From b1ee4fada0a9af70993e2c12fafbfe2a629e3e8a Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 31 Oct 2023 14:42:44 +1100 Subject: [PATCH 01/45] Add WP-GraphQL to Block Data API, import it on plugin startup and make a blank graphQL class --- lib/wp-graphql-1.17.0/.codeclimate.yml | 5 + lib/wp-graphql-1.17.0/.nvmrc | 1 + lib/wp-graphql-1.17.0/.prettierignore | 3 + lib/wp-graphql-1.17.0/.prettierrc.json | 1 + lib/wp-graphql-1.17.0/.remarkrc | 21 + lib/wp-graphql-1.17.0/LICENSE | 674 +++++ lib/wp-graphql-1.17.0/access-functions.php | 920 +++++++ lib/wp-graphql-1.17.0/activation.php | 17 + lib/wp-graphql-1.17.0/babel.config.js | 8 + lib/wp-graphql-1.17.0/build/app.asset.php | 1 + lib/wp-graphql-1.17.0/build/app.css | 1800 +++++++++++++ lib/wp-graphql-1.17.0/build/app.js | 38 + .../build/graphiqlAuthSwitch.asset.php | 1 + .../build/graphiqlAuthSwitch.js | 5 + .../build/graphiqlFullscreenToggle.asset.php | 1 + .../build/graphiqlFullscreenToggle.css | 1 + .../build/graphiqlFullscreenToggle.js | 1 + .../build/graphiqlQueryComposer.asset.php | 1 + .../build/graphiqlQueryComposer.css | 1 + .../build/graphiqlQueryComposer.js | 14 + lib/wp-graphql-1.17.0/build/index.asset.php | 1 + lib/wp-graphql-1.17.0/build/index.js | 1 + lib/wp-graphql-1.17.0/build/style-app.css | 1 + lib/wp-graphql-1.17.0/cli/wp-cli.php | 64 + lib/wp-graphql-1.17.0/constants.php | 38 + lib/wp-graphql-1.17.0/deactivation.php | 60 + lib/wp-graphql-1.17.0/phpcs.xml.dist | 165 ++ lib/wp-graphql-1.17.0/readme.txt | 1557 +++++++++++ lib/wp-graphql-1.17.0/src/Admin/Admin.php | 70 + .../src/Admin/GraphiQL/GraphiQL.php | 249 ++ .../src/Admin/Settings/Settings.php | 281 ++ .../src/Admin/Settings/SettingsRegistry.php | 789 ++++++ lib/wp-graphql-1.17.0/src/AppContext.php | 212 ++ .../src/Connection/Comments.php | 38 + .../src/Connection/MenuItems.php | 28 + .../src/Connection/PostObjects.php | 38 + .../src/Connection/Taxonomies.php | 18 + .../src/Connection/TermObjects.php | 38 + .../src/Connection/Users.php | 28 + .../src/Data/CommentMutation.php | 161 ++ lib/wp-graphql-1.17.0/src/Data/Config.php | 477 ++++ .../Connection/AbstractConnectionResolver.php | 1030 ++++++++ .../Connection/CommentConnectionResolver.php | 338 +++ .../ContentTypeConnectionResolver.php | 90 + .../EnqueuedScriptsConnectionResolver.php | 120 + .../EnqueuedStylesheetConnectionResolver.php | 128 + .../Connection/MenuConnectionResolver.php | 50 + .../Connection/MenuItemConnectionResolver.php | 125 + .../Connection/PluginConnectionResolver.php | 261 ++ .../PostObjectConnectionResolver.php | 622 +++++ .../Connection/TaxonomyConnectionResolver.php | 90 + .../TermObjectConnectionResolver.php | 324 +++ .../Connection/ThemeConnectionResolver.php | 88 + .../Connection/UserConnectionResolver.php | 299 +++ .../Connection/UserRoleConnectionResolver.php | 97 + .../src/Data/Cursor/AbstractCursor.php | 329 +++ .../src/Data/Cursor/CommentObjectCursor.php | 148 ++ .../src/Data/Cursor/CursorBuilder.php | 176 ++ .../src/Data/Cursor/PostObjectCursor.php | 293 +++ .../src/Data/Cursor/TermObjectCursor.php | 227 ++ .../src/Data/Cursor/UserCursor.php | 255 ++ lib/wp-graphql-1.17.0/src/Data/DataSource.php | 727 +++++ .../src/Data/Loader/AbstractDataLoader.php | 509 ++++ .../src/Data/Loader/CommentAuthorLoader.php | 58 + .../src/Data/Loader/CommentLoader.php | 75 + .../src/Data/Loader/EnqueuedScriptLoader.php | 35 + .../Data/Loader/EnqueuedStylesheetLoader.php | 33 + .../src/Data/Loader/PluginLoader.php | 60 + .../src/Data/Loader/PostObjectLoader.php | 136 + .../src/Data/Loader/PostTypeLoader.php | 46 + .../src/Data/Loader/TaxonomyLoader.php | 46 + .../src/Data/Loader/TermObjectLoader.php | 106 + .../src/Data/Loader/ThemeLoader.php | 52 + .../src/Data/Loader/UserLoader.php | 179 ++ .../src/Data/Loader/UserRoleLoader.php | 52 + .../src/Data/MediaItemMutation.php | 144 + .../src/Data/NodeResolver.php | 622 +++++ .../src/Data/PostObjectMutation.php | 496 ++++ .../src/Data/TermObjectMutation.php | 87 + .../src/Data/UserMutation.php | 314 +++ lib/wp-graphql-1.17.0/src/Model/Avatar.php | 83 + lib/wp-graphql-1.17.0/src/Model/Comment.php | 194 ++ .../src/Model/CommentAuthor.php | 66 + lib/wp-graphql-1.17.0/src/Model/Menu.php | 114 + lib/wp-graphql-1.17.0/src/Model/MenuItem.php | 206 ++ lib/wp-graphql-1.17.0/src/Model/Model.php | 552 ++++ lib/wp-graphql-1.17.0/src/Model/Plugin.php | 96 + lib/wp-graphql-1.17.0/src/Model/Post.php | 852 ++++++ lib/wp-graphql-1.17.0/src/Model/PostType.php | 218 ++ lib/wp-graphql-1.17.0/src/Model/Taxonomy.php | 160 ++ lib/wp-graphql-1.17.0/src/Model/Term.php | 211 ++ lib/wp-graphql-1.17.0/src/Model/Theme.php | 110 + lib/wp-graphql-1.17.0/src/Model/User.php | 271 ++ lib/wp-graphql-1.17.0/src/Model/UserRole.php | 86 + .../src/Mutation/CommentCreate.php | 203 ++ .../src/Mutation/CommentDelete.php | 136 + .../src/Mutation/CommentRestore.php | 106 + .../src/Mutation/CommentUpdate.php | 144 + .../src/Mutation/MediaItemCreate.php | 328 +++ .../src/Mutation/MediaItemDelete.php | 146 ++ .../src/Mutation/MediaItemUpdate.php | 171 ++ .../src/Mutation/PostObjectCreate.php | 379 +++ .../src/Mutation/PostObjectDelete.php | 167 ++ .../src/Mutation/PostObjectUpdate.php | 222 ++ .../src/Mutation/ResetUserPassword.php | 114 + .../src/Mutation/SendPasswordResetEmail.php | 258 ++ .../src/Mutation/TermObjectCreate.php | 197 ++ .../src/Mutation/TermObjectDelete.php | 153 ++ .../src/Mutation/TermObjectUpdate.php | 182 ++ .../src/Mutation/UpdateSettings.php | 221 ++ .../src/Mutation/UserCreate.php | 187 ++ .../src/Mutation/UserDelete.php | 168 ++ .../src/Mutation/UserRegister.php | 171 ++ .../src/Mutation/UserUpdate.php | 129 + .../src/Registry/SchemaRegistry.php | 59 + .../src/Registry/TypeRegistry.php | 1363 ++++++++++ .../src/Registry/Utils/PostObject.php | 589 +++++ .../src/Registry/Utils/TermObject.php | 339 +++ lib/wp-graphql-1.17.0/src/Request.php | 798 ++++++ lib/wp-graphql-1.17.0/src/Router.php | 564 ++++ .../ValidationRules/DisableIntrospection.php | 24 + .../src/Server/ValidationRules/QueryDepth.php | 173 ++ .../ValidationRules/RequireAuthentication.php | 106 + lib/wp-graphql-1.17.0/src/Server/WPHelper.php | 99 + .../src/Type/Connection/Comments.php | 263 ++ .../src/Type/Connection/MenuItems.php | 128 + .../src/Type/Connection/PostObjects.php | 599 +++++ .../src/Type/Connection/Taxonomies.php | 44 + .../src/Type/Connection/TermObjects.php | 220 ++ .../src/Type/Connection/Users.php | 207 ++ .../src/Type/Enum/AvatarRatingEnum.php | 37 + .../src/Type/Enum/CommentNodeIdTypeEnum.php | 36 + .../src/Type/Enum/CommentStatusEnum.php | 38 + .../Enum/CommentsConnectionOrderbyEnum.php | 85 + .../src/Type/Enum/ContentNodeIdTypeEnum.php | 81 + .../src/Type/Enum/ContentTypeEnum.php | 84 + .../src/Type/Enum/ContentTypeIdTypeEnum.php | 32 + .../src/Type/Enum/MediaItemSizeEnum.php | 51 + .../src/Type/Enum/MediaItemStatusEnum.php | 46 + .../src/Type/Enum/MenuItemNodeIdTypeEnum.php | 36 + .../src/Type/Enum/MenuLocationEnum.php | 47 + .../src/Type/Enum/MenuNodeIdTypeEnum.php | 51 + .../src/Type/Enum/MimeTypeEnum.php | 46 + .../src/Type/Enum/OrderEnum.php | 31 + .../src/Type/Enum/PluginStatusEnum.php | 75 + .../Type/Enum/PostObjectFieldFormatEnum.php | 32 + .../PostObjectsConnectionDateColumnEnum.php | 30 + .../Enum/PostObjectsConnectionOrderbyEnum.php | 62 + .../src/Type/Enum/PostStatusEnum.php | 54 + .../src/Type/Enum/RelationEnum.php | 32 + .../src/Type/Enum/TaxonomyEnum.php | 46 + .../src/Type/Enum/TaxonomyIdTypeEnum.php | 32 + .../src/Type/Enum/TermNodeIdTypeEnum.php | 74 + .../Enum/TermObjectsConnectionOrderbyEnum.php | 49 + .../src/Type/Enum/TimezoneEnum.php | 194 ++ .../src/Type/Enum/UserNodeIdTypeEnum.php | 60 + .../src/Type/Enum/UserRoleEnum.php | 40 + .../Type/Enum/UsersConnectionOrderbyEnum.php | 54 + .../Enum/UsersConnectionSearchColumnEnum.php | 42 + .../src/Type/Input/DateInput.php | 33 + .../src/Type/Input/DateQueryInput.php | 74 + .../PostObjectsConnectionOrderbyInput.php | 34 + .../Input/UsersConnectionOrderbyInput.php | 32 + .../src/Type/InterfaceType/Commenter.php | 74 + .../src/Type/InterfaceType/Connection.php | 38 + .../src/Type/InterfaceType/ContentNode.php | 174 ++ .../Type/InterfaceType/ContentTemplate.php | 86 + .../Type/InterfaceType/DatabaseIdentifier.php | 31 + .../src/Type/InterfaceType/Edge.php | 34 + .../src/Type/InterfaceType/EnqueuedAsset.php | 83 + .../InterfaceType/HierarchicalContentNode.php | 45 + .../Type/InterfaceType/HierarchicalNode.php | 44 + .../InterfaceType/HierarchicalTermNode.php | 45 + .../Type/InterfaceType/MenuItemLinkable.php | 47 + .../src/Type/InterfaceType/Node.php | 30 + .../src/Type/InterfaceType/NodeWithAuthor.php | 33 + .../Type/InterfaceType/NodeWithComments.php | 33 + .../InterfaceType/NodeWithContentEditor.php | 44 + .../Type/InterfaceType/NodeWithExcerpt.php | 45 + .../InterfaceType/NodeWithFeaturedImage.php | 55 + .../InterfaceType/NodeWithPageAttributes.php | 30 + .../Type/InterfaceType/NodeWithRevisions.php | 30 + .../Type/InterfaceType/NodeWithTemplate.php | 30 + .../src/Type/InterfaceType/NodeWithTitle.php | 45 + .../Type/InterfaceType/NodeWithTrackbacks.php | 38 + .../Type/InterfaceType/OneToOneConnection.php | 31 + .../src/Type/InterfaceType/PageInfo.php | 64 + .../src/Type/InterfaceType/Previewable.php | 51 + .../src/Type/InterfaceType/TermNode.php | 112 + .../UniformResourceIdentifiable.php | 76 + .../src/Type/ObjectType/Avatar.php | 69 + .../src/Type/ObjectType/Comment.php | 131 + .../src/Type/ObjectType/CommentAuthor.php | 104 + .../src/Type/ObjectType/ContentType.php | 136 + .../src/Type/ObjectType/EnqueuedScript.php | 50 + .../Type/ObjectType/EnqueuedStylesheet.php | 50 + .../src/Type/ObjectType/MediaDetails.php | 83 + .../src/Type/ObjectType/MediaItemMeta.php | 86 + .../src/Type/ObjectType/MediaSize.php | 77 + .../src/Type/ObjectType/Menu.php | 56 + .../src/Type/ObjectType/MenuItem.php | 198 ++ .../src/Type/ObjectType/Plugin.php | 66 + .../src/Type/ObjectType/PostObject.php | 48 + .../Type/ObjectType/PostTypeLabelDetails.php | 193 ++ .../src/Type/ObjectType/RootMutation.php | 35 + .../src/Type/ObjectType/RootQuery.php | 963 +++++++ .../src/Type/ObjectType/SettingGroup.php | 125 + .../src/Type/ObjectType/Settings.php | 128 + .../src/Type/ObjectType/Taxonomy.php | 130 + .../src/Type/ObjectType/TermObject.php | 29 + .../src/Type/ObjectType/Theme.php | 77 + .../src/Type/ObjectType/User.php | 207 ++ .../src/Type/ObjectType/UserRole.php | 47 + .../src/Type/Union/MenuItemObjectUnion.php | 93 + .../src/Type/Union/PostObjectUnion.php | 65 + .../src/Type/Union/TermObjectUnion.php | 66 + .../src/Type/WPConnectionType.php | 674 +++++ lib/wp-graphql-1.17.0/src/Type/WPEnumType.php | 100 + .../src/Type/WPInputObjectType.php | 115 + .../src/Type/WPInterfaceTrait.php | 106 + .../src/Type/WPInterfaceType.php | 174 ++ .../src/Type/WPMutationType.php | 355 +++ .../src/Type/WPObjectType.php | 226 ++ lib/wp-graphql-1.17.0/src/Type/WPScalar.php | 27 + .../src/Type/WPUnionType.php | 107 + lib/wp-graphql-1.17.0/src/Types.php | 40 + lib/wp-graphql-1.17.0/src/Utils/DebugLog.php | 131 + .../src/Utils/InstrumentSchema.php | 273 ++ lib/wp-graphql-1.17.0/src/Utils/Preview.php | 58 + .../src/Utils/QueryAnalyzer.php | 800 ++++++ lib/wp-graphql-1.17.0/src/Utils/QueryLog.php | 171 ++ lib/wp-graphql-1.17.0/src/Utils/Tracing.php | 360 +++ lib/wp-graphql-1.17.0/src/Utils/Utils.php | 367 +++ lib/wp-graphql-1.17.0/src/WPGraphQL.php | 823 ++++++ lib/wp-graphql-1.17.0/src/WPSchema.php | 54 + .../vendor/appsero/client/readme.md | 266 ++ .../vendor/appsero/client/src/Client.php | 280 ++ .../vendor/appsero/client/src/Insights.php | 1184 +++++++++ .../vendor/appsero/client/src/License.php | 809 ++++++ .../vendor/appsero/client/src/Updater.php | 258 ++ lib/wp-graphql-1.17.0/vendor/autoload.php | 25 + .../vendor/composer/ClassLoader.php | 579 ++++ .../vendor/composer/InstalledVersions.php | 359 +++ lib/wp-graphql-1.17.0/vendor/composer/LICENSE | 21 + .../vendor/composer/autoload_classmap.php | 420 +++ .../vendor/composer/autoload_namespaces.php | 9 + .../vendor/composer/autoload_psr4.php | 12 + .../vendor/composer/autoload_real.php | 38 + .../vendor/composer/autoload_static.php | 462 ++++ .../vendor/composer/installed.json | 171 ++ .../vendor/composer/installed.php | 50 + .../vendor/composer/platform_check.php | 26 + .../ivome/graphql-relay-php/.travis.yml | 19 + .../vendor/ivome/graphql-relay-php/LICENSE | 29 + .../ivome/graphql-relay-php/contributors.txt | 1 + .../ivome/graphql-relay-php/phpunit.xml | 12 + .../src/Connection/ArrayConnection.php | 178 ++ .../src/Connection/Connection.php | 195 ++ .../src/Mutation/Mutation.php | 120 + .../ivome/graphql-relay-php/src/Node/Node.php | 117 + .../graphql-relay-php/src/Node/Plural.php | 69 + .../ivome/graphql-relay-php/src/Relay.php | 219 ++ .../tests/Connection/ArrayConnectionTest.php | 991 +++++++ .../tests/Connection/ConnectionTest.php | 278 ++ .../Connection/SeparateConnectionTest.php | 284 ++ .../tests/Mutation/MutationTest.php | 565 ++++ .../graphql-relay-php/tests/Node/NodeTest.php | 411 +++ .../tests/Node/PluralTest.php | 186 ++ .../graphql-relay-php/tests/RelayTest.php | 73 + .../tests/StarWarsConnectionTest.php | 291 ++ .../graphql-relay-php/tests/StarWarsData.php | 139 + .../tests/StarWarsMutationTest.php | 60 + .../StarWarsObjectIdentificationTest.php | 131 + .../tests/StarWarsSchema.php | 379 +++ .../webonyx/graphql-php/.github/FUNDING.yml | 2 + .../.github/workflows/validate.yml | 69 + .../vendor/webonyx/graphql-php/LICENSE | 21 + .../vendor/webonyx/graphql-php/UPGRADE.md | 731 ++++++ .../graphql-php/docs/best-practices.md | 9 + .../graphql-php/docs/complementary-tools.md | 28 + .../webonyx/graphql-php/docs/concepts.md | 139 + .../webonyx/graphql-php/docs/data-fetching.md | 274 ++ .../graphql-php/docs/error-handling.md | 199 ++ .../graphql-php/docs/executing-queries.md | 208 ++ .../graphql-php/docs/getting-started.md | 125 + .../webonyx/graphql-php/docs/how-it-works.md | 35 + .../vendor/webonyx/graphql-php/docs/index.md | 55 + .../webonyx/graphql-php/docs/reference.md | 2332 +++++++++++++++++ .../webonyx/graphql-php/docs/security.md | 94 + .../docs/type-system/directives.md | 61 + .../docs/type-system/enum-types.md | 182 ++ .../graphql-php/docs/type-system/index.md | 127 + .../docs/type-system/input-types.md | 172 ++ .../docs/type-system/interfaces.md | 174 ++ .../docs/type-system/lists-and-nonnulls.md | 62 + .../docs/type-system/object-types.md | 210 ++ .../docs/type-system/scalar-types.md | 130 + .../graphql-php/docs/type-system/schema.md | 194 ++ .../docs/type-system/type-language.md | 91 + .../graphql-php/docs/type-system/unions.md | 39 + .../webonyx/graphql-php/phpstan-baseline.neon | 647 +++++ .../webonyx/graphql-php/src/Deferred.php | 26 + .../graphql-php/src/Error/ClientAware.php | 36 + .../graphql-php/src/Error/DebugFlag.php | 17 + .../webonyx/graphql-php/src/Error/Error.php | 384 +++ .../graphql-php/src/Error/FormattedError.php | 418 +++ .../src/Error/InvariantViolation.php | 20 + .../graphql-php/src/Error/SyntaxError.php | 25 + .../graphql-php/src/Error/UserError.php | 29 + .../webonyx/graphql-php/src/Error/Warning.php | 121 + .../src/Exception/InvalidArgument.php | 20 + .../src/Executor/ExecutionContext.php | 78 + .../src/Executor/ExecutionResult.php | 166 ++ .../graphql-php/src/Executor/Executor.php | 190 ++ .../src/Executor/ExecutorImplementation.php | 15 + .../Promise/Adapter/AmpPromiseAdapter.php | 147 ++ .../Promise/Adapter/ReactPromiseAdapter.php | 100 + .../Executor/Promise/Adapter/SyncPromise.php | 202 ++ .../Promise/Adapter/SyncPromiseAdapter.php | 180 ++ .../src/Executor/Promise/Promise.php | 40 + .../src/Executor/Promise/PromiseAdapter.php | 92 + .../src/Executor/ReferenceExecutor.php | 1305 +++++++++ .../graphql-php/src/Executor/Values.php | 334 +++ .../src/Experimental/Executor/Collector.php | 282 ++ .../Executor/CoroutineContext.php | 57 + .../Executor/CoroutineContextShared.php | 62 + .../Executor/CoroutineExecutor.php | 970 +++++++ .../src/Experimental/Executor/Runtime.php | 26 + .../src/Experimental/Executor/Strand.php | 35 + .../webonyx/graphql-php/src/GraphQL.php | 365 +++ .../src/Language/AST/ArgumentNode.php | 17 + .../src/Language/AST/BooleanValueNode.php | 14 + .../src/Language/AST/DefinitionNode.php | 14 + .../Language/AST/DirectiveDefinitionNode.php | 26 + .../src/Language/AST/DirectiveNode.php | 17 + .../src/Language/AST/DocumentNode.php | 15 + .../Language/AST/EnumTypeDefinitionNode.php | 23 + .../Language/AST/EnumTypeExtensionNode.php | 20 + .../Language/AST/EnumValueDefinitionNode.php | 20 + .../src/Language/AST/EnumValueNode.php | 14 + .../Language/AST/ExecutableDefinitionNode.php | 14 + .../src/Language/AST/FieldDefinitionNode.php | 26 + .../src/Language/AST/FieldNode.php | 26 + .../src/Language/AST/FloatValueNode.php | 14 + .../Language/AST/FragmentDefinitionNode.php | 31 + .../src/Language/AST/FragmentSpreadNode.php | 17 + .../src/Language/AST/HasSelectionSet.php | 15 + .../src/Language/AST/InlineFragmentNode.php | 20 + .../AST/InputObjectTypeDefinitionNode.php | 23 + .../AST/InputObjectTypeExtensionNode.php | 20 + .../Language/AST/InputValueDefinitionNode.php | 26 + .../src/Language/AST/IntValueNode.php | 14 + .../AST/InterfaceTypeDefinitionNode.php | 26 + .../AST/InterfaceTypeExtensionNode.php | 23 + .../src/Language/AST/ListTypeNode.php | 14 + .../src/Language/AST/ListValueNode.php | 14 + .../graphql-php/src/Language/AST/Location.php | 79 + .../graphql-php/src/Language/AST/NameNode.php | 14 + .../src/Language/AST/NamedTypeNode.php | 14 + .../graphql-php/src/Language/AST/Node.php | 161 ++ .../graphql-php/src/Language/AST/NodeKind.php | 138 + .../graphql-php/src/Language/AST/NodeList.php | 154 ++ .../src/Language/AST/NonNullTypeNode.php | 14 + .../src/Language/AST/NullValueNode.php | 11 + .../src/Language/AST/ObjectFieldNode.php | 17 + .../Language/AST/ObjectTypeDefinitionNode.php | 26 + .../Language/AST/ObjectTypeExtensionNode.php | 23 + .../src/Language/AST/ObjectValueNode.php | 14 + .../Language/AST/OperationDefinitionNode.php | 27 + .../AST/OperationTypeDefinitionNode.php | 21 + .../Language/AST/ScalarTypeDefinitionNode.php | 20 + .../Language/AST/ScalarTypeExtensionNode.php | 17 + .../src/Language/AST/SchemaDefinitionNode.php | 17 + .../Language/AST/SchemaTypeExtensionNode.php | 17 + .../src/Language/AST/SelectionNode.php | 12 + .../src/Language/AST/SelectionSetNode.php | 14 + .../src/Language/AST/StringValueNode.php | 17 + .../src/Language/AST/TypeDefinitionNode.php | 17 + .../src/Language/AST/TypeExtensionNode.php | 18 + .../graphql-php/src/Language/AST/TypeNode.php | 14 + .../Language/AST/TypeSystemDefinitionNode.php | 18 + .../Language/AST/UnionTypeDefinitionNode.php | 23 + .../Language/AST/UnionTypeExtensionNode.php | 20 + .../src/Language/AST/ValueNode.php | 20 + .../Language/AST/VariableDefinitionNode.php | 23 + .../src/Language/AST/VariableNode.php | 14 + .../src/Language/DirectiveLocation.php | 61 + .../graphql-php/src/Language/Lexer.php | 826 ++++++ .../graphql-php/src/Language/Parser.php | 1780 +++++++++++++ .../graphql-php/src/Language/Printer.php | 539 ++++ .../graphql-php/src/Language/Source.php | 85 + .../src/Language/SourceLocation.php | 55 + .../graphql-php/src/Language/Token.php | 119 + .../graphql-php/src/Language/Visitor.php | 538 ++++ .../src/Language/VisitorOperation.php | 17 + .../webonyx/graphql-php/src/Server/Helper.php | 629 +++++ .../src/Server/OperationParams.php | 144 + .../graphql-php/src/Server/RequestError.php | 33 + .../graphql-php/src/Server/ServerConfig.php | 330 +++ .../graphql-php/src/Server/StandardServer.php | 186 ++ .../src/Type/Definition/AbstractType.php | 23 + .../src/Type/Definition/BooleanType.php | 65 + .../src/Type/Definition/CompositeType.php | 16 + .../src/Type/Definition/CustomScalarType.php | 76 + .../src/Type/Definition/Directive.php | 185 ++ .../src/Type/Definition/EnumType.php | 229 ++ .../Type/Definition/EnumValueDefinition.php | 50 + .../src/Type/Definition/FieldArgument.php | 135 + .../src/Type/Definition/FieldDefinition.php | 331 +++ .../src/Type/Definition/FloatType.php | 89 + .../src/Type/Definition/HasFieldsType.php | 33 + .../src/Type/Definition/IDType.php | 80 + .../src/Type/Definition/ImplementingType.php | 20 + .../src/Type/Definition/InputObjectField.php | 171 ++ .../src/Type/Definition/InputObjectType.php | 121 + .../src/Type/Definition/InputType.php | 22 + .../src/Type/Definition/IntType.php | 118 + .../src/Type/Definition/InterfaceType.php | 154 ++ .../src/Type/Definition/LeafType.php | 61 + .../src/Type/Definition/ListOfType.php | 41 + .../src/Type/Definition/NamedType.php | 18 + .../src/Type/Definition/NonNull.php | 44 + .../src/Type/Definition/NullableType.php | 20 + .../src/Type/Definition/ObjectType.php | 206 ++ .../src/Type/Definition/OutputType.php | 19 + .../src/Type/Definition/QueryPlan.php | 296 +++ .../src/Type/Definition/ResolveInfo.php | 255 ++ .../src/Type/Definition/ScalarType.php | 51 + .../src/Type/Definition/StringType.php | 84 + .../graphql-php/src/Type/Definition/Type.php | 355 +++ .../src/Type/Definition/TypeWithFields.php | 81 + .../src/Type/Definition/UnionType.php | 150 ++ .../src/Type/Definition/UnmodifiedType.php | 19 + .../Definition/UnresolvedFieldDefinition.php | 71 + .../src/Type/Definition/WrappingType.php | 10 + .../graphql-php/src/Type/Introspection.php | 845 ++++++ .../webonyx/graphql-php/src/Type/Schema.php | 603 +++++ .../graphql-php/src/Type/SchemaConfig.php | 313 +++ .../src/Type/SchemaValidationContext.php | 1084 ++++++++ .../webonyx/graphql-php/src/Type/TypeKind.php | 17 + .../Validation/InputObjectCircularRefs.php | 105 + .../webonyx/graphql-php/src/Utils/AST.php | 641 +++++ .../src/Utils/ASTDefinitionBuilder.php | 493 ++++ .../graphql-php/src/Utils/BlockString.php | 77 + .../src/Utils/BreakingChangesFinder.php | 938 +++++++ .../src/Utils/BuildClientSchema.php | 496 ++++ .../graphql-php/src/Utils/BuildSchema.php | 237 ++ .../src/Utils/InterfaceImplementations.php | 48 + .../graphql-php/src/Utils/MixedStore.php | 247 ++ .../webonyx/graphql-php/src/Utils/PairSet.php | 66 + .../graphql-php/src/Utils/SchemaExtender.php | 650 +++++ .../graphql-php/src/Utils/SchemaPrinter.php | 508 ++++ .../graphql-php/src/Utils/TypeComparators.php | 138 + .../graphql-php/src/Utils/TypeInfo.php | 504 ++++ .../webonyx/graphql-php/src/Utils/Utils.php | 658 +++++ .../webonyx/graphql-php/src/Utils/Value.php | 311 +++ .../src/Validator/ASTValidationContext.php | 54 + .../src/Validator/DocumentValidator.php | 361 +++ .../Validator/Rules/CustomValidationRule.php | 30 + .../Validator/Rules/DisableIntrospection.php | 57 + .../Validator/Rules/ExecutableDefinitions.php | 50 + .../Validator/Rules/FieldsOnCorrectType.php | 166 ++ .../Rules/FragmentsOnCompositeTypes.php | 64 + .../Validator/Rules/KnownArgumentNames.php | 80 + .../Rules/KnownArgumentNamesOnDirectives.php | 115 + .../src/Validator/Rules/KnownDirectives.php | 200 ++ .../Validator/Rules/KnownFragmentNames.php | 40 + .../src/Validator/Rules/KnownTypeNames.php | 74 + .../Rules/LoneAnonymousOperation.php | 58 + .../Validator/Rules/LoneSchemaDefinition.php | 59 + .../src/Validator/Rules/NoFragmentCycles.php | 112 + .../Validator/Rules/NoUndefinedVariables.php | 64 + .../src/Validator/Rules/NoUnusedFragments.php | 70 + .../src/Validator/Rules/NoUnusedVariables.php | 66 + .../Rules/OverlappingFieldsCanBeMerged.php | 897 +++++++ .../Rules/PossibleFragmentSpreads.php | 160 ++ .../Rules/ProvidedRequiredArguments.php | 62 + .../ProvidedRequiredArgumentsOnDirectives.php | 128 + .../src/Validator/Rules/QueryComplexity.php | 300 +++ .../src/Validator/Rules/QueryDepth.php | 118 + .../src/Validator/Rules/QuerySecurityRule.php | 184 ++ .../src/Validator/Rules/ScalarLeafs.php | 51 + .../Rules/SingleFieldSubscription.php | 57 + .../Validator/Rules/UniqueArgumentNames.php | 64 + .../Rules/UniqueDirectivesPerLocation.php | 96 + .../Validator/Rules/UniqueFragmentNames.php | 49 + .../Validator/Rules/UniqueInputFieldNames.php | 73 + .../Validator/Rules/UniqueOperationNames.php | 52 + .../Validator/Rules/UniqueVariableNames.php | 45 + .../src/Validator/Rules/ValidationRule.php | 51 + .../Validator/Rules/ValuesOfCorrectType.php | 290 ++ .../Rules/VariablesAreInputTypes.php | 42 + .../Rules/VariablesInAllowedPosition.php | 116 + .../src/Validator/SDLValidationContext.php | 9 + .../src/Validator/ValidationContext.php | 271 ++ lib/wp-graphql-1.17.0/webpack.config.js | 32 + lib/wp-graphql-1.17.0/wp-graphql.php | 190 ++ src/graphql/graphql-api.php | 33 + vip-block-data-api.php | 3 + 499 files changed, 87220 insertions(+) create mode 100644 lib/wp-graphql-1.17.0/.codeclimate.yml create mode 100644 lib/wp-graphql-1.17.0/.nvmrc create mode 100644 lib/wp-graphql-1.17.0/.prettierignore create mode 100644 lib/wp-graphql-1.17.0/.prettierrc.json create mode 100644 lib/wp-graphql-1.17.0/.remarkrc create mode 100644 lib/wp-graphql-1.17.0/LICENSE create mode 100644 lib/wp-graphql-1.17.0/access-functions.php create mode 100644 lib/wp-graphql-1.17.0/activation.php create mode 100644 lib/wp-graphql-1.17.0/babel.config.js create mode 100644 lib/wp-graphql-1.17.0/build/app.asset.php create mode 100644 lib/wp-graphql-1.17.0/build/app.css create mode 100644 lib/wp-graphql-1.17.0/build/app.js create mode 100644 lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.asset.php create mode 100644 lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.js create mode 100644 lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.asset.php create mode 100644 lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.css create mode 100644 lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.js create mode 100644 lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.asset.php create mode 100644 lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.css create mode 100644 lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.js create mode 100644 lib/wp-graphql-1.17.0/build/index.asset.php create mode 100644 lib/wp-graphql-1.17.0/build/index.js create mode 100644 lib/wp-graphql-1.17.0/build/style-app.css create mode 100644 lib/wp-graphql-1.17.0/cli/wp-cli.php create mode 100644 lib/wp-graphql-1.17.0/constants.php create mode 100644 lib/wp-graphql-1.17.0/deactivation.php create mode 100644 lib/wp-graphql-1.17.0/phpcs.xml.dist create mode 100644 lib/wp-graphql-1.17.0/readme.txt create mode 100644 lib/wp-graphql-1.17.0/src/Admin/Admin.php create mode 100644 lib/wp-graphql-1.17.0/src/Admin/GraphiQL/GraphiQL.php create mode 100644 lib/wp-graphql-1.17.0/src/Admin/Settings/Settings.php create mode 100644 lib/wp-graphql-1.17.0/src/Admin/Settings/SettingsRegistry.php create mode 100644 lib/wp-graphql-1.17.0/src/AppContext.php create mode 100644 lib/wp-graphql-1.17.0/src/Connection/Comments.php create mode 100644 lib/wp-graphql-1.17.0/src/Connection/MenuItems.php create mode 100644 lib/wp-graphql-1.17.0/src/Connection/PostObjects.php create mode 100644 lib/wp-graphql-1.17.0/src/Connection/Taxonomies.php create mode 100644 lib/wp-graphql-1.17.0/src/Connection/TermObjects.php create mode 100644 lib/wp-graphql-1.17.0/src/Connection/Users.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/CommentMutation.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Config.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/AbstractConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/CommentConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/ContentTypeConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedScriptsConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/MenuConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/MenuItemConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/PluginConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/PostObjectConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/TaxonomyConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/TermObjectConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/ThemeConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/UserConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/UserRoleConnectionResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/AbstractCursor.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/CommentObjectCursor.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/CursorBuilder.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/PostObjectCursor.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/TermObjectCursor.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/UserCursor.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/DataSource.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/AbstractDataLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/CommentAuthorLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/CommentLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedScriptLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedStylesheetLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/PluginLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/PostObjectLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/PostTypeLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/TaxonomyLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/TermObjectLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/ThemeLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/UserLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/UserRoleLoader.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/MediaItemMutation.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/NodeResolver.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/PostObjectMutation.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/TermObjectMutation.php create mode 100644 lib/wp-graphql-1.17.0/src/Data/UserMutation.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/Avatar.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/Comment.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/CommentAuthor.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/Menu.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/MenuItem.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/Model.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/Plugin.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/Post.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/PostType.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/Taxonomy.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/Term.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/Theme.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/User.php create mode 100644 lib/wp-graphql-1.17.0/src/Model/UserRole.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/CommentCreate.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/CommentDelete.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/CommentRestore.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/CommentUpdate.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/MediaItemCreate.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/MediaItemDelete.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/MediaItemUpdate.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/PostObjectCreate.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/PostObjectDelete.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/PostObjectUpdate.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/ResetUserPassword.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/SendPasswordResetEmail.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/TermObjectCreate.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/TermObjectDelete.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/TermObjectUpdate.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UpdateSettings.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UserCreate.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UserDelete.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UserRegister.php create mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UserUpdate.php create mode 100644 lib/wp-graphql-1.17.0/src/Registry/SchemaRegistry.php create mode 100644 lib/wp-graphql-1.17.0/src/Registry/TypeRegistry.php create mode 100644 lib/wp-graphql-1.17.0/src/Registry/Utils/PostObject.php create mode 100644 lib/wp-graphql-1.17.0/src/Registry/Utils/TermObject.php create mode 100644 lib/wp-graphql-1.17.0/src/Request.php create mode 100644 lib/wp-graphql-1.17.0/src/Router.php create mode 100644 lib/wp-graphql-1.17.0/src/Server/ValidationRules/DisableIntrospection.php create mode 100644 lib/wp-graphql-1.17.0/src/Server/ValidationRules/QueryDepth.php create mode 100644 lib/wp-graphql-1.17.0/src/Server/ValidationRules/RequireAuthentication.php create mode 100644 lib/wp-graphql-1.17.0/src/Server/WPHelper.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/Comments.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/MenuItems.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/PostObjects.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/Taxonomies.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/TermObjects.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/Users.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/AvatarRatingEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/CommentNodeIdTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/CommentStatusEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/CommentsConnectionOrderbyEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/ContentNodeIdTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeIdTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemSizeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemStatusEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MenuItemNodeIdTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MenuLocationEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MenuNodeIdTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MimeTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/OrderEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PluginStatusEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectFieldFormatEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PostStatusEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/RelationEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyIdTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TermNodeIdTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TimezoneEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/UserNodeIdTypeEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/UserRoleEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionOrderbyEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionSearchColumnEnum.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Input/DateInput.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Input/DateQueryInput.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Input/PostObjectsConnectionOrderbyInput.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Input/UsersConnectionOrderbyInput.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Commenter.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Connection.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentNode.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentTemplate.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/DatabaseIdentifier.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Edge.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/EnqueuedAsset.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalContentNode.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalNode.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalTermNode.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/MenuItemLinkable.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Node.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithAuthor.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithComments.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithContentEditor.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithExcerpt.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithFeaturedImage.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithPageAttributes.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithRevisions.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTemplate.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTitle.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTrackbacks.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/OneToOneConnection.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/PageInfo.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Previewable.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/TermNode.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/UniformResourceIdentifiable.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Avatar.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Comment.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/CommentAuthor.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/ContentType.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedScript.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedStylesheet.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaDetails.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaItemMeta.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaSize.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Menu.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/MenuItem.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Plugin.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/PostObject.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/PostTypeLabelDetails.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/RootMutation.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/RootQuery.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/SettingGroup.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Settings.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Taxonomy.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/TermObject.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Theme.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/User.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/UserRole.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Union/MenuItemObjectUnion.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Union/PostObjectUnion.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/Union/TermObjectUnion.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/WPConnectionType.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/WPEnumType.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/WPInputObjectType.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/WPInterfaceTrait.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/WPInterfaceType.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/WPMutationType.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/WPObjectType.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/WPScalar.php create mode 100644 lib/wp-graphql-1.17.0/src/Type/WPUnionType.php create mode 100644 lib/wp-graphql-1.17.0/src/Types.php create mode 100644 lib/wp-graphql-1.17.0/src/Utils/DebugLog.php create mode 100644 lib/wp-graphql-1.17.0/src/Utils/InstrumentSchema.php create mode 100644 lib/wp-graphql-1.17.0/src/Utils/Preview.php create mode 100644 lib/wp-graphql-1.17.0/src/Utils/QueryAnalyzer.php create mode 100644 lib/wp-graphql-1.17.0/src/Utils/QueryLog.php create mode 100644 lib/wp-graphql-1.17.0/src/Utils/Tracing.php create mode 100644 lib/wp-graphql-1.17.0/src/Utils/Utils.php create mode 100644 lib/wp-graphql-1.17.0/src/WPGraphQL.php create mode 100644 lib/wp-graphql-1.17.0/src/WPSchema.php create mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/readme.md create mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/src/Client.php create mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/src/Insights.php create mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/src/License.php create mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/src/Updater.php create mode 100644 lib/wp-graphql-1.17.0/vendor/autoload.php create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/ClassLoader.php create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/InstalledVersions.php create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/LICENSE create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_classmap.php create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_namespaces.php create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_psr4.php create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_real.php create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_static.php create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/installed.json create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/installed.php create mode 100644 lib/wp-graphql-1.17.0/vendor/composer/platform_check.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/.travis.yml create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/LICENSE create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/contributors.txt create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/phpunit.xml create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/ArrayConnection.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/Connection.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Mutation/Mutation.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Node.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Plural.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Relay.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ArrayConnectionTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ConnectionTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/SeparateConnectionTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Mutation/MutationTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/NodeTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/PluralTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/RelayTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsConnectionTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsData.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsMutationTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsObjectIdentificationTest.php create mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsSchema.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/FUNDING.yml create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/workflows/validate.yml create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/LICENSE create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/UPGRADE.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/best-practices.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/complementary-tools.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/concepts.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/data-fetching.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/error-handling.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/executing-queries.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/getting-started.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/how-it-works.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/index.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/reference.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/security.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/directives.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/enum-types.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/index.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/input-types.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/interfaces.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/lists-and-nonnulls.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/object-types.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/scalar-types.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/schema.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/type-language.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/unions.md create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/phpstan-baseline.neon create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Deferred.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/ClientAware.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/DebugFlag.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/Error.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/FormattedError.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/InvariantViolation.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/SyntaxError.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/UserError.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/Warning.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Exception/InvalidArgument.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionContext.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Executor.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutorImplementation.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/AmpPromiseAdapter.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Promise.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Values.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Collector.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Runtime.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Strand.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/GraphQL.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/BooleanValueNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DocumentNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ExecutableDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FloatValueNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InlineFragmentNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListTypeNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListValueNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Location.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NameNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NamedTypeNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Node.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeKind.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeList.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NullValueNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectFieldNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionSetNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/StringValueNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/TypeDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/TypeExtensionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/TypeNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/TypeSystemDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ValueNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableDefinitionNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableNode.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/DirectiveLocation.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Lexer.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Parser.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Printer.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Source.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/SourceLocation.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Token.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Visitor.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/VisitorOperation.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/Helper.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/OperationParams.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/RequestError.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/ServerConfig.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/StandardServer.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/AbstractType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/BooleanType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CustomScalarType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Directive.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldArgument.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ImplementingType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectField.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IntType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InterfaceType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/LeafType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ListOfType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NamedType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NonNull.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NullableType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ObjectType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/QueryPlan.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ScalarType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Type.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnionType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnresolvedFieldDefinition.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/WrappingType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Introspection.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Schema.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaConfig.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaValidationContext.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/TypeKind.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Validation/InputObjectCircularRefs.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/AST.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BlockString.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildClientSchema.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildSchema.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/InterfaceImplementations.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/MixedStore.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/PairSet.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaExtender.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaPrinter.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeComparators.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Utils.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Value.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ASTValidationContext.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/SDLValidationContext.php create mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ValidationContext.php create mode 100644 lib/wp-graphql-1.17.0/webpack.config.js create mode 100644 lib/wp-graphql-1.17.0/wp-graphql.php create mode 100644 src/graphql/graphql-api.php diff --git a/lib/wp-graphql-1.17.0/.codeclimate.yml b/lib/wp-graphql-1.17.0/.codeclimate.yml new file mode 100644 index 00000000..fc0f42bf --- /dev/null +++ b/lib/wp-graphql-1.17.0/.codeclimate.yml @@ -0,0 +1,5 @@ +version: "2" +checks: + method-lines: + config: + threshold: 40 diff --git a/lib/wp-graphql-1.17.0/.nvmrc b/lib/wp-graphql-1.17.0/.nvmrc new file mode 100644 index 00000000..7b16f790 --- /dev/null +++ b/lib/wp-graphql-1.17.0/.nvmrc @@ -0,0 +1 @@ +v14.19.0 diff --git a/lib/wp-graphql-1.17.0/.prettierignore b/lib/wp-graphql-1.17.0/.prettierignore new file mode 100644 index 00000000..d9cd20ef --- /dev/null +++ b/lib/wp-graphql-1.17.0/.prettierignore @@ -0,0 +1,3 @@ +# Ignore artifacts: +build +node_modules diff --git a/lib/wp-graphql-1.17.0/.prettierrc.json b/lib/wp-graphql-1.17.0/.prettierrc.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/lib/wp-graphql-1.17.0/.prettierrc.json @@ -0,0 +1 @@ +{} diff --git a/lib/wp-graphql-1.17.0/.remarkrc b/lib/wp-graphql-1.17.0/.remarkrc new file mode 100644 index 00000000..1227c64b --- /dev/null +++ b/lib/wp-graphql-1.17.0/.remarkrc @@ -0,0 +1,21 @@ +{ + "settings": { + "bullet": "-", + "listItemIndent": "mixed", + "fences": true, + "incrementListMarker": false + }, + "plugins": [ + "remark-frontmatter", + "remark-preset-lint-consistent", + "remark-preset-lint-markdown-style-guide", + [ + "remark-lint-maximum-line-length", + false + ], + [ + "remark-lint-no-duplicate-headings", + false + ] + ] +} diff --git a/lib/wp-graphql-1.17.0/LICENSE b/lib/wp-graphql-1.17.0/LICENSE new file mode 100644 index 00000000..9cecc1d4 --- /dev/null +++ b/lib/wp-graphql-1.17.0/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/lib/wp-graphql-1.17.0/access-functions.php b/lib/wp-graphql-1.17.0/access-functions.php new file mode 100644 index 00000000..b591e8a2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/access-functions.php @@ -0,0 +1,920 @@ +execute(); +} + +/** + * Previous access function for running GraphQL queries directly. This function will + * eventually be deprecated in favor of `graphql`. + * + * @param string $query The GraphQL query to run + * @param string $operation_name The name of the operation + * @param array $variables Variables to be passed to your GraphQL request + * @param bool $return_request If true, return the Request object, else return the results of the request execution + * + * @return array|\WPGraphQL\Request + * @throws \Exception + * @since 0.0.2 + */ +function do_graphql_request( $query, $operation_name = '', $variables = [], $return_request = false ) { + return graphql( + [ + 'query' => $query, + 'variables' => $variables, + 'operation_name' => $operation_name, + ], + $return_request + ); +} + +/** + * Determine when to register types + * + * @return string + */ +function get_graphql_register_action() { + $action = 'graphql_register_types_late'; + if ( ! did_action( 'graphql_register_initial_types' ) ) { + $action = 'graphql_register_initial_types'; + } elseif ( ! did_action( 'graphql_register_types' ) ) { + $action = 'graphql_register_types'; + } + + return $action; +} + +/** + * Given a type name and interface name, this applies the interface to the Type. + * + * Should be used at the `graphql_register_types` hook. + * + * @param mixed|string|array $interface_names Array of one or more names of the GraphQL + * Interfaces to apply to the GraphQL Types + * @param mixed|string|array $type_names Array of one or more names of the GraphQL + * Types to apply the interfaces to + * + * example: + * The following would register the "MyNewInterface" interface to the Post and Page type in the + * Schema. + * + * register_graphql_interfaces_to_types( [ 'MyNewInterface' ], [ 'Post', 'Page' ] ); + * + * @return void + */ +function register_graphql_interfaces_to_types( $interface_names, $type_names ) { + if ( is_string( $type_names ) ) { + $type_names = [ $type_names ]; + } + + if ( is_string( $interface_names ) ) { + $interface_names = [ $interface_names ]; + } + + if ( ! empty( $type_names ) && is_array( $type_names ) && ! empty( $interface_names ) && is_array( $interface_names ) ) { + foreach ( $type_names as $type_name ) { + + // Filter the GraphQL Object Type Interface to apply the interface + add_filter( + 'graphql_type_interfaces', + static function ( $interfaces, $config ) use ( $type_name, $interface_names ) { + $interfaces = is_array( $interfaces ) ? $interfaces : []; + + if ( strtolower( $type_name ) === strtolower( $config['name'] ) ) { + $interfaces = array_unique( array_merge( $interfaces, $interface_names ) ); + } + + return $interfaces; + }, + 10, + 2 + ); + } + } +} + +/** + * Given a Type Name and a $config array, this adds a Type to the TypeRegistry + * + * @param string $type_name The name of the Type to register + * @param array $config The Type config + * + * @throws \Exception + * @return void + */ +function register_graphql_type( string $type_name, array $config ) { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $type_name, $config ) { + $type_registry->register_type( $type_name, $config ); + }, + 10 + ); +} + +/** + * Given a Type Name and a $config array, this adds an Interface Type to the TypeRegistry + * + * @param string $type_name The name of the Type to register + * @param mixed|array|\GraphQL\Type\Definition\Type $config The Type config + * + * @throws \Exception + * @return void + */ +function register_graphql_interface_type( string $type_name, $config ) { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $type_name, $config ) { + $type_registry->register_interface_type( $type_name, $config ); + }, + 10 + ); +} + +/** + * Given a Type Name and a $config array, this adds an ObjectType to the TypeRegistry + * + * @param string $type_name The name of the Type to register + * @param array $config The Type config + * + * @return void + */ +function register_graphql_object_type( string $type_name, array $config ) { + $config['kind'] = 'object'; + register_graphql_type( $type_name, $config ); +} + +/** + * Given a Type Name and a $config array, this adds an InputType to the TypeRegistry + * + * @param string $type_name The name of the Type to register + * @param array $config The Type config + * + * @return void + */ +function register_graphql_input_type( string $type_name, array $config ) { + $config['kind'] = 'input'; + register_graphql_type( $type_name, $config ); +} + +/** + * Given a Type Name and a $config array, this adds an UnionType to the TypeRegistry + * + * @param string $type_name The name of the Type to register + * @param array $config The Type config + * + * @throws \Exception + * + * @return void + */ +function register_graphql_union_type( string $type_name, array $config ) { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $type_name, $config ) { + $config['kind'] = 'union'; + $type_registry->register_type( $type_name, $config ); + }, + 10 + ); +} + +/** + * Given a Type Name and a $config array, this adds an EnumType to the TypeRegistry + * + * @param string $type_name The name of the Type to register + * @param array $config The Type config + * + * @return void + */ +function register_graphql_enum_type( string $type_name, array $config ) { + $config['kind'] = 'enum'; + register_graphql_type( $type_name, $config ); +} + +/** + * Given a Type Name, Field Name, and a $config array, this adds a Field to a registered Type in + * the TypeRegistry + * + * @param string $type_name The name of the Type to add the field to + * @param string $field_name The name of the Field to add to the Type + * @param array $config The Type config + * + * @return void + * @throws \Exception + * @since 0.1.0 + */ +function register_graphql_field( string $type_name, string $field_name, array $config ) { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $type_name, $field_name, $config ) { + $type_registry->register_field( $type_name, $field_name, $config ); + }, + 10 + ); +} + +/** + * Given a Type Name and an array of field configs, this adds the fields to the registered type in + * the TypeRegistry + * + * @param string $type_name The name of the Type to add the fields to + * @param array $fields An array of field configs + * + * @return void + * @throws \Exception + * @since 0.1.0 + */ +function register_graphql_fields( string $type_name, array $fields ) { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $type_name, $fields ) { + $type_registry->register_fields( $type_name, $fields ); + }, + 10 + ); +} + +/** + * Adds a field to the Connection Edge between the provided 'From' Type Name and 'To' Type Name. + * + * @param string $from_type The name of the Type the connection is coming from. + * @param string $to_type The name of the Type or Alias (the connection config's `FromFieldName`) the connection is going to. + * @param string $field_name The name of the field to add to the connection edge. + * @param array $config The field config. + * + * @since 1.13.0 + */ +function register_graphql_edge_field( string $from_type, string $to_type, string $field_name, array $config ): void { + $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'ConnectionEdge'; + + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $connection_name, $field_name, $config ) { + $type_registry->register_field( $connection_name, $field_name, $config ); + }, + 10 + ); +} + +/** + * Adds several fields to the Connection Edge between the provided 'From' Type Name and 'To' Type Name. + * + * @param string $from_type The name of the Type the connection is coming from. + * @param string $to_type The name of the Type or Alias (the connection config's `FromFieldName`) the connection is going to. + * @param array $fields An array of field configs. + * + * @since 1.13.0 + */ +function register_graphql_edge_fields( string $from_type, string $to_type, array $fields ): void { + $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'ConnectionEdge'; + + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $connection_name, $fields ) { + $type_registry->register_fields( $connection_name, $fields ); + }, + 10 + ); +} + +/** + * Adds an input field to the Connection Where Args between the provided 'From' Type Name and 'To' Type Name. + * + * @param string $from_type The name of the Type the connection is coming from. + * @param string $to_type The name of the Type or Alias (the connection config's `FromFieldName`) the connection is going to. + * @param string $field_name The name of the field to add to the connection edge. + * @param array $config The field config. + * + * @since 1.13.0 + */ +function register_graphql_connection_where_arg( string $from_type, string $to_type, string $field_name, array $config ): void { + $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'ConnectionWhereArgs'; + + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $connection_name, $field_name, $config ) { + $type_registry->register_field( $connection_name, $field_name, $config ); + }, + 10 + ); +} + +/** + * Adds several input fields to the Connection Where Args between the provided 'From' Type Name and 'To' Type Name. + * + * @param string $from_type The name of the Type the connection is coming from. + * @param string $to_type The name of the Type or Alias (the connection config's `FromFieldName`) the connection is going to. + * @param array $fields An array of field configs. + * + * @since 1.13.0 + */ +function register_graphql_connection_where_args( string $from_type, string $to_type, array $fields ): void { + $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'ConnectionWhereArgs'; + + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $connection_name, $fields ) { + $type_registry->register_fields( $connection_name, $fields ); + }, + 10 + ); +} + +/** + * Renames a GraphQL field. + * + * @param string $type_name Name of the Type to rename a field on. + * @param string $field_name Field name to be renamed. + * @param string $new_field_name New field name. + * + * @return void + * @since 1.3.4 + */ +function rename_graphql_field( string $type_name, string $field_name, string $new_field_name ) { + // Rename fields on the type. + add_filter( + "graphql_{$type_name}_fields", + static function ( $fields ) use ( $field_name, $new_field_name ) { + // Bail if the field doesn't exist. + if ( ! isset( $fields[ $field_name ] ) ) { + return $fields; + } + + $fields[ $new_field_name ] = $fields[ $field_name ]; + unset( $fields[ $field_name ] ); + + return $fields; + } + ); + + // Rename fields registered to the type by connections. + add_filter( + "graphql_wp_connection_{$type_name}_from_field_name", + static function ( $old_field_name ) use ( $field_name, $new_field_name ) { + // Bail if the field name doesn't match. + if ( $old_field_name !== $field_name ) { + return $old_field_name; + } + + return $new_field_name; + } + ); +} + +/** + * Renames a GraphQL Type in the Schema. + * + * @param string $type_name The name of the Type in the Schema to rename. + * @param string $new_type_name The new name to give the Type. + * + * @return void + * @throws \Exception + * + * @since 1.3.4 + */ +function rename_graphql_type( string $type_name, string $new_type_name ) { + add_filter( + 'graphql_type_name', + static function ( $name ) use ( $type_name, $new_type_name ) { + if ( $name === $type_name ) { + return $new_type_name; + } + return $name; + } + ); + + // Add the new type to the registry referencing the original Type instance. + // This allows for both the new type name and the old type name to be + // referenced as the type when registering fields. + add_action( + 'graphql_register_types_late', + static function ( TypeRegistry $type_registry ) use ( $type_name, $new_type_name ) { + $type = $type_registry->get_type( $type_name ); + if ( ! $type instanceof Type ) { + return; + } + $type_registry->register_type( $new_type_name, $type ); + } + ); +} + +/** + * Given a config array for a connection, this registers a connection by creating all appropriate + * fields and types for the connection + * + * @param array $config Array to configure the connection + * + * @throws \Exception + * @return void + * + * @since 0.1.0 + */ +function register_graphql_connection( array $config ) { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $config ) { + $type_registry->register_connection( $config ); + }, + 20 + ); +} + +/** + * Given a Mutation Name and Config array, this adds a Mutation to the Schema + * + * @param string $mutation_name The name of the Mutation to register + * @param array $config The config for the mutation + * + * @throws \Exception + * + * @return void + * @since 0.1.0 + */ +function register_graphql_mutation( string $mutation_name, array $config ) { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $mutation_name, $config ) { + $type_registry->register_mutation( $mutation_name, $config ); + }, + 10 + ); +} + +/** + * Given a config array for a custom Scalar, this registers a Scalar for use in the Schema + * + * @param string $type_name The name of the Type to register + * @param array $config The config for the scalar type to register + * + * @throws \Exception + * @return void + * + * @since 0.8.4 + */ +function register_graphql_scalar( string $type_name, array $config ) { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $type_name, $config ) { + $type_registry->register_scalar( $type_name, $config ); + }, + 10 + ); +} + +/** + * Given a Type Name, this removes the type from the entire schema + * + * @param string $type_name The name of the Type to remove. + * + * @since 1.13.0 + */ +function deregister_graphql_type( string $type_name ): void { + // Prevent the type from being registered to the scheme directly. + add_filter( + 'graphql_excluded_types', + static function ( $excluded_types ) use ( $type_name ): array { + // Normalize the types to prevent case sensitivity issues. + $type_name = strtolower( $type_name ); + // If the type isn't already excluded, add it to the array. + if ( ! in_array( $type_name, $excluded_types, true ) ) { + $excluded_types[] = $type_name; + } + + return $excluded_types; + }, + 10 + ); + + // Prevent the type from being inherited as an interface. + add_filter( + 'graphql_type_interfaces', + static function ( $interfaces ) use ( $type_name ): array { + // Normalize the needle and haystack to prevent case sensitivity issues. + $key = array_search( + strtolower( $type_name ), + array_map( 'strtolower', $interfaces ), + true + ); + // If the type is found, unset it. + if ( false !== $key ) { + unset( $interfaces[ $key ] ); + } + + return $interfaces; + }, + 10 + ); +} + +/** + * Given a Type Name and Field Name, this removes the field from the TypeRegistry + * + * @param string $type_name The name of the Type to remove the field from + * @param string $field_name The name of the field to remove + * + * @return void + * + * @since 0.1.0 + */ +function deregister_graphql_field( string $type_name, string $field_name ) { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $type_name, $field_name ) { + $type_registry->deregister_field( $type_name, $field_name ); + }, + 10 + ); +} + + +/** + * Given a Connection Name, this removes the connection from the Schema + * + * @param string $connection_name The name of the Connection to remove + * + * @since 1.14.0 + */ +function deregister_graphql_connection( string $connection_name ): void { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $connection_name ) { + $type_registry->deregister_connection( $connection_name ); + }, + 10 + ); +} + +/** + * Given a Mutation Name, this removes the mutation from the Schema + * + * @param string $mutation_name The name of the Mutation to remove + * + * @since 1.14.0 + */ +function deregister_graphql_mutation( string $mutation_name ): void { + add_action( + get_graphql_register_action(), + static function ( TypeRegistry $type_registry ) use ( $mutation_name ) { + $type_registry->deregister_mutation( $mutation_name ); + }, + 10 + ); +} + +/** + * Whether a GraphQL request is in action or not. This is determined by the WPGraphQL Request + * class being initiated. True while a request is in action, false after a request completes. + * + * This should be used when a condition needs to be checked for ALL GraphQL requests, such + * as filtering WP_Query for GraphQL requests, for example. + * + * Default false. + * + * @return bool + * @since 0.4.1 + */ +function is_graphql_request() { + return WPGraphQL::is_graphql_request(); +} + +/** + * Whether a GraphQL HTTP request is in action or not. This is determined by + * checking if the request is occurring on the route defined for the GraphQL endpoint. + * + * This conditional should only be used for features that apply to HTTP requests. If you are going + * to apply filters to underlying WordPress core functionality that should affect _all_ GraphQL + * requests, you should use "is_graphql_request" but if you need to apply filters only if the + * GraphQL request is an HTTP request, use this conditional. + * + * Default false. + * + * @return bool + * @since 0.4.1 + */ +function is_graphql_http_request() { + return Router::is_graphql_http_request(); +} + +/** + * Registers a GraphQL Settings Section + * + * @param string $slug The slug of the group being registered + * @param array $config Array configuring the section. Should include: title + * + * @return void + * @since 0.13.0 + */ +function register_graphql_settings_section( string $slug, array $config ) { + add_action( + 'graphql_init_settings', + static function ( \WPGraphQL\Admin\Settings\SettingsRegistry $registry ) use ( $slug, $config ) { + $registry->register_section( $slug, $config ); + } + ); +} + +/** + * Registers a GraphQL Settings Field + * + * @param string $group The name of the group to register a setting field to + * @param array $config The config for the settings field being registered + * + * @return void + * @since 0.13.0 + */ +function register_graphql_settings_field( string $group, array $config ) { + add_action( + 'graphql_init_settings', + static function ( \WPGraphQL\Admin\Settings\SettingsRegistry $registry ) use ( $group, $config ) { + $registry->register_field( $group, $config ); + } + ); +} + +/** + * Given a message and an optional config array + * + * @param mixed|string|array $message The debug message + * @param array $config The debug config. Should be an associative array of keys and + * values. + * $config['type'] will set the "type" of the log, default type + * is GRAPHQL_DEBUG. Other fields added to $config will be + * merged into the debug entry. + * + * @return void + * @since 0.14.0 + */ +function graphql_debug( $message, $config = [] ) { + $debug_backtrace = debug_backtrace(); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace + $config['backtrace'] = ! empty( $debug_backtrace ) + ? + array_values( + array_map( + static function ( $trace ) { + $line = isset( $trace['line'] ) ? absint( $trace['line'] ) : 0; + return sprintf( '%s:%d', $trace['file'], $line ); + }, + array_filter( // Filter out steps without files + $debug_backtrace, + static function ( $step ) { + return ! empty( $step['file'] ); + } + ) + ) + ) + : + []; + + add_action( + 'graphql_get_debug_log', + static function ( \WPGraphQL\Utils\DebugLog $debug_log ) use ( $message, $config ) { + $debug_log->add_log_entry( $message, $config ); + } + ); +} + +/** + * Check if the name is valid for use in GraphQL + * + * @param string $type_name The name of the type to validate + * + * @return bool + * @since 0.14.0 + */ +function is_valid_graphql_name( string $type_name ) { + if ( preg_match( '/^\d/', $type_name ) ) { + return false; + } + + return true; +} + +/** + * Registers a series of GraphQL Settings Fields + * + * @param string $group The name of the settings group to register fields to + * @param array $fields Array of field configs to register to the group + * + * @return void + * @since 0.13.0 + */ +function register_graphql_settings_fields( string $group, array $fields ) { + add_action( + 'graphql_init_settings', + static function ( \WPGraphQL\Admin\Settings\SettingsRegistry $registry ) use ( $group, $fields ) { + $registry->register_fields( $group, $fields ); + } + ); +} + +/** + * Get an option value from GraphQL settings + * + * @param string $option_name The key of the option to return + * @param mixed $default_value The default value the setting should return if no value is set + * @param string $section_name The settings group section that the option belongs to + * + * @return mixed|string|int|boolean + * @since 0.13.0 + */ +function get_graphql_setting( string $option_name, $default_value = '', $section_name = 'graphql_general_settings' ) { + $section_fields = get_option( $section_name ); + + /** + * Filter the section fields + * + * @param array $section_fields The values of the fields stored for the section + * @param string $section_name The name of the section + * @param mixed $default_value The default value for the option being retrieved + */ + $section_fields = apply_filters( 'graphql_get_setting_section_fields', $section_fields, $section_name, $default_value ); + + /** + * Get the value from the stored data, or return the default + */ + $value = isset( $section_fields[ $option_name ] ) ? $section_fields[ $option_name ] : $default_value; + + /** + * Filter the value before returning it + * + * @param mixed $value The value of the field + * @param mixed $default_value The default value if there is no value set + * @param string $option_name The name of the option + * @param array $section_fields The setting values within the section + * @param string $section_name The name of the section the setting belongs to + */ + return apply_filters( 'graphql_get_setting_section_field_value', $value, $default_value, $option_name, $section_fields, $section_name ); +} + +/** + * Get the endpoint route for the WPGraphQL API + * + * @return string + * @since 1.12.0 + */ +function graphql_get_endpoint() { + + // get the endpoint from the settings. default to 'graphql' + $endpoint = get_graphql_setting( 'graphql_endpoint', 'graphql' ); + + /** + * @param string $endpoint The relative endpoint that graphql can be accessed at + */ + $filtered_endpoint = apply_filters( 'graphql_endpoint', $endpoint ); + + // If the filtered endpoint has a value (not filtered to a falsy value), use it. else return the default endpoint + return ! empty( $filtered_endpoint ) ? $filtered_endpoint : $endpoint; +} + +/** + * Return the full url for the GraphQL Endpoint. + * + * @return string + * @since 1.12.0 + */ +function graphql_get_endpoint_url() { + return site_url( graphql_get_endpoint() ); +} + +/** + * Polyfill for PHP versions below 7.3 + * + * @return int|string|null + * + * @since 0.10.0 + */ +if ( ! function_exists( 'array_key_first' ) ) { + + /** + * @param array $arr + * + * @return int|string|null + */ + function array_key_first( array $arr ) { + foreach ( $arr as $key => $value ) { + return $key; + } + return null; + } +} + +/** + * Polyfill for PHP versions below 7.3 + * + * @return mixed|string|int + * + * @since 0.10.0 + */ +if ( ! function_exists( 'array_key_last' ) ) { + + /** + * @param array $arr + * + * @return int|string|null + */ + function array_key_last( array $arr ) { + end( $arr ); + + return key( $arr ); + } +} diff --git a/lib/wp-graphql-1.17.0/activation.php b/lib/wp-graphql-1.17.0/activation.php new file mode 100644 index 00000000..25531ac7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/activation.php @@ -0,0 +1,17 @@ + { + api.cache(true); + + return { + presets: ["@wordpress/babel-preset-default"], + plugins: ["babel-plugin-inline-json-import"], + }; +}; diff --git a/lib/wp-graphql-1.17.0/build/app.asset.php b/lib/wp-graphql-1.17.0/build/app.asset.php new file mode 100644 index 00000000..a1fa4dc8 --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/app.asset.php @@ -0,0 +1 @@ + array('react', 'react-dom', 'wp-element', 'wp-hooks'), 'version' => 'b46a34de121156c88432'); diff --git a/lib/wp-graphql-1.17.0/build/app.css b/lib/wp-graphql-1.17.0/build/app.css new file mode 100644 index 00000000..b62c15b9 --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/app.css @@ -0,0 +1,1800 @@ +.graphiql-container, +.graphiql-container button, +.graphiql-container input { + color: #141823; + font-family: system, -apple-system, 'San Francisco', '.SFNSDisplay-Regular', + 'Segoe UI', Segoe, 'Segoe WP', 'Helvetica Neue', helvetica, 'Lucida Grande', + arial, sans-serif; + font-size: 14px; +} + +.graphiql-container { + display: flex; + flex-direction: row; + height: 100%; + margin: 0; + overflow: hidden; + width: 100%; +} + +.graphiql-container .editorWrap { + display: flex; + flex-direction: column; + flex: 1; + overflow-x: hidden; +} + +.graphiql-container .title { + font-size: 18px; +} + +.graphiql-container .title em { + font-family: georgia; + font-size: 19px; +} + +.graphiql-container .topBarWrap { + display: flex; + flex-direction: row; +} + +.graphiql-container .topBar { + align-items: center; + background: linear-gradient(#f7f7f7, #e2e2e2); + border-bottom: 1px solid #d0d0d0; + cursor: default; + display: flex; + flex-direction: row; + flex: 1; + height: 34px; + overflow-y: visible; + padding: 7px 14px 6px; + user-select: none; +} + +.graphiql-container .toolbar { + overflow-x: visible; + display: flex; +} + +.graphiql-container .docExplorerShow, +.graphiql-container .historyShow { + background: linear-gradient(#f7f7f7, #e2e2e2); + border-radius: 0; + border-bottom: 1px solid #d0d0d0; + border-right: none; + border-top: none; + color: #3b5998; + cursor: pointer; + font-size: 14px; + margin: 0; + padding: 2px 20px 0 18px; +} + +.graphiql-container .docExplorerShow { + border-left: 1px solid rgba(0, 0, 0, 0.2); +} + +.graphiql-container .historyShow { + border-right: 1px solid rgba(0, 0, 0, 0.2); + border-left: 0; +} + +.graphiql-container .docExplorerShow:before { + border-left: 2px solid #3b5998; + border-top: 2px solid #3b5998; + content: ''; + display: inline-block; + height: 9px; + margin: 0 3px -1px 0; + position: relative; + transform: rotate(-45deg); + width: 9px; +} + +.graphiql-container .editorBar { + display: flex; + flex-direction: row; + flex: 1; + max-height: 100%; +} + +.graphiql-container .queryWrap { + display: flex; + flex-direction: column; + flex: 1; +} + +.graphiql-container .resultWrap { + border-left: solid 1px #e0e0e0; + display: flex; + flex-direction: column; + flex: 1; + flex-basis: 1em; + position: relative; +} + +.graphiql-container .docExplorerWrap, +.graphiql-container .historyPaneWrap { + background: white; + box-shadow: 0 0 8px rgba(0, 0, 0, 0.15); + position: relative; + z-index: 3; +} + +.graphiql-container .historyPaneWrap { + min-width: 230px; + z-index: 5; +} + +.graphiql-container .docExplorerResizer { + cursor: col-resize; + height: 100%; + left: -5px; + position: absolute; + top: 0; + width: 10px; + z-index: 10; +} + +.graphiql-container .docExplorerHide { + cursor: pointer; + font-size: 18px; + margin: -7px -8px -6px 0; + padding: 18px 16px 15px 12px; + background: 0; + border: 0; + line-height: 14px; +} + +.graphiql-container div .query-editor { + flex: 1; + position: relative; +} + +.graphiql-container .secondary-editor { + display: flex; + flex-direction: column; + height: 30px; + position: relative; +} + +.graphiql-container .secondary-editor-title { + background: #eeeeee; + border-bottom: 1px solid #d6d6d6; + border-top: 1px solid #e0e0e0; + color: #777; + font-variant: small-caps; + font-weight: bold; + letter-spacing: 1px; + line-height: 14px; + padding: 6px 0 8px 43px; + text-transform: lowercase; + user-select: none; +} + +.graphiql-container .codemirrorWrap { + flex: 1; + height: 100%; + position: relative; +} + +.graphiql-container .result-window { + flex: 1; + height: 100%; + position: relative; +} + +.graphiql-container .footer { + background: #f6f7f8; + border-left: 1px solid #e0e0e0; + border-top: 1px solid #e0e0e0; + margin-left: 12px; + position: relative; +} + +.graphiql-container .footer:before { + background: #eeeeee; + bottom: 0; + content: ' '; + left: -13px; + position: absolute; + top: -1px; + width: 12px; +} + +/* No `.graphiql-container` here so themes can overwrite */ + +.result-window .CodeMirror.cm-s-graphiql { + background: #f6f7f8; +} + +.graphiql-container .result-window .CodeMirror-gutters { + background-color: #eeeeee; + border-color: #e0e0e0; + cursor: col-resize; +} + +.graphiql-container .result-window .CodeMirror-foldgutter, +.graphiql-container .result-window .CodeMirror-foldgutter-open:after, +.graphiql-container .result-window .CodeMirror-foldgutter-folded:after { + padding-left: 3px; +} + +.graphiql-container .toolbar-button { + background: #fdfdfd; + background: linear-gradient(#f9f9f9, #ececec); + border: 0; + border-radius: 3px; + box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), + 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 1px #fff; + color: #555; + cursor: pointer; + display: inline-block; + margin: 0 5px; + padding: 3px 11px 5px; + text-decoration: none; + text-overflow: ellipsis; + white-space: nowrap; + max-width: 150px; +} + +.graphiql-container .toolbar-button:active { + background: linear-gradient(#ececec, #d5d5d5); + box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), + inset 0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 1px 1px 1px rgba(0, 0, 0, 0.12), + inset 0 0 5px rgba(0, 0, 0, 0.1); +} + +.graphiql-container .toolbar-button.error { + background: linear-gradient(#fdf3f3, #e6d6d7); + color: #b00; +} + +.graphiql-container .toolbar-button-group { + margin: 0 5px; + white-space: nowrap; +} + +.graphiql-container .toolbar-button-group > * { + margin: 0; +} + +.graphiql-container .toolbar-button-group > *:not(:last-child) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.graphiql-container .toolbar-button-group > *:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + margin-left: -1px; +} + +.graphiql-container .execute-button-wrap { + height: 34px; + margin: 0 14px 0 28px; + position: relative; +} + +.graphiql-container .execute-button { + background: linear-gradient(#fdfdfd, #d2d3d6); + border-radius: 17px; + border: 1px solid rgba(0, 0, 0, 0.25); + box-shadow: 0 1px 0 #fff; + cursor: pointer; + fill: #444; + height: 34px; + margin: 0; + padding: 0; + width: 34px; +} + +.graphiql-container .execute-button svg { + pointer-events: none; +} + +.graphiql-container .execute-button:active { + background: linear-gradient(#e6e6e6, #c3c3c3); + box-shadow: 0 1px 0 #fff, inset 0 0 2px rgba(0, 0, 0, 0.2), + inset 0 0 6px rgba(0, 0, 0, 0.1); +} + +.graphiql-container .toolbar-menu, +.graphiql-container .toolbar-select { + position: relative; +} + +.graphiql-container .execute-options, +.graphiql-container .toolbar-menu-items, +.graphiql-container .toolbar-select-options { + background: #fff; + box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.25); + margin: 0; + padding: 6px 0; + position: absolute; + z-index: 100; +} + +.graphiql-container .execute-options { + min-width: 100px; + top: 37px; + left: -1px; +} + +.graphiql-container .toolbar-menu-items { + left: 1px; + margin-top: -1px; + min-width: 110%; + top: 100%; + visibility: hidden; +} + +.graphiql-container .toolbar-menu-items.open { + visibility: visible; +} + +.graphiql-container .toolbar-select-options { + left: 0; + min-width: 100%; + top: -5px; + visibility: hidden; +} + +.graphiql-container .toolbar-select-options.open { + visibility: visible; +} + +.graphiql-container .execute-options > li, +.graphiql-container .toolbar-menu-items > li, +.graphiql-container .toolbar-select-options > li { + cursor: pointer; + display: block; + margin: none; + max-width: 300px; + overflow: hidden; + padding: 2px 20px 4px 11px; + white-space: nowrap; +} + +.graphiql-container .execute-options > li.selected, +.graphiql-container .toolbar-menu-items > li.hover, +.graphiql-container .toolbar-menu-items > li:active, +.graphiql-container .toolbar-menu-items > li:hover, +.graphiql-container .toolbar-select-options > li.hover, +.graphiql-container .toolbar-select-options > li:active, +.graphiql-container .toolbar-select-options > li:hover, +.graphiql-container .history-contents > li:hover, +.graphiql-container .history-contents > li:active { + background: #e10098; + color: #fff; +} + +.graphiql-container .toolbar-select-options > li > svg { + display: inline; + fill: #666; + margin: 0 -6px 0 6px; + pointer-events: none; + vertical-align: middle; +} + +.graphiql-container .toolbar-select-options > li.hover > svg, +.graphiql-container .toolbar-select-options > li:active > svg, +.graphiql-container .toolbar-select-options > li:hover > svg { + fill: #fff; +} + +.graphiql-container .CodeMirror-scroll { + overflow-scrolling: touch; +} + +.graphiql-container .CodeMirror { + color: #141823; + font-family: 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace; + font-size: 13px; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; +} + +.graphiql-container .CodeMirror-lines { + padding: 20px 0; +} + +.CodeMirror-hint-information .content { + box-orient: vertical; + color: #141823; + display: flex; + font-family: system, -apple-system, 'San Francisco', '.SFNSDisplay-Regular', + 'Segoe UI', Segoe, 'Segoe WP', 'Helvetica Neue', helvetica, 'Lucida Grande', + arial, sans-serif; + font-size: 13px; + line-clamp: 3; + line-height: 16px; + max-height: 48px; + overflow: hidden; + text-overflow: -o-ellipsis-lastline; +} + +.CodeMirror-hint-information .content p:first-child { + margin-top: 0; +} + +.CodeMirror-hint-information .content p:last-child { + margin-bottom: 0; +} + +.CodeMirror-hint-information .infoType { + color: #ca9800; + cursor: pointer; + display: inline; + margin-right: 0.5em; +} + +.autoInsertedLeaf.cm-property { + animation-duration: 6s; + animation-name: insertionFade; + border-bottom: 2px solid rgba(255, 255, 255, 0); + border-radius: 2px; + margin: -2px -4px -1px; + padding: 2px 4px 1px; +} + +@keyframes insertionFade { + from, + to { + background: rgba(255, 255, 255, 0); + border-color: rgba(255, 255, 255, 0); + } + + 15%, + 85% { + background: #fbffc9; + border-color: #f0f3c0; + } +} + +div.CodeMirror-lint-tooltip { + background-color: white; + border-radius: 2px; + border: 0; + color: #141823; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); + font-size: 13px; + line-height: 16px; + max-width: 430px; + opacity: 0; + padding: 8px 10px; + transition: opacity 0.15s; + white-space: pre-wrap; +} + +div.CodeMirror-lint-tooltip > * { + padding-left: 23px; +} + +div.CodeMirror-lint-tooltip > * + * { + margin-top: 12px; +} + +.graphiql-container .variable-editor-title-text { + cursor: pointer; + display: inline-block; + color: gray; +} + +.graphiql-container .variable-editor-title-text.active { + color: #000; +} + +/* COLORS */ + +.graphiql-container .CodeMirror-foldmarker { + border-radius: 4px; + background: #08f; + background: linear-gradient(#43a8ff, #0f83e8); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.1); + color: white; + font-family: arial; + font-size: 12px; + line-height: 0; + margin: 0 3px; + padding: 0px 4px 1px; + text-shadow: 0 -1px rgba(0, 0, 0, 0.1); +} + +.graphiql-container div.CodeMirror span.CodeMirror-matchingbracket { + color: #555; + text-decoration: underline; +} + +.graphiql-container div.CodeMirror span.CodeMirror-nonmatchingbracket { + color: #f00; +} + +/* Comment */ + +.cm-comment { + color: #666; +} + +/* Punctuation */ + +.cm-punctuation { + color: #555; +} + +/* Keyword */ + +.cm-keyword { + color: #b11a04; +} + +/* OperationName, FragmentName */ + +.cm-def { + color: #d2054e; +} + +/* FieldName */ + +.cm-property { + color: #1f61a0; +} + +/* FieldAlias */ + +.cm-qualifier { + color: #1c92a9; +} + +/* ArgumentName and ObjectFieldName */ + +.cm-attribute { + color: #8b2bb9; +} + +/* Number */ + +.cm-number { + color: #2882f9; +} + +/* String */ + +.cm-string { + color: #d64292; +} + +/* Boolean */ + +.cm-builtin { + color: #d47509; +} + +/* EnumValue */ + +.cm-string-2 { + color: #0b7fc7; +} + +/* Variable */ + +.cm-variable { + color: #397d13; +} + +/* Directive */ + +.cm-meta { + color: #b33086; +} + +/* Type */ + +.cm-atom { + color: #ca9800; +} + +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + color: black; + font-family: monospace; + height: 300px; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} + +.CodeMirror pre { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler, +.CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; + white-space: nowrap; +} + +.CodeMirror-linenumbers { +} + +.CodeMirror-linenumber { + color: #666; + min-width: 20px; + padding: 0 3px 0 5px; + text-align: right; + white-space: nowrap; +} + +.CodeMirror-guttermarker { + color: black; +} + +.CodeMirror-guttermarker-subtle { + color: #666; +} + +/* CURSOR */ + +.CodeMirror .CodeMirror-cursor { + border-left: 1px solid black; +} + +/* Shown when moving in bi-directional text */ + +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} + +.CodeMirror.cm-fat-cursor div.CodeMirror-cursor { + background: #7e7; + border: 0; + width: auto; +} + +.CodeMirror.cm-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} + +.cm-animate-fat-cursor { + animation: blink 1.06s steps(1) infinite; + border: 0; + width: auto; +} + +@keyframes blink { + 0% { + background: #7e7; + } + 50% { + background: none; + } + 100% { + background: #7e7; + } +} + +/* Can style cursor different in overwrite (non-insert) mode */ + +div.CodeMirror-overwrite div.CodeMirror-cursor { +} + +.cm-tab { + display: inline-block; + text-decoration: inherit; +} + +.CodeMirror-ruler { + border-left: 1px solid #ccc; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-keyword { + color: #708; +} + +.cm-s-default .cm-atom { + color: #219; +} + +.cm-s-default .cm-number { + color: #164; +} + +.cm-s-default .cm-def { + color: #00f; +} + +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator { +} + +.cm-s-default .cm-variable-2 { + color: #05a; +} + +.cm-s-default .cm-variable-3 { + color: #085; +} + +.cm-s-default .cm-comment { + color: #a50; +} + +.cm-s-default .cm-string { + color: #a11; +} + +.cm-s-default .cm-string-2 { + color: #f50; +} + +.cm-s-default .cm-meta { + color: #555; +} + +.cm-s-default .cm-qualifier { + color: #555; +} + +.cm-s-default .cm-builtin { + color: #30a; +} + +.cm-s-default .cm-bracket { + color: #666; +} + +.cm-s-default .cm-tag { + color: #170; +} + +.cm-s-default .cm-attribute { + color: #00c; +} + +.cm-s-default .cm-header { + color: blue; +} + +.cm-s-default .cm-quote { + color: #090; +} + +.cm-s-default .cm-hr { + color: #666; +} + +.cm-s-default .cm-link { + color: #00c; +} + +.cm-negative { + color: #d44; +} + +.cm-positive { + color: #292; +} + +.cm-header, +.cm-strong { + font-weight: bold; +} + +.cm-em { + font-style: italic; +} + +.cm-link { + text-decoration: underline; +} + +.cm-strikethrough { + text-decoration: line-through; +} + +.cm-s-default .cm-error { + color: #f00; +} + +.cm-invalidchar { + color: #f00; +} + +.CodeMirror-composing { + border-bottom: 2px solid; +} + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket { + color: #0f0; +} + +div.CodeMirror span.CodeMirror-nonmatchingbracket { + color: #f22; +} + +.CodeMirror-matchingtag { + background: rgba(255, 150, 0, 0.3); +} + +.CodeMirror-activeline-background { + background: #e8f2ff; +} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + background: white; + overflow: hidden; + position: relative; +} + +.CodeMirror-scroll { + height: 100%; + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -30px; + margin-right: -30px; + outline: none; /* Prevent dragging from highlighting the element */ + overflow: scroll !important; /* Things will break if this is overridden */ + padding-bottom: 30px; + position: relative; +} + +.CodeMirror-sizer { + border-right: 30px solid transparent; + position: relative; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actual scrolling happens, thus preventing shaking and + flickering artifacts. */ + +.CodeMirror-vscrollbar, +.CodeMirror-hscrollbar, +.CodeMirror-scrollbar-filler, +.CodeMirror-gutter-filler { + display: none; + position: absolute; + z-index: 6; +} + +.CodeMirror-vscrollbar { + overflow-x: hidden; + overflow-y: scroll; + right: 0; + top: 0; +} + +.CodeMirror-hscrollbar { + bottom: 0; + left: 0; + overflow-x: scroll; + overflow-y: hidden; +} + +.CodeMirror-scrollbar-filler { + right: 0; + bottom: 0; +} + +.CodeMirror-gutter-filler { + left: 0; + bottom: 0; +} + +.CodeMirror-gutters { + min-height: 100%; + position: absolute; + left: 0; + top: 0; + z-index: 3; +} + +.CodeMirror-gutter { + display: inline-block; + height: 100%; + margin-bottom: -30px; + vertical-align: top; + white-space: normal; +} + +.CodeMirror-gutter-wrapper { + background: none !important; + border: none !important; + position: absolute; + z-index: 4; +} + +.CodeMirror-gutter-background { + position: absolute; + top: 0; + bottom: 0; + z-index: 4; +} + +.CodeMirror-gutter-elt { + cursor: default; + position: absolute; + z-index: 4; +} + +.CodeMirror-gutter-wrapper { + user-select: none; +} + +.CodeMirror-lines { + cursor: text; + min-height: 1px; /* prevents collapsing before first draw */ +} + +.CodeMirror pre { + -webkit-tap-highlight-color: transparent; + /* Reset some styles that the rest of the page might have set */ + background: transparent; + border-radius: 0; + border-width: 0; + color: inherit; + font-family: inherit; + font-size: inherit; + font-variant-ligatures: none; + line-height: inherit; + margin: 0; + overflow: visible; + position: relative; + white-space: pre; + word-wrap: normal; + z-index: 2; +} + +.CodeMirror-wrap pre { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} + +.CodeMirror-linebackground { + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + overflow: auto; + position: relative; + z-index: 2; +} + +.CodeMirror-widget { +} + +.CodeMirror-code { + outline: none; +} + +/* Force content-box sizing for the elements where we expect it */ + +.CodeMirror-scroll, +.CodeMirror-sizer, +.CodeMirror-gutter, +.CodeMirror-gutters, +.CodeMirror-linenumber { + box-sizing: content-box; +} + +.CodeMirror-measure { + height: 0; + overflow: hidden; + position: absolute; + visibility: hidden; + width: 100%; +} + +.CodeMirror-cursor { + position: absolute; +} + +.CodeMirror-measure pre { + position: static; +} + +div.CodeMirror-cursors { + position: relative; + visibility: hidden; + z-index: 3; +} + +div.CodeMirror-dragcursors { + visibility: visible; +} + +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { + background: #d9d9d9; +} + +.CodeMirror-focused .CodeMirror-selected { + background: #d7d4f0; +} + +.CodeMirror-crosshair { + cursor: crosshair; +} + +.CodeMirror-line::selection, +.CodeMirror-line > span::selection, +.CodeMirror-line > span > span::selection { + background: #d7d4f0; +} + +.CodeMirror-line::-moz-selection, +.CodeMirror-line > span::-moz-selection, +.CodeMirror-line > span > span::-moz-selection { + background: #d7d4f0; +} + +.cm-searching { + background: #ffa; + background: rgba(255, 255, 0, 0.4); +} + +/* Used to force a border model for a node */ + +.cm-force-border { + padding-right: 0.1px; +} + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} + +/* See issue #2901 */ + +.cm-tab-wrap-hack:after { + content: ''; +} + +/* Help users use markselection to safely style text background */ + +span.CodeMirror-selectedtext { + background: none; +} + +.CodeMirror-dialog { + background: inherit; + color: inherit; + left: 0; + right: 0; + overflow: hidden; + padding: 0.1em 0.8em; + position: absolute; + z-index: 15; +} + +.CodeMirror-dialog-top { + border-bottom: 1px solid #eee; + top: 0; +} + +.CodeMirror-dialog-bottom { + border-top: 1px solid #eee; + bottom: 0; +} + +.CodeMirror-dialog input { + background: transparent; + border: 1px solid #d3d6db; + color: inherit; + font-family: monospace; + outline: none; + width: 20em; +} + +.CodeMirror-dialog button { + font-size: 70%; +} + +.CodeMirror-foldmarker { + color: blue; + cursor: pointer; + font-family: arial; + line-height: 0.3; + text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, + #b9f -1px 1px 2px; +} +.CodeMirror-foldgutter { + width: 0.7em; +} +.CodeMirror-foldgutter-open, +.CodeMirror-foldgutter-folded { + cursor: pointer; +} +.CodeMirror-foldgutter-open:after { + content: '\25BE'; +} +.CodeMirror-foldgutter-folded:after { + content: '\25B8'; +} + +.CodeMirror-info { + background: white; + border-radius: 2px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); + box-sizing: border-box; + color: #555; + font-family: system, -apple-system, 'San Francisco', '.SFNSDisplay-Regular', + 'Segoe UI', Segoe, 'Segoe WP', 'Helvetica Neue', helvetica, 'Lucida Grande', + arial, sans-serif; + font-size: 13px; + line-height: 16px; + margin: 8px -8px; + max-width: 400px; + opacity: 0; + overflow: hidden; + padding: 8px 8px; + position: fixed; + transition: opacity 0.15s; + z-index: 50; +} + +.CodeMirror-info :first-child { + margin-top: 0; +} + +.CodeMirror-info :last-child { + margin-bottom: 0; +} + +.CodeMirror-info p { + margin: 1em 0; +} + +.CodeMirror-info .info-description { + color: #777; + line-height: 16px; + margin-top: 1em; + max-height: 80px; + overflow: hidden; +} + +.CodeMirror-info .info-deprecation { + background: #fffae8; + box-shadow: inset 0 1px 1px -1px #bfb063; + color: #867f70; + line-height: 16px; + margin: -8px; + margin-top: 8px; + max-height: 80px; + overflow: hidden; + padding: 8px; +} + +.CodeMirror-info .info-deprecation-label { + color: #c79b2e; + cursor: default; + display: block; + font-size: 9px; + font-weight: bold; + letter-spacing: 1px; + line-height: 1; + padding-bottom: 5px; + text-transform: uppercase; + user-select: none; +} + +.CodeMirror-info .info-deprecation-label + * { + margin-top: 0; +} + +.CodeMirror-info a { + text-decoration: none; +} + +.CodeMirror-info a:hover { + text-decoration: underline; +} + +.CodeMirror-info .type-name { + color: #ca9800; +} + +.CodeMirror-info .field-name { + color: #1f61a0; +} + +.CodeMirror-info .enum-value { + color: #0b7fc7; +} + +.CodeMirror-info .arg-name { + color: #8b2bb9; +} + +.CodeMirror-info .directive-name { + color: #b33086; +} + +.CodeMirror-jump-token { + text-decoration: underline; + cursor: pointer; +} + +/* The lint marker gutter */ +.CodeMirror-lint-markers { + width: 16px; +} +.CodeMirror-lint-tooltip { + background-color: infobackground; + border-radius: 4px 4px 4px 4px; + border: 1px solid black; + color: infotext; + font-family: monospace; + font-size: 10pt; + max-width: 600px; + opacity: 0; + overflow: hidden; + padding: 2px 5px; + position: fixed; + transition: opacity 0.4s; + white-space: pre-wrap; + z-index: 100; +} +.CodeMirror-lint-mark-error, +.CodeMirror-lint-mark-warning { + background-position: left bottom; + background-repeat: repeat-x; +} +.CodeMirror-lint-mark-error { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==); +} +.CodeMirror-lint-mark-warning { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=); +} +.CodeMirror-lint-marker-error, +.CodeMirror-lint-marker-warning { + background-position: center center; + background-repeat: no-repeat; + cursor: pointer; + display: inline-block; + height: 16px; + position: relative; + vertical-align: middle; + width: 16px; +} +.CodeMirror-lint-message-error, +.CodeMirror-lint-message-warning { + background-position: top left; + background-repeat: no-repeat; + padding-left: 18px; +} +.CodeMirror-lint-marker-error, +.CodeMirror-lint-message-error { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=); +} +.CodeMirror-lint-marker-warning, +.CodeMirror-lint-message-warning { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=); +} +.CodeMirror-lint-marker-multiple { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC); + background-position: right bottom; + background-repeat: no-repeat; + width: 100%; + height: 100%; +} + +.graphiql-container .spinner-container { + height: 36px; + left: 50%; + position: absolute; + top: 50%; + transform: translate(-50%, -50%); + width: 36px; + z-index: 10; +} + +.graphiql-container .spinner { + animation: rotation 0.6s infinite linear; + border-bottom: 6px solid rgba(150, 150, 150, 0.15); + border-left: 6px solid rgba(150, 150, 150, 0.15); + border-radius: 100%; + border-right: 6px solid rgba(150, 150, 150, 0.15); + border-top: 6px solid rgba(150, 150, 150, 0.8); + display: inline-block; + height: 24px; + position: absolute; + vertical-align: middle; + width: 24px; +} + +@keyframes rotation { + from { + transform: rotate(0deg); + } + to { + transform: rotate(359deg); + } +} + +.CodeMirror-hints { + background: white; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); + font-family: 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace; + font-size: 13px; + list-style: none; + margin-left: -6px; + margin: 0; + max-height: 14.5em; + overflow: hidden; + overflow-y: auto; + padding: 0; + position: absolute; + z-index: 10; +} + +.CodeMirror-hint { + border-top: solid 1px #f7f7f7; + color: #141823; + cursor: pointer; + margin: 0; + max-width: 300px; + overflow: hidden; + padding: 2px 6px; + white-space: pre; +} + +li.CodeMirror-hint-active { + background-color: #08f; + border-top-color: white; + color: white; +} + +.CodeMirror-hint-information { + border-top: solid 1px #c0c0c0; + max-width: 300px; + padding: 4px 6px; + position: relative; + z-index: 1; +} + +.CodeMirror-hint-information:first-child { + border-bottom: solid 1px #c0c0c0; + border-top: none; + margin-bottom: -1px; +} + +.CodeMirror-hint-deprecation { + background: #fffae8; + box-shadow: inset 0 1px 1px -1px #bfb063; + color: #867f70; + font-family: system, -apple-system, 'San Francisco', '.SFNSDisplay-Regular', + 'Segoe UI', Segoe, 'Segoe WP', 'Helvetica Neue', helvetica, 'Lucida Grande', + arial, sans-serif; + font-size: 13px; + line-height: 16px; + margin-top: 4px; + max-height: 80px; + overflow: hidden; + padding: 6px; +} + +.CodeMirror-hint-deprecation .deprecation-label { + color: #c79b2e; + cursor: default; + display: block; + font-size: 9px; + font-weight: bold; + letter-spacing: 1px; + line-height: 1; + padding-bottom: 5px; + text-transform: uppercase; + user-select: none; +} + +.CodeMirror-hint-deprecation .deprecation-label + * { + margin-top: 0; +} + +.CodeMirror-hint-deprecation :last-child { + margin-bottom: 0; +} + +.graphiql-container .doc-explorer { + background: white; +} + +.graphiql-container .doc-explorer-title-bar, +.graphiql-container .history-title-bar { + cursor: default; + display: flex; + height: 34px; + line-height: 14px; + padding: 8px 8px 5px; + position: relative; + user-select: none; +} + +.graphiql-container .doc-explorer-title, +.graphiql-container .history-title { + flex: 1; + font-weight: bold; + overflow-x: hidden; + padding: 10px 0 10px 10px; + text-align: center; + text-overflow: ellipsis; + user-select: text; + white-space: nowrap; +} + +.graphiql-container .doc-explorer-back { + color: #3b5998; + cursor: pointer; + margin: -7px 0 -6px -8px; + overflow-x: hidden; + padding: 17px 12px 16px 16px; + text-overflow: ellipsis; + white-space: nowrap; + background: 0; + border: 0; + line-height: 14px; +} + +.doc-explorer-narrow .doc-explorer-back { + width: 0; +} + +.graphiql-container .doc-explorer-back:before { + border-left: 2px solid #3b5998; + border-top: 2px solid #3b5998; + content: ''; + display: inline-block; + height: 9px; + margin: 0 3px -1px 0; + position: relative; + transform: rotate(-45deg); + width: 9px; +} + +.graphiql-container .doc-explorer-rhs { + position: relative; +} + +.graphiql-container .doc-explorer-contents, +.graphiql-container .history-contents { + background-color: #ffffff; + border-top: 1px solid #d6d6d6; + bottom: 0; + left: 0; + overflow-y: auto; + padding: 20px 15px; + position: absolute; + right: 0; + top: 47px; +} + +.graphiql-container .doc-explorer-contents { + min-width: 300px; +} + +.graphiql-container .doc-type-description p:first-child, +.graphiql-container .doc-type-description blockquote:first-child { + margin-top: 0; +} + +.graphiql-container .doc-explorer-contents a { + cursor: pointer; + text-decoration: none; +} + +.graphiql-container .doc-explorer-contents a:hover { + text-decoration: underline; +} + +.graphiql-container .doc-value-description > :first-child { + margin-top: 4px; +} + +.graphiql-container .doc-value-description > :last-child { + margin-bottom: 4px; +} + +.graphiql-container .doc-type-description code, +.graphiql-container .doc-type-description pre, +.graphiql-container .doc-category code, +.graphiql-container .doc-category pre { + --saf-0: rgba(var(--sk_foreground_low, 29, 28, 29), 0.13); + font-size: 12px; + line-height: 1.50001; + font-variant-ligatures: none; + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; + word-break: normal; + -webkit-tab-size: 4; + -moz-tab-size: 4; + tab-size: 4; +} + +.graphiql-container .doc-type-description code, +.graphiql-container .doc-category code { + padding: 2px 3px 1px; + border: 1px solid var(--saf-0); + border-radius: 3px; + background-color: rgba(var(--sk_foreground_min, 29, 28, 29), 0.04); + color: #e01e5a; + background-color: white; +} + +.graphiql-container .doc-category { + margin: 20px 0; +} + +.graphiql-container .doc-category-title { + border-bottom: 1px solid #e0e0e0; + color: #777; + cursor: default; + font-size: 14px; + font-variant: small-caps; + font-weight: bold; + letter-spacing: 1px; + margin: 0 -15px 10px 0; + padding: 10px 0; + user-select: none; +} + +.graphiql-container .doc-category-item { + margin: 12px 0; + color: #555; +} + +.graphiql-container .keyword { + color: #b11a04; +} + +.graphiql-container .type-name { + color: #ca9800; +} + +.graphiql-container .field-name { + color: #1f61a0; +} + +.graphiql-container .field-short-description { + color: #666; + margin-left: 5px; + overflow: hidden; + text-overflow: ellipsis; +} + +.graphiql-container .enum-value { + color: #0b7fc7; +} + +.graphiql-container .arg-name { + color: #8b2bb9; +} + +.graphiql-container .arg { + display: block; + margin-left: 1em; +} + +.graphiql-container .arg:first-child:last-child, +.graphiql-container .arg:first-child:nth-last-child(2), +.graphiql-container .arg:first-child:nth-last-child(2) ~ .arg { + display: inherit; + margin: inherit; +} + +.graphiql-container .arg:first-child:nth-last-child(2):after { + content: ', '; +} + +.graphiql-container .arg-default-value { + color: #43a047; +} + +.graphiql-container .doc-deprecation { + background: #fffae8; + box-shadow: inset 0 0 1px #bfb063; + color: #867f70; + line-height: 16px; + margin: 8px -8px; + max-height: 80px; + overflow: hidden; + padding: 8px; + border-radius: 3px; +} + +.graphiql-container .doc-deprecation:before { + content: 'Deprecated:'; + color: #c79b2e; + cursor: default; + display: block; + font-size: 9px; + font-weight: bold; + letter-spacing: 1px; + line-height: 1; + padding-bottom: 5px; + text-transform: uppercase; + user-select: none; +} + +.graphiql-container .doc-deprecation > :first-child { + margin-top: 0; +} + +.graphiql-container .doc-deprecation > :last-child { + margin-bottom: 0; +} + +.graphiql-container .show-btn { + -webkit-appearance: initial; + display: block; + border-radius: 3px; + border: solid 1px #ccc; + text-align: center; + padding: 8px 12px 10px; + width: 100%; + box-sizing: border-box; + background: #fbfcfc; + color: #555; + cursor: pointer; +} + +.graphiql-container .search-box { + border-bottom: 1px solid #d3d6db; + display: flex; + align-items: center; + font-size: 14px; + margin: -15px -15px 12px 0; + position: relative; +} + +.graphiql-container .search-box-icon { + cursor: pointer; + display: block; + font-size: 24px; + transform: rotate(-45deg); + user-select: none; +} + +.graphiql-container .search-box .search-box-clear { + background-color: #d0d0d0; + border-radius: 12px; + color: #fff; + cursor: pointer; + font-size: 11px; + padding: 1px 5px 2px; + position: absolute; + right: 3px; + user-select: none; + border: 0; +} + +.graphiql-container .search-box .search-box-clear:hover { + background-color: #b9b9b9; +} + +.graphiql-container .search-box > input { + border: none; + box-sizing: border-box; + font-size: 14px; + outline: none; + padding: 6px 24px 8px 20px; + width: 100%; +} + +.graphiql-container .error-container { + font-weight: bold; + left: 0; + letter-spacing: 1px; + opacity: 0.5; + position: absolute; + right: 0; + text-align: center; + text-transform: uppercase; + top: 50%; + transform: translate(0, -50%); +} + +.graphiql-container .history-contents { + font-family: 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace; +} + +.graphiql-container .history-contents { + margin: 0; + padding: 0; +} + +.graphiql-container .history-contents li { + align-items: center; + display: flex; + font-size: 12px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin: 0; + padding: 8px; + border-bottom: 1px solid #e0e0e0; +} + +.graphiql-container .history-contents li button:not(.history-label) { + display: none; + margin-left: 10px; +} + +.graphiql-container .history-contents li:hover button:not(.history-label), +.graphiql-container + .history-contents + li:focus-within + button:not(.history-label) { + display: inline-block; +} + +.graphiql-container .history-contents input, +.graphiql-container .history-contents button { + padding: 0; + background: 0; + border: 0; + font-size: inherit; + font-family: inherit; + line-height: 14px; + color: inherit; +} + +.graphiql-container .history-contents input { + flex-grow: 1; +} + +.graphiql-container .history-contents input::placeholder { + color: inherit; +} + +.graphiql-container .history-contents button { + cursor: pointer; + text-align: left; +} + +.graphiql-container .history-contents .history-label { + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; +} + + +[class*=ant-] input::-ms-clear,[class*=ant-] input::-ms-reveal,[class*=ant-]::-ms-clear,[class^=ant-] input::-ms-clear,[class^=ant-] input::-ms-reveal,[class^=ant-]::-ms-clear{display:none}body,html{height:100%;width:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{box-sizing:border-box}html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:sans-serif;line-height:1.15}@-ms-viewport{width:device-width}body{font-feature-settings:"tnum";background-color:#fff;color:rgba(0,0,0,.85);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:14px;font-variant:tabular-nums;line-height:1.5715;margin:0}[tabindex="-1"]:focus{outline:none!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{color:rgba(0,0,0,.85);font-weight:500;margin-bottom:.5em;margin-top:0}p{margin-bottom:1em;margin-top:0}abbr[data-original-title],abbr[title]{border-bottom:0;cursor:help;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}address{font-style:normal;line-height:inherit;margin-bottom:1em}input[type=number],input[type=password],input[type=text],textarea{-webkit-appearance:none}dl,ol,ul{margin-bottom:1em;margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{-webkit-text-decoration-skip:objects;background-color:transparent;color:#1890ff;cursor:pointer;outline:none;text-decoration:none;transition:color .3s}a:hover{color:#40a9ff}a:active{color:#096dd9}a:active,a:focus,a:hover{outline:0;text-decoration:none}a[disabled]{color:rgba(0,0,0,.25);cursor:not-allowed}code,kbd,pre,samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}pre{margin-bottom:1em;margin-top:0;overflow:auto}figure{margin:0 0 1em}img{border-style:none;vertical-align:middle}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{caption-side:bottom;color:rgba(0,0,0,.45);padding-bottom:.3em;padding-top:.75em;text-align:left}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{border:0;margin:0;min-width:0;padding:0}legend{color:inherit;display:block;font-size:1.5em;line-height:inherit;margin-bottom:.5em;max-width:100%;padding:0;white-space:normal;width:100%}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:none;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{background-color:#feffe6;padding:.2em}::-moz-selection{background:#1890ff;color:#fff}::selection{background:#1890ff;color:#fff}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}.anticon{text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:inherit;display:inline-block;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em}.anticon>*{line-height:1}.anticon svg{display:inline-block}.anticon:before{display:none}.anticon .anticon-icon{display:block}.anticon>.anticon{line-height:0;vertical-align:0}.anticon[tabindex]{cursor:pointer}.anticon-spin,.anticon-spin:before{-webkit-animation:loadingCircle 1s linear infinite;animation:loadingCircle 1s linear infinite;display:inline-block}.ant-fade-appear,.ant-fade-enter,.ant-fade-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-fade-appear.ant-fade-appear-active,.ant-fade-enter.ant-fade-enter-active{-webkit-animation-name:antFadeIn;animation-name:antFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-fade-leave.ant-fade-leave-active{-webkit-animation-name:antFadeOut;animation-name:antFadeOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-fade-appear,.ant-fade-enter{opacity:0}.ant-fade-appear,.ant-fade-enter,.ant-fade-leave{-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes antFadeIn{0%{opacity:0}to{opacity:1}}@keyframes antFadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes antFadeOut{0%{opacity:1}to{opacity:0}}@keyframes antFadeOut{0%{opacity:1}to{opacity:0}}.ant-move-up-appear,.ant-move-up-enter,.ant-move-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-move-up-appear.ant-move-up-appear-active,.ant-move-up-enter.ant-move-up-enter-active{-webkit-animation-name:antMoveUpIn;animation-name:antMoveUpIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-move-up-leave.ant-move-up-leave-active{-webkit-animation-name:antMoveUpOut;animation-name:antMoveUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-move-up-appear,.ant-move-up-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0}.ant-move-up-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.ant-move-down-appear,.ant-move-down-enter,.ant-move-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-move-down-appear.ant-move-down-appear-active,.ant-move-down-enter.ant-move-down-enter-active{-webkit-animation-name:antMoveDownIn;animation-name:antMoveDownIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-move-down-leave.ant-move-down-leave-active{-webkit-animation-name:antMoveDownOut;animation-name:antMoveDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-move-down-appear,.ant-move-down-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0}.ant-move-down-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.ant-move-left-appear,.ant-move-left-enter,.ant-move-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-move-left-appear.ant-move-left-appear-active,.ant-move-left-enter.ant-move-left-enter-active{-webkit-animation-name:antMoveLeftIn;animation-name:antMoveLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-move-left-leave.ant-move-left-leave-active{-webkit-animation-name:antMoveLeftOut;animation-name:antMoveLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-move-left-appear,.ant-move-left-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0}.ant-move-left-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.ant-move-right-appear,.ant-move-right-enter,.ant-move-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-move-right-appear.ant-move-right-appear-active,.ant-move-right-enter.ant-move-right-enter-active{-webkit-animation-name:antMoveRightIn;animation-name:antMoveRightIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-move-right-leave.ant-move-right-leave-active{-webkit-animation-name:antMoveRightOut;animation-name:antMoveRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-move-right-appear,.ant-move-right-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0}.ant-move-right-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}@-webkit-keyframes antMoveDownIn{0%{opacity:0;transform:translateY(100%);transform-origin:0 0}to{opacity:1;transform:translateY(0);transform-origin:0 0}}@keyframes antMoveDownIn{0%{opacity:0;transform:translateY(100%);transform-origin:0 0}to{opacity:1;transform:translateY(0);transform-origin:0 0}}@-webkit-keyframes antMoveDownOut{0%{opacity:1;transform:translateY(0);transform-origin:0 0}to{opacity:0;transform:translateY(100%);transform-origin:0 0}}@keyframes antMoveDownOut{0%{opacity:1;transform:translateY(0);transform-origin:0 0}to{opacity:0;transform:translateY(100%);transform-origin:0 0}}@-webkit-keyframes antMoveLeftIn{0%{opacity:0;transform:translateX(-100%);transform-origin:0 0}to{opacity:1;transform:translateX(0);transform-origin:0 0}}@keyframes antMoveLeftIn{0%{opacity:0;transform:translateX(-100%);transform-origin:0 0}to{opacity:1;transform:translateX(0);transform-origin:0 0}}@-webkit-keyframes antMoveLeftOut{0%{opacity:1;transform:translateX(0);transform-origin:0 0}to{opacity:0;transform:translateX(-100%);transform-origin:0 0}}@keyframes antMoveLeftOut{0%{opacity:1;transform:translateX(0);transform-origin:0 0}to{opacity:0;transform:translateX(-100%);transform-origin:0 0}}@-webkit-keyframes antMoveRightIn{0%{opacity:0;transform:translateX(100%);transform-origin:0 0}to{opacity:1;transform:translateX(0);transform-origin:0 0}}@keyframes antMoveRightIn{0%{opacity:0;transform:translateX(100%);transform-origin:0 0}to{opacity:1;transform:translateX(0);transform-origin:0 0}}@-webkit-keyframes antMoveRightOut{0%{opacity:1;transform:translateX(0);transform-origin:0 0}to{opacity:0;transform:translateX(100%);transform-origin:0 0}}@keyframes antMoveRightOut{0%{opacity:1;transform:translateX(0);transform-origin:0 0}to{opacity:0;transform:translateX(100%);transform-origin:0 0}}@-webkit-keyframes antMoveUpIn{0%{opacity:0;transform:translateY(-100%);transform-origin:0 0}to{opacity:1;transform:translateY(0);transform-origin:0 0}}@keyframes antMoveUpIn{0%{opacity:0;transform:translateY(-100%);transform-origin:0 0}to{opacity:1;transform:translateY(0);transform-origin:0 0}}@-webkit-keyframes antMoveUpOut{0%{opacity:1;transform:translateY(0);transform-origin:0 0}to{opacity:0;transform:translateY(-100%);transform-origin:0 0}}@keyframes antMoveUpOut{0%{opacity:1;transform:translateY(0);transform-origin:0 0}to{opacity:0;transform:translateY(-100%);transform-origin:0 0}}@-webkit-keyframes loadingCircle{to{transform:rotate(1turn)}}@keyframes loadingCircle{to{transform:rotate(1turn)}}[ant-click-animating-without-extra-node=true],[ant-click-animating=true]{position:relative}html{--antd-wave-shadow-color:#1890ff;--scroll-bar:0}.ant-click-animating-node,[ant-click-animating-without-extra-node=true]:after{-webkit-animation:fadeEffect 2s cubic-bezier(.08,.82,.17,1),waveEffect .4s cubic-bezier(.08,.82,.17,1);animation:fadeEffect 2s cubic-bezier(.08,.82,.17,1),waveEffect .4s cubic-bezier(.08,.82,.17,1);-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;border-radius:inherit;bottom:0;box-shadow:0 0 0 0 #1890ff;box-shadow:0 0 0 0 var(--antd-wave-shadow-color);content:"";display:block;left:0;opacity:.2;pointer-events:none;position:absolute;right:0;top:0}@-webkit-keyframes waveEffect{to{box-shadow:0 0 0 #1890ff;box-shadow:0 0 0 6px var(--antd-wave-shadow-color)}}@keyframes waveEffect{to{box-shadow:0 0 0 #1890ff;box-shadow:0 0 0 6px var(--antd-wave-shadow-color)}}@-webkit-keyframes fadeEffect{to{opacity:0}}@keyframes fadeEffect{to{opacity:0}}.ant-slide-up-appear,.ant-slide-up-enter,.ant-slide-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-slide-up-appear.ant-slide-up-appear-active,.ant-slide-up-enter.ant-slide-up-enter-active{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-slide-up-leave.ant-slide-up-leave-active{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-slide-up-appear,.ant-slide-up-enter{-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1);opacity:0}.ant-slide-up-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.ant-slide-down-appear,.ant-slide-down-enter,.ant-slide-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-slide-down-appear.ant-slide-down-appear-active,.ant-slide-down-enter.ant-slide-down-enter-active{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-slide-down-leave.ant-slide-down-leave-active{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-slide-down-appear,.ant-slide-down-enter{-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1);opacity:0}.ant-slide-down-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.ant-slide-left-appear,.ant-slide-left-enter,.ant-slide-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-slide-left-appear.ant-slide-left-appear-active,.ant-slide-left-enter.ant-slide-left-enter-active{-webkit-animation-name:antSlideLeftIn;animation-name:antSlideLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-slide-left-leave.ant-slide-left-leave-active{-webkit-animation-name:antSlideLeftOut;animation-name:antSlideLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-slide-left-appear,.ant-slide-left-enter{-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1);opacity:0}.ant-slide-left-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.ant-slide-right-appear,.ant-slide-right-enter,.ant-slide-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-slide-right-appear.ant-slide-right-appear-active,.ant-slide-right-enter.ant-slide-right-enter-active{-webkit-animation-name:antSlideRightIn;animation-name:antSlideRightIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-slide-right-leave.ant-slide-right-leave-active{-webkit-animation-name:antSlideRightOut;animation-name:antSlideRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-slide-right-appear,.ant-slide-right-enter{-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1);opacity:0}.ant-slide-right-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}@-webkit-keyframes antSlideUpIn{0%{opacity:0;transform:scaleY(.8);transform-origin:0 0}to{opacity:1;transform:scaleY(1);transform-origin:0 0}}@keyframes antSlideUpIn{0%{opacity:0;transform:scaleY(.8);transform-origin:0 0}to{opacity:1;transform:scaleY(1);transform-origin:0 0}}@-webkit-keyframes antSlideUpOut{0%{opacity:1;transform:scaleY(1);transform-origin:0 0}to{opacity:0;transform:scaleY(.8);transform-origin:0 0}}@keyframes antSlideUpOut{0%{opacity:1;transform:scaleY(1);transform-origin:0 0}to{opacity:0;transform:scaleY(.8);transform-origin:0 0}}@-webkit-keyframes antSlideDownIn{0%{opacity:0;transform:scaleY(.8);transform-origin:100% 100%}to{opacity:1;transform:scaleY(1);transform-origin:100% 100%}}@keyframes antSlideDownIn{0%{opacity:0;transform:scaleY(.8);transform-origin:100% 100%}to{opacity:1;transform:scaleY(1);transform-origin:100% 100%}}@-webkit-keyframes antSlideDownOut{0%{opacity:1;transform:scaleY(1);transform-origin:100% 100%}to{opacity:0;transform:scaleY(.8);transform-origin:100% 100%}}@keyframes antSlideDownOut{0%{opacity:1;transform:scaleY(1);transform-origin:100% 100%}to{opacity:0;transform:scaleY(.8);transform-origin:100% 100%}}@-webkit-keyframes antSlideLeftIn{0%{opacity:0;transform:scaleX(.8);transform-origin:0 0}to{opacity:1;transform:scaleX(1);transform-origin:0 0}}@keyframes antSlideLeftIn{0%{opacity:0;transform:scaleX(.8);transform-origin:0 0}to{opacity:1;transform:scaleX(1);transform-origin:0 0}}@-webkit-keyframes antSlideLeftOut{0%{opacity:1;transform:scaleX(1);transform-origin:0 0}to{opacity:0;transform:scaleX(.8);transform-origin:0 0}}@keyframes antSlideLeftOut{0%{opacity:1;transform:scaleX(1);transform-origin:0 0}to{opacity:0;transform:scaleX(.8);transform-origin:0 0}}@-webkit-keyframes antSlideRightIn{0%{opacity:0;transform:scaleX(.8);transform-origin:100% 0}to{opacity:1;transform:scaleX(1);transform-origin:100% 0}}@keyframes antSlideRightIn{0%{opacity:0;transform:scaleX(.8);transform-origin:100% 0}to{opacity:1;transform:scaleX(1);transform-origin:100% 0}}@-webkit-keyframes antSlideRightOut{0%{opacity:1;transform:scaleX(1);transform-origin:100% 0}to{opacity:0;transform:scaleX(.8);transform-origin:100% 0}}@keyframes antSlideRightOut{0%{opacity:1;transform:scaleX(1);transform-origin:100% 0}to{opacity:0;transform:scaleX(.8);transform-origin:100% 0}}.ant-zoom-appear,.ant-zoom-enter,.ant-zoom-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-appear.ant-zoom-appear-active,.ant-zoom-enter.ant-zoom-enter-active{-webkit-animation-name:antZoomIn;animation-name:antZoomIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-leave.ant-zoom-leave-active{-webkit-animation-name:antZoomOut;animation-name:antZoomOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-appear,.ant-zoom-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-appear-prepare,.ant-zoom-enter-prepare{transform:none}.ant-zoom-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-big-appear,.ant-zoom-big-enter,.ant-zoom-big-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-big-appear.ant-zoom-big-appear-active,.ant-zoom-big-enter.ant-zoom-big-enter-active{-webkit-animation-name:antZoomBigIn;animation-name:antZoomBigIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-big-leave.ant-zoom-big-leave-active{-webkit-animation-name:antZoomBigOut;animation-name:antZoomBigOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-big-appear,.ant-zoom-big-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-big-appear-prepare,.ant-zoom-big-enter-prepare{transform:none}.ant-zoom-big-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-big-fast-appear,.ant-zoom-big-fast-enter,.ant-zoom-big-fast-leave{-webkit-animation-duration:.1s;animation-duration:.1s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-big-fast-appear.ant-zoom-big-fast-appear-active,.ant-zoom-big-fast-enter.ant-zoom-big-fast-enter-active{-webkit-animation-name:antZoomBigIn;animation-name:antZoomBigIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-big-fast-leave.ant-zoom-big-fast-leave-active{-webkit-animation-name:antZoomBigOut;animation-name:antZoomBigOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-big-fast-appear,.ant-zoom-big-fast-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-big-fast-appear-prepare,.ant-zoom-big-fast-enter-prepare{transform:none}.ant-zoom-big-fast-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-up-appear,.ant-zoom-up-enter,.ant-zoom-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-up-appear.ant-zoom-up-appear-active,.ant-zoom-up-enter.ant-zoom-up-enter-active{-webkit-animation-name:antZoomUpIn;animation-name:antZoomUpIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-up-leave.ant-zoom-up-leave-active{-webkit-animation-name:antZoomUpOut;animation-name:antZoomUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-up-appear,.ant-zoom-up-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-up-appear-prepare,.ant-zoom-up-enter-prepare{transform:none}.ant-zoom-up-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-down-appear,.ant-zoom-down-enter,.ant-zoom-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-down-appear.ant-zoom-down-appear-active,.ant-zoom-down-enter.ant-zoom-down-enter-active{-webkit-animation-name:antZoomDownIn;animation-name:antZoomDownIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-down-leave.ant-zoom-down-leave-active{-webkit-animation-name:antZoomDownOut;animation-name:antZoomDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-down-appear,.ant-zoom-down-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-down-appear-prepare,.ant-zoom-down-enter-prepare{transform:none}.ant-zoom-down-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-left-appear,.ant-zoom-left-enter,.ant-zoom-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-left-appear.ant-zoom-left-appear-active,.ant-zoom-left-enter.ant-zoom-left-enter-active{-webkit-animation-name:antZoomLeftIn;animation-name:antZoomLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-left-leave.ant-zoom-left-leave-active{-webkit-animation-name:antZoomLeftOut;animation-name:antZoomLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-left-appear,.ant-zoom-left-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-left-appear-prepare,.ant-zoom-left-enter-prepare{transform:none}.ant-zoom-left-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-right-appear,.ant-zoom-right-enter,.ant-zoom-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-right-appear.ant-zoom-right-appear-active,.ant-zoom-right-enter.ant-zoom-right-enter-active{-webkit-animation-name:antZoomRightIn;animation-name:antZoomRightIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-right-leave.ant-zoom-right-leave-active{-webkit-animation-name:antZoomRightOut;animation-name:antZoomRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-right-appear,.ant-zoom-right-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-right-appear-prepare,.ant-zoom-right-enter-prepare{transform:none}.ant-zoom-right-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}@-webkit-keyframes antZoomIn{0%{opacity:0;transform:scale(.2)}to{opacity:1;transform:scale(1)}}@keyframes antZoomIn{0%{opacity:0;transform:scale(.2)}to{opacity:1;transform:scale(1)}}@-webkit-keyframes antZoomOut{0%{transform:scale(1)}to{opacity:0;transform:scale(.2)}}@keyframes antZoomOut{0%{transform:scale(1)}to{opacity:0;transform:scale(.2)}}@-webkit-keyframes antZoomBigIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes antZoomBigIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@-webkit-keyframes antZoomBigOut{0%{transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes antZoomBigOut{0%{transform:scale(1)}to{opacity:0;transform:scale(.8)}}@-webkit-keyframes antZoomUpIn{0%{opacity:0;transform:scale(.8);transform-origin:50% 0}to{transform:scale(1);transform-origin:50% 0}}@keyframes antZoomUpIn{0%{opacity:0;transform:scale(.8);transform-origin:50% 0}to{transform:scale(1);transform-origin:50% 0}}@-webkit-keyframes antZoomUpOut{0%{transform:scale(1);transform-origin:50% 0}to{opacity:0;transform:scale(.8);transform-origin:50% 0}}@keyframes antZoomUpOut{0%{transform:scale(1);transform-origin:50% 0}to{opacity:0;transform:scale(.8);transform-origin:50% 0}}@-webkit-keyframes antZoomLeftIn{0%{opacity:0;transform:scale(.8);transform-origin:0 50%}to{transform:scale(1);transform-origin:0 50%}}@keyframes antZoomLeftIn{0%{opacity:0;transform:scale(.8);transform-origin:0 50%}to{transform:scale(1);transform-origin:0 50%}}@-webkit-keyframes antZoomLeftOut{0%{transform:scale(1);transform-origin:0 50%}to{opacity:0;transform:scale(.8);transform-origin:0 50%}}@keyframes antZoomLeftOut{0%{transform:scale(1);transform-origin:0 50%}to{opacity:0;transform:scale(.8);transform-origin:0 50%}}@-webkit-keyframes antZoomRightIn{0%{opacity:0;transform:scale(.8);transform-origin:100% 50%}to{transform:scale(1);transform-origin:100% 50%}}@keyframes antZoomRightIn{0%{opacity:0;transform:scale(.8);transform-origin:100% 50%}to{transform:scale(1);transform-origin:100% 50%}}@-webkit-keyframes antZoomRightOut{0%{transform:scale(1);transform-origin:100% 50%}to{opacity:0;transform:scale(.8);transform-origin:100% 50%}}@keyframes antZoomRightOut{0%{transform:scale(1);transform-origin:100% 50%}to{opacity:0;transform:scale(.8);transform-origin:100% 50%}}@-webkit-keyframes antZoomDownIn{0%{opacity:0;transform:scale(.8);transform-origin:50% 100%}to{transform:scale(1);transform-origin:50% 100%}}@keyframes antZoomDownIn{0%{opacity:0;transform:scale(.8);transform-origin:50% 100%}to{transform:scale(1);transform-origin:50% 100%}}@-webkit-keyframes antZoomDownOut{0%{transform:scale(1);transform-origin:50% 100%}to{opacity:0;transform:scale(.8);transform-origin:50% 100%}}@keyframes antZoomDownOut{0%{transform:scale(1);transform-origin:50% 100%}to{opacity:0;transform:scale(.8);transform-origin:50% 100%}}.ant-motion-collapse-legacy{overflow:hidden}.ant-motion-collapse,.ant-motion-collapse-legacy-active{transition:height .2s cubic-bezier(.645,.045,.355,1),opacity .2s cubic-bezier(.645,.045,.355,1)!important}.ant-motion-collapse{overflow:hidden}.ant-affix{position:fixed;z-index:10}.ant-alert{font-feature-settings:"tnum";word-wrap:break-word;align-items:center;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:8px 15px;position:relative}.ant-alert-content{flex:1;min-width:0}.ant-alert-icon{margin-right:8px}.ant-alert-description{display:none;font-size:14px;line-height:22px}.ant-alert-success{background-color:#f6ffed;border:1px solid #b7eb8f}.ant-alert-success .ant-alert-icon{color:#52c41a}.ant-alert-info{background-color:#e6f7ff;border:1px solid #91d5ff}.ant-alert-info .ant-alert-icon{color:#1890ff}.ant-alert-warning{background-color:#fffbe6;border:1px solid #ffe58f}.ant-alert-warning .ant-alert-icon{color:#faad14}.ant-alert-error{background-color:#fff2f0;border:1px solid #ffccc7}.ant-alert-error .ant-alert-icon{color:#ff4d4f}.ant-alert-error .ant-alert-description>pre{margin:0;padding:0}.ant-alert-action{margin-left:8px}.ant-alert-close-icon{background-color:transparent;border:none;cursor:pointer;font-size:12px;line-height:12px;margin-left:8px;outline:none;overflow:hidden;padding:0}.ant-alert-close-icon .anticon-close{color:rgba(0,0,0,.45);transition:color .3s}.ant-alert-close-icon .anticon-close:hover{color:rgba(0,0,0,.75)}.ant-alert-close-text{color:rgba(0,0,0,.45);transition:color .3s}.ant-alert-close-text:hover{color:rgba(0,0,0,.75)}.ant-alert-with-description{align-items:flex-start;padding:15px 15px 15px 24px}.ant-alert-with-description.ant-alert-no-icon{padding:15px}.ant-alert-with-description .ant-alert-icon{font-size:24px;margin-right:15px}.ant-alert-with-description .ant-alert-message{color:rgba(0,0,0,.85);display:block;font-size:16px;margin-bottom:4px}.ant-alert-message{color:rgba(0,0,0,.85)}.ant-alert-with-description .ant-alert-description{display:block}.ant-alert.ant-alert-motion-leave{opacity:1;overflow:hidden;transition:max-height .3s cubic-bezier(.78,.14,.15,.86),opacity .3s cubic-bezier(.78,.14,.15,.86),padding-top .3s cubic-bezier(.78,.14,.15,.86),padding-bottom .3s cubic-bezier(.78,.14,.15,.86),margin-bottom .3s cubic-bezier(.78,.14,.15,.86)}.ant-alert.ant-alert-motion-leave-active{margin-bottom:0!important;max-height:0;opacity:0;padding-bottom:0;padding-top:0}.ant-alert-banner{border:0;border-radius:0;margin-bottom:0}.ant-alert.ant-alert-rtl{direction:rtl}.ant-alert-rtl .ant-alert-icon{margin-left:8px;margin-right:auto}.ant-alert-rtl .ant-alert-action,.ant-alert-rtl .ant-alert-close-icon{margin-left:auto;margin-right:8px}.ant-alert-rtl.ant-alert-with-description{padding-left:15px;padding-right:24px}.ant-alert-rtl.ant-alert-with-description .ant-alert-icon{margin-left:15px;margin-right:auto}.ant-anchor{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0 0 0 2px;position:relative}.ant-anchor-wrapper{background-color:transparent;margin-left:-4px;overflow:auto;padding-left:4px}.ant-anchor-ink{height:100%;left:0;position:absolute;top:0}.ant-anchor-ink:before{background-color:#f0f0f0;content:" ";display:block;height:100%;margin:0 auto;position:relative;width:2px}.ant-anchor-ink-ball{background-color:#fff;border:2px solid #1890ff;border-radius:8px;display:none;height:8px;left:50%;position:absolute;transform:translateX(-50%);transition:top .3s ease-in-out;width:8px}.ant-anchor-ink-ball.visible{display:inline-block}.ant-anchor-fixed .ant-anchor-ink .ant-anchor-ink-ball{display:none}.ant-anchor-link{padding:4px 0 4px 16px}.ant-anchor-link-title{color:rgba(0,0,0,.85);display:block;margin-bottom:3px;overflow:hidden;position:relative;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-anchor-link-title:only-child{margin-bottom:0}.ant-anchor-link-active>.ant-anchor-link-title{color:#1890ff}.ant-anchor-link .ant-anchor-link{padding-bottom:2px;padding-top:2px}.ant-anchor-rtl{direction:rtl}.ant-anchor-rtl.ant-anchor-wrapper{margin-left:0;margin-right:-4px;padding-left:0;padding-right:4px}.ant-anchor-rtl .ant-anchor-ink{left:auto;right:0}.ant-anchor-rtl .ant-anchor-ink-ball{left:0;right:50%;transform:translateX(50%)}.ant-anchor-rtl .ant-anchor-link{padding:4px 16px 4px 0}.ant-select-auto-complete{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-select-auto-complete .ant-select-clear{right:13px}.ant-avatar{font-feature-settings:"tnum";background:#ccc;border-radius:50%;box-sizing:border-box;color:rgba(0,0,0,.85);color:#fff;display:inline-block;font-size:14px;font-variant:tabular-nums;height:32px;line-height:1.5715;line-height:32px;list-style:none;margin:0;overflow:hidden;padding:0;position:relative;text-align:center;vertical-align:middle;white-space:nowrap;width:32px}.ant-avatar-image{background:transparent}.ant-avatar .ant-image-img{display:block}.ant-avatar-string{left:50%;position:absolute;transform-origin:0 center}.ant-avatar.ant-avatar-icon{font-size:18px}.ant-avatar.ant-avatar-icon>.anticon{margin:0}.ant-avatar-lg{border-radius:50%;height:40px;line-height:40px;width:40px}.ant-avatar-lg-string{left:50%;position:absolute;transform-origin:0 center}.ant-avatar-lg.ant-avatar-icon{font-size:24px}.ant-avatar-lg.ant-avatar-icon>.anticon{margin:0}.ant-avatar-sm{border-radius:50%;height:24px;line-height:24px;width:24px}.ant-avatar-sm-string{left:50%;position:absolute;transform-origin:0 center}.ant-avatar-sm.ant-avatar-icon{font-size:14px}.ant-avatar-sm.ant-avatar-icon>.anticon{margin:0}.ant-avatar-square{border-radius:2px}.ant-avatar>img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.ant-avatar-group{display:inline-flex}.ant-avatar-group .ant-avatar{border:1px solid #fff}.ant-avatar-group .ant-avatar:not(:first-child){margin-left:-8px}.ant-avatar-group-popover .ant-avatar+.ant-avatar{margin-left:3px}.ant-avatar-group-rtl .ant-avatar:not(:first-child){margin-left:0;margin-right:-8px}.ant-avatar-group-popover.ant-popover-rtl .ant-avatar+.ant-avatar{margin-left:0;margin-right:3px}.ant-back-top{font-feature-settings:"tnum";bottom:50px;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;height:40px;line-height:1.5715;list-style:none;margin:0;padding:0;position:fixed;right:100px;width:40px;z-index:10}.ant-back-top:empty{display:none}.ant-back-top-rtl{direction:rtl;left:100px;right:auto}.ant-back-top-content{background-color:rgba(0,0,0,.45);border-radius:20px;color:#fff;height:40px;overflow:hidden;text-align:center;transition:all .3s;width:40px}.ant-back-top-content:hover{background-color:rgba(0,0,0,.85);transition:all .3s}.ant-back-top-icon{font-size:24px;line-height:40px}@media screen and (max-width:768px){.ant-back-top{right:60px}.ant-back-top-rtl{left:60px;right:auto}}@media screen and (max-width:480px){.ant-back-top{right:20px}.ant-back-top-rtl{left:20px;right:auto}}.ant-badge{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;padding:0;position:relative}.ant-badge-count{background:#ff4d4f;border-radius:10px;box-shadow:0 0 0 1px #fff;color:#fff;font-size:12px;font-weight:400;height:20px;line-height:20px;min-width:20px;padding:0 6px;text-align:center;white-space:nowrap;z-index:auto}.ant-badge-count a,.ant-badge-count a:hover{color:#fff}.ant-badge-count-sm{border-radius:7px;font-size:12px;height:14px;line-height:14px;min-width:14px;padding:0}.ant-badge-multiple-words{padding:0 8px}.ant-badge-dot{background:#ff4d4f;border-radius:100%;box-shadow:0 0 0 1px #fff;height:6px;min-width:6px;width:6px;z-index:auto}.ant-badge-dot.ant-scroll-number{transition:background 1.5s}.ant-badge .ant-scroll-number-custom-component,.ant-badge-count,.ant-badge-dot{position:absolute;right:0;top:0;transform:translate(50%,-50%);transform-origin:100% 0}.ant-badge .ant-scroll-number-custom-component.anticon-spin,.ant-badge-count.anticon-spin,.ant-badge-dot.anticon-spin{-webkit-animation:antBadgeLoadingCircle 1s linear infinite;animation:antBadgeLoadingCircle 1s linear infinite}.ant-badge-status{line-height:inherit;vertical-align:baseline}.ant-badge-status-dot{border-radius:50%;display:inline-block;height:6px;position:relative;top:-1px;vertical-align:middle;width:6px}.ant-badge-status-success{background-color:#52c41a}.ant-badge-status-processing{background-color:#1890ff;position:relative}.ant-badge-status-processing:after{-webkit-animation:antStatusProcessing 1.2s ease-in-out infinite;animation:antStatusProcessing 1.2s ease-in-out infinite;border:1px solid #1890ff;border-radius:50%;content:"";height:100%;left:0;position:absolute;top:0;width:100%}.ant-badge-status-default{background-color:#d9d9d9}.ant-badge-status-error{background-color:#ff4d4f}.ant-badge-status-warning{background-color:#faad14}.ant-badge-status-magenta,.ant-badge-status-pink{background:#eb2f96}.ant-badge-status-red{background:#f5222d}.ant-badge-status-volcano{background:#fa541c}.ant-badge-status-orange{background:#fa8c16}.ant-badge-status-yellow{background:#fadb14}.ant-badge-status-gold{background:#faad14}.ant-badge-status-cyan{background:#13c2c2}.ant-badge-status-lime{background:#a0d911}.ant-badge-status-green{background:#52c41a}.ant-badge-status-blue{background:#1890ff}.ant-badge-status-geekblue{background:#2f54eb}.ant-badge-status-purple{background:#722ed1}.ant-badge-status-text{color:rgba(0,0,0,.85);font-size:14px;margin-left:8px}.ant-badge-zoom-appear,.ant-badge-zoom-enter{-webkit-animation:antZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);animation:antZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-badge-zoom-leave{-webkit-animation:antZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);animation:antZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-badge-not-a-wrapper .ant-badge-zoom-appear,.ant-badge-not-a-wrapper .ant-badge-zoom-enter{-webkit-animation:antNoWrapperZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);animation:antNoWrapperZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46)}.ant-badge-not-a-wrapper .ant-badge-zoom-leave{-webkit-animation:antNoWrapperZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);animation:antNoWrapperZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6)}.ant-badge-not-a-wrapper:not(.ant-badge-status){vertical-align:middle}.ant-badge-not-a-wrapper .ant-badge-count,.ant-badge-not-a-wrapper .ant-scroll-number-custom-component{transform:none}.ant-badge-not-a-wrapper .ant-scroll-number,.ant-badge-not-a-wrapper .ant-scroll-number-custom-component{display:block;position:relative;top:auto;transform-origin:50% 50%}@-webkit-keyframes antStatusProcessing{0%{opacity:.5;transform:scale(.8)}to{opacity:0;transform:scale(2.4)}}@keyframes antStatusProcessing{0%{opacity:.5;transform:scale(.8)}to{opacity:0;transform:scale(2.4)}}.ant-scroll-number{direction:ltr;overflow:hidden}.ant-scroll-number-only{display:inline-block;position:relative;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-scroll-number-only,.ant-scroll-number-only>p.ant-scroll-number-only-unit{-webkit-backface-visibility:hidden;height:20px;-webkit-transform-style:preserve-3d}.ant-scroll-number-only>p.ant-scroll-number-only-unit{margin:0}.ant-scroll-number-symbol{vertical-align:top}@-webkit-keyframes antZoomBadgeIn{0%{opacity:0;transform:scale(0) translate(50%,-50%)}to{transform:scale(1) translate(50%,-50%)}}@keyframes antZoomBadgeIn{0%{opacity:0;transform:scale(0) translate(50%,-50%)}to{transform:scale(1) translate(50%,-50%)}}@-webkit-keyframes antZoomBadgeOut{0%{transform:scale(1) translate(50%,-50%)}to{opacity:0;transform:scale(0) translate(50%,-50%)}}@keyframes antZoomBadgeOut{0%{transform:scale(1) translate(50%,-50%)}to{opacity:0;transform:scale(0) translate(50%,-50%)}}@-webkit-keyframes antNoWrapperZoomBadgeIn{0%{opacity:0;transform:scale(0)}to{transform:scale(1)}}@keyframes antNoWrapperZoomBadgeIn{0%{opacity:0;transform:scale(0)}to{transform:scale(1)}}@-webkit-keyframes antNoWrapperZoomBadgeOut{0%{transform:scale(1)}to{opacity:0;transform:scale(0)}}@keyframes antNoWrapperZoomBadgeOut{0%{transform:scale(1)}to{opacity:0;transform:scale(0)}}@-webkit-keyframes antBadgeLoadingCircle{0%{transform-origin:50%}to{transform:translate(50%,-50%) rotate(1turn);transform-origin:50%}}@keyframes antBadgeLoadingCircle{0%{transform-origin:50%}to{transform:translate(50%,-50%) rotate(1turn);transform-origin:50%}}.ant-ribbon-wrapper{position:relative}.ant-ribbon{font-feature-settings:"tnum";background-color:#1890ff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);color:#fff;font-size:14px;font-variant:tabular-nums;height:22px;line-height:1.5715;line-height:22px;list-style:none;margin:0;padding:0 8px;position:absolute;top:8px;white-space:nowrap}.ant-ribbon-text{color:#fff}.ant-ribbon-corner{border:4px solid;color:currentcolor;height:8px;position:absolute;top:100%;transform:scaleY(.75);transform-origin:top;width:8px}.ant-ribbon-corner:after{border:inherit;color:rgba(0,0,0,.25);content:"";height:inherit;left:-4px;position:absolute;top:-4px;width:inherit}.ant-ribbon-color-magenta,.ant-ribbon-color-pink{background:#eb2f96;color:#eb2f96}.ant-ribbon-color-red{background:#f5222d;color:#f5222d}.ant-ribbon-color-volcano{background:#fa541c;color:#fa541c}.ant-ribbon-color-orange{background:#fa8c16;color:#fa8c16}.ant-ribbon-color-yellow{background:#fadb14;color:#fadb14}.ant-ribbon-color-gold{background:#faad14;color:#faad14}.ant-ribbon-color-cyan{background:#13c2c2;color:#13c2c2}.ant-ribbon-color-lime{background:#a0d911;color:#a0d911}.ant-ribbon-color-green{background:#52c41a;color:#52c41a}.ant-ribbon-color-blue{background:#1890ff;color:#1890ff}.ant-ribbon-color-geekblue{background:#2f54eb;color:#2f54eb}.ant-ribbon-color-purple{background:#722ed1;color:#722ed1}.ant-ribbon.ant-ribbon-placement-end{border-bottom-right-radius:0;right:-8px}.ant-ribbon.ant-ribbon-placement-end .ant-ribbon-corner{border-color:currentcolor transparent transparent currentcolor;right:0}.ant-ribbon.ant-ribbon-placement-start{border-bottom-left-radius:0;left:-8px}.ant-ribbon.ant-ribbon-placement-start .ant-ribbon-corner{border-color:currentcolor currentcolor transparent transparent;left:0}.ant-badge-rtl{direction:rtl}.ant-badge-rtl.ant-badge:not(.ant-badge-not-a-wrapper) .ant-badge-count,.ant-badge-rtl.ant-badge:not(.ant-badge-not-a-wrapper) .ant-badge-dot,.ant-badge-rtl.ant-badge:not(.ant-badge-not-a-wrapper) .ant-scroll-number-custom-component{direction:ltr;left:0;right:auto;transform:translate(-50%,-50%);transform-origin:0 0}.ant-badge-rtl.ant-badge:not(.ant-badge-not-a-wrapper) .ant-scroll-number-custom-component{left:0;right:auto;transform:translate(-50%,-50%);transform-origin:0 0}.ant-badge-rtl .ant-badge-status-text{margin-left:0;margin-right:8px}.ant-badge:not(.ant-badge-not-a-wrapper).ant-badge-rtl .ant-badge-zoom-appear,.ant-badge:not(.ant-badge-not-a-wrapper).ant-badge-rtl .ant-badge-zoom-enter{-webkit-animation-name:antZoomBadgeInRtl;animation-name:antZoomBadgeInRtl}.ant-badge:not(.ant-badge-not-a-wrapper).ant-badge-rtl .ant-badge-zoom-leave{-webkit-animation-name:antZoomBadgeOutRtl;animation-name:antZoomBadgeOutRtl}.ant-ribbon-rtl{direction:rtl}.ant-ribbon-rtl.ant-ribbon-placement-end{border-bottom-left-radius:0;border-bottom-right-radius:2px;left:-8px;right:unset}.ant-ribbon-rtl.ant-ribbon-placement-end .ant-ribbon-corner{left:0;right:unset}.ant-ribbon-rtl.ant-ribbon-placement-end .ant-ribbon-corner,.ant-ribbon-rtl.ant-ribbon-placement-end .ant-ribbon-corner:after{border-color:currentcolor currentcolor transparent transparent}.ant-ribbon-rtl.ant-ribbon-placement-start{border-bottom-left-radius:2px;border-bottom-right-radius:0;left:unset;right:-8px}.ant-ribbon-rtl.ant-ribbon-placement-start .ant-ribbon-corner{left:unset;right:0}.ant-ribbon-rtl.ant-ribbon-placement-start .ant-ribbon-corner,.ant-ribbon-rtl.ant-ribbon-placement-start .ant-ribbon-corner:after{border-color:currentcolor transparent transparent currentcolor}@-webkit-keyframes antZoomBadgeInRtl{0%{opacity:0;transform:scale(0) translate(-50%,-50%)}to{transform:scale(1) translate(-50%,-50%)}}@keyframes antZoomBadgeInRtl{0%{opacity:0;transform:scale(0) translate(-50%,-50%)}to{transform:scale(1) translate(-50%,-50%)}}@-webkit-keyframes antZoomBadgeOutRtl{0%{transform:scale(1) translate(-50%,-50%)}to{opacity:0;transform:scale(0) translate(-50%,-50%)}}@keyframes antZoomBadgeOutRtl{0%{transform:scale(1) translate(-50%,-50%)}to{opacity:0;transform:scale(0) translate(-50%,-50%)}}.ant-breadcrumb{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);color:rgba(0,0,0,.45);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-breadcrumb .anticon{font-size:14px}.ant-breadcrumb ol{display:flex;flex-wrap:wrap;list-style:none;margin:0;padding:0}.ant-breadcrumb a{color:rgba(0,0,0,.45);transition:color .3s}.ant-breadcrumb a:hover,.ant-breadcrumb li:last-child,.ant-breadcrumb li:last-child a{color:rgba(0,0,0,.85)}li:last-child>.ant-breadcrumb-separator{display:none}.ant-breadcrumb-separator{color:rgba(0,0,0,.45);margin:0 8px}.ant-breadcrumb-link>.anticon+a,.ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-overlay-link>.anticon{margin-left:4px}.ant-breadcrumb-rtl{direction:rtl}.ant-breadcrumb-rtl:before{content:"";display:table}.ant-breadcrumb-rtl:after{clear:both;content:"";display:table}.ant-breadcrumb-rtl>span{float:right}.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+a,.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-rtl .ant-breadcrumb-overlay-link>.anticon{margin-left:0;margin-right:4px}.ant-btn{background-image:none;background:#fff;border:1px solid #d9d9d9;border-radius:2px;box-shadow:0 2px 0 rgba(0,0,0,.015);color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;font-weight:400;height:32px;line-height:1.5715;padding:4px 15px;position:relative;text-align:center;touch-action:manipulation;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.ant-btn>.anticon{line-height:1}.ant-btn,.ant-btn:active,.ant-btn:focus{outline:0}.ant-btn:not([disabled]):hover{text-decoration:none}.ant-btn:not([disabled]):active{box-shadow:none;outline:0}.ant-btn[disabled]{cursor:not-allowed}.ant-btn[disabled]>*{pointer-events:none}.ant-btn-lg{border-radius:2px;font-size:16px;height:40px;padding:6.4px 15px}.ant-btn-sm{border-radius:2px;font-size:14px;height:24px;padding:0 7px}.ant-btn>a:only-child{color:currentcolor}.ant-btn>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn:focus,.ant-btn:hover{background:#fff;border-color:#40a9ff;color:#40a9ff}.ant-btn:focus>a:only-child,.ant-btn:hover>a:only-child{color:currentcolor}.ant-btn:focus>a:only-child:after,.ant-btn:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn:active{background:#fff;border-color:#096dd9;color:#096dd9}.ant-btn:active>a:only-child{color:currentcolor}.ant-btn:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn[disabled],.ant-btn[disabled]:active,.ant-btn[disabled]:focus,.ant-btn[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn[disabled]:active>a:only-child,.ant-btn[disabled]:focus>a:only-child,.ant-btn[disabled]:hover>a:only-child,.ant-btn[disabled]>a:only-child{color:currentcolor}.ant-btn[disabled]:active>a:only-child:after,.ant-btn[disabled]:focus>a:only-child:after,.ant-btn[disabled]:hover>a:only-child:after,.ant-btn[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn:active,.ant-btn:focus,.ant-btn:hover{background:#fff;text-decoration:none}.ant-btn>span{display:inline-block}.ant-btn-primary{background:#1890ff;border-color:#1890ff;box-shadow:0 2px 0 rgba(0,0,0,.045);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.12)}.ant-btn-primary>a:only-child{color:currentcolor}.ant-btn-primary>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-primary:focus,.ant-btn-primary:hover{background:#40a9ff;border-color:#40a9ff;color:#fff}.ant-btn-primary:focus>a:only-child,.ant-btn-primary:hover>a:only-child{color:currentcolor}.ant-btn-primary:focus>a:only-child:after,.ant-btn-primary:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-primary:active{background:#096dd9;border-color:#096dd9;color:#fff}.ant-btn-primary:active>a:only-child{color:currentcolor}.ant-btn-primary:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-primary[disabled],.ant-btn-primary[disabled]:active,.ant-btn-primary[disabled]:focus,.ant-btn-primary[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-primary[disabled]>a:only-child{color:currentcolor}.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-primary[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child){border-left-color:#40a9ff;border-right-color:#40a9ff}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child):disabled{border-color:#d9d9d9}.ant-btn-group .ant-btn-primary:first-child:not(:last-child){border-right-color:#40a9ff}.ant-btn-group .ant-btn-primary:first-child:not(:last-child)[disabled]{border-right-color:#d9d9d9}.ant-btn-group .ant-btn-primary+.ant-btn-primary,.ant-btn-group .ant-btn-primary:last-child:not(:first-child){border-left-color:#40a9ff}.ant-btn-group .ant-btn-primary+.ant-btn-primary[disabled],.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#d9d9d9}.ant-btn-ghost{background:transparent;border-color:#d9d9d9;color:rgba(0,0,0,.85)}.ant-btn-ghost>a:only-child{color:currentcolor}.ant-btn-ghost>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-ghost:focus,.ant-btn-ghost:hover{background:transparent;border-color:#40a9ff;color:#40a9ff}.ant-btn-ghost:focus>a:only-child,.ant-btn-ghost:hover>a:only-child{color:currentcolor}.ant-btn-ghost:focus>a:only-child:after,.ant-btn-ghost:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-ghost:active{background:transparent;border-color:#096dd9;color:#096dd9}.ant-btn-ghost:active>a:only-child{color:currentcolor}.ant-btn-ghost:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-ghost[disabled],.ant-btn-ghost[disabled]:active,.ant-btn-ghost[disabled]:focus,.ant-btn-ghost[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-ghost[disabled]:active>a:only-child,.ant-btn-ghost[disabled]:focus>a:only-child,.ant-btn-ghost[disabled]:hover>a:only-child,.ant-btn-ghost[disabled]>a:only-child{color:currentcolor}.ant-btn-ghost[disabled]:active>a:only-child:after,.ant-btn-ghost[disabled]:focus>a:only-child:after,.ant-btn-ghost[disabled]:hover>a:only-child:after,.ant-btn-ghost[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dashed{background:#fff;border-color:#d9d9d9;border-style:dashed;color:rgba(0,0,0,.85)}.ant-btn-dashed>a:only-child{color:currentcolor}.ant-btn-dashed>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dashed:focus,.ant-btn-dashed:hover{background:#fff;border-color:#40a9ff;color:#40a9ff}.ant-btn-dashed:focus>a:only-child,.ant-btn-dashed:hover>a:only-child{color:currentcolor}.ant-btn-dashed:focus>a:only-child:after,.ant-btn-dashed:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dashed:active{background:#fff;border-color:#096dd9;color:#096dd9}.ant-btn-dashed:active>a:only-child{color:currentcolor}.ant-btn-dashed:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dashed[disabled],.ant-btn-dashed[disabled]:active,.ant-btn-dashed[disabled]:focus,.ant-btn-dashed[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dashed[disabled]:active>a:only-child,.ant-btn-dashed[disabled]:focus>a:only-child,.ant-btn-dashed[disabled]:hover>a:only-child,.ant-btn-dashed[disabled]>a:only-child{color:currentcolor}.ant-btn-dashed[disabled]:active>a:only-child:after,.ant-btn-dashed[disabled]:focus>a:only-child:after,.ant-btn-dashed[disabled]:hover>a:only-child:after,.ant-btn-dashed[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-danger{background:#ff4d4f;border-color:#ff4d4f;box-shadow:0 2px 0 rgba(0,0,0,.045);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.12)}.ant-btn-danger>a:only-child{color:currentcolor}.ant-btn-danger>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-danger:focus,.ant-btn-danger:hover{background:#ff7875;border-color:#ff7875;color:#fff}.ant-btn-danger:focus>a:only-child,.ant-btn-danger:hover>a:only-child{color:currentcolor}.ant-btn-danger:focus>a:only-child:after,.ant-btn-danger:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-danger:active{background:#d9363e;border-color:#d9363e;color:#fff}.ant-btn-danger:active>a:only-child{color:currentcolor}.ant-btn-danger:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-danger[disabled],.ant-btn-danger[disabled]:active,.ant-btn-danger[disabled]:focus,.ant-btn-danger[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-danger[disabled]>a:only-child{color:currentcolor}.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-danger[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-link{background:transparent;border-color:transparent;box-shadow:none;color:#1890ff}.ant-btn-link>a:only-child{color:currentcolor}.ant-btn-link>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-link:focus,.ant-btn-link:hover{background:transparent;border-color:#40a9ff;color:#40a9ff}.ant-btn-link:focus>a:only-child,.ant-btn-link:hover>a:only-child{color:currentcolor}.ant-btn-link:focus>a:only-child:after,.ant-btn-link:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-link:active{background:transparent;border-color:#096dd9;color:#096dd9}.ant-btn-link:active>a:only-child{color:currentcolor}.ant-btn-link:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-link[disabled],.ant-btn-link[disabled]:active,.ant-btn-link[disabled]:focus,.ant-btn-link[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9}.ant-btn-link:hover{background:transparent}.ant-btn-link:active,.ant-btn-link:focus,.ant-btn-link:hover{border-color:transparent}.ant-btn-link[disabled],.ant-btn-link[disabled]:active,.ant-btn-link[disabled]:focus,.ant-btn-link[disabled]:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-link[disabled]:active>a:only-child,.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-link[disabled]>a:only-child{color:currentcolor}.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-link[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-text{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.85)}.ant-btn-text>a:only-child{color:currentcolor}.ant-btn-text>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-text:focus,.ant-btn-text:hover{background:transparent;border-color:#40a9ff;color:#40a9ff}.ant-btn-text:focus>a:only-child,.ant-btn-text:hover>a:only-child{color:currentcolor}.ant-btn-text:focus>a:only-child:after,.ant-btn-text:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-text:active{background:transparent;border-color:#096dd9;color:#096dd9}.ant-btn-text:active>a:only-child{color:currentcolor}.ant-btn-text:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-text[disabled],.ant-btn-text[disabled]:active,.ant-btn-text[disabled]:focus,.ant-btn-text[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9}.ant-btn-text:focus,.ant-btn-text:hover{background:rgba(0,0,0,.018);border-color:transparent;color:rgba(0,0,0,.85)}.ant-btn-text:active{background:rgba(0,0,0,.028);border-color:transparent;color:rgba(0,0,0,.85)}.ant-btn-text[disabled],.ant-btn-text[disabled]:active,.ant-btn-text[disabled]:focus,.ant-btn-text[disabled]:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-text[disabled]:active>a:only-child,.ant-btn-text[disabled]:focus>a:only-child,.ant-btn-text[disabled]:hover>a:only-child,.ant-btn-text[disabled]>a:only-child{color:currentcolor}.ant-btn-text[disabled]:active>a:only-child:after,.ant-btn-text[disabled]:focus>a:only-child:after,.ant-btn-text[disabled]:hover>a:only-child:after,.ant-btn-text[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous{background:#fff;border-color:#ff4d4f;color:#ff4d4f}.ant-btn-dangerous>a:only-child{color:currentcolor}.ant-btn-dangerous>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous:focus,.ant-btn-dangerous:hover{background:#fff;border-color:#ff7875;color:#ff7875}.ant-btn-dangerous:focus>a:only-child,.ant-btn-dangerous:hover>a:only-child{color:currentcolor}.ant-btn-dangerous:focus>a:only-child:after,.ant-btn-dangerous:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous:active{background:#fff;border-color:#d9363e;color:#d9363e}.ant-btn-dangerous:active>a:only-child{color:currentcolor}.ant-btn-dangerous:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous[disabled],.ant-btn-dangerous[disabled]:active,.ant-btn-dangerous[disabled]:focus,.ant-btn-dangerous[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dangerous[disabled]:active>a:only-child,.ant-btn-dangerous[disabled]:focus>a:only-child,.ant-btn-dangerous[disabled]:hover>a:only-child,.ant-btn-dangerous[disabled]>a:only-child{color:currentcolor}.ant-btn-dangerous[disabled]:active>a:only-child:after,.ant-btn-dangerous[disabled]:focus>a:only-child:after,.ant-btn-dangerous[disabled]:hover>a:only-child:after,.ant-btn-dangerous[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-primary{background:#ff4d4f;border-color:#ff4d4f;box-shadow:0 2px 0 rgba(0,0,0,.045);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.12)}.ant-btn-dangerous.ant-btn-primary>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-primary>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-primary:focus,.ant-btn-dangerous.ant-btn-primary:hover{background:#ff7875;border-color:#ff7875;color:#fff}.ant-btn-dangerous.ant-btn-primary:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary:hover>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-primary:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-primary:active{background:#d9363e;border-color:#d9363e;color:#fff}.ant-btn-dangerous.ant-btn-primary:active>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-primary:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-primary[disabled],.ant-btn-dangerous.ant-btn-primary[disabled]:active,.ant-btn-dangerous.ant-btn-primary[disabled]:focus,.ant-btn-dangerous.ant-btn-primary[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dangerous.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-link{background:transparent;border-color:transparent;box-shadow:none;color:#ff4d4f}.ant-btn-dangerous.ant-btn-link>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-link>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-dangerous.ant-btn-link:hover{border-color:#40a9ff;color:#40a9ff}.ant-btn-dangerous.ant-btn-link:active{border-color:#096dd9;color:#096dd9}.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-dangerous.ant-btn-link[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9}.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-dangerous.ant-btn-link:hover{background:transparent;border-color:transparent;color:#ff7875}.ant-btn-dangerous.ant-btn-link:focus>a:only-child,.ant-btn-dangerous.ant-btn-link:hover>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-link:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-link:active{background:transparent;border-color:transparent;color:#d9363e}.ant-btn-dangerous.ant-btn-link:active>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-link:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-dangerous.ant-btn-link[disabled]:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-text{background:transparent;border-color:transparent;box-shadow:none;color:#ff4d4f}.ant-btn-dangerous.ant-btn-text>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-text>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-text:focus,.ant-btn-dangerous.ant-btn-text:hover{background:transparent;border-color:#40a9ff;color:#40a9ff}.ant-btn-dangerous.ant-btn-text:active{background:transparent;border-color:#096dd9;color:#096dd9}.ant-btn-dangerous.ant-btn-text[disabled],.ant-btn-dangerous.ant-btn-text[disabled]:active,.ant-btn-dangerous.ant-btn-text[disabled]:focus,.ant-btn-dangerous.ant-btn-text[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9}.ant-btn-dangerous.ant-btn-text:focus,.ant-btn-dangerous.ant-btn-text:hover{background:rgba(0,0,0,.018);border-color:transparent;color:#ff7875}.ant-btn-dangerous.ant-btn-text:focus>a:only-child,.ant-btn-dangerous.ant-btn-text:hover>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-text:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-text:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-text:active{background:rgba(0,0,0,.028);border-color:transparent;color:#d9363e}.ant-btn-dangerous.ant-btn-text:active>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-text:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-text[disabled],.ant-btn-dangerous.ant-btn-text[disabled]:active,.ant-btn-dangerous.ant-btn-text[disabled]:focus,.ant-btn-dangerous.ant-btn-text[disabled]:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dangerous.ant-btn-text[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-text[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-text[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-text[disabled]>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-text[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-text[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-text[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-text[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-icon-only{border-radius:2px;font-size:16px;height:32px;padding:2.4px 0;vertical-align:-3px;width:32px}.ant-btn-icon-only>*{font-size:16px}.ant-btn-icon-only.ant-btn-lg{border-radius:2px;font-size:18px;height:40px;padding:4.9px 0;width:40px}.ant-btn-icon-only.ant-btn-lg>*{font-size:18px}.ant-btn-icon-only.ant-btn-sm{border-radius:2px;font-size:14px;height:24px;padding:0;width:24px}.ant-btn-icon-only.ant-btn-sm>*{font-size:14px}.ant-btn-icon-only>.anticon{display:flex;justify-content:center}.ant-btn-icon-only .anticon-loading{padding:0!important}a.ant-btn-icon-only{vertical-align:-1px}a.ant-btn-icon-only>.anticon{display:inline}.ant-btn-round{border-radius:32px;font-size:14px;height:32px;padding:4px 16px}.ant-btn-round.ant-btn-lg{border-radius:40px;font-size:16px;height:40px;padding:6.4px 20px}.ant-btn-round.ant-btn-sm{border-radius:24px;font-size:14px;height:24px;padding:0 12px}.ant-btn-round.ant-btn-icon-only{width:auto}.ant-btn-circle{border-radius:50%;min-width:32px;padding-left:0;padding-right:0;text-align:center}.ant-btn-circle.ant-btn-lg{border-radius:50%;min-width:40px}.ant-btn-circle.ant-btn-sm{border-radius:50%;min-width:24px}.ant-btn:before{background:#fff;border-radius:inherit;bottom:-1px;content:"";display:none;left:-1px;opacity:.35;pointer-events:none;position:absolute;right:-1px;top:-1px;transition:opacity .2s;z-index:1}.ant-btn .anticon{transition:margin-left .3s cubic-bezier(.645,.045,.355,1)}.ant-btn .anticon.anticon-minus>svg,.ant-btn .anticon.anticon-plus>svg{shape-rendering:optimizespeed}.ant-btn.ant-btn-loading{cursor:default;position:relative}.ant-btn.ant-btn-loading:before{display:block}.ant-btn>.ant-btn-loading-icon{transition:width .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1)}.ant-btn>.ant-btn-loading-icon .anticon{-webkit-animation:none;animation:none;padding-right:8px}.ant-btn>.ant-btn-loading-icon .anticon svg{-webkit-animation:loadingCircle 1s linear infinite;animation:loadingCircle 1s linear infinite}.ant-btn-group{display:inline-flex}.ant-btn-group,.ant-btn-group>.ant-btn,.ant-btn-group>span>.ant-btn{position:relative}.ant-btn-group>.ant-btn:active,.ant-btn-group>.ant-btn:focus,.ant-btn-group>.ant-btn:hover,.ant-btn-group>span>.ant-btn:active,.ant-btn-group>span>.ant-btn:focus,.ant-btn-group>span>.ant-btn:hover{z-index:2}.ant-btn-group>.ant-btn[disabled],.ant-btn-group>span>.ant-btn[disabled]{z-index:0}.ant-btn-group .ant-btn-icon-only{font-size:14px}.ant-btn+.ant-btn-group,.ant-btn-group .ant-btn+.ant-btn,.ant-btn-group .ant-btn+span,.ant-btn-group span+.ant-btn,.ant-btn-group+.ant-btn,.ant-btn-group+.ant-btn-group,.ant-btn-group>span+span{margin-left:-1px}.ant-btn-group .ant-btn-primary+.ant-btn:not(.ant-btn-primary):not([disabled]){border-left-color:transparent}.ant-btn-group .ant-btn{border-radius:0}.ant-btn-group>.ant-btn:first-child,.ant-btn-group>span:first-child>.ant-btn{margin-left:0}.ant-btn-group>.ant-btn:only-child,.ant-btn-group>span:only-child>.ant-btn{border-radius:2px}.ant-btn-group>.ant-btn:first-child:not(:last-child),.ant-btn-group>span:first-child:not(:last-child)>.ant-btn{border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-btn-group>.ant-btn:last-child:not(:first-child),.ant-btn-group>span:last-child:not(:first-child)>.ant-btn{border-bottom-right-radius:2px;border-top-right-radius:2px}.ant-btn-group-sm>.ant-btn:only-child,.ant-btn-group-sm>span:only-child>.ant-btn{border-radius:2px}.ant-btn-group-sm>.ant-btn:first-child:not(:last-child),.ant-btn-group-sm>span:first-child:not(:last-child)>.ant-btn{border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-btn-group-sm>.ant-btn:last-child:not(:first-child),.ant-btn-group-sm>span:last-child:not(:first-child)>.ant-btn{border-bottom-right-radius:2px;border-top-right-radius:2px}.ant-btn-group>.ant-btn-group{float:left}.ant-btn-group>.ant-btn-group:not(:first-child):not(:last-child)>.ant-btn{border-radius:0}.ant-btn-group>.ant-btn-group:first-child:not(:last-child)>.ant-btn:last-child{border-bottom-right-radius:0;border-top-right-radius:0;padding-right:8px}.ant-btn-group>.ant-btn-group:last-child:not(:first-child)>.ant-btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0;padding-left:8px}.ant-btn-group-rtl.ant-btn+.ant-btn-group,.ant-btn-group-rtl.ant-btn-group .ant-btn+.ant-btn,.ant-btn-group-rtl.ant-btn-group .ant-btn+span,.ant-btn-group-rtl.ant-btn-group span+.ant-btn,.ant-btn-group-rtl.ant-btn-group+.ant-btn,.ant-btn-group-rtl.ant-btn-group+.ant-btn-group,.ant-btn-group-rtl.ant-btn-group>span+span,.ant-btn-rtl.ant-btn+.ant-btn-group,.ant-btn-rtl.ant-btn-group .ant-btn+.ant-btn,.ant-btn-rtl.ant-btn-group .ant-btn+span,.ant-btn-rtl.ant-btn-group span+.ant-btn,.ant-btn-rtl.ant-btn-group+.ant-btn,.ant-btn-rtl.ant-btn-group+.ant-btn-group,.ant-btn-rtl.ant-btn-group>span+span{margin-left:auto;margin-right:-1px}.ant-btn-group.ant-btn-group-rtl{direction:rtl}.ant-btn-group-rtl.ant-btn-group>.ant-btn:first-child:not(:last-child),.ant-btn-group-rtl.ant-btn-group>span:first-child:not(:last-child)>.ant-btn{border-radius:0 2px 2px 0}.ant-btn-group-rtl.ant-btn-group>.ant-btn:last-child:not(:first-child),.ant-btn-group-rtl.ant-btn-group>span:last-child:not(:first-child)>.ant-btn{border-radius:2px 0 0 2px}.ant-btn-group-rtl.ant-btn-group-sm>.ant-btn:first-child:not(:last-child),.ant-btn-group-rtl.ant-btn-group-sm>span:first-child:not(:last-child)>.ant-btn{border-radius:0 2px 2px 0}.ant-btn-group-rtl.ant-btn-group-sm>.ant-btn:last-child:not(:first-child),.ant-btn-group-rtl.ant-btn-group-sm>span:last-child:not(:first-child)>.ant-btn{border-radius:2px 0 0 2px}.ant-btn:active>span,.ant-btn:focus>span{position:relative}.ant-btn>.anticon+span,.ant-btn>span+.anticon{margin-left:8px}.ant-btn.ant-btn-background-ghost{border-color:#fff;color:#fff}.ant-btn.ant-btn-background-ghost,.ant-btn.ant-btn-background-ghost:active,.ant-btn.ant-btn-background-ghost:focus,.ant-btn.ant-btn-background-ghost:hover{background:transparent}.ant-btn.ant-btn-background-ghost:focus,.ant-btn.ant-btn-background-ghost:hover{border-color:#40a9ff;color:#40a9ff}.ant-btn.ant-btn-background-ghost:active{border-color:#096dd9;color:#096dd9}.ant-btn.ant-btn-background-ghost[disabled]{background:transparent;border-color:#d9d9d9;color:rgba(0,0,0,.25)}.ant-btn-background-ghost.ant-btn-primary{border-color:#1890ff;color:#1890ff;text-shadow:none}.ant-btn-background-ghost.ant-btn-primary>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-primary>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-primary:focus,.ant-btn-background-ghost.ant-btn-primary:hover{border-color:#40a9ff;color:#40a9ff}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-primary:active{border-color:#096dd9;color:#096dd9}.ant-btn-background-ghost.ant-btn-primary:active>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-primary:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-primary[disabled],.ant-btn-background-ghost.ant-btn-primary[disabled]:active,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-danger{border-color:#ff4d4f;color:#ff4d4f;text-shadow:none}.ant-btn-background-ghost.ant-btn-danger>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-danger>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-danger:focus,.ant-btn-background-ghost.ant-btn-danger:hover{border-color:#ff7875;color:#ff7875}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-danger:active{border-color:#d9363e;color:#d9363e}.ant-btn-background-ghost.ant-btn-danger:active>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-danger:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-danger[disabled],.ant-btn-background-ghost.ant-btn-danger[disabled]:active,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous{border-color:#ff4d4f;color:#ff4d4f;text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous:focus,.ant-btn-background-ghost.ant-btn-dangerous:hover{border-color:#ff7875;color:#ff7875}.ant-btn-background-ghost.ant-btn-dangerous:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous:hover>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous:active{border-color:#d9363e;color:#d9363e}.ant-btn-background-ghost.ant-btn-dangerous:active>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous[disabled],.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link{border-color:transparent;color:#ff4d4f;text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover{border-color:transparent;color:#ff7875}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active{border-color:transparent;color:#d9363e}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-two-chinese-chars:first-letter{letter-spacing:.34em}.ant-btn-two-chinese-chars>:not(.anticon){letter-spacing:.34em;margin-right:-.34em}.ant-btn.ant-btn-block{width:100%}.ant-btn:empty{content:" ";display:inline-block;visibility:hidden;width:0}a.ant-btn{line-height:30px;padding-top:.01px!important}a.ant-btn-disabled{cursor:not-allowed}a.ant-btn-disabled>*{pointer-events:none}a.ant-btn-disabled,a.ant-btn-disabled:active,a.ant-btn-disabled:focus,a.ant-btn-disabled:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}a.ant-btn-disabled:active>a:only-child,a.ant-btn-disabled:focus>a:only-child,a.ant-btn-disabled:hover>a:only-child,a.ant-btn-disabled>a:only-child{color:currentcolor}a.ant-btn-disabled:active>a:only-child:after,a.ant-btn-disabled:focus>a:only-child:after,a.ant-btn-disabled:hover>a:only-child:after,a.ant-btn-disabled>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}a.ant-btn-lg{line-height:38px}a.ant-btn-sm{line-height:22px}.ant-btn-rtl{direction:rtl}.ant-btn-group-rtl.ant-btn-group .ant-btn-primary+.ant-btn-primary,.ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child){border-left-color:#d9d9d9;border-right-color:#40a9ff}.ant-btn-group-rtl.ant-btn-group .ant-btn-primary+.ant-btn-primary[disabled],.ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#40a9ff;border-right-color:#d9d9d9}.ant-btn-rtl.ant-btn>.ant-btn-loading-icon .anticon{padding-left:8px;padding-right:0}.ant-btn-rtl.ant-btn>.anticon+span,.ant-btn-rtl.ant-btn>span+.anticon{margin-left:0;margin-right:8px}.ant-picker-calendar{font-feature-settings:"tnum";background:#fff;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-picker-calendar-header{display:flex;justify-content:flex-end;padding:12px 0}.ant-picker-calendar-header .ant-picker-calendar-year-select{min-width:80px}.ant-picker-calendar-header .ant-picker-calendar-month-select{margin-left:8px;min-width:70px}.ant-picker-calendar-header .ant-picker-calendar-mode-switch{margin-left:8px}.ant-picker-calendar .ant-picker-panel{background:#fff;border:0;border-radius:0;border-top:1px solid #f0f0f0}.ant-picker-calendar .ant-picker-panel .ant-picker-date-panel,.ant-picker-calendar .ant-picker-panel .ant-picker-month-panel{width:auto}.ant-picker-calendar .ant-picker-panel .ant-picker-body{padding:8px 0}.ant-picker-calendar .ant-picker-panel .ant-picker-content{width:100%}.ant-picker-calendar-mini{border-radius:2px}.ant-picker-calendar-mini .ant-picker-calendar-header{padding-left:8px;padding-right:8px}.ant-picker-calendar-mini .ant-picker-panel{border-radius:0 0 2px 2px}.ant-picker-calendar-mini .ant-picker-content{height:256px}.ant-picker-calendar-mini .ant-picker-content th{height:auto;line-height:18px;padding:0}.ant-picker-calendar-mini .ant-picker-cell:before{pointer-events:none}.ant-picker-calendar-full .ant-picker-panel{background:#fff;border:0;display:block;text-align:right;width:100%}.ant-picker-calendar-full .ant-picker-panel .ant-picker-body td,.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{padding:0}.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{height:auto;line-height:18px;padding:0 12px 5px 0}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell:before{display:none}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell:hover .ant-picker-calendar-date{background:#f5f5f5}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell .ant-picker-calendar-date-today:before{display:none}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date-today,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date-today{background:#e6f7ff}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date-today .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date-today .ant-picker-calendar-date-value{color:#1890ff}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date{border:0;border-radius:0;border-top:2px solid #f0f0f0;display:block;height:auto;margin:0 4px;padding:4px 8px 0;transition:background .3s;width:auto}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-value{line-height:24px;transition:color .3s}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-content{color:rgba(0,0,0,.85);height:86px;line-height:1.5715;overflow-y:auto;position:static;text-align:left;width:auto}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-today{border-color:#1890ff}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-today .ant-picker-calendar-date-value{color:rgba(0,0,0,.85)}@media only screen and (max-width:480px){.ant-picker-calendar-header{display:block}.ant-picker-calendar-header .ant-picker-calendar-year-select{width:50%}.ant-picker-calendar-header .ant-picker-calendar-month-select{width:calc(50% - 8px)}.ant-picker-calendar-header .ant-picker-calendar-mode-switch{margin-left:0;margin-top:8px;width:100%}.ant-picker-calendar-header .ant-picker-calendar-mode-switch>label{text-align:center;width:50%}}.ant-picker-calendar-rtl{direction:rtl}.ant-picker-calendar-rtl .ant-picker-calendar-header .ant-picker-calendar-mode-switch,.ant-picker-calendar-rtl .ant-picker-calendar-header .ant-picker-calendar-month-select{margin-left:0;margin-right:8px}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel{text-align:left}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{padding:0 0 5px 12px}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-content{text-align:right}.ant-card{font-feature-settings:"tnum";background:#fff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-card-rtl{direction:rtl}.ant-card-hoverable{cursor:pointer;transition:box-shadow .3s,border-color .3s}.ant-card-hoverable:hover{border-color:transparent;box-shadow:0 1px 2px -2px rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.12),0 5px 12px 4px rgba(0,0,0,.09)}.ant-card-bordered{border:1px solid #f0f0f0}.ant-card-head{background:transparent;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0;color:rgba(0,0,0,.85);font-size:16px;font-weight:500;margin-bottom:-1px;min-height:48px;padding:0 24px}.ant-card-head:after,.ant-card-head:before{content:"";display:table}.ant-card-head:after{clear:both}.ant-card-head-wrapper{align-items:center;display:flex}.ant-card-head-title{display:inline-block;flex:1;overflow:hidden;padding:16px 0;text-overflow:ellipsis;white-space:nowrap}.ant-card-head-title>.ant-typography,.ant-card-head-title>.ant-typography-edit-content{left:0;margin-bottom:0;margin-top:0}.ant-card-head .ant-tabs-top{clear:both;color:rgba(0,0,0,.85);font-size:14px;font-weight:400;margin-bottom:-17px}.ant-card-head .ant-tabs-top-bar{border-bottom:1px solid #f0f0f0}.ant-card-extra{color:rgba(0,0,0,.85);font-size:14px;font-weight:400;margin-left:auto;padding:16px 0}.ant-card-rtl .ant-card-extra{margin-left:0;margin-right:auto}.ant-card-body{padding:24px}.ant-card-body:after,.ant-card-body:before{content:"";display:table}.ant-card-body:after{clear:both}.ant-card-contain-grid .ant-card-body{display:flex;flex-wrap:wrap}.ant-card-contain-grid:not(.ant-card-loading) .ant-card-body{margin:-1px 0 0 -1px;padding:0}.ant-card-grid{border:0;border-radius:0;box-shadow:1px 0 0 0 #f0f0f0,0 1px 0 0 #f0f0f0,1px 1px 0 0 #f0f0f0,inset 1px 0 0 0 #f0f0f0,inset 0 1px 0 0 #f0f0f0;padding:24px;transition:all .3s;width:33.33%}.ant-card-grid-hoverable:hover{box-shadow:0 1px 2px -2px rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.12),0 5px 12px 4px rgba(0,0,0,.09);position:relative;z-index:1}.ant-card-contain-tabs>.ant-card-head .ant-card-head-title{min-height:32px;padding-bottom:0}.ant-card-contain-tabs>.ant-card-head .ant-card-extra{padding-bottom:0}.ant-card-bordered .ant-card-cover{margin-left:-1px;margin-right:-1px;margin-top:-1px}.ant-card-cover>*{display:block;width:100%}.ant-card-cover img{border-radius:2px 2px 0 0}.ant-card-actions{background:#fff;border-top:1px solid #f0f0f0;display:flex;list-style:none;margin:0;padding:0}.ant-card-actions:after,.ant-card-actions:before{content:"";display:table}.ant-card-actions:after{clear:both}.ant-card-actions>li{color:rgba(0,0,0,.45);margin:12px 0;text-align:center}.ant-card-actions>li>span{cursor:pointer;display:block;font-size:14px;line-height:1.5715;min-width:32px;position:relative}.ant-card-actions>li>span:hover{color:#1890ff;transition:color .3s}.ant-card-actions>li>span a:not(.ant-btn),.ant-card-actions>li>span>.anticon{color:rgba(0,0,0,.45);display:inline-block;line-height:22px;transition:color .3s;width:100%}.ant-card-actions>li>span a:not(.ant-btn):hover,.ant-card-actions>li>span>.anticon:hover{color:#1890ff}.ant-card-actions>li>span>.anticon{font-size:16px;line-height:22px}.ant-card-actions>li:not(:last-child){border-right:1px solid #f0f0f0}.ant-card-rtl .ant-card-actions>li:not(:last-child){border-left:1px solid #f0f0f0;border-right:none}.ant-card-type-inner .ant-card-head{background:#fafafa;padding:0 24px}.ant-card-type-inner .ant-card-head-title{font-size:14px;padding:12px 0}.ant-card-type-inner .ant-card-body{padding:16px 24px}.ant-card-type-inner .ant-card-extra{padding:13.5px 0}.ant-card-meta{display:flex;margin:-4px 0}.ant-card-meta:after,.ant-card-meta:before{content:"";display:table}.ant-card-meta:after{clear:both}.ant-card-meta-avatar{padding-right:16px}.ant-card-rtl .ant-card-meta-avatar{padding-left:16px;padding-right:0}.ant-card-meta-detail{overflow:hidden}.ant-card-meta-detail>div:not(:last-child){margin-bottom:8px}.ant-card-meta-title{color:rgba(0,0,0,.85);font-size:16px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-card-meta-description{color:rgba(0,0,0,.45)}.ant-card-loading{overflow:hidden}.ant-card-loading .ant-card-body{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-card-small>.ant-card-head{font-size:14px;min-height:36px;padding:0 12px}.ant-card-small>.ant-card-head>.ant-card-head-wrapper>.ant-card-head-title{padding:8px 0}.ant-card-small>.ant-card-head>.ant-card-head-wrapper>.ant-card-extra{font-size:14px;padding:8px 0}.ant-card-small>.ant-card-body{padding:12px}.ant-carousel{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-carousel .slick-slider{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;box-sizing:border-box;display:block;position:relative;touch-action:pan-y}.ant-carousel .slick-list{display:block;margin:0;overflow:hidden;padding:0;position:relative}.ant-carousel .slick-list:focus{outline:none}.ant-carousel .slick-list.dragging{cursor:pointer}.ant-carousel .slick-list .slick-slide{pointer-events:none}.ant-carousel .slick-list .slick-slide input.ant-checkbox-input,.ant-carousel .slick-list .slick-slide input.ant-radio-input{visibility:hidden}.ant-carousel .slick-list .slick-slide.slick-active{pointer-events:auto}.ant-carousel .slick-list .slick-slide.slick-active input.ant-checkbox-input,.ant-carousel .slick-list .slick-slide.slick-active input.ant-radio-input{visibility:visible}.ant-carousel .slick-list .slick-slide>div>div{vertical-align:bottom}.ant-carousel .slick-slider .slick-list,.ant-carousel .slick-slider .slick-track{touch-action:pan-y;transform:translateZ(0)}.ant-carousel .slick-track{display:block;left:0;position:relative;top:0}.ant-carousel .slick-track:after,.ant-carousel .slick-track:before{content:"";display:table}.ant-carousel .slick-track:after{clear:both}.slick-loading .ant-carousel .slick-track{visibility:hidden}.ant-carousel .slick-slide{display:none;float:left;height:100%;min-height:1px}.ant-carousel .slick-slide img{display:block}.ant-carousel .slick-slide.slick-loading img{display:none}.ant-carousel .slick-slide.dragging img{pointer-events:none}.ant-carousel .slick-initialized .slick-slide{display:block}.ant-carousel .slick-loading .slick-slide{visibility:hidden}.ant-carousel .slick-vertical .slick-slide{display:block;height:auto}.ant-carousel .slick-arrow.slick-hidden{display:none}.ant-carousel .slick-next,.ant-carousel .slick-prev{border:0;cursor:pointer;display:block;font-size:0;height:20px;line-height:0;margin-top:-10px;padding:0;position:absolute;top:50%;width:20px}.ant-carousel .slick-next,.ant-carousel .slick-next:focus,.ant-carousel .slick-next:hover,.ant-carousel .slick-prev,.ant-carousel .slick-prev:focus,.ant-carousel .slick-prev:hover{background:transparent;color:transparent;outline:none}.ant-carousel .slick-next:focus:before,.ant-carousel .slick-next:hover:before,.ant-carousel .slick-prev:focus:before,.ant-carousel .slick-prev:hover:before{opacity:1}.ant-carousel .slick-next.slick-disabled:before,.ant-carousel .slick-prev.slick-disabled:before{opacity:.25}.ant-carousel .slick-prev{left:-25px}.ant-carousel .slick-prev:before{content:"←"}.ant-carousel .slick-next{right:-25px}.ant-carousel .slick-next:before{content:"→"}.ant-carousel .slick-dots{bottom:0;display:flex!important;justify-content:center;left:0;list-style:none;margin-left:15%;margin-right:15%;padding-left:0;position:absolute;right:0;z-index:15}.ant-carousel .slick-dots-bottom{bottom:12px}.ant-carousel .slick-dots-top{bottom:auto;top:12px}.ant-carousel .slick-dots li{box-sizing:content-box;display:inline-block;flex:0 1 auto;height:3px;margin:0 3px;padding:0;position:relative;text-align:center;text-indent:-999px;transition:all .5s;vertical-align:top;width:16px}.ant-carousel .slick-dots li button{background:#fff;border:0;border-radius:1px;color:transparent;cursor:pointer;display:block;font-size:0;height:3px;opacity:.3;outline:none;padding:0;transition:all .5s;width:100%}.ant-carousel .slick-dots li button:focus,.ant-carousel .slick-dots li button:hover{opacity:.75}.ant-carousel .slick-dots li.slick-active{width:24px}.ant-carousel .slick-dots li.slick-active button{background:#fff;opacity:1}.ant-carousel .slick-dots li.slick-active:focus,.ant-carousel .slick-dots li.slick-active:hover{opacity:1}.ant-carousel-vertical .slick-dots{bottom:auto;flex-direction:column;height:auto;margin:0;top:50%;transform:translateY(-50%);width:3px}.ant-carousel-vertical .slick-dots-left{left:12px;right:auto}.ant-carousel-vertical .slick-dots-right{left:auto;right:12px}.ant-carousel-vertical .slick-dots li{height:16px;margin:4px 2px;vertical-align:baseline;width:3px}.ant-carousel-vertical .slick-dots li button{height:16px;width:3px}.ant-carousel-vertical .slick-dots li.slick-active,.ant-carousel-vertical .slick-dots li.slick-active button{height:24px;width:3px}.ant-carousel-rtl{direction:rtl}.ant-carousel-rtl .ant-carousel .slick-track{left:auto;right:0}.ant-carousel-rtl .ant-carousel .slick-prev{left:auto;right:-25px}.ant-carousel-rtl .ant-carousel .slick-prev:before{content:"→"}.ant-carousel-rtl .ant-carousel .slick-next{left:-25px;right:auto}.ant-carousel-rtl .ant-carousel .slick-next:before{content:"←"}.ant-carousel-rtl.ant-carousel .slick-dots{flex-direction:row-reverse}.ant-carousel-rtl.ant-carousel-vertical .slick-dots{flex-direction:column}.ant-cascader-checkbox{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em;white-space:nowrap}.ant-cascader-checkbox-input:focus+.ant-cascader-checkbox-inner,.ant-cascader-checkbox-wrapper:hover .ant-cascader-checkbox-inner,.ant-cascader-checkbox:hover .ant-cascader-checkbox-inner{border-color:#1890ff}.ant-cascader-checkbox-checked:after{-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;border:1px solid #1890ff;border-radius:2px;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-cascader-checkbox-wrapper:hover .ant-cascader-checkbox:after,.ant-cascader-checkbox:hover:after{visibility:visible}.ant-cascader-checkbox-inner{background-color:#fff;border:1px solid #d9d9d9;border-collapse:separate;border-radius:2px;direction:ltr;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-cascader-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;height:9.14285714px;left:21.5%;opacity:0;position:absolute;top:50%;transform:rotate(45deg) scale(0) translate(-50%,-50%);transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;width:5.71428571px}.ant-cascader-checkbox-input{bottom:0;cursor:pointer;height:100%;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-cascader-checkbox-checked .ant-cascader-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;transform:rotate(45deg) scale(1) translate(-50%,-50%);transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.ant-cascader-checkbox-checked .ant-cascader-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-cascader-checkbox-disabled{cursor:not-allowed}.ant-cascader-checkbox-disabled.ant-cascader-checkbox-checked .ant-cascader-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.ant-cascader-checkbox-disabled .ant-cascader-checkbox-input{cursor:not-allowed;pointer-events:none}.ant-cascader-checkbox-disabled .ant-cascader-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-cascader-checkbox-disabled .ant-cascader-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-collapse:separate;border-color:#f5f5f5}.ant-cascader-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-cascader-checkbox-disabled:hover:after,.ant-cascader-checkbox-wrapper:hover .ant-cascader-checkbox-disabled:after{visibility:hidden}.ant-cascader-checkbox-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.ant-cascader-checkbox-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-cascader-checkbox-wrapper.ant-cascader-checkbox-wrapper-disabled{cursor:not-allowed}.ant-cascader-checkbox-wrapper+.ant-cascader-checkbox-wrapper{margin-left:8px}.ant-cascader-checkbox-wrapper.ant-cascader-checkbox-wrapper-in-form-item input[type=checkbox]{height:14px;width:14px}.ant-cascader-checkbox+span{padding-left:8px;padding-right:8px}.ant-cascader-checkbox-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-cascader-checkbox-group-item{margin-right:8px}.ant-cascader-checkbox-group-item:last-child{margin-right:0}.ant-cascader-checkbox-group-item+.ant-cascader-checkbox-group-item{margin-left:0}.ant-cascader-checkbox-indeterminate .ant-cascader-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-cascader-checkbox-indeterminate .ant-cascader-checkbox-inner:after{background-color:#1890ff;border:0;content:" ";height:8px;left:50%;opacity:1;top:50%;transform:translate(-50%,-50%) scale(1);width:8px}.ant-cascader-checkbox-indeterminate.ant-cascader-checkbox-disabled .ant-cascader-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-cascader{width:184px}.ant-cascader-checkbox{margin-right:8px;top:0}.ant-cascader-menus{align-items:flex-start;display:flex;flex-wrap:nowrap}.ant-cascader-menus.ant-cascader-menu-empty .ant-cascader-menu{height:auto;width:100%}.ant-cascader-menu{-ms-overflow-style:-ms-autohiding-scrollbar;border-right:1px solid #f0f0f0;flex-grow:1;height:180px;list-style:none;margin:-4px 0;min-width:111px;overflow:auto;padding:4px 0;vertical-align:top}.ant-cascader-menu-item{align-items:center;cursor:pointer;display:flex;flex-wrap:nowrap;line-height:22px;overflow:hidden;padding:5px 12px;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-cascader-menu-item:hover{background:#f5f5f5}.ant-cascader-menu-item-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-cascader-menu-item-disabled:hover{background:transparent}.ant-cascader-menu-empty .ant-cascader-menu-item{color:rgba(0,0,0,.25);cursor:default;pointer-events:none}.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled),.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled):hover{background-color:#e6f7ff;font-weight:600}.ant-cascader-menu-item-content{flex:auto}.ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon,.ant-cascader-menu-item-loading-icon{color:rgba(0,0,0,.45);font-size:10px;margin-left:4px}.ant-cascader-menu-item-disabled.ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon,.ant-cascader-menu-item-disabled.ant-cascader-menu-item-loading-icon{color:rgba(0,0,0,.25)}.ant-cascader-menu-item-keyword{color:#ff4d4f}.ant-cascader-rtl .ant-cascader-menu-item-expand-icon,.ant-cascader-rtl .ant-cascader-menu-item-loading-icon{margin-left:0;margin-right:4px}.ant-cascader-rtl .ant-cascader-checkbox{margin-left:8px;margin-right:0;top:0}.ant-checkbox{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em;white-space:nowrap}.ant-checkbox-input:focus+.ant-checkbox-inner,.ant-checkbox-wrapper:hover .ant-checkbox-inner,.ant-checkbox:hover .ant-checkbox-inner{border-color:#1890ff}.ant-checkbox-checked:after{-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;border:1px solid #1890ff;border-radius:2px;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-checkbox-wrapper:hover .ant-checkbox:after,.ant-checkbox:hover:after{visibility:visible}.ant-checkbox-inner{background-color:#fff;border:1px solid #d9d9d9;border-collapse:separate;border-radius:2px;direction:ltr;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;height:9.14285714px;left:21.5%;opacity:0;position:absolute;top:50%;transform:rotate(45deg) scale(0) translate(-50%,-50%);transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;width:5.71428571px}.ant-checkbox-input{bottom:0;cursor:pointer;height:100%;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-checkbox-checked .ant-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;transform:rotate(45deg) scale(1) translate(-50%,-50%);transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.ant-checkbox-checked .ant-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-checkbox-disabled{cursor:not-allowed}.ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.ant-checkbox-disabled .ant-checkbox-input{cursor:not-allowed;pointer-events:none}.ant-checkbox-disabled .ant-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-checkbox-disabled .ant-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-collapse:separate;border-color:#f5f5f5}.ant-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-checkbox-disabled:hover:after,.ant-checkbox-wrapper:hover .ant-checkbox-disabled:after{visibility:hidden}.ant-checkbox-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.ant-checkbox-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-checkbox-wrapper.ant-checkbox-wrapper-disabled{cursor:not-allowed}.ant-checkbox-wrapper+.ant-checkbox-wrapper{margin-left:8px}.ant-checkbox-wrapper.ant-checkbox-wrapper-in-form-item input[type=checkbox]{height:14px;width:14px}.ant-checkbox+span{padding-left:8px;padding-right:8px}.ant-checkbox-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-checkbox-group-item{margin-right:8px}.ant-checkbox-group-item:last-child{margin-right:0}.ant-checkbox-group-item+.ant-checkbox-group-item{margin-left:0}.ant-checkbox-indeterminate .ant-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-checkbox-indeterminate .ant-checkbox-inner:after{background-color:#1890ff;border:0;content:" ";height:8px;left:50%;opacity:1;top:50%;transform:translate(-50%,-50%) scale(1);width:8px}.ant-checkbox-indeterminate.ant-checkbox-disabled .ant-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-checkbox-rtl{direction:rtl}.ant-checkbox-group-rtl .ant-checkbox-group-item{margin-left:8px;margin-right:0}.ant-checkbox-group-rtl .ant-checkbox-group-item:last-child{margin-left:0!important}.ant-checkbox-group-rtl .ant-checkbox-group-item+.ant-checkbox-group-item{margin-left:8px}.ant-collapse{font-feature-settings:"tnum";background-color:#fafafa;border:1px solid #d9d9d9;border-bottom:0;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-collapse>.ant-collapse-item{border-bottom:1px solid #d9d9d9}.ant-collapse>.ant-collapse-item:last-child,.ant-collapse>.ant-collapse-item:last-child>.ant-collapse-header{border-radius:0 0 2px 2px}.ant-collapse>.ant-collapse-item>.ant-collapse-header{align-items:flex-start;color:rgba(0,0,0,.85);cursor:pointer;display:flex;flex-wrap:nowrap;line-height:1.5715;padding:12px 16px;position:relative;transition:all .3s,visibility 0s}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{display:inline-block;font-size:12px;margin-right:12px;vertical-align:-1px}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{transition:transform .24s}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{margin-left:auto}.ant-collapse>.ant-collapse-item>.ant-collapse-header:focus{outline:none}.ant-collapse>.ant-collapse-item .ant-collapse-header-collapsible-only{cursor:default}.ant-collapse>.ant-collapse-item .ant-collapse-header-collapsible-only .ant-collapse-header-text{cursor:pointer}.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-left:12px}.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header{padding:12px 40px 12px 16px;position:relative}.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{left:auto;margin:0;position:absolute;right:16px;top:50%;transform:translateY(-50%)}.ant-collapse-content{background-color:#fff;border-top:1px solid #d9d9d9;color:rgba(0,0,0,.85)}.ant-collapse-content>.ant-collapse-content-box{padding:16px}.ant-collapse-content-hidden{display:none}.ant-collapse-item:last-child>.ant-collapse-content{border-radius:0 0 2px 2px}.ant-collapse-borderless{background-color:#fafafa;border:0}.ant-collapse-borderless>.ant-collapse-item{border-bottom:1px solid #d9d9d9}.ant-collapse-borderless>.ant-collapse-item:last-child,.ant-collapse-borderless>.ant-collapse-item:last-child .ant-collapse-header{border-radius:0}.ant-collapse-borderless>.ant-collapse-item:last-child{border-bottom:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content{background-color:transparent;border-top:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content>.ant-collapse-content-box{padding-top:4px}.ant-collapse-ghost{background-color:transparent;border:0}.ant-collapse-ghost>.ant-collapse-item{border-bottom:0}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-content{background-color:transparent;border-top:0}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-content>.ant-collapse-content-box{padding-bottom:12px;padding-top:12px}.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header,.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header>.arrow{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-collapse-rtl{direction:rtl}.ant-collapse-rtl.ant-collapse.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header{padding:12px 16px 12px 40px;position:relative}.ant-collapse-rtl.ant-collapse.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{left:16px;margin:0;position:absolute;right:auto;top:50%;transform:translateY(-50%)}.ant-collapse-rtl .ant-collapse>.ant-collapse-item>.ant-collapse-header{padding:12px 40px 12px 16px}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{margin-left:12px;margin-right:0}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{transform:rotate(180deg)}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{margin-left:0;margin-right:auto}.ant-collapse-rtl.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-left:0;padding-right:12px}.ant-comment{background-color:inherit;position:relative}.ant-comment-inner{display:flex;padding:16px 0}.ant-comment-avatar{cursor:pointer;flex-shrink:0;margin-right:12px;position:relative}.ant-comment-avatar img{border-radius:50%;height:32px;width:32px}.ant-comment-content{word-wrap:break-word;flex:1 1 auto;font-size:14px;min-width:1px;position:relative}.ant-comment-content-author{display:flex;flex-wrap:wrap;font-size:14px;justify-content:flex-start;margin-bottom:4px}.ant-comment-content-author>a,.ant-comment-content-author>span{font-size:12px;line-height:18px;padding-right:8px}.ant-comment-content-author-name{color:rgba(0,0,0,.45);font-size:14px;transition:color .3s}.ant-comment-content-author-name>*,.ant-comment-content-author-name>:hover{color:rgba(0,0,0,.45)}.ant-comment-content-author-time{color:#ccc;cursor:auto;white-space:nowrap}.ant-comment-content-detail p{margin-bottom:inherit;white-space:pre-wrap}.ant-comment-actions{margin-bottom:inherit;margin-top:12px;padding-left:0}.ant-comment-actions>li{color:rgba(0,0,0,.45);display:inline-block}.ant-comment-actions>li>span{color:rgba(0,0,0,.45);cursor:pointer;font-size:12px;margin-right:10px;transition:color .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-comment-actions>li>span:hover{color:#595959}.ant-comment-nested{margin-left:44px}.ant-comment-rtl{direction:rtl}.ant-comment-rtl .ant-comment-avatar{margin-left:12px;margin-right:0}.ant-comment-rtl .ant-comment-content-author>a,.ant-comment-rtl .ant-comment-content-author>span{padding-left:8px;padding-right:0}.ant-comment-rtl .ant-comment-actions{padding-right:0}.ant-comment-rtl .ant-comment-actions>li>span{margin-left:10px;margin-right:0}.ant-comment-rtl .ant-comment-nested{margin-left:0;margin-right:44px}.ant-picker-status-error.ant-picker,.ant-picker-status-error.ant-picker:not([disabled]):hover{background-color:#fff;border-color:#ff4d4f}.ant-picker-status-error.ant-picker-focused,.ant-picker-status-error.ant-picker:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-picker-status-error.ant-picker .ant-picker-active-bar{background:#ff7875}.ant-picker-status-warning.ant-picker,.ant-picker-status-warning.ant-picker:not([disabled]):hover{background-color:#fff;border-color:#faad14}.ant-picker-status-warning.ant-picker-focused,.ant-picker-status-warning.ant-picker:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-picker-status-warning.ant-picker .ant-picker-active-bar{background:#ffc53d}.ant-picker{font-feature-settings:"tnum";align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:4px 11px;position:relative;transition:border .3s,box-shadow .3s}.ant-picker-focused,.ant-picker:hover{border-color:#40a9ff;border-right-width:1px}.ant-picker-focused{box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-picker.ant-picker-disabled{background:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.ant-picker.ant-picker-disabled .ant-picker-suffix{color:rgba(0,0,0,.25)}.ant-picker.ant-picker-borderless{background-color:transparent!important;border-color:transparent!important;box-shadow:none!important}.ant-picker-input{align-items:center;display:inline-flex;position:relative;width:100%}.ant-picker-input>input{background-color:#fff;background-image:none;background:transparent;border:0;border-radius:2px;color:rgba(0,0,0,.85);display:inline-block;flex:auto;font-size:14px;height:auto;line-height:1.5715;min-width:0;min-width:1px;padding:0;position:relative;transition:all .3s;width:100%}.ant-picker-input>input::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-picker-input>input:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-picker-input>input::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-picker-input>input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-picker-input>input:-ms-input-placeholder{text-overflow:ellipsis}.ant-picker-input>input:placeholder-shown{text-overflow:ellipsis}.ant-picker-input>input:hover{border-color:#40a9ff;border-right-width:1px}.ant-picker-input>input-focused,.ant-picker-input>input:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-picker-input>input-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-picker-input>input-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-picker-input>input[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-picker-input>input[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-picker-input>input-borderless,.ant-picker-input>input-borderless-disabled,.ant-picker-input>input-borderless-focused,.ant-picker-input>input-borderless:focus,.ant-picker-input>input-borderless:hover,.ant-picker-input>input-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-picker-input>input{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-picker-input>input-lg{font-size:16px;padding:6.5px 11px}.ant-picker-input>input-sm{padding:0 7px}.ant-picker-input>input:focus{box-shadow:none}.ant-picker-input>input[disabled]{background:transparent}.ant-picker-input:hover .ant-picker-clear{opacity:1}.ant-picker-input-placeholder>input{color:#bfbfbf}.ant-picker-large{padding:6.5px 11px}.ant-picker-large .ant-picker-input>input{font-size:16px}.ant-picker-small{padding:0 7px}.ant-picker-suffix{-ms-grid-row-align:center;align-self:center;color:rgba(0,0,0,.25);display:flex;flex:none;line-height:1;margin-left:4px;pointer-events:none}.ant-picker-suffix>*{vertical-align:top}.ant-picker-suffix>:not(:last-child){margin-right:8px}.ant-picker-clear{background:#fff;color:rgba(0,0,0,.25);cursor:pointer;line-height:1;opacity:0;position:absolute;right:0;top:50%;transform:translateY(-50%);transition:opacity .3s,color .3s}.ant-picker-clear>*{vertical-align:top}.ant-picker-clear:hover{color:rgba(0,0,0,.45)}.ant-picker-separator{color:rgba(0,0,0,.25);cursor:default;display:inline-block;font-size:16px;height:16px;position:relative;vertical-align:top;width:1em}.ant-picker-focused .ant-picker-separator{color:rgba(0,0,0,.45)}.ant-picker-disabled .ant-picker-range-separator .ant-picker-separator{cursor:not-allowed}.ant-picker-range{display:inline-flex;position:relative}.ant-picker-range .ant-picker-clear{right:11px}.ant-picker-range:hover .ant-picker-clear{opacity:1}.ant-picker-range .ant-picker-active-bar{background:#1890ff;bottom:-1px;height:2px;margin-left:11px;opacity:0;pointer-events:none;transition:all .3s ease-out}.ant-picker-range.ant-picker-focused .ant-picker-active-bar{opacity:1}.ant-picker-range-separator{align-items:center;line-height:1;padding:0 8px}.ant-picker-range.ant-picker-small .ant-picker-clear{right:7px}.ant-picker-range.ant-picker-small .ant-picker-active-bar{margin-left:7px}.ant-picker-dropdown{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;left:-9999px;line-height:1.5715;list-style:none;margin:0;padding:0;position:absolute;top:-9999px;z-index:1050}.ant-picker-dropdown-hidden{display:none}.ant-picker-dropdown-placement-bottomLeft .ant-picker-range-arrow{display:block;top:2.58561808px;transform:rotate(-135deg) translateY(1px)}.ant-picker-dropdown-placement-topLeft .ant-picker-range-arrow{bottom:2.58561808px;display:block;transform:rotate(45deg)}.ant-picker-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-picker-dropdown-placement-topLeft,.ant-picker-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-picker-dropdown-placement-topRight,.ant-picker-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-picker-dropdown-placement-topLeft,.ant-picker-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-picker-dropdown-placement-topRight{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn}.ant-picker-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-picker-dropdown-placement-bottomLeft,.ant-picker-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-picker-dropdown-placement-bottomRight,.ant-picker-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-picker-dropdown-placement-bottomLeft,.ant-picker-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-picker-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn}.ant-picker-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-picker-dropdown-placement-topLeft,.ant-picker-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-picker-dropdown-placement-topRight{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut}.ant-picker-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-picker-dropdown-placement-bottomLeft,.ant-picker-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-picker-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut}.ant-picker-dropdown-range{padding:7.54247233px 0}.ant-picker-dropdown-range-hidden{display:none}.ant-picker-dropdown .ant-picker-panel>.ant-picker-time-panel{padding-top:4px}.ant-picker-ranges{line-height:34px;list-style:none;margin-bottom:0;overflow:hidden;padding:4px 12px;text-align:left}.ant-picker-ranges>li{display:inline-block}.ant-picker-ranges .ant-picker-preset>.ant-tag-blue{background:#e6f7ff;border-color:#91d5ff;color:#1890ff;cursor:pointer}.ant-picker-ranges .ant-picker-ok{float:right;margin-left:8px}.ant-picker-range-wrapper{display:flex}.ant-picker-range-arrow{border-radius:0 0 2px;box-shadow:2px 2px 6px -2px rgba(0,0,0,.1);display:none;height:11.3137085px;margin-left:16.5px;pointer-events:none;position:absolute;transition:left .3s ease-out;width:11.3137085px;z-index:1}.ant-picker-range-arrow:before{background:#fff;background-position:-10px -10px;background-repeat:no-repeat;-webkit-clip-path:inset(33% 33%);clip-path:inset(33% 33%);-webkit-clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");content:"";height:33.9411255px;left:-11.3137085px;position:absolute;top:-11.3137085px;width:33.9411255px}.ant-picker-panel-container{background:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);overflow:hidden;transition:margin .3s;vertical-align:top}.ant-picker-panel-container .ant-picker-panels{direction:ltr;display:inline-flex;flex-wrap:nowrap}.ant-picker-panel-container .ant-picker-panel{background:transparent;border-radius:0;border-width:0 0 1px;vertical-align:top}.ant-picker-panel-container .ant-picker-panel .ant-picker-content,.ant-picker-panel-container .ant-picker-panel table{text-align:center}.ant-picker-panel-container .ant-picker-panel-focused{border-color:#f0f0f0}.ant-picker-panel{background:#fff;border:1px solid #f0f0f0;border-radius:2px;display:inline-flex;flex-direction:column;outline:none;text-align:center}.ant-picker-panel-focused{border-color:#1890ff}.ant-picker-date-panel,.ant-picker-decade-panel,.ant-picker-month-panel,.ant-picker-quarter-panel,.ant-picker-time-panel,.ant-picker-week-panel,.ant-picker-year-panel{display:flex;flex-direction:column;width:280px}.ant-picker-header{border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.85);display:flex;padding:0 8px}.ant-picker-header>*{flex:none}.ant-picker-header button{background:transparent;border:0;color:rgba(0,0,0,.25);cursor:pointer;line-height:40px;padding:0;transition:color .3s}.ant-picker-header>button{font-size:14px;min-width:1.6em}.ant-picker-header>button:hover{color:rgba(0,0,0,.85)}.ant-picker-header-view{flex:auto;font-weight:500;line-height:40px}.ant-picker-header-view button{color:inherit;font-weight:inherit}.ant-picker-header-view button:not(:first-child){margin-left:8px}.ant-picker-header-view button:hover{color:#1890ff}.ant-picker-next-icon,.ant-picker-prev-icon,.ant-picker-super-next-icon,.ant-picker-super-prev-icon{display:inline-block;height:7px;position:relative;width:7px}.ant-picker-next-icon:before,.ant-picker-prev-icon:before,.ant-picker-super-next-icon:before,.ant-picker-super-prev-icon:before{border:0 solid;border-width:1.5px 0 0 1.5px;content:"";display:inline-block;height:7px;left:0;position:absolute;top:0;width:7px}.ant-picker-super-next-icon:after,.ant-picker-super-prev-icon:after{border:0 solid;border-width:1.5px 0 0 1.5px;content:"";display:inline-block;height:7px;left:4px;position:absolute;top:4px;width:7px}.ant-picker-prev-icon,.ant-picker-super-prev-icon{transform:rotate(-45deg)}.ant-picker-next-icon,.ant-picker-super-next-icon{transform:rotate(135deg)}.ant-picker-content{border-collapse:collapse;table-layout:fixed;width:100%}.ant-picker-content td,.ant-picker-content th{font-weight:400;min-width:24px;position:relative}.ant-picker-content th{color:rgba(0,0,0,.85);height:30px;line-height:30px}.ant-picker-cell{color:rgba(0,0,0,.25);cursor:pointer;padding:3px 0}.ant-picker-cell-in-view{color:rgba(0,0,0,.85)}.ant-picker-cell:before{content:"";height:24px;left:0;position:absolute;right:0;top:50%;transform:translateY(-50%);transition:all .3s;z-index:1}.ant-picker-cell:hover:not(.ant-picker-cell-in-view) .ant-picker-cell-inner,.ant-picker-cell:hover:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):not(.ant-picker-cell-range-hover-start):not(.ant-picker-cell-range-hover-end) .ant-picker-cell-inner{background:#f5f5f5}.ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner:before{border:1px solid #1890ff;border-radius:2px;bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.ant-picker-cell-in-view.ant-picker-cell-in-range{position:relative}.ant-picker-cell-in-view.ant-picker-cell-in-range:before{background:#e6f7ff}.ant-picker-cell-in-view.ant-picker-cell-range-end .ant-picker-cell-inner,.ant-picker-cell-in-view.ant-picker-cell-range-start .ant-picker-cell-inner,.ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner{background:#1890ff;color:#fff}.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):before,.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):before{background:#e6f7ff}.ant-picker-cell-in-view.ant-picker-cell-range-start:before{left:50%}.ant-picker-cell-in-view.ant-picker-cell-range-end:before{right:50%}.ant-picker-cell-in-view.ant-picker-cell-range-hover-end.ant-picker-cell-range-end-single:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end.ant-picker-cell-range-start.ant-picker-cell-range-end.ant-picker-cell-range-start-near-hover:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:not(.ant-picker-cell-in-range):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start.ant-picker-cell-range-start-single:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start.ant-picker-cell-range-start.ant-picker-cell-range-end.ant-picker-cell-range-end-near-hover:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:not(.ant-picker-cell-in-range):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-in-range):after{border-bottom:1px dashed #7ec1ff;border-top:1px dashed #7ec1ff;content:"";height:24px;position:absolute;top:50%;transform:translateY(-50%);transition:all .3s;z-index:0}.ant-picker-cell-range-hover-end:after,.ant-picker-cell-range-hover-start:after,.ant-picker-cell-range-hover:after{left:2px;right:0}.ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-end.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single).ant-picker-cell-range-hover-end:before,.ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single).ant-picker-cell-range-hover-start:before,.ant-picker-panel>:not(.ant-picker-date-panel) .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end:before,.ant-picker-panel>:not(.ant-picker-date-panel) .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start:before{background:#cbe6ff}.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(.ant-picker-cell-range-end) .ant-picker-cell-inner{border-radius:2px 0 0 2px}.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(.ant-picker-cell-range-start) .ant-picker-cell-inner{border-radius:0 2px 2px 0}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after,.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{background:#cbe6ff;bottom:0;content:"";position:absolute;top:0;transition:all .3s;z-index:-1}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{left:0;right:-6px}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after{left:-6px;right:0}.ant-picker-cell-range-hover.ant-picker-cell-range-start:after{right:50%}.ant-picker-cell-range-hover.ant-picker-cell-range-end:after{left:50%}.ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover-edge-start-near-range):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:after,.ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-edge-start.ant-picker-cell-range-hover-edge-start-near-range:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:first-child:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:first-child:after{border-bottom-left-radius:2px;border-left:1px dashed #7ec1ff;border-top-left-radius:2px;left:6px}.ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover-edge-end.ant-picker-cell-range-hover-edge-end-near-range:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover-edge-end-near-range):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:last-child:after{border-bottom-right-radius:2px;border-right:1px dashed #7ec1ff;border-top-right-radius:2px;right:6px}.ant-picker-cell-disabled{color:rgba(0,0,0,.25);pointer-events:none}.ant-picker-cell-disabled .ant-picker-cell-inner{background:transparent}.ant-picker-cell-disabled:before{background:rgba(0,0,0,.04)}.ant-picker-cell-disabled.ant-picker-cell-today .ant-picker-cell-inner:before{border-color:rgba(0,0,0,.25)}.ant-picker-decade-panel .ant-picker-content,.ant-picker-month-panel .ant-picker-content,.ant-picker-quarter-panel .ant-picker-content,.ant-picker-year-panel .ant-picker-content{height:264px}.ant-picker-decade-panel .ant-picker-cell-inner,.ant-picker-month-panel .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-inner{padding:0 8px}.ant-picker-quarter-panel .ant-picker-content{height:56px}.ant-picker-footer{border-bottom:1px solid transparent;line-height:38px;min-width:100%;text-align:center;width:-webkit-min-content;width:-moz-min-content;width:min-content}.ant-picker-panel .ant-picker-footer{border-top:1px solid #f0f0f0}.ant-picker-footer-extra{line-height:38px;padding:0 12px;text-align:left}.ant-picker-footer-extra:not(:last-child){border-bottom:1px solid #f0f0f0}.ant-picker-now{text-align:left}.ant-picker-today-btn{color:#1890ff}.ant-picker-today-btn:hover{color:#40a9ff}.ant-picker-today-btn:active{color:#096dd9}.ant-picker-today-btn.ant-picker-today-btn-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-picker-decade-panel .ant-picker-cell-inner{padding:0 4px}.ant-picker-decade-panel .ant-picker-cell:before{display:none}.ant-picker-month-panel .ant-picker-body,.ant-picker-quarter-panel .ant-picker-body,.ant-picker-year-panel .ant-picker-body{padding:0 8px}.ant-picker-month-panel .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-inner{width:60px}.ant-picker-month-panel .ant-picker-cell-range-hover-start:after,.ant-picker-quarter-panel .ant-picker-cell-range-hover-start:after,.ant-picker-year-panel .ant-picker-cell-range-hover-start:after{border-left:1px dashed #7ec1ff;border-radius:2px 0 0 2px;left:14px}.ant-picker-month-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-month-panel .ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-quarter-panel .ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-year-panel .ant-picker-cell-range-hover-start:after,.ant-picker-quarter-panel .ant-picker-cell-range-hover-end:after,.ant-picker-year-panel .ant-picker-cell-range-hover-end:after{border-radius:0 2px 2px 0;border-right:1px dashed #7ec1ff;right:14px}.ant-picker-panel-rtl .ant-picker-month-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-quarter-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-year-panel .ant-picker-cell-range-hover-end:after{border-left:1px dashed #7ec1ff;border-radius:2px 0 0 2px;left:14px}.ant-picker-week-panel .ant-picker-body{padding:8px 12px}.ant-picker-week-panel .ant-picker-cell .ant-picker-cell-inner,.ant-picker-week-panel .ant-picker-cell-selected .ant-picker-cell-inner,.ant-picker-week-panel .ant-picker-cell:hover .ant-picker-cell-inner{background:transparent!important}.ant-picker-week-panel-row td{transition:background .3s}.ant-picker-week-panel-row:hover td{background:#f5f5f5}.ant-picker-week-panel-row-selected td,.ant-picker-week-panel-row-selected:hover td{background:#1890ff}.ant-picker-week-panel-row-selected td.ant-picker-cell-week,.ant-picker-week-panel-row-selected:hover td.ant-picker-cell-week{color:hsla(0,0%,100%,.5)}.ant-picker-week-panel-row-selected td.ant-picker-cell-today .ant-picker-cell-inner:before,.ant-picker-week-panel-row-selected:hover td.ant-picker-cell-today .ant-picker-cell-inner:before{border-color:#fff}.ant-picker-week-panel-row-selected td .ant-picker-cell-inner,.ant-picker-week-panel-row-selected:hover td .ant-picker-cell-inner{color:#fff}.ant-picker-date-panel .ant-picker-body{padding:8px 12px}.ant-picker-date-panel .ant-picker-content{width:252px}.ant-picker-date-panel .ant-picker-content th{width:36px}.ant-picker-datetime-panel{display:flex}.ant-picker-datetime-panel .ant-picker-time-panel{border-left:1px solid #f0f0f0}.ant-picker-datetime-panel .ant-picker-date-panel,.ant-picker-datetime-panel .ant-picker-time-panel{transition:opacity .3s}.ant-picker-datetime-panel-active .ant-picker-date-panel,.ant-picker-datetime-panel-active .ant-picker-time-panel{opacity:.3}.ant-picker-datetime-panel-active .ant-picker-date-panel-active,.ant-picker-datetime-panel-active .ant-picker-time-panel-active{opacity:1}.ant-picker-time-panel{min-width:auto;width:auto}.ant-picker-time-panel .ant-picker-content{display:flex;flex:auto;height:224px}.ant-picker-time-panel-column{flex:1 0 auto;list-style:none;margin:0;overflow-y:hidden;padding:0;text-align:left;transition:background .3s;width:56px}.ant-picker-time-panel-column:after{content:"";display:block;height:196px}.ant-picker-datetime-panel .ant-picker-time-panel-column:after{height:198px}.ant-picker-time-panel-column:not(:first-child){border-left:1px solid #f0f0f0}.ant-picker-time-panel-column-active{background:rgba(230,247,255,.2)}.ant-picker-time-panel-column:hover{overflow-y:auto}.ant-picker-time-panel-column>li{margin:0;padding:0}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell .ant-picker-time-panel-cell-inner{border-radius:0;color:rgba(0,0,0,.85);cursor:pointer;display:block;height:28px;line-height:28px;margin:0;padding:0 0 0 14px;transition:background .3s;width:100%}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell .ant-picker-time-panel-cell-inner:hover{background:#f5f5f5}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell-selected .ant-picker-time-panel-cell-inner{background:#e6f7ff}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell-disabled .ant-picker-time-panel-cell-inner{background:transparent;color:rgba(0,0,0,.25);cursor:not-allowed}:root .ant-picker-range-wrapper .ant-picker-month-panel .ant-picker-cell,:root .ant-picker-range-wrapper .ant-picker-year-panel .ant-picker-cell,_:-ms-fullscreen .ant-picker-range-wrapper .ant-picker-month-panel .ant-picker-cell,_:-ms-fullscreen .ant-picker-range-wrapper .ant-picker-year-panel .ant-picker-cell{padding:21px 0}.ant-picker-rtl{direction:rtl}.ant-picker-rtl .ant-picker-suffix{margin-left:0;margin-right:4px}.ant-picker-rtl .ant-picker-clear{left:0;right:auto}.ant-picker-rtl .ant-picker-separator{transform:rotate(180deg)}.ant-picker-panel-rtl .ant-picker-header-view button:not(:first-child){margin-left:0;margin-right:8px}.ant-picker-rtl.ant-picker-range .ant-picker-clear{left:11px;right:auto}.ant-picker-rtl.ant-picker-range .ant-picker-active-bar{margin-left:0;margin-right:11px}.ant-picker-rtl.ant-picker-range.ant-picker-small .ant-picker-active-bar{margin-right:7px}.ant-picker-dropdown-rtl .ant-picker-ranges{text-align:right}.ant-picker-dropdown-rtl .ant-picker-ranges .ant-picker-ok{float:left;margin-left:0;margin-right:8px}.ant-picker-panel-rtl{direction:rtl}.ant-picker-panel-rtl .ant-picker-prev-icon,.ant-picker-panel-rtl .ant-picker-super-prev-icon{transform:rotate(135deg)}.ant-picker-panel-rtl .ant-picker-next-icon,.ant-picker-panel-rtl .ant-picker-super-next-icon{transform:rotate(-45deg)}.ant-picker-cell .ant-picker-cell-inner{border-radius:2px;display:inline-block;height:24px;line-height:24px;min-width:24px;position:relative;transition:background .3s,border .3s;z-index:2}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start:before{left:0;right:50%}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-end:before{left:50%;right:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-end:before{left:50%;right:50%}.ant-picker-panel-rtl .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{left:-6px;right:0}.ant-picker-panel-rtl .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after{left:0;right:-6px}.ant-picker-panel-rtl .ant-picker-cell-range-hover.ant-picker-cell-range-start:after{left:50%;right:0}.ant-picker-panel-rtl .ant-picker-cell-range-hover.ant-picker-cell-range-end:after{left:0;right:50%}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(.ant-picker-cell-range-end) .ant-picker-cell-inner{border-radius:0 2px 2px 0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(.ant-picker-cell-range-start) .ant-picker-cell-inner{border-radius:2px 0 0 2px}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover-edge-start-near-range):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-edge-start.ant-picker-cell-range-hover-edge-start-near-range:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-selected):first-child:after{border-left:none;border-radius:0 2px 2px 0;border-right:1px dashed #7ec1ff;left:0;right:6px}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover-edge-end.ant-picker-cell-range-hover-edge-end-near-range:after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover-edge-end-near-range):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-selected):last-child:after{border-left:1px dashed #7ec1ff;border-radius:2px 0 0 2px;border-right:none;left:6px;right:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover-start.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-end.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover):after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover.ant-picker-cell-range-hover-edge-end:first-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:first-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover.ant-picker-cell-range-hover-edge-start:last-child:after{border-left:1px dashed #7ec1ff;border-radius:2px;border-right:1px dashed #7ec1ff;left:6px;right:6px}.ant-picker-dropdown-rtl .ant-picker-footer-extra{direction:rtl;text-align:right}.ant-picker-panel-rtl .ant-picker-time-panel{direction:ltr}.ant-descriptions-header{align-items:center;display:flex;margin-bottom:20px}.ant-descriptions-title{color:rgba(0,0,0,.85);flex:auto;font-size:16px;font-weight:700;line-height:1.5715;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-descriptions-extra{color:rgba(0,0,0,.85);font-size:14px;margin-left:auto}.ant-descriptions-view{border-radius:2px;width:100%}.ant-descriptions-view table{table-layout:fixed;width:100%}.ant-descriptions-row>td,.ant-descriptions-row>th{padding-bottom:16px}.ant-descriptions-row:last-child{border-bottom:none}.ant-descriptions-item-label{color:rgba(0,0,0,.85);font-size:14px;font-weight:400;line-height:1.5715;text-align:start}.ant-descriptions-item-label:after{content:":";margin:0 8px 0 2px;position:relative;top:-.5px}.ant-descriptions-item-label.ant-descriptions-item-no-colon:after{content:" "}.ant-descriptions-item-no-label:after{content:"";margin:0}.ant-descriptions-item-content{color:rgba(0,0,0,.85);display:table-cell;flex:1;font-size:14px;line-height:1.5715;overflow-wrap:break-word;word-break:break-word}.ant-descriptions-item{padding-bottom:0;vertical-align:top}.ant-descriptions-item-container{display:flex}.ant-descriptions-item-container .ant-descriptions-item-content,.ant-descriptions-item-container .ant-descriptions-item-label{align-items:baseline;display:inline-flex}.ant-descriptions-middle .ant-descriptions-row>td,.ant-descriptions-middle .ant-descriptions-row>th{padding-bottom:12px}.ant-descriptions-small .ant-descriptions-row>td,.ant-descriptions-small .ant-descriptions-row>th{padding-bottom:8px}.ant-descriptions-bordered .ant-descriptions-view{border:1px solid #f0f0f0}.ant-descriptions-bordered .ant-descriptions-view>table{border-collapse:collapse;table-layout:auto}.ant-descriptions-bordered .ant-descriptions-item-content,.ant-descriptions-bordered .ant-descriptions-item-label{border-right:1px solid #f0f0f0;padding:16px 24px}.ant-descriptions-bordered .ant-descriptions-item-content:last-child,.ant-descriptions-bordered .ant-descriptions-item-label:last-child{border-right:none}.ant-descriptions-bordered .ant-descriptions-item-label{background-color:#fafafa}.ant-descriptions-bordered .ant-descriptions-item-label:after{display:none}.ant-descriptions-bordered .ant-descriptions-row{border-bottom:1px solid #f0f0f0}.ant-descriptions-bordered .ant-descriptions-row:last-child{border-bottom:none}.ant-descriptions-bordered.ant-descriptions-middle .ant-descriptions-item-content,.ant-descriptions-bordered.ant-descriptions-middle .ant-descriptions-item-label{padding:12px 24px}.ant-descriptions-bordered.ant-descriptions-small .ant-descriptions-item-content,.ant-descriptions-bordered.ant-descriptions-small .ant-descriptions-item-label{padding:8px 16px}.ant-descriptions-rtl{direction:rtl}.ant-descriptions-rtl .ant-descriptions-item-label:after{margin:0 2px 0 8px}.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-content,.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-label{border-left:1px solid #f0f0f0;border-right:none}.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-content:last-child,.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-label:last-child{border-left:none}.ant-divider{font-feature-settings:"tnum";border-top:1px solid rgba(0,0,0,.06);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-divider-vertical{border-left:1px solid rgba(0,0,0,.06);border-top:0;display:inline-block;height:.9em;margin:0 8px;position:relative;top:-.06em;vertical-align:middle}.ant-divider-horizontal{clear:both;display:flex;margin:24px 0;min-width:100%;width:100%}.ant-divider-horizontal.ant-divider-with-text{border-top:0;border-top-color:rgba(0,0,0,.06);color:rgba(0,0,0,.85);display:flex;font-size:16px;font-weight:500;margin:16px 0;text-align:center;white-space:nowrap}.ant-divider-horizontal.ant-divider-with-text:after,.ant-divider-horizontal.ant-divider-with-text:before{border-bottom:0;border-top:1px solid transparent;border-top-color:inherit;content:"";position:relative;top:50%;transform:translateY(50%);width:50%}.ant-divider-horizontal.ant-divider-with-text-left:before{top:50%;width:5%}.ant-divider-horizontal.ant-divider-with-text-left:after,.ant-divider-horizontal.ant-divider-with-text-right:before{top:50%;width:95%}.ant-divider-horizontal.ant-divider-with-text-right:after{top:50%;width:5%}.ant-divider-inner-text{display:inline-block;padding:0 1em}.ant-divider-dashed{background:none;border:dashed rgba(0,0,0,.06);border-width:1px 0 0}.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:after,.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:before{border-style:dashed none none}.ant-divider-vertical.ant-divider-dashed{border-width:0 0 0 1px}.ant-divider-plain.ant-divider-with-text{color:rgba(0,0,0,.85);font-size:14px;font-weight:400}.ant-divider-horizontal.ant-divider-with-text-left.ant-divider-no-default-orientation-margin-left:before{width:0}.ant-divider-horizontal.ant-divider-with-text-left.ant-divider-no-default-orientation-margin-left:after{width:100%}.ant-divider-horizontal.ant-divider-with-text-left.ant-divider-no-default-orientation-margin-left .ant-divider-inner-text{padding-left:0}.ant-divider-horizontal.ant-divider-with-text-right.ant-divider-no-default-orientation-margin-right:before{width:100%}.ant-divider-horizontal.ant-divider-with-text-right.ant-divider-no-default-orientation-margin-right:after{width:0}.ant-divider-horizontal.ant-divider-with-text-right.ant-divider-no-default-orientation-margin-right .ant-divider-inner-text{padding-right:0}.ant-divider-rtl{direction:rtl}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-left:before{width:95%}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-left:after,.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-right:before{width:5%}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-right:after{width:95%}.ant-drawer{height:100%;position:fixed;transition:width 0s ease .3s,height 0s ease .3s;width:0;z-index:1000}.ant-drawer-content-wrapper{height:100%;position:absolute;transition:transform .3s cubic-bezier(.23,1,.32,1),box-shadow .3s cubic-bezier(.23,1,.32,1);width:100%}.ant-drawer .ant-drawer-content{height:100%;width:100%}.ant-drawer-left,.ant-drawer-right{height:100%;top:0;width:0}.ant-drawer-left .ant-drawer-content-wrapper,.ant-drawer-right .ant-drawer-content-wrapper{height:100%}.ant-drawer-left.ant-drawer-open,.ant-drawer-right.ant-drawer-open{transition:transform .3s cubic-bezier(.23,1,.32,1);width:100%}.ant-drawer-left,.ant-drawer-left .ant-drawer-content-wrapper{left:0}.ant-drawer-left.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:6px 0 16px -8px rgba(0,0,0,.08),9px 0 28px 0 rgba(0,0,0,.05),12px 0 48px 16px rgba(0,0,0,.03)}.ant-drawer-right,.ant-drawer-right .ant-drawer-content-wrapper{right:0}.ant-drawer-right.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:-6px 0 16px -8px rgba(0,0,0,.08),-9px 0 28px 0 rgba(0,0,0,.05),-12px 0 48px 16px rgba(0,0,0,.03)}.ant-drawer-right.ant-drawer-open.no-mask{right:1px;transform:translateX(1px)}.ant-drawer-bottom,.ant-drawer-top{height:0%;left:0;width:100%}.ant-drawer-bottom .ant-drawer-content-wrapper,.ant-drawer-top .ant-drawer-content-wrapper{width:100%}.ant-drawer-bottom.ant-drawer-open,.ant-drawer-top.ant-drawer-open{height:100%;transition:transform .3s cubic-bezier(.23,1,.32,1)}.ant-drawer-top{top:0}.ant-drawer-top.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:0 6px 16px -8px rgba(0,0,0,.08),0 9px 28px 0 rgba(0,0,0,.05),0 12px 48px 16px rgba(0,0,0,.03)}.ant-drawer-bottom,.ant-drawer-bottom .ant-drawer-content-wrapper{bottom:0}.ant-drawer-bottom.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:0 -6px 16px -8px rgba(0,0,0,.08),0 -9px 28px 0 rgba(0,0,0,.05),0 -12px 48px 16px rgba(0,0,0,.03)}.ant-drawer-bottom.ant-drawer-open.no-mask{bottom:1px;transform:translateY(1px)}.ant-drawer.ant-drawer-open .ant-drawer-mask{-webkit-animation:antdDrawerFadeIn .3s cubic-bezier(.23,1,.32,1);animation:antdDrawerFadeIn .3s cubic-bezier(.23,1,.32,1);height:100%;opacity:1;pointer-events:auto;transition:none}.ant-drawer-title{color:rgba(0,0,0,.85);flex:1;font-size:16px;font-weight:500;line-height:22px;margin:0}.ant-drawer-content{background-clip:padding-box;background-color:#fff;border:0;overflow:auto;position:relative;z-index:1}.ant-drawer-close{text-rendering:auto;background:transparent;border:0;color:rgba(0,0,0,.45);cursor:pointer;display:inline-block;font-size:16px;font-style:normal;font-weight:700;line-height:1;margin-right:12px;outline:0;text-align:center;text-decoration:none;text-transform:none;transition:color .3s}.ant-drawer-close:focus,.ant-drawer-close:hover{color:rgba(0,0,0,.75);text-decoration:none}.ant-drawer-header{background:#fff;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0;color:rgba(0,0,0,.85);padding:16px 24px;position:relative}.ant-drawer-header,.ant-drawer-header-title{align-items:center;display:flex;justify-content:space-between}.ant-drawer-header-title{flex:1}.ant-drawer-header-close-only{border:none;padding-bottom:0}.ant-drawer-wrapper-body{display:flex;flex-flow:column nowrap;height:100%;width:100%}.ant-drawer-body{word-wrap:break-word;flex-grow:1;font-size:14px;line-height:1.5715;overflow:auto;padding:24px}.ant-drawer-footer{border-top:1px solid #f0f0f0;flex-shrink:0;padding:10px 16px}.ant-drawer-mask{background-color:rgba(0,0,0,.45);height:0;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity .3s linear,height 0s ease .3s;width:100%}.ant-drawer .ant-picker-clear{background:#fff}@-webkit-keyframes antdDrawerFadeIn{0%{opacity:0}to{opacity:1}}@keyframes antdDrawerFadeIn{0%{opacity:0}to{opacity:1}}.ant-drawer-rtl{direction:rtl}.ant-drawer-rtl .ant-drawer-close{margin-left:12px;margin-right:0}.ant-dropdown-menu-item.ant-dropdown-menu-item-danger{color:#ff4d4f}.ant-dropdown-menu-item.ant-dropdown-menu-item-danger:hover{background-color:#ff4d4f;color:#fff}.ant-dropdown{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:block;font-size:14px;font-variant:tabular-nums;left:-9999px;line-height:1.5715;list-style:none;margin:0;padding:0;position:absolute;top:-9999px;z-index:1050}.ant-dropdown:before{bottom:-4px;content:" ";left:-7px;opacity:.0001;position:absolute;right:0;top:-4px;z-index:-9999}.ant-dropdown-wrap{position:relative}.ant-dropdown-wrap .ant-btn>.anticon-down{font-size:10px}.ant-dropdown-wrap .anticon-down:before{transition:transform .2s}.ant-dropdown-wrap-open .anticon-down:before{transform:rotate(180deg)}.ant-dropdown-hidden,.ant-dropdown-menu-hidden,.ant-dropdown-menu-submenu-hidden{display:none}.ant-dropdown-show-arrow.ant-dropdown-placement-top,.ant-dropdown-show-arrow.ant-dropdown-placement-topLeft,.ant-dropdown-show-arrow.ant-dropdown-placement-topRight{padding-bottom:15.3137085px}.ant-dropdown-show-arrow.ant-dropdown-placement-bottom,.ant-dropdown-show-arrow.ant-dropdown-placement-bottomLeft,.ant-dropdown-show-arrow.ant-dropdown-placement-bottomRight{padding-top:15.3137085px}.ant-dropdown-arrow{border-radius:0 0 2px;display:block;height:11.3137085px;pointer-events:none;position:absolute;width:11.3137085px;z-index:1}.ant-dropdown-arrow:before{background:#fff;background-position:-10px -10px;background-repeat:no-repeat;-webkit-clip-path:inset(33% 33%);clip-path:inset(33% 33%);-webkit-clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");content:"";height:33.9411255px;left:-11.3137085px;position:absolute;top:-11.3137085px;width:33.9411255px}.ant-dropdown-placement-top>.ant-dropdown-arrow,.ant-dropdown-placement-topLeft>.ant-dropdown-arrow,.ant-dropdown-placement-topRight>.ant-dropdown-arrow{bottom:10px;box-shadow:3px 3px 7px -3px rgba(0,0,0,.1);transform:rotate(45deg)}.ant-dropdown-placement-top>.ant-dropdown-arrow{left:50%;transform:translateX(-50%) rotate(45deg)}.ant-dropdown-placement-topLeft>.ant-dropdown-arrow{left:16px}.ant-dropdown-placement-topRight>.ant-dropdown-arrow{right:16px}.ant-dropdown-placement-bottom>.ant-dropdown-arrow,.ant-dropdown-placement-bottomLeft>.ant-dropdown-arrow,.ant-dropdown-placement-bottomRight>.ant-dropdown-arrow{box-shadow:2px 2px 5px -2px rgba(0,0,0,.1);top:9.41421356px;transform:rotate(-135deg) translateY(-.5px)}.ant-dropdown-placement-bottom>.ant-dropdown-arrow{left:50%;transform:translateX(-50%) rotate(-135deg) translateY(-.5px)}.ant-dropdown-placement-bottomLeft>.ant-dropdown-arrow{left:16px}.ant-dropdown-placement-bottomRight>.ant-dropdown-arrow{right:16px}.ant-dropdown-menu{background-clip:padding-box;background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);list-style-type:none;margin:0;outline:none;padding:4px 0;position:relative;text-align:left}.ant-dropdown-menu-item-group-title{color:rgba(0,0,0,.45);padding:5px 12px;transition:all .3s}.ant-dropdown-menu-submenu-popup{background:transparent;box-shadow:none;position:absolute;transform-origin:0 0;z-index:1050}.ant-dropdown-menu-submenu-popup li,.ant-dropdown-menu-submenu-popup ul{list-style:none}.ant-dropdown-menu-submenu-popup ul{margin-left:.3em;margin-right:.3em}.ant-dropdown-menu-item{align-items:center;display:flex;position:relative}.ant-dropdown-menu-item-icon{font-size:12px;margin-right:8px;min-width:12px}.ant-dropdown-menu-title-content{flex:auto}.ant-dropdown-menu-title-content>a{color:inherit;transition:all .3s}.ant-dropdown-menu-title-content>a:hover{color:inherit}.ant-dropdown-menu-title-content>a:after{bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-dropdown-menu-item,.ant-dropdown-menu-submenu-title{clear:both;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-weight:400;line-height:22px;margin:0;padding:5px 12px;transition:all .3s}.ant-dropdown-menu-item-selected,.ant-dropdown-menu-submenu-title-selected{background-color:#e6f7ff;color:#1890ff}.ant-dropdown-menu-item.ant-dropdown-menu-item-active,.ant-dropdown-menu-item.ant-dropdown-menu-submenu-title-active,.ant-dropdown-menu-item:hover,.ant-dropdown-menu-submenu-title.ant-dropdown-menu-item-active,.ant-dropdown-menu-submenu-title.ant-dropdown-menu-submenu-title-active,.ant-dropdown-menu-submenu-title:hover{background-color:#f5f5f5}.ant-dropdown-menu-item-disabled,.ant-dropdown-menu-submenu-title-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-dropdown-menu-item-disabled:hover,.ant-dropdown-menu-submenu-title-disabled:hover{background-color:#fff;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-dropdown-menu-item-disabled a,.ant-dropdown-menu-submenu-title-disabled a{pointer-events:none}.ant-dropdown-menu-item-divider,.ant-dropdown-menu-submenu-title-divider{background-color:#f0f0f0;height:1px;line-height:0;margin:4px 0;overflow:hidden}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon{position:absolute;right:8px}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon{color:rgba(0,0,0,.45);font-size:10px;font-style:normal;margin-right:0!important}.ant-dropdown-menu-item-group-list{list-style:none;margin:0 8px;padding:0}.ant-dropdown-menu-submenu-title{padding-right:24px}.ant-dropdown-menu-submenu-vertical{position:relative}.ant-dropdown-menu-submenu-vertical>.ant-dropdown-menu{left:100%;margin-left:4px;min-width:100%;position:absolute;top:0;transform-origin:0 0}.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title,.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow-icon{background-color:#fff;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-dropdown-menu-submenu-selected .ant-dropdown-menu-submenu-title{color:#1890ff}.ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottom,.ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottomRight,.ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottom,.ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn}.ant-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-dropdown-placement-top,.ant-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-dropdown-placement-topLeft,.ant-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-dropdown-placement-topRight,.ant-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-dropdown-placement-top,.ant-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-dropdown-placement-topLeft,.ant-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-dropdown-placement-topRight{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn}.ant-dropdown.ant-slide-down-leave.ant-slide-down-leave-active.ant-dropdown-placement-bottom,.ant-dropdown.ant-slide-down-leave.ant-slide-down-leave-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.ant-slide-down-leave.ant-slide-down-leave-active.ant-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut}.ant-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-dropdown-placement-top,.ant-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-dropdown-placement-topLeft,.ant-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-dropdown-placement-topRight{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut}.ant-dropdown-button>.anticon.anticon-down,.ant-dropdown-link>.anticon.anticon-down,.ant-dropdown-trigger>.anticon.anticon-down{font-size:10px;vertical-align:baseline}.ant-dropdown-button{white-space:nowrap}.ant-dropdown-button.ant-btn-group>.ant-btn-loading,.ant-dropdown-button.ant-btn-group>.ant-btn-loading+.ant-btn{cursor:default;pointer-events:none}.ant-dropdown-button.ant-btn-group>.ant-btn-loading+.ant-btn:before{display:block}.ant-dropdown-button.ant-btn-group>.ant-btn:last-child:not(:first-child):not(.ant-btn-icon-only){padding-left:8px;padding-right:8px}.ant-dropdown-menu-dark,.ant-dropdown-menu-dark .ant-dropdown-menu{background:#001529}.ant-dropdown-menu-dark .ant-dropdown-menu-item,.ant-dropdown-menu-dark .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-item>.anticon+span>a,.ant-dropdown-menu-dark .ant-dropdown-menu-item>.anticon+span>a .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow:after{color:hsla(0,0%,100%,.65)}.ant-dropdown-menu-dark .ant-dropdown-menu-item:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item>.anticon+span>a:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title:hover{background:transparent;color:#fff}.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected,.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected>a{background:#1890ff;color:#fff}.ant-dropdown-rtl{direction:rtl}.ant-dropdown-rtl.ant-dropdown:before{left:0;right:-7px}.ant-dropdown-menu-submenu-rtl .ant-dropdown-menu-item-group-title,.ant-dropdown-menu.ant-dropdown-menu-rtl,.ant-dropdown-rtl .ant-dropdown-menu-item-group-title{direction:rtl;text-align:right}.ant-dropdown-menu-submenu-popup.ant-dropdown-menu-submenu-rtl{transform-origin:100% 0}.ant-dropdown-rtl .ant-dropdown-menu-item,.ant-dropdown-rtl .ant-dropdown-menu-submenu-popup li,.ant-dropdown-rtl .ant-dropdown-menu-submenu-popup ul,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title{text-align:right}.ant-dropdown-rtl .ant-dropdown-menu-item>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-item>span>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title>span>.anticon:first-child{margin-left:8px;margin-right:0}.ant-dropdown-rtl .ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon{left:8px;right:auto}.ant-dropdown-rtl .ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon{margin-left:0!important;transform:scaleX(-1)}.ant-dropdown-rtl .ant-dropdown-menu-submenu-title{padding-left:24px;padding-right:12px}.ant-dropdown-rtl .ant-dropdown-menu-submenu-vertical>.ant-dropdown-menu{left:0;margin-left:0;margin-right:4px;right:100%}.ant-empty{font-size:14px;line-height:1.5715;margin:0 8px;text-align:center}.ant-empty-image{height:100px;margin-bottom:8px}.ant-empty-image img{height:100%}.ant-empty-image svg{height:100%;margin:auto}.ant-empty-footer{margin-top:16px}.ant-empty-normal{color:rgba(0,0,0,.25);margin:32px 0}.ant-empty-normal .ant-empty-image{height:40px}.ant-empty-small{color:rgba(0,0,0,.25);margin:8px 0}.ant-empty-small .ant-empty-image{height:35px}.ant-empty-img-default-ellipse{fill:#f5f5f5;fill-opacity:.8}.ant-empty-img-default-path-1{fill:#aeb8c2}.ant-empty-img-default-path-2{fill:url(#linearGradient-1)}.ant-empty-img-default-path-3{fill:#f5f5f7}.ant-empty-img-default-path-4,.ant-empty-img-default-path-5{fill:#dce0e6}.ant-empty-img-default-g{fill:#fff}.ant-empty-img-simple-ellipse{fill:#f5f5f5}.ant-empty-img-simple-g{stroke:#d9d9d9}.ant-empty-img-simple-path{fill:#fafafa}.ant-empty-rtl{direction:rtl}.ant-form-item .ant-input-number+.ant-form-text{margin-left:8px}.ant-form-inline{display:flex;flex-wrap:wrap}.ant-form-inline .ant-form-item{flex:none;flex-wrap:nowrap;margin-bottom:0;margin-right:16px}.ant-form-inline .ant-form-item-with-help{margin-bottom:24px}.ant-form-inline .ant-form-item>.ant-form-item-control,.ant-form-inline .ant-form-item>.ant-form-item-label{display:inline-block;vertical-align:top}.ant-form-inline .ant-form-item>.ant-form-item-label{flex:none}.ant-form-inline .ant-form-item .ant-form-item-has-feedback,.ant-form-inline .ant-form-item .ant-form-text{display:inline-block}.ant-form-horizontal .ant-form-item-label{flex-grow:0}.ant-form-horizontal .ant-form-item-control{flex:1 1 0;min-width:0}.ant-form-horizontal .ant-form-item-label[class$="-24"]+.ant-form-item-control,.ant-form-horizontal .ant-form-item-label[class*="-24 "]+.ant-form-item-control{min-width:unset}.ant-form-vertical .ant-form-item{flex-direction:column}.ant-form-vertical .ant-form-item-label>label{height:auto}.ant-col-24.ant-form-item-label,.ant-col-xl-24.ant-form-item-label,.ant-form-vertical .ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-24.ant-form-item-label>label,.ant-col-xl-24.ant-form-item-label>label,.ant-form-vertical .ant-form-item-label>label{margin:0}.ant-col-24.ant-form-item-label>label:after,.ant-col-xl-24.ant-form-item-label>label:after,.ant-form-vertical .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-24.ant-form-item-label,.ant-form-rtl.ant-col-xl-24.ant-form-item-label,.ant-form-rtl.ant-form-vertical .ant-form-item-label{text-align:right}@media(max-width:575px){.ant-form-item .ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-form-item .ant-form-item-label>label{margin:0}.ant-form-item .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-form-item .ant-form-item-label{text-align:right}.ant-form .ant-form-item{flex-wrap:wrap}.ant-form .ant-form-item .ant-form-item-control,.ant-form .ant-form-item .ant-form-item-label{flex:0 0 100%;max-width:100%}.ant-col-xs-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-xs-24.ant-form-item-label>label{margin:0}.ant-col-xs-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xs-24.ant-form-item-label{text-align:right}}@media(max-width:767px){.ant-col-sm-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-sm-24.ant-form-item-label>label{margin:0}.ant-col-sm-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-sm-24.ant-form-item-label{text-align:right}}@media(max-width:991px){.ant-col-md-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-md-24.ant-form-item-label>label{margin:0}.ant-col-md-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-md-24.ant-form-item-label{text-align:right}}@media(max-width:1199px){.ant-col-lg-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-lg-24.ant-form-item-label>label{margin:0}.ant-col-lg-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-lg-24.ant-form-item-label{text-align:right}}@media(max-width:1599px){.ant-col-xl-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-xl-24.ant-form-item-label>label{margin:0}.ant-col-xl-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xl-24.ant-form-item-label{text-align:right}}.ant-form-item-explain-error{color:#ff4d4f}.ant-form-item-explain-warning{color:#faad14}.ant-form-item-has-feedback .ant-switch{margin:2px 0 4px}.ant-form-item-has-warning .ant-form-item-split{color:#faad14}.ant-form-item-has-error .ant-form-item-split{color:#ff4d4f}.ant-form{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-form legend{border:0;border-bottom:1px solid #d9d9d9;color:rgba(0,0,0,.45);display:block;font-size:16px;line-height:inherit;margin-bottom:20px;padding:0;width:100%}.ant-form label{font-size:14px}.ant-form input[type=search]{box-sizing:border-box}.ant-form input[type=checkbox],.ant-form input[type=radio]{line-height:normal}.ant-form input[type=file]{display:block}.ant-form input[type=range]{display:block;width:100%}.ant-form select[multiple],.ant-form select[size]{height:auto}.ant-form input[type=checkbox]:focus,.ant-form input[type=file]:focus,.ant-form input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ant-form output{color:rgba(0,0,0,.85);display:block;font-size:14px;line-height:1.5715;padding-top:15px}.ant-form .ant-form-text{display:inline-block;padding-right:8px}.ant-form-small .ant-form-item-label>label{height:24px}.ant-form-small .ant-form-item-control-input{min-height:24px}.ant-form-large .ant-form-item-label>label{height:40px}.ant-form-large .ant-form-item-control-input{min-height:40px}.ant-form-item{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 0 24px;padding:0;transition:margin-bottom .3s linear 17ms;vertical-align:top}.ant-form-item-with-help{margin-bottom:0;transition:none}.ant-form-item-hidden,.ant-form-item-hidden.ant-row{display:none}.ant-form-item-label{display:inline-block;flex-grow:0;overflow:hidden;text-align:right;vertical-align:middle;white-space:nowrap}.ant-form-item-label-left{text-align:left}.ant-form-item-label-wrap{line-height:1.3215em;overflow:unset;white-space:unset}.ant-form-item-label>label{align-items:center;color:rgba(0,0,0,.85);display:inline-flex;font-size:14px;height:32px;max-width:100%;position:relative}.ant-form-item-label>label>.anticon{font-size:14px;vertical-align:top}.ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{color:#ff4d4f;content:"*";display:inline-block;font-family:SimSun,sans-serif;font-size:14px;line-height:1;margin-right:4px}.ant-form-hide-required-mark .ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{display:none}.ant-form-item-label>label .ant-form-item-optional{color:rgba(0,0,0,.45);display:inline-block;margin-left:4px}.ant-form-hide-required-mark .ant-form-item-label>label .ant-form-item-optional{display:none}.ant-form-item-label>label .ant-form-item-tooltip{-webkit-margin-start:4px;color:rgba(0,0,0,.45);cursor:help;margin-inline-start:4px;-ms-writing-mode:lr-tb;writing-mode:horizontal-tb}.ant-form-item-label>label:after{content:":";margin:0 8px 0 2px;position:relative;top:-.5px}.ant-form-item-label>label.ant-form-item-no-colon:after{content:" "}.ant-form-item-control{display:flex;flex-direction:column;flex-grow:1}.ant-form-item-control:first-child:not([class^=ant-col-]):not([class*=" ant-col-"]){width:100%}.ant-form-item-control-input{align-items:center;display:flex;min-height:32px;position:relative}.ant-form-item-control-input-content{flex:auto;max-width:100%}.ant-form-item-explain,.ant-form-item-extra{clear:both;color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715;transition:color .3s cubic-bezier(.215,.61,.355,1)}.ant-form-item-explain-connected{height:0;min-height:0;opacity:0}.ant-form-item-extra{min-height:24px}.ant-form-item-with-help .ant-form-item-explain{height:auto;min-height:24px;opacity:1}.ant-form-item-feedback-icon{-webkit-animation:zoomIn .3s cubic-bezier(.12,.4,.29,1.46);animation:zoomIn .3s cubic-bezier(.12,.4,.29,1.46);font-size:14px;pointer-events:none;text-align:center;visibility:visible}.ant-form-item-feedback-icon-success{color:#52c41a}.ant-form-item-feedback-icon-error{color:#ff4d4f}.ant-form-item-feedback-icon-warning{color:#faad14}.ant-form-item-feedback-icon-validating{color:#1890ff}.ant-show-help{transition:height .3s linear,min-height .3s linear,margin-bottom .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1)}.ant-show-help-leave{min-height:24px}.ant-show-help-leave-active{min-height:0}.ant-show-help-item{overflow:hidden;transition:height .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1)!important}.ant-show-help-item-appear,.ant-show-help-item-enter{opacity:0;transform:translateY(-5px)}.ant-show-help-item-appear-active,.ant-show-help-item-enter-active{opacity:1;transform:translateY(0)}.ant-show-help-item-leave-active{transform:translateY(-5px)}@-webkit-keyframes diffZoomIn1{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn1{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@-webkit-keyframes diffZoomIn2{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn2{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@-webkit-keyframes diffZoomIn3{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn3{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}.ant-form-rtl{direction:rtl}.ant-form-rtl .ant-form-item-label{text-align:left}.ant-form-rtl .ant-form-item-label>label.ant-form-item-required:before{margin-left:4px;margin-right:0}.ant-form-rtl .ant-form-item-label>label:after{margin:0 2px 0 8px}.ant-form-rtl .ant-form-item-label>label .ant-form-item-optional{margin-left:0;margin-right:4px}.ant-col-rtl .ant-form-item-control:first-child{width:100%}.ant-form-rtl .ant-form-item-has-feedback .ant-input{padding-left:24px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input-suffix{padding-left:18px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input,.ant-form-rtl .ant-form-item-has-feedback .ant-input-number-affix-wrapper .ant-input-number{padding:0}.ant-form-rtl .ant-form-item-has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix{left:28px;right:auto}.ant-form-rtl .ant-form-item-has-feedback .ant-input-number{padding-left:18px}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-clear,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-clear,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-clear{left:32px;right:auto}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-selection-selected-value{padding-left:42px;padding-right:0}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-arrow{margin-left:19px;margin-right:0}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-clear{left:32px;right:auto}.ant-form-rtl .ant-form-item-has-feedback .ant-picker,.ant-form-rtl .ant-form-item-has-feedback .ant-picker-large{padding-left:29.2px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-picker-small{padding-left:25.2px;padding-right:7px}.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-error .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-success .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-warning .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-is-validating .ant-form-item-children-icon{left:0;right:auto}.ant-form-rtl.ant-form-inline .ant-form-item{margin-left:16px;margin-right:0}.ant-row{flex-flow:row wrap}.ant-row,.ant-row:after,.ant-row:before{display:flex}.ant-row-no-wrap{flex-wrap:nowrap}.ant-row-start{justify-content:flex-start}.ant-row-center{justify-content:center}.ant-row-end{justify-content:flex-end}.ant-row-space-between{justify-content:space-between}.ant-row-space-around{justify-content:space-around}.ant-row-space-evenly{justify-content:space-evenly}.ant-row-top{align-items:flex-start}.ant-row-middle{align-items:center}.ant-row-bottom{align-items:flex-end}.ant-col{max-width:100%;min-height:1px;position:relative}.ant-col-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-push-24{left:100%}.ant-col-pull-24{right:100%}.ant-col-offset-24{margin-left:100%}.ant-col-order-24{order:24}.ant-col-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-push-23{left:95.83333333%}.ant-col-pull-23{right:95.83333333%}.ant-col-offset-23{margin-left:95.83333333%}.ant-col-order-23{order:23}.ant-col-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-push-22{left:91.66666667%}.ant-col-pull-22{right:91.66666667%}.ant-col-offset-22{margin-left:91.66666667%}.ant-col-order-22{order:22}.ant-col-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-push-21{left:87.5%}.ant-col-pull-21{right:87.5%}.ant-col-offset-21{margin-left:87.5%}.ant-col-order-21{order:21}.ant-col-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-push-20{left:83.33333333%}.ant-col-pull-20{right:83.33333333%}.ant-col-offset-20{margin-left:83.33333333%}.ant-col-order-20{order:20}.ant-col-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-push-19{left:79.16666667%}.ant-col-pull-19{right:79.16666667%}.ant-col-offset-19{margin-left:79.16666667%}.ant-col-order-19{order:19}.ant-col-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-push-18{left:75%}.ant-col-pull-18{right:75%}.ant-col-offset-18{margin-left:75%}.ant-col-order-18{order:18}.ant-col-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-push-17{left:70.83333333%}.ant-col-pull-17{right:70.83333333%}.ant-col-offset-17{margin-left:70.83333333%}.ant-col-order-17{order:17}.ant-col-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-push-16{left:66.66666667%}.ant-col-pull-16{right:66.66666667%}.ant-col-offset-16{margin-left:66.66666667%}.ant-col-order-16{order:16}.ant-col-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-push-15{left:62.5%}.ant-col-pull-15{right:62.5%}.ant-col-offset-15{margin-left:62.5%}.ant-col-order-15{order:15}.ant-col-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-push-14{left:58.33333333%}.ant-col-pull-14{right:58.33333333%}.ant-col-offset-14{margin-left:58.33333333%}.ant-col-order-14{order:14}.ant-col-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-push-13{left:54.16666667%}.ant-col-pull-13{right:54.16666667%}.ant-col-offset-13{margin-left:54.16666667%}.ant-col-order-13{order:13}.ant-col-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-push-12{left:50%}.ant-col-pull-12{right:50%}.ant-col-offset-12{margin-left:50%}.ant-col-order-12{order:12}.ant-col-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-push-11{left:45.83333333%}.ant-col-pull-11{right:45.83333333%}.ant-col-offset-11{margin-left:45.83333333%}.ant-col-order-11{order:11}.ant-col-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-push-10{left:41.66666667%}.ant-col-pull-10{right:41.66666667%}.ant-col-offset-10{margin-left:41.66666667%}.ant-col-order-10{order:10}.ant-col-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-push-9{left:37.5%}.ant-col-pull-9{right:37.5%}.ant-col-offset-9{margin-left:37.5%}.ant-col-order-9{order:9}.ant-col-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-push-8{left:33.33333333%}.ant-col-pull-8{right:33.33333333%}.ant-col-offset-8{margin-left:33.33333333%}.ant-col-order-8{order:8}.ant-col-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-push-7{left:29.16666667%}.ant-col-pull-7{right:29.16666667%}.ant-col-offset-7{margin-left:29.16666667%}.ant-col-order-7{order:7}.ant-col-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-push-6{left:25%}.ant-col-pull-6{right:25%}.ant-col-offset-6{margin-left:25%}.ant-col-order-6{order:6}.ant-col-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-push-5{left:20.83333333%}.ant-col-pull-5{right:20.83333333%}.ant-col-offset-5{margin-left:20.83333333%}.ant-col-order-5{order:5}.ant-col-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-push-4{left:16.66666667%}.ant-col-pull-4{right:16.66666667%}.ant-col-offset-4{margin-left:16.66666667%}.ant-col-order-4{order:4}.ant-col-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-push-3{left:12.5%}.ant-col-pull-3{right:12.5%}.ant-col-offset-3{margin-left:12.5%}.ant-col-order-3{order:3}.ant-col-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-push-2{left:8.33333333%}.ant-col-pull-2{right:8.33333333%}.ant-col-offset-2{margin-left:8.33333333%}.ant-col-order-2{order:2}.ant-col-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-push-1{left:4.16666667%}.ant-col-pull-1{right:4.16666667%}.ant-col-offset-1{margin-left:4.16666667%}.ant-col-order-1{order:1}.ant-col-0{display:none}.ant-col-offset-0{margin-left:0}.ant-col-order-0{order:0}.ant-col-offset-0.ant-col-rtl{margin-right:0}.ant-col-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}.ant-col-xs-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-xs-push-24{left:100%}.ant-col-xs-pull-24{right:100%}.ant-col-xs-offset-24{margin-left:100%}.ant-col-xs-order-24{order:24}.ant-col-xs-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xs-push-23{left:95.83333333%}.ant-col-xs-pull-23{right:95.83333333%}.ant-col-xs-offset-23{margin-left:95.83333333%}.ant-col-xs-order-23{order:23}.ant-col-xs-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xs-push-22{left:91.66666667%}.ant-col-xs-pull-22{right:91.66666667%}.ant-col-xs-offset-22{margin-left:91.66666667%}.ant-col-xs-order-22{order:22}.ant-col-xs-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-xs-push-21{left:87.5%}.ant-col-xs-pull-21{right:87.5%}.ant-col-xs-offset-21{margin-left:87.5%}.ant-col-xs-order-21{order:21}.ant-col-xs-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xs-push-20{left:83.33333333%}.ant-col-xs-pull-20{right:83.33333333%}.ant-col-xs-offset-20{margin-left:83.33333333%}.ant-col-xs-order-20{order:20}.ant-col-xs-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xs-push-19{left:79.16666667%}.ant-col-xs-pull-19{right:79.16666667%}.ant-col-xs-offset-19{margin-left:79.16666667%}.ant-col-xs-order-19{order:19}.ant-col-xs-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-xs-push-18{left:75%}.ant-col-xs-pull-18{right:75%}.ant-col-xs-offset-18{margin-left:75%}.ant-col-xs-order-18{order:18}.ant-col-xs-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xs-push-17{left:70.83333333%}.ant-col-xs-pull-17{right:70.83333333%}.ant-col-xs-offset-17{margin-left:70.83333333%}.ant-col-xs-order-17{order:17}.ant-col-xs-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xs-push-16{left:66.66666667%}.ant-col-xs-pull-16{right:66.66666667%}.ant-col-xs-offset-16{margin-left:66.66666667%}.ant-col-xs-order-16{order:16}.ant-col-xs-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-xs-push-15{left:62.5%}.ant-col-xs-pull-15{right:62.5%}.ant-col-xs-offset-15{margin-left:62.5%}.ant-col-xs-order-15{order:15}.ant-col-xs-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xs-push-14{left:58.33333333%}.ant-col-xs-pull-14{right:58.33333333%}.ant-col-xs-offset-14{margin-left:58.33333333%}.ant-col-xs-order-14{order:14}.ant-col-xs-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xs-push-13{left:54.16666667%}.ant-col-xs-pull-13{right:54.16666667%}.ant-col-xs-offset-13{margin-left:54.16666667%}.ant-col-xs-order-13{order:13}.ant-col-xs-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-xs-push-12{left:50%}.ant-col-xs-pull-12{right:50%}.ant-col-xs-offset-12{margin-left:50%}.ant-col-xs-order-12{order:12}.ant-col-xs-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xs-push-11{left:45.83333333%}.ant-col-xs-pull-11{right:45.83333333%}.ant-col-xs-offset-11{margin-left:45.83333333%}.ant-col-xs-order-11{order:11}.ant-col-xs-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xs-push-10{left:41.66666667%}.ant-col-xs-pull-10{right:41.66666667%}.ant-col-xs-offset-10{margin-left:41.66666667%}.ant-col-xs-order-10{order:10}.ant-col-xs-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-xs-push-9{left:37.5%}.ant-col-xs-pull-9{right:37.5%}.ant-col-xs-offset-9{margin-left:37.5%}.ant-col-xs-order-9{order:9}.ant-col-xs-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xs-push-8{left:33.33333333%}.ant-col-xs-pull-8{right:33.33333333%}.ant-col-xs-offset-8{margin-left:33.33333333%}.ant-col-xs-order-8{order:8}.ant-col-xs-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xs-push-7{left:29.16666667%}.ant-col-xs-pull-7{right:29.16666667%}.ant-col-xs-offset-7{margin-left:29.16666667%}.ant-col-xs-order-7{order:7}.ant-col-xs-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-xs-push-6{left:25%}.ant-col-xs-pull-6{right:25%}.ant-col-xs-offset-6{margin-left:25%}.ant-col-xs-order-6{order:6}.ant-col-xs-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xs-push-5{left:20.83333333%}.ant-col-xs-pull-5{right:20.83333333%}.ant-col-xs-offset-5{margin-left:20.83333333%}.ant-col-xs-order-5{order:5}.ant-col-xs-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xs-push-4{left:16.66666667%}.ant-col-xs-pull-4{right:16.66666667%}.ant-col-xs-offset-4{margin-left:16.66666667%}.ant-col-xs-order-4{order:4}.ant-col-xs-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-xs-push-3{left:12.5%}.ant-col-xs-pull-3{right:12.5%}.ant-col-xs-offset-3{margin-left:12.5%}.ant-col-xs-order-3{order:3}.ant-col-xs-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xs-push-2{left:8.33333333%}.ant-col-xs-pull-2{right:8.33333333%}.ant-col-xs-offset-2{margin-left:8.33333333%}.ant-col-xs-order-2{order:2}.ant-col-xs-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xs-push-1{left:4.16666667%}.ant-col-xs-pull-1{right:4.16666667%}.ant-col-xs-offset-1{margin-left:4.16666667%}.ant-col-xs-order-1{order:1}.ant-col-xs-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xs-push-0{left:auto}.ant-col-xs-pull-0{right:auto}.ant-col-xs-offset-0{margin-left:0}.ant-col-xs-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xs-push-0.ant-col-rtl{right:auto}.ant-col-xs-pull-0.ant-col-rtl{left:auto}.ant-col-xs-offset-0.ant-col-rtl{margin-right:0}.ant-col-xs-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-xs-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-xs-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-xs-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-xs-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-xs-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-xs-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-xs-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-xs-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-xs-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-xs-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-xs-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-xs-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-xs-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-xs-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-xs-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-xs-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-xs-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-xs-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-xs-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-xs-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-xs-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-xs-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-xs-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-xs-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-xs-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-xs-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-xs-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-xs-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-xs-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-xs-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-xs-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-xs-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-xs-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-xs-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-xs-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-xs-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-xs-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-xs-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-xs-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-xs-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-xs-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-xs-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-xs-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-xs-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-xs-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-xs-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-xs-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-xs-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-xs-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-xs-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-xs-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-xs-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-xs-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-xs-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-xs-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-xs-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-xs-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-xs-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-xs-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-xs-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-xs-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-xs-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-xs-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-xs-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-xs-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-xs-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-xs-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-xs-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-xs-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-xs-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-xs-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}@media(min-width:576px){.ant-col-sm-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-sm-push-24{left:100%}.ant-col-sm-pull-24{right:100%}.ant-col-sm-offset-24{margin-left:100%}.ant-col-sm-order-24{order:24}.ant-col-sm-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-sm-push-23{left:95.83333333%}.ant-col-sm-pull-23{right:95.83333333%}.ant-col-sm-offset-23{margin-left:95.83333333%}.ant-col-sm-order-23{order:23}.ant-col-sm-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-sm-push-22{left:91.66666667%}.ant-col-sm-pull-22{right:91.66666667%}.ant-col-sm-offset-22{margin-left:91.66666667%}.ant-col-sm-order-22{order:22}.ant-col-sm-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-sm-push-21{left:87.5%}.ant-col-sm-pull-21{right:87.5%}.ant-col-sm-offset-21{margin-left:87.5%}.ant-col-sm-order-21{order:21}.ant-col-sm-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-sm-push-20{left:83.33333333%}.ant-col-sm-pull-20{right:83.33333333%}.ant-col-sm-offset-20{margin-left:83.33333333%}.ant-col-sm-order-20{order:20}.ant-col-sm-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-sm-push-19{left:79.16666667%}.ant-col-sm-pull-19{right:79.16666667%}.ant-col-sm-offset-19{margin-left:79.16666667%}.ant-col-sm-order-19{order:19}.ant-col-sm-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-sm-push-18{left:75%}.ant-col-sm-pull-18{right:75%}.ant-col-sm-offset-18{margin-left:75%}.ant-col-sm-order-18{order:18}.ant-col-sm-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-sm-push-17{left:70.83333333%}.ant-col-sm-pull-17{right:70.83333333%}.ant-col-sm-offset-17{margin-left:70.83333333%}.ant-col-sm-order-17{order:17}.ant-col-sm-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-sm-push-16{left:66.66666667%}.ant-col-sm-pull-16{right:66.66666667%}.ant-col-sm-offset-16{margin-left:66.66666667%}.ant-col-sm-order-16{order:16}.ant-col-sm-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-sm-push-15{left:62.5%}.ant-col-sm-pull-15{right:62.5%}.ant-col-sm-offset-15{margin-left:62.5%}.ant-col-sm-order-15{order:15}.ant-col-sm-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-sm-push-14{left:58.33333333%}.ant-col-sm-pull-14{right:58.33333333%}.ant-col-sm-offset-14{margin-left:58.33333333%}.ant-col-sm-order-14{order:14}.ant-col-sm-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-sm-push-13{left:54.16666667%}.ant-col-sm-pull-13{right:54.16666667%}.ant-col-sm-offset-13{margin-left:54.16666667%}.ant-col-sm-order-13{order:13}.ant-col-sm-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-sm-push-12{left:50%}.ant-col-sm-pull-12{right:50%}.ant-col-sm-offset-12{margin-left:50%}.ant-col-sm-order-12{order:12}.ant-col-sm-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-sm-push-11{left:45.83333333%}.ant-col-sm-pull-11{right:45.83333333%}.ant-col-sm-offset-11{margin-left:45.83333333%}.ant-col-sm-order-11{order:11}.ant-col-sm-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-sm-push-10{left:41.66666667%}.ant-col-sm-pull-10{right:41.66666667%}.ant-col-sm-offset-10{margin-left:41.66666667%}.ant-col-sm-order-10{order:10}.ant-col-sm-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-sm-push-9{left:37.5%}.ant-col-sm-pull-9{right:37.5%}.ant-col-sm-offset-9{margin-left:37.5%}.ant-col-sm-order-9{order:9}.ant-col-sm-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-sm-push-8{left:33.33333333%}.ant-col-sm-pull-8{right:33.33333333%}.ant-col-sm-offset-8{margin-left:33.33333333%}.ant-col-sm-order-8{order:8}.ant-col-sm-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-sm-push-7{left:29.16666667%}.ant-col-sm-pull-7{right:29.16666667%}.ant-col-sm-offset-7{margin-left:29.16666667%}.ant-col-sm-order-7{order:7}.ant-col-sm-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-sm-push-6{left:25%}.ant-col-sm-pull-6{right:25%}.ant-col-sm-offset-6{margin-left:25%}.ant-col-sm-order-6{order:6}.ant-col-sm-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-sm-push-5{left:20.83333333%}.ant-col-sm-pull-5{right:20.83333333%}.ant-col-sm-offset-5{margin-left:20.83333333%}.ant-col-sm-order-5{order:5}.ant-col-sm-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-sm-push-4{left:16.66666667%}.ant-col-sm-pull-4{right:16.66666667%}.ant-col-sm-offset-4{margin-left:16.66666667%}.ant-col-sm-order-4{order:4}.ant-col-sm-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-sm-push-3{left:12.5%}.ant-col-sm-pull-3{right:12.5%}.ant-col-sm-offset-3{margin-left:12.5%}.ant-col-sm-order-3{order:3}.ant-col-sm-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-sm-push-2{left:8.33333333%}.ant-col-sm-pull-2{right:8.33333333%}.ant-col-sm-offset-2{margin-left:8.33333333%}.ant-col-sm-order-2{order:2}.ant-col-sm-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-sm-push-1{left:4.16666667%}.ant-col-sm-pull-1{right:4.16666667%}.ant-col-sm-offset-1{margin-left:4.16666667%}.ant-col-sm-order-1{order:1}.ant-col-sm-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-sm-push-0{left:auto}.ant-col-sm-pull-0{right:auto}.ant-col-sm-offset-0{margin-left:0}.ant-col-sm-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-sm-push-0.ant-col-rtl{right:auto}.ant-col-sm-pull-0.ant-col-rtl{left:auto}.ant-col-sm-offset-0.ant-col-rtl{margin-right:0}.ant-col-sm-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-sm-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-sm-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-sm-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-sm-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-sm-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-sm-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-sm-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-sm-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-sm-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-sm-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-sm-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-sm-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-sm-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-sm-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-sm-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-sm-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-sm-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-sm-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-sm-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-sm-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-sm-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-sm-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-sm-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-sm-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-sm-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-sm-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-sm-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-sm-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-sm-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-sm-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-sm-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-sm-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-sm-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-sm-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-sm-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-sm-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-sm-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-sm-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-sm-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-sm-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-sm-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-sm-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-sm-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-sm-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-sm-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-sm-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-sm-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-sm-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-sm-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-sm-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-sm-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-sm-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-sm-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-sm-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-sm-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-sm-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-sm-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-sm-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-sm-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-sm-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-sm-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-sm-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-sm-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-sm-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-sm-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-sm-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-sm-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-sm-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-sm-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-sm-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-sm-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}@media(min-width:768px){.ant-col-md-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-md-push-24{left:100%}.ant-col-md-pull-24{right:100%}.ant-col-md-offset-24{margin-left:100%}.ant-col-md-order-24{order:24}.ant-col-md-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-md-push-23{left:95.83333333%}.ant-col-md-pull-23{right:95.83333333%}.ant-col-md-offset-23{margin-left:95.83333333%}.ant-col-md-order-23{order:23}.ant-col-md-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-md-push-22{left:91.66666667%}.ant-col-md-pull-22{right:91.66666667%}.ant-col-md-offset-22{margin-left:91.66666667%}.ant-col-md-order-22{order:22}.ant-col-md-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-md-push-21{left:87.5%}.ant-col-md-pull-21{right:87.5%}.ant-col-md-offset-21{margin-left:87.5%}.ant-col-md-order-21{order:21}.ant-col-md-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-md-push-20{left:83.33333333%}.ant-col-md-pull-20{right:83.33333333%}.ant-col-md-offset-20{margin-left:83.33333333%}.ant-col-md-order-20{order:20}.ant-col-md-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-md-push-19{left:79.16666667%}.ant-col-md-pull-19{right:79.16666667%}.ant-col-md-offset-19{margin-left:79.16666667%}.ant-col-md-order-19{order:19}.ant-col-md-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-md-push-18{left:75%}.ant-col-md-pull-18{right:75%}.ant-col-md-offset-18{margin-left:75%}.ant-col-md-order-18{order:18}.ant-col-md-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-md-push-17{left:70.83333333%}.ant-col-md-pull-17{right:70.83333333%}.ant-col-md-offset-17{margin-left:70.83333333%}.ant-col-md-order-17{order:17}.ant-col-md-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-md-push-16{left:66.66666667%}.ant-col-md-pull-16{right:66.66666667%}.ant-col-md-offset-16{margin-left:66.66666667%}.ant-col-md-order-16{order:16}.ant-col-md-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-md-push-15{left:62.5%}.ant-col-md-pull-15{right:62.5%}.ant-col-md-offset-15{margin-left:62.5%}.ant-col-md-order-15{order:15}.ant-col-md-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-md-push-14{left:58.33333333%}.ant-col-md-pull-14{right:58.33333333%}.ant-col-md-offset-14{margin-left:58.33333333%}.ant-col-md-order-14{order:14}.ant-col-md-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-md-push-13{left:54.16666667%}.ant-col-md-pull-13{right:54.16666667%}.ant-col-md-offset-13{margin-left:54.16666667%}.ant-col-md-order-13{order:13}.ant-col-md-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-md-push-12{left:50%}.ant-col-md-pull-12{right:50%}.ant-col-md-offset-12{margin-left:50%}.ant-col-md-order-12{order:12}.ant-col-md-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-md-push-11{left:45.83333333%}.ant-col-md-pull-11{right:45.83333333%}.ant-col-md-offset-11{margin-left:45.83333333%}.ant-col-md-order-11{order:11}.ant-col-md-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-md-push-10{left:41.66666667%}.ant-col-md-pull-10{right:41.66666667%}.ant-col-md-offset-10{margin-left:41.66666667%}.ant-col-md-order-10{order:10}.ant-col-md-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-md-push-9{left:37.5%}.ant-col-md-pull-9{right:37.5%}.ant-col-md-offset-9{margin-left:37.5%}.ant-col-md-order-9{order:9}.ant-col-md-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-md-push-8{left:33.33333333%}.ant-col-md-pull-8{right:33.33333333%}.ant-col-md-offset-8{margin-left:33.33333333%}.ant-col-md-order-8{order:8}.ant-col-md-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-md-push-7{left:29.16666667%}.ant-col-md-pull-7{right:29.16666667%}.ant-col-md-offset-7{margin-left:29.16666667%}.ant-col-md-order-7{order:7}.ant-col-md-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-md-push-6{left:25%}.ant-col-md-pull-6{right:25%}.ant-col-md-offset-6{margin-left:25%}.ant-col-md-order-6{order:6}.ant-col-md-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-md-push-5{left:20.83333333%}.ant-col-md-pull-5{right:20.83333333%}.ant-col-md-offset-5{margin-left:20.83333333%}.ant-col-md-order-5{order:5}.ant-col-md-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-md-push-4{left:16.66666667%}.ant-col-md-pull-4{right:16.66666667%}.ant-col-md-offset-4{margin-left:16.66666667%}.ant-col-md-order-4{order:4}.ant-col-md-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-md-push-3{left:12.5%}.ant-col-md-pull-3{right:12.5%}.ant-col-md-offset-3{margin-left:12.5%}.ant-col-md-order-3{order:3}.ant-col-md-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-md-push-2{left:8.33333333%}.ant-col-md-pull-2{right:8.33333333%}.ant-col-md-offset-2{margin-left:8.33333333%}.ant-col-md-order-2{order:2}.ant-col-md-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-md-push-1{left:4.16666667%}.ant-col-md-pull-1{right:4.16666667%}.ant-col-md-offset-1{margin-left:4.16666667%}.ant-col-md-order-1{order:1}.ant-col-md-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-md-push-0{left:auto}.ant-col-md-pull-0{right:auto}.ant-col-md-offset-0{margin-left:0}.ant-col-md-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-md-push-0.ant-col-rtl{right:auto}.ant-col-md-pull-0.ant-col-rtl{left:auto}.ant-col-md-offset-0.ant-col-rtl{margin-right:0}.ant-col-md-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-md-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-md-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-md-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-md-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-md-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-md-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-md-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-md-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-md-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-md-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-md-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-md-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-md-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-md-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-md-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-md-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-md-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-md-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-md-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-md-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-md-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-md-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-md-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-md-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-md-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-md-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-md-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-md-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-md-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-md-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-md-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-md-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-md-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-md-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-md-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-md-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-md-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-md-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-md-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-md-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-md-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-md-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-md-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-md-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-md-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-md-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-md-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-md-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-md-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-md-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-md-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-md-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-md-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-md-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-md-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-md-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-md-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-md-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-md-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-md-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-md-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-md-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-md-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-md-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-md-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-md-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-md-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-md-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-md-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-md-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-md-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}@media(min-width:992px){.ant-col-lg-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-lg-push-24{left:100%}.ant-col-lg-pull-24{right:100%}.ant-col-lg-offset-24{margin-left:100%}.ant-col-lg-order-24{order:24}.ant-col-lg-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-lg-push-23{left:95.83333333%}.ant-col-lg-pull-23{right:95.83333333%}.ant-col-lg-offset-23{margin-left:95.83333333%}.ant-col-lg-order-23{order:23}.ant-col-lg-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-lg-push-22{left:91.66666667%}.ant-col-lg-pull-22{right:91.66666667%}.ant-col-lg-offset-22{margin-left:91.66666667%}.ant-col-lg-order-22{order:22}.ant-col-lg-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-lg-push-21{left:87.5%}.ant-col-lg-pull-21{right:87.5%}.ant-col-lg-offset-21{margin-left:87.5%}.ant-col-lg-order-21{order:21}.ant-col-lg-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-lg-push-20{left:83.33333333%}.ant-col-lg-pull-20{right:83.33333333%}.ant-col-lg-offset-20{margin-left:83.33333333%}.ant-col-lg-order-20{order:20}.ant-col-lg-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-lg-push-19{left:79.16666667%}.ant-col-lg-pull-19{right:79.16666667%}.ant-col-lg-offset-19{margin-left:79.16666667%}.ant-col-lg-order-19{order:19}.ant-col-lg-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-lg-push-18{left:75%}.ant-col-lg-pull-18{right:75%}.ant-col-lg-offset-18{margin-left:75%}.ant-col-lg-order-18{order:18}.ant-col-lg-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-lg-push-17{left:70.83333333%}.ant-col-lg-pull-17{right:70.83333333%}.ant-col-lg-offset-17{margin-left:70.83333333%}.ant-col-lg-order-17{order:17}.ant-col-lg-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-lg-push-16{left:66.66666667%}.ant-col-lg-pull-16{right:66.66666667%}.ant-col-lg-offset-16{margin-left:66.66666667%}.ant-col-lg-order-16{order:16}.ant-col-lg-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-lg-push-15{left:62.5%}.ant-col-lg-pull-15{right:62.5%}.ant-col-lg-offset-15{margin-left:62.5%}.ant-col-lg-order-15{order:15}.ant-col-lg-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-lg-push-14{left:58.33333333%}.ant-col-lg-pull-14{right:58.33333333%}.ant-col-lg-offset-14{margin-left:58.33333333%}.ant-col-lg-order-14{order:14}.ant-col-lg-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-lg-push-13{left:54.16666667%}.ant-col-lg-pull-13{right:54.16666667%}.ant-col-lg-offset-13{margin-left:54.16666667%}.ant-col-lg-order-13{order:13}.ant-col-lg-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-lg-push-12{left:50%}.ant-col-lg-pull-12{right:50%}.ant-col-lg-offset-12{margin-left:50%}.ant-col-lg-order-12{order:12}.ant-col-lg-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-lg-push-11{left:45.83333333%}.ant-col-lg-pull-11{right:45.83333333%}.ant-col-lg-offset-11{margin-left:45.83333333%}.ant-col-lg-order-11{order:11}.ant-col-lg-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-lg-push-10{left:41.66666667%}.ant-col-lg-pull-10{right:41.66666667%}.ant-col-lg-offset-10{margin-left:41.66666667%}.ant-col-lg-order-10{order:10}.ant-col-lg-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-lg-push-9{left:37.5%}.ant-col-lg-pull-9{right:37.5%}.ant-col-lg-offset-9{margin-left:37.5%}.ant-col-lg-order-9{order:9}.ant-col-lg-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-lg-push-8{left:33.33333333%}.ant-col-lg-pull-8{right:33.33333333%}.ant-col-lg-offset-8{margin-left:33.33333333%}.ant-col-lg-order-8{order:8}.ant-col-lg-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-lg-push-7{left:29.16666667%}.ant-col-lg-pull-7{right:29.16666667%}.ant-col-lg-offset-7{margin-left:29.16666667%}.ant-col-lg-order-7{order:7}.ant-col-lg-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-lg-push-6{left:25%}.ant-col-lg-pull-6{right:25%}.ant-col-lg-offset-6{margin-left:25%}.ant-col-lg-order-6{order:6}.ant-col-lg-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-lg-push-5{left:20.83333333%}.ant-col-lg-pull-5{right:20.83333333%}.ant-col-lg-offset-5{margin-left:20.83333333%}.ant-col-lg-order-5{order:5}.ant-col-lg-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-lg-push-4{left:16.66666667%}.ant-col-lg-pull-4{right:16.66666667%}.ant-col-lg-offset-4{margin-left:16.66666667%}.ant-col-lg-order-4{order:4}.ant-col-lg-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-lg-push-3{left:12.5%}.ant-col-lg-pull-3{right:12.5%}.ant-col-lg-offset-3{margin-left:12.5%}.ant-col-lg-order-3{order:3}.ant-col-lg-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-lg-push-2{left:8.33333333%}.ant-col-lg-pull-2{right:8.33333333%}.ant-col-lg-offset-2{margin-left:8.33333333%}.ant-col-lg-order-2{order:2}.ant-col-lg-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-lg-push-1{left:4.16666667%}.ant-col-lg-pull-1{right:4.16666667%}.ant-col-lg-offset-1{margin-left:4.16666667%}.ant-col-lg-order-1{order:1}.ant-col-lg-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-lg-push-0{left:auto}.ant-col-lg-pull-0{right:auto}.ant-col-lg-offset-0{margin-left:0}.ant-col-lg-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-lg-push-0.ant-col-rtl{right:auto}.ant-col-lg-pull-0.ant-col-rtl{left:auto}.ant-col-lg-offset-0.ant-col-rtl{margin-right:0}.ant-col-lg-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-lg-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-lg-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-lg-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-lg-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-lg-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-lg-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-lg-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-lg-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-lg-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-lg-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-lg-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-lg-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-lg-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-lg-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-lg-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-lg-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-lg-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-lg-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-lg-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-lg-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-lg-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-lg-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-lg-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-lg-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-lg-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-lg-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-lg-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-lg-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-lg-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-lg-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-lg-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-lg-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-lg-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-lg-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-lg-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-lg-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-lg-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-lg-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-lg-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-lg-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-lg-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-lg-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-lg-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-lg-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-lg-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-lg-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-lg-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-lg-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-lg-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-lg-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-lg-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-lg-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-lg-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-lg-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-lg-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-lg-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-lg-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-lg-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-lg-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-lg-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-lg-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-lg-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-lg-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-lg-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-lg-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-lg-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-lg-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-lg-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-lg-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-lg-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-lg-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}@media(min-width:1200px){.ant-col-xl-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-xl-push-24{left:100%}.ant-col-xl-pull-24{right:100%}.ant-col-xl-offset-24{margin-left:100%}.ant-col-xl-order-24{order:24}.ant-col-xl-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xl-push-23{left:95.83333333%}.ant-col-xl-pull-23{right:95.83333333%}.ant-col-xl-offset-23{margin-left:95.83333333%}.ant-col-xl-order-23{order:23}.ant-col-xl-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xl-push-22{left:91.66666667%}.ant-col-xl-pull-22{right:91.66666667%}.ant-col-xl-offset-22{margin-left:91.66666667%}.ant-col-xl-order-22{order:22}.ant-col-xl-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-xl-push-21{left:87.5%}.ant-col-xl-pull-21{right:87.5%}.ant-col-xl-offset-21{margin-left:87.5%}.ant-col-xl-order-21{order:21}.ant-col-xl-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xl-push-20{left:83.33333333%}.ant-col-xl-pull-20{right:83.33333333%}.ant-col-xl-offset-20{margin-left:83.33333333%}.ant-col-xl-order-20{order:20}.ant-col-xl-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xl-push-19{left:79.16666667%}.ant-col-xl-pull-19{right:79.16666667%}.ant-col-xl-offset-19{margin-left:79.16666667%}.ant-col-xl-order-19{order:19}.ant-col-xl-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-xl-push-18{left:75%}.ant-col-xl-pull-18{right:75%}.ant-col-xl-offset-18{margin-left:75%}.ant-col-xl-order-18{order:18}.ant-col-xl-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xl-push-17{left:70.83333333%}.ant-col-xl-pull-17{right:70.83333333%}.ant-col-xl-offset-17{margin-left:70.83333333%}.ant-col-xl-order-17{order:17}.ant-col-xl-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xl-push-16{left:66.66666667%}.ant-col-xl-pull-16{right:66.66666667%}.ant-col-xl-offset-16{margin-left:66.66666667%}.ant-col-xl-order-16{order:16}.ant-col-xl-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-xl-push-15{left:62.5%}.ant-col-xl-pull-15{right:62.5%}.ant-col-xl-offset-15{margin-left:62.5%}.ant-col-xl-order-15{order:15}.ant-col-xl-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xl-push-14{left:58.33333333%}.ant-col-xl-pull-14{right:58.33333333%}.ant-col-xl-offset-14{margin-left:58.33333333%}.ant-col-xl-order-14{order:14}.ant-col-xl-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xl-push-13{left:54.16666667%}.ant-col-xl-pull-13{right:54.16666667%}.ant-col-xl-offset-13{margin-left:54.16666667%}.ant-col-xl-order-13{order:13}.ant-col-xl-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-xl-push-12{left:50%}.ant-col-xl-pull-12{right:50%}.ant-col-xl-offset-12{margin-left:50%}.ant-col-xl-order-12{order:12}.ant-col-xl-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xl-push-11{left:45.83333333%}.ant-col-xl-pull-11{right:45.83333333%}.ant-col-xl-offset-11{margin-left:45.83333333%}.ant-col-xl-order-11{order:11}.ant-col-xl-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xl-push-10{left:41.66666667%}.ant-col-xl-pull-10{right:41.66666667%}.ant-col-xl-offset-10{margin-left:41.66666667%}.ant-col-xl-order-10{order:10}.ant-col-xl-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-xl-push-9{left:37.5%}.ant-col-xl-pull-9{right:37.5%}.ant-col-xl-offset-9{margin-left:37.5%}.ant-col-xl-order-9{order:9}.ant-col-xl-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xl-push-8{left:33.33333333%}.ant-col-xl-pull-8{right:33.33333333%}.ant-col-xl-offset-8{margin-left:33.33333333%}.ant-col-xl-order-8{order:8}.ant-col-xl-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xl-push-7{left:29.16666667%}.ant-col-xl-pull-7{right:29.16666667%}.ant-col-xl-offset-7{margin-left:29.16666667%}.ant-col-xl-order-7{order:7}.ant-col-xl-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-xl-push-6{left:25%}.ant-col-xl-pull-6{right:25%}.ant-col-xl-offset-6{margin-left:25%}.ant-col-xl-order-6{order:6}.ant-col-xl-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xl-push-5{left:20.83333333%}.ant-col-xl-pull-5{right:20.83333333%}.ant-col-xl-offset-5{margin-left:20.83333333%}.ant-col-xl-order-5{order:5}.ant-col-xl-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xl-push-4{left:16.66666667%}.ant-col-xl-pull-4{right:16.66666667%}.ant-col-xl-offset-4{margin-left:16.66666667%}.ant-col-xl-order-4{order:4}.ant-col-xl-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-xl-push-3{left:12.5%}.ant-col-xl-pull-3{right:12.5%}.ant-col-xl-offset-3{margin-left:12.5%}.ant-col-xl-order-3{order:3}.ant-col-xl-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xl-push-2{left:8.33333333%}.ant-col-xl-pull-2{right:8.33333333%}.ant-col-xl-offset-2{margin-left:8.33333333%}.ant-col-xl-order-2{order:2}.ant-col-xl-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xl-push-1{left:4.16666667%}.ant-col-xl-pull-1{right:4.16666667%}.ant-col-xl-offset-1{margin-left:4.16666667%}.ant-col-xl-order-1{order:1}.ant-col-xl-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xl-push-0{left:auto}.ant-col-xl-pull-0{right:auto}.ant-col-xl-offset-0{margin-left:0}.ant-col-xl-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xl-push-0.ant-col-rtl{right:auto}.ant-col-xl-pull-0.ant-col-rtl{left:auto}.ant-col-xl-offset-0.ant-col-rtl{margin-right:0}.ant-col-xl-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-xl-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-xl-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-xl-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-xl-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-xl-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-xl-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-xl-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-xl-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-xl-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-xl-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-xl-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-xl-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-xl-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-xl-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-xl-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-xl-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-xl-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-xl-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-xl-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-xl-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-xl-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-xl-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-xl-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-xl-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-xl-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-xl-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-xl-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-xl-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-xl-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-xl-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-xl-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-xl-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-xl-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-xl-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-xl-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-xl-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-xl-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-xl-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-xl-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-xl-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-xl-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-xl-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-xl-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-xl-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-xl-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-xl-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-xl-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-xl-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-xl-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-xl-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-xl-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-xl-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-xl-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-xl-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-xl-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-xl-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-xl-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-xl-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-xl-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-xl-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-xl-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-xl-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-xl-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-xl-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-xl-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-xl-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-xl-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-xl-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-xl-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-xl-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-xl-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}@media(min-width:1600px){.ant-col-xxl-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-xxl-push-24{left:100%}.ant-col-xxl-pull-24{right:100%}.ant-col-xxl-offset-24{margin-left:100%}.ant-col-xxl-order-24{order:24}.ant-col-xxl-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xxl-push-23{left:95.83333333%}.ant-col-xxl-pull-23{right:95.83333333%}.ant-col-xxl-offset-23{margin-left:95.83333333%}.ant-col-xxl-order-23{order:23}.ant-col-xxl-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xxl-push-22{left:91.66666667%}.ant-col-xxl-pull-22{right:91.66666667%}.ant-col-xxl-offset-22{margin-left:91.66666667%}.ant-col-xxl-order-22{order:22}.ant-col-xxl-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-xxl-push-21{left:87.5%}.ant-col-xxl-pull-21{right:87.5%}.ant-col-xxl-offset-21{margin-left:87.5%}.ant-col-xxl-order-21{order:21}.ant-col-xxl-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xxl-push-20{left:83.33333333%}.ant-col-xxl-pull-20{right:83.33333333%}.ant-col-xxl-offset-20{margin-left:83.33333333%}.ant-col-xxl-order-20{order:20}.ant-col-xxl-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xxl-push-19{left:79.16666667%}.ant-col-xxl-pull-19{right:79.16666667%}.ant-col-xxl-offset-19{margin-left:79.16666667%}.ant-col-xxl-order-19{order:19}.ant-col-xxl-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-xxl-push-18{left:75%}.ant-col-xxl-pull-18{right:75%}.ant-col-xxl-offset-18{margin-left:75%}.ant-col-xxl-order-18{order:18}.ant-col-xxl-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xxl-push-17{left:70.83333333%}.ant-col-xxl-pull-17{right:70.83333333%}.ant-col-xxl-offset-17{margin-left:70.83333333%}.ant-col-xxl-order-17{order:17}.ant-col-xxl-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xxl-push-16{left:66.66666667%}.ant-col-xxl-pull-16{right:66.66666667%}.ant-col-xxl-offset-16{margin-left:66.66666667%}.ant-col-xxl-order-16{order:16}.ant-col-xxl-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-xxl-push-15{left:62.5%}.ant-col-xxl-pull-15{right:62.5%}.ant-col-xxl-offset-15{margin-left:62.5%}.ant-col-xxl-order-15{order:15}.ant-col-xxl-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xxl-push-14{left:58.33333333%}.ant-col-xxl-pull-14{right:58.33333333%}.ant-col-xxl-offset-14{margin-left:58.33333333%}.ant-col-xxl-order-14{order:14}.ant-col-xxl-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xxl-push-13{left:54.16666667%}.ant-col-xxl-pull-13{right:54.16666667%}.ant-col-xxl-offset-13{margin-left:54.16666667%}.ant-col-xxl-order-13{order:13}.ant-col-xxl-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-xxl-push-12{left:50%}.ant-col-xxl-pull-12{right:50%}.ant-col-xxl-offset-12{margin-left:50%}.ant-col-xxl-order-12{order:12}.ant-col-xxl-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xxl-push-11{left:45.83333333%}.ant-col-xxl-pull-11{right:45.83333333%}.ant-col-xxl-offset-11{margin-left:45.83333333%}.ant-col-xxl-order-11{order:11}.ant-col-xxl-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xxl-push-10{left:41.66666667%}.ant-col-xxl-pull-10{right:41.66666667%}.ant-col-xxl-offset-10{margin-left:41.66666667%}.ant-col-xxl-order-10{order:10}.ant-col-xxl-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-xxl-push-9{left:37.5%}.ant-col-xxl-pull-9{right:37.5%}.ant-col-xxl-offset-9{margin-left:37.5%}.ant-col-xxl-order-9{order:9}.ant-col-xxl-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xxl-push-8{left:33.33333333%}.ant-col-xxl-pull-8{right:33.33333333%}.ant-col-xxl-offset-8{margin-left:33.33333333%}.ant-col-xxl-order-8{order:8}.ant-col-xxl-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xxl-push-7{left:29.16666667%}.ant-col-xxl-pull-7{right:29.16666667%}.ant-col-xxl-offset-7{margin-left:29.16666667%}.ant-col-xxl-order-7{order:7}.ant-col-xxl-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-xxl-push-6{left:25%}.ant-col-xxl-pull-6{right:25%}.ant-col-xxl-offset-6{margin-left:25%}.ant-col-xxl-order-6{order:6}.ant-col-xxl-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xxl-push-5{left:20.83333333%}.ant-col-xxl-pull-5{right:20.83333333%}.ant-col-xxl-offset-5{margin-left:20.83333333%}.ant-col-xxl-order-5{order:5}.ant-col-xxl-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xxl-push-4{left:16.66666667%}.ant-col-xxl-pull-4{right:16.66666667%}.ant-col-xxl-offset-4{margin-left:16.66666667%}.ant-col-xxl-order-4{order:4}.ant-col-xxl-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-xxl-push-3{left:12.5%}.ant-col-xxl-pull-3{right:12.5%}.ant-col-xxl-offset-3{margin-left:12.5%}.ant-col-xxl-order-3{order:3}.ant-col-xxl-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xxl-push-2{left:8.33333333%}.ant-col-xxl-pull-2{right:8.33333333%}.ant-col-xxl-offset-2{margin-left:8.33333333%}.ant-col-xxl-order-2{order:2}.ant-col-xxl-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xxl-push-1{left:4.16666667%}.ant-col-xxl-pull-1{right:4.16666667%}.ant-col-xxl-offset-1{margin-left:4.16666667%}.ant-col-xxl-order-1{order:1}.ant-col-xxl-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xxl-push-0{left:auto}.ant-col-xxl-pull-0{right:auto}.ant-col-xxl-offset-0{margin-left:0}.ant-col-xxl-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xxl-push-0.ant-col-rtl{right:auto}.ant-col-xxl-pull-0.ant-col-rtl{left:auto}.ant-col-xxl-offset-0.ant-col-rtl{margin-right:0}.ant-col-xxl-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-xxl-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-xxl-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-xxl-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-xxl-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-xxl-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-xxl-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-xxl-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-xxl-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-xxl-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-xxl-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-xxl-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-xxl-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-xxl-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-xxl-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-xxl-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-xxl-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-xxl-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-xxl-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-xxl-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-xxl-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-xxl-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-xxl-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-xxl-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-xxl-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-xxl-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-xxl-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-xxl-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-xxl-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-xxl-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-xxl-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-xxl-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-xxl-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-xxl-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-xxl-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-xxl-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-xxl-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-xxl-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-xxl-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-xxl-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-xxl-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-xxl-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-xxl-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-xxl-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-xxl-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-xxl-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-xxl-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-xxl-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-xxl-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-xxl-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-xxl-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-xxl-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-xxl-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-xxl-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-xxl-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-xxl-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-xxl-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-xxl-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-xxl-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-xxl-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-xxl-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-xxl-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-xxl-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-xxl-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-xxl-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-xxl-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-xxl-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-xxl-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-xxl-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-xxl-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-xxl-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-xxl-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}.ant-row-rtl{direction:rtl}.ant-image{display:inline-block;position:relative}.ant-image-img{height:auto;vertical-align:middle;width:100%}.ant-image-img-placeholder{background-color:#f5f5f5;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjUgMi41aC0xM0EuNS41IDAgMCAwIDEgM3YxMGEuNS41IDAgMCAwIC41LjVoMTNhLjUuNSAwIDAgMCAuNS0uNVYzYS41LjUgMCAwIDAtLjUtLjV6TTUuMjgxIDQuNzVhMSAxIDAgMCAxIDAgMiAxIDEgMCAwIDEgMC0yem04LjAzIDYuODNhLjEyNy4xMjcgMCAwIDEtLjA4MS4wM0gyLjc2OWEuMTI1LjEyNSAwIDAgMS0uMDk2LS4yMDdsMi42NjEtMy4xNTZhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTYuMDE2TDcuMDggMTAuMDlsMi40Ny0yLjkzYS4xMjYuMTI2IDAgMCAxIC4xNzctLjAxNmwuMDE1LjAxNiAzLjU4OCA0LjI0NGEuMTI3LjEyNyAwIDAgMS0uMDIuMTc1eiIgZmlsbD0iIzhDOEM4QyIvPjwvc3ZnPg==);background-position:50%;background-repeat:no-repeat;background-size:30%}.ant-image-mask{align-items:center;background:rgba(0,0,0,.5);bottom:0;color:#fff;cursor:pointer;display:flex;justify-content:center;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .3s}.ant-image-mask-info{overflow:hidden;padding:0 4px;text-overflow:ellipsis;white-space:nowrap}.ant-image-mask-info .anticon{-webkit-margin-end:4px;margin-inline-end:4px}.ant-image-mask:hover{opacity:1}.ant-image-placeholder{bottom:0;left:0;position:absolute;right:0;top:0}.ant-image-preview{height:100%;pointer-events:none;text-align:center}.ant-image-preview.ant-zoom-appear,.ant-image-preview.ant-zoom-enter{-webkit-animation-duration:.3s;animation-duration:.3s;opacity:0;transform:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-image-preview-mask{background-color:rgba(0,0,0,.45);bottom:0;height:100%;left:0;position:fixed;right:0;top:0;z-index:1000}.ant-image-preview-mask-hidden{display:none}.ant-image-preview-wrap{bottom:0;left:0;outline:0;overflow:auto;position:fixed;right:0;top:0}.ant-image-preview-body{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.ant-image-preview-img{cursor:-webkit-grab;cursor:grab;max-height:100%;max-width:100%;pointer-events:auto;transform:scaleX(1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle}.ant-image-preview-img,.ant-image-preview-img-wrapper{transition:transform .3s cubic-bezier(.215,.61,.355,1) 0s}.ant-image-preview-img-wrapper{bottom:0;left:0;position:absolute;right:0;top:0}.ant-image-preview-img-wrapper:before{content:"";display:inline-block;height:50%;margin-right:-1px;width:1px}.ant-image-preview-moving .ant-image-preview-img{cursor:-webkit-grabbing;cursor:grabbing}.ant-image-preview-moving .ant-image-preview-img-wrapper{transition-duration:0s}.ant-image-preview-wrap{z-index:1080}.ant-image-preview-operations{font-feature-settings:"tnum";align-items:center;background:rgba(0,0,0,.1);box-sizing:border-box;color:rgba(0,0,0,.85);color:hsla(0,0%,100%,.85);display:flex;flex-direction:row-reverse;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;pointer-events:auto;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-image-preview-operations-operation{cursor:pointer;margin-left:12px;padding:12px}.ant-image-preview-operations-operation-disabled{color:hsla(0,0%,100%,.25);pointer-events:none}.ant-image-preview-operations-operation:last-of-type{margin-left:0}.ant-image-preview-operations-progress{left:50%;position:absolute;transform:translateX(-50%)}.ant-image-preview-operations-icon{font-size:18px}.ant-image-preview-switch-left,.ant-image-preview-switch-right{align-items:center;background:rgba(0,0,0,.1);border-radius:50%;color:hsla(0,0%,100%,.85);cursor:pointer;display:flex;height:44px;justify-content:center;margin-top:-22px;pointer-events:auto;position:absolute;right:10px;top:50%;width:44px;z-index:1}.ant-image-preview-switch-left-disabled,.ant-image-preview-switch-right-disabled{color:hsla(0,0%,100%,.25);cursor:not-allowed}.ant-image-preview-switch-left-disabled>.anticon,.ant-image-preview-switch-right-disabled>.anticon{cursor:not-allowed}.ant-image-preview-switch-left>.anticon,.ant-image-preview-switch-right>.anticon{font-size:18px}.ant-image-preview-switch-left{left:10px}.ant-image-preview-switch-right{right:10px}.ant-input-number-affix-wrapper{-webkit-padding-start:11px;background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);display:inline-block;display:inline-flex;font-size:14px;line-height:1.5715;min-width:0;padding:0;padding-inline-start:11px;position:relative;transition:all .3s;width:100%;width:90px}.ant-input-number-affix-wrapper::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input-number-affix-wrapper:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input-number-affix-wrapper::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input-number-affix-wrapper:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-number-affix-wrapper:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number-affix-wrapper:placeholder-shown{text-overflow:ellipsis}.ant-input-number-affix-wrapper:hover{border-color:#40a9ff;border-right-width:1px}.ant-input-number-affix-wrapper-focused,.ant-input-number-affix-wrapper:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-number-affix-wrapper-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-number-affix-wrapper-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-number-affix-wrapper[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-number-affix-wrapper[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-number-affix-wrapper-borderless,.ant-input-number-affix-wrapper-borderless-disabled,.ant-input-number-affix-wrapper-borderless-focused,.ant-input-number-affix-wrapper-borderless:focus,.ant-input-number-affix-wrapper-borderless:hover,.ant-input-number-affix-wrapper-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input-number-affix-wrapper{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-input-number-affix-wrapper-lg{font-size:16px;padding:6.5px 11px}.ant-input-number-affix-wrapper-sm{padding:0 7px}.ant-input-number-affix-wrapper:not(.ant-input-number-affix-wrapper-disabled):hover{border-color:#40a9ff;border-right-width:1px;z-index:1}.ant-input-number-affix-wrapper-focused,.ant-input-number-affix-wrapper:focus{z-index:1}.ant-input-number-affix-wrapper-disabled .ant-input-number[disabled]{background:transparent}.ant-input-number-affix-wrapper>div.ant-input-number{border:none;outline:none;width:100%}.ant-input-number-affix-wrapper>div.ant-input-number.ant-input-number-focused{box-shadow:none!important}.ant-input-number-affix-wrapper input.ant-input-number-input{padding:0}.ant-input-number-affix-wrapper:before{content:" ";visibility:hidden;width:0}.ant-input-number-affix-wrapper .ant-input-number-handler-wrap{z-index:2}.ant-input-number-prefix,.ant-input-number-suffix{align-items:center;display:flex;flex:none;pointer-events:none}.ant-input-number-prefix{-webkit-margin-end:4px;margin-inline-end:4px}.ant-input-number-suffix{height:100%;margin-left:4px;margin-right:11px;position:absolute;right:0;top:0;z-index:1}.ant-input-number-group-wrapper .ant-input-number-affix-wrapper{width:100%}.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number,.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:hover{background:#fff;border-color:#ff4d4f}.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number-focused,.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-input-number-status-error .ant-input-number-prefix{color:#ff4d4f}.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number,.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:hover{background:#fff;border-color:#faad14}.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number-focused,.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-input-number-status-warning .ant-input-number-prefix{color:#faad14}.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper,.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:hover{background:#fff;border-color:#ff4d4f}.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper-focused,.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-input-number-affix-wrapper-status-error .ant-input-number-prefix{color:#ff4d4f}.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper,.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:hover{background:#fff;border-color:#faad14}.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper-focused,.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-input-number-affix-wrapper-status-warning .ant-input-number-prefix{color:#faad14}.ant-input-number-group-wrapper-status-error .ant-input-number-group-addon{border-color:#ff4d4f;color:#ff4d4f}.ant-input-number-group-wrapper-status-warning .ant-input-number-group-addon{border-color:#faad14;color:#faad14}.ant-input-number{font-feature-settings:"tnum";background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;min-width:0;padding:0;position:relative;transition:all .3s;width:100%;width:90px}.ant-input-number::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input-number:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input-number::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input-number:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-number:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number:placeholder-shown{text-overflow:ellipsis}.ant-input-number-focused,.ant-input-number:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-number[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-number[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-number-borderless,.ant-input-number-borderless-disabled,.ant-input-number-borderless-focused,.ant-input-number-borderless:focus,.ant-input-number-borderless:hover,.ant-input-number-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input-number{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-input-number-lg{padding:6.5px 11px}.ant-input-number-sm{padding:0 7px}.ant-input-number-group{font-feature-settings:"tnum";border-collapse:separate;border-spacing:0;box-sizing:border-box;color:rgba(0,0,0,.85);display:table;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative;width:100%}.ant-input-number-group[class*=col-]{float:none;padding-left:0;padding-right:0}.ant-input-number-group>[class*=col-]{padding-right:8px}.ant-input-number-group>[class*=col-]:last-child{padding-right:0}.ant-input-number-group-addon,.ant-input-number-group-wrap,.ant-input-number-group>.ant-input-number{display:table-cell}.ant-input-number-group-addon:not(:first-child):not(:last-child),.ant-input-number-group-wrap:not(:first-child):not(:last-child),.ant-input-number-group>.ant-input-number:not(:first-child):not(:last-child){border-radius:0}.ant-input-number-group-addon,.ant-input-number-group-wrap{vertical-align:middle;white-space:nowrap;width:1px}.ant-input-number-group-wrap>*{display:block!important}.ant-input-number-group .ant-input-number{float:left;margin-bottom:0;text-align:inherit;width:100%}.ant-input-number-group .ant-input-number:focus,.ant-input-number-group .ant-input-number:hover{border-right-width:1px;z-index:1}.ant-input-search-with-button .ant-input-number-group .ant-input-number:hover{z-index:0}.ant-input-number-group-addon{background-color:#fafafa;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);font-size:14px;font-weight:400;padding:0 11px;position:relative;text-align:center;transition:all .3s}.ant-input-number-group-addon .ant-select{margin:-5px -11px}.ant-input-number-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{background-color:inherit;border:1px solid transparent;box-shadow:none}.ant-input-number-group-addon .ant-select-focused .ant-select-selector,.ant-input-number-group-addon .ant-select-open .ant-select-selector{color:#1890ff}.ant-input-number-group-addon .ant-cascader-picker{background-color:transparent;margin:-9px -12px}.ant-input-number-group-addon .ant-cascader-picker .ant-cascader-input{border:0;box-shadow:none;text-align:left}.ant-input-number-group-addon:first-child,.ant-input-number-group-addon:first-child .ant-select .ant-select-selector,.ant-input-number-group>.ant-input-number:first-child,.ant-input-number-group>.ant-input-number:first-child .ant-select .ant-select-selector{border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-number-group>.ant-input-number-affix-wrapper:not(:first-child) .ant-input-number{border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-number-group>.ant-input-number-affix-wrapper:not(:last-child) .ant-input-number{border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-number-group-addon:first-child{border-right:0}.ant-input-number-group-addon:last-child{border-left:0}.ant-input-number-group-addon:last-child,.ant-input-number-group-addon:last-child .ant-select .ant-select-selector,.ant-input-number-group>.ant-input-number:last-child,.ant-input-number-group>.ant-input-number:last-child .ant-select .ant-select-selector{border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-number-group-lg .ant-input-number,.ant-input-number-group-lg>.ant-input-number-group-addon{font-size:16px;padding:6.5px 11px}.ant-input-number-group-sm .ant-input-number,.ant-input-number-group-sm>.ant-input-number-group-addon{padding:0 7px}.ant-input-number-group-lg .ant-select-single .ant-select-selector{height:40px}.ant-input-number-group-sm .ant-select-single .ant-select-selector{height:24px}.ant-input-number-group .ant-input-number-affix-wrapper:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-search .ant-input-number-group .ant-input-number-affix-wrapper:not(:last-child){border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-input-number-group .ant-input-number-affix-wrapper:not(:first-child),.ant-input-search .ant-input-number-group .ant-input-number-affix-wrapper:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-number-group.ant-input-number-group-compact{display:block}.ant-input-number-group.ant-input-number-group-compact:before{content:"";display:table}.ant-input-number-group.ant-input-number-group-compact:after{clear:both;content:"";display:table}.ant-input-number-group.ant-input-number-group-compact-addon:not(:first-child):not(:last-child),.ant-input-number-group.ant-input-number-group-compact-wrap:not(:first-child):not(:last-child),.ant-input-number-group.ant-input-number-group-compact>.ant-input-number:not(:first-child):not(:last-child){border-right-width:1px}.ant-input-number-group.ant-input-number-group-compact-addon:not(:first-child):not(:last-child):focus,.ant-input-number-group.ant-input-number-group-compact-addon:not(:first-child):not(:last-child):hover,.ant-input-number-group.ant-input-number-group-compact-wrap:not(:first-child):not(:last-child):focus,.ant-input-number-group.ant-input-number-group-compact-wrap:not(:first-child):not(:last-child):hover,.ant-input-number-group.ant-input-number-group-compact>.ant-input-number:not(:first-child):not(:last-child):focus,.ant-input-number-group.ant-input-number-group-compact>.ant-input-number:not(:first-child):not(:last-child):hover{z-index:1}.ant-input-number-group.ant-input-number-group-compact>*{border-radius:0;display:inline-block;float:none;vertical-align:top}.ant-input-number-group.ant-input-number-group-compact>.ant-input-number-affix-wrapper,.ant-input-number-group.ant-input-number-group-compact>.ant-picker-range{display:inline-flex}.ant-input-number-group.ant-input-number-group-compact>:not(:last-child){border-right-width:1px;margin-right:-1px}.ant-input-number-group.ant-input-number-group-compact .ant-input-number{float:none}.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-input-group-wrapper .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select>.ant-select-selector{border-radius:0;border-right-width:1px}.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker .ant-input:focus,.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker .ant-input:hover,.ant-input-number-group.ant-input-number-group-compact>.ant-input-group-wrapper .ant-input:focus,.ant-input-number-group.ant-input-number-group-compact>.ant-input-group-wrapper .ant-input:hover,.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete .ant-input:focus,.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete .ant-input:hover,.ant-input-number-group.ant-input-number-group-compact>.ant-select-focused,.ant-input-number-group.ant-input-number-group-compact>.ant-select>.ant-select-arrow,.ant-input-number-group.ant-input-number-group-compact>.ant-select>.ant-select-selector:focus,.ant-input-number-group.ant-input-number-group-compact>.ant-select>.ant-select-selector:hover{z-index:1}.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-number-group.ant-input-number-group-compact>:first-child{border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-number-group.ant-input-number-group-compact>:last-child{border-bottom-right-radius:2px;border-right-width:1px;border-top-right-radius:2px}.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete .ant-input{vertical-align:top}.ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper{margin-left:-1px}.ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper .ant-input-affix-wrapper,.ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input-group-addon>.ant-input-search-button{border-radius:0}.ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input{border-radius:2px 0 0 2px}.ant-input-number-group>.ant-input-number-rtl:first-child{border-radius:0 2px 2px 0}.ant-input-number-group>.ant-input-number-rtl:last-child{border-radius:2px 0 0 2px}.ant-input-number-group-rtl .ant-input-number-group-addon:first-child{border-left:0;border-radius:0 2px 2px 0;border-right:1px solid #d9d9d9}.ant-input-number-group-rtl .ant-input-number-group-addon:last-child{border-left:1px solid #d9d9d9;border-radius:2px 0 0 2px;border-right:0}.ant-input-number-group-wrapper{display:inline-block;text-align:start;vertical-align:top}.ant-input-number-handler{border-left:1px solid #d9d9d9;color:rgba(0,0,0,.45);display:block;font-weight:700;height:50%;line-height:0;overflow:hidden;position:relative;text-align:center;transition:all .1s linear;width:100%}.ant-input-number-handler:active{background:#f4f4f4}.ant-input-number-handler:hover .ant-input-number-handler-down-inner,.ant-input-number-handler:hover .ant-input-number-handler-up-inner{color:#40a9ff}.ant-input-number-handler-down-inner,.ant-input-number-handler-up-inner{text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:inherit;color:rgba(0,0,0,.45);display:inline-block;font-style:normal;height:12px;line-height:0;line-height:12px;position:absolute;right:4px;text-align:center;text-transform:none;transition:all .1s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:-.125em;width:12px}.ant-input-number-handler-down-inner>*,.ant-input-number-handler-up-inner>*{line-height:1}.ant-input-number-handler-down-inner svg,.ant-input-number-handler-up-inner svg{display:inline-block}.ant-input-number-handler-down-inner:before,.ant-input-number-handler-up-inner:before{display:none}.ant-input-number-handler-down-inner .ant-input-number-handler-down-inner-icon,.ant-input-number-handler-down-inner .ant-input-number-handler-up-inner-icon,.ant-input-number-handler-up-inner .ant-input-number-handler-down-inner-icon,.ant-input-number-handler-up-inner .ant-input-number-handler-up-inner-icon{display:block}.ant-input-number:hover{border-color:#40a9ff;border-right-width:1px}.ant-input-number:hover+.ant-form-item-children-icon{opacity:0;transition:opacity .24s linear .24s}.ant-input-number-focused{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-number-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-number-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-number-disabled .ant-input-number-input{cursor:not-allowed}.ant-input-number-disabled .ant-input-number-handler-wrap,.ant-input-number-readonly .ant-input-number-handler-wrap{display:none}.ant-input-number-input{-webkit-appearance:textfield!important;-moz-appearance:textfield!important;appearance:textfield!important;background-color:transparent;border:0;border-radius:2px;height:30px;outline:0;padding:0 11px;text-align:left;transition:all .3s linear;width:100%}.ant-input-number-input::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input-number-input:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input-number-input::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input-number-input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-number-input:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number-input:placeholder-shown{text-overflow:ellipsis}.ant-input-number-input[type=number]::-webkit-inner-spin-button,.ant-input-number-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.ant-input-number-lg{font-size:16px;padding:0}.ant-input-number-lg input{height:38px}.ant-input-number-sm{padding:0}.ant-input-number-sm input{height:22px;padding:0 7px}.ant-input-number-handler-wrap{background:#fff;border-radius:0 2px 2px 0;height:100%;opacity:0;position:absolute;right:0;top:0;transition:opacity .24s linear .1s;width:22px}.ant-input-number-handler-wrap .ant-input-number-handler .ant-input-number-handler-down-inner,.ant-input-number-handler-wrap .ant-input-number-handler .ant-input-number-handler-up-inner{align-items:center;display:flex;font-size:7px;justify-content:center;margin-right:0;min-width:auto}.ant-input-number-borderless .ant-input-number-handler-wrap{border-left-width:0}.ant-input-number-handler-wrap:hover .ant-input-number-handler{height:40%}.ant-input-number-focused .ant-input-number-handler-wrap,.ant-input-number:hover .ant-input-number-handler-wrap{opacity:1}.ant-input-number-handler-up{border-top-right-radius:2px;cursor:pointer}.ant-input-number-handler-up-inner{margin-top:-5px;text-align:center;top:50%}.ant-input-number-handler-up:hover{height:60%!important}.ant-input-number-handler-down{border-bottom-right-radius:2px;border-top:1px solid #d9d9d9;cursor:pointer;top:0}.ant-input-number-handler-down-inner{text-align:center;top:50%;transform:translateY(-50%)}.ant-input-number-handler-down:hover{height:60%!important}.ant-input-number-borderless .ant-input-number-handler-down{border-top-width:0}.ant-input-number-handler-down-disabled,.ant-input-number-handler-up-disabled{cursor:not-allowed}.ant-input-number-handler-down-disabled:hover .ant-input-number-handler-down-inner,.ant-input-number-handler-up-disabled:hover .ant-input-number-handler-up-inner{color:rgba(0,0,0,.25)}.ant-input-number-borderless{box-shadow:none}.ant-input-number-out-of-range input{color:#ff4d4f}.ant-input-number-rtl{direction:rtl}.ant-input-number-rtl .ant-input-number-handler{border-left:0;border-right:1px solid #d9d9d9}.ant-input-number-rtl .ant-input-number-handler-wrap{left:0;right:auto}.ant-input-number-rtl.ant-input-number-borderless .ant-input-number-handler-wrap{border-right-width:0}.ant-input-number-rtl .ant-input-number-handler-up{border-top-right-radius:0}.ant-input-number-rtl .ant-input-number-handler-down{border-bottom-right-radius:0}.ant-input-number-rtl .ant-input-number-input{direction:ltr;text-align:right}.ant-input-affix-wrapper{background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);display:inline-block;display:inline-flex;font-size:14px;line-height:1.5715;min-width:0;padding:4px 11px;position:relative;transition:all .3s;width:100%}.ant-input-affix-wrapper::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input-affix-wrapper:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input-affix-wrapper::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input-affix-wrapper:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-affix-wrapper:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-affix-wrapper:placeholder-shown{text-overflow:ellipsis}.ant-input-affix-wrapper:hover{border-color:#40a9ff;border-right-width:1px}.ant-input-rtl .ant-input-affix-wrapper:hover{border-left-width:1px!important;border-right-width:0}.ant-input-affix-wrapper-focused,.ant-input-affix-wrapper:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-rtl .ant-input-affix-wrapper-focused,.ant-input-rtl .ant-input-affix-wrapper:focus{border-left-width:1px!important;border-right-width:0}.ant-input-affix-wrapper-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-affix-wrapper-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-affix-wrapper[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-affix-wrapper[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-affix-wrapper-borderless,.ant-input-affix-wrapper-borderless-disabled,.ant-input-affix-wrapper-borderless-focused,.ant-input-affix-wrapper-borderless:focus,.ant-input-affix-wrapper-borderless:hover,.ant-input-affix-wrapper-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input-affix-wrapper{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-input-affix-wrapper-lg{font-size:16px;padding:6.5px 11px}.ant-input-affix-wrapper-sm{padding:0 7px}.ant-input-affix-wrapper-rtl{direction:rtl}.ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover{border-color:#40a9ff;border-right-width:1px;z-index:1}.ant-input-rtl .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover{border-left-width:1px!important;border-right-width:0}.ant-input-search-with-button .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover{z-index:0}.ant-input-affix-wrapper-focused,.ant-input-affix-wrapper:focus{z-index:1}.ant-input-affix-wrapper-disabled .ant-input[disabled]{background:transparent}.ant-input-affix-wrapper>input.ant-input{border:none;outline:none;padding:0}.ant-input-affix-wrapper>input.ant-input:focus{box-shadow:none!important}.ant-input-affix-wrapper:before{content:" ";visibility:hidden;width:0}.ant-input-prefix,.ant-input-suffix{align-items:center;display:flex;flex:none}.ant-input-prefix>:not(:last-child),.ant-input-suffix>:not(:last-child){margin-right:8px}.ant-input-show-count-suffix{color:rgba(0,0,0,.45)}.ant-input-show-count-has-suffix{margin-right:2px}.ant-input-prefix{margin-right:4px}.ant-input-suffix{margin-left:4px}.ant-input-clear-icon,.anticon.ant-input-clear-icon{color:rgba(0,0,0,.25);cursor:pointer;font-size:12px;margin:0;transition:color .3s;vertical-align:-1px}.ant-input-clear-icon:hover,.anticon.ant-input-clear-icon:hover{color:rgba(0,0,0,.45)}.ant-input-clear-icon:active,.anticon.ant-input-clear-icon:active{color:rgba(0,0,0,.85)}.ant-input-clear-icon-hidden,.anticon.ant-input-clear-icon-hidden{visibility:hidden}.ant-input-clear-icon-has-suffix,.anticon.ant-input-clear-icon-has-suffix{margin:0 4px}.ant-input-affix-wrapper-textarea-with-clear-btn{border:0!important;padding:0!important}.ant-input-affix-wrapper-textarea-with-clear-btn .ant-input-clear-icon{position:absolute;right:8px;top:8px;z-index:1}.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input,.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:hover{background:#fff;border-color:#ff4d4f}.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input-focused,.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-input-status-error .ant-input-prefix{color:#ff4d4f}.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input,.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:hover{background:#fff;border-color:#faad14}.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input-focused,.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-input-status-warning .ant-input-prefix{color:#faad14}.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper,.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:hover{background:#fff;border-color:#ff4d4f}.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper-focused,.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-input-affix-wrapper-status-error .ant-input-prefix{color:#ff4d4f}.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper,.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:hover{background:#fff;border-color:#faad14}.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper-focused,.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-input-affix-wrapper-status-warning .ant-input-prefix{color:#faad14}.ant-input-textarea-status-error.ant-input-textarea-has-feedback .ant-input,.ant-input-textarea-status-success.ant-input-textarea-has-feedback .ant-input,.ant-input-textarea-status-validating.ant-input-textarea-has-feedback .ant-input,.ant-input-textarea-status-warning.ant-input-textarea-has-feedback .ant-input{padding-right:24px}.ant-input-group-wrapper-status-error .ant-input-group-addon{border-color:#ff4d4f;color:#ff4d4f}.ant-input-group-wrapper-status-warning .ant-input-group-addon{border-color:#faad14;color:#faad14}.ant-input{font-feature-settings:"tnum";background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;min-width:0;padding:4px 11px;position:relative;transition:all .3s;width:100%}.ant-input::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input:-ms-input-placeholder{text-overflow:ellipsis}.ant-input:placeholder-shown{text-overflow:ellipsis}.ant-input:hover{border-color:#40a9ff;border-right-width:1px}.ant-input-rtl .ant-input:hover{border-left-width:1px!important;border-right-width:0}.ant-input-focused,.ant-input:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-rtl .ant-input-focused,.ant-input-rtl .ant-input:focus{border-left-width:1px!important;border-right-width:0}.ant-input-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-borderless,.ant-input-borderless-disabled,.ant-input-borderless-focused,.ant-input-borderless:focus,.ant-input-borderless:hover,.ant-input-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-input-lg{font-size:16px;padding:6.5px 11px}.ant-input-sm{padding:0 7px}.ant-input-rtl{direction:rtl}.ant-input-group{font-feature-settings:"tnum";border-collapse:separate;border-spacing:0;box-sizing:border-box;color:rgba(0,0,0,.85);display:table;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative;width:100%}.ant-input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.ant-input-group>[class*=col-]{padding-right:8px}.ant-input-group>[class*=col-]:last-child{padding-right:0}.ant-input-group-addon,.ant-input-group-wrap,.ant-input-group>.ant-input{display:table-cell}.ant-input-group-addon:not(:first-child):not(:last-child),.ant-input-group-wrap:not(:first-child):not(:last-child),.ant-input-group>.ant-input:not(:first-child):not(:last-child){border-radius:0}.ant-input-group-addon,.ant-input-group-wrap{vertical-align:middle;white-space:nowrap;width:1px}.ant-input-group-wrap>*{display:block!important}.ant-input-group .ant-input{float:left;margin-bottom:0;text-align:inherit;width:100%}.ant-input-group .ant-input:focus,.ant-input-group .ant-input:hover{border-right-width:1px;z-index:1}.ant-input-search-with-button .ant-input-group .ant-input:hover{z-index:0}.ant-input-group-addon{background-color:#fafafa;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);font-size:14px;font-weight:400;padding:0 11px;position:relative;text-align:center;transition:all .3s}.ant-input-group-addon .ant-select{margin:-5px -11px}.ant-input-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{background-color:inherit;border:1px solid transparent;box-shadow:none}.ant-input-group-addon .ant-select-focused .ant-select-selector,.ant-input-group-addon .ant-select-open .ant-select-selector{color:#1890ff}.ant-input-group-addon .ant-cascader-picker{background-color:transparent;margin:-9px -12px}.ant-input-group-addon .ant-cascader-picker .ant-cascader-input{border:0;box-shadow:none;text-align:left}.ant-input-group-addon:first-child,.ant-input-group-addon:first-child .ant-select .ant-select-selector,.ant-input-group>.ant-input:first-child,.ant-input-group>.ant-input:first-child .ant-select .ant-select-selector{border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-group>.ant-input-affix-wrapper:not(:first-child) .ant-input{border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-group>.ant-input-affix-wrapper:not(:last-child) .ant-input{border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-group-addon:first-child{border-right:0}.ant-input-group-addon:last-child{border-left:0}.ant-input-group-addon:last-child,.ant-input-group-addon:last-child .ant-select .ant-select-selector,.ant-input-group>.ant-input:last-child,.ant-input-group>.ant-input:last-child .ant-select .ant-select-selector{border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-group-lg .ant-input,.ant-input-group-lg>.ant-input-group-addon{font-size:16px;padding:6.5px 11px}.ant-input-group-sm .ant-input,.ant-input-group-sm>.ant-input-group-addon{padding:0 7px}.ant-input-group-lg .ant-select-single .ant-select-selector{height:40px}.ant-input-group-sm .ant-select-single .ant-select-selector{height:24px}.ant-input-group .ant-input-affix-wrapper:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-search .ant-input-group .ant-input-affix-wrapper:not(:last-child){border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-input-group .ant-input-affix-wrapper:not(:first-child),.ant-input-search .ant-input-group .ant-input-affix-wrapper:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-group.ant-input-group-compact{display:block}.ant-input-group.ant-input-group-compact:before{content:"";display:table}.ant-input-group.ant-input-group-compact:after{clear:both;content:"";display:table}.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child),.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child),.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child){border-right-width:1px}.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child):hover,.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child):hover,.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child):hover{z-index:1}.ant-input-group.ant-input-group-compact>*{border-radius:0;display:inline-block;float:none;vertical-align:top}.ant-input-group.ant-input-group-compact>.ant-input-affix-wrapper,.ant-input-group.ant-input-group-compact>.ant-picker-range{display:inline-flex}.ant-input-group.ant-input-group-compact>:not(:last-child){border-right-width:1px;margin-right:-1px}.ant-input-group.ant-input-group-compact .ant-input{float:none}.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector{border-radius:0;border-right-width:1px}.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-select-focused,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-arrow,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector:focus,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector:hover{z-index:1}.ant-input-group.ant-input-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-group.ant-input-group-compact>:first-child{border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-input-group.ant-input-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-group.ant-input-group-compact>:last-child{border-bottom-right-radius:2px;border-right-width:1px;border-top-right-radius:2px}.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input{vertical-align:top}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper{margin-left:-1px}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper .ant-input-affix-wrapper,.ant-input-group.ant-input-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input-group-addon>.ant-input-search-button{border-radius:0}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input{border-radius:2px 0 0 2px}.ant-input-group-rtl .ant-input-group-addon:first-child,.ant-input-group>.ant-input-rtl:first-child{border-radius:0 2px 2px 0}.ant-input-group-rtl .ant-input-group-addon:first-child{border-left:0;border-right:1px solid #d9d9d9}.ant-input-group-rtl .ant-input-group-addon:last-child{border-left:1px solid #d9d9d9;border-radius:2px 0 0 2px;border-right:0}.ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:first-child),.ant-input-group-rtl.ant-input-group-addon:last-child,.ant-input-group-rtl.ant-input-group>.ant-input:last-child{border-radius:2px 0 0 2px}.ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:last-child){border-radius:0 2px 2px 0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:not(:last-child){border-left-width:1px;margin-left:-1px;margin-right:0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:first-child{border-radius:0 2px 2px 0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:last-child{border-left-width:1px;border-radius:2px 0 0 2px}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper-rtl+.ant-input-group-wrapper-rtl{margin-left:0;margin-right:-1px}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper-rtl:not(:last-child).ant-input-search>.ant-input-group>.ant-input{border-radius:0 2px 2px 0}.ant-input-group-wrapper{display:inline-block;text-align:start;vertical-align:top;width:100%}.ant-input-password-icon.anticon{color:rgba(0,0,0,.45);cursor:pointer;transition:all .3s}.ant-input-password-icon.anticon:hover{color:rgba(0,0,0,.85)}.ant-input[type=color]{height:32px}.ant-input[type=color].ant-input-lg{height:40px}.ant-input[type=color].ant-input-sm{height:24px;padding-bottom:3px;padding-top:3px}.ant-input-textarea-show-count>.ant-input{height:100%}.ant-input-textarea-show-count:after{color:rgba(0,0,0,.45);content:attr(data-count);float:right;pointer-events:none;white-space:nowrap}.ant-input-textarea-show-count.ant-input-textarea-in-form-item:after{margin-bottom:-22px}.ant-input-textarea-suffix{align-items:center;bottom:0;display:inline-flex;margin:auto;position:absolute;right:11px;top:0;z-index:1}.ant-input-search .ant-input:focus,.ant-input-search .ant-input:hover{border-color:#40a9ff}.ant-input-search .ant-input:focus+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary),.ant-input-search .ant-input:hover+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary){border-left-color:#40a9ff}.ant-input-search .ant-input-affix-wrapper{border-radius:0}.ant-input-search .ant-input-lg{line-height:1.5713}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child{border:0;left:-1px;padding:0}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child .ant-input-search-button{border-radius:0 2px 2px 0;padding-bottom:0;padding-top:0}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child .ant-input-search-button:not(.ant-btn-primary){color:rgba(0,0,0,.45)}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child .ant-input-search-button:not(.ant-btn-primary).ant-btn-loading:before{bottom:0;left:0;right:0;top:0}.ant-input-search-button{height:32px}.ant-input-search-button:focus,.ant-input-search-button:hover{z-index:1}.ant-input-search-large .ant-input-search-button{height:40px}.ant-input-search-small .ant-input-search-button{height:24px}.ant-input-group-rtl,.ant-input-group-wrapper-rtl{direction:rtl}.ant-input-affix-wrapper.ant-input-affix-wrapper-rtl>input.ant-input{border:none;outline:none}.ant-input-affix-wrapper-rtl .ant-input-prefix{margin:0 0 0 4px}.ant-input-affix-wrapper-rtl .ant-input-suffix{margin:0 4px 0 0}.ant-input-textarea-rtl{direction:rtl}.ant-input-textarea-rtl.ant-input-textarea-show-count:after{text-align:left}.ant-input-affix-wrapper-rtl .ant-input-clear-icon-has-suffix{margin-left:4px;margin-right:0}.ant-input-affix-wrapper-rtl .ant-input-clear-icon{left:8px;right:auto}.ant-input-search-rtl{direction:rtl}.ant-input-search-rtl .ant-input:focus+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary),.ant-input-search-rtl .ant-input:hover+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary){border-left-color:#d9d9d9;border-right-color:#40a9ff}.ant-input-search-rtl>.ant-input-group>.ant-input-affix-wrapper-focused,.ant-input-search-rtl>.ant-input-group>.ant-input-affix-wrapper:hover{border-right-color:#40a9ff}.ant-input-search-rtl>.ant-input-group>.ant-input-group-addon{left:auto;right:-1px}.ant-input-search-rtl>.ant-input-group>.ant-input-group-addon .ant-input-search-button{border-radius:2px 0 0 2px}@media(-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ant-input{height:32px}.ant-input-lg{height:40px}.ant-input-sm{height:24px}.ant-input-affix-wrapper>input.ant-input{height:auto}}.ant-layout{background:#f0f2f5;display:flex;flex:auto;flex-direction:column;min-height:0}.ant-layout,.ant-layout *{box-sizing:border-box}.ant-layout.ant-layout-has-sider{flex-direction:row}.ant-layout.ant-layout-has-sider>.ant-layout,.ant-layout.ant-layout-has-sider>.ant-layout-content{width:0}.ant-layout-footer,.ant-layout-header{flex:0 0 auto}.ant-layout-header{background:#001529;color:rgba(0,0,0,.85);height:64px;line-height:64px;padding:0 50px}.ant-layout-footer{background:#f0f2f5;color:rgba(0,0,0,.85);font-size:14px;padding:24px 50px}.ant-layout-content{flex:auto;min-height:0}.ant-layout-sider{background:#001529;min-width:0;position:relative;transition:all .2s}.ant-layout-sider-children{height:100%;margin-top:-.1px;padding-top:.1px}.ant-layout-sider-children .ant-menu.ant-menu-inline-collapsed{width:auto}.ant-layout-sider-has-trigger{padding-bottom:48px}.ant-layout-sider-right{order:1}.ant-layout-sider-trigger{background:#002140;bottom:0;color:#fff;cursor:pointer;height:48px;line-height:48px;position:fixed;text-align:center;transition:all .2s;z-index:1}.ant-layout-sider-zero-width>*{overflow:hidden}.ant-layout-sider-zero-width-trigger{background:#001529;border-radius:0 2px 2px 0;color:#fff;cursor:pointer;font-size:18px;height:42px;line-height:42px;position:absolute;right:-36px;text-align:center;top:64px;transition:background .3s ease;width:36px;z-index:1}.ant-layout-sider-zero-width-trigger:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0;transition:all .3s}.ant-layout-sider-zero-width-trigger:hover:after{background:hsla(0,0%,100%,.1)}.ant-layout-sider-zero-width-trigger-right{border-radius:2px 0 0 2px;left:-36px}.ant-layout-sider-light{background:#fff}.ant-layout-sider-light .ant-layout-sider-trigger,.ant-layout-sider-light .ant-layout-sider-zero-width-trigger{background:#fff;color:rgba(0,0,0,.85)}.ant-layout-rtl{direction:rtl}.ant-list{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-list *{outline:none}.ant-list-pagination{margin-top:24px;text-align:right}.ant-list-pagination .ant-pagination-options{text-align:left}.ant-list-more{margin-top:12px;text-align:center}.ant-list-more button{padding-left:32px;padding-right:32px}.ant-list-spin{min-height:40px;text-align:center}.ant-list-empty-text{color:rgba(0,0,0,.25);font-size:14px;padding:16px;text-align:center}.ant-list-items{list-style:none;margin:0;padding:0}.ant-list-item{align-items:center;color:rgba(0,0,0,.85);display:flex;justify-content:space-between;padding:12px 0}.ant-list-item-meta{align-items:flex-start;display:flex;flex:1;max-width:100%}.ant-list-item-meta-avatar{margin-right:16px}.ant-list-item-meta-content{color:rgba(0,0,0,.85);flex:1 0;width:0}.ant-list-item-meta-title{color:rgba(0,0,0,.85);font-size:14px;line-height:1.5715;margin-bottom:4px}.ant-list-item-meta-title>a{color:rgba(0,0,0,.85);transition:all .3s}.ant-list-item-meta-title>a:hover{color:#1890ff}.ant-list-item-meta-description{color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715}.ant-list-item-action{flex:0 0 auto;font-size:0;list-style:none;margin-left:48px;padding:0}.ant-list-item-action>li{color:rgba(0,0,0,.45);display:inline-block;font-size:14px;line-height:1.5715;padding:0 8px;position:relative;text-align:center}.ant-list-item-action>li:first-child{padding-left:0}.ant-list-item-action-split{background-color:#f0f0f0;height:14px;margin-top:-7px;position:absolute;right:0;top:50%;width:1px}.ant-list-footer,.ant-list-header{background:transparent;padding-bottom:12px;padding-top:12px}.ant-list-empty{color:rgba(0,0,0,.45);font-size:12px;padding:16px 0;text-align:center}.ant-list-split .ant-list-item{border-bottom:1px solid #f0f0f0}.ant-list-split .ant-list-item:last-child{border-bottom:none}.ant-list-split .ant-list-header{border-bottom:1px solid #f0f0f0}.ant-list-split.ant-list-empty .ant-list-footer{border-top:1px solid #f0f0f0}.ant-list-loading .ant-list-spin-nested-loading{min-height:32px}.ant-list-split.ant-list-something-after-last-item .ant-spin-container>.ant-list-items>.ant-list-item:last-child{border-bottom:1px solid #f0f0f0}.ant-list-lg .ant-list-item{padding:16px 24px}.ant-list-sm .ant-list-item{padding:8px 16px}.ant-list-vertical .ant-list-item{align-items:normal}.ant-list-vertical .ant-list-item-main{display:block;flex:1}.ant-list-vertical .ant-list-item-extra{margin-left:40px}.ant-list-vertical .ant-list-item-meta{margin-bottom:16px}.ant-list-vertical .ant-list-item-meta-title{color:rgba(0,0,0,.85);font-size:16px;line-height:24px;margin-bottom:12px}.ant-list-vertical .ant-list-item-action{margin-left:auto;margin-top:16px}.ant-list-vertical .ant-list-item-action>li{padding:0 16px}.ant-list-vertical .ant-list-item-action>li:first-child{padding-left:0}.ant-list-grid .ant-col>.ant-list-item{border-bottom:none;display:block;margin-bottom:16px;max-width:100%;padding-bottom:0;padding-top:0}.ant-list-item-no-flex{display:block}.ant-list:not(.ant-list-vertical) .ant-list-item-no-flex .ant-list-item-action{float:right}.ant-list-bordered{border:1px solid #d9d9d9;border-radius:2px}.ant-list-bordered .ant-list-footer,.ant-list-bordered .ant-list-header,.ant-list-bordered .ant-list-item{padding-left:24px;padding-right:24px}.ant-list-bordered .ant-list-pagination{margin:16px 24px}.ant-list-bordered.ant-list-sm .ant-list-footer,.ant-list-bordered.ant-list-sm .ant-list-header,.ant-list-bordered.ant-list-sm .ant-list-item{padding:8px 16px}.ant-list-bordered.ant-list-lg .ant-list-footer,.ant-list-bordered.ant-list-lg .ant-list-header,.ant-list-bordered.ant-list-lg .ant-list-item{padding:16px 24px}@media screen and (max-width:768px){.ant-list-item-action,.ant-list-vertical .ant-list-item-extra{margin-left:24px}}@media screen and (max-width:576px){.ant-list-item{flex-wrap:wrap}.ant-list-item-action{margin-left:12px}.ant-list-vertical .ant-list-item{flex-wrap:wrap-reverse}.ant-list-vertical .ant-list-item-main{min-width:220px}.ant-list-vertical .ant-list-item-extra{margin:auto auto 16px}}.ant-list-rtl{direction:rtl;text-align:right}.ant-list-rtl .ReactVirtualized__List .ant-list-item{direction:rtl}.ant-list-rtl .ant-list-pagination{text-align:left}.ant-list-rtl .ant-list-item-meta-avatar{margin-left:16px;margin-right:0}.ant-list-rtl .ant-list-item-action{margin-left:0;margin-right:48px}.ant-list.ant-list-rtl .ant-list-item-action>li:first-child{padding-left:16px;padding-right:0}.ant-list-rtl .ant-list-item-action-split{left:0;right:auto}.ant-list-rtl.ant-list-vertical .ant-list-item-extra{margin-left:0;margin-right:40px}.ant-list-rtl.ant-list-vertical .ant-list-item-action{margin-right:auto}.ant-list-rtl .ant-list-vertical .ant-list-item-action>li:first-child{padding-left:16px;padding-right:0}.ant-list-rtl .ant-list:not(.ant-list-vertical) .ant-list-item-no-flex .ant-list-item-action{float:left}@media screen and (max-width:768px){.ant-list-rtl .ant-list-item-action,.ant-list-rtl .ant-list-vertical .ant-list-item-extra{margin-left:0;margin-right:24px}}@media screen and (max-width:576px){.ant-list-rtl .ant-list-item-action{margin-left:0;margin-right:22px}.ant-list-rtl.ant-list-vertical .ant-list-item-extra{margin:auto auto 16px}}.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions,.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:hover{background:#fff;border-color:#ff4d4f}.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions-focused,.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-mentions-status-error .ant-input-prefix{color:#ff4d4f}.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions,.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:hover{background:#fff;border-color:#faad14}.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions-focused,.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-mentions-status-warning .ant-input-prefix{color:#faad14}.ant-mentions{font-feature-settings:"tnum";background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;height:auto;line-height:1.5715;list-style:none;margin:0;min-width:0;overflow:hidden;padding:0;position:relative;transition:all .3s;vertical-align:bottom;white-space:pre-wrap;width:100%}.ant-mentions::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-mentions:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-mentions::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-mentions:-moz-placeholder-shown{text-overflow:ellipsis}.ant-mentions:-ms-input-placeholder{text-overflow:ellipsis}.ant-mentions:placeholder-shown{text-overflow:ellipsis}.ant-mentions-focused,.ant-mentions:focus,.ant-mentions:hover{border-color:#40a9ff;border-right-width:1px}.ant-mentions-focused,.ant-mentions:focus{box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-mentions-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-mentions-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-mentions[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-mentions[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-mentions-borderless,.ant-mentions-borderless-disabled,.ant-mentions-borderless-focused,.ant-mentions-borderless:focus,.ant-mentions-borderless:hover,.ant-mentions-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-mentions{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-mentions-lg{font-size:16px;padding:6.5px 11px}.ant-mentions-sm{padding:0 7px}.ant-mentions-disabled>textarea{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-mentions-disabled>textarea:hover{border-color:#d9d9d9;border-right-width:1px}.ant-mentions-focused{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-mentions-measure,.ant-mentions>textarea{word-wrap:break-word;direction:inherit;font-family:inherit;font-size:inherit;font-size-adjust:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;min-height:30px;overflow:inherit;overflow-x:hidden;overflow-y:auto;padding:4px 11px;-moz-tab-size:inherit;-o-tab-size:inherit;tab-size:inherit;text-align:inherit;vertical-align:top;white-space:inherit;word-break:inherit}.ant-mentions>textarea{border:none;outline:none;resize:none;width:100%}.ant-mentions>textarea::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-mentions>textarea:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-mentions>textarea::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-mentions>textarea:-moz-placeholder-shown{text-overflow:ellipsis}.ant-mentions>textarea:-ms-input-placeholder{text-overflow:ellipsis}.ant-mentions>textarea:placeholder-shown{text-overflow:ellipsis}.ant-mentions-measure{bottom:0;color:transparent;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}.ant-mentions-measure>span{display:inline-block;min-height:1em}.ant-mentions-dropdown{font-feature-settings:"tnum";background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;font-variant:normal;left:-9999px;line-height:1.5715;list-style:none;margin:0;outline:none;padding:0;position:absolute;top:-9999px;z-index:1050}.ant-mentions-dropdown-hidden{display:none}.ant-mentions-dropdown-menu{list-style:none;margin-bottom:0;max-height:250px;outline:none;overflow:auto;padding-left:0}.ant-mentions-dropdown-menu-item{color:rgba(0,0,0,.85);cursor:pointer;display:block;font-weight:400;line-height:1.5715;min-width:100px;overflow:hidden;padding:5px 12px;position:relative;text-overflow:ellipsis;transition:background .3s ease;white-space:nowrap}.ant-mentions-dropdown-menu-item:hover{background-color:#f5f5f5}.ant-mentions-dropdown-menu-item:first-child{border-radius:2px 2px 0 0}.ant-mentions-dropdown-menu-item:last-child{border-radius:0 0 2px 2px}.ant-mentions-dropdown-menu-item-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-mentions-dropdown-menu-item-disabled:hover{background-color:#fff;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-mentions-dropdown-menu-item-selected{background-color:#fafafa;color:rgba(0,0,0,.85);font-weight:600}.ant-mentions-dropdown-menu-item-active{background-color:#f5f5f5}.ant-mentions-suffix{align-items:center;bottom:0;display:inline-flex;margin:auto;position:absolute;right:11px;top:0;z-index:1}.ant-mentions-rtl{direction:rtl}.ant-menu-item-danger.ant-menu-item,.ant-menu-item-danger.ant-menu-item-active,.ant-menu-item-danger.ant-menu-item:hover{color:#ff4d4f}.ant-menu-item-danger.ant-menu-item:active{background:#fff1f0}.ant-menu-item-danger.ant-menu-item-selected,.ant-menu-item-danger.ant-menu-item-selected>a,.ant-menu-item-danger.ant-menu-item-selected>a:hover{color:#ff4d4f}.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected{background-color:#fff1f0}.ant-menu-inline .ant-menu-item-danger.ant-menu-item:after{border-right-color:#ff4d4f}.ant-menu-dark .ant-menu-item-danger.ant-menu-item,.ant-menu-dark .ant-menu-item-danger.ant-menu-item:hover,.ant-menu-dark .ant-menu-item-danger.ant-menu-item>a{color:#ff4d4f}.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected{background-color:#ff4d4f;color:#fff}.ant-menu{font-feature-settings:"tnum";background:#fff;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:0;list-style:none;margin:0;outline:none;padding:0;text-align:left;transition:background .3s,width .3s cubic-bezier(.2,0,0,1) 0s}.ant-menu:after,.ant-menu:before{content:"";display:table}.ant-menu:after{clear:both}.ant-menu.ant-menu-root:focus-visible{box-shadow:0 0 0 2px #bae7ff}.ant-menu ol,.ant-menu ul{list-style:none;margin:0;padding:0}.ant-menu-overflow{display:flex}.ant-menu-overflow-item{flex:none}.ant-menu-hidden,.ant-menu-submenu-hidden{display:none}.ant-menu-item-group-title{color:rgba(0,0,0,.45);font-size:14px;height:1.5715;line-height:1.5715;padding:8px 16px;transition:all .3s}.ant-menu-horizontal .ant-menu-submenu{transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu,.ant-menu-submenu-inline{transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-selected{color:#1890ff}.ant-menu-item:active,.ant-menu-submenu-title:active{background:#e6f7ff}.ant-menu-submenu .ant-menu-sub{cursor:auto;transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-title-content{transition:color .3s}.ant-menu-item a{color:rgba(0,0,0,.85)}.ant-menu-item a:hover{color:#1890ff}.ant-menu-item a:before{background-color:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-menu-item>.ant-badge a{color:rgba(0,0,0,.85)}.ant-menu-item>.ant-badge a:hover{color:#1890ff}.ant-menu-item-divider{border:solid #f0f0f0;border-width:1px 0 0;line-height:0;overflow:hidden}.ant-menu-item-divider-dashed{border-style:dashed}.ant-menu-horizontal .ant-menu-item,.ant-menu-horizontal .ant-menu-submenu{margin-top:-1px}.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu .ant-menu-submenu-title:hover{background-color:transparent}.ant-menu-item-selected,.ant-menu-item-selected a,.ant-menu-item-selected a:hover{color:#1890ff}.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#e6f7ff}.ant-menu-inline,.ant-menu-vertical,.ant-menu-vertical-left{border-right:1px solid #f0f0f0}.ant-menu-vertical-right{border-left:1px solid #f0f0f0}.ant-menu-vertical-left.ant-menu-sub,.ant-menu-vertical-right.ant-menu-sub,.ant-menu-vertical.ant-menu-sub{border-right:0;max-height:calc(100vh - 100px);min-width:160px;overflow:hidden;padding:0}.ant-menu-vertical-left.ant-menu-sub:not([class*=-active]),.ant-menu-vertical-right.ant-menu-sub:not([class*=-active]),.ant-menu-vertical.ant-menu-sub:not([class*=-active]){overflow-x:hidden;overflow-y:auto}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item,.ant-menu-vertical.ant-menu-sub .ant-menu-item{border-right:0;left:0;margin-left:0}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical.ant-menu-sub .ant-menu-item:after{border-right:0}.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{transform-origin:0 0}.ant-menu-horizontal.ant-menu-sub{min-width:114px}.ant-menu-horizontal .ant-menu-item,.ant-menu-horizontal .ant-menu-submenu-title{transition:border-color .3s,background .3s}.ant-menu-item,.ant-menu-submenu-title{cursor:pointer;display:block;margin:0;padding:0 20px;position:relative;transition:border-color .3s,background .3s,padding .3s cubic-bezier(.645,.045,.355,1);white-space:nowrap}.ant-menu-item .ant-menu-item-icon,.ant-menu-item .anticon,.ant-menu-submenu-title .ant-menu-item-icon,.ant-menu-submenu-title .anticon{font-size:14px;min-width:14px;transition:font-size .15s cubic-bezier(.215,.61,.355,1),margin .3s cubic-bezier(.645,.045,.355,1),color .3s}.ant-menu-item .ant-menu-item-icon+span,.ant-menu-item .anticon+span,.ant-menu-submenu-title .ant-menu-item-icon+span,.ant-menu-submenu-title .anticon+span{margin-left:10px;opacity:1;transition:opacity .3s cubic-bezier(.645,.045,.355,1),margin .3s,color .3s}.ant-menu-item .ant-menu-item-icon.svg,.ant-menu-submenu-title .ant-menu-item-icon.svg{vertical-align:-.125em}.ant-menu-item.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-item.ant-menu-item-only-child>.anticon,.ant-menu-submenu-title.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-submenu-title.ant-menu-item-only-child>.anticon{margin-right:0}.ant-menu-item:focus-visible,.ant-menu-submenu-title:focus-visible{box-shadow:0 0 0 2px #bae7ff}.ant-menu>.ant-menu-item-divider{margin:1px 0;padding:0}.ant-menu-submenu-popup{background:transparent;border-radius:2px;box-shadow:none;position:absolute;transform-origin:0 0;z-index:1050}.ant-menu-submenu-popup:before{bottom:0;content:" ";height:100%;left:0;opacity:.0001;position:absolute;right:0;top:-7px;width:100%;z-index:-1}.ant-menu-submenu-placement-rightTop:before{left:-7px;top:0}.ant-menu-submenu>.ant-menu{background-color:#fff;border-radius:2px}.ant-menu-submenu>.ant-menu-submenu-title:after{transition:transform .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-popup>.ant-menu{background-color:#fff}.ant-menu-submenu-arrow,.ant-menu-submenu-expand-icon{color:rgba(0,0,0,.85);position:absolute;right:16px;top:50%;transform:translateY(-50%);transition:transform .3s cubic-bezier(.645,.045,.355,1);width:10px}.ant-menu-submenu-arrow:after,.ant-menu-submenu-arrow:before{background-color:currentcolor;border-radius:2px;content:"";height:1.5px;position:absolute;transition:background .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),color .3s cubic-bezier(.645,.045,.355,1);width:6px}.ant-menu-submenu-arrow:before{transform:rotate(45deg) translateY(-2.5px)}.ant-menu-submenu-arrow:after{transform:rotate(-45deg) translateY(2.5px)}.ant-menu-submenu:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-submenu:hover>.ant-menu-submenu-title>.ant-menu-submenu-expand-icon{color:#1890ff}.ant-menu-inline-collapsed .ant-menu-submenu-arrow:before,.ant-menu-submenu-inline .ant-menu-submenu-arrow:before{transform:rotate(-45deg) translateX(2.5px)}.ant-menu-inline-collapsed .ant-menu-submenu-arrow:after,.ant-menu-submenu-inline .ant-menu-submenu-arrow:after{transform:rotate(45deg) translateX(-2.5px)}.ant-menu-submenu-horizontal .ant-menu-submenu-arrow{display:none}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title>.ant-menu-submenu-arrow{transform:translateY(-2px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after{transform:rotate(-45deg) translateX(-2.5px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{transform:rotate(45deg) translateX(2.5px)}.ant-menu-vertical .ant-menu-submenu-selected,.ant-menu-vertical-left .ant-menu-submenu-selected,.ant-menu-vertical-right .ant-menu-submenu-selected{color:#1890ff}.ant-menu-horizontal{border:0;border-bottom:1px solid #f0f0f0;box-shadow:none;line-height:46px}.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu{margin-bottom:0;margin-top:-1px;padding:0 20px}.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-active,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-open,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-selected,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item:hover,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-active,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-open,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-selected,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu:hover{color:#1890ff}.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-active:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-open:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-selected:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item:hover:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-active:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-open:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-selected:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu:hover:after{border-bottom:2px solid #1890ff}.ant-menu-horizontal>.ant-menu-item,.ant-menu-horizontal>.ant-menu-submenu{display:inline-block;position:relative;top:1px;vertical-align:bottom}.ant-menu-horizontal>.ant-menu-item:after,.ant-menu-horizontal>.ant-menu-submenu:after{border-bottom:2px solid transparent;bottom:0;content:"";left:20px;position:absolute;right:20px;transition:border-color .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-horizontal>.ant-menu-submenu>.ant-menu-submenu-title{padding:0}.ant-menu-horizontal>.ant-menu-item a{color:rgba(0,0,0,.85)}.ant-menu-horizontal>.ant-menu-item a:hover{color:#1890ff}.ant-menu-horizontal>.ant-menu-item a:before{bottom:-2px}.ant-menu-horizontal>.ant-menu-item-selected a{color:#1890ff}.ant-menu-horizontal:after{clear:both;content:" ";display:block;height:0}.ant-menu-inline .ant-menu-item,.ant-menu-vertical .ant-menu-item,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-right .ant-menu-item{position:relative}.ant-menu-inline .ant-menu-item:after,.ant-menu-vertical .ant-menu-item:after,.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-vertical-right .ant-menu-item:after{border-right:3px solid #1890ff;bottom:0;content:"";opacity:0;position:absolute;right:0;top:0;transform:scaleY(.0001);transition:transform .15s cubic-bezier(.215,.61,.355,1),opacity .15s cubic-bezier(.215,.61,.355,1)}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title,.ant-menu-vertical .ant-menu-item,.ant-menu-vertical .ant-menu-submenu-title,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-left .ant-menu-submenu-title,.ant-menu-vertical-right .ant-menu-item,.ant-menu-vertical-right .ant-menu-submenu-title{height:40px;line-height:40px;margin-bottom:4px;margin-top:4px;overflow:hidden;padding:0 16px;text-overflow:ellipsis}.ant-menu-inline .ant-menu-submenu,.ant-menu-vertical .ant-menu-submenu,.ant-menu-vertical-left .ant-menu-submenu,.ant-menu-vertical-right .ant-menu-submenu{padding-bottom:.02px}.ant-menu-inline .ant-menu-item:not(:last-child),.ant-menu-vertical .ant-menu-item:not(:last-child),.ant-menu-vertical-left .ant-menu-item:not(:last-child),.ant-menu-vertical-right .ant-menu-item:not(:last-child){margin-bottom:8px}.ant-menu-inline>.ant-menu-item,.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-left>.ant-menu-item,.ant-menu-vertical-left>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-right>.ant-menu-item,.ant-menu-vertical-right>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical>.ant-menu-item,.ant-menu-vertical>.ant-menu-submenu>.ant-menu-submenu-title{height:40px;line-height:40px}.ant-menu-vertical .ant-menu-item-group-list .ant-menu-submenu-title,.ant-menu-vertical .ant-menu-submenu-title{padding-right:34px}.ant-menu-inline{width:100%}.ant-menu-inline .ant-menu-item-selected:after,.ant-menu-inline .ant-menu-selected:after{opacity:1;transform:scaleY(1);transition:transform .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title{width:calc(100% + 1px)}.ant-menu-inline .ant-menu-item-group-list .ant-menu-submenu-title,.ant-menu-inline .ant-menu-submenu-title{padding-right:34px}.ant-menu-inline.ant-menu-root .ant-menu-item,.ant-menu-inline.ant-menu-root .ant-menu-submenu-title{align-items:center;display:flex;transition:border-color .3s,background .3s,padding .1s cubic-bezier(.215,.61,.355,1)}.ant-menu-inline.ant-menu-root .ant-menu-item>.ant-menu-title-content,.ant-menu-inline.ant-menu-root .ant-menu-submenu-title>.ant-menu-title-content{flex:auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.ant-menu-inline.ant-menu-root .ant-menu-item>*,.ant-menu-inline.ant-menu-root .ant-menu-submenu-title>*{flex:none}.ant-menu.ant-menu-inline-collapsed{width:80px}.ant-menu.ant-menu-inline-collapsed>.ant-menu-item,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title{left:0;padding:0 calc(50% - 8px);text-overflow:clip}.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow{opacity:0}.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .anticon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon{font-size:16px;line-height:40px;margin:0}.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-item-icon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .anticon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-item-icon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span{display:inline-block;opacity:0}.ant-menu.ant-menu-inline-collapsed .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed .anticon{display:inline-block}.ant-menu.ant-menu-inline-collapsed-tooltip{pointer-events:none}.ant-menu.ant-menu-inline-collapsed-tooltip .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed-tooltip .anticon{display:none}.ant-menu.ant-menu-inline-collapsed-tooltip a{color:hsla(0,0%,100%,.85)}.ant-menu.ant-menu-inline-collapsed .ant-menu-item-group-title{overflow:hidden;padding-left:4px;padding-right:4px;text-overflow:ellipsis;white-space:nowrap}.ant-menu-item-group-list{margin:0;padding:0}.ant-menu-item-group-list .ant-menu-item,.ant-menu-item-group-list .ant-menu-submenu-title{padding:0 16px 0 28px}.ant-menu-root.ant-menu-inline,.ant-menu-root.ant-menu-vertical,.ant-menu-root.ant-menu-vertical-left,.ant-menu-root.ant-menu-vertical-right{box-shadow:none}.ant-menu-root.ant-menu-inline-collapsed .ant-menu-item>.ant-menu-inline-collapsed-noicon,.ant-menu-root.ant-menu-inline-collapsed .ant-menu-submenu .ant-menu-submenu-title>.ant-menu-inline-collapsed-noicon{font-size:16px;text-align:center}.ant-menu-sub.ant-menu-inline{background:#fafafa;border-radius:0;box-shadow:none;padding:0}.ant-menu-sub.ant-menu-inline>.ant-menu-item,.ant-menu-sub.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title{height:40px;line-height:40px;list-style-position:inside;list-style-type:disc}.ant-menu-sub.ant-menu-inline .ant-menu-item-group-title{padding-left:32px}.ant-menu-item-disabled,.ant-menu-submenu-disabled{background:none;color:rgba(0,0,0,.25)!important;cursor:not-allowed}.ant-menu-item-disabled:after,.ant-menu-submenu-disabled:after{border-color:transparent!important}.ant-menu-item-disabled a,.ant-menu-submenu-disabled a{color:rgba(0,0,0,.25)!important;pointer-events:none}.ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-submenu-disabled>.ant-menu-submenu-title{color:rgba(0,0,0,.25)!important;cursor:not-allowed}.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:rgba(0,0,0,.25)!important}.ant-layout-header .ant-menu{line-height:inherit}.ant-menu-inline-collapsed-tooltip a,.ant-menu-inline-collapsed-tooltip a:hover{color:#fff}.ant-menu-light .ant-menu-item-active,.ant-menu-light .ant-menu-item:hover,.ant-menu-light .ant-menu-submenu-active,.ant-menu-light .ant-menu-submenu-title:hover,.ant-menu-light .ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open{color:#1890ff}.ant-menu-dark .ant-menu-item:focus-visible,.ant-menu-dark .ant-menu-submenu-title:focus-visible,.ant-menu.ant-menu-root:focus-visible{box-shadow:0 0 0 2px #096dd9}.ant-menu-dark .ant-menu-sub,.ant-menu.ant-menu-dark,.ant-menu.ant-menu-dark .ant-menu-sub{background:#001529;color:hsla(0,0%,100%,.65)}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow{opacity:.45;transition:all .3s}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark.ant-menu-submenu-popup{background:transparent}.ant-menu-dark .ant-menu-inline.ant-menu-sub{background:#000c17}.ant-menu-dark.ant-menu-horizontal{border-bottom:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item,.ant-menu-dark.ant-menu-horizontal>.ant-menu-submenu{border-color:#001529;border-bottom:0;margin-top:0;padding:0 20px;top:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item:hover{background-color:#1890ff}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item>a:before{bottom:0}.ant-menu-dark .ant-menu-item,.ant-menu-dark .ant-menu-item-group-title,.ant-menu-dark .ant-menu-item>a,.ant-menu-dark .ant-menu-item>span>a{color:hsla(0,0%,100%,.65)}.ant-menu-dark.ant-menu-inline,.ant-menu-dark.ant-menu-vertical,.ant-menu-dark.ant-menu-vertical-left,.ant-menu-dark.ant-menu-vertical-right{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-vertical .ant-menu-item,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item{border-right:0;left:0;margin-left:0}.ant-menu-dark.ant-menu-inline .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item:after{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-inline .ant-menu-submenu-title{width:100%}.ant-menu-dark .ant-menu-item-active,.ant-menu-dark .ant-menu-item:hover,.ant-menu-dark .ant-menu-submenu-active,.ant-menu-dark .ant-menu-submenu-open,.ant-menu-dark .ant-menu-submenu-selected,.ant-menu-dark .ant-menu-submenu-title:hover{background-color:transparent;color:#fff}.ant-menu-dark .ant-menu-item-active>a,.ant-menu-dark .ant-menu-item-active>span>a,.ant-menu-dark .ant-menu-item:hover>a,.ant-menu-dark .ant-menu-item:hover>span>a,.ant-menu-dark .ant-menu-submenu-active>a,.ant-menu-dark .ant-menu-submenu-active>span>a,.ant-menu-dark .ant-menu-submenu-open>a,.ant-menu-dark .ant-menu-submenu-open>span>a,.ant-menu-dark .ant-menu-submenu-selected>a,.ant-menu-dark .ant-menu-submenu-selected>span>a,.ant-menu-dark .ant-menu-submenu-title:hover>a,.ant-menu-dark .ant-menu-submenu-title:hover>span>a{color:#fff}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow{opacity:1}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark .ant-menu-item:hover{background-color:transparent}.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#1890ff}.ant-menu-dark .ant-menu-item-selected{border-right:0;color:#fff}.ant-menu-dark .ant-menu-item-selected:after{border-right:0}.ant-menu-dark .ant-menu-item-selected .ant-menu-item-icon,.ant-menu-dark .ant-menu-item-selected .ant-menu-item-icon+span,.ant-menu-dark .ant-menu-item-selected .anticon,.ant-menu-dark .ant-menu-item-selected .anticon+span,.ant-menu-dark .ant-menu-item-selected>a,.ant-menu-dark .ant-menu-item-selected>a:hover,.ant-menu-dark .ant-menu-item-selected>span>a,.ant-menu-dark .ant-menu-item-selected>span>a:hover{color:#fff}.ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected,.ant-menu.ant-menu-dark .ant-menu-item-selected{background-color:#1890ff}.ant-menu-dark .ant-menu-item-disabled,.ant-menu-dark .ant-menu-item-disabled>a,.ant-menu-dark .ant-menu-item-disabled>span>a,.ant-menu-dark .ant-menu-submenu-disabled,.ant-menu-dark .ant-menu-submenu-disabled>a,.ant-menu-dark .ant-menu-submenu-disabled>span>a{color:hsla(0,0%,100%,.35)!important;opacity:.8}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title{color:hsla(0,0%,100%,.35)!important}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:hsla(0,0%,100%,.35)!important}.ant-menu.ant-menu-rtl{direction:rtl;text-align:right}.ant-menu-rtl .ant-menu-item-group-title{text-align:right}.ant-menu-rtl.ant-menu-inline,.ant-menu-rtl.ant-menu-vertical{border-left:1px solid #f0f0f0;border-right:none}.ant-menu-rtl.ant-menu-dark.ant-menu-inline,.ant-menu-rtl.ant-menu-dark.ant-menu-vertical{border-left:none}.ant-menu-rtl.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-rtl.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-rtl.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{transform-origin:top right}.ant-menu-rtl .ant-menu-item .ant-menu-item-icon,.ant-menu-rtl .ant-menu-item .anticon,.ant-menu-rtl .ant-menu-submenu-title .ant-menu-item-icon,.ant-menu-rtl .ant-menu-submenu-title .anticon{margin-left:10px;margin-right:auto}.ant-menu-rtl .ant-menu-item.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-rtl .ant-menu-item.ant-menu-item-only-child>.anticon,.ant-menu-rtl .ant-menu-submenu-title.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-rtl .ant-menu-submenu-title.ant-menu-item-only-child>.anticon{margin-left:0}.ant-menu-submenu-rtl.ant-menu-submenu-popup{transform-origin:100% 0}.ant-menu-rtl .ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow{left:16px;right:auto}.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{transform:rotate(-45deg) translateY(-2px)}.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{transform:rotate(45deg) translateY(2px)}.ant-menu-rtl.ant-menu-inline .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-item:after{left:0;right:auto}.ant-menu-rtl.ant-menu-inline .ant-menu-item,.ant-menu-rtl.ant-menu-inline .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical .ant-menu-item,.ant-menu-rtl.ant-menu-vertical .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-item,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-item,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-submenu-title{text-align:right}.ant-menu-rtl.ant-menu-inline .ant-menu-submenu-title{padding-left:34px;padding-right:0}.ant-menu-rtl.ant-menu-vertical .ant-menu-submenu-title{padding-left:34px;padding-right:16px}.ant-menu-rtl.ant-menu-inline-collapsed.ant-menu-vertical .ant-menu-submenu-title{padding:0 calc(50% - 8px)}.ant-menu-rtl .ant-menu-item-group-list .ant-menu-item,.ant-menu-rtl .ant-menu-item-group-list .ant-menu-submenu-title{padding:0 28px 0 16px}.ant-menu-sub.ant-menu-inline{border:0}.ant-menu-rtl.ant-menu-sub.ant-menu-inline .ant-menu-item-group-title{padding-left:0;padding-right:32px}.ant-message{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;left:0;line-height:1.5715;list-style:none;margin:0;padding:0;pointer-events:none;position:fixed;top:8px;width:100%;z-index:1010}.ant-message-notice{padding:8px;text-align:center}.ant-message-notice-content{background:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);display:inline-block;padding:10px 16px;pointer-events:all}.ant-message-success .anticon{color:#52c41a}.ant-message-error .anticon{color:#ff4d4f}.ant-message-warning .anticon{color:#faad14}.ant-message-info .anticon,.ant-message-loading .anticon{color:#1890ff}.ant-message .anticon{font-size:16px;margin-right:8px;position:relative;top:1px}.ant-message-notice.ant-move-up-leave.ant-move-up-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:MessageMoveOut;animation-name:MessageMoveOut}@-webkit-keyframes MessageMoveOut{0%{max-height:150px;opacity:1;padding:8px}to{max-height:0;opacity:0;padding:0}}@keyframes MessageMoveOut{0%{max-height:150px;opacity:1;padding:8px}to{max-height:0;opacity:0;padding:0}}.ant-message-rtl,.ant-message-rtl span{direction:rtl}.ant-message-rtl .anticon{margin-left:8px;margin-right:0}.ant-modal{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 auto;max-width:calc(100vw - 32px);padding:0 0 24px;pointer-events:none;position:relative;top:100px;width:auto}.ant-modal.ant-zoom-appear,.ant-modal.ant-zoom-enter{-webkit-animation-duration:.3s;animation-duration:.3s;opacity:0;transform:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-modal-mask{background-color:rgba(0,0,0,.45);bottom:0;height:100%;left:0;position:fixed;right:0;top:0;z-index:1000}.ant-modal-mask-hidden{display:none}.ant-modal-wrap{bottom:0;left:0;outline:0;overflow:auto;position:fixed;right:0;top:0;z-index:1000}.ant-modal-title{word-wrap:break-word;color:rgba(0,0,0,.85);font-size:16px;font-weight:500;line-height:22px;margin:0}.ant-modal-content{background-clip:padding-box;background-color:#fff;border:0;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);pointer-events:auto;position:relative}.ant-modal-close{background:transparent;border:0;color:rgba(0,0,0,.45);cursor:pointer;font-weight:700;line-height:1;outline:0;padding:0;position:absolute;right:0;text-decoration:none;top:0;transition:color .3s;z-index:10}.ant-modal-close-x{text-rendering:auto;display:block;font-size:16px;font-style:normal;height:54px;line-height:54px;text-align:center;text-transform:none;width:54px}.ant-modal-close:focus,.ant-modal-close:hover{color:rgba(0,0,0,.75);text-decoration:none}.ant-modal-header{background:#fff;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0;color:rgba(0,0,0,.85);padding:16px 24px}.ant-modal-body{word-wrap:break-word;font-size:14px;line-height:1.5715;padding:24px}.ant-modal-footer{background:transparent;border-radius:0 0 2px 2px;border-top:1px solid #f0f0f0;padding:10px 16px;text-align:right}.ant-modal-footer .ant-btn+.ant-btn:not(.ant-dropdown-trigger){margin-bottom:0;margin-left:8px}.ant-modal-open{overflow:hidden}.ant-modal-centered{text-align:center}.ant-modal-centered:before{content:"";display:inline-block;height:100%;vertical-align:middle;width:0}.ant-modal-centered .ant-modal{display:inline-block;padding-bottom:0;text-align:left;top:0;vertical-align:middle}@media(max-width:767px){.ant-modal{margin:8px auto;max-width:calc(100vw - 16px)}.ant-modal-centered .ant-modal{flex:1}}.ant-modal-confirm .ant-modal-header{display:none}.ant-modal-confirm .ant-modal-body{padding:32px 32px 24px}.ant-modal-confirm-body-wrapper:before{content:"";display:table}.ant-modal-confirm-body-wrapper:after{clear:both;content:"";display:table}.ant-modal-confirm-body .ant-modal-confirm-title{color:rgba(0,0,0,.85);display:block;font-size:16px;font-weight:500;line-height:1.4;overflow:hidden}.ant-modal-confirm-body .ant-modal-confirm-content{color:rgba(0,0,0,.85);font-size:14px;margin-top:8px}.ant-modal-confirm-body>.anticon{float:left;font-size:22px;margin-right:16px}.ant-modal-confirm-body>.anticon+.ant-modal-confirm-title+.ant-modal-confirm-content{margin-left:38px}.ant-modal-confirm .ant-modal-confirm-btns{margin-top:24px;text-align:right}.ant-modal-confirm .ant-modal-confirm-btns .ant-btn+.ant-btn{margin-bottom:0;margin-left:8px}.ant-modal-confirm-error .ant-modal-confirm-body>.anticon{color:#ff4d4f}.ant-modal-confirm-confirm .ant-modal-confirm-body>.anticon,.ant-modal-confirm-warning .ant-modal-confirm-body>.anticon{color:#faad14}.ant-modal-confirm-info .ant-modal-confirm-body>.anticon{color:#1890ff}.ant-modal-confirm-success .ant-modal-confirm-body>.anticon{color:#52c41a}.ant-modal-wrap-rtl{direction:rtl}.ant-modal-wrap-rtl .ant-modal-close{left:0;right:auto}.ant-modal-wrap-rtl .ant-modal-footer{text-align:left}.ant-modal-wrap-rtl .ant-modal-footer .ant-btn+.ant-btn{margin-left:0;margin-right:8px}.ant-modal-wrap-rtl .ant-modal-confirm-body{direction:rtl}.ant-modal-wrap-rtl .ant-modal-confirm-body>.anticon{float:right;margin-left:16px;margin-right:0}.ant-modal-wrap-rtl .ant-modal-confirm-body>.anticon+.ant-modal-confirm-title+.ant-modal-confirm-content{margin-left:0;margin-right:38px}.ant-modal-wrap-rtl .ant-modal-confirm-btns{text-align:left}.ant-modal-wrap-rtl .ant-modal-confirm-btns .ant-btn+.ant-btn{margin-left:0;margin-right:8px}.ant-modal-wrap-rtl.ant-modal-centered .ant-modal{text-align:right}.ant-notification{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 24px 0 0;padding:0;position:fixed;z-index:1010}.ant-notification-close-icon{cursor:pointer;font-size:14px}.ant-notification-hook-holder{position:relative}.ant-notification-notice{word-wrap:break-word;background:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);line-height:1.5715;margin-bottom:16px;margin-left:auto;max-width:calc(100vw - 48px);overflow:hidden;padding:16px 24px;position:relative;width:384px}.ant-notification-bottom .ant-notification-notice,.ant-notification-top .ant-notification-notice{margin-left:auto;margin-right:auto}.ant-notification-bottomLeft .ant-notification-notice,.ant-notification-topLeft .ant-notification-notice{margin-left:0;margin-right:auto}.ant-notification-notice-message{color:rgba(0,0,0,.85);font-size:16px;line-height:24px;margin-bottom:8px}.ant-notification-notice-message-single-line-auto-margin{background-color:transparent;display:block;max-width:4px;pointer-events:none;width:calc(264px - 100%)}.ant-notification-notice-message-single-line-auto-margin:before{content:"";display:block}.ant-notification-notice-description{font-size:14px}.ant-notification-notice-closable .ant-notification-notice-message{padding-right:24px}.ant-notification-notice-with-icon .ant-notification-notice-message{font-size:16px;margin-bottom:4px;margin-left:48px}.ant-notification-notice-with-icon .ant-notification-notice-description{font-size:14px;margin-left:48px}.ant-notification-notice-icon{font-size:24px;line-height:24px;margin-left:4px;position:absolute}.anticon.ant-notification-notice-icon-success{color:#52c41a}.anticon.ant-notification-notice-icon-info{color:#1890ff}.anticon.ant-notification-notice-icon-warning{color:#faad14}.anticon.ant-notification-notice-icon-error{color:#ff4d4f}.ant-notification-notice-close{color:rgba(0,0,0,.45);outline:none;position:absolute;right:22px;top:16px}.ant-notification-notice-close:hover{color:rgba(0,0,0,.67)}.ant-notification-notice-btn{float:right;margin-top:16px}.ant-notification .notification-fade-effect{-webkit-animation-duration:.24s;animation-duration:.24s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-timing-function:cubic-bezier(.645,.045,.355,1)}.ant-notification-fade-appear,.ant-notification-fade-enter{-webkit-animation-play-state:paused;animation-play-state:paused;opacity:0}.ant-notification-fade-appear,.ant-notification-fade-enter,.ant-notification-fade-leave{-webkit-animation-duration:.24s;animation-duration:.24s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-timing-function:cubic-bezier(.645,.045,.355,1)}.ant-notification-fade-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationFadeIn;animation-name:NotificationFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-notification-fade-leave.ant-notification-fade-leave-active{-webkit-animation-name:NotificationFadeOut;animation-name:NotificationFadeOut;-webkit-animation-play-state:running;animation-play-state:running}@-webkit-keyframes NotificationFadeIn{0%{left:384px;opacity:0}to{left:0;opacity:1}}@keyframes NotificationFadeIn{0%{left:384px;opacity:0}to{left:0;opacity:1}}@-webkit-keyframes NotificationFadeOut{0%{margin-bottom:16px;max-height:150px;opacity:1}to{margin-bottom:0;max-height:0;opacity:0;padding-bottom:0;padding-top:0}}@keyframes NotificationFadeOut{0%{margin-bottom:16px;max-height:150px;opacity:1}to{margin-bottom:0;max-height:0;opacity:0;padding-bottom:0;padding-top:0}}.ant-notification-rtl{direction:rtl}.ant-notification-rtl .ant-notification-notice-closable .ant-notification-notice-message{padding-left:24px;padding-right:0}.ant-notification-rtl .ant-notification-notice-with-icon .ant-notification-notice-description,.ant-notification-rtl .ant-notification-notice-with-icon .ant-notification-notice-message{margin-left:0;margin-right:48px}.ant-notification-rtl .ant-notification-notice-icon{margin-left:0;margin-right:4px}.ant-notification-rtl .ant-notification-notice-close{left:22px;right:auto}.ant-notification-rtl .ant-notification-notice-btn{float:left}.ant-notification-bottom,.ant-notification-top{margin-left:0;margin-right:0}.ant-notification-top .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-top .ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationTopFadeIn;animation-name:NotificationTopFadeIn}.ant-notification-bottom .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-bottom .ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationBottomFadeIn;animation-name:NotificationBottomFadeIn}.ant-notification-bottomLeft,.ant-notification-topLeft{margin-left:24px;margin-right:0}.ant-notification-bottomLeft .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-bottomLeft .ant-notification-fade-enter.ant-notification-fade-enter-active,.ant-notification-topLeft .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-topLeft .ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationLeftFadeIn;animation-name:NotificationLeftFadeIn}@-webkit-keyframes NotificationTopFadeIn{0%{margin-top:-100%;opacity:0}to{margin-top:0;opacity:1}}@keyframes NotificationTopFadeIn{0%{margin-top:-100%;opacity:0}to{margin-top:0;opacity:1}}@-webkit-keyframes NotificationBottomFadeIn{0%{margin-bottom:-100%;opacity:0}to{margin-bottom:0;opacity:1}}@keyframes NotificationBottomFadeIn{0%{margin-bottom:-100%;opacity:0}to{margin-bottom:0;opacity:1}}@-webkit-keyframes NotificationLeftFadeIn{0%{opacity:0;right:384px}to{opacity:1;right:0}}@keyframes NotificationLeftFadeIn{0%{opacity:0;right:384px}to{opacity:1;right:0}}.ant-page-header{font-feature-settings:"tnum";background-color:#fff;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:16px 24px;position:relative}.ant-page-header-ghost{background-color:inherit}.ant-page-header.has-breadcrumb{padding-top:12px}.ant-page-header.has-footer{padding-bottom:0}.ant-page-header-back{font-size:16px;line-height:1;margin-right:16px}.ant-page-header-back-button{color:#1890ff;color:#000;cursor:pointer;outline:none;text-decoration:none;transition:color .3s}.ant-page-header-back-button:focus,.ant-page-header-back-button:hover{color:#40a9ff}.ant-page-header-back-button:active{color:#096dd9}.ant-page-header .ant-divider-vertical{height:14px;margin:0 12px;vertical-align:middle}.ant-breadcrumb+.ant-page-header-heading{margin-top:8px}.ant-page-header-heading{display:flex;justify-content:space-between}.ant-page-header-heading-left{align-items:center;display:flex;margin:4px 0;overflow:hidden}.ant-page-header-heading-title{color:rgba(0,0,0,.85);font-size:20px;font-weight:600;line-height:32px;margin-bottom:0;margin-right:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-page-header-heading .ant-avatar{margin-right:12px}.ant-page-header-heading-sub-title{color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715;margin-right:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-page-header-heading-extra{margin:4px 0;white-space:nowrap}.ant-page-header-heading-extra>*{white-space:unset}.ant-page-header-content{padding-top:12px}.ant-page-header-footer{margin-top:16px}.ant-page-header-footer .ant-tabs>.ant-tabs-nav{margin:0}.ant-page-header-footer .ant-tabs>.ant-tabs-nav:before{border:none}.ant-page-header-footer .ant-tabs .ant-tabs-tab{font-size:16px;padding-bottom:8px;padding-top:8px}.ant-page-header-compact .ant-page-header-heading{flex-wrap:wrap}.ant-page-header-rtl{direction:rtl}.ant-page-header-rtl .ant-page-header-back{float:right;margin-left:16px;margin-right:0}.ant-page-header-rtl .ant-page-header-heading .ant-avatar,.ant-page-header-rtl .ant-page-header-heading-title{margin-left:12px;margin-right:0}.ant-page-header-rtl .ant-page-header-heading-sub-title{float:right;margin-left:12px;margin-right:0}.ant-page-header-rtl .ant-page-header-heading-tags{float:right}.ant-page-header-rtl .ant-page-header-heading-extra{float:left}.ant-page-header-rtl .ant-page-header-heading-extra>*{margin-left:0;margin-right:12px}.ant-page-header-rtl .ant-page-header-heading-extra>:first-child{margin-right:0}.ant-page-header-rtl .ant-page-header-footer .ant-tabs-bar .ant-tabs-nav{float:right}.ant-pagination{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715}.ant-pagination,.ant-pagination ol,.ant-pagination ul{list-style:none;margin:0;padding:0}.ant-pagination:after{clear:both;content:" ";display:block;height:0;overflow:hidden;visibility:hidden}.ant-pagination-item,.ant-pagination-total-text{display:inline-block;height:32px;line-height:30px;margin-right:8px;vertical-align:middle}.ant-pagination-item{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;list-style:none;min-width:32px;outline:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-item a{color:rgba(0,0,0,.85);display:block;padding:0 6px;transition:none}.ant-pagination-item a:hover{text-decoration:none}.ant-pagination-item:hover{border-color:#1890ff;transition:all .3s}.ant-pagination-item:hover a{color:#1890ff}.ant-pagination-item:focus-visible{border-color:#1890ff;transition:all .3s}.ant-pagination-item:focus-visible a{color:#1890ff}.ant-pagination-item-active{background:#fff;border-color:#1890ff;font-weight:500}.ant-pagination-item-active a{color:#1890ff}.ant-pagination-item-active:focus-visible,.ant-pagination-item-active:hover{border-color:#40a9ff}.ant-pagination-item-active:focus-visible a,.ant-pagination-item-active:hover a{color:#40a9ff}.ant-pagination-jump-next,.ant-pagination-jump-prev{outline:0}.ant-pagination-jump-next .ant-pagination-item-container,.ant-pagination-jump-prev .ant-pagination-item-container{position:relative}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon{color:#1890ff;font-size:12px;letter-spacing:-1px;opacity:0;transition:all .2s}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon-svg,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon-svg{bottom:0;left:0;margin:auto;right:0;top:0}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-ellipsis,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-ellipsis{bottom:0;color:rgba(0,0,0,.25);display:block;font-family:Arial,Helvetica,sans-serif;left:0;letter-spacing:2px;margin:auto;opacity:1;position:absolute;right:0;text-align:center;text-indent:.13em;top:0;transition:all .2s}.ant-pagination-jump-next:hover .ant-pagination-item-link-icon,.ant-pagination-jump-prev:hover .ant-pagination-item-link-icon{opacity:1}.ant-pagination-jump-next:hover .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:hover .ant-pagination-item-ellipsis{opacity:0}.ant-pagination-jump-next:focus-visible .ant-pagination-item-link-icon,.ant-pagination-jump-prev:focus-visible .ant-pagination-item-link-icon{opacity:1}.ant-pagination-jump-next:focus-visible .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:focus-visible .ant-pagination-item-ellipsis{opacity:0}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-prev{margin-right:8px}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-next,.ant-pagination-prev{border-radius:2px;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;height:32px;line-height:32px;list-style:none;min-width:32px;text-align:center;transition:all .3s;vertical-align:middle}.ant-pagination-next,.ant-pagination-prev{font-family:Arial,Helvetica,sans-serif;outline:0}.ant-pagination-next button,.ant-pagination-prev button{color:rgba(0,0,0,.85);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-next:hover button,.ant-pagination-prev:hover button{border-color:#40a9ff}.ant-pagination-next .ant-pagination-item-link,.ant-pagination-prev .ant-pagination-item-link{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;display:block;font-size:12px;height:100%;outline:none;padding:0;text-align:center;transition:all .3s;width:100%}.ant-pagination-next:focus-visible .ant-pagination-item-link,.ant-pagination-next:hover .ant-pagination-item-link,.ant-pagination-prev:focus-visible .ant-pagination-item-link,.ant-pagination-prev:hover .ant-pagination-item-link{border-color:#1890ff;color:#1890ff}.ant-pagination-disabled,.ant-pagination-disabled:hover{cursor:not-allowed}.ant-pagination-disabled .ant-pagination-item-link,.ant-pagination-disabled:hover .ant-pagination-item-link{border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination-disabled:focus-visible{cursor:not-allowed}.ant-pagination-disabled:focus-visible .ant-pagination-item-link{border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination-slash{margin:0 10px 0 5px}.ant-pagination-options{display:inline-block;margin-left:16px;vertical-align:middle}@media(-ms-high-contrast:none){.ant-pagination-options,.ant-pagination-options ::-ms-backdrop{vertical-align:top}}.ant-pagination-options-size-changer.ant-select{display:inline-block;width:auto}.ant-pagination-options-quick-jumper{display:inline-block;height:32px;line-height:32px;margin-left:8px;vertical-align:top}.ant-pagination-options-quick-jumper input{background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;height:32px;line-height:1.5715;margin:0 8px;min-width:0;padding:4px 11px;position:relative;transition:all .3s;width:100%;width:50px}.ant-pagination-options-quick-jumper input::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-pagination-options-quick-jumper input:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-pagination-options-quick-jumper input::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-options-quick-jumper input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:-ms-input-placeholder{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:placeholder-shown{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:hover{border-color:#40a9ff;border-right-width:1px}.ant-pagination-options-quick-jumper input-focused,.ant-pagination-options-quick-jumper input:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-pagination-options-quick-jumper input-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-pagination-options-quick-jumper input-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-pagination-options-quick-jumper input[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-pagination-options-quick-jumper input[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-pagination-options-quick-jumper input-borderless,.ant-pagination-options-quick-jumper input-borderless-disabled,.ant-pagination-options-quick-jumper input-borderless-focused,.ant-pagination-options-quick-jumper input-borderless:focus,.ant-pagination-options-quick-jumper input-borderless:hover,.ant-pagination-options-quick-jumper input-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-pagination-options-quick-jumper input{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-pagination-options-quick-jumper input-lg{font-size:16px;padding:6.5px 11px}.ant-pagination-options-quick-jumper input-sm{padding:0 7px}.ant-pagination-simple .ant-pagination-next,.ant-pagination-simple .ant-pagination-prev{height:24px;line-height:24px;vertical-align:top}.ant-pagination-simple .ant-pagination-next .ant-pagination-item-link,.ant-pagination-simple .ant-pagination-prev .ant-pagination-item-link{background-color:transparent;border:0;height:24px}.ant-pagination-simple .ant-pagination-next .ant-pagination-item-link:after,.ant-pagination-simple .ant-pagination-prev .ant-pagination-item-link:after{height:24px;line-height:24px}.ant-pagination-simple .ant-pagination-simple-pager{display:inline-block;height:24px;margin-right:8px}.ant-pagination-simple .ant-pagination-simple-pager input{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;height:100%;margin-right:8px;outline:none;padding:0 6px;text-align:center;transition:border-color .3s}.ant-pagination-simple .ant-pagination-simple-pager input:hover{border-color:#1890ff}.ant-pagination-simple .ant-pagination-simple-pager input:focus{border-color:#40a9ff;box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-pagination-simple .ant-pagination-simple-pager input[disabled]{background:#f5f5f5;border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination.ant-pagination-mini .ant-pagination-simple-pager,.ant-pagination.ant-pagination-mini .ant-pagination-total-text{height:24px;line-height:24px}.ant-pagination.ant-pagination-mini .ant-pagination-item{height:24px;line-height:22px;margin:0;min-width:24px}.ant-pagination.ant-pagination-mini .ant-pagination-item:not(.ant-pagination-item-active){background:transparent;border-color:transparent}.ant-pagination.ant-pagination-mini .ant-pagination-next,.ant-pagination.ant-pagination-mini .ant-pagination-prev{height:24px;line-height:24px;margin:0;min-width:24px}.ant-pagination.ant-pagination-mini .ant-pagination-next .ant-pagination-item-link,.ant-pagination.ant-pagination-mini .ant-pagination-prev .ant-pagination-item-link{background:transparent;border-color:transparent}.ant-pagination.ant-pagination-mini .ant-pagination-next .ant-pagination-item-link:after,.ant-pagination.ant-pagination-mini .ant-pagination-prev .ant-pagination-item-link:after{height:24px;line-height:24px}.ant-pagination.ant-pagination-mini .ant-pagination-jump-next,.ant-pagination.ant-pagination-mini .ant-pagination-jump-prev{height:24px;line-height:24px;margin-right:0}.ant-pagination.ant-pagination-mini .ant-pagination-options{margin-left:2px}.ant-pagination.ant-pagination-mini .ant-pagination-options-size-changer{top:0}.ant-pagination.ant-pagination-mini .ant-pagination-options-quick-jumper{height:24px;line-height:24px}.ant-pagination.ant-pagination-mini .ant-pagination-options-quick-jumper input{height:24px;padding:0 7px;width:44px}.ant-pagination.ant-pagination-disabled{cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item{background:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item a{background:transparent;border:none;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item-active{background:#e6e6e6}.ant-pagination.ant-pagination-disabled .ant-pagination-item-active a{color:rgba(0,0,0,.25)}.ant-pagination.ant-pagination-disabled .ant-pagination-item-link{background:#f5f5f5;border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination-simple.ant-pagination.ant-pagination-disabled .ant-pagination-item-link{background:transparent}.ant-pagination.ant-pagination-disabled .ant-pagination-item-link-icon{opacity:0}.ant-pagination.ant-pagination-disabled .ant-pagination-item-ellipsis{opacity:1}.ant-pagination.ant-pagination-disabled .ant-pagination-simple-pager{color:rgba(0,0,0,.25)}@media only screen and (max-width:992px){.ant-pagination-item-after-jump-prev,.ant-pagination-item-before-jump-next{display:none}}@media only screen and (max-width:576px){.ant-pagination-options{display:none}}.ant-pagination-rtl .ant-pagination-item,.ant-pagination-rtl .ant-pagination-jump-next,.ant-pagination-rtl .ant-pagination-jump-prev,.ant-pagination-rtl .ant-pagination-prev,.ant-pagination-rtl .ant-pagination-total-text{margin-left:8px;margin-right:0}.ant-pagination-rtl .ant-pagination-slash{margin:0 5px 0 10px}.ant-pagination-rtl .ant-pagination-options{margin-left:0;margin-right:16px}.ant-pagination-rtl .ant-pagination-options .ant-pagination-options-size-changer.ant-select{margin-left:8px;margin-right:0}.ant-pagination-rtl .ant-pagination-options .ant-pagination-options-quick-jumper{margin-left:0}.ant-pagination-rtl.ant-pagination-simple .ant-pagination-simple-pager,.ant-pagination-rtl.ant-pagination-simple .ant-pagination-simple-pager input{margin-left:8px;margin-right:0}.ant-pagination-rtl.ant-pagination.mini .ant-pagination-options{margin-left:0;margin-right:2px}.ant-popconfirm{z-index:1060}.ant-popover{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:auto;font-size:14px;font-variant:tabular-nums;font-weight:400;left:0;line-height:1.5715;list-style:none;margin:0;padding:0;position:absolute;text-align:left;top:0;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;white-space:normal;z-index:1030}.ant-popover-content{position:relative}.ant-popover:after{background:hsla(0,0%,100%,.01);content:"";position:absolute}.ant-popover-hidden{display:none}.ant-popover-placement-top,.ant-popover-placement-topLeft,.ant-popover-placement-topRight{padding-bottom:15.3137085px}.ant-popover-placement-right,.ant-popover-placement-rightBottom,.ant-popover-placement-rightTop{padding-left:15.3137085px}.ant-popover-placement-bottom,.ant-popover-placement-bottomLeft,.ant-popover-placement-bottomRight{padding-top:15.3137085px}.ant-popover-placement-left,.ant-popover-placement-leftBottom,.ant-popover-placement-leftTop{padding-right:15.3137085px}.ant-popover-inner{background-clip:padding-box;background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 0 8px rgba(0,0,0,.15)\9}@media(-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ant-popover-inner{box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}}.ant-popover-title{border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.85);font-weight:500;margin:0;min-height:32px;min-width:177px;padding:5px 16px 4px}.ant-popover-inner-content{color:rgba(0,0,0,.85);padding:12px 16px}.ant-popover-message{color:rgba(0,0,0,.85);font-size:14px;padding:4px 0 12px;position:relative}.ant-popover-message>.anticon{color:#faad14;font-size:14px;position:absolute;top:8.0005px}.ant-popover-message-title{padding-left:22px}.ant-popover-buttons{margin-bottom:4px;text-align:right}.ant-popover-buttons button{margin-left:8px}.ant-popover-arrow{background:transparent;display:block;height:22px;overflow:hidden;pointer-events:none;position:absolute;width:22px}.ant-popover-arrow-content{--antd-arrow-background-color:#fff;border-radius:0 0 2px;bottom:0;content:"";display:block;height:11.3137085px;left:0;margin:auto;pointer-events:auto;pointer-events:none;position:absolute;right:0;top:0;width:11.3137085px}.ant-popover-arrow-content:before{background:var(--antd-arrow-background-color);background-position:-10px -10px;background-repeat:no-repeat;-webkit-clip-path:inset(33% 33%);clip-path:inset(33% 33%);-webkit-clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");content:"";height:33.9411255px;left:-11.3137085px;position:absolute;top:-11.3137085px;width:33.9411255px}.ant-popover-placement-top .ant-popover-arrow,.ant-popover-placement-topLeft .ant-popover-arrow,.ant-popover-placement-topRight .ant-popover-arrow{bottom:0;transform:translateY(100%)}.ant-popover-placement-top .ant-popover-arrow-content,.ant-popover-placement-topLeft .ant-popover-arrow-content,.ant-popover-placement-topRight .ant-popover-arrow-content{box-shadow:3px 3px 7px rgba(0,0,0,.07);transform:translateY(-11px) rotate(45deg)}.ant-popover-placement-top .ant-popover-arrow{left:50%;transform:translateY(100%) translateX(-50%)}.ant-popover-placement-topLeft .ant-popover-arrow{left:16px}.ant-popover-placement-topRight .ant-popover-arrow{right:16px}.ant-popover-placement-right .ant-popover-arrow,.ant-popover-placement-rightBottom .ant-popover-arrow,.ant-popover-placement-rightTop .ant-popover-arrow{left:0;transform:translateX(-100%)}.ant-popover-placement-right .ant-popover-arrow-content,.ant-popover-placement-rightBottom .ant-popover-arrow-content,.ant-popover-placement-rightTop .ant-popover-arrow-content{box-shadow:3px 3px 7px rgba(0,0,0,.07);transform:translateX(11px) rotate(135deg)}.ant-popover-placement-right .ant-popover-arrow{top:50%;transform:translateX(-100%) translateY(-50%)}.ant-popover-placement-rightTop .ant-popover-arrow{top:12px}.ant-popover-placement-rightBottom .ant-popover-arrow{bottom:12px}.ant-popover-placement-bottom .ant-popover-arrow,.ant-popover-placement-bottomLeft .ant-popover-arrow,.ant-popover-placement-bottomRight .ant-popover-arrow{top:0;transform:translateY(-100%)}.ant-popover-placement-bottom .ant-popover-arrow-content,.ant-popover-placement-bottomLeft .ant-popover-arrow-content,.ant-popover-placement-bottomRight .ant-popover-arrow-content{box-shadow:2px 2px 5px rgba(0,0,0,.06);transform:translateY(11px) rotate(-135deg)}.ant-popover-placement-bottom .ant-popover-arrow{left:50%;transform:translateY(-100%) translateX(-50%)}.ant-popover-placement-bottomLeft .ant-popover-arrow{left:16px}.ant-popover-placement-bottomRight .ant-popover-arrow{right:16px}.ant-popover-placement-left .ant-popover-arrow,.ant-popover-placement-leftBottom .ant-popover-arrow,.ant-popover-placement-leftTop .ant-popover-arrow{right:0;transform:translateX(100%)}.ant-popover-placement-left .ant-popover-arrow-content,.ant-popover-placement-leftBottom .ant-popover-arrow-content,.ant-popover-placement-leftTop .ant-popover-arrow-content{box-shadow:3px 3px 7px rgba(0,0,0,.07);transform:translateX(-11px) rotate(-45deg)}.ant-popover-placement-left .ant-popover-arrow{top:50%;transform:translateX(100%) translateY(-50%)}.ant-popover-placement-leftTop .ant-popover-arrow{top:12px}.ant-popover-placement-leftBottom .ant-popover-arrow{bottom:12px}.ant-popover-magenta .ant-popover-arrow-content,.ant-popover-magenta .ant-popover-inner,.ant-popover-pink .ant-popover-arrow-content,.ant-popover-pink .ant-popover-inner{background-color:#eb2f96}.ant-popover-red .ant-popover-arrow-content,.ant-popover-red .ant-popover-inner{background-color:#f5222d}.ant-popover-volcano .ant-popover-arrow-content,.ant-popover-volcano .ant-popover-inner{background-color:#fa541c}.ant-popover-orange .ant-popover-arrow-content,.ant-popover-orange .ant-popover-inner{background-color:#fa8c16}.ant-popover-yellow .ant-popover-arrow-content,.ant-popover-yellow .ant-popover-inner{background-color:#fadb14}.ant-popover-gold .ant-popover-arrow-content,.ant-popover-gold .ant-popover-inner{background-color:#faad14}.ant-popover-cyan .ant-popover-arrow-content,.ant-popover-cyan .ant-popover-inner{background-color:#13c2c2}.ant-popover-lime .ant-popover-arrow-content,.ant-popover-lime .ant-popover-inner{background-color:#a0d911}.ant-popover-green .ant-popover-arrow-content,.ant-popover-green .ant-popover-inner{background-color:#52c41a}.ant-popover-blue .ant-popover-arrow-content,.ant-popover-blue .ant-popover-inner{background-color:#1890ff}.ant-popover-geekblue .ant-popover-arrow-content,.ant-popover-geekblue .ant-popover-inner{background-color:#2f54eb}.ant-popover-purple .ant-popover-arrow-content,.ant-popover-purple .ant-popover-inner{background-color:#722ed1}.ant-popover-rtl{direction:rtl;text-align:right}.ant-popover-rtl .ant-popover-message-title{padding-left:16px;padding-right:22px}.ant-popover-rtl .ant-popover-buttons{text-align:left}.ant-popover-rtl .ant-popover-buttons button{margin-left:0;margin-right:8px}.ant-progress{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-progress-line{font-size:14px;position:relative;width:100%}.ant-progress-steps{display:inline-block}.ant-progress-steps-outer{align-items:center;display:flex;flex-direction:row}.ant-progress-steps-item{background:#f3f3f3;flex-shrink:0;margin-right:2px;min-width:2px;transition:all .3s}.ant-progress-steps-item-active{background:#1890ff}.ant-progress-small.ant-progress-line,.ant-progress-small.ant-progress-line .ant-progress-text .anticon{font-size:12px}.ant-progress-outer{display:inline-block;margin-right:0;padding-right:0;width:100%}.ant-progress-show-info .ant-progress-outer{margin-right:calc(-2em - 8px);padding-right:calc(2em + 8px)}.ant-progress-inner{background-color:#f5f5f5;border-radius:100px;display:inline-block;overflow:hidden;position:relative;vertical-align:middle;width:100%}.ant-progress-circle-trail{stroke:#f5f5f5}.ant-progress-circle-path{-webkit-animation:ant-progress-appear .3s;animation:ant-progress-appear .3s}.ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#1890ff}.ant-progress-bg,.ant-progress-success-bg{background-color:#1890ff;border-radius:100px;position:relative;transition:all .4s cubic-bezier(.08,.82,.17,1) 0s}.ant-progress-success-bg{background-color:#52c41a;left:0;position:absolute;top:0}.ant-progress-text{color:rgba(0,0,0,.85);display:inline-block;font-size:1em;line-height:1;margin-left:8px;text-align:left;vertical-align:middle;white-space:nowrap;width:2em;word-break:normal}.ant-progress-text .anticon{font-size:14px}.ant-progress-status-active .ant-progress-bg:before{-webkit-animation:ant-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;animation:ant-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;background:#fff;border-radius:10px;bottom:0;content:"";left:0;opacity:0;position:absolute;right:0;top:0}.ant-progress-status-exception .ant-progress-bg{background-color:#ff4d4f}.ant-progress-status-exception .ant-progress-text{color:#ff4d4f}.ant-progress-status-exception .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#ff4d4f}.ant-progress-status-success .ant-progress-bg{background-color:#52c41a}.ant-progress-status-success .ant-progress-text{color:#52c41a}.ant-progress-status-success .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#52c41a}.ant-progress-circle .ant-progress-inner{background-color:transparent;line-height:1;position:relative}.ant-progress-circle .ant-progress-text{color:rgba(0,0,0,.85);font-size:1em;left:50%;line-height:1;margin:0;padding:0;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);white-space:normal;width:100%}.ant-progress-circle .ant-progress-text .anticon{font-size:1.16666667em}.ant-progress-circle.ant-progress-status-exception .ant-progress-text{color:#ff4d4f}.ant-progress-circle.ant-progress-status-success .ant-progress-text{color:#52c41a}@-webkit-keyframes ant-progress-active{0%{opacity:.1;transform:translateX(-100%) scaleX(0)}20%{opacity:.5;transform:translateX(-100%) scaleX(0)}to{opacity:0;transform:translateX(0) scaleX(1)}}@keyframes ant-progress-active{0%{opacity:.1;transform:translateX(-100%) scaleX(0)}20%{opacity:.5;transform:translateX(-100%) scaleX(0)}to{opacity:0;transform:translateX(0) scaleX(1)}}.ant-progress-rtl{direction:rtl}.ant-progress-rtl.ant-progress-show-info .ant-progress-outer{margin-left:calc(-2em - 8px);margin-right:0;padding-left:calc(2em + 8px);padding-right:0}.ant-progress-rtl .ant-progress-success-bg{left:auto;right:0}.ant-progress-rtl.ant-progress-line .ant-progress-text,.ant-progress-rtl.ant-progress-steps .ant-progress-text{margin-left:0;margin-right:8px;text-align:right}.ant-radio-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-size:0;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-radio-group .ant-badge-count{z-index:1}.ant-radio-group>.ant-badge:not(:first-child)>.ant-radio-button-wrapper{border-left:none}.ant-radio-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 8px 0 0;padding:0;position:relative}.ant-radio-wrapper-disabled{cursor:not-allowed}.ant-radio-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-radio-wrapper.ant-radio-wrapper-in-form-item input[type=radio]{height:14px;width:14px}.ant-radio{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em}.ant-radio-input:focus+.ant-radio-inner,.ant-radio-wrapper:hover .ant-radio,.ant-radio:hover .ant-radio-inner{border-color:#1890ff}.ant-radio-input:focus+.ant-radio-inner{box-shadow:0 0 0 3px rgba(24,144,255,.12)}.ant-radio-checked:after{-webkit-animation:antRadioEffect .36s ease-in-out;animation:antRadioEffect .36s ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both;border:1px solid #1890ff;border-radius:50%;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-radio-wrapper:hover .ant-radio:after,.ant-radio:hover:after{visibility:visible}.ant-radio-inner{background-color:#fff;border:1px solid #d9d9d9;border-radius:50%;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-radio-inner:after{background-color:#1890ff;border-left:0;border-radius:16px;border-top:0;content:" ";display:block;height:16px;left:50%;margin-left:-8px;margin-top:-8px;opacity:0;position:absolute;top:50%;transform:scale(0);transition:all .3s cubic-bezier(.78,.14,.15,.86);width:16px}.ant-radio-input{bottom:0;cursor:pointer;left:0;opacity:0;position:absolute;right:0;top:0;z-index:1}.ant-radio.ant-radio-disabled .ant-radio-inner{border-color:#d9d9d9}.ant-radio-checked .ant-radio-inner{border-color:#1890ff}.ant-radio-checked .ant-radio-inner:after{opacity:1;transform:scale(.5);transition:all .3s cubic-bezier(.78,.14,.15,.86)}.ant-radio-disabled{cursor:not-allowed}.ant-radio-disabled .ant-radio-inner{background-color:#f5f5f5;cursor:not-allowed}.ant-radio-disabled .ant-radio-inner:after{background-color:rgba(0,0,0,.2)}.ant-radio-disabled .ant-radio-input{cursor:not-allowed}.ant-radio-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}span.ant-radio+*{padding-left:8px;padding-right:8px}.ant-radio-button-wrapper{background:#fff;border-color:#d9d9d9;border-style:solid;border-width:1.02px 1px 1px 0;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;height:32px;line-height:30px;margin:0;padding:0 15px;position:relative;transition:color .3s,background .3s,border-color .3s,box-shadow .3s}.ant-radio-button-wrapper a{color:rgba(0,0,0,.85)}.ant-radio-button-wrapper>.ant-radio-button{height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1}.ant-radio-group-large .ant-radio-button-wrapper{font-size:16px;height:40px;line-height:38px}.ant-radio-group-small .ant-radio-button-wrapper{height:24px;line-height:22px;padding:0 7px}.ant-radio-button-wrapper:not(:first-child):before{background-color:#d9d9d9;box-sizing:content-box;content:"";display:block;height:100%;left:-1px;padding:1px 0;position:absolute;top:-1px;transition:background-color .3s;width:1px}.ant-radio-button-wrapper:first-child{border-left:1px solid #d9d9d9;border-radius:2px 0 0 2px}.ant-radio-button-wrapper:last-child{border-radius:0 2px 2px 0}.ant-radio-button-wrapper:first-child:last-child{border-radius:2px}.ant-radio-button-wrapper:hover{color:#1890ff;position:relative}.ant-radio-button-wrapper:focus-within{box-shadow:0 0 0 3px rgba(24,144,255,.12)}.ant-radio-button-wrapper .ant-radio-inner,.ant-radio-button-wrapper input[type=checkbox],.ant-radio-button-wrapper input[type=radio]{height:0;opacity:0;pointer-events:none;width:0}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){background:#fff;border-color:#1890ff;color:#1890ff;z-index:1}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):before{background-color:#1890ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child{border-color:#1890ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover{border-color:#40a9ff;color:#40a9ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover:before{background-color:#40a9ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active{border-color:#096dd9;color:#096dd9}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active:before{background-color:#096dd9}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within{box-shadow:0 0 0 3px rgba(24,144,255,.12)}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){background:#1890ff;border-color:#1890ff;color:#fff}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover{background:#40a9ff;border-color:#40a9ff;color:#fff}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active{background:#096dd9;border-color:#096dd9;color:#fff}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within{box-shadow:0 0 0 3px rgba(24,144,255,.12)}.ant-radio-button-wrapper-disabled{cursor:not-allowed}.ant-radio-button-wrapper-disabled,.ant-radio-button-wrapper-disabled:first-child,.ant-radio-button-wrapper-disabled:hover{background-color:#f5f5f5;border-color:#d9d9d9;color:rgba(0,0,0,.25)}.ant-radio-button-wrapper-disabled:first-child{border-left-color:#d9d9d9}.ant-radio-button-wrapper-disabled.ant-radio-button-wrapper-checked{background-color:#e6e6e6;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25)}@-webkit-keyframes antRadioEffect{0%{opacity:.5;transform:scale(1)}to{opacity:0;transform:scale(1.6)}}@keyframes antRadioEffect{0%{opacity:.5;transform:scale(1)}to{opacity:0;transform:scale(1.6)}}.ant-radio-group.ant-radio-group-rtl{direction:rtl}.ant-radio-wrapper.ant-radio-wrapper-rtl{direction:rtl;margin-left:8px;margin-right:0}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl{border-left-width:1px;border-right-width:0}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:not(:first-child):before{left:0;right:-1px}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:first-child{border-radius:0 2px 2px 0;border-right:1px solid #d9d9d9}.ant-radio-button-wrapper-checked:not([class*=" ant-radio-button-wrapper-disabled"]).ant-radio-button-wrapper:first-child{border-right-color:#40a9ff}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:last-child{border-radius:2px 0 0 2px}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper-disabled:first-child{border-right-color:#d9d9d9}.ant-rate{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);color:#fadb14;display:inline-block;font-size:14px;font-size:20px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;outline:none;padding:0}.ant-rate-disabled .ant-rate-star{cursor:default}.ant-rate-disabled .ant-rate-star>div:hover{transform:scale(1)}.ant-rate-star{color:inherit;cursor:pointer;display:inline-block;position:relative}.ant-rate-star:not(:last-child){margin-right:8px}.ant-rate-star>div{transition:all .3s,outline 0s}.ant-rate-star>div:hover{transform:scale(1.1)}.ant-rate-star>div:focus{outline:0}.ant-rate-star>div:focus-visible{outline:1px dashed #fadb14;transform:scale(1.1)}.ant-rate-star-first,.ant-rate-star-second{color:#f0f0f0;transition:all .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-rate-star-first .anticon,.ant-rate-star-second .anticon{vertical-align:middle}.ant-rate-star-first{height:100%;left:0;opacity:0;overflow:hidden;position:absolute;top:0;width:50%}.ant-rate-star-half .ant-rate-star-first,.ant-rate-star-half .ant-rate-star-second{opacity:1}.ant-rate-star-full .ant-rate-star-second,.ant-rate-star-half .ant-rate-star-first{color:inherit}.ant-rate-text{display:inline-block;font-size:14px;margin:0 8px}.ant-rate-rtl{direction:rtl}.ant-rate-rtl .ant-rate-star:not(:last-child){margin-left:8px;margin-right:0}.ant-rate-rtl .ant-rate-star-first{left:auto;right:0}.ant-result{padding:48px 32px}.ant-result-success .ant-result-icon>.anticon{color:#52c41a}.ant-result-error .ant-result-icon>.anticon{color:#ff4d4f}.ant-result-info .ant-result-icon>.anticon{color:#1890ff}.ant-result-warning .ant-result-icon>.anticon{color:#faad14}.ant-result-image{height:295px;margin:auto;width:250px}.ant-result-icon{margin-bottom:24px;text-align:center}.ant-result-icon>.anticon{font-size:72px}.ant-result-title{color:rgba(0,0,0,.85);font-size:24px;line-height:1.8;text-align:center}.ant-result-subtitle{color:rgba(0,0,0,.45);font-size:14px;line-height:1.6;text-align:center}.ant-result-extra{margin:24px 0 0;text-align:center}.ant-result-extra>*{margin-right:8px}.ant-result-extra>:last-child{margin-right:0}.ant-result-content{background-color:#fafafa;margin-top:24px;padding:24px 40px}.ant-result-rtl{direction:rtl}.ant-result-rtl .ant-result-extra>*{margin-left:8px;margin-right:0}.ant-result-rtl .ant-result-extra>:last-child{margin-left:0}.segmented-disabled-item,.segmented-disabled-item:focus,.segmented-disabled-item:hover{color:rgba(0,0,0,.25);cursor:not-allowed}.segmented-item-selected{background-color:#fff;border-radius:2px;box-shadow:0 2px 8px -2px rgba(0,0,0,.05),0 1px 4px -1px rgba(0,0,0,.07),0 0 1px 0 rgba(0,0,0,.08)}.segmented-text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all}.ant-segmented{font-feature-settings:"tnum";background-color:rgba(0,0,0,.04);border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);color:rgba(0,0,0,.65);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:2px;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-segmented-group{align-items:stretch;display:flex;justify-items:flex-start;position:relative;width:100%}.ant-segmented.ant-segmented-block{display:flex}.ant-segmented.ant-segmented-block .ant-segmented-item{flex:1;min-width:0}.ant-segmented:not(.ant-segmented-disabled):focus,.ant-segmented:not(.ant-segmented-disabled):hover{background-color:rgba(0,0,0,.06)}.ant-segmented-item{cursor:pointer;position:relative;text-align:center;transition:color .3s cubic-bezier(.645,.045,.355,1)}.ant-segmented-item-selected{background-color:#fff;border-radius:2px;box-shadow:0 2px 8px -2px rgba(0,0,0,.05),0 1px 4px -1px rgba(0,0,0,.07),0 0 1px 0 rgba(0,0,0,.08);color:#262626}.ant-segmented-item:focus,.ant-segmented-item:hover{color:#262626}.ant-segmented-item-label{line-height:28px;min-height:28px;overflow:hidden;padding:0 11px;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all}.ant-segmented-item-icon+*{margin-left:6px}.ant-segmented-item-input{height:0;left:0;opacity:0;pointer-events:none;position:absolute;top:0;width:0}.ant-segmented.ant-segmented-lg .ant-segmented-item-label{font-size:16px;line-height:36px;min-height:36px;padding:0 11px}.ant-segmented.ant-segmented-sm .ant-segmented-item-label{line-height:20px;min-height:20px;padding:0 7px}.ant-segmented-item-disabled,.ant-segmented-item-disabled:focus,.ant-segmented-item-disabled:hover{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-segmented-thumb{background-color:#fff;border-radius:2px;box-shadow:0 2px 8px -2px rgba(0,0,0,.05),0 1px 4px -1px rgba(0,0,0,.07),0 0 1px 0 rgba(0,0,0,.08);height:100%;left:0;padding:4px 0;position:absolute;top:0;width:0}.ant-segmented-thumb-motion-appear-active{transition:transform .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1);will-change:transform,width}.ant-segmented.ant-segmented-rtl{direction:rtl}.ant-segmented.ant-segmented-rtl .ant-segmented-item-icon{margin-left:6px;margin-right:0}.ant-select-single .ant-select-selector{display:flex}.ant-select-single .ant-select-selector .ant-select-selection-search{bottom:0;left:11px;position:absolute;right:11px;top:0}.ant-select-single .ant-select-selector .ant-select-selection-search-input{width:100%}.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-single .ant-select-selector .ant-select-selection-placeholder{line-height:30px;padding:0;transition:all .3s}.ant-select-single .ant-select-selector .ant-select-selection-item{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-single .ant-select-selector .ant-select-selection-placeholder{pointer-events:none;transition:none}.ant-select-single .ant-select-selector .ant-select-selection-item:after,.ant-select-single .ant-select-selector .ant-select-selection-placeholder:after,.ant-select-single .ant-select-selector:after{content:" ";display:inline-block;visibility:hidden;width:0}.ant-select-single.ant-select-show-arrow .ant-select-selection-search{right:25px}.ant-select-single.ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{padding-right:18px}.ant-select-single.ant-select-open .ant-select-selection-item{color:#bfbfbf}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{height:32px;padding:0 11px;width:100%}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{height:30px}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector:after{line-height:30px}.ant-select-single.ant-select-customize-input .ant-select-selector:after{display:none}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-search{position:static;width:100%}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder{left:0;padding:0 11px;position:absolute;right:0}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder:after{display:none}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{height:40px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-placeholder,.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector:after{line-height:38px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input):not(.ant-select-customize-input) .ant-select-selection-search-input{height:38px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{height:24px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-placeholder,.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector:after{line-height:22px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input):not(.ant-select-customize-input) .ant-select-selection-search-input{height:22px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selection-search{left:7px;right:7px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{padding:0 7px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-search{right:28px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder{padding-right:21px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{padding:0 11px}.ant-select-selection-overflow{display:flex;flex:auto;flex-wrap:wrap;max-width:100%;position:relative}.ant-select-selection-overflow-item{-ms-grid-row-align:center;align-self:center;flex:none;max-width:100%}.ant-select-multiple .ant-select-selector{align-items:center;display:flex;flex-wrap:wrap;padding:1px 4px}.ant-select-show-search.ant-select-multiple .ant-select-selector{cursor:text}.ant-select-disabled.ant-select-multiple .ant-select-selector{background:#f5f5f5;cursor:not-allowed}.ant-select-multiple .ant-select-selector:after{content:" ";display:inline-block;line-height:24px;margin:2px 0;width:0}.ant-select-multiple.ant-select-allow-clear .ant-select-selector,.ant-select-multiple.ant-select-show-arrow .ant-select-selector{padding-right:24px}.ant-select-multiple .ant-select-selection-item{-webkit-margin-end:4px;-webkit-padding-start:8px;-webkit-padding-end:4px;background:#f5f5f5;border:1px solid #f0f0f0;border-radius:2px;box-sizing:border-box;cursor:default;display:flex;flex:none;height:24px;line-height:22px;margin-bottom:2px;margin-inline-end:4px;margin-top:2px;max-width:100%;padding-inline-end:4px;padding-inline-start:8px;position:relative;transition:font-size .3s,line-height .3s,height .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-disabled.ant-select-multiple .ant-select-selection-item{border-color:#d9d9d9;color:#bfbfbf;cursor:not-allowed}.ant-select-multiple .ant-select-selection-item-content{display:inline-block;margin-right:4px;overflow:hidden;text-overflow:ellipsis;white-space:pre}.ant-select-multiple .ant-select-selection-item-remove{text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:inherit;color:rgba(0,0,0,.45);cursor:pointer;display:inline-block;font-size:10px;font-style:normal;font-weight:700;line-height:0;line-height:inherit;text-align:center;text-transform:none;vertical-align:-.125em}.ant-select-multiple .ant-select-selection-item-remove>*{line-height:1}.ant-select-multiple .ant-select-selection-item-remove svg{display:inline-block}.ant-select-multiple .ant-select-selection-item-remove:before{display:none}.ant-select-multiple .ant-select-selection-item-remove .ant-select-multiple .ant-select-selection-item-remove-icon{display:block}.ant-select-multiple .ant-select-selection-item-remove>.anticon{vertical-align:middle}.ant-select-multiple .ant-select-selection-item-remove:hover{color:rgba(0,0,0,.75)}.ant-select-multiple .ant-select-selection-overflow-item+.ant-select-selection-overflow-item .ant-select-selection-search{-webkit-margin-start:0;margin-inline-start:0}.ant-select-multiple .ant-select-selection-search{-webkit-margin-start:7px;margin-inline-start:7px;max-width:100%;position:relative}.ant-select-multiple .ant-select-selection-search-input,.ant-select-multiple .ant-select-selection-search-mirror{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;height:24px;line-height:24px;transition:all .3s}.ant-select-multiple .ant-select-selection-search-input{min-width:4.1px;width:100%}.ant-select-multiple .ant-select-selection-search-mirror{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.ant-select-multiple .ant-select-selection-placeholder{left:11px;position:absolute;right:11px;top:50%;transform:translateY(-50%);transition:all .3s}.ant-select-multiple.ant-select-lg .ant-select-selector:after{line-height:32px}.ant-select-multiple.ant-select-lg .ant-select-selection-item{line-height:30px}.ant-select-multiple.ant-select-lg .ant-select-selection-search{height:32px;line-height:32px}.ant-select-multiple.ant-select-lg .ant-select-selection-search-input,.ant-select-multiple.ant-select-lg .ant-select-selection-search-mirror{height:32px;line-height:30px}.ant-select-multiple.ant-select-sm .ant-select-selector:after{line-height:16px}.ant-select-multiple.ant-select-sm .ant-select-selection-item{height:16px;line-height:14px}.ant-select-multiple.ant-select-sm .ant-select-selection-search{height:16px;line-height:16px}.ant-select-multiple.ant-select-sm .ant-select-selection-search-input,.ant-select-multiple.ant-select-sm .ant-select-selection-search-mirror{height:16px;line-height:14px}.ant-select-multiple.ant-select-sm .ant-select-selection-placeholder{left:7px}.ant-select-multiple.ant-select-sm .ant-select-selection-search{-webkit-margin-start:3px;margin-inline-start:3px}.ant-select-multiple.ant-select-lg .ant-select-selection-item{height:32px;line-height:32px}.ant-select-disabled .ant-select-selection-item-remove{display:none}.ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input) .ant-select-selector{background-color:#fff;border-color:#ff4d4f!important}.ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-focused .ant-select-selector,.ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-open .ant-select-selector{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input) .ant-select-selector{background-color:#fff;border-color:#faad14!important}.ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-focused .ant-select-selector,.ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-open .ant-select-selector{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-select-status-error.ant-select-has-feedback .ant-select-clear,.ant-select-status-success.ant-select-has-feedback .ant-select-clear,.ant-select-status-validating.ant-select-has-feedback .ant-select-clear,.ant-select-status-warning.ant-select-has-feedback .ant-select-clear{right:32px}.ant-select-status-error.ant-select-has-feedback .ant-select-selection-selected-value,.ant-select-status-success.ant-select-has-feedback .ant-select-selection-selected-value,.ant-select-status-validating.ant-select-has-feedback .ant-select-selection-selected-value,.ant-select-status-warning.ant-select-has-feedback .ant-select-selection-selected-value{padding-right:42px}.ant-select{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-select:not(.ant-select-customize-input) .ant-select-selector{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;position:relative;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:pointer}.ant-select-show-search.ant-select:not(.ant-select-customize-input) .ant-select-selector{cursor:text}.ant-select-show-search.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:auto}.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{background:#f5f5f5;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-multiple.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{background:#f5f5f5}.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:not-allowed}.ant-select:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:none;margin:0;outline:none;padding:0}.ant-select:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input::-webkit-search-cancel-button{-webkit-appearance:none;display:none}.ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:#40a9ff;border-right-width:1px}.ant-select-selection-item{flex:1;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(-ms-high-contrast:none){.ant-select-selection-item,.ant-select-selection-item ::-ms-backdrop{flex:auto}}.ant-select-selection-placeholder{color:#bfbfbf;flex:1;overflow:hidden;pointer-events:none;text-overflow:ellipsis;white-space:nowrap}@media(-ms-high-contrast:none){.ant-select-selection-placeholder,.ant-select-selection-placeholder ::-ms-backdrop{flex:auto}}.ant-select-arrow{text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;align-items:center;color:inherit;color:rgba(0,0,0,.25);display:inline-block;display:flex;font-size:12px;font-style:normal;height:12px;line-height:0;line-height:1;margin-top:-6px;pointer-events:none;position:absolute;right:11px;text-align:center;text-transform:none;top:50%;vertical-align:-.125em}.ant-select-arrow>*{line-height:1}.ant-select-arrow svg{display:inline-block}.ant-select-arrow:before{display:none}.ant-select-arrow .ant-select-arrow-icon{display:block}.ant-select-arrow .anticon{transition:transform .3s;vertical-align:top}.ant-select-arrow .anticon>svg{vertical-align:top}.ant-select-arrow .anticon:not(.ant-select-suffix){pointer-events:auto}.ant-select-disabled .ant-select-arrow{cursor:not-allowed}.ant-select-arrow>:not(:last-child){-webkit-margin-end:8px;margin-inline-end:8px}.ant-select-clear{text-rendering:auto;background:#fff;color:rgba(0,0,0,.25);cursor:pointer;display:inline-block;font-size:12px;font-style:normal;height:12px;line-height:1;margin-top:-6px;opacity:0;position:absolute;right:11px;text-align:center;text-transform:none;top:50%;transition:color .3s ease,opacity .15s ease;width:12px;z-index:1}.ant-select-clear:before{display:block}.ant-select-clear:hover{color:rgba(0,0,0,.45)}.ant-select:hover .ant-select-clear{opacity:1}.ant-select-dropdown{font-feature-settings:"tnum";background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;font-variant:normal;left:-9999px;line-height:1.5715;list-style:none;margin:0;outline:none;overflow:hidden;padding:4px 0;position:absolute;top:-9999px;z-index:1050}.ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-bottomLeft,.ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-bottomLeft{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn}.ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-topLeft,.ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-topLeft{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn}.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-bottomLeft{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut}.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-topLeft{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut}.ant-select-dropdown-hidden{display:none}.ant-select-dropdown-empty{color:rgba(0,0,0,.25)}.ant-select-item-empty{color:rgba(0,0,0,.85);color:rgba(0,0,0,.25)}.ant-select-item,.ant-select-item-empty{display:block;font-size:14px;font-weight:400;line-height:22px;min-height:32px;padding:5px 12px;position:relative}.ant-select-item{color:rgba(0,0,0,.85);cursor:pointer;transition:background .3s ease}.ant-select-item-group{color:rgba(0,0,0,.45);cursor:default;font-size:12px}.ant-select-item-option{display:flex}.ant-select-item-option-content{flex:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-select-item-option-state{flex:none}.ant-select-item-option-active:not(.ant-select-item-option-disabled){background-color:#f5f5f5}.ant-select-item-option-selected:not(.ant-select-item-option-disabled){background-color:#e6f7ff;color:rgba(0,0,0,.85);font-weight:600}.ant-select-item-option-selected:not(.ant-select-item-option-disabled) .ant-select-item-option-state{color:#1890ff}.ant-select-item-option-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-item-option-disabled.ant-select-item-option-selected{background-color:#f5f5f5}.ant-select-item-option-grouped{padding-left:24px}.ant-select-lg{font-size:16px}.ant-select-borderless .ant-select-selector{background-color:transparent!important;border-color:transparent!important;box-shadow:none!important}.ant-select.ant-select-in-form-item{width:100%}.ant-select-rtl{direction:rtl}.ant-select-rtl .ant-select-arrow,.ant-select-rtl .ant-select-clear{left:11px;right:auto}.ant-select-dropdown-rtl{direction:rtl}.ant-select-dropdown-rtl .ant-select-item-option-grouped{padding-left:12px;padding-right:24px}.ant-select-rtl.ant-select-multiple.ant-select-allow-clear .ant-select-selector,.ant-select-rtl.ant-select-multiple.ant-select-show-arrow .ant-select-selector{padding-left:24px;padding-right:4px}.ant-select-rtl.ant-select-multiple .ant-select-selection-item{text-align:right}.ant-select-rtl.ant-select-multiple .ant-select-selection-item-content{margin-left:4px;margin-right:0;text-align:right}.ant-select-rtl.ant-select-multiple .ant-select-selection-search-mirror{left:auto;right:0}.ant-select-rtl.ant-select-multiple .ant-select-selection-placeholder{left:auto;right:11px}.ant-select-rtl.ant-select-multiple.ant-select-sm .ant-select-selection-placeholder{right:7px}.ant-select-rtl.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-rtl.ant-select-single .ant-select-selector .ant-select-selection-placeholder{left:9px;right:0;text-align:right}.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-search{left:25px;right:11px}.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-item,.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{padding-left:18px;padding-right:0}.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-search{right:6px}.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item,.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder{padding-left:21px;padding-right:0}.ant-skeleton{display:table;width:100%}.ant-skeleton-header{display:table-cell;padding-right:16px;vertical-align:top}.ant-skeleton-header .ant-skeleton-avatar{background:hsla(0,0%,75%,.2);display:inline-block;height:32px;line-height:32px;vertical-align:top;width:32px}.ant-skeleton-header .ant-skeleton-avatar.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-lg{height:40px;line-height:40px;width:40px}.ant-skeleton-header .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-sm{height:24px;line-height:24px;width:24px}.ant-skeleton-header .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-content{display:table-cell;vertical-align:top;width:100%}.ant-skeleton-content .ant-skeleton-title{background:hsla(0,0%,75%,.2);border-radius:2px;height:16px;width:100%}.ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:24px}.ant-skeleton-content .ant-skeleton-paragraph{padding:0}.ant-skeleton-content .ant-skeleton-paragraph>li{background:hsla(0,0%,75%,.2);border-radius:2px;height:16px;list-style:none;width:100%}.ant-skeleton-content .ant-skeleton-paragraph>li:last-child:not(:first-child):not(:nth-child(2)){width:61%}.ant-skeleton-content .ant-skeleton-paragraph>li+li{margin-top:16px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title{margin-top:12px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:28px}.ant-skeleton-round .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton-round .ant-skeleton-content .ant-skeleton-title{border-radius:100px}.ant-skeleton-active .ant-skeleton-avatar,.ant-skeleton-active .ant-skeleton-button,.ant-skeleton-active .ant-skeleton-image,.ant-skeleton-active .ant-skeleton-input,.ant-skeleton-active .ant-skeleton-paragraph>li,.ant-skeleton-active .ant-skeleton-title{background:transparent;overflow:hidden;position:relative;z-index:0}.ant-skeleton-active .ant-skeleton-avatar:after,.ant-skeleton-active .ant-skeleton-button:after,.ant-skeleton-active .ant-skeleton-image:after,.ant-skeleton-active .ant-skeleton-input:after,.ant-skeleton-active .ant-skeleton-paragraph>li:after,.ant-skeleton-active .ant-skeleton-title:after{-webkit-animation:ant-skeleton-loading 1.4s ease infinite;animation:ant-skeleton-loading 1.4s ease infinite;background:linear-gradient(90deg,hsla(0,0%,75%,.2) 25%,hsla(0,0%,51%,.24) 37%,hsla(0,0%,75%,.2) 63%);bottom:0;content:"";left:-150%;position:absolute;right:-150%;top:0}.ant-skeleton.ant-skeleton-block,.ant-skeleton.ant-skeleton-block .ant-skeleton-button,.ant-skeleton.ant-skeleton-block .ant-skeleton-input{width:100%}.ant-skeleton-element{display:inline-block;width:auto}.ant-skeleton-element .ant-skeleton-button{background:hsla(0,0%,75%,.2);border-radius:2px;display:inline-block;height:32px;line-height:32px;min-width:64px;vertical-align:top;width:64px}.ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-circle{border-radius:50%;min-width:32px;width:32px}.ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-round{border-radius:32px}.ant-skeleton-element .ant-skeleton-button-lg{height:40px;line-height:40px;min-width:80px;width:80px}.ant-skeleton-element .ant-skeleton-button-lg.ant-skeleton-button-circle{border-radius:50%;min-width:40px;width:40px}.ant-skeleton-element .ant-skeleton-button-lg.ant-skeleton-button-round{border-radius:40px}.ant-skeleton-element .ant-skeleton-button-sm{height:24px;line-height:24px;min-width:48px;width:48px}.ant-skeleton-element .ant-skeleton-button-sm.ant-skeleton-button-circle{border-radius:50%;min-width:24px;width:24px}.ant-skeleton-element .ant-skeleton-button-sm.ant-skeleton-button-round{border-radius:24px}.ant-skeleton-element .ant-skeleton-avatar{background:hsla(0,0%,75%,.2);display:inline-block;height:32px;line-height:32px;vertical-align:top;width:32px}.ant-skeleton-element .ant-skeleton-avatar.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-avatar-lg{height:40px;line-height:40px;width:40px}.ant-skeleton-element .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-avatar-sm{height:24px;line-height:24px;width:24px}.ant-skeleton-element .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-input{background:hsla(0,0%,75%,.2);display:inline-block;height:32px;line-height:32px;min-width:160px;vertical-align:top;width:160px}.ant-skeleton-element .ant-skeleton-input-lg{height:40px;line-height:40px;min-width:200px;width:200px}.ant-skeleton-element .ant-skeleton-input-sm{height:24px;line-height:24px;min-width:120px;width:120px}.ant-skeleton-element .ant-skeleton-image{align-items:center;background:hsla(0,0%,75%,.2);display:flex;height:96px;justify-content:center;line-height:96px;vertical-align:top;width:96px}.ant-skeleton-element .ant-skeleton-image.ant-skeleton-image-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-image-path{fill:#bfbfbf}.ant-skeleton-element .ant-skeleton-image-svg{height:48px;line-height:48px;max-height:192px;max-width:192px;width:48px}.ant-skeleton-element .ant-skeleton-image-svg.ant-skeleton-image-circle{border-radius:50%}@-webkit-keyframes ant-skeleton-loading{0%{transform:translateX(-37.5%)}to{transform:translateX(37.5%)}}@keyframes ant-skeleton-loading{0%{transform:translateX(-37.5%)}to{transform:translateX(37.5%)}}.ant-skeleton-rtl{direction:rtl}.ant-skeleton-rtl .ant-skeleton-header{padding-left:16px;padding-right:0}.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-avatar,.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-title{-webkit-animation-name:ant-skeleton-loading-rtl;animation-name:ant-skeleton-loading-rtl}@-webkit-keyframes ant-skeleton-loading-rtl{0%{background-position:0 50%}to{background-position:100% 50%}}@keyframes ant-skeleton-loading-rtl{0%{background-position:0 50%}to{background-position:100% 50%}}.ant-slider{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;height:12px;line-height:1.5715;list-style:none;margin:10px 6px;padding:4px 0;position:relative;touch-action:none}.ant-slider-vertical{height:100%;margin:6px 10px;padding:0 4px;width:12px}.ant-slider-vertical .ant-slider-rail{height:100%;width:4px}.ant-slider-vertical .ant-slider-track{width:4px}.ant-slider-vertical .ant-slider-handle{margin-left:-5px;margin-top:-6px}.ant-slider-vertical .ant-slider-mark{height:100%;left:12px;top:0;width:18px}.ant-slider-vertical .ant-slider-mark-text{left:4px;white-space:nowrap}.ant-slider-vertical .ant-slider-step{height:100%;width:4px}.ant-slider-vertical .ant-slider-dot{margin-left:-2px;top:auto}.ant-slider-tooltip .ant-tooltip-inner{min-width:unset}.ant-slider-rtl.ant-slider-vertical .ant-slider-handle{margin-left:0;margin-right:-5px}.ant-slider-rtl.ant-slider-vertical .ant-slider-mark{left:auto;right:12px}.ant-slider-rtl.ant-slider-vertical .ant-slider-mark-text{left:auto;right:4px}.ant-slider-rtl.ant-slider-vertical .ant-slider-dot{left:auto;right:2px}.ant-slider-with-marks{margin-bottom:28px}.ant-slider-rail{background-color:#f5f5f5;width:100%}.ant-slider-rail,.ant-slider-track{border-radius:2px;height:4px;position:absolute;transition:background-color .3s}.ant-slider-track{background-color:#91d5ff}.ant-slider-handle{background-color:#fff;border:2px solid #91d5ff;border-radius:50%;box-shadow:0;cursor:pointer;height:14px;margin-top:-5px;position:absolute;transition:border-color .3s,box-shadow .6s,transform .3s cubic-bezier(.18,.89,.32,1.28);width:14px}.ant-slider-handle-dragging{z-index:1}.ant-slider-handle:focus{border-color:#46a6ff;box-shadow:0 0 0 5px rgba(24,144,255,.12);outline:none}.ant-slider-handle.ant-tooltip-open{border-color:#1890ff}.ant-slider-handle:after{bottom:-6px;content:"";left:-6px;position:absolute;right:-6px;top:-6px}.ant-slider:hover .ant-slider-rail{background-color:#e1e1e1}.ant-slider:hover .ant-slider-track{background-color:#69c0ff}.ant-slider:hover .ant-slider-handle:not(.ant-tooltip-open){border-color:#69c0ff}.ant-slider-mark{font-size:14px;left:0;position:absolute;top:14px;width:100%}.ant-slider-mark-text{color:rgba(0,0,0,.45);cursor:pointer;display:inline-block;position:absolute;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;word-break:keep-all}.ant-slider-mark-text-active{color:rgba(0,0,0,.85)}.ant-slider-step{background:transparent;height:4px;pointer-events:none;position:absolute;width:100%}.ant-slider-dot{background-color:#fff;border:2px solid #f0f0f0;border-radius:50%;cursor:pointer;height:8px;position:absolute;top:-2px;width:8px}.ant-slider-dot-active{border-color:#8cc8ff}.ant-slider-disabled{cursor:not-allowed}.ant-slider-disabled .ant-slider-rail{background-color:#f5f5f5!important}.ant-slider-disabled .ant-slider-track{background-color:rgba(0,0,0,.25)!important}.ant-slider-disabled .ant-slider-dot,.ant-slider-disabled .ant-slider-handle{background-color:#fff;border-color:rgba(0,0,0,.25)!important;box-shadow:none;cursor:not-allowed}.ant-slider-disabled .ant-slider-dot,.ant-slider-disabled .ant-slider-mark-text{cursor:not-allowed!important}.ant-slider-rtl{direction:rtl}.ant-slider-rtl .ant-slider-mark{left:auto;right:0}.ant-space{display:inline-flex}.ant-space-vertical{flex-direction:column}.ant-space-align-center{align-items:center}.ant-space-align-start{align-items:flex-start}.ant-space-align-end{align-items:flex-end}.ant-space-align-baseline{align-items:baseline}.ant-space-item:empty{display:none}.ant-space-rtl{direction:rtl}.ant-spin{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);color:#1890ff;display:none;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;opacity:0;padding:0;position:absolute;text-align:center;transition:transform .3s cubic-bezier(.78,.14,.15,.86);vertical-align:middle}.ant-spin-spinning{display:inline-block;opacity:1;position:static}.ant-spin-nested-loading{position:relative}.ant-spin-nested-loading>div>.ant-spin{display:block;height:100%;left:0;max-height:400px;position:absolute;top:0;width:100%;z-index:4}.ant-spin-nested-loading>div>.ant-spin .ant-spin-dot{left:50%;margin:-10px;position:absolute;top:50%}.ant-spin-nested-loading>div>.ant-spin .ant-spin-text{padding-top:5px;position:absolute;text-shadow:0 1px 2px #fff;top:50%;width:100%}.ant-spin-nested-loading>div>.ant-spin.ant-spin-show-text .ant-spin-dot{margin-top:-20px}.ant-spin-nested-loading>div>.ant-spin-sm .ant-spin-dot{margin:-7px}.ant-spin-nested-loading>div>.ant-spin-sm .ant-spin-text{padding-top:2px}.ant-spin-nested-loading>div>.ant-spin-sm.ant-spin-show-text .ant-spin-dot{margin-top:-17px}.ant-spin-nested-loading>div>.ant-spin-lg .ant-spin-dot{margin:-16px}.ant-spin-nested-loading>div>.ant-spin-lg .ant-spin-text{padding-top:11px}.ant-spin-nested-loading>div>.ant-spin-lg.ant-spin-show-text .ant-spin-dot{margin-top:-26px}.ant-spin-container{position:relative;transition:opacity .3s}.ant-spin-container:after{background:#fff;bottom:0;content:"";display:none\9;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;transition:all .3s;width:100%;z-index:10}.ant-spin-blur{clear:both;opacity:.5;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-spin-blur:after{opacity:.4;pointer-events:auto}.ant-spin-tip{color:rgba(0,0,0,.45)}.ant-spin-dot{display:inline-block;font-size:20px;height:1em;position:relative;width:1em}.ant-spin-dot-item{-webkit-animation:antSpinMove 1s linear infinite alternate;animation:antSpinMove 1s linear infinite alternate;background-color:#1890ff;border-radius:100%;display:block;height:9px;opacity:.3;position:absolute;transform:scale(.75);transform-origin:50% 50%;width:9px}.ant-spin-dot-item:first-child{left:0;top:0}.ant-spin-dot-item:nth-child(2){-webkit-animation-delay:.4s;animation-delay:.4s;right:0;top:0}.ant-spin-dot-item:nth-child(3){-webkit-animation-delay:.8s;animation-delay:.8s;bottom:0;right:0}.ant-spin-dot-item:nth-child(4){-webkit-animation-delay:1.2s;animation-delay:1.2s;bottom:0;left:0}.ant-spin-dot-spin{-webkit-animation:antRotate 1.2s linear infinite;animation:antRotate 1.2s linear infinite;transform:rotate(0deg)}.ant-spin-sm .ant-spin-dot{font-size:14px}.ant-spin-sm .ant-spin-dot i{height:6px;width:6px}.ant-spin-lg .ant-spin-dot{font-size:32px}.ant-spin-lg .ant-spin-dot i{height:14px;width:14px}.ant-spin.ant-spin-show-text .ant-spin-text{display:block}@media(-ms-high-contrast:active),(-ms-high-contrast:none){.ant-spin-blur{background:#fff;opacity:.5}}@-webkit-keyframes antSpinMove{to{opacity:1}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antRotate{to{transform:rotate(1turn)}}@keyframes antRotate{to{transform:rotate(1turn)}}.ant-spin-rtl{direction:rtl}.ant-spin-rtl .ant-spin-dot-spin{-webkit-animation-name:antRotateRtl;animation-name:antRotateRtl;transform:rotate(-45deg)}@-webkit-keyframes antRotateRtl{to{transform:rotate(-405deg)}}@keyframes antRotateRtl{to{transform:rotate(-405deg)}}.ant-statistic{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-statistic-title{color:rgba(0,0,0,.45);font-size:14px;margin-bottom:4px}.ant-statistic-skeleton{padding-top:16px}.ant-statistic-content{color:rgba(0,0,0,.85);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:24px}.ant-statistic-content-value{direction:ltr;display:inline-block}.ant-statistic-content-prefix,.ant-statistic-content-suffix{display:inline-block}.ant-statistic-content-prefix{margin-right:4px}.ant-statistic-content-suffix{margin-left:4px}.ant-statistic-rtl{direction:rtl}.ant-statistic-rtl .ant-statistic-content-prefix{margin-left:4px;margin-right:0}.ant-statistic-rtl .ant-statistic-content-suffix{margin-left:0;margin-right:4px}.ant-steps{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:flex;font-size:14px;font-size:0;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;text-align:initial;width:100%}.ant-steps-item{display:inline-block;flex:1;overflow:hidden;position:relative;vertical-align:top}.ant-steps-item-container{outline:none}.ant-steps-item:last-child{flex:none}.ant-steps-item:last-child>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after,.ant-steps-item:last-child>.ant-steps-item-container>.ant-steps-item-tail{display:none}.ant-steps-item-content,.ant-steps-item-icon{display:inline-block;vertical-align:top}.ant-steps-item-icon{border:1px solid rgba(0,0,0,.25);border-radius:32px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:16px;height:32px;line-height:32px;margin:0 8px 0 0;text-align:center;transition:background-color .3s,border-color .3s;width:32px}.ant-steps-item-icon .ant-steps-icon{color:#1890ff;line-height:1;position:relative;top:-.5px}.ant-steps-item-tail{left:0;padding:0 10px;position:absolute;top:12px;width:100%}.ant-steps-item-tail:after{background:#f0f0f0;border-radius:1px;content:"";display:inline-block;height:1px;transition:background .3s;width:100%}.ant-steps-item-title{color:rgba(0,0,0,.85);display:inline-block;font-size:16px;line-height:32px;padding-right:16px;position:relative}.ant-steps-item-title:after{background:#f0f0f0;content:"";display:block;height:1px;left:100%;position:absolute;top:16px;width:9999px}.ant-steps-item-subtitle{display:inline;font-weight:400;margin-left:8px}.ant-steps-item-description,.ant-steps-item-subtitle{color:rgba(0,0,0,.45);font-size:14px}.ant-steps-item-wait .ant-steps-item-icon{background-color:#fff;border-color:rgba(0,0,0,.25)}.ant-steps-item-wait .ant-steps-item-icon>.ant-steps-icon{color:rgba(0,0,0,.25)}.ant-steps-item-wait .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:rgba(0,0,0,.25)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:rgba(0,0,0,.45)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#f0f0f0}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:rgba(0,0,0,.45)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#f0f0f0}.ant-steps-item-process .ant-steps-item-icon{background-color:#fff;border-color:#1890ff}.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon{color:#1890ff}.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#1890ff}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:rgba(0,0,0,.85)}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#f0f0f0}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:rgba(0,0,0,.85)}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#f0f0f0}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-icon{background:#1890ff}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-icon .ant-steps-icon{color:#fff}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-title{font-weight:500}.ant-steps-item-finish .ant-steps-item-icon{background-color:#fff;border-color:#1890ff}.ant-steps-item-finish .ant-steps-item-icon>.ant-steps-icon{color:#1890ff}.ant-steps-item-finish .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#1890ff}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:rgba(0,0,0,.85)}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#1890ff}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:rgba(0,0,0,.45)}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#1890ff}.ant-steps-item-error .ant-steps-item-icon{background-color:#fff;border-color:#ff4d4f}.ant-steps-item-error .ant-steps-item-icon>.ant-steps-icon{color:#ff4d4f}.ant-steps-item-error .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#ff4d4f}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:#ff4d4f}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#f0f0f0}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:#ff4d4f}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#f0f0f0}.ant-steps-item.ant-steps-next-error .ant-steps-item-title:after{background:#ff4d4f}.ant-steps-item-disabled{cursor:not-allowed}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]{cursor:pointer}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-description,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-icon .ant-steps-icon,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-subtitle,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-title{transition:color .3s}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-description,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-subtitle,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-title{color:#1890ff}.ant-steps .ant-steps-item:not(.ant-steps-item-active):not(.ant-steps-item-process)>.ant-steps-item-container[role=button]:hover .ant-steps-item-icon{border-color:#1890ff}.ant-steps .ant-steps-item:not(.ant-steps-item-active):not(.ant-steps-item-process)>.ant-steps-item-container[role=button]:hover .ant-steps-item-icon .ant-steps-icon{color:#1890ff}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:16px;white-space:nowrap}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-left:0}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child .ant-steps-item-title{padding-right:0}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item-tail{display:none}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item-description{max-width:140px;white-space:normal}.ant-steps-item-custom>.ant-steps-item-container>.ant-steps-item-icon{background:none;border:0;height:auto}.ant-steps-item-custom>.ant-steps-item-container>.ant-steps-item-icon>.ant-steps-icon{font-size:24px;height:32px;left:.5px;line-height:32px;top:0;width:32px}.ant-steps-item-custom.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon{color:#1890ff}.ant-steps:not(.ant-steps-vertical) .ant-steps-item-custom .ant-steps-item-icon{background:none;width:auto}.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:12px}.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-left:0}.ant-steps-small .ant-steps-item-icon{border-radius:24px;font-size:12px;height:24px;line-height:24px;margin:0 8px 0 0;text-align:center;width:24px}.ant-steps-small .ant-steps-item-title{font-size:14px;line-height:24px;padding-right:12px}.ant-steps-small .ant-steps-item-title:after{top:12px}.ant-steps-small .ant-steps-item-description{color:rgba(0,0,0,.45);font-size:14px}.ant-steps-small .ant-steps-item-tail{top:8px}.ant-steps-small .ant-steps-item-custom .ant-steps-item-icon{background:none;border:0;border-radius:0;height:inherit;line-height:inherit;width:inherit}.ant-steps-small .ant-steps-item-custom .ant-steps-item-icon>.ant-steps-icon{font-size:24px;line-height:24px;transform:none}.ant-steps-vertical{display:flex;flex-direction:column}.ant-steps-vertical>.ant-steps-item{display:block;flex:1 0 auto;overflow:visible;padding-left:0}.ant-steps-vertical>.ant-steps-item .ant-steps-item-icon{float:left;margin-right:16px}.ant-steps-vertical>.ant-steps-item .ant-steps-item-content{display:block;min-height:48px;overflow:hidden}.ant-steps-vertical>.ant-steps-item .ant-steps-item-title{line-height:32px}.ant-steps-vertical>.ant-steps-item .ant-steps-item-description{padding-bottom:12px}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{height:100%;left:16px;padding:38px 0 6px;position:absolute;top:0;width:1px}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail:after{height:100%;width:1px}.ant-steps-vertical>.ant-steps-item:not(:last-child)>.ant-steps-item-container>.ant-steps-item-tail{display:block}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{display:none}.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{left:12px;padding:30px 0 6px;position:absolute;top:0}.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-title{line-height:24px}.ant-steps-label-vertical .ant-steps-item{overflow:visible}.ant-steps-label-vertical .ant-steps-item-tail{margin-left:58px;padding:3.5px 24px}.ant-steps-label-vertical .ant-steps-item-content{display:block;margin-top:8px;text-align:center;width:116px}.ant-steps-label-vertical .ant-steps-item-icon{display:inline-block;margin-left:42px}.ant-steps-label-vertical .ant-steps-item-title{padding-left:0;padding-right:0}.ant-steps-label-vertical .ant-steps-item-title:after{display:none}.ant-steps-label-vertical .ant-steps-item-subtitle{display:block;line-height:1.5715;margin-bottom:4px;margin-left:0}.ant-steps-label-vertical.ant-steps-small:not(.ant-steps-dot) .ant-steps-item-icon{margin-left:46px}.ant-steps-dot .ant-steps-item-title,.ant-steps-dot.ant-steps-small .ant-steps-item-title{line-height:1.5715}.ant-steps-dot .ant-steps-item-tail,.ant-steps-dot.ant-steps-small .ant-steps-item-tail{margin:0 0 0 70px;padding:0;top:2px;width:100%}.ant-steps-dot .ant-steps-item-tail:after,.ant-steps-dot.ant-steps-small .ant-steps-item-tail:after{height:3px;margin-left:12px;width:calc(100% - 20px)}.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item:first-child .ant-steps-icon-dot{left:2px}.ant-steps-dot .ant-steps-item-icon,.ant-steps-dot.ant-steps-small .ant-steps-item-icon{background:transparent;border:0;height:8px;line-height:8px;margin-left:67px;padding-right:0;width:8px}.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot{border-radius:100px;float:left;height:100%;position:relative;transition:all .3s;width:100%}.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot:after,.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot:after{background:rgba(0,0,0,.001);content:"";height:32px;left:-26px;position:absolute;top:-12px;width:60px}.ant-steps-dot .ant-steps-item-content,.ant-steps-dot.ant-steps-small .ant-steps-item-content{width:140px}.ant-steps-dot .ant-steps-item-process .ant-steps-item-icon,.ant-steps-dot.ant-steps-small .ant-steps-item-process .ant-steps-item-icon{background:none;height:10px;line-height:10px;position:relative;top:-1px;width:10px}.ant-steps-dot .ant-steps-item-process .ant-steps-icon:first-child .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item-process .ant-steps-icon:first-child .ant-steps-icon-dot{left:0}.ant-steps-vertical.ant-steps-dot .ant-steps-item-icon{background:none;margin-left:0;margin-top:13px}.ant-steps-vertical.ant-steps-dot .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{left:-9px;margin:0;padding:22px 0 4px;top:6.5px}.ant-steps-vertical.ant-steps-dot.ant-steps-small .ant-steps-item-icon{margin-top:10px}.ant-steps-vertical.ant-steps-dot.ant-steps-small .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{top:3.5px}.ant-steps-vertical.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot{left:0}.ant-steps-vertical.ant-steps-dot .ant-steps-item-content{width:inherit}.ant-steps-vertical.ant-steps-dot .ant-steps-item-process .ant-steps-item-container .ant-steps-item-icon .ant-steps-icon-dot{left:-1px;top:-1px}.ant-steps-navigation{padding-top:12px}.ant-steps-navigation.ant-steps-small .ant-steps-item-container{margin-left:-12px}.ant-steps-navigation .ant-steps-item{overflow:visible;text-align:center}.ant-steps-navigation .ant-steps-item-container{display:inline-block;height:100%;margin-left:-16px;padding-bottom:12px;text-align:left;transition:opacity .3s}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-content{max-width:auto}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title{max-width:100%;overflow:hidden;padding-right:0;text-overflow:ellipsis;white-space:nowrap}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title:after{display:none}.ant-steps-navigation .ant-steps-item:not(.ant-steps-item-active) .ant-steps-item-container[role=button]{cursor:pointer}.ant-steps-navigation .ant-steps-item:not(.ant-steps-item-active) .ant-steps-item-container[role=button]:hover{opacity:.85}.ant-steps-navigation .ant-steps-item:last-child{flex:1}.ant-steps-navigation .ant-steps-item:last-child:after{display:none}.ant-steps-navigation .ant-steps-item:after{border:1px solid rgba(0,0,0,.25);border-bottom:none;border-left:none;content:"";display:inline-block;height:12px;left:100%;margin-left:-2px;margin-top:-14px;position:absolute;top:50%;transform:rotate(45deg);width:12px}.ant-steps-navigation .ant-steps-item:before{background-color:#1890ff;bottom:0;content:"";display:inline-block;height:2px;left:50%;position:absolute;transition:width .3s,left .3s;transition-timing-function:ease-out;width:0}.ant-steps-navigation .ant-steps-item.ant-steps-item-active:before{left:0;width:100%}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item{margin-right:0!important}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item:before{display:none}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item.ant-steps-item-active:before{display:block;height:calc(100% - 24px);left:unset;right:0;top:0;width:3px}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item:after{display:block;height:8px;left:50%;margin-bottom:8px;position:relative;text-align:center;top:-2px;transform:rotate(135deg);width:8px}.ant-steps-navigation.ant-steps-horizontal>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail,.ant-steps-navigation.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{visibility:hidden}.ant-steps-rtl{direction:rtl}.ant-steps.ant-steps-rtl .ant-steps-item-icon{margin-left:8px;margin-right:0}.ant-steps-rtl .ant-steps-item-tail{left:auto;right:0}.ant-steps-rtl .ant-steps-item-title{padding-left:16px;padding-right:0}.ant-steps-rtl .ant-steps-item-title .ant-steps-item-subtitle{float:left;margin-left:0;margin-right:8px}.ant-steps-rtl .ant-steps-item-title:after{left:auto;right:100%}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:0;padding-right:16px}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-right:0}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child .ant-steps-item-title{padding-left:0}.ant-steps-rtl .ant-steps-item-custom .ant-steps-item-icon>.ant-steps-icon{left:auto;right:.5px}.ant-steps-rtl.ant-steps-navigation.ant-steps-small .ant-steps-item-container{margin-left:0;margin-right:-12px}.ant-steps-rtl.ant-steps-navigation .ant-steps-item-container{margin-left:0;margin-right:-16px;text-align:right}.ant-steps-rtl.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title{padding-left:0}.ant-steps-rtl.ant-steps-navigation .ant-steps-item:after{left:auto;margin-left:0;margin-right:-2px;right:100%;transform:rotate(225deg)}.ant-steps-rtl.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:0;padding-right:12px}.ant-steps-rtl.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-right:0}.ant-steps-rtl.ant-steps-small .ant-steps-item-title{padding-left:12px;padding-right:0}.ant-steps-rtl.ant-steps-vertical>.ant-steps-item .ant-steps-item-icon{float:right;margin-left:16px;margin-right:0}.ant-steps-rtl.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{left:auto;right:16px}.ant-steps-rtl.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{left:auto;right:12px}.ant-steps-rtl.ant-steps-label-vertical .ant-steps-item-title{padding-left:0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-tail,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-tail{margin:0 70px 0 0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-tail:after,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-tail:after{margin-left:0;margin-right:12px}.ant-steps-rtl.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item:first-child .ant-steps-icon-dot{left:auto;right:2px}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon{margin-left:0;margin-right:67px}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot{float:right}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot:after,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot:after{left:auto;right:-26px}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item-icon{margin-left:16px;margin-right:0}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{left:auto;right:-9px}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot{left:auto;right:0}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item-process .ant-steps-icon-dot{left:auto;right:-2px}.ant-steps-rtl.ant-steps-with-progress.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item:first-child{padding-left:0;padding-right:4px}.ant-steps-rtl.ant-steps-with-progress.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item:first-child.ant-steps-item-active{padding-right:4px}.ant-steps-with-progress .ant-steps-item{padding-top:4px}.ant-steps-with-progress .ant-steps-item .ant-steps-item-tail{top:4px!important}.ant-steps-with-progress.ant-steps-horizontal .ant-steps-item:first-child{padding-bottom:4px;padding-left:4px}.ant-steps-with-progress .ant-steps-item-icon{position:relative}.ant-steps-with-progress .ant-steps-item-icon .ant-progress{bottom:-5px;left:-5px;position:absolute;right:-5px;top:-5px}.ant-switch{font-feature-settings:"tnum";background-image:linear-gradient(90deg,rgba(0,0,0,.25),rgba(0,0,0,.25)),linear-gradient(90deg,#fff,#fff);border:0;border-radius:100px;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;font-variant:tabular-nums;height:22px;line-height:1.5715;line-height:22px;list-style:none;margin:0;min-width:44px;padding:0;position:relative;transition:all .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle}.ant-switch:focus{box-shadow:0 0 0 2px rgba(0,0,0,.1);outline:0}.ant-switch-checked:focus{box-shadow:0 0 0 2px #e6f7ff}.ant-switch:focus:hover{box-shadow:none}.ant-switch-checked{background:#1890ff}.ant-switch-disabled,.ant-switch-loading{cursor:not-allowed;opacity:.4}.ant-switch-disabled *,.ant-switch-loading *{box-shadow:none;cursor:not-allowed}.ant-switch-inner{color:#fff;display:block;font-size:12px;margin:0 7px 0 25px;transition:margin .2s}.ant-switch-checked .ant-switch-inner{margin:0 25px 0 7px}.ant-switch-handle{height:18px;left:2px;top:2px;width:18px}.ant-switch-handle,.ant-switch-handle:before{position:absolute;transition:all .2s ease-in-out}.ant-switch-handle:before{background-color:#fff;border-radius:9px;bottom:0;box-shadow:0 2px 4px 0 rgba(0,35,11,.2);content:"";left:0;right:0;top:0}.ant-switch-checked .ant-switch-handle{left:calc(100% - 20px)}.ant-switch:not(.ant-switch-disabled):active .ant-switch-handle:before{left:0;right:-30%}.ant-switch:not(.ant-switch-disabled):active.ant-switch-checked .ant-switch-handle:before{left:-30%;right:0}.ant-switch-loading-icon.anticon{color:rgba(0,0,0,.65);position:relative;top:2px;vertical-align:top}.ant-switch-checked .ant-switch-loading-icon{color:#1890ff}.ant-switch-small{height:16px;line-height:16px;min-width:28px}.ant-switch-small .ant-switch-inner{font-size:12px;margin:0 5px 0 18px}.ant-switch-small .ant-switch-handle{height:12px;width:12px}.ant-switch-small .ant-switch-loading-icon{font-size:9px;top:1.5px}.ant-switch-small.ant-switch-checked .ant-switch-inner{margin:0 18px 0 5px}.ant-switch-small.ant-switch-checked .ant-switch-handle{left:calc(100% - 14px)}.ant-switch-rtl{direction:rtl}.ant-switch-rtl .ant-switch-inner{margin:0 25px 0 7px}.ant-switch-rtl .ant-switch-handle{left:auto;right:2px}.ant-switch-rtl:not(.ant-switch-rtl-disabled):active .ant-switch-handle:before{left:-30%;right:0}.ant-switch-rtl:not(.ant-switch-rtl-disabled):active.ant-switch-checked .ant-switch-handle:before{left:0;right:-30%}.ant-switch-rtl.ant-switch-checked .ant-switch-inner{margin:0 7px 0 25px}.ant-switch-rtl.ant-switch-checked .ant-switch-handle{right:calc(100% - 20px)}.ant-switch-rtl.ant-switch-small.ant-switch-checked .ant-switch-handle{right:calc(100% - 14px)}.ant-table.ant-table-middle{font-size:14px}.ant-table.ant-table-middle .ant-table-footer,.ant-table.ant-table-middle .ant-table-tbody>tr>td,.ant-table.ant-table-middle .ant-table-thead>tr>th,.ant-table.ant-table-middle .ant-table-title,.ant-table.ant-table-middle tfoot>tr>td,.ant-table.ant-table-middle tfoot>tr>th{padding:12px 8px}.ant-table.ant-table-middle .ant-table-filter-trigger{margin-right:-4px}.ant-table.ant-table-middle .ant-table-expanded-row-fixed{margin:-12px -8px}.ant-table.ant-table-middle .ant-table-tbody .ant-table-wrapper:only-child .ant-table{margin:-12px -8px -12px 40px}.ant-table.ant-table-middle .ant-table-selection-column{-webkit-padding-start:2px;padding-inline-start:2px}.ant-table.ant-table-small{font-size:14px}.ant-table.ant-table-small .ant-table-footer,.ant-table.ant-table-small .ant-table-tbody>tr>td,.ant-table.ant-table-small .ant-table-thead>tr>th,.ant-table.ant-table-small .ant-table-title,.ant-table.ant-table-small tfoot>tr>td,.ant-table.ant-table-small tfoot>tr>th{padding:8px}.ant-table.ant-table-small .ant-table-filter-trigger{margin-right:-4px}.ant-table.ant-table-small .ant-table-expanded-row-fixed{margin:-8px}.ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table{margin:-8px -8px -8px 40px}.ant-table.ant-table-small .ant-table-selection-column{-webkit-padding-start:2px;padding-inline-start:2px}.ant-table.ant-table-bordered>.ant-table-title{border:1px solid #f0f0f0;border-bottom:0}.ant-table.ant-table-bordered>.ant-table-container{border-left:1px solid #f0f0f0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>thead>tr>th{border-right:1px solid #f0f0f0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr:not(:last-child)>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr:not(:last-child)>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr:not(:last-child)>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>thead>tr:not(:last-child)>th{border-bottom:1px solid #f0f0f0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr>th:before,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>th:before,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr>th:before,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>thead>tr>th:before{background-color:transparent!important}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>thead>tr>.ant-table-cell-fix-right-first:after{border-right:1px solid #f0f0f0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tbody>tr>td>.ant-table-expanded-row-fixed{margin:-16px -17px}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>td>.ant-table-expanded-row-fixed:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tbody>tr>td>.ant-table-expanded-row-fixed:after{border-right:1px solid #f0f0f0;bottom:0;content:"";position:absolute;right:1px;top:0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table{border-top:1px solid #f0f0f0}.ant-table.ant-table-bordered.ant-table-scroll-horizontal>.ant-table-container>.ant-table-body>table>tbody>tr.ant-table-expanded-row>td,.ant-table.ant-table-bordered.ant-table-scroll-horizontal>.ant-table-container>.ant-table-body>table>tbody>tr.ant-table-placeholder>td{border-right:0}.ant-table.ant-table-bordered.ant-table-middle>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered.ant-table-middle>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed{margin:-12px -9px}.ant-table.ant-table-bordered.ant-table-small>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered.ant-table-small>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed{margin:-8px -9px}.ant-table.ant-table-bordered>.ant-table-footer{border:1px solid #f0f0f0;border-top:0}.ant-table-cell .ant-table-container:first-child{border-top:0}.ant-table-cell-scrollbar:not([rowspan]){box-shadow:0 1px 0 1px #fafafa}.ant-table-wrapper{clear:both;max-width:100%}.ant-table-wrapper:before{content:"";display:table}.ant-table-wrapper:after{clear:both;content:"";display:table}.ant-table{font-feature-settings:"tnum";background:#fff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-table table{border-collapse:separate;border-radius:2px 2px 0 0;border-spacing:0;text-align:left;width:100%}.ant-table tfoot>tr>td,.ant-table tfoot>tr>th,.ant-table-tbody>tr>td,.ant-table-thead>tr>th{overflow-wrap:break-word;padding:16px;position:relative}.ant-table-cell-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all}.ant-table-cell-ellipsis.ant-table-cell-fix-left-last,.ant-table-cell-ellipsis.ant-table-cell-fix-right-first{overflow:visible}.ant-table-cell-ellipsis.ant-table-cell-fix-left-last .ant-table-cell-content,.ant-table-cell-ellipsis.ant-table-cell-fix-right-first .ant-table-cell-content{display:block;overflow:hidden;text-overflow:ellipsis}.ant-table-cell-ellipsis .ant-table-column-title{overflow:hidden;text-overflow:ellipsis;word-break:keep-all}.ant-table-title{padding:16px}.ant-table-footer{background:#fafafa;color:rgba(0,0,0,.85);padding:16px}.ant-table-thead>tr>th{background:#fafafa;border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.85);font-weight:500;position:relative;text-align:left;transition:background .3s ease}.ant-table-thead>tr>th[colspan]:not([colspan="1"]){text-align:center}.ant-table-thead>tr>th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]):before{background-color:rgba(0,0,0,.06);content:"";height:1.6em;position:absolute;right:0;top:50%;transform:translateY(-50%);transition:background-color .3s;width:1px}.ant-table-thead>tr:not(:last-child)>th[colspan]{border-bottom:0}.ant-table-tbody>tr>td{border-bottom:1px solid #f0f0f0;transition:background .3s}.ant-table-tbody>tr>td>.ant-table-expanded-row-fixed>.ant-table-wrapper:only-child .ant-table,.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table{margin:-16px -16px -16px 32px}.ant-table-tbody>tr>td>.ant-table-expanded-row-fixed>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td,.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td{border-bottom:0}.ant-table-tbody>tr>td>.ant-table-expanded-row-fixed>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:first-child,.ant-table-tbody>tr>td>.ant-table-expanded-row-fixed>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:last-child,.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:first-child,.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:last-child{border-radius:0}.ant-table-tbody>tr.ant-table-row:hover>td,.ant-table-tbody>tr>td.ant-table-cell-row-hover{background:#fafafa}.ant-table-tbody>tr.ant-table-row-selected>td{background:#e6f7ff;border-color:rgba(0,0,0,.03)}.ant-table-tbody>tr.ant-table-row-selected:hover>td{background:#dcf4ff}.ant-table-summary{background:#fff;position:relative;z-index:2}div.ant-table-summary{box-shadow:0 -1px 0 #f0f0f0}.ant-table-summary>tr>td,.ant-table-summary>tr>th{border-bottom:1px solid #f0f0f0}.ant-table-pagination.ant-pagination{margin:16px 0}.ant-table-pagination{display:flex;flex-wrap:wrap;row-gap:8px}.ant-table-pagination>*{flex:none}.ant-table-pagination-left{justify-content:flex-start}.ant-table-pagination-center{justify-content:center}.ant-table-pagination-right{justify-content:flex-end}.ant-table-thead th.ant-table-column-has-sorters{cursor:pointer;outline:none;transition:all .3s}.ant-table-thead th.ant-table-column-has-sorters:hover{background:rgba(0,0,0,.04)}.ant-table-thead th.ant-table-column-has-sorters:hover:before{background-color:transparent!important}.ant-table-thead th.ant-table-column-has-sorters:focus-visible{color:#1890ff}.ant-table-thead th.ant-table-column-has-sorters.ant-table-cell-fix-left:hover,.ant-table-thead th.ant-table-column-has-sorters.ant-table-cell-fix-right:hover,.ant-table-thead th.ant-table-column-sort{background:#f5f5f5}.ant-table-thead th.ant-table-column-sort:before{background-color:transparent!important}td.ant-table-column-sort{background:#fafafa}.ant-table-column-title{flex:1;position:relative;z-index:1}.ant-table-column-sorters{align-items:center;display:flex;flex:auto;justify-content:space-between}.ant-table-column-sorters:after{bottom:0;content:"";height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ant-table-column-sorter{color:#bfbfbf;font-size:0;margin-left:4px;transition:color .3s}.ant-table-column-sorter-inner{align-items:center;display:inline-flex;flex-direction:column}.ant-table-column-sorter-down,.ant-table-column-sorter-up{font-size:11px}.ant-table-column-sorter-down.active,.ant-table-column-sorter-up.active{color:#1890ff}.ant-table-column-sorter-up+.ant-table-column-sorter-down{margin-top:-.3em}.ant-table-column-sorters:hover .ant-table-column-sorter{color:#a6a6a6}.ant-table-filter-column{display:flex;justify-content:space-between}.ant-table-filter-trigger{align-items:center;border-radius:2px;color:#bfbfbf;cursor:pointer;display:flex;font-size:12px;margin:-4px -8px -4px 4px;padding:0 4px;position:relative;transition:all .3s}.ant-table-filter-trigger:hover{background:rgba(0,0,0,.04);color:rgba(0,0,0,.45)}.ant-table-filter-trigger.active{color:#1890ff}.ant-table-filter-dropdown{font-feature-settings:"tnum";background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;min-width:120px;padding:0}.ant-table-filter-dropdown .ant-dropdown-menu{border:0;box-shadow:none;max-height:264px;overflow-x:hidden}.ant-table-filter-dropdown .ant-dropdown-menu:empty:after{color:rgba(0,0,0,.25);content:"Not Found";display:block;font-size:12px;padding:8px 0;text-align:center}.ant-table-filter-dropdown-tree{padding:8px 8px 0}.ant-table-filter-dropdown-tree .ant-tree-treenode .ant-tree-node-content-wrapper:hover{background-color:#f5f5f5}.ant-table-filter-dropdown-tree .ant-tree-treenode-checkbox-checked .ant-tree-node-content-wrapper,.ant-table-filter-dropdown-tree .ant-tree-treenode-checkbox-checked .ant-tree-node-content-wrapper:hover{background-color:#bae7ff}.ant-table-filter-dropdown-search{border-bottom:1px solid #f0f0f0;padding:8px}.ant-table-filter-dropdown-search-input input{min-width:140px}.ant-table-filter-dropdown-search-input .anticon{color:rgba(0,0,0,.25)}.ant-table-filter-dropdown-checkall{margin-bottom:4px;margin-left:4px;width:100%}.ant-table-filter-dropdown-submenu>ul{max-height:calc(100vh - 130px);overflow-x:hidden;overflow-y:auto}.ant-table-filter-dropdown .ant-checkbox-wrapper+span,.ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span{padding-left:8px}.ant-table-filter-dropdown-btns{background-color:inherit;border-top:1px solid #f0f0f0;display:flex;justify-content:space-between;overflow:hidden;padding:7px 8px}.ant-table-selection-col{width:32px}.ant-table-bordered .ant-table-selection-col{width:50px}table tr td.ant-table-selection-column,table tr th.ant-table-selection-column{padding-left:8px;padding-right:8px;text-align:center}table tr td.ant-table-selection-column .ant-radio-wrapper,table tr th.ant-table-selection-column .ant-radio-wrapper{margin-right:0}table tr th.ant-table-selection-column.ant-table-cell-fix-left{z-index:3}table tr th.ant-table-selection-column:after{background-color:transparent!important}.ant-table-selection{display:inline-flex;flex-direction:column;position:relative}.ant-table-selection-extra{-webkit-margin-start:100%;-webkit-padding-start:4px;cursor:pointer;margin-inline-start:100%;padding-inline-start:4px;position:absolute;top:0;transition:all .3s;z-index:1}.ant-table-selection-extra .anticon{color:#bfbfbf;font-size:10px}.ant-table-selection-extra .anticon:hover{color:#a6a6a6}.ant-table-expand-icon-col{width:48px}.ant-table-row-expand-icon-cell{text-align:center}.ant-table-row-indent{float:left;height:1px}.ant-table-row-expand-icon{background:#fff;border:1px solid #f0f0f0;border-radius:2px;box-sizing:border-box;color:#1890ff;color:inherit;cursor:pointer;display:inline-flex;height:17px;line-height:17px;outline:none;padding:0;position:relative;text-decoration:none;transform:scale(.94117647);transition:color .3s;transition:all .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:-3px;width:17px}.ant-table-row-expand-icon:focus,.ant-table-row-expand-icon:hover{color:#40a9ff}.ant-table-row-expand-icon:active{color:#096dd9}.ant-table-row-expand-icon:active,.ant-table-row-expand-icon:focus,.ant-table-row-expand-icon:hover{border-color:currentcolor}.ant-table-row-expand-icon:after,.ant-table-row-expand-icon:before{background:currentcolor;content:"";position:absolute;transition:transform .3s ease-out}.ant-table-row-expand-icon:before{height:1px;left:3px;right:3px;top:7px}.ant-table-row-expand-icon:after{bottom:3px;left:7px;top:3px;transform:rotate(90deg);width:1px}.ant-table-row-expand-icon-collapsed:before{transform:rotate(-180deg)}.ant-table-row-expand-icon-collapsed:after{transform:rotate(0deg)}.ant-table-row-expand-icon-spaced{background:transparent;border:0;visibility:hidden}.ant-table-row-expand-icon-spaced:after,.ant-table-row-expand-icon-spaced:before{content:none;display:none}.ant-table-row-indent+.ant-table-row-expand-icon{margin-right:8px;margin-top:2.5005px}tr.ant-table-expanded-row:hover>td,tr.ant-table-expanded-row>td{background:#fbfbfb}tr.ant-table-expanded-row .ant-descriptions-view{display:flex}tr.ant-table-expanded-row .ant-descriptions-view table{flex:auto;width:auto}.ant-table .ant-table-expanded-row-fixed{margin:-16px;padding:16px;position:relative}.ant-table-tbody>tr.ant-table-placeholder{text-align:center}.ant-table-empty .ant-table-tbody>tr.ant-table-placeholder{color:rgba(0,0,0,.25)}.ant-table-tbody>tr.ant-table-placeholder:hover>td{background:#fff}.ant-table-cell-fix-left,.ant-table-cell-fix-right{background:#fff;position:-webkit-sticky!important;position:sticky!important;z-index:2}.ant-table-cell-fix-left-first:after,.ant-table-cell-fix-left-last:after{bottom:-1px;content:"";pointer-events:none;position:absolute;right:0;top:0;transform:translateX(100%);transition:box-shadow .3s;width:30px}.ant-table-cell-fix-right-first:after,.ant-table-cell-fix-right-last:after{bottom:-1px;content:"";left:0;pointer-events:none;position:absolute;top:0;transform:translateX(-100%);transition:box-shadow .3s;width:30px}.ant-table .ant-table-container:after,.ant-table .ant-table-container:before{bottom:0;content:"";pointer-events:none;position:absolute;top:0;transition:box-shadow .3s;width:30px;z-index:2}.ant-table .ant-table-container:before{left:0}.ant-table .ant-table-container:after{right:0}.ant-table-ping-left:not(.ant-table-has-fix-left)>.ant-table-container{position:relative}.ant-table-ping-left .ant-table-cell-fix-left-first:after,.ant-table-ping-left .ant-table-cell-fix-left-last:after,.ant-table-ping-left:not(.ant-table-has-fix-left)>.ant-table-container:before{box-shadow:inset 10px 0 8px -8px rgba(0,0,0,.15)}.ant-table-ping-left .ant-table-cell-fix-left-last:before{background-color:transparent!important}.ant-table-ping-right:not(.ant-table-has-fix-right)>.ant-table-container{position:relative}.ant-table-ping-right .ant-table-cell-fix-right-first:after,.ant-table-ping-right .ant-table-cell-fix-right-last:after,.ant-table-ping-right:not(.ant-table-has-fix-right)>.ant-table-container:after{box-shadow:inset -10px 0 8px -8px rgba(0,0,0,.15)}.ant-table-sticky-holder,.ant-table-sticky-scroll{background:#fff;position:-webkit-sticky;position:sticky;z-index:3}.ant-table-sticky-scroll{align-items:center;border-top:1px solid #f0f0f0;bottom:0;display:flex;opacity:.6}.ant-table-sticky-scroll:hover{transform-origin:center bottom}.ant-table-sticky-scroll-bar{background-color:rgba(0,0,0,.35);border-radius:4px;height:8px}.ant-table-sticky-scroll-bar-active,.ant-table-sticky-scroll-bar:hover{background-color:rgba(0,0,0,.8)}@media(-ms-high-contrast:none){.ant-table-ping-left .ant-table-cell-fix-left-last:after,.ant-table-ping-right .ant-table-cell-fix-right-first:after{box-shadow:none!important}}.ant-table-title{border-radius:2px 2px 0 0}.ant-table-title+.ant-table-container{border-top-left-radius:0;border-top-right-radius:0}.ant-table-title+.ant-table-container table,.ant-table-title+.ant-table-container table>thead>tr:first-child th:first-child,.ant-table-title+.ant-table-container table>thead>tr:first-child th:last-child{border-radius:0}.ant-table-container{border-top-right-radius:2px}.ant-table-container,.ant-table-container table>thead>tr:first-child th:first-child{border-top-left-radius:2px}.ant-table-container table>thead>tr:first-child th:last-child{border-top-right-radius:2px}.ant-table-footer{border-radius:0 0 2px 2px}.ant-table-rtl,.ant-table-wrapper-rtl{direction:rtl}.ant-table-wrapper-rtl .ant-table table{text-align:right}.ant-table-wrapper-rtl .ant-table-thead>tr>th[colspan]:not([colspan="1"]){text-align:center}.ant-table-wrapper-rtl .ant-table-thead>tr>th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]):before{left:0;right:auto}.ant-table-wrapper-rtl .ant-table-thead>tr>th{text-align:right}.ant-table-tbody>tr .ant-table-wrapper:only-child .ant-table.ant-table-rtl{margin:-16px 33px -16px -16px}.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination-left{justify-content:flex-end}.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination-right{justify-content:flex-start}.ant-table-wrapper-rtl .ant-table-column-sorter{margin-left:0;margin-right:4px}.ant-table-wrapper-rtl .ant-table-filter-column-title{padding:16px 16px 16px 2.3em}.ant-table-rtl .ant-table-thead tr th.ant-table-column-has-sorters .ant-table-filter-column-title{padding:0 0 0 2.3em}.ant-table-wrapper-rtl .ant-table-filter-trigger{margin:-4px 4px -4px -8px}.ant-dropdown-menu-submenu-rtl.ant-table-filter-dropdown .ant-checkbox-wrapper+span,.ant-dropdown-menu-submenu-rtl.ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span,.ant-dropdown-rtl .ant-table-filter-dropdown .ant-checkbox-wrapper+span,.ant-dropdown-rtl .ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span{padding-left:0;padding-right:8px}.ant-table-wrapper-rtl .ant-table-selection{text-align:center}.ant-table-wrapper-rtl .ant-table-row-expand-icon,.ant-table-wrapper-rtl .ant-table-row-indent{float:right}.ant-table-wrapper-rtl .ant-table-row-indent+.ant-table-row-expand-icon{margin-left:8px;margin-right:0}.ant-table-wrapper-rtl .ant-table-row-expand-icon:after{transform:rotate(-90deg)}.ant-table-wrapper-rtl .ant-table-row-expand-icon-collapsed:before{transform:rotate(180deg)}.ant-table-wrapper-rtl .ant-table-row-expand-icon-collapsed:after{transform:rotate(0deg)}.ant-tabs-small>.ant-tabs-nav .ant-tabs-tab{font-size:14px;padding:8px 0}.ant-tabs-large>.ant-tabs-nav .ant-tabs-tab{font-size:16px;padding:16px 0}.ant-tabs-card.ant-tabs-small>.ant-tabs-nav .ant-tabs-tab{padding:6px 16px}.ant-tabs-card.ant-tabs-large>.ant-tabs-nav .ant-tabs-tab{padding:7px 16px 6px}.ant-tabs-rtl{direction:rtl}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab{margin:0 0 0 32px}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab:last-of-type{margin-left:0}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .anticon{margin-left:12px;margin-right:0}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove{margin-left:-4px;margin-right:8px}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove .anticon{margin:0}.ant-tabs-rtl.ant-tabs-left>.ant-tabs-nav{order:1}.ant-tabs-rtl.ant-tabs-left>.ant-tabs-content-holder,.ant-tabs-rtl.ant-tabs-right>.ant-tabs-nav{order:0}.ant-tabs-rtl.ant-tabs-right>.ant-tabs-content-holder{order:1}.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-left:0;margin-right:2px}.ant-tabs-dropdown-rtl{direction:rtl}.ant-tabs-dropdown-rtl .ant-tabs-dropdown-menu-item{text-align:right}.ant-tabs-bottom,.ant-tabs-top{flex-direction:column}.ant-tabs-bottom>.ant-tabs-nav,.ant-tabs-bottom>div>.ant-tabs-nav,.ant-tabs-top>.ant-tabs-nav,.ant-tabs-top>div>.ant-tabs-nav{margin:0 0 16px}.ant-tabs-bottom>.ant-tabs-nav:before,.ant-tabs-bottom>div>.ant-tabs-nav:before,.ant-tabs-top>.ant-tabs-nav:before,.ant-tabs-top>div>.ant-tabs-nav:before{border-bottom:1px solid #f0f0f0;content:"";left:0;position:absolute;right:0}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-ink-bar{height:2px}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-top>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-ink-bar-animated{transition:width .3s,left .3s,right .3s}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{bottom:0;top:0;width:30px}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{box-shadow:inset 10px 0 8px -8px rgba(0,0,0,.08);left:0}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:after{box-shadow:inset -10px 0 8px -8px rgba(0,0,0,.08);right:0}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after{opacity:1}.ant-tabs-top>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>.ant-tabs-nav:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>div>.ant-tabs-nav:before{bottom:0}.ant-tabs-bottom>.ant-tabs-nav,.ant-tabs-bottom>div>.ant-tabs-nav{margin-bottom:0;margin-top:16px;order:1}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-bottom>.ant-tabs-nav:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-bottom>div>.ant-tabs-nav:before{top:0}.ant-tabs-bottom>.ant-tabs-content-holder,.ant-tabs-bottom>div>.ant-tabs-content-holder{order:0}.ant-tabs-left>.ant-tabs-nav,.ant-tabs-left>div>.ant-tabs-nav,.ant-tabs-right>.ant-tabs-nav,.ant-tabs-right>div>.ant-tabs-nav{flex-direction:column;min-width:50px}.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab{padding:8px 24px;text-align:center}.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin:16px 0 0}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap{flex-direction:column}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{height:30px;left:0;right:0}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{box-shadow:inset 0 10px 8px -8px rgba(0,0,0,.08);top:0}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:after{bottom:0;box-shadow:inset 0 -10px 8px -8px rgba(0,0,0,.08)}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before{opacity:1}.ant-tabs-left>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-right>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-ink-bar{width:2px}.ant-tabs-left>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-right>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-ink-bar-animated{transition:height .3s,top .3s}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-operations{flex:1 0 auto;flex-direction:column}.ant-tabs-left>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-ink-bar{right:0}.ant-tabs-left>.ant-tabs-content-holder,.ant-tabs-left>div>.ant-tabs-content-holder{border-left:1px solid #f0f0f0;margin-left:-1px}.ant-tabs-left>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane,.ant-tabs-left>div>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane{padding-left:24px}.ant-tabs-right>.ant-tabs-nav,.ant-tabs-right>div>.ant-tabs-nav{order:1}.ant-tabs-right>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-ink-bar{left:0}.ant-tabs-right>.ant-tabs-content-holder,.ant-tabs-right>div>.ant-tabs-content-holder{border-right:1px solid #f0f0f0;margin-right:-1px;order:0}.ant-tabs-right>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane,.ant-tabs-right>div>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane{padding-right:24px}.ant-tabs-dropdown{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:block;font-size:14px;font-variant:tabular-nums;left:-9999px;line-height:1.5715;list-style:none;margin:0;padding:0;position:absolute;top:-9999px;z-index:1050}.ant-tabs-dropdown-hidden{display:none}.ant-tabs-dropdown-menu{background-clip:padding-box;background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);list-style-type:none;margin:0;max-height:200px;outline:none;overflow-x:hidden;overflow-y:auto;padding:4px 0;text-align:left}.ant-tabs-dropdown-menu-item{align-items:center;color:rgba(0,0,0,.85);cursor:pointer;display:flex;font-size:14px;font-weight:400;line-height:22px;margin:0;min-width:120px;overflow:hidden;padding:5px 12px;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-tabs-dropdown-menu-item>span{flex:1;white-space:nowrap}.ant-tabs-dropdown-menu-item-remove{background:transparent;border:0;color:rgba(0,0,0,.45);cursor:pointer;flex:none;font-size:12px;margin-left:12px}.ant-tabs-dropdown-menu-item-remove:hover{color:#40a9ff}.ant-tabs-dropdown-menu-item:hover{background:#f5f5f5}.ant-tabs-dropdown-menu-item-disabled,.ant-tabs-dropdown-menu-item-disabled:hover{background:transparent;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tabs-card>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card>div>.ant-tabs-nav .ant-tabs-tab{background:#fafafa;border:1px solid #f0f0f0;margin:0;padding:8px 16px;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-card>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card>div>.ant-tabs-nav .ant-tabs-tab-active{background:#fff;color:#1890ff}.ant-tabs-card>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-card>div>.ant-tabs-nav .ant-tabs-ink-bar{visibility:hidden}.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-left:2px}.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab{border-radius:2px 2px 0 0}.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab-active{border-bottom-color:#fff}.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab{border-radius:0 0 2px 2px}.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab-active{border-top-color:#fff}.ant-tabs-card.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-top:2px}.ant-tabs-card.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab{border-radius:2px 0 0 2px}.ant-tabs-card.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab-active{border-right-color:#fff}.ant-tabs-card.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab{border-radius:0 2px 2px 0}.ant-tabs-card.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab-active{border-left-color:#fff}.ant-tabs{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-tabs>.ant-tabs-nav,.ant-tabs>div>.ant-tabs-nav{align-items:center;display:flex;flex:none;position:relative}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-wrap{-ms-grid-row-align:stretch;align-self:stretch;display:inline-block;display:flex;flex:auto;overflow:hidden;position:relative;transform:translate(0);white-space:nowrap}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{content:"";opacity:0;pointer-events:none;position:absolute;transition:opacity .3s;z-index:1}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-list{display:flex;position:relative;transition:transform .3s}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-operations{-ms-grid-row-align:stretch;align-self:stretch;display:flex}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-operations-hidden,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-operations-hidden{pointer-events:none;position:absolute;visibility:hidden}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-more,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-more{background:transparent;border:0;padding:8px 16px;position:relative}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-more:after,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-more:after{bottom:0;content:"";height:5px;left:0;position:absolute;right:0;transform:translateY(100%)}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add{background:#fafafa;border:1px solid #f0f0f0;border-radius:2px 2px 0 0;cursor:pointer;margin-left:2px;min-width:40px;outline:none;padding:0 8px;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add:hover,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add:hover{color:#40a9ff}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add:active,.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add:focus,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add:active,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add:focus{color:#096dd9}.ant-tabs-extra-content{flex:none}.ant-tabs-centered>.ant-tabs-nav .ant-tabs-nav-wrap:not([class*=ant-tabs-nav-wrap-ping]),.ant-tabs-centered>div>.ant-tabs-nav .ant-tabs-nav-wrap:not([class*=ant-tabs-nav-wrap-ping]){justify-content:center}.ant-tabs-ink-bar{background:#1890ff;pointer-events:none;position:absolute}.ant-tabs-tab{align-items:center;background:transparent;border:0;cursor:pointer;display:inline-flex;font-size:14px;outline:none;padding:12px 0;position:relative}.ant-tabs-tab-btn:active,.ant-tabs-tab-btn:focus,.ant-tabs-tab-remove:active,.ant-tabs-tab-remove:focus{color:#096dd9}.ant-tabs-tab-btn,.ant-tabs-tab-remove{outline:none;transition:all .3s}.ant-tabs-tab-remove{background:transparent;border:none;color:rgba(0,0,0,.45);cursor:pointer;flex:none;font-size:12px;margin-left:8px;margin-right:-4px}.ant-tabs-tab-remove:hover{color:rgba(0,0,0,.85)}.ant-tabs-tab:hover{color:#40a9ff}.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{color:#1890ff;text-shadow:0 0 .25px currentcolor}.ant-tabs-tab.ant-tabs-tab-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-btn:active,.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-btn:focus,.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-remove:active,.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-remove:focus{color:rgba(0,0,0,.25)}.ant-tabs-tab .ant-tabs-tab-remove .anticon{margin:0}.ant-tabs-tab .anticon{margin-right:12px}.ant-tabs-tab+.ant-tabs-tab{margin:0 0 0 32px}.ant-tabs-content{display:flex;width:100%}.ant-tabs-content-holder{flex:auto;min-height:0;min-width:0}.ant-tabs-content-animated{transition:margin .3s}.ant-tabs-tabpane{flex:none;outline:none;width:100%}.ant-tag{font-feature-settings:"tnum";background:#fafafa;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;display:inline-block;font-size:14px;font-size:12px;font-variant:tabular-nums;height:auto;line-height:1.5715;line-height:20px;list-style:none;margin:0 8px 0 0;opacity:1;padding:0 7px;transition:all .3s;white-space:nowrap}.ant-tag,.ant-tag a,.ant-tag a:hover{color:rgba(0,0,0,.85)}.ant-tag>a:first-child:last-child{display:inline-block;margin:0 -8px;padding:0 8px}.ant-tag-close-icon{color:rgba(0,0,0,.45);cursor:pointer;font-size:10px;margin-left:3px;transition:all .3s}.ant-tag-close-icon:hover{color:rgba(0,0,0,.85)}.ant-tag-has-color{border-color:transparent}.ant-tag-has-color,.ant-tag-has-color .anticon-close,.ant-tag-has-color .anticon-close:hover,.ant-tag-has-color a,.ant-tag-has-color a:hover{color:#fff}.ant-tag-checkable{background-color:transparent;border-color:transparent;cursor:pointer}.ant-tag-checkable:not(.ant-tag-checkable-checked):hover{color:#1890ff}.ant-tag-checkable-checked,.ant-tag-checkable:active{color:#fff}.ant-tag-checkable-checked{background-color:#1890ff}.ant-tag-checkable:active{background-color:#096dd9}.ant-tag-hidden{display:none}.ant-tag-pink{background:#fff0f6;border-color:#ffadd2;color:#c41d7f}.ant-tag-pink-inverse{background:#eb2f96;border-color:#eb2f96;color:#fff}.ant-tag-magenta{background:#fff0f6;border-color:#ffadd2;color:#c41d7f}.ant-tag-magenta-inverse{background:#eb2f96;border-color:#eb2f96;color:#fff}.ant-tag-red{background:#fff1f0;border-color:#ffa39e;color:#cf1322}.ant-tag-red-inverse{background:#f5222d;border-color:#f5222d;color:#fff}.ant-tag-volcano{background:#fff2e8;border-color:#ffbb96;color:#d4380d}.ant-tag-volcano-inverse{background:#fa541c;border-color:#fa541c;color:#fff}.ant-tag-orange{background:#fff7e6;border-color:#ffd591;color:#d46b08}.ant-tag-orange-inverse{background:#fa8c16;border-color:#fa8c16;color:#fff}.ant-tag-yellow{background:#feffe6;border-color:#fffb8f;color:#d4b106}.ant-tag-yellow-inverse{background:#fadb14;border-color:#fadb14;color:#fff}.ant-tag-gold{background:#fffbe6;border-color:#ffe58f;color:#d48806}.ant-tag-gold-inverse{background:#faad14;border-color:#faad14;color:#fff}.ant-tag-cyan{background:#e6fffb;border-color:#87e8de;color:#08979c}.ant-tag-cyan-inverse{background:#13c2c2;border-color:#13c2c2;color:#fff}.ant-tag-lime{background:#fcffe6;border-color:#eaff8f;color:#7cb305}.ant-tag-lime-inverse{background:#a0d911;border-color:#a0d911;color:#fff}.ant-tag-green{background:#f6ffed;border-color:#b7eb8f;color:#389e0d}.ant-tag-green-inverse{background:#52c41a;border-color:#52c41a;color:#fff}.ant-tag-blue{background:#e6f7ff;border-color:#91d5ff;color:#096dd9}.ant-tag-blue-inverse{background:#1890ff;border-color:#1890ff;color:#fff}.ant-tag-geekblue{background:#f0f5ff;border-color:#adc6ff;color:#1d39c4}.ant-tag-geekblue-inverse{background:#2f54eb;border-color:#2f54eb;color:#fff}.ant-tag-purple{background:#f9f0ff;border-color:#d3adf7;color:#531dab}.ant-tag-purple-inverse{background:#722ed1;border-color:#722ed1;color:#fff}.ant-tag-success{background:#f6ffed;border-color:#b7eb8f;color:#52c41a}.ant-tag-processing{background:#e6f7ff;border-color:#91d5ff;color:#1890ff}.ant-tag-error{background:#fff2f0;border-color:#ffccc7;color:#ff4d4f}.ant-tag-warning{background:#fffbe6;border-color:#ffe58f;color:#faad14}.ant-tag>.anticon+span,.ant-tag>span+.anticon{margin-left:7px}.ant-tag.ant-tag-rtl{direction:rtl;margin-left:8px;margin-right:0;text-align:right}.ant-tag-rtl .ant-tag-close-icon{margin-left:0;margin-right:3px}.ant-tag-rtl.ant-tag>.anticon+span,.ant-tag-rtl.ant-tag>span+.anticon{margin-left:0;margin-right:7px}.ant-timeline{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-timeline-item{font-size:14px;list-style:none;margin:0;padding-bottom:20px;position:relative}.ant-timeline-item-tail{border-left:2px solid #f0f0f0;height:calc(100% - 10px);left:4px;position:absolute;top:10px}.ant-timeline-item-pending .ant-timeline-item-head{background-color:transparent;font-size:12px}.ant-timeline-item-pending .ant-timeline-item-tail{display:none}.ant-timeline-item-head{background-color:#fff;border:2px solid transparent;border-radius:100px;height:10px;position:absolute;width:10px}.ant-timeline-item-head-blue{border-color:#1890ff;color:#1890ff}.ant-timeline-item-head-red{border-color:#ff4d4f;color:#ff4d4f}.ant-timeline-item-head-green{border-color:#52c41a;color:#52c41a}.ant-timeline-item-head-gray{border-color:rgba(0,0,0,.25);color:rgba(0,0,0,.25)}.ant-timeline-item-head-custom{border:0;border-radius:0;height:auto;left:5px;line-height:1;margin-top:0;padding:3px 1px;position:absolute;text-align:center;top:5.5px;transform:translate(-50%,-50%);width:auto}.ant-timeline-item-content{margin:0 0 0 26px;position:relative;top:-7.001px;word-break:break-word}.ant-timeline-item-last>.ant-timeline-item-tail{display:none}.ant-timeline-item-last>.ant-timeline-item-content{min-height:48px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-alternate .ant-timeline-item-tail,.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-label .ant-timeline-item-tail,.ant-timeline.ant-timeline-right .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-tail{left:50%}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-head{margin-left:-4px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom{margin-left:1px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline.ant-timeline-label .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline.ant-timeline-right .ant-timeline-item-left .ant-timeline-item-content{left:calc(50% - 4px);text-align:left;width:calc(50% - 14px)}.ant-timeline.ant-timeline-alternate .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{margin:0;text-align:right;width:calc(50% - 12px)}.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-tail{left:calc(100% - 6px)}.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{width:calc(100% - 18px)}.ant-timeline.ant-timeline-pending .ant-timeline-item-last .ant-timeline-item-tail{border-left:2px dotted #f0f0f0;display:block;height:calc(100% - 14px)}.ant-timeline.ant-timeline-reverse .ant-timeline-item-last .ant-timeline-item-tail{display:none}.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-tail{border-left:2px dotted #f0f0f0;display:block;height:calc(100% - 15px);top:15px}.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-content{min-height:48px}.ant-timeline.ant-timeline-label .ant-timeline-item-label{position:absolute;text-align:right;top:-7.001px;width:calc(50% - 12px)}.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-label{left:calc(50% + 14px);text-align:left;width:calc(50% - 14px)}.ant-timeline-rtl{direction:rtl}.ant-timeline-rtl .ant-timeline-item-tail{border-left:none;border-right:2px solid #f0f0f0;left:auto;right:4px}.ant-timeline-rtl .ant-timeline-item-head-custom{left:auto;right:5px;transform:translate(50%,-50%)}.ant-timeline-rtl .ant-timeline-item-content{margin:0 18px 0 0}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-tail{left:auto;right:50%}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head{margin-left:0;margin-right:-4px}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom{margin-left:0;margin-right:1px}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-left .ant-timeline-item-content{left:auto;right:calc(50% - 4px);text-align:right}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{text-align:left}.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-tail{left:auto;right:0}.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{margin-right:18px;text-align:right;width:100%}.ant-timeline-rtl.ant-timeline.ant-timeline-pending .ant-timeline-item-last .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-tail{border-left:none;border-right:2px dotted #f0f0f0}.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-label{text-align:left}.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-label{right:calc(50% + 14px);text-align:right}.ant-tooltip{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;max-width:250px;padding:0;position:absolute;visibility:visible;width:-webkit-max-content;width:-moz-max-content;width:max-content;width:intrinsic;z-index:1070}.ant-tooltip-content{position:relative}.ant-tooltip-hidden{display:none}.ant-tooltip-placement-top,.ant-tooltip-placement-topLeft,.ant-tooltip-placement-topRight{padding-bottom:14.3137085px}.ant-tooltip-placement-right,.ant-tooltip-placement-rightBottom,.ant-tooltip-placement-rightTop{padding-left:14.3137085px}.ant-tooltip-placement-bottom,.ant-tooltip-placement-bottomLeft,.ant-tooltip-placement-bottomRight{padding-top:14.3137085px}.ant-tooltip-placement-left,.ant-tooltip-placement-leftBottom,.ant-tooltip-placement-leftTop{padding-right:14.3137085px}.ant-tooltip-inner{word-wrap:break-word;background-color:rgba(0,0,0,.75);border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);color:#fff;min-height:32px;min-width:30px;padding:6px 8px;text-align:left;text-decoration:none}.ant-tooltip-arrow{background:transparent;display:block;height:22px;overflow:hidden;pointer-events:none;position:absolute;width:22px;z-index:2}.ant-tooltip-arrow-content{--antd-arrow-background-color:linear-gradient(to right bottom,rgba(0,0,0,.65),rgba(0,0,0,.75));border-radius:0 0 2px;bottom:0;content:"";display:block;height:11.3137085px;left:0;margin:auto;pointer-events:auto;pointer-events:none;position:absolute;right:0;top:0;width:11.3137085px}.ant-tooltip-arrow-content:before{background:var(--antd-arrow-background-color);background-position:-10px -10px;background-repeat:no-repeat;-webkit-clip-path:inset(33% 33%);clip-path:inset(33% 33%);-webkit-clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");content:"";height:33.9411255px;left:-11.3137085px;position:absolute;top:-11.3137085px;width:33.9411255px}.ant-tooltip-placement-top .ant-tooltip-arrow,.ant-tooltip-placement-topLeft .ant-tooltip-arrow,.ant-tooltip-placement-topRight .ant-tooltip-arrow{bottom:0;transform:translateY(100%)}.ant-tooltip-placement-top .ant-tooltip-arrow-content,.ant-tooltip-placement-topLeft .ant-tooltip-arrow-content,.ant-tooltip-placement-topRight .ant-tooltip-arrow-content{box-shadow:3px 3px 7px rgba(0,0,0,.07);transform:translateY(-11px) rotate(45deg)}.ant-tooltip-placement-top .ant-tooltip-arrow{left:50%;transform:translateY(100%) translateX(-50%)}.ant-tooltip-placement-topLeft .ant-tooltip-arrow{left:13px}.ant-tooltip-placement-topRight .ant-tooltip-arrow{right:13px}.ant-tooltip-placement-right .ant-tooltip-arrow,.ant-tooltip-placement-rightBottom .ant-tooltip-arrow,.ant-tooltip-placement-rightTop .ant-tooltip-arrow{left:0;transform:translateX(-100%)}.ant-tooltip-placement-right .ant-tooltip-arrow-content,.ant-tooltip-placement-rightBottom .ant-tooltip-arrow-content,.ant-tooltip-placement-rightTop .ant-tooltip-arrow-content{box-shadow:-3px 3px 7px rgba(0,0,0,.07);transform:translateX(11px) rotate(135deg)}.ant-tooltip-placement-right .ant-tooltip-arrow{top:50%;transform:translateX(-100%) translateY(-50%)}.ant-tooltip-placement-rightTop .ant-tooltip-arrow{top:5px}.ant-tooltip-placement-rightBottom .ant-tooltip-arrow{bottom:5px}.ant-tooltip-placement-left .ant-tooltip-arrow,.ant-tooltip-placement-leftBottom .ant-tooltip-arrow,.ant-tooltip-placement-leftTop .ant-tooltip-arrow{right:0;transform:translateX(100%)}.ant-tooltip-placement-left .ant-tooltip-arrow-content,.ant-tooltip-placement-leftBottom .ant-tooltip-arrow-content,.ant-tooltip-placement-leftTop .ant-tooltip-arrow-content{box-shadow:3px -3px 7px rgba(0,0,0,.07);transform:translateX(-11px) rotate(315deg)}.ant-tooltip-placement-left .ant-tooltip-arrow{top:50%;transform:translateX(100%) translateY(-50%)}.ant-tooltip-placement-leftTop .ant-tooltip-arrow{top:5px}.ant-tooltip-placement-leftBottom .ant-tooltip-arrow{bottom:5px}.ant-tooltip-placement-bottom .ant-tooltip-arrow,.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow,.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{top:0;transform:translateY(-100%)}.ant-tooltip-placement-bottom .ant-tooltip-arrow-content,.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow-content,.ant-tooltip-placement-bottomRight .ant-tooltip-arrow-content{box-shadow:-3px -3px 7px rgba(0,0,0,.07);transform:translateY(11px) rotate(225deg)}.ant-tooltip-placement-bottom .ant-tooltip-arrow{left:50%;transform:translateY(-100%) translateX(-50%)}.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow{left:13px}.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{right:13px}.ant-tooltip-pink .ant-tooltip-inner{background-color:#eb2f96}.ant-tooltip-pink .ant-tooltip-arrow-content:before{background:#eb2f96}.ant-tooltip-magenta .ant-tooltip-inner{background-color:#eb2f96}.ant-tooltip-magenta .ant-tooltip-arrow-content:before{background:#eb2f96}.ant-tooltip-red .ant-tooltip-inner{background-color:#f5222d}.ant-tooltip-red .ant-tooltip-arrow-content:before{background:#f5222d}.ant-tooltip-volcano .ant-tooltip-inner{background-color:#fa541c}.ant-tooltip-volcano .ant-tooltip-arrow-content:before{background:#fa541c}.ant-tooltip-orange .ant-tooltip-inner{background-color:#fa8c16}.ant-tooltip-orange .ant-tooltip-arrow-content:before{background:#fa8c16}.ant-tooltip-yellow .ant-tooltip-inner{background-color:#fadb14}.ant-tooltip-yellow .ant-tooltip-arrow-content:before{background:#fadb14}.ant-tooltip-gold .ant-tooltip-inner{background-color:#faad14}.ant-tooltip-gold .ant-tooltip-arrow-content:before{background:#faad14}.ant-tooltip-cyan .ant-tooltip-inner{background-color:#13c2c2}.ant-tooltip-cyan .ant-tooltip-arrow-content:before{background:#13c2c2}.ant-tooltip-lime .ant-tooltip-inner{background-color:#a0d911}.ant-tooltip-lime .ant-tooltip-arrow-content:before{background:#a0d911}.ant-tooltip-green .ant-tooltip-inner{background-color:#52c41a}.ant-tooltip-green .ant-tooltip-arrow-content:before{background:#52c41a}.ant-tooltip-blue .ant-tooltip-inner{background-color:#1890ff}.ant-tooltip-blue .ant-tooltip-arrow-content:before{background:#1890ff}.ant-tooltip-geekblue .ant-tooltip-inner{background-color:#2f54eb}.ant-tooltip-geekblue .ant-tooltip-arrow-content:before{background:#2f54eb}.ant-tooltip-purple .ant-tooltip-inner{background-color:#722ed1}.ant-tooltip-purple .ant-tooltip-arrow-content:before{background:#722ed1}.ant-tooltip-rtl{direction:rtl}.ant-tooltip-rtl .ant-tooltip-inner{text-align:right}.ant-transfer-customize-list .ant-transfer-list{flex:1 1 50%;height:auto;min-height:200px;width:auto}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small{border:0;border-radius:0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small .ant-table-selection-column{min-width:40px;width:40px}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small>.ant-table-content>.ant-table-body>table>.ant-table-thead>tr>th{background:#fafafa}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small>.ant-table-content .ant-table-row:last-child td{border-bottom:1px solid #f0f0f0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small .ant-table-body{margin:0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-pagination.ant-pagination{margin:16px 0 4px}.ant-transfer-customize-list .ant-input[disabled]{background-color:transparent}.ant-transfer-status-error .ant-transfer-list{border-color:#ff4d4f}.ant-transfer-status-error .ant-transfer-list-search:not([disabled]){border-color:#d9d9d9}.ant-transfer-status-error .ant-transfer-list-search:not([disabled]):hover{border-color:#40a9ff;border-right-width:1px}.ant-transfer-status-error .ant-transfer-list-search:not([disabled]):focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-transfer-status-warning .ant-transfer-list{border-color:#faad14}.ant-transfer-status-warning .ant-transfer-list-search:not([disabled]){border-color:#d9d9d9}.ant-transfer-status-warning .ant-transfer-list-search:not([disabled]):hover{border-color:#40a9ff;border-right-width:1px}.ant-transfer-status-warning .ant-transfer-list-search:not([disabled]):focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-transfer{font-feature-settings:"tnum";align-items:stretch;box-sizing:border-box;color:rgba(0,0,0,.85);display:flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-transfer-disabled .ant-transfer-list{background:#f5f5f5}.ant-transfer-list{border:1px solid #d9d9d9;border-radius:2px;display:flex;flex-direction:column;height:200px;width:180px}.ant-transfer-list-with-pagination{height:auto;width:250px}.ant-transfer-list-search .anticon-search{color:rgba(0,0,0,.25)}.ant-transfer-list-header{align-items:center;background:#fff;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0;color:rgba(0,0,0,.85);display:flex;flex:none;height:40px;padding:8px 12px 9px}.ant-transfer-list-header>:not(:last-child){margin-right:4px}.ant-transfer-list-header>*{flex:none}.ant-transfer-list-header-title{flex:auto;overflow:hidden;text-align:right;text-overflow:ellipsis;white-space:nowrap}.ant-transfer-list-header-dropdown{cursor:pointer;font-size:10px;transform:translateY(10%)}.ant-transfer-list-header-dropdown[disabled]{cursor:not-allowed}.ant-transfer-list-body{display:flex;flex:auto;flex-direction:column;font-size:14px;overflow:hidden}.ant-transfer-list-body-search-wrapper{flex:none;padding:12px;position:relative}.ant-transfer-list-content{flex:auto;list-style:none;margin:0;overflow:auto;padding:0}.ant-transfer-list-content-item{align-items:center;display:flex;line-height:20px;min-height:32px;padding:6px 12px;transition:all .3s}.ant-transfer-list-content-item>:not(:last-child){margin-right:8px}.ant-transfer-list-content-item>*{flex:none}.ant-transfer-list-content-item-text{flex:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-transfer-list-content-item-remove{color:#1890ff;color:#d9d9d9;cursor:pointer;outline:none;position:relative;text-decoration:none;transition:color .3s}.ant-transfer-list-content-item-remove:focus,.ant-transfer-list-content-item-remove:hover{color:#40a9ff}.ant-transfer-list-content-item-remove:active{color:#096dd9}.ant-transfer-list-content-item-remove:after{bottom:-6px;content:"";left:-50%;position:absolute;right:-50%;top:-6px}.ant-transfer-list-content-item-remove:hover{color:#40a9ff}.ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background-color:#f5f5f5;cursor:pointer}.ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled).ant-transfer-list-content-item-checked:hover{background-color:#dcf4ff}.ant-transfer-list-content-show-remove .ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background:transparent;cursor:default}.ant-transfer-list-content-item-checked{background-color:#e6f7ff}.ant-transfer-list-content-item-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-transfer-list-pagination{border-top:1px solid #f0f0f0;padding:8px 0;text-align:right}.ant-transfer-list-body-not-found{color:rgba(0,0,0,.25);flex:none;margin:auto 0;text-align:center;width:100%}.ant-transfer-list-footer{border-top:1px solid #f0f0f0}.ant-transfer-operation{-ms-grid-row-align:center;align-self:center;display:flex;flex:none;flex-direction:column;margin:0 8px;vertical-align:middle}.ant-transfer-operation .ant-btn{display:block}.ant-transfer-operation .ant-btn:first-child{margin-bottom:4px}.ant-transfer-operation .ant-btn .anticon{font-size:12px}.ant-transfer .ant-empty-image{max-height:-2px}.ant-transfer-rtl{direction:rtl}.ant-transfer-rtl .ant-transfer-list-search{padding-left:24px;padding-right:8px}.ant-transfer-rtl .ant-transfer-list-search-action{left:12px;right:auto}.ant-transfer-rtl .ant-transfer-list-header>:not(:last-child){margin-left:4px;margin-right:0}.ant-transfer-rtl .ant-transfer-list-header{left:auto;right:0}.ant-transfer-rtl .ant-transfer-list-header-title{text-align:left}.ant-transfer-rtl .ant-transfer-list-content-item>:not(:last-child){margin-left:8px;margin-right:0}.ant-transfer-rtl .ant-transfer-list-pagination{text-align:left}.ant-transfer-rtl .ant-transfer-list-footer{left:auto;right:0}.ant-select-tree-checkbox{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em;white-space:nowrap}.ant-select-tree-checkbox-input:focus+.ant-select-tree-checkbox-inner,.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox-inner,.ant-select-tree-checkbox:hover .ant-select-tree-checkbox-inner{border-color:#1890ff}.ant-select-tree-checkbox-checked:after{-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;border:1px solid #1890ff;border-radius:2px;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox:after,.ant-select-tree-checkbox:hover:after{visibility:visible}.ant-select-tree-checkbox-inner{background-color:#fff;border:1px solid #d9d9d9;border-collapse:separate;border-radius:2px;direction:ltr;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-select-tree-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;height:9.14285714px;left:21.5%;opacity:0;position:absolute;top:50%;transform:rotate(45deg) scale(0) translate(-50%,-50%);transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;width:5.71428571px}.ant-select-tree-checkbox-input{bottom:0;cursor:pointer;height:100%;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;transform:rotate(45deg) scale(1) translate(-50%,-50%);transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-select-tree-checkbox-disabled{cursor:not-allowed}.ant-select-tree-checkbox-disabled.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-input{cursor:not-allowed;pointer-events:none}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-collapse:separate;border-color:#f5f5f5}.ant-select-tree-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-tree-checkbox-disabled:hover:after,.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox-disabled:after{visibility:hidden}.ant-select-tree-checkbox-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.ant-select-tree-checkbox-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-select-tree-checkbox-wrapper.ant-select-tree-checkbox-wrapper-disabled{cursor:not-allowed}.ant-select-tree-checkbox-wrapper+.ant-select-tree-checkbox-wrapper{margin-left:8px}.ant-select-tree-checkbox-wrapper.ant-select-tree-checkbox-wrapper-in-form-item input[type=checkbox]{height:14px;width:14px}.ant-select-tree-checkbox+span{padding-left:8px;padding-right:8px}.ant-select-tree-checkbox-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-select-tree-checkbox-group-item{margin-right:8px}.ant-select-tree-checkbox-group-item:last-child{margin-right:0}.ant-select-tree-checkbox-group-item+.ant-select-tree-checkbox-group-item{margin-left:0}.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner:after{background-color:#1890ff;border:0;content:" ";height:8px;left:50%;opacity:1;top:50%;transform:translate(-50%,-50%) scale(1);width:8px}.ant-select-tree-checkbox-indeterminate.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-tree-select-dropdown{padding:8px 4px}.ant-tree-select-dropdown-rtl{direction:rtl}.ant-tree-select-dropdown .ant-select-tree{border-radius:0}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner{align-items:stretch}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner .ant-select-tree-treenode .ant-select-tree-node-content-wrapper{flex:auto}.ant-select-tree{font-feature-settings:"tnum";background:#fff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;transition:background-color .3s}.ant-select-tree-focused:not(:hover):not(.ant-select-tree-active-focused){background:#e6f7ff}.ant-select-tree-list-holder-inner{align-items:flex-start}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner{align-items:stretch}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner .ant-select-tree-node-content-wrapper{flex:auto}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner .ant-select-tree-treenode.dragging{position:relative}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner .ant-select-tree-treenode.dragging:after{-webkit-animation:ant-tree-node-fx-do-not-use .3s;animation:ant-tree-node-fx-do-not-use .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-play-state:running;animation-play-state:running;border:1px solid #1890ff;bottom:4px;content:"";left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0}.ant-select-tree .ant-select-tree-treenode{align-items:flex-start;display:flex;outline:none;padding:0 0 4px}.ant-select-tree .ant-select-tree-treenode-disabled .ant-select-tree-node-content-wrapper{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-tree .ant-select-tree-treenode-disabled .ant-select-tree-node-content-wrapper:hover{background:transparent}.ant-select-tree .ant-select-tree-treenode-active .ant-select-tree-node-content-wrapper{background:#f5f5f5}.ant-select-tree .ant-select-tree-treenode:not(.ant-select-tree .ant-select-tree-treenode-disabled).filter-node .ant-select-tree-title{color:inherit;font-weight:500}.ant-select-tree-indent{-ms-grid-row-align:stretch;align-self:stretch;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.ant-select-tree-indent-unit{display:inline-block;width:24px}.ant-select-tree-draggable-icon{line-height:24px;opacity:.2;text-align:center;transition:opacity .3s;width:24px}.ant-select-tree-treenode:hover .ant-select-tree-draggable-icon{opacity:.45}.ant-select-tree-switcher{-ms-grid-row-align:stretch;align-self:stretch;cursor:pointer;flex:none;line-height:24px;margin:0;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:24px}.ant-select-tree-switcher .ant-select-tree-switcher-icon,.ant-select-tree-switcher .ant-tree-switcher-icon{display:inline-block;font-size:10px;vertical-align:baseline}.ant-select-tree-switcher .ant-select-tree-switcher-icon svg,.ant-select-tree-switcher .ant-tree-switcher-icon svg{transition:transform .3s}.ant-select-tree-switcher-noop{cursor:default}.ant-select-tree-switcher_close .ant-select-tree-switcher-icon svg{transform:rotate(-90deg)}.ant-select-tree-switcher-loading-icon{color:#1890ff}.ant-select-tree-switcher-leaf-line{display:inline-block;height:100%;position:relative;width:100%;z-index:1}.ant-select-tree-switcher-leaf-line:before{border-right:1px solid #d9d9d9;bottom:-4px;content:" ";margin-left:-1px;position:absolute;right:12px;top:0}.ant-select-tree-switcher-leaf-line:after{border-bottom:1px solid #d9d9d9;content:" ";height:14px;position:absolute;width:10px}.ant-select-tree-checkbox{margin:4px 8px 0 0;top:auto}.ant-select-tree .ant-select-tree-node-content-wrapper{background:transparent;border-radius:2px;color:inherit;cursor:pointer;line-height:24px;margin:0;min-height:24px;padding:0 4px;position:relative;transition:all .3s,border 0s,line-height 0s,box-shadow 0s;z-index:auto}.ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:#f5f5f5}.ant-select-tree .ant-select-tree-node-content-wrapper.ant-select-tree-node-selected{background-color:#bae7ff}.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-iconEle{display:inline-block;height:24px;line-height:24px;text-align:center;vertical-align:top;width:24px}.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-iconEle:empty{display:none}.ant-select-tree-unselectable .ant-select-tree-node-content-wrapper:hover{background-color:transparent}.ant-select-tree-node-content-wrapper{line-height:24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-tree-node-content-wrapper .ant-tree-drop-indicator{background-color:#1890ff;border-radius:1px;height:2px;pointer-events:none;position:absolute;z-index:1}.ant-select-tree-node-content-wrapper .ant-tree-drop-indicator:after{background-color:transparent;border:2px solid #1890ff;border-radius:50%;content:"";height:8px;left:-6px;position:absolute;top:-3px;width:8px}.ant-select-tree .ant-select-tree-treenode.drop-container>[draggable]{box-shadow:0 0 0 2px #1890ff}.ant-select-tree-show-line .ant-select-tree-indent-unit{height:100%;position:relative}.ant-select-tree-show-line .ant-select-tree-indent-unit:before{border-right:1px solid #d9d9d9;bottom:-4px;content:"";position:absolute;right:12px;top:0}.ant-select-tree-show-line .ant-select-tree-indent-unit-end:before{display:none}.ant-select-tree-show-line .ant-select-tree-switcher{background:#fff}.ant-select-tree-show-line .ant-select-tree-switcher-line-icon{vertical-align:-.15em}.ant-select-tree .ant-select-tree-treenode-leaf-last .ant-select-tree-switcher-leaf-line:before{bottom:auto!important;height:14px!important;top:auto!important}.ant-tree-select-dropdown-rtl .ant-select-tree .ant-select-tree-switcher_close .ant-select-tree-switcher-icon svg{transform:rotate(90deg)}.ant-tree-select-dropdown-rtl .ant-select-tree .ant-select-tree-switcher-loading-icon{transform:scaleY(-1)}@-webkit-keyframes antCheckboxEffect{0%{opacity:.5;transform:scale(1)}to{opacity:0;transform:scale(1.6)}}@keyframes antCheckboxEffect{0%{opacity:.5;transform:scale(1)}to{opacity:0;transform:scale(1.6)}}@-webkit-keyframes ant-tree-node-fx-do-not-use{0%{opacity:0}to{opacity:1}}@keyframes ant-tree-node-fx-do-not-use{0%{opacity:0}to{opacity:1}}.ant-tree.ant-tree-directory .ant-tree-treenode{position:relative}.ant-tree.ant-tree-directory .ant-tree-treenode:before{bottom:4px;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0;transition:background-color .3s}.ant-tree.ant-tree-directory .ant-tree-treenode:hover:before{background:#f5f5f5}.ant-tree.ant-tree-directory .ant-tree-treenode>*{z-index:1}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-switcher{transition:color .3s}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper{border-radius:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper:hover{background:transparent}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper.ant-tree-node-selected{background:transparent;color:#fff}.ant-tree.ant-tree-directory .ant-tree-treenode-selected:before,.ant-tree.ant-tree-directory .ant-tree-treenode-selected:hover:before{background:#1890ff}.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-switcher{color:#fff}.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-node-content-wrapper{background:transparent;color:#fff}.ant-tree-checkbox{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em;white-space:nowrap}.ant-tree-checkbox-input:focus+.ant-tree-checkbox-inner,.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-inner,.ant-tree-checkbox:hover .ant-tree-checkbox-inner{border-color:#1890ff}.ant-tree-checkbox-checked:after{-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;border:1px solid #1890ff;border-radius:2px;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox:after,.ant-tree-checkbox:hover:after{visibility:visible}.ant-tree-checkbox-inner{background-color:#fff;border:1px solid #d9d9d9;border-collapse:separate;border-radius:2px;direction:ltr;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-tree-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;height:9.14285714px;left:21.5%;opacity:0;position:absolute;top:50%;transform:rotate(45deg) scale(0) translate(-50%,-50%);transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;width:5.71428571px}.ant-tree-checkbox-input{bottom:0;cursor:pointer;height:100%;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;transform:rotate(45deg) scale(1) translate(-50%,-50%);transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.ant-tree-checkbox-checked .ant-tree-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-tree-checkbox-disabled{cursor:not-allowed}.ant-tree-checkbox-disabled.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.ant-tree-checkbox-disabled .ant-tree-checkbox-input{cursor:not-allowed;pointer-events:none}.ant-tree-checkbox-disabled .ant-tree-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-collapse:separate;border-color:#f5f5f5}.ant-tree-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tree-checkbox-disabled:hover:after,.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-disabled:after{visibility:hidden}.ant-tree-checkbox-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.ant-tree-checkbox-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-tree-checkbox-wrapper.ant-tree-checkbox-wrapper-disabled{cursor:not-allowed}.ant-tree-checkbox-wrapper+.ant-tree-checkbox-wrapper{margin-left:8px}.ant-tree-checkbox-wrapper.ant-tree-checkbox-wrapper-in-form-item input[type=checkbox]{height:14px;width:14px}.ant-tree-checkbox+span{padding-left:8px;padding-right:8px}.ant-tree-checkbox-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-tree-checkbox-group-item{margin-right:8px}.ant-tree-checkbox-group-item:last-child{margin-right:0}.ant-tree-checkbox-group-item+.ant-tree-checkbox-group-item{margin-left:0}.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner:after{background-color:#1890ff;border:0;content:" ";height:8px;left:50%;opacity:1;top:50%;transform:translate(-50%,-50%) scale(1);width:8px}.ant-tree-checkbox-indeterminate.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-tree{font-feature-settings:"tnum";background:#fff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;transition:background-color .3s}.ant-tree-focused:not(:hover):not(.ant-tree-active-focused){background:#e6f7ff}.ant-tree-list-holder-inner{align-items:flex-start}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner{align-items:stretch}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper{flex:auto}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-treenode.dragging{position:relative}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-treenode.dragging:after{-webkit-animation:ant-tree-node-fx-do-not-use .3s;animation:ant-tree-node-fx-do-not-use .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-play-state:running;animation-play-state:running;border:1px solid #1890ff;bottom:4px;content:"";left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0}.ant-tree .ant-tree-treenode{align-items:flex-start;display:flex;outline:none;padding:0 0 4px}.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper:hover{background:transparent}.ant-tree .ant-tree-treenode-active .ant-tree-node-content-wrapper{background:#f5f5f5}.ant-tree .ant-tree-treenode:not(.ant-tree .ant-tree-treenode-disabled).filter-node .ant-tree-title{color:inherit;font-weight:500}.ant-tree-indent{-ms-grid-row-align:stretch;align-self:stretch;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.ant-tree-indent-unit{display:inline-block;width:24px}.ant-tree-draggable-icon{line-height:24px;opacity:.2;text-align:center;transition:opacity .3s;width:24px}.ant-tree-treenode:hover .ant-tree-draggable-icon{opacity:.45}.ant-tree-switcher{-ms-grid-row-align:stretch;align-self:stretch;cursor:pointer;flex:none;line-height:24px;margin:0;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:24px}.ant-tree-switcher .ant-select-tree-switcher-icon,.ant-tree-switcher .ant-tree-switcher-icon{display:inline-block;font-size:10px;vertical-align:baseline}.ant-tree-switcher .ant-select-tree-switcher-icon svg,.ant-tree-switcher .ant-tree-switcher-icon svg{transition:transform .3s}.ant-tree-switcher-noop{cursor:default}.ant-tree-switcher_close .ant-tree-switcher-icon svg{transform:rotate(-90deg)}.ant-tree-switcher-loading-icon{color:#1890ff}.ant-tree-switcher-leaf-line{display:inline-block;height:100%;position:relative;width:100%;z-index:1}.ant-tree-switcher-leaf-line:before{border-right:1px solid #d9d9d9;bottom:-4px;content:" ";margin-left:-1px;position:absolute;right:12px;top:0}.ant-tree-switcher-leaf-line:after{border-bottom:1px solid #d9d9d9;content:" ";height:14px;position:absolute;width:10px}.ant-tree-checkbox{margin:4px 8px 0 0;top:auto}.ant-tree .ant-tree-node-content-wrapper{background:transparent;border-radius:2px;color:inherit;cursor:pointer;line-height:24px;margin:0;min-height:24px;padding:0 4px;position:relative;transition:all .3s,border 0s,line-height 0s,box-shadow 0s;z-index:auto}.ant-tree .ant-tree-node-content-wrapper:hover{background-color:#f5f5f5}.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected{background-color:#bae7ff}.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle{display:inline-block;height:24px;line-height:24px;text-align:center;vertical-align:top;width:24px}.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle:empty{display:none}.ant-tree-unselectable .ant-tree-node-content-wrapper:hover{background-color:transparent}.ant-tree-node-content-wrapper{line-height:24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-tree-node-content-wrapper .ant-tree-drop-indicator{background-color:#1890ff;border-radius:1px;height:2px;pointer-events:none;position:absolute;z-index:1}.ant-tree-node-content-wrapper .ant-tree-drop-indicator:after{background-color:transparent;border:2px solid #1890ff;border-radius:50%;content:"";height:8px;left:-6px;position:absolute;top:-3px;width:8px}.ant-tree .ant-tree-treenode.drop-container>[draggable]{box-shadow:0 0 0 2px #1890ff}.ant-tree-show-line .ant-tree-indent-unit{height:100%;position:relative}.ant-tree-show-line .ant-tree-indent-unit:before{border-right:1px solid #d9d9d9;bottom:-4px;content:"";position:absolute;right:12px;top:0}.ant-tree-show-line .ant-tree-indent-unit-end:before{display:none}.ant-tree-show-line .ant-tree-switcher{background:#fff}.ant-tree-show-line .ant-tree-switcher-line-icon{vertical-align:-.15em}.ant-tree .ant-tree-treenode-leaf-last .ant-tree-switcher-leaf-line:before{bottom:auto!important;height:14px!important;top:auto!important}.ant-tree-rtl{direction:rtl}.ant-tree-rtl .ant-tree-node-content-wrapper[draggable=true] .ant-tree-drop-indicator:after{left:unset;right:-6px}.ant-tree .ant-tree-treenode-rtl{direction:rtl}.ant-tree-rtl .ant-tree-switcher_close .ant-tree-switcher-icon svg{transform:rotate(90deg)}.ant-tree-rtl.ant-tree-show-line .ant-tree-indent-unit:before{border-left:1px solid #d9d9d9;border-right:none;left:-13px;right:auto}.ant-tree-rtl .ant-tree-checkbox,.ant-tree-select-dropdown-rtl .ant-select-tree-checkbox{margin:4px 0 0 8px}.ant-typography{color:rgba(0,0,0,.85);overflow-wrap:break-word}.ant-typography.ant-typography-secondary{color:rgba(0,0,0,.45)}.ant-typography.ant-typography-success{color:#52c41a}.ant-typography.ant-typography-warning{color:#faad14}.ant-typography.ant-typography-danger{color:#ff4d4f}a.ant-typography.ant-typography-danger:active,a.ant-typography.ant-typography-danger:focus{color:#d9363e}a.ant-typography.ant-typography-danger:hover{color:#ff7875}.ant-typography.ant-typography-disabled{color:rgba(0,0,0,.25);cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-typography p,div.ant-typography{margin-bottom:1em}.ant-typography h1,div.ant-typography-h1,div.ant-typography-h1>textarea,h1.ant-typography{color:rgba(0,0,0,.85);font-size:38px;font-weight:600;line-height:1.23;margin-bottom:.5em}.ant-typography h2,div.ant-typography-h2,div.ant-typography-h2>textarea,h2.ant-typography{color:rgba(0,0,0,.85);font-size:30px;font-weight:600;line-height:1.35;margin-bottom:.5em}.ant-typography h3,div.ant-typography-h3,div.ant-typography-h3>textarea,h3.ant-typography{color:rgba(0,0,0,.85);font-size:24px;font-weight:600;line-height:1.35;margin-bottom:.5em}.ant-typography h4,div.ant-typography-h4,div.ant-typography-h4>textarea,h4.ant-typography{color:rgba(0,0,0,.85);font-size:20px;font-weight:600;line-height:1.4;margin-bottom:.5em}.ant-typography h5,div.ant-typography-h5,div.ant-typography-h5>textarea,h5.ant-typography{color:rgba(0,0,0,.85);font-size:16px;font-weight:600;line-height:1.5;margin-bottom:.5em}.ant-typography div+h1,.ant-typography div+h2,.ant-typography div+h3,.ant-typography div+h4,.ant-typography div+h5,.ant-typography h1+h1,.ant-typography h1+h2,.ant-typography h1+h3,.ant-typography h1+h4,.ant-typography h1+h5,.ant-typography h2+h1,.ant-typography h2+h2,.ant-typography h2+h3,.ant-typography h2+h4,.ant-typography h2+h5,.ant-typography h3+h1,.ant-typography h3+h2,.ant-typography h3+h3,.ant-typography h3+h4,.ant-typography h3+h5,.ant-typography h4+h1,.ant-typography h4+h2,.ant-typography h4+h3,.ant-typography h4+h4,.ant-typography h4+h5,.ant-typography h5+h1,.ant-typography h5+h2,.ant-typography h5+h3,.ant-typography h5+h4,.ant-typography h5+h5,.ant-typography li+h1,.ant-typography li+h2,.ant-typography li+h3,.ant-typography li+h4,.ant-typography li+h5,.ant-typography p+h1,.ant-typography p+h2,.ant-typography p+h3,.ant-typography p+h4,.ant-typography p+h5,.ant-typography ul+h1,.ant-typography ul+h2,.ant-typography ul+h3,.ant-typography ul+h4,.ant-typography ul+h5,.ant-typography+h1.ant-typography,.ant-typography+h2.ant-typography,.ant-typography+h3.ant-typography,.ant-typography+h4.ant-typography,.ant-typography+h5.ant-typography{margin-top:1.2em}a.ant-typography-ellipsis,span.ant-typography-ellipsis{display:inline-block;max-width:100%}.ant-typography a,a.ant-typography{color:#1890ff;cursor:pointer;outline:none;text-decoration:none;transition:color .3s}.ant-typography a:focus,.ant-typography a:hover,a.ant-typography:focus,a.ant-typography:hover{color:#40a9ff}.ant-typography a:active,a.ant-typography:active{color:#096dd9}.ant-typography a:active,.ant-typography a:hover,a.ant-typography:active,a.ant-typography:hover{text-decoration:none}.ant-typography a.ant-typography-disabled,.ant-typography a[disabled],a.ant-typography.ant-typography-disabled,a.ant-typography[disabled]{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-typography a.ant-typography-disabled:active,.ant-typography a.ant-typography-disabled:hover,.ant-typography a[disabled]:active,.ant-typography a[disabled]:hover,a.ant-typography.ant-typography-disabled:active,a.ant-typography.ant-typography-disabled:hover,a.ant-typography[disabled]:active,a.ant-typography[disabled]:hover{color:rgba(0,0,0,.25)}.ant-typography a.ant-typography-disabled:active,.ant-typography a[disabled]:active,a.ant-typography.ant-typography-disabled:active,a.ant-typography[disabled]:active{pointer-events:none}.ant-typography code{background:hsla(0,0%,59%,.1);border:1px solid hsla(0,0%,39%,.2);border-radius:3px;font-size:85%;margin:0 .2em;padding:.2em .4em .1em}.ant-typography kbd{background:hsla(0,0%,59%,.06);border:solid hsla(0,0%,39%,.2);border-radius:3px;border-width:1px 1px 2px;font-size:90%;margin:0 .2em;padding:.15em .4em .1em}.ant-typography mark{background-color:#ffe58f;padding:0}.ant-typography ins,.ant-typography u{-webkit-text-decoration-skip:ink;text-decoration:underline;text-decoration-skip-ink:auto}.ant-typography del,.ant-typography s{text-decoration:line-through}.ant-typography strong{font-weight:600}.ant-typography-copy,.ant-typography-edit,.ant-typography-expand{color:#1890ff;cursor:pointer;margin-left:4px;outline:none;text-decoration:none;transition:color .3s}.ant-typography-copy:focus,.ant-typography-copy:hover,.ant-typography-edit:focus,.ant-typography-edit:hover,.ant-typography-expand:focus,.ant-typography-expand:hover{color:#40a9ff}.ant-typography-copy:active,.ant-typography-edit:active,.ant-typography-expand:active{color:#096dd9}.ant-typography-copy-success,.ant-typography-copy-success:focus,.ant-typography-copy-success:hover{color:#52c41a}.ant-typography-edit-content{position:relative}div.ant-typography-edit-content{left:-12px;margin-bottom:calc(1em - 5px);margin-top:-5px}.ant-typography-edit-content-confirm{bottom:8px;color:rgba(0,0,0,.45);font-size:14px;font-style:normal;font-weight:400;pointer-events:none;position:absolute;right:10px}.ant-typography-edit-content textarea{height:1em;margin:0!important;-moz-transition:none}.ant-typography ol,.ant-typography ul{margin:0 0 1em;padding:0}.ant-typography ol li,.ant-typography ul li{margin:0 0 0 20px;padding:0 0 0 4px}.ant-typography ul{list-style-type:circle}.ant-typography ul ul{list-style-type:disc}.ant-typography ol{list-style-type:decimal}.ant-typography blockquote,.ant-typography pre{margin:1em 0}.ant-typography pre{word-wrap:break-word;background:hsla(0,0%,59%,.1);border:1px solid hsla(0,0%,39%,.2);border-radius:3px;padding:.4em .6em;white-space:pre-wrap}.ant-typography pre code{background:transparent;border:0;display:inline;font-family:inherit;font-size:inherit;margin:0;padding:0}.ant-typography blockquote{border-left:4px solid hsla(0,0%,39%,.2);opacity:.85;padding:0 0 0 .6em}.ant-typography-single-line{white-space:nowrap}.ant-typography-ellipsis-single-line{overflow:hidden;text-overflow:ellipsis}a.ant-typography-ellipsis-single-line,span.ant-typography-ellipsis-single-line{vertical-align:bottom}.ant-typography-ellipsis-multiple-line{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ant-typography-rtl{direction:rtl}.ant-typography-rtl .ant-typography-copy,.ant-typography-rtl .ant-typography-edit,.ant-typography-rtl .ant-typography-expand{margin-left:0;margin-right:4px}.ant-typography-rtl .ant-typography-expand{float:left}div.ant-typography-edit-content.ant-typography-rtl{left:auto;right:-12px}.ant-typography-rtl .ant-typography-edit-content-confirm{left:10px;right:auto}.ant-typography-rtl.ant-typography ol li,.ant-typography-rtl.ant-typography ul li{margin:0 20px 0 0;padding:0 4px 0 0}.ant-upload{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;outline:0;padding:0}.ant-upload p{margin:0}.ant-upload-btn{display:block;outline:none;width:100%}.ant-upload input[type=file]{cursor:pointer}.ant-upload.ant-upload-select{display:inline-block}.ant-upload.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-select-picture-card{background-color:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;height:104px;margin-bottom:8px;margin-right:8px;text-align:center;transition:border-color .3s;vertical-align:top;width:104px}.ant-upload.ant-upload-select-picture-card>.ant-upload{align-items:center;display:flex;height:100%;justify-content:center;text-align:center}.ant-upload.ant-upload-select-picture-card:hover{border-color:#1890ff}.ant-upload-disabled.ant-upload.ant-upload-select-picture-card:hover{border-color:#d9d9d9}.ant-upload.ant-upload-drag{background:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;height:100%;position:relative;text-align:center;transition:border-color .3s;width:100%}.ant-upload.ant-upload-drag .ant-upload{padding:16px 0}.ant-upload.ant-upload-drag.ant-upload-drag-hover:not(.ant-upload-disabled){border-color:#096dd9}.ant-upload.ant-upload-drag.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-drag .ant-upload-btn{display:table;height:100%}.ant-upload.ant-upload-drag .ant-upload-drag-container{display:table-cell;vertical-align:middle}.ant-upload.ant-upload-drag:not(.ant-upload-disabled):hover{border-color:#40a9ff}.ant-upload.ant-upload-drag p.ant-upload-drag-icon{margin-bottom:20px}.ant-upload.ant-upload-drag p.ant-upload-drag-icon .anticon{color:#40a9ff;font-size:48px}.ant-upload.ant-upload-drag p.ant-upload-text{color:rgba(0,0,0,.85);font-size:16px;margin:0 0 4px}.ant-upload.ant-upload-drag p.ant-upload-hint{color:rgba(0,0,0,.45);font-size:14px}.ant-upload.ant-upload-drag .anticon-plus{color:rgba(0,0,0,.25);font-size:30px;transition:all .3s}.ant-upload.ant-upload-drag .anticon-plus:hover,.ant-upload.ant-upload-drag:hover .anticon-plus{color:rgba(0,0,0,.45)}.ant-upload-picture-card-wrapper{display:inline-block;width:100%}.ant-upload-picture-card-wrapper:before{content:"";display:table}.ant-upload-picture-card-wrapper:after{clear:both;content:"";display:table}.ant-upload-list{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-upload-list:after,.ant-upload-list:before{content:"";display:table}.ant-upload-list:after{clear:both}.ant-upload-list-item{font-size:14px;height:22.001px;margin-top:8px;position:relative}.ant-upload-list-item-name{display:inline-block;line-height:1.5715;overflow:hidden;padding-left:22px;text-overflow:ellipsis;white-space:nowrap;width:100%}.ant-upload-list-item-card-actions{position:absolute;right:0}.ant-upload-list-item-card-actions-btn{opacity:0}.ant-upload-list-item-card-actions-btn.ant-btn-sm{height:22.001px;line-height:1;vertical-align:top}.ant-upload-list-item-card-actions.picture{line-height:0;top:22px}.ant-upload-list-item-card-actions-btn:focus,.ant-upload-list-item-card-actions.picture .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-card-actions .anticon{color:rgba(0,0,0,.45);transition:all .3s}.ant-upload-list-item-card-actions:hover .anticon{color:rgba(0,0,0,.85)}.ant-upload-list-item-info{height:100%;transition:background-color .3s}.ant-upload-list-item-info>span{display:block;height:100%;width:100%}.ant-upload-list-item-info .ant-upload-text-icon .anticon,.ant-upload-list-item-info .anticon-loading .anticon{color:rgba(0,0,0,.45);font-size:14px;position:absolute;top:5px}.ant-upload-list-item:hover .ant-upload-list-item-info{background-color:#f5f5f5}.ant-upload-list-item:hover .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-error,.ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon,.ant-upload-list-item-error .ant-upload-list-item-name,.ant-upload-list-item-error .ant-upload-text-icon>.anticon{color:#ff4d4f}.ant-upload-list-item-error .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-progress{bottom:-12px;font-size:14px;line-height:0;padding-left:26px;position:absolute;width:100%}.ant-upload-list-picture .ant-upload-list-item,.ant-upload-list-picture-card .ant-upload-list-item{border:1px solid #d9d9d9;border-radius:2px;height:66px;padding:8px;position:relative}.ant-upload-list-picture .ant-upload-list-item:hover,.ant-upload-list-picture-card .ant-upload-list-item:hover{background:transparent}.ant-upload-list-picture .ant-upload-list-item-error,.ant-upload-list-picture-card .ant-upload-list-item-error{border-color:#ff4d4f}.ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info,.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info{background:transparent}.ant-upload-list-picture .ant-upload-list-item-uploading,.ant-upload-list-picture-card .ant-upload-list-item-uploading{border-style:dashed}.ant-upload-list-picture .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail{height:48px;line-height:60px;opacity:.8;text-align:center;width:48px}.ant-upload-list-picture .ant-upload-list-item-thumbnail .anticon,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail .anticon{font-size:26px}.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"],.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"]{fill:#fff2f0}.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"],.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"]{fill:#ff4d4f}.ant-upload-list-picture .ant-upload-list-item-icon,.ant-upload-list-picture-card .ant-upload-list-item-icon{font-size:26px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.ant-upload-list-picture .ant-upload-list-item-icon .anticon,.ant-upload-list-picture-card .ant-upload-list-item-icon .anticon{font-size:26px}.ant-upload-list-picture .ant-upload-list-item-image,.ant-upload-list-picture-card .ant-upload-list-item-image{max-width:100%}.ant-upload-list-picture .ant-upload-list-item-thumbnail img,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{display:block;height:48px;overflow:hidden;width:48px}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-picture-card .ant-upload-list-item-name{box-sizing:border-box;display:inline-block;line-height:44px;margin:0 0 0 8px;max-width:100%;overflow:hidden;padding-left:48px;padding-right:8px;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-upload-list-picture .ant-upload-list-item-uploading .ant-upload-list-item-name,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-name{margin-bottom:12px}.ant-upload-list-picture .ant-upload-list-item-progress,.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:14px;margin-top:0;padding-left:56px;width:calc(100% - 24px)}.ant-upload-list-picture-card-container{display:inline-block;height:104px;margin:0 8px 8px 0;vertical-align:top;width:104px}.ant-upload-list-picture-card .ant-upload-list-item{height:100%;margin:0}.ant-upload-list-picture-card .ant-upload-list-item-info{height:100%;overflow:hidden;position:relative}.ant-upload-list-picture-card .ant-upload-list-item-info:before{background-color:rgba(0,0,0,.5);content:" ";height:100%;opacity:0;position:absolute;transition:all .3s;width:100%;z-index:1}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info:before{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-actions{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);transition:all .3s;white-space:nowrap;z-index:10}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye{color:hsla(0,0%,100%,.85);cursor:pointer;font-size:16px;margin:0 4px;transition:all .3s;width:16px;z-index:10}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye:hover{color:#fff}.ant-upload-list-picture-card .ant-upload-list-item-actions:hover,.ant-upload-list-picture-card .ant-upload-list-item-info:hover+.ant-upload-list-item-actions{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{display:block;height:100%;-o-object-fit:contain;object-fit:contain;position:static;width:100%}.ant-upload-list-picture-card .ant-upload-list-item-name{display:none;line-height:1.5715;margin:8px 0 0;padding:0;text-align:center}.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{bottom:10px;display:block;position:absolute}.ant-upload-list-picture-card .ant-upload-list-item-uploading.ant-upload-list-item{background-color:#fafafa}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info{height:auto}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-eye,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info:before{display:none}.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:32px;padding-left:0;width:calc(100% - 14px)}.ant-upload-list-picture-container,.ant-upload-list-text-container{transition:opacity .3s,height .3s}.ant-upload-list-picture-container:before,.ant-upload-list-text-container:before{content:"";display:table;height:0;width:0}.ant-upload-list-picture-container .ant-upload-span,.ant-upload-list-text-container .ant-upload-span{display:block;flex:auto}.ant-upload-list-picture .ant-upload-span,.ant-upload-list-text .ant-upload-span{align-items:center;display:flex}.ant-upload-list-picture .ant-upload-span>*,.ant-upload-list-text .ant-upload-span>*{flex:none}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-text .ant-upload-list-item-name{flex:auto;margin:0;padding:0 8px}.ant-upload-list-picture .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-text-icon .anticon{position:static}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter,.ant-upload-list .ant-upload-animate-inline-leave{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter{-webkit-animation-name:uploadAnimateInlineIn;animation-name:uploadAnimateInlineIn}.ant-upload-list .ant-upload-animate-inline-leave{-webkit-animation-name:uploadAnimateInlineOut;animation-name:uploadAnimateInlineOut}@-webkit-keyframes uploadAnimateInlineIn{0%{height:0;margin:0;opacity:0;padding:0;width:0}}@keyframes uploadAnimateInlineIn{0%{height:0;margin:0;opacity:0;padding:0;width:0}}@-webkit-keyframes uploadAnimateInlineOut{to{height:0;margin:0;opacity:0;padding:0;width:0}}@keyframes uploadAnimateInlineOut{to{height:0;margin:0;opacity:0;padding:0;width:0}}.ant-upload-rtl{direction:rtl}.ant-upload-rtl.ant-upload.ant-upload-select-picture-card{margin-left:8px;margin-right:auto}.ant-upload-list-rtl{direction:rtl}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-1{padding-left:14px;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-2{padding-left:28px;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-name{padding-left:0;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-name-icon-count-1{padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-card-actions{left:0;right:auto}.ant-upload-list-rtl .ant-upload-list-item-card-actions .anticon{padding-left:5px;padding-right:0}.ant-upload-list-rtl .ant-upload-list-item-info{padding:0 4px 0 12px}.ant-upload-list-rtl .ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon{padding-left:5px;padding-right:0}.ant-upload-list-rtl .ant-upload-list-item-progress{padding-left:0;padding-right:26px}.ant-upload-list-picture .ant-upload-list-item-info,.ant-upload-list-picture-card .ant-upload-list-item-info{padding:0}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-thumbnail,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-thumbnail{left:auto;right:8px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-icon,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-icon{left:auto;right:50%;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name{margin:0 8px 0 0;padding-left:8px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-1,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-1{padding-left:18px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-2,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-2{padding-left:36px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-progress,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-progress{padding-left:0;padding-right:0}.ant-upload-list-rtl .ant-upload-list-picture-card-container{margin:0 0 8px 8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-actions{left:auto;right:50%;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{margin:8px 0 0;padding:0}#wpcontent{padding-left:0}#wpbody-content{padding-bottom:0}#wpbody-content .wrap{margin:0}#wpfooter{display:none}body:not(.graphiql-fullscreen) #wpbody-content{margin-bottom:-32px;position:-webkit-sticky;position:sticky;top:32px}#wpbody-content>:not(.wrap){display:none} diff --git a/lib/wp-graphql-1.17.0/build/app.js b/lib/wp-graphql-1.17.0/build/app.js new file mode 100644 index 00000000..f3b01d7e --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/app.js @@ -0,0 +1,38 @@ +!function(){var e,t={8870:function(e,t,n){"use strict";var r=n(9307);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var h=n(4184),m=n.n(h),v=(0,s.createContext)({});function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function b(e){return e<=1?100*Number(e)+"%":e}function E(e){return 1===e.length?"0"+e:String(e)}function w(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function T(e){return _(e)/255}function _(e){return parseInt(e,16)}var k={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function O(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(k[e])e=k[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=N.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=N.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=N.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=N.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=N.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=N.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=N.hex8.exec(e))?{r:_(n[1]),g:_(n[2]),b:_(n[3]),a:T(n[4]),format:t?"name":"hex8"}:(n=N.hex6.exec(e))?{r:_(n[1]),g:_(n[2]),b:_(n[3]),format:t?"name":"hex"}:(n=N.hex4.exec(e))?{r:_(n[1]+n[1]),g:_(n[2]+n[2]),b:_(n[3]+n[3]),a:T(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=N.hex3.exec(e))&&{r:_(n[1]+n[1]),g:_(n[2]+n[2]),b:_(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(A(e.r)&&A(e.g)&&A(e.b)?(t=function(e,t,n){return{r:255*g(e,255),g:255*g(t,255),b:255*g(n,255)}}(e.r,e.g,e.b),a=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):A(e.h)&&A(e.s)&&A(e.v)?(r=b(e.s),i=b(e.v),t=function(e,t,n){e=6*g(e,360),t=g(t,100),n=g(n,100);var r=Math.floor(e),i=e-r,o=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6;return{r:255*[n,a,o,o,s,n][c],g:255*[s,n,n,a,o,o][c],b:255*[o,o,s,n,n,a][c]}}(e.h,r,i),a=!0,s="hsv"):A(e.h)&&A(e.s)&&A(e.l)&&(r=b(e.s),o=b(e.l),t=function(e,t,n){var r,i,o;if(e=g(e,360),t=g(t,100),n=g(n,100),0===t)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=w(s,a,e+1/3),i=w(s,a,e),o=w(s,a,e-1/3)}return{r:255*r,g:255*i,b:255*o}}(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var S="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",x="[\\s|\\(]+("+S+")[,|\\s]+("+S+")[,|\\s]+("+S+")\\s*\\)?",C="[\\s|\\(]+("+S+")[,|\\s]+("+S+")[,|\\s]+("+S+")[,|\\s]+("+S+")\\s*\\)?",N={CSS_UNIT:new RegExp(S),rgb:new RegExp("rgb"+x),rgba:new RegExp("rgba"+C),hsl:new RegExp("hsl"+x),hsla:new RegExp("hsla"+C),hsv:new RegExp("hsv"+x),hsva:new RegExp("hsva"+C),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function A(e){return Boolean(N.CSS_UNIT.exec(String(e)))}var L=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function D(e){var t=function(e,t,n){e=g(e,255),t=g(t,255),n=g(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,c=0===r?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function M(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function j(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function F(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=O(e),i=5;i>0;i-=1){var o=D(r),a=I(O({h:R(o,i,!0),s:M(o,i,!0),v:j(o,i,!0)}));n.push(a)}n.push(I(r));for(var s=1;s<=4;s+=1){var c=D(r),l=I(O({h:R(c,s),s:M(c,s),v:j(c,s)}));n.push(l)}return"dark"===t.theme?L.map((function(e){var r=e.index,i=e.opacity;return I(P(O(t.backgroundColor||"#141414"),O(n[r]),100*i))})):n}var V={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Q={},q={};Object.keys(V).forEach((function(e){Q[e]=F(V[e]),Q[e].primary=Q[e][5],q[e]=F(V[e],{theme:"dark",backgroundColor:"#141414"}),q[e].primary=q[e][5]})),Q.red,Q.volcano,Q.gold,Q.orange,Q.yellow,Q.lime,Q.green,Q.cyan,Q.blue,Q.geekblue,Q.purple,Q.magenta,Q.grey;var U={};function G(e,t){}var B=function(e,t){!function(e,t,n){t||U[n]||(e(!1,n),U[n]=!0)}(G,e,t)};function K(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}var z="rc-util-key";function $(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):z}function H(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function W(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!K())return null;var r,i=document.createElement("style");(null===(t=n.csp)||void 0===t?void 0:t.nonce)&&(i.nonce=null===(r=n.csp)||void 0===r?void 0:r.nonce),i.innerHTML=e;var o=H(n),a=o.firstChild;return n.prepend&&o.prepend?o.prepend(i):n.prepend&&a?o.insertBefore(i,a):o.appendChild(i),i}var Y=new Map;function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=H(t);return Array.from(Y.get(n).children).find((function(n){return"STYLE"===n.tagName&&n.getAttribute($(t))===e}))}function X(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=H(n);if(!Y.has(r)){var i=W("",n),o=i.parentNode;Y.set(r,o),o.removeChild(i)}var a,s,c,l=J(t,n);if(l)return(null===(a=n.csp)||void 0===a?void 0:a.nonce)&&l.nonce!==(null===(s=n.csp)||void 0===s?void 0:s.nonce)&&(l.nonce=null===(c=n.csp)||void 0===c?void 0:c.nonce),l.innerHTML!==e&&(l.innerHTML=e),l;var u=W(e,n);return u.setAttribute($(n),t),u}function Z(e){return"object"===y(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===y(e.icon)||"function"==typeof e.icon)}function ee(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){var r=e[n];return"class"===n?(t.className=r,delete t.class):t[n]=r,t}),{})}function te(e,t,n){return n?c().createElement(e.tag,a(a({key:t},ee(e.attrs)),n),(e.children||[]).map((function(n,r){return te(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))):c().createElement(e.tag,a({key:t},ee(e.attrs)),(e.children||[]).map((function(n,r){return te(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})))}function ne(e){return F(e)[0]}function re(e){return e?Array.isArray(e)?e:[e]:[]}var ie="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",oe=["icon","className","onClick","style","primaryColor","secondaryColor"],ae={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},se=function(e){var t,n,r=e.icon,i=e.className,o=e.onClick,c=e.style,l=e.primaryColor,u=e.secondaryColor,p=d(e,oe),f=ae;if(l&&(f={primaryColor:l,secondaryColor:u||ne(l)}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie,t=(0,s.useContext)(v).csp;(0,s.useEffect)((function(){X(e,"@ant-design-icons",{prepend:!0,csp:t})}),[])}(),t=Z(r),n="icon should be icon definiton, but got ".concat(r),B(t,"[@ant-design/icons] ".concat(n)),!Z(r))return null;var h=r;return h&&"function"==typeof h.icon&&(h=a(a({},h),{},{icon:h.icon(f.primaryColor,f.secondaryColor)})),te(h.icon,"svg-".concat(h.name),a({className:i,onClick:o,style:c,"data-icon":h.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},p))};se.displayName="IconReact",se.getTwoToneColors=function(){return a({},ae)},se.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;ae.primaryColor=t,ae.secondaryColor=n||ne(t),ae.calculated=!!n};var ce=se;function le(e){var t=f(re(e),2),n=t[0],r=t[1];return ce.setTwoToneColors({primaryColor:n,secondaryColor:r})}var ue=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];le("#1890ff");var pe=s.forwardRef((function(e,t){var n,r=e.className,o=e.icon,c=e.spin,l=e.rotate,u=e.tabIndex,p=e.onClick,h=e.twoToneColor,y=d(e,ue),g=s.useContext(v).prefixCls,b=void 0===g?"anticon":g,E=m()(b,(i(n={},"".concat(b,"-").concat(o.name),!!o.name),i(n,"".concat(b,"-spin"),!!c||"loading"===o.name),n),r),w=u;void 0===w&&p&&(w=-1);var T=l?{msTransform:"rotate(".concat(l,"deg)"),transform:"rotate(".concat(l,"deg)")}:void 0,_=f(re(h),2),k=_[0],O=_[1];return s.createElement("span",a(a({role:"img","aria-label":o.name},y),{},{ref:t,tabIndex:w,onClick:p,className:E}),s.createElement(ce,{icon:o,primaryColor:k,secondaryColor:O,style:T}))}));pe.displayName="AntdIcon",pe.getTwoToneColor=function(){var e=ce.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},pe.setTwoToneColor=le;var fe=pe,de=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:l}))};de.displayName="CodeOutlined";var he=s.forwardRef(de),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},ve=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:me}))};ve.displayName="QuestionCircleOutlined";var ye=s.forwardRef(ve),ge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},be=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:ge}))};be.displayName="RightOutlined";var Ee=s.forwardRef(be),we={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},Te=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:we}))};Te.displayName="LeftOutlined";var _e=s.forwardRef(Te);function ke(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t0),i(n,"".concat(l,"-rtl"),"rtl"===r),n),u),g=s.useMemo((function(){return{siderHook:{addSider:function(e){c((function(t){return[].concat(ke(t),[e])}))},removeSider:function(e){c((function(t){return t.filter((function(t){return t!==e}))}))}}}}),[]);return s.createElement(Ne.Provider,{value:g},s.createElement(h,Oe({ref:t,className:y},v),p))})),Ie=Ae({suffixCls:"layout",tagName:"section",displayName:"Layout"})(De),Pe=Ae({suffixCls:"layout-header",tagName:"header",displayName:"Header"})(Le),Re=Ae({suffixCls:"layout-footer",tagName:"footer",displayName:"Footer"})(Le),Me=Ae({suffixCls:"layout-content",tagName:"main",displayName:"Content"})(Le),je=Ie,Fe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},Ve=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:Fe}))};Ve.displayName="BarsOutlined";var Qe=s.forwardRef(Ve);function qe(e,t){var n=a({},e);return Array.isArray(t)&&t.forEach((function(e){delete n[e]})),n}var Ue,Ge={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},Be=s.createContext({}),Ke=(Ue=0,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ue+=1,"".concat(e).concat(Ue)}),ze=s.forwardRef((function(e,t){var n=e.prefixCls,r=e.className,o=e.trigger,a=e.children,c=e.defaultCollapsed,l=void 0!==c&&c,u=e.theme,p=void 0===u?"dark":u,d=e.style,h=void 0===d?{}:d,v=e.collapsible,y=void 0!==v&&v,g=e.reverseArrow,b=void 0!==g&&g,E=e.width,w=void 0===E?200:E,T=e.collapsedWidth,_=void 0===T?80:T,k=e.zeroWidthTriggerStyle,O=e.breakpoint,S=e.onCollapse,x=e.onBreakpoint,C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1&&void 0!==arguments[1]?arguments[1]:{},n=[];return c().Children.forEach(e,(function(e){(null!=e||t.keepEmpty)&&(Array.isArray(e)?n=n.concat(yt(e)):(0,vt.isFragment)(e)&&e.props?n=n.concat(yt(e.props.children,t)):n.push(e))})),n}function gt(e,t){"function"==typeof e?e(t):"object"===y(e)&&e&&"current"in e&&(e.current=t)}function bt(){for(var e=arguments.length,t=new Array(e),n=0;n0},e.prototype.connect_=function(){Ot&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Nt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Ot&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;Ct.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Lt=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),Ut="undefined"!=typeof WeakMap?new WeakMap:new kt,Gt=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=At.getInstance(),r=new qt(t,n,this);Ut.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Gt.prototype[e]=function(){var t;return(t=Ut.get(this))[e].apply(t,arguments)}}));var Bt=void 0!==St.ResizeObserver?St.ResizeObserver:Gt,Kt=new Map,zt=new Bt((function(e){e.forEach((function(e){var t,n=e.target;null===(t=Kt.get(n))||void 0===t||t.forEach((function(e){return e(n)}))}))})),$t=function(e){et(n,e);var t=it(n);function n(){return Ye(this,n),t.apply(this,arguments)}return Xe(n,[{key:"render",value:function(){return this.props.children}}]),n}(s.Component),Ht=s.createContext(null);function Wt(e){var t=e.children,n=e.disabled,r=s.useRef(null),i=s.useRef(null),o=s.useContext(Ht),c="function"==typeof t,l=c?t(r):t,u=s.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),p=!c&&s.isValidElement(l)&&Et(l),f=p?l.ref:null,d=s.useMemo((function(){return bt(f,r)}),[f,r]),h=s.useRef(e);h.current=e;var m=s.useCallback((function(e){var t=h.current,n=t.onResize,r=t.data,i=e.getBoundingClientRect(),s=i.width,c=i.height,l=e.offsetWidth,p=e.offsetHeight,f=Math.floor(s),d=Math.floor(c);if(u.current.width!==f||u.current.height!==d||u.current.offsetWidth!==l||u.current.offsetHeight!==p){var m={width:f,height:d,offsetWidth:l,offsetHeight:p};u.current=m;var v=l===Math.round(s)?s:l,y=p===Math.round(c)?c:p,g=a(a({},m),{},{offsetWidth:v,offsetHeight:y});null==o||o(g,e,r),n&&Promise.resolve().then((function(){n(g,e)}))}}),[]);return s.useEffect((function(){var e,t,o=_t(r.current)||_t(i.current);return o&&!n&&(e=o,t=m,Kt.has(e)||(Kt.set(e,new Set),zt.observe(e)),Kt.get(e).add(t)),function(){return function(e,t){Kt.has(e)&&(Kt.get(e).delete(t),Kt.get(e).size||(zt.unobserve(e),Kt.delete(e)))}(o,m)}}),[r.current,n]),s.createElement($t,{ref:i},p?s.cloneElement(l,{ref:d}):l)}function Yt(e){var t=e.children;return("function"==typeof t?[t]:yt(t)).map((function(t,n){var r=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(n);return s.createElement(Wt,Oe({},e,{key:r}),t)}))}Yt.Collection=function(e){var t=e.children,n=e.onBatchResize,r=s.useRef(0),i=s.useRef([]),o=s.useContext(Ht),a=s.useCallback((function(e,t,a){r.current+=1;var s=r.current;i.current.push({size:e,element:t,data:a}),Promise.resolve().then((function(){s===r.current&&(null==n||n(i.current),i.current=[])})),null==o||o(e,t,a)}),[n,o]);return s.createElement(Ht.Provider,{value:a},t)};var Jt=Yt,Xt=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Zt=void 0;function en(e,t){var n=e.prefixCls,r=e.invalidate,i=e.item,o=e.renderItem,c=e.responsive,l=e.responsiveDisabled,u=e.registerSize,p=e.itemKey,f=e.className,h=e.style,v=e.children,y=e.display,g=e.order,b=e.component,E=void 0===b?"div":b,w=d(e,Xt),T=c&&!y;function _(e){u(p,e)}s.useEffect((function(){return function(){_(null)}}),[]);var k,O=o&&i!==Zt?o(i):v;r||(k={opacity:T?0:1,height:T?0:Zt,overflowY:T?"hidden":Zt,order:c?g:Zt,pointerEvents:T?"none":Zt,position:T?"absolute":Zt});var S={};T&&(S["aria-hidden"]=!0);var x=s.createElement(E,Oe({className:m()(!r&&n,f),style:a(a({},k),h)},S,w,{ref:t}),O);return c&&(x=s.createElement(Jt,{onResize:function(e){_(e.offsetWidth)},disabled:l},x)),x}var tn=s.forwardRef(en);tn.displayName="Item";var nn=tn,rn=function(e){return+setTimeout(e,16)},on=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(rn=function(e){return window.requestAnimationFrame(e)},on=function(e){return window.cancelAnimationFrame(e)});var an=0,sn=new Map;function cn(e){sn.delete(e)}function ln(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=an+=1;function r(t){if(0===t)cn(n),e();else{var i=rn((function(){r(t-1)}));sn.set(n,i)}}return r(t),n}ln.cancel=function(e){var t=sn.get(e);return cn(t),on(t)};var un=["component"],pn=["className"],fn=["className"],dn=function(e,t){var n=s.useContext(yn);if(!n){var r=e.component,i=void 0===r?"div":r,o=d(e,un);return s.createElement(i,Oe({},o,{ref:t}))}var a=n.className,c=d(n,pn),l=e.className,u=d(e,fn);return s.createElement(yn.Provider,{value:null},s.createElement(nn,Oe({ref:t,className:m()(a,l)},c,u)))},hn=s.forwardRef(dn);hn.displayName="RawItem";var mn=hn,vn=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],yn=s.createContext(null),gn="responsive",bn="invalidate";function En(e){return"+ ".concat(e.length," ...")}function wn(e,t){var n,r,i,o,c=e.prefixCls,l=void 0===c?"rc-overflow":c,u=e.data,p=void 0===u?[]:u,h=e.renderItem,v=e.renderRawItem,y=e.itemKey,g=e.itemWidth,b=void 0===g?10:g,E=e.ssr,w=e.style,T=e.className,_=e.maxCount,k=e.renderRest,O=e.renderRawRest,S=e.suffix,x=e.component,C=void 0===x?"div":x,N=e.itemComponent,A=e.onVisibleChange,L=d(e,vn),D=(n=f(dt({}),2)[1],r=(0,s.useRef)([]),i=0,o=0,function(e){var t=i;return i+=1,r.current.length_,fe=(0,s.useMemo)((function(){var e=p;return le?e=null===R&&I?p:p.slice(0,Math.min(p.length,j/b)):"number"==typeof _&&(e=p.slice(0,_)),e}),[p,b,R,_,le]),de=(0,s.useMemo)((function(){return le?p.slice(ne+1):p.slice(fe.length)}),[p,fe,le,ne]),he=(0,s.useCallback)((function(e,t){var n;return"function"==typeof y?y(e):null!==(n=y&&(null==e?void 0:e[y]))&&void 0!==n?n:t}),[y]),me=(0,s.useCallback)(h||function(e){return e},[h]);function ve(e,t){te(e),t||(oe(ej){ve(r-1),X(e-i-H+K);break}}S&&ge(0)+H>j&&X(null)}}),[j,V,K,H,he,fe]);var be=ie&&!!de.length,Ee={};null!==J&&le&&(Ee={position:"absolute",left:J,top:0});var we,Te={prefixCls:ae,responsive:le,component:N,invalidate:ue},_e=v?function(e,t){var n=he(e,t);return s.createElement(yn.Provider,{key:n,value:a(a({},Te),{},{order:t,item:e,itemKey:n,registerSize:ye,display:t<=ne})},v(e,t))}:function(e,t){var n=he(e,t);return s.createElement(nn,Oe({},Te,{order:t,key:n,item:e,renderItem:me,itemKey:n,registerSize:ye,display:t<=ne}))},ke={order:be?ne:Number.MAX_SAFE_INTEGER,className:"".concat(ae,"-rest"),registerSize:function(e,t){z(t),G(K)},display:be};if(O)O&&(we=s.createElement(yn.Provider,{value:a(a({},Te),ke)},O(de)));else{var Se=k||En;we=s.createElement(nn,Oe({},Te,ke),"function"==typeof Se?Se(de):Se)}var xe=s.createElement(C,Oe({className:m()(!ue&&l,T),style:w,ref:t},L),fe.map(_e),pe?we:null,S&&s.createElement(nn,Oe({},Te,{responsive:ce,responsiveDisabled:!le,order:ne,className:"".concat(ae,"-suffix"),registerSize:function(e,t){W(t)},display:!0,style:Ee}),S));return ce&&(xe=s.createElement(Jt,{onResize:function(e,t){M(t.clientWidth)},disabled:!le},xe)),xe}var Tn=s.forwardRef(wn);Tn.displayName="Overflow",Tn.Item=mn,Tn.RESPONSIVE=gn,Tn.INVALIDATE=bn;var kn=Tn,On={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=On.F1&&t<=On.F12)return!1;switch(t){case On.ALT:case On.CAPS_LOCK:case On.CONTEXT_MENU:case On.CTRL:case On.DOWN:case On.END:case On.ESC:case On.HOME:case On.INSERT:case On.LEFT:case On.MAC_FF_META:case On.META:case On.NUMLOCK:case On.NUM_CENTER:case On.PAGE_DOWN:case On.PAGE_UP:case On.PAUSE:case On.PRINT_SCREEN:case On.RIGHT:case On.SHIFT:case On.UP:case On.WIN_KEY:case On.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=On.ZERO&&e<=On.NINE)return!0;if(e>=On.NUM_ZERO&&e<=On.NUM_MULTIPLY)return!0;if(e>=On.A&&e<=On.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case On.SPACE:case On.QUESTION_MARK:case On.NUM_PLUS:case On.NUM_MINUS:case On.NUM_PERIOD:case On.NUM_DIVISION:case On.SEMICOLON:case On.DASH:case On.EQUALS:case On.COMMA:case On.PERIOD:case On.SLASH:case On.APOSTROPHE:case On.SINGLE_QUOTE:case On.OPEN_SQUARE_BRACKET:case On.BACKSLASH:case On.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Sn=On,xn=["children","locked"],Cn=s.createContext(null);function Nn(e){var t,n,r,i,o,c,l=e.children,u=e.locked,p=d(e,xn),f=s.useContext(Cn),h=(t=[f,p],"value"in(c=s.useRef({})).current&&(i=c.current.condition,o=t,!!(u||i[0]===o[0]&<()(i[1],o[1])))||(c.current.value=(n=p,r=a({},f),Object.keys(n).forEach((function(e){var t=n[e];void 0!==t&&(r[e]=t)})),r),c.current.condition=t),c.current.value);return s.createElement(Cn.Provider,{value:h},l)}function An(e,t,n,r){var i=s.useContext(Cn),o=i.activeKey,a=i.onActive,c=i.onInactive,l={active:o===e};return t||(l.onMouseEnter=function(t){null==n||n({key:e,domEvent:t}),a(e)},l.onMouseLeave=function(t){null==r||r({key:e,domEvent:t}),c(e)}),l}var Ln=["item"];function Dn(e){var t=e.item,n=d(e,Ln);return Object.defineProperty(n,"item",{get:function(){return B(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),n}function In(e){var t=e.icon,n=e.props,r=e.children;return("function"==typeof t?s.createElement(t,a({},n)):t)||r||null}function Pn(e){var t=s.useContext(Cn),n=t.mode,r=t.rtl,i=t.inlineIndent;return"inline"!==n?null:r?{paddingRight:e*i}:{paddingLeft:e*i}}var Rn=[],Mn=s.createContext(null);function jn(){return s.useContext(Mn)}var Fn=s.createContext(Rn);function Vn(e){var t=s.useContext(Fn);return s.useMemo((function(){return void 0!==e?[].concat(ke(t),[e]):t}),[t,e])}var Qn=s.createContext(null),qn=s.createContext(null);function Un(e,t){return void 0===e?null:"".concat(e,"-").concat(t)}function Gn(e){return Un(s.useContext(qn),e)}var Bn=s.createContext({}),Kn=["title","attribute","elementRef"],zn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],$n=["active"],Hn=function(e){et(n,e);var t=it(n);function n(){return Ye(this,n),t.apply(this,arguments)}return Xe(n,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.attribute,r=e.elementRef,i=qe(d(e,Kn),["eventKey"]);return B(!n,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),s.createElement(kn.Item,Oe({},n,{title:"string"==typeof t?t:void 0},i,{ref:r}))}}]),n}(s.Component),Wn=function(e){var t,n=e.style,r=e.className,o=e.eventKey,c=(e.warnKey,e.disabled),l=e.itemIcon,u=e.children,p=e.role,f=e.onMouseEnter,h=e.onMouseLeave,v=e.onClick,y=e.onKeyDown,g=e.onFocus,b=d(e,zn),E=Gn(o),w=s.useContext(Cn),T=w.prefixCls,_=w.onItemClick,k=w.disabled,O=w.overflowDisabled,S=w.itemIcon,x=w.selectedKeys,C=w.onActive,N=s.useContext(Bn)._internalRenderMenuItem,A="".concat(T,"-item"),L=s.useRef(),D=s.useRef(),I=k||c,P=Vn(o),R=function(e){return{key:o,keyPath:ke(P).reverse(),item:L.current,domEvent:e}},M=l||S,j=An(o,I,f,h),F=j.active,V=d(j,$n),Q=x.includes(o),q=Pn(P.length),U={};"option"===e.role&&(U["aria-selected"]=Q);var G=s.createElement(Hn,Oe({ref:L,elementRef:D,role:null===p?"none":p||"menuitem",tabIndex:c?null:-1,"data-menu-id":O&&E?null:E},b,V,U,{component:"li","aria-disabled":c,style:a(a({},q),n),className:m()(A,(t={},i(t,"".concat(A,"-active"),F),i(t,"".concat(A,"-selected"),Q),i(t,"".concat(A,"-disabled"),I),t),r),onClick:function(e){if(!I){var t=R(e);null==v||v(Dn(t)),_(t)}},onKeyDown:function(e){if(null==y||y(e),e.which===Sn.ENTER){var t=R(e);null==v||v(Dn(t)),_(t)}},onFocus:function(e){C(o),null==g||g(e)}}),u,s.createElement(In,{props:a(a({},e),{},{isSelected:Q}),icon:M}));return N&&(G=N(G,e,{selected:Q})),G},Yn=function(e){var t=e.eventKey,n=jn(),r=Vn(t);return s.useEffect((function(){if(n)return n.registerPath(t,r),function(){n.unregisterPath(t,r)}}),[r]),n?null:s.createElement(Wn,e)},Jn=["label","children","key","type"];function Xn(e,t){return yt(e).map((function(e,n){if(s.isValidElement(e)){var r,i,o=e.key,a=null!==(r=null===(i=e.props)||void 0===i?void 0:i.eventKey)&&void 0!==r?r:o;null==a&&(a="tmp_key-".concat([].concat(ke(t),[n]).join("-")));var c={key:a,eventKey:a};return s.cloneElement(e,c)}return e}))}function Zn(e){return(e||[]).map((function(e,t){if(e&&"object"===y(e)){var n=e.label,r=e.children,i=e.key,o=e.type,a=d(e,Jn),c=null!=i?i:"tmp-".concat(t);return r||"group"===o?"group"===o?s.createElement(la,Oe({key:c},a,{title:n}),Zn(r)):s.createElement(Fo,Oe({key:c},a,{title:n}),Zn(r)):"divider"===o?s.createElement(ua,Oe({key:c},a)):s.createElement(Yn,Oe({key:c},a),n)}return null})).filter((function(e){return e}))}function er(e,t,n){var r=e;return t&&(r=Zn(t)),Xn(r,n)}function tr(e){var t=s.useRef(e);t.current=e;var n=s.useCallback((function(){for(var e,n=arguments.length,r=new Array(n),i=0;i1&&void 0!==arguments[1]?arguments[1]:2;t();var o=ln((function(){i<=1?r({isCanceled:function(){return o!==e.current}}):n(r,i-1)}));e.current=o},t]}(),a=f(o,2),c=a[0],l=a[1];return Mr((function(){if(r!==Lr&&r!==Rr){var e=jr.indexOf(r),n=jr[e+1],o=t(r);!1===o?i(n,!0):c((function(e){function t(){e.isCanceled()||i(n,!0)}!0===o?t():Promise.resolve(o).then(t)}))}}),[e,r]),s.useEffect((function(){return function(){l()}}),[]),[function(){i(Dr,!0)},r]}(I,(function(e){if(e===Dr){var t=K.prepare;return!!t&&t(Q())}var n;return H in K&&j((null===(n=K[H])||void 0===n?void 0:n.call(K,Q(),null))||null),H===Pr&&(B(Q()),h>0&&(clearTimeout(V.current),V.current=setTimeout((function(){U({deadline:!0})}),h))),!0})),2),$=z[0],H=z[1],W=Fr(H);q.current=W,Mr((function(){L(t);var n,r=F.current;F.current=!0,e&&(!r&&t&&u&&(n=Cr),r&&t&&c&&(n=Nr),(r&&!t&&d||!r&&m&&!t&&d)&&(n=Ar),n&&(P(n),$()))}),[t]),(0,s.useEffect)((function(){(I===Cr&&!u||I===Nr&&!c||I===Ar&&!d)&&P(xr)}),[u,c,d]),(0,s.useEffect)((function(){return function(){F.current=!1,clearTimeout(V.current)}}),[]),(0,s.useEffect)((function(){void 0!==A&&I===xr&&(null==C||C(A))}),[A,I]);var Y=M;return K.prepare&&H===Ir&&(Y=a({transition:"none"},Y)),[I,H,Y,null!=A?A:t]}var Qr=function(e){et(n,e);var t=it(n);function n(){return Ye(this,n),t.apply(this,arguments)}return Xe(n,[{key:"render",value:function(){return this.props.children}}]),n}(s.Component),qr=Qr,Ur=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===y(e)&&(t=e.transitionSupport);var r=s.forwardRef((function(e,t){var r=e.visible,o=void 0===r||r,c=e.removeOnLeave,l=void 0===c||c,u=e.forceRender,p=e.children,d=e.motionName,h=e.leavedClassName,v=e.eventProps,y=n(e),g=(0,s.useRef)(),b=(0,s.useRef)(),E=f(Vr(y,o,(function(){try{return g.current instanceof HTMLElement?g.current:_t(b.current)}catch(e){return null}}),e),4),w=E[0],T=E[1],_=E[2],k=E[3],O=s.useRef(k);k&&(O.current=!0);var S,x=s.useCallback((function(e){g.current=e,gt(t,e)}),[t]),C=a(a({},v),{},{visible:o});if(p)if(w!==xr&&n(e)){var N,A;T===Dr?A="prepare":Fr(T)?A="active":T===Ir&&(A="start"),S=p(a(a({},C),{},{className:m()(Sr(d,w),(N={},i(N,Sr(d,"".concat(w,"-").concat(A)),A),i(N,d,"string"==typeof d),N)),style:_}),x)}else S=k?p(a({},C),x):!l&&O.current?p(a(a({},C),{},{className:h}),x):u?p(a(a({},C),{},{style:{display:"none"}}),x):null;else S=null;return s.isValidElement(S)&&Et(S)&&(S.ref||(S=s.cloneElement(S,{ref:x}))),s.createElement(qr,{ref:b},S)}));return r.displayName="CSSMotion",r}(_r),Gr="add",Br="keep",Kr="remove",zr="removed";function $r(e){var t;return a(a({},t=e&&"object"===y(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Hr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map($r)}function Wr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,i=t.length,o=Hr(e),s=Hr(t);o.forEach((function(e){for(var t=!1,o=r;o1}));return l.forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==Kr}))).forEach((function(t){t.key===e&&(t.status=Br)}))})),n}var Yr=["component","children","onVisibleChanged","onAllRemoved"],Jr=["status"],Xr=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ur,n=function(e){et(r,e);var n=it(r);function r(){var e;Ye(this,r);for(var t=arguments.length,i=new Array(t),o=0;o=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Ki(e){var t,n,r;if(Qi.isWindow(e)||9===e.nodeType){var i=Qi.getWindow(e);t={left:Qi.getWindowScrollLeft(i),top:Qi.getWindowScrollTop(i)},n=Qi.viewportWidth(i),r=Qi.viewportHeight(i)}else t=Qi.offset(e),n=Qi.outerWidth(e),r=Qi.outerHeight(e);return t.width=n,t.height=r,t}function zi(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,o=e.height,a=e.left,s=e.top;return"c"===n?s+=o/2:"b"===n&&(s+=o),"c"===r?a+=i/2:"r"===r&&(a+=i),{left:a,top:s}}function $i(e,t,n,r,i){var o=zi(t,n[1]),a=zi(e,n[0]),s=[a.left-o.left,a.top-o.top];return{left:Math.round(e.left-s[0]+r[0]-i[0]),top:Math.round(e.top-s[1]+r[1]-i[1])}}function Hi(e,t,n){return e.leftn.right}function Wi(e,t,n){return e.topn.bottom}function Yi(e,t,n){var r=[];return Qi.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function Ji(e,t){return e[t]=-e[t],e}function Xi(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Zi(e,t){e[0]=Xi(e[0],t.width),e[1]=Xi(e[1],t.height)}function eo(e,t,n,r){var i=n.points,o=n.offset||[0,0],a=n.targetOffset||[0,0],s=n.overflow,c=n.source||e;o=[].concat(o),a=[].concat(a);var l={},u=0,p=Bi(c,!(!(s=s||{})||!s.alwaysByViewport)),f=Ki(c);Zi(o,f),Zi(a,t);var d=$i(f,t,i,o,a),h=Qi.merge(f,d);if(p&&(s.adjustX||s.adjustY)&&r){if(s.adjustX&&Hi(d,f,p)){var m=Yi(i,/[lr]/gi,{l:"r",r:"l"}),v=Ji(o,0),y=Ji(a,0);(function(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.left&&i.left+o.width>n.right&&(o.width-=i.left+o.width-n.right),r.adjustX&&i.left+o.width>n.right&&(i.left=Math.max(n.right-o.width,n.left)),r.adjustY&&i.top=n.top&&i.top+o.height>n.bottom&&(o.height-=i.top+o.height-n.bottom),r.adjustY&&i.top+o.height>n.bottom&&(i.top=Math.max(n.bottom-o.height,n.top)),Qi.mix(i,o)}(d,f,p,l))}return h.width!==f.width&&Qi.css(c,"width",Qi.width(c)+h.width-f.width),h.height!==f.height&&Qi.css(c,"height",Qi.height(c)+h.height-f.height),Qi.offset(c,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:o,targetOffset:a,overflow:l}}function to(e,t,n){var r=n.target||t,i=Ki(r),o=!function(e,t){var n=Bi(e,t),r=Ki(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return eo(e,i,n,o)}to.__getOffsetParent=Ui,to.__getVisibleRectForElement=Bi;var no=n(8446),ro=n.n(no);function io(e,t){var n=null,r=null,i=new Bt((function(e){var i=f(e,1)[0].target;if(document.documentElement.contains(i)){var o=i.getBoundingClientRect(),a=o.width,s=o.height,c=Math.floor(a),l=Math.floor(s);n===c&&r===l||Promise.resolve().then((function(){t({width:c,height:l})})),n=c,r=l}}));return e&&i.observe(e),function(){i.disconnect()}}function oo(e){return"function"!=typeof e?null:e()}function ao(e){return"object"===y(e)&&e?e:null}var so=function(e,t){var n=e.children,r=e.disabled,i=e.target,o=e.align,a=e.onAlign,s=e.monitorWindowResize,l=e.monitorBufferTime,u=void 0===l?0:l,p=c().useRef({}),d=c().useRef(),h=c().Children.only(n),m=c().useRef({});m.current.disabled=r,m.current.target=i,m.current.align=o,m.current.onAlign=a;var v=function(e,t){var n=c().useRef(!1),r=c().useRef(null);function i(){window.clearTimeout(r.current)}return[function e(o){if(i(),n.current&&!0!==o)r.current=window.setTimeout((function(){n.current=!1,e()}),t);else{if(!1===function(){var e=m.current,t=e.disabled,n=e.target,r=e.align,i=e.onAlign;if(!t&&n){var o,a=d.current,s=oo(n),c=ao(n);p.current.element=s,p.current.point=c,p.current.align=r;var l=document.activeElement;return s&&ri(s)?o=to(a,s,r):c&&(o=function(e,t,n){var r,i,o=Qi.getDocument(e),a=o.defaultView||o.parentWindow,s=Qi.getWindowScrollLeft(a),c=Qi.getWindowScrollTop(a),l=Qi.viewportWidth(a),u=Qi.viewportHeight(a),p={left:r="pageX"in t?t.pageX:s+t.clientX,top:i="pageY"in t?t.pageY:c+t.clientY,width:0,height:0},f=r>=0&&r<=s+l&&i>=0&&i<=c+u,d=[n.points[0],"cc"];return eo(e,p,oi(oi({},n),{},{points:d}),f)}(a,c,r)),function(e,t){e!==document.activeElement&&ar(t,e)&&"function"==typeof e.focus&&e.focus()}(l,a),i&&o&&i(a,o),!0}return!1}())return;n.current=!0,r.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,i()}]}(0,u),y=f(v,2),g=y[0],b=y[1],E=c().useRef({cancel:function(){}}),w=c().useRef({cancel:function(){}});c().useEffect((function(){var e,t,n=oo(i),r=ao(i);d.current!==w.current.element&&(w.current.cancel(),w.current.element=d.current,w.current.cancel=io(d.current,g)),p.current.element===n&&((e=p.current.point)===(t=r)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&ro()(p.current.align,o)||(g(),E.current.element!==n&&(E.current.cancel(),E.current.element=n,E.current.cancel=io(n,g)))})),c().useEffect((function(){r?b():g()}),[r]);var T=c().useRef(null);return c().useEffect((function(){s?T.current||(T.current=sr(window,"resize",g)):T.current&&(T.current.remove(),T.current=null)}),[s]),c().useEffect((function(){return function(){E.current.cancel(),w.current.cancel(),T.current&&T.current.remove(),b()}}),[]),c().useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),c().isValidElement(h)&&(h=c().cloneElement(h,{ref:bt(h.ref,d)})),h},co=c().forwardRef(so);co.displayName="Align";var lo=co;function uo(){uo=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),a=new k(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function p(){}function f(){}function d(){}var h={};s(h,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(O([])));v&&v!==t&&n.call(v,i)&&(h=v);var g=d.prototype=p.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(i,o,a,s){var c=l(e[i],e,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==y(p)&&n.call(p,"__await")?t.resolve(p.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(p).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function po(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function fo(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){po(o,r,i,a,s,"next",e)}function s(e){po(o,r,i,a,s,"throw",e)}a(void 0)}))}}var ho=["measure","alignPre","align",null,"motion"],mo=s.forwardRef((function(e,t){var n=e.visible,r=e.prefixCls,i=e.className,o=e.style,c=e.children,l=e.zIndex,u=e.stretch,p=e.destroyPopupOnHide,d=e.forceRender,h=e.align,v=e.point,y=e.getRootDomNode,g=e.getClassNameFromAlign,b=e.onAlign,E=e.onMouseEnter,w=e.onMouseLeave,T=e.onMouseDown,_=e.onTouchStart,k=e.onClick,O=(0,s.useRef)(),S=(0,s.useRef)(),x=f((0,s.useState)(),2),C=x[0],N=x[1],A=function(e){var t=f(s.useState({width:0,height:0}),2),n=t[0],r=t[1];return[s.useMemo((function(){var t={};if(e){var r=n.width,i=n.height;-1!==e.indexOf("height")&&i?t.height=i:-1!==e.indexOf("minHeight")&&i&&(t.minHeight=i),-1!==e.indexOf("width")&&r?t.width=r:-1!==e.indexOf("minWidth")&&r&&(t.minWidth=r)}return t}),[e,n]),function(e){r({width:e.offsetWidth,height:e.offsetHeight})}]}(u),L=f(A,2),D=L[0],I=L[1],P=function(e,t){var n=f(dt(null),2),r=n[0],i=n[1],o=(0,s.useRef)();function a(e){i(e,!0)}function c(){ln.cancel(o.current)}return(0,s.useEffect)((function(){a("measure")}),[e]),(0,s.useEffect)((function(){"measure"===r&&(u&&I(y())),r&&(o.current=ln(fo(uo().mark((function e(){var t,n;return uo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=ho.indexOf(r),(n=ho[t+1])&&-1!==t&&a(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),(0,s.useEffect)((function(){return function(){c()}}),[]),[r,function(e){c(),o.current=ln((function(){a((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(n),R=f(P,2),M=R[0],j=R[1],F=f((0,s.useState)(0),2),V=F[0],Q=F[1],q=(0,s.useRef)();function U(){var e;null===(e=O.current)||void 0===e||e.forceAlign()}function G(e,t){var n=g(t);C!==n&&N(n),Q((function(e){return e+1})),"align"===M&&(null==b||b(e,t))}ft((function(){"alignPre"===M&&Q(0)}),[M]),ft((function(){"align"===M&&(V<2?U():j((function(){var e;null===(e=q.current)||void 0===e||e.call(q)})))}),[V]);var B=a({},ei(e));function K(){return new Promise((function(e){q.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=B[e];B[e]=function(e,n){return j(),null==t?void 0:t(e,n)}})),s.useEffect((function(){B.motionName||"motion"!==M||j()}),[B.motionName,M]),s.useImperativeHandle(t,(function(){return{forceAlign:U,getElement:function(){return S.current}}}));var z=a(a({},D),{},{zIndex:l,opacity:"motion"!==M&&"stable"!==M&&n?0:void 0,pointerEvents:n||"stable"===M?void 0:"none"},o),$=!0;!(null==h?void 0:h.points)||"align"!==M&&"stable"!==M||($=!1);var H=c;return s.Children.count(c)>1&&(H=s.createElement("div",{className:"".concat(r,"-content")},c)),s.createElement(Zr,Oe({visible:n,ref:S,leavedClassName:"".concat(r,"-hidden")},B,{onAppearPrepare:K,onEnterPrepare:K,removeOnLeave:p,forceRender:d}),(function(e,t){var n=e.className,o=e.style,c=m()(r,i,C,n);return s.createElement(lo,{target:v||y,key:"popup",ref:O,monitorWindowResize:!0,disabled:$,align:h,onAlign:G},s.createElement("div",{ref:t,className:c,onMouseEnter:E,onMouseLeave:w,onMouseDownCapture:T,onTouchStartCapture:_,onClick:k,style:a(a({},o),z)},H))}))}));mo.displayName="PopupInner";var vo=mo,yo=s.forwardRef((function(e,t){var n=e.prefixCls,r=e.visible,i=e.zIndex,o=e.children,c=e.mobile,l=(c=void 0===c?{}:c).popupClassName,u=c.popupStyle,p=c.popupMotion,f=void 0===p?{}:p,d=c.popupRender,h=e.onClick,v=s.useRef();s.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return v.current}}}));var y=a({zIndex:i},u),g=o;return s.Children.count(o)>1&&(g=s.createElement("div",{className:"".concat(n,"-content")},o)),d&&(g=d(g)),s.createElement(Zr,Oe({visible:r,ref:v,removeOnLeave:!0},f),(function(e,t){var r=e.className,i=e.style,o=m()(n,l,r);return s.createElement("div",{ref:t,className:o,onClick:h,style:a(a({},i),y)},g)}))}));yo.displayName="MobilePopupInner";var go=yo,bo=["visible","mobile"],Eo=s.forwardRef((function(e,t){var n=e.visible,r=e.mobile,i=d(e,bo),o=f((0,s.useState)(n),2),c=o[0],l=o[1],u=f((0,s.useState)(!1),2),p=u[0],h=u[1],m=a(a({},i),{},{visible:c});(0,s.useEffect)((function(){l(n),n&&r&&h(pr())}),[n,r]);var v=p?s.createElement(go,Oe({},m,{mobile:r,ref:t})):s.createElement(vo,Oe({},m,{ref:t}));return s.createElement("div",null,s.createElement(ti,m),v)}));Eo.displayName="Popup";var wo=Eo,To=s.createContext(null);function _o(){}var ko,Oo,So=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"],xo=(ko=lr,Oo=function(e){et(n,e);var t=it(n);function n(e){var r,i;return Ye(this,n),(r=t.call(this,e)).popupRef=s.createRef(),r.triggerRef=s.createRef(),r.portalContainer=void 0,r.attachId=void 0,r.clickOutsideHandler=void 0,r.touchOutsideHandler=void 0,r.contextMenuOutsideHandler1=void 0,r.contextMenuOutsideHandler2=void 0,r.mouseDownTimeout=void 0,r.focusTime=void 0,r.preClickTime=void 0,r.preTouchTime=void 0,r.delayTimer=void 0,r.hasPopupMouseDown=void 0,r.onMouseEnter=function(e){var t=r.props.mouseEnterDelay;r.fireEvents("onMouseEnter",e),r.delaySetPopupVisible(!0,t,t?null:e)},r.onMouseMove=function(e){r.fireEvents("onMouseMove",e),r.setPoint(e)},r.onMouseLeave=function(e){r.fireEvents("onMouseLeave",e),r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)},r.onPopupMouseEnter=function(){r.clearDelayTimer()},r.onPopupMouseLeave=function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&ar(null===(t=r.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)},r.onFocus=function(e){r.fireEvents("onFocus",e),r.clearDelayTimer(),r.isFocusToShow()&&(r.focusTime=Date.now(),r.delaySetPopupVisible(!0,r.props.focusDelay))},r.onMouseDown=function(e){r.fireEvents("onMouseDown",e),r.preClickTime=Date.now()},r.onTouchStart=function(e){r.fireEvents("onTouchStart",e),r.preTouchTime=Date.now()},r.onBlur=function(e){r.fireEvents("onBlur",e),r.clearDelayTimer(),r.isBlurToHide()&&r.delaySetPopupVisible(!1,r.props.blurDelay)},r.onContextMenu=function(e){e.preventDefault(),r.fireEvents("onContextMenu",e),r.setPopupVisible(!0,e)},r.onContextMenuClose=function(){r.isContextMenuToShow()&&r.close()},r.onClick=function(e){if(r.fireEvents("onClick",e),r.focusTime){var t;if(r.preClickTime&&r.preTouchTime?t=Math.min(r.preClickTime,r.preTouchTime):r.preClickTime?t=r.preClickTime:r.preTouchTime&&(t=r.preTouchTime),Math.abs(t-r.focusTime)<20)return;r.focusTime=0}r.preClickTime=0,r.preTouchTime=0,r.isClickToShow()&&(r.isClickToHide()||r.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!r.state.popupVisible;(r.isClickToHide()&&!n||n&&r.isClickToShow())&&r.setPopupVisible(!r.state.popupVisible,e)},r.onPopupMouseDown=function(){var e;r.hasPopupMouseDown=!0,clearTimeout(r.mouseDownTimeout),r.mouseDownTimeout=window.setTimeout((function(){r.hasPopupMouseDown=!1}),0),r.context&&(e=r.context).onPopupMouseDown.apply(e,arguments)},r.onDocumentClick=function(e){if(!r.props.mask||r.props.maskClosable){var t=e.target,n=r.getRootDomNode(),i=r.getPopupDomNode();ar(n,t)&&!r.isContextMenuOnly()||ar(i,t)||r.hasPopupMouseDown||r.close()}},r.getRootDomNode=function(){var e=r.props.getTriggerDOMNode;if(e)return e(r.triggerRef.current);try{var t=_t(r.triggerRef.current);if(t)return t}catch(e){}return Tt().findDOMNode(nt(r))},r.getPopupClassNameFromAlign=function(e){var t=[],n=r.props,i=n.popupPlacement,o=n.builtinPlacements,a=n.prefixCls,s=n.alignPoint,c=n.getPopupClassNameFromAlign;return i&&o&&t.push(function(e,t,n,r){for(var i=n.points,o=Object.keys(e),a=0;a1&&(E.motionAppear=!1);var w=E.onVisibleChanged;return E.onVisibleChanged=function(e){return m.current||e||g(!0),null==w?void 0:w(e)},y?null:s.createElement(Nn,{mode:o,locked:!m.current},s.createElement(Zr,Oe({visible:b},E,{forceRender:u,removeOnLeave:!1,leavedClassName:"".concat(l,"-hidden")}),(function(e){var n=e.className,r=e.style;return s.createElement(or,{id:t,className:n,style:r},i)})))}var Ro=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Mo=["active"],jo=function(e){var t,n=e.style,r=e.className,o=e.title,c=e.eventKey,l=(e.warnKey,e.disabled),u=e.internalPopupClose,p=e.children,h=e.itemIcon,v=e.expandIcon,y=e.popupClassName,g=e.popupOffset,b=e.onClick,E=e.onMouseEnter,w=e.onMouseLeave,T=e.onTitleClick,_=e.onTitleMouseEnter,k=e.onTitleMouseLeave,O=d(e,Ro),S=Gn(c),x=s.useContext(Cn),C=x.prefixCls,N=x.mode,A=x.openKeys,L=x.disabled,D=x.overflowDisabled,I=x.activeKey,P=x.selectedKeys,R=x.itemIcon,M=x.expandIcon,j=x.onItemClick,F=x.onOpenChange,V=x.onActive,Q=s.useContext(Bn)._internalRenderSubMenuItem,q=s.useContext(Qn).isSubPathKey,U=Vn(),G="".concat(C,"-submenu"),B=L||l,K=s.useRef(),z=s.useRef(),$=h||R,H=v||M,W=A.includes(c),Y=!D&&W,J=q(P,c),X=An(c,B,_,k),Z=X.active,ee=d(X,Mo),te=f(s.useState(!1),2),ne=te[0],re=te[1],ie=function(e){B||re(e)},oe=s.useMemo((function(){return Z||"inline"!==N&&(ne||q([I],c))}),[N,Z,I,ne,c,q]),ae=Pn(U.length),se=tr((function(e){null==b||b(Dn(e)),j(e)})),ce=S&&"".concat(S,"-popup"),le=s.createElement("div",Oe({role:"menuitem",style:ae,className:"".concat(G,"-title"),tabIndex:B?null:-1,ref:K,title:"string"==typeof o?o:null,"data-menu-id":D&&S?null:S,"aria-expanded":Y,"aria-haspopup":!0,"aria-controls":ce,"aria-disabled":B,onClick:function(e){B||(null==T||T({key:c,domEvent:e}),"inline"===N&&F(c,!W))},onFocus:function(){V(c)}},ee),o,s.createElement(In,{icon:"horizontal"!==N?H:null,props:a(a({},e),{},{isOpen:Y,isSubMenu:!0})},s.createElement("i",{className:"".concat(G,"-arrow")}))),ue=s.useRef(N);if("inline"!==N&&(ue.current=U.length>1?"vertical":N),!D){var pe=ue.current;le=s.createElement(Io,{mode:pe,prefixCls:G,visible:!u&&Y&&"inline"!==N,popupClassName:y,popupOffset:g,popup:s.createElement(Nn,{mode:"horizontal"===pe?"vertical":pe},s.createElement(or,{id:ce,ref:z},p)),disabled:B,onVisibleChange:function(e){"inline"!==N&&F(c,e)}},le)}var fe=s.createElement(kn.Item,Oe({role:"none"},O,{component:"li",style:n,className:m()(G,"".concat(G,"-").concat(N),r,(t={},i(t,"".concat(G,"-open"),Y),i(t,"".concat(G,"-active"),oe),i(t,"".concat(G,"-selected"),J),i(t,"".concat(G,"-disabled"),B),t)),onMouseEnter:function(e){ie(!0),null==E||E({key:c,domEvent:e})},onMouseLeave:function(e){ie(!1),null==w||w({key:c,domEvent:e})}}),le,!D&&s.createElement(Po,{id:ce,open:Y,keyPath:U},p));return Q&&(fe=Q(fe,e,{selected:J,active:oe,open:Y,disabled:B})),s.createElement(Nn,{onItemClick:se,mode:"horizontal"===N?"vertical":N,itemIcon:$,expandIcon:H},fe)};function Fo(e){var t,n=e.eventKey,r=e.children,i=Vn(n),o=Xn(r,i),a=jn();return s.useEffect((function(){if(a)return a.registerPath(n,i),function(){a.unregisterPath(n,i)}}),[i]),t=a?o:s.createElement(jo,e,o),s.createElement(Fn.Provider,{value:i},t)}function Vo(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(ri(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||"a"===n&&!!e.getAttribute("href"),i=e.getAttribute("tabindex"),o=Number(i),a=null;return i&&!Number.isNaN(o)?a=o:r&&null===a&&(a=0),r&&e.disabled&&(a=null),null!==a&&(a>=0||t&&a<0)}return!1}function Qo(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ke(e.querySelectorAll("*")).filter((function(e){return Vo(e,t)}));return Vo(e,t)&&n.unshift(e),n}var qo=Sn.LEFT,Uo=Sn.RIGHT,Go=Sn.UP,Bo=Sn.DOWN,Ko=Sn.ENTER,zo=Sn.ESC,$o=Sn.HOME,Ho=Sn.END,Wo=[Go,Bo,qo,Uo];function Yo(e,t){return Qo(e,!0).filter((function(e){return t.has(e)}))}function Jo(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var i=Yo(e,t),o=i.length,a=i.findIndex((function(e){return n===e}));return r<0?-1===a?a=o-1:a-=1:r>0&&(a+=1),i[a=(a+o)%o]}var Xo=Math.random().toFixed(5).toString().slice(2),Zo=0,ea="__RC_UTIL_PATH_SPLIT__",ta=function(e){return e.join(ea)},na="rc-menu-more";var ra=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],ia=[],oa=s.forwardRef((function(e,t){var n,r,o=e.prefixCls,c=void 0===o?"rc-menu":o,l=e.rootClassName,u=e.style,p=e.className,h=e.tabIndex,v=void 0===h?0:h,y=e.items,g=e.children,b=e.direction,E=e.id,w=e.mode,T=void 0===w?"vertical":w,_=e.inlineCollapsed,k=e.disabled,O=e.disabledOverflow,S=e.subMenuOpenDelay,x=void 0===S?.1:S,C=e.subMenuCloseDelay,N=void 0===C?.1:C,A=e.forceSubMenuRender,L=e.defaultOpenKeys,D=e.openKeys,I=e.activeKey,P=e.defaultActiveFirst,R=e.selectable,M=void 0===R||R,j=e.multiple,F=void 0!==j&&j,V=e.defaultSelectedKeys,Q=e.selectedKeys,q=e.onSelect,U=e.onDeselect,G=e.inlineIndent,B=void 0===G?24:G,K=e.motion,z=e.defaultMotions,$=e.triggerSubMenuAction,H=void 0===$?"hover":$,W=e.builtinPlacements,Y=e.itemIcon,J=e.expandIcon,X=e.overflowedIndicator,Z=void 0===X?"...":X,ee=e.overflowedIndicatorPopupClassName,te=e.getPopupContainer,ne=e.onClick,re=e.onOpenChange,ie=e.onKeyDown,oe=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),ae=e._internalRenderSubMenuItem,se=d(e,ra),ce=s.useMemo((function(){return er(g,y,ia)}),[g,y]),le=f(s.useState(!1),2),ue=le[0],pe=le[1],fe=s.useRef(),de=function(e){var t=f(mt(e,{value:e}),2),n=t[0],r=t[1];return s.useEffect((function(){Zo+=1;var e="".concat(Xo,"-").concat(Zo);r("rc-menu-uuid-".concat(e))}),[]),n}(E),he="rtl"===b,me=f(s.useMemo((function(){return"inline"!==T&&"vertical"!==T||!_?[T,!1]:["vertical",_]}),[T,_]),2),ve=me[0],ye=me[1],ge=f(s.useState(0),2),be=ge[0],Ee=ge[1],we=be>=ce.length-1||"horizontal"!==ve||O,Te=f(mt(L,{value:D,postState:function(e){return e||ia}}),2),_e=Te[0],Se=Te[1],xe=function(e){Se(e),null==re||re(e)},Ce=f(s.useState(_e),2),Ne=Ce[0],Ae=Ce[1],Le="inline"===ve,De=s.useRef(!1);s.useEffect((function(){Le&&Ae(_e)}),[_e]),s.useEffect((function(){De.current?Le?Se(Ne):xe(ia):De.current=!0}),[Le]);var Ie=function(){var e=f(s.useState({}),2)[1],t=(0,s.useRef)(new Map),n=(0,s.useRef)(new Map),r=f(s.useState([]),2),i=r[0],o=r[1],a=(0,s.useRef)(0),c=(0,s.useRef)(!1),l=(0,s.useCallback)((function(r,i){var o=ta(i);n.current.set(o,r),t.current.set(r,o),a.current+=1;var s,l=a.current;s=function(){l===a.current&&(c.current||e({}))},Promise.resolve().then(s)}),[]),u=(0,s.useCallback)((function(e,r){var i=ta(r);n.current.delete(i),t.current.delete(e)}),[]),p=(0,s.useCallback)((function(e){o(e)}),[]),d=(0,s.useCallback)((function(e,n){var r=(t.current.get(e)||"").split(ea);return n&&i.includes(r[0])&&r.unshift(na),r}),[i]),h=(0,s.useCallback)((function(e,t){return e.some((function(e){return d(e,!0).includes(t)}))}),[d]),m=(0,s.useCallback)((function(e){var r="".concat(t.current.get(e)).concat(ea),i=new Set;return ke(n.current.keys()).forEach((function(e){e.startsWith(r)&&i.add(n.current.get(e))})),i}),[]);return s.useEffect((function(){return function(){c.current=!0}}),[]),{registerPath:l,unregisterPath:u,refreshOverflowKeys:p,isSubPathKey:h,getKeyPath:d,getKeys:function(){var e=ke(t.current.keys());return i.length&&e.push(na),e},getSubPathKeys:m}}(),Pe=Ie.registerPath,Re=Ie.unregisterPath,Me=Ie.refreshOverflowKeys,je=Ie.isSubPathKey,Fe=Ie.getKeyPath,Ve=Ie.getKeys,Qe=Ie.getSubPathKeys,qe=s.useMemo((function(){return{registerPath:Pe,unregisterPath:Re}}),[Pe,Re]),Ue=s.useMemo((function(){return{isSubPathKey:je}}),[je]);s.useEffect((function(){Me(we?ia:ce.slice(be+1).map((function(e){return e.key})))}),[be,we]);var Ge=f(mt(I||P&&(null===(n=ce[0])||void 0===n?void 0:n.key),{value:I}),2),Be=Ge[0],Ke=Ge[1],ze=tr((function(e){Ke(e)})),$e=tr((function(){Ke(void 0)}));(0,s.useImperativeHandle)(t,(function(){return{list:fe.current,focus:function(e){var t,n,r,i,o=null!=Be?Be:null===(t=ce.find((function(e){return!e.props.disabled})))||void 0===t?void 0:t.key;o&&(null===(n=fe.current)||void 0===n||null===(r=n.querySelector("li[data-menu-id='".concat(Un(de,o),"']")))||void 0===r||null===(i=r.focus)||void 0===i||i.call(r,e))}}}));var He=f(mt(V||[],{value:Q,postState:function(e){return Array.isArray(e)?e:null==e?ia:[e]}}),2),We=He[0],Ye=He[1],Je=tr((function(e){null==ne||ne(Dn(e)),function(e){if(M){var t,n=e.key,r=We.includes(n);t=F?r?We.filter((function(e){return e!==n})):[].concat(ke(We),[n]):[n],Ye(t);var i=a(a({},e),{},{selectedKeys:t});r?null==U||U(i):null==q||q(i)}!F&&_e.length&&"inline"!==ve&&xe(ia)}(e)})),Xe=tr((function(e,t){var n=_e.filter((function(t){return t!==e}));if(t)n.push(e);else if("inline"!==ve){var r=Qe(e);n=n.filter((function(e){return!r.has(e)}))}lt()(_e,n)||xe(n)})),Ze=tr(te),et=function(e,t,n,r,o,a,c,l,u,p){var f=s.useRef(),d=s.useRef();d.current=t;var h=function(){ln.cancel(f.current)};return s.useEffect((function(){return function(){h()}}),[]),function(s){var m=s.which;if([].concat(Wo,[Ko,zo,$o,Ho]).includes(m)){var v,y,g,b=function(){return v=new Set,y=new Map,g=new Map,a().forEach((function(e){var t=document.querySelector("[data-menu-id='".concat(Un(r,e),"']"));t&&(v.add(t),g.set(t,e),y.set(e,t))})),v};b();var E=function(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}(y.get(t),v),w=g.get(E),T=function(e,t,n,r){var o,a,s,c,l="prev",u="next",p="children",f="parent";if("inline"===e&&r===Ko)return{inlineTrigger:!0};var d=(i(o={},Go,l),i(o,Bo,u),o),h=(i(a={},qo,n?u:l),i(a,Uo,n?l:u),i(a,Bo,p),i(a,Ko,p),a),m=(i(s={},Go,l),i(s,Bo,u),i(s,Ko,p),i(s,zo,f),i(s,qo,n?p:f),i(s,Uo,n?f:p),s);switch(null===(c={inline:d,horizontal:h,vertical:m,inlineSub:d,horizontalSub:m,verticalSub:m}["".concat(e).concat(t?"":"Sub")])||void 0===c?void 0:c[r]){case l:return{offset:-1,sibling:!0};case u:return{offset:1,sibling:!0};case f:return{offset:-1,sibling:!1};case p:return{offset:1,sibling:!1};default:return null}}(e,1===c(w,!0).length,n,m);if(!T&&m!==$o&&m!==Ho)return;(Wo.includes(m)||[$o,Ho].includes(m))&&s.preventDefault();var _=function(e){if(e){var t=e,n=e.querySelector("a");(null==n?void 0:n.getAttribute("href"))&&(t=n);var r=g.get(e);l(r),h(),f.current=ln((function(){d.current===r&&t.focus()}))}};if([$o,Ho].includes(m)||T.sibling||!E){var k,O,S=Yo(k=E&&"inline"!==e?function(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}(E):o.current,v);O=m===$o?S[0]:m===Ho?S[S.length-1]:Jo(k,v,E,T.offset),_(O)}else if(T.inlineTrigger)u(w);else if(T.offset>0)u(w,!0),h(),f.current=ln((function(){b();var e=E.getAttribute("aria-controls"),t=Jo(document.getElementById(e),v);_(t)}),5);else if(T.offset<0){var x=c(w,!0),C=x[x.length-2],N=y.get(C);u(C,!1),_(N)}}null==p||p(s)}}(ve,Be,he,de,fe,Ve,Fe,Ke,(function(e,t){var n=null!=t?t:!_e.includes(e);Xe(e,n)}),ie);s.useEffect((function(){pe(!0)}),[]);var tt=s.useMemo((function(){return{_internalRenderMenuItem:oe,_internalRenderSubMenuItem:ae}}),[oe,ae]),nt="horizontal"!==ve||O?ce:ce.map((function(e,t){return s.createElement(Nn,{key:e.key,overflowDisabled:t>be},e)})),rt=s.createElement(kn,Oe({id:E,ref:fe,prefixCls:"".concat(c,"-overflow"),component:"ul",itemComponent:Yn,className:m()(c,"".concat(c,"-root"),"".concat(c,"-").concat(ve),p,(r={},i(r,"".concat(c,"-inline-collapsed"),ye),i(r,"".concat(c,"-rtl"),he),r),l),dir:b,style:u,role:"menu",tabIndex:v,data:nt,renderRawItem:function(e){return e},renderRawRest:function(e){var t=e.length,n=t?ce.slice(-t):null;return s.createElement(Fo,{eventKey:na,title:Z,disabled:we,internalPopupClose:0===t,popupClassName:ee},n)},maxCount:"horizontal"!==ve||O?kn.INVALIDATE:kn.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){Ee(e)},onKeyDown:et},se));return s.createElement(Bn.Provider,{value:tt},s.createElement(qn.Provider,{value:de},s.createElement(Nn,{prefixCls:c,rootClassName:l,mode:ve,openKeys:_e,rtl:he,disabled:k,motion:ue?K:null,defaultMotions:ue?z:null,activeKey:Be,onActive:ze,onInactive:$e,selectedKeys:We,inlineIndent:B,subMenuOpenDelay:x,subMenuCloseDelay:N,forceSubMenuRender:A,builtinPlacements:W,triggerSubMenuAction:H,getPopupContainer:Ze,itemIcon:Y,expandIcon:J,onItemClick:Je,onOpenChange:Xe},s.createElement(Qn.Provider,{value:Ue},rt),s.createElement("div",{style:{display:"none"},"aria-hidden":!0},s.createElement(Mn.Provider,{value:qe},ce)))))})),aa=["className","title","eventKey","children"],sa=["children"],ca=function(e){var t=e.className,n=e.title,r=(e.eventKey,e.children),i=d(e,aa),o=s.useContext(Cn).prefixCls,a="".concat(o,"-item-group");return s.createElement("li",Oe({},i,{onClick:function(e){return e.stopPropagation()},className:m()(a,t)}),s.createElement("div",{className:"".concat(a,"-title"),title:"string"==typeof n?n:void 0},n),s.createElement("ul",{className:"".concat(a,"-list")},r))};function la(e){var t=e.children,n=d(e,sa),r=Xn(t,Vn(n.eventKey));return jn()?r:s.createElement(ca,qe(n,["warnKey"]),r)}function ua(e){var t=e.className,n=e.style,r=s.useContext(Cn).prefixCls;return jn()?null:s.createElement("li",{className:m()("".concat(r,"-item-divider"),t),style:n})}var pa=Vn,fa=oa;fa.Item=Yn,fa.SubMenu=Fo,fa.ItemGroup=la,fa.Divider=ua;var da=fa,ha=function(){for(var e=arguments.length,t=new Array(e),n=0;n=0||r.indexOf("Bottom")>=0?o.top="".concat(i.height-t.offset[1],"px"):(r.indexOf("Top")>=0||r.indexOf("bottom")>=0)&&(o.top="".concat(-t.offset[1],"px")),r.indexOf("left")>=0||r.indexOf("Right")>=0?o.left="".concat(i.width-t.offset[0],"px"):(r.indexOf("right")>=0||r.indexOf("Left")>=0)&&(o.left="".concat(-t.offset[0],"px")),e.style.transformOrigin="".concat(o.left," ").concat(o.top)}},overlayInnerStyle:R,arrowContent:s.createElement("span",{className:"".concat(O,"-arrow-content"),style:C}),motion:{motionName:ba(S,"zoom-big-fast",e.transitionName),motionDeadline:1e3}}),x?Ta(L,{className:I}):L)}));Ma.defaultProps={placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0};var ja=Ma,Fa=(0,s.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),Va=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);id)&&(V=(U=U.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(v,"$1"+e.trim());case 58:return e.trim()+t.replace(v,"$1"+e.trim());default:if(0<1*n&&0c.charCodeAt(8))break;case 115:a=a.replace(c,"-webkit-"+c)+";"+a;break;case 207:case 102:a=a.replace(c,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var fs=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&ps(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o=ms&&(ms=t+1),ds.set(e,t),hs.set(t,e)},bs="style["+cs+'][data-styled-version="5.3.5"]',Es=new RegExp("^"+cs+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),ws=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(cs))return r}}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(cs,"active"),r.setAttribute("data-styled-version","5.3.5");var a=_s();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},Os=function(){function e(e){var t=this.element=ks(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(l+=e+",")})),r+=""+s+c+'{content:"'+l+'"}/*!sc*/\n'}}}return r}(this)},e}(),Ls=/(a)(d)/gi,Ds=function(e){return String.fromCharCode(e+(e>25?39:97))};function Is(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Ds(t%52)+n;return(Ds(t%52)+n).replace(Ls,"$1-$2")}var Ps=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Rs=function(e){return Ps(5381,e)};function Ms(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=n(o,"."+a,void 0,r);t.insertRules(r,a,s)}i.push(a),this.staticRulesId=a}else{for(var c=this.rules.length,l=Ps(this.baseHash,n.hash),u="",p=0;p>>0);if(!t.hasNameForId(r,m)){var v=n(u,"."+m,void 0,r);t.insertRules(r,m,v)}i.push(m)}}return i.join(" ")},e}(),Vs=/^\s*\/\/.*$/gm,Qs=[":","[",".","#"];function qs(e){var t,n,r,i,o=void 0===e?is:e,a=o.options,s=void 0===a?is:a,c=o.plugins,l=void 0===c?rs:c,u=new Ha(s),p=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,o,a,s,c,l,u,p){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===l)return r+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(i[0]+r),"";default:return r+(0===p?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){p.push(e)})),d=function(e,r,o){return 0===r&&-1!==Qs.indexOf(o[n.length])||o.match(i)?e:"."+t};function h(e,o,a,s){void 0===s&&(s="&");var c=e.replace(Vs,""),l=o&&a?a+" "+o+" { "+c+" }":c;return t=s,n=o,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),u(a||!o?"":o,l)}return u.use([].concat(l,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,d))},f,function(e){if(-2===e){var t=p;return p=[],t}}])),h.hash=l.length?l.reduce((function(e,t){return t.name||ps(15),Ps(e,t.name)}),5381).toString():"",h}var Us=c().createContext(),Gs=(Us.Consumer,c().createContext()),Bs=(Gs.Consumer,new As),Ks=qs();function zs(){return(0,s.useContext)(Us)||Bs}function $s(e){var t=(0,s.useState)(e.stylisPlugins),n=t[0],r=t[1],i=zs(),o=(0,s.useMemo)((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),a=(0,s.useMemo)((function(){return qs({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,s.useEffect)((function(){lt()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),c().createElement(Us.Provider,{value:o},c().createElement(Gs.Provider,{value:a},e.children))}var Hs=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ks);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return ps(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Ks),this.name+e.hash},e}(),Ws=/([A-Z])/,Ys=/([A-Z])/g,Js=/^ms-/,Xs=function(e){return"-"+e.toLowerCase()};function Zs(e){return Ws.test(e)?e.replace(Ys,Xs).replace(Js,"-ms-"):e}var ec=function(e){return null==e||!1===e||""===e};function tc(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,oc=/(^-|-$)/g;function ac(e){return e.replace(ic,"-").replace(oc,"")}function sc(e){return"string"==typeof e&&!0}var cc=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},lc=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function uc(e,t,n){var r=e[n];cc(t)&&cc(r)?pc(r,t):e[n]=t}function pc(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r>>0)}("5.3.5"+n+dc[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):l,p=t.displayName,f=void 0===p?function(e){return sc(e)?"styled."+e:"Styled("+as(e)+")"}(e):p,d=t.displayName&&t.componentId?ac(t.displayName)+"-"+t.componentId:t.componentId||u,h=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,m=t.shouldForwardProp;r&&e.shouldForwardProp&&(m=t.shouldForwardProp?function(n,r,i){return e.shouldForwardProp(n,r,i)&&t.shouldForwardProp(n,r,i)}:e.shouldForwardProp);var v,y=new Fs(n,d,r?e.componentStyle:void 0),g=y.isStatic&&0===a.length,b=function(e,t){return function(e,t,n,r){var i=e.attrs,o=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,l=e.shouldForwardProp,u=e.styledComponentId,p=e.target,f=function(e,t,n){void 0===e&&(e=is);var r=es({},t,{theme:e}),i={};return n.forEach((function(e){var t,n,o,a=e;for(t in os(a)&&(a=a(r)),a)r[t]=i[t]="className"===t?(n=i[t],o=a[t],n&&o?n+" "+o:n||o):a[t]})),[r,i]}(function(e,t,n){return void 0===n&&(n=is),e.theme!==n.theme&&e.theme||t||n.theme}(t,(0,s.useContext)(fc),a)||is,t,i),d=f[0],h=f[1],m=function(e,t,n,r){var i=zs(),o=(0,s.useContext)(Gs)||Ks;return t?e.generateAndInjectStyles(is,i,o):e.generateAndInjectStyles(n,i,o)}(o,r,d),v=n,y=h.$as||t.$as||h.as||t.as||p,g=sc(y),b=h!==t?es({},t,{},h):t,E={};for(var w in b)"$"!==w[0]&&"as"!==w&&("forwardedAs"===w?E.as=b[w]:(l?l(w,Ja,y):!g||Ja(w))&&(E[w]=b[w]));return t.style&&h.style!==t.style&&(E.style=es({},t.style,{},h.style)),E.className=Array.prototype.concat(c,u,m!==u?m:null,t.className,h.className).filter(Boolean).join(" "),E.ref=v,(0,s.createElement)(y,E)}(v,e,t,g)};return b.displayName=f,(v=c().forwardRef(b)).attrs=h,v.componentStyle=y,v.displayName=f,v.shouldForwardProp=m,v.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):rs,v.styledComponentId=d,v.target=r?e.target:e,v.withComponent=function(e){var r=t.componentId,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(t,["componentId"]),o=r&&r+"-"+(sc(e)?e:ac(as(e)));return hc(e,es({},i,{attrs:h,componentId:o}),n)},Object.defineProperty(v,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?pc({},e.defaultProps,t):t}}),v.toString=function(){return"."+v.styledComponentId},i&&Za()(v,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),v}var mc,vc=function(e){return function e(t,n,r){if(void 0===r&&(r=is),!(0,$a.isValidElementType)(n))return ps(1,String(n));var i=function(){return t(n,r,rc.apply(void 0,arguments))};return i.withConfig=function(i){return e(t,n,es({},r,{},i))},i.attrs=function(i){return e(t,n,es({},r,{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},i}(hc,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){vc[e]=vc(e)})),mc=function(e,t){this.rules=e,this.componentId=t,this.isStatic=Ms(e),As.registerId(this.componentId+1)}.prototype,mc.createStyles=function(e,t,n,r){var i=r(tc(this.rules,t,n,r).join(""),""),o=this.componentId+e;n.insertRules(o,o,i)},mc.removeStyles=function(e,t){t.clearRules(this.componentId+e)},mc.renderStyles=function(e,t,n,r){e>2&&As.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=_s();return""},this.getStyleTags=function(){return e.sealed?ps(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return ps(2);var n=((t={})[cs]="",t["data-styled-version"]="5.3.5",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=_s();return r&&(n.nonce=r),[c().createElement("style",es({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new As({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?ps(2):c().createElement($s,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return ps(3)}}();var yc,gc=vc,bc=n(6428),Ec=function(e){var t,n=s.useContext(Se),r=n.getPrefixCls,o=n.direction,a=e.prefixCls,c=e.type,l=void 0===c?"horizontal":c,u=e.orientation,p=void 0===u?"center":u,f=e.orientationMargin,d=e.className,h=e.children,v=e.dashed,y=e.plain,g=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0?"-".concat(p):p,w=!!h,T="left"===p&&null!=f,_="right"===p&&null!=f,k=m()(b,"".concat(b,"-").concat(l),(i(t={},"".concat(b,"-with-text"),w),i(t,"".concat(b,"-with-text").concat(E),w),i(t,"".concat(b,"-dashed"),!!v),i(t,"".concat(b,"-plain"),!!y),i(t,"".concat(b,"-rtl"),"rtl"===o),i(t,"".concat(b,"-no-default-orientation-margin-left"),T),i(t,"".concat(b,"-no-default-orientation-margin-right"),_),t),d),O=Oe(Oe({},T&&{marginLeft:f}),_&&{marginRight:f});return s.createElement("div",Oe({className:k},g,{role:"separator"}),h&&s.createElement("span",{className:"".concat(b,"-inner-text"),style:O},h))},wc=["xxl","xl","lg","md","sm","xs"],Tc={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},_c=new Map,kc=-1,Oc={},Sc={matchHandlers:{},dispatch:function(e){return Oc=e,_c.forEach((function(e){return e(Oc)})),_c.size>=1},subscribe:function(e){return _c.size||this.register(),kc+=1,_c.set(kc,e),e(Oc),kc},unsubscribe:function(e){_c.delete(e),_c.size||this.unregister()},unregister:function(){var e=this;Object.keys(Tc).forEach((function(t){var n=Tc[t],r=e.matchHandlers[n];null==r||r.mql.removeListener(null==r?void 0:r.listener)})),_c.clear()},register:function(){var e=this;Object.keys(Tc).forEach((function(t){var n=Tc[t],r=function(n){var r=n.matches;e.dispatch(Oe(Oe({},Oc),i({},t,r)))},o=window.matchMedia(n);o.addListener(r),e.matchHandlers[n]={mql:o,listener:r},r(o)}))}},xc=(0,s.createContext)({}),Cc=(ha("top","middle","bottom","stretch"),ha("start","end","center","space-around","space-between","space-evenly"),s.forwardRef((function(e,t){var n,r=e.prefixCls,o=e.justify,a=e.align,c=e.className,l=e.style,u=e.children,p=e.gutter,d=void 0===p?0:p,h=e.wrap,v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0?C[0]/-2:void 0,D=null!=C[1]&&C[1]>0?C[1]/-2:void 0;if(L&&(A.marginLeft=L,A.marginRight=L),k){var I=f(C,2);A.rowGap=I[1]}else D&&(A.marginTop=D,A.marginBottom=D);var P=f(C,2),R=P[0],M=P[1],j=s.useMemo((function(){return{gutter:[R,M],wrap:h,supportFlexGap:k}}),[R,M,h,k]);return s.createElement(xc.Provider,{value:j},s.createElement("div",Oe({},v,{className:N,style:Oe(Oe({},A),l),ref:t}),u))}))),Nc=Cc,Ac=["xs","sm","md","lg","xl","xxl"],Lc=s.forwardRef((function(e,t){var n,r=s.useContext(Se),o=r.getPrefixCls,a=r.direction,c=s.useContext(xc),l=c.gutter,u=c.wrap,p=c.supportFlexGap,f=e.prefixCls,d=e.span,h=e.order,v=e.offset,g=e.push,b=e.pull,E=e.className,w=e.children,T=e.flex,_=e.style,k=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0){var N=l[0]/2;C.paddingLeft=N,C.paddingRight=N}if(l&&l[1]>0&&!p){var A=l[1]/2;C.paddingTop=A,C.paddingBottom=A}return T&&(C.flex=function(e){return"number"==typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(T),!1!==u||C.minWidth||(C.minWidth=0)),s.createElement("div",Oe({},k,{style:Oe(Oe({},C),_),className:x,ref:t}),w)})),Dc=Lc,Ic=s.createContext(void 0),Pc=function(e){var t,n,r=e.prefixCls,o=e.className,a=e.style,c=e.size,l=e.shape,u=m()((i(t={},"".concat(r,"-lg"),"large"===c),i(t,"".concat(r,"-sm"),"small"===c),t)),p=m()((i(n={},"".concat(r,"-circle"),"circle"===l),i(n,"".concat(r,"-square"),"square"===l),i(n,"".concat(r,"-round"),"round"===l),n)),f="number"==typeof c?{width:c,height:c,lineHeight:"".concat(c,"px")}:{};return s.createElement("span",{className:m()(r,u,p,o),style:Oe(Oe({},f),a)})},Rc=function(e){var t=e.prefixCls,n=e.className,r=e.active,o=(0,s.useContext(Se).getPrefixCls)("skeleton",t),a=qe(e,["prefixCls","className"]),c=m()(o,"".concat(o,"-element"),i({},"".concat(o,"-active"),r),n);return s.createElement("div",{className:c},s.createElement(Pc,Oe({prefixCls:"".concat(o,"-avatar")},a)))};Rc.defaultProps={size:"default",shape:"circle"};var Mc=Rc,jc=function(e){var t,n=e.prefixCls,r=e.className,o=e.active,a=e.block,c=void 0!==a&&a,l=(0,s.useContext(Se).getPrefixCls)("skeleton",n),u=qe(e,["prefixCls"]),p=m()(l,"".concat(l,"-element"),(i(t={},"".concat(l,"-active"),o),i(t,"".concat(l,"-block"),c),t),r);return s.createElement("div",{className:p},s.createElement(Pc,Oe({prefixCls:"".concat(l,"-button")},u)))};jc.defaultProps={size:"default"};var Fc=jc,Vc=function(e){var t,n=e.prefixCls,r=e.className,o=e.active,a=e.block,c=(0,s.useContext(Se).getPrefixCls)("skeleton",n),l=qe(e,["prefixCls"]),u=m()(c,"".concat(c,"-element"),(i(t={},"".concat(c,"-active"),o),i(t,"".concat(c,"-block"),a),t),r);return s.createElement("div",{className:u},s.createElement(Pc,Oe({prefixCls:"".concat(c,"-input")},l)))};Vc.defaultProps={size:"default"};var Qc=Vc,qc=function(e){var t=function(t){var n=e.width,r=e.rows,i=void 0===r?2:r;return Array.isArray(n)?n[t]:i-1===t?n:void 0},n=e.prefixCls,r=e.className,i=e.style,o=e.rows,a=ke(Array(o)).map((function(e,n){return s.createElement("li",{key:n,style:{width:t(n)}})}));return s.createElement("ul",{className:m()(n,r),style:i},a)},Uc=function(e){var t=e.prefixCls,n=e.className,r=e.width,i=e.style;return s.createElement("h3",{className:m()(t,n),style:Oe({width:r},i)})};function Gc(e){return e&&"object"===y(e)?e:{}}var Bc=function(e){var t=e.prefixCls,n=e.loading,r=e.className,o=e.style,a=e.children,c=e.avatar,l=e.title,u=e.paragraph,p=e.active,f=e.round,d=s.useContext(Se),h=d.getPrefixCls,v=d.direction,y=h("skeleton",t);if(n||!("loading"in e)){var g,b,E,w=!!c,T=!!l,_=!!u;if(w){var k=Oe(Oe({prefixCls:"".concat(y,"-avatar")},function(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}(T,_)),Gc(c));b=s.createElement("div",{className:"".concat(y,"-header")},s.createElement(Pc,Oe({},k)))}if(T||_){var O,S;if(T){var x=Oe(Oe({prefixCls:"".concat(y,"-title")},function(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}(w,_)),Gc(l));O=s.createElement(Uc,Oe({},x))}if(_){var C=Oe(Oe({prefixCls:"".concat(y,"-paragraph")},function(e,t){var n={};return e&&t||(n.width="61%"),n.rows=!e&&t?3:2,n}(w,T)),Gc(u));S=s.createElement(qc,Oe({},C))}E=s.createElement("div",{className:"".concat(y,"-content")},O,S)}var N=m()(y,(i(g={},"".concat(y,"-with-avatar"),w),i(g,"".concat(y,"-active"),p),i(g,"".concat(y,"-rtl"),"rtl"===v),i(g,"".concat(y,"-round"),f),g),r);return s.createElement("div",{className:N,style:o},b,E)}return void 0!==a?a:null};Bc.defaultProps={avatar:!1,title:!0,paragraph:!0},Bc.Button=Fc,Bc.Avatar=Mc,Bc.Input=Qc,Bc.Image=function(e){var t=e.prefixCls,n=e.className,r=e.style,i=(0,s.useContext(Se).getPrefixCls)("skeleton",t),o=m()(i,"".concat(i,"-element"),n);return s.createElement("div",{className:o},s.createElement("div",{className:m()("".concat(i,"-image"),n),style:r},s.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(i,"-image-svg")},s.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(i,"-image-path")}))))};var Kc=Bc,zc={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"},$c=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:zc}))};$c.displayName="CloseOutlined";var Hc=s.forwardRef($c),Wc={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},Yc=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:Wc}))};Yc.displayName="PlusOutlined";var Jc=s.forwardRef(Yc);function Xc(e){var t=(0,s.useRef)(),n=(0,s.useRef)(!1);return(0,s.useEffect)((function(){return n.current=!1,function(){n.current=!0,ln.cancel(t.current)}}),[]),function(){for(var r=arguments.length,i=new Array(r),o=0;ot?"left":"right"})})),2),Q=V[0],q=V[1],U=f(yl(0,(function(e,t){!F&&A&&A({direction:e>t?"top":"bottom"})})),2),G=U[0],B=U[1],K=f((0,s.useState)(0),2),z=K[0],$=K[1],H=f((0,s.useState)(0),2),W=H[0],Y=H[1],J=f((0,s.useState)(null),2),X=J[0],Z=J[1],ee=f((0,s.useState)(null),2),te=ee[0],ne=ee[1],re=f((0,s.useState)(0),2),ie=re[0],oe=re[1],ae=f((0,s.useState)(0),2),se=ae[0],ce=ae[1],le=(o=new Map,c=(0,s.useRef)([]),l=f((0,s.useState)({}),2)[1],u=(0,s.useRef)("function"==typeof o?o():o),p=Xc((function(){var e=u.current;c.current.forEach((function(t){e=t(e)})),c.current=[],u.current=e,l({})})),[u.current,function(e){c.current.push(e),p()}]),ue=f(le,2),pe=ue[0],fe=ue[1],de=function(e,t,n){return(0,s.useMemo)((function(){for(var n,r=new Map,i=t.get(null===(n=e[0])||void 0===n?void 0:n.key)||tl,o=i.left+i.width,s=0;sve?ve:e}F?T?(me=0,ve=Math.max(0,z-X)):(me=Math.min(0,X-z),ve=0):(me=Math.min(0,te-W),ve=0);var ge=(0,s.useRef)(),be=f((0,s.useState)(),2),Ee=be[0],we=be[1];function Te(){we(Date.now())}function _e(){window.clearTimeout(ge.current)}function Se(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w,t=de.get(e)||{width:0,height:0,left:0,right:0,top:0};if(F){var n=Q;T?t.rightQ+X&&(n=t.right+t.width-X):t.left<-Q?n=-t.left:t.left+t.width>-Q+X&&(n=-(t.left+t.width-X)),B(0),q(ye(n))}else{var r=G;t.top<-G?r=-t.top:t.top+t.height>-G+te&&(r=-(t.top+t.height-te)),q(0),B(ye(r))}}!function(e,t){var n=f((0,s.useState)(),2),r=n[0],i=n[1],o=f((0,s.useState)(0),2),a=o[0],c=o[1],l=f((0,s.useState)(0),2),u=l[0],p=l[1],d=f((0,s.useState)(),2),h=d[0],m=d[1],v=(0,s.useRef)(),y=(0,s.useRef)(),g=(0,s.useRef)(null);g.current={onTouchStart:function(e){var t=e.touches[0],n=t.screenX,r=t.screenY;i({x:n,y:r}),window.clearInterval(v.current)},onTouchMove:function(e){if(r){e.preventDefault();var n=e.touches[0],o=n.screenX,s=n.screenY;i({x:o,y:s});var l=o-r.x,u=s-r.y;t(l,u);var f=Date.now();c(f),p(f-a),m({x:l,y:u})}},onTouchEnd:function(){if(r&&(i(null),m(null),h)){var e=h.x/u,n=h.y/u,o=Math.abs(e),a=Math.abs(n);if(Math.max(o,a)<.1)return;var s=e,c=n;v.current=window.setInterval((function(){Math.abs(s)<.01&&Math.abs(c)<.01?window.clearInterval(v.current):t(20*(s*=vl),20*(c*=vl))}),20)}},onWheel:function(e){var n=e.deltaX,r=e.deltaY,i=0,o=Math.abs(n),a=Math.abs(r);o===a?i="x"===y.current?n:r:o>a?(i=n,y.current="x"):(i=r,y.current="y"),t(-i,-i)&&e.preventDefault()}},s.useEffect((function(){function t(e){g.current.onTouchMove(e)}function n(e){g.current.onTouchEnd(e)}return document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("touchend",n,{passive:!1}),e.current.addEventListener("touchstart",(function(e){g.current.onTouchStart(e)}),{passive:!1}),e.current.addEventListener("wheel",(function(e){g.current.onWheel(e)})),function(){document.removeEventListener("touchmove",t),document.removeEventListener("touchend",n)}}),[])}(L,(function(e,t){function n(e,t){e((function(e){return ye(e+t)}))}if(F){if(X>=z)return!1;n(q,e)}else{if(te>=W)return!1;n(B,t)}return _e(),Te(),!0})),(0,s.useEffect)((function(){return _e(),Ee&&(ge.current=window.setTimeout((function(){we(0)}),100)),_e}),[Ee]);var xe=function(e,t,n,r,i){var o,a,c,l=i.tabs,u=i.tabPosition,p=i.rtl;["top","bottom"].includes(u)?(o="width",a=p?"right":"left",c=Math.abs(t.left)):(o="height",a="top",c=-t.top);var f=t[o],d=n[o],h=r[o],m=f;return d+h>f&&dc+m){n=r-1;break}}for(var s=0,u=t-1;u>=0;u-=1)if((e.get(l[u].key)||nl)[a]0,Ge=Q+X1&&void 0!==arguments[1]?arguments[1]:1,n=Ml++,r=t;function i(){(r-=1)<=0?(e(),delete jl[n]):jl[n]=ln(i)}return jl[n]=ln(i),n}function Vl(e){return!e||null===e.offsetParent||e.hidden}function Ql(e){var t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return!(t&&t[1]&&t[2]&&t[3]&&t[1]===t[2]&&t[2]===t[3])}Fl.cancel=function(e){void 0!==e&&(ln.cancel(jl[e]),delete jl[e])},Fl.ids=jl;var ql=function(e){et(n,e);var t=it(n);function n(){var e;return Ye(this,n),(e=t.apply(this,arguments)).containerRef=s.createRef(),e.animationStart=!1,e.destroyed=!1,e.onClick=function(t,n){var r,i,o=e.props,a=o.insertExtraNode;if(!(o.disabled||!t||Vl(t)||t.className.indexOf("-leave")>=0)){e.extraNode=document.createElement("div");var s=nt(e).extraNode,c=e.context.getPrefixCls;s.className="".concat(c(""),"-click-animating-node");var l=e.getAttributeName();if(t.setAttribute(l,"true"),n&&"#ffffff"!==n&&"rgb(255, 255, 255)"!==n&&Ql(n)&&!/rgba\((?:\d*, ){3}0\)/.test(n)&&"transparent"!==n){s.style.borderColor=n;var u=(null===(r=t.getRootNode)||void 0===r?void 0:r.call(t))||t.ownerDocument,p=u instanceof Document?u.body:null!==(i=u.firstChild)&&void 0!==i?i:u;Il=X("\n [".concat(c(""),"-click-animating-without-extra-node='true']::after, .").concat(c(""),"-click-animating-node {\n --antd-wave-shadow-color: ").concat(n,";\n }"),"antd-wave",{csp:e.csp,attachTo:p})}a&&t.appendChild(s),["transition","animation"].forEach((function(n){t.addEventListener("".concat(n,"start"),e.onTransitionStart),t.addEventListener("".concat(n,"end"),e.onTransitionEnd)}))}},e.onTransitionStart=function(t){if(!e.destroyed){var n=e.containerRef.current;t&&t.target===n&&!e.animationStart&&e.resetEffect(n)}},e.onTransitionEnd=function(t){t&&"fadeEffect"===t.animationName&&e.resetEffect(t.target)},e.bindAnimationEvent=function(t){if(t&&t.getAttribute&&!t.getAttribute("disabled")&&!(t.className.indexOf("disabled")>=0)){var n=function(n){if("INPUT"!==n.target.tagName&&!Vl(n.target)){e.resetEffect(t);var r=getComputedStyle(t).getPropertyValue("border-top-color")||getComputedStyle(t).getPropertyValue("border-color")||getComputedStyle(t).getPropertyValue("background-color");e.clickWaveTimeoutId=window.setTimeout((function(){return e.onClick(t,r)}),0),Fl.cancel(e.animationStartId),e.animationStart=!0,e.animationStartId=Fl((function(){e.animationStart=!1}),10)}};return t.addEventListener("click",n,!0),{cancel:function(){t.removeEventListener("click",n,!0)}}}},e.renderWave=function(t){var n=t.csp,r=e.props.children;if(e.csp=n,!s.isValidElement(r))return r;var i=e.containerRef;return Et(r)&&(i=bt(r.ref,e.containerRef)),Ta(r,{ref:i})},e}return Xe(n,[{key:"componentDidMount",value:function(){this.destroyed=!1;var e=this.containerRef.current;e&&1===e.nodeType&&(this.instance=this.bindAnimationEvent(e))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var e=this.context.getPrefixCls,t=this.props.insertExtraNode;return"".concat(e(""),t?"-click-animating":"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(e){var t=this;if(e&&e!==this.extraNode&&e instanceof Element){var n=this.props.insertExtraNode,r=this.getAttributeName();e.setAttribute(r,"false"),Il&&(Il.innerHTML=""),n&&this.extraNode&&e.contains(this.extraNode)&&e.removeChild(this.extraNode),["transition","animation"].forEach((function(n){e.removeEventListener("".concat(n,"start"),t.onTransitionStart),e.removeEventListener("".concat(n,"end"),t.onTransitionEnd)}))}}},{key:"render",value:function(){return s.createElement(xe,null,this.renderWave)}}]),n}(s.Component);ql.contextType=Se;var Ul=(0,s.forwardRef)((function(e,t){return s.createElement(ql,Oe({ref:t},e))})),Gl=s.createContext(void 0),Bl={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},Kl=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:Bl}))};Kl.displayName="LoadingOutlined";var zl=s.forwardRef(Kl),$l=function(){return{width:0,opacity:0,transform:"scale(0)"}},Hl=function(e){return{width:e.scrollWidth,opacity:1,transform:"scale(1)"}},Wl=function(e){var t=e.prefixCls,n=!!e.loading;return e.existIcon?c().createElement("span",{className:"".concat(t,"-loading-icon")},c().createElement(zl,null)):c().createElement(Zr,{visible:n,motionName:"".concat(t,"-loading-icon-motion"),removeOnLeave:!0,onAppearStart:$l,onAppearActive:Hl,onEnterStart:$l,onEnterActive:Hl,onLeaveStart:Hl,onLeaveActive:$l},(function(e,n){var r=e.className,i=e.style;return c().createElement("span",{className:"".concat(t,"-loading-icon"),style:i,ref:n},c().createElement(zl,{className:r}))}))},Yl=/^[\u4e00-\u9fa5]{2}$/,Jl=Yl.test.bind(Yl);function Xl(e){return"text"===e||"link"===e}ha("default","primary","ghost","dashed","link","text"),ha("default","circle","round"),ha("submit","button","reset");var Zl=function(e,t){var n,r=e.loading,o=void 0!==r&&r,a=e.prefixCls,c=e.type,l=void 0===c?"default":c,u=e.danger,p=e.shape,d=void 0===p?"default":p,h=e.size,v=e.disabled,g=e.className,b=e.children,E=e.icon,w=e.ghost,T=void 0!==w&&w,_=e.block,k=void 0!==_&&_,O=e.htmlType,S=void 0===O?"button":O,x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(0,r.createElement)(nu,null,(0,r.createElement)("h2",null,"Help"),(0,r.createElement)("p",null,"On this page you will find resources to help you understand WPGraphQL, how to use GraphQL with WordPress, how to customize it and make it work for you, and how to get plugged into the community."),(0,r.createElement)(Ec,null),(0,r.createElement)("h3",null,"Documentation"),(0,r.createElement)("p",null,"Below are helpful links to the official WPGraphQL documentation."),(0,r.createElement)(Nc,{gutter:[16,16]},(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Getting Started",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/docs/introduction/",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Get Started with WPGraphQL"))]},(0,r.createElement)("p",null,"In the Getting Started are resources to learn about GraphQL, WordPress, how they work together, and more."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Beginner Guides",actions:[(0,r.createElement)("a",{target:"_blank",href:"https://www.wpgraphql.com/docs/intro-to-graphql/"},(0,r.createElement)(tu,{type:"primary"},"Beginner Guides"))]},(0,r.createElement)("p",null,"The Beginner guides go over specific topics such as GraphQL, WordPress, tools and techniques to interact with GraphQL APIs and more."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Using WPGraphQL",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/docs/posts-and-pages/",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Using WPGraphQL"))]},(0,r.createElement)("p",null,"This section covers how WPGraphQL exposes WordPress data to the Graph, and shows how you can interact with this data using GraphQL."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Advanced Concepts",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/docs/wpgraphql-concepts/",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Advanced Concepts"))]},(0,r.createElement)("p",null,'Learn about concepts such as "connections", "edges", "nodes", "what is an application data graph?" and more'," ")))),(0,r.createElement)(Ec,null),(0,r.createElement)("h3",null,"Developer Reference"),(0,r.createElement)("p",null,"Below are helpful links to the WPGraphQL developer reference. These links will be most helpful to developers looking to customize WPGraphQL"," "),(0,r.createElement)(Nc,{gutter:[16,16]},(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Recipes",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/recipes",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Recipes"))]},(0,r.createElement)("p",null,"Here you will find snippets of code you can use to customize WPGraphQL. Most snippets are PHP and intended to be included in your theme or plugin."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Actions",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/actions",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Actions"))]},(0,r.createElement)("p",null,'Here you will find an index of the WordPress "actions" that are used in the WPGraphQL codebase. Actions can be used to customize behaviors.'))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Filters",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/filters",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Filters"))]},(0,r.createElement)("p",null,'Here you will find an index of the WordPress "filters" that are used in the WPGraphQL codebase. Filters are used to customize the Schema and more.'))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Functions",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/functions",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Functions"))]},(0,r.createElement)("p",null,'Here you will find functions that can be used to customize the WPGraphQL Schema. Learn how to register GraphQL "fields", "types", and more.')))),(0,r.createElement)(Ec,null),(0,r.createElement)("h3",null,"Community"),(0,r.createElement)(Nc,{gutter:[16,16]},(0,r.createElement)(Dc,{xs:24,sm:24,md:24,lg:8,xl:8},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Blog",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/Blog",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Read the Blog"))]},(0,r.createElement)("p",null,"Keep up to date with the latest news and updates from the WPGraphQL team."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:24,lg:8,xl:8},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Extensions",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/Extensions",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"View Extensions"))]},(0,r.createElement)("p",null,"Browse the list of extensions that are available to extend WPGraphQL to work with other popular WordPress plugins."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:24,lg:8,xl:8},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Join us in Slack",actions:[(0,r.createElement)("a",{href:"https://join.slack.com/t/wp-graphql/shared_invite/zt-3vloo60z-PpJV2PFIwEathWDOxCTTLA",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Join us in Slack"))]},(0,r.createElement)("p",null,"There are more than 2,000 people in the WPGraphQL Slack community asking questions and helping each other. Join us today!"))))),iu=function(){return iu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1,o=null;if(i&&r){var a=this.state.highlight;o=c().createElement("ul",{className:"execute-options"},n.map((function(e,n){var r=e.name?e.name.value:"";return c().createElement("li",{key:r+"-"+n,className:e===a?"selected":void 0,onMouseOver:function(){return t.setState({highlight:e})},onMouseOut:function(){return t.setState({highlight:null})},onMouseUp:function(){return t._onOptionSelected(e)}},r)})))}!this.props.isRunning&&i||(e=this._onClick);var s=function(){};this.props.isRunning||!i||r||(s=this._onOptionsOpen);var l=this.props.isRunning?c().createElement("path",{d:"M 10 10 L 23 10 L 23 23 L 10 23 z"}):c().createElement("path",{d:"M 11 9 L 24 16 L 11 23 z"});return c().createElement("div",{className:"execute-button-wrap"},c().createElement("button",{type:"button",className:"execute-button",onMouseDown:s,onClick:e,title:"Execute Query (Ctrl-Enter)"},c().createElement("svg",{width:"34",height:"34"},l)),o)},t}(c().Component),Vu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}();function Qu(e){if("string"===e.type){var t=e.string.slice(1).slice(0,-1).trim();try{var n=window.location;return new URL(t,n.protocol+"//"+n.host)}catch(e){return}}}var qu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._node=null,t.state={width:null,height:null,src:null,mime:null},t}return Vu(t,e),t.shouldRender=function(e){var t=Qu(e);return!!t&&function(e){return/(bmp|gif|jpeg|jpg|png|svg)$/.test(e.pathname)}(t)},t.prototype.componentDidMount=function(){this._updateMetadata()},t.prototype.componentDidUpdate=function(){this._updateMetadata()},t.prototype.render=function(){var e,t=this,n=null;if(null!==this.state.width&&null!==this.state.height){var r=this.state.width+"x"+this.state.height;null!==this.state.mime&&(r+=" "+this.state.mime),n=c().createElement("div",null,r)}return c().createElement("div",null,c().createElement("img",{onLoad:function(){return t._updateMetadata()},ref:function(e){t._node=e},src:null===(e=Qu(this.props.token))||void 0===e?void 0:e.href}),n)},t.prototype._updateMetadata=function(){var e=this;if(this._node){var t=this._node.naturalWidth,n=this._node.naturalHeight,r=this._node.src;r!==this.state.src&&(this.setState({src:r}),fetch(r,{method:"HEAD"}).then((function(t){e.setState({mime:t.headers.get("Content-Type")})}))),t===this.state.width&&n===this.state.height||this.setState({height:n,width:t})}},t}(c().Component),Uu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Gu=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClick=function(){try{n.props.onClick(),n.setState({error:null})}catch(e){n.setState({error:e})}},n.state={error:null},n}return Uu(t,e),t.prototype.render=function(){var e=this.state.error;return c().createElement("button",{className:"toolbar-button"+(e?" error":""),onClick:this.handleClick,title:e?e.message:this.props.title,"aria-invalid":e?"true":"false"},this.props.label)},t}(c().Component);function Bu(e){var t=e.children;return c().createElement("div",{className:"toolbar-button-group"},t)}var Ku=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),zu=function(e){function t(t){var n=e.call(this,t)||this;return n._node=null,n._listener=null,n.handleOpen=function(e){Hu(e),n.setState({visible:!0}),n._subscribe()},n.state={visible:!1},n}return Ku(t,e),t.prototype.componentWillUnmount=function(){this._release()},t.prototype.render=function(){var e=this,t=this.state.visible;return c().createElement("a",{className:"toolbar-menu toolbar-button",onClick:this.handleOpen.bind(this),onMouseDown:Hu,ref:function(t){t&&(e._node=t)},title:this.props.title},this.props.label,c().createElement("svg",{width:"14",height:"8"},c().createElement("path",{fill:"#666",d:"M 5 1.5 L 14 1.5 L 9.5 7 z"})),c().createElement("ul",{className:"toolbar-menu-items"+(t?" open":"")},this.props.children))},t.prototype._subscribe=function(){this._listener||(this._listener=this.handleClick.bind(this),document.addEventListener("click",this._listener))},t.prototype._release=function(){this._listener&&(document.removeEventListener("click",this._listener),this._listener=null)},t.prototype.handleClick=function(e){this._node!==e.target&&(e.preventDefault(),this.setState({visible:!1}),this._release())},t}(c().Component),$u=function(e){var t=e.onSelect,n=e.title,r=e.label;return c().createElement("li",{onMouseOver:function(e){e.currentTarget.className="hover"},onMouseOut:function(e){e.currentTarget.className=""},onMouseDown:Hu,onMouseUp:t,title:n},r)};function Hu(e){e.preventDefault()}var Wu=n(9980),Yu=n.n(Wu),Ju=Array.from({length:11},(function(e,t){return String.fromCharCode(8192+t)})).concat(["\u2028","\u2029"," "," "]),Xu=new RegExp("["+Ju.join("")+"]","g");function Zu(e){return e.replace(Xu," ")}var ep,tp=n(5573),np=n.n(tp),rp=new(Yu());function ip(e,t,r){var i,o;n(4631).on(t,"select",(function(e,t){if(!i){var n,a=t.parentNode;(i=document.createElement("div")).className="CodeMirror-hint-information",a.appendChild(i),(o=document.createElement("div")).className="CodeMirror-hint-deprecation",a.appendChild(o),a.addEventListener("DOMNodeRemoved",n=function(e){e.target===a&&(a.removeEventListener("DOMNodeRemoved",n),i=null,o=null,n=null)})}var s=e.description?rp.render(e.description):"Self descriptive.",c=e.type?''+op(e.type)+"":"";if(i.innerHTML='
'+("

"===s.slice(0,3)?"

"+c+s.slice(3):c+s)+"

",e&&o&&e.deprecationReason){var l=e.deprecationReason?rp.render(e.deprecationReason):"";o.innerHTML='Deprecated'+l,o.style.display="block"}else o&&(o.style.display="none");r&&r(i)}))}function op(e){return e instanceof Iu.GraphQLNonNull?op(e.ofType)+"!":e instanceof Iu.GraphQLList?"["+op(e.ofType)+"]":''+np()(e.name)+""}var ap=!1;"object"==typeof window&&(ap="MacIntel"===window.navigator.platform);var sp=((ep={})[ap?"Cmd-F":"Ctrl-F"]="findPersistent",ep["Cmd-G"]="findPersistent",ep["Ctrl-G"]="findPersistent",ep["Ctrl-Left"]="goSubwordLeft",ep["Ctrl-Right"]="goSubwordRight",ep["Alt-Left"]="goGroupLeft",ep["Alt-Right"]="goGroupRight",ep),cp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),lp=function(){return lp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=65&&r<=90||!t.shiftKey&&r>=48&&r<=57||t.shiftKey&&189===r||t.shiftKey&&222===r)&&n.editor.execCommand("autocomplete")},n._onEdit=function(){n.editor&&(n.ignoreChangeEvent||(n.cachedValue=n.editor.getValue(),n.props.onEdit&&n.props.onEdit(n.cachedValue)))},n._onHasCompletion=function(e,t){ip(0,t,n.props.onHintInformationRender)},n.cachedValue=t.value||"",n}return dp(t,e),t.prototype.componentDidMount=function(){var e=this;this.CodeMirror=n(4631),n(1707),n(4328),n(2801),n(5688),n(9700),n(3256),n(2095),n(4568),n(5292),n(3412),n(6094),n(373),n(9677);var t=this.editor=this.CodeMirror(this._node,{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql-variables",theme:this.props.editorTheme||"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!this.props.readOnly&&"nocursor",foldGutter:{minFoldSize:4},lint:{variableToType:this.props.variableToType},hintOptions:{variableToType:this.props.variableToType,closeOnUnfocus:!1,completeSingle:!1,container:this._node},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:hp({"Cmd-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Alt-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Shift-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Cmd-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Ctrl-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Shift-Ctrl-P":function(){e.props.onPrettifyQuery&&e.props.onPrettifyQuery()},"Shift-Ctrl-M":function(){e.props.onMergeQuery&&e.props.onMergeQuery()}},sp)});t.on("change",this._onEdit),t.on("keyup",this._onKeyUp),t.on("hasCompletion",this._onHasCompletion)},t.prototype.componentDidUpdate=function(e){if(this.CodeMirror=n(4631),this.editor){if(this.ignoreChangeEvent=!0,this.props.variableToType!==e.variableToType&&(this.editor.options.lint.variableToType=this.props.variableToType,this.editor.options.hintOptions.variableToType=this.props.variableToType,this.CodeMirror.signal(this.editor,"change",this.editor)),this.props.value!==e.value&&this.props.value!==this.cachedValue){var t=this.props.value||"";this.cachedValue=t,this.editor.setValue(t)}this.ignoreChangeEvent=!1}},t.prototype.componentWillUnmount=function(){this.editor&&(this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null)},t.prototype.render=function(){var e=this;return c().createElement("div",{className:"codemirrorWrap",style:{position:this.props.active?"relative":"absolute",visibility:this.props.active?"visible":"hidden"},ref:function(t){e._node=t}})},t.prototype.getCodeMirror=function(){return this.editor},t.prototype.getClientHeight=function(){return this._node&&this._node.clientHeight},t}(c().Component),vp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),yp=function(){return yp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=65&&r<=90||!t.shiftKey&&r>=48&&r<=57||t.shiftKey&&189===r||t.shiftKey&&222===r)&&n.editor.execCommand("autocomplete")},n._onEdit=function(){n.editor&&(n.ignoreChangeEvent||(n.cachedValue=n.editor.getValue(),n.props.onEdit&&n.props.onEdit(n.cachedValue)))},n._onHasCompletion=function(e,t){ip(0,t,n.props.onHintInformationRender)},n.cachedValue=t.value||"",n}return vp(t,e),t.prototype.componentDidMount=function(){var e=this;this.CodeMirror=n(4631),n(1707),n(4328),n(2801),n(5688),n(9700),n(3256),n(2095),n(4568),n(5292),n(6876),n(3412);var t=this.editor=this.CodeMirror(this._node,{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:{name:"javascript",json:!0},theme:this.props.editorTheme||"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!this.props.readOnly&&"nocursor",foldGutter:{minFoldSize:4},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:yp({"Cmd-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Alt-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Shift-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Cmd-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Ctrl-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Shift-Ctrl-P":function(){e.props.onPrettifyQuery&&e.props.onPrettifyQuery()},"Shift-Ctrl-M":function(){e.props.onMergeQuery&&e.props.onMergeQuery()}},sp)});t.on("change",this._onEdit),t.on("keyup",this._onKeyUp),t.on("hasCompletion",this._onHasCompletion)},t.prototype.componentDidUpdate=function(e){if(this.CodeMirror=n(4631),this.editor){if(this.ignoreChangeEvent=!0,this.props.value!==e.value&&this.props.value!==this.cachedValue){var t=this.props.value||"";this.cachedValue=t,this.editor.setValue(t)}this.ignoreChangeEvent=!1}},t.prototype.componentWillUnmount=function(){this.editor&&(this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null)},t.prototype.render=function(){var e=this;return c().createElement("div",{className:"codemirrorWrap",style:{position:this.props.active?"relative":"absolute",visibility:this.props.active?"visible":"hidden"},ref:function(t){e._node=t}})},t.prototype.getCodeMirror=function(){return this.editor},t.prototype.getClientHeight=function(){return this._node&&this._node.clientHeight},t}(c().Component),bp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Ep=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.viewer=null,t._node=null,t}return bp(t,e),t.prototype.componentDidMount=function(){var e=n(4631);n(9700),n(5688),n(5292),n(1699),n(2095),n(4568),n(3412),n(6276);var t=this.props.ResultsTooltip,r=this.props.ImagePreview;if(t||r){n(9965);var i=document.createElement("div");e.registerHelper("info","graphql-results",(function(e,n,o,a){var s=[];return t&&s.push(c().createElement(t,{pos:a})),r&&"function"==typeof r.shouldRender&&r.shouldRender(e)&&s.push(c().createElement(r,{token:e})),s.length?(Tt().render(c().createElement("div",null,s),i),i):(Tt().unmountComponentAtNode(i),null)}))}this.viewer=e(this._node,{lineWrapping:!0,value:this.props.value||"",readOnly:!0,theme:this.props.editorTheme||"graphiql",mode:"graphql-results",keyMap:"sublime",foldGutter:{minFoldSize:4},gutters:["CodeMirror-foldgutter"],info:Boolean(this.props.ResultsTooltip||this.props.ImagePreview),extraKeys:sp})},t.prototype.shouldComponentUpdate=function(e){return this.props.value!==e.value},t.prototype.componentDidUpdate=function(){this.viewer&&this.viewer.setValue(this.props.value||"")},t.prototype.componentWillUnmount=function(){this.viewer=null},t.prototype.render=function(){var e=this;return c().createElement("section",{className:"result-window","aria-label":"Result Window","aria-live":"polite","aria-atomic":"true",ref:function(t){t&&(e.props.registerRef(t),e._node=t)}})},t.prototype.getCodeMirror=function(){return this.viewer},t.prototype.getClientHeight=function(){return this._node&&this._node.clientHeight},t}(c().Component);function wp(e){var t=e.onClick?e.onClick:function(){return null};return Tp(e.type,t)}function Tp(e,t){return e instanceof Iu.GraphQLNonNull?c().createElement("span",null,Tp(e.ofType,t),"!"):e instanceof Iu.GraphQLList?c().createElement("span",null,"[",Tp(e.ofType,t),"]"):c().createElement("a",{className:"type-name",onClick:function(n){n.preventDefault(),t(e,n)},href:"#"},null==e?void 0:e.name)}function _p(e){var t,n=e.field;return"defaultValue"in n&&void 0!==n.defaultValue?c().createElement("span",null," = ",c().createElement("span",{className:"arg-default-value"},(t=(0,Iu.astFromValue)(n.defaultValue,n.type))?(0,Iu.print)(t):"")):null}function kp(e){var t=e.arg,n=e.onClickType,r=e.showDefaultValue;return c().createElement("span",{className:"arg"},c().createElement("span",{className:"arg-name"},t.name),": ",c().createElement(wp,{type:t.type,onClick:n}),!1!==r&&c().createElement(_p,{field:t}))}function Op(e){var t=e.directive;return c().createElement("span",{className:"doc-category-item",id:t.name.value},"@",t.name.value)}var Sp=new(Yu())({breaks:!0,linkify:!0});function xp(e){var t=e.markdown,n=e.className;return t?c().createElement("div",{className:n,dangerouslySetInnerHTML:{__html:Sp.render(t)}}):c().createElement("div",null)}function Cp(e){var t,n,r,i=e.field,o=e.onClickType,a=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(c().useState(!1),2),s=a[0],l=a[1];if(i&&"args"in i&&i.args.length>0){t=c().createElement("div",{id:"doc-args",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"arguments"),i.args.filter((function(e){return!e.deprecationReason})).map((function(e){return c().createElement("div",{key:e.name,className:"doc-category-item"},c().createElement("div",null,c().createElement(kp,{arg:e,onClickType:o})),c().createElement(xp,{className:"doc-value-description",markdown:e.description}),e&&"deprecationReason"in e&&c().createElement(xp,{className:"doc-deprecation",markdown:null==e?void 0:e.deprecationReason}))})));var u=i.args.filter((function(e){return Boolean(e.deprecationReason)}));u.length>0&&(n=c().createElement("div",{id:"doc-deprecated-args",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"deprecated arguments"),s?u.map((function(e,t){return c().createElement("div",{key:t},c().createElement("div",null,c().createElement(kp,{arg:e,onClickType:o})),c().createElement(xp,{className:"doc-value-description",markdown:e.description}),e&&"deprecationReason"in e&&c().createElement(xp,{className:"doc-deprecation",markdown:null==e?void 0:e.deprecationReason}))})):c().createElement("button",{className:"show-btn",onClick:function(){return l(!s)}},"Show deprecated arguments...")))}return i&&i.astNode&&i.astNode.directives&&i.astNode.directives.length>0&&(r=c().createElement("div",{id:"doc-directives",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"directives"),i.astNode.directives.map((function(e){return c().createElement("div",{key:e.name.value,className:"doc-category-item"},c().createElement("div",null,c().createElement(Op,{directive:e})))})))),c().createElement("div",null,c().createElement(xp,{className:"doc-type-description",markdown:(null==i?void 0:i.description)||"No Description"}),i&&"deprecationReason"in i&&c().createElement(xp,{className:"doc-deprecation",markdown:null==i?void 0:i.deprecationReason}),c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"type"),c().createElement(wp,{type:null==i?void 0:i.type,onClick:o})),t,r,n)}function Np(e){var t=e.schema,n=e.onClickType,r=t.getQueryType(),i=t.getMutationType&&t.getMutationType(),o=t.getSubscriptionType&&t.getSubscriptionType();return c().createElement("div",null,c().createElement(xp,{className:"doc-type-description",markdown:t.description||"A GraphQL schema provides a root type for each kind of operation."}),c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"root types"),c().createElement("div",{className:"doc-category-item"},c().createElement("span",{className:"keyword"},"query"),": ",c().createElement(wp,{type:r,onClick:n})),i&&c().createElement("div",{className:"doc-category-item"},c().createElement("span",{className:"keyword"},"mutation"),": ",c().createElement(wp,{type:i,onClick:n})),o&&c().createElement("div",{className:"doc-category-item"},c().createElement("span",{className:"keyword"},"subscription"),": ",c().createElement(wp,{type:o,onClick:n}))))}function Ap(e,t){var n;return function(){for(var r=this,i=[],o=0;o=100)return"break";var t=p[e];if(r!==t&&Mp(e,n)&&l.push(c().createElement("div",{className:"doc-category-item",key:e},c().createElement(wp,{type:t,onClick:o}))),t&&"getFields"in t){var i=t.getFields();Object.keys(i).forEach((function(l){var p,f=i[l];if(!Mp(l,n)){if(!("args"in f)||!f.args.length)return;if(0===(p=f.args.filter((function(e){return Mp(e.name,n)}))).length)return}var d=c().createElement("div",{className:"doc-category-item",key:e+"."+l},r!==t&&[c().createElement(wp,{key:"type",type:t,onClick:o}),"."],c().createElement("a",{className:"field-name",onClick:function(e){return a(f,t,e)}},f.name),p&&["(",c().createElement("span",{key:"args"},p.map((function(e){return c().createElement(kp,{key:e.name,arg:e,onClickType:o,showDefaultValue:!1})}))),")"]);r===t?s.push(d):u.push(d)}))}};try{for(var h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(f),m=h.next();!m.done&&"break"!==d(m.value);m=h.next());}catch(t){e={error:t}}finally{try{m&&!m.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}return s.length+l.length+u.length===0?c().createElement("span",{className:"doc-alert-text"},"No results found."):r&&l.length+u.length>0?c().createElement("div",null,s,c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"other results"),l,u)):c().createElement("div",{className:"doc-search-items"},s,l,u)},t}(c().Component),Rp=Pp;function Mp(e,t){try{var n=t.replace(/[^_0-9A-Za-z]/g,(function(e){return"\\"+e}));return-1!==e.search(new RegExp(n,"i"))}catch(n){return-1!==e.toLowerCase().indexOf(t.toLowerCase())}}var jp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Fp=function(e){function t(t){var n=e.call(this,t)||this;return n.handleShowDeprecated=function(){return n.setState({showDeprecated:!0})},n.state={showDeprecated:!1},n}return jp(t,e),t.prototype.shouldComponentUpdate=function(e,t){return this.props.type!==e.type||this.props.schema!==e.schema||this.state.showDeprecated!==t.showDeprecated},t.prototype.render=function(){var e,t,n,r,i,o=this.props.schema,a=this.props.type,s=this.props.onClickType,l=this.props.onClickField,u=null,p=[];if(a instanceof Iu.GraphQLUnionType?(u="possible types",p=o.getPossibleTypes(a)):a instanceof Iu.GraphQLInterfaceType?(u="implementations",p=o.getPossibleTypes(a)):a instanceof Iu.GraphQLObjectType&&(u="implements",p=a.getInterfaces()),p&&p.length>0&&(e=c().createElement("div",{id:"doc-types",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},u),p.map((function(e){return c().createElement("div",{key:e.name,className:"doc-category-item"},c().createElement(wp,{type:e,onClick:s}))})))),a&&"getFields"in a){var f=a.getFields(),d=Object.keys(f).map((function(e){return f[e]}));t=c().createElement("div",{id:"doc-fields",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"fields"),d.filter((function(e){return!e.deprecationReason})).map((function(e){return c().createElement(Vp,{key:e.name,type:a,field:e,onClickType:s,onClickField:l})})));var h=d.filter((function(e){return Boolean(e.deprecationReason)}));h.length>0&&(n=c().createElement("div",{id:"doc-deprecated-fields",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"deprecated fields"),this.state.showDeprecated?h.map((function(e){return c().createElement(Vp,{key:e.name,type:a,field:e,onClickType:s,onClickField:l})})):c().createElement("button",{className:"show-btn",onClick:this.handleShowDeprecated},"Show deprecated fields...")))}if(a instanceof Iu.GraphQLEnumType){var m=a.getValues();r=c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"values"),m.filter((function(e){return Boolean(!e.deprecationReason)})).map((function(e){return c().createElement(Qp,{key:e.name,value:e})})));var v=m.filter((function(e){return Boolean(e.deprecationReason)}));v.length>0&&(i=c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"deprecated values"),this.state.showDeprecated?v.map((function(e){return c().createElement(Qp,{key:e.name,value:e})})):c().createElement("button",{className:"show-btn",onClick:this.handleShowDeprecated},"Show deprecated values...")))}return c().createElement("div",null,c().createElement(xp,{className:"doc-type-description",markdown:"description"in a&&a.description||"No Description"}),a instanceof Iu.GraphQLObjectType&&e,t,n,r,i,!(a instanceof Iu.GraphQLObjectType)&&e)},t}(c().Component);function Vp(e){var t=e.type,n=e.field,r=e.onClickType,i=e.onClickField;return c().createElement("div",{className:"doc-category-item"},c().createElement("a",{className:"field-name",onClick:function(e){return i(n,t,e)}},n.name),"args"in n&&n.args&&n.args.length>0&&["(",c().createElement("span",{key:"args"},n.args.filter((function(e){return!e.deprecationReason})).map((function(e){return c().createElement(kp,{key:e.name,arg:e,onClickType:r})}))),")"],": ",c().createElement(wp,{type:n.type,onClick:r}),c().createElement(_p,{field:n}),n.description&&c().createElement(xp,{className:"field-short-description",markdown:n.description}),"deprecationReason"in n&&n.deprecationReason&&c().createElement(xp,{className:"doc-deprecation",markdown:n.deprecationReason}))}function Qp(e){var t=e.value;return c().createElement("div",{className:"doc-category-item"},c().createElement("div",{className:"enum-value"},t.name),c().createElement(xp,{className:"doc-value-description",markdown:t.description}),t.deprecationReason&&c().createElement(xp,{className:"doc-deprecation",markdown:t.deprecationReason}))}var qp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Up=function(){return Up=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1&&n.setState({navStack:n.state.navStack.slice(0,-1)})},n.handleClickType=function(e){n.showDoc(e)},n.handleClickField=function(e){n.showDoc(e)},n.handleSearch=function(e){n.showSearch(e)},n.state={navStack:[Gp]},n}return qp(t,e),t.prototype.shouldComponentUpdate=function(e,t){return this.props.schema!==e.schema||this.state.navStack!==t.navStack||this.props.schemaErrors!==e.schemaErrors},t.prototype.render=function(){var e,t=this.props,n=t.schema,r=t.schemaErrors,i=this.state.navStack,o=i[i.length-1];e=r?c().createElement("div",{className:"error-container"},"Error fetching schema"):void 0===n?c().createElement("div",{className:"spinner-container"},c().createElement("div",{className:"spinner"})):n?o.search?c().createElement(Rp,{searchValue:o.search,withinType:o.def,schema:n,onClickType:this.handleClickType,onClickField:this.handleClickField}):1===i.length?c().createElement(Np,{schema:n,onClickType:this.handleClickType}):(0,Iu.isType)(o.def)?c().createElement(Fp,{schema:n,type:o.def,onClickType:this.handleClickType,onClickField:this.handleClickField}):c().createElement(Cp,{field:o.def,onClickType:this.handleClickType}):c().createElement("div",{className:"error-container"},"No Schema Available");var a,s=1===i.length||(0,Iu.isType)(o.def)&&"getFields"in o.def;return i.length>1&&(a=i[i.length-2].name),c().createElement("section",{className:"doc-explorer",key:o.name,"aria-label":"Documentation Explorer"},c().createElement("div",{className:"doc-explorer-title-bar"},a&&c().createElement("button",{className:"doc-explorer-back",onClick:this.handleNavBackClick,"aria-label":"Go back to "+a},a),c().createElement("div",{className:"doc-explorer-title"},o.title||o.name),c().createElement("div",{className:"doc-explorer-rhs"},this.props.children)),c().createElement("div",{className:"doc-explorer-contents"},s&&c().createElement(Dp,{value:o.search,placeholder:"Search "+o.name+"...",onSearch:this.handleSearch}),e))},t.prototype.showDoc=function(e){var t=this.state.navStack;t[t.length-1].def!==e&&this.setState({navStack:t.concat([{name:e.name,def:e}])})},t.prototype.showDocForReference=function(e){e&&"Type"===e.kind?this.showDoc(e.type):"Field"===e.kind||"Argument"===e.kind&&e.field?this.showDoc(e.field):"EnumValue"===e.kind&&e.type&&this.showDoc(e.type)},t.prototype.showSearch=function(e){var t=this.state.navStack.slice(),n=t[t.length-1];t[t.length-1]=Up(Up({},n),{search:e}),this.setState({navStack:t})},t.prototype.reset=function(){this.setState({navStack:[Gp]})},t}(c().Component),Kp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),zp=function(e){function t(t){var n=e.call(this,t)||this;return n.state={editable:!1},n.editField=null,n}return Kp(t,e),t.prototype.render=function(){var e,t=this,n=this.props.label||this.props.operationName||(null===(e=this.props.query)||void 0===e?void 0:e.split("\n").filter((function(e){return 0!==e.indexOf("#")})).join("")),r=this.props.favorite?"★":"☆";return c().createElement("li",{className:this.state.editable?"editable":void 0},this.state.editable?c().createElement("input",{type:"text",defaultValue:this.props.label,ref:function(e){t.editField=e},onBlur:this.handleFieldBlur.bind(this),onKeyDown:this.handleFieldKeyDown.bind(this),placeholder:"Type a label"}):c().createElement("button",{className:"history-label",onClick:this.handleClick.bind(this)},n),c().createElement("button",{onClick:this.handleEditClick.bind(this),"aria-label":"Edit label"},"✎"),c().createElement("button",{className:this.props.favorite?"favorited":void 0,onClick:this.handleStarClick.bind(this),"aria-label":this.props.favorite?"Remove favorite":"Add favorite"},r))},t.prototype.handleClick=function(){this.props.onSelect(this.props.query,this.props.variables,this.props.headers,this.props.operationName,this.props.label)},t.prototype.handleStarClick=function(e){e.stopPropagation(),this.props.handleToggleFavorite(this.props.query,this.props.variables,this.props.headers,this.props.operationName,this.props.label,this.props.favorite)},t.prototype.handleFieldBlur=function(e){e.stopPropagation(),this.setState({editable:!1}),this.props.handleEditLabel(this.props.query,this.props.variables,this.props.headers,this.props.operationName,e.target.value,this.props.favorite)},t.prototype.handleFieldKeyDown=function(e){13===e.keyCode&&(e.stopPropagation(),this.setState({editable:!1}),this.props.handleEditLabel(this.props.query,this.props.variables,this.props.headers,this.props.operationName,e.currentTarget.value,this.props.favorite))},t.prototype.handleEditClick=function(e){var t=this;e.stopPropagation(),this.setState({editable:!0},(function(){t.editField&&t.editField.focus()}))},t}(c().Component),$p=zp,Hp=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Wp=function(){function e(e,t,n){void 0===n&&(n=null),this.key=e,this.storage=t,this.maxSize=n,this.items=this.fetchAll()}return Object.defineProperty(e.prototype,"length",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),e.prototype.contains=function(e){return this.items.some((function(t){return t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName}))},e.prototype.edit=function(e){var t=this.items.findIndex((function(t){return t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName}));-1!==t&&(this.items.splice(t,1,e),this.save())},e.prototype.delete=function(e){var t=this.items.findIndex((function(t){return t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName}));-1!==t&&(this.items.splice(t,1),this.save())},e.prototype.fetchRecent=function(){return this.items[this.items.length-1]},e.prototype.fetchAll=function(){var e=this.storage.get(this.key);return e?JSON.parse(e)[this.key]:[]},e.prototype.push=function(e){var t,n=function(){for(var e=[],t=0;tthis.maxSize&&n.shift();for(var r=0;r<5;r++){var i=this.storage.set(this.key,JSON.stringify(((t={})[this.key]=n,t)));if(i&&i.error){if(!i.isQuotaError||!this.maxSize)return;n.shift()}else this.items=n}},e.prototype.save=function(){var e;this.storage.set(this.key,JSON.stringify(((e={})[this.key]=this.items,e)))},e}(),Yp=Wp,Jp=function(){return Jp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Zp=function(){for(var e=[],t=0;t1e5)return!1;if(!r)return!0;if(JSON.stringify(e)===JSON.stringify(r.query)){if(JSON.stringify(t)===JSON.stringify(r.variables)){if(JSON.stringify(n)===JSON.stringify(r.headers))return!1;if(n&&!r.headers)return!1}if(t&&!r.variables)return!1}return!0},this.fetchAllQueries=function(){var e=n.history.fetchAll(),t=n.favorite.fetchAll();return e.concat(t)},this.updateHistory=function(e,t,r,i){if(n.shouldSaveQuery(e,t,r,n.history.fetchRecent())){n.history.push({query:e,variables:t,headers:r,operationName:i});var o=n.history.items,a=n.favorite.items;n.queries=o.concat(a)}},this.toggleFavorite=function(e,t,r,i,o,a){var s={query:e,variables:t,headers:r,operationName:i,label:o};n.favorite.contains(s)?a&&(s.favorite=!1,n.favorite.delete(s)):(s.favorite=!0,n.favorite.push(s)),n.queries=Zp(n.history.items,n.favorite.items)},this.editLabel=function(e,t,r,i,o,a){var s={query:e,variables:t,headers:r,operationName:i,label:o};a?n.favorite.edit(Jp(Jp({},s),{favorite:a})):n.history.edit(s),n.queries=Zp(n.history.items,n.favorite.items)},this.history=new Yp("queries",this.storage,this.maxHistoryLength),this.favorite=new Yp("favorites",this.storage,null),this.queries=this.fetchAllQueries()},tf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),nf=function(){return nf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yf=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},gf=function(){for(var e=[],t=0;t=0)continue;c.push(f)}var d=e[p.name.value];if(d){var h=d.typeCondition,m=d.directives,v=d.selectionSet;p={kind:Iu.Kind.INLINE_FRAGMENT,typeCondition:h,directives:m,selectionSet:v}}}if(p.kind===Iu.Kind.INLINE_FRAGMENT&&(!p.directives||0===(null===(o=p.directives)||void 0===o?void 0:o.length))){var y=p.typeCondition?p.typeCondition.name.value:null;if(!y||y===a){s.push.apply(s,gf(bf(e,p.selectionSet.selections,n)));continue}}s.push(p)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return s}function Ef(e,t){var n,r,i=t?new Iu.TypeInfo(t):null,o=Object.create(null);try{for(var a=vf(e.definitions),s=a.next();!s.done;s=a.next()){var c=s.value;c.kind===Iu.Kind.FRAGMENT_DEFINITION&&(o[c.name.value]=c)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}var l={SelectionSet:function(e){var t=i?i.getParentType():null,n=e.selections;return n=function(e,t){var n,r,i,o=new Map,a=[];try{for(var s=vf(e),c=s.next();!c.done;c=s.next()){var l=c.value;if("Field"===l.kind){var u=(i=l).alias?i.alias.value:i.name.value,p=o.get(u);if(l.directives&&l.directives.length){var f=mf({},l);a.push(f)}else p&&p.selectionSet&&l.selectionSet?p.selectionSet.selections=gf(p.selectionSet.selections,l.selectionSet.selections):p||(f=mf({},l),o.set(u,f),a.push(f))}else a.push(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a}(n=bf(o,n,t)),mf(mf({},e),{selections:n})},FragmentDefinition:function(){return null}};return(0,Iu.visit)(e,i?(0,Iu.visitWithTypeInfo)(i,l):l)}function wf(e,t,n){if("object"==typeof e&&"object"==typeof t){if(Array.isArray(e)&&Array.isArray(t))for(n=0;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Nf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};if(parseInt(c().version.slice(0,2),10)<16)throw Error(["GraphiQL 0.18.0 and after is not compatible with React 15 or below.","If you are using a CDN source (jsdelivr, unpkg, etc), follow this example:","https://github.com/graphql/graphiql/blob/master/examples/graphiql-cdn/index.html#L49"].join("\n"));var Af=function(e){return JSON.stringify(e,null,2)},Lf=function(e){return e instanceof Iu.GraphQLError?e.toString():e instanceof Error?function(e){return kf(kf({},e),{message:e.message,stack:e.stack})}(e):e},Df=function(e){function t(n){var r,i,o,a,s,c,l=e.call(this,n)||this;if(l._editorQueryID=0,l.safeSetState=function(e,t){l.componentIsMounted&&l.setState(e,t)},l.handleClickReference=function(e){l.setState({docExplorerOpen:!0},(function(){l.docExplorerComponent&&l.docExplorerComponent.showDocForReference(e)})),l._storage.set("docExplorerOpen",JSON.stringify(l.state.docExplorerOpen))},l.handleRunQuery=function(e){return Of(l,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,p=this;return Sf(this,(function(f){switch(f.label){case 0:this._editorQueryID++,n=this._editorQueryID,r=this.autoCompleteLeafs()||this.state.query,i=this.state.variables,o=this.state.headers,a=this.state.shouldPersistHeaders,s=this.state.operationName,e&&e!==s&&(s=e,this.handleEditOperationName(s)),f.label=1;case 1:return f.trys.push([1,3,,4]),this.setState({isWaitingForResponse:!0,response:void 0,operationName:s}),this._storage.set("operationName",s),this._queryHistory?this._queryHistory.onUpdateHistory(r,i,o,s):this._historyStore&&this._historyStore.updateHistory(r,i,o,s),c={data:{}},[4,this._fetchQuery(r,i,o,s,a,(function(e){var r,i;if(n===p._editorQueryID){var o=!!Array.isArray(e)&&e;if(!o&&"string"!=typeof e&&null!==e&&"hasNext"in e&&(o=[e]),o){var a={data:c.data},s=function(){for(var e=[],t=0;t0&&(w=t.formatError(_),E=void 0,T=_)}return l._introspectionQuery=(0,Iu.getIntrospectionQuery)({schemaDescription:null!==(a=n.schemaDescription)&&void 0!==a?a:void 0,inputValueDeprecation:null!==(s=n.inputValueDeprecation)&&void 0!==s?s:void 0}),l._introspectionQueryName=null!==(c=n.introspectionQueryName)&&void 0!==c?c:"IntrospectionQuery",l._introspectionQuerySansSubscriptions=l._introspectionQuery.replace("subscriptionType { name }",""),l.state=kf({schema:E,query:f,variables:h,headers:m,operationName:v,docExplorerOpen:y,schemaErrors:T,response:w,editorFlex:Number(l._storage.get("editorFlex"))||1,secondaryEditorOpen:p,secondaryEditorHeight:Number(l._storage.get("secondaryEditorHeight"))||200,variableEditorActive:"true"!==l._storage.get("variableEditorActive")&&!n.headerEditorEnabled||"true"!==l._storage.get("headerEditorActive"),headerEditorActive:"true"===l._storage.get("headerEditorActive"),headerEditorEnabled:g,shouldPersistHeaders:b,historyPaneOpen:"true"===l._storage.get("historyPaneOpen")||!1,docExplorerWidth:Number(l._storage.get("docExplorerWidth"))||350,isWaitingForResponse:!1,subscription:null,maxHistoryLength:u},d),l}return _f(t,e),t.formatResult=function(e){return JSON.stringify(e,null,2)},t.prototype.componentDidMount=function(){this.componentIsMounted=!0,void 0===this.state.schema&&this.fetchSchema(),this.codeMirrorSizer=new of,void 0!==n.g&&(n.g.g=this)},t.prototype.UNSAFE_componentWillMount=function(){this.componentIsMounted=!1},t.prototype.UNSAFE_componentWillReceiveProps=function(e){var t=this,n=this.state.schema,r=this.state.query,i=this.state.variables,o=this.state.headers,a=this.state.operationName,s=this.state.response;if(void 0!==e.schema&&(n=e.schema),void 0!==e.query&&this.props.query!==e.query&&(r=e.query),void 0!==e.variables&&this.props.variables!==e.variables&&(i=e.variables),void 0!==e.headers&&this.props.headers!==e.headers&&(o=e.headers),void 0!==e.operationName&&(a=e.operationName),void 0!==e.response&&(s=e.response),r&&n&&(n!==this.state.schema||r!==this.state.query||a!==this.state.operationName)){if(!this.props.dangerouslyAssumeSchemaIsValid){var c=(0,Iu.validateSchema)(n);c&&c.length>0&&(this.handleSchemaErrors(c),n=void 0)}var l=this._updateQueryFacts(r,a,this.state.operations,n);void 0!==l&&(a=l.operationName,this.setState(l))}void 0===e.schema&&e.fetcher!==this.props.fetcher&&(n=void 0),this._storage.set("operationName",a),this.setState({schema:n,query:r,variables:i,headers:o,operationName:a,response:s},(function(){void 0===t.state.schema&&(t.docExplorerComponent&&t.docExplorerComponent.reset(),t.fetchSchema())}))},t.prototype.componentDidUpdate=function(){this.codeMirrorSizer.updateSizes([this.queryEditorComponent,this.variableEditorComponent,this.headerEditorComponent,this.resultComponent])},t.prototype.render=function(){var e,n=this,r=c().Children.toArray(this.props.children),i=cf(r,(function(e){return qf(e,t.Logo)}))||c().createElement(t.Logo,null),o=cf(r,(function(e){return qf(e,t.Toolbar)}))||c().createElement(t.Toolbar,null,c().createElement(Gu,{onClick:this.handlePrettifyQuery,title:"Prettify Query (Shift-Ctrl-P)",label:"Prettify"}),c().createElement(Gu,{onClick:this.handleMergeQuery,title:"Merge Query (Shift-Ctrl-M)",label:"Merge"}),c().createElement(Gu,{onClick:this.handleCopyQuery,title:"Copy Query (Shift-Ctrl-C)",label:"Copy"}),c().createElement(Gu,{onClick:this.handleToggleHistory,title:"Show History",label:"History"}),(null===(e=this.props.toolbar)||void 0===e?void 0:e.additionalContent)?this.props.toolbar.additionalContent:null),a=cf(r,(function(e){return qf(e,t.Footer)})),s={WebkitFlex:this.state.editorFlex,flex:this.state.editorFlex},l={display:"block",width:this.state.docExplorerWidth},u="docExplorerWrap"+(this.state.docExplorerWidth<200?" doc-explorer-narrow":""),p={display:this.state.historyPaneOpen?"block":"none",width:"230px",zIndex:7},f=this.state.secondaryEditorOpen,d={height:f?this.state.secondaryEditorHeight:void 0};return c().createElement("div",{ref:function(e){n.graphiqlContainer=e},className:"graphiql-container"},this.state.historyPaneOpen&&c().createElement("div",{className:"historyPaneWrap",style:p},c().createElement(rf,{ref:function(e){n._queryHistory=e},operationName:this.state.operationName,query:this.state.query,variables:this.state.variables,onSelectQuery:this.handleSelectHistoryQuery,storage:this._storage,maxHistoryLength:this.state.maxHistoryLength,queryID:this._editorQueryID},c().createElement("button",{className:"docExplorerHide",onClick:this.handleToggleHistory,"aria-label":"Close History"},"✕"))),c().createElement("div",{className:"editorWrap"},c().createElement("div",{className:"topBarWrap"},this.props.beforeTopBarContent,c().createElement("div",{className:"topBar"},i,c().createElement(Fu,{isRunning:Boolean(this.state.subscription),onRun:this.handleRunQuery,onStop:this.handleStopQuery,operations:this.state.operations}),o),!this.state.docExplorerOpen&&c().createElement("button",{className:"docExplorerShow",onClick:this.handleToggleDocs,"aria-label":"Open Documentation Explorer"},"Docs")),c().createElement("div",{ref:function(e){n.editorBarComponent=e},className:"editorBar",onDoubleClick:this.handleResetResize,onMouseDown:this.handleResizeStart},c().createElement("div",{className:"queryWrap",style:s},c().createElement(fp,{ref:function(e){n.queryEditorComponent=e},schema:this.state.schema,validationRules:this.props.validationRules,value:this.state.query,onEdit:this.handleEditQuery,onHintInformationRender:this.handleHintInformationRender,onClickReference:this.handleClickReference,onCopyQuery:this.handleCopyQuery,onPrettifyQuery:this.handlePrettifyQuery,onMergeQuery:this.handleMergeQuery,onRunQuery:this.handleEditorRunQuery,editorTheme:this.props.editorTheme,readOnly:this.props.readOnly,externalFragments:this.props.externalFragments}),c().createElement("section",{className:"variable-editor secondary-editor",style:d,"aria-label":this.state.variableEditorActive?"Query Variables":"Request Headers"},c().createElement("div",{className:"secondary-editor-title variable-editor-title",id:"secondary-editor-title",style:{cursor:f?"row-resize":"n-resize"},onMouseDown:this.handleSecondaryEditorResizeStart},c().createElement("div",{className:"variable-editor-title-text"+(this.state.variableEditorActive?" active":""),onClick:this.handleOpenVariableEditorTab,onMouseDown:this.handleTabClickPropogation},"Query Variables"),this.state.headerEditorEnabled&&c().createElement("div",{style:{marginLeft:"20px"},className:"variable-editor-title-text"+(this.state.headerEditorActive?" active":""),onClick:this.handleOpenHeaderEditorTab,onMouseDown:this.handleTabClickPropogation},"Request Headers")),c().createElement(mp,{ref:function(e){n.variableEditorComponent=e},value:this.state.variables,variableToType:this.state.variableToType,onEdit:this.handleEditVariables,onHintInformationRender:this.handleHintInformationRender,onPrettifyQuery:this.handlePrettifyQuery,onMergeQuery:this.handleMergeQuery,onRunQuery:this.handleEditorRunQuery,editorTheme:this.props.editorTheme,readOnly:this.props.readOnly,active:this.state.variableEditorActive}),this.state.headerEditorEnabled&&c().createElement(gp,{ref:function(e){n.headerEditorComponent=e},value:this.state.headers,onEdit:this.handleEditHeaders,onHintInformationRender:this.handleHintInformationRender,onPrettifyQuery:this.handlePrettifyQuery,onMergeQuery:this.handleMergeQuery,onRunQuery:this.handleEditorRunQuery,editorTheme:this.props.editorTheme,readOnly:this.props.readOnly,active:this.state.headerEditorActive}))),c().createElement("div",{className:"resultWrap"},this.state.isWaitingForResponse&&c().createElement("div",{className:"spinner-container"},c().createElement("div",{className:"spinner"})),c().createElement(Ep,{registerRef:function(e){n.resultViewerElement=e},ref:function(e){n.resultComponent=e},value:this.state.response,editorTheme:this.props.editorTheme,ResultsTooltip:this.props.ResultsTooltip,ImagePreview:qu}),a))),this.state.docExplorerOpen&&c().createElement("div",{className:u,style:l},c().createElement("div",{className:"docExplorerResizer",onDoubleClick:this.handleDocsResetResize,onMouseDown:this.handleDocsResizeStart}),c().createElement(Bp,{ref:function(e){n.docExplorerComponent=e},schemaErrors:this.state.schemaErrors,schema:this.state.schema},c().createElement("button",{className:"docExplorerHide",onClick:this.handleToggleDocs,"aria-label":"Close Documentation Explorer"},"✕"))))},t.prototype.getQueryEditor=function(){if(this.queryEditorComponent)return this.queryEditorComponent.getCodeMirror()},t.prototype.getVariableEditor=function(){return this.variableEditorComponent?this.variableEditorComponent.getCodeMirror():null},t.prototype.getHeaderEditor=function(){return this.headerEditorComponent?this.headerEditorComponent.getCodeMirror():null},t.prototype.refresh=function(){this.queryEditorComponent&&this.queryEditorComponent.getCodeMirror().refresh(),this.variableEditorComponent&&this.variableEditorComponent.getCodeMirror().refresh(),this.headerEditorComponent&&this.headerEditorComponent.getCodeMirror().refresh(),this.resultComponent&&this.resultComponent.getCodeMirror().refresh()},t.prototype.autoCompleteLeafs=function(){var e=lf(this.state.schema,this.state.query,this.props.getDefaultFieldNames),t=e.insertions,n=e.result;if(t&&t.length>0){var r=this.getQueryEditor();r&&r.operation((function(){var e=r.getCursor(),i=r.indexFromPos(e);r.setValue(n||"");var o=0,a=t.map((function(e){var t=e.index,n=e.string;return r.markText(r.posFromIndex(t+o),r.posFromIndex(t+(o+=n.length)),{className:"autoInsertedLeaf",clearOnEnter:!0,title:"Automatically added leaf fields"})}));setTimeout((function(){return a.forEach((function(e){return e.clear()}))}),7e3);var s=i;t.forEach((function(e){var t=e.index,n=e.string;t2?r.headers=JSON.parse(this.state.headers):this.props.headers&&(r.headers=JSON.parse(this.props.headers));var i=Qf(n({query:this._introspectionQuery,operationName:this._introspectionQueryName},r));jf(i)?i.then((function(t){if("string"!=typeof t&&"data"in t)return t;var o=Qf(n({query:e._introspectionQuerySansSubscriptions,operationName:e._introspectionQueryName},r));if(!jf(i))throw new Error("Fetcher did not return a Promise for introspection.");return o})).then((function(n){var r,i;if(void 0===e.state.schema)if(n&&n.data&&"__schema"in(null==n?void 0:n.data)){var o=(0,Iu.buildClientSchema)(n.data);if(!e.props.dangerouslyAssumeSchemaIsValid){var a=(0,Iu.validateSchema)(o);a&&a.length>0&&(o=void 0,e.handleSchemaErrors(a))}if(o){var s=(0,Mu.getOperationFacts)(o,e.state.query);e.safeSetState(kf(kf({schema:o},s),{schemaErrors:void 0})),null===(i=(r=e.props).onSchemaChange)||void 0===i||i.call(r,o)}}else{var c="string"==typeof n?n:t.formatResult(n);e.handleSchemaErrors([c])}})).catch((function(t){e.handleSchemaErrors([t])})):this.setState({response:"Fetcher did not return a Promise for introspection."})},t.prototype.handleSchemaErrors=function(e){this.safeSetState({response:e?t.formatError(e):void 0,schema:void 0,schemaErrors:e})},t.prototype._fetchQuery=function(e,n,r,i,o,a){return Of(this,void 0,void 0,(function(){var s,c,l,u,p,f,d=this;return Sf(this,(function(h){s=this.props.fetcher,c=null,l=null;try{c=n&&""!==n.trim()?JSON.parse(n):null}catch(e){throw new Error("Variables are invalid JSON: "+e.message+".")}if("object"!=typeof c)throw new Error("Variables are not a JSON object.");try{l=r&&""!==r.trim()?JSON.parse(r):null}catch(e){throw new Error("Headers are invalid JSON: "+e.message+".")}if("object"!=typeof l)throw new Error("Headers are not a JSON object.");return this.props.externalFragments&&(u=new Map,Array.isArray(this.props.externalFragments)?this.props.externalFragments.forEach((function(e){u.set(e.name.value,e)})):(0,Iu.visit)((0,Iu.parse)(this.props.externalFragments,{}),{FragmentDefinition:function(e){u.set(e.name.value,e)}}),(p=(0,Mu.getFragmentDependenciesForAST)(this.state.documentAST,u)).length>0&&(e+="\n"+p.map((function(e){return(0,Iu.print)(e)})).join("\n"))),f=s({query:e,variables:c,operationName:i},{headers:l,shouldPersistHeaders:o,documentAST:this.state.documentAST}),[2,Promise.resolve(f).then((function(e){return Ff(e)?e.subscribe({next:a,error:function(e){d.safeSetState({isWaitingForResponse:!1,response:e?t.formatError(e):void 0,subscription:null})},complete:function(){d.safeSetState({isWaitingForResponse:!1,subscription:null})}}):Vf(e)?(Of(d,void 0,void 0,(function(){var n,r,i,o,s,c,l;return Sf(this,(function(u){switch(u.label){case 0:u.trys.push([0,13,,14]),u.label=1;case 1:u.trys.push([1,6,7,12]),n=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof Nf?Nf(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}(e),u.label=2;case 2:return[4,n.next()];case 3:if((r=u.sent()).done)return[3,5];i=r.value,a(i),u.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return o=u.sent(),c={error:o},[3,12];case 7:return u.trys.push([7,,10,11]),r&&!r.done&&(l=n.return)?[4,l.call(n)]:[3,9];case 8:u.sent(),u.label=9;case 9:return[3,11];case 10:if(c)throw c.error;return[7];case 11:return[7];case 12:return this.safeSetState({isWaitingForResponse:!1,subscription:null}),[3,14];case 13:return s=u.sent(),this.safeSetState({isWaitingForResponse:!1,response:s?t.formatError(s):void 0,subscription:null}),[3,14];case 14:return[2]}}))})),{unsubscribe:function(){var t,n;return null===(n=(t=e[Symbol.asyncIterator]()).return)||void 0===n?void 0:n.call(t)}}):(a(e),null)})).catch((function(e){return d.safeSetState({isWaitingForResponse:!1,response:e?t.formatError(e):void 0}),null}))]}))}))},t.prototype._runQueryAtCursor=function(){if(this.state.subscription)this.handleStopQuery();else{var e,t=this.state.operations;if(t){var n=this.getQueryEditor();if(n&&n.hasFocus())for(var r=n.getCursor(),i=n.indexFromPos(r),o=0;o=i){e=a.name&&a.name.value;break}}}this.handleRunQuery(e)}},t.prototype._didClickDragBar=function(e){if(0!==e.button||e.ctrlKey)return!1;var t=e.target;if(0!==t.className.indexOf("CodeMirror-gutter"))return!1;for(var n=this.resultViewerElement;t;){if(t===n)return!0;t=t.parentNode}return!1},t.formatError=function(e){return Array.isArray(e)?Af({errors:e.map((function(e){return Lf(e)}))}):Af({errors:Lf(e)})},t.Logo=If,t.Toolbar=Pf,t.Footer=Rf,t.QueryEditor=fp,t.VariableEditor=mp,t.HeaderEditor=gp,t.ResultViewer=Ep,t.Button=Gu,t.ToolbarButton=Gu,t.Group=Bu,t.Menu=zu,t.MenuItem=$u,t}(c().Component);function If(e){return c().createElement("div",{className:"title"},e.children||c().createElement("span",null,"Graph",c().createElement("em",null,"i"),"QL"))}function Pf(e){return c().createElement("div",{className:"toolbar",role:"toolbar","aria-label":"Editor Commands"},e.children)}function Rf(e){return c().createElement("div",{className:"footer"},e.children)}If.displayName="GraphiQLLogo",Pf.displayName="GraphiQLToolbar",Rf.displayName="GraphiQLFooter";var Mf='# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a "{" character. Lines that start\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n# {\n# field(arg: "value") {\n# subField\n# }\n# }\n#\n# Keyboard shortcuts:\n#\n# Prettify Query: Shift-Ctrl-P (or press the prettify button above)\n#\n# Merge Query: Shift-Ctrl-M (or press the merge button above)\n#\n# Run Query: Ctrl-Enter (or press the play button above)\n#\n# Auto Complete: Ctrl-Space (or just start typing)\n#\n\n';function jf(e){return"object"==typeof e&&"function"==typeof e.then}function Ff(e){return"object"==typeof e&&"subscribe"in e&&"function"==typeof e.subscribe}function Vf(e){return"object"==typeof e&&null!==e&&("AsyncGenerator"===e[Symbol.toStringTag]||Symbol.asyncIterator in e)}function Qf(e){return Promise.resolve(e).then((function(e){return Vf(e)?(n=e,new Promise((function(e,t){var r,i=null===(r=("return"in n?n:n[Symbol.asyncIterator]()).return)||void 0===r?void 0:r.bind(n);("next"in n?n:n[Symbol.asyncIterator]()).next.bind(n)().then((function(t){e(t.value),null==i||i()})).catch((function(e){t(e)}))}))):Ff(e)?(t=e,new Promise((function(e,n){var r=t.subscribe({next:function(t){e(t),r.unsubscribe()},error:n,complete:function(){n(new Error("no value resolved"))}})}))):e;var t,n}))}function qf(e,t){var n;return!(!(null===(n=null==e?void 0:e.type)||void 0===n?void 0:n.displayName)||e.type.displayName!==t.displayName)||e.type===t}var Uf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Gf=function(){return Gf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n(0,r.useContext)(od),sd=e=>{var t,n,i;let{children:o}=e;const{queryParams:a,setQueryParams:s}=id(),c=null!==(t=window&&(null===(n=window)||void 0===n||null===(i=n.localStorage)||void 0===i?void 0:i.getItem("graphiql:variables")))&&void 0!==t?t:null,[l,u]=(0,r.useState)((()=>{var e;let t="",n=null!==(e=a.query)&&void 0!==e?e:null;n&&(t=ed().decompressFromEncodedURIComponent(n),null===t&&(t=n));try{t=(0,nd.print)((0,nd.parse)(t))}catch(e){var r,i,o;t=null!==(r=null===(i=window)||void 0===i||null===(o=i.localStorage)||void 0===o?void 0:o.getItem("graphiql:query"))&&void 0!==r?r:null}return t})()),[p,f]=(0,r.useState)(c),[d,h]=(0,r.useState)((()=>{var e,t;const n=null!==(e=null===(t=wpGraphiQLSettings)||void 0===t?void 0:t.externalFragments)&&void 0!==e?e:null;if(!n)return[];const r=[];return n.map((e=>{let t,n;try{var i,o;t=td(e),n=null!==(i=null===(o=t)||void 0===o?void 0:o.definitions[0])&&void 0!==i?i:null}catch(e){}n&&r.push(n)})),r})()),m=rd.applyFilters("graphiql_context_default_value",{query:l,setQuery:async e=>{const t=l;rd.doAction("graphiql_update_query",{currentQuery:t,newQuery:e});let n,r,i=!1;if(null!==e&&e===l)return;if(null===e||""===e)i=!0;else{r=ed().decompressFromEncodedURIComponent(e),n=null===r?ed().compressToEncodedURIComponent(e):e;try{(0,nd.parse)(e),i=!0}catch(t){return void console.warn({error:{e:t,newQuery:e}})}}if(!i)return;var o;window&&window.localStorage&&""!==e&&null!==e&&(null===(o=window)||void 0===o||o.localStorage.setItem("graphiql:query",e));const c={...a,query:n};JSON.stringify(c!==JSON.stringify(a))&&s(c),t!==e&&await u(e)},variables:p,setVariables:e=>{window&&window.localStorage&&window.localStorage.setItem("graphiql:variables",e),f(e)},externalFragments:d,setExternalFragments:h});return(0,r.createElement)(od.Provider,{value:m},o)},{hooks:cd}=wpGraphiQL;var ld=e=>{const{graphiql:t}=e;const n=ad(),i={...e,GraphiQL:Df,graphiqlContext:n},o=cd.applyFilters("graphiql_toolbar_buttons",[{label:"Prettify",title:"Prettify Query (Shift-Ctrl-P)",onClick:e=>{e().handlePrettifyQuery()}},{label:"History",title:"Show History",onClick:e=>{e().handleToggleHistory()}}],i),a=cd.applyFilters("graphiql_toolbar_before_buttons",[],i),s=cd.applyFilters("graphiql_toolbar_after_buttons",[],i);return(0,r.createElement)("div",{"data-testid":"graphiql-toolbar",style:{display:"flex"}},a.length>0?a:null,o&&o.length&&o.map(((e,n)=>{const{label:i,title:o,onClick:a}=e;return(0,r.createElement)(Df.Button,{"data-testid":i,key:n,onClick:()=>{a(t)},label:i,title:o})})),s.length>0?s:null)};const{hooks:ud,useAppContext:pd,GraphQL:fd}=wpGraphiQL,{parse:dd,specifiedRules:hd}=fd,md=gc.div` + display: flex; + .topBar { + height: 50px; + } + .doc-explorer-title, + .history-title { + padding-top: 5px; + overflow: hidden; + } + .doc-explorer-back { + overflow: hidden; + } + height: 100%; + display: flex; + flex-direction: row; + margin: 0; + overflow: hidden; + width: 100%; + .graphiql-container { + border: 1px solid #ccc; + } + .graphiql-container .execute-button-wrap { + margin: 0 14px; + } + padding: 20px; +`,vd=e=>{try{return JSON.parse(e)&&!!e}catch(e){return!1}},yd=()=>{let e=(0,r.useRef)(null);const t=pd(),n=ad(),{query:i,setQuery:o,externalFragments:a,variables:s,setVariables:c}=n,{endpoint:l,nonce:u,schema:p,setSchema:f}=t;let d=((e,t)=>{const{nonce:n}=t;return t=>{const r={method:"POST",headers:{Accept:"application/json","content-type":"application/json","X-WP-Nonce":n},body:JSON.stringify(t),credentials:"include"};return fetch(e,r).then((e=>e.json()))}})(l,{nonce:u});d=ud.applyFilters("graphiql_fetcher",d,t);const h=ud.applyFilters("graphiql_before_graphiql",[],{...t,...n}),m=ud.applyFilters("graphiql_after_graphiql",[],{...t,...n});return(0,r.createElement)(md,{"data-testid":"wp-graphiql-wrapper",id:"wp-graphiql-wrapper"},h.length>0?h:null,(0,r.createElement)(zf,{ref:t=>{e=t},fetcher:e=>d(e),schema:p,query:i,onEditQuery:e=>{let t=!1;if(e!==i){if(null===e||""===e)t=!0;else try{dd(e),t=!0}catch(e){return}t&&o(e)}},onEditVariables:e=>{vd(e)&&c(e)},variables:vd(s)?s:null,validationRules:hd,readOnly:!1,externalFragments:a,headerEditorEnabled:!1,onSchemaChange:e=>{p!==e&&f(e)}},(0,r.createElement)(zf.Toolbar,null,(0,r.createElement)(ld,{graphiql:()=>e})),(0,r.createElement)(zf.Logo,null,(0,r.createElement)(r.Fragment,null))),m.length>0?m:null)};var gd=()=>{const e=pd(),{schema:t}=e;return t?(0,r.createElement)(sd,{appContext:e},(0,r.createElement)(yd,null)):(0,r.createElement)(Xf,{style:{margin:"50px"}})},bd=function(e,t){return bd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},bd(e,t)};function Ed(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}bd(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var wd=function(){return wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=Dd){var t=console[e]||console.log;return t.apply(console,arguments)}}}function Pd(e){try{return e()}catch(e){}}!function(e){e.debug=Id("debug"),e.log=Id("log"),e.warn=Id("warn"),e.error=Id("error")}(Ad||(Ad={}));var Rd=Pd((function(){return globalThis}))||Pd((function(){return window}))||Pd((function(){return self}))||Pd((function(){return global}))||Pd((function(){return Pd.constructor("return this")()})),__="__",Md=[__,__].join("DEV"),jd=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(Rd,Md,{value:"production"!==Pd((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),Rd[Md]}}();function Fd(e){try{return e()}catch(e){}}var Vd=Fd((function(){return globalThis}))||Fd((function(){return window}))||Fd((function(){return self}))||Fd((function(){return global}))||Fd((function(){return Fd.constructor("return this")()})),Qd=!1;function qd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[Hd]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=Yd(t,Hd);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Xd(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(Kd("iterator")&&(r=Yd(t,$d)))return new n((function(e){eh((function(){if(!e.closed){for(var n,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return qd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){eh((function(){if(!e.closed){for(var n=0;n0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),"".concat(n.connection.key,"(").concat(yh(i),")")}return n.connection.key}var o=e;if(t){var a=yh(t);o+="(".concat(a,")")}return n&&Object.keys(n).forEach((function(e){-1===mh.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@".concat(e,"(").concat(yh(n[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=yh;return yh=e,t}}),yh=function(e){return JSON.stringify(e,gh)};function gh(e,t){return ch(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{})),t}function bh(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return hh(n,r,i,t)})),n}return null}function Eh(e){return e.alias?e.alias.value:e.name.value}function wh(e,t,n){if("string"==typeof e.__typename)return e.__typename;for(var r=0,i=t.selections;r=300&&Fh(e,t,"Response not successful: Received status code ".concat(e.status)),Array.isArray(t)||Vh.call(t,"data")||Vh.call(t,"errors")||Fh(e,t,"Server response was missing for query '".concat(Array.isArray(i)?i.map((function(e){return e.operationName})):i.operationName,"'.")),t}))})).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){d&&d.abort()}}))}))},zh=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,Kh(t).request)||this;return n.options=t,n}return Ed(t,e),t}(Rh),$h=Object.prototype,Hh=$h.toString,Wh=$h.hasOwnProperty,Yh=Function.prototype.toString,Jh=new Map;function Xh(e,t){try{return Zh(e,t)}finally{Jh.clear()}}function Zh(e,t){if(e===t)return!0;var n,r,i,o=Hh.call(e);if(o!==Hh.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(rm(e,t))return!0;var a=em(e),s=em(t),c=a.length;if(c!==s.length)return!1;for(var l=0;l=0&&n.indexOf(r,i)===i))}return!1}function em(e){return Object.keys(e).filter(tm,e)}function tm(e){return void 0!==this[e]}var nm="{ [native code] }";function rm(e,t){var n=Jh.get(e);if(n){if(n.has(t))return!0}else Jh.set(e,n=new Set);return n.add(t),!1}var im=function(){return Object.create(null)},om=Array.prototype,am=om.forEach,sm=om.slice,cm=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=im),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t-1}))}function mm(e){return e&&hm(["client"],e)&&hm(["export"],e)}Pd((function(){return window.document.createElement})),Pd((function(){return navigator.userAgent.indexOf("jsdom")>=0}));var vm=Object.prototype.hasOwnProperty;function ym(){for(var e=[],t=0;t1)for(var r=new Em,i=1;i0||!1}function jm(e,t,n){var r=0;return e.forEach((function(n,i){t.call(this,n,i,e)&&(e[r++]=n)}),n),e.length=r,e}var Fm={kind:"Field",name:{kind:"Name",value:"__typename"}};function Vm(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&Vm(t[e.name.value],t)}))}function Qm(e){return Vm(Oh(e)||function(e){__DEV__?Ad("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):Ad("Document"===e.kind,48),__DEV__?Ad(e.definitions.length<=1,"Fragment must have exactly one definition."):Ad(e.definitions.length<=1,49);var t=e.definitions[0];return __DEV__?Ad("FragmentDefinition"===t.kind,"Must be a fragment definition."):Ad("FragmentDefinition"===t.kind,50),t}(e),uh(xh(e)))?null:e}function qm(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function Um(e,t){var n=Object.create(null),r=[],i=Object.create(null),o=[],a=Qm((0,Iu.visit)(t,{Variable:{enter:function(e,t,r){"VariableDefinition"!==r.kind&&(n[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(qm(e)))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&r.push({name:e.value.name.value})})),t.selectionSet&&Km(t.selectionSet).forEach((function(e){o.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(qm(e)(t))return null}}}));return a&&jm(r,(function(e){return!!e.name&&!n[e.name]})).length&&(a=function(e,t){var n=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return Qm((0,Iu.visit)(t,{OperationDefinition:{enter:function(t){return wd(wd({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var r=0;if(t.arguments&&t.arguments.forEach((function(e){n(e)&&(r+=1)})),1===r)return null}}},Argument:{enter:function(e){if(n(e))return null}}}))}(r,a)),a&&jm(o,(function(e){return!!e.name&&!i[e.name]})).length&&(a=function(e,t){function n(t){if(e.some((function(e){return e.name===t.name.value})))return null}return Qm((0,Iu.visit)(t,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}(o,a)),a}var Gm=Object.assign((function(e){return(0,Iu.visit)(e,{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var r=e.selections;if(r&&!r.some((function(e){return Th(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(Th(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return wd(wd({},e),{selections:Od(Od([],r,!0),[Fm],!1)})}}}}})}),{added:function(e){return e===Fm}}),Bm={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&Ad.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function Km(e){var t=[];return e.selections.forEach((function(e){(Th(e)||_h(e))&&e.selectionSet?Km(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function zm(e){return"query"===Nh(e).operation?e:(0,Iu.visit)(e,{OperationDefinition:{enter:function(e){return wd(wd({},e),{operation:"query"})}}})}var $m=new Map;function Hm(e){var t=$m.get(e)||1;return $m.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function Wm(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Ym(e){function t(t){Object.defineProperty(e,t,{value:sh})}return pm&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Jm(e){return e&&"function"==typeof e.then}var Xm=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.addCount=0,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],Wm(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),Wm(n.observers,"error",e))},complete:function(){var e=n.sub;if(null!==e){var t=n.sources.shift();t?Jm(t)?t.then((function(e){return n.sub=e.subscribe(n.handlers)})):n.sub=t.subscribe(n.handlers):(e&&setTimeout((function(){return e.unsubscribe()})),n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),Wm(n.observers,"complete"))}}},n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.complete()},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new sh(t)]),Jm(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return Ed(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e),++this.addCount)},t.prototype.removeObserver=function(e,t){this.observers.delete(e)&&--this.addCount<1&&!t&&this.handlers.complete()},t.prototype.cleanup=function(e){var t=this,n=!1,r=function(){n||(n=!0,t.observers.delete(i),e())},i={next:r,error:r,complete:r},o=this.addCount;this.addObserver(i),this.addCount=o},t}(sh);function Zm(e){return Array.isArray(e)&&e.length>0}Ym(Xm);var ev,tv=function(e){function t(n){var r,i,o=n.graphQLErrors,a=n.clientErrors,s=n.networkError,c=n.errorMessage,l=n.extraInfo,u=e.call(this,c)||this;return u.graphQLErrors=o||[],u.clientErrors=a||[],u.networkError=s||null,u.message=c||(i="",(Zm((r=u).graphQLErrors)||Zm(r.clientErrors))&&(r.graphQLErrors||[]).concat(r.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+="".concat(t,"\n")})),r.networkError&&(i+="".concat(r.networkError.message,"\n")),i=i.replace(/\n$/,"")),u.extraInfo=l,u.__proto__=t.prototype,u}return Ed(t,e),t}(Error);function nv(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(ev||(ev={}));var rv=Object.prototype.toString;function iv(e){return ov(e)}function ov(e,t){switch(rv.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=ov(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=ov(e[n],t)})),r;default:return e}}var av=Object.assign,sv=Object.hasOwnProperty,cv=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=uv)}catch(e){}var n=!o.observers.size;o.observers.add(e);var r=o.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=r,o.queryManager=n,o.isTornDown=!1;var a=n.defaultOptions.watchQuery,s=(void 0===a?{}:a).fetchPolicy,c=void 0===s?"cache-first":s,l=i.fetchPolicy,u=void 0===l?c:l,p=i.initialFetchPolicy,f=void 0===p?"standby"===u?c:u:p;o.options=wd(wd({},i),{initialFetchPolicy:f,fetchPolicy:u}),o.queryId=r.queryId||n.generateQueryId();var d=Oh(o.query);return o.queryName=d&&d.name&&d.name.value,o}return Ed(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||ev.ready,r=wd(wd({},t),{loading:nv(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if("network-only"===o||"no-cache"===o||"standby"===o||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var a=this.queryInfo.getDiff();(a.complete||this.options.returnPartialData)&&(r.data=a.result),Xh(r.data,{})&&(r.data=void 0),a.complete?(delete r.partial,!a.complete||r.networkStatus!==ev.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=ev.ready,r.loading=!1)):r.partial=!0,!__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||pv(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e){return!this.last||!Xh(this.last.result,e)},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||Xh(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if(n.fetchPolicy="cache-and-network"===r?r:"no-cache"===r?"no-cache":"network-only",__DEV__&&e&&sv.call(e,"variables")){var i=Ch(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&Ad.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!Xh(this.options.variables,e)&&(n.variables=this.options.variables=wd(wd({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,ev.refetch)},t.prototype.fetchMore=function(e){var t=this,n=wd(wd({},e.query?e:wd(wd(wd(wd({},this.options),{query:this.query}),e),{variables:wd(wd({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),r=this.queryManager.generateQueryId(),i=this.queryInfo,o=i.networkStatus;i.networkStatus=ev.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var a=new Set;return this.queryManager.fetchQuery(r,n,ev.fetchMore).then((function(s){return t.queryManager.removeQuery(r),i.networkStatus===ev.fetchMore&&(i.networkStatus=o),t.queryManager.cache.batch({update:function(r){var i=e.updateQuery;i?r.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:s.data,variables:n.variables})})):r.writeQuery({query:n.query,variables:n.variables,data:s.data})},onWatchUpdated:function(e){a.add(e.query)}}),s})).finally((function(){a.has(t.query)||lv(t)}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&Ad.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return Xh(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},ev.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var n=t.fetchPolicy,r=void 0===n?"cache-first":n,i=t.initialFetchPolicy,o=void 0===i?r:i;"standby"===r||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n){if(!t||t.interval!==n){__DEV__?Ad(n,"Attempted to start a polling query without a polling interval."):Ad(n,10),(t||(this.pollingInfo={})).interval=n;var r=function(){e.pollingInfo&&(nv(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"network-only"},ev.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=wd(wd({},this.last),{result:this.queryManager.assumeImmutableResults?e:iv(e),variables:t}),Zm(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var n=this;this.isTornDown=!1;var r=t===ev.refetch||t===ev.fetchMore||t===ev.poll,i=this.options.variables,o=this.options.fetchPolicy,a=fm(this.options,e||{}),s=r?a:av(this.options,a);r||(this.updatePolling(),e&&e.variables&&!Xh(e.variables,i)&&"standby"!==s.fetchPolicy&&s.fetchPolicy===o&&(this.applyNextFetchPolicy("variables-changed",s),void 0===t&&(t=ev.setVariables)));var c=s.variables&&wd({},s.variables),l=this.fetch(s,t),u={next:function(e){n.reportResult(e,c)},error:function(e){n.reportError(e,c)}};return r||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=l,this.observer=u),l.addObserver(u),l.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError();(n||this.isDifferentFromLastResult(e))&&((n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),Wm(this.observers,"next",e))},t.prototype.reportError=function(e,t){var n=wd(wd({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:ev.error,loading:!1});this.updateLastResult(n,t),Wm(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(sh);function lv(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=r,"function"==typeof r?r.apply(this,arguments):n}}):e.reobserve()}function uv(e){__DEV__&&Ad.error("Unhandled error",e.message,e.stack)}function pv(e){__DEV__&&e&&__DEV__&&Ad.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}Ym(cv);var fv=null,dv={},hv=1,mv="@wry/context:Slot",vv=Array,yv=vv[mv]||function(){var e=function(){function e(){this.id=["slot",hv++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=fv;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===dv)break;return e!==fv&&(fv.slots[this.id]=t),!0}return fv&&(fv.slots[this.id]=dv),!1},e.prototype.getValue=function(){if(this.hasValue())return fv.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var i,o=((i={__proto__:null})[this.id]=e,i),a=fv;fv={parent:a,slots:o};try{return t.apply(r,n)}finally{fv=a}},e.bind=function(e){var t=fv;return function(){var n=fv;try{return fv=t,e.apply(this,arguments)}finally{fv=n}}},e.noContext=function(e,t,n){if(!fv)return e.apply(n,t);var r=fv;try{return fv=null,e.apply(n,t)}finally{fv=r}},e}();try{Object.defineProperty(vv,mv,{value:vv[mv]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();function gv(){}yv.bind,yv.noContext;var bv,Ev=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=gv),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),wv=new yv,Tv=Object.prototype.hasOwnProperty,_v=void 0===(bv=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:bv;function kv(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Ov=[];function Sv(e,t){if(!e)throw new Error(t||"assertion failure")}function xv(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Cv=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!Lv(this))return Nv(this),this.value[0]},e.prototype.recompute=function(e){return Sv(!this.recomputing,"already recomputing"),Nv(this),Lv(this)?function(e,t){return Fv(e),wv.withValue(e,Av,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{kv(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,Lv(e)||Iv(e)}(e),xv(e.value)}(this,e):xv(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Dv(this),kv(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),Fv(this),Pv(this,(function(t,n){t.setDirty(),Vv(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Ov.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(_v(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Ov.push(this.deps),this.deps=null)},e.count=0,e}();function Nv(e){var t=wv.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Lv(e)?Rv(t,e):Mv(t,e),t}function Av(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function Lv(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Dv(e){Pv(e,Rv)}function Iv(e){Pv(e,Mv)}function Pv(e,t){var n=e.parents.size;if(n)for(var r=_v(e.parents),i=0;i0&&n===t.length&&e[n-1]===t[n-1]}(n,t.value)||e.setDirty(),jv(e,t),Lv(e)||Iv(e)}function jv(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(Ov.length<100&&Ov.push(n),e.dirtyChildren=null))}function Fv(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){Vv(e,n)})),e.forgetDeps(),Sv(null===e.dirtyChildren)}function Vv(e,t){t.parents.delete(e),e.childValues.delete(t),jv(e,t)}var Qv={setDirty:!0,dispose:!0,forget:!0};function qv(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=wv.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(kv(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&Tv.call(Qv,n)?n:"setDirty";_v(r).forEach((function(e){return e[i]()})),t.delete(e),kv(r)}},r}function Uv(){var e=new cm("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}Uv();var Gv=new Set;function Bv(e,t){void 0===t&&(t=Object.create(null));var n=new Ev(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=t.keyArgs,i=t.makeCacheKey||Uv(),o=function(){var o=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var a=n.get(o);a||(n.set(o,a=new Cv(e)),a.subscribe=t.subscribe,a.forget=function(){return n.delete(o)});var s=a.recompute(Array.prototype.slice.call(arguments));return n.set(o,a),Gv.add(n),wv.hasValue()||(Gv.forEach((function(e){return e.clean()})),Gv.clear()),s};function a(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function c(e){return n.delete(e)}return Object.defineProperty(o,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=a,o.dirty=function(){a(i.apply(null,arguments))},o.peekKey=s,o.peek=function(){return s(i.apply(null,arguments))},o.forgetKey=c,o.forget=function(){return c(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(o)}var Kv=new yv,zv=new WeakMap;function $v(e){var t=zv.get(e);return t||zv.set(e,t={vars:new Set,dep:qv()}),t}function Hv(e){$v(e).vars.forEach((function(t){return t.forgetCache(e)}))}function Wv(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){$v(e).dep.dirty(r),Yv(e)}));var a=Array.from(n);n.clear(),a.forEach((function(t){return t(e)}))}}else{var s=Kv.getValue();s&&(i(s),$v(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),$v(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function Yv(e){e.broadcastWatches&&e.broadcastWatches()}var Jv=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=ym(t.resolvers,e)})):this.resolvers=ym(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return _d(this,void 0,void 0,(function(){return kd(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,a).then((function(e){return wd(wd({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return hm(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){kh(e);var t=Um([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,Iu.visit)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return Th(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return wd(wd({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),_d(this,void 0,void 0,(function(){return kd(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return wd(wd({},t),e.exportedVariables)}))]:[2,wd({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,Iu.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Iu.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:zm(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,o){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),_d(this,void 0,void 0,(function(){var a,s,c,l,u,p,f,d,h;return kd(this,(function(m){return a=Nh(e),s=xh(e),c=uh(s),l=a.operation,u=l?l.charAt(0).toUpperCase()+l.slice(1):"Query",f=(p=this).cache,d=p.client,h={fragmentMap:c,context:wd(wd({},n),{cache:f,client:d}),variables:r,fragmentMatcher:i,defaultOperationType:u,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,h).then((function(e){return{result:e,exportedVariables:h.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return _d(this,void 0,void 0,(function(){var r,i,o,a,s,c=this;return kd(this,(function(l){return r=n.fragmentMap,i=n.context,o=n.variables,a=[t],s=function(e){return _d(c,void 0,void 0,(function(){var s,c;return kd(this,(function(l){return dm(e,o)?Th(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&a.push(((n={})[Eh(e)]=t,n))}))]:(_h(e)?s=e:(s=r[e.name.value],__DEV__?Ad(s,"No fragment named ".concat(e.name.value)):Ad(s,9)),s&&s.typeCondition&&(c=s.typeCondition.name.value,n.fragmentMatcher(t,c,i))?[2,this.resolveSelectionSet(s.selectionSet,t,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return gm(a)}))]}))}))},e.prototype.resolveField=function(e,t,n){return _d(this,void 0,void 0,(function(){var r,i,o,a,s,c,l,u,p,f=this;return kd(this,(function(d){return r=n.variables,i=e.name.value,o=Eh(e),a=i!==o,s=t[o]||t[i],c=Promise.resolve(s),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(l=t.__typename||n.defaultOperationType,(u=this.resolvers&&this.resolvers[l])&&(p=u[a?i:o])&&(c=Promise.resolve(Kv.withValue(this.cache,p,[t,bh(e,r),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,c.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,n):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}(),Xv=new(lm?WeakMap:Map);function Zv(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Xv.set(e,(Xv.get(e)+1)%1e15),n.apply(this,arguments)})}function ey(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var ty=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Xv.has(n)||(Xv.set(n,0),Zv(n,"evict"),Zv(n,"modify"),Zv(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||ev.loading;return this.variables&&this.networkStatus!==ev.loading&&!Xh(this.variables,e.variables)&&(t=ev.setVariables),Xh(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){ey(this),this.lastDiff=void 0,this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&Xh(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||Xh(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():lv(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;ey(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(nv(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=wd(wd({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&Xh(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Xv.get(this.cache)&&Xh(t,n.variables)&&Xh(e.data,n.result.data))},e.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Zm(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(t.variables)):0!==n&&(ny(e,t.errorPolicy)?this.cache.performTransaction((function(i){if(r.shouldWrite(e,t.variables))i.writeQuery({query:r.document,data:e.data,variables:t.variables,overwrite:1===n}),r.lastWrite={result:e,variables:t.variables,dmCount:Xv.get(r.cache)};else if(r.lastDiff&&r.lastDiff.diff.complete)return void(e.data=r.lastDiff.diff.result);var o=r.getDiffOptions(t.variables),a=i.diff(o);r.stopped||r.updateWatch(t.variables),r.updateLastDiff(a,o),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ev.ready},e.prototype.markError=function(e){return this.networkStatus=ev.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function ny(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Mm(e);return!r&&n&&e.data&&(r=!0),r}var ry=Object.prototype.hasOwnProperty,iy=function(){function e(e){var t=e.cache,n=e.link,r=e.defaultOptions,i=e.queryDeduplication,o=void 0!==i&&i,a=e.onBroadcast,s=e.ssrMode,c=void 0!==s&&s,l=e.clientAwareness,u=void 0===l?{}:l,p=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(lm?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=r||Object.create(null),this.queryDeduplication=o,this.clientAwareness=u,this.localState=p||new Jv({cache:t}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(__DEV__?new Nd("QueryManager stopped while query was in flight"):new Nd(11))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,n,r=e.mutation,i=e.variables,o=e.optimisticResponse,a=e.updateQueries,s=e.refetchQueries,c=void 0===s?[]:s,l=e.awaitRefetchQueries,u=void 0!==l&&l,p=e.update,f=e.onQueryUpdated,d=e.fetchPolicy,h=void 0===d?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":d,m=e.errorPolicy,v=void 0===m?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":m,y=e.keepRootFields,g=e.context;return _d(this,void 0,void 0,(function(){var e,t,n;return kd(this,(function(s){switch(s.label){case 0:return __DEV__?Ad(r,"mutation option is required. You must specify your GraphQL document in the mutation option."):Ad(r,12),__DEV__?Ad("network-only"===h||"no-cache"===h,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):Ad("network-only"===h||"no-cache"===h,13),e=this.generateMutationId(),r=this.transform(r).document,i=this.getVariables(r,i),this.transform(r).hasClientExports?[4,this.localState.addExportedVariables(r,i,g)]:[3,2];case 1:i=s.sent(),s.label=2;case 2:return t=this.mutationStore&&(this.mutationStore[e]={mutation:r,variables:i,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:e,document:r,variables:i,fetchPolicy:h,errorPolicy:v,context:g,updateQueries:a,update:p,keepRootFields:y}),this.broadcastQueries(),n=this,[2,new Promise((function(s,l){return Rm(n.getObservableFromLink(r,wd(wd({},g),{optimisticResponse:o}),i,!1),(function(s){if(Mm(s)&&"none"===v)throw new tv({graphQLErrors:s.errors});t&&(t.loading=!1,t.error=null);var l=wd({},s);return"function"==typeof c&&(c=c(l)),"ignore"===v&&Mm(l)&&delete l.errors,n.markMutationResult({mutationId:e,result:l,document:r,variables:i,fetchPolicy:h,errorPolicy:v,context:g,update:p,updateQueries:a,awaitRefetchQueries:u,refetchQueries:c,removeOptimistic:o?e:void 0,onQueryUpdated:f,keepRootFields:y})})).subscribe({next:function(e){n.broadcastQueries(),s(e)},error:function(r){t&&(t.loading=!1,t.error=r),o&&n.cache.removeOptimistic(e),n.broadcastQueries(),l(r instanceof tv?r:new tv({networkError:r}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&ny(r,e.errorPolicy)){i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var a=e.updateQueries;a&&this.queries.forEach((function(e,o){var s=e.observableQuery,c=s&&s.queryName;if(c&&ry.call(a,c)){var l=a[c],u=n.queries.get(o),p=u.document,f=u.variables,d=t.diff({query:p,variables:f,returnPartialData:!0,optimistic:!1}),h=d.result;if(d.complete&&h){var m=l(h,{mutationResult:r,queryName:p&&Sh(p)||void 0,queryVariables:f});m&&i.push({result:m,dataId:"ROOT_QUERY",query:p,variables:f})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var s=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var a=e.update;if(a){if(!o){var s=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});s.complete&&(r=wd(wd({},r),{data:s.result}))}a(t,r,{context:e.context,variables:e.variables})}o||e.keepRootFields||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return s.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(s).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(wd(wd({},t),{result:{data:r}}),e)}catch(e){__DEV__&&Ad.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t,n=this.transformCache;if(!n.has(e)){var r=this.cache.transformDocument(e),i=(t=this.cache.transformForLink(r),Um([Bm],kh(t))),o=this.localState.clientQuery(r),a=i&&this.localState.serverQuery(i),s={document:r,hasClientExports:mm(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:o,serverQuery:a,defaultVars:Ah(Oh(r)),asQuery:wd(wd({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?wd(wd({},e),{operation:"query"}):e}))})},c=function(e){e&&!n.has(e)&&n.set(e,s)};c(e),c(r),c(o),c(a)}return n.get(e)},e.prototype.getVariables=function(e,t){return wd(wd({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=wd(wd({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new ty(this),n=new cv({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?Ad(e.query,"query option is required. You must specify your GraphQL document in the query option."):Ad(e.query,14),__DEV__?Ad("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):Ad("Document"===e.query.kind,15),__DEV__?Ad(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):Ad(!e.returnPartialData,16),__DEV__?Ad(!e.pollInterval,"pollInterval option only supported on watchQuery."):Ad(!e.pollInterval,17),this.fetchQuery(t,e).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Nd("Store reset while query was in flight (not completed in link chain)"):new Nd(18)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=ev.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):ch(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e).document,!1):ch(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void n.set(i,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&r.has(s)||a&&r.has(a))&&(n.set(i,o),s&&r.set(s,!0),a&&r.set(a,!0))}})),i.size&&i.forEach((function(e){var r=Hm("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new cv({queryManager:t,queryInfo:i,options:wd(wd({},e),{fetchPolicy:"network-only"})});Ad(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),__DEV__&&r.size&&r.forEach((function(e,t){e||__DEV__&&Ad.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,i){var o=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=e.variables,a=e.context,s=void 0===a?{}:a;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(e){return t.getObservableFromLink(n,s,e).map((function(o){if("no-cache"!==r&&(ny(o,i)&&t.cache.write({query:n,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),Mm(o))throw new tv({graphQLErrors:o.errors});return o}))};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,s).then(c);return new sh((function(e){var t=null;return l.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return c(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,o,a=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var c=this.inFlightLinkObservables,l=this.link,u={query:s,variables:n,operationName:Sh(s)||void 0,context:this.prepareContext(wd(wd({},t),{forceFetch:!r}))};if(t=u.context,r){var p=c.get(s)||new Map;c.set(s,p);var f=Im(n);if(!(o=p.get(f))){var d=new Xm([Mh(l,u)]);p.set(f,o=d),d.cleanup((function(){p.delete(f)&&p.size<1&&c.delete(s)}))}}else o=new Xm([Mh(l,u)])}else o=new Xm([sh.of({data:{}})]),t=this.prepareContext(t);var h=this.transform(e).clientQuery;return h&&(o=Rm(o,(function(e){return a.localState.runResolvers({document:h,remoteResult:e,context:t,variables:n})}))),o},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return Rm(this.getObservableFromLink(e.document,n.context,n.variables),(function(i){var o=Zm(i.errors);if(r>=e.lastRequestId){if(o&&"none"===n.errorPolicy)throw e.markError(new tv({graphQLErrors:i.errors}));e.markResult(i,n,t),e.markReady()}var a={data:i.data,loading:!1,networkStatus:ev.ready};return o&&"ignore"!==n.errorPolicy&&(a.errors=i.errors,a.networkStatus=ev.error),a}),(function(t){var n=t.hasOwnProperty("graphQLErrors")?t:new tv({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=ev.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),a=this.getQuery(e),s=this.defaultOptions.watchQuery,c=t.fetchPolicy,l=void 0===c?s&&s.fetchPolicy||"cache-first":c,u=t.errorPolicy,p=void 0===u?s&&s.errorPolicy||"none":u,f=t.returnPartialData,d=void 0!==f&&f,h=t.notifyOnNetworkStatusChange,m=void 0!==h&&h,v=t.context,y=void 0===v?{}:v,g=Object.assign({},t,{query:i,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:d,notifyOnNetworkStatusChange:m,context:y}),b=function(e){g.variables=e;var i=r.fetchQueryByPolicy(a,g,n);return"standby"!==g.fetchPolicy&&i.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",t),i},E=function(){return r.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,(function(e){E(),setTimeout((function(){return w.cancel(e)}))}));var w=new Xm(this.transform(g.query).hasClientExports?this.localState.addExportedVariables(g.query,g.variables,g.context).then(b):b(g.variables));return w.promise.then(E,E),w},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?Hm("refetchQueries"):void 0:a,c=e.onQueryUpdated,l=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){l.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var u=new Map;return n&&this.cache.batch({update:n,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof ty&&e.watcher.observableQuery;if(r){if(c){l.delete(r.queryId);var i=c(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&u.set(r,i),i}null!==c&&l.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),l.size&&l.forEach((function(e,n){var r,i=e.oq,o=e.lastDiff,a=e.diff;if(c){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}r=c(i,a,o)}c&&!0!==r||(r=i.refetch()),!1!==r&&u.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),u},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,o=t.variables,a=t.fetchPolicy,s=t.refetchWritePolicy,c=t.errorPolicy,l=t.returnPartialData,u=t.context,p=t.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(i).document,variables:o,networkStatus:n});var d=function(){return e.getDiff(o)},h=function(t,n){void 0===n&&(n=e.networkStatus||ev.loading);var a=t.result;!__DEV__||l||Xh(a,{})||pv(t.missing);var s=function(e){return sh.of(wd({data:e,loading:nv(n),networkStatus:n},t.complete?null:{partial:!0}))};return a&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:a},context:u,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return s(e.data||void 0)})):s(a)},m="no-cache"===a?0:n===ev.refetch&&"merge"!==s?1:2,v=function(){return r.getResultsFromLink(e,m,{variables:o,context:u,fetchPolicy:a,errorPolicy:c})},y=p&&"number"==typeof f&&f!==n&&nv(n);switch(a){default:case"cache-first":return(g=d()).complete?[h(g,e.markReady())]:l||y?[h(g),v()]:[v()];case"cache-and-network":var g;return(g=d()).complete||l||y?[h(g),v()]:[v()];case"cache-only":return[h(d(),e.markReady())];case"network-only":return y?[h(d()),v()]:[v()];case"no-cache":return y?[h(e.getDiff()),v()]:[v()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ty(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return wd(wd({},t),{clientAwareness:this.clientAwareness})},e}();function oy(e,t){return fm(e,t,t.variables&&{variables:wd(wd({},e&&e.variables),t.variables)})}var ay=!1,sy=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,o=e.cache,a=e.ssrMode,s=void 0!==a&&a,c=e.ssrForceFetchDelay,l=void 0===c?0:c,u=e.connectToDevTools,p=void 0===u?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:u,f=e.queryDeduplication,d=void 0===f||f,h=e.defaultOptions,m=e.assumeImmutableResults,v=void 0!==m&&m,y=e.resolvers,g=e.typeDefs,b=e.fragmentMatcher,E=e.name,w=e.version,T=e.link;if(T||(T=n?new zh({uri:n,credentials:r,headers:i}):Rh.empty()),!o)throw __DEV__?new Nd("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Nd(7);if(this.link=T,this.cache=o,this.disableNetworkFetches=s||l>0,this.queryDeduplication=d,this.defaultOptions=h||Object.create(null),this.typeDefs=g,l&&setTimeout((function(){return t.disableNetworkFetches=!1}),l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!ay&&__DEV__&&(ay=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var _=window.navigator,k=_&&_.userAgent,O=void 0;"string"==typeof k&&(k.indexOf("Chrome/")>-1?O="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":k.indexOf("Firefox/")>-1&&(O="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),O&&__DEV__&&Ad.log("Download the Apollo DevTools for a better development experience: "+O)}this.version="3.6.9",this.localState=new Jv({cache:o,client:this,resolvers:y,fragmentMatcher:b}),this.queryManager=new iy({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:d,ssrMode:s,clientAwareness:{name:E,version:w},localState:this.localState,assumeImmutableResults:v,onBroadcast:p?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=oy(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=wd(wd({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=oy(this.defaultOptions.query,e)),__DEV__?Ad("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):Ad("cache-and-network"!==e.fetchPolicy,8),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=wd(wd({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=oy(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Mh(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var i=Promise.all(r);return i.queries=n,i.results=r,i.catch((function(e){__DEV__&&Ad.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),cy=function(){function e(){this.getFragmentDoc=Bv(lh)}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(n)}),r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(wd(wd({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(wd(wd({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=Td(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,o=Td(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery(wd(wd({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment(wd(wd({},e),{data:i})),i)}})},e}(),ly=function(e,t,n,r){this.message=e,this.path=t,this.query=n,this.variables=r};function uy(e){return __DEV__&&(t=e,(n=new Set([t])).forEach((function(e){ch(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(t){ch(e[t])&&n.add(e[t])}))}))),e;var t,n}var py=Object.create(null),fy=function(){return py},dy=Object.create(null),hy=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return uy(dh(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return dh(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return fh(e);if(dh(e))return e;var r=n.policies.identify(e)[0];if(r){var i=fh(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return wd({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),wm.call(this.data,e)){var n=this.data[e];if(n&&wm.call(n,t))return n[t]}return"__typename"===t&&wm.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof gy?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),wm.call(this.data,e)?this.data[e]:this instanceof gy?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;dh(e)&&(e=e.__ref),dh(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,o="string"==typeof t?this.lookup(n=t):t;if(o){__DEV__?Ad("string"==typeof n,"store.merge expects a string ID"):Ad("string"==typeof n,1);var a=new Em(Ey).merge(i,o);if(this.data[n]=a,a!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=Sm(e);t===e||r.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||r instanceof gy||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),o=!1,a=!0,s={DELETE:py,INVALIDATE:dy,isReference:dh,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||fh(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(c){var l=Sm(c),u=r[c];if(void 0!==u){var p="function"==typeof t?t:t[c]||t[l];if(p){var f=p===fy?py:p(uy(u),wd(wd({},s),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===dy?n.group.dirty(e,c):(f===py&&(f=void 0),f!==u&&(i[c]=f,o=!0,u=f))}void 0!==u&&(a=!1)}})),o)return this.merge(e,i),a&&(this instanceof gy?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=fy,r):fy)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(wm.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof gy&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){wm.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&wm.call(e,n)||t.delete(n)})),e){var n=e.__META,r=Td(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof gy?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){wm.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof gy;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!wm.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){dh(e)&&(t[e.__ref]=!0),ch(e)&&Object.keys(e).forEach((function(t){var n=e[t];ch(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),my=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?qv():null,this.keyMaker=new cm(lm)},e.prototype.depend=function(e,t){if(this.d){this.d(vy(e,t));var n=Sm(t);n!==t&&this.d(vy(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(vy(e,t),"__exists"===t?"forget":"setDirty")},e}();function vy(e,t){return t+"#"+e}function yy(e,t){wy(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,o=t.seed,a=e.call(this,n,new my(i))||this;return a.stump=new by(a),a.storageTrie=new cm(lm),o&&a.replace(o),a}return Ed(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(hy||(hy={}));var gy=function(e){function t(t,n,r,i){var o=e.call(this,n.policies,i)||this;return o.id=t,o.parent=n,o.replay=r,o.group=i,r(o),o}return Ed(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach((function(n){Xh(r[n],i[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return wd(wd({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return wm.call(this.data,t)?wd(wd({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(hy),by=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new my(t.group.caching,t.group))||this}return Ed(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(gy);function Ey(e,t,n){var r=e[n],i=t[n];return Xh(r,i)?r:i}function wy(e){return!!(e instanceof hy&&e.group.caching)}function Ty(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var _y=function(){function e(e){var t=this;this.knownResults=new(lm?WeakMap:Map),this.config=fm(e,{addTypename:!1!==e.addTypename,canonizeResults:km(e)}),this.canon=e.canon||new Dm,this.executeSelectionSet=Bv((function(e){var n,r=e.context.canonizeResults,i=Ty(e);i[3]=!r;var o=(n=t.executeSelectionSet).peek.apply(n,i);return o?r?wd(wd({},o),{result:t.canon.admit(o.result)}):o:(yy(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:Ty,makeCacheKey:function(e,t,n,r){if(wy(n.store))return n.store.makeCacheKey(e,dh(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Bv((function(e){return yy(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(wy(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Dm},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,a=e.returnPartialData,s=void 0===a||a,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,u=this.config.cache.policies;o=wd(wd({},Ah(Ch(n))),o);var p,f=fh(i),d=this.executeSelectionSet({selectionSet:Nh(n).selectionSet,objectOrReference:f,enclosingRef:f,context:{store:t,query:n,policies:u,variables:o,varString:Im(o),canonizeResults:l,fragmentMap:uh(xh(n))}});if(d.missing&&(p=[new ly(ky(d.missing),d.missing,n,o)],!s))throw p[0];return{result:d.result,complete:!p,missing:p}},e.prototype.isFresh=function(e,t,n,r){if(wy(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.enclosingRef,o=e.context;if(dh(r)&&!o.policies.rootTypenamesById[r.__ref]&&!o.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var a,s=o.variables,c=o.policies,l=o.store.getFieldValue(r,"__typename"),u=[],p=new Em;function f(e,t){var n;return e.missing&&(a=p.merge(a,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&u.push({__typename:l});var d=new Set(n.selections);d.forEach((function(e){var n,h;if(dm(e,s))if(Th(e)){var m=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),v=Eh(e);void 0===m?Gm.added(e)||(a=p.merge(a,((n={})[v]="Can't find field '".concat(e.name.value,"' on ").concat(dh(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Lm(m)?m=f(t.executeSubSelectedArray({field:e,array:m,enclosingRef:i,context:o}),v):e.selectionSet?null!=m&&(m=f(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:m,enclosingRef:dh(m)?m:i,context:o}),v)):o.canonizeResults&&(m=t.canon.pass(m)),void 0!==m&&u.push(((h={})[v]=m,h))}else{var y=ph(e,o.fragmentMap);y&&c.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(d.add,d)}}));var h={result:gm(u),missing:a},m=o.canonizeResults?this.canon.admit(h):uy(h);return m.result&&this.knownResults.set(m.result,n),m},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.enclosingRef,a=e.context,s=new Em;function c(e,n){var r;return e.missing&&(t=s.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:Lm(e)?c(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:a}),t):r.selectionSet?c(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:dh(e)?e:o,context:a}),t):(__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){ch(n)&&(__DEV__?Ad(!dh(n),"Missing selection set for object of type ".concat(function(e,t){return dh(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n)," returned for query field ").concat(t.name.value)):Ad(!dh(n),5),Object.values(n).forEach(r.add,r))}))}}(a.store,r,e),e)})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function ky(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var Oy=Object.create(null);function Sy(e){var t=JSON.stringify(e);return Oy[t]||(Oy[t]=Object.create(null))}function xy(e){var t=Sy(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=Ny(e,(function(e){var i=Dy(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&wm.call(t,e[0])&&(i=Dy(t,e,Ly)),__DEV__?Ad(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):Ad(void 0!==i,2),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function Cy(e){var t=Sy(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,o=n.fieldName,a=Ny(e,(function(e){var n=e[0],o=n.charAt(0);if("@"!==o)if("$"!==o){if(t)return Dy(t,e)}else{var a=n.slice(1);if(i&&wm.call(i,a)){var s=e.slice(0);return s[0]=a,Dy(i,s)}}else if(r&&Zm(r.directives)){var c=n.slice(1),l=r.directives.find((function(e){return e.name.value===c})),u=l&&bh(l,i);return u&&Dy(u,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(o+=":"+s),o})}function Ny(e,t){var n=new Em;return Ay(e).reduce((function(e,r){var i,o=t(r);if(void 0!==o){for(var a=r.length-1;a>=0;--a)(i={})[r[a]]=o,o=i;e=n.merge(e,o)}return e}),Object.create(null))}function Ay(e){var t=Sy(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){Lm(t)?(Ay(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Lm(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function Ly(e,t){return e[t]}function Dy(e,t,n){return n=n||Ly,Iy(t.reduce((function e(t,r){return Lm(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function Iy(e){return ch(e)?Lm(e)?e.map(Iy):Ny(Object.keys(e).sort(),(function(t){return Dy(e,t)})):e}function Py(e){return void 0!==e.args?e.args:e.field?bh(e.field,e.variables):null}vh.setStringify(Im);var Ry=function(){},My=function(e,t){return t.fieldName},jy=function(e,t,n){return(0,n.mergeObjects)(e,t)},Fy=function(e,t){return t},Vy=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=wd({dataIdFromObject:Tm},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r=this,i=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,a=t&&t.storeObject||e,s=wd(wd({},t),{typename:i,storeObject:a,readField:t&&t.readField||function(){var e=qy(arguments,a);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),c=i&&this.getTypePolicy(i),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var u=l(e,s);if(!Lm(u)){o=u;break}l=xy(u)}return o=o?String(o):void 0,s.keyObject?[o,s.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,o=r.mutationType,a=r.subscriptionType,s=Td(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),a&&t.setRootTypename("Subscription",n),wm.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?jy:!1===t?Fy:e.merge}a(r,t.merge),r.keyFn=!1===i?Ry:Lm(i)?xy(i):"function"==typeof i?i:r.keyFn,o&&Object.keys(o).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,c=i.read,l=i.merge;r.keyFn=!1===s?My:Lm(s)?Cy(s):"function"==typeof s?s:r.keyFn,"function"==typeof c&&(r.read=c),a(r,l)}r.read&&r.merge&&(r.keyFn=r.keyFn||My)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?Ad(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):Ad(!r||r===e,3),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(Om);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!wm.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,o=Td(r,["fields"]);Object.assign(n,o),Object.assign(n.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},l=!(!n||!this.fuzzySubtypes.size),u=!1,p=0;p1?s:t}:(r=wd({},a),wm.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Ad.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(e),o=Hm("stringifyForDisplay"),JSON.stringify(i,(function(e,t){return void 0===t?o:t})).split(JSON.stringify(o)).join("")))),void 0===r.variables&&(r.variables=n),r}function Uy(e){return function(t,n){if(Lm(t)||Lm(n))throw __DEV__?new Nd("Cannot automatically merge arrays"):new Nd(4);if(ch(t)&&ch(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(dh(t)&&Cm(n))return e.merge(t.__ref,n),t;if(Cm(t)&&dh(n))return e.merge(t,n.__ref),n;if(Cm(t)&&Cm(n))return wd(wd({},t),n)}return n}}function Gy(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:wd(wd({},e),{clientOnly:t,deferred:n})),i}var By=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,o=t.dataId,a=t.variables,s=t.overwrite,c=Oh(r),l=new Em;a=wd(wd({},Ah(c)),a);var u={store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:Im(a),fragmentMap:uh(xh(r)),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map},p=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:u});if(!dh(p))throw __DEV__?new Nd("Could not identify object ".concat(JSON.stringify(i))):new Nd(6);return u.incomingById.forEach((function(t,r){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,s=fh(r);if(o&&o.map.size){var c=n.applyMerges(o,s,i,u);if(dh(c))return;i=c}if(__DEV__&&!u.overwrite){var l=Object.create(null);a.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)})),Object.keys(i).forEach((function(e){(function(e){return!0===l[Sm(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},o=i(e);if(o){var a=i(t);if(a&&!dh(o)&&!Xh(o,a)&&!Object.keys(o).every((function(e){return void 0!==r.getFieldValue(a,e)}))){var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),c=Sm(n),l="".concat(s,".").concat(c);if(!Yy.has(l)){Yy.add(l);var u=[];Lm(o)||Lm(a)||[o,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||u.includes(t)||u.push(t)})),__DEV__&&Ad.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(u.length?"either ensure all objects of type "+u.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(a).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}(s,i,e,u.store)}))}e.merge(r,i)})),e.retain(p.__ref),p},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,a=e.mergeTree,s=this.cache.policies,c=Object.create(null),l=n&&s.rootTypenamesById[n]||wh(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof l&&(c.__typename=l);var u=function(){var e=qy(arguments,c,o.variables);if(dh(e.from)){var t=o.incomingById.get(e.from.__ref);if(t){var n=s.readField(wd(wd({},e),{from:t.storeObject}),o);if(void 0!==n)return n}}return s.readField(e,o)},p=new Set;this.flattenFields(i,r,o,l).forEach((function(e,n){var i,o=Eh(n),f=r[o];if(p.add(n),void 0!==f){var d=s.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),h=zy(a,d),m=t.processFieldValue(f,n,n.selectionSet?Gy(e,!1,!1):e,h),v=void 0;n.selectionSet&&(dh(m)||Cm(m))&&(v=u("__typename",m));var y=s.getMergeFunction(l,n.name.value,v);y?h.info={field:n,typename:l,merge:y}:Wy(a,d),c=e.merge(c,((i={})[d]=m,i))}else!__DEV__||e.clientOnly||e.deferred||Gm.added(n)||s.getReadFunction(l,n.name.value)||__DEV__&&Ad.error("Missing field '".concat(Eh(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))}));try{var f=s.identify(r,{typename:l,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:c,readField:u}),d=f[0],h=f[1];n=n||d,h&&(c=o.merge(c,h))}catch(e){if(!n)throw e}if("string"==typeof n){var m=fh(n),v=o.written[n]||(o.written[n]=[]);if(v.indexOf(i)>=0)return m;if(v.push(i),this.reader&&this.reader.isFresh(r,m,i,o))return m;var y=o.incomingById.get(n);return y?(y.storeObject=o.merge(y.storeObject,c),y.mergeTree=$y(y.mergeTree,a),p.forEach((function(e){return y.fieldNodeSet.add(e)}))):o.incomingById.set(n,{storeObject:c,mergeTree:Hy(a)?void 0:a,fieldNodeSet:p}),m}return c},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Lm(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,n,zy(r,o));return Wy(r,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?iv(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=wh(t,e,n.fragmentMap));var i=new Map,o=this.cache.policies,a=new cm(!1);return function e(s,c){var l=a.lookup(s,c.clientOnly,c.deferred);l.visited||(l.visited=!0,s.selections.forEach((function(a){if(dm(a,n.variables)){var s=c.clientOnly,l=c.deferred;if(s&&l||!Zm(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=bh(e,n.variables);r&&!1===r.if||(l=!0)}})),Th(a)){var u=i.get(a);u&&(s=s&&u.clientOnly,l=l&&u.deferred),i.set(a,Gy(n,s,l))}else{var p=ph(a,n.fragmentMap);p&&o.fragmentMatches(p,r,t,n.variables)&&e(p.selectionSet,Gy(n,s,l))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var o,a=this;if(e.map.size&&!dh(n)){var s,c=Lm(n)||!dh(t)&&!Cm(t)?void 0:t,l=n;c&&!i&&(i=[dh(c)?c.__ref:c]);var u=function(e,t){return Lm(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=u(c,t),o=u(l,t);if(void 0!==o){i&&i.push(t);var p=a.applyMerges(e,n,o,r,i);p!==o&&(s=s||new Map).set(t,p),i&&Ad(i.pop()===t)}})),s&&(n=Lm(l)?l.slice(0):wd({},l),s.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),Ky=[];function zy(e,t){var n=e.map;return n.has(t)||n.set(t,Ky.pop()||{map:new Map}),n.get(t)}function $y(e,t){if(e===t||!t||Hy(t))return e;if(!e||Hy(e))return t;var n=e.info&&t.info?wd(wd({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,$y(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,$y(t.map.get(n),e.map.get(n)))}))}return i}function Hy(e){return!e||!(e.info||e.map.size)}function Wy(e,t){var n=e.map,r=n.get(t);r&&Hy(r)&&(Ky.push(r),n.delete(t))}var Yy=new Set,Jy=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=Wv,n.txCount=0,n.config=function(e){return fm(_m,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new Vy({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return Ed(t,e),t.prototype.init=function(){var e=this.data=new hy.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader;this.storeWriter=new By(this,this.storeReader=new _y({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:km(this.config),canon:e?void 0:n&&n.canon})),this.maybeBroadcastWatch=Bv((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(wy(n)){var r=e.optimistic,i=e.rootId,o=e.variables;return n.makeCacheKey(e.query,e.callback,Im({optimistic:r,rootId:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(wd(wd({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof ly)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(wm.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(wd(wd({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,n=this;return this.watches.size||$v(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){n.watches.delete(e)&&!n.watches.size&&Hv(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){Im.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(dh(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&Ad.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(wm.call(e,"id"))return!1;e=wd(wd({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),Im.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),Hv(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,o=void 0===i||i,a=e.removeOptimistic,s=e.onWatchUpdated,c=function(e){var i=n,o=i.data,a=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=o,n.optimisticData=a}},l=new Set;return s&&!this.txCount&&this.broadcastWatches(wd(wd({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,c):!1===o?c(this.data):c(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),s&&l.size?(this.broadcastWatches(wd(wd({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&l.delete(e),n}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Gm(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&Xh(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(cy);const Xy=e=>new sy({uri:e,connectToDevTools:!0,cache:new Jy({})});var Zy=new Map,eg=new Map,tg=!0,ng=!1;function rg(e){return e.replace(/[\s,]+/g," ").trim()}function ig(e){var t,n,r,i=rg(e);if(!Zy.has(i)){var o=(0,Iu.parse)(e,{experimentalFragmentVariables:ng,allowLegacyFragmentVariables:ng});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");Zy.set(i,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}((t=o,n=new Set,r=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=rg((a=e.loc).source.body.substring(a.start,a.end)),o=eg.get(t);o&&!o.has(i)?tg&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||eg.set(t,o=new Set),o.add(i),n.has(i)||(n.add(i),r.push(e))}else r.push(e);var a})),wd(wd({},t),{definitions:r}))))}return Zy.get(i)}function og(e){for(var t=[],n=1;n{const{setQueryParams:t,setCurrentScreen:n,currentScreen:i,screens:o}=e,[a,s]=(0,r.useState)(!0);return(0,r.createElement)(dg,{id:"graphiql-router-sider","data-testid":"graphiql-router-sider",className:"graphiql-app-screen-sider",collapsible:!0,defaultCollapsed:a,collapsed:a,trigger:(0,r.createElement)("span",{"data-testid":"router-menu-collapse-trigger"},a?(0,r.createElement)(Ee,null):(0,r.createElement)(_e,null)),onCollapse:()=>{s(!a)}},(0,r.createElement)(za,{theme:"dark",mode:"inline",selectedKeys:i,activeKey:i,items:(()=>{let e=[];return o&&o.map((r=>{e.push({"data-testid":`router-menu-item-${r.id}`,id:`router-menu-item-${r.id}`,key:r.id,icon:r.icon,onClick:()=>{(e=>{n(e),t({screen:e})})(r.id)},label:r.title})})),e})()}))};var vg,yg,gg,bg,Eg,wg,Tg=(vg={screen:(bg=ou,Eg="graphiql",void 0===wg&&(wg=!0),iu(iu({},bg),{decode:function(){for(var e=[],t=0;t{const[t,n]=wu({screen:ou}),{endpoint:i,schema:o,setSchema:a}=lg(),{screen:s}=t,[c,l]=(0,r.useState)((()=>{const e=[{id:"graphiql",title:"GraphiQL",icon:(0,r.createElement)(he,null),render:()=>(0,r.createElement)(gd,null)},{id:"help",title:"Help",icon:(0,r.createElement)(ye,null),render:()=>(0,r.createElement)(ru,null)}],t=bc.P.applyFilters("graphiql_router_screens",e);return!0===Array.isArray(t)?t:e})());(0,r.useEffect)((()=>{if(null!==o)return;const e=pg();Xy(i).query({query:cg` + ${e} + `}).then((e=>{const t=null!=e&&e.data?fg(e.data):null;t!==o&&a(t)}))}),[i]);const[u,p]=(0,r.useState)((()=>{const e=c&&c.find((e=>e.id===s));return e?e.id:"graphiql"})());return u?(0,r.createElement)(hg,{"data-testid":"graphiql-router"},(0,r.createElement)(We,{style:{height:"calc(100vh - 32px)",width:"100%"}},(0,r.createElement)(mg,{setQueryParams:n,setCurrentScreen:p,currentScreen:u,screens:c}),(0,r.createElement)(We,{className:"screen-layout",style:{background:"#fff"}},(e=>{const t=null!==(n=c.find((e=>e.id===u)))&&void 0!==n?n:c[0];var n;return t?(0,r.createElement)(We,{className:"router-screen","data-testid":`router-screen-${t.id}`},null==t?void 0:t.render(e)):null})(e)))):null},gg=function(e){var t=Tu(vg),n=t[0],r=t[1];return s.createElement(yg,_u({query:n,setQuery:r},e))},gg.displayName="withQueryParams("+(yg.displayName||yg.name||"Component")+")",gg),_g=n(755),kg=pm?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__",Og=function(e){var t=e.client,n=e.children,r=function(){var e=s.createContext[kg];return e||(Object.defineProperty(s.createContext,kg,{value:e=s.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}();return s.createElement(r.Consumer,null,(function(e){return void 0===e&&(e={}),t&&e.client!==t&&(e=Object.assign({},e,{client:t})),__DEV__?Ad(e.client,'ApolloProvider was not passed a client instance. Make sure you pass in your client via the "client" prop.'):Ad(e.client,26),s.createElement(r.Provider,{value:e},n)}))};const{hooks:Sg,AppContextProvider:xg,useAppContext:Cg}=window.wpGraphiQL,Ng=()=>{const e=Cg();return Sg.applyFilters("graphiql_app",(0,r.createElement)(Tg,null),{appContext:e})},Ag={push:e=>{history.replaceState(null,null,e.href)},replace:e=>{history.replaceState(null,null,e.href)}};(0,r.render)((0,r.createElement)((()=>{const e=Sg.applyFilters("graphiql_query_params_provider_config",{query:ou,variables:ou}),[t,n]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(!t){const e=document.getElementById("graphiql");e&&e.classList.remove("graphiql-container"),Sg.doAction("graphiql_rendered"),n(!0)}}),[]),t?(0,r.createElement)(Du,{history:Ag},(0,r.createElement)(Cu,{config:e},(e=>{const{query:t,setQuery:n}=e;return(0,r.createElement)(xg,{queryParams:t,setQueryParams:n},(0,r.createElement)(Og,{client:Xy((0,_g.O3)())},(0,r.createElement)(Ng,null)))}))):null}),null),document.getElementById("graphiql"))},755:function(e,t,n){"use strict";n.d(t,{O3:function(){return s},bp:function(){return a},iz:function(){return c}});var r=n(9307),i=n(6428);const o=(0,r.createContext)(),a=()=>(0,r.useContext)(o),s=()=>{var e,t,n;return null!==(e=null===(t=window)||void 0===t||null===(n=t.wpGraphiQLSettings)||void 0===n?void 0:n.graphqlEndpoint)&&void 0!==e?e:null},c=e=>{let{children:t,setQueryParams:n,queryParams:a}=e;const[c,l]=(0,r.useState)(null),[u,p]=(0,r.useState)(null!==(f=null===(d=window)||void 0===d||null===(h=d.wpGraphiQLSettings)||void 0===h?void 0:h.nonce)&&void 0!==f?f:null);var f,d,h;const[m,v]=(0,r.useState)(s()),[y,g]=(0,r.useState)(a);let b={endpoint:m,setEndpoint:v,nonce:u,setNonce:p,schema:c,setSchema:l,queryParams:y,setQueryParams:e=>{g(e),n(e)}},E=i.P.applyFilters("graphiql_app_context",b);return(0,r.createElement)(o.Provider,{value:E},t)}},6428:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(20),i=window.wp.hooks,o=n(755);const a=(0,i.createHooks)();window.wpGraphiQL={GraphQL:r,hooks:a,useAppContext:o.bp,AppContextProvider:o.iz}},4184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t0&&(l.from=i.default.Pos(l.from.line,l.from.ch),l.to=i.default.Pos(l.to.line,l.to.ch),i.default.signal(e,"hasCompletion",e,l,a)),l}}))},122:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(875),o=r(n(4631)),a=r(n(9068)),s=n(2311);function c(e,t,n){var r,i=(null===(r=t.fieldDef)||void 0===r?void 0:r.name)||"";"__"!==i.slice(0,2)&&(p(e,t,n,t.parentType),d(e,".")),d(e,i,"field-name",n,(0,s.getFieldReference)(t))}function l(e,t,n){var r;d(e,"@"+((null===(r=t.directiveDef)||void 0===r?void 0:r.name)||""),"directive-name",n,(0,s.getDirectiveReference)(t))}function u(e,t,n,r){d(e,": "),p(e,t,n,r)}function p(e,t,n,r){r instanceof i.GraphQLNonNull?(p(e,t,n,r.ofType),d(e,"!")):r instanceof i.GraphQLList?(d(e,"["),p(e,t,n,r.ofType),d(e,"]")):d(e,(null==r?void 0:r.name)||"","type-name",n,(0,s.getTypeReference)(t,r))}function f(e,t,n){var r=n.description;if(r){var i=document.createElement("div");i.className="info-description",t.renderDescription?i.innerHTML=t.renderDescription(r):i.appendChild(document.createTextNode(r)),e.appendChild(i)}!function(e,t,n){var r=n.deprecationReason;if(r){var i=document.createElement("div");i.className="info-deprecation",t.renderDescription?i.innerHTML=t.renderDescription(r):i.appendChild(document.createTextNode(r));var o=document.createElement("span");o.className="info-deprecation-label",o.appendChild(document.createTextNode("Deprecated: ")),i.insertBefore(o,i.firstChild),e.appendChild(i)}}(e,t,n)}function d(e,t,n,r,i){if(void 0===n&&(n=""),void 0===r&&(r={onClick:null}),void 0===i&&(i=null),n){var o=r.onClick,a=void 0;o?((a=document.createElement("a")).href="javascript:void 0",a.addEventListener("click",(function(e){o(i,e)}))):a=document.createElement("span"),a.className=n,a.appendChild(document.createTextNode(t)),e.appendChild(a)}else e.appendChild(document.createTextNode(t))}n(9965),o.default.registerHelper("info","graphql",(function(e,t){if(t.schema&&e.state){var n,r=e.state,i=r.kind,o=r.step,h=(0,a.default)(t.schema,e.state);return"Field"===i&&0===o&&h.fieldDef||"AliasedField"===i&&2===o&&h.fieldDef?(function(e,t,n){c(e,t,n),u(e,t,n,t.type)}(n=document.createElement("div"),h,t),f(n,t,h.fieldDef),n):"Directive"===i&&1===o&&h.directiveDef?(l(n=document.createElement("div"),h,t),f(n,t,h.directiveDef),n):"Argument"===i&&0===o&&h.argDef?(function(e,t,n){var r;t.directiveDef?l(e,t,n):t.fieldDef&&c(e,t,n);var i=(null===(r=t.argDef)||void 0===r?void 0:r.name)||"";d(e,"("),d(e,i,"arg-name",n,(0,s.getArgumentReference)(t)),u(e,t,n,t.inputType),d(e,")")}(n=document.createElement("div"),h,t),f(n,t,h.argDef),n):"EnumValue"===i&&h.enumValue&&h.enumValue.description?(function(e,t,n){var r,i=(null===(r=t.enumValue)||void 0===r?void 0:r.name)||"";p(e,t,n,t.inputType),d(e,"."),d(e,i,"enum-value",n,(0,s.getEnumValueReference)(t))}(n=document.createElement("div"),h,t),f(n,t,h.enumValue),n):"NamedType"===i&&h.type&&h.type.description?(p(n=document.createElement("div"),h,t,h.type),f(n,t,h.type),n):void 0}}))},2570:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=r(n(9068)),a=n(2311);n(5805),i.default.registerHelper("jump","graphql",(function(e,t){if(t.schema&&t.onClick&&e.state){var n=e.state,r=n.kind,i=n.step,s=(0,o.default)(t.schema,n);return"Field"===r&&0===i&&s.fieldDef||"AliasedField"===r&&2===i&&s.fieldDef?(0,a.getFieldReference)(s):"Directive"===r&&1===i&&s.directiveDef?(0,a.getDirectiveReference)(s):"Argument"===r&&0===i&&s.argDef?(0,a.getArgumentReference)(s):"EnumValue"===r&&s.enumValue?(0,a.getEnumValueReference)(s):"NamedType"===r&&s.type?(0,a.getTypeReference)(s):void 0}}))},1871:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=n(435),a=["error","warning","information","hint"],s={"GraphQL: Validation":"validation","GraphQL: Deprecation":"deprecation","GraphQL: Syntax":"syntax"};i.default.registerHelper("lint","graphql",(function(e,t){var n=t.schema;return(0,o.getDiagnostics)(e,n,t.validationRules,void 0,t.externalFragments).map((function(e){return{message:e.message,severity:e.severity?a[e.severity-1]:a[0],type:e.source?s[e.source]:void 0,from:i.default.Pos(e.range.start.line,e.range.start.character),to:i.default.Pos(e.range.end.line,e.range.end.character)}}))}))},9229:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=r(n(88));i.default.defineMode("graphql",o.default)},6276:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=n(435);function a(e,t){var n,r,i=e.levels;return((i&&0!==i.length?i[i.length-1]-((null===(n=this.electricInput)||void 0===n?void 0:n.test(t))?1:0):e.indentLevel)||0)*((null===(r=this.config)||void 0===r?void 0:r.indentUnit)||0)}i.default.defineMode("graphql-results",(function(e){var t=(0,o.onlineParser)({eatWhitespace:function(e){return e.eatSpace()},lexRules:s,parseRules:c,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:a,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));var s={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},c={Document:[(0,o.p)("{"),(0,o.list)("Entry",(0,o.p)(",")),(0,o.p)("}")],Entry:[(0,o.t)("String","def"),(0,o.p)(":"),"Value"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,o.t)("Number","number")],StringValue:[(0,o.t)("String","string")],BooleanValue:[(0,o.t)("Keyword","builtin")],NullValue:[(0,o.t)("Keyword","keyword")],ListValue:[(0,o.p)("["),(0,o.list)("Value",(0,o.p)(",")),(0,o.p)("]")],ObjectValue:[(0,o.p)("{"),(0,o.list)("ObjectField",(0,o.p)(",")),(0,o.p)("}")],ObjectField:[(0,o.t)("String","property"),(0,o.p)(":"),"Value"]}},2311:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTypeReference=t.getEnumValueReference=t.getArgumentReference=t.getDirectiveReference=t.getFieldReference=void 0;var r=n(875);function i(e){return"__"===e.name.slice(0,2)}t.getFieldReference=function(e){return{kind:"Field",schema:e.schema,field:e.fieldDef,type:i(e.fieldDef)?null:e.parentType}},t.getDirectiveReference=function(e){return{kind:"Directive",schema:e.schema,directive:e.directiveDef}},t.getArgumentReference=function(e){return e.directiveDef?{kind:"Argument",schema:e.schema,argument:e.argDef,directive:e.directiveDef}:{kind:"Argument",schema:e.schema,argument:e.argDef,field:e.fieldDef,type:i(e.fieldDef)?null:e.parentType}},t.getEnumValueReference=function(e){return{kind:"EnumValue",value:e.enumValue||void 0,type:e.inputType?(0,r.getNamedType)(e.inputType):void 0}},t.getTypeReference=function(e,t){return{kind:"Type",schema:e.schema,type:t||e.type}}},3285:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var n=[],r=e;null==r?void 0:r.kind;)n.push(r),r=r.prevState;for(var i=n.length-1;i>=0;i--)t(n[i])}},9068:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(875),o=n(8155),a=r(n(3285));function s(e,t,n){return n===o.SchemaMetaFieldDef.name&&e.getQueryType()===t?o.SchemaMetaFieldDef:n===o.TypeMetaFieldDef.name&&e.getQueryType()===t?o.TypeMetaFieldDef:n===o.TypeNameMetaFieldDef.name&&(0,i.isCompositeType)(t)?o.TypeNameMetaFieldDef:t&&t.getFields?t.getFields()[n]:void 0}t.default=function(e,t){var n={schema:e,type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return(0,a.default)(t,(function(t){var r,o;switch(t.kind){case"Query":case"ShortQuery":n.type=e.getQueryType();break;case"Mutation":n.type=e.getMutationType();break;case"Subscription":n.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":t.type&&(n.type=e.getType(t.type));break;case"Field":case"AliasedField":n.fieldDef=n.type&&t.name?s(e,n.parentType,t.name):null,n.type=null===(r=n.fieldDef)||void 0===r?void 0:r.type;break;case"SelectionSet":n.parentType=n.type?(0,i.getNamedType)(n.type):null;break;case"Directive":n.directiveDef=t.name?e.getDirective(t.name):null;break;case"Arguments":var a=t.prevState?"Field"===t.prevState.kind?n.fieldDef:"Directive"===t.prevState.kind?n.directiveDef:"AliasedField"===t.prevState.kind?t.prevState.name&&s(e,n.parentType,t.prevState.name):null:null;n.argDefs=a?a.args:null;break;case"Argument":if(n.argDef=null,n.argDefs)for(var c=0;c1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+s))}return i[o][a]}(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,o){var a=function(e,t){return t?n(n(e.map((function(e){return{proximity:i(r(e.text),t),entry:e}})),(function(e){return e.proximity<=2})),(function(e){return!e.entry.isDeprecated})).sort((function(e,t){return(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.text.length-t.entry.text.length})).map((function(e){return e.entry})):n(e,(function(e){return!e.isDeprecated}))}(o,r(t.string));if(a){var s=null!==t.type&&/"|\w/.test(t.string[0])?t.start:t.end;return{list:a,from:{line:e.line,ch:s},to:{line:e.line,ch:t.end}}}}},9965:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631));function o(e,t){var n=e.state.info,r=t.target||t.srcElement;if(r instanceof HTMLElement&&"SPAN"===r.nodeName&&void 0===n.hoverTimeout){var o=r.getBoundingClientRect(),a=function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(c,l)},s=function(){i.default.off(document,"mousemove",a),i.default.off(e.getWrapperElement(),"mouseout",s),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0},c=function(){i.default.off(document,"mousemove",a),i.default.off(e.getWrapperElement(),"mouseout",s),n.hoverTimeout=void 0,function(e,t){var n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}),r=e.state.info.options,o=r.render||e.getHelper(n,"info");if(o){var a=e.getTokenAt(n,!0);if(a){var s=o(a,r,e,n);s&&function(e,t,n){var r=document.createElement("div");r.className="CodeMirror-info",r.appendChild(n),document.body.appendChild(r);var o=r.getBoundingClientRect(),a=window.getComputedStyle(r),s=o.right-o.left+parseFloat(a.marginLeft)+parseFloat(a.marginRight),c=o.bottom-o.top+parseFloat(a.marginTop)+parseFloat(a.marginBottom),l=t.bottom;c>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(l=t.top-c),l<0&&(l=t.bottom);var u,p=Math.max(0,window.innerWidth-s-15);p>t.left&&(p=t.left),r.style.opacity="1",r.style.top=l+"px",r.style.left=p+"px";var f=function(){clearTimeout(u)},d=function(){clearTimeout(u),u=setTimeout(h,200)},h=function(){i.default.off(r,"mouseover",f),i.default.off(r,"mouseout",d),i.default.off(e.getWrapperElement(),"mouseout",d),r.style.opacity?(r.style.opacity="0",setTimeout((function(){r.parentNode&&r.parentNode.removeChild(r)}),600)):r.parentNode&&r.parentNode.removeChild(r)};i.default.on(r,"mouseover",f),i.default.on(r,"mouseout",d),i.default.on(e.getWrapperElement(),"mouseout",d)}(e,t,s)}}}(e,o)},l=function(e){var t=e.state.info.options;return(null==t?void 0:t.hoverTime)||500}(e);n.hoverTimeout=setTimeout(c,l),i.default.on(document,"mousemove",a),i.default.on(e.getWrapperElement(),"mouseout",s)}}i.default.defineOption("info",!1,(function(e,t,n){if(n&&n!==i.default.Init){var r=e.state.info.onMouseOver;i.default.off(e.getWrapperElement(),"mouseover",r),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){var a=e.state.info=function(e){return{options:e instanceof Function?{render:e}:!0===e?{}:e}}(t);a.onMouseOver=o.bind(null,e),i.default.on(e.getWrapperElement(),"mouseover",a.onMouseOver)}}))},1277:function(e,t){"use strict";var n,r,i,o,a,s,c,l,u=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});function p(){var e=o,t=[];if(m("{"),!g("}")){do{t.push(f())}while(g(","));m("}")}return{kind:"Object",start:e,end:s,members:t}}function f(){var e=o,t="String"===l?h():null;m("String"),m(":");var n=d();return{kind:"Member",start:e,end:s,key:t,value:n}}function d(){switch(l){case"[":return function(){var e=o,t=[];if(m("["),!g("]")){do{t.push(d())}while(g(","));m("]")}return{kind:"Array",start:e,end:s,values:t}}();case"{":return p();case"String":case"Number":case"Boolean":case"Null":var e=h();return E(),e}m("Value")}function h(){return{kind:l,start:o,end:a,value:JSON.parse(r.slice(o,a))}}function m(e){if(l!==e){var t;if("EOF"===l)t="[end of file]";else if(a-o>1)t="`"+r.slice(o,a)+"`";else{var n=r.slice(o).match(/^.+?\b/);t="`"+(n?n[0]:r[o])+"`"}throw y("Expected ".concat(e," but found ").concat(t,"."))}E()}Object.defineProperty(t,"__esModule",{value:!0}),t.JSONSyntaxError=void 0,t.default=function(e){r=e,i=e.length,o=a=s=-1,b(),E();var t=p();return m("EOF"),t};var v=function(e){function t(t,n){var r=e.call(this,t)||this;return r.position=n,r}return u(t,e),t}(Error);function y(e){return new v(e,{start:o,end:a})}function g(e){if(l===e)return E(),!0}function b(){return a31;)if(92===c)switch(c=b()){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:b();break;case 117:b(),w(),w(),w(),w();break;default:throw y("Bad character escape sequence.")}else{if(a===i)throw y("Unterminated string.");b()}if(34!==c)throw y("Unterminated string.");b()}();case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return l="Number",45===c&&b(),48===c?b():T(),46===c&&(b(),T()),void(69!==c&&101!==c||(43!==(c=b())&&45!==c||b(),T()));case 102:if("false"!==r.slice(o,o+5))break;return a+=4,b(),void(l="Boolean");case 110:if("null"!==r.slice(o,o+4))break;return a+=3,b(),void(l="Null");case 116:if("true"!==r.slice(o,o+4))break;return a+=3,b(),void(l="Boolean")}l=r[o],b()}else l="EOF"}function w(){if(c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102)return b();throw y("Expected hexadecimal digit.")}function T(){if(c<48||c>57)throw y("Expected decimal digit.");do{b()}while(c>=48&&c<=57)}t.JSONSyntaxError=v},5805:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631));function o(e,t){var n=t.target||t.srcElement;if(n instanceof HTMLElement&&"SPAN"===(null==n?void 0:n.nodeName)){var r=n.getBoundingClientRect(),i={left:(r.left+r.right)/2,top:(r.top+r.bottom)/2};e.state.jump.cursor=i,e.state.jump.isHoldingModifier&&l(e)}}function a(e){e.state.jump.isHoldingModifier||!e.state.jump.cursor?e.state.jump.isHoldingModifier&&e.state.jump.marker&&u(e):e.state.jump.cursor=null}function s(e,t){if(!e.state.jump.isHoldingModifier&&t.key===(c?"Meta":"Control")){e.state.jump.isHoldingModifier=!0,e.state.jump.cursor&&l(e);var n=function(a){a.code===t.code&&(e.state.jump.isHoldingModifier=!1,e.state.jump.marker&&u(e),i.default.off(document,"keyup",n),i.default.off(document,"click",r),e.off("mousedown",o))},r=function(t){var n=e.state.jump.destination;n&&e.state.jump.options.onClick(n,t)},o=function(t,n){e.state.jump.destination&&(n.codemirrorIgnore=!0)};i.default.on(document,"keyup",n),i.default.on(document,"click",r),e.on("mousedown",o)}}i.default.defineOption("jump",!1,(function(e,t,n){if(n&&n!==i.default.Init){var r=e.state.jump.onMouseOver;i.default.off(e.getWrapperElement(),"mouseover",r);var c=e.state.jump.onMouseOut;i.default.off(e.getWrapperElement(),"mouseout",c),i.default.off(document,"keydown",e.state.jump.onKeyDown),delete e.state.jump}if(t){var l=e.state.jump={options:t,onMouseOver:o.bind(null,e),onMouseOut:a.bind(null,e),onKeyDown:s.bind(null,e)};i.default.on(e.getWrapperElement(),"mouseover",l.onMouseOver),i.default.on(e.getWrapperElement(),"mouseout",l.onMouseOut),i.default.on(document,"keydown",l.onKeyDown)}}));var c="undefined"!=typeof navigator&&navigator&&-1!==navigator.appVersion.indexOf("Mac");function l(e){if(!e.state.jump.marker){var t=e.state.jump.cursor,n=e.coordsChar(t),r=e.getTokenAt(n,!0),i=e.state.jump.options,o=i.getDestination||e.getHelper(n,"jump");if(o){var a=o(r,i,e);if(a){var s=e.markText({line:n.line,ch:r.start},{line:n.line,ch:r.end},{className:"CodeMirror-jump-token"});e.state.jump.marker=s,e.state.jump.destination=a}}}}function u(e){var t=e.state.jump.marker;e.state.jump.marker=null,e.state.jump.destination=null,t.clear()}},88:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(435),o=r(n(9655));t.default=function(e){var t=(0,i.onlineParser)({eatWhitespace:function(e){return e.eatWhile(i.isIgnored)},lexRules:i.LexRules,parseRules:i.ParseRules,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:o.default,electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}}},9655:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n,r,i=e.levels;return((i&&0!==i.length?i[i.length-1]-((null===(n=this.electricInput)||void 0===n?void 0:n.test(t))?1:0):e.indentLevel)||0)*((null===(r=this.config)||void 0===r?void 0:r.indentUnit)||0)}},6094:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=n(875),a=r(n(3285)),s=r(n(8984));i.default.registerHelper("hint","graphql-variables",(function(e,t){var n=e.getCursor(),r=e.getTokenAt(n),c=function(e,t,n){var r="Invalid"===t.state.kind?t.state.prevState:t.state,i=r.kind,c=r.step;if("Document"===i&&0===c)return(0,s.default)(e,t,[{text:"{"}]);var l=n.variableToType;if(l){var u=function(e,t){var n={type:null,fields:null};return(0,a.default)(t,(function(t){if("Variable"===t.kind)n.type=e[t.name];else if("ListValue"===t.kind){var r=n.type?(0,o.getNullableType)(n.type):void 0;n.type=r instanceof o.GraphQLList?r.ofType:null}else if("ObjectValue"===t.kind){var i=n.type?(0,o.getNamedType)(n.type):void 0;n.fields=i instanceof o.GraphQLInputObjectType?i.getFields():null}else if("ObjectField"===t.kind){var a=t.name&&n.fields?n.fields[t.name]:null;n.type=null==a?void 0:a.type}})),n}(l,t.state);if("Document"===i||"Variable"===i&&0===c){var p=Object.keys(l);return(0,s.default)(e,t,p.map((function(e){return{text:'"'.concat(e,'": '),type:l[e]}})))}if(("ObjectValue"===i||"ObjectField"===i&&0===c)&&u.fields){var f=Object.keys(u.fields).map((function(e){return u.fields[e]}));return(0,s.default)(e,t,f.map((function(e){return{text:'"'.concat(e.name,'": '),type:e.type,description:e.description}})))}if("StringValue"===i||"NumberValue"===i||"BooleanValue"===i||"NullValue"===i||"ListValue"===i&&1===c||"ObjectField"===i&&2===c||"Variable"===i&&2===c){var d=u.type?(0,o.getNamedType)(u.type):void 0;if(d instanceof o.GraphQLInputObjectType)return(0,s.default)(e,t,[{text:"{"}]);if(d instanceof o.GraphQLEnumType){var h=d.getValues();return(0,s.default)(e,t,h.map((function(e){return{text:'"'.concat(e.name,'"'),type:d,description:e.description}})))}if(d===o.GraphQLBoolean)return(0,s.default)(e,t,[{text:"true",type:o.GraphQLBoolean,description:"Not false."},{text:"false",type:o.GraphQLBoolean,description:"Not true."}])}}}(n,r,t);return(null==c?void 0:c.list)&&c.list.length>0&&(c.from=i.default.Pos(c.from.line,c.from.ch),c.to=i.default.Pos(c.to.line,c.to.ch),i.default.signal(e,"hasCompletion",e,c,r)),c}))},373:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=s(n(4631)),l=n(875),u=o(n(1277));function p(e,t){if(!e||!t)return[];if(e instanceof l.GraphQLNonNull)return"Null"===t.kind?[[t,'Type "'.concat(e,'" is non-nullable and cannot be null.')]]:p(e.ofType,t);if("Null"===t.kind)return[];if(e instanceof l.GraphQLList){var n=e.ofType;return"Array"===t.kind?d(t.values||[],(function(e){return p(n,e)})):p(n,t)}if(e instanceof l.GraphQLInputObjectType){if("Object"!==t.kind)return[[t,'Type "'.concat(e,'" must be an Object.')]];var r=Object.create(null),i=d(t.members,(function(t){var n,i=null===(n=null==t?void 0:t.key)||void 0===n?void 0:n.value;r[i]=!0;var o=e.getFields()[i];return o?p(o?o.type:void 0,t.value):[[t.key,'Type "'.concat(e,'" does not have a field "').concat(i,'".')]]}));return Object.keys(e.getFields()).forEach((function(n){r[n]||e.getFields()[n].type instanceof l.GraphQLNonNull&&i.push([t,'Object of type "'.concat(e,'" is missing required field "').concat(n,'".')])})),i}return"Boolean"===e.name&&"Boolean"!==t.kind||"String"===e.name&&"String"!==t.kind||"ID"===e.name&&"Number"!==t.kind&&"String"!==t.kind||"Float"===e.name&&"Number"!==t.kind||"Int"===e.name&&("Number"!==t.kind||(0|t.value)!==t.value)||(e instanceof l.GraphQLEnumType||e instanceof l.GraphQLScalarType)&&("String"!==t.kind&&"Number"!==t.kind&&"Boolean"!==t.kind&&"Null"!==t.kind||null==(o=e.parseValue(t.value))||o!=o)?[[t,'Expected value of type "'.concat(e,'".')]]:[];var o}function f(e,t,n){return{message:n,severity:"error",type:"validation",from:e.posFromIndex(t.start),to:e.posFromIndex(t.end)}}function d(e,t){return Array.prototype.concat.apply([],e.map(t))}c.default.registerHelper("lint","graphql-variables",(function(e,t,n){if(!e)return[];var r;try{r=(0,u.default)(e)}catch(e){if(e instanceof u.JSONSyntaxError)return[f(n,e.position,e.message)];throw e}var i=t.variableToType;return i?function(e,t,n){var r=[];return n.members.forEach((function(n){var i;if(n){var o=null===(i=n.key)||void 0===i?void 0:i.value,s=t[o];s?p(s,n.value).forEach((function(t){var n=a(t,2),i=n[0],o=n[1];r.push(f(e,i,o))})):r.push(f(e,n.key,'Variable "$'.concat(o,'" does not appear in any GraphQL query.')))}})),r}(n,i,r):[]}))},9677:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=n(435);function a(e,t){var n,r,i=e.levels;return((i&&0!==i.length?i[i.length-1]-((null===(n=this.electricInput)||void 0===n?void 0:n.test(t))?1:0):e.indentLevel)||0)*((null===(r=this.config)||void 0===r?void 0:r.indentUnit)||0)}i.default.defineMode("graphql-variables",(function(e){var t=(0,o.onlineParser)({eatWhitespace:function(e){return e.eatSpace()},lexRules:s,parseRules:c,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:a,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));var s={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},c={Document:[(0,o.p)("{"),(0,o.list)("Variable",(0,o.opt)((0,o.p)(","))),(0,o.p)("}")],Variable:[l("variable"),(0,o.p)(":"),"Value"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,o.t)("Number","number")],StringValue:[(0,o.t)("String","string")],BooleanValue:[(0,o.t)("Keyword","builtin")],NullValue:[(0,o.t)("Keyword","keyword")],ListValue:[(0,o.p)("["),(0,o.list)("Value",(0,o.opt)((0,o.p)(","))),(0,o.p)("]")],ObjectValue:[(0,o.p)("{"),(0,o.list)("ObjectField",(0,o.opt)((0,o.p)(","))),(0,o.p)("}")],ObjectField:[l("attribute"),(0,o.p)(":"),"Value"]};function l(e){return{style:e,match:function(e){return"String"===e.kind},update:function(e,t){e.name=t.value.slice(1,-1)}}}},4504:function(e,t,n){!function(e){"use strict";var t={},n=/[^\s\u00a0]/,r=e.Pos,i=e.cmpPos;function o(e){var t=e.search(n);return-1==t?0:t}function a(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=t);for(var n=this,i=1/0,o=this.listSelections(),a=null,s=o.length-1;s>=0;s--){var c=o[s].from(),l=o[s].to();c.line>=i||(l.line>=i&&(l=r(i,0)),i=c.line,null==a?n.uncomment(c,l,e)?a="un":(n.lineComment(c,l,e),a="line"):"un"==a?n.uncomment(c,l,e):n.lineComment(c,l,e))}})),e.defineExtension("lineComment",(function(e,i,s){s||(s=t);var c,l,u=this,p=a(u,e),f=u.getLine(e.line);if(null!=f&&(c=e,l=f,!/\bstring\b/.test(u.getTokenTypeAt(r(c.line,0)))||/^[\'\"\`]/.test(l))){var d=s.lineComment||p.lineComment;if(d){var h=Math.min(0!=i.ch||i.line==e.line?i.line+1:i.line,u.lastLine()+1),m=null==s.padding?" ":s.padding,v=s.commentBlankLines||e.line==i.line;u.operation((function(){if(s.indent){for(var t=null,i=e.line;ia.length)&&(t=a)}for(i=e.line;if||c.operation((function(){if(0!=s.fullLines){var t=n.test(c.getLine(f));c.replaceRange(d+p,r(f)),c.replaceRange(u+d,r(e.line,0));var a=s.blockCommentLead||l.blockCommentLead;if(null!=a)for(var h=e.line+1;h<=f;++h)(h!=f||t)&&c.replaceRange(a+d,r(h,0))}else{var m=0==i(c.getCursor("to"),o),v=!c.somethingSelected();c.replaceRange(p,o),m&&c.setSelection(v?o:c.getCursor("from"),o),c.replaceRange(u,e)}}))}}else(s.lineComment||l.lineComment)&&0!=s.fullLines&&c.lineComment(e,o,s)})),e.defineExtension("uncomment",(function(e,i,o){o||(o=t);var s,c=this,l=a(c,e),u=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,c.lastLine()),p=Math.min(e.line,u),f=o.lineComment||l.lineComment,d=[],h=null==o.padding?" ":o.padding;e:if(f){for(var m=p;m<=u;++m){var v=c.getLine(m),y=v.indexOf(f);if(y>-1&&!/comment/.test(c.getTokenTypeAt(r(m,y+1)))&&(y=-1),-1==y&&n.test(v))break e;if(y>-1&&n.test(v.slice(0,y)))break e;d.push(v)}if(c.operation((function(){for(var e=p;e<=u;++e){var t=d[e-p],n=t.indexOf(f),i=n+f.length;n<0||(t.slice(i,i+h.length)==h&&(i+=h.length),s=!0,c.replaceRange("",r(e,n),r(e,i)))}})),s)return!0}var g=o.blockCommentStart||l.blockCommentStart,b=o.blockCommentEnd||l.blockCommentEnd;if(!g||!b)return!1;var E=o.blockCommentLead||l.blockCommentLead,w=c.getLine(p),T=w.indexOf(g);if(-1==T)return!1;var _=u==p?w:c.getLine(u),k=_.indexOf(b,u==p?T+g.length:0),O=r(p,T+1),S=r(u,k+1);if(-1==k||!/comment/.test(c.getTokenTypeAt(O))||!/comment/.test(c.getTokenTypeAt(S))||c.getRange(O,S,"\n").indexOf(b)>-1)return!1;var x=w.lastIndexOf(g,e.ch),C=-1==x?-1:w.slice(0,e.ch).indexOf(b,x+g.length);if(-1!=x&&-1!=C&&C+b.length!=e.ch)return!1;C=_.indexOf(b,i.ch);var N=_.slice(i.ch).lastIndexOf(g,C-i.ch);return x=-1==C||-1==N?-1:i.ch+N,(-1==C||-1==x||x==i.ch)&&(c.operation((function(){c.replaceRange("",r(u,k-(h&&_.slice(k-h.length,k)==h?h.length:0)),r(u,k+b.length));var e=T+g.length;if(h&&w.slice(e,e+h.length)==h&&(e+=h.length),c.replaceRange("",r(p,T),r(p,e)),E)for(var t=p+1;t<=u;++t){var i=c.getLine(t),o=i.indexOf(E);if(-1!=o&&!n.test(i.slice(0,o))){var a=o+E.length;h&&i.slice(a,a+h.length)==h&&(a+=h.length),c.replaceRange("",r(t,o),r(t,a))}}})),!0)}))}(n(4631))},5292:function(e,t,n){!function(e){function t(t,n,r){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(o,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",(function(r,i,o){o||(o={}),n(this,null);var a=t(this,r,o.bottom),s=!1,c=this;function l(t){if("string"==typeof t)p.value=t;else{if(s)return;s=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),c.focus(),o.onClose&&o.onClose(a)}}var u,p=a.getElementsByTagName("input")[0];return p?(p.focus(),o.value&&(p.value=o.value,!1!==o.selectValueOnOpen&&p.select()),o.onInput&&e.on(p,"input",(function(e){o.onInput(e,p.value,l)})),o.onKeyUp&&e.on(p,"keyup",(function(e){o.onKeyUp(e,p.value,l)})),e.on(p,"keydown",(function(t){o&&o.onKeyDown&&o.onKeyDown(t,p.value,l)||((27==t.keyCode||!1!==o.closeOnEnter&&13==t.keyCode)&&(p.blur(),e.e_stop(t),l()),13==t.keyCode&&i(p.value,t))})),!1!==o.closeOnBlur&&e.on(a,"focusout",(function(e){null!==e.relatedTarget&&l()}))):(u=a.getElementsByTagName("button")[0])&&(e.on(u,"click",(function(){l(),c.focus()})),!1!==o.closeOnBlur&&e.on(u,"blur",l),u.focus()),l})),e.defineExtension("openConfirm",(function(r,i,o){n(this,null);var a=t(this,r,o&&o.bottom),s=a.getElementsByTagName("button"),c=!1,l=this,u=1;function p(){c||(c=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),l.focus())}s[0].focus();for(var f=0;f",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:function(t){var i=s(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),a=t.listSelections(),c=0;c=0;c--){var p=a[c].head;t.replaceRange("",n(p.line,p.ch-1),n(p.line,p.ch+1),"+delete")}},Enter:function(t){var n=s(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a1&&h.indexOf(i)>=0&&t.getRange(n(w.line,w.ch-2),w)==i+i){if(w.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(w.line,w.ch-2))))return e.Pass;b="addFour"}else if(m){var _=0==w.ch?" ":t.getRange(n(w.line,w.ch-1),w);if(e.isWordChar(T)||_==i||e.isWordChar(_))return e.Pass;b="both"}else{if(!y||!(0===T.length||/\s/.test(T)||d.indexOf(T)>-1))return e.Pass;b="both"}else b=m&&p(t,w)?"both":h.indexOf(i)>=0&&t.getRange(w,n(w.line,w.ch+3))==i+i+i?"skipThree":"skip";if(f){if(f!=b)return e.Pass}else f=b}var k=u%2?a.charAt(u-1):i,O=u%2?i:a.charAt(u+1);t.operation((function(){if("skip"==f)c(t,1);else if("skipThree"==f)c(t,3);else if("surround"==f){for(var e=t.getSelections(),n=0;n0?{line:a.head.line,ch:a.head.ch+t}:{line:a.head.line-1};n.push({anchor:s,head:s})}e.setSelections(n,i)}function l(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function u(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function p(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}(n(4631))},4328:function(e,t,n){!function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var s=e.getLineHandle(t.line),c=t.ch-1,l=o&&o.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=i(o),p=!l&&c>=0&&u.test(s.text.charAt(c))&&r[s.text.charAt(c)]||u.test(s.text.charAt(c+1))&&r[s.text.charAt(++c)];if(!p)return null;var f=">"==p.charAt(1)?1:-1;if(o&&o.strict&&f>0!=(c==t.ch))return null;var d=e.getTokenTypeAt(n(t.line,c+1)),h=a(e,n(t.line,c+(f>0?1:0)),f,d,o);return null==h?null:{from:n(t.line,c),to:h&&h.pos,match:h&&h.ch==p.charAt(0),forward:f>0}}function a(e,t,o,a,s){for(var c=s&&s.maxScanLineLength||1e4,l=s&&s.maxScanLines||1e3,u=[],p=i(s),f=o>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=f;d+=o){var h=e.getLine(d);if(h){var m=o>0?0:h.length-1,v=o>0?h.length:-1;if(!(h.length>c))for(d==t.line&&(m=t.ch-(o<0?1:0));m!=v;m+=o){var y=h.charAt(m);if(p.test(y)&&(void 0===a||(e.getTokenTypeAt(n(d,m+1))||"")==(a||""))){var g=r[y];if(g&&">"==g.charAt(1)==o>0)u.push(y);else{if(!u.length)return{pos:n(d,m),ch:y};u.pop()}}}}}return d-o!=(o>0?e.lastLine():e.firstLine())&&null}function s(e,r,i){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=i&&i.highlightNonMatching,c=[],l=e.listSelections(),u=0;ut.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var c=r(s.line+1);if(null==c)break;s=c.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:s}})),e.registerHelper("fold","include",(function(t,n){function r(n){if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;null!=r(a+1);)++a;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}}))}(n(4631))},8657:function(e,t,n){!function(e){"use strict";function t(t,n,i,o){if(i&&i.call){var a=i;i=null}else a=r(t,i,"rangeFinder");"number"==typeof n&&(n=e.Pos(n,0));var s=r(t,i,"minFoldSize");function c(e){var r=a(t,n);if(!r||r.to.line-r.from.linet.firstLine();)n=e.Pos(n.line-1,0),l=c(!1);if(l&&!l.cleared&&"unfold"!==o){var u=function(e,t,n){var i=r(e,t,"widget");if("function"==typeof i&&(i=i(n.from,n.to)),"string"==typeof i){var o=document.createTextNode(i);(i=document.createElement("span")).appendChild(o),i.className="CodeMirror-foldmarker"}else i&&(i=i.cloneNode(!0));return i}(t,i,l);e.on(u,"mousedown",(function(t){p.clear(),e.e_preventDefault(t)}));var p=t.markText(l.from,l.to,{replacedWith:u,clearOnEnter:r(t,i,"clearOnEnter"),__isFold:!0});p.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,l.from,l.to)}}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n=l){if(f&&a&&f.test(a.className))return;o=i(s.indicatorOpen)}}(o||a)&&e.setGutterMarker(n,s.gutter,o)}))}function a(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){o(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function c(e,n,i){var o=e.state.foldGutter;if(o){var a=o.options;if(i==a.gutter){var s=r(e,n);s?s.clear():e.foldCode(t(n,0),a)}}}function l(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),n.foldOnChangeTimeSpan||600)}}function u(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?s(e):e.operation((function(){n.fromt.to&&(o(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r1)){if(this.somethingSelected()){if(!n.hint.supportsSelection)return;for(var i=0;il.clientHeight+1;if(setTimeout((function(){C=a.getScrollInfo()})),N.bottom-x>0){var L=N.bottom-N.top;if(y.top-(y.bottom-N.top)-L>0)l.style.top=(b=y.top-L-T)+"px",E=!1;else if(L>x){l.style.height=x-5+"px",l.style.top=(b=y.bottom-N.top-T)+"px";var D=a.getCursor();n.from.ch!=D.ch&&(y=a.cursorCoords(D),l.style.left=(g=y.left-w)+"px",N=l.getBoundingClientRect())}}var I,P=N.right-S;if(A&&(P+=a.display.nativeBarWidth),P>0&&(N.right-N.left>S&&(l.style.width=S-5+"px",P-=N.right-N.left-S),l.style.left=(g=Math.max(y.left-P-w,0))+"px"),A)for(var R=l.firstChild;R;R=R.nextSibling)R.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=function(e,t){var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close};/Mac/.test(navigator.platform)&&(n["Ctrl-P"]=function(){t.moveFocus(-1)},n["Ctrl-N"]=function(){t.moveFocus(1)});var r=e.options.customKeys,i=r?{}:n;function o(e,r){var o;o="string"!=typeof r?function(e){return r(e,t)}:n.hasOwnProperty(r)?n[r]:r,i[e]=o}if(r)for(var a in r)r.hasOwnProperty(a)&&o(a,r[a]);var s=e.options.extraKeys;if(s)for(var a in s)s.hasOwnProperty(a)&&o(a,s[a]);return i}(t,{moveFocus:function(e,t){r.changeActive(r.selectedHint+e,t)},setFocus:function(e){r.changeActive(e)},menuSize:function(){return r.screenAmount()},length:p.length,close:function(){t.close()},pick:function(){r.pick()},data:n})),t.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){I=setTimeout((function(){t.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(I)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),n=a.getWrapperElement().getBoundingClientRect();C||(C=a.getScrollInfo());var r=b+C.top-e.top,i=r-(c.pageYOffset||(s.documentElement||s.body).scrollTop);if(E||(i+=l.offsetHeight),i<=n.top||i>=n.bottom)return t.close();l.style.top=r+"px",l.style.left=g+C.left-e.left+"px"}),e.on(l,"dblclick",(function(e){var t=o(l,e.target||e.srcElement);t&&null!=t.hintId&&(r.changeActive(t.hintId),r.pick())})),e.on(l,"click",(function(e){var n=o(l,e.target||e.srcElement);n&&null!=n.hintId&&(r.changeActive(n.hintId),t.options.completeOnSingleClick&&r.pick())})),e.on(l,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var M=this.getSelectedHintRange();return 0===M.from&&0===M.to||this.scrollToActive(),e.signal(n,"select",p[this.selectedHint],l.childNodes[this.selectedHint]),!0}function s(e,t,n,r){if(e.async)e(t,r,n);else{var i=e(t,n);i&&i.then?i.then(r):r(i)}}t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n],o=this;this.cm.operation((function(){r.hint?r.hint(o.cm,t,r):o.cm.replaceRange(i(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),o.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(r(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),i=this.cm.getLine(t.line);if(t.line!=this.startPos.line||i.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=n?this.data.list.length-1:0:t<0&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var r=this.hints.childNodes[this.selectedHint];r&&(r.className=r.className.replace(" CodeMirror-hint-active",""),r.removeAttribute("aria-selected")),(r=this.hints.childNodes[this.selectedHint=t]).className+=" CodeMirror-hint-active",r.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",r.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],r)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],r=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:function(t,n){var r,i=t.getHelpers(n,"hint");if(i.length){var o=function(e,t,n){var r=function(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):i(o+1)}))}(0)};return o.async=!0,o.supportsSelection=!0,o}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,n){var r,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(n(4631))},3256:function(e,t,n){!function(e){"use strict";var t="CodeMirror-lint-markers";function n(e){e.parentNode&&e.parentNode.removeChild(e)}function r(t,r,i,o){var a=function(t,n,r){var i=document.createElement("div");function o(t){if(!i.parentNode)return e.off(document,"mousemove",o);i.style.top=Math.max(0,t.clientY-i.offsetHeight-5)+"px",i.style.left=t.clientX+5+"px"}return i.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,i.appendChild(r.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(i):document.body.appendChild(i),e.on(document,"mousemove",o),o(n),null!=i.style.opacity&&(i.style.opacity=1),i}(t,r,i);function s(){var t;e.off(o,"mouseout",s),a&&((t=a).parentNode&&(null==t.style.opacity&&n(t),t.style.opacity=0,setTimeout((function(){n(t)}),600)),a=null)}var c=setInterval((function(){if(a)for(var e=o;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){s();break}}if(!a)return clearInterval(c)}),400);e.on(o,"mouseout",s)}function i(e,t,n){for(var i in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),t&&!0!==t||(t={}),this.options={},this.linterOptions=t.options||{},o)this.options[i]=o[i];for(var i in t)o.hasOwnProperty(i)?null!=t[i]&&(this.options[i]=t[i]):t.options||(this.linterOptions[i]=t[i]);this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){!function(e,t){var n=t.target||t.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className)){for(var i=n.getBoundingClientRect(),o=(i.left+i.right)/2,a=(i.top+i.bottom)/2,s=e.findMarksAt(e.coordsChar({left:o,top:a},"client")),l=[],u=0;u-1)&&d.push(e.message)}));for(var h=null,m=o.hasGutter&&document.createDocumentFragment(),v=0;v1,l.tooltips)),l.highlightLines&&e.addLineClass(p,"wrap","CodeMirror-lint-line-"+h)}}l.onUpdateLinting&&l.onUpdateLinting(n,u,e)}}function p(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){l(e)}),t.options.delay))}e.defineOption("lint",!1,(function(n,r,o){if(o&&o!=e.Init&&(a(n),!1!==n.state.lint.options.lintOnChange&&n.off("change",p),e.off(n.getWrapperElement(),"mouseover",n.state.lint.onMouseOver),clearTimeout(n.state.lint.timeout),delete n.state.lint),r){for(var s=n.getOption("gutters"),c=!1,u=0;u '+e.phrase("(Use line:column or scroll% syntax)")+""}(e),e.phrase("Jump to line:"),n.line+1+":"+n.ch,(function(r){var i;if(r)if(i=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(r))e.setCursor(t(e,i[1]),Number(i[2]));else if(i=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(r)){var o=Math.round(e.lineCount()*Number(i[1])/100);/^[-+]/.test(i[1])&&(o=n.line+o+1),e.setCursor(o-1,n.ch)}else(i=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(r))&&e.setCursor(t(e,i[1]),n.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}(n(4631),n(5292))},1699:function(e,t,n){!function(e){"use strict";function t(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new t)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function i(e,t,n){return e.getSearchCursor(t,n,{caseFold:r(t),multiline:!0})}function o(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function a(e){return e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"==t?"\\":e}))}function s(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=a(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,t,n){t.queryText=n,t.query=s(n),e.removeOverlay(t.overlay,r(t.query)),t.overlay=function(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}(t.query,r(t.query)),e.addOverlay(t.overlay),e.showMatchesOnScrollbar&&(t.annotate&&(t.annotate.clear(),t.annotate=null),t.annotate=e.showMatchesOnScrollbar(t.query,r(t.query)))}function l(t,r,i,a){var s=n(t);if(s.query)return u(t,r);var l=t.getSelection()||s.lastQuery;if(l instanceof RegExp&&"x^"==l.source&&(l=null),i&&t.openDialog){var f=null,h=function(n,r){e.e_stop(r),n&&(n!=s.queryText&&(c(t,s,n),s.posFrom=s.posTo=t.getCursor()),f&&(f.style.opacity=1),u(t,r.shiftKey,(function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((f=r).style.opacity=.4)})))};(function(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(e)},onKeyDown:i,bottom:e.options.search.bottom})})(t,d(t),l,h,(function(r,i){var o=e.keyName(r),a=t.getOption("extraKeys"),s=a&&a[o]||e.keyMap[t.getOption("keyMap")][o];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(r),c(t,n(t),i),t.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(r),h(i,r))})),a&&l&&(c(t,s,l),u(t,r))}else o(t,d(t),"Search for:",l,(function(e){e&&!s.query&&t.operation((function(){c(t,s,e),s.posFrom=s.posTo=t.getCursor(),u(t,r)}))}))}function u(t,r,o){t.operation((function(){var a=n(t),s=i(t,a.query,r?a.posFrom:a.posTo);(s.find(r)||(s=i(t,a.query,r?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(r))&&(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),o&&o(s.from(),s.to()))}))}function p(e){e.operation((function(){var t=n(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function f(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var r in t)n[r]=t[r];for(var i=2;iu);p++){var f=e.getLine(l++);s=null==s?f:s+"\n"+f}c*=2,t.lastIndex=n.ch;var d=t.exec(s);if(d){var h=s.slice(0,d.index).split("\n"),m=d[0].split("\n"),v=n.line+h.length-1,y=h[h.length-1].length;return{from:r(v,y),to:r(v+m.length-1,1==m.length?y+m[0].length:m[m.length-1].length),match:d}}}}function c(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function l(e,t,n){t=i(t,"g");for(var o=n.line,a=n.ch,s=e.firstLine();o>=s;o--,a=-1){var l=e.getLine(o),u=c(l,t,a<0?0:l.length-a);if(u)return{from:r(o,u.index),to:r(o,u.index+u[0].length),match:u}}}function u(e,t,n){if(!o(t))return l(e,t,n);t=i(t,"gm");for(var a,s=1,u=e.getLine(n.line).length-n.ch,p=n.line,f=e.firstLine();p>=f;){for(var d=0;d=f;d++){var h=e.getLine(p--);a=null==a?h:h+"\n"+a}s*=2;var m=c(a,t,u);if(m){var v=a.slice(0,m.index).split("\n"),y=m[0].split("\n"),g=p+v.length,b=v[v.length-1].length;return{from:r(g,b),to:r(g+y.length-1,1==y.length?b+y[0].length:y[y.length-1].length),match:m}}}}function p(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function f(e,i,o,a){if(!i.length)return null;var s=a?t:n,c=s(i).split(/\r|\n\r?/);e:for(var l=o.line,u=o.ch,f=e.lastLine()+1-c.length;l<=f;l++,u=0){var d=e.getLine(l).slice(u),h=s(d);if(1==c.length){var m=h.indexOf(c[0]);if(-1==m)continue e;return o=p(d,h,m,s)+u,{from:r(l,p(d,h,m,s)+u),to:r(l,p(d,h,m+c[0].length,s)+u)}}var v=h.length-c[0].length;if(h.slice(v)==c[0]){for(var y=1;y=f;l--,u=-1){var d=e.getLine(l);u>-1&&(d=d.slice(0,u));var h=s(d);if(1==c.length){var m=h.lastIndexOf(c[0]);if(-1==m)continue e;return{from:r(l,p(d,h,m,s)),to:r(l,p(d,h,m+c[0].length,s))}}var v=c[c.length-1];if(h.slice(0,v.length)==v){var y=1;for(o=l-c.length+1;y(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=e.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var i=this.matches(t,n);if(this.afterEmptyMatch=i&&0==e.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=r(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new h(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new h(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}(n(4631))},3412:function(e,t,n){!function(e){"use strict";var t=e.commands,n=e.Pos;function r(t,r){t.extendSelectionsBy((function(i){return t.display.shift||t.doc.extend||i.empty()?function(t,r,i){if(i<0&&0==r.ch)return t.clipPos(n(r.line-1));var o=t.getLine(r.line);if(i>0&&r.ch>=o.length)return t.clipPos(n(r.line+1,0));for(var a,s="start",c=r.ch,l=c,u=i<0?0:o.length,p=0;l!=u;l+=i,p++){var f=o.charAt(i<0?l-1:l),d="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==d&&f.toUpperCase()==f&&(d="W"),"start"==s)"o"!=d?(s="in",a=d):c=l+i;else if("in"==s&&a!=d){if("w"==a&&"W"==d&&i<0&&l--,"W"==a&&"w"==d&&i>0){if(l==c+1){a="w";continue}l--}break}}return n(r.line,l)}(t.doc,i.head,r):r<0?i.from():i.to()}))}function i(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,i=[],o=-1,a=0;a=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],i=0;io.line&&s==a.line&&0==a.ch||r.push({anchor:s==o.line?o:n(s,0),head:s==a.line?a:n(s)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;s--){var l=r[i[s]];if(!(c&&e.cmpPos(l.head,c)>0)){var u=o(t,l.head);c=u.from,t.replaceRange(n(u.word),u.from,u.to)}}}))}function f(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=o(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function d(e,t){var r=f(e);if(r){var i=r.query,o=e.getSearchCursor(i,t?r.to:r.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(i,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):r.word&&e.setSelection(r.from,r.to))}}t.selectScope=function(e){c(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!c(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy((function(r){var i=t.scanForBracket(r.head,1,l(t.getTokenTypeAt(r.head)));if(i&&0!=e.cmpPos(i.pos,r.head))return i.pos;var o=t.scanForBracket(r.head,-1,l(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.firstLine()-1,a=[],s=0;so?i.push(l,u):i.length&&(i[i.length-1]=u),o=u}t.operation((function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+s,n(t.lastLine()),null,"+swapLine"):t.replaceRange(s+"\n",n(o,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],c=s.to().line+1,l=s.from().line;0!=s.to().ch||s.empty()||c--,c=0;e-=2){var r=i[e],o=i[e+1],a=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;o--){var a=r[o].head,s=t.getRange({line:a.line,ch:0},a),c=e.countColumn(s,null,t.getOption("tabSize")),l=t.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&c%i==0){var u=new n(a.line,e.findColumn(s,c-i,i));u.ch!=a.ch&&(l=u)}t.replaceRange("",l,a,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){p(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){p(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){d(e,!0)},t.findUnderPrevious=function(e){d(e,!1)},t.findAllUnder=function(e){var t=f(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var h=e.keyMap;h.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(h.macSublime),h.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(h.pcSublime);var m=h.default==h.macDefault;h.sublime=m?h.macSublime:h.pcSublime}(n(4631),n(2095),n(4328))},4631:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),c=!o&&/WebKit\//.test(e),l=c&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\/(\d+)/.exec(e),p=u&&+u[1],f=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),v=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),y=/Android/.test(e),g=v||y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=v||/Mac/.test(t),E=/\bCrOS\b/.test(e),w=/win/i.test(t),T=f&&e.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(f=!1,c=!0);var _=b&&(l||f&&(null==T||T<12.11)),k=n||a&&s>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,x=function(e,t){var n=e.className,r=O(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function C(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return C(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}v?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(M=function(e){try{e.select()}catch(e){}});var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};function q(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var $=[""];function H(e){for(;$.length<=e;)$.push(W($)+" ");return $[e]}function W(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&re.test(e)}function oe(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var se=null;function ce(e,t,n){var r;se=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:se=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:se=i)}return null!=r?r:se}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var c,l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var u=a.length,p=[],f=0;f-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function me(e,t){var n=de(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function be(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Te(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function _e(e){Ee(e),we(e)}function ke(e){return e.target||e.srcElement}function Oe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Se,xe,Ce=function(){if(a&&s<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Ne(e){if(null==Se){var t=A("span","​");N(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Se=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Se?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ae(e){if(null!=xe)return xe;var t=N(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return C(e),!(!n||n.left==n.right)&&(xe=r.right-n.right<3)}var Le,De=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ie=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe="oncopy"in(Le=A("div"))||(Le.setAttribute("oncopy","return;"),"function"==typeof Le.oncopy),Re=null;var Me={},je={};function Fe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Me[e]=t}function Ve(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=X(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Qe(e,t){t=Ve(t);var n=Me[t.name];if(!n)return Qe(e,"text/plain");var r=n(e,t);if(qe.hasOwnProperty(t.name)){var i=qe[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var qe={};function Ue(e,t){F(t,qe.hasOwnProperty(e)?qe[e]:qe[e]={})}function Ge(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Be(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ke(e,t,n){return!e.startState||e.startState(t,n)}var ze=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function $e(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?tt(n,$e(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?tt(e.line,t):n<0?tt(e.line,0):e}(t,$e(e,t.line).text.length)}function lt(e,t){for(var n=[],r=0;r=this.string.length},ze.prototype.sol=function(){return this.pos==this.lineStart},ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ze.prototype.next=function(){if(this.post},ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ze.prototype.skipToEnd=function(){this.pos=this.string.length},ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ze.prototype.backUp=function(e){this.pos-=e},ze.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},pt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,r){var i=[e.state.modeGen],o={};wt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],c=1,l=0;n.state=!0,wt(e,t.text,s.mode,n,(function(e,t){for(var n=c;le&&i.splice(c,1,e,i[c+1],r),c+=2,l=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,c-n,e,"overlay "+t),c=n+2;else for(;ne.options.maxHighlightLength&&Ge(e.doc.mode,r.state),o=ft(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ht(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new pt(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var c=$e(o,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof ut?l.lookAhead:0)<=o.modeFrontier))return s;var u=V(c.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),a=o>r.first&&$e(r,o-1).stateAfter,s=a?pt.fromSaved(r,a,o):new pt(r,Ke(r.mode),o);return r.iter(o,t,(function(n){mt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}pt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},pt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},pt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pt.fromSaved=function(e,t,n){return t instanceof ut?new pt(e,Ge(e.mode,t.state),n,t.lookAhead):new pt(e,Ge(e.mode,t),n)},pt.prototype.save=function(e){var t=!1!==e?Ge(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var gt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function bt(e,t,n,r){var i,o,a=e.doc,s=a.mode,c=$e(a,(t=ct(a,t)).line),l=ht(e,t.line,n),u=new ze(c.text,e.options.tabSize,l);for(r&&(o=[]);(r||u.pose.options.maxHighlightLength?(s=!1,a&&mt(e,t,r,p.pos),p.pos=t.length,c=null):c=Et(yt(n,p,r.state,f),o),f){var d=f[0].name;d&&(c="m-"+(c?d+" "+c:d))}if(!s||u!=c){for(;l=t:o.to>t);(r||(r=[])).push(new kt(a,o.from,s?null:o.to))}}return r}(n,i,a),c=function(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;bt)&&(!n||It(n,o.marker)<0)&&(n=o.marker)}return n}function Ft(e,t,n,r,i){var o=$e(e,t),a=_t&&o.markedSpans;if(a)for(var s=0;s=0&&p<=0||u<=0&&p>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?nt(l.to,n)>=0:nt(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?nt(l.from,r)<=0:nt(l.from,r)<0)))return!0}}}function Vt(e){for(var t;t=Rt(e);)e=t.find(-1,!0).line;return e}function Qt(e,t){var n=$e(e,t),r=Vt(n);return n==r?t:Je(r)}function qt(e,t){if(t>e.lastLine())return t;var n,r=$e(e,t);if(!Ut(e,r))return t;for(;n=Mt(r);)r=n.find(1,!0).line;return Je(r)+1}function Ut(e,t){var n=_t&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var $t=function(e,t,n){this.text=e,At(this,t),this.height=n?n(this):1};function Ht(e){e.parent=null,Nt(e)}$t.prototype.lineNo=function(){return Je(this)},be($t);var Wt={},Yt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:Wt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var n=L("span",null,null,c?"padding-right: .1px":null),r={pre:L("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=en,Ae(e.display.measure)&&(a=ue(o,e.doc.direction))&&(r.addToken=tn(r.addToken,a)),r.map=[],rn(o,r,dt(e,o,t!=e.display.externalMeasured&&Je(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=R(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=R(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ne(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=R(r.pre.className,r.textClass||"")),r}function Zt(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function en(e,t,n,r,i,o,c){if(t){var l,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;il&&p.from<=l);f++);if(p.to>=u)return e(n,r,i,o,a,s,c);e(n,r.slice(0,p.to-l),i,o,null,s,c),o=null,r=r.slice(p.to-l),l=p.to}}}function nn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,c,l,u,p,f,d=i.length,h=0,m=1,v="",y=0;;){if(y==h){c=l=u=s="",f=null,p=null,y=1/0;for(var g=[],b=void 0,E=0;Eh||T.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&y>w.to&&(y=w.to,l=""),T.className&&(c+=" "+T.className),T.css&&(s=(s?s+";":"")+T.css),T.startStyle&&w.from==h&&(u+=" "+T.startStyle),T.endStyle&&w.to==y&&(b||(b=[])).push(T.endStyle,w.to),T.title&&((f||(f={})).title=T.title),T.attributes)for(var _ in T.attributes)(f||(f={}))[_]=T.attributes[_];T.collapsed&&(!p||It(p.marker,T)<0)&&(p=w)}else w.from>h&&y>w.from&&(y=w.from)}if(b)for(var k=0;k=d)break;for(var S=Math.min(d,y);;){if(v){var x=h+v.length;if(!p){var C=x>S?v.slice(0,S-h):v;t.addToken(t,C,a?a+c:c,u,h+C.length==y?l:"",s,f)}if(x>=S){v=v.slice(S-h),h=S;break}h=x,u=""}v=i.slice(o,o=n[m++]),a=Jt(n[m++],t.cm.options)}}else for(var N=1;Nn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Dn(e,t,n,r){return Rn(e,Pn(e,t),n,r)}function In(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((c.bottom+l.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Fn(t.map,n,r),c=o.node,l=o.start,u=o.end,p=o.collapse;if(3==c.nodeType){for(var f=0;f<4;f++){for(;l&&ie(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+u1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var d;l>0&&(p=r="right"),i=e.options.lineWrapping&&(d=c.getClientRects()).length>1?d["right"==r?d.length-1:0]:c.getBoundingClientRect()}if(a&&s<9&&!l&&(!i||!i.left&&!i.right)){var h=c.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+ar(e.display),top:h.top,bottom:h.bottom}:jn}for(var m=i.top-t.rect.top,v=i.bottom-t.rect.top,y=(m+v)/2,g=t.view.measure.heights,b=0;bt)&&(i=(o=c-s)-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[2+(l-=3)],a="left";if("right"==n&&i==c-s)for(;l=0&&(n=e[i]).left==n.right;i--);return n}function Qn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(c=r.text.length,l="before"):c<=0&&(c=0,l="after"),!s)return a("before"==l?c-1:c,"before"==l);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var p=ce(s,c,l),f=se,d=u(c,p,"before"==l);return null!=f&&(d.other=u(c,f,"before"!=l)),d}function Yn(e,t){var n=0;t=ct(e.doc,t),e.options.lineWrapping||(n=ar(e.display)*t.ch);var r=$e(e.doc,t.line),i=Bt(r)+On(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Jn(e,t,n,r,i){var o=tt(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Jn(r.first,0,null,-1,-1);var i=Xe(r,n),o=r.first+r.size-1;if(i>o)return Jn(r.first+r.size-1,$e(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=$e(r,i);;){var s=nr(e,a,i,t,n),c=jt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!c)return s;var l=c.find(1);if(l.line==i)return l;a=$e(r,i=l.line)}}function Zn(e,t,n,r){r-=Kn(t);var i=t.text.length,o=ae((function(t){return Rn(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=ae((function(t){return Rn(e,n,t).top>r}),o,i)}}function er(e,t,n,r){return n||(n=Pn(e,t)),Zn(e,t,n,zn(e,t,Rn(e,n,r),"line").top)}function tr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function nr(e,t,n,r,i){i-=Bt(t);var o=Pn(e,t),a=Kn(t),s=0,c=t.text.length,l=!0,u=ue(t,e.doc.direction);if(u){var p=(e.options.lineWrapping?ir:rr)(e,t,n,o,u,r,i);s=(l=1!=p.level)?p.from:p.to-1,c=l?p.to:p.from-1}var f,d,h=null,m=null,v=ae((function(t){var n=Rn(e,o,t);return n.top+=a,n.bottom+=a,!!tr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,c),y=!1;if(m){var g=r-m.left=E.bottom?1:0}return Jn(n,v=oe(t.text,v,1),d,y,r-f)}function rr(e,t,n,r,i,o,a){var s=ae((function(s){var c=i[s],l=1!=c.level;return tr(Wn(e,tt(n,l?c.to:c.from,l?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),c=i[s];if(s>0){var l=1!=c.level,u=Wn(e,tt(n,l?c.from:c.to,l?"after":"before"),"line",t,r);tr(u,o,a,!0)&&u.top>a&&(c=i[s-1])}return c}function ir(e,t,n,r,i,o,a){var s=Zn(e,t,r,a),c=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var u=null,p=null,f=0;f=l||d.to<=c)){var h=Rn(e,r,1!=d.level?Math.min(l,d.to)-1:Math.max(c,d.from)).right,m=hm)&&(u=d,p=m)}}return u||(u=i[i.length-1]),u.froml&&(u={from:u.from,to:l,level:u.level}),u}function or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Mn){Mn=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Mn.appendChild(document.createTextNode("x")),Mn.appendChild(A("br"));Mn.appendChild(document.createTextNode("x"))}N(e.measure,Mn);var n=Mn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),C(e.measure),n||1}function ar(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");N(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function sr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:cr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function cr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var t=or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ar(e.display)-3);return function(i){if(Ut(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(c=$e(e.doc,l.line).text).length==l.ch){var u=V(c,c.length,e.options.tabSize)-c.length;l=tt(l.line,Math.max(0,Math.round((o-xn(e.display).left)/ar(e.display))-u))}return l}function fr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)_t&&Qt(e.doc,t)i.viewFrom?mr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)mr(e);else if(t<=i.viewFrom){var o=vr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):mr(e)}else if(n>=i.viewTo){var a=vr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):mr(e)}else{var s=vr(e,t,t,-1),c=vr(e,n,n+r,1);s&&c?(i.view=i.view.slice(0,s.index).concat(an(e,s.lineN,c.lineN)).concat(i.view.slice(c.index)),i.viewTo+=r):mr(e)}var l=i.externalMeasured;l&&(n=i.lineN&&t=r.viewTo)){var o=r.view[fr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==q(a,n)&&a.push(n)}}}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vr(e,t,n,r){var i,o=fr(e,t),a=e.display.view;if(!_t||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,c=0;c0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;Qt(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function yr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||c.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function wr(e,t){return e.top-t.top||e.left-t.left}function Tr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=xn(e.display),s=a.left,c=Math.max(r.sizerWidth,Nn(e)-r.sizer.offsetLeft)-a.right,l="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?c-e:n)+"px;\n height: "+(r-t)+"px"))}function p(t,n,r){var o,a,p=$e(i,t),f=p.text.length;function d(n,r){return Hn(e,tt(t,n),"div",p,r)}function h(t,n,r){var i=er(e,p,null,t),o="ltr"==n==("after"==r)?"left":"right";return d("after"==r?i.begin:i.end-(/\s/.test(p.text.charAt(i.end-1))?2:1),o)[o]}var m=ue(p,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,(function(e,t,i,p){var v="ltr"==i,y=d(e,v?"left":"right"),g=d(t-1,v?"right":"left"),b=null==n&&0==e,E=null==r&&t==f,w=0==p,T=!m||p==m.length-1;if(g.top-y.top<=3){var _=(l?E:b)&&T,k=(l?b:E)&&w?s:(v?y:g).left,O=_?c:(v?g:y).right;u(k,y.top,O-k,y.bottom)}else{var S,x,C,N;v?(S=l&&b&&w?s:y.left,x=l?c:h(e,i,"before"),C=l?s:h(t,i,"after"),N=l&&E&&T?c:g.right):(S=l?h(e,i,"before"):s,x=!l&&b&&w?c:y.right,C=!l&&E&&T?s:g.left,N=l?h(t,i,"after"):c),u(S,y.top,x-S,y.bottom),y.bottom0?t.blinker=setInterval((function(){e.hasFocus()||xr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function kr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Sr(e))}function Or(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&xr(e))}),100)}function Sr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(me(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),c&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),_r(e))}function xr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Cr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,c=0;c.005||m<-.005)&&(ie.display.sizerWidth){var y=Math.ceil(f/ar(e.display));y>e.display.maxLineLength&&(e.display.maxLineLength=y,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function Nr(e){if(e.widgets)for(var t=0;t=a&&(o=Xe(t,Bt($e(t,c))-e.wrapper.clientHeight),a=c)}return{from:o,to:Math.max(a,o+1)}}function Lr(e,t){var n=e.display,r=or(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=An(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Sn(n),c=t.tops-r;if(t.topi+o){var u=Math.min(t.top,(l?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-p,d=Nn(e)-n.gutters.offsetWidth,h=t.right-t.left>d;return h&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.leftd+f-3&&(a.scrollLeft=t.right+(h?0:10)-d),a}function Dr(e,t){null!=t&&(Rr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ir(e){Rr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pr(e,t,n){null==t&&null==n||Rr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Rr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mr(e,Yn(e,t.from),Yn(e,t.to),t.margin))}function Mr(e,t,n,r){var i=Lr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Pr(e,i.scrollLeft,i.scrollTop)}function jr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ui(e,{top:t}),Fr(e,t,!0),n&&ui(e),oi(e,100))}function Fr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Vr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,di(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Qr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Sn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Cn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var qr=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),fe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},qr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},qr.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Q,this.disableVert=new Q},qr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,r)}))},qr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ur=function(){};function Gr(e,t){t||(t=Qr(e));var n=e.display.barWidth,r=e.display.barHeight;Br(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Cr(e),Br(e,Qr(e)),n=e.display.barWidth,r=e.display.barHeight}function Br(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Ur.prototype.update=function(){return{bottom:0,right:0}},Ur.prototype.setScrollLeft=function(){},Ur.prototype.setScrollTop=function(){},Ur.prototype.clear=function(){};var Kr={native:qr,null:Ur};function zr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Kr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Vr(e,t):jr(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var $r=0;function Hr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++$r,markArrays:null},t=e.curOp,sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}function Wr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new si(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Jr(e){e.updatedDisplay=e.mustUpdate&&ci(e.cm,e.update)}function Xr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Cr(t),e.barMeasure=Qr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Dn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Cn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Nn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var o=A("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-On(e.display))+"px;\n height: "+(t.bottom-t.top+Cn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?tt(t.line,t.ch+1,"before"):t,t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=Wn(e,t),c=n&&n!=t?Wn(e,n):s,l=Lr(e,i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r}),u=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=l.scrollTop&&(jr(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=l.scrollLeft&&(Vr(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}(t,ct(r,e.scrollToPos.from),ct(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ht(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ge(t.mode,r.state):null,c=ft(e,o,r,!0);s&&(r.state=s),o.styles=c.styles;var l=o.styleClasses,u=c.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var p=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!p&&fn)return oi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&ti(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==yr(e))return!1;hi(e)&&(mr(e),t.dims=sr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),_t&&(o=Qt(e.doc,o),a=qt(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;(function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=an(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=an(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,fr(e,n)))),r.viewTo=n})(e,o,a),n.viewOffset=Bt($e(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=yr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=I();if(!t||!D(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&D(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return l>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return c&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,p=0;p-1&&(d=!1),pn(e,f,u,n)),d&&(C(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(et(e.options,u)))),a=f.node.nextSibling}else{var h=gn(e,f,u,n);o.insertBefore(h,a)}u+=f.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=I()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),C(n.cursorDiv),C(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,oi(e,400)),n.updateLineNumbers=null,!0}function li(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Nn(e))r&&(t.visible=Ar(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-An(e),n.top)}),t.visible=Ar(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ci(e,t))break;Cr(e);var i=Qr(e);gr(e),Gr(e,i),fi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ui(e,t){var n=new si(e,t);if(ci(e,n)){Cr(e),li(e,n);var r=Qr(e);gr(e),Gr(e,r),fi(e,r),n.finish()}}function pi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ln(e,"gutterChanged",e)}function fi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Cn(e)+"px"}function di(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=cr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=102&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var r=wi(t),i=r.x,o=r.y,a=Ei;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,a=1);var s=e.display,l=s.scroller,d=l.scrollWidth>l.clientWidth,h=l.scrollHeight>l.clientHeight;if(i&&d||o&&h){if(o&&b&&c)e:for(var m=t.target,v=s.view;m!=l;m=m.parentNode)for(var y=0;y=0&&nt(e,r.to())<=0)return n}return-1};var Oi=function(e,t){this.anchor=e,this.head=t};function Si(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return nt(e.from(),t.from())})),n=q(t,i);for(var o=1;o0:c>=0){var l=at(s.from(),a.from()),u=ot(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new Oi(p?u:l,p?l:u))}}return new ki(t,n)}function xi(e,t){return new ki([new Oi(e,t||e)],0)}function Ci(e){return e.text?tt(e.from.line+e.text.length-1,W(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ni(e,t){if(nt(e,t.from)<0)return e;if(nt(e,t.to)<=0)return Ci(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ci(t).ch-t.to.ch),tt(n,r)}function Ai(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,h-1),e.insert(s.line+1,y)}ln(e,"change",e,t)}function Mi(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(qi(e.done),W(e.done)):e.done.length&&!W(e.done).ranges?W(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),W(e.done)):void 0}(i,i.lastOp==r)))a=W(o.changes),0==nt(t.from,t.to)&&0==nt(t.from,a.to)?a.to=Ci(t):o.changes.push(Qi(e,t));else{var c=W(i.done);for(c&&c.ranges||Bi(e.sel,i.done),o={changes:[Qi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||me(e,"historyAdded")}function Gi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,W(i.done),t))?i.done[i.done.length-1]=t:Bi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&qi(i.undone)}function Bi(e,t){var n=W(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ki(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function zi(e){if(!e)return null;for(var t,n=0;n-1&&(W(s)[p]=l[p],delete l[p])}}}return r}function Wi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=nt(t,i)<0;o!=nt(n,i)<0?(i=t,t=n):o!=nt(t,n)<0&&(t=n)}return new Oi(i,t)}return new Oi(n||t,t)}function Yi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),to(e,new ki([Wi(e.sel.primary(),t,n,i)],0),r)}function Ji(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(me(c,"beforeCursorEnter"),c.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!c.atomic)continue;if(n){var p=c.find(r<0?1:-1),f=void 0;if((r<0?u:l)&&(p=co(e,p,-r,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(f=nt(p,n))&&(r<0?f<0:f>0))return ao(e,p,t,r,i)}var d=c.find(r<0?-1:1);return(r<0?l:u)&&(d=co(e,d,r,d.line==t.line?o:null)),d?ao(e,d,t,r,i):null}}return t}function so(e,t,n,r,i){var o=r||1;return ao(e,t,n,o,i)||!i&&ao(e,t,n,o,!0)||ao(e,t,n,-o,i)||!i&&ao(e,t,n,-o,!0)||(e.cantEdit=!0,tt(e.first,0))}function co(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ct(e,tt(t.line-1)):null:n>0&&t.ch==(r||$e(e,t.line)).text.length?t.line0)){var u=[c,1],p=nt(l.from,s.from),f=nt(l.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&u.push({from:l.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)fo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else fo(e,t)}}function fo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=nt(t.from,t.to)){var n=Ai(e,t);Ui(e,t,n,e.cm?e.cm.curOp.id:NaN),vo(e,t,n,xt(e,t));var r=[];Mi(e,(function(e,n){n||-1!=q(r,e.history)||(Eo(e.history,t),r.push(e.history)),vo(e,t,null,xt(e,t))}))}}function ho(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,c="undo"==t?o.undone:o.done,l=0;l=0;--d){var h=f(d);if(h)return h.v}}}}function mo(e,t){if(0!=t&&(e.first+=t,e.sel=new ki(Y(e.sel.ranges,(function(e){return new Oi(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){dr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:tt(o,$e(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=He(e,t.from,t.to),n||(n=Ai(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,c=o.line;e.options.lineWrapping||(c=Je(Vt($e(r,o.line))),r.iter(c,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ye(e),Ri(r,t,n,lr(e)),e.options.lineWrapping||(r.iter(c,o.line+t.text.length,(function(e){var t=Kt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=$e(e,r).stateAfter;if(i&&(!(i instanceof ut)||r+i.lookAhead1||!(this.children[0]instanceof To))){var s=[];this.collapse(s),this.children=[new To(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=L("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ft(e,t.line,t,n,o)||t.line!=n.line&&Ft(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");_t=!0}o.addToHistory&&Ui(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,c=t.line,l=e.cm;if(e.iter(c,n.line+1,(function(r){l&&o.collapsed&&!l.options.lineWrapping&&Vt(r)==l.display.maxLine&&(s=!0),o.collapsed&&c!=t.line&&Ye(r,0),function(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}(r,new kt(o,c==t.line?t.ch:null,c==n.line?n.ch:null),e.cm&&e.cm.curOp),++c})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Ut(e,t)&&Ye(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Tt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),o.collapsed)dr(l,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)hr(l,u,"text");o.atomic&&io(l.doc),ln(l,"markerAdded",l,o)}return o}xo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hr(e),ge(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&dr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&io(e.doc)),e&&ln(e,"markerCleared",e,this,r,i),t&&Wr(e),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;c--)po(this,r[c]);s?eo(this,s):this.cm&&Ir(this.cm)})),undo:ii((function(){ho(this,"undo")})),redo:ii((function(){ho(this,"redo")})),undoSelection:ii((function(){ho(this,"undo",!0)})),redoSelection:ii((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ct(this,e),t=ct(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=c.to||null==c.from&&i!=e.line||null!=c.from&&i==t.line&&c.from>=t.ch||n&&!n(c.marker)||r.push(c.marker.parent||c.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),ct(this,tt(n,t))},indexFromPos:function(e){var t=(e=ct(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var p=e.dataTransfer.getData("Text");if(p){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),no(t.doc,xi(n,n)),f)for(var d=0;d=0;t--)yo(e.doc,"",r[t].from,r[t].to,"+delete");Ir(e)}))}function ea(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ta(e,t,n){var r=ea(e,t.ch,n);return null==r?null:new tt(t.line,r,n<0?"after":"before")}function na(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ue(n,t.doc.direction);if(o){var a,s=i<0?W(o):o[0],c=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var l=Pn(t,n);a=i<0?n.text.length-1:0;var u=Rn(t,l,a).top;a=ae((function(e){return Rn(t,l,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=ea(n,a,1))}else a=i<0?s.to:s.from;return new tt(r,a,c)}}return new tt(r,i<0?n.text.length:0,i<0?"before":"after")}Ko.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ko.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ko.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ko.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ko.default=b?Ko.macDefault:Ko.pcDefault;var ra={selectAll:lo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),G)},killLine:function(e){return Zo(e,(function(t){if(t.empty()){var n=$e(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new tt(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),tt(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=$e(e.doc,i.line-1).text;a&&(i=new tt(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),tt(i.line-1,a.length-1),i,"+transpose"))}n.push(new Oi(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return ti(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(nt((i=l.ranges[i]).from(),t)<0||t.xRel>0)&&(nt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,l=ni(e,(function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Or(e)),he(i.wrapper.ownerDocument,"mouseup",l),he(i.wrapper.ownerDocument,"mousemove",u),he(i.scroller,"dragstart",p),he(i.scroller,"drop",l),o||(Ee(t),r.addNew||Yi(e.doc,n,null,null,r.extend),c&&!d||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},p=function(){return o=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,fe(i.wrapper.ownerDocument,"mouseup",l),fe(i.wrapper.ownerDocument,"mousemove",u),fe(i.scroller,"dragstart",p),fe(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(e,r,t,o):function(e,t,n,r){a&&Or(e);var i=e.display,o=e.doc;Ee(t);var s,c,l=o.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=o.sel.contains(n),s=c>-1?u[c]:new Oi(n,n)):(s=o.sel.primary(),c=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new Oi(n,n)),n=pr(e,t,!0,!0),c=-1;else{var p=ba(e,n,r.unit);s=r.extend?Wi(s,p.anchor,p.head,r.extend):p}r.addNew?-1==c?(c=u.length,to(o,Si(e,u.concat([s]),c),{scroll:!1,origin:"*mouse"})):u.length>1&&u[c].empty()&&"char"==r.unit&&!r.extend?(to(o,Si(e,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Xi(o,c,s,B):(c=0,to(o,new ki([s],0),B),l=o.sel);var f=n;function d(t){if(0!=nt(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,u=V($e(o,n.line).text,n.ch,a),p=V($e(o,t.line).text,t.ch,a),d=Math.min(u,p),h=Math.max(u,p),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var y=$e(o,m).text,g=z(y,d,a);d==h?i.push(new Oi(tt(m,g),tt(m,g))):y.length>g&&i.push(new Oi(tt(m,g),tt(m,z(y,h,a))))}i.length||i.push(new Oi(n,n)),to(o,Si(e,l.ranges.slice(0,c).concat(i),c),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,E=s,w=ba(e,t,r.unit),T=E.anchor;nt(w.anchor,T)>0?(b=w.head,T=at(E.from(),w.anchor)):(b=w.anchor,T=ot(E.to(),w.head));var _=l.ranges.slice(0);_[c]=function(e,t){var n=t.anchor,r=t.head,i=$e(e.doc,n.line);if(0==nt(n,r)&&n.sticky==r.sticky)return t;var o=ue(i);if(!o)return t;var a=ce(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var c,l=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==l||l==o.length)return t;if(r.line!=n.line)c=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ce(o,r.ch,r.sticky),p=u-a||(r.ch-n.ch)*(1==s.level?-1:1);c=u==l-1||u==l?p<0:p>0}var f=o[l+(c?-1:0)],d=c==(1==f.level),h=d?f.from:f.to,m=d?"after":"before";return n.ch==h&&n.sticky==m?t:new Oi(new tt(n.line,h,m),r)}(e,new Oi(ct(o,T),b)),to(o,Si(e,_,c),B)}}var h=i.wrapper.getBoundingClientRect(),m=0;function v(t){var n=++m,a=pr(e,t,!0,"rectangle"==r.unit);if(a)if(0!=nt(a,f)){e.curOp.focus=I(),d(a);var s=Ar(i,o);(a.line>=s.to||a.lineh.bottom?20:0;c&&setTimeout(ni(e,(function(){m==n&&(i.scroller.scrollTop+=c,v(t))})),50)}}function y(t){e.state.selectingText=!1,m=1/0,t&&(Ee(t),i.input.focus()),he(i.wrapper.ownerDocument,"mousemove",g),he(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var g=ni(e,(function(e){0!==e.buttons&&Oe(e)?v(e):y(e)})),b=ni(e,y);e.state.selectingText=b,fe(i.wrapper.ownerDocument,"mousemove",g),fe(i.wrapper.ownerDocument,"mouseup",b)}(e,r,t,o)}(t,r,o,e):ke(e)==n.scroller&&Ee(e):2==i?(r&&Yi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(k?t.display.input.onContextMenu(e):Or(t)))}}function ba(e,t,n){if("char"==n)return new Oi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Oi(tt(t.line,0),ct(e.doc,tt(t.line+1,0)));var r=n(e,t);return new Oi(r.from,r.to)}function Ea(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ee(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ge(e,n))return Te(t);o-=s.top-a.viewOffset;for(var c=0;c=i)return me(e,n,e,Xe(e.doc,o),e.display.gutterSpecs[c].className,t),Te(t)}}function wa(e,t){return Ea(e,t,"gutterClick",!0)}function Ta(e,t){kn(e.display,t)||function(e,t){return!!ge(e,"gutterContextMenu")&&Ea(e,t,"gutterContextMenu",!1)}(e,t)||ve(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function _a(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Un(e)}ya.prototype.compare=function(e,t,n){return this.time+400>e&&0==nt(t,this.pos)&&n==this.button};var ka={toString:function(){return"CodeMirror.Init"}},Oa={},Sa={};function xa(e,t,n){if(!t!=!(n&&n!=ka)){var r=e.display.dragFunctions,i=t?fe:he;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ca(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),zt(e)),ur(e),dr(e),Un(e),setTimeout((function(){return Gr(e)}),100)}function Na(e,t){var n=this;if(!(this instanceof Na))return new Na(e,t);this.options=t=t?F(t):{},F(Oa,t,!1);var r=t.value;"string"==typeof r?r=new Io(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Na.inputStyles[t.inputStyle](this),o=this.display=new gi(e,r,i,t);for(var l in o.wrapper.CodeMirror=this,_a(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Q,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",ni(e,ga)),fe(t.scroller,"dblclick",a&&s<11?ni(e,(function(t){if(!ve(e,t)){var n=pr(e,t);if(n&&!wa(e,t)&&!kn(e.display,t)){Ee(t);var r=e.findWordAt(n);Yi(e.doc,r.anchor,r.head)}}})):function(t){return ve(e,t)||Ee(t)}),fe(t.scroller,"contextmenu",(function(t){return Ta(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Ta(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function c(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",(function(i){if(!ve(e,i)&&!o(i)&&!wa(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!kn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||c(r,r.prev)?new Oi(a,a):!r.prev.prev||c(r,r.prev.prev)?e.findWordAt(a):new Oi(tt(a.line,0),ct(e.doc,tt(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ee(n)}i()})),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(jr(e,t.scroller.scrollTop),Vr(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return _i(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return _i(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ve(e,t)||_e(t)},over:function(t){ve(e,t)||(function(e,t){var n=pr(e,t);if(n){var r=document.createDocumentFragment();Er(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,r)}}(e,t),_e(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Po<100))_e(t);else if(!ve(e,t)&&!kn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(e,t)},drop:ni(e,Ro),leave:function(t){ve(e,t)||Mo(e)}};var l=t.input.getField();fe(l,"keyup",(function(t){return da.call(e,t)})),fe(l,"keydown",ni(e,fa)),fe(l,"keypress",ni(e,ha)),fe(l,"focus",(function(t){return Sr(e,t)})),fe(l,"blur",(function(t){return xr(e,t)}))}(this),Vo(),Hr(this),this.curOp.forceUpdate=!0,ji(this,r),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Sr(n)}),20):xr(this),Sa)Sa.hasOwnProperty(l)&&Sa[l](this,t[l],ka);hi(this),t.finishInit&&t.finishInit(this);for(var u=0;u150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=t>o.first?V($e(o,t-1).text,null,a):0:"add"==n?l=c+e.options.indentUnit:"subtract"==n?l=c-e.options.indentUnit:"number"==typeof n&&(l=c+n),l=Math.max(0,l);var p="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(l/a);d;--d)f+=a,p+="\t";if(fa,c=De(t),l=null;if(s&&r.ranges.length>1)if(Da&&Da.text.join("\n")==t){if(r.ranges.length%Da.text.length==0){l=[];for(var u=0;u=0;f--){var d=r.ranges[f],h=d.from(),m=d.to();d.empty()&&(n&&n>0?h=tt(h.line,h.ch-n):e.state.overwrite&&!s?m=tt(m.line,Math.min($e(o,m.line).text.length,m.ch+W(c).length)):s&&Da&&Da.lineWise&&Da.text.join("\n")==c.join("\n")&&(h=m=tt(h.line,0)));var v={from:h,to:m,text:l?l[f%l.length]:c,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};po(e.doc,v),ln(e,"inputRead",e,v)}t&&!s&&Ma(e,t),Ir(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ra(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||ti(t,(function(){return Pa(t,n,0,null,"paste")})),!0}function Ma(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=La(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test($e(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=La(e,i.head.line,"smart"));a&&ln(e,"electricInput",e,i.head.line)}}}function ja(e){for(var t=[],n=[],r=0;r0?0:-1));if(isNaN(u))a=null;else{var p=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new tt(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(p?2:1))),-n)}}else a=i?function(e,t,n,r){var i=ue(t,e.doc.direction);if(!i)return ta(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ce(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&f>=u.begin)){var d=p?"before":"after";return new tt(n.line,f,d)}}var h=function(e,t,r){for(var o=function(e,t){return t?new tt(n.line,c(e,1),"before"):new tt(n.line,e,"after")};e>=0&&e0==(1!=a.level),l=s?r.begin:c(r.end,-1);if(a.from<=l&&l0?u.end:c(u.begin,-1);return null==v||r>0&&v==t.text.length||!(m=h(r>0?0:i.length-1,r,l(v)))?null:m}(e.cm,s,t,n):ta(s,t,n);if(null==a){if(o||((l=t.line+c)=e.first+e.size||(t=new tt(l,t.ch,t.sticky),!(s=$e(e,l)))))return!1;t=na(i,e.cm,s,t.line,c)}else t=a;return!0}if("char"==r||"codepoint"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var u=null,p="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||l(!d);d=!1){var h=s.text.charAt(t.ch)||"\n",m=te(h,f)?"w":p&&"\n"==h?"n":!p||/\s/.test(h)?null:"p";if(!p||d||m||(m="s"),u&&u!=m){n<0&&(n=1,l(),t.sticky="after");break}if(m&&(u=m),n>0&&!l(!d))break}var v=so(e,t,o,a,!0);return rt(o,v)&&(v.hitSide=!0),v}function qa(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var c=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(c-.5*or(e.display),3);i=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Xn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ua=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ga(e,t){var n=In(e,t.line);if(!n||n.hidden)return null;var r=$e(e.doc,t.line),i=Ln(n,r,t.line),o=ue(r,e.doc.direction),a="left";o&&(a=ce(o,t.ch)%2?"right":"left");var s=Fn(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Ba(e,t){return t&&(e.bad=!0),e}function Ka(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Ba(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||o.line=t.display.viewFrom&&Ga(t,i)||{node:c[0].measure.map[2],offset:0},u=o.liner.firstLine()&&(a=tt(a.line-1,$e(r.doc,a.line-1).length)),s.ch==$e(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=fr(r,a.line))?(t=Je(i.view[0].line),n=i.view[0].node):(t=Je(i.view[e].line),n=i.view[e-1].node.nextSibling);var c,l,u=fr(r,s.line);if(u==i.view.length-1?(c=i.viewTo-1,l=i.lineDiv.lastChild):(c=Je(i.view[u+1].line)-1,l=i.view[u+1].node.previousSibling),!n)return!1;for(var p=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),c=!1;function l(){a&&(o+=s,c&&(o+=s),a=c=!1)}function u(e){e&&(l(),o+=e)}function p(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,f=t.getAttribute("cm-marker");if(f){var d=e.findMarks(tt(r,0),tt(i+1,0),(v=+f,function(e){return e.id==v}));return void(d.length&&(o=d[0].find(0))&&u(He(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&l();for(var m=0;m1&&f.length>1;)if(W(p)==W(f))p.pop(),f.pop(),c--;else{if(p[0]!=f[0])break;p.shift(),f.shift(),t++}for(var d=0,h=0,m=p[0],v=f[0],y=Math.min(m.length,v.length);da.ch&&g.charCodeAt(g.length-h-1)==b.charCodeAt(b.length-h-1);)d--,h++;p[p.length-1]=g.slice(0,g.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(d).replace(/\u200b+$/,"");var w=tt(t,d),T=tt(c,f.length?W(f).length-h:0);return p.length>1||p[0]||nt(w,T)?(yo(r.doc,p,w,T,"+input"),!0):void 0},Ua.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ua.prototype.reset=function(){this.forceCompositionEnd()},Ua.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ua.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ua.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ti(this.cm,(function(){return dr(e.cm)}))},Ua.prototype.setUneditable=function(e){e.contentEditable="false"},Ua.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ni(this.cm,Pa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ua.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ua.prototype.onContextMenu=function(){},Ua.prototype.resetPosition=function(){},Ua.prototype.needsContentAttribute=!0;var $a=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null};$a.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ve(r,e)){if(r.somethingSelected())Ia({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=ja(r);Ia({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,G):(n.prevInput="",i.value=t.text.join("\n"),M(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(i.style.width="0px"),fe(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(i,"paste",(function(e){ve(r,e)||Ra(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),fe(i,"cut",o),fe(i,"copy",o),fe(e.scroller,"paste",(function(t){if(!kn(e,t)&&!ve(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){kn(e,t)||Ee(t)})),fe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},$a.prototype.createField=function(e){this.wrapper=Va(),this.textarea=this.wrapper.firstChild},$a.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$a.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=br(e);if(e.options.moveInputWithCursor){var i=Wn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},$a.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$a.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&M(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},$a.prototype.getField=function(){return this.textarea},$a.prototype.supportsTouch=function(){return!1},$a.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},$a.prototype.blur=function(){this.textarea.blur()},$a.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$a.prototype.receivedFocus=function(){this.slowPoll()},$a.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},$a.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},$a.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var c=0,l=Math.min(r.length,i.length);c1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},$a.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$a.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},$a.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=pr(n,e),l=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ni(n,to)(n.doc,xi(o),G);var u,p=i.style.cssText,d=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",c&&(u=window.scrollY),r.input.focus(),c&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),k){_e(e);var m=function(){he(window,"mouseup",m),setTimeout(y,20)};fe(window,"mouseup",m)}else setTimeout(y,50)}function v(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=p,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),null!=i.selectionStart)){(!a||a&&s<9)&&v();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ni(n,lo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},$a.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},$a.prototype.setUneditable=function(){},$a.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=ka&&i(e,t,n)}:i)}e.defineOption=n,e.Init=ka,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Di(e)}),!0),n("indentUnit",2,Di,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ii(e),Un(e),dr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(tt(r,o))}r++}));for(var i=n.length-1;i>=0;i--)yo(e.doc,t,n[i],tt(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=ka&&e.refresh()})),n("specialCharPlaceholder",Zt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){_a(e),yi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Xo(t),i=n!=ka&&Xo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ca,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=mi(t,e.options.lineNumbers),yi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?cr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Gr(e)}),!0),n("scrollbarStyle","native",(function(e){zr(e),Gr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=mi(e.options.gutters,t),yi(e)}),!0),n("firstLineNumber",1,yi,!0),n("lineNumberFormatter",(function(e){return e}),yi,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(xr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,xa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ii,!0),n("addModeClass",!1,Ii,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ii,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Na),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ni(this,t[e])(this,n,i),me(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(La(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Ir(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var c=s;c0&&Xi(this.doc,r,new Oi(o,l[r].to()),G)}}})),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=ct(this.doc,e);var t,n=dt(this,$e(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=$e(this.doc,e)}else r=e;return zn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Bt(r):0)},defaultTextHeight:function(){return or(this.display)},defaultCharWidth:function(){return ar(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s,c=this.display,l=(e=Wn(this,ct(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),c.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var p=Math.max(c.wrapper.clientHeight,this.doc.height),f=Math.max(c.sizer.clientWidth,c.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>p)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=p&&(l=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(u=c.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(c.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:l,right:u+t.offsetWidth,bottom:l+t.offsetHeight},null!=(s=Lr(o,a)).scrollTop&&jr(o,s.scrollTop),null!=s.scrollLeft&&Vr(o,s.scrollLeft))},triggerOnKeyDown:ri(fa),triggerOnKeyPress:ri(ha),triggerOnKeyUp:da,triggerOnMouseDown:ri(ga),execCommand:function(e){if(ra.hasOwnProperty(e))return ra[e].call(null,this)},triggerElectric:ri((function(e){Ma(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ct(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&ur(this),me(this,"refresh",this)})),swapDoc:ri((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),ji(this,e),Un(this),this.display.input.reset(),Pr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Na);var Ha="iter insert remove copy getEditor constructor".split(" ");for(var Wa in Io.prototype)Io.prototype.hasOwnProperty(Wa)&&q(Ha,Wa)<0&&(Na.prototype[Wa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Io.prototype[Wa]));return be(Io),Na.inputStyles={textarea:$a,contenteditable:Ua},Na.defineMode=function(e){Na.defaults.mode||"null"==e||(Na.defaults.mode=e),Fe.apply(this,arguments)},Na.defineMIME=function(e,t){je[e]=t},Na.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Na.defineMIME("text/plain","null"),Na.defineExtension=function(e,t){Na.prototype[e]=t},Na.defineDocExtension=function(e,t){Io.prototype[e]=t},Na.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=I();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Na((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=he,e.on=fe,e.wheelEventPixels=Ti,e.Doc=Io,e.splitLines=De,e.countColumn=V,e.findColumn=z,e.isWordChar=ee,e.Pass=U,e.signal=me,e.Line=$t,e.changeEnd=Ci,e.scrollbarModel=Kr,e.Pos=tt,e.cmpPos=nt,e.modes=Me,e.mimeModes=je,e.resolveMode=Ve,e.getMode=Qe,e.modeExtensions=qe,e.extendMode=Ue,e.copyState=Ge,e.startState=Ke,e.innerMode=Be,e.commands=ra,e.keyMap=Ko,e.keyName=Jo,e.isModifierKey=Wo,e.lookupKey=Ho,e.normalizeKeyMap=$o,e.StringStream=ze,e.SharedTextMarker=No,e.TextMarker=xo,e.LineWidget=ko,e.e_preventDefault=Ee,e.e_stopPropagation=we,e.e_stop=_e,e.addClass=P,e.contains=D,e.rmClass=x,e.keyNames=qo}(Na),Na.version="5.65.6",Na}()},6876:function(e,t,n){!function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,i,o=t.indentUnit,a=n.statementIndent,s=n.jsonld,c=n.json||s,l=!1!==n.trackScope,u=n.typescript,p=n.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e,t,n){return r=e,i=n,t}function v(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,i=!1;if(s&&"@"==e.peek()&&e.match(h))return t.tokenize=v,m("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(t.tokenize=v),m("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==r&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return m(r);if("="==r&&e.eat(">"))return m("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==r)return e.eat("*")?(t.tokenize=y,y(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):Ze(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==r)return t.tokenize=g,g(e,t);if("#"==r&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==r&&e.eatWhile(p))return m("variable","property");if("<"==r&&e.match("!--")||"-"==r&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(d.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-|&?]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),"?"==r&&e.eat(".")?m("."):m("operator","operator",e.current());if(p.test(r)){e.eatWhile(p);var i=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(i)){var o=f[i];return m(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",i)}return m("variable","variable",i)}}function y(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=v;break}r="*"==n}return m("comment","comment")}function g(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=v;break}r=!r&&"\\"==n}return m("quasi","string-2",e.current())}function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),c="([{}])".indexOf(s);if(c>=0&&c<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(c>=3&&c<6)++i;else if(p.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var E={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function T(e,t){if(!l)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function _(e,t,n,r,i){var o=e.cc;for(k.state=e,k.stream=i,k.marked=null,k.cc=o,k.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():c?U:Q)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return k.marked?k.marked:"variable"==n&&T(e,r)?"variable-2":t}}var k={state:null,column:null,marked:null,cc:null};function O(){for(var e=arguments.length-1;e>=0;e--)k.cc.push(arguments[e])}function S(){return O.apply(null,arguments),!0}function x(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function C(e){var t=k.state;if(k.marked="def",l){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=N(e,t.context);if(null!=r)return void(t.context=r)}else if(!x(e,t.localVars))return void(t.localVars=new D(e,t.localVars));n.globalVars&&!x(e,t.globalVars)&&(t.globalVars=new D(e,t.globalVars))}}function N(e,t){if(t){if(t.block){var n=N(e,t.prev);return n?n==t.prev?t:new L(n,t.vars,!0):null}return x(e,t.vars)?t:new L(t.prev,new D(e,t.vars),!1)}return null}function A(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function L(e,t,n){this.prev=e,this.vars=t,this.block=n}function D(e,t){this.name=e,this.next=t}var I=new D("this",new D("arguments",null));function P(){k.state.context=new L(k.state.context,k.state.localVars,!1),k.state.localVars=I}function R(){k.state.context=new L(k.state.context,k.state.localVars,!0),k.state.localVars=null}function M(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function j(e,t){var n=function(){var n=k.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new w(r,k.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function F(){var e=k.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function V(e){return function t(n){return n==e?S():";"==e||"}"==n||")"==n||"]"==n?O():S(t)}}function Q(e,t){return"var"==e?S(j("vardef",t),ke,V(";"),F):"keyword a"==e?S(j("form"),B,Q,F):"keyword b"==e?S(j("form"),Q,F):"keyword d"==e?k.stream.match(/^\s*$/,!1)?S():S(j("stat"),z,V(";"),F):"debugger"==e?S(V(";")):"{"==e?S(j("}"),R,ce,F,M):";"==e?S():"if"==e?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==F&&k.state.cc.pop()(),S(j("form"),B,Q,F,Ae)):"function"==e?S(Pe):"for"==e?S(j("form"),R,Le,Q,M,F):"class"==e||u&&"interface"==t?(k.marked="keyword",S(j("form","class"==e?e:t),Ve,F)):"variable"==e?u&&"declare"==t?(k.marked="keyword",S(Q)):u&&("module"==t||"enum"==t||"type"==t)&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword","enum"==t?S(Je):"type"==t?S(Me,V("operator"),de,V(";")):S(j("form"),Oe,V("{"),j("}"),ce,F,F)):u&&"namespace"==t?(k.marked="keyword",S(j("form"),U,Q,F)):u&&"abstract"==t?(k.marked="keyword",S(Q)):S(j("stat"),te):"switch"==e?S(j("form"),B,V("{"),j("}","switch"),R,ce,F,F,M):"case"==e?S(U,V(":")):"default"==e?S(V(":")):"catch"==e?S(j("form"),P,q,Q,F,M):"export"==e?S(j("stat"),Ge,F):"import"==e?S(j("stat"),Ke,F):"async"==e?S(Q):"@"==t?S(U,Q):O(j("stat"),U,V(";"),F)}function q(e){if("("==e)return S(je,V(")"))}function U(e,t){return K(e,t,!1)}function G(e,t){return K(e,t,!0)}function B(e){return"("!=e?O():S(j(")"),z,V(")"),F)}function K(e,t,n){if(k.state.fatArrowAt==k.stream.start){var r=n?X:J;if("("==e)return S(P,j(")"),ae(je,")"),F,V("=>"),r,M);if("variable"==e)return O(P,Oe,V("=>"),r,M)}var i=n?H:$;return E.hasOwnProperty(e)?S(i):"function"==e?S(Pe,i):"class"==e||u&&"interface"==t?(k.marked="keyword",S(j("form"),Fe,F)):"keyword c"==e||"async"==e?S(n?G:U):"("==e?S(j(")"),z,V(")"),F,i):"operator"==e||"spread"==e?S(n?G:U):"["==e?S(j("]"),Ye,F,i):"{"==e?se(re,"}",null,i):"quasi"==e?O(W,i):"new"==e?S(function(e){return function(t){return"."==t?S(e?ee:Z):"variable"==t&&u?S(we,e?H:$):O(e?G:U)}}(n)):S()}function z(e){return e.match(/[;\}\)\],]/)?O():O(U)}function $(e,t){return","==e?S(z):H(e,t,!1)}function H(e,t,n){var r=0==n?$:H,i=0==n?U:G;return"=>"==e?S(P,n?X:J,M):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?S(r):u&&"<"==t&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?S(j(">"),ae(de,">"),F,r):"?"==t?S(U,V(":"),i):S(i):"quasi"==e?O(W,r):";"!=e?"("==e?se(G,")","call",r):"."==e?S(ne,r):"["==e?S(j("]"),z,V("]"),F,r):u&&"as"==t?(k.marked="keyword",S(de,r)):"regexp"==e?(k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),S(i)):void 0:void 0}function W(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?S(W):S(z,Y)}function Y(e){if("}"==e)return k.marked="string-2",k.state.tokenize=g,S(W)}function J(e){return b(k.stream,k.state),O("{"==e?Q:U)}function X(e){return b(k.stream,k.state),O("{"==e?Q:G)}function Z(e,t){if("target"==t)return k.marked="keyword",S($)}function ee(e,t){if("target"==t)return k.marked="keyword",S(H)}function te(e){return":"==e?S(F,Q):O($,V(";"),F)}function ne(e){if("variable"==e)return k.marked="property",S()}function re(e,t){return"async"==e?(k.marked="property",S(re)):"variable"==e||"keyword"==k.style?(k.marked="property","get"==t||"set"==t?S(ie):(u&&k.state.fatArrowAt==k.stream.start&&(n=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+n[0].length),S(oe))):"number"==e||"string"==e?(k.marked=s?"property":k.style+" property",S(oe)):"jsonld-keyword"==e?S(oe):u&&A(t)?(k.marked="keyword",S(re)):"["==e?S(U,le,V("]"),oe):"spread"==e?S(G,oe):"*"==t?(k.marked="keyword",S(re)):":"==e?O(oe):void 0;var n}function ie(e){return"variable"!=e?O(oe):(k.marked="property",S(Pe))}function oe(e){return":"==e?S(G):"("==e?O(Pe):void 0}function ae(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=k.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),S((function(n,r){return n==t||r==t?O():O(e)}),r)}return i==t||o==t?S():n&&n.indexOf(";")>-1?O(e):S(V(t))}return function(n,i){return n==t||i==t?S():O(e,r)}}function se(e,t,n){for(var r=3;r"),de):"quasi"==e?O(ye,Ee):void 0}function he(e){if("=>"==e)return S(de)}function me(e){return e.match(/[\}\)\]]/)?S():","==e||";"==e?S(me):O(ve,me)}function ve(e,t){return"variable"==e||"keyword"==k.style?(k.marked="property",S(ve)):"?"==t||"number"==e||"string"==e?S(ve):":"==e?S(de):"["==e?S(V("variable"),ue,V("]"),ve):"("==e?O(Re,ve):e.match(/[;\}\)\],]/)?void 0:S()}function ye(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?S(ye):S(de,ge)}function ge(e){if("}"==e)return k.marked="string-2",k.state.tokenize=g,S(ye)}function be(e,t){return"variable"==e&&k.stream.match(/^\s*[?:]/,!1)||"?"==t?S(be):":"==e?S(de):"spread"==e?S(be):O(de)}function Ee(e,t){return"<"==t?S(j(">"),ae(de,">"),F,Ee):"|"==t||"."==e||"&"==t?S(de):"["==e?S(de,V("]"),Ee):"extends"==t||"implements"==t?(k.marked="keyword",S(de)):"?"==t?S(de,V(":"),de):void 0}function we(e,t){if("<"==t)return S(j(">"),ae(de,">"),F,Ee)}function Te(){return O(de,_e)}function _e(e,t){if("="==t)return S(de)}function ke(e,t){return"enum"==t?(k.marked="keyword",S(Je)):O(Oe,le,Ce,Ne)}function Oe(e,t){return u&&A(t)?(k.marked="keyword",S(Oe)):"variable"==e?(C(t),S()):"spread"==e?S(Oe):"["==e?se(xe,"]"):"{"==e?se(Se,"}"):void 0}function Se(e,t){return"variable"!=e||k.stream.match(/^\s*:/,!1)?("variable"==e&&(k.marked="property"),"spread"==e?S(Oe):"}"==e?O():"["==e?S(U,V("]"),V(":"),Se):S(V(":"),Oe,Ce)):(C(t),S(Ce))}function xe(){return O(Oe,Ce)}function Ce(e,t){if("="==t)return S(G)}function Ne(e){if(","==e)return S(ke)}function Ae(e,t){if("keyword b"==e&&"else"==t)return S(j("form","else"),Q,F)}function Le(e,t){return"await"==t?S(Le):"("==e?S(j(")"),De,F):void 0}function De(e){return"var"==e?S(ke,Ie):"variable"==e?S(Ie):O(Ie)}function Ie(e,t){return")"==e?S():";"==e?S(Ie):"in"==t||"of"==t?(k.marked="keyword",S(U,Ie)):O(U,Ie)}function Pe(e,t){return"*"==t?(k.marked="keyword",S(Pe)):"variable"==e?(C(t),S(Pe)):"("==e?S(P,j(")"),ae(je,")"),F,pe,Q,M):u&&"<"==t?S(j(">"),ae(Te,">"),F,Pe):void 0}function Re(e,t){return"*"==t?(k.marked="keyword",S(Re)):"variable"==e?(C(t),S(Re)):"("==e?S(P,j(")"),ae(je,")"),F,pe,M):u&&"<"==t?S(j(">"),ae(Te,">"),F,Re):void 0}function Me(e,t){return"keyword"==e||"variable"==e?(k.marked="type",S(Me)):"<"==t?S(j(">"),ae(Te,">"),F):void 0}function je(e,t){return"@"==t&&S(U,je),"spread"==e?S(je):u&&A(t)?(k.marked="keyword",S(je)):u&&"this"==e?S(le,Ce):O(Oe,le,Ce)}function Fe(e,t){return"variable"==e?Ve(e,t):Qe(e,t)}function Ve(e,t){if("variable"==e)return C(t),S(Qe)}function Qe(e,t){return"<"==t?S(j(">"),ae(Te,">"),F,Qe):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(k.marked="keyword"),S(u?de:U,Qe)):"{"==e?S(j("}"),qe,F):void 0}function qe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&A(t))&&k.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(k.marked="keyword",S(qe)):"variable"==e||"keyword"==k.style?(k.marked="property",S(Ue,qe)):"number"==e||"string"==e?S(Ue,qe):"["==e?S(U,le,V("]"),Ue,qe):"*"==t?(k.marked="keyword",S(qe)):u&&"("==e?O(Re,qe):";"==e||","==e?S(qe):"}"==e?S():"@"==t?S(U,qe):void 0}function Ue(e,t){if("!"==t)return S(Ue);if("?"==t)return S(Ue);if(":"==e)return S(de,Ce);if("="==t)return S(G);var n=k.state.lexical.prev;return O(n&&"interface"==n.info?Re:Pe)}function Ge(e,t){return"*"==t?(k.marked="keyword",S(We,V(";"))):"default"==t?(k.marked="keyword",S(U,V(";"))):"{"==e?S(ae(Be,"}"),We,V(";")):O(Q)}function Be(e,t){return"as"==t?(k.marked="keyword",S(V("variable"))):"variable"==e?O(G,Be):void 0}function Ke(e){return"string"==e?S():"("==e?O(U):"."==e?O($):O(ze,$e,We)}function ze(e,t){return"{"==e?se(ze,"}"):("variable"==e&&C(t),"*"==t&&(k.marked="keyword"),S(He))}function $e(e){if(","==e)return S(ze,$e)}function He(e,t){if("as"==t)return k.marked="keyword",S(ze)}function We(e,t){if("from"==t)return k.marked="keyword",S(U)}function Ye(e){return"]"==e?S():O(ae(G,"]"))}function Je(){return O(j("form"),Oe,V("{"),j("}"),ae(Xe,"}"),F,F)}function Xe(){return O(Oe,Ce)}function Ze(e,t,n){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return P.lex=R.lex=!0,M.lex=!0,F.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new w((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new L(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=y&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",_(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==y||t.tokenize==g)return e.Pass;if(t.tokenize!=v)return 0;var i,s=r&&r.charAt(0),c=t.lexical;if(!/^\s*else\b/.test(r))for(var l=t.cc.length-1;l>=0;--l){var u=t.cc[l];if(u==F)c=c.prev;else if(u!=Ae&&u!=M)break}for(;("stat"==c.type||"form"==c.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==$||i==H)&&!/^[,\.=+\-*:?[\(]/.test(r));)c=c.prev;a&&")"==c.type&&"stat"==c.prev.type&&(c=c.prev);var p=c.type,f=s==p;return"vardef"==p?c.indented+("operator"==t.lastType||","==t.lastType?c.info.length+1:0):"form"==p&&"{"==s?c.indented:"form"==p?c.indented+o:"stat"==p?c.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?a||o:0):"switch"!=c.info||f||0==n.doubleIndentSwitch?c.align?c.column+(f?0:1):c.indented+(f?0:o):c.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:c?null:"/*",blockCommentEnd:c?null:"*/",blockCommentContinue:c?null:" * ",lineComment:c?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:c?"json":"javascript",jsonldMode:s,jsonMode:c,expressionAllowed:Ze,skipExpression:function(t){_(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(4631))},640:function(e,t,n){"use strict";var r=n(1742),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,o,a,s,c,l,u=!1;t||(t={}),n=t.debug||!1;try{if(a=r(),s=document.createRange(),c=document.getSelection(),(l=document.createElement("span")).textContent=e,l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[t.format]||i.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(l),s.selectNodeContents(l),c.addRange(s),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(s):c.removeAllRanges()),l&&document.body.removeChild(l),a()}return u}},4020:function(e){"use strict";var t="%[a-f0-9]{2}",n=new RegExp("("+t+")|([^%]+?)","gi"),r=new RegExp("("+t+")+","gi");function i(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],i(n),i(r))}function o(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(n)||[],r=1;r]/;e.exports=function(e){var n,r=""+e,i=t.exec(r);if(!i)return r;var o="",a=0,s=0;for(a=i.index;a{switch(e.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":t=e}})),t}function P(e,t,n){return n===D.SchemaMetaFieldDef.name&&e.getQueryType()===t?D.SchemaMetaFieldDef:n===D.TypeMetaFieldDef.name&&e.getQueryType()===t?D.TypeMetaFieldDef:n===D.TypeNameMetaFieldDef.name&&(0,L.isCompositeType)(t)?D.TypeNameMetaFieldDef:"getFields"in t?t.getFields()[n]:null}function R(e,t){const n=[];let r=e;for(;null==r?void 0:r.kind;)n.push(r),r=r.prevState;for(let e=n.length-1;e>=0;e--)t(n[e])}function M(e){const t=Object.keys(e),n=t.length,r=new Array(n);for(let i=0;i({proximity:Q(V(e.label),t),entry:e}))),(e=>e.proximity<=2)),(e=>!e.entry.isDeprecated)).sort(((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.label.length-t.entry.label.length)).map((e=>e.entry)):F(e,(e=>!e.isDeprecated))}(t,V(e.string))}function F(e,t){const n=e.filter(t);return 0===n.length?e:n}function V(e){return e.toLowerCase().replace(/\W/g,"")}function Q(e,t){let n=function(e,t){let n,r;const i=[],o=e.length,a=t.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=a;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=a;r++){const o=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+o),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+o))}return i[o][a]}(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}!function(e){e.is=function(e){return"string"==typeof e}}(r||(r={})),function(e){e.is=function(e){return"string"==typeof e}}(i||(i={})),function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(o||(o={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(a||(a={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=a.MAX_VALUE),t===Number.MAX_VALUE&&(t=a.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.uinteger(t.line)&&Pe.uinteger(t.character)}}(s||(s={})),function(e){e.create=function(e,t,n,r){if(Pe.uinteger(e)&&Pe.uinteger(t)&&Pe.uinteger(n)&&Pe.uinteger(r))return{start:s.create(e,t),end:s.create(n,r)};if(s.is(e)&&s.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&s.is(t.start)&&s.is(t.end)}}(c||(c={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&c.is(t.range)&&(Pe.string(t.uri)||Pe.undefined(t.uri))}}(l||(l={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&c.is(t.targetRange)&&Pe.string(t.targetUri)&&c.is(t.targetSelectionRange)&&(c.is(t.originSelectionRange)||Pe.undefined(t.originSelectionRange))}}(u||(u={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.numberRange(t.red,0,1)&&Pe.numberRange(t.green,0,1)&&Pe.numberRange(t.blue,0,1)&&Pe.numberRange(t.alpha,0,1)}}(p||(p={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&c.is(t.range)&&p.is(t.color)}}(f||(f={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.label)&&(Pe.undefined(t.textEdit)||T.is(t))&&(Pe.undefined(t.additionalTextEdits)||Pe.typedArray(t.additionalTextEdits,T.is))}}(d||(d={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(h||(h={})),function(e){e.create=function(e,t,n,r,i,o){var a={startLine:e,endLine:t};return Pe.defined(n)&&(a.startCharacter=n),Pe.defined(r)&&(a.endCharacter=r),Pe.defined(i)&&(a.kind=i),Pe.defined(o)&&(a.collapsedText=o),a},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.uinteger(t.startLine)&&Pe.uinteger(t.startLine)&&(Pe.undefined(t.startCharacter)||Pe.uinteger(t.startCharacter))&&(Pe.undefined(t.endCharacter)||Pe.uinteger(t.endCharacter))&&(Pe.undefined(t.kind)||Pe.string(t.kind))}}(m||(m={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return Pe.defined(t)&&l.is(t.location)&&Pe.string(t.message)}}(v||(v={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(y||(y={})),function(e){e.Unnecessary=1,e.Deprecated=2}(g||(g={})),function(e){e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.href)}}(b||(b={})),function(e){e.create=function(e,t,n,r,i,o){var a={range:e,message:t};return Pe.defined(n)&&(a.severity=n),Pe.defined(r)&&(a.code=r),Pe.defined(i)&&(a.source=i),Pe.defined(o)&&(a.relatedInformation=o),a},e.is=function(e){var t,n=e;return Pe.defined(n)&&c.is(n.range)&&Pe.string(n.message)&&(Pe.number(n.severity)||Pe.undefined(n.severity))&&(Pe.integer(n.code)||Pe.string(n.code)||Pe.undefined(n.code))&&(Pe.undefined(n.codeDescription)||Pe.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Pe.string(n.source)||Pe.undefined(n.source))&&(Pe.undefined(n.relatedInformation)||Pe.typedArray(n.relatedInformation,v.is))}}(E||(E={})),function(e){e.create=function(e,t){for(var n=[],r=2;r0&&(i.arguments=n),i},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.title)&&Pe.string(t.command)}}(w||(w={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.newText)&&c.is(t.range)}}(T||(T={})),function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.label)&&(Pe.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Pe.string(t.description)||void 0===t.description)}}(_||(_={})),function(e){e.is=function(e){var t=e;return Pe.string(t)}}(k||(k={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return T.is(t)&&(_.is(t.annotationId)||k.is(t.annotationId))}}(O||(O={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return Pe.defined(t)&&G.is(t.textDocument)&&Array.isArray(t.edits)}}(S||(S={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"create"===t.kind&&Pe.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Pe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Pe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(x||(x={})),function(e){e.create=function(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){var t=e;return t&&"rename"===t.kind&&Pe.string(t.oldUri)&&Pe.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Pe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Pe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(C||(C={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"delete"===t.kind&&Pe.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Pe.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Pe.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(N||(N={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return Pe.string(e.kind)?x.is(e)||C.is(e)||N.is(e):S.is(e)})))}}(A||(A={}));var q,U,G,B,K,z,$,H,W,Y,J,X,Z,ee,te,ne,re,ie,oe,ae,se,ce,le,ue,pe,fe,de,he,me,ve,ye,ge,be,Ee,we,Te,_e,ke,Oe,Se,xe,Ce,Ne,Ae,Le,De=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=T.insert(e,t):k.is(n)?(i=n,r=O.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=O.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=T.replace(e,t):k.is(n)?(i=n,r=O.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=O.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=T.del(e):k.is(t)?(r=t,n=O.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=O.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),Ie=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(k.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();!function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ie(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(S.is(e)){var n=new De(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new De(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(G.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new De(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new De(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new Ie,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(_.is(t)||k.is(t)?r=t:n=t,void 0===r?i=x.create(e,n):(o=k.is(r)?r:this._changeAnnotations.manage(r),i=x.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,a;if(_.is(n)||k.is(n)?i=n:r=n,void 0===i?o=C.create(e,t,r):(a=k.is(i)?i:this._changeAnnotations.manage(i),o=C.create(e,t,r,a)),this._workspaceEdit.documentChanges.push(o),void 0!==a)return a},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(_.is(t)||k.is(t)?r=t:n=t,void 0===r?i=N.create(e,n):(o=k.is(r)?r:this._changeAnnotations.manage(r),i=N.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o}}(),function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)}}(q||(q={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)&&Pe.integer(t.version)}}(U||(U={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)&&(null===t.version||Pe.integer(t.version))}}(G||(G={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)&&Pe.string(t.languageId)&&Pe.integer(t.version)&&Pe.string(t.text)}}(B||(B={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(K||(K={})),function(e){e.is=function(e){var t=e;return Pe.objectLiteral(e)&&K.is(t.kind)&&Pe.string(t.value)}}(z||(z={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}($||($={})),function(e){e.PlainText=1,e.Snippet=2}(H||(H={})),function(e){e.Deprecated=1}(W||(W={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&Pe.string(t.newText)&&c.is(t.insert)&&c.is(t.replace)}}(Y||(Y={})),function(e){e.asIs=1,e.adjustIndentation=2}(J||(J={})),function(e){e.is=function(e){var t=e;return t&&(Pe.string(t.detail)||void 0===t.detail)&&(Pe.string(t.description)||void 0===t.description)}}(X||(X={})),function(e){e.create=function(e){return{label:e}}}(Z||(Z={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(ee||(ee={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return Pe.string(t)||Pe.objectLiteral(t)&&Pe.string(t.language)&&Pe.string(t.value)}}(te||(te={})),function(e){e.is=function(e){var t=e;return!!t&&Pe.objectLiteral(t)&&(z.is(t.contents)||te.is(t.contents)||Pe.typedArray(t.contents,te.is))&&(void 0===e.range||c.is(e.range))}}(ne||(ne={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(re||(re={})),function(e){e.create=function(e,t){for(var n=[],r=2;r=0;a--){var s=i[a],c=e.offsetAt(s.range.start),l=e.offsetAt(s.range.end);if(!(l<=o))throw new Error("Overlapping edit");r=r.substring(0,c)+s.newText+r.substring(l,r.length),o=c}return r}}(Le||(Le={}));var Pe,Re=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return s.create(0,e);for(;ne?r=i:n=i+1}var o=n-1;return s.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>0===this._pos,this.peek=()=>this._sourceText.charAt(this._pos)?this._sourceText.charAt(this._pos):null,this.next=()=>{const e=this._sourceText.charAt(this._pos);return this._pos++,e},this.eat=e=>{if(this._testNextCharacter(e))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=e=>{let t=this._testNextCharacter(e),n=!1;for(t&&(n=t,this._start=this._pos);t;)this._pos++,t=this._testNextCharacter(e),n=!0;return n},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=e=>{this._pos=e},this.match=(e,t=!0,n=!1)=>{let r=null,i=null;return"string"==typeof e?(i=new RegExp(e,n?"i":"g").test(this._sourceText.substr(this._pos,e.length)),r=e):e instanceof RegExp&&(i=this._sourceText.slice(this._pos).match(e),r=null==i?void 0:i[0]),!(null==i||!("string"==typeof e||i instanceof Array&&this._sourceText.startsWith(i[0],this._pos)))&&(t&&(this._start=this._pos,r&&r.length&&(this._pos+=r.length)),i)},this.backUp=e=>{this._pos-=e},this.column=()=>this._pos,this.indentation=()=>{const e=this._sourceText.match(/\s*/);let t=0;if(e&&0!==e.length){const n=e[0];let r=0;for(;n.length>r;)9===n.charCodeAt(r)?t+=2:t++,r++}return t},this.current=()=>this._sourceText.slice(this._start,this._pos),this._start=0,this._pos=0,this._sourceText=e}_testNextCharacter(e){const t=this._sourceText.charAt(this._pos);let n=!1;return n="string"==typeof e?t===e:e instanceof RegExp?e.test(t):e(t),n}}function je(e){return{ofRule:e}}function Fe(e,t){return{ofRule:e,isList:!0,separator:t}}function Ve(e,t){return{style:t,match:t=>t.kind===e}}function Qe(e,t){return{style:t||"punctuation",match:t=>"Punctuation"===t.kind&&t.value===e}}const qe=e=>" "===e||"\t"===e||","===e||"\n"===e||"\r"===e||"\ufeff"===e||" "===e,Ue={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},Ge={Document:[Fe("Definition")],Definition(e){switch(e.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return L.Kind.FRAGMENT_DEFINITION;case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[Be("query"),je(Ke("def")),je("VariableDefinitions"),Fe("Directive"),"SelectionSet"],Mutation:[Be("mutation"),je(Ke("def")),je("VariableDefinitions"),Fe("Directive"),"SelectionSet"],Subscription:[Be("subscription"),je(Ke("def")),je("VariableDefinitions"),Fe("Directive"),"SelectionSet"],VariableDefinitions:[Qe("("),Fe("VariableDefinition"),Qe(")")],VariableDefinition:["Variable",Qe(":"),"Type",je("DefaultValue")],Variable:[Qe("$","variable"),Ke("variable")],DefaultValue:[Qe("="),"Value"],SelectionSet:[Qe("{"),Fe("Selection"),Qe("}")],Selection:(e,t)=>"..."===e.value?t.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":t.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field",AliasedField:[Ke("property"),Qe(":"),Ke("qualifier"),je("Arguments"),Fe("Directive"),je("SelectionSet")],Field:[Ke("property"),je("Arguments"),Fe("Directive"),je("SelectionSet")],Arguments:[Qe("("),Fe("Argument"),Qe(")")],Argument:[Ke("attribute"),Qe(":"),"Value"],FragmentSpread:[Qe("..."),Ke("def"),Fe("Directive")],InlineFragment:[Qe("..."),je("TypeCondition"),Fe("Directive"),"SelectionSet"],FragmentDefinition:[Be("fragment"),je(function(e,t){const n=e.match;return e.match=e=>{let r=!1;return n&&(r=n(e)),r&&t.every((t=>t.match&&!t.match(e)))},e}(Ke("def"),[Be("on")])),"TypeCondition",Fe("Directive"),"SelectionSet"],TypeCondition:[Be("on"),"NamedType"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable";case"&":return"NamedType"}return null;case"Name":switch(e.value){case"true":case"false":return"BooleanValue"}return"null"===e.value?"NullValue":"EnumValue"}},NumberValue:[Ve("Number","number")],StringValue:[{style:"string",match:e=>"String"===e.kind,update(e,t){t.value.startsWith('"""')&&(e.inBlockstring=!t.value.slice(3).endsWith('"""'))}}],BooleanValue:[Ve("Name","builtin")],NullValue:[Ve("Name","keyword")],EnumValue:[Ke("string-2")],ListValue:[Qe("["),Fe("Value"),Qe("]")],ObjectValue:[Qe("{"),Fe("ObjectField"),Qe("}")],ObjectField:[Ke("attribute"),Qe(":"),"Value"],Type:e=>"["===e.value?"ListType":"NonNullType",ListType:[Qe("["),"Type",Qe("]"),je(Qe("!"))],NonNullType:["NamedType",je(Qe("!"))],NamedType:[("atom",{style:"atom",match:e=>"Name"===e.kind,update(e,t){var n;(null===(n=e.prevState)||void 0===n?void 0:n.prevState)&&(e.name=t.value,e.prevState.prevState.type=t.value)}})],Directive:[Qe("@","meta"),Ke("meta"),je("Arguments")],DirectiveDef:[Be("directive"),Qe("@","meta"),Ke("meta"),je("ArgumentsDef"),Be("on"),Fe("DirectiveLocation",Qe("|"))],InterfaceDef:[Be("interface"),Ke("atom"),je("Implements"),Fe("Directive"),Qe("{"),Fe("FieldDef"),Qe("}")],Implements:[Be("implements"),Fe("NamedType",Qe("&"))],DirectiveLocation:[Ke("string-2")],SchemaDef:[Be("schema"),Fe("Directive"),Qe("{"),Fe("OperationTypeDef"),Qe("}")],OperationTypeDef:[Ke("keyword"),Qe(":"),Ke("atom")],ScalarDef:[Be("scalar"),Ke("atom"),Fe("Directive")],ObjectTypeDef:[Be("type"),Ke("atom"),je("Implements"),Fe("Directive"),Qe("{"),Fe("FieldDef"),Qe("}")],FieldDef:[Ke("property"),je("ArgumentsDef"),Qe(":"),"Type",Fe("Directive")],ArgumentsDef:[Qe("("),Fe("InputValueDef"),Qe(")")],InputValueDef:[Ke("attribute"),Qe(":"),"Type",je("DefaultValue"),Fe("Directive")],UnionDef:[Be("union"),Ke("atom"),Fe("Directive"),Qe("="),Fe("UnionMember",Qe("|"))],UnionMember:["NamedType"],EnumDef:[Be("enum"),Ke("atom"),Fe("Directive"),Qe("{"),Fe("EnumValueDef"),Qe("}")],EnumValueDef:[Ke("string-2"),Fe("Directive")],InputDef:[Be("input"),Ke("atom"),Fe("Directive"),Qe("{"),Fe("InputValueDef"),Qe("}")],ExtendDef:[Be("extend"),"ObjectTypeDef"]};function Be(e){return{style:"keyword",match:t=>"Name"===t.kind&&t.value===e}}function Ke(e){return{style:e,match:e=>"Name"===e.kind,update(e,t){e.name=t.value}}}function ze(e={eatWhitespace:e=>e.eatWhile(qe),lexRules:Ue,parseRules:Ge,editorConfig:{}}){return{startState(){const t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeperator:!1,prevState:null};return We(e.parseRules,t,L.Kind.DOCUMENT),t},token:(t,n)=>function(e,t,n){var r;if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,"string"):(e.skipToEnd(),"string");const{lexRules:i,parseRules:o,eatWhitespace:a,editorConfig:s}=n;if(t.rule&&0===t.rule.length?Ye(t):t.needsAdvance&&(t.needsAdvance=!1,Je(t,!0)),e.sol()){const n=(null==s?void 0:s.tabSize)||2;t.indentLevel=Math.floor(e.indentation()/n)}if(a(e))return"ws";const c=function(e,t){const n=Object.keys(e);for(let r=0;r0&&e[e.length-1]e)),s=new Set;st(r,((e,t)=>{var r,o,c,l,u;if(t.name&&(t.kind!==et.INTERFACE_DEF||a.includes(t.name)||s.add(t.name),t.kind===et.NAMED_TYPE&&(null===(r=t.prevState)||void 0===r?void 0:r.kind)===et.IMPLEMENTS))if(i.interfaceDef){if(null===(o=i.interfaceDef)||void 0===o?void 0:o.getInterfaces().find((({name:e})=>e===t.name)))return;const e=n.getType(t.name),r=null===(c=i.interfaceDef)||void 0===c?void 0:c.toConfig();i.interfaceDef=new L.GraphQLInterfaceType(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new L.GraphQLInterfaceType({name:t.name,fields:{}})]}))}else if(i.objectTypeDef){if(null===(l=i.objectTypeDef)||void 0===l?void 0:l.getInterfaces().find((({name:e})=>e===t.name)))return;const e=n.getType(t.name),r=null===(u=i.objectTypeDef)||void 0===u?void 0:u.toConfig();i.objectTypeDef=new L.GraphQLObjectType(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new L.GraphQLInterfaceType({name:t.name,fields:{}})]}))}}));const c=i.interfaceDef||i.objectTypeDef,l=((null==c?void 0:c.getInterfaces())||[]).map((({name:e})=>e));return j(e,o.concat([...s].map((e=>({name:e})))).filter((({name:e})=>e!==(null==c?void 0:c.name)&&!l.includes(e))).map((e=>{const t={label:e.name,kind:$.Interface,type:e};return(null==e?void 0:e.description)&&(t.documentation=e.description),t})))}(c,l,e,t,f);if(u===et.SELECTION_SET||u===et.FIELD||u===et.ALIASED_FIELD)return function(e,t,n){var r;if(t.parentType){const i=t.parentType;let o=[];return"getFields"in i&&(o=M(i.getFields())),(0,L.isCompositeType)(i)&&o.push(L.TypeNameMetaFieldDef),i===(null===(r=null==n?void 0:n.schema)||void 0===r?void 0:r.getQueryType())&&o.push(L.SchemaMetaFieldDef,L.TypeMetaFieldDef),j(e,o.map(((e,t)=>{var n;const r={sortText:String(t)+e.name,label:e.name,detail:String(e.type),documentation:null!==(n=e.description)&&void 0!==n?n:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:$.Field,type:e.type},i=(e=>{const t=e.type;if((0,L.isCompositeType)(t))return rt;if((0,L.isListType)(t)&&(0,L.isCompositeType)(t.ofType))return rt;if((0,L.isNonNullType)(t)){if((0,L.isCompositeType)(t.ofType))return rt;if((0,L.isListType)(t.ofType)&&(0,L.isCompositeType)(t.ofType.ofType))return rt}return null})(e);return i&&(r.insertText=e.name+i,r.insertTextFormat=H.Snippet,r.command=tt),r})))}return[]}(c,f,s);if(u===et.ARGUMENTS||u===et.ARGUMENT&&0===p){const e=f.argDefs;if(e)return j(c,e.map((e=>{var t;return{label:e.name,insertText:e.name+": ",command:tt,detail:String(e.type),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,kind:$.Variable,type:e.type}})))}if((u===et.OBJECT_VALUE||u===et.OBJECT_FIELD&&0===p)&&f.objectFieldDefs){const e=M(f.objectFieldDefs),t=u===et.OBJECT_VALUE?$.Value:$.Field;return j(c,e.map((e=>{var n;return{label:e.name,detail:String(e.type),documentation:null!==(n=e.description)&&void 0!==n?n:void 0,kind:t,type:e.type}})))}if(u===et.ENUM_VALUE||u===et.LIST_VALUE&&1===p||u===et.OBJECT_FIELD&&2===p||u===et.ARGUMENT&&2===p)return function(e,t,n,r){const i=(0,L.getNamedType)(t.inputType),o=it(n,r,e).filter((e=>e.detail===i.name));return i instanceof L.GraphQLEnumType?j(e,i.getValues().map((e=>{var t;return{label:e.name,detail:String(i),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:$.EnumMember,type:i}})).concat(o)):i===L.GraphQLBoolean?j(e,o.concat([{label:"true",detail:String(L.GraphQLBoolean),documentation:"Not false.",kind:$.Variable,type:L.GraphQLBoolean},{label:"false",detail:String(L.GraphQLBoolean),documentation:"Not true.",kind:$.Variable,type:L.GraphQLBoolean}])):o}(c,f,t,e);if(u===et.VARIABLE&&1===p){const n=(0,L.getNamedType)(f.inputType);return j(c,it(t,e,c).filter((e=>e.detail===(null==n?void 0:n.name))))}return u===et.TYPE_CONDITION&&1===p||u===et.NAMED_TYPE&&null!=l.prevState&&l.prevState.kind===et.TYPE_CONDITION?function(e,t,n,r){let i;if(t.parentType)if((0,L.isAbstractType)(t.parentType)){const e=(0,L.assertAbstractType)(t.parentType),r=n.getPossibleTypes(e),o=Object.create(null);r.forEach((e=>{e.getInterfaces().forEach((e=>{o[e.name]=e}))})),i=r.concat(M(o))}else i=[t.parentType];else i=M(n.getTypeMap()).filter(L.isCompositeType);return j(e,i.map((e=>{const t=(0,L.getNamedType)(e);return{label:String(e),documentation:(null==t?void 0:t.description)||"",kind:$.Field}})))}(c,f,e):u===et.FRAGMENT_SPREAD&&1===p?function(e,t,n,r,i){if(!r)return[];const o=n.getTypeMap(),a=I(e.state),s=ot(r);i&&i.length>0&&s.push(...i);return j(e,s.filter((e=>o[e.typeCondition.name.value]&&!(a&&a.kind===et.FRAGMENT_DEFINITION&&a.name===e.name.value)&&(0,L.isCompositeType)(t.parentType)&&(0,L.isCompositeType)(o[e.typeCondition.name.value])&&(0,L.doTypesOverlap)(n,t.parentType,o[e.typeCondition.name.value]))).map((e=>({label:e.name.value,detail:String(o[e.typeCondition.name.value]),documentation:`fragment ${e.name.value} on ${e.typeCondition.name.value}`,kind:$.Field,type:o[e.typeCondition.name.value]}))))}(c,f,e,t,Array.isArray(i)?i:(e=>{const t=[];if(e)try{(0,L.visit)((0,L.parse)(e),{FragmentDefinition(e){t.push(e)}})}catch(e){return[]}return t})(i)):u===et.VARIABLE_DEFINITION&&2===p||u===et.LIST_TYPE&&1===p||u===et.NAMED_TYPE&&l.prevState&&(l.prevState.kind===et.VARIABLE_DEFINITION||l.prevState.kind===et.LIST_TYPE||l.prevState.kind===et.NON_NULL_TYPE)?function(e,t,n){return j(e,M(t.getTypeMap()).filter(L.isInputType).map((e=>({label:e.name,documentation:e.description,kind:$.Variable}))))}(c,e):u===et.DIRECTIVE?function(e,t,n,r){var i;return(null===(i=t.prevState)||void 0===i?void 0:i.kind)?j(e,n.getDirectives().filter((e=>ct(t.prevState,e))).map((e=>({label:e.name,documentation:e.description||"",kind:$.Function})))):[]}(c,l,e):[]}const rt=" {\n $1\n}";function it(e,t,n){let r,i=null;const o=Object.create({});return st(e,((e,a)=>{if((null==a?void 0:a.kind)===et.VARIABLE&&a.name&&(i=a.name),(null==a?void 0:a.kind)===et.NAMED_TYPE&&i){const e=((e,t)=>{var n,r,i,o,a,s,c,l,u,p;return(null===(n=e.prevState)||void 0===n?void 0:n.kind)===t?e.prevState:(null===(i=null===(r=e.prevState)||void 0===r?void 0:r.prevState)||void 0===i?void 0:i.kind)===t?e.prevState.prevState:(null===(s=null===(a=null===(o=e.prevState)||void 0===o?void 0:o.prevState)||void 0===a?void 0:a.prevState)||void 0===s?void 0:s.kind)===t?e.prevState.prevState.prevState:(null===(p=null===(u=null===(l=null===(c=e.prevState)||void 0===c?void 0:c.prevState)||void 0===l?void 0:l.prevState)||void 0===u?void 0:u.prevState)||void 0===p?void 0:p.kind)===t?e.prevState.prevState.prevState.prevState:void 0})(a,et.TYPE);(null==e?void 0:e.type)&&(r=t.getType(null==e?void 0:e.type))}i&&r&&(o[i]||(o[i]={detail:r.toString(),insertText:"$"===n.string?i:"$"+i,label:i,type:r,kind:$.Variable},i=null,r=null))})),M(o)}function ot(e){const t=[];return st(e,((e,n)=>{n.kind===et.FRAGMENT_DEFINITION&&n.name&&n.type&&t.push({kind:et.FRAGMENT_DEFINITION,name:{kind:L.Kind.NAME,value:n.name},selectionSet:{kind:et.SELECTION_SET,selections:[]},typeCondition:{kind:et.NAMED_TYPE,name:{kind:L.Kind.NAME,value:n.type}}})})),t}function at(e,t){let n=null,r=null,i=null;const o=st(e,((e,o,a,s)=>{if(s===t.line&&e.getCurrentPosition()>=t.character)return n=a,r=Object.assign({},o),i=e.current(),"BREAK"}));return{start:o.start,end:o.end,string:i||o.string,state:r||o.state,style:n||o.style}}function st(e,t){const n=e.split("\n"),r=ze();let i=r.startState(),o="",a=new Me("");for(let e=0;e{var d;switch(t.kind){case et.QUERY:case"ShortQuery":p=e.getQueryType();break;case et.MUTATION:p=e.getMutationType();break;case et.SUBSCRIPTION:p=e.getSubscriptionType();break;case et.INLINE_FRAGMENT:case et.FRAGMENT_DEFINITION:t.type&&(p=e.getType(t.type));break;case et.FIELD:case et.ALIASED_FIELD:p&&t.name?(a=u?P(e,u,t.name):null,p=a?a.type:null):a=null;break;case et.SELECTION_SET:u=(0,L.getNamedType)(p);break;case et.DIRECTIVE:i=t.name?e.getDirective(t.name):null;break;case et.INTERFACE_DEF:t.name&&(c=null,f=new L.GraphQLInterfaceType({name:t.name,interfaces:[],fields:{}}));break;case et.OBJECT_TYPE_DEF:t.name&&(f=null,c=new L.GraphQLObjectType({name:t.name,interfaces:[],fields:{}}));break;case et.ARGUMENTS:if(t.prevState)switch(t.prevState.kind){case et.FIELD:r=a&&a.args;break;case et.DIRECTIVE:r=i&&i.args;break;case et.ALIASED_FIELD:{const n=null===(d=t.prevState)||void 0===d?void 0:d.name;if(!n){r=null;break}const i=u?P(e,u,n):null;if(!i){r=null;break}r=i.args;break}default:r=null}else r=null;break;case et.ARGUMENT:if(r)for(let e=0;ee.value===t.name)):null;break;case et.LIST_VALUE:const m=(0,L.getNullableType)(s);s=m instanceof L.GraphQLList?m.ofType:null;break;case et.OBJECT_VALUE:const v=(0,L.getNamedType)(s);l=v instanceof L.GraphQLInputObjectType?v.getFields():null;break;case et.OBJECT_FIELD:const y=t.name&&l?l[t.name]:null;s=null==y?void 0:y.type;break;case et.NAMED_TYPE:t.name&&(p=e.getType(t.name))}})),{argDef:n,argDefs:r,directiveDef:i,enumValue:o,fieldDef:a,inputType:s,objectFieldDefs:l,parentType:u,type:p,interfaceDef:f,objectTypeDef:c}}var ut=n(4357),pt=n.n(ut);const ft=(e,t)=>{if(!t)return[];let n;try{n=(0,L.parse)(e)}catch(e){return[]}return dt(n,t)},dt=(e,t)=>{if(!t)return[];const n=new Map,r=new Set;(0,L.visit)(e,{FragmentDefinition(e){n.set(e.name.value,!0)},FragmentSpread(e){r.has(e.name.value)||r.add(e.name.value)}});const i=new Set;r.forEach((e=>{!n.has(e)&&t.has(e)&&i.add(pt()(t.get(e)))}));const o=[];return i.forEach((e=>{(0,L.visit)(e,{FragmentSpread(e){!r.has(e.name.value)&&t.get(e.name.value)&&(i.add(pt()(t.get(e.name.value))),r.add(e.name.value))}}),n.has(e.name.value)||o.push(e)})),o};function ht(e,t){e.push(t)}function mt(e,t){(0,L.isNonNullType)(t)?(mt(e,t.ofType),ht(e,"!")):(0,L.isListType)(t)?(ht(e,"["),mt(e,t.ofType),ht(e,"]")):ht(e,t.name)}function vt(e,t){const n=[];return t&&ht(n,"```graphql\n"),mt(n,e),t&&ht(n,"\n```"),n.join("")}const yt={Int:"integer",String:"string",Float:"number",ID:"string",Boolean:"boolean",DateTime:"string"};function gt(e,t){var n;let r=!1,i=Object.create(null);const o=Object.create(null);if("defaultValue"in e&&void 0!==e.defaultValue&&(i.default=e.defaultValue),(0,L.isEnumType)(e)&&(i.type="string",i.enum=e.getValues().map((e=>e.name))),(0,L.isScalarType)(e)&&(i.type=null!==(n=yt[e.name])&&void 0!==n?n:"any"),(0,L.isListType)(e)){i.type="array";const{definition:n,definitions:r}=gt(e.ofType,t);n.$ref?i.items={$ref:n.$ref}:i.items=n,r&&Object.keys(r).forEach((e=>{o[e]=r[e]}))}if((0,L.isNonNullType)(e)){r=!0;const{definition:n,definitions:a}=gt(e.ofType,t);i=n,a&&Object.keys(a).forEach((e=>{o[e]=a[e]}))}if((0,L.isInputObjectType)(e)){i.$ref=`#/definitions/${e.name}`;const n=e.getFields(),r={type:"object",properties:{},required:[]};e.description?(r.description=e.description+"\n"+vt(e),(null==t?void 0:t.useMarkdownDescription)&&(r.markdownDescription=e.description+"\n"+vt(e,!0))):(r.description=vt(e),(null==t?void 0:t.useMarkdownDescription)&&(r.markdownDescription=vt(e,!0))),Object.keys(n).forEach((e=>{const i=n[e],{required:a,definition:s,definitions:c}=gt(i.type,t),{definition:l}=gt(i,t);r.properties[e]=Object.assign(Object.assign({},s),l);const u=vt(i.type);if(r.properties[e].description=i.description?i.description+"\n"+u:u,null==t?void 0:t.useMarkdownDescription){const t=vt(i.type,!0);r.properties[e].markdownDescription=i.description?i.description+"\n"+t:t}a&&r.required.push(e),c&&Object.keys(c).map((e=>{o[e]=c[e]}))})),o[e.name]=r}return"description"in e&&!(0,L.isScalarType)(e)&&e.description&&!i.description?(i.description=e.description+"\n"+vt(e),(null==t?void 0:t.useMarkdownDescription)&&(i.markdownDescription=e.description+"\n"+vt(e,!0))):(i.description=vt(e),(null==t?void 0:t.useMarkdownDescription)&&(i.markdownDescription=vt(e,!0))),{required:r,definition:i,definitions:o}}function bt(e,t){const n={$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",properties:{},required:[]};return e&&Object.entries(e).forEach((([e,r])=>{var i;const{definition:o,required:a,definitions:s}=gt(r,t);n.properties[e]=o,a&&(null===(i=n.required)||void 0===i||i.push(e)),s&&(n.definitions=Object.assign(Object.assign({},null==n?void 0:n.definitions),s))})),n}function Et(e,t,n){const r=wt(e,n);let i;return(0,L.visit)(t,{enter(e){if(!("Name"!==e.kind&&e.loc&&e.loc.start<=r&&r<=e.loc.end))return!1;i=e},leave(e){if(e.loc&&e.loc.start<=r&&r<=e.loc.end)return!1}}),i}function wt(e,t){const n=e.split("\n").slice(0,t.line);return t.character+n.map((e=>e.length+1)).reduce(((e,t)=>e+t),0)}class Tt{constructor(e,t){this.containsPosition=e=>this.start.line===e.line?this.start.character<=e.character:this.end.line===e.line?this.end.character>=e.character:this.start.line<=e.line&&this.end.line>=e.line,this.start=e,this.end=t}setStart(e,t){this.start=new _t(e,t)}setEnd(e,t){this.end=new _t(e,t)}}class _t{constructor(e,t){this.lessThanOrEqualTo=e=>this.linee!==L.NoUnusedFragmentsRule&&e!==L.ExecutableDefinitionsRule&&(!r||e!==L.KnownFragmentNamesRule)));return n&&Array.prototype.push.apply(o,n),i&&Array.prototype.push.apply(o,Ot),(0,L.validate)(e,t,o).filter((e=>{if(-1!==e.message.indexOf("Unknown directive")&&e.nodes){const t=e.nodes[0];if(t&&t.kind===L.Kind.DIRECTIVE){const e=t.name.value;if("arguments"===e||"argumentDefinitions"===e)return!1}}return!0}))}function xt(e,t){const n=Object.create(null);return t.definitions.forEach((t=>{if("OperationDefinition"===t.kind){const r=t.variableDefinitions;r&&r.forEach((({variable:t,type:r})=>{const i=(0,L.typeFromAST)(e,r);i?n[t.name.value]=i:r.kind===L.Kind.NAMED_TYPE&&"Float"===r.name.value&&(n[t.name.value]=L.GraphQLFloat)}))}})),n}function Ct(e,t){const n=t?xt(t,e):void 0,r=[];return(0,L.visit)(e,{OperationDefinition(e){r.push(e)}}),{variableToType:n,operations:r}}function Nt(e,t){if(t)try{const n=(0,L.parse)(t);return Object.assign(Object.assign({},Ct(n,e)),{documentAST:n})}catch(e){return}}const At=Nt;var Lt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};const Dt="GraphQL";function It(e,t){if(!e)throw new Error(t)}function Pt(e,t){const n=t.loc;return It(n,"Expected ASTNode to have a location."),function(e,t){const n=kt(e,t.start),r=kt(e,t.end);return new Tt(n,r)}(e,n)}function Rt(e,t){const n=t.loc;return It(n,"Expected ASTNode to have a location."),kt(e,n.start)}function Mt(e,t,n){return Lt(this,void 0,void 0,(function*(){const r=t.name.value,i=n.filter((({definition:e})=>e.name&&e.name.value===r));if(0===i.length)throw Error(`Definition not found for GraphQL type ${r}`);const o=i.map((({filePath:e,content:t,definition:n})=>function(e,t,n){const r=n.name;return It(r,"Expected ASTNode to have a Name."),{path:e,position:Rt(t,n),range:Pt(t,n),name:r.value||"",language:Dt,projectRoot:e}}(e||"",t,n)));return{definitions:o,queryRange:o.map((n=>Pt(e,t)))}}))}function jt(e,t,n){return Lt(this,void 0,void 0,(function*(){const r=n.filter((({definition:e})=>e.name&&e.name.value===t));if(0===r.length)throw Error(`Definition not found for GraphQL type ${t}`);const i=[];return r.forEach((({filePath:t,content:n,definition:r})=>{var o;const a=null===(o=r.fields)||void 0===o?void 0:o.find((t=>t.name.value===e));if(null==a)return null;i.push(function(e,t,n){const r=n.name;return It(r,"Expected ASTNode to have a Name."),{path:e,position:Rt(t,n),range:Pt(t,n),name:r.value||"",language:Dt,projectRoot:e}}(t||"",n,a))})),{definitions:i,queryRange:[]}}))}function Ft(e,t,n){return Lt(this,void 0,void 0,(function*(){const r=t.name.value,i=n.filter((({definition:e})=>e.name.value===r));if(0===i.length)throw Error(`Definition not found for GraphQL fragment ${r}`);const o=i.map((({filePath:e,content:t,definition:n})=>Qt(e||"",t,n)));return{definitions:o,queryRange:o.map((n=>Pt(e,t)))}}))}function Vt(e,t,n){return{definitions:[Qt(e,t,n)],queryRange:n.name?[Pt(t,n.name)]:[]}}function Qt(e,t,n){const r=n.name;if(!r)throw Error("Expected ASTNode to have a Name.");return{path:e,position:Rt(t,n),range:Pt(t,n),name:r.value||"",language:Dt,projectRoot:e}}const qt={Error:"Error",Warning:"Warning",Information:"Information",Hint:"Hint"},Ut={[qt.Error]:1,[qt.Warning]:2,[qt.Information]:3,[qt.Hint]:4},Gt=(e,t)=>{if(!e)throw new Error(t)};function Bt(e,t=null,n,r,i){var o,a;let s=null;i&&(e+="string"==typeof i?"\n\n"+i:"\n\n"+i.reduce(((e,t)=>e+((0,L.print)(t)+"\n\n")),""));try{s=(0,L.parse)(e)}catch(t){if(t instanceof L.GraphQLError){const n=Ht(null!==(a=null===(o=t.locations)||void 0===o?void 0:o[0])&&void 0!==a?a:{line:0,column:0},e);return[{severity:Ut.Error,message:t.message,source:"GraphQL: Syntax",range:n}]}throw t}return Kt(s,t,n,r)}function Kt(e,t=null,n,r){if(!t)return[];const i=zt(St(t,e,n,r),(e=>$t(e,Ut.Error,"Validation"))),o=zt((0,L.validate)(t,e,[L.NoDeprecatedCustomRule]),(e=>$t(e,Ut.Warning,"Deprecation")));return i.concat(o)}function zt(e,t){return Array.prototype.concat.apply([],e.map(t))}function $t(e,t,n){if(!e.nodes)return[];const r=[];return e.nodes.forEach((i=>{const o="Variable"!==i.kind&&"name"in i&&void 0!==i.name?i.name:"variable"in i&&void 0!==i.variable?i.variable:i;if(o){Gt(e.locations,"GraphQL validation error requires locations.");const i=e.locations[0],a=function(e){const t=e.loc;return Gt(t,"Expected ASTNode to have a location."),t}(o),s=i.column+(a.end-a.start);r.push({source:`GraphQL: ${n}`,message:e.message,severity:t,range:new Tt(new _t(i.line-1,i.column-1),new _t(i.line-1,s))})}})),r}function Ht(e,t){const n=ze(),r=n.startState(),i=t.split("\n");Gt(i.length>=e.line,"Query text must have more lines than where the error happened");let o=null;for(let t=0;t({representativeName:t.name,startPosition:kt(e,t.loc.start),endPosition:kt(e,t.loc.end),kind:t.kind,children:t.selectionSet||t.fields||t.values||t.arguments||[]});return{Field:e=>{const n=e.alias?[Jt("plain",e.alias),Jt("plain",": ")]:[];return n.push(Jt("plain",e.name)),Object.assign({tokenizedText:n},t(e))},OperationDefinition:e=>Object.assign({tokenizedText:[Jt("keyword",e.operation),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),Document:e=>e.definitions,SelectionSet:e=>function(e,t){const n=[];for(let t=0;te.value,FragmentDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","fragment"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),InterfaceTypeDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","interface"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),EnumTypeDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","enum"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),EnumValueDefinition:e=>Object.assign({tokenizedText:[Jt("plain",e.name)]},t(e)),ObjectTypeDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","type"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),InputObjectTypeDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","input"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),FragmentSpread:e=>Object.assign({tokenizedText:[Jt("plain","..."),Jt("class-name",e.name)]},t(e)),InputValueDefinition:e=>Object.assign({tokenizedText:[Jt("plain",e.name)]},t(e)),FieldDefinition:e=>Object.assign({tokenizedText:[Jt("plain",e.name)]},t(e)),InlineFragment:e=>e.selectionSet}}(e);return{outlineTrees:(0,L.visit)(t,{leave:e=>void 0!==n&&e.kind in n?n[e.kind](e):null})}}function Jt(e,t){return{kind:e,value:t}}function Xt(e,t,n,r,i){const o=r||at(t,n);if(!e||!o||!o.state)return"";const a=o.state,s=a.kind,c=a.step,l=lt(e,o.state),u=Object.assign(Object.assign({},i),{schema:e});if("Field"===s&&0===c&&l.fieldDef||"AliasedField"===s&&2===c&&l.fieldDef){const e=[];return Zt(e,u),function(e,t,n){tn(e,t,n),rn(e,t,n,t.type)}(e,l,u),en(e,u),an(e,0,l.fieldDef),e.join("").trim()}if("Directive"===s&&1===c&&l.directiveDef){const e=[];return Zt(e,u),nn(e,l),en(e,u),an(e,0,l.directiveDef),e.join("").trim()}if("Argument"===s&&0===c&&l.argDef){const e=[];return Zt(e,u),function(e,t,n){if(t.directiveDef?nn(e,t):t.fieldDef&&tn(e,t,n),!t.argDef)return;const r=t.argDef.name;sn(e,"("),sn(e,r),rn(e,t,n,t.inputType),sn(e,")")}(e,l,u),en(e,u),an(e,0,l.argDef),e.join("").trim()}if("EnumValue"===s&&l.enumValue&&"description"in l.enumValue){const e=[];return Zt(e,u),function(e,t,n){if(!t.enumValue)return;const r=t.enumValue.name;on(e,t,n,t.inputType),sn(e,"."),sn(e,r)}(e,l,u),en(e,u),an(e,0,l.enumValue),e.join("").trim()}if("NamedType"===s&&l.type&&"description"in l.type){const e=[];return Zt(e,u),on(e,l,u,l.type),en(e,u),an(e,0,l.type),e.join("").trim()}return""}function Zt(e,t){t.useMarkdown&&sn(e,"```graphql\n")}function en(e,t){t.useMarkdown&&sn(e,"\n```")}function tn(e,t,n){if(!t.fieldDef)return;const r=t.fieldDef.name;"__"!==r.slice(0,2)&&(on(e,t,n,t.parentType),sn(e,".")),sn(e,r)}function nn(e,t,n){t.directiveDef&&sn(e,"@"+t.directiveDef.name)}function rn(e,t,n,r){sn(e,": "),on(e,t,n,r)}function on(e,t,n,r){r&&(r instanceof L.GraphQLNonNull?(on(e,t,n,r.ofType),sn(e,"!")):r instanceof L.GraphQLList?(sn(e,"["),on(e,t,n,r.ofType),sn(e,"]")):sn(e,r.name))}function an(e,t,n){if(!n)return;const r="string"==typeof n.description?n.description:null;r&&(sn(e,"\n\n"),sn(e,r)),function(e,t,n){if(!n)return;const r=n.deprecationReason?n.deprecationReason:null;r&&(sn(e,"\n\n"),sn(e,"Deprecated: "),sn(e,r))}(e,0,n)}function sn(e,t){e.push(t)}const cn={Created:1,Changed:2,Deleted:3};var ln;!function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(ln||(ln={}))},5822:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=void 0,t.formatError=function(e){return e.toJSON()},t.printError=function(e){return e.toString()};var r=n(5690),i=n(9016),o=n(8038);class a extends Error{constructor(e,...t){var n,o,c;const{nodes:l,source:u,positions:p,path:f,originalError:d,extensions:h}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=f?f:void 0,this.originalError=null!=d?d:void 0,this.nodes=s(Array.isArray(l)?l:l?[l]:void 0);const m=s(null===(n=this.nodes)||void 0===n?void 0:n.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=u?u:null==m||null===(o=m[0])||void 0===o?void 0:o.source,this.positions=null!=p?p:null==m?void 0:m.map((e=>e.start)),this.locations=p&&u?p.map((e=>(0,i.getLocation)(u,e))):null==m?void 0:m.map((e=>(0,i.getLocation)(e.source,e.start)));const v=(0,r.isObjectLike)(null==d?void 0:d.extensions)?null==d?void 0:d.extensions:void 0;this.extensions=null!==(c=null!=h?h:v)&&void 0!==c?c:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=d&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,o.printLocation)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,o.printSourceLocation)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function s(e){return void 0===e||0===e.length?void 0:e}t.GraphQLError=a},6972:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"GraphQLError",{enumerable:!0,get:function(){return r.GraphQLError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return r.formatError}}),Object.defineProperty(t,"locatedError",{enumerable:!0,get:function(){return o.locatedError}}),Object.defineProperty(t,"printError",{enumerable:!0,get:function(){return r.printError}}),Object.defineProperty(t,"syntaxError",{enumerable:!0,get:function(){return i.syntaxError}});var r=n(5822),i=n(338),o=n(1993)},1993:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.locatedError=function(e,t,n){var o;const a=(0,r.toError)(e);return s=a,Array.isArray(s.path)?a:new i.GraphQLError(a.message,{nodes:null!==(o=a.nodes)&&void 0!==o?o:t,source:a.source,positions:a.positions,path:n,originalError:a});var s};var r=n(7729),i=n(5822)},338:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new r.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})};var r=n(5822)},8950:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.collectFields=function(e,t,n,r,i){const o=new Map;return c(e,t,n,r,i,o,new Set),o},t.collectSubfields=function(e,t,n,r,i){const o=new Map,a=new Set;for(const s of i)s.selectionSet&&c(e,t,n,r,s.selectionSet,o,a);return o};var r=n(2828),i=n(5003),o=n(7197),a=n(5115),s=n(8840);function c(e,t,n,i,o,a,s){for(const f of o.selections)switch(f.kind){case r.Kind.FIELD:{if(!l(n,f))continue;const e=(p=f).alias?p.alias.value:p.name.value,t=a.get(e);void 0!==t?t.push(f):a.set(e,[f]);break}case r.Kind.INLINE_FRAGMENT:if(!l(n,f)||!u(e,f,i))continue;c(e,t,n,i,f.selectionSet,a,s);break;case r.Kind.FRAGMENT_SPREAD:{const r=f.name.value;if(s.has(r)||!l(n,f))continue;s.add(r);const o=t[r];if(!o||!u(e,o,i))continue;c(e,t,n,i,o.selectionSet,a,s);break}}var p}function l(e,t){const n=(0,s.getDirectiveValues)(o.GraphQLSkipDirective,t,e);if(!0===(null==n?void 0:n.if))return!1;const r=(0,s.getDirectiveValues)(o.GraphQLIncludeDirective,t,e);return!1!==(null==r?void 0:r.if)}function u(e,t,n){const r=t.typeCondition;if(!r)return!0;const o=(0,a.typeFromAST)(e,r);return o===n||!!(0,i.isAbstractType)(o)&&e.isSubType(o,n)}},192:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidExecutionArguments=O,t.buildExecutionContext=S,t.buildResolveInfo=A,t.defaultTypeResolver=t.defaultFieldResolver=void 0,t.execute=_,t.executeSync=function(e){const t=_(e);if((0,c.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t},t.getFieldDef=F;var r=n(7242),i=n(8002),o=n(7706),a=n(6609),s=n(5690),c=n(4221),l=n(5456),u=n(7059),p=n(3179),f=n(9915),d=n(5822),h=n(1993),m=n(1807),v=n(2828),y=n(5003),g=n(8155),b=n(1671),E=n(8950),w=n(8840);const T=(0,l.memoize3)(((e,t,n)=>(0,E.collectSubfields)(e.schema,e.fragments,e.variableValues,t,n)));function _(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,document:n,variableValues:i,rootValue:o}=e;O(t,n,i);const a=S(e);if(!("schema"in a))return{errors:a};try{const{operation:e}=a,t=x(a,e,o);return(0,c.isPromise)(t)?t.then((e=>k(e,a.errors)),(e=>(a.errors.push(e),k(null,a.errors)))):k(t,a.errors)}catch(e){return a.errors.push(e),k(null,a.errors)}}function k(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function O(e,t,n){t||(0,r.devAssert)(!1,"Must provide document."),(0,b.assertValidSchema)(e),null==n||(0,s.isObjectLike)(n)||(0,r.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function S(e){var t,n;const{schema:r,document:i,rootValue:o,contextValue:a,variableValues:s,operationName:c,fieldResolver:l,typeResolver:u,subscribeFieldResolver:p}=e;let f;const h=Object.create(null);for(const e of i.definitions)switch(e.kind){case v.Kind.OPERATION_DEFINITION:if(null==c){if(void 0!==f)return[new d.GraphQLError("Must provide operation name if query contains multiple operations.")];f=e}else(null===(t=e.name)||void 0===t?void 0:t.value)===c&&(f=e);break;case v.Kind.FRAGMENT_DEFINITION:h[e.name.value]=e}if(!f)return null!=c?[new d.GraphQLError(`Unknown operation named "${c}".`)]:[new d.GraphQLError("Must provide an operation.")];const m=null!==(n=f.variableDefinitions)&&void 0!==n?n:[],y=(0,w.getVariableValues)(r,m,null!=s?s:{},{maxErrors:50});return y.errors?y.errors:{schema:r,fragments:h,rootValue:o,contextValue:a,operation:f,variableValues:y.coerced,fieldResolver:null!=l?l:j,typeResolver:null!=u?u:M,subscribeFieldResolver:null!=p?p:j,errors:[]}}function x(e,t,n){const r=e.schema.getRootType(t.operation);if(null==r)throw new d.GraphQLError(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});const i=(0,E.collectFields)(e.schema,e.fragments,e.variableValues,r,t.selectionSet),o=void 0;switch(t.operation){case m.OperationTypeNode.QUERY:return C(e,r,n,o,i);case m.OperationTypeNode.MUTATION:return function(e,t,n,r,i){return(0,f.promiseReduce)(i.entries(),((r,[i,o])=>{const a=(0,u.addPath)(undefined,i,t.name),s=N(e,t,n,o,a);return void 0===s?r:(0,c.isPromise)(s)?s.then((e=>(r[i]=e,r))):(r[i]=s,r)}),Object.create(null))}(e,r,n,0,i);case m.OperationTypeNode.SUBSCRIPTION:return C(e,r,n,o,i)}}function C(e,t,n,r,i){const o=Object.create(null);let a=!1;try{for(const[s,l]of i.entries()){const i=N(e,t,n,l,(0,u.addPath)(r,s,t.name));void 0!==i&&(o[s]=i,(0,c.isPromise)(i)&&(a=!0))}}catch(e){if(a)return(0,p.promiseForObject)(o).finally((()=>{throw e}));throw e}return a?(0,p.promiseForObject)(o):o}function N(e,t,n,r,i){var o;const a=F(e.schema,t,r[0]);if(!a)return;const s=a.type,l=null!==(o=a.resolve)&&void 0!==o?o:e.fieldResolver,p=A(e,a,r,t,i);try{const t=l(n,(0,w.getArgumentValues)(a,r[0],e.variableValues),e.contextValue,p);let o;return o=(0,c.isPromise)(t)?t.then((t=>D(e,s,r,p,i,t))):D(e,s,r,p,i,t),(0,c.isPromise)(o)?o.then(void 0,(t=>L((0,h.locatedError)(t,r,(0,u.pathToArray)(i)),s,e))):o}catch(t){return L((0,h.locatedError)(t,r,(0,u.pathToArray)(i)),s,e)}}function A(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function L(e,t,n){if((0,y.isNonNullType)(t))throw e;return n.errors.push(e),null}function D(e,t,n,r,s,l){if(l instanceof Error)throw l;if((0,y.isNonNullType)(t)){const i=D(e,t.ofType,n,r,s,l);if(null===i)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return i}return null==l?null:(0,y.isListType)(t)?function(e,t,n,r,i,o){if(!(0,a.isIterableObject)(o))throw new d.GraphQLError(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const s=t.ofType;let l=!1;const p=Array.from(o,((t,o)=>{const a=(0,u.addPath)(i,o,void 0);try{let i;return i=(0,c.isPromise)(t)?t.then((t=>D(e,s,n,r,a,t))):D(e,s,n,r,a,t),(0,c.isPromise)(i)?(l=!0,i.then(void 0,(t=>L((0,h.locatedError)(t,n,(0,u.pathToArray)(a)),s,e)))):i}catch(t){return L((0,h.locatedError)(t,n,(0,u.pathToArray)(a)),s,e)}}));return l?Promise.all(p):p}(e,t,n,r,s,l):(0,y.isLeafType)(t)?function(e,t){const n=e.serialize(t);if(null==n)throw new Error(`Expected \`${(0,i.inspect)(e)}.serialize(${(0,i.inspect)(t)})\` to return non-nullable value, returned: ${(0,i.inspect)(n)}`);return n}(t,l):(0,y.isAbstractType)(t)?function(e,t,n,r,i,o){var a;const s=null!==(a=t.resolveType)&&void 0!==a?a:e.typeResolver,l=e.contextValue,u=s(o,l,r,t);return(0,c.isPromise)(u)?u.then((a=>P(e,I(a,e,t,n,r,o),n,r,i,o))):P(e,I(u,e,t,n,r,o),n,r,i,o)}(e,t,n,r,s,l):(0,y.isObjectType)(t)?P(e,t,n,r,s,l):void(0,o.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,i.inspect)(t))}function I(e,t,n,r,o,a){if(null==e)throw new d.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if((0,y.isObjectType)(e))throw new d.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new d.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}" with value ${(0,i.inspect)(a)}, received "${(0,i.inspect)(e)}".`);const s=t.schema.getType(e);if(null==s)throw new d.GraphQLError(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!(0,y.isObjectType)(s))throw new d.GraphQLError(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,s))throw new d.GraphQLError(`Runtime Object type "${s.name}" is not a possible type for "${n.name}".`,{nodes:r});return s}function P(e,t,n,r,i,o){const a=T(e,t,n);if(t.isTypeOf){const s=t.isTypeOf(o,e.contextValue,r);if((0,c.isPromise)(s))return s.then((r=>{if(!r)throw R(t,o,n);return C(e,t,o,i,a)}));if(!s)throw R(t,o,n)}return C(e,t,o,i,a)}function R(e,t,n){return new d.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,i.inspect)(t)}.`,{nodes:n})}const M=function(e,t,n,r){if((0,s.isObjectLike)(e)&&"string"==typeof e.__typename)return e.__typename;const i=n.schema.getPossibleTypes(r),o=[];for(let r=0;r{for(let t=0;tr(await n.next()),return:async()=>"function"==typeof n.return?r(await n.return()):{value:void 0,done:!0},async throw(e){if("function"==typeof n.throw)return r(await n.throw(e));throw e},[Symbol.asyncIterator](){return this}}}},6234:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSourceEventStream=d,t.subscribe=async function(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const t=await d(e);if(!(0,o.isAsyncIterable)(t))return t;const n=t=>(0,u.execute)({...e,rootValue:t});return(0,p.mapAsyncIterator)(t,n)};var r=n(7242),i=n(8002),o=n(8648),a=n(7059),s=n(5822),c=n(1993),l=n(8950),u=n(192),p=n(6082),f=n(8840);async function d(...e){const t=function(e){const t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}(e),{schema:n,document:r,variableValues:p}=t;(0,u.assertValidExecutionArguments)(n,r,p);const d=(0,u.buildExecutionContext)(t);if(!("schema"in d))return{errors:d};try{const e=await async function(e){const{schema:t,fragments:n,operation:r,variableValues:i,rootValue:o}=e,p=t.getSubscriptionType();if(null==p)throw new s.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:r});const d=(0,l.collectFields)(t,n,i,p,r.selectionSet),[h,m]=[...d.entries()][0],v=(0,u.getFieldDef)(t,p,m[0]);if(!v){const e=m[0].name.value;throw new s.GraphQLError(`The subscription field "${e}" is not defined.`,{nodes:m})}const y=(0,a.addPath)(void 0,h,p.name),g=(0,u.buildResolveInfo)(e,v,m,p,y);try{var b;const t=(0,f.getArgumentValues)(v,m[0],i),n=e.contextValue,r=null!==(b=v.subscribe)&&void 0!==b?b:e.subscribeFieldResolver,a=await r(o,t,n,g);if(a instanceof Error)throw a;return a}catch(e){throw(0,c.locatedError)(e,m,(0,a.pathToArray)(y))}}(d);if(!(0,o.isAsyncIterable)(e))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,i.inspect)(e)}.`);return e}catch(e){if(e instanceof s.GraphQLError)return{errors:[e]};throw e}}},8840:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getArgumentValues=d,t.getDirectiveValues=function(e,t,n){var r;const i=null===(r=t.directives)||void 0===r?void 0:r.find((t=>t.name.value===e.name));if(i)return d(e,i,n)},t.getVariableValues=function(e,t,n,i){const s=[],d=null==i?void 0:i.maxErrors;try{const i=function(e,t,n,i){const s={};for(const d of t){const t=d.variable.name.value,m=(0,p.typeFromAST)(e,d.type);if(!(0,l.isInputType)(m)){const e=(0,c.print)(d.type);i(new a.GraphQLError(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:d.type}));continue}if(!h(n,t)){if(d.defaultValue)s[t]=(0,f.valueFromAST)(d.defaultValue,m);else if((0,l.isNonNullType)(m)){const e=(0,r.inspect)(m);i(new a.GraphQLError(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:d}))}continue}const v=n[t];if(null===v&&(0,l.isNonNullType)(m)){const e=(0,r.inspect)(m);i(new a.GraphQLError(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:d}))}else s[t]=(0,u.coerceInputValue)(v,m,((e,n,s)=>{let c=`Variable "$${t}" got invalid value `+(0,r.inspect)(n);e.length>0&&(c+=` at "${t}${(0,o.printPathArray)(e)}"`),i(new a.GraphQLError(c+"; "+s.message,{nodes:d,originalError:s}))}))}return s}(e,t,n,(e=>{if(null!=d&&s.length>=d)throw new a.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");s.push(e)}));if(0===s.length)return{coerced:i}}catch(e){s.push(e)}return{errors:s}};var r=n(8002),i=n(2863),o=n(737),a=n(5822),s=n(2828),c=n(3033),l=n(5003),u=n(3679),p=n(5115),f=n(3770);function d(e,t,n){var o;const u={},p=null!==(o=t.arguments)&&void 0!==o?o:[],d=(0,i.keyMap)(p,(e=>e.name.value));for(const i of e.args){const e=i.name,o=i.type,p=d[e];if(!p){if(void 0!==i.defaultValue)u[e]=i.defaultValue;else if((0,l.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of required type "${(0,r.inspect)(o)}" was not provided.`,{nodes:t});continue}const m=p.value;let v=m.kind===s.Kind.NULL;if(m.kind===s.Kind.VARIABLE){const t=m.name.value;if(null==n||!h(n,t)){if(void 0!==i.defaultValue)u[e]=i.defaultValue;else if((0,l.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of required type "${(0,r.inspect)(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:m});continue}v=null==n[t]}if(v&&(0,l.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of non-null type "${(0,r.inspect)(o)}" must not be null.`,{nodes:m});const y=(0,f.valueFromAST)(m,o,n);if(void 0===y)throw new a.GraphQLError(`Argument "${e}" has invalid value ${(0,c.print)(m)}.`,{nodes:m});u[e]=y}return u}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},9728:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.graphql=function(e){return new Promise((t=>t(l(e))))},t.graphqlSync=function(e){const t=l(e);if((0,i.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t};var r=n(7242),i=n(4221),o=n(8370),a=n(1671),s=n(9504),c=n(192);function l(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,source:n,rootValue:i,contextValue:l,variableValues:u,operationName:p,fieldResolver:f,typeResolver:d}=e,h=(0,a.validateSchema)(t);if(h.length>0)return{errors:h};let m;try{m=(0,o.parse)(n)}catch(e){return{errors:[e]}}const v=(0,s.validate)(t,m);return v.length>0?{errors:v}:(0,c.execute)({schema:t,document:m,rootValue:i,contextValue:l,variableValues:u,operationName:p,fieldResolver:f,typeResolver:d})}},20:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BREAK",{enumerable:!0,get:function(){return a.BREAK}}),Object.defineProperty(t,"BreakingChangeType",{enumerable:!0,get:function(){return u.BreakingChangeType}}),Object.defineProperty(t,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return o.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(t,"DangerousChangeType",{enumerable:!0,get:function(){return u.DangerousChangeType}}),Object.defineProperty(t,"DirectiveLocation",{enumerable:!0,get:function(){return a.DirectiveLocation}}),Object.defineProperty(t,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return c.ExecutableDefinitionsRule}}),Object.defineProperty(t,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return c.FieldsOnCorrectTypeRule}}),Object.defineProperty(t,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return c.FragmentsOnCompositeTypesRule}}),Object.defineProperty(t,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return o.GRAPHQL_MAX_INT}}),Object.defineProperty(t,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return o.GRAPHQL_MIN_INT}}),Object.defineProperty(t,"GraphQLBoolean",{enumerable:!0,get:function(){return o.GraphQLBoolean}}),Object.defineProperty(t,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return o.GraphQLDeprecatedDirective}}),Object.defineProperty(t,"GraphQLDirective",{enumerable:!0,get:function(){return o.GraphQLDirective}}),Object.defineProperty(t,"GraphQLEnumType",{enumerable:!0,get:function(){return o.GraphQLEnumType}}),Object.defineProperty(t,"GraphQLError",{enumerable:!0,get:function(){return l.GraphQLError}}),Object.defineProperty(t,"GraphQLFloat",{enumerable:!0,get:function(){return o.GraphQLFloat}}),Object.defineProperty(t,"GraphQLID",{enumerable:!0,get:function(){return o.GraphQLID}}),Object.defineProperty(t,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return o.GraphQLIncludeDirective}}),Object.defineProperty(t,"GraphQLInputObjectType",{enumerable:!0,get:function(){return o.GraphQLInputObjectType}}),Object.defineProperty(t,"GraphQLInt",{enumerable:!0,get:function(){return o.GraphQLInt}}),Object.defineProperty(t,"GraphQLInterfaceType",{enumerable:!0,get:function(){return o.GraphQLInterfaceType}}),Object.defineProperty(t,"GraphQLList",{enumerable:!0,get:function(){return o.GraphQLList}}),Object.defineProperty(t,"GraphQLNonNull",{enumerable:!0,get:function(){return o.GraphQLNonNull}}),Object.defineProperty(t,"GraphQLObjectType",{enumerable:!0,get:function(){return o.GraphQLObjectType}}),Object.defineProperty(t,"GraphQLScalarType",{enumerable:!0,get:function(){return o.GraphQLScalarType}}),Object.defineProperty(t,"GraphQLSchema",{enumerable:!0,get:function(){return o.GraphQLSchema}}),Object.defineProperty(t,"GraphQLSkipDirective",{enumerable:!0,get:function(){return o.GraphQLSkipDirective}}),Object.defineProperty(t,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return o.GraphQLSpecifiedByDirective}}),Object.defineProperty(t,"GraphQLString",{enumerable:!0,get:function(){return o.GraphQLString}}),Object.defineProperty(t,"GraphQLUnionType",{enumerable:!0,get:function(){return o.GraphQLUnionType}}),Object.defineProperty(t,"Kind",{enumerable:!0,get:function(){return a.Kind}}),Object.defineProperty(t,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return c.KnownArgumentNamesRule}}),Object.defineProperty(t,"KnownDirectivesRule",{enumerable:!0,get:function(){return c.KnownDirectivesRule}}),Object.defineProperty(t,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return c.KnownFragmentNamesRule}}),Object.defineProperty(t,"KnownTypeNamesRule",{enumerable:!0,get:function(){return c.KnownTypeNamesRule}}),Object.defineProperty(t,"Lexer",{enumerable:!0,get:function(){return a.Lexer}}),Object.defineProperty(t,"Location",{enumerable:!0,get:function(){return a.Location}}),Object.defineProperty(t,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return c.LoneAnonymousOperationRule}}),Object.defineProperty(t,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return c.LoneSchemaDefinitionRule}}),Object.defineProperty(t,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return c.NoDeprecatedCustomRule}}),Object.defineProperty(t,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return c.NoFragmentCyclesRule}}),Object.defineProperty(t,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return c.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(t,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return c.NoUndefinedVariablesRule}}),Object.defineProperty(t,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return c.NoUnusedFragmentsRule}}),Object.defineProperty(t,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return c.NoUnusedVariablesRule}}),Object.defineProperty(t,"OperationTypeNode",{enumerable:!0,get:function(){return a.OperationTypeNode}}),Object.defineProperty(t,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return c.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(t,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return c.PossibleFragmentSpreadsRule}}),Object.defineProperty(t,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return c.PossibleTypeExtensionsRule}}),Object.defineProperty(t,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return c.ProvidedRequiredArgumentsRule}}),Object.defineProperty(t,"ScalarLeafsRule",{enumerable:!0,get:function(){return c.ScalarLeafsRule}}),Object.defineProperty(t,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return o.SchemaMetaFieldDef}}),Object.defineProperty(t,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return c.SingleFieldSubscriptionsRule}}),Object.defineProperty(t,"Source",{enumerable:!0,get:function(){return a.Source}}),Object.defineProperty(t,"Token",{enumerable:!0,get:function(){return a.Token}}),Object.defineProperty(t,"TokenKind",{enumerable:!0,get:function(){return a.TokenKind}}),Object.defineProperty(t,"TypeInfo",{enumerable:!0,get:function(){return u.TypeInfo}}),Object.defineProperty(t,"TypeKind",{enumerable:!0,get:function(){return o.TypeKind}}),Object.defineProperty(t,"TypeMetaFieldDef",{enumerable:!0,get:function(){return o.TypeMetaFieldDef}}),Object.defineProperty(t,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return o.TypeNameMetaFieldDef}}),Object.defineProperty(t,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return c.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(t,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return c.UniqueArgumentNamesRule}}),Object.defineProperty(t,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return c.UniqueDirectiveNamesRule}}),Object.defineProperty(t,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return c.UniqueDirectivesPerLocationRule}}),Object.defineProperty(t,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return c.UniqueEnumValueNamesRule}}),Object.defineProperty(t,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return c.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(t,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return c.UniqueFragmentNamesRule}}),Object.defineProperty(t,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return c.UniqueInputFieldNamesRule}}),Object.defineProperty(t,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return c.UniqueOperationNamesRule}}),Object.defineProperty(t,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return c.UniqueOperationTypesRule}}),Object.defineProperty(t,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return c.UniqueTypeNamesRule}}),Object.defineProperty(t,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return c.UniqueVariableNamesRule}}),Object.defineProperty(t,"ValidationContext",{enumerable:!0,get:function(){return c.ValidationContext}}),Object.defineProperty(t,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return c.ValuesOfCorrectTypeRule}}),Object.defineProperty(t,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return c.VariablesAreInputTypesRule}}),Object.defineProperty(t,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return c.VariablesInAllowedPositionRule}}),Object.defineProperty(t,"__Directive",{enumerable:!0,get:function(){return o.__Directive}}),Object.defineProperty(t,"__DirectiveLocation",{enumerable:!0,get:function(){return o.__DirectiveLocation}}),Object.defineProperty(t,"__EnumValue",{enumerable:!0,get:function(){return o.__EnumValue}}),Object.defineProperty(t,"__Field",{enumerable:!0,get:function(){return o.__Field}}),Object.defineProperty(t,"__InputValue",{enumerable:!0,get:function(){return o.__InputValue}}),Object.defineProperty(t,"__Schema",{enumerable:!0,get:function(){return o.__Schema}}),Object.defineProperty(t,"__Type",{enumerable:!0,get:function(){return o.__Type}}),Object.defineProperty(t,"__TypeKind",{enumerable:!0,get:function(){return o.__TypeKind}}),Object.defineProperty(t,"assertAbstractType",{enumerable:!0,get:function(){return o.assertAbstractType}}),Object.defineProperty(t,"assertCompositeType",{enumerable:!0,get:function(){return o.assertCompositeType}}),Object.defineProperty(t,"assertDirective",{enumerable:!0,get:function(){return o.assertDirective}}),Object.defineProperty(t,"assertEnumType",{enumerable:!0,get:function(){return o.assertEnumType}}),Object.defineProperty(t,"assertEnumValueName",{enumerable:!0,get:function(){return o.assertEnumValueName}}),Object.defineProperty(t,"assertInputObjectType",{enumerable:!0,get:function(){return o.assertInputObjectType}}),Object.defineProperty(t,"assertInputType",{enumerable:!0,get:function(){return o.assertInputType}}),Object.defineProperty(t,"assertInterfaceType",{enumerable:!0,get:function(){return o.assertInterfaceType}}),Object.defineProperty(t,"assertLeafType",{enumerable:!0,get:function(){return o.assertLeafType}}),Object.defineProperty(t,"assertListType",{enumerable:!0,get:function(){return o.assertListType}}),Object.defineProperty(t,"assertName",{enumerable:!0,get:function(){return o.assertName}}),Object.defineProperty(t,"assertNamedType",{enumerable:!0,get:function(){return o.assertNamedType}}),Object.defineProperty(t,"assertNonNullType",{enumerable:!0,get:function(){return o.assertNonNullType}}),Object.defineProperty(t,"assertNullableType",{enumerable:!0,get:function(){return o.assertNullableType}}),Object.defineProperty(t,"assertObjectType",{enumerable:!0,get:function(){return o.assertObjectType}}),Object.defineProperty(t,"assertOutputType",{enumerable:!0,get:function(){return o.assertOutputType}}),Object.defineProperty(t,"assertScalarType",{enumerable:!0,get:function(){return o.assertScalarType}}),Object.defineProperty(t,"assertSchema",{enumerable:!0,get:function(){return o.assertSchema}}),Object.defineProperty(t,"assertType",{enumerable:!0,get:function(){return o.assertType}}),Object.defineProperty(t,"assertUnionType",{enumerable:!0,get:function(){return o.assertUnionType}}),Object.defineProperty(t,"assertValidName",{enumerable:!0,get:function(){return u.assertValidName}}),Object.defineProperty(t,"assertValidSchema",{enumerable:!0,get:function(){return o.assertValidSchema}}),Object.defineProperty(t,"assertWrappingType",{enumerable:!0,get:function(){return o.assertWrappingType}}),Object.defineProperty(t,"astFromValue",{enumerable:!0,get:function(){return u.astFromValue}}),Object.defineProperty(t,"buildASTSchema",{enumerable:!0,get:function(){return u.buildASTSchema}}),Object.defineProperty(t,"buildClientSchema",{enumerable:!0,get:function(){return u.buildClientSchema}}),Object.defineProperty(t,"buildSchema",{enumerable:!0,get:function(){return u.buildSchema}}),Object.defineProperty(t,"coerceInputValue",{enumerable:!0,get:function(){return u.coerceInputValue}}),Object.defineProperty(t,"concatAST",{enumerable:!0,get:function(){return u.concatAST}}),Object.defineProperty(t,"createSourceEventStream",{enumerable:!0,get:function(){return s.createSourceEventStream}}),Object.defineProperty(t,"defaultFieldResolver",{enumerable:!0,get:function(){return s.defaultFieldResolver}}),Object.defineProperty(t,"defaultTypeResolver",{enumerable:!0,get:function(){return s.defaultTypeResolver}}),Object.defineProperty(t,"doTypesOverlap",{enumerable:!0,get:function(){return u.doTypesOverlap}}),Object.defineProperty(t,"execute",{enumerable:!0,get:function(){return s.execute}}),Object.defineProperty(t,"executeSync",{enumerable:!0,get:function(){return s.executeSync}}),Object.defineProperty(t,"extendSchema",{enumerable:!0,get:function(){return u.extendSchema}}),Object.defineProperty(t,"findBreakingChanges",{enumerable:!0,get:function(){return u.findBreakingChanges}}),Object.defineProperty(t,"findDangerousChanges",{enumerable:!0,get:function(){return u.findDangerousChanges}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return l.formatError}}),Object.defineProperty(t,"getArgumentValues",{enumerable:!0,get:function(){return s.getArgumentValues}}),Object.defineProperty(t,"getDirectiveValues",{enumerable:!0,get:function(){return s.getDirectiveValues}}),Object.defineProperty(t,"getEnterLeaveForKind",{enumerable:!0,get:function(){return a.getEnterLeaveForKind}}),Object.defineProperty(t,"getIntrospectionQuery",{enumerable:!0,get:function(){return u.getIntrospectionQuery}}),Object.defineProperty(t,"getLocation",{enumerable:!0,get:function(){return a.getLocation}}),Object.defineProperty(t,"getNamedType",{enumerable:!0,get:function(){return o.getNamedType}}),Object.defineProperty(t,"getNullableType",{enumerable:!0,get:function(){return o.getNullableType}}),Object.defineProperty(t,"getOperationAST",{enumerable:!0,get:function(){return u.getOperationAST}}),Object.defineProperty(t,"getOperationRootType",{enumerable:!0,get:function(){return u.getOperationRootType}}),Object.defineProperty(t,"getVariableValues",{enumerable:!0,get:function(){return s.getVariableValues}}),Object.defineProperty(t,"getVisitFn",{enumerable:!0,get:function(){return a.getVisitFn}}),Object.defineProperty(t,"graphql",{enumerable:!0,get:function(){return i.graphql}}),Object.defineProperty(t,"graphqlSync",{enumerable:!0,get:function(){return i.graphqlSync}}),Object.defineProperty(t,"introspectionFromSchema",{enumerable:!0,get:function(){return u.introspectionFromSchema}}),Object.defineProperty(t,"introspectionTypes",{enumerable:!0,get:function(){return o.introspectionTypes}}),Object.defineProperty(t,"isAbstractType",{enumerable:!0,get:function(){return o.isAbstractType}}),Object.defineProperty(t,"isCompositeType",{enumerable:!0,get:function(){return o.isCompositeType}}),Object.defineProperty(t,"isConstValueNode",{enumerable:!0,get:function(){return a.isConstValueNode}}),Object.defineProperty(t,"isDefinitionNode",{enumerable:!0,get:function(){return a.isDefinitionNode}}),Object.defineProperty(t,"isDirective",{enumerable:!0,get:function(){return o.isDirective}}),Object.defineProperty(t,"isEnumType",{enumerable:!0,get:function(){return o.isEnumType}}),Object.defineProperty(t,"isEqualType",{enumerable:!0,get:function(){return u.isEqualType}}),Object.defineProperty(t,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return a.isExecutableDefinitionNode}}),Object.defineProperty(t,"isInputObjectType",{enumerable:!0,get:function(){return o.isInputObjectType}}),Object.defineProperty(t,"isInputType",{enumerable:!0,get:function(){return o.isInputType}}),Object.defineProperty(t,"isInterfaceType",{enumerable:!0,get:function(){return o.isInterfaceType}}),Object.defineProperty(t,"isIntrospectionType",{enumerable:!0,get:function(){return o.isIntrospectionType}}),Object.defineProperty(t,"isLeafType",{enumerable:!0,get:function(){return o.isLeafType}}),Object.defineProperty(t,"isListType",{enumerable:!0,get:function(){return o.isListType}}),Object.defineProperty(t,"isNamedType",{enumerable:!0,get:function(){return o.isNamedType}}),Object.defineProperty(t,"isNonNullType",{enumerable:!0,get:function(){return o.isNonNullType}}),Object.defineProperty(t,"isNullableType",{enumerable:!0,get:function(){return o.isNullableType}}),Object.defineProperty(t,"isObjectType",{enumerable:!0,get:function(){return o.isObjectType}}),Object.defineProperty(t,"isOutputType",{enumerable:!0,get:function(){return o.isOutputType}}),Object.defineProperty(t,"isRequiredArgument",{enumerable:!0,get:function(){return o.isRequiredArgument}}),Object.defineProperty(t,"isRequiredInputField",{enumerable:!0,get:function(){return o.isRequiredInputField}}),Object.defineProperty(t,"isScalarType",{enumerable:!0,get:function(){return o.isScalarType}}),Object.defineProperty(t,"isSchema",{enumerable:!0,get:function(){return o.isSchema}}),Object.defineProperty(t,"isSelectionNode",{enumerable:!0,get:function(){return a.isSelectionNode}}),Object.defineProperty(t,"isSpecifiedDirective",{enumerable:!0,get:function(){return o.isSpecifiedDirective}}),Object.defineProperty(t,"isSpecifiedScalarType",{enumerable:!0,get:function(){return o.isSpecifiedScalarType}}),Object.defineProperty(t,"isType",{enumerable:!0,get:function(){return o.isType}}),Object.defineProperty(t,"isTypeDefinitionNode",{enumerable:!0,get:function(){return a.isTypeDefinitionNode}}),Object.defineProperty(t,"isTypeExtensionNode",{enumerable:!0,get:function(){return a.isTypeExtensionNode}}),Object.defineProperty(t,"isTypeNode",{enumerable:!0,get:function(){return a.isTypeNode}}),Object.defineProperty(t,"isTypeSubTypeOf",{enumerable:!0,get:function(){return u.isTypeSubTypeOf}}),Object.defineProperty(t,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return a.isTypeSystemDefinitionNode}}),Object.defineProperty(t,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return a.isTypeSystemExtensionNode}}),Object.defineProperty(t,"isUnionType",{enumerable:!0,get:function(){return o.isUnionType}}),Object.defineProperty(t,"isValidNameError",{enumerable:!0,get:function(){return u.isValidNameError}}),Object.defineProperty(t,"isValueNode",{enumerable:!0,get:function(){return a.isValueNode}}),Object.defineProperty(t,"isWrappingType",{enumerable:!0,get:function(){return o.isWrappingType}}),Object.defineProperty(t,"lexicographicSortSchema",{enumerable:!0,get:function(){return u.lexicographicSortSchema}}),Object.defineProperty(t,"locatedError",{enumerable:!0,get:function(){return l.locatedError}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.parse}}),Object.defineProperty(t,"parseConstValue",{enumerable:!0,get:function(){return a.parseConstValue}}),Object.defineProperty(t,"parseType",{enumerable:!0,get:function(){return a.parseType}}),Object.defineProperty(t,"parseValue",{enumerable:!0,get:function(){return a.parseValue}}),Object.defineProperty(t,"print",{enumerable:!0,get:function(){return a.print}}),Object.defineProperty(t,"printError",{enumerable:!0,get:function(){return l.printError}}),Object.defineProperty(t,"printIntrospectionSchema",{enumerable:!0,get:function(){return u.printIntrospectionSchema}}),Object.defineProperty(t,"printLocation",{enumerable:!0,get:function(){return a.printLocation}}),Object.defineProperty(t,"printSchema",{enumerable:!0,get:function(){return u.printSchema}}),Object.defineProperty(t,"printSourceLocation",{enumerable:!0,get:function(){return a.printSourceLocation}}),Object.defineProperty(t,"printType",{enumerable:!0,get:function(){return u.printType}}),Object.defineProperty(t,"resolveObjMapThunk",{enumerable:!0,get:function(){return o.resolveObjMapThunk}}),Object.defineProperty(t,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return o.resolveReadonlyArrayThunk}}),Object.defineProperty(t,"responsePathAsArray",{enumerable:!0,get:function(){return s.responsePathAsArray}}),Object.defineProperty(t,"separateOperations",{enumerable:!0,get:function(){return u.separateOperations}}),Object.defineProperty(t,"specifiedDirectives",{enumerable:!0,get:function(){return o.specifiedDirectives}}),Object.defineProperty(t,"specifiedRules",{enumerable:!0,get:function(){return c.specifiedRules}}),Object.defineProperty(t,"specifiedScalarTypes",{enumerable:!0,get:function(){return o.specifiedScalarTypes}}),Object.defineProperty(t,"stripIgnoredCharacters",{enumerable:!0,get:function(){return u.stripIgnoredCharacters}}),Object.defineProperty(t,"subscribe",{enumerable:!0,get:function(){return s.subscribe}}),Object.defineProperty(t,"syntaxError",{enumerable:!0,get:function(){return l.syntaxError}}),Object.defineProperty(t,"typeFromAST",{enumerable:!0,get:function(){return u.typeFromAST}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return c.validate}}),Object.defineProperty(t,"validateSchema",{enumerable:!0,get:function(){return o.validateSchema}}),Object.defineProperty(t,"valueFromAST",{enumerable:!0,get:function(){return u.valueFromAST}}),Object.defineProperty(t,"valueFromASTUntyped",{enumerable:!0,get:function(){return u.valueFromASTUntyped}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return r.version}}),Object.defineProperty(t,"versionInfo",{enumerable:!0,get:function(){return r.versionInfo}}),Object.defineProperty(t,"visit",{enumerable:!0,get:function(){return a.visit}}),Object.defineProperty(t,"visitInParallel",{enumerable:!0,get:function(){return a.visitInParallel}}),Object.defineProperty(t,"visitWithTypeInfo",{enumerable:!0,get:function(){return u.visitWithTypeInfo}});var r=n(8696),i=n(9728),o=n(3226),a=n(2178),s=n(9931),c=n(1122),l=n(6972),u=n(9548)},7059:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPath=function(e,t,n){return{prev:e,key:t,typename:n}},t.pathToArray=function(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}},7242:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.devAssert=function(e,t){if(!Boolean(e))throw new Error(t)}},166:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.didYouMean=function(e,t){const[n,r]=t?[e,t]:[void 0,e];let i=" Did you mean ";n&&(i+=n+" ");const o=r.map((e=>`"${e}"`));switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}const a=o.slice(0,5),s=a.pop();return i+a.join(", ")+", or "+s+"?"}},4620:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=function(e,t){const n=new Map;for(const r of e){const e=t(r),i=n.get(e);void 0===i?n.set(e,[r]):i.push(r)}return n}},3317:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identityFunc=function(e){return e}},8002:function(e,t){"use strict";function n(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:n(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const r=Math.min(10,e.length),i=e.length-r,o=[];for(let i=0;i1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const i=r.map((([e,r])=>e+": "+n(r,t)));return"{ "+i.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.inspect=function(e){return n(e,[])}},5752:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.instanceOf=void 0;var r=n(8002);const i=globalThis.process&&"production"===globalThis.process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const i=t.prototype[Symbol.toStringTag];if(i===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){const t=(0,r.inspect)(e);throw new Error(`Cannot use ${i} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};t.instanceOf=i},7706:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8648:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=function(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}},6609:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterableObject=function(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}},5690:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}},4221:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=function(e){return"function"==typeof(null==e?void 0:e.then)}},2863:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyMap=function(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}},7154:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyValMap=function(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}},6124:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapValue=function(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}},5456:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memoize3=function(e){let t;return function(n,r,i){void 0===t&&(t=new WeakMap);let o=t.get(n);void 0===o&&(o=new WeakMap,t.set(n,o));let a=o.get(r);void 0===a&&(a=new WeakMap,o.set(r,a));let s=a.get(i);return void 0===s&&(s=e(n,r,i),a.set(i,s)),s}}},5250:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.naturalCompare=function(e,t){let i=0,o=0;for(;i0);let l=0;do{++o,l=10*l+s-n,s=t.charCodeAt(o)}while(r(s)&&l>0);if(cl)return 1}else{if(as)return 1;++i,++o}}return e.length-t.length};const n=48;function r(e){return!isNaN(e)&&n<=e&&e<=57}},737:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printPathArray=function(e){return e.map((e=>"number"==typeof e?"["+e.toString()+"]":"."+e)).join("")}},3179:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseForObject=function(e){return Promise.all(Object.values(e)).then((t=>{const n=Object.create(null);for(const[r,i]of Object.keys(e).entries())n[i]=t[r];return n}))}},9915:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseReduce=function(e,t,n){let i=n;for(const n of e)i=(0,r.isPromise)(i)?i.then((e=>t(e,n))):t(i,n);return i};var r=n(4221)},8070:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.suggestionList=function(e,t){const n=Object.create(null),o=new i(e),a=Math.floor(.4*e.length)+1;for(const e of t){const t=o.measure(e,a);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const i=n[e]-n[t];return 0!==i?i:(0,r.naturalCompare)(e,t)}))};var r=n(5250);class i{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=o(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=o(n),i=this._inputArray;if(r.lengtht)return;const c=this._rows;for(let e=0;e<=s;e++)c[0][e]=e;for(let e=1;e<=a;e++){const n=c[(e-1)%3],o=c[e%3];let a=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let l=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=c[(e-2)%3][t-2];l=Math.min(l,n+1)}lt)return}const l=c[a%3][s];return l<=t?l:void 0}}function o(e){const t=e.length,n=new Array(t);for(let r=0;r0===t?e:e.slice(n))).slice(null!==(t=r)&&void 0!==t?t:0,o+1)},t.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,n=!1,r=!0,i=!1;for(let o=0;o1&&i.slice(1).every((e=>0===e.length||(0,r.isWhiteSpace)(e.charCodeAt(0)))),s=n.endsWith('\\"""'),c=e.endsWith('"')&&!s,l=e.endsWith("\\"),u=c||l,p=!(null!=t&&t.minimize)&&(!o||e.length>70||u||a||s);let f="";const d=o&&(0,r.isWhiteSpace)(e.charCodeAt(0));return(p&&!d||a)&&(f+="\n"),f+=n,(p||u)&&(f+="\n"),'"""'+f+'"""'};var r=n(100);function i(e){let t=0;for(;t=48&&e<=57}function r(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(t,"__esModule",{value:!0}),t.isDigit=n,t.isLetter=r,t.isNameContinue=function(e){return r(e)||n(e)||95===e},t.isNameStart=function(e){return r(e)||95===e},t.isWhiteSpace=function(e){return 9===e||32===e}},8333:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0,t.DirectiveLocation=n,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(t.DirectiveLocation=n={}))},2178:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BREAK",{enumerable:!0,get:function(){return p.BREAK}}),Object.defineProperty(t,"DirectiveLocation",{enumerable:!0,get:function(){return h.DirectiveLocation}}),Object.defineProperty(t,"Kind",{enumerable:!0,get:function(){return a.Kind}}),Object.defineProperty(t,"Lexer",{enumerable:!0,get:function(){return c.Lexer}}),Object.defineProperty(t,"Location",{enumerable:!0,get:function(){return f.Location}}),Object.defineProperty(t,"OperationTypeNode",{enumerable:!0,get:function(){return f.OperationTypeNode}}),Object.defineProperty(t,"Source",{enumerable:!0,get:function(){return r.Source}}),Object.defineProperty(t,"Token",{enumerable:!0,get:function(){return f.Token}}),Object.defineProperty(t,"TokenKind",{enumerable:!0,get:function(){return s.TokenKind}}),Object.defineProperty(t,"getEnterLeaveForKind",{enumerable:!0,get:function(){return p.getEnterLeaveForKind}}),Object.defineProperty(t,"getLocation",{enumerable:!0,get:function(){return i.getLocation}}),Object.defineProperty(t,"getVisitFn",{enumerable:!0,get:function(){return p.getVisitFn}}),Object.defineProperty(t,"isConstValueNode",{enumerable:!0,get:function(){return d.isConstValueNode}}),Object.defineProperty(t,"isDefinitionNode",{enumerable:!0,get:function(){return d.isDefinitionNode}}),Object.defineProperty(t,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return d.isExecutableDefinitionNode}}),Object.defineProperty(t,"isSelectionNode",{enumerable:!0,get:function(){return d.isSelectionNode}}),Object.defineProperty(t,"isTypeDefinitionNode",{enumerable:!0,get:function(){return d.isTypeDefinitionNode}}),Object.defineProperty(t,"isTypeExtensionNode",{enumerable:!0,get:function(){return d.isTypeExtensionNode}}),Object.defineProperty(t,"isTypeNode",{enumerable:!0,get:function(){return d.isTypeNode}}),Object.defineProperty(t,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return d.isTypeSystemDefinitionNode}}),Object.defineProperty(t,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return d.isTypeSystemExtensionNode}}),Object.defineProperty(t,"isValueNode",{enumerable:!0,get:function(){return d.isValueNode}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return l.parse}}),Object.defineProperty(t,"parseConstValue",{enumerable:!0,get:function(){return l.parseConstValue}}),Object.defineProperty(t,"parseType",{enumerable:!0,get:function(){return l.parseType}}),Object.defineProperty(t,"parseValue",{enumerable:!0,get:function(){return l.parseValue}}),Object.defineProperty(t,"print",{enumerable:!0,get:function(){return u.print}}),Object.defineProperty(t,"printLocation",{enumerable:!0,get:function(){return o.printLocation}}),Object.defineProperty(t,"printSourceLocation",{enumerable:!0,get:function(){return o.printSourceLocation}}),Object.defineProperty(t,"visit",{enumerable:!0,get:function(){return p.visit}}),Object.defineProperty(t,"visitInParallel",{enumerable:!0,get:function(){return p.visitInParallel}});var r=n(2412),i=n(9016),o=n(8038),a=n(2828),s=n(3175),c=n(4274),l=n(8370),u=n(3033),p=n(285),f=n(1807),d=n(1352),h=n(8333)},2828:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0,t.Kind=n,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(t.Kind=n={}))},4274:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=void 0,t.isPunctuatorTokenKind=function(e){return e===s.TokenKind.BANG||e===s.TokenKind.DOLLAR||e===s.TokenKind.AMP||e===s.TokenKind.PAREN_L||e===s.TokenKind.PAREN_R||e===s.TokenKind.SPREAD||e===s.TokenKind.COLON||e===s.TokenKind.EQUALS||e===s.TokenKind.AT||e===s.TokenKind.BRACKET_L||e===s.TokenKind.BRACKET_R||e===s.TokenKind.BRACE_L||e===s.TokenKind.PIPE||e===s.TokenKind.BRACE_R};var r=n(338),i=n(1807),o=n(849),a=n(100),s=n(3175);class c{constructor(e){const t=new i.Token(s.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==s.TokenKind.EOF)do{if(e.next)e=e.next;else{const t=m(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===s.TokenKind.COMMENT);return e}}function l(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function u(e,t){return p(e.charCodeAt(t))&&f(e.charCodeAt(t+1))}function p(e){return e>=55296&&e<=56319}function f(e){return e>=56320&&e<=57343}function d(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return s.TokenKind.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function h(e,t,n,r,o){const a=e.line,s=1+n-e.lineStart;return new i.Token(t,n,r,a,s,o)}function m(e,t){const n=e.source.body,i=n.length;let o=t;for(;o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function k(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,r.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function O(e,t){const n=e.source.body,i=n.length;let a=e.lineStart,c=t+3,p=c,f="";const m=[];for(;c=t)break;n=a.index+a[0].length,o+=1}return{line:o,column:t+1-n}};var r=n(7706);const i=/\r\n|[\n\r]/g},8370:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0,t.parse=function(e,t){return new u(e,t).parseDocument()},t.parseConstValue=function(e,t){const n=new u(e,t);n.expectToken(l.TokenKind.SOF);const r=n.parseConstValueLiteral();return n.expectToken(l.TokenKind.EOF),r},t.parseType=function(e,t){const n=new u(e,t);n.expectToken(l.TokenKind.SOF);const r=n.parseTypeReference();return n.expectToken(l.TokenKind.EOF),r},t.parseValue=function(e,t){const n=new u(e,t);n.expectToken(l.TokenKind.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(l.TokenKind.EOF),r};var r=n(338),i=n(1807),o=n(8333),a=n(2828),s=n(4274),c=n(2412),l=n(3175);class u{constructor(e,t={}){const n=(0,c.isSource)(e)?e:new c.Source(e);this._lexer=new s.Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(l.TokenKind.NAME);return this.node(e,{kind:a.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:a.Kind.DOCUMENT,definitions:this.many(l.TokenKind.SOF,this.parseDefinition,l.TokenKind.EOF)})}parseDefinition(){if(this.peek(l.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===l.TokenKind.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(l.TokenKind.BRACE_L))return this.node(e,{kind:a.Kind.OPERATION_DEFINITION,operation:i.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(l.TokenKind.NAME)&&(n=this.parseName()),this.node(e,{kind:a.Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(l.TokenKind.NAME);switch(e.value){case"query":return i.OperationTypeNode.QUERY;case"mutation":return i.OperationTypeNode.MUTATION;case"subscription":return i.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(l.TokenKind.PAREN_L,this.parseVariableDefinition,l.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:a.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(l.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(l.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(l.TokenKind.DOLLAR),this.node(e,{kind:a.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:a.Kind.SELECTION_SET,selections:this.many(l.TokenKind.BRACE_L,this.parseSelection,l.TokenKind.BRACE_R)})}parseSelection(){return this.peek(l.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(l.TokenKind.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:a.Kind.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(l.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(l.TokenKind.PAREN_L,t,l.TokenKind.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(l.TokenKind.COLON),this.node(t,{kind:a.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(l.TokenKind.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(l.TokenKind.NAME)?this.node(e,{kind:a.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:a.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case l.TokenKind.BRACKET_L:return this.parseList(e);case l.TokenKind.BRACE_L:return this.parseObject(e);case l.TokenKind.INT:return this.advanceLexer(),this.node(t,{kind:a.Kind.INT,value:t.value});case l.TokenKind.FLOAT:return this.advanceLexer(),this.node(t,{kind:a.Kind.FLOAT,value:t.value});case l.TokenKind.STRING:case l.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case l.TokenKind.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:a.Kind.BOOLEAN,value:!0});case"false":return this.node(t,{kind:a.Kind.BOOLEAN,value:!1});case"null":return this.node(t,{kind:a.Kind.NULL});default:return this.node(t,{kind:a.Kind.ENUM,value:t.value})}case l.TokenKind.DOLLAR:if(e){if(this.expectToken(l.TokenKind.DOLLAR),this._lexer.token.kind===l.TokenKind.NAME){const e=this._lexer.token.value;throw(0,r.syntaxError)(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:a.Kind.STRING,value:e.value,block:e.kind===l.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:a.Kind.LIST,values:this.any(l.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),l.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:a.Kind.OBJECT,fields:this.any(l.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),l.TokenKind.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(l.TokenKind.COLON),this.node(t,{kind:a.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(l.TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(l.TokenKind.AT),this.node(t,{kind:a.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(l.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(l.TokenKind.BRACKET_R),t=this.node(e,{kind:a.Kind.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(l.TokenKind.BANG)?this.node(e,{kind:a.Kind.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:a.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(l.TokenKind.STRING)||this.peek(l.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(l.TokenKind.BRACE_L,this.parseOperationTypeDefinition,l.TokenKind.BRACE_R);return this.node(e,{kind:a.Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(l.TokenKind.COLON);const n=this.parseNamedType();return this.node(e,{kind:a.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:a.Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(l.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(l.TokenKind.BRACE_L,this.parseFieldDefinition,l.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(l.TokenKind.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:a.Kind.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(l.TokenKind.PAREN_L,this.parseInputValueDef,l.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(l.TokenKind.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(l.TokenKind.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:a.Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:a.Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(l.TokenKind.EQUALS)?this.delimitedMany(l.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:a.Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(l.TokenKind.BRACE_L,this.parseEnumValueDefinition,l.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:a.Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,`${p(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:a.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(l.TokenKind.BRACE_L,this.parseInputValueDef,l.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===l.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(l.TokenKind.BRACE_L,this.parseOperationTypeDefinition,l.TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:a.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:a.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(l.TokenKind.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:a.Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(l.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(o.DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new i.Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw(0,r.syntaxError)(this._lexer.source,t.start,`Expected ${f(e)}, found ${p(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==l.TokenKind.NAME||t.value!==e)throw(0,r.syntaxError)(this._lexer.source,t.start,`Expected "${e}", found ${p(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===l.TokenKind.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,r.syntaxError)(this._lexer.source,t.start,`Unexpected ${p(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==l.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,r.syntaxError)(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function p(e){const t=e.value;return f(e.kind)+(null!=t?` "${t}"`:"")}function f(e){return(0,s.isPunctuatorTokenKind)(e)?`"${e}"`:e}t.Parser=u},1352:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isConstValueNode=function e(t){return o(t)&&(t.kind===r.Kind.LIST?t.values.some(e):t.kind===r.Kind.OBJECT?t.fields.some((t=>e(t.value))):t.kind!==r.Kind.VARIABLE)},t.isDefinitionNode=function(e){return i(e)||a(e)||c(e)},t.isExecutableDefinitionNode=i,t.isSelectionNode=function(e){return e.kind===r.Kind.FIELD||e.kind===r.Kind.FRAGMENT_SPREAD||e.kind===r.Kind.INLINE_FRAGMENT},t.isTypeDefinitionNode=s,t.isTypeExtensionNode=l,t.isTypeNode=function(e){return e.kind===r.Kind.NAMED_TYPE||e.kind===r.Kind.LIST_TYPE||e.kind===r.Kind.NON_NULL_TYPE},t.isTypeSystemDefinitionNode=a,t.isTypeSystemExtensionNode=c,t.isValueNode=o;var r=n(2828);function i(e){return e.kind===r.Kind.OPERATION_DEFINITION||e.kind===r.Kind.FRAGMENT_DEFINITION}function o(e){return e.kind===r.Kind.VARIABLE||e.kind===r.Kind.INT||e.kind===r.Kind.FLOAT||e.kind===r.Kind.STRING||e.kind===r.Kind.BOOLEAN||e.kind===r.Kind.NULL||e.kind===r.Kind.ENUM||e.kind===r.Kind.LIST||e.kind===r.Kind.OBJECT}function a(e){return e.kind===r.Kind.SCHEMA_DEFINITION||s(e)||e.kind===r.Kind.DIRECTIVE_DEFINITION}function s(e){return e.kind===r.Kind.SCALAR_TYPE_DEFINITION||e.kind===r.Kind.OBJECT_TYPE_DEFINITION||e.kind===r.Kind.INTERFACE_TYPE_DEFINITION||e.kind===r.Kind.UNION_TYPE_DEFINITION||e.kind===r.Kind.ENUM_TYPE_DEFINITION||e.kind===r.Kind.INPUT_OBJECT_TYPE_DEFINITION}function c(e){return e.kind===r.Kind.SCHEMA_EXTENSION||l(e)}function l(e){return e.kind===r.Kind.SCALAR_TYPE_EXTENSION||e.kind===r.Kind.OBJECT_TYPE_EXTENSION||e.kind===r.Kind.INTERFACE_TYPE_EXTENSION||e.kind===r.Kind.UNION_TYPE_EXTENSION||e.kind===r.Kind.ENUM_TYPE_EXTENSION||e.kind===r.Kind.INPUT_OBJECT_TYPE_EXTENSION}},8038:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return i(e.source,(0,r.getLocation)(e.source,e.start))},t.printSourceLocation=i;var r=n(9016);function i(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,s=t.line+a,c=1===t.line?n:0,l=t.column+c,u=`${e.name}:${s}:${l}\n`,p=r.split(/\r\n|[\n\r]/g),f=p[i];if(f.length>120){const e=Math.floor(l/80),t=l%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+o([[s-1+" |",p[i-1]],[`${s} |`,f],["|","^".padStart(l)],[`${s+1} |`,p[i+1]]])}function o(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}},8942:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printString=function(e){return`"${e.replace(n,r)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function r(e){return i[e.charCodeAt(0)]}const i=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]},3033:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,o.visit)(e,a)};var r=n(849),i=n(8942),o=n(285);const a={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>s(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=l("(",s(e.variableDefinitions,", "),")"),n=s([e.operation,s([e.name,t]),s(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+l(" = ",n)+l(" ",s(r," "))},SelectionSet:{leave:({selections:e})=>c(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=l("",e,": ")+t;let a=o+l("(",s(n,", "),")");return a.length>80&&(a=o+l("(\n",u(s(n,"\n")),"\n)")),s([a,s(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+l(" ",s(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>s(["...",l("on ",e),s(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${l("(",s(n,", "),")")} on ${t} ${l("",s(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,r.printBlockString)(e):(0,i.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+s(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+s(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+l("(",s(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>l("",e,"\n")+s(["schema",s(t," "),c(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>l("",e,"\n")+s(["scalar",t,s(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>l("",e,"\n")+s(["type",t,l("implements ",s(n," & ")),s(r," "),c(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>l("",e,"\n")+t+(p(n)?l("(\n",u(s(n,"\n")),"\n)"):l("(",s(n,", "),")"))+": "+r+l(" ",s(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>l("",e,"\n")+s([t+": "+n,l("= ",r),s(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>l("",e,"\n")+s(["interface",t,l("implements ",s(n," & ")),s(r," "),c(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>l("",e,"\n")+s(["union",t,s(n," "),l("= ",s(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>l("",e,"\n")+s(["enum",t,s(n," "),c(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>l("",e,"\n")+s([t,s(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>l("",e,"\n")+s(["input",t,s(n," "),c(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>l("",e,"\n")+"directive @"+t+(p(n)?l("(\n",u(s(n,"\n")),"\n)"):l("(",s(n,", "),")"))+(r?" repeatable":"")+" on "+s(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>s(["extend schema",s(e," "),c(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>s(["extend scalar",e,s(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>s(["extend type",e,l("implements ",s(t," & ")),s(n," "),c(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>s(["extend interface",e,l("implements ",s(t," & ")),s(n," "),c(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>s(["extend union",e,s(t," "),l("= ",s(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>s(["extend enum",e,s(t," "),c(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>s(["extend input",e,s(t," "),c(n)]," ")}};function s(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function c(e){return l("{\n",u(s(e,"\n")),"\n}")}function l(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function u(e){return l(" ",e.replace(/\n/g,"\n "))}function p(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}},2412:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0,t.isSource=function(e){return(0,o.instanceOf)(e,a)};var r=n(7242),i=n(8002),o=n(5752);class a{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,r.devAssert)(!1,`Body must be a string. Received: ${(0,i.inspect)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,r.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,r.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}t.Source=a},3175:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.TokenKind=n,function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(n||(t.TokenKind=n={}))},285:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAK=void 0,t.getEnterLeaveForKind=c,t.getVisitFn=function(e,t,n){const{enter:r,leave:i}=c(e,t);return n?i:r},t.visit=function(e,t,n=o.QueryDocumentKeys){const l=new Map;for(const e of Object.values(a.Kind))l.set(e,c(t,e));let u,p,f,d=Array.isArray(e),h=[e],m=-1,v=[],y=e;const g=[],b=[];do{m++;const e=m===h.length,a=e&&0!==v.length;if(e){if(p=0===b.length?void 0:g[g.length-1],y=f,f=b.pop(),a)if(d){y=y.slice();let e=0;for(const[t,n]of v){const r=t-e;null===n?(y.splice(r,1),e++):y[r]=n}}else{y=Object.defineProperties({},Object.getOwnPropertyDescriptors(y));for(const[e,t]of v)y[e]=t}m=u.index,h=u.keys,v=u.edits,d=u.inArray,u=u.prev}else if(f){if(p=d?m:h[m],y=f[p],null==y)continue;g.push(p)}let c;if(!Array.isArray(y)){var E,w;(0,o.isNode)(y)||(0,r.devAssert)(!1,`Invalid AST Node: ${(0,i.inspect)(y)}.`);const n=e?null===(E=l.get(y.kind))||void 0===E?void 0:E.leave:null===(w=l.get(y.kind))||void 0===w?void 0:w.enter;if(c=null==n?void 0:n.call(t,y,p,f,g,b),c===s)break;if(!1===c){if(!e){g.pop();continue}}else if(void 0!==c&&(v.push([p,c]),!e)){if(!(0,o.isNode)(c)){g.pop();continue}y=c}}var T;void 0===c&&a&&v.push([p,y]),e?g.pop():(u={inArray:d,index:m,keys:h,edits:v,prev:u},d=Array.isArray(y),h=d?y:null!==(T=n[y.kind])&&void 0!==T?T:[],m=-1,v=[],f&&b.push(f),f=y)}while(void 0!==u);return 0!==v.length?v[v.length-1][1]:e},t.visitInParallel=function(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const r of Object.values(a.Kind)){let i=!1;const o=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let t=0;tc((0,y.valueFromASTUntyped)(e,t)),this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(s=e.extensionASTNodes)&&void 0!==s?s:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,r.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,a.inspect)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,r.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,r.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}t.GraphQLScalarType=Q;class q{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=()=>G(e),this._interfaces=()=>U(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,r.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,a.inspect)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:z(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function U(e){var t;const n=F(null!==(t=e.interfaces)&&void 0!==t?t:[]);return Array.isArray(n)||(0,r.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function G(e){const t=V(e.fields);return K(t)||(0,r.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,p.mapValue)(t,((t,n)=>{var i;K(t)||(0,r.devAssert)(!1,`${e.name}.${n} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,r.devAssert)(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${(0,a.inspect)(t.resolve)}.`);const o=null!==(i=t.args)&&void 0!==i?i:{};return K(o)||(0,r.devAssert)(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:(0,g.assertName)(n),description:t.description,type:t.type,args:B(o),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:(0,d.toObjMap)(t.extensions),astNode:t.astNode}}))}function B(e){return Object.entries(e).map((([e,t])=>({name:(0,g.assertName)(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,d.toObjMap)(t.extensions),astNode:t.astNode})))}function K(e){return(0,c.isObjectLike)(e)&&!Array.isArray(e)}function z(e){return(0,p.mapValue)(e,(e=>({description:e.description,type:e.type,args:$(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function $(e){return(0,u.keyValMap)(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}t.GraphQLObjectType=q;class H{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=G.bind(void 0,e),this._interfaces=U.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:z(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}t.GraphQLInterfaceType=H;class W{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._types=Y.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Y(e){const t=F(e.types);return Array.isArray(t)||(0,r.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}t.GraphQLUnionType=W;class J{constructor(e){var t,n,i;this.name=(0,g.assertName)(e.name),this.description=e.description,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._values=(n=this.name,K(i=e.values)||(0,r.devAssert)(!1,`${n} values must be an object with value names as keys.`),Object.entries(i).map((([e,t])=>(K(t)||(0,r.devAssert)(!1,`${n}.${e} must refer to an object with a "value" key representing an internal value but got: ${(0,a.inspect)(t)}.`),{name:(0,g.assertEnumValueName)(e),description:t.description,value:void 0!==t.value?t.value:e,deprecationReason:t.deprecationReason,extensions:(0,d.toObjMap)(t.extensions),astNode:t.astNode})))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=(0,l.keyMap)(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new h.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,a.inspect)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=(0,a.inspect)(e);throw new h.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${t}.`+X(this,t))}const t=this.getValue(e);if(null==t)throw new h.GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+X(this,e));return t.value}parseLiteral(e,t){if(e.kind!==m.Kind.ENUM){const t=(0,v.print)(e);throw new h.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+X(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=(0,v.print)(e);throw new h.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+X(this,t),{nodes:e})}return n.value}toConfig(){const e=(0,u.keyValMap)(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function X(e,t){const n=e.getValues().map((e=>e.name)),r=(0,f.suggestionList)(t,n);return(0,i.didYouMean)("the enum value",r)}t.GraphQLEnumType=J;class Z{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=ee.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=(0,p.mapValue)(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ee(e){const t=V(e.fields);return K(t)||(0,r.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,p.mapValue)(t,((t,n)=>(!("resolve"in t)||(0,r.devAssert)(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,g.assertName)(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,d.toObjMap)(t.extensions),astNode:t.astNode})))}t.GraphQLInputObjectType=Z},7197:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLSpecifiedByDirective=t.GraphQLSkipDirective=t.GraphQLIncludeDirective=t.GraphQLDirective=t.GraphQLDeprecatedDirective=t.DEFAULT_DEPRECATION_REASON=void 0,t.assertDirective=function(e){if(!f(e))throw new Error(`Expected ${(0,i.inspect)(e)} to be a GraphQL directive.`);return e},t.isDirective=f,t.isSpecifiedDirective=function(e){return b.some((({name:t})=>t===e.name))},t.specifiedDirectives=void 0;var r=n(7242),i=n(8002),o=n(5752),a=n(5690),s=n(7690),c=n(8333),l=n(3058),u=n(5003),p=n(2229);function f(e){return(0,o.instanceOf)(e,d)}class d{constructor(e){var t,n;this.name=(0,l.assertName)(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!==(t=e.isRepeatable)&&void 0!==t&&t,this.extensions=(0,s.toObjMap)(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,r.devAssert)(!1,`@${e.name} locations must be an Array.`);const i=null!==(n=e.args)&&void 0!==n?n:{};(0,a.isObjectLike)(i)&&!Array.isArray(i)||(0,r.devAssert)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=(0,u.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,u.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}t.GraphQLDirective=d;const h=new d({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[c.DirectiveLocation.FIELD,c.DirectiveLocation.FRAGMENT_SPREAD,c.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new u.GraphQLNonNull(p.GraphQLBoolean),description:"Included when true."}}});t.GraphQLIncludeDirective=h;const m=new d({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[c.DirectiveLocation.FIELD,c.DirectiveLocation.FRAGMENT_SPREAD,c.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new u.GraphQLNonNull(p.GraphQLBoolean),description:"Skipped when true."}}});t.GraphQLSkipDirective=m;const v="No longer supported";t.DEFAULT_DEPRECATION_REASON=v;const y=new d({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[c.DirectiveLocation.FIELD_DEFINITION,c.DirectiveLocation.ARGUMENT_DEFINITION,c.DirectiveLocation.INPUT_FIELD_DEFINITION,c.DirectiveLocation.ENUM_VALUE],args:{reason:{type:p.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:v}}});t.GraphQLDeprecatedDirective=y;const g=new d({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[c.DirectiveLocation.SCALAR],args:{url:{type:new u.GraphQLNonNull(p.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});t.GraphQLSpecifiedByDirective=g;const b=Object.freeze([h,m,y,g]);t.specifiedDirectives=b},3226:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return o.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(t,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return a.GRAPHQL_MAX_INT}}),Object.defineProperty(t,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return a.GRAPHQL_MIN_INT}}),Object.defineProperty(t,"GraphQLBoolean",{enumerable:!0,get:function(){return a.GraphQLBoolean}}),Object.defineProperty(t,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return o.GraphQLDeprecatedDirective}}),Object.defineProperty(t,"GraphQLDirective",{enumerable:!0,get:function(){return o.GraphQLDirective}}),Object.defineProperty(t,"GraphQLEnumType",{enumerable:!0,get:function(){return i.GraphQLEnumType}}),Object.defineProperty(t,"GraphQLFloat",{enumerable:!0,get:function(){return a.GraphQLFloat}}),Object.defineProperty(t,"GraphQLID",{enumerable:!0,get:function(){return a.GraphQLID}}),Object.defineProperty(t,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return o.GraphQLIncludeDirective}}),Object.defineProperty(t,"GraphQLInputObjectType",{enumerable:!0,get:function(){return i.GraphQLInputObjectType}}),Object.defineProperty(t,"GraphQLInt",{enumerable:!0,get:function(){return a.GraphQLInt}}),Object.defineProperty(t,"GraphQLInterfaceType",{enumerable:!0,get:function(){return i.GraphQLInterfaceType}}),Object.defineProperty(t,"GraphQLList",{enumerable:!0,get:function(){return i.GraphQLList}}),Object.defineProperty(t,"GraphQLNonNull",{enumerable:!0,get:function(){return i.GraphQLNonNull}}),Object.defineProperty(t,"GraphQLObjectType",{enumerable:!0,get:function(){return i.GraphQLObjectType}}),Object.defineProperty(t,"GraphQLScalarType",{enumerable:!0,get:function(){return i.GraphQLScalarType}}),Object.defineProperty(t,"GraphQLSchema",{enumerable:!0,get:function(){return r.GraphQLSchema}}),Object.defineProperty(t,"GraphQLSkipDirective",{enumerable:!0,get:function(){return o.GraphQLSkipDirective}}),Object.defineProperty(t,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return o.GraphQLSpecifiedByDirective}}),Object.defineProperty(t,"GraphQLString",{enumerable:!0,get:function(){return a.GraphQLString}}),Object.defineProperty(t,"GraphQLUnionType",{enumerable:!0,get:function(){return i.GraphQLUnionType}}),Object.defineProperty(t,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return s.SchemaMetaFieldDef}}),Object.defineProperty(t,"TypeKind",{enumerable:!0,get:function(){return s.TypeKind}}),Object.defineProperty(t,"TypeMetaFieldDef",{enumerable:!0,get:function(){return s.TypeMetaFieldDef}}),Object.defineProperty(t,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return s.TypeNameMetaFieldDef}}),Object.defineProperty(t,"__Directive",{enumerable:!0,get:function(){return s.__Directive}}),Object.defineProperty(t,"__DirectiveLocation",{enumerable:!0,get:function(){return s.__DirectiveLocation}}),Object.defineProperty(t,"__EnumValue",{enumerable:!0,get:function(){return s.__EnumValue}}),Object.defineProperty(t,"__Field",{enumerable:!0,get:function(){return s.__Field}}),Object.defineProperty(t,"__InputValue",{enumerable:!0,get:function(){return s.__InputValue}}),Object.defineProperty(t,"__Schema",{enumerable:!0,get:function(){return s.__Schema}}),Object.defineProperty(t,"__Type",{enumerable:!0,get:function(){return s.__Type}}),Object.defineProperty(t,"__TypeKind",{enumerable:!0,get:function(){return s.__TypeKind}}),Object.defineProperty(t,"assertAbstractType",{enumerable:!0,get:function(){return i.assertAbstractType}}),Object.defineProperty(t,"assertCompositeType",{enumerable:!0,get:function(){return i.assertCompositeType}}),Object.defineProperty(t,"assertDirective",{enumerable:!0,get:function(){return o.assertDirective}}),Object.defineProperty(t,"assertEnumType",{enumerable:!0,get:function(){return i.assertEnumType}}),Object.defineProperty(t,"assertEnumValueName",{enumerable:!0,get:function(){return l.assertEnumValueName}}),Object.defineProperty(t,"assertInputObjectType",{enumerable:!0,get:function(){return i.assertInputObjectType}}),Object.defineProperty(t,"assertInputType",{enumerable:!0,get:function(){return i.assertInputType}}),Object.defineProperty(t,"assertInterfaceType",{enumerable:!0,get:function(){return i.assertInterfaceType}}),Object.defineProperty(t,"assertLeafType",{enumerable:!0,get:function(){return i.assertLeafType}}),Object.defineProperty(t,"assertListType",{enumerable:!0,get:function(){return i.assertListType}}),Object.defineProperty(t,"assertName",{enumerable:!0,get:function(){return l.assertName}}),Object.defineProperty(t,"assertNamedType",{enumerable:!0,get:function(){return i.assertNamedType}}),Object.defineProperty(t,"assertNonNullType",{enumerable:!0,get:function(){return i.assertNonNullType}}),Object.defineProperty(t,"assertNullableType",{enumerable:!0,get:function(){return i.assertNullableType}}),Object.defineProperty(t,"assertObjectType",{enumerable:!0,get:function(){return i.assertObjectType}}),Object.defineProperty(t,"assertOutputType",{enumerable:!0,get:function(){return i.assertOutputType}}),Object.defineProperty(t,"assertScalarType",{enumerable:!0,get:function(){return i.assertScalarType}}),Object.defineProperty(t,"assertSchema",{enumerable:!0,get:function(){return r.assertSchema}}),Object.defineProperty(t,"assertType",{enumerable:!0,get:function(){return i.assertType}}),Object.defineProperty(t,"assertUnionType",{enumerable:!0,get:function(){return i.assertUnionType}}),Object.defineProperty(t,"assertValidSchema",{enumerable:!0,get:function(){return c.assertValidSchema}}),Object.defineProperty(t,"assertWrappingType",{enumerable:!0,get:function(){return i.assertWrappingType}}),Object.defineProperty(t,"getNamedType",{enumerable:!0,get:function(){return i.getNamedType}}),Object.defineProperty(t,"getNullableType",{enumerable:!0,get:function(){return i.getNullableType}}),Object.defineProperty(t,"introspectionTypes",{enumerable:!0,get:function(){return s.introspectionTypes}}),Object.defineProperty(t,"isAbstractType",{enumerable:!0,get:function(){return i.isAbstractType}}),Object.defineProperty(t,"isCompositeType",{enumerable:!0,get:function(){return i.isCompositeType}}),Object.defineProperty(t,"isDirective",{enumerable:!0,get:function(){return o.isDirective}}),Object.defineProperty(t,"isEnumType",{enumerable:!0,get:function(){return i.isEnumType}}),Object.defineProperty(t,"isInputObjectType",{enumerable:!0,get:function(){return i.isInputObjectType}}),Object.defineProperty(t,"isInputType",{enumerable:!0,get:function(){return i.isInputType}}),Object.defineProperty(t,"isInterfaceType",{enumerable:!0,get:function(){return i.isInterfaceType}}),Object.defineProperty(t,"isIntrospectionType",{enumerable:!0,get:function(){return s.isIntrospectionType}}),Object.defineProperty(t,"isLeafType",{enumerable:!0,get:function(){return i.isLeafType}}),Object.defineProperty(t,"isListType",{enumerable:!0,get:function(){return i.isListType}}),Object.defineProperty(t,"isNamedType",{enumerable:!0,get:function(){return i.isNamedType}}),Object.defineProperty(t,"isNonNullType",{enumerable:!0,get:function(){return i.isNonNullType}}),Object.defineProperty(t,"isNullableType",{enumerable:!0,get:function(){return i.isNullableType}}),Object.defineProperty(t,"isObjectType",{enumerable:!0,get:function(){return i.isObjectType}}),Object.defineProperty(t,"isOutputType",{enumerable:!0,get:function(){return i.isOutputType}}),Object.defineProperty(t,"isRequiredArgument",{enumerable:!0,get:function(){return i.isRequiredArgument}}),Object.defineProperty(t,"isRequiredInputField",{enumerable:!0,get:function(){return i.isRequiredInputField}}),Object.defineProperty(t,"isScalarType",{enumerable:!0,get:function(){return i.isScalarType}}),Object.defineProperty(t,"isSchema",{enumerable:!0,get:function(){return r.isSchema}}),Object.defineProperty(t,"isSpecifiedDirective",{enumerable:!0,get:function(){return o.isSpecifiedDirective}}),Object.defineProperty(t,"isSpecifiedScalarType",{enumerable:!0,get:function(){return a.isSpecifiedScalarType}}),Object.defineProperty(t,"isType",{enumerable:!0,get:function(){return i.isType}}),Object.defineProperty(t,"isUnionType",{enumerable:!0,get:function(){return i.isUnionType}}),Object.defineProperty(t,"isWrappingType",{enumerable:!0,get:function(){return i.isWrappingType}}),Object.defineProperty(t,"resolveObjMapThunk",{enumerable:!0,get:function(){return i.resolveObjMapThunk}}),Object.defineProperty(t,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return i.resolveReadonlyArrayThunk}}),Object.defineProperty(t,"specifiedDirectives",{enumerable:!0,get:function(){return o.specifiedDirectives}}),Object.defineProperty(t,"specifiedScalarTypes",{enumerable:!0,get:function(){return a.specifiedScalarTypes}}),Object.defineProperty(t,"validateSchema",{enumerable:!0,get:function(){return c.validateSchema}});var r=n(6829),i=n(5003),o=n(7197),a=n(2229),s=n(8155),c=n(1671),l=n(3058)},8155:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.introspectionTypes=t.__TypeKind=t.__Type=t.__Schema=t.__InputValue=t.__Field=t.__EnumValue=t.__DirectiveLocation=t.__Directive=t.TypeNameMetaFieldDef=t.TypeMetaFieldDef=t.TypeKind=t.SchemaMetaFieldDef=void 0,t.isIntrospectionType=function(e){return T.some((({name:t})=>e.name===t))};var r=n(8002),i=n(7706),o=n(8333),a=n(3033),s=n(8115),c=n(5003),l=n(2229);const u=new c.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:l.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(d))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new c.GraphQLNonNull(d),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:d,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:d,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(p))),resolve:e=>e.getDirectives()}})});t.__Schema=u;const p=new c.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new c.GraphQLNonNull(l.GraphQLString),resolve:e=>e.name},description:{type:l.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new c.GraphQLNonNull(l.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(f))),resolve:e=>e.locations},args:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(m))),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter((e=>null==e.deprecationReason))}})});t.__Directive=p;const f=new c.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:o.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:o.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:o.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:o.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:o.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:o.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:o.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:o.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:o.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:o.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:o.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:o.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:o.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:o.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:o.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:o.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:o.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:o.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:o.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});t.__DirectiveLocation=f;const d=new c.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new c.GraphQLNonNull(g),resolve:e=>(0,c.isScalarType)(e)?y.SCALAR:(0,c.isObjectType)(e)?y.OBJECT:(0,c.isInterfaceType)(e)?y.INTERFACE:(0,c.isUnionType)(e)?y.UNION:(0,c.isEnumType)(e)?y.ENUM:(0,c.isInputObjectType)(e)?y.INPUT_OBJECT:(0,c.isListType)(e)?y.LIST:(0,c.isNonNullType)(e)?y.NON_NULL:void(0,i.invariant)(!1,`Unexpected type: "${(0,r.inspect)(e)}".`)},name:{type:l.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:l.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:l.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new c.GraphQLList(new c.GraphQLNonNull(h)),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isObjectType)(e)||(0,c.isInterfaceType)(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new c.GraphQLList(new c.GraphQLNonNull(d)),resolve(e){if((0,c.isObjectType)(e)||(0,c.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new c.GraphQLList(new c.GraphQLNonNull(d)),resolve(e,t,n,{schema:r}){if((0,c.isAbstractType)(e))return r.getPossibleTypes(e)}},enumValues:{type:new c.GraphQLList(new c.GraphQLNonNull(v)),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isEnumType)(e)){const n=e.getValues();return t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new c.GraphQLList(new c.GraphQLNonNull(m)),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isInputObjectType)(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:d,resolve:e=>"ofType"in e?e.ofType:void 0}})});t.__Type=d;const h=new c.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new c.GraphQLNonNull(l.GraphQLString),resolve:e=>e.name},description:{type:l.GraphQLString,resolve:e=>e.description},args:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(m))),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new c.GraphQLNonNull(d),resolve:e=>e.type},isDeprecated:{type:new c.GraphQLNonNull(l.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:l.GraphQLString,resolve:e=>e.deprecationReason}})});t.__Field=h;const m=new c.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new c.GraphQLNonNull(l.GraphQLString),resolve:e=>e.name},description:{type:l.GraphQLString,resolve:e=>e.description},type:{type:new c.GraphQLNonNull(d),resolve:e=>e.type},defaultValue:{type:l.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=(0,s.astFromValue)(n,t);return r?(0,a.print)(r):null}},isDeprecated:{type:new c.GraphQLNonNull(l.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:l.GraphQLString,resolve:e=>e.deprecationReason}})});t.__InputValue=m;const v=new c.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new c.GraphQLNonNull(l.GraphQLString),resolve:e=>e.name},description:{type:l.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new c.GraphQLNonNull(l.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:l.GraphQLString,resolve:e=>e.deprecationReason}})});var y;t.__EnumValue=v,t.TypeKind=y,function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(y||(t.TypeKind=y={}));const g=new c.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:y.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:y.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:y.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:y.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:y.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:y.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:y.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:y.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});t.__TypeKind=g;const b={name:"__schema",type:new c.GraphQLNonNull(u),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};t.SchemaMetaFieldDef=b;const E={name:"__type",type:d,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new c.GraphQLNonNull(l.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};t.TypeMetaFieldDef=E;const w={name:"__typename",type:new c.GraphQLNonNull(l.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};t.TypeNameMetaFieldDef=w;const T=Object.freeze([u,p,f,d,h,m,v,g]);t.introspectionTypes=T},2229:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLString=t.GraphQLInt=t.GraphQLID=t.GraphQLFloat=t.GraphQLBoolean=t.GRAPHQL_MIN_INT=t.GRAPHQL_MAX_INT=void 0,t.isSpecifiedScalarType=function(e){return v.some((({name:t})=>e.name===t))},t.specifiedScalarTypes=void 0;var r=n(8002),i=n(5690),o=n(5822),a=n(2828),s=n(3033),c=n(5003);const l=2147483647;t.GRAPHQL_MAX_INT=l;const u=-2147483648;t.GRAPHQL_MIN_INT=u;const p=new c.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=y(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new o.GraphQLError(`Int cannot represent non-integer value: ${(0,r.inspect)(t)}`);if(n>l||nl||el||tt.name===e))}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function h(e,t){const n=(0,l.getNamedType)(e);if(!t.has(n))if(t.add(n),(0,l.isUnionType)(n))for(const e of n.getTypes())h(e,t);else if((0,l.isObjectType)(n)||(0,l.isInterfaceType)(n)){for(const e of n.getInterfaces())h(e,t);for(const e of Object.values(n.getFields())){h(e.type,t);for(const n of e.args)h(n.type,t)}}else if((0,l.isInputObjectType)(n))for(const e of Object.values(n.getFields()))h(e.type,t);return t}t.GraphQLSchema=d},1671:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidSchema=function(e){const t=p(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))},t.validateSchema=p;var r=n(8002),i=n(5822),o=n(1807),a=n(298),s=n(5003),c=n(7197),l=n(8155),u=n(6829);function p(e){if((0,u.assertSchema)(e),e.__validationErrors)return e.__validationErrors;const t=new f(e);!function(e){const t=e.schema,n=t.getQueryType();if(n){if(!(0,s.isObjectType)(n)){var i;e.reportError(`Query root type must be Object type, it cannot be ${(0,r.inspect)(n)}.`,null!==(i=d(t,o.OperationTypeNode.QUERY))&&void 0!==i?i:n.astNode)}}else e.reportError("Query root type must be provided.",t.astNode);const a=t.getMutationType();var c;a&&!(0,s.isObjectType)(a)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,r.inspect)(a)}.`,null!==(c=d(t,o.OperationTypeNode.MUTATION))&&void 0!==c?c:a.astNode);const l=t.getSubscriptionType();var u;l&&!(0,s.isObjectType)(l)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,r.inspect)(l)}.`,null!==(u=d(t,o.OperationTypeNode.SUBSCRIPTION))&&void 0!==u?u:l.astNode)}(t),function(e){for(const n of e.schema.getDirectives())if((0,c.isDirective)(n)){h(e,n);for(const i of n.args){var t;h(e,i),(0,s.isInputType)(i.type)||e.reportError(`The type of @${n.name}(${i.name}:) must be Input Type but got: ${(0,r.inspect)(i.type)}.`,i.astNode),(0,s.isRequiredArgument)(i)&&null!=i.deprecationReason&&e.reportError(`Required argument @${n.name}(${i.name}:) cannot be deprecated.`,[k(i.astNode),null===(t=i.astNode)||void 0===t?void 0:t.type])}}else e.reportError(`Expected directive but got: ${(0,r.inspect)(n)}.`,null==n?void 0:n.astNode)}(t),function(e){const t=function(e){const t=Object.create(null),n=[],r=Object.create(null);return function i(o){if(t[o.name])return;t[o.name]=!0,r[o.name]=n.length;const a=Object.values(o.getFields());for(const t of a)if((0,s.isNonNullType)(t.type)&&(0,s.isInputObjectType)(t.type.ofType)){const o=t.type.ofType,a=r[o.name];if(n.push(t),void 0===a)i(o);else{const t=n.slice(a),r=t.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const i of Object.values(n))(0,s.isNamedType)(i)?((0,l.isIntrospectionType)(i)||h(e,i),(0,s.isObjectType)(i)||(0,s.isInterfaceType)(i)?(m(e,i),v(e,i)):(0,s.isUnionType)(i)?b(e,i):(0,s.isEnumType)(i)?E(e,i):(0,s.isInputObjectType)(i)&&(w(e,i),t(i))):e.reportError(`Expected GraphQL named type but got: ${(0,r.inspect)(i)}.`,i.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}class f{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new i.GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function d(e,t){var n;return null===(n=[e.astNode,...e.extensionASTNodes].flatMap((e=>{var t;return null!==(t=null==e?void 0:e.operationTypes)&&void 0!==t?t:[]})).find((e=>e.operation===t)))||void 0===n?void 0:n.type}function h(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function m(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const c of n){var i;h(e,c),(0,s.isOutputType)(c.type)||e.reportError(`The type of ${t.name}.${c.name} must be Output Type but got: ${(0,r.inspect)(c.type)}.`,null===(i=c.astNode)||void 0===i?void 0:i.type);for(const n of c.args){const i=n.name;var o,a;h(e,n),(0,s.isInputType)(n.type)||e.reportError(`The type of ${t.name}.${c.name}(${i}:) must be Input Type but got: ${(0,r.inspect)(n.type)}.`,null===(o=n.astNode)||void 0===o?void 0:o.type),(0,s.isRequiredArgument)(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${t.name}.${c.name}(${i}:) cannot be deprecated.`,[k(n.astNode),null===(a=n.astNode)||void 0===a?void 0:a.type])}}}function v(e,t){const n=Object.create(null);for(const i of t.getInterfaces())(0,s.isInterfaceType)(i)?t!==i?n[i.name]?e.reportError(`Type ${t.name} can only implement ${i.name} once.`,T(t,i)):(n[i.name]=!0,g(e,t,i),y(e,t,i)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,T(t,i)):e.reportError(`Type ${(0,r.inspect)(t)} must only implement Interface types, it cannot implement ${(0,r.inspect)(i)}.`,T(t,i))}function y(e,t,n){const i=t.getFields();for(const p of Object.values(n.getFields())){const f=p.name,d=i[f];if(d){var o,c;(0,a.isTypeSubTypeOf)(e.schema,d.type,p.type)||e.reportError(`Interface field ${n.name}.${f} expects type ${(0,r.inspect)(p.type)} but ${t.name}.${f} is type ${(0,r.inspect)(d.type)}.`,[null===(o=p.astNode)||void 0===o?void 0:o.type,null===(c=d.astNode)||void 0===c?void 0:c.type]);for(const i of p.args){const o=i.name,s=d.args.find((e=>e.name===o));var l,u;s?(0,a.isEqualType)(i.type,s.type)||e.reportError(`Interface field argument ${n.name}.${f}(${o}:) expects type ${(0,r.inspect)(i.type)} but ${t.name}.${f}(${o}:) is type ${(0,r.inspect)(s.type)}.`,[null===(l=i.astNode)||void 0===l?void 0:l.type,null===(u=s.astNode)||void 0===u?void 0:u.type]):e.reportError(`Interface field argument ${n.name}.${f}(${o}:) expected but ${t.name}.${f} does not provide it.`,[i.astNode,d.astNode])}for(const r of d.args){const i=r.name;!p.args.find((e=>e.name===i))&&(0,s.isRequiredArgument)(r)&&e.reportError(`Object field ${t.name}.${f} includes required argument ${i} that is missing from the Interface field ${n.name}.${f}.`,[r.astNode,p.astNode])}}else e.reportError(`Interface field ${n.name}.${f} expected but ${t.name} does not provide it.`,[p.astNode,t.astNode,...t.extensionASTNodes])}}function g(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...T(n,i),...T(t,n)])}function b(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const i=Object.create(null);for(const o of n)i[o.name]?e.reportError(`Union type ${t.name} can only include type ${o.name} once.`,_(t,o.name)):(i[o.name]=!0,(0,s.isObjectType)(o)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,r.inspect)(o)}.`,_(t,String(o))))}function E(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)h(e,t)}function w(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const a of n){var i,o;h(e,a),(0,s.isInputType)(a.type)||e.reportError(`The type of ${t.name}.${a.name} must be Input Type but got: ${(0,r.inspect)(a.type)}.`,null===(i=a.astNode)||void 0===i?void 0:i.type),(0,s.isRequiredInputField)(a)&&null!=a.deprecationReason&&e.reportError(`Required input field ${t.name}.${a.name} cannot be deprecated.`,[k(a.astNode),null===(o=a.astNode)||void 0===o?void 0:o.type])}}function T(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>{var t;return null!==(t=e.interfaces)&&void 0!==t?t:[]})).filter((e=>e.name.value===t.name))}function _(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>{var t;return null!==(t=e.types)&&void 0!==t?t:[]})).filter((e=>e.name.value===t))}function k(e){var t;return null==e||null===(t=e.directives)||void 0===t?void 0:t.find((e=>e.name.value===c.GraphQLDeprecatedDirective.name))}},6226:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeInfo=void 0,t.visitWithTypeInfo=function(e,t){return{enter(...n){const i=n[0];e.enter(i);const a=(0,o.getEnterLeaveForKind)(t,i.kind).enter;if(a){const o=a.apply(t,n);return void 0!==o&&(e.leave(i),(0,r.isNode)(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=(0,o.getEnterLeaveForKind)(t,r.kind).leave;let a;return i&&(a=i.apply(t,n)),e.leave(r),a}}};var r=n(1807),i=n(2828),o=n(285),a=n(5003),s=n(8155),c=n(5115);class l{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=n?n:u,t&&((0,a.isInputType)(t)&&this._inputTypeStack.push(t),(0,a.isCompositeType)(t)&&this._parentTypeStack.push(t),(0,a.isOutputType)(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case i.Kind.SELECTION_SET:{const e=(0,a.getNamedType)(this.getType());this._parentTypeStack.push((0,a.isCompositeType)(e)?e:void 0);break}case i.Kind.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push((0,a.isOutputType)(i)?i:void 0);break}case i.Kind.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case i.Kind.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push((0,a.isObjectType)(n)?n:void 0);break}case i.Kind.INLINE_FRAGMENT:case i.Kind.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?(0,c.typeFromAST)(t,n):(0,a.getNamedType)(this.getType());this._typeStack.push((0,a.isOutputType)(r)?r:void 0);break}case i.Kind.VARIABLE_DEFINITION:{const n=(0,c.typeFromAST)(t,e.type);this._inputTypeStack.push((0,a.isInputType)(n)?n:void 0);break}case i.Kind.ARGUMENT:{var n;let t,r;const i=null!==(n=this.getDirective())&&void 0!==n?n:this.getFieldDef();i&&(t=i.args.find((t=>t.name===e.name.value)),t&&(r=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(r)?r:void 0);break}case i.Kind.LIST:{const e=(0,a.getNullableType)(this.getInputType()),t=(0,a.isListType)(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,a.isInputType)(t)?t:void 0);break}case i.Kind.OBJECT_FIELD:{const t=(0,a.getNamedType)(this.getInputType());let n,r;(0,a.isInputObjectType)(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(n)?n:void 0);break}case i.Kind.ENUM:{const t=(0,a.getNamedType)(this.getInputType());let n;(0,a.isEnumType)(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case i.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case i.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case i.Kind.DIRECTIVE:this._directive=null;break;case i.Kind.OPERATION_DEFINITION:case i.Kind.INLINE_FRAGMENT:case i.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case i.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case i.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.Kind.LIST:case i.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.Kind.ENUM:this._enumValue=null}}}function u(e,t,n){const r=n.name.value;return r===s.SchemaMetaFieldDef.name&&e.getQueryType()===t?s.SchemaMetaFieldDef:r===s.TypeMetaFieldDef.name&&e.getQueryType()===t?s.TypeMetaFieldDef:r===s.TypeNameMetaFieldDef.name&&(0,a.isCompositeType)(t)?s.TypeNameMetaFieldDef:(0,a.isObjectType)(t)||(0,a.isInterfaceType)(t)?t.getFields()[r]:void 0}t.TypeInfo=l},6526:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidName=function(e){const t=a(e);if(t)throw t;return e},t.isValidNameError=a;var r=n(7242),i=n(5822),o=n(3058);function a(e){if("string"==typeof e||(0,r.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new i.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,o.assertName)(e)}catch(e){return e}}},8115:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.astFromValue=function e(t,n){if((0,c.isNonNullType)(n)){const r=e(t,n.ofType);return(null==r?void 0:r.kind)===s.Kind.NULL?null:r}if(null===t)return{kind:s.Kind.NULL};if(void 0===t)return null;if((0,c.isListType)(n)){const r=n.ofType;if((0,o.isIterableObject)(t)){const n=[];for(const i of t){const t=e(i,r);null!=t&&n.push(t)}return{kind:s.Kind.LIST,values:n}}return e(t,r)}if((0,c.isInputObjectType)(n)){if(!(0,a.isObjectLike)(t))return null;const r=[];for(const i of Object.values(n.getFields())){const n=e(t[i.name],i.type);n&&r.push({kind:s.Kind.OBJECT_FIELD,name:{kind:s.Kind.NAME,value:i.name},value:n})}return{kind:s.Kind.OBJECT,fields:r}}if((0,c.isLeafType)(n)){const e=n.serialize(t);if(null==e)return null;if("boolean"==typeof e)return{kind:s.Kind.BOOLEAN,value:e};if("number"==typeof e&&Number.isFinite(e)){const t=String(e);return u.test(t)?{kind:s.Kind.INT,value:t}:{kind:s.Kind.FLOAT,value:t}}if("string"==typeof e)return(0,c.isEnumType)(n)?{kind:s.Kind.ENUM,value:e}:n===l.GraphQLID&&u.test(e)?{kind:s.Kind.INT,value:e}:{kind:s.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${(0,r.inspect)(e)}.`)}(0,i.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(n))};var r=n(8002),i=n(7706),o=n(6609),a=n(5690),s=n(2828),c=n(5003),l=n(2229);const u=/^-?(?:0|[1-9][0-9]*)$/},2906:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildASTSchema=u,t.buildSchema=function(e,t){return u((0,o.parse)(e,{noLocation:null==t?void 0:t.noLocation,allowLegacyFragmentVariables:null==t?void 0:t.allowLegacyFragmentVariables}),{assumeValidSDL:null==t?void 0:t.assumeValidSDL,assumeValid:null==t?void 0:t.assumeValid})};var r=n(7242),i=n(2828),o=n(8370),a=n(7197),s=n(6829),c=n(9504),l=n(3242);function u(e,t){null!=e&&e.kind===i.Kind.DOCUMENT||(0,r.devAssert)(!1,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&(0,c.assertValidSDL)(e);const n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},o=(0,l.extendSchemaImpl)(n,e,t);if(null==o.astNode)for(const e of o.types)switch(e.name){case"Query":o.query=e;break;case"Mutation":o.mutation=e;break;case"Subscription":o.subscription=e}const u=[...o.directives,...a.specifiedDirectives.filter((e=>o.directives.every((t=>t.name!==e.name))))];return new s.GraphQLSchema({...o,directives:u})}},8686:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildClientSchema=function(e,t){(0,o.isObjectLike)(e)&&(0,o.isObjectLike)(e.__schema)||(0,r.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,i.inspect)(e)}.`);const n=e.__schema,h=(0,a.keyValMap)(n.types,(e=>e.name),(e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case u.TypeKind.SCALAR:return r=e,new c.GraphQLScalarType({name:r.name,description:r.description,specifiedByURL:r.specifiedByURL});case u.TypeKind.OBJECT:return n=e,new c.GraphQLObjectType({name:n.name,description:n.description,interfaces:()=>_(n),fields:()=>k(n)});case u.TypeKind.INTERFACE:return t=e,new c.GraphQLInterfaceType({name:t.name,description:t.description,interfaces:()=>_(t),fields:()=>k(t)});case u.TypeKind.UNION:return function(e){if(!e.possibleTypes){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new c.GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(w)})}(e);case u.TypeKind.ENUM:return function(e){if(!e.enumValues){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new c.GraphQLEnumType({name:e.name,description:e.description,values:(0,a.keyValMap)(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case u.TypeKind.INPUT_OBJECT:return function(e){if(!e.inputFields){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new c.GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>S(e.inputFields)})}(e)}var t,n,r;const o=(0,i.inspect)(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${o}.`)}(e)));for(const e of[...p.specifiedScalarTypes,...u.introspectionTypes])h[e.name]&&(h[e.name]=e);const m=n.queryType?w(n.queryType):null,v=n.mutationType?w(n.mutationType):null,y=n.subscriptionType?w(n.subscriptionType):null,g=n.directives?n.directives.map((function(e){if(!e.args){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new l.GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:S(e.args)})})):[];return new f.GraphQLSchema({description:n.description,query:m,mutation:v,subscription:y,types:Object.values(h),directives:g,assumeValid:null==t?void 0:t.assumeValid});function b(e){if(e.kind===u.TypeKind.LIST){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return new c.GraphQLList(b(t))}if(e.kind===u.TypeKind.NON_NULL){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");const n=b(t);return new c.GraphQLNonNull((0,c.assertNullableType)(n))}return E(e)}function E(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${(0,i.inspect)(e)}.`);const n=h[t];if(!n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function w(e){return(0,c.assertObjectType)(E(e))}function T(e){return(0,c.assertInterfaceType)(E(e))}function _(e){if(null===e.interfaces&&e.kind===u.TypeKind.INTERFACE)return[];if(!e.interfaces){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(T)}function k(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${(0,i.inspect)(e)}.`);return(0,a.keyValMap)(e.fields,(e=>e.name),O)}function O(e){const t=b(e.type);if(!(0,c.isOutputType)(t)){const e=(0,i.inspect)(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:S(e.args)}}function S(e){return(0,a.keyValMap)(e,(e=>e.name),x)}function x(e){const t=b(e.type);if(!(0,c.isInputType)(t)){const e=(0,i.inspect)(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?(0,d.valueFromAST)((0,s.parseValue)(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}};var r=n(7242),i=n(8002),o=n(5690),a=n(7154),s=n(8370),c=n(5003),l=n(7197),u=n(8155),p=n(2229),f=n(6829),d=n(3770)},3679:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coerceInputValue=function(e,t,n=d){return h(e,t,n,void 0)};var r=n(166),i=n(8002),o=n(7706),a=n(6609),s=n(5690),c=n(7059),l=n(737),u=n(8070),p=n(5822),f=n(5003);function d(e,t,n){let r="Invalid value "+(0,i.inspect)(t);throw e.length>0&&(r+=` at "value${(0,l.printPathArray)(e)}"`),n.message=r+": "+n.message,n}function h(e,t,n,l){if((0,f.isNonNullType)(t))return null!=e?h(e,t.ofType,n,l):void n((0,c.pathToArray)(l),e,new p.GraphQLError(`Expected non-nullable type "${(0,i.inspect)(t)}" not to be null.`));if(null==e)return null;if((0,f.isListType)(t)){const r=t.ofType;return(0,a.isIterableObject)(e)?Array.from(e,((e,t)=>{const i=(0,c.addPath)(l,t,void 0);return h(e,r,n,i)})):[h(e,r,n,l)]}if((0,f.isInputObjectType)(t)){if(!(0,s.isObjectLike)(e))return void n((0,c.pathToArray)(l),e,new p.GraphQLError(`Expected type "${t.name}" to be an object.`));const o={},a=t.getFields();for(const r of Object.values(a)){const a=e[r.name];if(void 0!==a)o[r.name]=h(a,r.type,n,(0,c.addPath)(l,r.name,t.name));else if(void 0!==r.defaultValue)o[r.name]=r.defaultValue;else if((0,f.isNonNullType)(r.type)){const t=(0,i.inspect)(r.type);n((0,c.pathToArray)(l),e,new p.GraphQLError(`Field "${r.name}" of required type "${t}" was not provided.`))}}for(const i of Object.keys(e))if(!a[i]){const o=(0,u.suggestionList)(i,Object.keys(t.getFields()));n((0,c.pathToArray)(l),e,new p.GraphQLError(`Field "${i}" is not defined by type "${t.name}".`+(0,r.didYouMean)(o)))}return o}if((0,f.isLeafType)(t)){let r;try{r=t.parseValue(e)}catch(r){return void(r instanceof p.GraphQLError?n((0,c.pathToArray)(l),e,r):n((0,c.pathToArray)(l),e,new p.GraphQLError(`Expected type "${t.name}". `+r.message,{originalError:r})))}return void 0===r&&n((0,c.pathToArray)(l),e,new p.GraphQLError(`Expected type "${t.name}".`)),r}(0,o.invariant)(!1,"Unexpected input type: "+(0,i.inspect)(t))}},6078:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAST=function(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:r.Kind.DOCUMENT,definitions:t}};var r=n(2828)},3242:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSchema=function(e,t,n){(0,h.assertSchema)(e),null!=t&&t.kind===c.Kind.DOCUMENT||(0,r.devAssert)(!1,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&(0,m.assertValidSDLExtension)(t,e);const i=e.toConfig(),o=g(i,t,n);return i===o?e:new h.GraphQLSchema(o)},t.extendSchemaImpl=g;var r=n(7242),i=n(8002),o=n(7706),a=n(2863),s=n(6124),c=n(2828),l=n(1352),u=n(5003),p=n(7197),f=n(8155),d=n(2229),h=n(6829),m=n(9504),v=n(8840),y=n(3770);function g(e,t,n){var r,a,h,m;const v=[],g=Object.create(null),T=[];let _;const k=[];for(const e of t.definitions)if(e.kind===c.Kind.SCHEMA_DEFINITION)_=e;else if(e.kind===c.Kind.SCHEMA_EXTENSION)k.push(e);else if((0,l.isTypeDefinitionNode)(e))v.push(e);else if((0,l.isTypeExtensionNode)(e)){const t=e.name.value,n=g[t];g[t]=n?n.concat([e]):[e]}else e.kind===c.Kind.DIRECTIVE_DEFINITION&&T.push(e);if(0===Object.keys(g).length&&0===v.length&&0===T.length&&0===k.length&&null==_)return e;const O=Object.create(null);for(const t of e.types)O[t.name]=(S=t,(0,f.isIntrospectionType)(S)||(0,d.isSpecifiedScalarType)(S)?S:(0,u.isScalarType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];let i=n.specifiedByURL;for(const e of r){var o;i=null!==(o=w(e))&&void 0!==o?o:i}return new u.GraphQLScalarType({...n,specifiedByURL:i,extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isObjectType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];return new u.GraphQLObjectType({...n,interfaces:()=>[...e.getInterfaces().map(A),...Q(r)],fields:()=>({...(0,s.mapValue)(n.fields,L),...M(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isInterfaceType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];return new u.GraphQLInterfaceType({...n,interfaces:()=>[...e.getInterfaces().map(A),...Q(r)],fields:()=>({...(0,s.mapValue)(n.fields,L),...M(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isUnionType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];return new u.GraphQLUnionType({...n,types:()=>[...e.getTypes().map(A),...q(r)],extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isEnumType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[e.name])&&void 0!==t?t:[];return new u.GraphQLEnumType({...n,values:{...n.values,...V(r)},extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isInputObjectType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];return new u.GraphQLInputObjectType({...n,fields:()=>({...(0,s.mapValue)(n.fields,(e=>({...e,type:N(e.type)}))),...F(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):void(0,o.invariant)(!1,"Unexpected type: "+(0,i.inspect)(S)));var S;for(const e of v){var x;const t=e.name.value;O[t]=null!==(x=b[t])&&void 0!==x?x:U(e)}const C={query:e.query&&A(e.query),mutation:e.mutation&&A(e.mutation),subscription:e.subscription&&A(e.subscription),..._&&I([_]),...I(k)};return{description:null===(r=_)||void 0===r||null===(a=r.description)||void 0===a?void 0:a.value,...C,types:Object.values(O),directives:[...e.directives.map((function(e){const t=e.toConfig();return new p.GraphQLDirective({...t,args:(0,s.mapValue)(t.args,D)})})),...T.map((function(e){var t;return new p.GraphQLDirective({name:e.name.value,description:null===(t=e.description)||void 0===t?void 0:t.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:j(e.arguments),astNode:e})}))],extensions:Object.create(null),astNode:null!==(h=_)&&void 0!==h?h:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(k),assumeValid:null!==(m=null==n?void 0:n.assumeValid)&&void 0!==m&&m};function N(e){return(0,u.isListType)(e)?new u.GraphQLList(N(e.ofType)):(0,u.isNonNullType)(e)?new u.GraphQLNonNull(N(e.ofType)):A(e)}function A(e){return O[e.name]}function L(e){return{...e,type:N(e.type),args:e.args&&(0,s.mapValue)(e.args,D)}}function D(e){return{...e,type:N(e.type)}}function I(e){const t={};for(const r of e){var n;const e=null!==(n=r.operationTypes)&&void 0!==n?n:[];for(const n of e)t[n.operation]=P(n.type)}return t}function P(e){var t;const n=e.name.value,r=null!==(t=b[n])&&void 0!==t?t:O[n];if(void 0===r)throw new Error(`Unknown type: "${n}".`);return r}function R(e){return e.kind===c.Kind.LIST_TYPE?new u.GraphQLList(R(e.type)):e.kind===c.Kind.NON_NULL_TYPE?new u.GraphQLNonNull(R(e.type)):P(e)}function M(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={type:R(n.type),description:null===(r=n.description)||void 0===r?void 0:r.value,args:j(n.arguments),deprecationReason:E(n),astNode:n}}}return t}function j(e){const t=null!=e?e:[],n=Object.create(null);for(const e of t){var r;const t=R(e.type);n[e.name.value]={type:t,description:null===(r=e.description)||void 0===r?void 0:r.value,defaultValue:(0,y.valueFromAST)(e.defaultValue,t),deprecationReason:E(e),astNode:e}}return n}function F(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;const e=R(n.type);t[n.name.value]={type:e,description:null===(r=n.description)||void 0===r?void 0:r.value,defaultValue:(0,y.valueFromAST)(n.defaultValue,e),deprecationReason:E(n),astNode:n}}}return t}function V(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.values)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={description:null===(r=n.description)||void 0===r?void 0:r.value,deprecationReason:E(n),astNode:n}}}return t}function Q(e){return e.flatMap((e=>{var t,n;return null!==(t=null===(n=e.interfaces)||void 0===n?void 0:n.map(P))&&void 0!==t?t:[]}))}function q(e){return e.flatMap((e=>{var t,n;return null!==(t=null===(n=e.types)||void 0===n?void 0:n.map(P))&&void 0!==t?t:[]}))}function U(e){var t;const n=e.name.value,r=null!==(t=g[n])&&void 0!==t?t:[];switch(e.kind){case c.Kind.OBJECT_TYPE_DEFINITION:{var i;const t=[e,...r];return new u.GraphQLObjectType({name:n,description:null===(i=e.description)||void 0===i?void 0:i.value,interfaces:()=>Q(t),fields:()=>M(t),astNode:e,extensionASTNodes:r})}case c.Kind.INTERFACE_TYPE_DEFINITION:{var o;const t=[e,...r];return new u.GraphQLInterfaceType({name:n,description:null===(o=e.description)||void 0===o?void 0:o.value,interfaces:()=>Q(t),fields:()=>M(t),astNode:e,extensionASTNodes:r})}case c.Kind.ENUM_TYPE_DEFINITION:{var a;const t=[e,...r];return new u.GraphQLEnumType({name:n,description:null===(a=e.description)||void 0===a?void 0:a.value,values:V(t),astNode:e,extensionASTNodes:r})}case c.Kind.UNION_TYPE_DEFINITION:{var s;const t=[e,...r];return new u.GraphQLUnionType({name:n,description:null===(s=e.description)||void 0===s?void 0:s.value,types:()=>q(t),astNode:e,extensionASTNodes:r})}case c.Kind.SCALAR_TYPE_DEFINITION:var l;return new u.GraphQLScalarType({name:n,description:null===(l=e.description)||void 0===l?void 0:l.value,specifiedByURL:w(e),astNode:e,extensionASTNodes:r});case c.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var p;const t=[e,...r];return new u.GraphQLInputObjectType({name:n,description:null===(p=e.description)||void 0===p?void 0:p.value,fields:()=>F(t),astNode:e,extensionASTNodes:r})}}}}const b=(0,a.keyMap)([...d.specifiedScalarTypes,...f.introspectionTypes],(e=>e.name));function E(e){const t=(0,v.getDirectiveValues)(p.GraphQLDeprecatedDirective,e);return null==t?void 0:t.reason}function w(e){const t=(0,v.getDirectiveValues)(p.GraphQLSpecifiedByDirective,e);return null==t?void 0:t.url}},3298:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DangerousChangeType=t.BreakingChangeType=void 0,t.findBreakingChanges=function(e,t){return d(e,t).filter((e=>e.type in r))},t.findDangerousChanges=function(e,t){return d(e,t).filter((e=>e.type in i))};var r,i,o=n(8002),a=n(7706),s=n(2863),c=n(3033),l=n(5003),u=n(2229),p=n(8115),f=n(6830);function d(e,t){return[...m(e,t),...h(e,t)]}function h(e,t){const n=[],i=S(e.getDirectives(),t.getDirectives());for(const e of i.removed)n.push({type:r.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(const[e,t]of i.persisted){const i=S(e.args,t.args);for(const t of i.added)(0,l.isRequiredArgument)(t)&&n.push({type:r.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${t.name} on directive ${e.name} was added.`});for(const t of i.removed)n.push({type:r.DIRECTIVE_ARG_REMOVED,description:`${t.name} was removed from ${e.name}.`});e.isRepeatable&&!t.isRepeatable&&n.push({type:r.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(const i of e.locations)t.locations.includes(i)||n.push({type:r.DIRECTIVE_LOCATION_REMOVED,description:`${i} was removed from ${e.name}.`})}return n}function m(e,t){const n=[],i=S(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(const e of i.removed)n.push({type:r.TYPE_REMOVED,description:(0,u.isSpecifiedScalarType)(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(const[e,t]of i.persisted)(0,l.isEnumType)(e)&&(0,l.isEnumType)(t)?n.push(...g(e,t)):(0,l.isUnionType)(e)&&(0,l.isUnionType)(t)?n.push(...y(e,t)):(0,l.isInputObjectType)(e)&&(0,l.isInputObjectType)(t)?n.push(...v(e,t)):(0,l.isObjectType)(e)&&(0,l.isObjectType)(t)||(0,l.isInterfaceType)(e)&&(0,l.isInterfaceType)(t)?n.push(...E(e,t),...b(e,t)):e.constructor!==t.constructor&&n.push({type:r.TYPE_CHANGED_KIND,description:`${e.name} changed from ${k(e)} to ${k(t)}.`});return n}function v(e,t){const n=[],o=S(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of o.added)(0,l.isRequiredInputField)(t)?n.push({type:r.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${t.name} on input type ${e.name} was added.`}):n.push({type:i.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${t.name} on input type ${e.name} was added.`});for(const t of o.removed)n.push({type:r.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of o.persisted)_(t.type,i.type)||n.push({type:r.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function y(e,t){const n=[],o=S(e.getTypes(),t.getTypes());for(const t of o.added)n.push({type:i.TYPE_ADDED_TO_UNION,description:`${t.name} was added to union type ${e.name}.`});for(const t of o.removed)n.push({type:r.TYPE_REMOVED_FROM_UNION,description:`${t.name} was removed from union type ${e.name}.`});return n}function g(e,t){const n=[],o=S(e.getValues(),t.getValues());for(const t of o.added)n.push({type:i.VALUE_ADDED_TO_ENUM,description:`${t.name} was added to enum type ${e.name}.`});for(const t of o.removed)n.push({type:r.VALUE_REMOVED_FROM_ENUM,description:`${t.name} was removed from enum type ${e.name}.`});return n}function b(e,t){const n=[],o=S(e.getInterfaces(),t.getInterfaces());for(const t of o.added)n.push({type:i.IMPLEMENTED_INTERFACE_ADDED,description:`${t.name} added to interfaces implemented by ${e.name}.`});for(const t of o.removed)n.push({type:r.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${t.name}.`});return n}function E(e,t){const n=[],i=S(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of i.removed)n.push({type:r.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,o]of i.persisted)n.push(...w(e,t,o)),T(t.type,o.type)||n.push({type:r.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(o.type)}.`});return n}function w(e,t,n){const o=[],a=S(t.args,n.args);for(const n of a.removed)o.push({type:r.ARG_REMOVED,description:`${e.name}.${t.name} arg ${n.name} was removed.`});for(const[n,s]of a.persisted)if(_(n.type,s.type)){if(void 0!==n.defaultValue)if(void 0===s.defaultValue)o.push({type:i.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} defaultValue was removed.`});else{const r=O(n.defaultValue,n.type),a=O(s.defaultValue,s.type);r!==a&&o.push({type:i.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} has changed defaultValue from ${r} to ${a}.`})}}else o.push({type:r.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${n.name} has changed type from ${String(n.type)} to ${String(s.type)}.`});for(const n of a.added)(0,l.isRequiredArgument)(n)?o.push({type:r.REQUIRED_ARG_ADDED,description:`A required arg ${n.name} on ${e.name}.${t.name} was added.`}):o.push({type:i.OPTIONAL_ARG_ADDED,description:`An optional arg ${n.name} on ${e.name}.${t.name} was added.`});return o}function T(e,t){return(0,l.isListType)(e)?(0,l.isListType)(t)&&T(e.ofType,t.ofType)||(0,l.isNonNullType)(t)&&T(e,t.ofType):(0,l.isNonNullType)(e)?(0,l.isNonNullType)(t)&&T(e.ofType,t.ofType):(0,l.isNamedType)(t)&&e.name===t.name||(0,l.isNonNullType)(t)&&T(e,t.ofType)}function _(e,t){return(0,l.isListType)(e)?(0,l.isListType)(t)&&_(e.ofType,t.ofType):(0,l.isNonNullType)(e)?(0,l.isNonNullType)(t)&&_(e.ofType,t.ofType)||!(0,l.isNonNullType)(t)&&_(e.ofType,t):(0,l.isNamedType)(t)&&e.name===t.name}function k(e){return(0,l.isScalarType)(e)?"a Scalar type":(0,l.isObjectType)(e)?"an Object type":(0,l.isInterfaceType)(e)?"an Interface type":(0,l.isUnionType)(e)?"a Union type":(0,l.isEnumType)(e)?"an Enum type":(0,l.isInputObjectType)(e)?"an Input type":void(0,a.invariant)(!1,"Unexpected type: "+(0,o.inspect)(e))}function O(e,t){const n=(0,p.astFromValue)(e,t);return null!=n||(0,a.invariant)(!1),(0,c.print)((0,f.sortValueNode)(n))}function S(e,t){const n=[],r=[],i=[],o=(0,s.keyMap)(e,(({name:e})=>e)),a=(0,s.keyMap)(t,(({name:e})=>e));for(const t of e){const e=a[t.name];void 0===e?r.push(t):i.push([t,e])}for(const e of t)void 0===o[e.name]&&n.push(e);return{added:n,persisted:i,removed:r}}t.BreakingChangeType=r,function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"}(r||(t.BreakingChangeType=r={})),t.DangerousChangeType=i,function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"}(i||(t.DangerousChangeType=i={}))},9363:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIntrospectionQuery=function(e){const t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"";function o(e){return t.inputValueDeprecation?e:""}return`\n query IntrospectionQuery {\n __schema {\n ${t.schemaDescription?n:""}\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ${n}\n ${i}\n locations\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ${n}\n ${r}\n fields(includeDeprecated: true) {\n name\n ${n}\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ${n}\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ${n}\n type { ...TypeRef }\n defaultValue\n ${o("isDeprecated")}\n ${o("deprecationReason")}\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n `}},9535:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOperationAST=function(e,t){let n=null;for(const o of e.definitions){var i;if(o.kind===r.Kind.OPERATION_DEFINITION)if(null==t){if(n)return null;n=o}else if((null===(i=o.name)||void 0===i?void 0:i.value)===t)return o}return n};var r=n(2828)},8678:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOperationRootType=function(e,t){if("query"===t.operation){const n=e.getQueryType();if(!n)throw new r.GraphQLError("Schema does not define the required query root type.",{nodes:t});return n}if("mutation"===t.operation){const n=e.getMutationType();if(!n)throw new r.GraphQLError("Schema is not configured for mutations.",{nodes:t});return n}if("subscription"===t.operation){const n=e.getSubscriptionType();if(!n)throw new r.GraphQLError("Schema is not configured for subscriptions.",{nodes:t});return n}throw new r.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:t})};var r=n(5822)},9548:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BreakingChangeType",{enumerable:!0,get:function(){return _.BreakingChangeType}}),Object.defineProperty(t,"DangerousChangeType",{enumerable:!0,get:function(){return _.DangerousChangeType}}),Object.defineProperty(t,"TypeInfo",{enumerable:!0,get:function(){return v.TypeInfo}}),Object.defineProperty(t,"assertValidName",{enumerable:!0,get:function(){return T.assertValidName}}),Object.defineProperty(t,"astFromValue",{enumerable:!0,get:function(){return m.astFromValue}}),Object.defineProperty(t,"buildASTSchema",{enumerable:!0,get:function(){return c.buildASTSchema}}),Object.defineProperty(t,"buildClientSchema",{enumerable:!0,get:function(){return s.buildClientSchema}}),Object.defineProperty(t,"buildSchema",{enumerable:!0,get:function(){return c.buildSchema}}),Object.defineProperty(t,"coerceInputValue",{enumerable:!0,get:function(){return y.coerceInputValue}}),Object.defineProperty(t,"concatAST",{enumerable:!0,get:function(){return g.concatAST}}),Object.defineProperty(t,"doTypesOverlap",{enumerable:!0,get:function(){return w.doTypesOverlap}}),Object.defineProperty(t,"extendSchema",{enumerable:!0,get:function(){return l.extendSchema}}),Object.defineProperty(t,"findBreakingChanges",{enumerable:!0,get:function(){return _.findBreakingChanges}}),Object.defineProperty(t,"findDangerousChanges",{enumerable:!0,get:function(){return _.findDangerousChanges}}),Object.defineProperty(t,"getIntrospectionQuery",{enumerable:!0,get:function(){return r.getIntrospectionQuery}}),Object.defineProperty(t,"getOperationAST",{enumerable:!0,get:function(){return i.getOperationAST}}),Object.defineProperty(t,"getOperationRootType",{enumerable:!0,get:function(){return o.getOperationRootType}}),Object.defineProperty(t,"introspectionFromSchema",{enumerable:!0,get:function(){return a.introspectionFromSchema}}),Object.defineProperty(t,"isEqualType",{enumerable:!0,get:function(){return w.isEqualType}}),Object.defineProperty(t,"isTypeSubTypeOf",{enumerable:!0,get:function(){return w.isTypeSubTypeOf}}),Object.defineProperty(t,"isValidNameError",{enumerable:!0,get:function(){return T.isValidNameError}}),Object.defineProperty(t,"lexicographicSortSchema",{enumerable:!0,get:function(){return u.lexicographicSortSchema}}),Object.defineProperty(t,"printIntrospectionSchema",{enumerable:!0,get:function(){return p.printIntrospectionSchema}}),Object.defineProperty(t,"printSchema",{enumerable:!0,get:function(){return p.printSchema}}),Object.defineProperty(t,"printType",{enumerable:!0,get:function(){return p.printType}}),Object.defineProperty(t,"separateOperations",{enumerable:!0,get:function(){return b.separateOperations}}),Object.defineProperty(t,"stripIgnoredCharacters",{enumerable:!0,get:function(){return E.stripIgnoredCharacters}}),Object.defineProperty(t,"typeFromAST",{enumerable:!0,get:function(){return f.typeFromAST}}),Object.defineProperty(t,"valueFromAST",{enumerable:!0,get:function(){return d.valueFromAST}}),Object.defineProperty(t,"valueFromASTUntyped",{enumerable:!0,get:function(){return h.valueFromASTUntyped}}),Object.defineProperty(t,"visitWithTypeInfo",{enumerable:!0,get:function(){return v.visitWithTypeInfo}});var r=n(9363),i=n(9535),o=n(8678),a=n(8039),s=n(8686),c=n(2906),l=n(3242),u=n(8163),p=n(2821),f=n(5115),d=n(3770),h=n(7784),m=n(8115),v=n(6226),y=n(3679),g=n(6078),b=n(8243),E=n(2307),w=n(298),T=n(6526),_=n(3298)},8039:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.introspectionFromSchema=function(e,t){const n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,...t},s=(0,i.parse)((0,a.getIntrospectionQuery)(n)),c=(0,o.executeSync)({schema:e,document:s});return!c.errors&&c.data||(0,r.invariant)(!1),c.data};var r=n(7706),i=n(8370),o=n(192),a=n(9363)},8163:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lexicographicSortSchema=function(e){const t=e.toConfig(),n=(0,o.keyValMap)(f(t.types),(e=>e.name),(function(e){if((0,s.isScalarType)(e)||(0,l.isIntrospectionType)(e))return e;if((0,s.isObjectType)(e)){const t=e.toConfig();return new s.GraphQLObjectType({...t,interfaces:()=>g(t.interfaces),fields:()=>y(t.fields)})}if((0,s.isInterfaceType)(e)){const t=e.toConfig();return new s.GraphQLInterfaceType({...t,interfaces:()=>g(t.interfaces),fields:()=>y(t.fields)})}if((0,s.isUnionType)(e)){const t=e.toConfig();return new s.GraphQLUnionType({...t,types:()=>g(t.types)})}if((0,s.isEnumType)(e)){const t=e.toConfig();return new s.GraphQLEnumType({...t,values:p(t.values,(e=>e))})}if((0,s.isInputObjectType)(e)){const t=e.toConfig();return new s.GraphQLInputObjectType({...t,fields:()=>p(t.fields,(e=>({...e,type:a(e.type)})))})}(0,i.invariant)(!1,"Unexpected type: "+(0,r.inspect)(e))}));return new u.GraphQLSchema({...t,types:Object.values(n),directives:f(t.directives).map((function(e){const t=e.toConfig();return new c.GraphQLDirective({...t,locations:d(t.locations,(e=>e)),args:v(t.args)})})),query:m(t.query),mutation:m(t.mutation),subscription:m(t.subscription)});function a(e){return(0,s.isListType)(e)?new s.GraphQLList(a(e.ofType)):(0,s.isNonNullType)(e)?new s.GraphQLNonNull(a(e.ofType)):h(e)}function h(e){return n[e.name]}function m(e){return e&&h(e)}function v(e){return p(e,(e=>({...e,type:a(e.type)})))}function y(e){return p(e,(e=>({...e,type:a(e.type),args:e.args&&v(e.args)})))}function g(e){return f(e).map(h)}};var r=n(8002),i=n(7706),o=n(7154),a=n(5250),s=n(5003),c=n(7197),l=n(8155),u=n(6829);function p(e,t){const n=Object.create(null);for(const r of Object.keys(e).sort(a.naturalCompare))n[r]=t(e[r]);return n}function f(e){return d(e,(e=>e.name))}function d(e,t){return e.slice().sort(((e,n)=>{const r=t(e),i=t(n);return(0,a.naturalCompare)(r,i)}))}},2821:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printIntrospectionSchema=function(e){return h(e,l.isSpecifiedDirective,u.isIntrospectionType)},t.printSchema=function(e){return h(e,(e=>!(0,l.isSpecifiedDirective)(e)),d)},t.printType=v;var r=n(8002),i=n(7706),o=n(849),a=n(2828),s=n(3033),c=n(5003),l=n(7197),u=n(8155),p=n(2229),f=n(8115);function d(e){return!(0,p.isSpecifiedScalarType)(e)&&!(0,u.isIntrospectionType)(e)}function h(e,t,n){const r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[m(e),...r.map((e=>function(e){return _(e)+"directive @"+e.name+E(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...i.map((e=>v(e)))].filter(Boolean).join("\n\n")}function m(e){if(null==e.description&&function(e){const t=e.getQueryType();if(t&&"Query"!==t.name)return!1;const n=e.getMutationType();if(n&&"Mutation"!==n.name)return!1;const r=e.getSubscriptionType();return!r||"Subscription"===r.name}(e))return;const t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);const r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),_(e)+`schema {\n${t.join("\n")}\n}`}function v(e){return(0,c.isScalarType)(e)?function(e){return _(e)+`scalar ${e.name}`+(null==(t=e).specifiedByURL?"":` @specifiedBy(url: ${(0,s.print)({kind:a.Kind.STRING,value:t.specifiedByURL})})`);var t}(e):(0,c.isObjectType)(e)?function(e){return _(e)+`type ${e.name}`+y(e)+g(e)}(e):(0,c.isInterfaceType)(e)?function(e){return _(e)+`interface ${e.name}`+y(e)+g(e)}(e):(0,c.isUnionType)(e)?function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return _(e)+"union "+e.name+n}(e):(0,c.isEnumType)(e)?function(e){const t=e.getValues().map(((e,t)=>_(e," ",!t)+" "+e.name+T(e.deprecationReason)));return _(e)+`enum ${e.name}`+b(t)}(e):(0,c.isInputObjectType)(e)?function(e){const t=Object.values(e.getFields()).map(((e,t)=>_(e," ",!t)+" "+w(e)));return _(e)+`input ${e.name}`+b(t)}(e):void(0,i.invariant)(!1,"Unexpected type: "+(0,r.inspect)(e))}function y(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function g(e){return b(Object.values(e.getFields()).map(((e,t)=>_(e," ",!t)+" "+e.name+E(e.args," ")+": "+String(e.type)+T(e.deprecationReason))))}function b(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function E(e,t=""){return 0===e.length?"":e.every((e=>!e.description))?"("+e.map(w).join(", ")+")":"(\n"+e.map(((e,n)=>_(e," "+t,!n)+" "+t+w(e))).join("\n")+"\n"+t+")"}function w(e){const t=(0,f.astFromValue)(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${(0,s.print)(t)}`),n+T(e.deprecationReason)}function T(e){return null==e?"":e!==l.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,s.print)({kind:a.Kind.STRING,value:e})})`:" @deprecated"}function _(e,t="",n=!0){const{description:r}=e;return null==r?"":(t&&!n?"\n"+t:t)+(0,s.print)({kind:a.Kind.STRING,value:r,block:(0,o.isPrintableAsBlockString)(r)}).replace(/\n/g,"\n"+t)+"\n"}},8243:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.separateOperations=function(e){const t=[],n=Object.create(null);for(const i of e.definitions)switch(i.kind){case r.Kind.OPERATION_DEFINITION:t.push(i);break;case r.Kind.FRAGMENT_DEFINITION:n[i.name.value]=a(i.selectionSet)}const i=Object.create(null);for(const s of t){const t=new Set;for(const e of a(s.selectionSet))o(t,n,e);i[s.name?s.name.value:""]={kind:r.Kind.DOCUMENT,definitions:e.definitions.filter((e=>e===s||e.kind===r.Kind.FRAGMENT_DEFINITION&&t.has(e.name.value)))}}return i};var r=n(2828),i=n(285);function o(e,t,n){if(!e.has(n)){e.add(n);const r=t[n];if(void 0!==r)for(const n of r)o(e,t,n)}}function a(e){const t=[];return(0,i.visit)(e,{FragmentSpread(e){t.push(e.name.value)}}),t}},6830:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortValueNode=function e(t){switch(t.kind){case i.Kind.OBJECT:return{...t,fields:(n=t.fields,n.map((t=>({...t,value:e(t.value)}))).sort(((e,t)=>(0,r.naturalCompare)(e.name.value,t.name.value))))};case i.Kind.LIST:return{...t,values:t.values.map(e)};case i.Kind.INT:case i.Kind.FLOAT:case i.Kind.STRING:case i.Kind.BOOLEAN:case i.Kind.NULL:case i.Kind.ENUM:case i.Kind.VARIABLE:return t}var n};var r=n(5250),i=n(2828)},2307:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stripIgnoredCharacters=function(e){const t=(0,o.isSource)(e)?e:new o.Source(e),n=t.body,s=new i.Lexer(t);let c="",l=!1;for(;s.advance().kind!==a.TokenKind.EOF;){const e=s.token,t=e.kind,o=!(0,i.isPunctuatorTokenKind)(e.kind);l&&(o||e.kind===a.TokenKind.SPREAD)&&(c+=" ");const u=n.slice(e.start,e.end);t===a.TokenKind.BLOCK_STRING?c+=(0,r.printBlockString)(e.value,{minimize:!0}):c+=u,l=o}return c};var r=n(849),i=n(4274),o=n(2412),a=n(3175)},298:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doTypesOverlap=function(e,t,n){return t===n||((0,r.isAbstractType)(t)?(0,r.isAbstractType)(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!(0,r.isAbstractType)(n)&&e.isSubType(n,t))},t.isEqualType=function e(t,n){return t===n||((0,r.isNonNullType)(t)&&(0,r.isNonNullType)(n)||!(!(0,r.isListType)(t)||!(0,r.isListType)(n)))&&e(t.ofType,n.ofType)},t.isTypeSubTypeOf=function e(t,n,i){return n===i||((0,r.isNonNullType)(i)?!!(0,r.isNonNullType)(n)&&e(t,n.ofType,i.ofType):(0,r.isNonNullType)(n)?e(t,n.ofType,i):(0,r.isListType)(i)?!!(0,r.isListType)(n)&&e(t,n.ofType,i.ofType):!(0,r.isListType)(n)&&((0,r.isAbstractType)(i)&&((0,r.isInterfaceType)(n)||(0,r.isObjectType)(n))&&t.isSubType(i,n)))};var r=n(5003)},5115:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeFromAST=function e(t,n){switch(n.kind){case r.Kind.LIST_TYPE:{const r=e(t,n.type);return r&&new i.GraphQLList(r)}case r.Kind.NON_NULL_TYPE:{const r=e(t,n.type);return r&&new i.GraphQLNonNull(r)}case r.Kind.NAMED_TYPE:return t.getType(n.name.value)}};var r=n(2828),i=n(5003)},3770:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.valueFromAST=function e(t,n,l){if(t){if(t.kind===a.Kind.VARIABLE){const e=t.name.value;if(null==l||void 0===l[e])return;const r=l[e];if(null===r&&(0,s.isNonNullType)(n))return;return r}if((0,s.isNonNullType)(n)){if(t.kind===a.Kind.NULL)return;return e(t,n.ofType,l)}if(t.kind===a.Kind.NULL)return null;if((0,s.isListType)(n)){const r=n.ofType;if(t.kind===a.Kind.LIST){const n=[];for(const i of t.values)if(c(i,l)){if((0,s.isNonNullType)(r))return;n.push(null)}else{const t=e(i,r,l);if(void 0===t)return;n.push(t)}return n}const i=e(t,r,l);if(void 0===i)return;return[i]}if((0,s.isInputObjectType)(n)){if(t.kind!==a.Kind.OBJECT)return;const r=Object.create(null),i=(0,o.keyMap)(t.fields,(e=>e.name.value));for(const t of Object.values(n.getFields())){const n=i[t.name];if(!n||c(n.value,l)){if(void 0!==t.defaultValue)r[t.name]=t.defaultValue;else if((0,s.isNonNullType)(t.type))return;continue}const o=e(n.value,t.type,l);if(void 0===o)return;r[t.name]=o}return r}if((0,s.isLeafType)(n)){let e;try{e=n.parseLiteral(t,l)}catch(e){return}if(void 0===e)return;return e}(0,i.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(n))}};var r=n(8002),i=n(7706),o=n(2863),a=n(2828),s=n(5003);function c(e,t){return e.kind===a.Kind.VARIABLE&&(null==t||void 0===t[e.name.value])}},7784:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.valueFromASTUntyped=function e(t,n){switch(t.kind){case i.Kind.NULL:return null;case i.Kind.INT:return parseInt(t.value,10);case i.Kind.FLOAT:return parseFloat(t.value);case i.Kind.STRING:case i.Kind.ENUM:case i.Kind.BOOLEAN:return t.value;case i.Kind.LIST:return t.values.map((t=>e(t,n)));case i.Kind.OBJECT:return(0,r.keyValMap)(t.fields,(e=>e.name.value),(t=>e(t.value,n)));case i.Kind.VARIABLE:return null==n?void 0:n[t.name.value]}};var r=n(7154),i=n(2828)},3955:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationContext=t.SDLValidationContext=t.ASTValidationContext=void 0;var r=n(2828),i=n(285),o=n(6226);class a{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===r.Kind.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let i;for(;i=n.pop();)for(const e of i.selections)e.kind===r.Kind.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=Object.create(null),r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!0!==n[i]){n[i]=!0;const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}t.ASTValidationContext=a;class s extends a{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}t.SDLValidationContext=s;class c extends a{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new o.TypeInfo(this._schema);(0,i.visit)(e,(0,o.visitWithTypeInfo)(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}t.ValidationContext=c},1122:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return a.ExecutableDefinitionsRule}}),Object.defineProperty(t,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return s.FieldsOnCorrectTypeRule}}),Object.defineProperty(t,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return c.FragmentsOnCompositeTypesRule}}),Object.defineProperty(t,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return l.KnownArgumentNamesRule}}),Object.defineProperty(t,"KnownDirectivesRule",{enumerable:!0,get:function(){return u.KnownDirectivesRule}}),Object.defineProperty(t,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return p.KnownFragmentNamesRule}}),Object.defineProperty(t,"KnownTypeNamesRule",{enumerable:!0,get:function(){return f.KnownTypeNamesRule}}),Object.defineProperty(t,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return d.LoneAnonymousOperationRule}}),Object.defineProperty(t,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return D.LoneSchemaDefinitionRule}}),Object.defineProperty(t,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return Q.NoDeprecatedCustomRule}}),Object.defineProperty(t,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return h.NoFragmentCyclesRule}}),Object.defineProperty(t,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return q.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(t,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return m.NoUndefinedVariablesRule}}),Object.defineProperty(t,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return v.NoUnusedFragmentsRule}}),Object.defineProperty(t,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return y.NoUnusedVariablesRule}}),Object.defineProperty(t,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return g.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(t,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return b.PossibleFragmentSpreadsRule}}),Object.defineProperty(t,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return V.PossibleTypeExtensionsRule}}),Object.defineProperty(t,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return E.ProvidedRequiredArgumentsRule}}),Object.defineProperty(t,"ScalarLeafsRule",{enumerable:!0,get:function(){return w.ScalarLeafsRule}}),Object.defineProperty(t,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return T.SingleFieldSubscriptionsRule}}),Object.defineProperty(t,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return j.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(t,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return _.UniqueArgumentNamesRule}}),Object.defineProperty(t,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return F.UniqueDirectiveNamesRule}}),Object.defineProperty(t,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return k.UniqueDirectivesPerLocationRule}}),Object.defineProperty(t,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return R.UniqueEnumValueNamesRule}}),Object.defineProperty(t,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return M.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(t,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return O.UniqueFragmentNamesRule}}),Object.defineProperty(t,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return S.UniqueInputFieldNamesRule}}),Object.defineProperty(t,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return x.UniqueOperationNamesRule}}),Object.defineProperty(t,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return I.UniqueOperationTypesRule}}),Object.defineProperty(t,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return P.UniqueTypeNamesRule}}),Object.defineProperty(t,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return C.UniqueVariableNamesRule}}),Object.defineProperty(t,"ValidationContext",{enumerable:!0,get:function(){return i.ValidationContext}}),Object.defineProperty(t,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return N.ValuesOfCorrectTypeRule}}),Object.defineProperty(t,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return A.VariablesAreInputTypesRule}}),Object.defineProperty(t,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return L.VariablesInAllowedPositionRule}}),Object.defineProperty(t,"specifiedRules",{enumerable:!0,get:function(){return o.specifiedRules}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return r.validate}});var r=n(9504),i=n(3955),o=n(4710),a=n(5285),s=n(9426),c=n(3558),l=n(9989),u=n(2826),p=n(1843),f=n(5961),d=n(870),h=n(658),m=n(7459),v=n(7317),y=n(8769),g=n(4331),b=n(5904),E=n(4312),w=n(7168),T=n(4666),_=n(4986),k=n(3576),O=n(5883),S=n(4313),x=n(2139),C=n(4243),N=n(6869),A=n(4942),L=n(8034),D=n(3411),I=n(856),P=n(1686),R=n(6400),M=n(4046),j=n(3878),F=n(6753),V=n(5715),Q=n(2860),q=n(2276)},5285:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExecutableDefinitionsRule=function(e){return{Document(t){for(const n of t.definitions)if(!(0,o.isExecutableDefinitionNode)(n)){const t=n.kind===i.Kind.SCHEMA_DEFINITION||n.kind===i.Kind.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new r.GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}};var r=n(5822),i=n(2828),o=n(1352)},9426:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldsOnCorrectTypeRule=function(e){return{Field(t){const n=e.getParentType();if(n&&!e.getFieldDef()){const c=e.getSchema(),l=t.name.value;let u=(0,r.didYouMean)("to use an inline fragment on",function(e,t,n){if(!(0,s.isAbstractType)(t))return[];const r=new Set,o=Object.create(null);for(const i of e.getPossibleTypes(t))if(i.getFields()[n]){r.add(i),o[i.name]=1;for(const e of i.getInterfaces()){var a;e.getFields()[n]&&(r.add(e),o[e.name]=(null!==(a=o[e.name])&&void 0!==a?a:0)+1)}}return[...r].sort(((t,n)=>{const r=o[n.name]-o[t.name];return 0!==r?r:(0,s.isInterfaceType)(t)&&e.isSubType(t,n)?-1:(0,s.isInterfaceType)(n)&&e.isSubType(n,t)?1:(0,i.naturalCompare)(t.name,n.name)})).map((e=>e.name))}(c,n,l));""===u&&(u=(0,r.didYouMean)(function(e,t){if((0,s.isObjectType)(e)||(0,s.isInterfaceType)(e)){const n=Object.keys(e.getFields());return(0,o.suggestionList)(t,n)}return[]}(n,l))),e.reportError(new a.GraphQLError(`Cannot query field "${l}" on type "${n.name}".`+u,{nodes:t}))}}}};var r=n(166),i=n(5250),o=n(8070),a=n(5822),s=n(5003)},3558:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FragmentsOnCompositeTypesRule=function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=(0,a.typeFromAST)(e.getSchema(),n);if(t&&!(0,o.isCompositeType)(t)){const t=(0,i.print)(n);e.reportError(new r.GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=(0,a.typeFromAST)(e.getSchema(),t.typeCondition);if(n&&!(0,o.isCompositeType)(n)){const n=(0,i.print)(t.typeCondition);e.reportError(new r.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}};var r=n(5822),i=n(3033),o=n(5003),a=n(5115)},9989:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KnownArgumentNamesOnDirectivesRule=c,t.KnownArgumentNamesRule=function(e){return{...c(e),Argument(t){const n=e.getArgument(),a=e.getFieldDef(),s=e.getParentType();if(!n&&a&&s){const n=t.name.value,c=a.args.map((e=>e.name)),l=(0,i.suggestionList)(n,c);e.reportError(new o.GraphQLError(`Unknown argument "${n}" on field "${s.name}.${a.name}".`+(0,r.didYouMean)(l),{nodes:t}))}}}};var r=n(166),i=n(8070),o=n(5822),a=n(2828),s=n(7197);function c(e){const t=Object.create(null),n=e.getSchema(),c=n?n.getDirectives():s.specifiedDirectives;for(const e of c)t[e.name]=e.args.map((e=>e.name));const l=e.getDocument().definitions;for(const e of l)if(e.kind===a.Kind.DIRECTIVE_DEFINITION){var u;const n=null!==(u=e.arguments)&&void 0!==u?u:[];t[e.name.value]=n.map((e=>e.name.value))}return{Directive(n){const a=n.name.value,s=t[a];if(n.arguments&&s)for(const t of n.arguments){const n=t.name.value;if(!s.includes(n)){const c=(0,i.suggestionList)(n,s);e.reportError(new o.GraphQLError(`Unknown argument "${n}" on directive "@${a}".`+(0,r.didYouMean)(c),{nodes:t}))}}return!1}}}},2826:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KnownDirectivesRule=function(e){const t=Object.create(null),n=e.getSchema(),u=n?n.getDirectives():l.specifiedDirectives;for(const e of u)t[e.name]=e.locations;const p=e.getDocument().definitions;for(const e of p)e.kind===c.Kind.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map((e=>e.value)));return{Directive(n,l,u,p,f){const d=n.name.value,h=t[d];if(!h)return void e.reportError(new o.GraphQLError(`Unknown directive "@${d}".`,{nodes:n}));const m=function(e){const t=e[e.length-1];switch("kind"in t||(0,i.invariant)(!1),t.kind){case c.Kind.OPERATION_DEFINITION:return function(e){switch(e){case a.OperationTypeNode.QUERY:return s.DirectiveLocation.QUERY;case a.OperationTypeNode.MUTATION:return s.DirectiveLocation.MUTATION;case a.OperationTypeNode.SUBSCRIPTION:return s.DirectiveLocation.SUBSCRIPTION}}(t.operation);case c.Kind.FIELD:return s.DirectiveLocation.FIELD;case c.Kind.FRAGMENT_SPREAD:return s.DirectiveLocation.FRAGMENT_SPREAD;case c.Kind.INLINE_FRAGMENT:return s.DirectiveLocation.INLINE_FRAGMENT;case c.Kind.FRAGMENT_DEFINITION:return s.DirectiveLocation.FRAGMENT_DEFINITION;case c.Kind.VARIABLE_DEFINITION:return s.DirectiveLocation.VARIABLE_DEFINITION;case c.Kind.SCHEMA_DEFINITION:case c.Kind.SCHEMA_EXTENSION:return s.DirectiveLocation.SCHEMA;case c.Kind.SCALAR_TYPE_DEFINITION:case c.Kind.SCALAR_TYPE_EXTENSION:return s.DirectiveLocation.SCALAR;case c.Kind.OBJECT_TYPE_DEFINITION:case c.Kind.OBJECT_TYPE_EXTENSION:return s.DirectiveLocation.OBJECT;case c.Kind.FIELD_DEFINITION:return s.DirectiveLocation.FIELD_DEFINITION;case c.Kind.INTERFACE_TYPE_DEFINITION:case c.Kind.INTERFACE_TYPE_EXTENSION:return s.DirectiveLocation.INTERFACE;case c.Kind.UNION_TYPE_DEFINITION:case c.Kind.UNION_TYPE_EXTENSION:return s.DirectiveLocation.UNION;case c.Kind.ENUM_TYPE_DEFINITION:case c.Kind.ENUM_TYPE_EXTENSION:return s.DirectiveLocation.ENUM;case c.Kind.ENUM_VALUE_DEFINITION:return s.DirectiveLocation.ENUM_VALUE;case c.Kind.INPUT_OBJECT_TYPE_DEFINITION:case c.Kind.INPUT_OBJECT_TYPE_EXTENSION:return s.DirectiveLocation.INPUT_OBJECT;case c.Kind.INPUT_VALUE_DEFINITION:{const t=e[e.length-3];return"kind"in t||(0,i.invariant)(!1),t.kind===c.Kind.INPUT_OBJECT_TYPE_DEFINITION?s.DirectiveLocation.INPUT_FIELD_DEFINITION:s.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,i.invariant)(!1,"Unexpected kind: "+(0,r.inspect)(t.kind))}}(f);m&&!h.includes(m)&&e.reportError(new o.GraphQLError(`Directive "@${d}" may not be used on ${m}.`,{nodes:n}))}}};var r=n(8002),i=n(7706),o=n(5822),a=n(1807),s=n(8333),c=n(2828),l=n(7197)},1843:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KnownFragmentNamesRule=function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new r.GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}};var r=n(5822)},5961:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KnownTypeNamesRule=function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),s=Object.create(null);for(const t of e.getDocument().definitions)(0,a.isTypeDefinitionNode)(t)&&(s[t.name.value]=!0);const l=[...Object.keys(n),...Object.keys(s)];return{NamedType(t,u,p,f,d){const h=t.name.value;if(!n[h]&&!s[h]){var m;const n=null!==(m=d[2])&&void 0!==m?m:p,s=null!=n&&"kind"in(v=n)&&((0,a.isTypeSystemDefinitionNode)(v)||(0,a.isTypeSystemExtensionNode)(v));if(s&&c.includes(h))return;const u=(0,i.suggestionList)(h,s?c.concat(l):l);e.reportError(new o.GraphQLError(`Unknown type "${h}".`+(0,r.didYouMean)(u),{nodes:t}))}var v}}};var r=n(166),i=n(8070),o=n(5822),a=n(1352),s=n(8155);const c=[...n(2229).specifiedScalarTypes,...s.introspectionTypes].map((e=>e.name))},870:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoneAnonymousOperationRule=function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===i.Kind.OPERATION_DEFINITION)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new r.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}};var r=n(5822),i=n(2828)},3411:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoneSchemaDefinitionRule=function(e){var t,n,i;const o=e.getSchema(),a=null!==(t=null!==(n=null!==(i=null==o?void 0:o.astNode)&&void 0!==i?i:null==o?void 0:o.getQueryType())&&void 0!==n?n:null==o?void 0:o.getMutationType())&&void 0!==t?t:null==o?void 0:o.getSubscriptionType();let s=0;return{SchemaDefinition(t){a?e.reportError(new r.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:t})):(s>0&&e.reportError(new r.GraphQLError("Must provide only one schema definition.",{nodes:t})),++s)}}};var r=n(5822)},658:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoFragmentCyclesRule=function(e){const t=Object.create(null),n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(o(e),!1)};function o(a){if(t[a.name.value])return;const s=a.name.value;t[s]=!0;const c=e.getFragmentSpreads(a.selectionSet);if(0!==c.length){i[s]=n.length;for(const t of c){const a=t.name.value,s=i[a];if(n.push(t),void 0===s){const t=e.getFragment(a);t&&o(t)}else{const t=n.slice(s),i=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new r.GraphQLError(`Cannot spread fragment "${a}" within itself`+(""!==i?` via ${i}.`:"."),{nodes:t}))}n.pop()}i[s]=void 0}}};var r=n(5822)},7459:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoUndefinedVariablesRule=function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const i=e.getRecursiveVariableUsages(n);for(const{node:o}of i){const i=o.name.value;!0!==t[i]&&e.reportError(new r.GraphQLError(n.name?`Variable "$${i}" is not defined by operation "${n.name.value}".`:`Variable "$${i}" is not defined.`,{nodes:[o,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}};var r=n(5822)},7317:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoUnusedFragmentsRule=function(e){const t=[],n=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){const i=Object.create(null);for(const n of t)for(const t of e.getRecursivelyReferencedFragments(n))i[t.name.value]=!0;for(const t of n){const n=t.name.value;!0!==i[n]&&e.reportError(new r.GraphQLError(`Fragment "${n}" is never used.`,{nodes:t}))}}}}};var r=n(5822)},8769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoUnusedVariablesRule=function(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){const i=Object.create(null),o=e.getRecursiveVariableUsages(n);for(const{node:e}of o)i[e.name.value]=!0;for(const o of t){const t=o.variable.name.value;!0!==i[t]&&e.reportError(new r.GraphQLError(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:o}))}}},VariableDefinition(e){t.push(e)}}};var r=n(5822)},4331:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverlappingFieldsCanBeMergedRule=function(e){const t=new E,n=new Map;return{SelectionSet(r){const o=function(e,t,n,r,i){const o=[],[a,s]=y(e,t,r,i);if(function(e,t,n,r,i){for(const[o,a]of Object.entries(i))if(a.length>1)for(let i=0;i`subfields "${e}" conflict because `+u(t))).join(" and "):e}function p(e,t,n,r,i,o,a){const s=e.getFragment(a);if(!s)return;const[c,l]=g(e,n,s);if(o!==c){d(e,t,n,r,i,o,c);for(const s of l)r.has(s,a,i)||(r.add(s,a,i),p(e,t,n,r,i,o,s))}}function f(e,t,n,r,i,o,a){if(o===a)return;if(r.has(o,a,i))return;r.add(o,a,i);const s=e.getFragment(o),c=e.getFragment(a);if(!s||!c)return;const[l,u]=g(e,n,s),[p,h]=g(e,n,c);d(e,t,n,r,i,l,p);for(const a of h)f(e,t,n,r,i,o,a);for(const o of u)f(e,t,n,r,i,o,a)}function d(e,t,n,r,i,o,a){for(const[s,c]of Object.entries(o)){const o=a[s];if(o)for(const a of c)for(const c of o){const o=h(e,n,r,i,s,a,c);o&&t.push(o)}}}function h(e,t,n,i,o,a,c){const[l,u,h]=a,[g,b,E]=c,w=i||l!==g&&(0,s.isObjectType)(l)&&(0,s.isObjectType)(g);if(!w){const e=u.name.value,t=b.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[u],[b]];if(!function(e,t){const n=e.arguments,r=t.arguments;if(void 0===n||0===n.length)return void 0===r||0===r.length;if(void 0===r||0===r.length)return!1;if(n.length!==r.length)return!1;const i=new Map(r.map((({name:e,value:t})=>[e.value,t])));return n.every((e=>{const t=e.value,n=i.get(e.name.value);return void 0!==n&&m(t)===m(n)}))}(u,b))return[[o,"they have differing arguments"],[u],[b]]}const T=null==h?void 0:h.type,_=null==E?void 0:E.type;if(T&&_&&v(T,_))return[[o,`they return conflicting types "${(0,r.inspect)(T)}" and "${(0,r.inspect)(_)}"`],[u],[b]];const k=u.selectionSet,O=b.selectionSet;if(k&&O){const r=function(e,t,n,r,i,o,a,s){const c=[],[l,u]=y(e,t,i,o),[h,m]=y(e,t,a,s);d(e,c,t,n,r,l,h);for(const i of m)p(e,c,t,n,r,l,i);for(const i of u)p(e,c,t,n,r,h,i);for(const i of u)for(const o of m)f(e,c,t,n,r,i,o);return c}(e,t,n,w,(0,s.getNamedType)(T),k,(0,s.getNamedType)(_),O);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,o,u,b)}}function m(e){return(0,a.print)((0,c.sortValueNode)(e))}function v(e,t){return(0,s.isListType)(e)?!(0,s.isListType)(t)||v(e.ofType,t.ofType):!!(0,s.isListType)(t)||((0,s.isNonNullType)(e)?!(0,s.isNonNullType)(t)||v(e.ofType,t.ofType):!!(0,s.isNonNullType)(t)||!(!(0,s.isLeafType)(e)&&!(0,s.isLeafType)(t))&&e!==t)}function y(e,t,n,r){const i=t.get(r);if(i)return i;const o=Object.create(null),a=Object.create(null);b(e,n,r,o,a);const s=[o,Object.keys(a)];return t.set(r,s),s}function g(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=(0,l.typeFromAST)(e.getSchema(),n.typeCondition);return y(e,t,i,n.selectionSet)}function b(e,t,n,r,i){for(const a of n.selections)switch(a.kind){case o.Kind.FIELD:{const e=a.name.value;let n;((0,s.isObjectType)(t)||(0,s.isInterfaceType)(t))&&(n=t.getFields()[e]);const i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,a,n]);break}case o.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case o.Kind.INLINE_FRAGMENT:{const n=a.typeCondition,o=n?(0,l.typeFromAST)(e.getSchema(),n):t;b(e,o,a.selectionSet,r,i);break}}}class E{constructor(){this._data=new Map}has(e,t,n){var r;const[i,o]=ee.name.value)));for(const n of i.args)if(!a.has(n.name)&&(0,c.isRequiredArgument)(n)){const a=(0,r.inspect)(n.type);e.reportError(new o.GraphQLError(`Field "${i.name}" argument "${n.name}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}};var r=n(8002),i=n(2863),o=n(5822),a=n(2828),s=n(3033),c=n(5003),l=n(7197);function u(e){var t;const n=Object.create(null),u=e.getSchema(),f=null!==(t=null==u?void 0:u.getDirectives())&&void 0!==t?t:l.specifiedDirectives;for(const e of f)n[e.name]=(0,i.keyMap)(e.args.filter(c.isRequiredArgument),(e=>e.name));const d=e.getDocument().definitions;for(const e of d)if(e.kind===a.Kind.DIRECTIVE_DEFINITION){var h;const t=null!==(h=e.arguments)&&void 0!==h?h:[];n[e.name.value]=(0,i.keyMap)(t.filter(p),(e=>e.name.value))}return{Directive:{leave(t){const i=t.name.value,a=n[i];if(a){var l;const n=null!==(l=t.arguments)&&void 0!==l?l:[],u=new Set(n.map((e=>e.name.value)));for(const[n,l]of Object.entries(a))if(!u.has(n)){const a=(0,c.isType)(l.type)?(0,r.inspect)(l.type):(0,s.print)(l.type);e.reportError(new o.GraphQLError(`Directive "@${i}" argument "${n}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}}function p(e){return e.type.kind===a.Kind.NON_NULL_TYPE&&null==e.defaultValue}},7168:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScalarLeafsRule=function(e){return{Field(t){const n=e.getType(),a=t.selectionSet;if(n)if((0,o.isLeafType)((0,o.getNamedType)(n))){if(a){const o=t.name.value,s=(0,r.inspect)(n);e.reportError(new i.GraphQLError(`Field "${o}" must not have a selection since type "${s}" has no subfields.`,{nodes:a}))}}else if(!a){const o=t.name.value,a=(0,r.inspect)(n);e.reportError(new i.GraphQLError(`Field "${o}" of type "${a}" must have a selection of subfields. Did you mean "${o} { ... }"?`,{nodes:t}))}}}};var r=n(8002),i=n(5822),o=n(5003)},4666:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleFieldSubscriptionsRule=function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),a=n.getSubscriptionType();if(a){const s=t.name?t.name.value:null,c=Object.create(null),l=e.getDocument(),u=Object.create(null);for(const e of l.definitions)e.kind===i.Kind.FRAGMENT_DEFINITION&&(u[e.name.value]=e);const p=(0,o.collectFields)(n,u,c,a,t.selectionSet);if(p.size>1){const t=[...p.values()].slice(1).flat();e.reportError(new r.GraphQLError(null!=s?`Subscription "${s}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of p.values())t[0].name.value.startsWith("__")&&e.reportError(new r.GraphQLError(null!=s?`Subscription "${s}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}};var r=n(5822),i=n(2828),o=n(8950)},3878:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueArgumentDefinitionNamesRule=function(e){return{DirectiveDefinition(e){var t;const r=null!==(t=e.arguments)&&void 0!==t?t:[];return n(`@${e.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t;const r=e.name.value,i=null!==(t=e.fields)&&void 0!==t?t:[];for(const e of i){var o;n(`${r}.${e.name.value}`,null!==(o=e.arguments)&&void 0!==o?o:[])}return!1}function n(t,n){const o=(0,r.groupBy)(n,(e=>e.name.value));for(const[n,r]of o)r.length>1&&e.reportError(new i.GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:r.map((e=>e.name))}));return!1}};var r=n(4620),i=n(5822)},4986:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueArgumentNamesRule=function(e){return{Field:t,Directive:t};function t(t){var n;const o=null!==(n=t.arguments)&&void 0!==n?n:[],a=(0,r.groupBy)(o,(e=>e.name.value));for(const[t,n]of a)n.length>1&&e.reportError(new i.GraphQLError(`There can be only one argument named "${t}".`,{nodes:n.map((e=>e.name))}))}};var r=n(4620),i=n(5822)},6753:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueDirectiveNamesRule=function(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(i){const o=i.name.value;if(null==n||!n.getDirective(o))return t[o]?e.reportError(new r.GraphQLError(`There can be only one directive named "@${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1;e.reportError(new r.GraphQLError(`Directive "@${o}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}))}}};var r=n(5822)},3576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueDirectivesPerLocationRule=function(e){const t=Object.create(null),n=e.getSchema(),s=n?n.getDirectives():a.specifiedDirectives;for(const e of s)t[e.name]=!e.isRepeatable;const c=e.getDocument().definitions;for(const e of c)e.kind===i.Kind.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);const l=Object.create(null),u=Object.create(null);return{enter(n){if(!("directives"in n)||!n.directives)return;let a;if(n.kind===i.Kind.SCHEMA_DEFINITION||n.kind===i.Kind.SCHEMA_EXTENSION)a=l;else if((0,o.isTypeDefinitionNode)(n)||(0,o.isTypeExtensionNode)(n)){const e=n.name.value;a=u[e],void 0===a&&(u[e]=a=Object.create(null))}else a=Object.create(null);for(const i of n.directives){const n=i.name.value;t[n]&&(a[n]?e.reportError(new r.GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[a[n],i]})):a[n]=i)}}}};var r=n(5822),i=n(2828),o=n(1352),a=n(7197)},6400:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueEnumValueNamesRule=function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),o=Object.create(null);return{EnumTypeDefinition:a,EnumTypeExtension:a};function a(t){var a;const s=t.name.value;o[s]||(o[s]=Object.create(null));const c=null!==(a=t.values)&&void 0!==a?a:[],l=o[s];for(const t of c){const o=t.name.value,a=n[s];(0,i.isEnumType)(a)&&a.getValue(o)?e.reportError(new r.GraphQLError(`Enum value "${s}.${o}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):l[o]?e.reportError(new r.GraphQLError(`Enum value "${s}.${o}" can only be defined once.`,{nodes:[l[o],t.name]})):l[o]=t.name}return!1}};var r=n(5822),i=n(5003)},4046:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueFieldDefinitionNamesRule=function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:a,InputObjectTypeExtension:a,InterfaceTypeDefinition:a,InterfaceTypeExtension:a,ObjectTypeDefinition:a,ObjectTypeExtension:a};function a(t){var a;const s=t.name.value;i[s]||(i[s]=Object.create(null));const c=null!==(a=t.fields)&&void 0!==a?a:[],l=i[s];for(const t of c){const i=t.name.value;o(n[s],i)?e.reportError(new r.GraphQLError(`Field "${s}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):l[i]?e.reportError(new r.GraphQLError(`Field "${s}.${i}" can only be defined once.`,{nodes:[l[i],t.name]})):l[i]=t.name}return!1}};var r=n(5822),i=n(5003);function o(e,t){return!!((0,i.isObjectType)(e)||(0,i.isInterfaceType)(e)||(0,i.isInputObjectType)(e))&&null!=e.getFields()[t]}},5883:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueFragmentNamesRule=function(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const i=n.name.value;return t[i]?e.reportError(new r.GraphQLError(`There can be only one fragment named "${i}".`,{nodes:[t[i],n.name]})):t[i]=n.name,!1}}};var r=n(5822)},4313:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueInputFieldNamesRule=function(e){const t=[];let n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){const e=t.pop();e||(0,r.invariant)(!1),n=e}},ObjectField(t){const r=t.name.value;n[r]?e.reportError(new i.GraphQLError(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}};var r=n(7706),i=n(5822)},2139:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueOperationNamesRule=function(e){const t=Object.create(null);return{OperationDefinition(n){const i=n.name;return i&&(t[i.value]?e.reportError(new r.GraphQLError(`There can be only one operation named "${i.value}".`,{nodes:[t[i.value],i]})):t[i.value]=i),!1},FragmentDefinition:()=>!1}};var r=n(5822)},856:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueOperationTypesRule=function(e){const t=e.getSchema(),n=Object.create(null),i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:o,SchemaExtension:o};function o(t){var o;const a=null!==(o=t.operationTypes)&&void 0!==o?o:[];for(const t of a){const o=t.operation,a=n[o];i[o]?e.reportError(new r.GraphQLError(`Type for ${o} already defined in the schema. It cannot be redefined.`,{nodes:t})):a?e.reportError(new r.GraphQLError(`There can be only one ${o} type in schema.`,{nodes:[a,t]})):n[o]=t}return!1}};var r=n(5822)},1686:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueTypeNamesRule=function(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(i){const o=i.name.value;if(null==n||!n.getType(o))return t[o]?e.reportError(new r.GraphQLError(`There can be only one type named "${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1;e.reportError(new r.GraphQLError(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}))}};var r=n(5822)},4243:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueVariableNamesRule=function(e){return{OperationDefinition(t){var n;const o=null!==(n=t.variableDefinitions)&&void 0!==n?n:[],a=(0,r.groupBy)(o,(e=>e.variable.name.value));for(const[t,n]of a)n.length>1&&e.reportError(new i.GraphQLError(`There can be only one variable named "$${t}".`,{nodes:n.map((e=>e.variable.name))}))}}};var r=n(4620),i=n(5822)},6869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValuesOfCorrectTypeRule=function(e){return{ListValue(t){const n=(0,l.getNullableType)(e.getParentInputType());if(!(0,l.isListType)(n))return u(e,t),!1},ObjectValue(t){const n=(0,l.getNamedType)(e.getInputType());if(!(0,l.isInputObjectType)(n))return u(e,t),!1;const r=(0,o.keyMap)(t.fields,(e=>e.name.value));for(const o of Object.values(n.getFields()))if(!r[o.name]&&(0,l.isRequiredInputField)(o)){const r=(0,i.inspect)(o.type);e.reportError(new s.GraphQLError(`Field "${n.name}.${o.name}" of required type "${r}" was not provided.`,{nodes:t}))}},ObjectField(t){const n=(0,l.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,l.isInputObjectType)(n)){const i=(0,a.suggestionList)(t.name.value,Object.keys(n.getFields()));e.reportError(new s.GraphQLError(`Field "${t.name.value}" is not defined by type "${n.name}".`+(0,r.didYouMean)(i),{nodes:t}))}},NullValue(t){const n=e.getInputType();(0,l.isNonNullType)(n)&&e.reportError(new s.GraphQLError(`Expected value of type "${(0,i.inspect)(n)}", found ${(0,c.print)(t)}.`,{nodes:t}))},EnumValue:t=>u(e,t),IntValue:t=>u(e,t),FloatValue:t=>u(e,t),StringValue:t=>u(e,t),BooleanValue:t=>u(e,t)}};var r=n(166),i=n(8002),o=n(2863),a=n(8070),s=n(5822),c=n(3033),l=n(5003);function u(e,t){const n=e.getInputType();if(!n)return;const r=(0,l.getNamedType)(n);if((0,l.isLeafType)(r))try{if(void 0===r.parseLiteral(t,void 0)){const r=(0,i.inspect)(n);e.reportError(new s.GraphQLError(`Expected value of type "${r}", found ${(0,c.print)(t)}.`,{nodes:t}))}}catch(r){const o=(0,i.inspect)(n);r instanceof s.GraphQLError?e.reportError(r):e.reportError(new s.GraphQLError(`Expected value of type "${o}", found ${(0,c.print)(t)}; `+r.message,{nodes:t,originalError:r}))}else{const r=(0,i.inspect)(n);e.reportError(new s.GraphQLError(`Expected value of type "${r}", found ${(0,c.print)(t)}.`,{nodes:t}))}}},4942:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VariablesAreInputTypesRule=function(e){return{VariableDefinition(t){const n=(0,a.typeFromAST)(e.getSchema(),t.type);if(void 0!==n&&!(0,o.isInputType)(n)){const n=t.variable.name.value,o=(0,i.print)(t.type);e.reportError(new r.GraphQLError(`Variable "$${n}" cannot be non-input type "${o}".`,{nodes:t.type}))}}}};var r=n(5822),i=n(3033),o=n(5003),a=n(5115)},8034:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VariablesInAllowedPositionRule=function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const o=e.getRecursiveVariableUsages(n);for(const{node:n,type:a,defaultValue:s}of o){const o=n.name.value,u=t[o];if(u&&a){const t=e.getSchema(),p=(0,c.typeFromAST)(t,u.type);if(p&&!l(t,p,u.defaultValue,a,s)){const t=(0,r.inspect)(p),s=(0,r.inspect)(a);e.reportError(new i.GraphQLError(`Variable "$${o}" of type "${t}" used in position expecting type "${s}".`,{nodes:[u,n]}))}}}}},VariableDefinition(e){t[e.variable.name.value]=e}}};var r=n(8002),i=n(5822),o=n(2828),a=n(5003),s=n(298),c=n(5115);function l(e,t,n,r,i){if((0,a.isNonNullType)(r)&&!(0,a.isNonNullType)(t)){const a=void 0!==i;if((null==n||n.kind===o.Kind.NULL)&&!a)return!1;const c=r.ofType;return(0,s.isTypeSubTypeOf)(e,t,c)}return(0,s.isTypeSubTypeOf)(e,t,r)}},2860:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoDeprecatedCustomRule=function(e){return{Field(t){const n=e.getFieldDef(),o=null==n?void 0:n.deprecationReason;if(n&&null!=o){const a=e.getParentType();null!=a||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`The field ${a.name}.${n.name} is deprecated. ${o}`,{nodes:t}))}},Argument(t){const n=e.getArgument(),o=null==n?void 0:n.deprecationReason;if(n&&null!=o){const a=e.getDirective();if(null!=a)e.reportError(new i.GraphQLError(`Directive "@${a.name}" argument "${n.name}" is deprecated. ${o}`,{nodes:t}));else{const a=e.getParentType(),s=e.getFieldDef();null!=a&&null!=s||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`Field "${a.name}.${s.name}" argument "${n.name}" is deprecated. ${o}`,{nodes:t}))}}},ObjectField(t){const n=(0,o.getNamedType)(e.getParentInputType());if((0,o.isInputObjectType)(n)){const r=n.getFields()[t.name.value],o=null==r?void 0:r.deprecationReason;null!=o&&e.reportError(new i.GraphQLError(`The input field ${n.name}.${r.name} is deprecated. ${o}`,{nodes:t}))}},EnumValue(t){const n=e.getEnumValue(),a=null==n?void 0:n.deprecationReason;if(n&&null!=a){const s=(0,o.getNamedType)(e.getInputType());null!=s||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`The enum value "${s.name}.${n.name}" is deprecated. ${a}`,{nodes:t}))}}}};var r=n(7706),i=n(5822),o=n(5003)},2276:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoSchemaIntrospectionCustomRule=function(e){return{Field(t){const n=(0,i.getNamedType)(e.getType());n&&(0,o.isIntrospectionType)(n)&&e.reportError(new r.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}};var r=n(5822),i=n(5003),o=n(8155)},4710:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.specifiedSDLRules=t.specifiedRules=void 0;var r=n(5285),i=n(9426),o=n(3558),a=n(9989),s=n(2826),c=n(1843),l=n(5961),u=n(870),p=n(3411),f=n(658),d=n(7459),h=n(7317),m=n(8769),v=n(4331),y=n(5904),g=n(5715),b=n(4312),E=n(7168),w=n(4666),T=n(3878),_=n(4986),k=n(6753),O=n(3576),S=n(6400),x=n(4046),C=n(5883),N=n(4313),A=n(2139),L=n(856),D=n(1686),I=n(4243),P=n(6869),R=n(4942),M=n(8034);const j=Object.freeze([r.ExecutableDefinitionsRule,A.UniqueOperationNamesRule,u.LoneAnonymousOperationRule,w.SingleFieldSubscriptionsRule,l.KnownTypeNamesRule,o.FragmentsOnCompositeTypesRule,R.VariablesAreInputTypesRule,E.ScalarLeafsRule,i.FieldsOnCorrectTypeRule,C.UniqueFragmentNamesRule,c.KnownFragmentNamesRule,h.NoUnusedFragmentsRule,y.PossibleFragmentSpreadsRule,f.NoFragmentCyclesRule,I.UniqueVariableNamesRule,d.NoUndefinedVariablesRule,m.NoUnusedVariablesRule,s.KnownDirectivesRule,O.UniqueDirectivesPerLocationRule,a.KnownArgumentNamesRule,_.UniqueArgumentNamesRule,P.ValuesOfCorrectTypeRule,b.ProvidedRequiredArgumentsRule,M.VariablesInAllowedPositionRule,v.OverlappingFieldsCanBeMergedRule,N.UniqueInputFieldNamesRule]);t.specifiedRules=j;const F=Object.freeze([p.LoneSchemaDefinitionRule,L.UniqueOperationTypesRule,D.UniqueTypeNamesRule,S.UniqueEnumValueNamesRule,x.UniqueFieldDefinitionNamesRule,T.UniqueArgumentDefinitionNamesRule,k.UniqueDirectiveNamesRule,l.KnownTypeNamesRule,s.KnownDirectivesRule,O.UniqueDirectivesPerLocationRule,g.PossibleTypeExtensionsRule,a.KnownArgumentNamesOnDirectivesRule,_.UniqueArgumentNamesRule,N.UniqueInputFieldNamesRule,b.ProvidedRequiredArgumentsOnDirectivesRule]);t.specifiedSDLRules=F},9504:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidSDL=function(e){const t=u(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))},t.assertValidSDLExtension=function(e,t){const n=u(e,t);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))},t.validate=function(e,t,n=c.specifiedRules,u,p=new s.TypeInfo(e)){var f;const d=null!==(f=null==u?void 0:u.maxErrors)&&void 0!==f?f:100;t||(0,r.devAssert)(!1,"Must provide document."),(0,a.assertValidSchema)(e);const h=Object.freeze({}),m=[],v=new l.ValidationContext(e,t,p,(e=>{if(m.length>=d)throw m.push(new i.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),h;m.push(e)})),y=(0,o.visitInParallel)(n.map((e=>e(v))));try{(0,o.visit)(t,(0,s.visitWithTypeInfo)(p,y))}catch(e){if(e!==h)throw e}return m},t.validateSDL=u;var r=n(7242),i=n(5822),o=n(285),a=n(1671),s=n(6226),c=n(4710),l=n(3955);function u(e,t,n=c.specifiedSDLRules){const r=[],i=new l.SDLValidationContext(e,t,(e=>{r.push(e)})),a=n.map((e=>e(i)));return(0,o.visit)(e,(0,o.visitInParallel)(a)),r}},8696:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.versionInfo=t.version=void 0,t.version="16.8.1";const n=Object.freeze({major:16,minor:8,patch:1,preReleaseTag:null});t.versionInfo=n},8679:function(e,t,n){"use strict";var r=n(1296),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var i=d(n);i&&i!==h&&e(t,i,r)}var a=u(n);p&&(a=a.concat(p(n)));for(var s=c(t),m=c(n),v=0;v=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},l="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function u(e){var t=e.re=n(6066)(e.__opts__),r=e.__tlds__.slice();function s(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");var c=[];function l(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===i(n))return"[object RegExp]"!==i(n.validate)?o(n.validate)?r.validate=n.validate:l(t,n):r.validate=function(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(o(n.normalize)?r.normalize=n.normalize:n.normalize?l(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===i(e)}(n)?l(t,n):c.push(t)}})),c.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var u=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(a).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function p(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function f(e,t){var n=new p(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function d(e,t){if(!(this instanceof d))return new d(e,t);var n;t||(n=e,Object.keys(n||{}).reduce((function(e,t){return e||s.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=r({},s,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},c,e),this.__compiled__={},this.__tlds__=l,this.__tlds_replaced__=!1,this.re={},u(this)}d.prototype.add=function(e,t){return this.__schemas__[e]=t,u(this),this},d.prototype.set=function(e){return this.__opts__=r(this.__opts__,e),this},d.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,i,o,a,s,c;if(this.re.schema_test.test(e))for((s=this.re.schema_search).lastIndex=0;null!==(t=s.exec(e));)if(i=this.testSchemaAt(e,t[2],s.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a)),this.__index__>=0},d.prototype.pretest=function(e){return this.re.pretest.test(e)},d.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},d.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(f(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(f(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},d.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),u(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,u(this),this)},d.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},d.prototype.onCompile=function(){},e.exports=d},6066:function(e,t,n){"use strict";e.exports=function(e){var t={};return t.src_Any=n(9369).source,t.src_Cc=n(9413).source,t.src_Z=n(5045).source,t.src_P=n(3189).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|"),t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+").|;(?!"+t.src_ZCc+").|\\!+(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},8552:function(e,t,n){var r=n(852)(n(5639),"DataView");e.exports=r},1989:function(e,t,n){var r=n(1789),i=n(401),o=n(7667),a=n(1327),s=n(1866);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tu))return!1;var f=c.get(e),d=c.get(t);if(f&&d)return f==t&&d==e;var h=-1,m=!0,v=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++h-1&&e%1==0&&e-1}},4705:function(e,t,n){var r=n(8470);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},4785:function(e,t,n){var r=n(1989),i=n(8407),o=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},1285:function(e,t,n){var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:function(e,t,n){var r=n(5050);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},4536:function(e,t,n){var r=n(852)(Object,"create");e.exports=r},6916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},1167:function(e,t,n){e=n.nmd(e);var r=n(1957),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5639:function(e,t,n){var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:function(e){e.exports=function(e){return this.__data__.has(e)}},1814:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},7465:function(e,t,n){var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,n){var r=n(8407),i=n(7071),o=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},3279:function(e,t,n){var r=n(3218),i=n(7771),o=n(4841),a=Math.max,s=Math.min;e.exports=function(e,t,n){var c,l,u,p,f,d,h=0,m=!1,v=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=c,r=l;return c=l=void 0,h=t,p=e.apply(r,n)}function b(e){return h=e,f=setTimeout(w,t),m?g(e):p}function E(e){var n=e-d;return void 0===d||n>=t||n<0||v&&e-h>=u}function w(){var e=i();if(E(e))return T(e);f=setTimeout(w,function(e){var n=t-(e-d);return v?s(n,u-(e-h)):n}(e))}function T(e){return f=void 0,y&&c?g(e):(c=l=void 0,p)}function _(){var e=i(),n=E(e);if(c=arguments,l=this,d=e,n){if(void 0===f)return b(d);if(v)return clearTimeout(f),f=setTimeout(w,t),g(d)}return void 0===f&&(f=setTimeout(w,t)),p}return t=o(t)||0,r(n)&&(m=!!n.leading,u=(v="maxWait"in n)?a(o(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),_.cancel=function(){void 0!==f&&clearTimeout(f),h=0,c=d=l=f=void 0},_.flush=function(){return void 0===f?p:T(i())},_}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},5694:function(e,t,n){var r=n(9454),i=n(7005),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var r=n(3560),i=n(1780);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},4144:function(e,t,n){e=n.nmd(e);var r=n(5639),i=n(5062),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||i;e.exports=c},8446:function(e,t,n){var r=n(939);e.exports=function(e,t){return r(e,t)}},3560:function(e,t,n){var r=n(4239),i=n(3218);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},3448:function(e,t,n){var r=n(4239),i=n(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},6719:function(e,t,n){var r=n(8749),i=n(1717),o=n(1167),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},3674:function(e,t,n){var r=n(4636),i=n(280),o=n(8612);e.exports=function(e){return o(e)?r(e):i(e)}},7771:function(e,t,n){var r=n(5639);e.exports=function(){return r.Date.now()}},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},4841:function(e,t,n){var r=n(7561),i=n(3218),o=n(3448),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},6961:function(e,t,n){var r,i=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function i(e,t){if(!r[e]){r[e]={};for(var n=0;n>>8,n[2*r+1]=a%256}return n},decompressFromUint8Array:function(t){if(null==t)return o.decompress(t);for(var n=new Array(t.length/2),r=0,i=n.length;r>=1}else{for(i=1,r=0;r>=1}0==--p&&(p=Math.pow(2,d),d++),delete s[u]}else for(i=a[u],r=0;r>=1;0==--p&&(p=Math.pow(2,d),d++),a[l]=f++,u=String(c)}if(""!==u){if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(r=0;r>=1}else{for(i=1,r=0;r>=1}0==--p&&(p=Math.pow(2,d),d++),delete s[u]}else for(i=a[u],r=0;r>=1;0==--p&&(p=Math.pow(2,d),d++)}for(i=2,r=0;r>=1;for(;;){if(m<<=1,v==t-1){h.push(n(m));break}v++}return h.join("")},decompress:function(e){return null==e?"":""==e?null:o._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(t,n,r){var i,o,a,s,c,l,u,p=[],f=4,d=4,h=3,m="",v=[],y={val:r(0),position:n,index:1};for(i=0;i<3;i+=1)p[i]=i;for(a=0,c=Math.pow(2,2),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;switch(a){case 0:for(a=0,c=Math.pow(2,8),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;u=e(a);break;case 1:for(a=0,c=Math.pow(2,16),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;u=e(a);break;case 2:return""}for(p[3]=u,o=u,v.push(u);;){if(y.index>t)return"";for(a=0,c=Math.pow(2,h),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;switch(u=a){case 0:for(a=0,c=Math.pow(2,8),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;p[d++]=e(a),u=d-1,f--;break;case 1:for(a=0,c=Math.pow(2,16),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;p[d++]=e(a),u=d-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,h),h++),p[u])m=p[u];else{if(u!==d)return null;m=o+o.charAt(0)}v.push(m),p[d++]=o+m.charAt(0),o=m,0==--f&&(f=Math.pow(2,h),h++)}}};return o}();void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)},9980:function(e,t,n){"use strict";e.exports=n(7024)},6233:function(e,t,n){"use strict";e.exports=n(5485)},813:function(e){"use strict";e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},1947:function(e){"use strict";var t="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",n="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r=new RegExp("^(?:"+t+"|"+n+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)"),i=new RegExp("^(?:"+t+"|"+n+")");e.exports.n=r,e.exports.q=i},7022:function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function i(e,t){return r.call(e,t)}function o(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)||e>=0&&e<=8||11===e||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function a(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var s=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(s.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,u=n(6233),p=/[&<>"]/,f=/[&<>"]/g,d={"&":"&","<":"<",">":">",'"':"""};function h(e){return d[e]}var m=/[.?*+^$[\]\\(){}|-]/g,v=n(3189);t.lib={},t.lib.mdurl=n(8765),t.lib.ucmicro=n(4205),t.assign=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=i,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(s,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(c,(function(e,t,n){return t||function(e,t){var n=0;return i(u,t)?u[t]:35===t.charCodeAt(0)&&l.test(t)&&o(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?a(n):e}(e,n)}))},t.isValidEntityCode=o,t.fromCodePoint=a,t.escapeHtml=function(e){return p.test(e)?e.replace(f,h):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return v.test(e)},t.escapeRE=function(e){return e.replace(m,"\\$&")},t.normalizeReference=function(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}},1685:function(e,t,n){"use strict";t.parseLinkLabel=n(3595),t.parseLinkDestination=n(2548),t.parseLinkTitle=n(8040)},2548:function(e,t,n){"use strict";var r=n(7022).unescapeAll;e.exports=function(e,t,n){var i,o,a=t,s={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;t32)return s;if(41===i){if(0===o)break;o--}t++}return a===t||0!==o||(s.str=r(e.slice(a,t)),s.lines=0,s.pos=t,s.ok=!0),s}},3595:function(e){"use strict";e.exports=function(e,t,n){var r,i,o,a,s=-1,c=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos=n)return c;if(34!==(o=e.charCodeAt(t))&&39!==o&&40!==o)return c;for(t++,40===o&&(o=41);t=0))try{t.hostname=p.toASCII(t.hostname)}catch(e){}return u.encode(u.format(t))}function g(e){var t=u.parse(e,!0);if(t.hostname&&(!t.protocol||v.indexOf(t.protocol)>=0))try{t.hostname=p.toUnicode(t.hostname)}catch(e){}return u.decode(u.format(t),u.decode.defaultChars+"%")}function b(e,t){if(!(this instanceof b))return new b(e,t);t||r.isString(e)||(t=e||{},e="default"),this.inline=new c,this.block=new s,this.core=new a,this.renderer=new o,this.linkify=new l,this.validateLink=m,this.normalizeLink=y,this.normalizeLinkText=g,this.utils=r,this.helpers=r.assign({},i),this.options={},this.configure(e),t&&this.set(t)}b.prototype.set=function(e){return r.assign(this.options,e),this},b.prototype.configure=function(e){var t,n=this;if(r.isString(e)&&!(e=f[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},b.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},b.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},b.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},b.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},b.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},b.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},b.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=b},2471:function(e,t,n){"use strict";var r=n(9580),i=[["table",n(1785),["paragraph","reference"]],["code",n(8768)],["fence",n(3542),["paragraph","reference","blockquote","list"]],["blockquote",n(5258),["paragraph","reference","blockquote","list"]],["hr",n(5634),["paragraph","reference","blockquote","list"]],["list",n(8532),["paragraph","reference","blockquote"]],["reference",n(3804)],["html_block",n(6329),["paragraph","reference","blockquote"]],["heading",n(1630),["paragraph","reference","blockquote"]],["lheading",n(6850)],["paragraph",n(6864)]];function o(){this.ruler=new r;for(var e=0;e=n))&&!(e.sCount[a]=c){e.line=n;break}for(r=0;r=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},a.prototype.parse=function(e,t,n,r){var i,o,a,s=new this.State(e,t,n,r);for(this.tokenize(s),a=(o=this.ruler2.getRules("")).length,i=0;i"+o(e[t].content)+""},a.code_block=function(e,t,n,r,i){var a=e[t];return""+o(e[t].content)+"\n"},a.fence=function(e,t,n,r,a){var s,c,l,u,p,f=e[t],d=f.info?i(f.info).trim():"",h="",m="";return d&&(h=(l=d.split(/(\s+)/g))[0],m=l.slice(2).join("")),0===(s=n.highlight&&n.highlight(f.content,h,m)||o(f.content)).indexOf(""+s+"\n"):"
"+s+"
\n"},a.image=function(e,t,n,r,i){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)},a.hardbreak=function(e,t,n){return n.xhtmlOut?"
\n":"
\n"},a.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},a.text=function(e,t){return o(e[t].content)},a.html_block=function(e,t){return e[t].content},a.html_inline=function(e,t){return e[t].content},s.prototype.renderAttrs=function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t\n":">")},s.prototype.renderInline=function(e,t,n){for(var r,i="",o=this.rules,a=0,s=e.length;a=4)return!1;if(62!==e.src.charCodeAt(S++))return!1;if(i)return!0;for(c=d=e.sCount[t]+1,32===e.src.charCodeAt(S)?(S++,c++,d++,o=!1,E=!0):9===e.src.charCodeAt(S)?(E=!0,(e.bsCount[t]+d)%4==3?(S++,c++,d++,o=!1):o=!0):E=!1,h=[e.bMarks[t]],e.bMarks[t]=S;S=x,g=[e.sCount[t]],e.sCount[t]=d-c,b=[e.tShift[t]],e.tShift[t]=S-e.bMarks[t],T=e.md.block.ruler.getRules("blockquote"),y=e.parentType,e.parentType="blockquote",f=t+1;f=(x=e.eMarks[f])));f++)if(62!==e.src.charCodeAt(S++)||k){if(u)break;for(w=!1,s=0,l=T.length;s=x,m.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(E?1:0),g.push(e.sCount[f]),e.sCount[f]=d-c,b.push(e.tShift[f]),e.tShift[f]=S-e.bMarks[f]}for(v=e.blkIndent,e.blkIndent=0,(_=e.push("blockquote_open","blockquote",1)).markup=">",_.map=p=[t,0],e.md.block.tokenize(e,t,f),(_=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=O,e.parentType=y,p[1]=e.line,s=0;s=4))break;i=++r}return e.line=i,(o=e.push("code_block","code",0)).content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}},3542:function(e){"use strict";e.exports=function(e,t,n,r){var i,o,a,s,c,l,u,p=!1,f=e.bMarks[t]+e.tShift[t],d=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(f+3>d)return!1;if(126!==(i=e.src.charCodeAt(f))&&96!==i)return!1;if(c=f,(o=(f=e.skipChars(f,i))-c)<3)return!1;if(u=e.src.slice(c,f),a=e.src.slice(f,d),96===i&&a.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(s=t;!(++s>=n||(f=c=e.bMarks[s]+e.tShift[s])<(d=e.eMarks[s])&&e.sCount[s]=4||(f=e.skipChars(f,i))-c=4)return!1;if(35!==(o=e.src.charCodeAt(l))||l>=u)return!1;for(a=1,o=e.src.charCodeAt(++l);35===o&&l6||ll&&r(e.src.charCodeAt(s-1))&&(u=s),e.line=t+1,(c=e.push("heading_open","h"+String(a),1)).markup="########".slice(0,a),c.map=[t,e.line],(c=e.push("inline","",0)).content=e.src.slice(l,u).trim(),c.map=[t,e.line],c.children=[],(c=e.push("heading_close","h"+String(a),-1)).markup="########".slice(0,a)),0))}},5634:function(e,t,n){"use strict";var r=n(7022).isSpace;e.exports=function(e,t,n,i){var o,a,s,c,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(42!==(o=e.src.charCodeAt(l++))&&45!==o&&95!==o)return!1;for(a=1;l|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(i.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,n,r){var i,a,s,c,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(l))return!1;for(c=e.src.slice(l,u),i=0;i=4)return!1;for(f=e.parentType,e.parentType="paragraph";d3)){if(e.sCount[d]>=e.blkIndent&&(c=e.bMarks[d]+e.tShift[d])<(l=e.eMarks[d])&&(45===(p=e.src.charCodeAt(c))||61===p)&&(c=e.skipChars(c,p),(c=e.skipSpaces(c))>=l)){u=61===p?1:2;break}if(!(e.sCount[d]<0)){for(i=!1,o=0,a=h.length;o=a)return-1;if((n=e.src.charCodeAt(o++))<48||n>57)return-1;for(;;){if(o>=a)return-1;if(!((n=e.src.charCodeAt(o++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(o-i>=10)return-1}return o=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(P=!0),(C=o(e,t))>=0){if(f=!0,A=e.bMarks[t]+e.tShift[t],g=Number(e.src.slice(A,C-1)),P&&1!==g)return!1}else{if(!((C=i(e,t))>=0))return!1;f=!1}if(P&&e.skipSpaces(C)>=e.eMarks[t])return!1;if(y=e.src.charCodeAt(C-1),r)return!0;for(v=e.tokens.length,f?(I=e.push("ordered_list_open","ol",1),1!==g&&(I.attrs=[["start",g]])):I=e.push("bullet_list_open","ul",1),I.map=m=[t,0],I.markup=String.fromCharCode(y),E=t,N=!1,D=e.md.block.ruler.getRules("list"),_=e.parentType,e.parentType="list";E=b?1:w-p)>4&&(u=1),l=p+u,(I=e.push("list_item_open","li",1)).markup=String.fromCharCode(y),I.map=d=[t,0],f&&(I.info=e.src.slice(A,C-1)),S=e.tight,O=e.tShift[t],k=e.sCount[t],T=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=l,e.tight=!0,e.tShift[t]=s-e.bMarks[t],e.sCount[t]=w,s>=b&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!N||(R=!1),N=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=T,e.tShift[t]=O,e.sCount[t]=k,e.tight=S,(I=e.push("list_item_close","li",-1)).markup=String.fromCharCode(y),E=t=e.line,d[1]=E,s=e.bMarks[t],E>=n)break;if(e.sCount[E]=4)break;for(L=!1,c=0,h=D.length;c3||e.sCount[c]<0)){for(r=!1,i=0,o=l.length;i=4)return!1;if(91!==e.src.charCodeAt(_))return!1;for(;++_3||e.sCount[O]<0)){for(b=!1,p=0,f=E.length;p0&&this.level++,this.tokens.push(i),i},o.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},o.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;et;)if(!i(this.src.charCodeAt(--e)))return e+1;return e},o.prototype.skipChars=function(e,t){for(var n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e},o.prototype.getLines=function(e,t,n,r){var o,a,s,c,l,u,p,f=e;if(e>=t)return"";for(u=new Array(t-e),o=0;fn?new Array(a-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return u.join("")},o.prototype.Token=r,e.exports=o},1785:function(e,t,n){"use strict";var r=n(7022).isSpace;function i(e,t){var n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.substr(n,r-n)}function o(e){var t,n=[],r=0,i=e.length,o=!1,a=0,s="";for(t=e.charCodeAt(r);rn)return!1;if(f=t+1,e.sCount[f]=4)return!1;if((l=e.bMarks[f]+e.tShift[f])>=e.eMarks[f])return!1;if(124!==(_=e.src.charCodeAt(l++))&&45!==_&&58!==_)return!1;if(l>=e.eMarks[f])return!1;if(124!==(k=e.src.charCodeAt(l++))&&45!==k&&58!==k&&!r(k))return!1;if(45===_&&r(k))return!1;for(;l=4)return!1;if((d=o(c)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),0===(h=d.length)||h!==v.length)return!1;if(a)return!0;for(E=e.parentType,e.parentType="table",T=e.md.block.ruler.getRules("blockquote"),(m=e.push("table_open","table",1)).map=g=[t,0],(m=e.push("thead_open","thead",1)).map=[t,t+1],(m=e.push("tr_open","tr",1)).map=[t,t+1],u=0;u=4)break;for((d=o(c)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),f===t+2&&((m=e.push("tbody_open","tbody",1)).map=b=[t+2,0]),(m=e.push("tr_open","tr",1)).map=[f,f+1],u=0;u/i.test(e)}e.exports=function(e){var t,n,o,a,s,c,l,u,p,f,d,h,m,v,y,g,b,E,w=e.tokens;if(e.md.options.linkify)for(n=0,o=w.length;n=0;t--)if("link_close"!==(c=a[t]).type){if("html_inline"===c.type&&(E=c.content,/^\s]/i.test(E)&&m>0&&m--,i(c.content)&&m++),!(m>0)&&"text"===c.type&&e.md.linkify.test(c.content)){for(p=c.content,b=e.md.linkify.match(p),l=[],h=c.level,d=0,u=0;ud&&((s=new e.Token("text","",0)).content=p.slice(d,f),s.level=h,l.push(s)),(s=new e.Token("link_open","a",1)).attrs=[["href",y]],s.level=h++,s.markup="linkify",s.info="auto",l.push(s),(s=new e.Token("text","",0)).content=g,s.level=h,l.push(s),(s=new e.Token("link_close","a",-1)).level=--h,s.markup="linkify",s.info="auto",l.push(s),d=b[u].lastIndex);d=0;t--)"text"!==(n=e[t]).type||i||(n.content=n.content.replace(r,o)),"link_open"===n.type&&"auto"===n.info&&i--,"link_close"===n.type&&"auto"===n.info&&i++}function s(e){var n,r,i=0;for(n=e.length-1;n>=0;n--)"text"!==(r=e[n]).type||i||t.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&i--,"link_close"===r.type&&"auto"===r.info&&i++}e.exports=function(e){var r;if(e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)"inline"===e.tokens[r].type&&(n.test(e.tokens[r].content)&&a(e.tokens[r].children),t.test(e.tokens[r].content)&&s(e.tokens[r].children))}},8450:function(e,t,n){"use strict";var r=n(7022).isWhiteSpace,i=n(7022).isPunctChar,o=n(7022).isMdAsciiPunct,a=/['"]/,s=/['"]/g;function c(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function l(e,t){var n,a,l,u,p,f,d,h,m,v,y,g,b,E,w,T,_,k,O,S,x;for(O=[],n=0;n=0&&!(O[_].level<=d);_--);if(O.length=_+1,"text"===a.type){p=0,f=(l=a.content).length;e:for(;p=0)m=l.charCodeAt(u.index-1);else for(_=n-1;_>=0&&"softbreak"!==e[_].type&&"hardbreak"!==e[_].type;_--)if(e[_].content){m=e[_].content.charCodeAt(e[_].content.length-1);break}if(v=32,p=48&&m<=57&&(T=w=!1),w&&T&&(w=y,T=g),w||T){if(T)for(_=O.length-1;_>=0&&(h=O[_],!(O[_].level=0;t--)"inline"===e.tokens[t].type&&a.test(e.tokens[t].content)&&l(e.tokens[t].children,e)}},6480:function(e,t,n){"use strict";var r=n(5872);function i(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}i.prototype.Token=r,e.exports=i},3420:function(e){"use strict";var t=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,n=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;e.exports=function(e,r){var i,o,a,s,c,l,u=e.pos;if(60!==e.src.charCodeAt(u))return!1;for(c=e.pos,l=e.posMax;;){if(++u>=l)return!1;if(60===(s=e.src.charCodeAt(u)))return!1;if(62===s)break}return i=e.src.slice(c+1,u),n.test(i)?(o=e.md.normalizeLink(i),!!e.md.validateLink(o)&&(r||((a=e.push("link_open","a",1)).attrs=[["href",o]],a.markup="autolink",a.info="auto",(a=e.push("text","",0)).content=e.md.normalizeLinkText(i),(a=e.push("link_close","a",-1)).markup="autolink",a.info="auto"),e.pos+=i.length+2,!0)):!!t.test(i)&&(o=e.md.normalizeLink("mailto:"+i),!!e.md.validateLink(o)&&(r||((a=e.push("link_open","a",1)).attrs=[["href",o]],a.markup="autolink",a.info="auto",(a=e.push("text","",0)).content=e.md.normalizeLinkText(i),(a=e.push("link_close","a",-1)).markup="autolink",a.info="auto"),e.pos+=i.length+2,!0))}},9755:function(e){"use strict";e.exports=function(e,t){var n,r,i,o,a,s,c,l,u=e.pos;if(96!==e.src.charCodeAt(u))return!1;for(n=u,u++,r=e.posMax;ua;r-=h[r]+1)if((o=t[r]).marker===i.marker&&o.open&&o.end<0&&(c=!1,(o.close||i.open)&&(o.length+i.length)%3==0&&(o.length%3==0&&i.length%3==0||(c=!0)),!c)){l=r>0&&!t[r-1].open?h[r-1]+1:0,h[n]=n-r+l,h[r]=l,i.open=!1,o.end=n,o.close=!1,s=-1,d=-2;break}-1!==s&&(u[i.marker][(i.open?3:0)+(i.length||0)%3]=s)}}}e.exports=function(e){var n,r=e.tokens_meta,i=e.tokens_meta.length;for(t(0,e.delimiters),n=0;n=0;n--)95!==(r=t[n]).marker&&42!==r.marker||-1!==r.end&&(i=t[r.end],s=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1,a=String.fromCharCode(r.marker),(o=e.tokens[r.token]).type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?a+a:a,o.content="",(o=e.tokens[i.token]).type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?a+a:a,o.content="",s&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}e.exports.w=function(e,t){var n,r,i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(95!==o&&42!==o)return!1;for(r=e.scanDelims(e.pos,42===o),n=0;n?@[]^_`{|}~-".split("").forEach((function(e){i[e.charCodeAt(0)]=1})),e.exports=function(e,t){var n,o=e.pos,a=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o=o||33!==(n=e.src.charCodeAt(a+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n)||!(i=e.src.slice(a).match(r))||(t||(e.push("html_inline","",0).content=e.src.slice(a,a+i[0].length)),e.pos+=i[0].length,0)))}},3006:function(e,t,n){"use strict";var r=n(7022).normalizeReference,i=n(7022).isSpace;e.exports=function(e,t){var n,o,a,s,c,l,u,p,f,d,h,m,v,y="",g=e.pos,b=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(l=e.pos+2,(c=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((u=c+1)=b)return!1;for(v=u,(f=e.md.helpers.parseLinkDestination(e.src,u,e.posMax)).ok&&(y=e.md.normalizeLink(f.str),e.md.validateLink(y)?u=f.pos:y=""),v=u;u=b||41!==e.src.charCodeAt(u))return e.pos=g,!1;u++}else{if(void 0===e.env.references)return!1;if(u=0?s=e.src.slice(v,u++):u=c+1):u=c+1,s||(s=e.src.slice(l,c)),!(p=e.env.references[r(s)]))return e.pos=g,!1;y=p.href,d=p.title}return t||(a=e.src.slice(l,c),e.md.inline.parse(a,e.md,e.env,m=[]),(h=e.push("image","img",0)).attrs=n=[["src",y],["alt",""]],h.children=m,h.content=a,d&&n.push(["title",d])),e.pos=u,e.posMax=b,!0}},1727:function(e,t,n){"use strict";var r=n(7022).normalizeReference,i=n(7022).isSpace;e.exports=function(e,t){var n,o,a,s,c,l,u,p,f="",d="",h=e.pos,m=e.posMax,v=e.pos,y=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(c=e.pos+1,(s=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((l=s+1)=m)return!1;if(v=l,(u=e.md.helpers.parseLinkDestination(e.src,l,e.posMax)).ok){for(f=e.md.normalizeLink(u.str),e.md.validateLink(f)?l=u.pos:f="",v=l;l=m||41!==e.src.charCodeAt(l))&&(y=!0),l++}if(y){if(void 0===e.env.references)return!1;if(l=0?a=e.src.slice(v,l++):l=s+1):l=s+1,a||(a=e.src.slice(c,s)),!(p=e.env.references[r(a)]))return e.pos=h,!1;f=p.href,d=p.title}return t||(e.pos=c,e.posMax=s,e.push("link_open","a",1).attrs=n=[["href",f]],d&&n.push(["title",d]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=l,e.posMax=m,!0}},3905:function(e,t,n){"use strict";var r=n(7022).isSpace;e.exports=function(e,t){var n,i,o,a=e.pos;if(10!==e.src.charCodeAt(a))return!1;if(n=e.pending.length-1,i=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(o=n-1;o>=1&&32===e.pending.charCodeAt(o-1);)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(a++;a0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i},s.prototype.scanDelims=function(e,t){var n,r,s,c,l,u,p,f,d,h=e,m=!0,v=!0,y=this.posMax,g=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;h0&&r++,"text"===i[t].type&&t+1=0&&(n=this.attrs[t][1]),n},t.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},e.exports=t},3122:function(e){"use strict";var t={};function n(e,r){var i;return"string"!=typeof r&&(r=n.defaultChars),i=function(e){var n,r,i=t[e];if(i)return i;for(i=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),i.push(r);for(n=0;n=55296&&c<=57343?"���":String.fromCharCode(c),t+=6):240==(248&r)&&t+91114111?l+="����":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),t+=9):l+="�";return l}))}n.defaultChars=";/?:@&=+$,#",n.componentChars="",e.exports=n},729:function(e){"use strict";var t={};function n(e,r,i){var o,a,s,c,l,u="";for("string"!=typeof r&&(i=r,r=n.defaultChars),void 0===i&&(i=!0),l=function(e){var n,r,i=t[e];if(i)return i;for(i=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),/^[0-9a-z]$/i.test(r)?i.push(r):i.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2));for(n=0;n=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1=56320&&c<=57343){u+=encodeURIComponent(e[o]+e[o+1]),o++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[o]);return u}n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()",e.exports=n},2201:function(e){"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",(t+=e.search||"")+(e.hash||"")}},8765:function(e,t,n){"use strict";e.exports.encode=n(729),e.exports.decode=n(3122),e.exports.format=n(2201),e.exports.parse=n(9553)},9553:function(e){"use strict";function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),a=["'"].concat(o),s=["%","/","?",";","#"].concat(a),c=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},f={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};t.prototype.parse=function(e,t){var r,o,a,d,h,m=e;if(m=m.trim(),!t&&1===e.split("#").length){var v=i.exec(m);if(v)return this.pathname=v[1],v[2]&&(this.search=v[2]),this}var y=n.exec(m);if(y&&(a=(y=y[0]).toLowerCase(),this.protocol=y,m=m.substr(y.length)),(t||y||m.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(h="//"===m.substr(0,2))||y&&p[y]||(m=m.substr(2),this.slashes=!0)),!p[y]&&(h||y&&!f[y])){var g,b,E=-1;for(r=0;r127?O+="x":O+=k[S];if(!O.match(l)){var C=_.slice(0,r),N=_.slice(r+1),A=k.match(u);A&&(C.push(A[1]),N.unshift(A[2])),N.length&&(m=N.join(".")+m),this.hostname=C.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var L=m.indexOf("#");-1!==L&&(this.hash=m.substr(L),m=m.slice(0,L));var D=m.indexOf("?");return-1!==D&&(this.search=m.substr(D),m=m.slice(0,D)),m&&(this.pathname=m),f[a]&&this.hostname&&!this.pathname&&(this.pathname=""),this},t.prototype.parseHost=function(e){var t=r.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,n){if(e&&e instanceof t)return e;var r=new t;return r.parse(e,n),r}},4357:function(e){"use strict";function t(e,t){if(null!=e)return e;var n=new Error(void 0!==t?t:"Got unexpected "+e);throw n.framesToPop=1,n}e.exports=t,e.exports.default=t,Object.defineProperty(e.exports,"__esModule",{value:!0})},3689:function(e,t,n){"use strict";n.r(t),n.d(t,{decode:function(){return y},encode:function(){return g},toASCII:function(){return E},toUnicode:function(){return b},ucs2decode:function(){return d},ucs2encode:function(){return h}});const r=2147483647,i=36,o=/^xn--/,a=/[^\0-\x7E]/,s=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},l=Math.floor,u=String.fromCharCode;function p(e){throw new RangeError(c[e])}function f(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]);const i=function(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}((e=e.replace(s,".")).split("."),t).join(".");return r+i}function d(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e),m=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},v=function(e,t,n){let r=0;for(e=n?l(e/700):e>>1,e+=l(e/t);e>455;r+=i)e=l(e/35);return l(r+36*e/(e+38))},y=function(e){const t=[],n=e.length;let o=0,a=128,s=72,c=e.lastIndexOf("-");c<0&&(c=0);for(let n=0;n=128&&p("not-basic"),t.push(e.charCodeAt(n));for(let f=c>0?c+1:0;f=n&&p("invalid-input");const c=(u=e.charCodeAt(f++))-48<10?u-22:u-65<26?u-65:u-97<26?u-97:i;(c>=i||c>l((r-o)/t))&&p("overflow"),o+=c*t;const d=a<=s?1:a>=s+26?26:a-s;if(cl(r/h)&&p("overflow"),t*=h}const d=t.length+1;s=v(o-c,d,0==c),l(o/d)>r-a&&p("overflow"),a+=l(o/d),o%=d,t.splice(o++,0,a)}var u;return String.fromCodePoint(...t)},g=function(e){const t=[];let n=(e=d(e)).length,o=128,a=0,s=72;for(const n of e)n<128&&t.push(u(n));let c=t.length,f=c;for(c&&t.push("-");f=o&&tl((r-a)/d)&&p("overflow"),a+=(n-o)*d,o=n;for(const n of e)if(nr&&p("overflow"),n==o){let e=a;for(let n=i;;n+=i){const r=n<=s?1:n>=s+26?26:n-s;if(eNumber(e)-Number(t))).map((t=>e[t])):e}function f(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){const t=(e=f(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function h(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function m(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const i="string"==typeof n&&n.includes(e.arrayFormatSeparator),o="string"==typeof n&&!i&&u(n,e).includes(e.arrayFormatSeparator);n=o?u(n,e):n;const a=i||o?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n?u(n,e):n);const o=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],o):r[t]=o};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const i of e.split("&")){if(""===i)continue;let[e,a]=o(t.decode?i.replace(/\+/g," "):i,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:u(a,t),n(u(e,t),a,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=h(n[e],t);else r[e]=h(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=p(n):e[t]=n,e}),Object.create(null))}t.extract=d,t.parse=m,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[",i,"]"].join("")]:[...n,[l(t,e),"[",l(i,e),"]=",l(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[]"].join("")]:[...n,[l(t,e),"[]=",l(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),":list="].join("")]:[...n,[l(t,e),":list=",l(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[l(n,e),t,l(i,e)].join("")]:[[r,l(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,l(t,e)]:[...n,[l(t,e),"=",l(r,e)].join("")]}}(t),i={};for(const t of Object.keys(e))n(t)||(i[t]=e[t]);const o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((n=>{const i=e[n];return void 0===i?"":null===i?l(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?l(n,t)+"[]":i.reduce(r(n),[]).join("&"):l(n,t)+"="+l(i,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=o(e,"#");return Object.assign({url:n.split("?")[0]||"",query:m(d(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const r=f(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),a=Object.assign(o,e.query);let c=t.stringify(a,n);c&&(c=`?${c}`);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u=`#${n[s]?l(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${c}${u}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);const{url:i,query:o,fragmentIdentifier:c}=t.parseUrl(e,r);return t.stringifyUrl({url:i,query:a(o,n),fragmentIdentifier:c},r)},t.exclude=(e,n,r)=>{const i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,i,r)}},1162:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,h=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),m=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case o:case s:case a:case d:return e;default:switch(e=e&&e.$$typeof){case l:case f:case m:case h:case c:return e;default:return t}}case i:return t}}}t.isFragment=function(e){return v(e)===o},t.isMemo=function(e){return v(e)===h}},1805:function(e,t,n){"use strict";e.exports=n(1162)},9921:function(e,t){"use strict";var n=60103,r=60106,i=60107,o=60108,a=60114,s=60109,c=60110,l=60112,u=60113,p=60120,f=60115,d=60116,h=60121,m=60122,v=60117,y=60129,g=60131;if("function"==typeof Symbol&&Symbol.for){var b=Symbol.for;n=b("react.element"),r=b("react.portal"),i=b("react.fragment"),o=b("react.strict_mode"),a=b("react.profiler"),s=b("react.provider"),c=b("react.context"),l=b("react.forward_ref"),u=b("react.suspense"),p=b("react.suspense_list"),f=b("react.memo"),d=b("react.lazy"),h=b("react.block"),m=b("react.server.block"),v=b("react.fundamental"),y=b("react.debug_trace_mode"),g=b("react.legacy_hidden")}t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===a||e===y||e===o||e===u||e===p||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===f||e.$$typeof===s||e.$$typeof===c||e.$$typeof===l||e.$$typeof===v||e.$$typeof===h||e[0]===m)},t.typeOf=function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case i:case a:case o:case u:case p:return e;default:switch(e=e&&e.$$typeof){case c:case l:case d:case f:case s:return e;default:return t}}case r:return t}}}},9864:function(e,t,n){"use strict";e.exports=n(9921)},6774:function(e){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},610:function(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},1742:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.m=t,e=[],r.O=function(t,n,i,o){if(!n){var a=1/0;for(u=0;u=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[c])}))?n.splice(c--,1):(s=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,i,o]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){var e={143:0,826:0,905:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,a=n[0],s=n[1],c=n[2],l=0;if(a.some((function(t){return 0!==e[t]}))){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(c)var u=c(r)}for(t&&t(n);l array('react', 'react-dom', 'wp-element'), 'version' => 'fb8db3223eb3f6563850'); diff --git a/lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.js b/lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.js new file mode 100644 index 00000000..185a30aa --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.js @@ -0,0 +1,5 @@ +!function(){var e={4184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;tl))return!1;var p=s.get(e),d=s.get(t);if(p&&d)return p==t&&d==e;var h=-1,v=!0,m=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++h-1&&e%1==0&&e-1}},4705:function(e,t,n){var r=n(8470);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4785:function(e,t,n){var r=n(1989),o=n(8407),i=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1285:function(e,t,n){var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:function(e,t,n){var r=n(5050);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},4536:function(e,t,n){var r=n(852)(Object,"create");e.exports=r},6916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},1167:function(e,t,n){e=n.nmd(e);var r=n(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,c=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=c},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5639:function(e,t,n){var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:function(e){e.exports=function(e){return this.__data__.has(e)}},1814:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},7465:function(e,t,n){var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,n){var r=n(8407),o=n(7071),i=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},5694:function(e,t,n){var r=n(9454),o=n(7005),i=Object.prototype,a=i.hasOwnProperty,c=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!c.call(e,"callee")};e.exports=s},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var r=n(3560),o=n(1780);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},4144:function(e,t,n){e=n.nmd(e);var r=n(5639),o=n(5062),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,c=a&&a.exports===i?r.Buffer:void 0,s=(c?c.isBuffer:void 0)||o;e.exports=s},8446:function(e,t,n){var r=n(939);e.exports=function(e,t){return r(e,t)}},3560:function(e,t,n){var r=n(4239),o=n(3218);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},6719:function(e,t,n){var r=n(8749),o=n(1717),i=n(1167),a=i&&i.isTypedArray,c=a?o(a):r;e.exports=c},3674:function(e,t,n){var r=n(4636),o=n(280),i=n(8612);e.exports=function(e){return i(e)?r(e):o(e)}},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},1162:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,h=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),v=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");function m(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case f:case i:case c:case a:case d:return e;default:switch(e=e&&e.$$typeof){case u:case p:case v:case h:case s:return e;default:return t}}case o:return t}}}t.isFragment=function(e){return m(e)===i},t.isMemo=function(e){return m(e)===h}},1805:function(e,t,n){"use strict";e.exports=n(1162)},9921:function(e,t){"use strict";var n=60103,r=60106,o=60107,i=60108,a=60114,c=60109,s=60110,u=60112,l=60113,f=60120,p=60115,d=60116,h=60121,v=60122,m=60117,g=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var b=Symbol.for;n=b("react.element"),r=b("react.portal"),o=b("react.fragment"),i=b("react.strict_mode"),a=b("react.profiler"),c=b("react.provider"),s=b("react.context"),u=b("react.forward_ref"),l=b("react.suspense"),f=b("react.suspense_list"),p=b("react.memo"),d=b("react.lazy"),h=b("react.block"),v=b("react.server.block"),m=b("react.fundamental"),g=b("react.debug_trace_mode"),y=b("react.legacy_hidden")}t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===a||e===g||e===i||e===l||e===f||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===p||e.$$typeof===c||e.$$typeof===s||e.$$typeof===u||e.$$typeof===m||e.$$typeof===h||e[0]===v)},t.typeOf=function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case a:case i:case l:case f:return e;default:switch(e=e&&e.$$typeof){case s:case u:case d:case p:case c:return e;default:return t}}case r:return t}}}},9864:function(e,t,n){"use strict";e.exports=n(9921)},6774:function(e){e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(t),s=0;s(0,e.useContext)(r),i=n=>{let{children:o}=n;const[i,a]=(0,e.useState)((()=>{var e;const t=null===(e=window)||void 0===e?void 0:e.localStorage.getItem("graphiql:usePublicFetcher");return!(t&&"false"===t)})()),c=t.applyFilters("graphiql_auth_switch_context_default_value",{usePublicFetcher:i,setUsePublicFetcher:a,toggleUsePublicFetcher:()=>{const e=!i;window.localStorage.setItem("graphiql:usePublicFetcher",e.toString()),a(e)}});return(0,e.createElement)(r.Provider,{value:c},o)};function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var m=window.React,g=n.n(m);function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1,n=T+=1;function r(t){if(0===t)R(n),e();else{var o=A((function(){r(t-1)}));M.set(n,o)}}return r(t),n}function D(e,t){return!!e&&e.contains(t)}function L(e){return e instanceof HTMLElement?e:P().findDOMNode(e)}N.cancel=function(e){var t=M.get(e);return R(t),j(t)};var I=n(1805);function z(e,t){"function"==typeof e?e(t):"object"===p(e)&&e&&"current"in e&&(e.current=t)}function F(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:2;t();var i=N((function(){o<=1?r({isCanceled:function(){return i!==e.current}}):n(r,o-1)}));e.current=i},t]}(),a=s(i,2),c=a[0],u=a[1];return ge((function(){if(r!==fe&&r!==ve){var e=ye.indexOf(r),n=ye[e+1],i=t(r);!1===i?o(n,!0):c((function(e){function t(){e.isCanceled()||o(n,!0)}!0===i?t():Promise.resolve(i).then(t)}))}}),[e,r]),m.useEffect((function(){return function(){u()}}),[]),[function(){o(pe,!0)},r]}(R,(function(e){if(e===pe){var t=Y.prepare;return!!t&&t(V())}var n;return X in Y&&z((null===(n=Y[X])||void 0===n?void 0:n.call(Y,V(),null))||null),X===he&&(q(V()),p>0&&(clearTimeout(H.current),H.current=setTimeout((function(){B({deadline:!0})}),p))),!0})),2),G=U[0],X=U[1],Z=be(X);$.current=Z,ge((function(){T(t);var n,r=F.current;F.current=!0,e&&(!r&&t&&u&&(n=se),r&&t&&i&&(n=ue),(r&&!t&&f||!r&&d&&!t&&f)&&(n=le),n&&(D(n),G()))}),[t]),(0,m.useEffect)((function(){(R===se&&!u||R===ue&&!i||R===le&&!f)&&D(ce)}),[u,i,f]),(0,m.useEffect)((function(){return function(){F.current=!1,clearTimeout(H.current)}}),[]),(0,m.useEffect)((function(){void 0!==j&&R===ce&&(null==P||P(j))}),[j,R]);var K=I;return Y.prepare&&X===de&&(K=h({transition:"none"},K)),[R,X,K,null!=j?j:t]}var xe=function(e){k(n,e);var t=S(n);function n(){return y(this,n),t.apply(this,arguments)}return w(n,[{key:"render",value:function(){return this.props.children}}]),n}(m.Component),Ce=xe,ke=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===p(e)&&(t=e.transitionSupport);var r=m.forwardRef((function(e,t){var r=e.visible,o=void 0===r||r,i=e.removeOnLeave,c=void 0===i||i,u=e.forceRender,l=e.children,p=e.motionName,d=e.leavedClassName,v=e.eventProps,g=n(e),y=(0,m.useRef)(),b=(0,m.useRef)(),w=s(we(g,o,(function(){try{return y.current instanceof HTMLElement?y.current:L(b.current)}catch(e){return null}}),e),4),x=w[0],C=w[1],k=w[2],O=w[3],E=m.useRef(O);O&&(E.current=!0);var S,_=m.useCallback((function(e){y.current=e,z(t,e)}),[t]),P=h(h({},v),{},{visible:o});if(l)if(x!==ce&&n(e)){var A,j;C===pe?j="prepare":be(C)?j="active":C===de&&(j="start"),S=l(h(h({},P),{},{className:f()(ae(p,x),(A={},a(A,ae(p,"".concat(x,"-").concat(j)),j),a(A,p,"string"==typeof p),A)),style:k}),_)}else S=O?l(h({},P),_):!c&&E.current?l(h(h({},P),{},{className:d}),_):u?l(h(h({},P),{},{style:{display:"none"}}),_):null;else S=null;return m.isValidElement(S)&&H(S)&&(S.ref||(S=m.cloneElement(S,{ref:_}))),m.createElement(Ce,{ref:b},S)}));return r.displayName="CSSMotion",r}(re),Oe="add",Ee="keep",Se="remove",_e="removed";function Pe(e){var t;return h(h({},t=e&&"object"===p(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Ae(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(Pe)}function je(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,i=Ae(e),a=Ae(t);i.forEach((function(e){for(var t=!1,i=r;i1}));return s.forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==Se}))).forEach((function(t){t.key===e&&(t.status=Ee)}))})),n}var Te=["component","children","onVisibleChanged","onAllRemoved"],Me=["status"],Re=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ke,n=function(e){k(r,e);var n=S(r);function r(){var e;y(this,r);for(var t=arguments.length,o=new Array(t),i=0;i=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Et(e){var t,n,r;if(wt.isWindow(e)||9===e.nodeType){var o=wt.getWindow(e);t={left:wt.getWindowScrollLeft(o),top:wt.getWindowScrollTop(o)},n=wt.viewportWidth(o),r=wt.viewportHeight(o)}else t=wt.offset(e),n=wt.outerWidth(e),r=wt.outerHeight(e);return t.width=n,t.height=r,t}function St(e,t){var n=t.charAt(0),r=t.charAt(1),o=e.width,i=e.height,a=e.left,c=e.top;return"c"===n?c+=i/2:"b"===n&&(c+=i),"c"===r?a+=o/2:"r"===r&&(a+=o),{left:a,top:c}}function _t(e,t,n,r,o){var i=St(t,n[1]),a=St(e,n[0]),c=[a.left-i.left,a.top-i.top];return{left:Math.round(e.left-c[0]+r[0]-o[0]),top:Math.round(e.top-c[1]+r[1]-o[1])}}function Pt(e,t,n){return e.leftn.right}function At(e,t,n){return e.topn.bottom}function jt(e,t,n){var r=[];return wt.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function Tt(e,t){return e[t]=-e[t],e}function Mt(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Rt(e,t){e[0]=Mt(e[0],t.width),e[1]=Mt(e[1],t.height)}function Nt(e,t,n,r){var o=n.points,i=n.offset||[0,0],a=n.targetOffset||[0,0],c=n.overflow,s=n.source||e;i=[].concat(i),a=[].concat(a);var u={},l=0,f=Ot(s,!(!(c=c||{})||!c.alwaysByViewport)),p=Et(s);Rt(i,p),Rt(a,t);var d=_t(p,t,o,i,a),h=wt.merge(p,d);if(f&&(c.adjustX||c.adjustY)&&r){if(c.adjustX&&Pt(d,p,f)){var v=jt(o,/[lr]/gi,{l:"r",r:"l"}),m=Tt(i,0),g=Tt(a,0);(function(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.left&&o.left+i.width>n.right&&(i.width-=o.left+i.width-n.right),r.adjustX&&o.left+i.width>n.right&&(o.left=Math.max(n.right-i.width,n.left)),r.adjustY&&o.top=n.top&&o.top+i.height>n.bottom&&(i.height-=o.top+i.height-n.bottom),r.adjustY&&o.top+i.height>n.bottom&&(o.top=Math.max(n.bottom-i.height,n.top)),wt.mix(o,i)}(d,p,f,u))}return h.width!==p.width&&wt.css(s,"width",wt.width(s)+h.width-p.width),h.height!==p.height&&wt.css(s,"height",wt.height(s)+h.height-p.height),wt.offset(s,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:o,offset:i,targetOffset:a,overflow:u}}function Dt(e,t,n){var r=n.target||t,o=Et(r),i=!function(e,t){var n=Ot(e,t),r=Et(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return Nt(e,o,n,i)}Dt.__getOffsetParent=Ct,Dt.__getVisibleRectForElement=Ot;var Lt=n(8446),It=n.n(Lt),zt=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){Ft&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Bt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Ft&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;$t.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),qt=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),nn="undefined"!=typeof WeakMap?new WeakMap:new zt,rn=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Wt.getInstance(),r=new tn(t,n,this);nn.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){rn.prototype[e]=function(){var t;return(t=nn.get(this))[e].apply(t,arguments)}}));var on=void 0!==Ht.ResizeObserver?Ht.ResizeObserver:rn;function an(e,t){var n=null,r=null,o=new on((function(e){var o=s(e,1)[0].target;if(document.documentElement.contains(o)){var i=o.getBoundingClientRect(),a=i.width,c=i.height,u=Math.floor(a),l=Math.floor(c);n===u&&r===l||Promise.resolve().then((function(){t({width:u,height:l})})),n=u,r=l}}));return e&&o.observe(e),function(){o.disconnect()}}function cn(e){return"function"!=typeof e?null:e()}function sn(e){return"object"===p(e)&&e?e:null}var un=function(e,t){var n=e.children,r=e.disabled,o=e.target,i=e.align,a=e.onAlign,c=e.monitorWindowResize,u=e.monitorBufferTime,l=void 0===u?0:u,f=g().useRef({}),p=g().useRef(),d=g().Children.only(n),h=g().useRef({});h.current.disabled=r,h.current.target=o,h.current.align=i,h.current.onAlign=a;var v=function(e,t){var n=g().useRef(!1),r=g().useRef(null);function o(){window.clearTimeout(r.current)}return[function e(i){if(o(),n.current&&!0!==i)r.current=window.setTimeout((function(){n.current=!1,e()}),t);else{if(!1===function(){var e=h.current,t=e.disabled,n=e.target,r=e.align,o=e.onAlign;if(!t&&n){var i,a=p.current,c=cn(n),s=sn(n);f.current.element=c,f.current.point=s,f.current.align=r;var u=document.activeElement;return c&&function(e){if(!e)return!1;if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox();if(t.width||t.height)return!0}if(e.getBoundingClientRect){var n=e.getBoundingClientRect();if(n.width||n.height)return!0}return!1}(c)?i=Dt(a,c,r):s&&(i=function(e,t,n){var r,o,i=wt.getDocument(e),a=i.defaultView||i.parentWindow,c=wt.getWindowScrollLeft(a),s=wt.getWindowScrollTop(a),u=wt.viewportWidth(a),l=wt.viewportHeight(a),f={left:r="pageX"in t?t.pageX:c+t.clientX,top:o="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},p=r>=0&&r<=c+u&&o>=0&&o<=s+l,d=[n.points[0],"cc"];return Nt(e,f,Fe(Fe({},n),{},{points:d}),p)}(a,s,r)),function(e,t){e!==document.activeElement&&D(t,e)&&"function"==typeof e.focus&&e.focus()}(u,a),o&&i&&o(a,i),!0}return!1}())return;n.current=!0,r.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,o()}]}(0,l),m=s(v,2),y=m[0],b=m[1],w=g().useRef({cancel:function(){}}),x=g().useRef({cancel:function(){}});g().useEffect((function(){var e,t,n=cn(o),r=sn(o);p.current!==x.current.element&&(x.current.cancel(),x.current.element=p.current,x.current.cancel=an(p.current,y)),f.current.element===n&&((e=f.current.point)===(t=r)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&It()(f.current.align,i)||(y(),w.current.element!==n&&(w.current.cancel(),w.current.element=n,w.current.cancel=an(n,y)))})),g().useEffect((function(){r?b():y()}),[r]);var C=g().useRef(null);return g().useEffect((function(){c?C.current||(C.current=V(window,"resize",y)):C.current&&(C.current.remove(),C.current=null)}),[c]),g().useEffect((function(){return function(){w.current.cancel(),x.current.cancel(),C.current&&C.current.remove(),b()}}),[]),g().useImperativeHandle(t,(function(){return{forceAlign:function(){return y(!0)}}})),g().isValidElement(d)&&(d=g().cloneElement(d,{ref:F(d.ref,p)})),d},ln=g().forwardRef(un);ln.displayName="Align";var fn=ln,pn=$()?m.useLayoutEffect:m.useEffect;function dn(){dn=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=x(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=u(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var l={};function f(){}function d(){}function h(){}var v={};c(v,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(E([])));g&&g!==t&&n.call(g,o)&&(v=g);var y=h.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(o,i,a,c){var s=u(e[o],e,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==p(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=u(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function hn(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function vn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){hn(i,r,o,a,c,"next",e)}function c(e){hn(i,r,o,a,c,"throw",e)}a(void 0)}))}}var mn=["measure","alignPre","align",null,"motion"],gn=m.forwardRef((function(e,t){var n=e.visible,r=e.prefixCls,o=e.className,i=e.style,a=e.children,c=e.zIndex,l=e.stretch,p=e.destroyPopupOnHide,d=e.forceRender,v=e.align,g=e.point,y=e.getRootDomNode,b=e.getClassNameFromAlign,w=e.onAlign,x=e.onMouseEnter,C=e.onMouseLeave,k=e.onMouseDown,O=e.onTouchStart,E=e.onClick,S=(0,m.useRef)(),_=(0,m.useRef)(),P=s((0,m.useState)(),2),A=P[0],j=P[1],T=function(e){var t=s(m.useState({width:0,height:0}),2),n=t[0],r=t[1];return[m.useMemo((function(){var t={};if(e){var r=n.width,o=n.height;-1!==e.indexOf("height")&&o?t.height=o:-1!==e.indexOf("minHeight")&&o&&(t.minHeight=o),-1!==e.indexOf("width")&&r?t.width=r:-1!==e.indexOf("minWidth")&&r&&(t.minWidth=r)}return t}),[e,n]),function(e){r({width:e.offsetWidth,height:e.offsetHeight})}]}(l),M=s(T,2),R=M[0],D=M[1],L=function(e,t){var n=s(me(null),2),r=n[0],o=n[1],i=(0,m.useRef)();function a(e){o(e,!0)}function c(){N.cancel(i.current)}return(0,m.useEffect)((function(){a("measure")}),[e]),(0,m.useEffect)((function(){"measure"===r&&(l&&D(y())),r&&(i.current=N(vn(dn().mark((function e(){var t,n;return dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=mn.indexOf(r),(n=mn[t+1])&&-1!==t&&a(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),(0,m.useEffect)((function(){return function(){c()}}),[]),[r,function(e){c(),i.current=N((function(){a((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(n),I=s(L,2),z=I[0],F=I[1],H=s((0,m.useState)(0),2),V=H[0],$=H[1],B=(0,m.useRef)();function W(){var e;null===(e=S.current)||void 0===e||e.forceAlign()}function q(e,t){var n=b(t);A!==n&&j(n),$((function(e){return e+1})),"align"===z&&(null==w||w(e,t))}pn((function(){"alignPre"===z&&$(0)}),[z]),pn((function(){"align"===z&&(V<2?W():F((function(){var e;null===(e=B.current)||void 0===e||e.call(B)})))}),[V]);var Y=h({},Le(e));function U(){return new Promise((function(e){B.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=Y[e];Y[e]=function(e,n){return F(),null==t?void 0:t(e,n)}})),m.useEffect((function(){Y.motionName||"motion"!==z||F()}),[Y.motionName,z]),m.useImperativeHandle(t,(function(){return{forceAlign:W,getElement:function(){return _.current}}}));var G=h(h({},R),{},{zIndex:c,opacity:"motion"!==z&&"stable"!==z&&n?0:void 0,pointerEvents:n||"stable"===z?void 0:"none"},i),X=!0;!(null==v?void 0:v.points)||"align"!==z&&"stable"!==z||(X=!1);var Z=a;return m.Children.count(a)>1&&(Z=m.createElement("div",{className:"".concat(r,"-content")},a)),m.createElement(De,u({visible:n,ref:_,leavedClassName:"".concat(r,"-hidden")},Y,{onAppearPrepare:U,onEnterPrepare:U,removeOnLeave:p,forceRender:d}),(function(e,t){var n=e.className,i=e.style,a=f()(r,o,A,n);return m.createElement(fn,{target:g||y,key:"popup",ref:S,monitorWindowResize:!0,disabled:X,align:v,onAlign:q},m.createElement("div",{ref:t,className:a,onMouseEnter:x,onMouseLeave:C,onMouseDownCapture:k,onTouchStartCapture:O,onClick:E,style:h(h({},i),G)},Z))}))}));gn.displayName="PopupInner";var yn=gn,bn=m.forwardRef((function(e,t){var n=e.prefixCls,r=e.visible,o=e.zIndex,i=e.children,a=e.mobile,c=(a=void 0===a?{}:a).popupClassName,s=a.popupStyle,l=a.popupMotion,p=void 0===l?{}:l,d=a.popupRender,v=e.onClick,g=m.useRef();m.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return g.current}}}));var y=h({zIndex:o},s),b=i;return m.Children.count(i)>1&&(b=m.createElement("div",{className:"".concat(n,"-content")},i)),d&&(b=d(b)),m.createElement(De,u({visible:r,ref:g,removeOnLeave:!0},p),(function(e,t){var r=e.className,o=e.style,i=f()(n,c,r);return m.createElement("div",{ref:t,className:i,onClick:v,style:h(h({},o),y)},b)}))}));bn.displayName="MobilePopupInner";var wn=bn,xn=["visible","mobile"],Cn=m.forwardRef((function(e,t){var n=e.visible,r=e.mobile,o=v(e,xn),i=s((0,m.useState)(n),2),a=i[0],c=i[1],l=s((0,m.useState)(!1),2),f=l[0],p=l[1],d=h(h({},o),{},{visible:a});(0,m.useEffect)((function(){c(n),n&&r&&p(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4)))}())}),[n,r]);var g=f?m.createElement(wn,u({},d,{mobile:r,ref:t})):m.createElement(yn,u({},d,{ref:t}));return m.createElement("div",null,m.createElement(Ie,d),g)}));Cn.displayName="Popup";var kn=Cn,On=m.createContext(null);function En(){}var Sn,Pn,An,jn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"],Tn=(Sn=W,Pn=function(e){k(n,e);var t=S(n);function n(e){var r,o;return y(this,n),(r=t.call(this,e)).popupRef=m.createRef(),r.triggerRef=m.createRef(),r.portalContainer=void 0,r.attachId=void 0,r.clickOutsideHandler=void 0,r.touchOutsideHandler=void 0,r.contextMenuOutsideHandler1=void 0,r.contextMenuOutsideHandler2=void 0,r.mouseDownTimeout=void 0,r.focusTime=void 0,r.preClickTime=void 0,r.preTouchTime=void 0,r.delayTimer=void 0,r.hasPopupMouseDown=void 0,r.onMouseEnter=function(e){var t=r.props.mouseEnterDelay;r.fireEvents("onMouseEnter",e),r.delaySetPopupVisible(!0,t,t?null:e)},r.onMouseMove=function(e){r.fireEvents("onMouseMove",e),r.setPoint(e)},r.onMouseLeave=function(e){r.fireEvents("onMouseLeave",e),r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)},r.onPopupMouseEnter=function(){r.clearDelayTimer()},r.onPopupMouseLeave=function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&D(null===(t=r.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)},r.onFocus=function(e){r.fireEvents("onFocus",e),r.clearDelayTimer(),r.isFocusToShow()&&(r.focusTime=Date.now(),r.delaySetPopupVisible(!0,r.props.focusDelay))},r.onMouseDown=function(e){r.fireEvents("onMouseDown",e),r.preClickTime=Date.now()},r.onTouchStart=function(e){r.fireEvents("onTouchStart",e),r.preTouchTime=Date.now()},r.onBlur=function(e){r.fireEvents("onBlur",e),r.clearDelayTimer(),r.isBlurToHide()&&r.delaySetPopupVisible(!1,r.props.blurDelay)},r.onContextMenu=function(e){e.preventDefault(),r.fireEvents("onContextMenu",e),r.setPopupVisible(!0,e)},r.onContextMenuClose=function(){r.isContextMenuToShow()&&r.close()},r.onClick=function(e){if(r.fireEvents("onClick",e),r.focusTime){var t;if(r.preClickTime&&r.preTouchTime?t=Math.min(r.preClickTime,r.preTouchTime):r.preClickTime?t=r.preClickTime:r.preTouchTime&&(t=r.preTouchTime),Math.abs(t-r.focusTime)<20)return;r.focusTime=0}r.preClickTime=0,r.preTouchTime=0,r.isClickToShow()&&(r.isClickToHide()||r.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!r.state.popupVisible;(r.isClickToHide()&&!n||n&&r.isClickToShow())&&r.setPopupVisible(!r.state.popupVisible,e)},r.onPopupMouseDown=function(){var e;r.hasPopupMouseDown=!0,clearTimeout(r.mouseDownTimeout),r.mouseDownTimeout=window.setTimeout((function(){r.hasPopupMouseDown=!1}),0),r.context&&(e=r.context).onPopupMouseDown.apply(e,arguments)},r.onDocumentClick=function(e){if(!r.props.mask||r.props.maskClosable){var t=e.target,n=r.getRootDomNode(),o=r.getPopupDomNode();D(n,t)&&!r.isContextMenuOnly()||D(o,t)||r.hasPopupMouseDown||r.close()}},r.getRootDomNode=function(){var e=r.props.getTriggerDOMNode;if(e)return e(r.triggerRef.current);try{var t=L(r.triggerRef.current);if(t)return t}catch(e){}return P().findDOMNode(x(r))},r.getPopupClassNameFromAlign=function(e){var t=[],n=r.props,o=n.popupPlacement,i=n.builtinPlacements,a=n.prefixCls,c=n.alignPoint,s=n.getPopupClassNameFromAlign;return o&&i&&t.push(function(e,t,n,r){for(var o=n.points,i=Object.keys(e),a=0;a=0||r.indexOf("Bottom")>=0?i.top="".concat(o.height-t.offset[1],"px"):(r.indexOf("Top")>=0||r.indexOf("bottom")>=0)&&(i.top="".concat(-t.offset[1],"px")),r.indexOf("left")>=0||r.indexOf("Right")>=0?i.left="".concat(o.width-t.offset[0],"px"):(r.indexOf("right")>=0||r.indexOf("Left")>=0)&&(i.left="".concat(-t.offset[0],"px")),e.style.transformOrigin="".concat(i.left," ").concat(i.top)}},overlayInnerStyle:L,arrowContent:m.createElement("span",{className:"".concat(S,"-arrow-content"),style:A}),motion:{motionName:Bn(_,"zoom-big-fast",e.transitionName),motionDeadline:1e3}}),P?Xn(M,{className:N}):M)}));Kn.defaultProps={placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0};var Qn=Kn;function Jn(e){return-1!==$n.indexOf(e)}function er(e){var t,n=e.prefixCls,r=e.value,o=e.current,i=e.offset,a=void 0===i?0:i;return a&&(t={position:"absolute",top:"".concat(a,"00%"),left:0}),m.createElement("span",{style:t,className:f()("".concat(n,"-only-unit"),{current:o})},r)}function tr(e,t,n){for(var r=e,o=0;(r+10)%10!==t;)r+=n,o+=n;return o}function nr(e){var t,n,r=e.prefixCls,o=e.count,i=e.value,a=Number(i),c=Math.abs(o),l=s(m.useState(a),2),f=l[0],p=l[1],d=s(m.useState(c),2),h=d[0],v=d[1],g=function(){p(a),v(c)};if(m.useEffect((function(){var e=setTimeout((function(){g()}),1e3);return function(){clearTimeout(e)}}),[a]),f===a||Number.isNaN(a)||Number.isNaN(f))t=[m.createElement(er,u({},e,{key:a,current:!0}))],n={transition:"none"};else{t=[];for(var y=a+10,b=[],w=a;w<=y;w+=1)b.push(w);var x=b.findIndex((function(e){return e%10===f}));t=b.map((function(t,n){var r=t%10;return m.createElement(er,u({},e,{key:t,value:r,offset:n-x,current:n===x}))})),n={transform:"translateY(".concat(-tr(f,a,hg?"".concat(g,"+"):h,N=null!=c||null!=l,D="0"===R||0===R,L=b&&!D,I=L?"":R,z=(0,m.useMemo)((function(){return(null==I||""===I||D&&!_)&&!L}),[I,D,_,L]),F=(0,m.useRef)(h);z||(F.current=h);var H=F.current,V=(0,m.useRef)(I);z||(V.current=I);var $=V.current,B=(0,m.useRef)(L);z||(B.current=L);var W=(0,m.useMemo)((function(){if(!k)return u({},O);var e={marginTop:k[1]};return"rtl"===T?e.left=parseInt(k[0],10):e.right=-parseInt(k[0],10),u(u({},e),O)}),[T,k,O]),q=null!=C?C:"string"==typeof H||"number"==typeof H?H:void 0,Y=z||!s?null:m.createElement("span",{className:"".concat(M,"-status-text")},s),U=H&&"object"===p(H)?Xn(H,(function(e){return{style:u(u({},W),e.style)}})):void 0,G=f()((a(t={},"".concat(M,"-status-dot"),N),a(t,"".concat(M,"-status-").concat(c),!!c),a(t,"".concat(M,"-status-").concat(l),Jn(l)),t)),X={};l&&!Jn(l)&&(X.background=l);var Z=f()(M,(a(n={},"".concat(M,"-status"),N),a(n,"".concat(M,"-not-a-wrapper"),!i),a(n,"".concat(M,"-rtl"),"rtl"===T),n),E);if(!i&&N){var K=W.color;return m.createElement("span",u({},P,{className:Z,style:W}),m.createElement("span",{className:G,style:X}),m.createElement("span",{style:{color:K},className:"".concat(M,"-status-text")},s))}return m.createElement("span",u({},P,{className:Z}),i,m.createElement(De,{visible:!z,motionName:"".concat(M,"-zoom"),motionAppear:!1,motionDeadline:1e3},(function(e){var t,n=e.className,r=j("scroll-number",o),i=B.current,s=f()((a(t={},"".concat(M,"-dot"),i),a(t,"".concat(M,"-count"),!i),a(t,"".concat(M,"-count-sm"),"small"===x),a(t,"".concat(M,"-multiple-words"),!i&&$&&$.toString().length>1),a(t,"".concat(M,"-status-").concat(c),!!c),a(t,"".concat(M,"-status-").concat(l),Jn(l)),t)),p=u({},W);return l&&!Jn(l)&&((p=p||{}).background=l),m.createElement(rr,{prefixCls:r,show:!z,motionClassName:n,className:s,count:$,title:q,style:p,key:"scrollNumber"},U)})),Y)};or.Ribbon=function(e){var t,n=e.className,r=e.prefixCls,o=e.style,i=e.color,c=e.children,s=e.text,l=e.placement,p=void 0===l?"end":l,d=m.useContext(Hn),h=d.getPrefixCls,v=d.direction,g=h("ribbon",r),y=Jn(i),b=f()(g,"".concat(g,"-placement-").concat(p),(a(t={},"".concat(g,"-rtl"),"rtl"===v),a(t,"".concat(g,"-color-").concat(i),y),t),n),w={},x={};return i&&!y&&(w.background=i,x.color=i),m.createElement("div",{className:"".concat(g,"-wrapper")},c,m.createElement("div",{className:b,style:u(u({},w),o)},m.createElement("span",{className:"".concat(g,"-text")},s),m.createElement("div",{className:"".concat(g,"-corner"),style:x})))};var ir=or;function ar(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];return g().Children.forEach(e,(function(e){(null!=e||t.keepEmpty)&&(Array.isArray(e)?n=n.concat(ar(e)):(0,I.isFragment)(e)&&e.props?n=n.concat(ar(e.props.children,t)):n.push(e))})),n}var cr={};function sr(e,t){}var ur=function(e,t){!function(e,t,n){t||cr[n]||(e(!1,n),cr[n]=!0)}(sr,e,t)},lr=new Map,fr=new on((function(e){e.forEach((function(e){var t,n=e.target;null===(t=lr.get(n))||void 0===t||t.forEach((function(e){return e(n)}))}))})),pr=function(e){k(n,e);var t=S(n);function n(){return y(this,n),t.apply(this,arguments)}return w(n,[{key:"render",value:function(){return this.props.children}}]),n}(m.Component),dr=m.createContext(null);function hr(e){var t=e.children,n=e.disabled,r=m.useRef(null),o=m.useRef(null),i=m.useContext(dr),a="function"==typeof t,c=a?t(r):t,s=m.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!a&&m.isValidElement(c)&&H(c),l=u?c.ref:null,f=m.useMemo((function(){return F(l,r)}),[l,r]),p=m.useRef(e);p.current=e;var d=m.useCallback((function(e){var t=p.current,n=t.onResize,r=t.data,o=e.getBoundingClientRect(),a=o.width,c=o.height,u=e.offsetWidth,l=e.offsetHeight,f=Math.floor(a),d=Math.floor(c);if(s.current.width!==f||s.current.height!==d||s.current.offsetWidth!==u||s.current.offsetHeight!==l){var v={width:f,height:d,offsetWidth:u,offsetHeight:l};s.current=v;var m=u===Math.round(a)?a:u,g=l===Math.round(c)?c:l,y=h(h({},v),{},{offsetWidth:m,offsetHeight:g});null==i||i(y,e,r),n&&Promise.resolve().then((function(){n(y,e)}))}}),[]);return m.useEffect((function(){var e,t,i=L(r.current)||L(o.current);return i&&!n&&(e=i,t=d,lr.has(e)||(lr.set(e,new Set),fr.observe(e)),lr.get(e).add(t)),function(){return function(e,t){lr.has(e)&&(lr.get(e).delete(t),lr.get(e).size||(fr.unobserve(e),lr.delete(e)))}(i,d)}}),[r.current,n]),m.createElement(pr,{ref:o},u?m.cloneElement(c,{ref:f}):c)}function vr(e){var t=e.children;return("function"==typeof t?[t]:ar(t)).map((function(t,n){var r=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(n);return m.createElement(hr,u({},e,{key:r}),t)}))}vr.Collection=function(e){var t=e.children,n=e.onBatchResize,r=m.useRef(0),o=m.useRef([]),i=m.useContext(dr),a=m.useCallback((function(e,t,a){r.current+=1;var c=r.current;o.current.push({size:e,element:t,data:a}),Promise.resolve().then((function(){c===r.current&&(null==n||n(o.current),o.current=[])})),null==i||i(e,t,a)}),[n,i]);return m.createElement(dr.Provider,{value:a},t)};var mr=vr;function gr(){var e=m.useReducer((function(e){return e+1}),0);return s(e,2)[1]}var yr=["xxl","xl","lg","md","sm","xs"],br={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},wr=new Map,xr=-1,Cr={},kr={matchHandlers:{},dispatch:function(e){return Cr=e,wr.forEach((function(e){return e(Cr)})),wr.size>=1},subscribe:function(e){return wr.size||this.register(),xr+=1,wr.set(xr,e),e(Cr),xr},unsubscribe:function(e){wr.delete(e),wr.size||this.unregister()},unregister:function(){var e=this;Object.keys(br).forEach((function(t){var n=br[t],r=e.matchHandlers[n];null==r||r.mql.removeListener(null==r?void 0:r.listener)})),wr.clear()},register:function(){var e=this;Object.keys(br).forEach((function(t){var n=br[t],r=function(n){var r=n.matches;e.dispatch(u(u({},Cr),a({},t,r)))},o=window.matchMedia(n);o.addListener(r),e.matchHandlers[n]={mql:o,listener:r},r(o)}))}},Or=m.createContext("default"),Er=function(e){var t=e.children,n=e.size;return m.createElement(Or.Consumer,null,(function(e){return m.createElement(Or.Provider,{value:n||e},t)}))},Sr=Or,_r=function(e,t){var n,r,o=m.useContext(Sr),i=s(m.useState(1),2),c=i[0],l=i[1],d=s(m.useState(!1),2),h=d[0],v=d[1],g=s(m.useState(!0),2),y=g[0],b=g[1],w=m.useRef(),x=m.useRef(),C=F(t,w),k=m.useContext(Hn).getPrefixCls,O=function(){if(x.current&&w.current){var t=x.current.offsetWidth,n=w.current.offsetWidth;if(0!==t&&0!==n){var r=e.gap,o=void 0===r?4:r;2*o0&&void 0!==arguments[0])||arguments[0],t=(0,m.useRef)({}),n=gr();return(0,m.useEffect)((function(){var r=kr.subscribe((function(r){t.current=r,e&&n()}));return function(){return kr.unsubscribe(r)}}),[]),t.current}(Object.keys("object"===p(z)&&z||{}).some((function(e){return["xs","sm","md","lg","xl","xxl"].includes(e)}))),V=m.useMemo((function(){if("object"!==p(z))return{};var e=yr.find((function(e){return H[e]})),t=z[e];return t?{width:t,height:t,lineHeight:"".concat(t,"px"),fontSize:T?t/2:18}:{}}),[H,z]),$=k("avatar",S),B=f()((a(n={},"".concat($,"-lg"),"large"===z),a(n,"".concat($,"-sm"),"small"===z),n)),W=m.isValidElement(A),q=f()($,B,(a(r={},"".concat($,"-").concat(_),!!_),a(r,"".concat($,"-image"),W||A&&y),a(r,"".concat($,"-icon"),!!T),r),M),Y="number"==typeof z?{width:z,height:z,lineHeight:"".concat(z,"px"),fontSize:T?z/2:18}:{};if("string"==typeof A&&y)E=m.createElement("img",{src:A,draggable:N,srcSet:j,onError:function(){var t=e.onError;!1!==(t?t():void 0)&&b(!1)},alt:R,crossOrigin:L});else if(W)E=A;else if(T)E=T;else if(h||1!==c){var U="scale(".concat(c,") translateX(-50%)"),G={msTransform:U,WebkitTransform:U,transform:U},X="number"==typeof z?{lineHeight:"".concat(z,"px")}:{};E=m.createElement(mr,{onResize:O},m.createElement("span",{className:"".concat($,"-string"),ref:function(e){x.current=e},style:u(u({},X),G)},D))}else E=m.createElement("span",{className:"".concat($,"-string"),style:{opacity:0},ref:function(e){x.current=e}},D);return delete I.onError,delete I.gap,m.createElement("span",u({},I,{style:u(u(u({},Y),V),I.style),className:q,ref:C}),E)},Pr=m.forwardRef(_r);Pr.defaultProps={shape:"circle",size:"default"};var Ar=Pr,jr=function(e){return e?"function"==typeof e?e():e:null},Tr=m.forwardRef((function(e,t){var n=e.prefixCls,r=e.title,o=e.content,i=e._overlay,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Vr(e){return $r(e)/255}function $r(e){return parseInt(e,16)}var Br={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Wr(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,a=!1,c=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(Br[e])e=Br[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=Gr.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Gr.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Gr.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Gr.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Gr.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Gr.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Gr.hex8.exec(e))?{r:$r(n[1]),g:$r(n[2]),b:$r(n[3]),a:Vr(n[4]),format:t?"name":"hex8"}:(n=Gr.hex6.exec(e))?{r:$r(n[1]),g:$r(n[2]),b:$r(n[3]),format:t?"name":"hex"}:(n=Gr.hex4.exec(e))?{r:$r(n[1]+n[1]),g:$r(n[2]+n[2]),b:$r(n[3]+n[3]),a:Vr(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=Gr.hex3.exec(e))&&{r:$r(n[1]+n[1]),g:$r(n[2]+n[2]),b:$r(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(Xr(e.r)&&Xr(e.g)&&Xr(e.b)?(t=function(e,t,n){return{r:255*Ir(e,255),g:255*Ir(t,255),b:255*Ir(n,255)}}(e.r,e.g,e.b),a=!0,c="%"===String(e.r).substr(-1)?"prgb":"rgb"):Xr(e.h)&&Xr(e.s)&&Xr(e.v)?(r=zr(e.s),o=zr(e.v),t=function(e,t,n){e=6*Ir(e,360),t=Ir(t,100),n=Ir(n,100);var r=Math.floor(e),o=e-r,i=n*(1-t),a=n*(1-o*t),c=n*(1-(1-o)*t),s=r%6;return{r:255*[n,a,i,i,c,n][s],g:255*[c,n,n,a,i,i][s],b:255*[i,i,c,n,n,a][s]}}(e.h,r,o),a=!0,c="hsv"):Xr(e.h)&&Xr(e.s)&&Xr(e.l)&&(r=zr(e.s),i=zr(e.l),t=function(e,t,n){var r,o,i;if(e=Ir(e,360),t=Ir(t,100),n=Ir(n,100),0===t)o=n,i=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=Hr(c,a,e+1/3),o=Hr(c,a,e),i=Hr(c,a,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,r,i),a=!0,c="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(n),{ok:a,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var qr="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",Yr="[\\s|\\(]+("+qr+")[,|\\s]+("+qr+")[,|\\s]+("+qr+")\\s*\\)?",Ur="[\\s|\\(]+("+qr+")[,|\\s]+("+qr+")[,|\\s]+("+qr+")[,|\\s]+("+qr+")\\s*\\)?",Gr={CSS_UNIT:new RegExp(qr),rgb:new RegExp("rgb"+Yr),rgba:new RegExp("rgba"+Ur),hsl:new RegExp("hsl"+Yr),hsla:new RegExp("hsla"+Ur),hsv:new RegExp("hsv"+Yr),hsva:new RegExp("hsva"+Ur),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Xr(e){return Boolean(Gr.CSS_UNIT.exec(String(e)))}var Zr=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Kr(e){var t=function(e,t,n){e=Ir(e,255),t=Ir(t,255),n=Ir(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,c=r-o,s=0===r?0:c/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/c+(t=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function to(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function no(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function ro(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=Wr(e),o=5;o>0;o-=1){var i=Kr(r),a=Qr(Wr({h:eo(i,o,!0),s:to(i,o,!0),v:no(i,o,!0)}));n.push(a)}n.push(Qr(r));for(var c=1;c<=4;c+=1){var s=Kr(r),u=Qr(Wr({h:eo(s,c),s:to(s,c),v:no(s,c)}));n.push(u)}return"dark"===t.theme?Zr.map((function(e){var r=e.index,o=e.opacity;return Qr(Jr(Wr(t.backgroundColor||"#141414"),Wr(n[r]),100*o))})):n}var oo={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},io={},ao={};Object.keys(oo).forEach((function(e){io[e]=ro(oo[e]),io[e].primary=io[e][5],ao[e]=ro(oo[e],{theme:"dark",backgroundColor:"#141414"}),ao[e].primary=ao[e][5]})),io.red,io.volcano,io.gold,io.orange,io.yellow,io.lime,io.green,io.cyan,io.blue,io.geekblue,io.purple,io.magenta,io.grey;var co="rc-util-key";function so(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):co}function uo(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function lo(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!$())return null;var r,o=document.createElement("style");(null===(t=n.csp)||void 0===t?void 0:t.nonce)&&(o.nonce=null===(r=n.csp)||void 0===r?void 0:r.nonce),o.innerHTML=e;var i=uo(n),a=i.firstChild;return n.prepend&&i.prepend?i.prepend(o):n.prepend&&a?i.insertBefore(o,a):i.appendChild(o),o}var fo=new Map;function po(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=uo(t);return Array.from(fo.get(n).children).find((function(n){return"STYLE"===n.tagName&&n.getAttribute(so(t))===e}))}function ho(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=uo(n);if(!fo.has(r)){var o=lo("",n),i=o.parentNode;fo.set(r,i),i.removeChild(o)}var a,c,s,u=po(t,n);if(u)return(null===(a=n.csp)||void 0===a?void 0:a.nonce)&&u.nonce!==(null===(c=n.csp)||void 0===c?void 0:c.nonce)&&(u.nonce=null===(s=n.csp)||void 0===s?void 0:s.nonce),u.innerHTML!==e&&(u.innerHTML=e),u;var l=lo(e,n);return l.setAttribute(so(n),t),l}function vo(e){return"object"===p(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===p(e.icon)||"function"==typeof e.icon)}function mo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){var r=e[n];return"class"===n?(t.className=r,delete t.class):t[n]=r,t}),{})}function go(e,t,n){return n?g().createElement(e.tag,h(h({key:t},mo(e.attrs)),n),(e.children||[]).map((function(n,r){return go(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))):g().createElement(e.tag,h({key:t},mo(e.attrs)),(e.children||[]).map((function(n,r){return go(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})))}function yo(e){return ro(e)[0]}function bo(e){return e?Array.isArray(e)?e:[e]:[]}var wo="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",xo=["icon","className","onClick","style","primaryColor","secondaryColor"],Co={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},ko=function(e){var t,n,r=e.icon,o=e.className,i=e.onClick,a=e.style,c=e.primaryColor,s=e.secondaryColor,u=v(e,xo),l=Co;if(c&&(l={primaryColor:c,secondaryColor:s||yo(c)}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wo,t=(0,m.useContext)(Lr).csp;(0,m.useEffect)((function(){ho(e,"@ant-design-icons",{prepend:!0,csp:t})}),[])}(),t=vo(r),n="icon should be icon definiton, but got ".concat(r),ur(t,"[@ant-design/icons] ".concat(n)),!vo(r))return null;var f=r;return f&&"function"==typeof f.icon&&(f=h(h({},f),{},{icon:f.icon(l.primaryColor,l.secondaryColor)})),go(f.icon,"svg-".concat(f.name),h({className:o,onClick:i,style:a,"data-icon":f.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},u))};ko.displayName="IconReact",ko.getTwoToneColors=function(){return h({},Co)},ko.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;Co.primaryColor=t,Co.secondaryColor=n||yo(t),Co.calculated=!!n};var Oo=ko;function Eo(e){var t=s(bo(e),2),n=t[0],r=t[1];return Oo.setTwoToneColors({primaryColor:n,secondaryColor:r})}var So=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Eo("#1890ff");var _o=m.forwardRef((function(e,t){var n,r=e.className,o=e.icon,i=e.spin,c=e.rotate,u=e.tabIndex,l=e.onClick,p=e.twoToneColor,d=v(e,So),g=m.useContext(Lr).prefixCls,y=void 0===g?"anticon":g,b=f()(y,(a(n={},"".concat(y,"-").concat(o.name),!!o.name),a(n,"".concat(y,"-spin"),!!i||"loading"===o.name),n),r),w=u;void 0===w&&l&&(w=-1);var x=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,C=s(bo(p),2),k=C[0],O=C[1];return m.createElement("span",h(h({role:"img","aria-label":o.name},d),{},{ref:t,tabIndex:w,onClick:l,className:b}),m.createElement(Oo,{icon:o,primaryColor:k,secondaryColor:O,style:x}))}));_o.displayName="AntdIcon",_o.getTwoToneColor=function(){var e=Oo.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},_o.setTwoToneColor=Eo;var Po=_o,Ao=function(e,t){return m.createElement(Po,h(h({},e),{},{ref:t,icon:Dr}))};Ao.displayName="UserAddOutlined";var jo=m.forwardRef(Ao),To=n(9864),Mo=n(6774),Ro=n.n(Mo),No=function(e){function t(e,r,s,u,p){for(var d,h,v,m,w,C=0,k=0,O=0,E=0,S=0,M=0,N=v=d=0,L=0,I=0,z=0,F=0,H=s.length,V=H-1,$="",B="",W="",q="";Ld)&&(F=($=$.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0s.charCodeAt(8))break;case 115:a=a.replace(s,"-webkit-"+s)+";"+a;break;case 207:case 102:a=a.replace(s,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var Qo=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&Ko(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i=ti&&(ti=t+1),Jo.set(e,t),ei.set(t,e)},ii="style["+Go+'][data-styled-version="5.3.5"]',ai=new RegExp("^"+Go+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),ci=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(Go))return r}}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(Go,"active"),r.setAttribute("data-styled-version","5.3.5");var a=ui();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},fi=function(){function e(e){var t=this.element=li(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(u+=e+",")})),r+=""+c+s+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),gi=/(a)(d)/gi,yi=function(e){return String.fromCharCode(e+(e>25?39:97))};function bi(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=yi(t%52)+n;return(yi(t%52)+n).replace(gi,"$1-$2")}var wi=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},xi=function(e){return wi(5381,e)};function Ci(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var c=n(i,"."+a,void 0,r);t.insertRules(r,a,c)}o.push(a),this.staticRulesId=a}else{for(var s=this.rules.length,u=wi(this.baseHash,n.hash),l="",f=0;f>>0);if(!t.hasNameForId(r,v)){var m=n(l,"."+v,void 0,r);t.insertRules(r,v,m)}o.push(v)}}return o.join(" ")},e}(),Ei=/^\s*\/\/.*$/gm,Si=[":","[",".","#"];function _i(e){var t,n,r,o,i=void 0===e?Wo:e,a=i.options,c=void 0===a?Wo:a,s=i.plugins,u=void 0===s?Bo:s,l=new No(c),f=[],p=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,i,a,c,s,u,l,f){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===f?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),d=function(e,r,i){return 0===r&&-1!==Si.indexOf(i[n.length])||i.match(o)?e:"."+t};function h(e,i,a,c){void 0===c&&(c="&");var s=e.replace(Ei,""),u=i&&a?a+" "+i+" { "+s+" }":s;return t=c,n=i,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(a||!i?"":i,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,d))},p,function(e){if(-2===e){var t=f;return f=[],t}}])),h.hash=u.length?u.reduce((function(e,t){return t.name||Ko(15),wi(e,t.name)}),5381).toString():"",h}var Pi=g().createContext(),Ai=(Pi.Consumer,g().createContext()),ji=(Ai.Consumer,new mi),Ti=_i();function Mi(){return(0,m.useContext)(Pi)||ji}function Ri(e){var t=(0,m.useState)(e.stylisPlugins),n=t[0],r=t[1],o=Mi(),i=(0,m.useMemo)((function(){var t=o;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),a=(0,m.useMemo)((function(){return _i({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,m.useEffect)((function(){Ro()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),g().createElement(Pi.Provider,{value:i},g().createElement(Ai.Provider,{value:a},e.children))}var Ni=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ti);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return Ko(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Ti),this.name+e.hash},e}(),Di=/([A-Z])/,Li=/([A-Z])/g,Ii=/^ms-/,zi=function(e){return"-"+e.toLowerCase()};function Fi(e){return Di.test(e)?e.replace(Li,zi).replace(Ii,"-ms-"):e}var Hi=function(e){return null==e||!1===e||""===e};function Vi(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,c=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,qi=/(^-|-$)/g;function Yi(e){return e.replace(Wi,"-").replace(qi,"")}function Ui(e){return"string"==typeof e&&!0}var Gi=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Xi=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Zi(e,t,n){var r=e[n];Gi(t)&&Gi(r)?Ki(r,t):e[n]=t}function Ki(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r>>0)}("5.3.5"+n+Ji[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):c,u=t.displayName,l=void 0===u?function(e){return Ui(e)?"styled."+e:"Styled("+Yo(e)+")"}(e):u,f=t.displayName&&t.componentId?Yi(t.displayName)+"-"+t.componentId:t.componentId||s,p=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,d=t.shouldForwardProp;r&&e.shouldForwardProp&&(d=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var h,v=new Oi(n,f,r?e.componentStyle:void 0),y=v.isStatic&&0===a.length,b=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,s=e.shouldForwardProp,u=e.styledComponentId,l=e.target,f=function(e,t,n){void 0===e&&(e=Wo);var r=Ho({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,i,a=e;for(t in qo(a)&&(a=a(r)),a)r[t]=o[t]="className"===t?(n=o[t],i=a[t],n&&i?n+" "+i:n||i):a[t]})),[r,o]}(function(e,t,n){return void 0===n&&(n=Wo),e.theme!==n.theme&&e.theme||t||n.theme}(t,(0,m.useContext)(Qi),a)||Wo,t,o),p=f[0],d=f[1],h=function(e,t,n,r){var o=Mi(),i=(0,m.useContext)(Ai)||Ti;return t?e.generateAndInjectStyles(Wo,o,i):e.generateAndInjectStyles(n,o,i)}(i,r,p),v=n,g=d.$as||t.$as||d.as||t.as||l,y=Ui(g),b=d!==t?Ho({},t,{},d):t,w={};for(var x in b)"$"!==x[0]&&"as"!==x&&("forwardedAs"===x?w.as=b[x]:(s?s(x,Io,g):!y||Io(x))&&(w[x]=b[x]));return t.style&&d.style!==t.style&&(w.style=Ho({},t.style,{},d.style)),w.className=Array.prototype.concat(c,u,h!==u?h:null,t.className,d.className).filter(Boolean).join(" "),w.ref=v,(0,m.createElement)(g,w)}(h,e,t,y)};return b.displayName=l,(h=g().forwardRef(b)).attrs=p,h.componentStyle=v,h.displayName=l,h.shouldForwardProp=d,h.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):Bo,h.styledComponentId=f,h.target=r?e.target:e,h.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(t,["componentId"]),i=r&&r+"-"+(Ui(e)?e:Yi(Yo(e)));return ea(e,Ho({},o,{attrs:p,componentId:i}),n)},Object.defineProperty(h,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Ki({},e.defaultProps,t):t}}),h.toString=function(){return"."+h.styledComponentId},o&&Fo()(h,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),h}var ta,na=function(e){return function e(t,n,r){if(void 0===r&&(r=Wo),!(0,To.isValidElementType)(n))return Ko(1,String(n));var o=function(){return t(n,r,Bi.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,Ho({},r,{},o))},o.attrs=function(o){return e(t,n,Ho({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(ea,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){na[e]=na(e)})),ta=function(e,t){this.rules=e,this.componentId=t,this.isStatic=Ci(e),mi.registerId(this.componentId+1)}.prototype,ta.createStyles=function(e,t,n,r){var o=r(Vi(this.rules,t,n,r).join(""),""),i=this.componentId+e;n.insertRules(i,i,o)},ta.removeStyles=function(e,t){t.clearRules(this.componentId+e)},ta.renderStyles=function(e,t,n,r){e>2&&mi.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=ui();return""},this.getStyleTags=function(){return e.sealed?Ko(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return Ko(2);var n=((t={})[Go]="",t["data-styled-version"]="5.3.5",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=ui();return r&&(n.nonce=r),[g().createElement("style",Ho({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new mi({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?Ko(2):g().createElement(Ri,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return Ko(3)}}();const ra=na.div` + .ant-avatar > img { + filter: grayscale(${e=>null!=e&&e.usePublicFetcher?100:0}); + } +`;var oa=()=>{var t,n,r,i,a;const c=o(),{usePublicFetcher:s,toggleUsePublicFetcher:u}=c,l=s?"Switch to execute as the logged-in user":"Switch to execute as a public user";return(0,e.createElement)(ra,{usePublicFetcher:s,className:"antd-app graphiql-auth-toggle","data-testid":"auth-switch"},(0,e.createElement)("span",{style:{margin:"0 5px"}},(0,e.createElement)(Qn,{getPopupContainer:()=>window.document.getElementsByClassName("graphiql-auth-toggle")[0],placement:"bottom",title:l},(0,e.createElement)("button",{"aria-label":l,type:"button",onClick:u,className:"toolbar-button"},(0,e.createElement)(ir,{dot:!s,status:"success"},(0,e.createElement)(Nr,{shape:"circle",size:"small",title:l,src:null!==(t=null===(n=window)||void 0===n||null===(r=n.wpGraphiQLSettings)||void 0===r?void 0:r.avatarUrl)&&void 0!==t?t:null,icon:null!==(i=window)&&void 0!==i&&null!==(a=i.wpGraphiQLSettings)&&void 0!==a&&a.avatarUrl?null:(0,e.createElement)(jo,null)}))))))};const{hooks:ia,useAppContext:aa}=window.wpGraphiQL;ia.addFilter("graphiql_fetcher","graphiql-auth-switch",((e,t)=>{const{usePublicFetcher:n}=o(),{endpoint:r}=aa();return n?(e=>t=>{const n={method:"POST",headers:{Accept:"application/json","content-type":"application/json"},body:JSON.stringify(t),credentials:"omit"};return fetch(e,n).then((e=>e.json()))})(r):e})),ia.addFilter("graphiql_app","graphiql-auth",(t=>(0,e.createElement)(i,null,t))),ia.addFilter("graphiql_toolbar_before_buttons","graphiql-auth-switch",(t=>(t.push((0,e.createElement)(oa,{key:"auth-switch"})),t)),1)}()}(); \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.asset.php b/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.asset.php new file mode 100644 index 00000000..557e0161 --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.asset.php @@ -0,0 +1 @@ + array('wp-element'), 'version' => '869eff3829c2cd794f4e'); diff --git a/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.css b/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.css new file mode 100644 index 00000000..d9317adf --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.css @@ -0,0 +1 @@ +.graphiql-fullscreen #wp-graphiql-wrapper{inset:0;padding:0;position:fixed;z-index:99999}#graphiql-fullscreen-toggle{align-items:center;display:flex;height:30px;justify-content:center;padding:8px}#wp-graphiql-wrapper .contract-icon,.graphiql-fullscreen #wp-graphiql-wrapper .expand-icon{display:none}.graphiql-fullscreen #wp-graphiql-wrapper .contract-icon{display:block} diff --git a/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.js b/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.js new file mode 100644 index 00000000..72db82cc --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.js @@ -0,0 +1 @@ +!function(){"use strict";var e=window.wp.element;const{hooks:t}=window.wpGraphiQL,o=()=>(0,e.createElement)("button",{id:"graphiql-fullscreen-toggle",className:"toolbar-button",title:"Toggle Full Screen",onClick:()=>{document.body.classList.toggle("graphiql-fullscreen")}},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",className:"expand-icon",viewBox:"0 0 512 512"},(0,e.createElement)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"})),(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",className:"contract-icon",viewBox:"0 0 512 512"},(0,e.createElement)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M304 416V304h112M314.2 314.23L432 432M208 96v112H96M197.8 197.77L80 80M416 208H304V96M314.23 197.8L432 80M96 304h112v112M197.77 314.2L80 432"})));t.addFilter("graphiql_toolbar_after_buttons","graphiql-extension",((t,n)=>(t.push((0,e.createElement)(o,{key:"fullscreen-toggle"})),t)))}(); \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.asset.php b/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.asset.php new file mode 100644 index 00000000..7b1973b6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.asset.php @@ -0,0 +1 @@ + array('react', 'react-dom', 'wp-element'), 'version' => 'afcdd7bc76e2b7fe5cd5'); diff --git a/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.css b/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.css new file mode 100644 index 00000000..6ad4295e --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.css @@ -0,0 +1 @@ +#wp-graphiql-wrapper .docExplorerWrap{background:#fff;box-shadow:0 0 8px rgba(0,0,0,.15);position:relative;z-index:4}#wp-graphiql-wrapper .docExplorerWrap .doc-explorer-title-bar{cursor:default;display:flex;height:34px;line-height:14px;padding:8px 8px 5px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#wp-graphiql-wrapper .docExplorerWrap .doc-explorer-title{flex:1 1;font-weight:700;overflow-x:hidden;overflow-y:hidden;padding:5px 0 10px 10px;text-align:center;text-overflow:ellipsis;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;white-space:nowrap}#wp-graphiql-wrapper .docExplorerWrap .doc-explorer-rhs{position:relative} diff --git a/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.js b/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.js new file mode 100644 index 00000000..c5d10c27 --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.js @@ -0,0 +1,14 @@ +!function(){var e={4184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;tu))return!1;var d=c.get(e),p=c.get(t);if(d&&p)return d==t&&p==e;var m=-1,v=!0,h=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++m-1&&e%1==0&&e-1}},4705:function(e,t,n){var r=n(8470);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4785:function(e,t,n){var r=n(1989),o=n(8407),i=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1285:function(e,t,n){var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:function(e,t,n){var r=n(5050);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},4536:function(e,t,n){var r=n(852)(Object,"create");e.exports=r},6916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},1167:function(e,t,n){e=n.nmd(e);var r=n(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,l=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=l},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5639:function(e,t,n){var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:function(e){e.exports=function(e){return this.__data__.has(e)}},1814:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},7465:function(e,t,n){var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,n){var r=n(8407),o=n(7071),i=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},3279:function(e,t,n){var r=n(3218),o=n(7771),i=n(4841),a=Math.max,l=Math.min;e.exports=function(e,t,n){var c,s,u,f,d,p,m=0,v=!1,h=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=c,r=s;return c=s=void 0,m=t,f=e.apply(r,n)}function b(e){return m=e,d=setTimeout(C,t),v?y(e):f}function w(e){var n=e-p;return void 0===p||n>=t||n<0||h&&e-m>=u}function C(){var e=o();if(w(e))return x(e);d=setTimeout(C,function(e){var n=t-(e-p);return h?l(n,u-(e-m)):n}(e))}function x(e){return d=void 0,g&&c?y(e):(c=s=void 0,f)}function E(){var e=o(),n=w(e);if(c=arguments,s=this,p=e,n){if(void 0===d)return b(p);if(h)return clearTimeout(d),d=setTimeout(C,t),y(p)}return void 0===d&&(d=setTimeout(C,t)),f}return t=i(t)||0,r(n)&&(v=!!n.leading,u=(h="maxWait"in n)?a(i(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),E.cancel=function(){void 0!==d&&clearTimeout(d),m=0,c=p=s=d=void 0},E.flush=function(){return void 0===d?f:x(o())},E}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},5694:function(e,t,n){var r=n(9454),o=n(7005),i=Object.prototype,a=i.hasOwnProperty,l=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!l.call(e,"callee")};e.exports=c},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var r=n(3560),o=n(1780);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},4144:function(e,t,n){e=n.nmd(e);var r=n(5639),o=n(5062),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,l=a&&a.exports===i?r.Buffer:void 0,c=(l?l.isBuffer:void 0)||o;e.exports=c},8446:function(e,t,n){var r=n(939);e.exports=function(e,t){return r(e,t)}},3560:function(e,t,n){var r=n(4239),o=n(3218);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},3448:function(e,t,n){var r=n(4239),o=n(7005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},6719:function(e,t,n){var r=n(8749),o=n(1717),i=n(1167),a=i&&i.isTypedArray,l=a?o(a):r;e.exports=l},3674:function(e,t,n){var r=n(4636),o=n(280),i=n(8612);e.exports=function(e){return i(e)?r(e):o(e)}},7771:function(e,t,n){var r=n(5639);e.exports=function(){return r.Date.now()}},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},4841:function(e,t,n){var r=n(7561),o=n(3218),i=n(3448),a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):a.test(e)?NaN:+e}},7563:function(e,t,n){"use strict";const r=n(610),o=n(4020),i=n(500),a=n(2806),l=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function s(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function u(e,t){return t.decode?o(e):e}function f(e){return Array.isArray(e)?e.sort():"object"==typeof e?f(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function m(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function v(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&u(n,e).includes(e.arrayFormatSeparator);n=i?u(n,e):n;const a=o||i?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(r[t]=n?u(n,e):n);const i=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],i):r[t]=i};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;let[e,a]=i(t.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:u(a,t),n(u(e,t),a,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=m(n[e],t);else r[e]=m(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=f(n):e[t]=n,e}),Object.create(null))}t.extract=p,t.parse=v,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[s(t,e),"[",o,"]"].join("")]:[...n,[s(t,e),"[",s(o,e),"]=",s(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[s(t,e),"[]"].join("")]:[...n,[s(t,e),"[]=",s(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[s(t,e),":list="].join("")]:[...n,[s(t,e),":list=",s(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[s(n,e),t,s(o,e)].join("")]:[[r,s(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,s(t,e)]:[...n,[s(t,e),"=",s(r,e)].join("")]}}(t),o={};for(const t of Object.keys(e))n(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const o=e[n];return void 0===o?"":null===o?s(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?s(n,t)+"[]":o.reduce(r(n),[]).join("&"):s(n,t)+"="+s(o,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:v(p(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[l]:!0},n);const r=d(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),a=Object.assign(i,e.query);let c=t.stringify(a,n);c&&(c=`?${c}`);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u=`#${n[l]?s(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${c}${u}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[l]:!1},r);const{url:o,query:i,fragmentIdentifier:c}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:a(i,n),fragmentIdentifier:c},r)},t.exclude=(e,n,r)=>{const o=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,o,r)}},1162:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,s=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),v=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case i:case l:case a:case p:return e;default:switch(e=e&&e.$$typeof){case s:case d:case v:case m:case c:return e;default:return t}}case o:return t}}}t.isFragment=function(e){return h(e)===i},t.isMemo=function(e){return h(e)===m}},1805:function(e,t,n){"use strict";e.exports=n(1162)},9921:function(e,t){"use strict";var n=60103,r=60106,o=60107,i=60108,a=60114,l=60109,c=60110,s=60112,u=60113,f=60120,d=60115,p=60116,m=60121,v=60122,h=60117,g=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var b=Symbol.for;n=b("react.element"),r=b("react.portal"),o=b("react.fragment"),i=b("react.strict_mode"),a=b("react.profiler"),l=b("react.provider"),c=b("react.context"),s=b("react.forward_ref"),u=b("react.suspense"),f=b("react.suspense_list"),d=b("react.memo"),p=b("react.lazy"),m=b("react.block"),v=b("react.server.block"),h=b("react.fundamental"),g=b("react.debug_trace_mode"),y=b("react.legacy_hidden")}t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===a||e===g||e===i||e===u||e===f||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===d||e.$$typeof===l||e.$$typeof===c||e.$$typeof===s||e.$$typeof===h||e.$$typeof===m||e[0]===v)},t.typeOf=function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case a:case i:case u:case f:return e;default:switch(e=e&&e.$$typeof){case c:case s:case p:case d:case l:return e;default:return t}}case r:return t}}}},9864:function(e,t,n){"use strict";e.exports=n(9921)},6774:function(e){e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),c=0;c{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},610:function(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;tr(s),f=e=>{let{children:n}=e;const r=c(),{queryParams:i,setQueryParams:a}=r,[u,f]=o((()=>{var e,t,n;const r=null!==(e=null===(t=window)||void 0===t?void 0:t.localStorage.getItem("graphiql:isQueryComposerOpen"))&&void 0!==e?e:null,o="true"===(null==i?void 0:i.explorerIsOpen),a=null!==(n=null==i?void 0:i.isQueryComposerOpen)&&void 0!==n?n:o;return null!==a?a:null!==r&&r})()),d=l.applyFilters("graphiql_explorer_context_default_value",{isQueryComposerOpen:u,toggleExplorer:()=>{(e=>{var t;u!==e&&f(e);const n={...i,isQueryComposerOpen:e,explorerIsOpen:void 0};JSON.stringify(n)!==JSON.stringify(i)&&a(n),null===(t=window)||void 0===t||t.localStorage.setItem("graphiql:isQueryComposerOpen",`${e}`)})(!u)}});return(0,t.createElement)(s.Provider,{value:d},n)},{useEffect:d}=wp.element;var p=e=>{const{isQueryComposerOpen:n,toggleExplorer:r}=u(),{children:o}=e,i="400px";return n?(0,t.createElement)("div",{className:"docExplorerWrap doc-explorer-app query-composer-wrap",style:{height:"100%",width:i,minWidth:i,zIndex:8,display:n?"flex":"none",flexDirection:"column",overflow:"hidden"}},(0,t.createElement)("div",{className:"doc-explorer"},(0,t.createElement)("div",{className:"doc-explorer-title-bar"},(0,t.createElement)("div",{className:"doc-explorer-title"},"Query Composer"),(0,t.createElement)("div",{className:"doc-explorer-rhs"},(0,t.createElement)("div",{className:"docExplorerHide",style:{cursor:"pointer",fontSize:"18px",margin:"-7px -8px -6px 0",padding:"18px 16px 15px 12px",background:0,border:0,lineHeight:"14px"},onClick:r},"✕"))),(0,t.createElement)("div",{className:"doc-explorer-contents",style:{backgroundColor:"#ffffff",borderTop:"1px solid #d6d6d6",bottom:0,left:0,overflowY:"hidden",padding:"0",right:0,top:"47px",position:"absolute"}},o))):null},m=wpGraphiQL.GraphQL,v=window.React,h=n.n(v);let g=null;const y=e=>{const t=e.getFields();if(t.id){const e=["id"];return t.email?e.push("email"):t.name&&e.push("name"),e}if(t.edges)return["edges"];if(t.node)return["node"];if(t.nodes)return["nodes"];const n=[];return Object.keys(t).forEach((e=>{(0,m.isLeafType)(t[e].type)&&n.push(e)})),n.length?n.slice(0,2):["__typename"]},b={keyword:"#B11A04",def:"#D2054E",property:"#1F61A0",qualifier:"#1C92A9",attribute:"#8B2BB9",number:"#2882F9",string:"#D64292",builtin:"#D47509",string2:"#0B7FC7",variable:"#397D13",atom:"#CA9800"},w=(0,t.createElement)("svg",{width:"12",height:"9"},(0,t.createElement)("path",{fill:"#666",d:"M 0 2 L 9 2 L 4.5 7.5 z"})),C=(0,t.createElement)("svg",{width:"12",height:"9"},(0,t.createElement)("path",{fill:"#666",d:"M 0 0 L 0 9 L 5.5 4.5 z"})),x=(0,t.createElement)("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0ZM16 16H2V2H16V16ZM14.99 6L13.58 4.58L6.99 11.17L4.41 8.6L2.99 10.01L6.99 14L14.99 6Z",fill:"#666"})),E=(0,t.createElement)("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M16 2V16H2V2H16ZM16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0Z",fill:"#CCC"})),k={buttonStyle:{fontSize:"1.2em",padding:"0px",backgroundColor:"white",border:"none",margin:"5px 0px",height:"40px",width:"100%",display:"block",maxWidth:"none"},actionButtonStyle:{padding:"0px",backgroundColor:"white",border:"none",margin:"0px",maxWidth:"none",height:"15px",width:"15px",display:"inline-block",fontSize:"smaller"},explorerActionsStyle:{margin:"4px -8px -8px",paddingLeft:"8px",bottom:"0px",width:"100%",textAlign:"center",background:"none",borderTop:"none",borderBottom:"none"}},S={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],name:{kind:"Name",value:"NewQuery"},directives:[],selectionSet:{kind:"SelectionSet",selections:[]}}]},O=e=>{if(g&&g[0]===e)return g[1];{const n=(e=>{try{return e.trim()?(0,m.parse)(e,{noLocation:!0}):null}catch(e){return new Error(e)}})(e);var t;return n?n instanceof Error?g?null!==(t=g[1])&&void 0!==t?t:"":S:(g=[e,n],n):S}},N=e=>e.charAt(0).toUpperCase()+e.slice(1),P=e=>(0,m.isNonNullType)(e.type)&&void 0===e.defaultValue,A=e=>{let t=e;for(;(0,m.isWrappingType)(t);)t=t.ofType;return t},M=e=>{let t=e;for(;(0,m.isWrappingType)(t);)t=t.ofType;return t},R=(e,t)=>{if("string"!=typeof t&&"VariableDefinition"===t.kind)return t.variable;if((0,m.isScalarType)(e))try{switch(e.name){case"String":return{kind:"StringValue",value:String(e.parseValue(t))};case"Float":return{kind:"FloatValue",value:String(e.parseValue(parseFloat(t)))};case"Int":return{kind:"IntValue",value:String(e.parseValue(parseInt(t,10)))};case"Boolean":try{const e=JSON.parse(t);return"boolean"==typeof e?{kind:"BooleanValue",value:e}:{kind:"BooleanValue",value:!1}}catch(e){return{kind:"BooleanValue",value:!1}}default:return{kind:"StringValue",value:String(e.parseValue(t))}}}catch(e){return console.error("error coercing arg value",e,t),{kind:"StringValue",value:t}}else try{const n=e.parseValue(t);return n?{kind:"EnumValue",value:String(n)}:{kind:"EnumValue",value:e.getValues()[0].name}}catch(t){return{kind:"EnumValue",value:e.getValues()[0].name}}},T=(e,t,n,r)=>{const o=[];for(const i of r)if((0,m.isRequiredInputField)(i)||t&&t(n,i)){const r=M(i.type);if((0,m.isInputObjectType)(r)){const a=r.getFields();o.push({kind:"ObjectField",name:{kind:"Name",value:i.name},value:{kind:"ObjectValue",fields:T(e,t,n,Object.keys(a).map((e=>a[e])))}})}else(0,m.isLeafType)(r)&&o.push({kind:"ObjectField",name:{kind:"Name",value:i.name},value:e(n,i,r)})}return o},F=(e,t,n)=>{const r=[];for(const o of n.args)if(P(o)||t&&t(n,o)){const i=M(o.type);if((0,m.isInputObjectType)(i)){const a=i.getFields();r.push({kind:"Argument",name:{kind:"Name",value:o.name},value:{kind:"ObjectValue",fields:T(e,t,n,Object.keys(a).map((e=>a[e])))}})}else(0,m.isLeafType)(i)&&r.push({kind:"Argument",name:{kind:"Name",value:o.name},value:e(n,o,i)})}return r},I=(e,t,n)=>(e=>{if((0,m.isEnumType)(e))return{kind:"EnumValue",value:e.getValues()[0].name};switch(e.name){case"String":default:return{kind:"StringValue",value:""};case"Float":return{kind:"FloatValue",value:"1.5"};case"Int":return{kind:"IntValue",value:"10"};case"Boolean":return{kind:"BooleanValue",value:!1}}})(n);function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e){if(Array.isArray(e))return e}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function K(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1,n=ae+=1;function r(t){if(0===t)ce(n),e();else{var o=oe((function(){r(t-1)}));le.set(n,o)}}return r(t),n}function ue(e,t){return!!e&&e.contains(t)}function fe(e){return e instanceof HTMLElement?e:re().findDOMNode(e)}se.cancel=function(e){var t=le.get(e);return ce(t),ie(t)};var de=n(1805);function pe(e,t,n){var r=v.useRef({});return"value"in r.current&&!n(r.current.condition,t)||(r.current.value=e(),r.current.condition=t),r.current.value}function me(e,t){"function"==typeof e?e(t):"object"===W(e)&&e&&"current"in e&&(e.current=t)}function ve(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:2;t();var i=se((function(){o<=1?r({isCanceled:function(){return i!==e.current}}):n(r,o-1)}));e.current=i},t]}(),a=z(i,2),l=a[0],c=a[1];return Ge((function(){if(r!==$e&&r!==qe){var e=Ye.indexOf(r),n=Ye[e+1],i=t(r);!1===i?o(n,!0):l((function(e){function t(){e.isCanceled()||o(n,!0)}!0===i?t():Promise.resolve(i).then(t)}))}}),[e,r]),v.useEffect((function(){return function(){c()}}),[]),[function(){o(We,!0)},r]}(M,(function(e){if(e===We){var t=B.prepare;return!!t&&t(V())}var n;return G in B&&I((null===(n=B[G])||void 0===n?void 0:n.call(B,V(),null))||null),G===Ue&&(W(V()),u>0&&(clearTimeout(D.current),D.current=setTimeout((function(){H({deadline:!0})}),u))),!0})),2),K=q[0],G=q[1],Y=Xe(G);L.current=Y,Ge((function(){P(t);var n,r=_.current;_.current=!0,e&&(!r&&t&&l&&(n=Le),r&&t&&i&&(n=ze),(r&&!t&&s||!r&&f&&!t&&s)&&(n=He),n&&(R(n),K()))}),[t]),(0,v.useEffect)((function(){(M===Le&&!l||M===ze&&!i||M===He&&!s)&&R(Ve)}),[l,i,s]),(0,v.useEffect)((function(){return function(){_.current=!1,clearTimeout(D.current)}}),[]),(0,v.useEffect)((function(){void 0!==N&&M===Ve&&(null==S||S(N))}),[N,M]);var X=F;return B.prepare&&G===Be&&(X=U({transition:"none"},X)),[M,G,X,null!=N?N:t]}var Ze=function(e){Z(n,e);var t=te(n);function n(){return K(this,n),t.apply(this,arguments)}return Y(n,[{key:"render",value:function(){return this.props.children}}]),n}(v.Component),Je=Ze,et=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===W(e)&&(t=e.transitionSupport);var r=v.forwardRef((function(e,t){var r=e.visible,o=void 0===r||r,i=e.removeOnLeave,a=void 0===i||i,l=e.forceRender,c=e.children,s=e.motionName,u=e.leavedClassName,f=e.eventProps,d=n(e),p=(0,v.useRef)(),m=(0,v.useRef)(),h=z(Qe(d,o,(function(){try{return p.current instanceof HTMLElement?p.current:fe(m.current)}catch(e){return null}}),e),4),g=h[0],y=h[1],b=h[2],w=h[3],C=v.useRef(w);w&&(C.current=!0);var x,E=v.useCallback((function(e){p.current=e,me(t,e)}),[t]),k=U(U({},f),{},{visible:o});if(c)if(g!==Ve&&n(e)){var S,O;y===We?O="prepare":Xe(y)?O="active":y===Be&&(O="start"),x=c(U(U({},k),{},{className:$()(De(s,g),(S={},j(S,De(s,"".concat(g,"-").concat(O)),O),j(S,s,"string"==typeof s),S)),style:b}),E)}else x=w?c(U({},k),E):!a&&C.current?c(U(U({},k),{},{className:u}),E):l?c(U(U({},k),{},{style:{display:"none"}}),E):null;else x=null;return v.isValidElement(x)&&he(x)&&(x.ref||(x=v.cloneElement(x,{ref:E}))),v.createElement(Je,{ref:m},x)}));return r.displayName="CSSMotion",r}(Ie),tt="add",nt="keep",rt="remove",ot="removed";function it(e){var t;return U(U({},t=e&&"object"===W(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function at(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(it)}function lt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,i=at(e),a=at(t);i.forEach((function(e){for(var t=!1,i=r;i1}));return c.forEach((function(e){n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==rt})),n.forEach((function(t){t.key===e&&(t.status=nt)}))})),n}var ct=["component","children","onVisibleChanged","onAllRemoved"],st=["status"],ut=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"],ft=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:et,r=function(t){Z(o,t);var r=te(o);function o(){var e;K(this,o);for(var t=arguments.length,n=new Array(t),i=0;i=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function on(e){var t,n,r;if(Jt.isWindow(e)||9===e.nodeType){var o=Jt.getWindow(e);t={left:Jt.getWindowScrollLeft(o),top:Jt.getWindowScrollTop(o)},n=Jt.viewportWidth(o),r=Jt.viewportHeight(o)}else t=Jt.offset(e),n=Jt.outerWidth(e),r=Jt.outerHeight(e);return t.width=n,t.height=r,t}function an(e,t){var n=t.charAt(0),r=t.charAt(1),o=e.width,i=e.height,a=e.left,l=e.top;return"c"===n?l+=i/2:"b"===n&&(l+=i),"c"===r?a+=o/2:"r"===r&&(a+=o),{left:a,top:l}}function ln(e,t,n,r,o){var i=an(t,n[1]),a=an(e,n[0]),l=[a.left-i.left,a.top-i.top];return{left:Math.round(e.left-l[0]+r[0]-o[0]),top:Math.round(e.top-l[1]+r[1]-o[1])}}function cn(e,t,n){return e.leftn.right}function sn(e,t,n){return e.topn.bottom}function un(e,t,n){var r=[];return Jt.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function fn(e,t){return e[t]=-e[t],e}function dn(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function pn(e,t){e[0]=dn(e[0],t.width),e[1]=dn(e[1],t.height)}function mn(e,t,n,r){var o=n.points,i=n.offset||[0,0],a=n.targetOffset||[0,0],l=n.overflow,c=n.source||e;i=[].concat(i),a=[].concat(a);var s={},u=0,f=rn(c,!(!(l=l||{})||!l.alwaysByViewport)),d=on(c);pn(i,d),pn(a,t);var p=ln(d,t,o,i,a),m=Jt.merge(d,p);if(f&&(l.adjustX||l.adjustY)&&r){if(l.adjustX&&cn(p,d,f)){var v=un(o,/[lr]/gi,{l:"r",r:"l"}),h=fn(i,0),g=fn(a,0);(function(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.left&&o.left+i.width>n.right&&(i.width-=o.left+i.width-n.right),r.adjustX&&o.left+i.width>n.right&&(o.left=Math.max(n.right-i.width,n.left)),r.adjustY&&o.top=n.top&&o.top+i.height>n.bottom&&(i.height-=o.top+i.height-n.bottom),r.adjustY&&o.top+i.height>n.bottom&&(o.top=Math.max(n.bottom-i.height,n.top)),Jt.mix(o,i)}(p,d,f,s))}return m.width!==d.width&&Jt.css(c,"width",Jt.width(c)+m.width-d.width),m.height!==d.height&&Jt.css(c,"height",Jt.height(c)+m.height-d.height),Jt.offset(c,{left:m.left,top:m.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:o,offset:i,targetOffset:a,overflow:s}}function vn(e,t,n){var r=n.target||t,o=on(r),i=!function(e,t){var n=rn(e,t),r=on(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return mn(e,o,n,i)}vn.__getOffsetParent=tn,vn.__getVisibleRectForElement=rn;var hn=n(8446),gn=n.n(hn),yn=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){bn&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),En?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){bn&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,r=xn.some((function(e){return!!~n.indexOf(e)}));r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Sn=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),Dn="undefined"!=typeof WeakMap?new WeakMap:new yn,Vn=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=kn.getInstance(),r=new jn(t,n,this);Dn.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Vn.prototype[e]=function(){var t;return(t=Dn.get(this))[e].apply(t,arguments)}}));var Ln=void 0!==wn.ResizeObserver?wn.ResizeObserver:Vn;function zn(e,t){var n=null,r=null,o=new Ln((function(e){var o=z(e,1)[0].target;if(document.documentElement.contains(o)){var i=o.getBoundingClientRect(),a=i.width,l=i.height,c=Math.floor(a),s=Math.floor(l);n===c&&r===s||Promise.resolve().then((function(){t({width:c,height:s})})),n=c,r=s}}));return e&&o.observe(e),function(){o.disconnect()}}function Hn(e){return"function"!=typeof e?null:e()}function $n(e){return"object"===W(e)&&e?e:null}var Wn=function(e,t){var n=e.children,r=e.disabled,o=e.target,i=e.align,a=e.onAlign,l=e.monitorWindowResize,c=e.monitorBufferTime,s=void 0===c?0:c,u=h().useRef({}),f=h().useRef(),d=h().Children.only(n),p=h().useRef({});p.current.disabled=r,p.current.target=o,p.current.align=i,p.current.onAlign=a;var m=function(e,t){var n=h().useRef(!1),r=h().useRef(null);function o(){window.clearTimeout(r.current)}return[function e(i){if(o(),n.current&&!0!==i)r.current=window.setTimeout((function(){n.current=!1,e()}),t);else{if(!1===function(){var e=p.current,t=e.disabled,n=e.target,r=e.align,o=e.onAlign;if(!t&&n){var i,a=f.current,l=Hn(n),c=$n(n);u.current.element=l,u.current.point=c,u.current.align=r;var s=document.activeElement;return l&&ht(l)?i=vn(a,l,r):c&&(i=function(e,t,n){var r,o,i=Jt.getDocument(e),a=i.defaultView||i.parentWindow,l=Jt.getWindowScrollLeft(a),c=Jt.getWindowScrollTop(a),s=Jt.viewportWidth(a),u=Jt.viewportHeight(a),f={left:r="pageX"in t?t.pageX:l+t.clientX,top:o="pageY"in t?t.pageY:c+t.clientY,width:0,height:0},d=r>=0&&r<=l+s&&o>=0&&o<=c+u,p=[n.points[0],"cc"];return mn(e,f,yt(yt({},n),{},{points:p}),d)}(a,c,r)),function(e,t){e!==document.activeElement&&ue(t,e)&&"function"==typeof e.focus&&e.focus()}(s,a),o&&i&&o(a,i),!0}return!1}())return;n.current=!0,r.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,o()}]}(0,s),v=z(m,2),g=v[0],y=v[1],b=h().useRef({cancel:function(){}}),w=h().useRef({cancel:function(){}});h().useEffect((function(){var e,t,n=Hn(o),r=$n(o);f.current!==w.current.element&&(w.current.cancel(),w.current.element=f.current,w.current.cancel=zn(f.current,g)),u.current.element===n&&((e=u.current.point)===(t=r)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&gn()(u.current.align,i)||(g(),b.current.element!==n&&(b.current.cancel(),b.current.element=n,b.current.cancel=zn(n,g)))})),h().useEffect((function(){r?y():g()}),[r]);var C=h().useRef(null);return h().useEffect((function(){l?C.current||(C.current=ge(window,"resize",g)):C.current&&(C.current.remove(),C.current=null)}),[l]),h().useEffect((function(){return function(){b.current.cancel(),w.current.cancel(),C.current&&C.current.remove(),y()}}),[]),h().useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),h().isValidElement(d)&&(d=h().cloneElement(d,{ref:ve(d.ref,f)})),d},Bn=h().forwardRef(Wn);Bn.displayName="Align";var Un=Bn,qn=ye()?v.useLayoutEffect:v.useEffect;function Kn(){Kn=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new E(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=w(a,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function f(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,h=v&&v(v(k([])));h&&h!==t&&n.call(h,o)&&(m=h);var g=p.prototype=f.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(o,i,a,l){var c=s(e[o],e,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==W(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,l)}))}l(c.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function k(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Gn(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,o)}function Yn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Gn(i,r,o,a,l,"next",e)}function l(e){Gn(i,r,o,a,l,"throw",e)}a(void 0)}))}}var Xn=["measure","alignPre","align",null,"motion"],Qn=v.forwardRef((function(t,n){var r=t.visible,o=t.prefixCls,i=t.className,a=t.style,l=t.children,c=t.zIndex,s=t.stretch,u=t.destroyPopupOnHide,f=t.forceRender,d=t.align,p=t.point,m=t.getRootDomNode,h=t.getClassNameFromAlign,g=t.onAlign,y=t.onMouseEnter,b=t.onMouseLeave,w=t.onMouseDown,C=t.onTouchStart,x=t.onClick,E=(0,v.useRef)(),k=(0,v.useRef)(),S=z((0,v.useState)(),2),O=S[0],N=S[1],P=function(e){var t=z(v.useState({width:0,height:0}),2),n=t[0],r=t[1];return[v.useMemo((function(){var t={};if(e){var r=n.width,o=n.height;-1!==e.indexOf("height")&&o?t.height=o:-1!==e.indexOf("minHeight")&&o&&(t.minHeight=o),-1!==e.indexOf("width")&&r?t.width=r:-1!==e.indexOf("minWidth")&&r&&(t.minWidth=r)}return t}),[e,n]),function(e){r({width:e.offsetWidth,height:e.offsetHeight})}]}(s),A=z(P,2),M=A[0],R=A[1],T=function(e,t){var n=z(Ke(null),2),r=n[0],o=n[1],i=(0,v.useRef)();function a(e){o(e,!0)}function l(){se.cancel(i.current)}return(0,v.useEffect)((function(){a("measure")}),[e]),(0,v.useEffect)((function(){"measure"===r&&(s&&R(m())),r&&(i.current=se(Yn(Kn().mark((function e(){var t,n;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Xn.indexOf(r),(n=Xn[t+1])&&-1!==t&&a(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),(0,v.useEffect)((function(){return function(){l()}}),[]),[r,function(e){l(),i.current=se((function(){a((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r),F=z(T,2),I=F[0],j=F[1],_=z((0,v.useState)(0),2),D=_[0],V=_[1],L=(0,v.useRef)();function H(){var e;null===(e=E.current)||void 0===e||e.forceAlign()}function W(e,t){var n=h(t);O!==n&&N(n),V((function(e){return e+1})),"align"===I&&(null==g||g(e,t))}qn((function(){"alignPre"===I&&V(0)}),[I]),qn((function(){"align"===I&&(D<2?H():j((function(){var e;null===(e=L.current)||void 0===e||e.call(L)})))}),[D]);var B=U({},pt(t));function q(){return new Promise((function(e){L.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=B[e];B[e]=function(e,n){return j(),null==t?void 0:t(e,n)}})),v.useEffect((function(){B.motionName||"motion"!==I||j()}),[B.motionName,I]),v.useImperativeHandle(n,(function(){return{forceAlign:H,getElement:function(){return k.current}}}));var K=U(U({},M),{},{zIndex:c,opacity:"motion"!==I&&"stable"!==I&&r?0:void 0,pointerEvents:r||"stable"===I?void 0:"none"},a),G=!0;!(null==d?void 0:d.points)||"align"!==I&&"stable"!==I||(G=!1);var Y=l;return v.Children.count(l)>1&&(Y=v.createElement("div",{className:"".concat(o,"-content")},l)),v.createElement(dt,e({visible:r,ref:k,leavedClassName:"".concat(o,"-hidden")},B,{onAppearPrepare:q,onEnterPrepare:q,removeOnLeave:u,forceRender:f}),(function(e,t){var n=e.className,r=e.style,a=$()(o,i,O,n);return v.createElement(Un,{target:p||m,key:"popup",ref:E,monitorWindowResize:!0,disabled:G,align:d,onAlign:W},v.createElement("div",{ref:t,className:a,onMouseEnter:y,onMouseLeave:b,onMouseDownCapture:w,onTouchStartCapture:C,onClick:x,style:U(U({},r),K)},Y))}))}));Qn.displayName="PopupInner";var Zn=Qn,Jn=v.forwardRef((function(t,n){var r=t.prefixCls,o=t.visible,i=t.zIndex,a=t.children,l=t.mobile,c=(l=void 0===l?{}:l).popupClassName,s=l.popupStyle,u=l.popupMotion,f=void 0===u?{}:u,d=l.popupRender,p=t.onClick,m=v.useRef();v.useImperativeHandle(n,(function(){return{forceAlign:function(){},getElement:function(){return m.current}}}));var h=U({zIndex:i},s),g=a;return v.Children.count(a)>1&&(g=v.createElement("div",{className:"".concat(r,"-content")},a)),d&&(g=d(g)),v.createElement(dt,e({visible:o,ref:m,removeOnLeave:!0},f),(function(e,t){var n=e.className,o=e.style,i=$()(r,c,n);return v.createElement("div",{ref:t,className:i,onClick:p,style:U(U({},o),h)},g)}))}));Jn.displayName="MobilePopupInner";var er=Jn,tr=["visible","mobile"],nr=v.forwardRef((function(t,n){var r=t.visible,o=t.mobile,i=q(t,tr),a=z((0,v.useState)(r),2),l=a[0],c=a[1],s=z((0,v.useState)(!1),2),u=s[0],f=s[1],d=U(U({},i),{},{visible:l});(0,v.useEffect)((function(){c(r),r&&o&&f(xe())}),[r,o]);var p=u?v.createElement(er,e({},d,{mobile:o,ref:n})):v.createElement(Zn,e({},d,{ref:n}));return v.createElement("div",null,v.createElement(mt,d),p)}));nr.displayName="Popup";var rr=nr,or=v.createContext(null);function ir(){}var ar,lr,cr,sr=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"],ur=(ar=we,lr=function(t){Z(r,t);var n=te(r);function r(t){var o,i;return K(this,r),(o=n.call(this,t)).popupRef=v.createRef(),o.triggerRef=v.createRef(),o.portalContainer=void 0,o.attachId=void 0,o.clickOutsideHandler=void 0,o.touchOutsideHandler=void 0,o.contextMenuOutsideHandler1=void 0,o.contextMenuOutsideHandler2=void 0,o.mouseDownTimeout=void 0,o.focusTime=void 0,o.preClickTime=void 0,o.preTouchTime=void 0,o.delayTimer=void 0,o.hasPopupMouseDown=void 0,o.onMouseEnter=function(e){var t=o.props.mouseEnterDelay;o.fireEvents("onMouseEnter",e),o.delaySetPopupVisible(!0,t,t?null:e)},o.onMouseMove=function(e){o.fireEvents("onMouseMove",e),o.setPoint(e)},o.onMouseLeave=function(e){o.fireEvents("onMouseLeave",e),o.delaySetPopupVisible(!1,o.props.mouseLeaveDelay)},o.onPopupMouseEnter=function(){o.clearDelayTimer()},o.onPopupMouseLeave=function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&ue(null===(t=o.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||o.delaySetPopupVisible(!1,o.props.mouseLeaveDelay)},o.onFocus=function(e){o.fireEvents("onFocus",e),o.clearDelayTimer(),o.isFocusToShow()&&(o.focusTime=Date.now(),o.delaySetPopupVisible(!0,o.props.focusDelay))},o.onMouseDown=function(e){o.fireEvents("onMouseDown",e),o.preClickTime=Date.now()},o.onTouchStart=function(e){o.fireEvents("onTouchStart",e),o.preTouchTime=Date.now()},o.onBlur=function(e){o.fireEvents("onBlur",e),o.clearDelayTimer(),o.isBlurToHide()&&o.delaySetPopupVisible(!1,o.props.blurDelay)},o.onContextMenu=function(e){e.preventDefault(),o.fireEvents("onContextMenu",e),o.setPopupVisible(!0,e)},o.onContextMenuClose=function(){o.isContextMenuToShow()&&o.close()},o.onClick=function(e){if(o.fireEvents("onClick",e),o.focusTime){var t;if(o.preClickTime&&o.preTouchTime?t=Math.min(o.preClickTime,o.preTouchTime):o.preClickTime?t=o.preClickTime:o.preTouchTime&&(t=o.preTouchTime),Math.abs(t-o.focusTime)<20)return;o.focusTime=0}o.preClickTime=0,o.preTouchTime=0,o.isClickToShow()&&(o.isClickToHide()||o.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!o.state.popupVisible;(o.isClickToHide()&&!n||n&&o.isClickToShow())&&o.setPopupVisible(!o.state.popupVisible,e)},o.onPopupMouseDown=function(){var e;o.hasPopupMouseDown=!0,clearTimeout(o.mouseDownTimeout),o.mouseDownTimeout=window.setTimeout((function(){o.hasPopupMouseDown=!1}),0),o.context&&(e=o.context).onPopupMouseDown.apply(e,arguments)},o.onDocumentClick=function(e){if(!o.props.mask||o.props.maskClosable){var t=e.target,n=o.getRootDomNode(),r=o.getPopupDomNode();ue(n,t)&&!o.isContextMenuOnly()||ue(r,t)||o.hasPopupMouseDown||o.close()}},o.getRootDomNode=function(){var e=o.props.getTriggerDOMNode;if(e)return e(o.triggerRef.current);try{var t=fe(o.triggerRef.current);if(t)return t}catch(e){}return re().findDOMNode(X(o))},o.getPopupClassNameFromAlign=function(e){var t=[],n=o.props,r=n.popupPlacement,i=n.builtinPlacements,a=n.prefixCls,l=n.alignPoint,c=n.getPopupClassNameFromAlign;return r&&i&&t.push(function(e,t,n,r){for(var o=n.points,i=Object.keys(e),a=0;a=0||r.indexOf("Bottom")>=0?i.top="".concat(o.height-t.offset[1],"px"):(r.indexOf("Top")>=0||r.indexOf("bottom")>=0)&&(i.top="".concat(-t.offset[1],"px")),r.indexOf("left")>=0||r.indexOf("Right")>=0?i.left="".concat(o.width-t.offset[0],"px"):(r.indexOf("right")>=0||r.indexOf("Left")>=0)&&(i.left="".concat(-t.offset[0],"px")),e.style.transformOrigin="".concat(i.left," ").concat(i.top)}},overlayInnerStyle:F,arrowContent:v.createElement("span",{className:"".concat(E,"-arrow-content"),style:O}),motion:{motionName:Ar(k,"zoom-big-fast",t.transitionName),motionDeadline:1e3}}),S?Dr(A,{className:R}):A)}));Lr.defaultProps={placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0};var zr=Lr;function Hr(e,t){var n=U({},e);return Array.isArray(t)&&t.forEach((function(e){delete n[e]})),n}var $r=v.createContext(!1),Wr=function(e){var t=e.children,n=e.disabled,r=v.useContext($r);return v.createElement($r.Provider,{value:n||r},t)},Br=$r,Ur=v.createContext(void 0),qr=function(e){var t=e.children,n=e.size;return v.createElement(Ur.Consumer,null,(function(e){return v.createElement(Ur.Provider,{value:n||e},t)}))},Kr=Ur,Gr="rc-util-key";function Yr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):Gr}function Xr(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Qr(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ye())return null;var r,o=document.createElement("style");(null===(t=n.csp)||void 0===t?void 0:t.nonce)&&(o.nonce=null===(r=n.csp)||void 0===r?void 0:r.nonce),o.innerHTML=e;var i=Xr(n),a=i.firstChild;return n.prepend&&i.prepend?i.prepend(o):n.prepend&&a?i.insertBefore(o,a):i.appendChild(o),o}var Zr=new Map;function Jr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Xr(t);return Array.from(Zr.get(n).children).find((function(n){return"STYLE"===n.tagName&&n.getAttribute(Yr(t))===e}))}function eo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Xr(n);if(!Zr.has(r)){var o=Qr("",n),i=o.parentNode;Zr.set(r,i),i.removeChild(o)}var a,l,c,s=Jr(t,n);if(s)return(null===(a=n.csp)||void 0===a?void 0:a.nonce)&&s.nonce!==(null===(l=n.csp)||void 0===l?void 0:l.nonce)&&(s.nonce=null===(c=n.csp)||void 0===c?void 0:c.nonce),s.innerHTML!==e&&(s.innerHTML=e),s;var u=Qr(e,n);return u.setAttribute(Yr(n),t),u}var to,no=0,ro={};function oo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=no++,r=t;function o(){(r-=1)<=0?(e(),delete ro[n]):ro[n]=se(o)}return ro[n]=se(o),n}function io(e){return!e||null===e.offsetParent||e.hidden}function ao(e){var t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return!(t&&t[1]&&t[2]&&t[3]&&t[1]===t[2]&&t[2]===t[3])}oo.cancel=function(e){void 0!==e&&(se.cancel(ro[e]),delete ro[e])},oo.ids=ro;var lo=function(e){Z(n,e);var t=te(n);function n(){var e;return K(this,n),(e=t.apply(this,arguments)).containerRef=v.createRef(),e.animationStart=!1,e.destroyed=!1,e.onClick=function(t,n){var r,o,i=e.props,a=i.insertExtraNode;if(!(i.disabled||!t||io(t)||t.className.indexOf("-leave")>=0)){e.extraNode=document.createElement("div");var l=X(e).extraNode,c=e.context.getPrefixCls;l.className="".concat(c(""),"-click-animating-node");var s=e.getAttributeName();if(t.setAttribute(s,"true"),n&&"#ffffff"!==n&&"rgb(255, 255, 255)"!==n&&ao(n)&&!/rgba\((?:\d*, ){3}0\)/.test(n)&&"transparent"!==n){l.style.borderColor=n;var u=(null===(r=t.getRootNode)||void 0===r?void 0:r.call(t))||t.ownerDocument,f=u instanceof Document?u.body:null!==(o=u.firstChild)&&void 0!==o?o:u;to=eo("\n [".concat(c(""),"-click-animating-without-extra-node='true']::after, .").concat(c(""),"-click-animating-node {\n --antd-wave-shadow-color: ").concat(n,";\n }"),"antd-wave",{csp:e.csp,attachTo:f})}a&&t.appendChild(l),["transition","animation"].forEach((function(n){t.addEventListener("".concat(n,"start"),e.onTransitionStart),t.addEventListener("".concat(n,"end"),e.onTransitionEnd)}))}},e.onTransitionStart=function(t){if(!e.destroyed){var n=e.containerRef.current;t&&t.target===n&&!e.animationStart&&e.resetEffect(n)}},e.onTransitionEnd=function(t){t&&"fadeEffect"===t.animationName&&e.resetEffect(t.target)},e.bindAnimationEvent=function(t){if(t&&t.getAttribute&&!t.getAttribute("disabled")&&!(t.className.indexOf("disabled")>=0)){var n=function(n){if("INPUT"!==n.target.tagName&&!io(n.target)){e.resetEffect(t);var r=getComputedStyle(t).getPropertyValue("border-top-color")||getComputedStyle(t).getPropertyValue("border-color")||getComputedStyle(t).getPropertyValue("background-color");e.clickWaveTimeoutId=window.setTimeout((function(){return e.onClick(t,r)}),0),oo.cancel(e.animationStartId),e.animationStart=!0,e.animationStartId=oo((function(){e.animationStart=!1}),10)}};return t.addEventListener("click",n,!0),{cancel:function(){t.removeEventListener("click",n,!0)}}}},e.renderWave=function(t){var n=t.csp,r=e.props.children;if(e.csp=n,!v.isValidElement(r))return r;var o=e.containerRef;return he(r)&&(o=ve(r.ref,e.containerRef)),Dr(r,{ref:o})},e}return Y(n,[{key:"componentDidMount",value:function(){this.destroyed=!1;var e=this.containerRef.current;e&&1===e.nodeType&&(this.instance=this.bindAnimationEvent(e))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var e=this.context.getPrefixCls,t=this.props.insertExtraNode;return"".concat(e(""),t?"-click-animating":"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(e){var t=this;if(e&&e!==this.extraNode&&e instanceof Element){var n=this.props.insertExtraNode,r=this.getAttributeName();e.setAttribute(r,"false"),to&&(to.innerHTML=""),n&&this.extraNode&&e.contains(this.extraNode)&&e.removeChild(this.extraNode),["transition","animation"].forEach((function(n){e.removeEventListener("".concat(n,"start"),t.onTransitionStart),e.removeEventListener("".concat(n,"end"),t.onTransitionEnd)}))}}},{key:"render",value:function(){return v.createElement(Cr,null,this.renderWave)}}]),n}(v.Component);lo.contextType=wr;var co=(0,v.forwardRef)((function(t,n){return v.createElement(lo,e({ref:n},t))})),so=v.createContext(void 0),uo={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},fo=(0,v.createContext)({});function po(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function mo(e){return Math.min(1,Math.max(0,e))}function vo(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ho(e){return e<=1?100*Number(e)+"%":e}function go(e){return 1===e.length?"0"+e:String(e)}function yo(e,t,n){e=po(e,255),t=po(t,255),n=po(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=0,l=(r+o)/2;if(r===o)a=0,i=0;else{var c=r-o;switch(a=l>.5?c/(2-r-o):c/(r+o),r){case e:i=(t-n)/c+(t1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wo(e,t,n){e=po(e,255),t=po(t,255),n=po(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,l=r-o,c=0===r?0:l/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/l+(t=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function _o(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function Do(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function Vo(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=So(e),o=5;o>0;o-=1){var i=To(r),a=Fo(So({h:jo(i,o,!0),s:_o(i,o,!0),v:Do(i,o,!0)}));n.push(a)}n.push(Fo(r));for(var l=1;l<=4;l+=1){var c=To(r),s=Fo(So({h:jo(c,l),s:_o(c,l),v:Do(c,l)}));n.push(s)}return"dark"===t.theme?Ro.map((function(e){var r=e.index,o=e.opacity;return Fo(Io(So(t.backgroundColor||"#141414"),So(n[r]),100*o))})):n}var Lo={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},zo={},Ho={};Object.keys(Lo).forEach((function(e){zo[e]=Vo(Lo[e]),zo[e].primary=zo[e][5],Ho[e]=Vo(Lo[e],{theme:"dark",backgroundColor:"#141414"}),Ho[e].primary=Ho[e][5]})),zo.red,zo.volcano,zo.gold,zo.orange,zo.yellow,zo.lime,zo.green,zo.cyan,zo.blue,zo.geekblue,zo.purple,zo.magenta,zo.grey;var $o={};function Wo(e,t){}var Bo=function(e,t){!function(e,t,n){t||$o[n]||(e(!1,n),$o[n]=!0)}(Wo,e,t)};function Uo(e){return"object"===W(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===W(e.icon)||"function"==typeof e.icon)}function qo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){var r=e[n];return"class"===n?(t.className=r,delete t.class):t[n]=r,t}),{})}function Ko(e,t,n){return n?h().createElement(e.tag,U(U({key:t},qo(e.attrs)),n),(e.children||[]).map((function(n,r){return Ko(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))):h().createElement(e.tag,U({key:t},qo(e.attrs)),(e.children||[]).map((function(n,r){return Ko(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})))}function Go(e){return Vo(e)[0]}function Yo(e){return e?Array.isArray(e)?e:[e]:[]}var Xo="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",Qo=["icon","className","onClick","style","primaryColor","secondaryColor"],Zo={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},Jo=function(e){var t=e.icon,n=e.className,r=e.onClick,o=e.style,i=e.primaryColor,a=e.secondaryColor,l=q(e,Qo),c=Zo;if(i&&(c={primaryColor:i,secondaryColor:a||Go(i)}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xo,t=(0,v.useContext)(fo).csp;(0,v.useEffect)((function(){eo(e,"@ant-design-icons",{prepend:!0,csp:t})}),[])}(),function(e,t){Bo(e,"[@ant-design/icons] ".concat(t))}(Uo(t),"icon should be icon definiton, but got ".concat(t)),!Uo(t))return null;var s=t;return s&&"function"==typeof s.icon&&(s=U(U({},s),{},{icon:s.icon(c.primaryColor,c.secondaryColor)})),Ko(s.icon,"svg-".concat(s.name),U({className:n,onClick:r,style:o,"data-icon":s.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l))};Jo.displayName="IconReact",Jo.getTwoToneColors=function(){return U({},Zo)},Jo.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;Zo.primaryColor=t,Zo.secondaryColor=n||Go(t),Zo.calculated=!!n};var ei=Jo;function ti(e){var t=z(Yo(e),2),n=t[0],r=t[1];return ei.setTwoToneColors({primaryColor:n,secondaryColor:r})}var ni=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];ti("#1890ff");var ri=v.forwardRef((function(e,t){var n,r=e.className,o=e.icon,i=e.spin,a=e.rotate,l=e.tabIndex,c=e.onClick,s=e.twoToneColor,u=q(e,ni),f=v.useContext(fo).prefixCls,d=void 0===f?"anticon":f,p=$()(d,(j(n={},"".concat(d,"-").concat(o.name),!!o.name),j(n,"".concat(d,"-spin"),!!i||"loading"===o.name),n),r),m=l;void 0===m&&c&&(m=-1);var h=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,g=z(Yo(s),2),y=g[0],b=g[1];return v.createElement("span",U(U({role:"img","aria-label":o.name},u),{},{ref:t,tabIndex:m,onClick:c,className:p}),v.createElement(ei,{icon:o,primaryColor:y,secondaryColor:b,style:h}))}));ri.displayName="AntdIcon",ri.getTwoToneColor=function(){var e=ei.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},ri.setTwoToneColor=ti;var oi=ri,ii=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:uo}))};ii.displayName="LoadingOutlined";var ai=v.forwardRef(ii),li=function(){return{width:0,opacity:0,transform:"scale(0)"}},ci=function(e){return{width:e.scrollWidth,opacity:1,transform:"scale(1)"}},si=function(e){var t=e.prefixCls,n=!!e.loading;return e.existIcon?h().createElement("span",{className:"".concat(t,"-loading-icon")},h().createElement(ai,null)):h().createElement(dt,{visible:n,motionName:"".concat(t,"-loading-icon-motion"),removeOnLeave:!0,onAppearStart:li,onAppearActive:ci,onEnterStart:li,onEnterActive:ci,onLeaveStart:ci,onLeaveActive:li},(function(e,n){var r=e.className,o=e.style;return h().createElement("span",{className:"".concat(t,"-loading-icon"),style:o,ref:n},h().createElement(ai,{className:r}))}))},ui=/^[\u4e00-\u9fa5]{2}$/,fi=ui.test.bind(ui);function di(e){return"text"===e||"link"===e}function pi(e){return"danger"===e?{danger:!0}:{type:e}}xr("default","primary","ghost","dashed","link","text"),xr("default","circle","round"),xr("submit","button","reset");var mi=function(t,n){var r,o=t.loading,i=void 0!==o&&o,a=t.prefixCls,l=t.type,c=void 0===l?"default":l,s=t.danger,u=t.shape,f=void 0===u?"default":u,d=t.size,p=t.disabled,m=t.className,h=t.children,g=t.icon,y=t.ghost,b=void 0!==y&&y,w=t.block,C=void 0!==w&&w,x=t.htmlType,E=void 0===x?"button":x,k=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);oe.checked?e.styleConfig.checkboxChecked:e.styleConfig.checkboxUnchecked;function yi(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function bi(e){return function(e){if(Array.isArray(e))return D(e)}(e)||yi(e)||V(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];return h().Children.forEach(e,(function(e){(null!=e||t.keepEmpty)&&(Array.isArray(e)?n=n.concat(wi(e)):(0,de.isFragment)(e)&&e.props?n=n.concat(wi(e.props.children,t)):n.push(e))})),n}var Ci="RC_FORM_INTERNAL_HOOKS",xi=function(){Bo(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Ei=v.createContext({getFieldValue:xi,getFieldsValue:xi,getFieldError:xi,getFieldWarning:xi,getFieldsError:xi,isFieldsTouched:xi,isFieldTouched:xi,isFieldValidating:xi,isFieldsValidating:xi,resetFields:xi,setFields:xi,setFieldsValue:xi,validateFields:xi,submit:xi,getInternalHooks:function(){return xi(),{dispatch:xi,initEntityValue:xi,registerField:xi,useSubscribe:xi,setInitialValues:xi,destroyForm:xi,setCallbacks:xi,registerWatch:xi,getFields:xi,setValidateMessages:xi,setPreserve:xi,getInitialValue:xi}}});function ki(e){return null==e?[]:Array.isArray(e)?e:[e]}function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),r=1;r=i)return e;switch(e){case"%s":return String(n[o++]);case"%d":return Number(n[o++]);case"%j":try{return JSON.stringify(n[o++])}catch(e){return"[Circular]"}break;default:return e}}));return a}return e}function Ii(e,t){return null==e||!("array"!==t||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}(t)||"string"!=typeof e||e)}function ji(e,t,n){var r=0,o=e.length;!function i(a){if(a&&a.length)n(a);else{var l=r;r+=1,l()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,$i=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Wi={integer:function(e){return Wi.number(e)&&parseInt(e,10)===e},float:function(e){return Wi.number(e)&&!Wi.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"==typeof e&&!Wi.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(Hi)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(function(){if(Li)return Li;var e="[a-fA-F\\d:]",t=function(t){return t&&t.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",o=("\n(?:\n(?:"+r+":){7}(?:"+r+"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:"+r+":){6}(?:"+n+"|:"+r+"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:"+r+":){5}(?::"+n+"|(?::"+r+"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:"+r+":){4}(?:(?::"+r+"){0,1}:"+n+"|(?::"+r+"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:"+r+":){3}(?:(?::"+r+"){0,2}:"+n+"|(?::"+r+"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:"+r+":){2}(?:(?::"+r+"){0,3}:"+n+"|(?::"+r+"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:"+r+":){1}(?:(?::"+r+"){0,4}:"+n+"|(?::"+r+"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::"+r+"){0,5}:"+n+"|(?::"+r+"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),i=new RegExp("(?:^"+n+"$)|(?:^"+o+"$)"),a=new RegExp("^"+n+"$"),l=new RegExp("^"+o+"$"),c=function(e){return e&&e.exact?i:new RegExp("(?:"+t(e)+n+t(e)+")|(?:"+t(e)+o+t(e)+")","g")};c.v4=function(e){return e&&e.exact?a:new RegExp(""+t(e)+n+t(e),"g")},c.v6=function(e){return e&&e.exact?l:new RegExp(""+t(e)+o+t(e),"g")};var s=c.v4().source,u=c.v6().source;return Li=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+s+"|"+u+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(e){return"string"==typeof e&&!!e.match($i)}},Bi=zi,Ui=function(e,t,n,r,o){(/^\s+$/.test(t)||""===t)&&r.push(Fi(o.messages.whitespace,e.fullField))},qi=function(e,t,n,r,o){if(e.required&&void 0===t)zi(e,t,n,r,o);else{var i=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(i)>-1?Wi[i](t)||r.push(Fi(o.messages.types[i],e.fullField,e.type)):i&&typeof t!==e.type&&r.push(Fi(o.messages.types[i],e.fullField,e.type))}},Ki=function(e,t,n,r,o){var i="number"==typeof e.len,a="number"==typeof e.min,l="number"==typeof e.max,c=t,s=null,u="number"==typeof t,f="string"==typeof t,d=Array.isArray(t);if(u?s="number":f?s="string":d&&(s="array"),!s)return!1;d&&(c=t.length),f&&(c=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),i?c!==e.len&&r.push(Fi(o.messages[s].len,e.fullField,e.len)):a&&!l&&ce.max?r.push(Fi(o.messages[s].max,e.fullField,e.max)):a&&l&&(ce.max)&&r.push(Fi(o.messages[s].range,e.fullField,e.min,e.max))},Gi=function(e,t,n,r,o){e.enum=Array.isArray(e.enum)?e.enum:[],-1===e.enum.indexOf(t)&&r.push(Fi(o.messages.enum,e.fullField,e.enum.join(", ")))},Yi=function(e,t,n,r,o){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Fi(o.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"==typeof e.pattern&&(new RegExp(e.pattern).test(t)||r.push(Fi(o.messages.pattern.mismatch,e.fullField,t,e.pattern))))},Xi=function(e,t,n,r,o){var i=e.type,a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t,i)&&!e.required)return n();Bi(e,t,r,a,o,i),Ii(t,i)||qi(e,t,r,a,o)}n(a)},Qi={string:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t,"string")&&!e.required)return n();Bi(e,t,r,i,o,"string"),Ii(t,"string")||(qi(e,t,r,i,o),Ki(e,t,r,i,o),Yi(e,t,r,i,o),!0===e.whitespace&&Ui(e,t,r,i,o))}n(i)},method:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&qi(e,t,r,i,o)}n(i)},number:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(""===t&&(t=void 0),Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&(qi(e,t,r,i,o),Ki(e,t,r,i,o))}n(i)},boolean:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&qi(e,t,r,i,o)}n(i)},regexp:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),Ii(t)||qi(e,t,r,i,o)}n(i)},integer:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&(qi(e,t,r,i,o),Ki(e,t,r,i,o))}n(i)},float:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&(qi(e,t,r,i,o),Ki(e,t,r,i,o))}n(i)},array:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();Bi(e,t,r,i,o,"array"),null!=t&&(qi(e,t,r,i,o),Ki(e,t,r,i,o))}n(i)},object:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&qi(e,t,r,i,o)}n(i)},enum:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&Gi(e,t,r,i,o)}n(i)},pattern:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t,"string")&&!e.required)return n();Bi(e,t,r,i,o),Ii(t,"string")||Yi(e,t,r,i,o)}n(i)},date:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t,"date")&&!e.required)return n();var a;Bi(e,t,r,i,o),Ii(t,"date")||(a=t instanceof Date?t:new Date(t),qi(e,a,r,i,o),a&&Ki(e,a.getTime(),r,i,o))}n(i)},url:Xi,hex:Xi,email:Xi,required:function(e,t,n,r,o){var i=[],a=Array.isArray(t)?"array":typeof t;Bi(e,t,r,i,o,a),n(i)},any:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o)}n(i)}};function Zi(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Ji=Zi(),ea=function(){function e(e){this.rules=null,this._messages=Ji,this.define(e)}var t=e.prototype;return t.define=function(e){var t=this;if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach((function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]}))},t.messages=function(e){return e&&(this._messages=Vi(Zi(),e)),this._messages},t.validate=function(t,n,r){var o=this;void 0===n&&(n={}),void 0===r&&(r=function(){});var i=t,a=n,l=r;if("function"==typeof a&&(l=a,a={}),!this.rules||0===Object.keys(this.rules).length)return l&&l(null,i),Promise.resolve(i);if(a.messages){var c=this.messages();c===Ji&&(c=Zi()),Vi(c,a.messages),a.messages=c}else a.messages=this.messages();var s={};(a.keys||Object.keys(this.rules)).forEach((function(e){var n=o.rules[e],r=i[e];n.forEach((function(n){var a=n;"function"==typeof a.transform&&(i===t&&(i=Si({},i)),r=i[e]=a.transform(r)),(a="function"==typeof a?{validator:a}:Si({},a)).validator=o.getValidationMethod(a),a.validator&&(a.field=e,a.fullField=a.fullField||e,a.type=o.getType(a),s[e]=s[e]||[],s[e].push({rule:a,value:r,source:i,field:e}))}))}));var u={};return function(e,t,n,r,o){if(t.first){var i=new Promise((function(t,i){var a=function(e){var t=[];return Object.keys(e).forEach((function(n){t.push.apply(t,e[n]||[])})),t}(e);ji(a,n,(function(e){return r(e),e.length?i(new _i(e,Ti(e))):t(o)}))}));return i.catch((function(e){return e})),i}var a=!0===t.firstFields?Object.keys(e):t.firstFields||[],l=Object.keys(e),c=l.length,s=0,u=[],f=new Promise((function(t,i){var f=function(e){if(u.push.apply(u,e),++s===c)return r(u),u.length?i(new _i(u,Ti(u))):t(o)};l.length||(r(u),t(o)),l.forEach((function(t){var r=e[t];-1!==a.indexOf(t)?ji(r,n,f):function(e,t,n){var r=[],o=0,i=e.length;function a(e){r.push.apply(r,e||[]),++o===i&&n(r)}e.forEach((function(e){t(e,a)}))}(r,n,f)}))}));return f.catch((function(e){return e})),f}(s,a,(function(t,n){var r,o=t.rule,l=!("object"!==o.type&&"array"!==o.type||"object"!=typeof o.fields&&"object"!=typeof o.defaultField);function c(e,t){return Si({},t,{fullField:o.fullField+"."+e,fullFields:o.fullFields?[].concat(o.fullFields,[e]):[e]})}function s(r){void 0===r&&(r=[]);var s=Array.isArray(r)?r:[r];!a.suppressWarning&&s.length&&e.warning("async-validator:",s),s.length&&void 0!==o.message&&(s=[].concat(o.message));var f=s.map(Di(o,i));if(a.first&&f.length)return u[o.field]=1,n(f);if(l){if(o.required&&!t.value)return void 0!==o.message?f=[].concat(o.message).map(Di(o,i)):a.error&&(f=[a.error(o,Fi(a.messages.required,o.field))]),n(f);var d={};o.defaultField&&Object.keys(t.value).map((function(e){d[e]=o.defaultField})),d=Si({},d,t.rule.fields);var p={};Object.keys(d).forEach((function(e){var t=d[e],n=Array.isArray(t)?t:[t];p[e]=n.map(c.bind(null,e))}));var m=new e(p);m.messages(a.messages),t.rule.options&&(t.rule.options.messages=a.messages,t.rule.options.error=a.error),m.validate(t.value,t.rule.options||a,(function(e){var t=[];f&&f.length&&t.push.apply(t,f),e&&e.length&&t.push.apply(t,e),n(t.length?t:null)}))}else n(f)}if(l=l&&(o.required||!o.required&&t.value),o.field=t.field,o.asyncValidator)r=o.asyncValidator(o,t.value,s,t.source,a);else if(o.validator){try{r=o.validator(o,t.value,s,t.source,a)}catch(e){null==console.error||console.error(e),a.suppressValidatorError||setTimeout((function(){throw e}),0),s(e.message)}!0===r?s():!1===r?s("function"==typeof o.message?o.message(o.fullField||o.field):o.message||(o.fullField||o.field)+" fails"):r instanceof Array?s(r):r instanceof Error&&s(r.message)}r&&r.then&&r.then((function(){return s()}),(function(e){return s(e)}))}),(function(e){!function(e){var t=[],n={};function r(e){var n;Array.isArray(e)?t=(n=t).concat.apply(n,e):t.push(e)}for(var o=0;o3&&void 0!==arguments[3]&&arguments[3];return t.length&&r&&void 0===n&&!ra(e,t.slice(0,-1))?e:ia(e,t,n,r)}var la=function e(t){return Array.isArray(t)?function(t){return t.map((function(t){return e(t)}))}(t):"object"===W(t)&&null!==t?function(t){if(Object.getPrototypeOf(t)===Object.prototype){var n={};for(var r in t)n[r]=e(t[r]);return n}return t}(t):t};function ca(e){return ki(e)}function sa(e,t){return ra(e,t)}function ua(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=aa(e,t,n,r);return o}function fa(e,t){var n={};return t.forEach((function(t){var r=sa(e,t);n=ua(n,t,r)})),n}function da(e,t){return e&&e.some((function(e){return ha(e,t)}))}function pa(e){return"object"===W(e)&&null!==e&&Object.getPrototypeOf(e)===Object.prototype}function ma(e,t){var n=Array.isArray(e)?bi(e):U({},e);return t?(Object.keys(t).forEach((function(e){var r=n[e],o=t[e],i=pa(r)&&pa(o);n[e]=i?ma(r,o||{}):la(o)})),n):n}function va(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=r||n<0||n>=r)return e;var o=e[t],i=t-n;return i>0?[].concat(bi(e.slice(0,n)),[o],bi(e.slice(n,t)),bi(e.slice(t+1,r))):i<0?[].concat(bi(e.slice(0,t)),bi(e.slice(t+1,n+1)),[o],bi(e.slice(n+1,r))):e}var ba=ea;function wa(e,t){return e.replace(/\$\{\w+\}/g,(function(e){var n=e.slice(2,-1);return t[n]}))}var Ca="CODE_LOGIC_ERROR";function xa(_x,e,t,n,r){return Ea.apply(this,arguments)}function Ea(){return Ea=Yn(Kn().mark((function e(t,n,r,o,i){var a,l,c,s,u,f,d,p,m;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return delete(a=U({},r)).ruleIndex,a.validator&&(l=a.validator,a.validator=function(){try{return l.apply(void 0,arguments)}catch(e){return console.error(e),Promise.reject(Ca)}}),c=null,a&&"array"===a.type&&a.defaultField&&(c=a.defaultField,delete a.defaultField),s=new ba(j({},t,[a])),u=va({},na,o.validateMessages),s.messages(u),f=[],e.prev=9,e.next=12,Promise.resolve(s.validate(j({},t,n),U({},o)));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(9),e.t0.errors&&(f=e.t0.errors.map((function(e,t){var n=e.message,r=n===Ca?u.default:n;return v.isValidElement(r)?v.cloneElement(r,{key:"error_".concat(t)}):r})));case 17:if(f.length||!c){e.next=22;break}return e.next=20,Promise.all(n.map((function(e,n){return xa("".concat(t,".").concat(n),e,c,o,i)})));case 20:return d=e.sent,e.abrupt("return",d.reduce((function(e,t){return[].concat(bi(e),bi(t))}),[]));case 22:return p=U(U({},r),{},{name:t,enum:(r.enum||[]).join(", ")},i),m=f.map((function(e){return"string"==typeof e?wa(e,p):e})),e.abrupt("return",m);case 25:case"end":return e.stop()}}),e,null,[[9,14]])}))),Ea.apply(this,arguments)}function ka(){return(ka=Yn(Kn().mark((function e(t){return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(t).then((function(e){var t;return(t=[]).concat.apply(t,bi(e))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sa(){return(Sa=Yn(Kn().mark((function e(t){var n;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=0,e.abrupt("return",new Promise((function(e){t.forEach((function(r){r.then((function(r){r.errors.length&&e([r]),(n+=1)===t.length&&e([])}))}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Oa=["name"],Na=[];function Pa(e,t,n,r,o,i){return"function"==typeof e?e(t,n,"source"in i?{source:i.source}:{}):r!==o}var Aa=function(e){Z(n,e);var t=te(n);function n(e){var r;return K(this,n),(r=t.call(this,e)).state={resetCount:0},r.cancelRegisterFunc=null,r.mounted=!1,r.touched=!1,r.dirty=!1,r.validatePromise=null,r.prevValidating=void 0,r.errors=Na,r.warnings=Na,r.cancelRegister=function(){var e=r.props,t=e.preserve,n=e.isListField,o=e.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(n,t,ca(o)),r.cancelRegisterFunc=null},r.getNamePath=function(){var e=r.props,t=e.name,n=e.fieldContext.prefixName;return void 0!==t?[].concat(bi(void 0===n?[]:n),bi(t)):[]},r.getRules=function(){var e=r.props,t=e.rules,n=void 0===t?[]:t,o=e.fieldContext;return n.map((function(e){return"function"==typeof e?e(o):e}))},r.refresh=function(){r.mounted&&r.setState((function(e){return{resetCount:e.resetCount+1}}))},r.triggerMetaEvent=function(e){var t=r.props.onMetaChange;null==t||t(U(U({},r.getMeta()),{},{destroy:e}))},r.onStoreChange=function(e,t,n){var o=r.props,i=o.shouldUpdate,a=o.dependencies,l=void 0===a?[]:a,c=o.onReset,s=n.store,u=r.getNamePath(),f=r.getValue(e),d=r.getValue(s),p=t&&da(t,u);switch("valueUpdate"===n.type&&"external"===n.source&&f!==d&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=Na,r.warnings=Na,r.triggerMetaEvent()),n.type){case"reset":if(!t||p)return r.touched=!1,r.dirty=!1,r.validatePromise=null,r.errors=Na,r.warnings=Na,r.triggerMetaEvent(),null==c||c(),void r.refresh();break;case"remove":if(i)return void r.reRender();break;case"setField":if(p){var m=n.data;return"touched"in m&&(r.touched=m.touched),"validating"in m&&!("originRCField"in m)&&(r.validatePromise=m.validating?Promise.resolve([]):null),"errors"in m&&(r.errors=m.errors||Na),"warnings"in m&&(r.warnings=m.warnings||Na),r.dirty=!0,r.triggerMetaEvent(),void r.reRender()}if(i&&!u.length&&Pa(i,e,s,f,d,n))return void r.reRender();break;case"dependenciesUpdate":if(l.map(ca).some((function(e){return da(n.relatedFields,e)})))return void r.reRender();break;default:if(p||(!l.length||u.length||i)&&Pa(i,e,s,f,d,n))return void r.reRender()}!0===i&&r.reRender()},r.validateRules=function(e){var t=r.getNamePath(),n=r.getValue(),o=Promise.resolve().then((function(){if(!r.mounted)return[];var i=r.props,a=i.validateFirst,l=void 0!==a&&a,c=i.messageVariables,s=(e||{}).triggerName,u=r.getRules();s&&(u=u.filter((function(e){var t=e.validateTrigger;return!t||ki(t).includes(s)})));var f=function(e,t,n,r,o,i){var a,l=e.join("."),c=n.map((function(e,t){var n=e.validator,r=U(U({},e),{},{ruleIndex:t});return n&&(r.validator=function(e,t,r){var o=!1,i=n(e,t,(function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:Na;if(r.validatePromise===o){r.validatePromise=null;var t=[],n=[];e.forEach((function(e){var r=e.rule.warningOnly,o=e.errors,i=void 0===o?Na:o;r?n.push.apply(n,bi(i)):t.push.apply(t,bi(i))})),r.errors=t,r.warnings=n,r.triggerMetaEvent(),r.reRender()}})),f}));return r.validatePromise=o,r.dirty=!0,r.errors=Na,r.warnings=Na,r.triggerMetaEvent(),r.reRender(),o},r.isFieldValidating=function(){return!!r.validatePromise},r.isFieldTouched=function(){return r.touched},r.isFieldDirty=function(){return!(!r.dirty&&void 0===r.props.initialValue)||void 0!==(0,r.props.fieldContext.getInternalHooks(Ci).getInitialValue)(r.getNamePath())},r.getErrors=function(){return r.errors},r.getWarnings=function(){return r.warnings},r.isListField=function(){return r.props.isListField},r.isList=function(){return r.props.isList},r.isPreserve=function(){return r.props.preserve},r.getMeta=function(){return r.prevValidating=r.isFieldValidating(),{touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath()}},r.getOnlyChild=function(e){if("function"==typeof e){var t=r.getMeta();return U(U({},r.getOnlyChild(e(r.getControlled(),t,r.props.fieldContext))),{},{isFunction:!0})}var n=wi(e);return 1===n.length&&v.isValidElement(n[0])?{child:n[0],isFunction:!1}:{child:n,isFunction:!1}},r.getValue=function(e){var t=r.props.fieldContext.getFieldsValue,n=r.getNamePath();return sa(e||t(!0),n)},r.getControlled=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r.props,n=t.trigger,o=t.validateTrigger,i=t.getValueFromEvent,a=t.normalize,l=t.valuePropName,c=t.getValueProps,s=t.fieldContext,u=void 0!==o?o:s.validateTrigger,f=r.getNamePath(),d=s.getInternalHooks,p=s.getFieldsValue,m=d(Ci),v=m.dispatch,h=r.getValue(),g=c||function(e){return j({},l,e)},y=e[n],b=U(U({},e),g(h));b[n]=function(){var e;r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var t=arguments.length,n=new Array(t),o=0;o=0&&t<=n.length?(l.keys=[].concat(bi(l.keys.slice(0,t)),[l.id],bi(l.keys.slice(t))),i([].concat(bi(n.slice(0,t)),[e],bi(n.slice(t))))):(l.keys=[].concat(bi(l.keys),[l.id]),i([].concat(bi(n),[e]))),l.id+=1},remove:function(e){var t=u(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(l.keys=l.keys.filter((function(e,t){return!n.has(t)})),i(t.filter((function(e,t){return!n.has(t)}))))},move:function(e,t){if(e!==t){var n=u();e<0||e>=n.length||t<0||t>=n.length||(l.keys=ya(l.keys,e,t),i(ya(n,e,t)))}}},d=o||[];return Array.isArray(d)||(d=[]),r(d.map((function(__,e){var t=l.keys[e];return void 0===t&&(l.keys[e]=l.id,t=l.keys[e],l.id+=1),{name:e,key:t,isListField:!0}})),f,t)}))))},Fa="__@field_split__";function Ia(e){return e.map((function(e){return"".concat(W(e),":").concat(e)})).join(Fa)}var ja=function(){function e(){K(this,e),this.kvs=new Map}return Y(e,[{key:"set",value:function(e,t){this.kvs.set(Ia(e),t)}},{key:"get",value:function(e){return this.kvs.get(Ia(e))}},{key:"update",value:function(e,t){var n=t(this.get(e));n?this.set(e,n):this.delete(e)}},{key:"delete",value:function(e){this.kvs.delete(Ia(e))}},{key:"map",value:function(e){return bi(this.kvs.entries()).map((function(t){var n=z(t,2),r=n[0],o=n[1],i=r.split(Fa);return e({key:i.map((function(e){var t=z(e.match(/^([^:]*):(.*)$/),3),n=t[1],r=t[2];return"number"===n?Number(r):r})),value:o})}))}},{key:"toJSON",value:function(){var e={};return this.map((function(t){var n=t.key,r=t.value;return e[n.join(".")]=r,null})),e}}]),e}(),_a=ja,Da=["name","errors"],Va=Y((function e(t){var n=this;K(this,e),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}},this.getInternalHooks=function(e){return e===Ci?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Bo(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(e){n.subscribable=e},this.prevWithoutPreserves=null,this.setInitialValues=function(e,t){if(n.initialValues=e||{},t){var r,o=va({},e,n.store);null===(r=n.prevWithoutPreserves)||void 0===r||r.map((function(t){var n=t.key;o=ua(o,n,sa(e,n))})),n.prevWithoutPreserves=null,n.updateStore(o)}},this.destroyForm=function(){var e=new _a;n.getFieldEntities(!0).forEach((function(t){n.isMergedPreserve(t.isPreserve())||e.set(t.getNamePath(),!0)})),n.prevWithoutPreserves=e},this.getInitialValue=function(e){var t=sa(n.initialValues,e);return e.length?la(t):t},this.setCallbacks=function(e){n.callbacks=e},this.setValidateMessages=function(e){n.validateMessages=e},this.setPreserve=function(e){n.preserve=e},this.watchList=[],this.registerWatch=function(e){return n.watchList.push(e),function(){n.watchList=n.watchList.filter((function(t){return t!==e}))}},this.notifyWatch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(n.watchList.length){var t=n.getFieldsValue();n.watchList.forEach((function(n){n(t,e)}))}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(e){n.store=e},this.getFieldEntities=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?n.fieldEntities.filter((function(e){return e.getNamePath().length})):n.fieldEntities},this.getFieldsMap=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new _a;return n.getFieldEntities(e).forEach((function(e){var n=e.getNamePath();t.set(n,e)})),t},this.getFieldEntitiesForNamePathList=function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map((function(e){var n=ca(e);return t.get(n)||{INVALIDATE_NAME_PATH:ca(e)}}))},this.getFieldsValue=function(e,t){if(n.warningUnhooked(),!0===e&&!t)return n.store;var r=n.getFieldEntitiesForNamePathList(Array.isArray(e)?e:null),o=[];return r.forEach((function(n){var r,i="INVALIDATE_NAME_PATH"in n?n.INVALIDATE_NAME_PATH:n.getNamePath();if(e||!(null===(r=n.isListField)||void 0===r?void 0:r.call(n)))if(t){var a="getMeta"in n?n.getMeta():null;t(a)&&o.push(i)}else o.push(i)})),fa(n.store,o.map(ca))},this.getFieldValue=function(e){n.warningUnhooked();var t=ca(e);return sa(n.store,t)},this.getFieldsError=function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map((function(t,n){return t&&!("INVALIDATE_NAME_PATH"in t)?{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}:{name:ca(e[n]),errors:[],warnings:[]}}))},this.getFieldError=function(e){n.warningUnhooked();var t=ca(e);return n.getFieldsError([t])[0].errors},this.getFieldWarning=function(e){n.warningUnhooked();var t=ca(e);return n.getFieldsError([t])[0].warnings},this.isFieldsTouched=function(){n.warningUnhooked();for(var e=arguments.length,t=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=new _a,r=n.getFieldEntities(!0);r.forEach((function(e){var n=e.props.initialValue,r=e.getNamePath();if(void 0!==n){var o=t.get(r)||new Set;o.add({entity:e,value:n}),t.set(r,o)}}));var o,i=function(r){r.forEach((function(r){if(void 0!==r.props.initialValue){var o=r.getNamePath();if(void 0!==n.getInitialValue(o))Bo(!1,"Form already set 'initialValues' with path '".concat(o.join("."),"'. Field can not overwrite it."));else{var i=t.get(o);if(i&&i.size>1)Bo(!1,"Multiple Field with path '".concat(o.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(i){var a=n.getFieldValue(o);e.skipExist&&void 0!==a||n.updateStore(ua(n.store,o,bi(i)[0].value))}}}}))};e.entities?o=e.entities:e.namePathList?(o=[],e.namePathList.forEach((function(e){var n,r=t.get(e);r&&(n=o).push.apply(n,bi(bi(r).map((function(e){return e.entity}))))}))):o=r,i(o)},this.resetFields=function(e){n.warningUnhooked();var t=n.store;if(!e)return n.updateStore(va({},n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(t,null,{type:"reset"}),void n.notifyWatch();var r=e.map(ca);r.forEach((function(e){var t=n.getInitialValue(e);n.updateStore(ua(n.store,e,t))})),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(t,r,{type:"reset"}),n.notifyWatch(r)},this.setFields=function(e){n.warningUnhooked();var t=n.store,r=[];e.forEach((function(e){var o=e.name,i=(e.errors,q(e,Da)),a=ca(o);r.push(a),"value"in i&&n.updateStore(ua(n.store,a,i.value)),n.notifyObservers(t,[a],{type:"setField",data:e})})),n.notifyWatch(r)},this.getFields=function(){return n.getFieldEntities(!0).map((function(e){var t=e.getNamePath(),r=U(U({},e.getMeta()),{},{name:t,value:n.getFieldValue(t)});return Object.defineProperty(r,"originRCField",{value:!0}),r}))},this.initEntityValue=function(e){var t=e.props.initialValue;if(void 0!==t){var r=e.getNamePath();void 0===sa(n.store,r)&&n.updateStore(ua(n.store,r,t))}},this.isMergedPreserve=function(e){var t=void 0!==e?e:n.preserve;return null==t||t},this.registerField=function(e){n.fieldEntities.push(e);var t=e.getNamePath();if(n.notifyWatch([t]),void 0!==e.props.initialValue){var r=n.store;n.resetWithFieldInitialValue({entities:[e],skipExist:!0}),n.notifyObservers(r,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter((function(t){return t!==e})),!n.isMergedPreserve(o)&&(!r||i.length>1)){var a=r?void 0:n.getInitialValue(t);if(t.length&&n.getFieldValue(t)!==a&&n.fieldEntities.every((function(e){return!ha(e.getNamePath(),t)}))){var l=n.store;n.updateStore(ua(l,t,a,!0)),n.notifyObservers(l,[t],{type:"remove"}),n.triggerDependenciesUpdate(l,t)}}n.notifyWatch([t])}},this.dispatch=function(e){switch(e.type){case"updateValue":var t=e.namePath,r=e.value;n.updateValue(t,r);break;case"validateField":var o=e.namePath,i=e.triggerName;n.validateFields([o],{triggerName:i})}},this.notifyObservers=function(e,t,r){if(n.subscribable){var o=U(U({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach((function(n){(0,n.onStoreChange)(e,t,o)}))}else n.forceRootUpdate()},this.triggerDependenciesUpdate=function(e,t){var r=n.getDependencyChildrenFields(t);return r.length&&n.validateFields(r),n.notifyObservers(e,r,{type:"dependenciesUpdate",relatedFields:[t].concat(bi(r))}),r},this.updateValue=function(e,t){var r=ca(e),o=n.store;n.updateStore(ua(n.store,r,t)),n.notifyObservers(o,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var i=n.triggerDependenciesUpdate(o,r),a=n.callbacks.onValuesChange;a&&a(fa(n.store,[r]),n.getFieldsValue()),n.triggerOnFieldsChange([r].concat(bi(i)))},this.setFieldsValue=function(e){n.warningUnhooked();var t=n.store;if(e){var r=va(n.store,e);n.updateStore(r)}n.notifyObservers(t,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()},this.getDependencyChildrenFields=function(e){var t=new Set,r=[],o=new _a;return n.getFieldEntities().forEach((function(e){(e.props.dependencies||[]).forEach((function(t){var n=ca(t);o.update(n,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t}))}))})),function e(n){(o.get(n)||new Set).forEach((function(n){if(!t.has(n)){t.add(n);var o=n.getNamePath();n.isFieldDirty()&&o.length&&(r.push(o),e(o))}}))}(e),r},this.triggerOnFieldsChange=function(e,t){var r=n.callbacks.onFieldsChange;if(r){var o=n.getFields();if(t){var i=new _a;t.forEach((function(e){var t=e.name,n=e.errors;i.set(t,n)})),o.forEach((function(e){e.errors=i.get(e.name)||e.errors}))}r(o.filter((function(t){var n=t.name;return da(e,n)})),o)}},this.validateFields=function(e,t){n.warningUnhooked();var r=!!e,o=r?e.map(ca):[],i=[];n.getFieldEntities(!0).forEach((function(a){if(r||o.push(a.getNamePath()),(null==t?void 0:t.recursive)&&r){var l=a.getNamePath();l.every((function(t,n){return e[n]===t||void 0===e[n]}))&&o.push(l)}if(a.props.rules&&a.props.rules.length){var c=a.getNamePath();if(!r||da(o,c)){var s=a.validateRules(U({validateMessages:U(U({},na),n.validateMessages)},t));i.push(s.then((function(){return{name:c,errors:[],warnings:[]}})).catch((function(e){var t=[],n=[];return e.forEach((function(e){var r=e.rule.warningOnly,o=e.errors;r?n.push.apply(n,bi(o)):t.push.apply(t,bi(o))})),t.length?Promise.reject({name:c,errors:t,warnings:n}):{name:c,errors:t,warnings:n}})))}}}));var a=function(e){var t=!1,n=e.length,r=[];return e.length?new Promise((function(o,i){e.forEach((function(e,a){e.catch((function(e){return t=!0,e})).then((function(e){n-=1,r[a]=e,n>0||(t&&i(r),o(r))}))}))})):Promise.resolve([])}(i);n.lastValidatePromise=a,a.catch((function(e){return e})).then((function(e){var t=e.map((function(e){return e.name}));n.notifyObservers(n.store,t,{type:"validateFinish"}),n.triggerOnFieldsChange(t,e)}));var l=a.then((function(){return n.lastValidatePromise===a?Promise.resolve(n.getFieldsValue(o)):Promise.reject([])})).catch((function(e){var t=e.filter((function(e){return e&&e.errors.length}));return Promise.reject({values:n.getFieldsValue(o),errorFields:t,outOfDate:n.lastValidatePromise!==a})}));return l.catch((function(e){return e})),l},this.submit=function(){n.warningUnhooked(),n.validateFields().then((function(e){var t=n.callbacks.onFinish;if(t)try{t(e)}catch(e){console.error(e)}})).catch((function(e){var t=n.callbacks.onFinishFailed;t&&t(e)}))},this.forceRootUpdate=t})),La=function(e){var t=v.useRef(),n=z(v.useState({}),2)[1];if(!t.current)if(e)t.current=e;else{var r=new Va((function(){n({})}));t.current=r.getForm()}return[t.current]},za=v.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),Ha=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,o=e.children,i=v.useContext(za),a=v.useRef({});return v.createElement(za.Provider,{value:U(U({},i),{},{validateMessages:U(U({},i.validateMessages),t),triggerFormChange:function(e,t){n&&n(e,{changedFields:t,forms:a.current}),i.triggerFormChange(e,t)},triggerFormFinish:function(e,t){r&&r(e,{values:t,forms:a.current}),i.triggerFormFinish(e,t)},registerForm:function(e,t){e&&(a.current=U(U({},a.current),{},j({},e,t))),i.registerForm(e,t)},unregisterForm:function(e){var t=U({},a.current);delete t[e],a.current=t,i.unregisterForm(e)}})},o)},$a=za,Wa=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],Ba=function(t,n){var r=t.name,o=t.initialValues,i=t.fields,a=t.form,l=t.preserve,c=t.children,s=t.component,u=void 0===s?"form":s,f=t.validateMessages,d=t.validateTrigger,p=void 0===d?"onChange":d,m=t.onValuesChange,h=t.onFieldsChange,g=t.onFinish,y=t.onFinishFailed,b=q(t,Wa),w=v.useContext($a),C=z(La(a),1)[0],x=C.getInternalHooks(Ci),E=x.useSubscribe,k=x.setInitialValues,S=x.setCallbacks,O=x.setValidateMessages,N=x.setPreserve,P=x.destroyForm;v.useImperativeHandle(n,(function(){return C})),v.useEffect((function(){return w.registerForm(r,C),function(){w.unregisterForm(r)}}),[w,C,r]),O(U(U({},w.validateMessages),f)),S({onValuesChange:m,onFieldsChange:function(e){if(w.triggerFormChange(r,e),h){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=(0,v.useState)(),r=z(n,2),o=r[0],i=r[1],a=(0,v.useMemo)((function(){return Ua(o)}),[o]),l=(0,v.useRef)(a);l.current=a;var c=(0,v.useContext)(Ei),s=t||c,u=s&&s._init,f=ca(e),d=(0,v.useRef)(f);return d.current=f,(0,v.useEffect)((function(){if(u){var e=s.getFieldsValue,t=(0,(0,s.getInternalHooks)(Ci).registerWatch)((function(e){var t=sa(e,d.current),n=Ua(t);l.current!==n&&(l.current=n,i(t))})),n=sa(e(),d.current);return i(n),t}}),[]),o},Ka=v.forwardRef(Ba);Ka.FormProvider=Ha,Ka.Field=Ma,Ka.List=Ta,Ka.useForm=La,Ka.useWatch=qa;var Ga=Ka,Ya=v.createContext({labelAlign:"right",vertical:!1,itemRef:function(){}}),Xa=v.createContext(null),Qa=v.createContext({prefixCls:""}),Za=v.createContext({}),Ja=function(t){var n=t.children,r=t.status,o=t.override,i=(0,v.useContext)(Za),a=(0,v.useMemo)((function(){var t=e({},i);return o&&delete t.isFormItemInput,r&&(delete t.status,delete t.hasFeedback,delete t.feedbackIcon),t}),[r,o,i]);return v.createElement(Za.Provider,{value:a},n)},el={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"},tl=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:el}))};tl.displayName="CloseCircleFilled";var nl=v.forwardRef(tl);function rl(e){return!(!e.addonBefore&&!e.addonAfter)}function ol(e){return!!(e.prefix||e.suffix||e.allowClear)}function il(e,t,n,r){if(n){var o=t;if("click"===t.type){var i=e.cloneNode(!0);return o=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value="",void n(o)}if(void 0!==r)return o=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,void n(o);n(o)}}function al(e){return null==e?"":String(e)}var ll=function(e){var t=e.inputElement,n=e.prefixCls,r=e.prefix,o=e.suffix,i=e.addonBefore,a=e.addonAfter,l=e.className,c=e.style,s=e.affixWrapperClassName,u=e.groupClassName,f=e.wrapperClassName,d=e.disabled,p=e.readOnly,m=e.focused,g=e.triggerFocus,y=e.allowClear,b=e.value,w=e.handleReset,C=e.hidden,x=(0,v.useRef)(null),E=(0,v.cloneElement)(t,{value:b,hidden:C});if(ol(e)){var k,S="".concat(n,"-affix-wrapper"),O=$()(S,(j(k={},"".concat(S,"-disabled"),d),j(k,"".concat(S,"-focused"),m),j(k,"".concat(S,"-readonly"),p),j(k,"".concat(S,"-input-with-clear-btn"),o&&y&&b),k),!rl(e)&&l,s),N=(o||y)&&h().createElement("span",{className:"".concat(n,"-suffix")},function(){var e;if(!y)return null;var t=!d&&!p&&b,r="".concat(n,"-clear-icon"),i="object"===W(y)&&(null==y?void 0:y.clearIcon)?y.clearIcon:"✖";return h().createElement("span",{onClick:w,onMouseDown:function(e){return e.preventDefault()},className:$()(r,(e={},j(e,"".concat(r,"-hidden"),!t),j(e,"".concat(r,"-has-suffix"),!!o),e)),role:"button",tabIndex:-1},i)}(),o);E=h().createElement("span",{className:O,style:c,hidden:!rl(e)&&C,onMouseDown:function(e){var t;(null===(t=x.current)||void 0===t?void 0:t.contains(e.target))&&(null==g||g())},ref:x},r&&h().createElement("span",{className:"".concat(n,"-prefix")},r),(0,v.cloneElement)(t,{style:null,value:b,hidden:null}),N)}if(rl(e)){var P="".concat(n,"-group"),A="".concat(P,"-addon"),M=$()("".concat(n,"-wrapper"),P,f),R=$()("".concat(n,"-group-wrapper"),l,u);return h().createElement("span",{className:R,style:c,hidden:C},h().createElement("span",{className:M},i&&h().createElement("span",{className:A},i),(0,v.cloneElement)(E,{style:null,hidden:null}),a&&h().createElement("span",{className:A},a)))}return E},cl=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],sl=(0,v.forwardRef)((function(e,t){var n=e.autoComplete,r=e.onChange,o=e.onFocus,i=e.onBlur,a=e.onPressEnter,l=e.onKeyDown,c=e.prefixCls,s=void 0===c?"rc-input":c,u=e.disabled,f=e.htmlSize,d=e.className,p=e.maxLength,m=e.suffix,g=e.showCount,y=e.type,b=void 0===y?"text":y,w=e.inputClassName,C=q(e,cl),x=z(br(e.defaultValue,{value:e.value}),2),E=x[0],k=x[1],S=z((0,v.useState)(!1),2),O=S[0],N=S[1],P=(0,v.useRef)(null),A=function(e){P.current&&function(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}(P.current,e)};(0,v.useImperativeHandle)(t,(function(){return{focus:A,blur:function(){var e;null===(e=P.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=P.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=P.current)||void 0===e||e.select()},input:P.current}})),(0,v.useEffect)((function(){N((function(e){return(!e||!u)&&e}))}),[u]);var M;return h().createElement(ll,U(U({},C),{},{prefixCls:s,className:d,inputElement:(M=Hr(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]),h().createElement("input",U(U({autoComplete:n},M),{},{onChange:function(t){void 0===e.value&&k(t.target.value),P.current&&il(P.current,t,r)},onFocus:function(e){N(!0),null==o||o(e)},onBlur:function(e){N(!1),null==i||i(e)},onKeyDown:function(e){a&&"Enter"===e.key&&a(e),null==l||l(e)},className:$()(s,j({},"".concat(s,"-disabled"),u),w,!rl(e)&&!ol(e)&&d),ref:P,size:f,type:b}))),handleReset:function(e){k(""),A(),P.current&&il(P.current,e,r)},value:al(E),focused:O,triggerFocus:A,suffix:function(){var e=Number(p)>0;if(m||g){var t=bi(al(E)).length,n="object"===W(g)?g.formatter({count:t,maxLength:p}):"".concat(t).concat(e?" / ".concat(p):"");return h().createElement(h().Fragment,null,!!g&&h().createElement("span",{className:$()("".concat(s,"-show-count-suffix"),j({},"".concat(s,"-show-count-has-suffix"),!!m))},n),m)}return null}(),disabled:u}))})),ul=sl;function fl(e,t,n){var r;return $()((j(r={},"".concat(e,"-status-success"),"success"===t),j(r,"".concat(e,"-status-warning"),"warning"===t),j(r,"".concat(e,"-status-error"),"error"===t),j(r,"".concat(e,"-status-validating"),"validating"===t),j(r,"".concat(e,"-has-feedback"),n),r))}xr("warning","error","");var dl=function(e,t){return t||e};function pl(e,t,n,r){if(n){var o=t;if("click"===t.type){var i=e.cloneNode(!0);return o=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value="",void n(o)}if(void 0!==r)return o=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,void n(o);n(o)}}var ml=(0,v.forwardRef)((function(t,n){var r,o,i,a=t.prefixCls,l=t.bordered,c=void 0===l||l,s=t.status,u=t.size,f=t.disabled,d=t.onBlur,p=t.onFocus,m=t.suffix,g=t.allowClear,y=t.addonAfter,b=t.addonBefore,w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&zl[n])return zl[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),i=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),a=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),l=Ll.map((function(e){return"".concat(e,":").concat(r.getPropertyValue(e))})).join(";"),c={sizingStyle:l,paddingSize:i,borderSize:a,boxSizing:o};return t&&n&&(zl[n]=c),c}var $l,Wl=n(6774),Bl=n.n(Wl);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}($l||($l={}));var Ul=function(t){Z(r,t);var n=te(r);function r(t){var o;return K(this,r),(o=n.call(this,t)).nextFrameActionId=void 0,o.resizeFrameId=void 0,o.textArea=void 0,o.saveTextArea=function(e){o.textArea=e},o.handleResize=function(e){var t=o.state.resizeStatus,n=o.props,r=n.autoSize,i=n.onResize;t===$l.NONE&&("function"==typeof i&&i(e),r&&o.resizeOnNextFrame())},o.resizeOnNextFrame=function(){cancelAnimationFrame(o.nextFrameActionId),o.nextFrameActionId=requestAnimationFrame(o.resizeTextarea)},o.resizeTextarea=function(){var e=o.props.autoSize;if(e&&o.textArea){var t=e.minRows,n=e.maxRows,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;_l||((_l=document.createElement("textarea")).setAttribute("tab-index","-1"),_l.setAttribute("aria-hidden","true"),document.body.appendChild(_l)),e.getAttribute("wrap")?_l.setAttribute("wrap",e.getAttribute("wrap")):_l.removeAttribute("wrap");var o=Hl(e,t),i=o.paddingSize,a=o.borderSize,l=o.boxSizing,c=o.sizingStyle;_l.setAttribute("style","".concat(c,";").concat(Vl)),_l.value=e.value||e.placeholder||"";var s,u=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER,d=_l.scrollHeight;if("border-box"===l?d+=a:"content-box"===l&&(d-=i),null!==n||null!==r){_l.value=" ";var p=_l.scrollHeight-i;null!==n&&(u=p*n,"border-box"===l&&(u=u+i+a),d=Math.max(u,d)),null!==r&&(f=p*r,"border-box"===l&&(f=f+i+a),s=d>f?"":"hidden",d=Math.min(f,d))}return{height:d,minHeight:u,maxHeight:f,overflowY:s,resize:"none"}}(o.textArea,!1,t,n);o.setState({textareaStyles:r,resizeStatus:$l.RESIZING},(function(){cancelAnimationFrame(o.resizeFrameId),o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:$l.RESIZED},(function(){o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:$l.NONE}),o.fixFirefoxAutoScroll()}))}))}))}))}},o.renderTextArea=function(){var t=o.props,n=t.prefixCls,r=void 0===n?"rc-textarea":n,i=t.autoSize,a=t.onResize,l=t.className,c=t.disabled,s=o.state,u=s.textareaStyles,f=s.resizeStatus,d=Hr(o.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),p=$()(r,l,j({},"".concat(r,"-disabled"),c));"value"in d&&(d.value=d.value||"");var m=U(U(U({},o.props.style),u),f===$l.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return v.createElement(Dl,{onResize:o.handleResize,disabled:!(i||a)},v.createElement("textarea",e({},d,{className:p,style:m,ref:o.saveTextArea})))},o.state={textareaStyles:{},resizeStatus:$l.NONE},o}return Y(r,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&Bl()(e.autoSize,this.props.autoSize)||this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var e=this.textArea.selectionStart,t=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,t)}}catch(e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),r}(v.Component),ql=Ul,Kl=function(t){Z(r,t);var n=te(r);function r(e){var t;K(this,r),(t=n.call(this,e)).resizableTextArea=void 0,t.focus=function(){t.resizableTextArea.textArea.focus()},t.saveTextArea=function(e){t.resizableTextArea=e},t.handleChange=function(e){var n=t.props.onChange;t.setValue(e.target.value,(function(){t.resizableTextArea.resizeTextarea()})),n&&n(e)},t.handleKeyDown=function(e){var n=t.props,r=n.onPressEnter,o=n.onKeyDown;13===e.keyCode&&r&&r(e),o&&o(e)};var o=void 0===e.value||null===e.value?e.defaultValue:e.value;return t.state={value:o},t}return Y(r,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return v.createElement(ql,e({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),r}(v.Component),Gl=Kl,Yl=xr("text","input"),Xl=function(e){Z(n,e);var t=te(n);function n(){return K(this,n),t.apply(this,arguments)}return Y(n,[{key:"renderClearIcon",value:function(e){var t,n=this.props,r=n.value,o=n.disabled,i=n.readOnly,a=n.handleReset,l=n.suffix,c=!o&&!i&&r,s="".concat(e,"-clear-icon");return v.createElement(nl,{onClick:a,onMouseDown:function(e){return e.preventDefault()},className:$()((t={},j(t,"".concat(s,"-hidden"),!c),j(t,"".concat(s,"-has-suffix"),!!l),t),s),role:"button"})}},{key:"renderTextAreaWithClearIcon",value:function(e,t,n){var r,o=this.props,i=o.value,a=o.allowClear,l=o.className,c=o.style,s=o.direction,u=o.bordered,f=o.hidden,d=o.status,p=n.status,m=n.hasFeedback;if(!a)return Dr(t,{value:i});var h,g=$()("".concat(e,"-affix-wrapper"),"".concat(e,"-affix-wrapper-textarea-with-clear-btn"),fl("".concat(e,"-affix-wrapper"),dl(p,d),m),(j(r={},"".concat(e,"-affix-wrapper-rtl"),"rtl"===s),j(r,"".concat(e,"-affix-wrapper-borderless"),!u),j(r,"".concat(l),!((h=this.props).addonBefore||h.addonAfter)&&l),r));return v.createElement("span",{className:g,style:c,hidden:f},Dr(t,{style:null,value:i}),this.renderClearIcon(e))}},{key:"render",value:function(){var e=this;return v.createElement(Za.Consumer,null,(function(t){var n=e.props,r=n.prefixCls,o=n.inputType,i=n.element;if(o===Yl[0])return e.renderTextAreaWithClearIcon(r,i,t)}))}}]),n}(v.Component),Ql=Xl;function Zl(e,t){return bi(e||"").slice(0,t).join("")}function Jl(e,t,n,r){var o=n;return e?o=Zl(n,r):bi(t||"").lengthr&&(o=t),o}var ec=v.forwardRef((function(t,n){var r,o=t.prefixCls,i=t.bordered,a=void 0===i||i,l=t.showCount,c=void 0!==l&&l,s=t.maxLength,u=t.className,f=t.style,d=t.size,p=t.disabled,m=t.onCompositionStart,h=t.onCompositionEnd,g=t.onChange,y=t.status,b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0,Y=C("input",o);v.useImperativeHandle(n,(function(){var e;return{resizableTextArea:null===(e=T.current)||void 0===e?void 0:e.resizableTextArea,focus:function(e){var t,n;!function(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}(null===(n=null===(t=T.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:function(){var e;return null===(e=T.current)||void 0===e?void 0:e.blur()}}}));var X=v.createElement(Gl,e({},Hr(b,["allowClear"]),{disabled:S,className:$()((r={},j(r,"".concat(Y,"-borderless"),!a),j(r,u,u&&!c),j(r,"".concat(Y,"-sm"),"small"===E||"small"===d),j(r,"".concat(Y,"-lg"),"large"===E||"large"===d),r),fl(Y,R)),style:c?void 0:f,prefixCls:Y,onCompositionStart:function(e){D(!0),V.current=B,L.current=e.currentTarget.selectionStart,null==m||m(e)},onChange:function(e){var t=e.target.value;!_&&G&&(t=Jl(e.target.selectionStart>=s+1||e.target.selectionStart===t.length||!e.target.selectionStart,B,t,s)),K(t),pl(e.currentTarget,e,g,t)},onCompositionEnd:function(e){var t;D(!1);var n=e.currentTarget.value;G&&(n=Jl(L.current>=s+1||L.current===(null===(t=V.current)||void 0===t?void 0:t.length),V.current,n,s)),n!==B&&(K(n),pl(e.currentTarget,e,g,n)),null==h||h(e)},ref:T})),Q=function(e){return null==e?"":String(e)}(B);_||!G||null!==b.value&&void 0!==b.value||(Q=Zl(Q,s));var Z=v.createElement(Ql,e({disabled:S},b,{prefixCls:Y,direction:x,inputType:"text",value:Q,element:X,handleReset:function(e){var t,n,r;K(""),null===(t=T.current)||void 0===t||t.focus(),pl(null===(r=null===(n=T.current)||void 0===n?void 0:n.resizableTextArea)||void 0===r?void 0:r.textArea,e,g)},ref:F,bordered:a,status:y,style:c?void 0:f}));if(c||P){var J,ee,te=bi(Q).length;return ee="object"===W(c)?c.formatter({count:te,maxLength:s}):"".concat(te).concat(G?" / ".concat(s):""),v.createElement("div",{hidden:q,className:$()("".concat(Y,"-textarea"),(J={},j(J,"".concat(Y,"-textarea-rtl"),"rtl"===x),j(J,"".concat(Y,"-textarea-show-count"),c),j(J,"".concat(Y,"-textarea-in-form-item"),A),J),fl("".concat(Y,"-textarea"),R,P),u),style:f,"data-count":ee},Z,P&&v.createElement("span",{className:"".concat(Y,"-textarea-suffix")},M))}return Z})),tc=ec,nc=vl;nc.Group=function(t){var n,r=(0,v.useContext)(wr),o=r.getPrefixCls,i=r.direction,a=t.prefixCls,l=t.className,c=void 0===l?"":l,s=o("input-group",a),u=$()(s,(j(n={},"".concat(s,"-lg"),"large"===t.size),j(n,"".concat(s,"-sm"),"small"===t.size),j(n,"".concat(s,"-compact"),t.compact),j(n,"".concat(s,"-rtl"),"rtl"===i),n),c),f=(0,v.useContext)(Za),d=(0,v.useMemo)((function(){return e(e({},f),{isFormItemInput:!1})}),[f]);return v.createElement("span",{className:u,style:t.style,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onFocus:t.onFocus,onBlur:t.onBlur},v.createElement(Za.Provider,{value:d},t.children))},nc.Search=Al,nc.TextArea=tc,nc.Password=kl;var rc=nc;const{useRef:oc,useEffect:ic}=wp.element;var ac=e=>{let n=oc(null);const{arg:r,argValue:o,styleConfig:i}=e,a=M(r.type),l="string"==typeof o.value?o.value:"",c="StringValue"===e.argValue.kind?i.colors.string:i.colors.number;return(0,t.createElement)("span",{style:{color:c}},"String"===a.name?'"':"",(0,t.createElement)(rc,{name:r.name,style:{width:"15ch",color:c,minHeight:"16px"},size:"small",ref:e=>{n=e},type:"text",onChange:t=>{var n;n=t,e.setArgValue(n,!0)},value:l}),"String"===a.name?'"':"")};const{isInputObjectType:lc,isLeafType:cc}=wpGraphiQL.GraphQL,{useState:sc}=wp.element;var uc=e=>{let n;const r=()=>e.selection.fields.find((t=>t.name.value===e.arg.name)),{arg:o,parentField:i}=e,a=r();return(0,t.createElement)(Xu,{argValue:a?a.value:null,arg:o,parentField:i,addArg:()=>{const{selection:t,arg:r,getDefaultScalarArgValue:o,parentField:i,makeDefaultArg:a}=e,l=M(r.type);let c=null;if(n)c=n;else if(lc(l)){const e=l.getFields();c={kind:"ObjectField",name:{kind:"Name",value:r.name},value:{kind:"ObjectValue",fields:T(o,a,i,Object.keys(e).map((t=>e[t])))}}}else cc(l)&&(c={kind:"ObjectField",name:{kind:"Name",value:r.name},value:o(i,r,l)});if(c)return e.modifyFields([...t.fields||[],c],!0);console.error("Unable to add arg for argType",l)},removeArg:()=>{const{selection:t}=e,o=r();n=o,e.modifyFields(t.fields.filter((e=>e!==o)),!0)},setArgFields:t=>e.modifyFields(e.selection.fields.map((n=>n.name.value===e.arg.name?{...n,value:{kind:"ObjectValue",fields:t}}:n)),!0),setArgValue:(t,n)=>{let o=!1,i=!1,a=!1;try{"VariableDefinition"===t.kind?i=!0:null==t?o=!0:"string"==typeof t.kind&&(a=!0)}catch(e){}const{selection:l}=e,c=r();if(!c)return void console.error("missing arg selection when setting arg value");const s=M(e.arg.type);if(!(cc(s)||i||o||a))return void console.warn("Unable to handle non leaf types in InputArgView.setArgValue",t);let u,f;return null==t?f=null:!t.target&&t.kind&&"VariableDefinition"===t.kind?(u=t,f=u.variable):"string"==typeof t.kind?f=t:t.target&&"string"==typeof t.target.value&&(u=t.target.value,f=R(s,u)),e.modifyFields((l.fields||[]).map((e=>e===c?{...e,value:f}:e)),n)},getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition})},fc={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=fc.F1&&t<=fc.F12)return!1;switch(t){case fc.ALT:case fc.CAPS_LOCK:case fc.CONTEXT_MENU:case fc.CTRL:case fc.DOWN:case fc.END:case fc.ESC:case fc.HOME:case fc.INSERT:case fc.LEFT:case fc.MAC_FF_META:case fc.META:case fc.NUMLOCK:case fc.NUM_CENTER:case fc.PAGE_DOWN:case fc.PAGE_UP:case fc.PAUSE:case fc.PRINT_SCREEN:case fc.RIGHT:case fc.SHIFT:case fc.UP:case fc.WIN_KEY:case fc.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=fc.ZERO&&e<=fc.NINE)return!0;if(e>=fc.NUM_ZERO&&e<=fc.NUM_MULTIPLY)return!0;if(e>=fc.A&&e<=fc.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case fc.SPACE:case fc.QUESTION_MARK:case fc.NUM_PLUS:case fc.NUM_MINUS:case fc.NUM_PERIOD:case fc.NUM_DIVISION:case fc.SEMICOLON:case fc.DASH:case fc.EQUALS:case fc.COMMA:case fc.PERIOD:case fc.SLASH:case fc.APOSTROPHE:case fc.SINGLE_QUOTE:case fc.OPEN_SQUARE_BRACKET:case fc.BACKSLASH:case fc.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},dc=fc;function pc(e,t){var n,r=e.key;return"value"in e&&(n=e.value),null!=r?r:void 0!==n?n:"rc-index-key-".concat(t)}function mc(e,t){var n=e||{};return{label:n.label||(t?"children":"label"),value:n.value||"value",options:n.options||"options"}}function vc(e){var t=U({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Bo(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var hc=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],gc=function(t,n){var r=t.prefixCls,o=(t.disabled,t.visible),i=t.children,a=t.popupElement,l=t.containerWidth,c=t.animation,s=t.transitionName,u=t.dropdownStyle,f=t.dropdownClassName,d=t.direction,p=void 0===d?"ltr":d,m=t.placement,h=t.dropdownMatchSelectWidth,g=t.dropdownRender,y=t.dropdownAlign,b=t.getPopupContainer,w=t.empty,C=t.getTriggerDOMNode,x=t.onPopupVisibleChange,E=t.onPopupMouseEnter,k=q(t,hc),S="".concat(r,"-dropdown"),O=a;g&&(O=g(a));var N=v.useMemo((function(){return function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}}(h)}),[h]),P=c?"".concat(S,"-").concat(c):s,A=v.useRef(null);v.useImperativeHandle(n,(function(){return{getPopupElement:function(){return A.current}}}));var M=U({minWidth:l},u);return"number"==typeof h?M.width=h:h&&(M.width=l),v.createElement(ur,e({},k,{showAction:x?["click"]:[],hideAction:x?["click"]:[],popupPlacement:m||("rtl"===p?"bottomRight":"bottomLeft"),builtinPlacements:N,prefixCls:S,popupTransitionName:P,popup:v.createElement("div",{ref:A,onMouseEnter:E},O),popupAlign:y,popupVisible:o,getPopupContainer:b,popupClassName:$()(f,j({},"".concat(S,"-empty"),w)),popupStyle:M,getTriggerDOMNode:C,onPopupVisibleChange:x}),i)},yc=v.forwardRef(gc);yc.displayName="SelectTrigger";var bc=yc,wc="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/),Cc="aria-",xc="data-";function Ec(e,t){return 0===e.indexOf(t)}function kc(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:U({},n);var r={};return Object.keys(e).forEach((function(n){(t.aria&&("role"===n||Ec(n,Cc))||t.data&&Ec(n,xc)||t.attr&&wc.includes(n))&&(r[n]=e[n])})),r}var Sc=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Oc=void 0;function Nc(t,n){var r=t.prefixCls,o=t.invalidate,i=t.item,a=t.renderItem,l=t.responsive,c=t.responsiveDisabled,s=t.registerSize,u=t.itemKey,f=t.className,d=t.style,p=t.children,m=t.display,h=t.order,g=t.component,y=void 0===g?"div":g,b=q(t,Sc),w=l&&!m;function C(e){s(u,e)}v.useEffect((function(){return function(){C(null)}}),[]);var x,E=a&&i!==Oc?a(i):p;o||(x={opacity:w?0:1,height:w?0:Oc,overflowY:w?"hidden":Oc,order:l?h:Oc,pointerEvents:w?"none":Oc,position:w?"absolute":Oc});var k={};w&&(k["aria-hidden"]=!0);var S=v.createElement(y,e({className:$()(!o&&r,f),style:U(U({},x),d)},k,b,{ref:n}),E);return l&&(S=v.createElement(Dl,{onResize:function(e){C(e.offsetWidth)},disabled:c},S)),S}var Pc=v.forwardRef(Nc);Pc.displayName="Item";var Ac=Pc,Mc=["component"],Rc=["className"],Tc=["className"],Fc=function(t,n){var r=v.useContext(Dc);if(!r){var o=t.component,i=void 0===o?"div":o,a=q(t,Mc);return v.createElement(i,e({},a,{ref:n}))}var l=r.className,c=q(r,Rc),s=t.className,u=q(t,Tc);return v.createElement(Dc.Provider,{value:null},v.createElement(Ac,e({ref:n,className:$()(l,s)},c,u)))},Ic=v.forwardRef(Fc);Ic.displayName="RawItem";var jc=Ic,_c=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Dc=v.createContext(null),Vc="responsive",Lc="invalidate";function zc(e){return"+ ".concat(e.length," ...")}function Hc(t,n){var r,o,i,a,l=t.prefixCls,c=void 0===l?"rc-overflow":l,s=t.data,u=void 0===s?[]:s,f=t.renderItem,d=t.renderRawItem,p=t.itemKey,m=t.itemWidth,h=void 0===m?10:m,g=t.ssr,y=t.style,b=t.className,w=t.maxCount,C=t.renderRest,x=t.renderRawRest,E=t.suffix,k=t.component,S=void 0===k?"div":k,O=t.itemComponent,N=t.onVisibleChange,P=q(t,_c),A=(r=z(Ke({}),2)[1],o=(0,v.useRef)([]),i=0,a=0,function(e){var t=i;return i+=1,o.current.lengthw,me=(0,v.useMemo)((function(){var e=u;return fe?e=null===T&&M?u:u.slice(0,Math.min(u.length,I/h)):"number"==typeof w&&(e=u.slice(0,w)),e}),[u,h,T,w,fe]),ve=(0,v.useMemo)((function(){return fe?u.slice(re+1):u.slice(me.length)}),[u,me,fe,re]),he=(0,v.useCallback)((function(e,t){var n;return"function"==typeof p?p(e):null!==(n=p&&(null==e?void 0:e[p]))&&void 0!==n?n:t}),[p]),ge=(0,v.useCallback)(f||function(e){return e},[f]);function ye(e,t){ne(e),t||(ae(eI){ye(r-1),J(e-o-Y+B);break}}E&&we(0)+Y>I&&J(null)}}),[I,_,B,Y,he,me]);var Ce=ie&&!!ve.length,xe={};null!==Z&&fe&&(xe={position:"absolute",left:Z,top:0});var Ee,ke={prefixCls:le,responsive:fe,component:O,invalidate:de},Se=d?function(e,t){var n=he(e,t);return v.createElement(Dc.Provider,{key:n,value:U(U({},ke),{},{order:t,item:e,itemKey:n,registerSize:be,display:t<=re})},d(e,t))}:function(t,n){var r=he(t,n);return v.createElement(Ac,e({},ke,{order:n,key:r,item:t,renderItem:ge,itemKey:r,registerSize:be,display:n<=re}))},Oe={order:Ce?re:Number.MAX_SAFE_INTEGER,className:"".concat(le,"-rest"),registerSize:function(e,t){K(t),H(B)},display:Ce};if(x)x&&(Ee=v.createElement(Dc.Provider,{value:U(U({},ke),Oe)},x(ve)));else{var Ne=C||zc;Ee=v.createElement(Ac,e({},ke,Oe),"function"==typeof Ne?Ne(ve):Ne)}var Pe=v.createElement(S,e({className:$()(!de&&c,b),style:y,ref:n},P),me.map(Se),pe?Ee:null,E&&v.createElement(Ac,e({},ke,{responsive:ue,responsiveDisabled:!fe,order:re,className:"".concat(le,"-suffix"),registerSize:function(e,t){X(t)},display:!0,style:xe}),E));return ue&&(Pe=v.createElement(Dl,{onResize:function(e,t){F(t.clientWidth)},disabled:!fe},Pe)),Pe}var $c=v.forwardRef(Hc);$c.displayName="Overflow",$c.Item=jc,$c.RESPONSIVE=Vc,$c.INVALIDATE=Lc;var Wc=$c,Bc=function(e){var t,n=e.className,r=e.customizeIcon,o=e.customizeIconProps,i=e.onMouseDown,a=e.onClick,l=e.children;return t="function"==typeof r?r(o):r,v.createElement("span",{className:n,onMouseDown:function(e){e.preventDefault(),i&&i(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},void 0!==t?t:v.createElement("span",{className:$()(n.split(/\s+/).map((function(e){return"".concat(e,"-icon")})))},l))},Uc=function(e,t){var n,r,o=e.prefixCls,i=e.id,a=e.inputElement,l=e.disabled,c=e.tabIndex,s=e.autoFocus,u=e.autoComplete,f=e.editable,d=e.activeDescendantId,p=e.value,m=e.maxLength,h=e.onKeyDown,g=e.onMouseDown,y=e.onChange,b=e.onPaste,w=e.onCompositionStart,C=e.onCompositionEnd,x=e.open,E=e.attrs,k=a||v.createElement("input",null),S=k,O=S.ref,N=S.props,P=N.onKeyDown,A=N.onChange,M=N.onMouseDown,R=N.onCompositionStart,T=N.onCompositionEnd,F=N.style;return k.props,v.cloneElement(k,U(U(U({type:"search"},N),{},{id:i,ref:ve(t,O),disabled:l,tabIndex:c,autoComplete:u||"off",autoFocus:s,className:$()("".concat(o,"-selection-search-input"),null===(n=k)||void 0===n||null===(r=n.props)||void 0===r?void 0:r.className),role:"combobox","aria-expanded":x,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":d},E),{},{value:f?p:"",maxLength:m,readOnly:!f,unselectable:f?null:"on",style:U(U({},F),{},{opacity:f?null:0}),onKeyDown:function(e){h(e),P&&P(e)},onMouseDown:function(e){g(e),M&&M(e)},onChange:function(e){y(e),A&&A(e)},onCompositionStart:function(e){w(e),R&&R(e)},onCompositionEnd:function(e){C(e),T&&T(e)},onPaste:b}))},qc=v.forwardRef(Uc);qc.displayName="Input";var Kc=qc;function Gc(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var Yc="undefined"!=typeof window&&window.document&&window.document.documentElement;function Xc(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var Qc=function(e){e.preventDefault(),e.stopPropagation()},Zc=function(e){var t,n,r=e.id,o=e.prefixCls,i=e.values,a=e.open,l=e.searchValue,c=e.inputRef,s=e.placeholder,u=e.disabled,f=e.mode,d=e.showSearch,p=e.autoFocus,m=e.autoComplete,h=e.activeDescendantId,g=e.tabIndex,y=e.removeIcon,b=e.maxTagCount,w=e.maxTagTextLength,C=e.maxTagPlaceholder,x=void 0===C?function(e){return"+ ".concat(e.length," ...")}:C,E=e.tagRender,k=e.onToggleOpen,S=e.onRemove,O=e.onInputChange,N=e.onInputPaste,P=e.onInputKeyDown,A=e.onInputMouseDown,M=e.onInputCompositionStart,R=e.onInputCompositionEnd,T=v.useRef(null),F=z((0,v.useState)(0),2),I=F[0],_=F[1],D=z((0,v.useState)(!1),2),V=D[0],L=D[1],H="".concat(o,"-selection"),W=a||"tags"===f?l:"",B="tags"===f||d&&(a||V);function U(e,t,n,r,o){return v.createElement("span",{className:$()("".concat(H,"-item"),j({},"".concat(H,"-item-disabled"),n)),title:"string"==typeof e||"number"==typeof e?e.toString():void 0},v.createElement("span",{className:"".concat(H,"-item-content")},t),r&&v.createElement(Bc,{className:"".concat(H,"-item-remove"),onMouseDown:Qc,onClick:o,customizeIcon:y},"×"))}t=function(){_(T.current.scrollWidth)},n=[W],Yc?v.useLayoutEffect(t,n):v.useEffect(t,n);var q=v.createElement("div",{className:"".concat(H,"-search"),style:{width:I},onFocus:function(){L(!0)},onBlur:function(){L(!1)}},v.createElement(Kc,{ref:c,open:a,prefixCls:o,id:r,inputElement:null,disabled:u,autoFocus:p,autoComplete:m,editable:B,activeDescendantId:h,value:W,onKeyDown:P,onMouseDown:A,onChange:O,onPaste:N,onCompositionStart:M,onCompositionEnd:R,tabIndex:g,attrs:kc(e,!0)}),v.createElement("span",{ref:T,className:"".concat(H,"-search-mirror"),"aria-hidden":!0},W," ")),K=v.createElement(Wc,{prefixCls:"".concat(H,"-overflow"),data:i,renderItem:function(e){var t=e.disabled,n=e.label,r=e.value,o=!u&&!t,i=n;if("number"==typeof w&&("string"==typeof n||"number"==typeof n)){var l=String(i);l.length>w&&(i="".concat(l.slice(0,w),"..."))}var c=function(t){t&&t.stopPropagation(),S(e)};return"function"==typeof E?function(e,t,n,r,o){return v.createElement("span",{onMouseDown:function(e){Qc(e),k(!a)}},E({label:t,value:e,disabled:n,closable:r,onClose:o}))}(r,i,t,o,c):U(n,i,t,o,c)},renderRest:function(e){var t="function"==typeof x?x(e):x;return U(t,t,!1)},suffix:q,itemKey:Xc,maxCount:b});return v.createElement(v.Fragment,null,K,!i.length&&!W&&v.createElement("span",{className:"".concat(H,"-placeholder")},s))},Jc=function(e){var t=e.inputElement,n=e.prefixCls,r=e.id,o=e.inputRef,i=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,s=e.mode,u=e.open,f=e.values,d=e.placeholder,p=e.tabIndex,m=e.showSearch,h=e.searchValue,g=e.activeValue,y=e.maxLength,b=e.onInputKeyDown,w=e.onInputMouseDown,C=e.onInputChange,x=e.onInputPaste,E=e.onInputCompositionStart,k=e.onInputCompositionEnd,S=z(v.useState(!1),2),O=S[0],N=S[1],P="combobox"===s,A=P||m,M=f[0],R=h||"";P&&g&&!O&&(R=g),v.useEffect((function(){P&&N(!1)}),[P,g]);var T=!("combobox"!==s&&!u&&!m||!R),F=!M||"string"!=typeof M.label&&"number"!=typeof M.label?void 0:M.label.toString();return v.createElement(v.Fragment,null,v.createElement("span",{className:"".concat(n,"-selection-search")},v.createElement(Kc,{ref:o,prefixCls:n,id:r,open:u,inputElement:t,disabled:i,autoFocus:a,autoComplete:l,editable:A,activeDescendantId:c,value:R,onKeyDown:b,onMouseDown:w,onChange:function(e){N(!0),C(e)},onPaste:x,onCompositionStart:E,onCompositionEnd:k,tabIndex:p,attrs:kc(e,!0),maxLength:P?y:void 0})),!P&&M&&!T&&v.createElement("span",{className:"".concat(n,"-selection-item"),title:F},M.label),function(){if(M)return null;var e=T?{visibility:"hidden"}:void 0;return v.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:e},d)}())};function es(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=v.useRef(null),n=v.useRef(null);function r(r){(r||null===t.current)&&(t.current=r),window.clearTimeout(n.current),n.current=window.setTimeout((function(){t.current=null}),e)}return v.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return t.current},r]}var ts=function(t,n){var r=(0,v.useRef)(null),o=(0,v.useRef)(!1),i=t.prefixCls,a=t.open,l=t.mode,c=t.showSearch,s=t.tokenWithEnter,u=t.onSearch,f=t.onSearchSubmit,d=t.onToggleOpen,p=t.onInputKeyDown,m=t.domRef;v.useImperativeHandle(n,(function(){return{focus:function(){r.current.focus()},blur:function(){r.current.blur()}}}));var h=z(es(0),2),g=h[0],y=h[1],b=(0,v.useRef)(null),w=function(e){!1!==u(e,!0,o.current)&&d(!0)},C={inputRef:r,onInputKeyDown:function(e){var t,n=e.which;n!==dc.UP&&n!==dc.DOWN||e.preventDefault(),p&&p(e),n!==dc.ENTER||"tags"!==l||o.current||a||null==f||f(e.target.value),t=n,[dc.ESC,dc.SHIFT,dc.BACKSPACE,dc.TAB,dc.WIN_KEY,dc.ALT,dc.META,dc.WIN_KEY_RIGHT,dc.CTRL,dc.SEMICOLON,dc.EQUALS,dc.CAPS_LOCK,dc.CONTEXT_MENU,dc.F1,dc.F2,dc.F3,dc.F4,dc.F5,dc.F6,dc.F7,dc.F8,dc.F9,dc.F10,dc.F11,dc.F12].includes(t)||d(!0)},onInputMouseDown:function(){y(!0)},onInputChange:function(e){var t=e.target.value;if(s&&b.current&&/[\r\n]/.test(b.current)){var n=b.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,b.current)}b.current=null,w(t)},onInputPaste:function(e){var t=e.clipboardData.getData("text");b.current=t},onInputCompositionStart:function(){o.current=!0},onInputCompositionEnd:function(e){o.current=!1,"combobox"!==l&&w(e.target.value)}},x="multiple"===l||"tags"===l?v.createElement(Zc,e({},t,C)):v.createElement(Jc,e({},t,C));return v.createElement("div",{ref:m,className:"".concat(i,"-selector"),onClick:function(e){e.target!==r.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){r.current.focus()})):r.current.focus())},onMouseDown:function(e){var t=g();e.target===r.current||t||e.preventDefault(),("combobox"===l||c&&t)&&a||(a&&u("",!0,!1),d())}},x)},ns=v.forwardRef(ts);ns.displayName="Selector";var rs=ns,os=v.createContext(null),is=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],as=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function ls(e){return"tags"===e||"multiple"===e}var cs=v.forwardRef((function(t,n){var r,o,i=t.id,a=t.prefixCls,l=t.className,c=t.showSearch,s=t.tagRender,u=t.direction,f=t.omitDomProps,d=t.displayValues,p=t.onDisplayValuesChange,m=t.emptyOptions,h=t.notFoundContent,g=void 0===h?"Not Found":h,y=t.onClear,b=t.mode,w=t.disabled,C=t.loading,x=t.getInputElement,E=t.getRawInputElement,k=t.open,S=t.defaultOpen,O=t.onDropdownVisibleChange,N=t.activeValue,P=t.onActiveValueChange,A=t.activeDescendantId,M=t.searchValue,R=t.onSearch,T=t.onSearchSplit,F=t.tokenSeparators,I=t.allowClear,_=t.showArrow,D=t.inputIcon,V=t.clearIcon,L=t.OptionList,H=t.animation,B=t.transitionName,K=t.dropdownStyle,G=t.dropdownClassName,Y=t.dropdownMatchSelectWidth,X=t.dropdownRender,Q=t.dropdownAlign,Z=t.placement,J=t.getPopupContainer,ee=t.showAction,te=void 0===ee?[]:ee,ne=t.onFocus,re=t.onBlur,oe=t.onKeyUp,ie=t.onKeyDown,ae=t.onMouseDown,le=q(t,is),ce=ls(b),se=(void 0!==c?c:ce)||"combobox"===b,ue=U({},le);as.forEach((function(e){delete ue[e]})),null==f||f.forEach((function(e){delete ue[e]}));var fe=z(v.useState(!1),2),de=fe[0],me=fe[1];v.useEffect((function(){me(xe())}),[]);var he=v.useRef(null),ge=v.useRef(null),ye=v.useRef(null),be=v.useRef(null),we=v.useRef(null),Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=z(v.useState(!1),2),n=t[0],r=t[1],o=v.useRef(null),i=function(){window.clearTimeout(o.current)};return v.useEffect((function(){return i}),[]),[n,function(t,n){i(),o.current=window.setTimeout((function(){r(t),n&&n()}),e)},i]}(),Ee=z(Ce,3),ke=Ee[0],Se=Ee[1],Oe=Ee[2];v.useImperativeHandle(n,(function(){var e,t;return{focus:null===(e=be.current)||void 0===e?void 0:e.focus,blur:null===(t=be.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=we.current)||void 0===t?void 0:t.scrollTo(e)}}}));var Ne=v.useMemo((function(){var e;if("combobox"!==b)return M;var t=null===(e=d[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""}),[M,b,d]),Pe="combobox"===b&&"function"==typeof x&&x()||null,Ae="function"==typeof E&&E(),Me=function(){for(var e=arguments.length,t=new Array(e),n=0;n1,l.reduce((function(t,n){return[].concat(bi(t),bi(e(n,a)))}),[]).filter((function(e){return e}))}(e,t);return n?r:null}(e,F);return"combobox"!==b&&i&&(o="",null==T||T(i),De(!1),r=!1),R&&Ne!==o&&R(o,{source:t?"typing":"effect"}),r};v.useEffect((function(){Ie||ce||"combobox"===b||Le("",!1,!1)}),[Ie]),v.useEffect((function(){Te&&w&&Fe(!1),w&&Se(!1)}),[w]);var ze=z(es(),2),He=ze[0],$e=ze[1],We=v.useRef(!1),Be=[];v.useEffect((function(){return function(){Be.forEach((function(e){return clearTimeout(e)})),Be.splice(0,Be.length)}}),[]);var Ue,qe=z(v.useState(null),2),Ke=qe[0],Ge=qe[1],Ye=z(v.useState({}),2)[1];qn((function(){if(_e){var e,t=Math.ceil(null===(e=he.current)||void 0===e?void 0:e.offsetWidth);Ke===t||Number.isNaN(t)||Ge(t)}}),[_e]),Ae&&(Ue=function(e){De(e)}),function(e,t,n,r){var o=v.useRef(null);o.current={open:t,triggerOpen:n,customizedTrigger:r},v.useEffect((function(){function e(e){var t,n;if(!(null===(t=o.current)||void 0===t?void 0:t.customizedTrigger)){var r=e.target;r.shadowRoot&&e.composed&&(r=e.composedPath()[0]||r),o.current.open&&[he.current,null===(n=ye.current)||void 0===n?void 0:n.getPopupElement()].filter((function(e){return e})).every((function(e){return!e.contains(r)&&e!==r}))&&o.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[])}(0,_e,De,!!Ae);var Xe,Qe,Ze=v.useMemo((function(){return U(U({},t),{},{notFoundContent:g,open:Ie,triggerOpen:_e,id:i,showSearch:se,multiple:ce,toggleOpen:De})}),[t,g,_e,Ie,i,se,ce,De]),Je=void 0!==_?_:C||!ce&&"combobox"!==b;Je&&(Xe=v.createElement(Bc,{className:$()("".concat(a,"-arrow"),j({},"".concat(a,"-arrow-loading"),C)),customizeIcon:D,customizeIconProps:{loading:C,searchValue:Ne,open:Ie,focused:ke,showSearch:se}})),!w&&I&&(d.length||Ne)&&(Qe=v.createElement(Bc,{className:"".concat(a,"-clear"),onMouseDown:function(){null==y||y(),p([],{type:"clear",values:d}),Le("",!1,!1)},customizeIcon:V},"×"));var et,tt=v.createElement(L,{ref:we}),nt=$()(a,l,(j(o={},"".concat(a,"-focused"),ke),j(o,"".concat(a,"-multiple"),ce),j(o,"".concat(a,"-single"),!ce),j(o,"".concat(a,"-allow-clear"),I),j(o,"".concat(a,"-show-arrow"),Je),j(o,"".concat(a,"-disabled"),w),j(o,"".concat(a,"-loading"),C),j(o,"".concat(a,"-open"),Ie),j(o,"".concat(a,"-customize-input"),Pe),j(o,"".concat(a,"-show-search"),se),o)),rt=v.createElement(bc,{ref:ye,disabled:w,prefixCls:a,visible:_e,popupElement:tt,containerWidth:Ke,animation:H,transitionName:B,dropdownStyle:K,dropdownClassName:G,direction:u,dropdownMatchSelectWidth:Y,dropdownRender:X,dropdownAlign:Q,placement:Z,getPopupContainer:J,empty:m,getTriggerDOMNode:function(){return ge.current},onPopupVisibleChange:Ue,onPopupMouseEnter:function(){Ye({})}},Ae?v.cloneElement(Ae,{ref:Me}):v.createElement(rs,e({},t,{domRef:ge,prefixCls:a,inputElement:Pe,ref:be,id:i,showSearch:se,mode:b,activeDescendantId:A,tagRender:s,values:d,open:Ie,onToggleOpen:De,activeValue:N,searchValue:Ne,onSearch:Le,onSearchSubmit:function(e){e&&e.trim()&&R(e,{source:"submit"})},onRemove:function(e){var t=d.filter((function(t){return t!==e}));p(t,{type:"remove",values:[e]})},tokenWithEnter:Ve})));return et=Ae?rt:v.createElement("div",e({className:nt},ue,{ref:he,onMouseDown:function(e){var t,n=e.target,r=null===(t=ye.current)||void 0===t?void 0:t.getPopupElement();if(r&&r.contains(n)){var o=setTimeout((function(){var e,t=Be.indexOf(o);-1!==t&&Be.splice(t,1),Oe(),de||r.contains(document.activeElement)||null===(e=be.current)||void 0===e||e.focus()}));Be.push(o)}for(var i=arguments.length,a=new Array(i>1?i-1:0),l=1;l=0;a-=1){var l=o[a];if(!l.disabled){o.splice(a,1),i=l;break}}i&&p(o,{type:"remove",values:[i]})}for(var c=arguments.length,s=new Array(c>1?c-1:0),u=1;u1?t-1:0),r=1;r1&&void 0!==arguments[1]&&arguments[1];return wi(e).map((function(e,n){if(!v.isValidElement(e)||!e.type)return null;var r=e.type.isSelectOptGroup,o=e.key,i=e.props,a=i.children,l=q(i,ms);return t||!r?vs(e):U(U({key:"__RC_SELECT_GRP__".concat(null===o?n:o,"__"),label:o},l),{},{options:hs(a)})})).filter((function(e){return e}))}function gs(e,t,n,r,o){return v.useMemo((function(){var i=e;!e&&(i=hs(t));var a=new Map,l=new Map,c=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(t){for(var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=0;sn},e}return t=a,(n=[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(e){e.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var e=this.state,t=e.dragging,n=e.visible,r=this.props.prefixCls,o=this.getSpinHeight(),i=this.getTop(),a=this.showScroll(),l=a&&n;return v.createElement("div",{ref:this.scrollbarRef,className:$()("".concat(r,"-scrollbar"),As({},"".concat(r,"-scrollbar-show"),a)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:l?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},v.createElement("div",{ref:this.thumbRef,className:$()("".concat(r,"-scrollbar-thumb"),As({},"".concat(r,"-scrollbar-thumb-moving"),t)),style:{width:"100%",height:o,top:i,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}])&&Rs(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(v.Component);function Ds(e){var t=e.children,n=e.setRef,r=v.useCallback((function(e){n(e)}),[]);return v.cloneElement(t,{ref:r})}function Vs(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],a=e<0&&i.current.top||e>0&&i.current.bottom;return t&&a?(clearTimeout(r.current),n.current=!1):a&&!n.current||o(),!n.current&&a}},Gs=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange"];function Ys(){return Ys=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Gs),w=!(!1===p||!i||!a),C=w&&u&&a*u.length>i,x=Js((0,v.useState)(0),2),E=x[0],k=x[1],S=Js((0,v.useState)(!1),2),O=S[0],N=S[1],P=$()(r,o),A=u||tu,M=(0,v.useRef)(),R=(0,v.useRef)(),T=(0,v.useRef)(),F=v.useCallback((function(e){return"function"==typeof d?d(e):null==e?void 0:e[d]}),[d]),I={getKey:F};function j(e){k((function(t){var n=function(e){var t=e;return Number.isNaN(Z.current)||(t=Math.min(t,Z.current)),Math.max(t,0)}("function"==typeof e?e(t):e);return M.current.scrollTop=n,n}))}var _=(0,v.useRef)({start:0,end:A.length}),D=(0,v.useRef)(),V=Js(function(e,t,n){var r=Ws(v.useState(e),2),o=r[0],i=r[1],a=Ws(v.useState(null),2),l=a[0],c=a[1];return v.useEffect((function(){var r=function(e,t,n){var r,o,i=e.length,a=t.length;if(0===i&&0===a)return null;i=E&&void 0===t&&(t=c,n=o),d>E+i&&void 0===r&&(r=c),o=d}return void 0===t&&(t=0,n=0),void 0===r&&(r=A.length-1),{scrollHeight:o,start:t,end:r=Math.min(r+1,A.length),offset:n}}),[C,w,E,A,U,i]),K=q.scrollHeight,G=q.start,Y=q.end,X=q.offset;_.current.start=G,_.current.end=Y;var Q=K-i,Z=(0,v.useRef)(Q);Z.current=Q;var J=E<=0,ee=E>=Q,te=Ks(J,ee),ne=function(e,t,n,r){var o=(0,v.useRef)(0),i=(0,v.useRef)(null),a=(0,v.useRef)(null),l=(0,v.useRef)(!1),c=Ks(t,n);return[function(t){if(e){se.cancel(i.current);var n=t.deltaY;o.current+=n,a.current=n,c(n)||(qs||t.preventDefault(),i.current=se((function(){var e,t=l.current?10:1;e=o.current*t,j((function(t){return t+e})),o.current=0})))}},function(t){e&&(l.current=t.detail===a.current)}]}(w,J,ee),re=Js(ne,2),oe=re[0],ie=re[1];!function(e,t,n){var r,o=(0,v.useRef)(!1),i=(0,v.useRef)(0),a=(0,v.useRef)(null),l=(0,v.useRef)(null),c=function(e){if(o.current){var t=Math.ceil(e.touches[0].pageY),r=i.current-t;i.current=t,n(r)&&e.preventDefault(),clearInterval(l.current),l.current=setInterval((function(){(!n(r*=.9333333333333333,!0)||Math.abs(r)<=.1)&&clearInterval(l.current)}),16)}},s=function(){o.current=!1,r()},u=function(e){r(),1!==e.touches.length||o.current||(o.current=!0,i.current=Math.ceil(e.touches[0].pageY),a.current=e.target,a.current.addEventListener("touchmove",c),a.current.addEventListener("touchend",s))};r=function(){a.current&&(a.current.removeEventListener("touchmove",c),a.current.removeEventListener("touchend",s))},qn((function(){return e&&t.current.addEventListener("touchstart",u),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",u),r(),clearInterval(l.current)}}),[e])}(w,M,(function(e,t){return!te(e,t)&&(oe({preventDefault:function(){},deltaY:e}),!0)})),qn((function(){function e(e){w&&e.preventDefault()}return M.current.addEventListener("wheel",oe),M.current.addEventListener("DOMMouseScroll",ie),M.current.addEventListener("MozMousePixelScroll",e),function(){M.current&&(M.current.removeEventListener("wheel",oe),M.current.removeEventListener("DOMMouseScroll",ie),M.current.removeEventListener("MozMousePixelScroll",e))}}),[w]);var ae=function(e,t,n,r,o,i,a,l){var c=v.useRef();return function(l){if(null!=l){if(se.cancel(c.current),"number"==typeof l)a(l);else if(l&&"object"===$s(l)){var s,u=l.align;s="index"in l?l.index:t.findIndex((function(e){return o(e)===l.key}));var f=l.offset,d=void 0===f?0:f;!function l(f,p){if(!(f<0)&&e.current){var m=e.current.clientHeight,v=!1,h=p;if(m){for(var g=p||u,y=0,b=0,w=0,C=Math.min(t.length,s),x=0;x<=C;x+=1){var E=o(t[x]);b=y;var k=n.get(E);y=w=b+(void 0===k?r:k),x===s&&void 0===k&&(v=!0)}var S=null;switch(g){case"top":S=b-d;break;case"bottom":S=w-m+d;break;default:var O=e.current.scrollTop;bO+m&&(h="bottom")}null!==S&&S!==e.current.scrollTop&&a(S)}c.current=se((function(){v&&i(),l(f-1,h)}))}}(3)}}else null===(p=T.current)||void 0===p||p.delayHidden();var p}}(M,A,B,a,F,W,j);v.useImperativeHandle(t,(function(){return{scrollTo:ae}})),qn((function(){if(y){var e=A.slice(G,Y+1);y(e,A)}}),[G,Y,A]);var le=function(e,t,n,r,o,i){var a=i.getKey;return e.slice(t,n+1).map((function(e,n){var i=o(e,t+n,{}),l=a(e);return v.createElement(Ds,{key:l,setRef:function(t){return r(e,t)}},i)}))}(A,G,Y,H,f,I),ce=null;return i&&(ce=Qs(Zs({},c?"height":"maxHeight",i),nu),w&&(ce.overflowY="hidden",O&&(ce.pointerEvents="none"))),v.createElement("div",Ys({style:Qs(Qs({},s),{},{position:"relative"}),className:P},b),v.createElement(h,{className:"".concat(r,"-holder"),style:ce,ref:M,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==E&&j(t),null==g||g(e)}},v.createElement(Ns,{prefixCls:r,height:K,offset:X,onInnerResize:W,ref:R},le)),w&&v.createElement(_s,{ref:T,prefixCls:r,scrollTop:E,height:i,scrollHeight:K,count:A.length,onScroll:function(e){j(e)},onStartMove:function(){N(!0)},onStopMove:function(){N(!1)}}))}var ou=v.forwardRef(ru);ou.displayName="List";var iu=ou,au=v.createContext(null),lu=["disabled","title","children","style","className"];function cu(e){return"string"==typeof e||"number"==typeof e}var su=function(t,n){var r=v.useContext(os),o=r.prefixCls,i=r.id,a=r.open,l=r.multiple,c=r.mode,s=r.searchValue,u=r.toggleOpen,f=r.notFoundContent,d=r.onPopupScroll,p=v.useContext(au),m=p.flattenOptions,h=p.onActiveValue,g=p.defaultActiveFirstOption,y=p.onSelect,b=p.menuItemSelectedIcon,w=p.rawValues,C=p.fieldNames,x=p.virtual,E=p.listHeight,k=p.listItemHeight,S="".concat(o,"-item"),O=pe((function(){return m}),[a,m],(function(e,t){return t[0]&&e[1]!==t[1]})),N=v.useRef(null),P=function(e){e.preventDefault()},A=function(e){N.current&&N.current.scrollTo("number"==typeof e?{index:e}:e)},M=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=O.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];F(e);var n={source:t?"keyboard":"mouse"},r=O[e];r?h(r.value,e,n):h(null,-1,n)};(0,v.useEffect)((function(){I(!1!==g?M(0):-1)}),[O.length,s]);var _=v.useCallback((function(e){return w.has(e)&&"combobox"!==c}),[c,bi(w).toString()]);(0,v.useEffect)((function(){var e,t=setTimeout((function(){if(!l&&a&&1===w.size){var e=Array.from(w)[0],t=O.findIndex((function(t){return t.data.value===e}));-1!==t&&(I(t),A(t))}}));return a&&(null===(e=N.current)||void 0===e||e.scrollTo(void 0)),function(){return clearTimeout(t)}}),[a,s]);var D=function(e){void 0!==e&&y(e,{selected:!w.has(e)}),l||u(!1)};if(v.useImperativeHandle(n,(function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case dc.N:case dc.P:case dc.UP:case dc.DOWN:var r=0;if(t===dc.UP?r=-1:t===dc.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===dc.N?r=1:t===dc.P&&(r=-1)),0!==r){var o=M(T+r,r);A(o),I(o,!0)}break;case dc.ENTER:var i=O[T];i&&!i.data.disabled?D(i.value):D(void 0),a&&e.preventDefault();break;case dc.ESC:u(!1),a&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){A(e)}}})),0===O.length)return v.createElement("div",{role:"listbox",id:"".concat(i,"_list"),className:"".concat(S,"-empty"),onMouseDown:P},f);var V=Object.keys(C).map((function(e){return C[e]})),L=function(e){return e.label},H=function(t){var n=O[t];if(!n)return null;var r=n.data||{},o=r.value,a=n.group,l=kc(r,!0),c=L(n);return n?v.createElement("div",e({"aria-label":"string"!=typeof c||a?null:c},l,{key:t,role:a?"presentation":"option",id:"".concat(i,"_list_").concat(t),"aria-selected":_(o)}),o):null};return v.createElement(v.Fragment,null,v.createElement("div",{role:"listbox",id:"".concat(i,"_list"),style:{height:0,width:0,overflow:"hidden"}},H(T-1),H(T),H(T+1)),v.createElement(iu,{itemKey:"key",ref:N,data:O,height:E,itemHeight:k,fullHeight:!1,onMouseDown:P,onScroll:d,virtual:x},(function(t,n){var r,o=t.group,i=t.groupOption,a=t.data,l=t.label,c=t.value,s=a.key;if(o){var u,f=null!==(u=a.title)&&void 0!==u?u:cu(l)?l.toString():void 0;return v.createElement("div",{className:$()(S,"".concat(S,"-group")),title:f},void 0!==l?l:s)}var d=a.disabled,p=a.title,m=(a.children,a.style),h=a.className,g=Hr(q(a,lu),V),y=_(c),w="".concat(S,"-option"),C=$()(S,w,h,(j(r={},"".concat(w,"-grouped"),i),j(r,"".concat(w,"-active"),T===n&&!d),j(r,"".concat(w,"-disabled"),d),j(r,"".concat(w,"-selected"),y),r)),x=L(t),E=!b||"function"==typeof b||y,k="number"==typeof x?x:x||c,O=cu(k)?k.toString():void 0;return void 0!==p&&(O=p),v.createElement("div",e({},kc(g),{"aria-selected":y,className:C,title:O,onMouseMove:function(){T===n||d||I(n)},onClick:function(){d||D(c)},style:m}),v.createElement("div",{className:"".concat(w,"-content")},k),v.isValidElement(b)||y,E&&v.createElement(Bc,{className:"".concat(S,"-option-state"),customizeIcon:b,customizeIconProps:{isSelected:y}},y?"✓":null))})))},uu=v.forwardRef(su);uu.displayName="OptionList";var fu=uu,du=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],pu=["inputValue"],mu=v.forwardRef((function(t,n){var r=t.id,o=t.mode,i=t.prefixCls,a=void 0===i?"rc-select":i,l=t.backfill,c=t.fieldNames,s=t.inputValue,u=t.searchValue,f=t.onSearch,d=t.autoClearSearchValue,p=void 0===d||d,m=t.onSelect,h=t.onDeselect,g=t.dropdownMatchSelectWidth,y=void 0===g||g,b=t.filterOption,w=t.filterSort,C=t.optionFilterProp,x=t.optionLabelProp,E=t.options,k=t.children,S=t.defaultActiveFirstOption,O=t.menuItemSelectedIcon,N=t.virtual,P=t.listHeight,A=void 0===P?200:P,M=t.listItemHeight,R=void 0===M?20:M,T=t.value,F=t.defaultValue,I=t.labelInValue,_=t.onChange,D=q(t,du),V=function(e){var t=z(v.useState(),2),n=t[0],r=t[1];return v.useEffect((function(){var e;r("rc_select_".concat((ds?(e=fs,fs+=1):e="TEST_OR_SSR",e)))}),[]),e||n}(r),L=ls(o),H=!(E||!k),$=v.useMemo((function(){return(void 0!==b||"combobox"!==o)&&b}),[b,o]),B=v.useMemo((function(){return mc(c,H)}),[JSON.stringify(c),H]),K=z(br("",{value:void 0!==u?u:s,postState:function(e){return e||""}}),2),G=K[0],Y=K[1],X=gs(E,k,B,C,x),Q=X.valueOptions,Z=X.labelOptions,J=X.options,ee=v.useCallback((function(e){return Gc(e).map((function(e){var t,n,r,o,i;!function(e){return!e||"object"!==W(e)}(e)?(r=e.key,n=e.label,t=null!==(i=e.value)&&void 0!==i?i:r):t=e;var a,l=Q.get(t);return l&&(void 0===n&&(n=null==l?void 0:l[x||B.label]),void 0===r&&(r=null!==(a=null==l?void 0:l.key)&&void 0!==a?a:t),o=null==l?void 0:l.disabled),{label:n,value:t,key:r,disabled:o}}))}),[B,x,Q]),te=z(br(F,{value:T}),2),ne=te[0],re=te[1],oe=function(e,t){var n=v.useRef({values:new Map,options:new Map});return[v.useMemo((function(){var r=n.current,o=r.values,i=r.options,a=e.map((function(e){var t;return void 0===e.label?U(U({},e),{},{label:null===(t=o.get(e.value))||void 0===t?void 0:t.label}):e})),l=new Map,c=new Map;return a.forEach((function(e){l.set(e.value,e),c.set(e.value,t.get(e.value)||i.get(e.value))})),n.current.values=l,n.current.options=c,a}),[e,t]),v.useCallback((function(e){return t.get(e)||n.current.options.get(e)}),[t])]}(v.useMemo((function(){var e,t=ee(ne);return"combobox"!==o||(null===(e=t[0])||void 0===e?void 0:e.value)?t:[]}),[ne,ee,o]),Q),ie=z(oe,2),ae=ie[0],le=ie[1],ce=v.useMemo((function(){if(!o&&1===ae.length){var e=ae[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return ae.map((function(e){var t;return U(U({},e),{},{label:null!==(t=e.label)&&void 0!==t?t:e.value})}))}),[o,ae]),se=v.useMemo((function(){return new Set(ae.map((function(e){return e.value})))}),[ae]);v.useEffect((function(){if("combobox"===o){var e,t=null===(e=ae[0])||void 0===e?void 0:e.value;null!=t&&Y(String(t))}}),[ae]);var ue=ys((function(e,t){var n,r=null!=t?t:e;return j(n={},B.value,e),j(n,B.label,r),n})),fe=v.useMemo((function(){if("tags"!==o)return J;var e=bi(J);return bi(ae).sort((function(e,t){return e.value1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,o=[],i=mc(n,!1),a=i.label,l=i.value,c=i.options;function s(e,t){e.forEach((function(e){var n=e[a];if(t||!(c in e)){var i=e[l];o.push({key:pc(e,o.length),groupOption:t,data:e,label:n,value:i})}else{var u=n;void 0===u&&r&&(u=e.label),o.push({key:pc(e,o.length),group:!0,data:e,label:u}),s(e[c],!0)}}))}return s(e,!1),o}(me,{fieldNames:B,childrenAsData:H})}),[me,B,H]),he=function(e){var t=ee(e);if(re(t),_&&(t.length!==ae.length||t.some((function(e,t){var n;return(null===(n=ae[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)})))){var n=I?t:t.map((function(e){return e.value})),r=t.map((function(e){return vc(le(e.value))}));_(L?n:n[0],L?r:r[0])}},ge=z(v.useState(null),2),ye=ge[0],be=ge[1],we=z(v.useState(0),2),Ce=we[0],xe=we[1],Ee=void 0!==S?S:"combobox"!==o,ke=v.useCallback((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.source,i=void 0===r?"keyboard":r;xe(t),l&&"combobox"===o&&null!==e&&"keyboard"===i&&be(String(e))}),[l,o]),Se=function(e,t){var n=function(){var t,n=le(e);return[I?{label:null==n?void 0:n[B.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,vc(n)]};if(t&&m){var r=z(n(),2),o=r[0],i=r[1];m(o,i)}else if(!t&&h){var a=z(n(),2),l=a[0],c=a[1];h(l,c)}},Oe=ys((function(e,t){var n,r=!L||t.selected;n=r?L?[].concat(bi(ae),[e]):[e]:ae.filter((function(t){return t.value!==e})),he(n),Se(e,r),"combobox"===o?be(""):ls&&!p||(Y(""),be(""))})),Ne=v.useMemo((function(){var e=!1!==N&&!1!==y;return U(U({},X),{},{flattenOptions:ve,onActiveValue:ke,defaultActiveFirstOption:Ee,onSelect:Oe,menuItemSelectedIcon:O,rawValues:se,fieldNames:B,virtual:e,listHeight:A,listItemHeight:R,childrenAsData:H})}),[X,ve,ke,Ee,Oe,O,se,B,N,y,A,R,H]);return v.createElement(au.Provider,{value:Ne},v.createElement(ss,e({},D,{id:V,prefixCls:a,ref:n,omitDomProps:pu,mode:o,displayValues:ce,onDisplayValuesChange:function(e,t){he(e),"remove"!==t.type&&"clear"!==t.type||t.values.forEach((function(e){Se(e.value,!1)}))},searchValue:G,onSearch:function(e,t){if(Y(e),be(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===o&&he(e),null==f||f(e));else{var n=(e||"").trim();if(n){var r=Array.from(new Set([].concat(bi(se),[n])));he(r),Se(n,!0),Y("")}}},onSearchSplit:function(e){var t=e;"tags"!==o&&(t=e.map((function(e){var t=Z.get(e);return null==t?void 0:t.value})).filter((function(e){return void 0!==e})));var n=Array.from(new Set([].concat(bi(se),bi(t))));he(n),n.forEach((function(e){Se(e,!0)}))},dropdownMatchSelectWidth:y,OptionList:fu,emptyOptions:!ve.length,activeValue:ye,activeDescendantId:"".concat(V,"_list_").concat(Ce)})))})),vu=mu;vu.Option=xs,vu.OptGroup=ws;var hu=vu,gu=(0,v.createContext)(void 0),yu={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},bu={lang:e({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"}),timePickerLocale:e({},yu)},wu="${label} is not a valid ${type}",Cu={locale:"en",Pagination:{items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},DatePicker:bu,TimePicker:yu,Calendar:bu,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No Data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},PageHeader:{back:"Back"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:wu,method:wu,array:wu,object:wu,number:wu,date:wu,boolean:wu,integer:wu,float:wu,regexp:wu,email:wu,url:wu,hex:wu},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"}},xu=Cu,Eu=function(t){Z(r,t);var n=te(r);function r(){return K(this,r),n.apply(this,arguments)}return Y(r,[{key:"getLocale",value:function(){var t=this.props,n=t.componentName,r=t.defaultLocale||xu[null!=n?n:"global"],o=this.context,i=n&&o?o[n]:{};return e(e({},r instanceof Function?r():r),i||{})}},{key:"getLocaleCode",value:function(){var e=this.context,t=e&&e.locale;return e&&e.exist&&!t?xu.locale:t}},{key:"render",value:function(){return this.props.children(this.getLocale(),this.getLocaleCode(),this.context)}}]),r}(v.Component);Eu.defaultProps={componentName:"global"},Eu.contextType=gu;var ku=function(){var e=(0,v.useContext(wr).getPrefixCls)("empty-img-default");return v.createElement("svg",{className:e,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("g",{transform:"translate(24 31.67)"},v.createElement("ellipse",{className:"".concat(e,"-ellipse"),cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),v.createElement("path",{className:"".concat(e,"-path-1"),d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),v.createElement("path",{className:"".concat(e,"-path-2"),d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",transform:"translate(13.56)"}),v.createElement("path",{className:"".concat(e,"-path-3"),d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),v.createElement("path",{className:"".concat(e,"-path-4"),d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),v.createElement("path",{className:"".concat(e,"-path-5"),d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),v.createElement("g",{className:"".concat(e,"-g"),transform:"translate(149.65 15.383)"},v.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),v.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},Su=function(){var e=(0,v.useContext(wr).getPrefixCls)("empty-img-simple");return v.createElement("svg",{className:e,width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},v.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},v.createElement("ellipse",{className:"".concat(e,"-ellipse"),cx:"32",cy:"33",rx:"32",ry:"7"}),v.createElement("g",{className:"".concat(e,"-g"),fillRule:"nonzero"},v.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),v.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",className:"".concat(e,"-path")}))))},Ou=v.createElement(ku,null),Nu=v.createElement(Su,null),Pu=function(t){var n=t.className,r=t.prefixCls,o=t.image,i=void 0===o?Ou:o,a=t.description,l=t.children,c=t.imageStyle,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const[n,r]=Yu(!0),{definition:o}=e,{argValue:i,arg:a,styleConfig:l}=e,c=M(a.type);let s=null;if(i)if("Variable"===i.kind)s=(0,t.createElement)("span",{style:{color:l.colors.variable}},"$",i.name.value);else if(qu(c))s="Boolean"===c.name?(0,t.createElement)(Wu,{getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],size:"small",style:{color:l.colors.builtin,minHeight:"16px",minWidth:"16ch"},onChange:t=>{const n={target:{value:t}};e.setArgValue(n)},value:"BooleanValue"===i.kind?i.value:void 0},(0,t.createElement)(Wu.Option,{key:"true",value:"true"},"true"),(0,t.createElement)(Wu.Option,{key:"false",value:"false"},"false")):(0,t.createElement)(ac,{setArgValue:e.setArgValue,arg:a,argValue:i,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig});else if(Bu(c))"EnumValue"===i.kind?s=(0,t.createElement)(Wu,{size:"small",getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],style:{backgroundColor:"white",minHeight:"16px",minWidth:"20ch",color:l.colors.string2},onChange:t=>{const n={target:{value:t}};e.setArgValue(n)},value:i.value},c.getValues().map(((e,n)=>(0,t.createElement)(Wu.Option,{key:n,value:e.name},e.name)))):console.error("arg mismatch between arg and selection",c,i);else if(Uu(c))if("ObjectValue"===i.kind){const n=c.getFields();s=(0,t.createElement)("div",{style:{marginLeft:16}},Object.keys(n).sort().map((r=>(0,t.createElement)(uc,{key:r,arg:n[r],parentField:e.parentField,selection:i,modifyFields:e.setArgFields,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition}))))}else console.error("arg mismatch between arg and selection",c,i);const u=i&&"Variable"===i.kind,f=void 0!==o.name&&i?(0,t.createElement)(zr,{getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],title:u?"Remove the variable":"Extract the current value into a GraphQL variable"},(0,t.createElement)(hi,{type:u?"danger":"default",size:"small",className:"toolbar-button",title:u?"Remove the variable":"Extract the current value into a GraphQL variable",onClick:t=>{t.preventDefault(),t.stopPropagation(),u?(()=>{if(!i||!i.name||!i.name.value)return;const t=i.name.value,n=(e.definition.variableDefinitions||[]).find((e=>e.variable.name.value===t));if(!n)return;const r=n.defaultValue,o=e.setArgValue(r,{commit:!1});if(o){const n=o.definitions.find((t=>t.name.value===e.definition.name.value));if(!n)return;let r=0;Gu(n,{Variable(e){e.name.value===t&&(r+=1)}});let i=n.variableDefinitions||[];r<2&&(i=i.filter((e=>e.variable.name.value!==t)));const a={...n,variableDefinitions:i},l=o.definitions.map((e=>n===e?a:e)),c={...o,definitions:l};e.onCommit(c)}})():(()=>{const t=a.name,n=(e.definition.variableDefinitions||[]).filter((e=>e.variable.name.value.startsWith(t))).length;let r;r=n>0?`${t}${n}`:t;const o=a.type.toString(),l={kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:r}},type:Ku(o),directives:[]};let c,s={};if(null!=i){const t=Gu(i,{Variable(t){const n=t.name.value,r=(o=n,(e.definition.variableDefinitions||[]).find((e=>e.variable.name.value===o)));var o;if(s[n]=s[n]+1||1,r)return r.defaultValue}});c={..."NonNullType"===l.type.kind?{...l,type:l.type.type}:l,defaultValue:t}}else c=l;const u=Object.entries(s).filter((e=>{let[t,n]=e;return n<2})).map((e=>{let[t,n]=e;return t}));if(c){const t=e.setArgValue(c,!1);if(t){const n=t.definitions.find((t=>!!(t.operation&&t.name&&t.name.value&&e.definition.name&&e.definition.name.value)&&t.name.value===e.definition.name.value)),r=[...(null==n?void 0:n.variableDefinitions)||[],c].filter((e=>-1===u.indexOf(e.variable.name.value))),o={...n,variableDefinitions:r},i=t.definitions.map((e=>n===e?o:e)),a={...t,definitions:i};e.onCommit(a)}}})()}},(0,t.createElement)("span",{style:{color:u?"inherit":l.colors.variable}},"$"))):null;return(0,t.createElement)("div",{style:{cursor:"pointer",minHeight:"20px",WebkitUserSelect:"none",userSelect:"none"},"data-arg-name":a.name,"data-arg-type":c.name,className:`graphiql-explorer-${a.name}`},(0,t.createElement)("span",{style:{cursor:"pointer"},onClick:t=>{const n=!i;n?e.addArg(!0):e.removeArg(!0),r(n)}},Uu(c)?(0,t.createElement)("span",null,i?e.styleConfig.arrowOpen:e.styleConfig.arrowClosed):(0,t.createElement)(gi,{checked:!!i,styleConfig:e.styleConfig}),(0,t.createElement)("span",{style:{color:l.colors.attribute},title:a.description,onMouseEnter:()=>{null!=i&&r(!0)},onMouseLeave:()=>r(!0)},a.name,P(a)?"*":"",": ",f," ")," "),s||(0,t.createElement)("span",null)," ")};const{isInputObjectType:Qu,isLeafType:Zu}=wpGraphiQL.GraphQL;var Ju=e=>{let n;const r=()=>{const{selection:t}=e;return(t.arguments||[]).find((t=>t.name.value===e.arg.name))},{arg:o,parentField:i}=e,a=r();return(0,t.createElement)(Xu,{argValue:a?a.value:null,arg:o,parentField:i,addArg:t=>{const{selection:r,getDefaultScalarArgValue:o,makeDefaultArg:i,parentField:a,arg:l}=e,c=M(l.type);let s=null;if(n)s=n;else if(Qu(c)){const e=c.getFields();s={kind:"Argument",name:{kind:"Name",value:l.name},value:{kind:"ObjectValue",fields:T(o,i,a,Object.keys(e).map((t=>e[t])))}}}else Zu(c)&&(s={kind:"Argument",name:{kind:"Name",value:l.name},value:o(a,l,c)});return s?e.modifyArguments([...r.arguments||[],s],t):(console.error("Unable to add arg for argType",c),null)},removeArg:t=>{const{selection:o}=e,i=r();return n=r(),e.modifyArguments((o.arguments||[]).filter((e=>e!==i)),t)},setArgFields:(t,n)=>{const{selection:o}=e,i=r();if(i)return e.modifyArguments((o.arguments||[]).map((e=>e===i?{...e,value:{kind:"ObjectValue",fields:t}}:e)),n);console.error("missing arg selection when setting arg value")},setArgValue:(t,n)=>{let o=!1,i=!1,a=!1;try{"VariableDefinition"===t.kind?i=!0:null==t?o=!0:"string"==typeof t.kind&&(a=!0)}catch(e){}const{selection:l}=e,c=r();if(!c&&!i)return void console.error("missing arg selection when setting arg value");const s=M(e.arg.type);if(!(Zu(s)||i||o||a))return void console.warn("Unable to handle non leaf types in ArgView._setArgValue");let u,f;return null==t?f=null:t.target&&"string"==typeof t.target.value?(u=t.target.value,f=R(s,u)):t.target||"VariableDefinition"!==t.kind?"string"==typeof t.kind&&(f=t):(u=t,f=u.variable),e.modifyArguments((l.arguments||[]).map((e=>e===c?{...e,value:f}:e)),n)},getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition})},ef={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},tf=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:ef}))};tf.displayName="LinkOutlined";var nf=v.forwardRef(tf),rf=e=>{let n;const r=()=>e.selections.find((t=>"FragmentSpread"===t.kind&&t.name.value===e.fragment.name.value)),{styleConfig:o}=e,i=r();return(0,t.createElement)("div",{className:`graphiql-explorer-${e.fragment.name.value}`},(0,t.createElement)("span",{style:{cursor:"pointer"},onClick:i?()=>{const t=r();n=t,e.modifySelections(e.selections.filter((t=>!("FragmentSpread"===t.kind&&t.name.value===e.fragment.name.value))))}:()=>{e.modifySelections([...e.selections,n||{kind:"FragmentSpread",name:e.fragment.name}])}},(0,t.createElement)(gi,{checked:!!i,styleConfig:e.styleConfig}),(0,t.createElement)("span",{style:{color:o.colors.def},className:`graphiql-explorer-${e.fragment.name.value}`},e.fragment.name.value),(0,t.createElement)(zr,{getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],title:`Edit the ${e.fragment.name.value} Fragment`},(0,t.createElement)(hi,{style:{height:"18px",margin:"0px 5px"},title:`Edit the ${e.fragment.name.value} Fragment`,type:"primary",size:"small",onClick:t=>{t.preventDefault(),t.stopPropagation();const n=window.document.getElementById(`collapse-wrap-fragment-${e.fragment.name.value}`);n&&n.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},icon:(0,t.createElement)(nf,null)}))))},of=e=>{let n;const r=()=>{const t=e.selections.find((t=>"InlineFragment"===t.kind&&t.typeCondition&&e.implementingType.name===t.typeCondition.name.value));return t?"InlineFragment"===t.kind?t:void 0:null},o=(t,n)=>{const o=r();return e.modifySelections(e.selections.map((n=>n===o?{directives:n.directives,kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:t}}:n)),n)},{implementingType:i,schema:a,getDefaultFieldNames:l,styleConfig:c}=e,s=r(),u=i.getFields(),f=s&&s.selectionSet?s.selectionSet.selections:[];return(0,t.createElement)("div",{className:`graphiql-explorer-${i.name}`},(0,t.createElement)("span",{style:{cursor:"pointer"},onClick:s?()=>{const t=r();n=t,e.modifySelections(e.selections.filter((e=>e!==t)))}:()=>{e.modifySelections([...e.selections,n||{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:e.getDefaultFieldNames(e.implementingType).map((e=>({kind:"Field",name:{kind:"Name",value:e}})))}}])}},(0,t.createElement)(gi,{checked:!!s,styleConfig:e.styleConfig}),(0,t.createElement)("span",{style:{color:c.colors.atom}},e.implementingType.name)),s?(0,t.createElement)("div",{style:{marginLeft:16}},Object.keys(u).sort().map((n=>(0,t.createElement)(vf,{key:n,field:u[n],selections:f,modifySelections:o,schema:a,getDefaultFieldNames:l,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,onCommit:e.onCommit,styleConfig:e.styleConfig,definition:e.definition,availableFragments:e.availableFragments})))):null)},af={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},lf=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:af}))};lf.displayName="EllipsisOutlined";var cf=v.forwardRef(lf);const{getNamedType:sf,isInterfaceType:uf,isObjectType:ff,isUnionType:df}=wpGraphiQL.GraphQL,{useState:pf}=wp.element,mf=e=>{const[n,r]=pf(!1);let o;const i=()=>{const t=e.selections.find((t=>"Field"===t.kind&&e.field.name===t.name.value));return t?"Field"===t.kind?t:void 0:null},a=(t,n)=>{const r=i();if(r)return e.modifySelections(e.selections.map((e=>e===r?{alias:r.alias,arguments:t,directives:r.directives,kind:"Field",name:r.name,selectionSet:r.selectionSet}:e)),n);console.error("Missing selection when setting arguments",t)},l=(t,n)=>e.modifySelections(e.selections.map((n=>{if("Field"===n.kind&&e.field.name===n.name.value){if("Field"!==n.kind)throw new Error("invalid selection");return{alias:n.alias,arguments:n.arguments,directives:n.directives,kind:"Field",name:n.name,selectionSet:{kind:"SelectionSet",selections:t}}}return n})),n),{field:c,schema:s,getDefaultFieldNames:u,styleConfig:f}=e,d=i(),p=A(c.type),m=c.args.sort(((e,t)=>e.name.localeCompare(t.name)));let v=`graphiql-explorer-node graphiql-explorer-${c.name}`;c.isDeprecated&&(v+=" graphiql-explorer-deprecated");const h=ff(p)||uf(p)||df(p)?e.availableFragments&&e.availableFragments[p.name]:null,g=d&&d.selectionSet?d.selectionSet.selections:[],y=(0,t.createElement)("div",{className:v},(0,t.createElement)("span",{title:c.description,style:{cursor:"pointer",display:"inline-flex",alignItems:"center",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-field-name":c.name,"data-field-type":p.name,onClick:t=>{if(i()&&!t.altKey)(()=>{const t=i();o=t,e.modifySelections(e.selections.filter((e=>e!==t)))})();else{const n=sf(e.field.type),r=ff(n)&&n.getFields();r&&t.altKey?(t=>{const n={kind:"SelectionSet",selections:t?Object.keys(t).map((e=>({kind:"Field",name:{kind:"Name",value:e},arguments:[]}))):[]},r=[...e.selections.filter((t=>"InlineFragment"===t.kind||t.name.value!==e.field.name)),{kind:"Field",name:{kind:"Name",value:e.field.name},arguments:F(e.getDefaultScalarArgValue,e.makeDefaultArg,e.field),selectionSet:n}];e.modifySelections(r)})(r):(t=>{const n=[...e.selections,o||{kind:"Field",name:{kind:"Name",value:e.field.name},arguments:F(e.getDefaultScalarArgValue,e.makeDefaultArg,e.field)}];e.modifySelections(n)})()}},onMouseEnter:()=>{ff(p)&&d&&d.selectionSet&&d.selectionSet.selections.filter((e=>"FragmentSpread"!==e.kind)).length>0&&r(!0)},onMouseLeave:()=>r(!1)},ff(p)?(0,t.createElement)("span",null,d?e.styleConfig.arrowOpen:e.styleConfig.arrowClosed):null,ff(p)?null:(0,t.createElement)(gi,{checked:!!d,styleConfig:e.styleConfig}),(0,t.createElement)("span",{style:{color:f.colors.property},className:"graphiql-explorer-field-view"},c.name),n?(0,t.createElement)(zr,{getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],title:"Extract selections into a new reusable fragment"},(0,t.createElement)(hi,{size:"small",type:"primary",title:"Extract selections into a new reusable fragment",onClick:t=>{t.preventDefault(),t.stopPropagation();let n=`${p.name}Fragment`;const o=(h||[]).filter((e=>e.name.value.startsWith(n))).length;o>0&&(n=`${n}${o}`);const i=[{kind:"FragmentSpread",name:{kind:"Name",value:n},directives:[]}],a={kind:"FragmentDefinition",name:{kind:"Name",value:n},typeCondition:{kind:"NamedType",name:{kind:"Name",value:p.name}},directives:[],selectionSet:{kind:"SelectionSet",selections:g}},c=l(i,!1);if(c){const t={...c,definitions:[...c.definitions,a]};e.onCommit(t)}else console.warn("Unable to complete extractFragment operation");r(!1)},icon:(0,t.createElement)(cf,null),style:{height:"18px",margin:"0px 5px"}})):null),d&&m.length?(0,t.createElement)("div",{style:{marginLeft:16},className:"graphiql-explorer-graphql-arguments"},m.map((n=>(0,t.createElement)(Ju,{key:n.name,parentField:c,arg:n,selection:d,modifyArguments:a,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition})))):null);if(d){const n=A(p),r=n&&"getFields"in n?n.getFields():null;if(r)return(0,t.createElement)("div",{className:`graphiql-explorer-${c.name}`},y,(0,t.createElement)("div",{style:{marginLeft:16}},h?h.map((n=>{const r=s.getType(n.typeCondition.name.value),o=n.name.value;return r?(0,t.createElement)(rf,{key:o,fragment:n,selections:g,modifySelections:l,schema:s,styleConfig:e.styleConfig,onCommit:e.onCommit}):null})):null,Object.keys(r).sort().map((n=>(0,t.createElement)(mf,{key:n,field:r[n],selections:g,modifySelections:l,schema:s,getDefaultFieldNames:u,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition,availableFragments:e.availableFragments}))),uf(p)||df(p)?s.getPossibleTypes(p).map((n=>(0,t.createElement)(of,{key:n.name,implementingType:n,selections:g,modifySelections:l,schema:s,getDefaultFieldNames:u,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition}))):null));if(df(p))return(0,t.createElement)("div",{className:`graphiql-explorer-${c.name}`},y,(0,t.createElement)("div",{style:{marginLeft:16}},s.getPossibleTypes(p).map((n=>(0,t.createElement)(of,{key:n.name,implementingType:n,selections:g,modifySelections:l,schema:s,getDefaultFieldNames:u,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition})))))}return y};var vf=mf,hf=n(9864),gf=function(e){function t(e,r,c,s,d){for(var p,m,v,h,w,x=0,E=0,k=0,S=0,O=0,T=0,I=v=p=0,_=0,D=0,V=0,L=0,z=c.length,H=z-1,$="",W="",B="",U="";_p)&&(L=($=$.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(h,"$1"+e.trim());case 58:return e.trim()+t.replace(h,"$1"+e.trim());default:if(0<1*n&&0c.charCodeAt(8))break;case 115:a=a.replace(c,"-webkit-"+c)+";"+a;break;case 207:case 102:a=a.replace(c,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var jf=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&If(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i=Vf&&(Vf=t+1),_f.set(e,t),Df.set(t,e)},$f="style["+Rf+'][data-styled-version="5.3.5"]',Wf=new RegExp("^"+Rf+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),Bf=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(Rf))return r}}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(Rf,"active"),r.setAttribute("data-styled-version","5.3.5");var a=qf();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},Gf=function(){function e(e){var t=this.element=Kf(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(s+=e+",")})),r+=""+l+c+'{content:"'+s+'"}/*!sc*/\n'}}}return r}(this)},e}(),ed=/(a)(d)/gi,td=function(e){return String.fromCharCode(e+(e>25?39:97))};function nd(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=td(t%52)+n;return(td(t%52)+n).replace(ed,"$1-$2")}var rd=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},od=function(e){return rd(5381,e)};function id(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var l=n(i,"."+a,void 0,r);t.insertRules(r,a,l)}o.push(a),this.staticRulesId=a}else{for(var c=this.rules.length,s=rd(this.baseHash,n.hash),u="",f=0;f>>0);if(!t.hasNameForId(r,v)){var h=n(u,"."+v,void 0,r);t.insertRules(r,v,h)}o.push(v)}}return o.join(" ")},e}(),cd=/^\s*\/\/.*$/gm,sd=[":","[",".","#"];function ud(e){var t,n,r,o,i=void 0===e?Nf:e,a=i.options,l=void 0===a?Nf:a,c=i.plugins,s=void 0===c?Of:c,u=new gf(l),f=[],d=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,i,a,l,c,s,u,f){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===s)return r+"/*|*/";break;case 3:switch(s){case 102:case 112:return e(o[0]+r),"";default:return r+(0===f?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),p=function(e,r,i){return 0===r&&-1!==sd.indexOf(i[n.length])||i.match(o)?e:"."+t};function m(e,i,a,l){void 0===l&&(l="&");var c=e.replace(cd,""),s=i&&a?a+" "+i+" { "+c+" }":c;return t=l,n=i,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),u(a||!i?"":i,s)}return u.use([].concat(s,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,p))},d,function(e){if(-2===e){var t=f;return f=[],t}}])),m.hash=s.length?s.reduce((function(e,t){return t.name||If(15),rd(e,t.name)}),5381).toString():"",m}var fd=h().createContext(),dd=(fd.Consumer,h().createContext()),pd=(dd.Consumer,new Jf),md=ud();function vd(){return(0,v.useContext)(fd)||pd}function hd(e){var t=(0,v.useState)(e.stylisPlugins),n=t[0],r=t[1],o=vd(),i=(0,v.useMemo)((function(){var t=o;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),a=(0,v.useMemo)((function(){return ud({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,v.useEffect)((function(){Bl()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),h().createElement(fd.Provider,{value:i},h().createElement(dd.Provider,{value:a},e.children))}var gd=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=md);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return If(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=md),this.name+e.hash},e}(),yd=/([A-Z])/,bd=/([A-Z])/g,wd=/^ms-/,Cd=function(e){return"-"+e.toLowerCase()};function xd(e){return yd.test(e)?e.replace(bd,Cd).replace(wd,"-ms-"):e}var Ed=function(e){return null==e||!1===e||""===e};function kd(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,l=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,Pd=/(^-|-$)/g;function Ad(e){return e.replace(Nd,"-").replace(Pd,"")}function Md(e){return"string"==typeof e&&!0}var Rd=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Td=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Fd(e,t,n){var r=e[n];Rd(t)&&Rd(r)?Id(r,t):e[n]=t}function Id(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r>>0)}("5.3.5"+n+_d[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):l,s=t.displayName,u=void 0===s?function(e){return Md(e)?"styled."+e:"Styled("+Af(e)+")"}(e):s,f=t.displayName&&t.componentId?Ad(t.displayName)+"-"+t.componentId:t.componentId||c,d=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,p=t.shouldForwardProp;r&&e.shouldForwardProp&&(p=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var m,g=new ld(n,f,r?e.componentStyle:void 0),y=g.isStatic&&0===a.length,b=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,l=e.foldedComponentIds,c=e.shouldForwardProp,s=e.styledComponentId,u=e.target,f=function(e,t,n){void 0===e&&(e=Nf);var r=Ef({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,i,a=e;for(t in Pf(a)&&(a=a(r)),a)r[t]=o[t]="className"===t?(n=o[t],i=a[t],n&&i?n+" "+i:n||i):a[t]})),[r,o]}(function(e,t,n){return void 0===n&&(n=Nf),e.theme!==n.theme&&e.theme||t||n.theme}(t,(0,v.useContext)(jd),a)||Nf,t,o),d=f[0],p=f[1],m=function(e,t,n,r){var o=vd(),i=(0,v.useContext)(dd)||md;return t?e.generateAndInjectStyles(Nf,o,i):e.generateAndInjectStyles(n,o,i)}(i,r,d),h=n,g=p.$as||t.$as||p.as||t.as||u,y=Md(g),b=p!==t?Ef({},t,{},p):t,w={};for(var C in b)"$"!==C[0]&&"as"!==C&&("forwardedAs"===C?w.as=b[C]:(c?c(C,wf,g):!y||wf(C))&&(w[C]=b[C]));return t.style&&p.style!==t.style&&(w.style=Ef({},t.style,{},p.style)),w.className=Array.prototype.concat(l,s,m!==s?m:null,t.className,p.className).filter(Boolean).join(" "),w.ref=h,(0,v.createElement)(g,w)}(m,e,t,y)};return b.displayName=u,(m=h().forwardRef(b)).attrs=d,m.componentStyle=g,m.displayName=u,m.shouldForwardProp=p,m.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):Of,m.styledComponentId=f,m.target=r?e.target:e,m.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(t,["componentId"]),i=r&&r+"-"+(Md(e)?e:Ad(Af(e)));return Dd(e,Ef({},o,{attrs:d,componentId:i}),n)},Object.defineProperty(m,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Id({},e.defaultProps,t):t}}),m.toString=function(){return"."+m.styledComponentId},o&&xf()(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),m}var Vd=function(e){return function e(t,n,r){if(void 0===r&&(r=Nf),!(0,hf.isValidElementType)(n))return If(1,String(n));var o=function(){return t(n,r,Od.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,Ef({},r,{},o))},o.attrs=function(o){return e(t,n,Ef({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Dd,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Vd[e]=Vd(e)})),function(){var e=function(e,t){this.rules=e,this.componentId=t,this.isStatic=id(e),Jf.registerId(this.componentId+1)}.prototype;e.createStyles=function(e,t,n,r){var o=r(kd(this.rules,t,n,r).join(""),""),i=this.componentId+e;n.insertRules(i,i,o)},e.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.renderStyles=function(e,t,n,r){e>2&&Jf.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}(),function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=qf();return""},this.getStyleTags=function(){return e.sealed?If(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return If(2);var n=((t={})[Rf]="",t["data-styled-version"]="5.3.5",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=qf();return r&&(n.nonce=r),[h().createElement("style",Ef({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Jf({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?If(2):h().createElement(hd,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return If(3)}}();var Ld=Vd,zd={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},Hd=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:zd}))};Hd.displayName="CheckCircleOutlined";var $d=v.forwardRef(Hd),Wd={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}},{tag:"path",attrs:{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"close-circle",theme:"outlined"},Bd=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Wd}))};Bd.displayName="CloseCircleOutlined";var Ud=v.forwardRef(Bd),qd={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},Kd=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:qd}))};Kd.displayName="ExclamationCircleOutlined";var Gd=v.forwardRef(Kd),Yd={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},Xd=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Yd}))};Xd.displayName="InfoCircleOutlined";var Qd,Zd=v.forwardRef(Xd),Jd=U({},ne),ep=Jd.version,tp=Jd.render,np=Jd.unmountComponentAtNode;try{Number((ep||"").split(".")[0])>=18&&(Qd=Jd.createRoot)}catch(Yh){}function rp(e){var t=Jd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===W(t)&&(t.usingClientEntryPoint=e)}var op="__rc_react_root__";function ip(_x){return ap.apply(this,arguments)}function ap(){return(ap=Yn(Kn().mark((function e(t){return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then((function(){var e;null===(e=t[op])||void 0===e||e.unmount(),delete t[op]})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lp(e){np(e)}function cp(){return(cp=Yn(Kn().mark((function e(t){return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Qd){e.next=2;break}return e.abrupt("return",ip(t));case 2:lp(t);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var sp=function(t){Z(r,t);var n=te(r);function r(){var e;K(this,r);for(var t=arguments.length,o=new Array(t),i=0;i=i&&(o.key=l[0].notice.key,o.updateMark=mp(),o.userPassKey=r,l.shift()),l.push({notice:o,holderCallback:n})),{notices:l}}))},e.remove=function(t){e.setState((function(e){return{notices:e.notices.filter((function(e){var n=e.notice,r=n.key;return(n.userPassKey||r)!==t}))}}))},e.noticePropsMap={},e}return Y(r,[{key:"getTransitionName",value:function(){var e=this.props,t=e.prefixCls,n=e.animation,r=this.props.transitionName;return!r&&n&&(r="".concat(t,"-").concat(n)),r}},{key:"render",value:function(){var t=this,n=this.state.notices,r=this.props,o=r.prefixCls,i=r.className,a=r.closeIcon,l=r.style,c=[];return n.forEach((function(e,r){var i=e.notice,l=e.holderCallback,s=r===n.length-1?i.updateMark:void 0,u=i.key,f=i.userPassKey,d=U(U(U({prefixCls:o,closeIcon:a},i),i.props),{},{key:u,noticeKey:f||u,updateMark:s,onClose:function(e){var n;t.remove(e),null===(n=i.onClose)||void 0===n||n.call(i)},onClick:i.onClick,children:i.content});c.push(u),t.noticePropsMap[u]={props:d,holderCallback:l}})),v.createElement("div",{className:$()(o,i),style:l},v.createElement(ft,{keys:c,motionName:this.getTransitionName(),onVisibleChanged:function(e,n){var r=n.key;e||delete t.noticePropsMap[r]}},(function(n){var r=n.key,i=n.className,a=n.style,l=n.visible,c=t.noticePropsMap[r],s=c.props,u=c.holderCallback;return u?v.createElement("div",{key:r,className:$()(i,"".concat(o,"-hook-holder")),style:U({},a),ref:function(e){void 0!==r&&(e?(t.hookRefs.set(r,e),u(e,s)):t.hookRefs.delete(r))}}):v.createElement(sp,e({},s,{className:$()(i,null==s?void 0:s.className),style:U(U({},a),null==s?void 0:s.style),visible:l}))})))}}]),r}(v.Component);vp.newInstance=void 0,vp.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}},vp.newInstance=function(t,n){var r=t||{},o=r.getContainer,i=q(r,fp),a=document.createElement("div");o?o().appendChild(a):document.body.appendChild(a);var l,c,s=!1;l=v.createElement(vp,e({},i,{ref:function(e){s||(s=!0,n({notice:function(t){e.add(t)},removeNotice:function(t){e.remove(t)},component:e,destroy:function(){!function(e){cp.apply(this,arguments)}(a),a.parentNode&&a.parentNode.removeChild(a)},useNotification:function(){return up(e)}}))}})),c=a,Qd?function(e,t){rp(!0);var n=t[op]||Qd(t);rp(!1),n.render(e),t[op]=n}(l,c):function(e,t){tp(e,t)}(l,c)};var hp=vp,gp=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function yp(e,t){if(e.length!==t.length)return!1;for(var n=0;n>16,g:(65280&e)>>8,b:255&e}}(t)),this.originalInput=t;var o=So(t);this.originalInput=t,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=n.format)&&void 0!==r?r:o.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255;return.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=vo(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var e=wo(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=wo(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this.roundA+")"},e.prototype.toHsl=function(){var e=yo(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=yo(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this.roundA+")"},e.prototype.toHex=function(e){return void 0===e&&(e=!1),Co(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,t,n,r,o){var i,a=[go(Math.round(e).toString(16)),go(Math.round(t).toString(16)),go(Math.round(n).toString(16)),go((i=r,Math.round(255*parseFloat(i)).toString(16)))];return o&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb("+e+", "+t+", "+n+")":"rgba("+e+", "+t+", "+n+", "+this.roundA+")"},e.prototype.toPercentageRgb=function(){var e=function(e){return Math.round(100*po(e,255))+"%"};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*po(e,255))};return 1===this.a?"rgb("+e(this.r)+"%, "+e(this.g)+"%, "+e(this.b)+"%)":"rgba("+e(this.r)+"%, "+e(this.g)+"%, "+e(this.b)+"%, "+this.roundA+")"},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+Co(this.r,this.g,this.b,!1),t=0,n=Object.entries(ko);t=0;return t||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=mo(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=mo(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=mo(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=mo(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var r=this.toRgb(),o=new e(t).toRgb(),i=n/100;return new e({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var r=this.toHsl(),o=360/n,i=[this];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(new e(r));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),r=n.h,o=n.s,i=n.v,a=[],l=1/t;t--;)a.push(new e({h:r,s:o,v:i})),i=(i+l)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,o=[this],i=360/t,a=1;a0&&(E=v.createElement(Ha,{validateMessages:k},o)),c&&(E=v.createElement(xp,{locale:c,_ANT_MARK__:"internalMark"},E)),(g||i)&&(E=v.createElement(fo.Provider,{value:x},E)),s&&(E=v.createElement(qr,{size:s},E)),void 0!==y&&(E=v.createElement(Wr,{disabled:y},E)),v.createElement(wr.Provider,{value:C},E)},om=function(t){return v.useEffect((function(){t.direction&&(Gp.config({rtl:"rtl"===t.direction}),Cm.config({rtl:"rtl"===t.direction}))}),[t.direction]),v.createElement(Eu,null,(function(n,__,r){return v.createElement(Cr,null,(function(n){return v.createElement(rm,e({parentContext:n,legacyLocale:r},t))}))}))};om.ConfigContext=wr,om.SizeContext=Kr,om.config=function(e){var t=e.prefixCls,n=e.iconPrefixCls,r=e.theme;void 0!==t&&(Qp=t),void 0!==n&&(Zp=n),r&&function(e,t){var n=function(e,t){var n={},r=function(e,t){var n=e.clone();return(n=(null==t?void 0:t(n))||n).toRgbString()},o=function(e,t){var o=new Yp(e),i=Vo(o.toRgbString());n["".concat(t,"-color")]=r(o),n["".concat(t,"-color-disabled")]=i[1],n["".concat(t,"-color-hover")]=i[4],n["".concat(t,"-color-active")]=i[7],n["".concat(t,"-color-outline")]=o.clone().setAlpha(.2).toRgbString(),n["".concat(t,"-color-deprecated-bg")]=i[1],n["".concat(t,"-color-deprecated-border")]=i[3]};if(t.primaryColor){o(t.primaryColor,"primary");var i=new Yp(t.primaryColor),a=Vo(i.toRgbString());a.forEach((function(e,t){n["primary-".concat(t+1)]=e})),n["primary-color-deprecated-l-35"]=r(i,(function(e){return e.lighten(35)})),n["primary-color-deprecated-l-20"]=r(i,(function(e){return e.lighten(20)})),n["primary-color-deprecated-t-20"]=r(i,(function(e){return e.tint(20)})),n["primary-color-deprecated-t-50"]=r(i,(function(e){return e.tint(50)})),n["primary-color-deprecated-f-12"]=r(i,(function(e){return e.setAlpha(.12*e.getAlpha())}));var l=new Yp(a[0]);n["primary-color-active-deprecated-f-30"]=r(l,(function(e){return e.setAlpha(.3*e.getAlpha())})),n["primary-color-active-deprecated-d-02"]=r(l,(function(e){return e.darken(2)}))}t.successColor&&o(t.successColor,"success"),t.warningColor&&o(t.warningColor,"warning"),t.errorColor&&o(t.errorColor,"error"),t.infoColor&&o(t.infoColor,"info");var c=Object.keys(n).map((function(t){return"--".concat(e,"-").concat(t,": ").concat(n[t],";")}));return"\n :root {\n ".concat(c.join("\n"),"\n }\n ").trim()}(e,t);ye()&&eo(n,"".concat(Xp,"-dynamic-theme"))}(em(),r)};var im,am,lm,cm=om,sm={},um=4.5,fm=24,dm=24,pm="",mm="topRight",vm=!1;function hm(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fm,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:dm;switch(e){case"top":t={left:"50%",transform:"translateX(-50%)",right:"auto",top:n,bottom:"auto"};break;case"topLeft":t={left:0,top:n,bottom:"auto"};break;case"topRight":t={right:0,top:n,bottom:"auto"};break;case"bottom":t={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:r};break;case"bottomLeft":t={left:0,top:"auto",bottom:r};break;default:t={right:0,top:"auto",bottom:r}}return t}function gm(e,t){var n=e.placement,r=void 0===n?mm:n,o=e.top,i=e.bottom,a=e.getContainer,l=void 0===a?im:a,c=e.prefixCls,s=nm(),u=s.getPrefixCls,f=s.getIconPrefixCls,d=u("notification",c||pm),p=f(),m="".concat(d,"-").concat(r),v=sm[m];if(v)Promise.resolve(v).then((function(e){t({prefixCls:"".concat(d,"-notice"),iconPrefixCls:p,instance:e})}));else{var h=$()("".concat(d,"-").concat(r),j({},"".concat(d,"-rtl"),!0===vm));sm[m]=new Promise((function(e){hp.newInstance({prefixCls:d,className:h,style:hm(r,o,i),getContainer:l,maxCount:lm},(function(n){e(n),t({prefixCls:"".concat(d,"-notice"),iconPrefixCls:p,instance:n})}))}))}}var ym={success:$d,info:Zd,error:Ud,warning:Gd};function bm(e,t,n){var r=e.duration,o=e.icon,i=e.type,a=e.description,l=e.message,c=e.btn,s=e.onClose,u=e.onClick,f=e.key,d=e.style,p=e.className,m=e.closeIcon,h=void 0===m?am:m,g=void 0===r?um:r,y=null;o?y=v.createElement("span",{className:"".concat(t,"-icon")},e.icon):i&&(y=v.createElement(ym[i]||null,{className:"".concat(t,"-icon ").concat(t,"-icon-").concat(i)}));var b=v.createElement("span",{className:"".concat(t,"-close-x")},h||v.createElement(_u,{className:"".concat(t,"-close-icon")})),w=!a&&y?v.createElement("span",{className:"".concat(t,"-message-single-line-auto-margin")}):null;return{content:v.createElement(cm,{iconPrefixCls:n},v.createElement("div",{className:y?"".concat(t,"-with-icon"):"",role:"alert"},y,v.createElement("div",{className:"".concat(t,"-message")},w,l),v.createElement("div",{className:"".concat(t,"-description")},a),c?v.createElement("span",{className:"".concat(t,"-btn")},c):null)),duration:g,closable:!0,closeIcon:b,onClose:s,onClick:u,key:f,style:d||{},className:$()(p,j({},"".concat(t,"-").concat(i),!!i))}}var wm={open:function(e){gm(e,(function(t){var n=t.prefixCls,r=t.iconPrefixCls;t.instance.notice(bm(e,n,r))}))},close:function(e){Object.keys(sm).forEach((function(t){return Promise.resolve(sm[t]).then((function(t){t.removeNotice(e)}))}))},config:function(e){var t=e.duration,n=e.placement,r=e.bottom,o=e.top,i=e.getContainer,a=e.closeIcon,l=e.prefixCls;void 0!==l&&(pm=l),void 0!==t&&(um=t),void 0!==n?mm=n:e.rtl&&(mm="topLeft"),void 0!==r&&(dm=r),void 0!==o&&(fm=o),void 0!==i&&(im=i),void 0!==a&&(am=a),void 0!==e.rtl&&(vm=e.rtl),void 0!==e.maxCount&&(lm=e.maxCount)},destroy:function(){Object.keys(sm).forEach((function(e){Promise.resolve(sm[e]).then((function(e){e.destroy()})),delete sm[e]}))}};["success","info","warning","error"].forEach((function(t){wm[t]=function(n){return wm.open(e(e({},n),{type:t}))}})),wm.warn=wm.warning,wm.useNotification=function(t,n){return function(){var r,o=null,i=z(up({add:function(e,t){null==o||o.component.add(e,t)}}),2),a=i[0],l=i[1],c=v.useRef({});return c.current.open=function(i){var l=i.prefixCls,c=r("notification",l);t(e(e({},i),{prefixCls:c}),(function(e){var t=e.prefixCls,r=e.instance;o=r,a(n(i,t))}))},["success","info","warning","error"].forEach((function(t){c.current[t]=function(n){return c.current.open(e(e({},n),{type:t}))}})),[c.current,v.createElement(Cr,{key:"holder"},(function(e){return r=e.getPrefixCls,l}))]}}(gm,bm);var Cm=wm,xm=["children","locked"],Em=v.createContext(null);function km(e){var t=e.children,n=e.locked,r=q(e,xm),o=v.useContext(Em),i=pe((function(){return e=r,t=U({},o),Object.keys(e).forEach((function(n){var r=e[n];void 0!==r&&(t[n]=r)})),t;var e,t}),[o,r],(function(e,t){return!(n||e[0]===t[0]&&Bl()(e[1],t[1]))}));return v.createElement(Em.Provider,{value:i},t)}function Sm(e,t,n,r){var o=v.useContext(Em),i=o.activeKey,a=o.onActive,l=o.onInactive,c={active:i===e};return t||(c.onMouseEnter=function(t){null==n||n({key:e,domEvent:t}),a(e)},c.onMouseLeave=function(t){null==r||r({key:e,domEvent:t}),l(e)}),c}var Om=["item"];function Nm(e){var t=e.item,n=q(e,Om);return Object.defineProperty(n,"item",{get:function(){return Bo(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),n}function Pm(e){var t=e.icon,n=e.props,r=e.children;return("function"==typeof t?v.createElement(t,U({},n)):t)||r||null}function Am(e){var t=v.useContext(Em),n=t.mode,r=t.rtl,o=t.inlineIndent;return"inline"!==n?null:r?{paddingRight:e*o}:{paddingLeft:e*o}}var Mm=[],Rm=v.createContext(null);function Tm(){return v.useContext(Rm)}var Fm=v.createContext(Mm);function Im(e){var t=v.useContext(Fm);return v.useMemo((function(){return void 0!==e?[].concat(bi(t),[e]):t}),[t,e])}var jm=v.createContext(null),_m=v.createContext(null);function Dm(e,t){return void 0===e?null:"".concat(e,"-").concat(t)}function Vm(e){return Dm(v.useContext(_m),e)}var Lm=v.createContext({}),zm=["title","attribute","elementRef"],Hm=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],$m=["active"],Wm=function(t){Z(r,t);var n=te(r);function r(){return K(this,r),n.apply(this,arguments)}return Y(r,[{key:"render",value:function(){var t=this.props,n=t.title,r=t.attribute,o=t.elementRef,i=Hr(q(t,zm),["eventKey"]);return Bo(!r,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),v.createElement(Wc.Item,e({},r,{title:"string"==typeof n?n:void 0},i,{ref:o}))}}]),r}(v.Component),Bm=function(t){var n,r=t.style,o=t.className,i=t.eventKey,a=(t.warnKey,t.disabled),l=t.itemIcon,c=t.children,s=t.role,u=t.onMouseEnter,f=t.onMouseLeave,d=t.onClick,p=t.onKeyDown,m=t.onFocus,h=q(t,Hm),g=Vm(i),y=v.useContext(Em),b=y.prefixCls,w=y.onItemClick,C=y.disabled,x=y.overflowDisabled,E=y.itemIcon,k=y.selectedKeys,S=y.onActive,O=v.useContext(Lm)._internalRenderMenuItem,N="".concat(b,"-item"),P=v.useRef(),A=v.useRef(),M=C||a,R=Im(i),T=function(e){return{key:i,keyPath:bi(R).reverse(),item:P.current,domEvent:e}},F=l||E,I=Sm(i,M,u,f),_=I.active,D=q(I,$m),V=k.includes(i),L=Am(R.length),z={};"option"===t.role&&(z["aria-selected"]=V);var H=v.createElement(Wm,e({ref:P,elementRef:A,role:null===s?"none":s||"menuitem",tabIndex:a?null:-1,"data-menu-id":x&&g?null:g},h,D,z,{component:"li","aria-disabled":a,style:U(U({},L),r),className:$()(N,(n={},j(n,"".concat(N,"-active"),_),j(n,"".concat(N,"-selected"),V),j(n,"".concat(N,"-disabled"),M),n),o),onClick:function(e){if(!M){var t=T(e);null==d||d(Nm(t)),w(t)}},onKeyDown:function(e){if(null==p||p(e),e.which===dc.ENTER){var t=T(e);null==d||d(Nm(t)),w(t)}},onFocus:function(e){S(i),null==m||m(e)}}),c,v.createElement(Pm,{props:U(U({},t),{},{isSelected:V}),icon:F}));return O&&(H=O(H,t,{selected:V})),H},Um=function(e){var t=e.eventKey,n=Tm(),r=Im(t);return v.useEffect((function(){if(n)return n.registerPath(t,r),function(){n.unregisterPath(t,r)}}),[r]),n?null:v.createElement(Bm,e)},qm=["label","children","key","type"];function Km(e,t){return wi(e).map((function(e,n){if(v.isValidElement(e)){var r,o,i=e.key,a=null!==(r=null===(o=e.props)||void 0===o?void 0:o.eventKey)&&void 0!==r?r:i;null==a&&(a="tmp_key-".concat([].concat(bi(t),[n]).join("-")));var l={key:a,eventKey:a};return v.cloneElement(e,l)}return e}))}function Gm(t){return(t||[]).map((function(t,n){if(t&&"object"===W(t)){var r=t.label,o=t.children,i=t.key,a=t.type,l=q(t,qm),c=null!=i?i:"tmp-".concat(n);return o||"group"===a?"group"===a?v.createElement(_v,e({key:c},l,{title:r}),Gm(o)):v.createElement(fv,e({key:c},l,{title:r}),Gm(o)):"divider"===a?v.createElement(Dv,e({key:c},l)):v.createElement(Um,e({key:c},l),r)}return null})).filter((function(e){return e}))}function Ym(e,t,n){var r=e;return t&&(r=Gm(t)),Km(r,n)}function Xm(e){var t=v.useRef(e);t.current=e;var n=v.useCallback((function(){for(var e,n=arguments.length,r=new Array(n),o=0;o1&&(b.motionAppear=!1);var w=b.onVisibleChanged;return b.onVisibleChanged=function(e){return p.current||e||g(!0),null==w?void 0:w(e)},h?null:v.createElement(km,{mode:a,locked:!p.current},v.createElement(dt,e({visible:y},b,{forceRender:s,removeOnLeave:!1,leavedClassName:"".concat(c,"-hidden")}),(function(e){var t=e.className,r=e.style;return v.createElement(ev,{id:n,className:t,style:r},i)})))}var cv=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],sv=["active"],uv=function(t){var n,r=t.style,o=t.className,i=t.title,a=t.eventKey,l=(t.warnKey,t.disabled),c=t.internalPopupClose,s=t.children,u=t.itemIcon,f=t.expandIcon,d=t.popupClassName,p=t.popupOffset,m=t.onClick,h=t.onMouseEnter,g=t.onMouseLeave,y=t.onTitleClick,b=t.onTitleMouseEnter,w=t.onTitleMouseLeave,C=q(t,cv),x=Vm(a),E=v.useContext(Em),k=E.prefixCls,S=E.mode,O=E.openKeys,N=E.disabled,P=E.overflowDisabled,A=E.activeKey,M=E.selectedKeys,R=E.itemIcon,T=E.expandIcon,F=E.onItemClick,I=E.onOpenChange,_=E.onActive,D=v.useContext(Lm)._internalRenderSubMenuItem,V=v.useContext(jm).isSubPathKey,L=Im(),H="".concat(k,"-submenu"),W=N||l,B=v.useRef(),K=v.useRef(),G=u||R,Y=f||T,X=O.includes(a),Q=!P&&X,Z=V(M,a),J=Sm(a,W,b,w),ee=J.active,te=q(J,sv),ne=z(v.useState(!1),2),re=ne[0],oe=ne[1],ie=function(e){W||oe(e)},ae=v.useMemo((function(){return ee||"inline"!==S&&(re||V([A],a))}),[S,ee,A,re,a,V]),le=Am(L.length),ce=Xm((function(e){null==m||m(Nm(e)),F(e)})),se=x&&"".concat(x,"-popup"),ue=v.createElement("div",e({role:"menuitem",style:le,className:"".concat(H,"-title"),tabIndex:W?null:-1,ref:B,title:"string"==typeof i?i:null,"data-menu-id":P&&x?null:x,"aria-expanded":Q,"aria-haspopup":!0,"aria-controls":se,"aria-disabled":W,onClick:function(e){W||(null==y||y({key:a,domEvent:e}),"inline"===S&&I(a,!X))},onFocus:function(){_(a)}},te),i,v.createElement(Pm,{icon:"horizontal"!==S?Y:null,props:U(U({},t),{},{isOpen:Q,isSubMenu:!0})},v.createElement("i",{className:"".concat(H,"-arrow")}))),fe=v.useRef(S);if("inline"!==S&&(fe.current=L.length>1?"vertical":S),!P){var de=fe.current;ue=v.createElement(av,{mode:de,prefixCls:H,visible:!c&&Q&&"inline"!==S,popupClassName:d,popupOffset:p,popup:v.createElement(km,{mode:"horizontal"===de?"vertical":de},v.createElement(ev,{id:se,ref:K},s)),disabled:W,onVisibleChange:function(e){"inline"!==S&&I(a,e)}},ue)}var pe=v.createElement(Wc.Item,e({role:"none"},C,{component:"li",style:r,className:$()(H,"".concat(H,"-").concat(S),o,(n={},j(n,"".concat(H,"-open"),Q),j(n,"".concat(H,"-active"),ae),j(n,"".concat(H,"-selected"),Z),j(n,"".concat(H,"-disabled"),W),n)),onMouseEnter:function(e){ie(!0),null==h||h({key:a,domEvent:e})},onMouseLeave:function(e){ie(!1),null==g||g({key:a,domEvent:e})}}),ue,!P&&v.createElement(lv,{id:se,open:Q,keyPath:L},s));return D&&(pe=D(pe,t,{selected:Z,active:ae,open:Q,disabled:W})),v.createElement(km,{onItemClick:ce,mode:"horizontal"===S?"vertical":S,itemIcon:G,expandIcon:Y},pe)};function fv(e){var t,n=e.eventKey,r=e.children,o=Im(n),i=Km(r,o),a=Tm();return v.useEffect((function(){if(a)return a.registerPath(n,o),function(){a.unregisterPath(n,o)}}),[o]),t=a?i:v.createElement(uv,e,i),v.createElement(Fm.Provider,{value:o},t)}function dv(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(ht(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||"a"===n&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),a=null;return o&&!Number.isNaN(i)?a=i:r&&null===a&&(a=0),r&&e.disabled&&(a=null),null!==a&&(a>=0||t&&a<0)}return!1}function pv(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=bi(e.querySelectorAll("*")).filter((function(e){return dv(e,t)}));return dv(e,t)&&n.unshift(e),n}var mv=dc.LEFT,vv=dc.RIGHT,hv=dc.UP,gv=dc.DOWN,yv=dc.ENTER,bv=dc.ESC,wv=dc.HOME,Cv=dc.END,xv=[hv,gv,mv,vv];function Ev(e,t){return pv(e,!0).filter((function(e){return t.has(e)}))}function kv(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var o=Ev(e,t),i=o.length,a=o.findIndex((function(e){return n===e}));return r<0?-1===a?a=i-1:a-=1:r>0&&(a+=1),o[a=(a+i)%i]}var Sv=Math.random().toFixed(5).toString().slice(2),Ov=0,Nv="__RC_UTIL_PATH_SPLIT__",Pv=function(e){return e.join(Nv)},Av="rc-menu-more";var Mv=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],Rv=[],Tv=v.forwardRef((function(t,n){var r,o,i=t.prefixCls,a=void 0===i?"rc-menu":i,l=t.rootClassName,c=t.style,s=t.className,u=t.tabIndex,f=void 0===u?0:u,d=t.items,p=t.children,m=t.direction,h=t.id,g=t.mode,y=void 0===g?"vertical":g,b=t.inlineCollapsed,w=t.disabled,C=t.disabledOverflow,x=t.subMenuOpenDelay,E=void 0===x?.1:x,k=t.subMenuCloseDelay,S=void 0===k?.1:k,O=t.forceSubMenuRender,N=t.defaultOpenKeys,P=t.openKeys,A=t.activeKey,M=t.defaultActiveFirst,R=t.selectable,T=void 0===R||R,F=t.multiple,I=void 0!==F&&F,_=t.defaultSelectedKeys,D=t.selectedKeys,V=t.onSelect,L=t.onDeselect,H=t.inlineIndent,W=void 0===H?24:H,B=t.motion,K=t.defaultMotions,G=t.triggerSubMenuAction,Y=void 0===G?"hover":G,X=t.builtinPlacements,Q=t.itemIcon,Z=t.expandIcon,J=t.overflowedIndicator,ee=void 0===J?"...":J,te=t.overflowedIndicatorPopupClassName,ne=t.getPopupContainer,re=t.onClick,oe=t.onOpenChange,ie=t.onKeyDown,ae=(t.openAnimation,t.openTransitionName,t._internalRenderMenuItem),le=t._internalRenderSubMenuItem,ce=q(t,Mv),ue=v.useMemo((function(){return Ym(p,d,Rv)}),[p,d]),fe=z(v.useState(!1),2),de=fe[0],pe=fe[1],me=v.useRef(),ve=function(e){var t=z(br(e,{value:e}),2),n=t[0],r=t[1];return v.useEffect((function(){Ov+=1;var e="".concat(Sv,"-").concat(Ov);r("rc-menu-uuid-".concat(e))}),[]),n}(h),he="rtl"===m,ge=z(v.useMemo((function(){return"inline"!==y&&"vertical"!==y||!b?[y,!1]:["vertical",b]}),[y,b]),2),ye=ge[0],be=ge[1],we=z(v.useState(0),2),Ce=we[0],xe=we[1],Ee=Ce>=ue.length-1||"horizontal"!==ye||C,ke=z(br(N,{value:P,postState:function(e){return e||Rv}}),2),Se=ke[0],Oe=ke[1],Ne=function(e){Oe(e),null==oe||oe(e)},Pe=z(v.useState(Se),2),Ae=Pe[0],Me=Pe[1],Re="inline"===ye,Te=v.useRef(!1);v.useEffect((function(){Re&&Me(Se)}),[Se]),v.useEffect((function(){Te.current?Re?Oe(Ae):Ne(Rv):Te.current=!0}),[Re]);var Fe=function(){var e=z(v.useState({}),2)[1],t=(0,v.useRef)(new Map),n=(0,v.useRef)(new Map),r=z(v.useState([]),2),o=r[0],i=r[1],a=(0,v.useRef)(0),l=(0,v.useRef)(!1),c=(0,v.useCallback)((function(r,o){var i=Pv(o);n.current.set(i,r),t.current.set(r,i),a.current+=1;var c,s=a.current;c=function(){s===a.current&&(l.current||e({}))},Promise.resolve().then(c)}),[]),s=(0,v.useCallback)((function(e,r){var o=Pv(r);n.current.delete(o),t.current.delete(e)}),[]),u=(0,v.useCallback)((function(e){i(e)}),[]),f=(0,v.useCallback)((function(e,n){var r=(t.current.get(e)||"").split(Nv);return n&&o.includes(r[0])&&r.unshift(Av),r}),[o]),d=(0,v.useCallback)((function(e,t){return e.some((function(e){return f(e,!0).includes(t)}))}),[f]),p=(0,v.useCallback)((function(e){var r="".concat(t.current.get(e)).concat(Nv),o=new Set;return bi(n.current.keys()).forEach((function(e){e.startsWith(r)&&o.add(n.current.get(e))})),o}),[]);return v.useEffect((function(){return function(){l.current=!0}}),[]),{registerPath:c,unregisterPath:s,refreshOverflowKeys:u,isSubPathKey:d,getKeyPath:f,getKeys:function(){var e=bi(t.current.keys());return o.length&&e.push(Av),e},getSubPathKeys:p}}(),Ie=Fe.registerPath,je=Fe.unregisterPath,_e=Fe.refreshOverflowKeys,De=Fe.isSubPathKey,Ve=Fe.getKeyPath,Le=Fe.getKeys,ze=Fe.getSubPathKeys,He=v.useMemo((function(){return{registerPath:Ie,unregisterPath:je}}),[Ie,je]),$e=v.useMemo((function(){return{isSubPathKey:De}}),[De]);v.useEffect((function(){_e(Ee?Rv:ue.slice(Ce+1).map((function(e){return e.key})))}),[Ce,Ee]);var We=z(br(A||M&&(null===(r=ue[0])||void 0===r?void 0:r.key),{value:A}),2),Be=We[0],Ue=We[1],qe=Xm((function(e){Ue(e)})),Ke=Xm((function(){Ue(void 0)}));(0,v.useImperativeHandle)(n,(function(){return{list:me.current,focus:function(e){var t,n,r,o,i=null!=Be?Be:null===(t=ue.find((function(e){return!e.props.disabled})))||void 0===t?void 0:t.key;i&&(null===(n=me.current)||void 0===n||null===(r=n.querySelector("li[data-menu-id='".concat(Dm(ve,i),"']")))||void 0===r||null===(o=r.focus)||void 0===o||o.call(r,e))}}}));var Ge=z(br(_||[],{value:D,postState:function(e){return Array.isArray(e)?e:null==e?Rv:[e]}}),2),Ye=Ge[0],Xe=Ge[1],Qe=Xm((function(e){null==re||re(Nm(e)),function(e){if(T){var t,n=e.key,r=Ye.includes(n);t=I?r?Ye.filter((function(e){return e!==n})):[].concat(bi(Ye),[n]):[n],Xe(t);var o=U(U({},e),{},{selectedKeys:t});r?null==L||L(o):null==V||V(o)}!I&&Se.length&&"inline"!==ye&&Ne(Rv)}(e)})),Ze=Xm((function(e,t){var n=Se.filter((function(t){return t!==e}));if(t)n.push(e);else if("inline"!==ye){var r=ze(e);n=n.filter((function(e){return!r.has(e)}))}Bl()(Se,n)||Ne(n)})),Je=Xm(ne),et=function(e,t,n,r,o,i,a,l,c,s){var u=v.useRef(),f=v.useRef();f.current=t;var d=function(){se.cancel(u.current)};return v.useEffect((function(){return function(){d()}}),[]),function(p){var m=p.which;if([].concat(xv,[yv,bv,wv,Cv]).includes(m)){var v,h,g,y=function(){return v=new Set,h=new Map,g=new Map,i().forEach((function(e){var t=document.querySelector("[data-menu-id='".concat(Dm(r,e),"']"));t&&(v.add(t),g.set(t,e),h.set(e,t))})),v};y();var b=function(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}(h.get(t),v),w=g.get(b),C=function(e,t,n,r){var o,i,a,l,c="prev",s="next",u="children",f="parent";if("inline"===e&&r===yv)return{inlineTrigger:!0};var d=(j(o={},hv,c),j(o,gv,s),o),p=(j(i={},mv,n?s:c),j(i,vv,n?c:s),j(i,gv,u),j(i,yv,u),i),m=(j(a={},hv,c),j(a,gv,s),j(a,yv,u),j(a,bv,f),j(a,mv,n?u:f),j(a,vv,n?f:u),a);switch(null===(l={inline:d,horizontal:p,vertical:m,inlineSub:d,horizontalSub:m,verticalSub:m}["".concat(e).concat(t?"":"Sub")])||void 0===l?void 0:l[r]){case c:return{offset:-1,sibling:!0};case s:return{offset:1,sibling:!0};case f:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}(e,1===a(w,!0).length,n,m);if(!C&&m!==wv&&m!==Cv)return;(xv.includes(m)||[wv,Cv].includes(m))&&p.preventDefault();var x=function(e){if(e){var t=e,n=e.querySelector("a");(null==n?void 0:n.getAttribute("href"))&&(t=n);var r=g.get(e);l(r),d(),u.current=se((function(){f.current===r&&t.focus()}))}};if([wv,Cv].includes(m)||C.sibling||!b){var E,k,S=Ev(E=b&&"inline"!==e?function(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}(b):o.current,v);k=m===wv?S[0]:m===Cv?S[S.length-1]:kv(E,v,b,C.offset),x(k)}else if(C.inlineTrigger)c(w);else if(C.offset>0)c(w,!0),d(),u.current=se((function(){y();var e=b.getAttribute("aria-controls"),t=kv(document.getElementById(e),v);x(t)}),5);else if(C.offset<0){var O=a(w,!0),N=O[O.length-2],P=h.get(N);c(N,!1),x(P)}}null==s||s(p)}}(ye,Be,he,ve,me,Le,Ve,Ue,(function(e,t){var n=null!=t?t:!Se.includes(e);Ze(e,n)}),ie);v.useEffect((function(){pe(!0)}),[]);var tt=v.useMemo((function(){return{_internalRenderMenuItem:ae,_internalRenderSubMenuItem:le}}),[ae,le]),nt="horizontal"!==ye||C?ue:ue.map((function(e,t){return v.createElement(km,{key:e.key,overflowDisabled:t>Ce},e)})),rt=v.createElement(Wc,e({id:h,ref:me,prefixCls:"".concat(a,"-overflow"),component:"ul",itemComponent:Um,className:$()(a,"".concat(a,"-root"),"".concat(a,"-").concat(ye),s,(o={},j(o,"".concat(a,"-inline-collapsed"),be),j(o,"".concat(a,"-rtl"),he),o),l),dir:m,style:c,role:"menu",tabIndex:f,data:nt,renderRawItem:function(e){return e},renderRawRest:function(e){var t=e.length,n=t?ue.slice(-t):null;return v.createElement(fv,{eventKey:Av,title:ee,disabled:Ee,internalPopupClose:0===t,popupClassName:te},n)},maxCount:"horizontal"!==ye||C?Wc.INVALIDATE:Wc.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){xe(e)},onKeyDown:et},ce));return v.createElement(Lm.Provider,{value:tt},v.createElement(_m.Provider,{value:ve},v.createElement(km,{prefixCls:a,rootClassName:l,mode:ye,openKeys:Se,rtl:he,disabled:w,motion:de?B:null,defaultMotions:de?K:null,activeKey:Be,onActive:qe,onInactive:Ke,selectedKeys:Ye,inlineIndent:W,subMenuOpenDelay:E,subMenuCloseDelay:S,forceSubMenuRender:O,builtinPlacements:X,triggerSubMenuAction:Y,getPopupContainer:Je,itemIcon:Q,expandIcon:Z,onItemClick:Qe,onOpenChange:Ze},v.createElement(jm.Provider,{value:$e},rt),v.createElement("div",{style:{display:"none"},"aria-hidden":!0},v.createElement(Rm.Provider,{value:He},ue)))))})),Fv=["className","title","eventKey","children"],Iv=["children"],jv=function(t){var n=t.className,r=t.title,o=(t.eventKey,t.children),i=q(t,Fv),a=v.useContext(Em).prefixCls,l="".concat(a,"-item-group");return v.createElement("li",e({},i,{onClick:function(e){return e.stopPropagation()},className:$()(l,n)}),v.createElement("div",{className:"".concat(l,"-title"),title:"string"==typeof r?r:void 0},r),v.createElement("ul",{className:"".concat(l,"-list")},o))};function _v(e){var t=e.children,n=q(e,Iv),r=Km(t,Im(n.eventKey));return Tm()?r:v.createElement(jv,Hr(n,["warnKey"]),r)}function Dv(e){var t=e.className,n=e.style,r=v.useContext(Em).prefixCls;return Tm()?null:v.createElement("li",{className:$()("".concat(r,"-item-divider"),t),style:n})}var Vv=Im,Lv=Tv;Lv.Item=Um,Lv.SubMenu=fv,Lv.ItemGroup=_v,Lv.Divider=Dv;var zv=Lv,Hv=v.createContext({}),$v=function(t){var n=t.prefixCls,r=t.className,o=t.dashed,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=0?"".concat(e,"-slide-down"):"".concat(e,"-slide-up")}(),trigger:w,overlay:function(){var e,n=t.overlay;return e="function"==typeof n?n():n,e=v.Children.only("string"==typeof e?v.createElement("span",null,e):e),v.createElement(Yv,{prefixCls:"".concat(g,"-menu"),expandIcon:v.createElement("span",{className:"".concat(g,"-menu-submenu-arrow")},v.createElement(uh,{className:"".concat(g,"-menu-submenu-arrow-icon")})),mode:"vertical",selectable:!1,onClick:P,validator:function(e){e.mode}},e)},placement:(C=t.placement,C?C.includes("Center")?C.slice(0,C.indexOf("Center")):C:"rtl"===a?"bottomRight":"bottomLeft"),onVisibleChange:S}),b)});xh.Button=Ch,xh.defaultProps={mouseEnterDelay:.15,mouseLeaveDelay:.1};var Eh=xh,kh=Eh,Sh=v.forwardRef((function(e,t){var n,r=e.prefixCls,o=e.forceRender,i=e.className,a=e.style,l=e.children,c=e.isActive,s=e.role,u=z(v.useState(c||o),2),f=u[0],d=u[1];return v.useEffect((function(){(o||c)&&d(!0)}),[o,c]),f?v.createElement("div",{ref:t,className:$()("".concat(r,"-content"),(n={},j(n,"".concat(r,"-content-active"),c),j(n,"".concat(r,"-content-inactive"),!c),n),i),style:a,role:s},v.createElement("div",{className:"".concat(r,"-content-box")},l)):null}));Sh.displayName="PanelContent";var Oh=Sh,Nh=function(t){Z(r,t);var n=te(r);function r(){var e;K(this,r);for(var t=arguments.length,o=new Array(t),i=0;i-1?t.splice(n,1):t.push(e)}r.setActiveKey(t)},r.getNewChild=function(e,t){if(!e)return null;var n=r.state.activeKey,o=r.props,i=o.prefixCls,a=o.openMotion,l=o.accordion,c=o.destroyInactivePanel,s=o.expandIcon,u=o.collapsible,f=e.key||String(t),d=e.props,p=d.header,m=d.headerClass,h=d.destroyInactivePanel,g=d.collapsible,y=null!=g?g:u,b={key:f,panelKey:f,header:p,headerClass:m,isActive:l?n[0]===f:n.indexOf(f)>-1,prefixCls:i,destroyInactivePanel:null!=h?h:c,openMotion:a,accordion:l,children:e.props.children,onItemClick:"disabled"===y?null:r.onClickItem,expandIcon:s,collapsible:y};return"string"==typeof e.type?e:(Object.keys(b).forEach((function(e){void 0===b[e]&&delete b[e]})),v.cloneElement(e,b))},r.getItems=function(){return wi(r.props.children).map(r.getNewChild)},r.setActiveKey=function(e){"activeKey"in r.props||r.setState({activeKey:e}),r.props.onChange(r.props.accordion?e[0]:e)};var o=e.activeKey,i=e.defaultActiveKey;return"activeKey"in e&&(i=o),r.state={activeKey:Ah(i)},r}return Y(n,[{key:"shouldComponentUpdate",value:function(e,t){return!Bl()(this.props,e)||!Bl()(this.state,t)}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.style,i=t.accordion,a=$()((j(e={},n,!0),j(e,r,!!r),e));return v.createElement("div",{className:a,style:o,role:i?"tablist":null},this.getItems())}}],[{key:"getDerivedStateFromProps",value:function(e){var t={};return"activeKey"in e&&(t.activeKey=Ah(e.activeKey)),t}}]),n}(v.Component);Mh.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1},Mh.Panel=Ph;var Rh=Mh,Th=(Mh.Panel,function(t){var n,r=v.useContext(wr),o=r.getPrefixCls,i=r.direction,a=t.prefixCls,l=t.className,c=void 0===l?"":l,s=t.bordered,u=void 0===s||s,f=t.ghost,d=t.expandIconPosition,p=void 0===d?"start":d,m=o("collapse",a),h=v.useMemo((function(){return"left"===p?"start":"right"===p?"end":p}),[p]),g=$()("".concat(m,"-icon-position-").concat(h),(j(n={},"".concat(m,"-borderless"),!u),j(n,"".concat(m,"-rtl"),"rtl"===i),j(n,"".concat(m,"-ghost"),!!f),n),c),y=e(e({},Mr),{motionAppear:!1,leavedClassName:"".concat(m,"-content-hidden")});return v.createElement(Rh,e({openMotion:y},t,{expandIcon:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.expandIcon,r=n?n(e):v.createElement(uh,{rotate:e.isActive?90:void 0});return Dr(r,(function(){return{className:$()(r.props.className,"".concat(m,"-arrow"))}}))},prefixCls:m,className:g}),wi(t.children).map((function(t,n){var r;if(null===(r=t.props)||void 0===r?void 0:r.disabled){var o=t.key||String(n),i=t.props,a=i.disabled,l=i.collapsible;return Dr(t,e(e({},Hr(t.props,["disabled"])),{key:o,collapsible:null!=l?l:a?"disabled":void 0}))}return t})))});Th.Panel=function(t){var n=v.useContext(wr).getPrefixCls,r=t.prefixCls,o=t.className,i=void 0===o?"":o,a=t.showArrow,l=void 0===a||a,c=n("collapse",r),s=$()(j({},"".concat(c,"-no-arrow"),!l),i);return v.createElement(Rh.Panel,e({},t,{prefixCls:c,className:s}))};var Fh=Th,Ih={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},jh=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Ih}))};jh.displayName="CopyOutlined";var _h=v.forwardRef(jh),Dh={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},Vh=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Dh}))};Vh.displayName="MoreOutlined";var Lh=v.forwardRef(Vh);const{hooks:zh}=wpGraphiQL,{useEffect:Hh}=wp.element,$h=Ld.div` + .ant-collapse { + margin-bottom: 10px; + } + .ant-collapse-content { + padding-left: 15px; + padding-top: 0px; + max-height: 450px; + overflow-y: scroll; + } + .ant-collapse-content-box { + padding: 0; + } +`;var Wh=e=>{var n,r;let o;const{index:i}=e,a=(t,n)=>{let r,i=e.definition;if(0===i.selectionSet.selections.length&&o&&(i=o),"FragmentDefinition"===i.kind)r={...i,selectionSet:{...i.selectionSet,selections:t}};else if("OperationDefinition"===i.kind){let e=t.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)));0===e.length&&(e=[{kind:"Field",name:{kind:"Name",value:"__typename ## Placeholder value"}}]),r={...i,selectionSet:{...i.selectionSet,selections:e}}}return o=r,e.onEdit(r,n)};Hh((()=>{Cm.config({top:50,placement:"topRight",getContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0]})}));const{operationType:l,definition:c,schema:s,getDefaultFieldNames:u,styleConfig:f}=e,d=(()=>{const{operationType:t,name:n}=e;return`${t}-${n||"unknown"}`})(),p=e.fields||{},m=c.selectionSet.selections,v=e.name||`${N(l)} Name`,h={clone:(0,t.createElement)(Jv.Item,{key:"clone"},(0,t.createElement)(hi,{type:"link",style:{marginRight:5},onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onOperationClone(),Cm.success({message:`${N(l)} "${v}" was cloned`})},icon:(0,t.createElement)(_h,null)},`Clone ${N(l)}`)),destroy:(0,t.createElement)(Jv.Item,{key:"destroy"},(0,t.createElement)(lh,{zIndex:1e4,getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],title:`Are you sure you want to delete ${N(l)} "${v}"`,onCancel:e=>{e.preventDefault(),e.stopPropagation()},onConfirm:t=>{t.preventDefault(),t.stopPropagation(),e.onOperationDestroy(),Cm.success({message:`${N(l)} "${v}" was deleted`})}},(0,t.createElement)(hi,{type:"link",onClick:e=>{e.preventDefault(),e.stopPropagation()},icon:(0,t.createElement)(Ud,null)},`Delete ${N(l)}`)))},g=zh.applyFilters("graphiql_explorer_operation_action_menu_items",h,{Menu:Jv,props:e});if(Object.keys(g).length<1)return null;const y=g&&Object.keys(g).length?Object.keys(g).map((e=>{var t;return null!==(t=g[e])&&void 0!==t?t:null})):null,b=(0,t.createElement)(Jv,null,y),w=(0,t.createElement)(kh,{overlay:b,arrow:!0,getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0]},(0,t.createElement)(hi,{type:"text",onClick:e=>e.stopPropagation()},(0,t.createElement)(Lh,null)));return(0,t.createElement)($h,{id:`collapse-wrap-${i}`},(0,t.createElement)("span",{id:`collapse-wrap-${d}`}),(0,t.createElement)(Fh,{key:`collapse-${i}`,id:`collapse-${i}`,tabIndex:"0",defaultActiveKey:0},(0,t.createElement)(Fh.Panel,{key:0,header:(0,t.createElement)("span",{style:{textOverflow:"ellipsis",display:"inline-block",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",verticalAlign:"middle",fontSize:"smaller",color:f.colors.keyword,paddingBottom:0},className:"graphiql-operation-title-bar"},l," ",(0,t.createElement)("span",{style:{color:f.colors.def}},(0,t.createElement)(rc,{id:`operationName-${i}`,name:"operation-name","data-lpignore":"true",defaultValue:null!==(n=e.name)&&void 0!==n?n:"",placeholder:null!==(r=e.name)&&void 0!==r?r:"name",onChange:t=>{var n;e.name!==t.target.value&&(n=t,e.onOperationRename(n.target.value))},value:e.name,onClick:e=>{e.stopPropagation(),e.preventDefault()},style:{color:f.colors.def,width:`${Math.max(15,v.length)}ch`,fontSize:"smaller"}}))),extra:w},(0,t.createElement)("div",{style:{padding:"10px 0 0 0"}},Object.keys(p).sort().map((n=>(0,t.createElement)(vf,{key:n,field:p[n],selections:m,modifySelections:a,schema:s,getDefaultFieldNames:u,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition,availableFragments:e.availableFragments})))))))};function Bh(e){var t=z(v.useState(e),2),n=t[0],r=t[1];return v.useEffect((function(){var t=setTimeout((function(){r(e)}),e.length?0:10);return function(){clearTimeout(t)}}),[e]),n}var Uh=[];function qh(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{key:"string"==typeof e?e:"".concat(n,"-").concat(r),error:e,errorStatus:t}}function Kh(t){var n=t.help,r=t.helpStatus,o=t.errors,i=void 0===o?Uh:o,a=t.warnings,l=void 0===a?Uh:a,c=t.className,s=v.useContext(Qa).prefixCls,u=v.useContext(wr).getPrefixCls,f="".concat(s,"-item-explain"),d=u(),p=Bh(i),m=Bh(l),h=v.useMemo((function(){return null!=n?[qh(n,r,"help")]:[].concat(bi(p.map((function(e,t){return qh(e,"error","error",t)}))),bi(m.map((function(e,t){return qh(e,"warning","warning",t)}))))}),[n,r,p,m]);return v.createElement(dt,e({},Mr,{motionName:"".concat(d,"-show-help"),motionAppear:!1,motionEnter:!1,visible:!!h.length,onLeaveStart:function(e){return e.style.height="auto",{height:e.offsetHeight}}}),(function(t){var n=t.className,r=t.style;return v.createElement("div",{className:$()(f,n,c),style:r},v.createElement(ft,e({keys:h},Mr,{motionName:"".concat(d,"-show-help-item"),component:!1}),(function(e){var t=e.key,n=e.error,r=e.errorStatus,o=e.className,i=e.style;return v.createElement("div",{key:t,role:"alert",className:$()(o,j({},"".concat(f,"-").concat(r),r)),style:i},n)})))}))}function Gh(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function Yh(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function Xh(e,t){if(e.clientHeightt||i>e&&a=t&&l>=n?i-e-r:a>t&&ln?a-t+o:0}function Zh(e,t){var n=window,r=t.scrollMode,o=t.block,i=t.inline,a=t.boundary,l=t.skipOverflowHiddenElements,c="function"==typeof a?a:function(e){return e!==a};if(!Gh(e))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,u=[],f=e;Gh(f)&&c(f);){if((f=f.parentElement)===s){u.push(f);break}null!=f&&f===document.body&&Xh(f)&&!Xh(document.documentElement)||null!=f&&Xh(f,l)&&u.push(f)}for(var d=n.visualViewport?n.visualViewport.width:innerWidth,p=n.visualViewport?n.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,h=e.getBoundingClientRect(),g=h.height,y=h.width,b=h.top,w=h.right,C=h.bottom,x=h.left,E="start"===o||"nearest"===o?b:"end"===o?C:b+g/2,k="center"===i?x+y/2:"end"===i?w:x,S=[],O=0;O=0&&x>=0&&C<=p&&w<=d&&b>=R&&C<=F&&x>=I&&w<=T)return S;var j=getComputedStyle(N),_=parseInt(j.borderLeftWidth,10),D=parseInt(j.borderTopWidth,10),V=parseInt(j.borderRightWidth,10),L=parseInt(j.borderBottomWidth,10),z=0,H=0,$="offsetWidth"in N?N.offsetWidth-N.clientWidth-_-V:0,W="offsetHeight"in N?N.offsetHeight-N.clientHeight-D-L:0;if(s===N)z="start"===o?E:"end"===o?E-p:"nearest"===o?Qh(v,v+p,p,D,L,v+E,v+E+g,g):E-p/2,H="start"===i?k:"center"===i?k-d/2:"end"===i?k-d:Qh(m,m+d,d,_,V,m+k,m+k+y,y),z=Math.max(0,z+v),H=Math.max(0,H+m);else{z="start"===o?E-R-D:"end"===o?E-F+L+W:"nearest"===o?Qh(R,F,A,D,L+W,E,E+g,g):E-(R+A/2)+W/2,H="start"===i?k-I-_:"center"===i?k-(I+M/2)+$/2:"end"===i?k-T+V+$:Qh(I,T,M,_,V+$,k,k+y,y);var B=N.scrollLeft,U=N.scrollTop;E+=U-(z=Math.max(0,Math.min(U+z,N.scrollHeight-A+W))),k+=B-(H=Math.max(0,Math.min(B+H,N.scrollWidth-M+$)))}S.push({el:N,top:z,left:H})}return S}function Jh(e){return e===Object(e)&&0!==Object.keys(e).length}var eg=function(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(Jh(t)&&"function"==typeof t.behavior)return t.behavior(n?Zh(e,t):[]);if(n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:Jh(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,o=e.top,i=e.left;r.scroll&&n?r.scroll({top:o,left:i,behavior:t}):(r.scrollTop=o,r.scrollLeft=i)}))}(Zh(e,r),r.behavior)}},tg=["parentNode"];function ng(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function rg(e,t){if(e.length){var n=e.join("_");return t?"".concat(t,"_").concat(n):tg.indexOf(n)>=0?"".concat("form_item","_").concat(n):n}}function og(e){return ng(e).join("_")}function ig(t){var n=z(La(),1)[0],r=v.useRef({}),o=v.useMemo((function(){return null!=t?t:e(e({},n),{__INTERNAL__:{itemRef:function(e){return function(t){var n=og(e);t?r.current[n]=t:delete r.current[n]}}},scrollToField:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ng(t),i=rg(r,o.__INTERNAL__.name),a=i?document.getElementById(i):null;a&&eg(a,e({scrollMode:"if-needed",block:"nearest"},n))},getFieldInstance:function(e){var t=og(e);return r.current[t]}})}),[t,n]);return[o]}var ag,lg=function(t,n){var r,o=v.useContext(Kr),i=v.useContext(Br),a=v.useContext(wr),l=a.getPrefixCls,c=a.direction,s=a.form,u=t.prefixCls,f=t.className,d=void 0===f?"":f,p=t.size,m=void 0===p?o:p,h=t.disabled,g=void 0===h?i:h,y=t.form,b=t.colon,w=t.labelAlign,C=t.labelWrap,x=t.labelCol,E=t.wrapperCol,k=t.hideRequiredMark,S=t.layout,O=void 0===S?"horizontal":S,N=t.scrollToFirstError,P=t.requiredMark,A=t.onFinishFailed,M=t.name,R=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=1},subscribe:function(e){return fg.size||this.register(),dg+=1,fg.set(dg,e),e(pg),dg},unsubscribe:function(e){fg.delete(e),fg.size||this.unregister()},unregister:function(){var e=this;Object.keys(ug).forEach((function(t){var n=ug[t],r=e.matchHandlers[n];null==r||r.mql.removeListener(null==r?void 0:r.listener)})),fg.clear()},register:function(){var t=this;Object.keys(ug).forEach((function(n){var r=ug[n],o=function(r){var o=r.matches;t.dispatch(e(e({},pg),j({},n,o)))},i=window.matchMedia(r);i.addListener(o),t.matchHandlers[r]={mql:i,listener:o},o(i)}))}},vg=mg,hg=(0,v.createContext)({}),gg=(xr("top","middle","bottom","stretch"),xr("start","end","center","space-around","space-between","space-evenly"),v.forwardRef((function(t,n){var r,o=t.prefixCls,i=t.justify,a=t.align,l=t.className,c=t.style,s=t.children,u=t.gutter,f=void 0===u?0:u,d=t.wrap,p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0?S[0]/-2:void 0,A=null!=S[1]&&S[1]>0?S[1]/-2:void 0;if(P&&(N.marginLeft=P,N.marginRight=P),C){var M=z(S,2);N.rowGap=M[1]}else A&&(N.marginTop=A,N.marginBottom=A);var R=z(S,2),T=R[0],F=R[1],I=v.useMemo((function(){return{gutter:[T,F],wrap:d,supportFlexGap:C}}),[T,F,d,C]);return v.createElement(hg.Provider,{value:I},v.createElement("div",e({},p,{className:O,style:e(e({},N),c),ref:n}),s))}))),yg=gg,bg=["xs","sm","md","lg","xl","xxl"],wg=v.forwardRef((function(t,n){var r,o=v.useContext(wr),i=o.getPrefixCls,a=o.direction,l=v.useContext(hg),c=l.gutter,s=l.wrap,u=l.supportFlexGap,f=t.prefixCls,d=t.span,p=t.order,m=t.offset,h=t.push,g=t.pull,y=t.className,b=t.children,w=t.flex,C=t.style,x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0){var N=c[0]/2;O.paddingLeft=N,O.paddingRight=N}if(c&&c[1]>0&&!u){var P=c[1]/2;O.paddingTop=P,O.paddingBottom=P}return w&&(O.flex=function(e){return"number"==typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(w),!1!==s||O.minWidth||(O.minWidth=0)),v.createElement("div",e({},x,{style:e(e({},O),C),className:S,ref:n}),b)})),Cg=wg,xg=function(t){var n=t.prefixCls,r=t.status,o=t.wrapperCol,i=t.children,a=t.errors,l=t.warnings,c=t._internalItemRender,s=t.extra,u=t.help,f="".concat(n,"-item"),d=v.useContext(Ya),p=o||d.wrapperCol||{},m=$()("".concat(f,"-control"),p.className),h=v.useMemo((function(){return e({},d)}),[d]);delete h.labelCol,delete h.wrapperCol;var g=v.createElement("div",{className:"".concat(f,"-control-input")},v.createElement("div",{className:"".concat(f,"-control-input-content")},i)),y=v.useMemo((function(){return{prefixCls:n,status:r}}),[n,r]),b=v.createElement(Qa.Provider,{value:y},v.createElement(Kh,{errors:a,warnings:l,help:u,helpStatus:r,className:"".concat(f,"-explain-connected")})),w=s?v.createElement("div",{className:"".concat(f,"-extra")},s):null,C=c&&"pro_table_render"===c.mark&&c.render?c.render(t,{input:g,errorList:b,extra:w}):v.createElement(v.Fragment,null,g,b,w);return v.createElement(Ya.Provider,{value:h},v.createElement(Cg,e({},p,{className:m}),C))},Eg={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},kg=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Eg}))};kg.displayName="QuestionCircleOutlined";var Sg=v.forwardRef(kg),Og=function(t){var n,r,o,i=t.prefixCls,a=t.label,l=t.htmlFor,c=t.labelCol,s=t.labelAlign,u=t.colon,f=t.required,d=t.requiredMark,p=t.tooltip,m=z((n="Form",o=v.useContext(gu),[v.useMemo((function(){var t=xu.Form,n=o?o.Form:{};return e(e({},"function"==typeof t?t():t),n||{})}),[n,r,o])]),1)[0];return a?v.createElement(Ya.Consumer,{key:"label"},(function(t){var n,r,o=t.vertical,h=t.labelAlign,g=t.labelCol,y=t.labelWrap,b=t.colon,w=c||g||{},C=s||h,x="".concat(i,"-item-label"),E=$()(x,"left"===C&&"".concat(x,"-left"),w.className,j({},"".concat(x,"-wrap"),!!y)),k=a,S=!0===u||!1!==b&&!1!==u;S&&!o&&"string"==typeof a&&""!==a.trim()&&(k=a.replace(/[:|:]\s*$/,""));var O=function(e){return e?"object"!==W(e)||v.isValidElement(e)?{title:e}:e:null}(p);if(O){var N=O.icon,P=void 0===N?v.createElement(Sg,null):N,A=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{actionOptions:n,addOperation:r}=e,o=45*n.length;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{style:{padding:"10px 10px 0 10px",borderTop:"1px solid #ccc",overflowY:"hidden",minHeight:`${o}px`}},(0,t.createElement)(Mg,{name:"add-graphql-operation",className:"variable-editor-title graphiql-explorer-actions",layout:"inline",onSubmit:e=>e.preventDefault()},n.map(((e,n)=>{const{type:o}=e;return(0,t.createElement)(hi,{key:n,style:{marginBottom:"5px",textTransform:"capitalize"},block:!0,type:"primary",onClick:()=>r(o)},"Add New ",o)})))))};const{useAppContext:Tg}=wpGraphiQL,{GraphQLObjectType:Fg,print:Ig}=wpGraphiQL.GraphQL,{useState:jg,useEffect:_g,useRef:Dg}=wp.element;var Vg=e=>{const[n,r]=jg("query"),[o,i]=jg(null),[a,l]=jg(null);let c=Dg(null);_g((()=>{}));const s=e=>{},{schema:u,query:f}=Tg(),{makeDefaultArg:d}=e;if(!u)return(0,t.createElement)("div",{style:{fontFamily:"sans-serif"},className:"error-container"},"No Schema Available");const p={colors:e.colors||b,checkboxChecked:e.checkboxChecked||x,checkboxUnchecked:e.checkboxUnchecked||E,arrowClosed:e.arrowClosed||C,arrowOpen:e.arrowOpen||w,styles:e.styles?{...k,...e.styles}:k},m=u.getQueryType(),v=u.getMutationType(),h=u.getSubscriptionType();if(!m&&!v&&!h)return(0,t.createElement)("div",null,"Missing query type");const g=m&&m.getFields(),P=v&&v.getFields(),A=h&&h.getFields(),M=O(f),R=e.getDefaultFieldNames||y,T=e.getDefaultScalarArgValue||I,F=M.definitions.map((e=>"FragmentDefinition"===e.kind||"OperationDefinition"===e.kind?e:null)).filter(Boolean),j=0===F.length?S.definitions:F;let _=[];g&&_.push({type:"query",label:"Queries",fields:()=>g}),A&&_.push({type:"subscription",label:"Subscriptions",fields:()=>A}),P&&_.push({type:"mutation",label:"Mutations",fields:()=>P});const D=(0,t.createElement)(Rg,{query:f,actionOptions:_,addOperation:t=>{const n=M.definitions,r=1===M.definitions.length&&M.definitions[0]===S.definitions[0],o=r?[]:n.filter((e=>"OperationDefinition"===e.kind&&e.operation===t)),i=`My${N(t)}${0===o.length?"":o.length+1}`,a={kind:"OperationDefinition",operation:t,name:{kind:"Name",value:i},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename # Placeholder value",loc:null},arguments:[],directives:[],selectionSet:null,loc:null}],loc:null},loc:null},l=r?[a]:[...M.definitions,a],c={...M,definitions:l};e.onEdit(Ig(c))}}),V=j.reduce(((e,t)=>{if("FragmentDefinition"===t.kind){const n=t.typeCondition.name.value,r=[...e[n]||[],t].sort(((e,t)=>e.name.value.localeCompare(t.name.value)));return{...e,[n]:r}}return e}),{});return(0,t.createElement)("div",{ref:e=>{c=e},style:{fontSize:12,textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0,padding:0,fontFamily:'Consolas, Inconsolata, "Droid Sans Mono", Monaco, monospace',display:"flex",flexDirection:"column",height:"100%"},className:"graphiql-explorer-root antd-app"},(0,t.createElement)("div",{style:{flexGrow:1,overflowY:"scroll",width:"100%",padding:"8px"}},j.map(((n,r)=>{const o=n&&n.name&&n.name.value,i="FragmentDefinition"===n.kind?"fragment":n&&n.operation||"query",a="FragmentDefinition"===n.kind&&"NamedType"===n.typeCondition.kind&&u.getType(n.typeCondition.name.value),l=a instanceof Fg?a.getFields():null,c="query"===i?g:"mutation"===i?P:"subscription"===i?A:"FragmentDefinition"===n.kind?l:null,f="FragmentDefinition"===n.kind?n.typeCondition.name.value:null,m=t=>{const n=Ig(t);e.onEdit(n)};return(0,t.createElement)(Wh,{key:r,index:r,isLast:r===j.length-1,fields:c,operationType:i,name:o,definition:n,onOperationRename:t=>{const r=((e,t)=>{const n=null==t||""===t?null:{kind:"Name",value:t,loc:void 0},r={...e,name:n},o=M.definitions.map((t=>e===t?r:t));return{...M,definitions:o}})(n,t);e.onEdit(Ig(r))},onOperationDestroy:()=>{const t=(e=>{const t=M.definitions.filter((t=>e!==t));return{...M,definitions:t}})(n);e.onEdit(Ig(t))},onOperationClone:()=>{const t=(e=>{let t;t="FragmentDefinition"===e.kind?"fragment":e.operation;const n={kind:"Name",value:(e.name&&e.name.value||"")+"Copy",loc:void 0},r={...e,name:n},o=[...M.definitions,r];return{...M,definitions:o}})(n);e.onEdit(Ig(t))},onTypeName:f,onMount:s,onCommit:m,onEdit:(e,t)=>{let r;if(r="object"!=typeof t||void 0===t.commit||t.commit,e){const t={...M,definitions:M.definitions.map((t=>t===n?e:t))};return r?(m(t),t):t}return M},schema:u,getDefaultFieldNames:R,getDefaultScalarArgValue:T,makeDefaultArg:d,onRunOperation:()=>{e.onRunOperation&&e.onRunOperation(o)},styleConfig:p,availableFragments:V})}))),D)},Lg=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).state={hasError:!1,error:null},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.getDerivedStateFromError=function(e){return{hasError:!0,error:e}};var o=r.prototype;return o.componentDidCatch=function(e,t){return this.props.onDidCatch(e,t)},o.render=function(){var e=this.state,t=this.props,n=t.render,r=t.children,o=t.renderError;return e.hasError?o?o({error:e.error}):null:n?n():r||null},r}(v.PureComponent),zg=function(e,t){switch(t.type){case"catch":return{didCatch:!0,error:t.error};case"reset":return{didCatch:!1,error:null};default:return e}},Hg=e=>{let{children:n}=e;const{ErrorBoundary:r,didCatch:o,error:i}=function(e){var t=(0,v.useReducer)(zg,{didCatch:!1,error:null}),n=t[0],r=t[1],o=(0,v.useRef)(null);function i(){return t=function(t,n){r({type:"catch",error:t}),e&&e.onDidCatch&&e.onDidCatch(t,n)},function(e){return h().createElement(Lg,{onDidCatch:t,children:e.children,render:e.render,renderError:e.renderError})};var t}var a,l=(0,v.useCallback)((function(){o.current=i(),r({type:"reset"})}),[]);return{ErrorBoundary:(a=o.current,null!==a?a:(o.current=i(),o.current)),didCatch:n.didCatch,error:n.error,reset:l}}();return o&&console.warn({error:i}),o?(0,t.createElement)("div",{style:{padding:18,fontFamily:"sans-serif"}},(0,t.createElement)("div",null,"Something went wrong"),(0,t.createElement)("details",{style:{whiteSpace:"pre-wrap"}},i?i.message:null,(0,t.createElement)("br",null),i.stack?i.stack:null)):(0,t.createElement)(r,null,n)},$g=n(3279),Wg=n.n($g),Bg=(xr("small","default","large"),null),Ug=function(t){Z(r,t);var n=te(r);function r(t){var o;K(this,r),(o=n.call(this,t)).debouncifyUpdateSpinning=function(e){var t=(e||o.props).delay;t&&(o.cancelExistingSpin(),o.updateSpinning=Wg()(o.originalUpdateSpinning,t))},o.updateSpinning=function(){var e=o.props.spinning;o.state.spinning!==e&&o.setState({spinning:e})},o.renderSpin=function(t){var n,r=t.direction,i=o.props,a=i.spinPrefixCls,l=i.className,c=i.size,s=i.tip,u=i.wrapperClassName,f=i.style,d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{let{schema:n,children:r}=e;return n?(0,t.createElement)("div",{style:{fontSize:12,textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0,padding:0,fontFamily:'Consolas, Inconsolata, "Droid Sans Mono", Monaco, monospace',display:"flex",flexDirection:"column",height:"100%"},className:"graphiql-explorer-root"},r):(0,t.createElement)("div",{style:{fontFamily:"sans-serif",textAlign:"center"},className:"error-container"},(0,t.createElement)(Kg,null))};var Zg=e=>{const{query:n,setQuery:r}=e,{schema:o}=Gg(),[i,a]=Yg(null);return Xg((()=>{const e=O(n);i!==e&&a(e)}),[n]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(p,null,(0,t.createElement)(Hg,null,(0,t.createElement)(Qg,{schema:o},(0,t.createElement)(Vg,{schema:o,query:n,onEdit:e=>{r(e)}})))))};function Jg(e,t){if(null==e)return e;if(0===e.length&&(!t||t&&""!==e))return null;var n=e instanceof Array?e[0]:e;return null==n||t||""!==n?n:null}var ey={encode:function(e){return null==e?e:String(e)},decode:function(e){var t=Jg(e,!0);return null==t?t:String(t)}},ty={encode:function(e){return null==e?e:e?"1":"0"},decode:function(e){var t=Jg(e);return null==t?t:"1"===t||"0"!==t&&null}},ny=n(7563);'{}[],":'.split("").map((function(e){return[e,encodeURIComponent(e)]})),Object.prototype.hasOwnProperty,v.createContext({location:{},getLocation:function(){return{}},setLocation:function(){}}),(0,ny.parse)("");const{hooks:ry}=window.wpGraphiQL;ry.addFilter("graphiql_toolbar_after_buttons","graphiql-extension",((e,n)=>{const{GraphiQL:r}=n,{toggleExplorer:o}=u();return e.push((0,t.createElement)(s.Consumer,{key:"graphiql-query-composer-button"},(e=>(0,t.createElement)(r.Button,{onClick:()=>{o()},label:"Query Composer",title:"Query Composer"})))),e})),ry.addFilter("graphiql_before_graphiql","graphiql-explorer",((n,r)=>(n.push((0,t.createElement)(Zg,e({},r,{key:"graphiql-explorer"}))),n))),ry.addFilter("graphiql_app","graphiql-explorer",((e,n)=>{let{appContext:r}=n;return(0,t.createElement)(f,{appContext:r},e)}),99),ry.addFilter("graphiql_query_params_provider_config","graphiql-explorer",(e=>({...e,isQueryComposerOpen:ty,explorerIsOpen:ey})))}()}(); \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/build/index.asset.php b/lib/wp-graphql-1.17.0/build/index.asset.php new file mode 100644 index 00000000..a35ba105 --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/index.asset.php @@ -0,0 +1 @@ + array('wp-element', 'wp-hooks'), 'version' => '16cb921597c1ed7eed91'); diff --git a/lib/wp-graphql-1.17.0/build/index.js b/lib/wp-graphql-1.17.0/build/index.js new file mode 100644 index 00000000..52de03d8 --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/index.js @@ -0,0 +1 @@ +!function(){"use strict";var e={755:function(e,n,t){t.d(n,{bp:function(){return a},iz:function(){return s}});var r=t(9307),i=t(6428);const o=(0,r.createContext)(),a=()=>(0,r.useContext)(o),s=e=>{let{children:n,setQueryParams:t,queryParams:a}=e;const[s,u]=(0,r.useState)(null),[c,p]=(0,r.useState)(null!==(l=null===(d=window)||void 0===d||null===(f=d.wpGraphiQLSettings)||void 0===f?void 0:f.nonce)&&void 0!==l?l:null);var l,d,f;const[y,m]=(0,r.useState)(null!==(h=null===(T=window)||void 0===T||null===(b=T.wpGraphiQLSettings)||void 0===b?void 0:b.graphqlEndpoint)&&void 0!==h?h:null);var h,T,b;const[v,g]=(0,r.useState)(a);let E={endpoint:y,setEndpoint:m,nonce:c,setNonce:p,schema:s,setSchema:u,queryParams:v,setQueryParams:e=>{g(e),t(e)}},N=i.P.applyFilters("graphiql_app_context",E);return(0,r.createElement)(o.Provider,{value:N},n)}},6428:function(e,n,t){t.d(n,{P:function(){return a}});var r=t(20),i=window.wp.hooks,o=t(755);const a=(0,i.createHooks)();window.wpGraphiQL={GraphQL:r,hooks:a,useAppContext:o.bp,AppContextProvider:o.iz}},5822:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.GraphQLError=void 0,n.formatError=function(e){return e.toJSON()},n.printError=function(e){return e.toString()};var r=t(5690),i=t(9016),o=t(8038);class a extends Error{constructor(e,...n){var t,o,u;const{nodes:c,source:p,positions:l,path:d,originalError:f,extensions:y}=function(e){const n=e[0];return null==n||"kind"in n||"length"in n?{nodes:n,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:n}(n);super(e),this.name="GraphQLError",this.path=null!=d?d:void 0,this.originalError=null!=f?f:void 0,this.nodes=s(Array.isArray(c)?c:c?[c]:void 0);const m=s(null===(t=this.nodes)||void 0===t?void 0:t.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=p?p:null==m||null===(o=m[0])||void 0===o?void 0:o.source,this.positions=null!=l?l:null==m?void 0:m.map((e=>e.start)),this.locations=l&&p?l.map((e=>(0,i.getLocation)(p,e))):null==m?void 0:m.map((e=>(0,i.getLocation)(e.source,e.start)));const h=(0,r.isObjectLike)(null==f?void 0:f.extensions)?null==f?void 0:f.extensions:void 0;this.extensions=null!==(u=null!=y?y:h)&&void 0!==u?u:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=f&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+(0,o.printLocation)(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+="\n\n"+(0,o.printSourceLocation)(this.source,n);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function s(e){return void 0===e||0===e.length?void 0:e}n.GraphQLError=a},6972:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"GraphQLError",{enumerable:!0,get:function(){return r.GraphQLError}}),Object.defineProperty(n,"formatError",{enumerable:!0,get:function(){return r.formatError}}),Object.defineProperty(n,"locatedError",{enumerable:!0,get:function(){return o.locatedError}}),Object.defineProperty(n,"printError",{enumerable:!0,get:function(){return r.printError}}),Object.defineProperty(n,"syntaxError",{enumerable:!0,get:function(){return i.syntaxError}});var r=t(5822),i=t(338),o=t(1993)},1993:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.locatedError=function(e,n,t){var o;const a=(0,r.toError)(e);return s=a,Array.isArray(s.path)?a:new i.GraphQLError(a.message,{nodes:null!==(o=a.nodes)&&void 0!==o?o:n,source:a.source,positions:a.positions,path:t,originalError:a});var s};var r=t(7729),i=t(5822)},338:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.syntaxError=function(e,n,t){return new r.GraphQLError(`Syntax Error: ${t}`,{source:e,positions:[n]})};var r=t(5822)},8950:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.collectFields=function(e,n,t,r,i){const o=new Map;return u(e,n,t,r,i,o,new Set),o},n.collectSubfields=function(e,n,t,r,i){const o=new Map,a=new Set;for(const s of i)s.selectionSet&&u(e,n,t,r,s.selectionSet,o,a);return o};var r=t(2828),i=t(5003),o=t(7197),a=t(5115),s=t(8840);function u(e,n,t,i,o,a,s){for(const d of o.selections)switch(d.kind){case r.Kind.FIELD:{if(!c(t,d))continue;const e=(l=d).alias?l.alias.value:l.name.value,n=a.get(e);void 0!==n?n.push(d):a.set(e,[d]);break}case r.Kind.INLINE_FRAGMENT:if(!c(t,d)||!p(e,d,i))continue;u(e,n,t,i,d.selectionSet,a,s);break;case r.Kind.FRAGMENT_SPREAD:{const r=d.name.value;if(s.has(r)||!c(t,d))continue;s.add(r);const o=n[r];if(!o||!p(e,o,i))continue;u(e,n,t,i,o.selectionSet,a,s);break}}var l}function c(e,n){const t=(0,s.getDirectiveValues)(o.GraphQLSkipDirective,n,e);if(!0===(null==t?void 0:t.if))return!1;const r=(0,s.getDirectiveValues)(o.GraphQLIncludeDirective,n,e);return!1!==(null==r?void 0:r.if)}function p(e,n,t){const r=n.typeCondition;if(!r)return!0;const o=(0,a.typeFromAST)(e,r);return o===t||!!(0,i.isAbstractType)(o)&&e.isSubType(o,t)}},192:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.assertValidExecutionArguments=_,n.buildExecutionContext=L,n.buildResolveInfo=A,n.defaultTypeResolver=n.defaultFieldResolver=void 0,n.execute=O,n.executeSync=function(e){const n=O(e);if((0,u.isPromise)(n))throw new Error("GraphQL execution failed to complete synchronously.");return n},n.getFieldDef=V;var r=t(7242),i=t(8002),o=t(7706),a=t(6609),s=t(5690),u=t(4221),c=t(5456),p=t(7059),l=t(3179),d=t(9915),f=t(5822),y=t(1993),m=t(1807),h=t(2828),T=t(5003),b=t(8155),v=t(1671),g=t(8950),E=t(8840);const N=(0,c.memoize3)(((e,n,t)=>(0,g.collectSubfields)(e.schema,e.fragments,e.variableValues,n,t)));function O(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:n,document:t,variableValues:i,rootValue:o}=e;_(n,t,i);const a=L(e);if(!("schema"in a))return{errors:a};try{const{operation:e}=a,n=S(a,e,o);return(0,u.isPromise)(n)?n.then((e=>I(e,a.errors)),(e=>(a.errors.push(e),I(null,a.errors)))):I(n,a.errors)}catch(e){return a.errors.push(e),I(null,a.errors)}}function I(e,n){return 0===n.length?{data:e}:{errors:n,data:e}}function _(e,n,t){n||(0,r.devAssert)(!1,"Must provide document."),(0,v.assertValidSchema)(e),null==t||(0,s.isObjectLike)(t)||(0,r.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function L(e){var n,t;const{schema:r,document:i,rootValue:o,contextValue:a,variableValues:s,operationName:u,fieldResolver:c,typeResolver:p,subscribeFieldResolver:l}=e;let d;const y=Object.create(null);for(const e of i.definitions)switch(e.kind){case h.Kind.OPERATION_DEFINITION:if(null==u){if(void 0!==d)return[new f.GraphQLError("Must provide operation name if query contains multiple operations.")];d=e}else(null===(n=e.name)||void 0===n?void 0:n.value)===u&&(d=e);break;case h.Kind.FRAGMENT_DEFINITION:y[e.name.value]=e}if(!d)return null!=u?[new f.GraphQLError(`Unknown operation named "${u}".`)]:[new f.GraphQLError("Must provide an operation.")];const m=null!==(t=d.variableDefinitions)&&void 0!==t?t:[],T=(0,E.getVariableValues)(r,m,null!=s?s:{},{maxErrors:50});return T.errors?T.errors:{schema:r,fragments:y,rootValue:o,contextValue:a,operation:d,variableValues:T.coerced,fieldResolver:null!=c?c:G,typeResolver:null!=p?p:x,subscribeFieldResolver:null!=l?l:G,errors:[]}}function S(e,n,t){const r=e.schema.getRootType(n.operation);if(null==r)throw new f.GraphQLError(`Schema is not configured to execute ${n.operation} operation.`,{nodes:n});const i=(0,g.collectFields)(e.schema,e.fragments,e.variableValues,r,n.selectionSet),o=void 0;switch(n.operation){case m.OperationTypeNode.QUERY:return D(e,r,t,o,i);case m.OperationTypeNode.MUTATION:return function(e,n,t,r,i){return(0,d.promiseReduce)(i.entries(),((r,[i,o])=>{const a=(0,p.addPath)(undefined,i,n.name),s=j(e,n,t,o,a);return void 0===s?r:(0,u.isPromise)(s)?s.then((e=>(r[i]=e,r))):(r[i]=s,r)}),Object.create(null))}(e,r,t,0,i);case m.OperationTypeNode.SUBSCRIPTION:return D(e,r,t,o,i)}}function D(e,n,t,r,i){const o=Object.create(null);let a=!1;try{for(const[s,c]of i.entries()){const i=j(e,n,t,c,(0,p.addPath)(r,s,n.name));void 0!==i&&(o[s]=i,(0,u.isPromise)(i)&&(a=!0))}}catch(e){if(a)return(0,l.promiseForObject)(o).finally((()=>{throw e}));throw e}return a?(0,l.promiseForObject)(o):o}function j(e,n,t,r,i){var o;const a=V(e.schema,n,r[0]);if(!a)return;const s=a.type,c=null!==(o=a.resolve)&&void 0!==o?o:e.fieldResolver,l=A(e,a,r,n,i);try{const n=c(t,(0,E.getArgumentValues)(a,r[0],e.variableValues),e.contextValue,l);let o;return o=(0,u.isPromise)(n)?n.then((n=>R(e,s,r,l,i,n))):R(e,s,r,l,i,n),(0,u.isPromise)(o)?o.then(void 0,(n=>P((0,y.locatedError)(n,r,(0,p.pathToArray)(i)),s,e))):o}catch(n){return P((0,y.locatedError)(n,r,(0,p.pathToArray)(i)),s,e)}}function A(e,n,t,r,i){return{fieldName:n.name,fieldNodes:t,returnType:n.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function P(e,n,t){if((0,T.isNonNullType)(n))throw e;return t.errors.push(e),null}function R(e,n,t,r,s,c){if(c instanceof Error)throw c;if((0,T.isNonNullType)(n)){const i=R(e,n.ofType,t,r,s,c);if(null===i)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return i}return null==c?null:(0,T.isListType)(n)?function(e,n,t,r,i,o){if(!(0,a.isIterableObject)(o))throw new f.GraphQLError(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const s=n.ofType;let c=!1;const l=Array.from(o,((n,o)=>{const a=(0,p.addPath)(i,o,void 0);try{let i;return i=(0,u.isPromise)(n)?n.then((n=>R(e,s,t,r,a,n))):R(e,s,t,r,a,n),(0,u.isPromise)(i)?(c=!0,i.then(void 0,(n=>P((0,y.locatedError)(n,t,(0,p.pathToArray)(a)),s,e)))):i}catch(n){return P((0,y.locatedError)(n,t,(0,p.pathToArray)(a)),s,e)}}));return c?Promise.all(l):l}(e,n,t,r,s,c):(0,T.isLeafType)(n)?function(e,n){const t=e.serialize(n);if(null==t)throw new Error(`Expected \`${(0,i.inspect)(e)}.serialize(${(0,i.inspect)(n)})\` to return non-nullable value, returned: ${(0,i.inspect)(t)}`);return t}(n,c):(0,T.isAbstractType)(n)?function(e,n,t,r,i,o){var a;const s=null!==(a=n.resolveType)&&void 0!==a?a:e.typeResolver,c=e.contextValue,p=s(o,c,r,n);return(0,u.isPromise)(p)?p.then((a=>k(e,w(a,e,n,t,r,o),t,r,i,o))):k(e,w(p,e,n,t,r,o),t,r,i,o)}(e,n,t,r,s,c):(0,T.isObjectType)(n)?k(e,n,t,r,s,c):void(0,o.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,i.inspect)(n))}function w(e,n,t,r,o,a){if(null==e)throw new f.GraphQLError(`Abstract type "${t.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}". Either the "${t.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if((0,T.isObjectType)(e))throw new f.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new f.GraphQLError(`Abstract type "${t.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}" with value ${(0,i.inspect)(a)}, received "${(0,i.inspect)(e)}".`);const s=n.schema.getType(e);if(null==s)throw new f.GraphQLError(`Abstract type "${t.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!(0,T.isObjectType)(s))throw new f.GraphQLError(`Abstract type "${t.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!n.schema.isSubType(t,s))throw new f.GraphQLError(`Runtime Object type "${s.name}" is not a possible type for "${t.name}".`,{nodes:r});return s}function k(e,n,t,r,i,o){const a=N(e,n,t);if(n.isTypeOf){const s=n.isTypeOf(o,e.contextValue,r);if((0,u.isPromise)(s))return s.then((r=>{if(!r)throw F(n,o,t);return D(e,n,o,i,a)}));if(!s)throw F(n,o,t)}return D(e,n,o,i,a)}function F(e,n,t){return new f.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,i.inspect)(n)}.`,{nodes:t})}const x=function(e,n,t,r){if((0,s.isObjectLike)(e)&&"string"==typeof e.__typename)return e.__typename;const i=t.schema.getPossibleTypes(r),o=[];for(let r=0;r{for(let n=0;nr(await t.next()),return:async()=>"function"==typeof t.return?r(await t.return()):{value:void 0,done:!0},async throw(e){if("function"==typeof t.throw)return r(await t.throw(e));throw e},[Symbol.asyncIterator](){return this}}}},6234:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.createSourceEventStream=f,n.subscribe=async function(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const n=await f(e);if(!(0,o.isAsyncIterable)(n))return n;const t=n=>(0,p.execute)({...e,rootValue:n});return(0,l.mapAsyncIterator)(n,t)};var r=t(7242),i=t(8002),o=t(8648),a=t(7059),s=t(5822),u=t(1993),c=t(8950),p=t(192),l=t(6082),d=t(8840);async function f(...e){const n=function(e){const n=e[0];return n&&"document"in n?n:{schema:n,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}(e),{schema:t,document:r,variableValues:l}=n;(0,p.assertValidExecutionArguments)(t,r,l);const f=(0,p.buildExecutionContext)(n);if(!("schema"in f))return{errors:f};try{const e=await async function(e){const{schema:n,fragments:t,operation:r,variableValues:i,rootValue:o}=e,l=n.getSubscriptionType();if(null==l)throw new s.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:r});const f=(0,c.collectFields)(n,t,i,l,r.selectionSet),[y,m]=[...f.entries()][0],h=(0,p.getFieldDef)(n,l,m[0]);if(!h){const e=m[0].name.value;throw new s.GraphQLError(`The subscription field "${e}" is not defined.`,{nodes:m})}const T=(0,a.addPath)(void 0,y,l.name),b=(0,p.buildResolveInfo)(e,h,m,l,T);try{var v;const n=(0,d.getArgumentValues)(h,m[0],i),t=e.contextValue,r=null!==(v=h.subscribe)&&void 0!==v?v:e.subscribeFieldResolver,a=await r(o,n,t,b);if(a instanceof Error)throw a;return a}catch(e){throw(0,u.locatedError)(e,m,(0,a.pathToArray)(T))}}(f);if(!(0,o.isAsyncIterable)(e))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,i.inspect)(e)}.`);return e}catch(e){if(e instanceof s.GraphQLError)return{errors:[e]};throw e}}},8840:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.getArgumentValues=f,n.getDirectiveValues=function(e,n,t){var r;const i=null===(r=n.directives)||void 0===r?void 0:r.find((n=>n.name.value===e.name));if(i)return f(e,i,t)},n.getVariableValues=function(e,n,t,i){const s=[],f=null==i?void 0:i.maxErrors;try{const i=function(e,n,t,i){const s={};for(const f of n){const n=f.variable.name.value,m=(0,l.typeFromAST)(e,f.type);if(!(0,c.isInputType)(m)){const e=(0,u.print)(f.type);i(new a.GraphQLError(`Variable "$${n}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:f.type}));continue}if(!y(t,n)){if(f.defaultValue)s[n]=(0,d.valueFromAST)(f.defaultValue,m);else if((0,c.isNonNullType)(m)){const e=(0,r.inspect)(m);i(new a.GraphQLError(`Variable "$${n}" of required type "${e}" was not provided.`,{nodes:f}))}continue}const h=t[n];if(null===h&&(0,c.isNonNullType)(m)){const e=(0,r.inspect)(m);i(new a.GraphQLError(`Variable "$${n}" of non-null type "${e}" must not be null.`,{nodes:f}))}else s[n]=(0,p.coerceInputValue)(h,m,((e,t,s)=>{let u=`Variable "$${n}" got invalid value `+(0,r.inspect)(t);e.length>0&&(u+=` at "${n}${(0,o.printPathArray)(e)}"`),i(new a.GraphQLError(u+"; "+s.message,{nodes:f,originalError:s}))}))}return s}(e,n,t,(e=>{if(null!=f&&s.length>=f)throw new a.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");s.push(e)}));if(0===s.length)return{coerced:i}}catch(e){s.push(e)}return{errors:s}};var r=t(8002),i=t(2863),o=t(737),a=t(5822),s=t(2828),u=t(3033),c=t(5003),p=t(3679),l=t(5115),d=t(3770);function f(e,n,t){var o;const p={},l=null!==(o=n.arguments)&&void 0!==o?o:[],f=(0,i.keyMap)(l,(e=>e.name.value));for(const i of e.args){const e=i.name,o=i.type,l=f[e];if(!l){if(void 0!==i.defaultValue)p[e]=i.defaultValue;else if((0,c.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of required type "${(0,r.inspect)(o)}" was not provided.`,{nodes:n});continue}const m=l.value;let h=m.kind===s.Kind.NULL;if(m.kind===s.Kind.VARIABLE){const n=m.name.value;if(null==t||!y(t,n)){if(void 0!==i.defaultValue)p[e]=i.defaultValue;else if((0,c.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of required type "${(0,r.inspect)(o)}" was provided the variable "$${n}" which was not provided a runtime value.`,{nodes:m});continue}h=null==t[n]}if(h&&(0,c.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of non-null type "${(0,r.inspect)(o)}" must not be null.`,{nodes:m});const T=(0,d.valueFromAST)(m,o,t);if(void 0===T)throw new a.GraphQLError(`Argument "${e}" has invalid value ${(0,u.print)(m)}.`,{nodes:m});p[e]=T}return p}function y(e,n){return Object.prototype.hasOwnProperty.call(e,n)}},9728:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.graphql=function(e){return new Promise((n=>n(c(e))))},n.graphqlSync=function(e){const n=c(e);if((0,i.isPromise)(n))throw new Error("GraphQL execution failed to complete synchronously.");return n};var r=t(7242),i=t(4221),o=t(8370),a=t(1671),s=t(9504),u=t(192);function c(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:n,source:t,rootValue:i,contextValue:c,variableValues:p,operationName:l,fieldResolver:d,typeResolver:f}=e,y=(0,a.validateSchema)(n);if(y.length>0)return{errors:y};let m;try{m=(0,o.parse)(t)}catch(e){return{errors:[e]}}const h=(0,s.validate)(n,m);return h.length>0?{errors:h}:(0,u.execute)({schema:n,document:m,rootValue:i,contextValue:c,variableValues:p,operationName:l,fieldResolver:d,typeResolver:f})}},20:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BREAK",{enumerable:!0,get:function(){return a.BREAK}}),Object.defineProperty(n,"BreakingChangeType",{enumerable:!0,get:function(){return p.BreakingChangeType}}),Object.defineProperty(n,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return o.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(n,"DangerousChangeType",{enumerable:!0,get:function(){return p.DangerousChangeType}}),Object.defineProperty(n,"DirectiveLocation",{enumerable:!0,get:function(){return a.DirectiveLocation}}),Object.defineProperty(n,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return u.ExecutableDefinitionsRule}}),Object.defineProperty(n,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return u.FieldsOnCorrectTypeRule}}),Object.defineProperty(n,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return u.FragmentsOnCompositeTypesRule}}),Object.defineProperty(n,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return o.GRAPHQL_MAX_INT}}),Object.defineProperty(n,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return o.GRAPHQL_MIN_INT}}),Object.defineProperty(n,"GraphQLBoolean",{enumerable:!0,get:function(){return o.GraphQLBoolean}}),Object.defineProperty(n,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return o.GraphQLDeprecatedDirective}}),Object.defineProperty(n,"GraphQLDirective",{enumerable:!0,get:function(){return o.GraphQLDirective}}),Object.defineProperty(n,"GraphQLEnumType",{enumerable:!0,get:function(){return o.GraphQLEnumType}}),Object.defineProperty(n,"GraphQLError",{enumerable:!0,get:function(){return c.GraphQLError}}),Object.defineProperty(n,"GraphQLFloat",{enumerable:!0,get:function(){return o.GraphQLFloat}}),Object.defineProperty(n,"GraphQLID",{enumerable:!0,get:function(){return o.GraphQLID}}),Object.defineProperty(n,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return o.GraphQLIncludeDirective}}),Object.defineProperty(n,"GraphQLInputObjectType",{enumerable:!0,get:function(){return o.GraphQLInputObjectType}}),Object.defineProperty(n,"GraphQLInt",{enumerable:!0,get:function(){return o.GraphQLInt}}),Object.defineProperty(n,"GraphQLInterfaceType",{enumerable:!0,get:function(){return o.GraphQLInterfaceType}}),Object.defineProperty(n,"GraphQLList",{enumerable:!0,get:function(){return o.GraphQLList}}),Object.defineProperty(n,"GraphQLNonNull",{enumerable:!0,get:function(){return o.GraphQLNonNull}}),Object.defineProperty(n,"GraphQLObjectType",{enumerable:!0,get:function(){return o.GraphQLObjectType}}),Object.defineProperty(n,"GraphQLScalarType",{enumerable:!0,get:function(){return o.GraphQLScalarType}}),Object.defineProperty(n,"GraphQLSchema",{enumerable:!0,get:function(){return o.GraphQLSchema}}),Object.defineProperty(n,"GraphQLSkipDirective",{enumerable:!0,get:function(){return o.GraphQLSkipDirective}}),Object.defineProperty(n,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return o.GraphQLSpecifiedByDirective}}),Object.defineProperty(n,"GraphQLString",{enumerable:!0,get:function(){return o.GraphQLString}}),Object.defineProperty(n,"GraphQLUnionType",{enumerable:!0,get:function(){return o.GraphQLUnionType}}),Object.defineProperty(n,"Kind",{enumerable:!0,get:function(){return a.Kind}}),Object.defineProperty(n,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return u.KnownArgumentNamesRule}}),Object.defineProperty(n,"KnownDirectivesRule",{enumerable:!0,get:function(){return u.KnownDirectivesRule}}),Object.defineProperty(n,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return u.KnownFragmentNamesRule}}),Object.defineProperty(n,"KnownTypeNamesRule",{enumerable:!0,get:function(){return u.KnownTypeNamesRule}}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return a.Lexer}}),Object.defineProperty(n,"Location",{enumerable:!0,get:function(){return a.Location}}),Object.defineProperty(n,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return u.LoneAnonymousOperationRule}}),Object.defineProperty(n,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return u.LoneSchemaDefinitionRule}}),Object.defineProperty(n,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return u.NoDeprecatedCustomRule}}),Object.defineProperty(n,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return u.NoFragmentCyclesRule}}),Object.defineProperty(n,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return u.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(n,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return u.NoUndefinedVariablesRule}}),Object.defineProperty(n,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return u.NoUnusedFragmentsRule}}),Object.defineProperty(n,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return u.NoUnusedVariablesRule}}),Object.defineProperty(n,"OperationTypeNode",{enumerable:!0,get:function(){return a.OperationTypeNode}}),Object.defineProperty(n,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return u.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(n,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return u.PossibleFragmentSpreadsRule}}),Object.defineProperty(n,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return u.PossibleTypeExtensionsRule}}),Object.defineProperty(n,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return u.ProvidedRequiredArgumentsRule}}),Object.defineProperty(n,"ScalarLeafsRule",{enumerable:!0,get:function(){return u.ScalarLeafsRule}}),Object.defineProperty(n,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return o.SchemaMetaFieldDef}}),Object.defineProperty(n,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return u.SingleFieldSubscriptionsRule}}),Object.defineProperty(n,"Source",{enumerable:!0,get:function(){return a.Source}}),Object.defineProperty(n,"Token",{enumerable:!0,get:function(){return a.Token}}),Object.defineProperty(n,"TokenKind",{enumerable:!0,get:function(){return a.TokenKind}}),Object.defineProperty(n,"TypeInfo",{enumerable:!0,get:function(){return p.TypeInfo}}),Object.defineProperty(n,"TypeKind",{enumerable:!0,get:function(){return o.TypeKind}}),Object.defineProperty(n,"TypeMetaFieldDef",{enumerable:!0,get:function(){return o.TypeMetaFieldDef}}),Object.defineProperty(n,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return o.TypeNameMetaFieldDef}}),Object.defineProperty(n,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return u.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(n,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return u.UniqueArgumentNamesRule}}),Object.defineProperty(n,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return u.UniqueDirectiveNamesRule}}),Object.defineProperty(n,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return u.UniqueDirectivesPerLocationRule}}),Object.defineProperty(n,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return u.UniqueEnumValueNamesRule}}),Object.defineProperty(n,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return u.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(n,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return u.UniqueFragmentNamesRule}}),Object.defineProperty(n,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return u.UniqueInputFieldNamesRule}}),Object.defineProperty(n,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return u.UniqueOperationNamesRule}}),Object.defineProperty(n,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return u.UniqueOperationTypesRule}}),Object.defineProperty(n,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return u.UniqueTypeNamesRule}}),Object.defineProperty(n,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return u.UniqueVariableNamesRule}}),Object.defineProperty(n,"ValidationContext",{enumerable:!0,get:function(){return u.ValidationContext}}),Object.defineProperty(n,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return u.ValuesOfCorrectTypeRule}}),Object.defineProperty(n,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return u.VariablesAreInputTypesRule}}),Object.defineProperty(n,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return u.VariablesInAllowedPositionRule}}),Object.defineProperty(n,"__Directive",{enumerable:!0,get:function(){return o.__Directive}}),Object.defineProperty(n,"__DirectiveLocation",{enumerable:!0,get:function(){return o.__DirectiveLocation}}),Object.defineProperty(n,"__EnumValue",{enumerable:!0,get:function(){return o.__EnumValue}}),Object.defineProperty(n,"__Field",{enumerable:!0,get:function(){return o.__Field}}),Object.defineProperty(n,"__InputValue",{enumerable:!0,get:function(){return o.__InputValue}}),Object.defineProperty(n,"__Schema",{enumerable:!0,get:function(){return o.__Schema}}),Object.defineProperty(n,"__Type",{enumerable:!0,get:function(){return o.__Type}}),Object.defineProperty(n,"__TypeKind",{enumerable:!0,get:function(){return o.__TypeKind}}),Object.defineProperty(n,"assertAbstractType",{enumerable:!0,get:function(){return o.assertAbstractType}}),Object.defineProperty(n,"assertCompositeType",{enumerable:!0,get:function(){return o.assertCompositeType}}),Object.defineProperty(n,"assertDirective",{enumerable:!0,get:function(){return o.assertDirective}}),Object.defineProperty(n,"assertEnumType",{enumerable:!0,get:function(){return o.assertEnumType}}),Object.defineProperty(n,"assertEnumValueName",{enumerable:!0,get:function(){return o.assertEnumValueName}}),Object.defineProperty(n,"assertInputObjectType",{enumerable:!0,get:function(){return o.assertInputObjectType}}),Object.defineProperty(n,"assertInputType",{enumerable:!0,get:function(){return o.assertInputType}}),Object.defineProperty(n,"assertInterfaceType",{enumerable:!0,get:function(){return o.assertInterfaceType}}),Object.defineProperty(n,"assertLeafType",{enumerable:!0,get:function(){return o.assertLeafType}}),Object.defineProperty(n,"assertListType",{enumerable:!0,get:function(){return o.assertListType}}),Object.defineProperty(n,"assertName",{enumerable:!0,get:function(){return o.assertName}}),Object.defineProperty(n,"assertNamedType",{enumerable:!0,get:function(){return o.assertNamedType}}),Object.defineProperty(n,"assertNonNullType",{enumerable:!0,get:function(){return o.assertNonNullType}}),Object.defineProperty(n,"assertNullableType",{enumerable:!0,get:function(){return o.assertNullableType}}),Object.defineProperty(n,"assertObjectType",{enumerable:!0,get:function(){return o.assertObjectType}}),Object.defineProperty(n,"assertOutputType",{enumerable:!0,get:function(){return o.assertOutputType}}),Object.defineProperty(n,"assertScalarType",{enumerable:!0,get:function(){return o.assertScalarType}}),Object.defineProperty(n,"assertSchema",{enumerable:!0,get:function(){return o.assertSchema}}),Object.defineProperty(n,"assertType",{enumerable:!0,get:function(){return o.assertType}}),Object.defineProperty(n,"assertUnionType",{enumerable:!0,get:function(){return o.assertUnionType}}),Object.defineProperty(n,"assertValidName",{enumerable:!0,get:function(){return p.assertValidName}}),Object.defineProperty(n,"assertValidSchema",{enumerable:!0,get:function(){return o.assertValidSchema}}),Object.defineProperty(n,"assertWrappingType",{enumerable:!0,get:function(){return o.assertWrappingType}}),Object.defineProperty(n,"astFromValue",{enumerable:!0,get:function(){return p.astFromValue}}),Object.defineProperty(n,"buildASTSchema",{enumerable:!0,get:function(){return p.buildASTSchema}}),Object.defineProperty(n,"buildClientSchema",{enumerable:!0,get:function(){return p.buildClientSchema}}),Object.defineProperty(n,"buildSchema",{enumerable:!0,get:function(){return p.buildSchema}}),Object.defineProperty(n,"coerceInputValue",{enumerable:!0,get:function(){return p.coerceInputValue}}),Object.defineProperty(n,"concatAST",{enumerable:!0,get:function(){return p.concatAST}}),Object.defineProperty(n,"createSourceEventStream",{enumerable:!0,get:function(){return s.createSourceEventStream}}),Object.defineProperty(n,"defaultFieldResolver",{enumerable:!0,get:function(){return s.defaultFieldResolver}}),Object.defineProperty(n,"defaultTypeResolver",{enumerable:!0,get:function(){return s.defaultTypeResolver}}),Object.defineProperty(n,"doTypesOverlap",{enumerable:!0,get:function(){return p.doTypesOverlap}}),Object.defineProperty(n,"execute",{enumerable:!0,get:function(){return s.execute}}),Object.defineProperty(n,"executeSync",{enumerable:!0,get:function(){return s.executeSync}}),Object.defineProperty(n,"extendSchema",{enumerable:!0,get:function(){return p.extendSchema}}),Object.defineProperty(n,"findBreakingChanges",{enumerable:!0,get:function(){return p.findBreakingChanges}}),Object.defineProperty(n,"findDangerousChanges",{enumerable:!0,get:function(){return p.findDangerousChanges}}),Object.defineProperty(n,"formatError",{enumerable:!0,get:function(){return c.formatError}}),Object.defineProperty(n,"getArgumentValues",{enumerable:!0,get:function(){return s.getArgumentValues}}),Object.defineProperty(n,"getDirectiveValues",{enumerable:!0,get:function(){return s.getDirectiveValues}}),Object.defineProperty(n,"getEnterLeaveForKind",{enumerable:!0,get:function(){return a.getEnterLeaveForKind}}),Object.defineProperty(n,"getIntrospectionQuery",{enumerable:!0,get:function(){return p.getIntrospectionQuery}}),Object.defineProperty(n,"getLocation",{enumerable:!0,get:function(){return a.getLocation}}),Object.defineProperty(n,"getNamedType",{enumerable:!0,get:function(){return o.getNamedType}}),Object.defineProperty(n,"getNullableType",{enumerable:!0,get:function(){return o.getNullableType}}),Object.defineProperty(n,"getOperationAST",{enumerable:!0,get:function(){return p.getOperationAST}}),Object.defineProperty(n,"getOperationRootType",{enumerable:!0,get:function(){return p.getOperationRootType}}),Object.defineProperty(n,"getVariableValues",{enumerable:!0,get:function(){return s.getVariableValues}}),Object.defineProperty(n,"getVisitFn",{enumerable:!0,get:function(){return a.getVisitFn}}),Object.defineProperty(n,"graphql",{enumerable:!0,get:function(){return i.graphql}}),Object.defineProperty(n,"graphqlSync",{enumerable:!0,get:function(){return i.graphqlSync}}),Object.defineProperty(n,"introspectionFromSchema",{enumerable:!0,get:function(){return p.introspectionFromSchema}}),Object.defineProperty(n,"introspectionTypes",{enumerable:!0,get:function(){return o.introspectionTypes}}),Object.defineProperty(n,"isAbstractType",{enumerable:!0,get:function(){return o.isAbstractType}}),Object.defineProperty(n,"isCompositeType",{enumerable:!0,get:function(){return o.isCompositeType}}),Object.defineProperty(n,"isConstValueNode",{enumerable:!0,get:function(){return a.isConstValueNode}}),Object.defineProperty(n,"isDefinitionNode",{enumerable:!0,get:function(){return a.isDefinitionNode}}),Object.defineProperty(n,"isDirective",{enumerable:!0,get:function(){return o.isDirective}}),Object.defineProperty(n,"isEnumType",{enumerable:!0,get:function(){return o.isEnumType}}),Object.defineProperty(n,"isEqualType",{enumerable:!0,get:function(){return p.isEqualType}}),Object.defineProperty(n,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return a.isExecutableDefinitionNode}}),Object.defineProperty(n,"isInputObjectType",{enumerable:!0,get:function(){return o.isInputObjectType}}),Object.defineProperty(n,"isInputType",{enumerable:!0,get:function(){return o.isInputType}}),Object.defineProperty(n,"isInterfaceType",{enumerable:!0,get:function(){return o.isInterfaceType}}),Object.defineProperty(n,"isIntrospectionType",{enumerable:!0,get:function(){return o.isIntrospectionType}}),Object.defineProperty(n,"isLeafType",{enumerable:!0,get:function(){return o.isLeafType}}),Object.defineProperty(n,"isListType",{enumerable:!0,get:function(){return o.isListType}}),Object.defineProperty(n,"isNamedType",{enumerable:!0,get:function(){return o.isNamedType}}),Object.defineProperty(n,"isNonNullType",{enumerable:!0,get:function(){return o.isNonNullType}}),Object.defineProperty(n,"isNullableType",{enumerable:!0,get:function(){return o.isNullableType}}),Object.defineProperty(n,"isObjectType",{enumerable:!0,get:function(){return o.isObjectType}}),Object.defineProperty(n,"isOutputType",{enumerable:!0,get:function(){return o.isOutputType}}),Object.defineProperty(n,"isRequiredArgument",{enumerable:!0,get:function(){return o.isRequiredArgument}}),Object.defineProperty(n,"isRequiredInputField",{enumerable:!0,get:function(){return o.isRequiredInputField}}),Object.defineProperty(n,"isScalarType",{enumerable:!0,get:function(){return o.isScalarType}}),Object.defineProperty(n,"isSchema",{enumerable:!0,get:function(){return o.isSchema}}),Object.defineProperty(n,"isSelectionNode",{enumerable:!0,get:function(){return a.isSelectionNode}}),Object.defineProperty(n,"isSpecifiedDirective",{enumerable:!0,get:function(){return o.isSpecifiedDirective}}),Object.defineProperty(n,"isSpecifiedScalarType",{enumerable:!0,get:function(){return o.isSpecifiedScalarType}}),Object.defineProperty(n,"isType",{enumerable:!0,get:function(){return o.isType}}),Object.defineProperty(n,"isTypeDefinitionNode",{enumerable:!0,get:function(){return a.isTypeDefinitionNode}}),Object.defineProperty(n,"isTypeExtensionNode",{enumerable:!0,get:function(){return a.isTypeExtensionNode}}),Object.defineProperty(n,"isTypeNode",{enumerable:!0,get:function(){return a.isTypeNode}}),Object.defineProperty(n,"isTypeSubTypeOf",{enumerable:!0,get:function(){return p.isTypeSubTypeOf}}),Object.defineProperty(n,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return a.isTypeSystemDefinitionNode}}),Object.defineProperty(n,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return a.isTypeSystemExtensionNode}}),Object.defineProperty(n,"isUnionType",{enumerable:!0,get:function(){return o.isUnionType}}),Object.defineProperty(n,"isValidNameError",{enumerable:!0,get:function(){return p.isValidNameError}}),Object.defineProperty(n,"isValueNode",{enumerable:!0,get:function(){return a.isValueNode}}),Object.defineProperty(n,"isWrappingType",{enumerable:!0,get:function(){return o.isWrappingType}}),Object.defineProperty(n,"lexicographicSortSchema",{enumerable:!0,get:function(){return p.lexicographicSortSchema}}),Object.defineProperty(n,"locatedError",{enumerable:!0,get:function(){return c.locatedError}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return a.parse}}),Object.defineProperty(n,"parseConstValue",{enumerable:!0,get:function(){return a.parseConstValue}}),Object.defineProperty(n,"parseType",{enumerable:!0,get:function(){return a.parseType}}),Object.defineProperty(n,"parseValue",{enumerable:!0,get:function(){return a.parseValue}}),Object.defineProperty(n,"print",{enumerable:!0,get:function(){return a.print}}),Object.defineProperty(n,"printError",{enumerable:!0,get:function(){return c.printError}}),Object.defineProperty(n,"printIntrospectionSchema",{enumerable:!0,get:function(){return p.printIntrospectionSchema}}),Object.defineProperty(n,"printLocation",{enumerable:!0,get:function(){return a.printLocation}}),Object.defineProperty(n,"printSchema",{enumerable:!0,get:function(){return p.printSchema}}),Object.defineProperty(n,"printSourceLocation",{enumerable:!0,get:function(){return a.printSourceLocation}}),Object.defineProperty(n,"printType",{enumerable:!0,get:function(){return p.printType}}),Object.defineProperty(n,"resolveObjMapThunk",{enumerable:!0,get:function(){return o.resolveObjMapThunk}}),Object.defineProperty(n,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return o.resolveReadonlyArrayThunk}}),Object.defineProperty(n,"responsePathAsArray",{enumerable:!0,get:function(){return s.responsePathAsArray}}),Object.defineProperty(n,"separateOperations",{enumerable:!0,get:function(){return p.separateOperations}}),Object.defineProperty(n,"specifiedDirectives",{enumerable:!0,get:function(){return o.specifiedDirectives}}),Object.defineProperty(n,"specifiedRules",{enumerable:!0,get:function(){return u.specifiedRules}}),Object.defineProperty(n,"specifiedScalarTypes",{enumerable:!0,get:function(){return o.specifiedScalarTypes}}),Object.defineProperty(n,"stripIgnoredCharacters",{enumerable:!0,get:function(){return p.stripIgnoredCharacters}}),Object.defineProperty(n,"subscribe",{enumerable:!0,get:function(){return s.subscribe}}),Object.defineProperty(n,"syntaxError",{enumerable:!0,get:function(){return c.syntaxError}}),Object.defineProperty(n,"typeFromAST",{enumerable:!0,get:function(){return p.typeFromAST}}),Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return u.validate}}),Object.defineProperty(n,"validateSchema",{enumerable:!0,get:function(){return o.validateSchema}}),Object.defineProperty(n,"valueFromAST",{enumerable:!0,get:function(){return p.valueFromAST}}),Object.defineProperty(n,"valueFromASTUntyped",{enumerable:!0,get:function(){return p.valueFromASTUntyped}}),Object.defineProperty(n,"version",{enumerable:!0,get:function(){return r.version}}),Object.defineProperty(n,"versionInfo",{enumerable:!0,get:function(){return r.versionInfo}}),Object.defineProperty(n,"visit",{enumerable:!0,get:function(){return a.visit}}),Object.defineProperty(n,"visitInParallel",{enumerable:!0,get:function(){return a.visitInParallel}}),Object.defineProperty(n,"visitWithTypeInfo",{enumerable:!0,get:function(){return p.visitWithTypeInfo}});var r=t(8696),i=t(9728),o=t(3226),a=t(2178),s=t(9931),u=t(1122),c=t(6972),p=t(9548)},7059:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.addPath=function(e,n,t){return{prev:e,key:n,typename:t}},n.pathToArray=function(e){const n=[];let t=e;for(;t;)n.push(t.key),t=t.prev;return n.reverse()}},7242:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.devAssert=function(e,n){if(!Boolean(e))throw new Error(n)}},166:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.didYouMean=function(e,n){const[t,r]=n?[e,n]:[void 0,e];let i=" Did you mean ";t&&(i+=t+" ");const o=r.map((e=>`"${e}"`));switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}const a=o.slice(0,5),s=a.pop();return i+a.join(", ")+", or "+s+"?"}},4620:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.groupBy=function(e,n){const t=new Map;for(const r of e){const e=n(r),i=t.get(e);void 0===i?t.set(e,[r]):i.push(r)}return t}},3317:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.identityFunc=function(e){return e}},8002:function(e,n){function t(e,n){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,n){if(null===e)return"null";if(n.includes(e))return"[Circular]";const r=[...n,e];if(function(e){return"function"==typeof e.toJSON}(e)){const n=e.toJSON();if(n!==e)return"string"==typeof n?n:t(n,r)}else if(Array.isArray(e))return function(e,n){if(0===e.length)return"[]";if(n.length>2)return"[Array]";const r=Math.min(10,e.length),i=e.length-r,o=[];for(let i=0;i1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(e,r);return function(e,n){const r=Object.entries(e);if(0===r.length)return"{}";if(n.length>2)return"["+function(e){const n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===n&&"function"==typeof e.constructor){const n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return n}(e)+"]";const i=r.map((([e,r])=>e+": "+t(r,n)));return"{ "+i.join(", ")+" }"}(e,r)}(e,n);default:return String(e)}}Object.defineProperty(n,"__esModule",{value:!0}),n.inspect=function(e){return t(e,[])}},5752:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.instanceOf=void 0;var r=t(8002);const i=globalThis.process&&"production"===globalThis.process.env.NODE_ENV?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if("object"==typeof e&&null!==e){var t;const i=n.prototype[Symbol.toStringTag];if(i===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(t=e.constructor)||void 0===t?void 0:t.name)){const n=(0,r.inspect)(e);throw new Error(`Cannot use ${i} "${n}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};n.instanceOf=i},7706:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.invariant=function(e,n){if(!Boolean(e))throw new Error(null!=n?n:"Unexpected invariant triggered.")}},8648:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isAsyncIterable=function(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}},6609:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isIterableObject=function(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}},5690:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isObjectLike=function(e){return"object"==typeof e&&null!==e}},4221:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isPromise=function(e){return"function"==typeof(null==e?void 0:e.then)}},2863:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.keyMap=function(e,n){const t=Object.create(null);for(const r of e)t[n(r)]=r;return t}},7154:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.keyValMap=function(e,n,t){const r=Object.create(null);for(const i of e)r[n(i)]=t(i);return r}},6124:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.mapValue=function(e,n){const t=Object.create(null);for(const r of Object.keys(e))t[r]=n(e[r],r);return t}},5456:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.memoize3=function(e){let n;return function(t,r,i){void 0===n&&(n=new WeakMap);let o=n.get(t);void 0===o&&(o=new WeakMap,n.set(t,o));let a=o.get(r);void 0===a&&(a=new WeakMap,o.set(r,a));let s=a.get(i);return void 0===s&&(s=e(t,r,i),a.set(i,s)),s}}},5250:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.naturalCompare=function(e,n){let i=0,o=0;for(;i0);let c=0;do{++o,c=10*c+s-t,s=n.charCodeAt(o)}while(r(s)&&c>0);if(uc)return 1}else{if(as)return 1;++i,++o}}return e.length-n.length};const t=48;function r(e){return!isNaN(e)&&t<=e&&e<=57}},737:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.printPathArray=function(e){return e.map((e=>"number"==typeof e?"["+e.toString()+"]":"."+e)).join("")}},3179:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.promiseForObject=function(e){return Promise.all(Object.values(e)).then((n=>{const t=Object.create(null);for(const[r,i]of Object.keys(e).entries())t[i]=n[r];return t}))}},9915:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.promiseReduce=function(e,n,t){let i=t;for(const t of e)i=(0,r.isPromise)(i)?i.then((e=>n(e,t))):n(i,t);return i};var r=t(4221)},8070:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.suggestionList=function(e,n){const t=Object.create(null),o=new i(e),a=Math.floor(.4*e.length)+1;for(const e of n){const n=o.measure(e,a);void 0!==n&&(t[e]=n)}return Object.keys(t).sort(((e,n)=>{const i=t[e]-t[n];return 0!==i?i:(0,r.naturalCompare)(e,n)}))};var r=t(5250);class i{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=o(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,n){if(this._input===e)return 0;const t=e.toLowerCase();if(this._inputLowerCase===t)return 1;let r=o(t),i=this._inputArray;if(r.lengthn)return;const u=this._rows;for(let e=0;e<=s;e++)u[0][e]=e;for(let e=1;e<=a;e++){const t=u[(e-1)%3],o=u[e%3];let a=o[0]=e;for(let n=1;n<=s;n++){const s=r[e-1]===i[n-1]?0:1;let c=Math.min(t[n]+1,o[n-1]+1,t[n-1]+s);if(e>1&&n>1&&r[e-1]===i[n-2]&&r[e-2]===i[n-1]){const t=u[(e-2)%3][n-2];c=Math.min(c,t+1)}cn)return}const c=u[a%3][s];return c<=n?c:void 0}}function o(e){const n=e.length,t=new Array(n);for(let r=0;r0===n?e:e.slice(t))).slice(null!==(n=r)&&void 0!==n?n:0,o+1)},n.isPrintableAsBlockString=function(e){if(""===e)return!0;let n=!0,t=!1,r=!0,i=!1;for(let o=0;o1&&i.slice(1).every((e=>0===e.length||(0,r.isWhiteSpace)(e.charCodeAt(0)))),s=t.endsWith('\\"""'),u=e.endsWith('"')&&!s,c=e.endsWith("\\"),p=u||c,l=!(null!=n&&n.minimize)&&(!o||e.length>70||p||a||s);let d="";const f=o&&(0,r.isWhiteSpace)(e.charCodeAt(0));return(l&&!f||a)&&(d+="\n"),d+=t,(l||p)&&(d+="\n"),'"""'+d+'"""'};var r=t(100);function i(e){let n=0;for(;n=48&&e<=57}function r(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(n,"__esModule",{value:!0}),n.isDigit=t,n.isLetter=r,n.isNameContinue=function(e){return r(e)||t(e)||95===e},n.isNameStart=function(e){return r(e)||95===e},n.isWhiteSpace=function(e){return 9===e||32===e}},8333:function(e,n){var t;Object.defineProperty(n,"__esModule",{value:!0}),n.DirectiveLocation=void 0,n.DirectiveLocation=t,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(t||(n.DirectiveLocation=t={}))},2178:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BREAK",{enumerable:!0,get:function(){return l.BREAK}}),Object.defineProperty(n,"DirectiveLocation",{enumerable:!0,get:function(){return y.DirectiveLocation}}),Object.defineProperty(n,"Kind",{enumerable:!0,get:function(){return a.Kind}}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return u.Lexer}}),Object.defineProperty(n,"Location",{enumerable:!0,get:function(){return d.Location}}),Object.defineProperty(n,"OperationTypeNode",{enumerable:!0,get:function(){return d.OperationTypeNode}}),Object.defineProperty(n,"Source",{enumerable:!0,get:function(){return r.Source}}),Object.defineProperty(n,"Token",{enumerable:!0,get:function(){return d.Token}}),Object.defineProperty(n,"TokenKind",{enumerable:!0,get:function(){return s.TokenKind}}),Object.defineProperty(n,"getEnterLeaveForKind",{enumerable:!0,get:function(){return l.getEnterLeaveForKind}}),Object.defineProperty(n,"getLocation",{enumerable:!0,get:function(){return i.getLocation}}),Object.defineProperty(n,"getVisitFn",{enumerable:!0,get:function(){return l.getVisitFn}}),Object.defineProperty(n,"isConstValueNode",{enumerable:!0,get:function(){return f.isConstValueNode}}),Object.defineProperty(n,"isDefinitionNode",{enumerable:!0,get:function(){return f.isDefinitionNode}}),Object.defineProperty(n,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return f.isExecutableDefinitionNode}}),Object.defineProperty(n,"isSelectionNode",{enumerable:!0,get:function(){return f.isSelectionNode}}),Object.defineProperty(n,"isTypeDefinitionNode",{enumerable:!0,get:function(){return f.isTypeDefinitionNode}}),Object.defineProperty(n,"isTypeExtensionNode",{enumerable:!0,get:function(){return f.isTypeExtensionNode}}),Object.defineProperty(n,"isTypeNode",{enumerable:!0,get:function(){return f.isTypeNode}}),Object.defineProperty(n,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return f.isTypeSystemDefinitionNode}}),Object.defineProperty(n,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return f.isTypeSystemExtensionNode}}),Object.defineProperty(n,"isValueNode",{enumerable:!0,get:function(){return f.isValueNode}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return c.parse}}),Object.defineProperty(n,"parseConstValue",{enumerable:!0,get:function(){return c.parseConstValue}}),Object.defineProperty(n,"parseType",{enumerable:!0,get:function(){return c.parseType}}),Object.defineProperty(n,"parseValue",{enumerable:!0,get:function(){return c.parseValue}}),Object.defineProperty(n,"print",{enumerable:!0,get:function(){return p.print}}),Object.defineProperty(n,"printLocation",{enumerable:!0,get:function(){return o.printLocation}}),Object.defineProperty(n,"printSourceLocation",{enumerable:!0,get:function(){return o.printSourceLocation}}),Object.defineProperty(n,"visit",{enumerable:!0,get:function(){return l.visit}}),Object.defineProperty(n,"visitInParallel",{enumerable:!0,get:function(){return l.visitInParallel}});var r=t(2412),i=t(9016),o=t(8038),a=t(2828),s=t(3175),u=t(4274),c=t(8370),p=t(3033),l=t(285),d=t(1807),f=t(1352),y=t(8333)},2828:function(e,n){var t;Object.defineProperty(n,"__esModule",{value:!0}),n.Kind=void 0,n.Kind=t,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(t||(n.Kind=t={}))},4274:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.Lexer=void 0,n.isPunctuatorTokenKind=function(e){return e===s.TokenKind.BANG||e===s.TokenKind.DOLLAR||e===s.TokenKind.AMP||e===s.TokenKind.PAREN_L||e===s.TokenKind.PAREN_R||e===s.TokenKind.SPREAD||e===s.TokenKind.COLON||e===s.TokenKind.EQUALS||e===s.TokenKind.AT||e===s.TokenKind.BRACKET_L||e===s.TokenKind.BRACKET_R||e===s.TokenKind.BRACE_L||e===s.TokenKind.PIPE||e===s.TokenKind.BRACE_R};var r=t(338),i=t(1807),o=t(849),a=t(100),s=t(3175);class u{constructor(e){const n=new i.Token(s.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==s.TokenKind.EOF)do{if(e.next)e=e.next;else{const n=m(this,e.end);e.next=n,n.prev=e,e=n}}while(e.kind===s.TokenKind.COMMENT);return e}}function c(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function p(e,n){return l(e.charCodeAt(n))&&d(e.charCodeAt(n+1))}function l(e){return e>=55296&&e<=56319}function d(e){return e>=56320&&e<=57343}function f(e,n){const t=e.source.body.codePointAt(n);if(void 0===t)return s.TokenKind.EOF;if(t>=32&&t<=126){const e=String.fromCodePoint(t);return'"'===e?"'\"'":`"${e}"`}return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function y(e,n,t,r,o){const a=e.line,s=1+t-e.lineStart;return new i.Token(n,t,r,a,s,o)}function m(e,n){const t=e.source.body,i=t.length;let o=n;for(;o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function I(e,n){const t=e.source.body;switch(t.charCodeAt(n+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,r.syntaxError)(e.source,n,`Invalid character escape sequence: "${t.slice(n,n+2)}".`)}function _(e,n){const t=e.source.body,i=t.length;let a=e.lineStart,u=n+3,l=u,d="";const m=[];for(;u=n)break;t=a.index+a[0].length,o+=1}return{line:o,column:n+1-t}};var r=t(7706);const i=/\r\n|[\n\r]/g},8370:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.Parser=void 0,n.parse=function(e,n){return new p(e,n).parseDocument()},n.parseConstValue=function(e,n){const t=new p(e,n);t.expectToken(c.TokenKind.SOF);const r=t.parseConstValueLiteral();return t.expectToken(c.TokenKind.EOF),r},n.parseType=function(e,n){const t=new p(e,n);t.expectToken(c.TokenKind.SOF);const r=t.parseTypeReference();return t.expectToken(c.TokenKind.EOF),r},n.parseValue=function(e,n){const t=new p(e,n);t.expectToken(c.TokenKind.SOF);const r=t.parseValueLiteral(!1);return t.expectToken(c.TokenKind.EOF),r};var r=t(338),i=t(1807),o=t(8333),a=t(2828),s=t(4274),u=t(2412),c=t(3175);class p{constructor(e,n={}){const t=(0,u.isSource)(e)?e:new u.Source(e);this._lexer=new s.Lexer(t),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(c.TokenKind.NAME);return this.node(e,{kind:a.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:a.Kind.DOCUMENT,definitions:this.many(c.TokenKind.SOF,this.parseDefinition,c.TokenKind.EOF)})}parseDefinition(){if(this.peek(c.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===c.TokenKind.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(c.TokenKind.BRACE_L))return this.node(e,{kind:a.Kind.OPERATION_DEFINITION,operation:i.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let t;return this.peek(c.TokenKind.NAME)&&(t=this.parseName()),this.node(e,{kind:a.Kind.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(c.TokenKind.NAME);switch(e.value){case"query":return i.OperationTypeNode.QUERY;case"mutation":return i.OperationTypeNode.MUTATION;case"subscription":return i.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(c.TokenKind.PAREN_L,this.parseVariableDefinition,c.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:a.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(c.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(c.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(c.TokenKind.DOLLAR),this.node(e,{kind:a.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:a.Kind.SELECTION_SET,selections:this.many(c.TokenKind.BRACE_L,this.parseSelection,c.TokenKind.BRACE_R)})}parseSelection(){return this.peek(c.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let t,r;return this.expectOptionalToken(c.TokenKind.COLON)?(t=n,r=this.parseName()):r=n,this.node(e,{kind:a.Kind.FIELD,alias:t,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(c.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(c.TokenKind.PAREN_L,n,c.TokenKind.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,t=this.parseName();return this.expectToken(c.TokenKind.COLON),this.node(n,{kind:a.Kind.ARGUMENT,name:t,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(c.TokenKind.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(c.TokenKind.NAME)?this.node(e,{kind:a.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:a.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case c.TokenKind.BRACKET_L:return this.parseList(e);case c.TokenKind.BRACE_L:return this.parseObject(e);case c.TokenKind.INT:return this.advanceLexer(),this.node(n,{kind:a.Kind.INT,value:n.value});case c.TokenKind.FLOAT:return this.advanceLexer(),this.node(n,{kind:a.Kind.FLOAT,value:n.value});case c.TokenKind.STRING:case c.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case c.TokenKind.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:a.Kind.BOOLEAN,value:!0});case"false":return this.node(n,{kind:a.Kind.BOOLEAN,value:!1});case"null":return this.node(n,{kind:a.Kind.NULL});default:return this.node(n,{kind:a.Kind.ENUM,value:n.value})}case c.TokenKind.DOLLAR:if(e){if(this.expectToken(c.TokenKind.DOLLAR),this._lexer.token.kind===c.TokenKind.NAME){const e=this._lexer.token.value;throw(0,r.syntaxError)(this._lexer.source,n.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(n)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:a.Kind.STRING,value:e.value,block:e.kind===c.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:a.Kind.LIST,values:this.any(c.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),c.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:a.Kind.OBJECT,fields:this.any(c.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),c.TokenKind.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,t=this.parseName();return this.expectToken(c.TokenKind.COLON),this.node(n,{kind:a.Kind.OBJECT_FIELD,name:t,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(c.TokenKind.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(c.TokenKind.AT),this.node(n,{kind:a.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(c.TokenKind.BRACKET_L)){const t=this.parseTypeReference();this.expectToken(c.TokenKind.BRACKET_R),n=this.node(e,{kind:a.Kind.LIST_TYPE,type:t})}else n=this.parseNamedType();return this.expectOptionalToken(c.TokenKind.BANG)?this.node(e,{kind:a.Kind.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:a.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(c.TokenKind.STRING)||this.peek(c.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const t=this.parseConstDirectives(),r=this.many(c.TokenKind.BRACE_L,this.parseOperationTypeDefinition,c.TokenKind.BRACE_R);return this.node(e,{kind:a.Kind.SCHEMA_DEFINITION,description:n,directives:t,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(c.TokenKind.COLON);const t=this.parseNamedType();return this.node(e,{kind:a.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:t})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const t=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:a.Kind.SCALAR_TYPE_DEFINITION,description:n,name:t,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const t=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.Kind.OBJECT_TYPE_DEFINITION,description:n,name:t,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(c.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(c.TokenKind.BRACE_L,this.parseFieldDefinition,c.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),t=this.parseName(),r=this.parseArgumentDefs();this.expectToken(c.TokenKind.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:a.Kind.FIELD_DEFINITION,description:n,name:t,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(c.TokenKind.PAREN_L,this.parseInputValueDef,c.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),t=this.parseName();this.expectToken(c.TokenKind.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(c.TokenKind.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:a.Kind.INPUT_VALUE_DEFINITION,description:n,name:t,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const t=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:t,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const t=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:a.Kind.UNION_TYPE_DEFINITION,description:n,name:t,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(c.TokenKind.EQUALS)?this.delimitedMany(c.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const t=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:a.Kind.ENUM_TYPE_DEFINITION,description:n,name:t,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(c.TokenKind.BRACE_L,this.parseEnumValueDefinition,c.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),t=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:a.Kind.ENUM_VALUE_DEFINITION,description:n,name:t,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,`${l(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const t=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:a.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:t,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(c.TokenKind.BRACE_L,this.parseInputValueDef,c.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===c.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),t=this.optionalMany(c.TokenKind.BRACE_L,this.parseOperationTypeDefinition,c.TokenKind.BRACE_R);if(0===n.length&&0===t.length)throw this.unexpected();return this.node(e,{kind:a.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:t})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),t=this.parseConstDirectives();if(0===t.length)throw this.unexpected();return this.node(e,{kind:a.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:t})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),t=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===t.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:t,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),t=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===t.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:t,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),t=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.UNION_TYPE_EXTENSION,name:n,directives:t,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),t=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.ENUM_TYPE_EXTENSION,name:n,directives:t,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),t=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:t,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(c.TokenKind.AT);const t=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:a.Kind.DIRECTIVE_DEFINITION,description:n,name:t,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(c.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(o.DirectiveLocation,n.value))return n;throw this.unexpected(e)}node(e,n){return!0!==this._options.noLocation&&(n.loc=new i.Location(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw(0,r.syntaxError)(this._lexer.source,n.start,`Expected ${d(e)}, found ${l(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const n=this._lexer.token;if(n.kind!==c.TokenKind.NAME||n.value!==e)throw(0,r.syntaxError)(this._lexer.source,n.start,`Expected "${e}", found ${l(n)}.`);this.advanceLexer()}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===c.TokenKind.NAME&&n.value===e&&(this.advanceLexer(),!0)}unexpected(e){const n=null!=e?e:this._lexer.token;return(0,r.syntaxError)(this._lexer.source,n.start,`Unexpected ${l(n)}.`)}any(e,n,t){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(t);)r.push(n.call(this));return r}optionalMany(e,n,t){if(this.expectOptionalToken(e)){const e=[];do{e.push(n.call(this))}while(!this.expectOptionalToken(t));return e}return[]}many(e,n,t){this.expectToken(e);const r=[];do{r.push(n.call(this))}while(!this.expectOptionalToken(t));return r}delimitedMany(e,n){this.expectOptionalToken(e);const t=[];do{t.push(n.call(this))}while(this.expectOptionalToken(e));return t}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(void 0!==e&&n.kind!==c.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,r.syntaxError)(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function l(e){const n=e.value;return d(e.kind)+(null!=n?` "${n}"`:"")}function d(e){return(0,s.isPunctuatorTokenKind)(e)?`"${e}"`:e}n.Parser=p},1352:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.isConstValueNode=function e(n){return o(n)&&(n.kind===r.Kind.LIST?n.values.some(e):n.kind===r.Kind.OBJECT?n.fields.some((n=>e(n.value))):n.kind!==r.Kind.VARIABLE)},n.isDefinitionNode=function(e){return i(e)||a(e)||u(e)},n.isExecutableDefinitionNode=i,n.isSelectionNode=function(e){return e.kind===r.Kind.FIELD||e.kind===r.Kind.FRAGMENT_SPREAD||e.kind===r.Kind.INLINE_FRAGMENT},n.isTypeDefinitionNode=s,n.isTypeExtensionNode=c,n.isTypeNode=function(e){return e.kind===r.Kind.NAMED_TYPE||e.kind===r.Kind.LIST_TYPE||e.kind===r.Kind.NON_NULL_TYPE},n.isTypeSystemDefinitionNode=a,n.isTypeSystemExtensionNode=u,n.isValueNode=o;var r=t(2828);function i(e){return e.kind===r.Kind.OPERATION_DEFINITION||e.kind===r.Kind.FRAGMENT_DEFINITION}function o(e){return e.kind===r.Kind.VARIABLE||e.kind===r.Kind.INT||e.kind===r.Kind.FLOAT||e.kind===r.Kind.STRING||e.kind===r.Kind.BOOLEAN||e.kind===r.Kind.NULL||e.kind===r.Kind.ENUM||e.kind===r.Kind.LIST||e.kind===r.Kind.OBJECT}function a(e){return e.kind===r.Kind.SCHEMA_DEFINITION||s(e)||e.kind===r.Kind.DIRECTIVE_DEFINITION}function s(e){return e.kind===r.Kind.SCALAR_TYPE_DEFINITION||e.kind===r.Kind.OBJECT_TYPE_DEFINITION||e.kind===r.Kind.INTERFACE_TYPE_DEFINITION||e.kind===r.Kind.UNION_TYPE_DEFINITION||e.kind===r.Kind.ENUM_TYPE_DEFINITION||e.kind===r.Kind.INPUT_OBJECT_TYPE_DEFINITION}function u(e){return e.kind===r.Kind.SCHEMA_EXTENSION||c(e)}function c(e){return e.kind===r.Kind.SCALAR_TYPE_EXTENSION||e.kind===r.Kind.OBJECT_TYPE_EXTENSION||e.kind===r.Kind.INTERFACE_TYPE_EXTENSION||e.kind===r.Kind.UNION_TYPE_EXTENSION||e.kind===r.Kind.ENUM_TYPE_EXTENSION||e.kind===r.Kind.INPUT_OBJECT_TYPE_EXTENSION}},8038:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.printLocation=function(e){return i(e.source,(0,r.getLocation)(e.source,e.start))},n.printSourceLocation=i;var r=t(9016);function i(e,n){const t=e.locationOffset.column-1,r="".padStart(t)+e.body,i=n.line-1,a=e.locationOffset.line-1,s=n.line+a,u=1===n.line?t:0,c=n.column+u,p=`${e.name}:${s}:${c}\n`,l=r.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){const e=Math.floor(c/80),n=c%80,t=[];for(let e=0;e["|",e])),["|","^".padStart(n)],["|",t[e+1]]])}return p+o([[s-1+" |",l[i-1]],[`${s} |`,d],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function o(e){const n=e.filter((([e,n])=>void 0!==n)),t=Math.max(...n.map((([e])=>e.length)));return n.map((([e,n])=>e.padStart(t)+(n?" "+n:""))).join("\n")}},8942:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.printString=function(e){return`"${e.replace(t,r)}"`};const t=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function r(e){return i[e.charCodeAt(0)]}const i=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]},3033:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.print=function(e){return(0,o.visit)(e,a)};var r=t(849),i=t(8942),o=t(285);const a={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>s(e.definitions,"\n\n")},OperationDefinition:{leave(e){const n=c("(",s(e.variableDefinitions,", "),")"),t=s([e.operation,s([e.name,n]),s(e.directives," ")]," ");return("query"===t?"":t+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:n,defaultValue:t,directives:r})=>e+": "+n+c(" = ",t)+c(" ",s(r," "))},SelectionSet:{leave:({selections:e})=>u(e)},Field:{leave({alias:e,name:n,arguments:t,directives:r,selectionSet:i}){const o=c("",e,": ")+n;let a=o+c("(",s(t,", "),")");return a.length>80&&(a=o+c("(\n",p(s(t,"\n")),"\n)")),s([a,s(r," "),i]," ")}},Argument:{leave:({name:e,value:n})=>e+": "+n},FragmentSpread:{leave:({name:e,directives:n})=>"..."+e+c(" ",s(n," "))},InlineFragment:{leave:({typeCondition:e,directives:n,selectionSet:t})=>s(["...",c("on ",e),s(n," "),t]," ")},FragmentDefinition:{leave:({name:e,typeCondition:n,variableDefinitions:t,directives:r,selectionSet:i})=>`fragment ${e}${c("(",s(t,", "),")")} on ${n} ${c("",s(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:n})=>n?(0,r.printBlockString)(e):(0,i.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+s(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+s(e,", ")+"}"},ObjectField:{leave:({name:e,value:n})=>e+": "+n},Directive:{leave:({name:e,arguments:n})=>"@"+e+c("(",s(n,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:n,operationTypes:t})=>c("",e,"\n")+s(["schema",s(n," "),u(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:n})=>e+": "+n},ScalarTypeDefinition:{leave:({description:e,name:n,directives:t})=>c("",e,"\n")+s(["scalar",n,s(t," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:n,interfaces:t,directives:r,fields:i})=>c("",e,"\n")+s(["type",n,c("implements ",s(t," & ")),s(r," "),u(i)]," ")},FieldDefinition:{leave:({description:e,name:n,arguments:t,type:r,directives:i})=>c("",e,"\n")+n+(l(t)?c("(\n",p(s(t,"\n")),"\n)"):c("(",s(t,", "),")"))+": "+r+c(" ",s(i," "))},InputValueDefinition:{leave:({description:e,name:n,type:t,defaultValue:r,directives:i})=>c("",e,"\n")+s([n+": "+t,c("= ",r),s(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:n,interfaces:t,directives:r,fields:i})=>c("",e,"\n")+s(["interface",n,c("implements ",s(t," & ")),s(r," "),u(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:n,directives:t,types:r})=>c("",e,"\n")+s(["union",n,s(t," "),c("= ",s(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:n,directives:t,values:r})=>c("",e,"\n")+s(["enum",n,s(t," "),u(r)]," ")},EnumValueDefinition:{leave:({description:e,name:n,directives:t})=>c("",e,"\n")+s([n,s(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:n,directives:t,fields:r})=>c("",e,"\n")+s(["input",n,s(t," "),u(r)]," ")},DirectiveDefinition:{leave:({description:e,name:n,arguments:t,repeatable:r,locations:i})=>c("",e,"\n")+"directive @"+n+(l(t)?c("(\n",p(s(t,"\n")),"\n)"):c("(",s(t,", "),")"))+(r?" repeatable":"")+" on "+s(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:n})=>s(["extend schema",s(e," "),u(n)]," ")},ScalarTypeExtension:{leave:({name:e,directives:n})=>s(["extend scalar",e,s(n," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:n,directives:t,fields:r})=>s(["extend type",e,c("implements ",s(n," & ")),s(t," "),u(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:n,directives:t,fields:r})=>s(["extend interface",e,c("implements ",s(n," & ")),s(t," "),u(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:n,types:t})=>s(["extend union",e,s(n," "),c("= ",s(t," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:n,values:t})=>s(["extend enum",e,s(n," "),u(t)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:n,fields:t})=>s(["extend input",e,s(n," "),u(t)]," ")}};function s(e,n=""){var t;return null!==(t=null==e?void 0:e.filter((e=>e)).join(n))&&void 0!==t?t:""}function u(e){return c("{\n",p(s(e,"\n")),"\n}")}function c(e,n,t=""){return null!=n&&""!==n?e+n+t:""}function p(e){return c(" ",e.replace(/\n/g,"\n "))}function l(e){var n;return null!==(n=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==n&&n}},2412:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.Source=void 0,n.isSource=function(e){return(0,o.instanceOf)(e,a)};var r=t(7242),i=t(8002),o=t(5752);class a{constructor(e,n="GraphQL request",t={line:1,column:1}){"string"==typeof e||(0,r.devAssert)(!1,`Body must be a string. Received: ${(0,i.inspect)(e)}.`),this.body=e,this.name=n,this.locationOffset=t,this.locationOffset.line>0||(0,r.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,r.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}n.Source=a},3175:function(e,n){var t;Object.defineProperty(n,"__esModule",{value:!0}),n.TokenKind=void 0,n.TokenKind=t,function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(t||(n.TokenKind=t={}))},285:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.BREAK=void 0,n.getEnterLeaveForKind=u,n.getVisitFn=function(e,n,t){const{enter:r,leave:i}=u(e,n);return t?i:r},n.visit=function(e,n,t=o.QueryDocumentKeys){const c=new Map;for(const e of Object.values(a.Kind))c.set(e,u(n,e));let p,l,d,f=Array.isArray(e),y=[e],m=-1,h=[],T=e;const b=[],v=[];do{m++;const e=m===y.length,a=e&&0!==h.length;if(e){if(l=0===v.length?void 0:b[b.length-1],T=d,d=v.pop(),a)if(f){T=T.slice();let e=0;for(const[n,t]of h){const r=n-e;null===t?(T.splice(r,1),e++):T[r]=t}}else{T=Object.defineProperties({},Object.getOwnPropertyDescriptors(T));for(const[e,n]of h)T[e]=n}m=p.index,y=p.keys,h=p.edits,f=p.inArray,p=p.prev}else if(d){if(l=f?m:y[m],T=d[l],null==T)continue;b.push(l)}let u;if(!Array.isArray(T)){var g,E;(0,o.isNode)(T)||(0,r.devAssert)(!1,`Invalid AST Node: ${(0,i.inspect)(T)}.`);const t=e?null===(g=c.get(T.kind))||void 0===g?void 0:g.leave:null===(E=c.get(T.kind))||void 0===E?void 0:E.enter;if(u=null==t?void 0:t.call(n,T,l,d,b,v),u===s)break;if(!1===u){if(!e){b.pop();continue}}else if(void 0!==u&&(h.push([l,u]),!e)){if(!(0,o.isNode)(u)){b.pop();continue}T=u}}var N;void 0===u&&a&&h.push([l,T]),e?b.pop():(p={inArray:f,index:m,keys:y,edits:h,prev:p},f=Array.isArray(T),y=f?T:null!==(N=t[T.kind])&&void 0!==N?N:[],m=-1,h=[],d&&v.push(d),d=T)}while(void 0!==p);return 0!==h.length?h[h.length-1][1]:e},n.visitInParallel=function(e){const n=new Array(e.length).fill(null),t=Object.create(null);for(const r of Object.values(a.Kind)){let i=!1;const o=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let n=0;nu((0,T.valueFromASTUntyped)(e,n)),this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(s=e.extensionASTNodes)&&void 0!==s?s:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,r.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,a.inspect)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,r.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,r.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}n.GraphQLScalarType=M;class K{constructor(e){var n;this.name=(0,b.assertName)(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._fields=()=>$(e),this._interfaces=()=>Q(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,r.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,a.inspect)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:q(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Q(e){var n;const t=V(null!==(n=e.interfaces)&&void 0!==n?n:[]);return Array.isArray(t)||(0,r.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),t}function $(e){const n=C(e.fields);return B(n)||(0,r.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,l.mapValue)(n,((n,t)=>{var i;B(n)||(0,r.devAssert)(!1,`${e.name}.${t} field config must be an object.`),null==n.resolve||"function"==typeof n.resolve||(0,r.devAssert)(!1,`${e.name}.${t} field resolver must be a function if provided, but got: ${(0,a.inspect)(n.resolve)}.`);const o=null!==(i=n.args)&&void 0!==i?i:{};return B(o)||(0,r.devAssert)(!1,`${e.name}.${t} args must be an object with argument names as keys.`),{name:(0,b.assertName)(t),description:n.description,type:n.type,args:U(o),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:(0,f.toObjMap)(n.extensions),astNode:n.astNode}}))}function U(e){return Object.entries(e).map((([e,n])=>({name:(0,b.assertName)(e),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,f.toObjMap)(n.extensions),astNode:n.astNode})))}function B(e){return(0,u.isObjectLike)(e)&&!Array.isArray(e)}function q(e){return(0,l.mapValue)(e,(e=>({description:e.description,type:e.type,args:Y(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function Y(e){return(0,p.keyValMap)(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}n.GraphQLObjectType=K;class J{constructor(e){var n;this.name=(0,b.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._fields=$.bind(void 0,e),this._interfaces=Q.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:q(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}n.GraphQLInterfaceType=J;class X{constructor(e){var n;this.name=(0,b.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._types=H.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function H(e){const n=V(e.types);return Array.isArray(n)||(0,r.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),n}n.GraphQLUnionType=X;class z{constructor(e){var n,t,i;this.name=(0,b.assertName)(e.name),this.description=e.description,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._values=(t=this.name,B(i=e.values)||(0,r.devAssert)(!1,`${t} values must be an object with value names as keys.`),Object.entries(i).map((([e,n])=>(B(n)||(0,r.devAssert)(!1,`${t}.${e} must refer to an object with a "value" key representing an internal value but got: ${(0,a.inspect)(n)}.`),{name:(0,b.assertEnumValueName)(e),description:n.description,value:void 0!==n.value?n.value:e,deprecationReason:n.deprecationReason,extensions:(0,f.toObjMap)(n.extensions),astNode:n.astNode})))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=(0,c.keyMap)(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const n=this._valueLookup.get(e);if(void 0===n)throw new y.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,a.inspect)(e)}`);return n.name}parseValue(e){if("string"!=typeof e){const n=(0,a.inspect)(e);throw new y.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+W(this,n))}const n=this.getValue(e);if(null==n)throw new y.GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+W(this,e));return n.value}parseLiteral(e,n){if(e.kind!==m.Kind.ENUM){const n=(0,h.print)(e);throw new y.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+W(this,n),{nodes:e})}const t=this.getValue(e.value);if(null==t){const n=(0,h.print)(e);throw new y.GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+W(this,n),{nodes:e})}return t.value}toConfig(){const e=(0,p.keyValMap)(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function W(e,n){const t=e.getValues().map((e=>e.name)),r=(0,d.suggestionList)(n,t);return(0,i.didYouMean)("the enum value",r)}n.GraphQLEnumType=z;class Z{constructor(e){var n;this.name=(0,b.assertName)(e.name),this.description=e.description,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._fields=ee.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=(0,l.mapValue)(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ee(e){const n=C(e.fields);return B(n)||(0,r.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,l.mapValue)(n,((n,t)=>(!("resolve"in n)||(0,r.devAssert)(!1,`${e.name}.${t} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,b.assertName)(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,f.toObjMap)(n.extensions),astNode:n.astNode})))}n.GraphQLInputObjectType=Z},7197:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.GraphQLSpecifiedByDirective=n.GraphQLSkipDirective=n.GraphQLIncludeDirective=n.GraphQLDirective=n.GraphQLDeprecatedDirective=n.DEFAULT_DEPRECATION_REASON=void 0,n.assertDirective=function(e){if(!d(e))throw new Error(`Expected ${(0,i.inspect)(e)} to be a GraphQL directive.`);return e},n.isDirective=d,n.isSpecifiedDirective=function(e){return v.some((({name:n})=>n===e.name))},n.specifiedDirectives=void 0;var r=t(7242),i=t(8002),o=t(5752),a=t(5690),s=t(7690),u=t(8333),c=t(3058),p=t(5003),l=t(2229);function d(e){return(0,o.instanceOf)(e,f)}class f{constructor(e){var n,t;this.name=(0,c.assertName)(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!==(n=e.isRepeatable)&&void 0!==n&&n,this.extensions=(0,s.toObjMap)(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,r.devAssert)(!1,`@${e.name} locations must be an Array.`);const i=null!==(t=e.args)&&void 0!==t?t:{};(0,a.isObjectLike)(i)&&!Array.isArray(i)||(0,r.devAssert)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=(0,p.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,p.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}n.GraphQLDirective=f;const y=new f({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[u.DirectiveLocation.FIELD,u.DirectiveLocation.FRAGMENT_SPREAD,u.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new p.GraphQLNonNull(l.GraphQLBoolean),description:"Included when true."}}});n.GraphQLIncludeDirective=y;const m=new f({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[u.DirectiveLocation.FIELD,u.DirectiveLocation.FRAGMENT_SPREAD,u.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new p.GraphQLNonNull(l.GraphQLBoolean),description:"Skipped when true."}}});n.GraphQLSkipDirective=m;const h="No longer supported";n.DEFAULT_DEPRECATION_REASON=h;const T=new f({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[u.DirectiveLocation.FIELD_DEFINITION,u.DirectiveLocation.ARGUMENT_DEFINITION,u.DirectiveLocation.INPUT_FIELD_DEFINITION,u.DirectiveLocation.ENUM_VALUE],args:{reason:{type:l.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:h}}});n.GraphQLDeprecatedDirective=T;const b=new f({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[u.DirectiveLocation.SCALAR],args:{url:{type:new p.GraphQLNonNull(l.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});n.GraphQLSpecifiedByDirective=b;const v=Object.freeze([y,m,T,b]);n.specifiedDirectives=v},3226:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return o.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(n,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return a.GRAPHQL_MAX_INT}}),Object.defineProperty(n,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return a.GRAPHQL_MIN_INT}}),Object.defineProperty(n,"GraphQLBoolean",{enumerable:!0,get:function(){return a.GraphQLBoolean}}),Object.defineProperty(n,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return o.GraphQLDeprecatedDirective}}),Object.defineProperty(n,"GraphQLDirective",{enumerable:!0,get:function(){return o.GraphQLDirective}}),Object.defineProperty(n,"GraphQLEnumType",{enumerable:!0,get:function(){return i.GraphQLEnumType}}),Object.defineProperty(n,"GraphQLFloat",{enumerable:!0,get:function(){return a.GraphQLFloat}}),Object.defineProperty(n,"GraphQLID",{enumerable:!0,get:function(){return a.GraphQLID}}),Object.defineProperty(n,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return o.GraphQLIncludeDirective}}),Object.defineProperty(n,"GraphQLInputObjectType",{enumerable:!0,get:function(){return i.GraphQLInputObjectType}}),Object.defineProperty(n,"GraphQLInt",{enumerable:!0,get:function(){return a.GraphQLInt}}),Object.defineProperty(n,"GraphQLInterfaceType",{enumerable:!0,get:function(){return i.GraphQLInterfaceType}}),Object.defineProperty(n,"GraphQLList",{enumerable:!0,get:function(){return i.GraphQLList}}),Object.defineProperty(n,"GraphQLNonNull",{enumerable:!0,get:function(){return i.GraphQLNonNull}}),Object.defineProperty(n,"GraphQLObjectType",{enumerable:!0,get:function(){return i.GraphQLObjectType}}),Object.defineProperty(n,"GraphQLScalarType",{enumerable:!0,get:function(){return i.GraphQLScalarType}}),Object.defineProperty(n,"GraphQLSchema",{enumerable:!0,get:function(){return r.GraphQLSchema}}),Object.defineProperty(n,"GraphQLSkipDirective",{enumerable:!0,get:function(){return o.GraphQLSkipDirective}}),Object.defineProperty(n,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return o.GraphQLSpecifiedByDirective}}),Object.defineProperty(n,"GraphQLString",{enumerable:!0,get:function(){return a.GraphQLString}}),Object.defineProperty(n,"GraphQLUnionType",{enumerable:!0,get:function(){return i.GraphQLUnionType}}),Object.defineProperty(n,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return s.SchemaMetaFieldDef}}),Object.defineProperty(n,"TypeKind",{enumerable:!0,get:function(){return s.TypeKind}}),Object.defineProperty(n,"TypeMetaFieldDef",{enumerable:!0,get:function(){return s.TypeMetaFieldDef}}),Object.defineProperty(n,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return s.TypeNameMetaFieldDef}}),Object.defineProperty(n,"__Directive",{enumerable:!0,get:function(){return s.__Directive}}),Object.defineProperty(n,"__DirectiveLocation",{enumerable:!0,get:function(){return s.__DirectiveLocation}}),Object.defineProperty(n,"__EnumValue",{enumerable:!0,get:function(){return s.__EnumValue}}),Object.defineProperty(n,"__Field",{enumerable:!0,get:function(){return s.__Field}}),Object.defineProperty(n,"__InputValue",{enumerable:!0,get:function(){return s.__InputValue}}),Object.defineProperty(n,"__Schema",{enumerable:!0,get:function(){return s.__Schema}}),Object.defineProperty(n,"__Type",{enumerable:!0,get:function(){return s.__Type}}),Object.defineProperty(n,"__TypeKind",{enumerable:!0,get:function(){return s.__TypeKind}}),Object.defineProperty(n,"assertAbstractType",{enumerable:!0,get:function(){return i.assertAbstractType}}),Object.defineProperty(n,"assertCompositeType",{enumerable:!0,get:function(){return i.assertCompositeType}}),Object.defineProperty(n,"assertDirective",{enumerable:!0,get:function(){return o.assertDirective}}),Object.defineProperty(n,"assertEnumType",{enumerable:!0,get:function(){return i.assertEnumType}}),Object.defineProperty(n,"assertEnumValueName",{enumerable:!0,get:function(){return c.assertEnumValueName}}),Object.defineProperty(n,"assertInputObjectType",{enumerable:!0,get:function(){return i.assertInputObjectType}}),Object.defineProperty(n,"assertInputType",{enumerable:!0,get:function(){return i.assertInputType}}),Object.defineProperty(n,"assertInterfaceType",{enumerable:!0,get:function(){return i.assertInterfaceType}}),Object.defineProperty(n,"assertLeafType",{enumerable:!0,get:function(){return i.assertLeafType}}),Object.defineProperty(n,"assertListType",{enumerable:!0,get:function(){return i.assertListType}}),Object.defineProperty(n,"assertName",{enumerable:!0,get:function(){return c.assertName}}),Object.defineProperty(n,"assertNamedType",{enumerable:!0,get:function(){return i.assertNamedType}}),Object.defineProperty(n,"assertNonNullType",{enumerable:!0,get:function(){return i.assertNonNullType}}),Object.defineProperty(n,"assertNullableType",{enumerable:!0,get:function(){return i.assertNullableType}}),Object.defineProperty(n,"assertObjectType",{enumerable:!0,get:function(){return i.assertObjectType}}),Object.defineProperty(n,"assertOutputType",{enumerable:!0,get:function(){return i.assertOutputType}}),Object.defineProperty(n,"assertScalarType",{enumerable:!0,get:function(){return i.assertScalarType}}),Object.defineProperty(n,"assertSchema",{enumerable:!0,get:function(){return r.assertSchema}}),Object.defineProperty(n,"assertType",{enumerable:!0,get:function(){return i.assertType}}),Object.defineProperty(n,"assertUnionType",{enumerable:!0,get:function(){return i.assertUnionType}}),Object.defineProperty(n,"assertValidSchema",{enumerable:!0,get:function(){return u.assertValidSchema}}),Object.defineProperty(n,"assertWrappingType",{enumerable:!0,get:function(){return i.assertWrappingType}}),Object.defineProperty(n,"getNamedType",{enumerable:!0,get:function(){return i.getNamedType}}),Object.defineProperty(n,"getNullableType",{enumerable:!0,get:function(){return i.getNullableType}}),Object.defineProperty(n,"introspectionTypes",{enumerable:!0,get:function(){return s.introspectionTypes}}),Object.defineProperty(n,"isAbstractType",{enumerable:!0,get:function(){return i.isAbstractType}}),Object.defineProperty(n,"isCompositeType",{enumerable:!0,get:function(){return i.isCompositeType}}),Object.defineProperty(n,"isDirective",{enumerable:!0,get:function(){return o.isDirective}}),Object.defineProperty(n,"isEnumType",{enumerable:!0,get:function(){return i.isEnumType}}),Object.defineProperty(n,"isInputObjectType",{enumerable:!0,get:function(){return i.isInputObjectType}}),Object.defineProperty(n,"isInputType",{enumerable:!0,get:function(){return i.isInputType}}),Object.defineProperty(n,"isInterfaceType",{enumerable:!0,get:function(){return i.isInterfaceType}}),Object.defineProperty(n,"isIntrospectionType",{enumerable:!0,get:function(){return s.isIntrospectionType}}),Object.defineProperty(n,"isLeafType",{enumerable:!0,get:function(){return i.isLeafType}}),Object.defineProperty(n,"isListType",{enumerable:!0,get:function(){return i.isListType}}),Object.defineProperty(n,"isNamedType",{enumerable:!0,get:function(){return i.isNamedType}}),Object.defineProperty(n,"isNonNullType",{enumerable:!0,get:function(){return i.isNonNullType}}),Object.defineProperty(n,"isNullableType",{enumerable:!0,get:function(){return i.isNullableType}}),Object.defineProperty(n,"isObjectType",{enumerable:!0,get:function(){return i.isObjectType}}),Object.defineProperty(n,"isOutputType",{enumerable:!0,get:function(){return i.isOutputType}}),Object.defineProperty(n,"isRequiredArgument",{enumerable:!0,get:function(){return i.isRequiredArgument}}),Object.defineProperty(n,"isRequiredInputField",{enumerable:!0,get:function(){return i.isRequiredInputField}}),Object.defineProperty(n,"isScalarType",{enumerable:!0,get:function(){return i.isScalarType}}),Object.defineProperty(n,"isSchema",{enumerable:!0,get:function(){return r.isSchema}}),Object.defineProperty(n,"isSpecifiedDirective",{enumerable:!0,get:function(){return o.isSpecifiedDirective}}),Object.defineProperty(n,"isSpecifiedScalarType",{enumerable:!0,get:function(){return a.isSpecifiedScalarType}}),Object.defineProperty(n,"isType",{enumerable:!0,get:function(){return i.isType}}),Object.defineProperty(n,"isUnionType",{enumerable:!0,get:function(){return i.isUnionType}}),Object.defineProperty(n,"isWrappingType",{enumerable:!0,get:function(){return i.isWrappingType}}),Object.defineProperty(n,"resolveObjMapThunk",{enumerable:!0,get:function(){return i.resolveObjMapThunk}}),Object.defineProperty(n,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return i.resolveReadonlyArrayThunk}}),Object.defineProperty(n,"specifiedDirectives",{enumerable:!0,get:function(){return o.specifiedDirectives}}),Object.defineProperty(n,"specifiedScalarTypes",{enumerable:!0,get:function(){return a.specifiedScalarTypes}}),Object.defineProperty(n,"validateSchema",{enumerable:!0,get:function(){return u.validateSchema}});var r=t(6829),i=t(5003),o=t(7197),a=t(2229),s=t(8155),u=t(1671),c=t(3058)},8155:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.introspectionTypes=n.__TypeKind=n.__Type=n.__Schema=n.__InputValue=n.__Field=n.__EnumValue=n.__DirectiveLocation=n.__Directive=n.TypeNameMetaFieldDef=n.TypeMetaFieldDef=n.TypeKind=n.SchemaMetaFieldDef=void 0,n.isIntrospectionType=function(e){return N.some((({name:n})=>e.name===n))};var r=t(8002),i=t(7706),o=t(8333),a=t(3033),s=t(8115),u=t(5003),c=t(2229);const p=new u.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:c.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(f))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new u.GraphQLNonNull(f),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:f,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:f,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(l))),resolve:e=>e.getDirectives()}})});n.__Schema=p;const l=new u.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new u.GraphQLNonNull(c.GraphQLString),resolve:e=>e.name},description:{type:c.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new u.GraphQLNonNull(c.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(d))),resolve:e=>e.locations},args:{type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(m))),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:n})=>n?e.args:e.args.filter((e=>null==e.deprecationReason))}})});n.__Directive=l;const d=new u.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:o.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:o.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:o.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:o.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:o.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:o.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:o.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:o.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:o.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:o.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:o.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:o.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:o.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:o.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:o.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:o.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:o.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:o.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:o.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});n.__DirectiveLocation=d;const f=new u.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new u.GraphQLNonNull(b),resolve:e=>(0,u.isScalarType)(e)?T.SCALAR:(0,u.isObjectType)(e)?T.OBJECT:(0,u.isInterfaceType)(e)?T.INTERFACE:(0,u.isUnionType)(e)?T.UNION:(0,u.isEnumType)(e)?T.ENUM:(0,u.isInputObjectType)(e)?T.INPUT_OBJECT:(0,u.isListType)(e)?T.LIST:(0,u.isNonNullType)(e)?T.NON_NULL:void(0,i.invariant)(!1,`Unexpected type: "${(0,r.inspect)(e)}".`)},name:{type:c.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:c.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:c.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new u.GraphQLList(new u.GraphQLNonNull(y)),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:n}){if((0,u.isObjectType)(e)||(0,u.isInterfaceType)(e)){const t=Object.values(e.getFields());return n?t:t.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new u.GraphQLList(new u.GraphQLNonNull(f)),resolve(e){if((0,u.isObjectType)(e)||(0,u.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new u.GraphQLList(new u.GraphQLNonNull(f)),resolve(e,n,t,{schema:r}){if((0,u.isAbstractType)(e))return r.getPossibleTypes(e)}},enumValues:{type:new u.GraphQLList(new u.GraphQLNonNull(h)),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:n}){if((0,u.isEnumType)(e)){const t=e.getValues();return n?t:t.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new u.GraphQLList(new u.GraphQLNonNull(m)),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:n}){if((0,u.isInputObjectType)(e)){const t=Object.values(e.getFields());return n?t:t.filter((e=>null==e.deprecationReason))}}},ofType:{type:f,resolve:e=>"ofType"in e?e.ofType:void 0}})});n.__Type=f;const y=new u.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new u.GraphQLNonNull(c.GraphQLString),resolve:e=>e.name},description:{type:c.GraphQLString,resolve:e=>e.description},args:{type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(m))),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:n})=>n?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new u.GraphQLNonNull(f),resolve:e=>e.type},isDeprecated:{type:new u.GraphQLNonNull(c.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:c.GraphQLString,resolve:e=>e.deprecationReason}})});n.__Field=y;const m=new u.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new u.GraphQLNonNull(c.GraphQLString),resolve:e=>e.name},description:{type:c.GraphQLString,resolve:e=>e.description},type:{type:new u.GraphQLNonNull(f),resolve:e=>e.type},defaultValue:{type:c.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:n,defaultValue:t}=e,r=(0,s.astFromValue)(t,n);return r?(0,a.print)(r):null}},isDeprecated:{type:new u.GraphQLNonNull(c.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:c.GraphQLString,resolve:e=>e.deprecationReason}})});n.__InputValue=m;const h=new u.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new u.GraphQLNonNull(c.GraphQLString),resolve:e=>e.name},description:{type:c.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new u.GraphQLNonNull(c.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:c.GraphQLString,resolve:e=>e.deprecationReason}})});var T;n.__EnumValue=h,n.TypeKind=T,function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(T||(n.TypeKind=T={}));const b=new u.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:T.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:T.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:T.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:T.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:T.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:T.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:T.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:T.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});n.__TypeKind=b;const v={name:"__schema",type:new u.GraphQLNonNull(p),description:"Access the current type schema of this server.",args:[],resolve:(e,n,t,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};n.SchemaMetaFieldDef=v;const g={name:"__type",type:f,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new u.GraphQLNonNull(c.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:n},t,{schema:r})=>r.getType(n),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};n.TypeMetaFieldDef=g;const E={name:"__typename",type:new u.GraphQLNonNull(c.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,n,t,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};n.TypeNameMetaFieldDef=E;const N=Object.freeze([p,l,d,f,y,m,h,b]);n.introspectionTypes=N},2229:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.GraphQLString=n.GraphQLInt=n.GraphQLID=n.GraphQLFloat=n.GraphQLBoolean=n.GRAPHQL_MIN_INT=n.GRAPHQL_MAX_INT=void 0,n.isSpecifiedScalarType=function(e){return h.some((({name:n})=>e.name===n))},n.specifiedScalarTypes=void 0;var r=t(8002),i=t(5690),o=t(5822),a=t(2828),s=t(3033),u=t(5003);const c=2147483647;n.GRAPHQL_MAX_INT=c;const p=-2147483648;n.GRAPHQL_MIN_INT=p;const l=new u.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const n=T(e);if("boolean"==typeof n)return n?1:0;let t=n;if("string"==typeof n&&""!==n&&(t=Number(n)),"number"!=typeof t||!Number.isInteger(t))throw new o.GraphQLError(`Int cannot represent non-integer value: ${(0,r.inspect)(n)}`);if(t>c||tc||ec||nn.name===e))}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function y(e,n){const t=(0,c.getNamedType)(e);if(!n.has(t))if(n.add(t),(0,c.isUnionType)(t))for(const e of t.getTypes())y(e,n);else if((0,c.isObjectType)(t)||(0,c.isInterfaceType)(t)){for(const e of t.getInterfaces())y(e,n);for(const e of Object.values(t.getFields())){y(e.type,n);for(const t of e.args)y(t.type,n)}}else if((0,c.isInputObjectType)(t))for(const e of Object.values(t.getFields()))y(e.type,n);return n}n.GraphQLSchema=f},1671:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.assertValidSchema=function(e){const n=l(e);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))},n.validateSchema=l;var r=t(8002),i=t(5822),o=t(1807),a=t(298),s=t(5003),u=t(7197),c=t(8155),p=t(6829);function l(e){if((0,p.assertSchema)(e),e.__validationErrors)return e.__validationErrors;const n=new d(e);!function(e){const n=e.schema,t=n.getQueryType();if(t){if(!(0,s.isObjectType)(t)){var i;e.reportError(`Query root type must be Object type, it cannot be ${(0,r.inspect)(t)}.`,null!==(i=f(n,o.OperationTypeNode.QUERY))&&void 0!==i?i:t.astNode)}}else e.reportError("Query root type must be provided.",n.astNode);const a=n.getMutationType();var u;a&&!(0,s.isObjectType)(a)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,r.inspect)(a)}.`,null!==(u=f(n,o.OperationTypeNode.MUTATION))&&void 0!==u?u:a.astNode);const c=n.getSubscriptionType();var p;c&&!(0,s.isObjectType)(c)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,r.inspect)(c)}.`,null!==(p=f(n,o.OperationTypeNode.SUBSCRIPTION))&&void 0!==p?p:c.astNode)}(n),function(e){for(const t of e.schema.getDirectives())if((0,u.isDirective)(t)){y(e,t);for(const i of t.args){var n;y(e,i),(0,s.isInputType)(i.type)||e.reportError(`The type of @${t.name}(${i.name}:) must be Input Type but got: ${(0,r.inspect)(i.type)}.`,i.astNode),(0,s.isRequiredArgument)(i)&&null!=i.deprecationReason&&e.reportError(`Required argument @${t.name}(${i.name}:) cannot be deprecated.`,[I(i.astNode),null===(n=i.astNode)||void 0===n?void 0:n.type])}}else e.reportError(`Expected directive but got: ${(0,r.inspect)(t)}.`,null==t?void 0:t.astNode)}(n),function(e){const n=function(e){const n=Object.create(null),t=[],r=Object.create(null);return function i(o){if(n[o.name])return;n[o.name]=!0,r[o.name]=t.length;const a=Object.values(o.getFields());for(const n of a)if((0,s.isNonNullType)(n.type)&&(0,s.isInputObjectType)(n.type.ofType)){const o=n.type.ofType,a=r[o.name];if(t.push(n),void 0===a)i(o);else{const n=t.slice(a),r=n.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,n.map((e=>e.astNode)))}t.pop()}r[o.name]=void 0}}(e),t=e.schema.getTypeMap();for(const i of Object.values(t))(0,s.isNamedType)(i)?((0,c.isIntrospectionType)(i)||y(e,i),(0,s.isObjectType)(i)||(0,s.isInterfaceType)(i)?(m(e,i),h(e,i)):(0,s.isUnionType)(i)?v(e,i):(0,s.isEnumType)(i)?g(e,i):(0,s.isInputObjectType)(i)&&(E(e,i),n(i))):e.reportError(`Expected GraphQL named type but got: ${(0,r.inspect)(i)}.`,i.astNode)}(n);const t=n.getErrors();return e.__validationErrors=t,t}class d{constructor(e){this._errors=[],this.schema=e}reportError(e,n){const t=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new i.GraphQLError(e,{nodes:t}))}getErrors(){return this._errors}}function f(e,n){var t;return null===(t=[e.astNode,...e.extensionASTNodes].flatMap((e=>{var n;return null!==(n=null==e?void 0:e.operationTypes)&&void 0!==n?n:[]})).find((e=>e.operation===n)))||void 0===t?void 0:t.type}function y(e,n){n.name.startsWith("__")&&e.reportError(`Name "${n.name}" must not begin with "__", which is reserved by GraphQL introspection.`,n.astNode)}function m(e,n){const t=Object.values(n.getFields());0===t.length&&e.reportError(`Type ${n.name} must define one or more fields.`,[n.astNode,...n.extensionASTNodes]);for(const u of t){var i;y(e,u),(0,s.isOutputType)(u.type)||e.reportError(`The type of ${n.name}.${u.name} must be Output Type but got: ${(0,r.inspect)(u.type)}.`,null===(i=u.astNode)||void 0===i?void 0:i.type);for(const t of u.args){const i=t.name;var o,a;y(e,t),(0,s.isInputType)(t.type)||e.reportError(`The type of ${n.name}.${u.name}(${i}:) must be Input Type but got: ${(0,r.inspect)(t.type)}.`,null===(o=t.astNode)||void 0===o?void 0:o.type),(0,s.isRequiredArgument)(t)&&null!=t.deprecationReason&&e.reportError(`Required argument ${n.name}.${u.name}(${i}:) cannot be deprecated.`,[I(t.astNode),null===(a=t.astNode)||void 0===a?void 0:a.type])}}}function h(e,n){const t=Object.create(null);for(const i of n.getInterfaces())(0,s.isInterfaceType)(i)?n!==i?t[i.name]?e.reportError(`Type ${n.name} can only implement ${i.name} once.`,N(n,i)):(t[i.name]=!0,b(e,n,i),T(e,n,i)):e.reportError(`Type ${n.name} cannot implement itself because it would create a circular reference.`,N(n,i)):e.reportError(`Type ${(0,r.inspect)(n)} must only implement Interface types, it cannot implement ${(0,r.inspect)(i)}.`,N(n,i))}function T(e,n,t){const i=n.getFields();for(const l of Object.values(t.getFields())){const d=l.name,f=i[d];if(f){var o,u;(0,a.isTypeSubTypeOf)(e.schema,f.type,l.type)||e.reportError(`Interface field ${t.name}.${d} expects type ${(0,r.inspect)(l.type)} but ${n.name}.${d} is type ${(0,r.inspect)(f.type)}.`,[null===(o=l.astNode)||void 0===o?void 0:o.type,null===(u=f.astNode)||void 0===u?void 0:u.type]);for(const i of l.args){const o=i.name,s=f.args.find((e=>e.name===o));var c,p;s?(0,a.isEqualType)(i.type,s.type)||e.reportError(`Interface field argument ${t.name}.${d}(${o}:) expects type ${(0,r.inspect)(i.type)} but ${n.name}.${d}(${o}:) is type ${(0,r.inspect)(s.type)}.`,[null===(c=i.astNode)||void 0===c?void 0:c.type,null===(p=s.astNode)||void 0===p?void 0:p.type]):e.reportError(`Interface field argument ${t.name}.${d}(${o}:) expected but ${n.name}.${d} does not provide it.`,[i.astNode,f.astNode])}for(const r of f.args){const i=r.name;!l.args.find((e=>e.name===i))&&(0,s.isRequiredArgument)(r)&&e.reportError(`Object field ${n.name}.${d} includes required argument ${i} that is missing from the Interface field ${t.name}.${d}.`,[r.astNode,l.astNode])}}else e.reportError(`Interface field ${t.name}.${d} expected but ${n.name} does not provide it.`,[l.astNode,n.astNode,...n.extensionASTNodes])}}function b(e,n,t){const r=n.getInterfaces();for(const i of t.getInterfaces())r.includes(i)||e.reportError(i===n?`Type ${n.name} cannot implement ${t.name} because it would create a circular reference.`:`Type ${n.name} must implement ${i.name} because it is implemented by ${t.name}.`,[...N(t,i),...N(n,t)])}function v(e,n){const t=n.getTypes();0===t.length&&e.reportError(`Union type ${n.name} must define one or more member types.`,[n.astNode,...n.extensionASTNodes]);const i=Object.create(null);for(const o of t)i[o.name]?e.reportError(`Union type ${n.name} can only include type ${o.name} once.`,O(n,o.name)):(i[o.name]=!0,(0,s.isObjectType)(o)||e.reportError(`Union type ${n.name} can only include Object types, it cannot include ${(0,r.inspect)(o)}.`,O(n,String(o))))}function g(e,n){const t=n.getValues();0===t.length&&e.reportError(`Enum type ${n.name} must define one or more values.`,[n.astNode,...n.extensionASTNodes]);for(const n of t)y(e,n)}function E(e,n){const t=Object.values(n.getFields());0===t.length&&e.reportError(`Input Object type ${n.name} must define one or more fields.`,[n.astNode,...n.extensionASTNodes]);for(const a of t){var i,o;y(e,a),(0,s.isInputType)(a.type)||e.reportError(`The type of ${n.name}.${a.name} must be Input Type but got: ${(0,r.inspect)(a.type)}.`,null===(i=a.astNode)||void 0===i?void 0:i.type),(0,s.isRequiredInputField)(a)&&null!=a.deprecationReason&&e.reportError(`Required input field ${n.name}.${a.name} cannot be deprecated.`,[I(a.astNode),null===(o=a.astNode)||void 0===o?void 0:o.type])}}function N(e,n){const{astNode:t,extensionASTNodes:r}=e;return(null!=t?[t,...r]:r).flatMap((e=>{var n;return null!==(n=e.interfaces)&&void 0!==n?n:[]})).filter((e=>e.name.value===n.name))}function O(e,n){const{astNode:t,extensionASTNodes:r}=e;return(null!=t?[t,...r]:r).flatMap((e=>{var n;return null!==(n=e.types)&&void 0!==n?n:[]})).filter((e=>e.name.value===n))}function I(e){var n;return null==e||null===(n=e.directives)||void 0===n?void 0:n.find((e=>e.name.value===u.GraphQLDeprecatedDirective.name))}},6226:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.TypeInfo=void 0,n.visitWithTypeInfo=function(e,n){return{enter(...t){const i=t[0];e.enter(i);const a=(0,o.getEnterLeaveForKind)(n,i.kind).enter;if(a){const o=a.apply(n,t);return void 0!==o&&(e.leave(i),(0,r.isNode)(o)&&e.enter(o)),o}},leave(...t){const r=t[0],i=(0,o.getEnterLeaveForKind)(n,r.kind).leave;let a;return i&&(a=i.apply(n,t)),e.leave(r),a}}};var r=t(1807),i=t(2828),o=t(285),a=t(5003),s=t(8155),u=t(5115);class c{constructor(e,n,t){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=t?t:p,n&&((0,a.isInputType)(n)&&this._inputTypeStack.push(n),(0,a.isCompositeType)(n)&&this._parentTypeStack.push(n),(0,a.isOutputType)(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const n=this._schema;switch(e.kind){case i.Kind.SELECTION_SET:{const e=(0,a.getNamedType)(this.getType());this._parentTypeStack.push((0,a.isCompositeType)(e)?e:void 0);break}case i.Kind.FIELD:{const t=this.getParentType();let r,i;t&&(r=this._getFieldDef(n,t,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push((0,a.isOutputType)(i)?i:void 0);break}case i.Kind.DIRECTIVE:this._directive=n.getDirective(e.name.value);break;case i.Kind.OPERATION_DEFINITION:{const t=n.getRootType(e.operation);this._typeStack.push((0,a.isObjectType)(t)?t:void 0);break}case i.Kind.INLINE_FRAGMENT:case i.Kind.FRAGMENT_DEFINITION:{const t=e.typeCondition,r=t?(0,u.typeFromAST)(n,t):(0,a.getNamedType)(this.getType());this._typeStack.push((0,a.isOutputType)(r)?r:void 0);break}case i.Kind.VARIABLE_DEFINITION:{const t=(0,u.typeFromAST)(n,e.type);this._inputTypeStack.push((0,a.isInputType)(t)?t:void 0);break}case i.Kind.ARGUMENT:{var t;let n,r;const i=null!==(t=this.getDirective())&&void 0!==t?t:this.getFieldDef();i&&(n=i.args.find((n=>n.name===e.name.value)),n&&(r=n.type)),this._argument=n,this._defaultValueStack.push(n?n.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(r)?r:void 0);break}case i.Kind.LIST:{const e=(0,a.getNullableType)(this.getInputType()),n=(0,a.isListType)(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,a.isInputType)(n)?n:void 0);break}case i.Kind.OBJECT_FIELD:{const n=(0,a.getNamedType)(this.getInputType());let t,r;(0,a.isInputObjectType)(n)&&(r=n.getFields()[e.name.value],r&&(t=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(t)?t:void 0);break}case i.Kind.ENUM:{const n=(0,a.getNamedType)(this.getInputType());let t;(0,a.isEnumType)(n)&&(t=n.getValue(e.value)),this._enumValue=t;break}}}leave(e){switch(e.kind){case i.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case i.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case i.Kind.DIRECTIVE:this._directive=null;break;case i.Kind.OPERATION_DEFINITION:case i.Kind.INLINE_FRAGMENT:case i.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case i.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case i.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.Kind.LIST:case i.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.Kind.ENUM:this._enumValue=null}}}function p(e,n,t){const r=t.name.value;return r===s.SchemaMetaFieldDef.name&&e.getQueryType()===n?s.SchemaMetaFieldDef:r===s.TypeMetaFieldDef.name&&e.getQueryType()===n?s.TypeMetaFieldDef:r===s.TypeNameMetaFieldDef.name&&(0,a.isCompositeType)(n)?s.TypeNameMetaFieldDef:(0,a.isObjectType)(n)||(0,a.isInterfaceType)(n)?n.getFields()[r]:void 0}n.TypeInfo=c},6526:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.assertValidName=function(e){const n=a(e);if(n)throw n;return e},n.isValidNameError=a;var r=t(7242),i=t(5822),o=t(3058);function a(e){if("string"==typeof e||(0,r.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new i.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,o.assertName)(e)}catch(e){return e}}},8115:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.astFromValue=function e(n,t){if((0,u.isNonNullType)(t)){const r=e(n,t.ofType);return(null==r?void 0:r.kind)===s.Kind.NULL?null:r}if(null===n)return{kind:s.Kind.NULL};if(void 0===n)return null;if((0,u.isListType)(t)){const r=t.ofType;if((0,o.isIterableObject)(n)){const t=[];for(const i of n){const n=e(i,r);null!=n&&t.push(n)}return{kind:s.Kind.LIST,values:t}}return e(n,r)}if((0,u.isInputObjectType)(t)){if(!(0,a.isObjectLike)(n))return null;const r=[];for(const i of Object.values(t.getFields())){const t=e(n[i.name],i.type);t&&r.push({kind:s.Kind.OBJECT_FIELD,name:{kind:s.Kind.NAME,value:i.name},value:t})}return{kind:s.Kind.OBJECT,fields:r}}if((0,u.isLeafType)(t)){const e=t.serialize(n);if(null==e)return null;if("boolean"==typeof e)return{kind:s.Kind.BOOLEAN,value:e};if("number"==typeof e&&Number.isFinite(e)){const n=String(e);return p.test(n)?{kind:s.Kind.INT,value:n}:{kind:s.Kind.FLOAT,value:n}}if("string"==typeof e)return(0,u.isEnumType)(t)?{kind:s.Kind.ENUM,value:e}:t===c.GraphQLID&&p.test(e)?{kind:s.Kind.INT,value:e}:{kind:s.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${(0,r.inspect)(e)}.`)}(0,i.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(t))};var r=t(8002),i=t(7706),o=t(6609),a=t(5690),s=t(2828),u=t(5003),c=t(2229);const p=/^-?(?:0|[1-9][0-9]*)$/},2906:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.buildASTSchema=p,n.buildSchema=function(e,n){return p((0,o.parse)(e,{noLocation:null==n?void 0:n.noLocation,allowLegacyFragmentVariables:null==n?void 0:n.allowLegacyFragmentVariables}),{assumeValidSDL:null==n?void 0:n.assumeValidSDL,assumeValid:null==n?void 0:n.assumeValid})};var r=t(7242),i=t(2828),o=t(8370),a=t(7197),s=t(6829),u=t(9504),c=t(3242);function p(e,n){null!=e&&e.kind===i.Kind.DOCUMENT||(0,r.devAssert)(!1,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&(0,u.assertValidSDL)(e);const t={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},o=(0,c.extendSchemaImpl)(t,e,n);if(null==o.astNode)for(const e of o.types)switch(e.name){case"Query":o.query=e;break;case"Mutation":o.mutation=e;break;case"Subscription":o.subscription=e}const p=[...o.directives,...a.specifiedDirectives.filter((e=>o.directives.every((n=>n.name!==e.name))))];return new s.GraphQLSchema({...o,directives:p})}},8686:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.buildClientSchema=function(e,n){(0,o.isObjectLike)(e)&&(0,o.isObjectLike)(e.__schema)||(0,r.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,i.inspect)(e)}.`);const t=e.__schema,y=(0,a.keyValMap)(t.types,(e=>e.name),(e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case p.TypeKind.SCALAR:return r=e,new u.GraphQLScalarType({name:r.name,description:r.description,specifiedByURL:r.specifiedByURL});case p.TypeKind.OBJECT:return t=e,new u.GraphQLObjectType({name:t.name,description:t.description,interfaces:()=>O(t),fields:()=>I(t)});case p.TypeKind.INTERFACE:return n=e,new u.GraphQLInterfaceType({name:n.name,description:n.description,interfaces:()=>O(n),fields:()=>I(n)});case p.TypeKind.UNION:return function(e){if(!e.possibleTypes){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing possibleTypes: ${n}.`)}return new u.GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(E)})}(e);case p.TypeKind.ENUM:return function(e){if(!e.enumValues){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing enumValues: ${n}.`)}return new u.GraphQLEnumType({name:e.name,description:e.description,values:(0,a.keyValMap)(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case p.TypeKind.INPUT_OBJECT:return function(e){if(!e.inputFields){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing inputFields: ${n}.`)}return new u.GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>L(e.inputFields)})}(e)}var n,t,r;const o=(0,i.inspect)(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${o}.`)}(e)));for(const e of[...l.specifiedScalarTypes,...p.introspectionTypes])y[e.name]&&(y[e.name]=e);const m=t.queryType?E(t.queryType):null,h=t.mutationType?E(t.mutationType):null,T=t.subscriptionType?E(t.subscriptionType):null,b=t.directives?t.directives.map((function(e){if(!e.args){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing directive args: ${n}.`)}if(!e.locations){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing directive locations: ${n}.`)}return new c.GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:L(e.args)})})):[];return new d.GraphQLSchema({description:t.description,query:m,mutation:h,subscription:T,types:Object.values(y),directives:b,assumeValid:null==n?void 0:n.assumeValid});function v(e){if(e.kind===p.TypeKind.LIST){const n=e.ofType;if(!n)throw new Error("Decorated type deeper than introspection query.");return new u.GraphQLList(v(n))}if(e.kind===p.TypeKind.NON_NULL){const n=e.ofType;if(!n)throw new Error("Decorated type deeper than introspection query.");const t=v(n);return new u.GraphQLNonNull((0,u.assertNullableType)(t))}return g(e)}function g(e){const n=e.name;if(!n)throw new Error(`Unknown type reference: ${(0,i.inspect)(e)}.`);const t=y[n];if(!t)throw new Error(`Invalid or incomplete schema, unknown type: ${n}. Ensure that a full introspection query is used in order to build a client schema.`);return t}function E(e){return(0,u.assertObjectType)(g(e))}function N(e){return(0,u.assertInterfaceType)(g(e))}function O(e){if(null===e.interfaces&&e.kind===p.TypeKind.INTERFACE)return[];if(!e.interfaces){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing interfaces: ${n}.`)}return e.interfaces.map(N)}function I(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${(0,i.inspect)(e)}.`);return(0,a.keyValMap)(e.fields,(e=>e.name),_)}function _(e){const n=v(e.type);if(!(0,u.isOutputType)(n)){const e=(0,i.inspect)(n);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing field args: ${n}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:n,args:L(e.args)}}function L(e){return(0,a.keyValMap)(e,(e=>e.name),S)}function S(e){const n=v(e.type);if(!(0,u.isInputType)(n)){const e=(0,i.inspect)(n);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const t=null!=e.defaultValue?(0,f.valueFromAST)((0,s.parseValue)(e.defaultValue),n):void 0;return{description:e.description,type:n,defaultValue:t,deprecationReason:e.deprecationReason}}};var r=t(7242),i=t(8002),o=t(5690),a=t(7154),s=t(8370),u=t(5003),c=t(7197),p=t(8155),l=t(2229),d=t(6829),f=t(3770)},3679:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.coerceInputValue=function(e,n,t=f){return y(e,n,t,void 0)};var r=t(166),i=t(8002),o=t(7706),a=t(6609),s=t(5690),u=t(7059),c=t(737),p=t(8070),l=t(5822),d=t(5003);function f(e,n,t){let r="Invalid value "+(0,i.inspect)(n);throw e.length>0&&(r+=` at "value${(0,c.printPathArray)(e)}"`),t.message=r+": "+t.message,t}function y(e,n,t,c){if((0,d.isNonNullType)(n))return null!=e?y(e,n.ofType,t,c):void t((0,u.pathToArray)(c),e,new l.GraphQLError(`Expected non-nullable type "${(0,i.inspect)(n)}" not to be null.`));if(null==e)return null;if((0,d.isListType)(n)){const r=n.ofType;return(0,a.isIterableObject)(e)?Array.from(e,((e,n)=>{const i=(0,u.addPath)(c,n,void 0);return y(e,r,t,i)})):[y(e,r,t,c)]}if((0,d.isInputObjectType)(n)){if(!(0,s.isObjectLike)(e))return void t((0,u.pathToArray)(c),e,new l.GraphQLError(`Expected type "${n.name}" to be an object.`));const o={},a=n.getFields();for(const r of Object.values(a)){const a=e[r.name];if(void 0!==a)o[r.name]=y(a,r.type,t,(0,u.addPath)(c,r.name,n.name));else if(void 0!==r.defaultValue)o[r.name]=r.defaultValue;else if((0,d.isNonNullType)(r.type)){const n=(0,i.inspect)(r.type);t((0,u.pathToArray)(c),e,new l.GraphQLError(`Field "${r.name}" of required type "${n}" was not provided.`))}}for(const i of Object.keys(e))if(!a[i]){const o=(0,p.suggestionList)(i,Object.keys(n.getFields()));t((0,u.pathToArray)(c),e,new l.GraphQLError(`Field "${i}" is not defined by type "${n.name}".`+(0,r.didYouMean)(o)))}return o}if((0,d.isLeafType)(n)){let r;try{r=n.parseValue(e)}catch(r){return void(r instanceof l.GraphQLError?t((0,u.pathToArray)(c),e,r):t((0,u.pathToArray)(c),e,new l.GraphQLError(`Expected type "${n.name}". `+r.message,{originalError:r})))}return void 0===r&&t((0,u.pathToArray)(c),e,new l.GraphQLError(`Expected type "${n.name}".`)),r}(0,o.invariant)(!1,"Unexpected input type: "+(0,i.inspect)(n))}},6078:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.concatAST=function(e){const n=[];for(const t of e)n.push(...t.definitions);return{kind:r.Kind.DOCUMENT,definitions:n}};var r=t(2828)},3242:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.extendSchema=function(e,n,t){(0,y.assertSchema)(e),null!=n&&n.kind===u.Kind.DOCUMENT||(0,r.devAssert)(!1,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&(0,m.assertValidSDLExtension)(n,e);const i=e.toConfig(),o=b(i,n,t);return i===o?e:new y.GraphQLSchema(o)},n.extendSchemaImpl=b;var r=t(7242),i=t(8002),o=t(7706),a=t(2863),s=t(6124),u=t(2828),c=t(1352),p=t(5003),l=t(7197),d=t(8155),f=t(2229),y=t(6829),m=t(9504),h=t(8840),T=t(3770);function b(e,n,t){var r,a,y,m;const h=[],b=Object.create(null),N=[];let O;const I=[];for(const e of n.definitions)if(e.kind===u.Kind.SCHEMA_DEFINITION)O=e;else if(e.kind===u.Kind.SCHEMA_EXTENSION)I.push(e);else if((0,c.isTypeDefinitionNode)(e))h.push(e);else if((0,c.isTypeExtensionNode)(e)){const n=e.name.value,t=b[n];b[n]=t?t.concat([e]):[e]}else e.kind===u.Kind.DIRECTIVE_DEFINITION&&N.push(e);if(0===Object.keys(b).length&&0===h.length&&0===N.length&&0===I.length&&null==O)return e;const _=Object.create(null);for(const n of e.types)_[n.name]=(L=n,(0,d.isIntrospectionType)(L)||(0,f.isSpecifiedScalarType)(L)?L:(0,p.isScalarType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];let i=t.specifiedByURL;for(const e of r){var o;i=null!==(o=E(e))&&void 0!==o?o:i}return new p.GraphQLScalarType({...t,specifiedByURL:i,extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isObjectType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];return new p.GraphQLObjectType({...t,interfaces:()=>[...e.getInterfaces().map(A),...M(r)],fields:()=>({...(0,s.mapValue)(t.fields,P),...x(r)}),extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isInterfaceType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];return new p.GraphQLInterfaceType({...t,interfaces:()=>[...e.getInterfaces().map(A),...M(r)],fields:()=>({...(0,s.mapValue)(t.fields,P),...x(r)}),extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isUnionType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];return new p.GraphQLUnionType({...t,types:()=>[...e.getTypes().map(A),...K(r)],extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isEnumType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[e.name])&&void 0!==n?n:[];return new p.GraphQLEnumType({...t,values:{...t.values,...C(r)},extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isInputObjectType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];return new p.GraphQLInputObjectType({...t,fields:()=>({...(0,s.mapValue)(t.fields,(e=>({...e,type:j(e.type)}))),...V(r)}),extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):void(0,o.invariant)(!1,"Unexpected type: "+(0,i.inspect)(L)));var L;for(const e of h){var S;const n=e.name.value;_[n]=null!==(S=v[n])&&void 0!==S?S:Q(e)}const D={query:e.query&&A(e.query),mutation:e.mutation&&A(e.mutation),subscription:e.subscription&&A(e.subscription),...O&&w([O]),...w(I)};return{description:null===(r=O)||void 0===r||null===(a=r.description)||void 0===a?void 0:a.value,...D,types:Object.values(_),directives:[...e.directives.map((function(e){const n=e.toConfig();return new l.GraphQLDirective({...n,args:(0,s.mapValue)(n.args,R)})})),...N.map((function(e){var n;return new l.GraphQLDirective({name:e.name.value,description:null===(n=e.description)||void 0===n?void 0:n.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:G(e.arguments),astNode:e})}))],extensions:Object.create(null),astNode:null!==(y=O)&&void 0!==y?y:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(I),assumeValid:null!==(m=null==t?void 0:t.assumeValid)&&void 0!==m&&m};function j(e){return(0,p.isListType)(e)?new p.GraphQLList(j(e.ofType)):(0,p.isNonNullType)(e)?new p.GraphQLNonNull(j(e.ofType)):A(e)}function A(e){return _[e.name]}function P(e){return{...e,type:j(e.type),args:e.args&&(0,s.mapValue)(e.args,R)}}function R(e){return{...e,type:j(e.type)}}function w(e){const n={};for(const r of e){var t;const e=null!==(t=r.operationTypes)&&void 0!==t?t:[];for(const t of e)n[t.operation]=k(t.type)}return n}function k(e){var n;const t=e.name.value,r=null!==(n=v[t])&&void 0!==n?n:_[t];if(void 0===r)throw new Error(`Unknown type: "${t}".`);return r}function F(e){return e.kind===u.Kind.LIST_TYPE?new p.GraphQLList(F(e.type)):e.kind===u.Kind.NON_NULL_TYPE?new p.GraphQLNonNull(F(e.type)):k(e)}function x(e){const n=Object.create(null);for(const i of e){var t;const e=null!==(t=i.fields)&&void 0!==t?t:[];for(const t of e){var r;n[t.name.value]={type:F(t.type),description:null===(r=t.description)||void 0===r?void 0:r.value,args:G(t.arguments),deprecationReason:g(t),astNode:t}}}return n}function G(e){const n=null!=e?e:[],t=Object.create(null);for(const e of n){var r;const n=F(e.type);t[e.name.value]={type:n,description:null===(r=e.description)||void 0===r?void 0:r.value,defaultValue:(0,T.valueFromAST)(e.defaultValue,n),deprecationReason:g(e),astNode:e}}return t}function V(e){const n=Object.create(null);for(const i of e){var t;const e=null!==(t=i.fields)&&void 0!==t?t:[];for(const t of e){var r;const e=F(t.type);n[t.name.value]={type:e,description:null===(r=t.description)||void 0===r?void 0:r.value,defaultValue:(0,T.valueFromAST)(t.defaultValue,e),deprecationReason:g(t),astNode:t}}}return n}function C(e){const n=Object.create(null);for(const i of e){var t;const e=null!==(t=i.values)&&void 0!==t?t:[];for(const t of e){var r;n[t.name.value]={description:null===(r=t.description)||void 0===r?void 0:r.value,deprecationReason:g(t),astNode:t}}}return n}function M(e){return e.flatMap((e=>{var n,t;return null!==(n=null===(t=e.interfaces)||void 0===t?void 0:t.map(k))&&void 0!==n?n:[]}))}function K(e){return e.flatMap((e=>{var n,t;return null!==(n=null===(t=e.types)||void 0===t?void 0:t.map(k))&&void 0!==n?n:[]}))}function Q(e){var n;const t=e.name.value,r=null!==(n=b[t])&&void 0!==n?n:[];switch(e.kind){case u.Kind.OBJECT_TYPE_DEFINITION:{var i;const n=[e,...r];return new p.GraphQLObjectType({name:t,description:null===(i=e.description)||void 0===i?void 0:i.value,interfaces:()=>M(n),fields:()=>x(n),astNode:e,extensionASTNodes:r})}case u.Kind.INTERFACE_TYPE_DEFINITION:{var o;const n=[e,...r];return new p.GraphQLInterfaceType({name:t,description:null===(o=e.description)||void 0===o?void 0:o.value,interfaces:()=>M(n),fields:()=>x(n),astNode:e,extensionASTNodes:r})}case u.Kind.ENUM_TYPE_DEFINITION:{var a;const n=[e,...r];return new p.GraphQLEnumType({name:t,description:null===(a=e.description)||void 0===a?void 0:a.value,values:C(n),astNode:e,extensionASTNodes:r})}case u.Kind.UNION_TYPE_DEFINITION:{var s;const n=[e,...r];return new p.GraphQLUnionType({name:t,description:null===(s=e.description)||void 0===s?void 0:s.value,types:()=>K(n),astNode:e,extensionASTNodes:r})}case u.Kind.SCALAR_TYPE_DEFINITION:var c;return new p.GraphQLScalarType({name:t,description:null===(c=e.description)||void 0===c?void 0:c.value,specifiedByURL:E(e),astNode:e,extensionASTNodes:r});case u.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var l;const n=[e,...r];return new p.GraphQLInputObjectType({name:t,description:null===(l=e.description)||void 0===l?void 0:l.value,fields:()=>V(n),astNode:e,extensionASTNodes:r})}}}}const v=(0,a.keyMap)([...f.specifiedScalarTypes,...d.introspectionTypes],(e=>e.name));function g(e){const n=(0,h.getDirectiveValues)(l.GraphQLDeprecatedDirective,e);return null==n?void 0:n.reason}function E(e){const n=(0,h.getDirectiveValues)(l.GraphQLSpecifiedByDirective,e);return null==n?void 0:n.url}},3298:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.DangerousChangeType=n.BreakingChangeType=void 0,n.findBreakingChanges=function(e,n){return f(e,n).filter((e=>e.type in r))},n.findDangerousChanges=function(e,n){return f(e,n).filter((e=>e.type in i))};var r,i,o=t(8002),a=t(7706),s=t(2863),u=t(3033),c=t(5003),p=t(2229),l=t(8115),d=t(6830);function f(e,n){return[...m(e,n),...y(e,n)]}function y(e,n){const t=[],i=L(e.getDirectives(),n.getDirectives());for(const e of i.removed)t.push({type:r.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(const[e,n]of i.persisted){const i=L(e.args,n.args);for(const n of i.added)(0,c.isRequiredArgument)(n)&&t.push({type:r.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${n.name} on directive ${e.name} was added.`});for(const n of i.removed)t.push({type:r.DIRECTIVE_ARG_REMOVED,description:`${n.name} was removed from ${e.name}.`});e.isRepeatable&&!n.isRepeatable&&t.push({type:r.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(const i of e.locations)n.locations.includes(i)||t.push({type:r.DIRECTIVE_LOCATION_REMOVED,description:`${i} was removed from ${e.name}.`})}return t}function m(e,n){const t=[],i=L(Object.values(e.getTypeMap()),Object.values(n.getTypeMap()));for(const e of i.removed)t.push({type:r.TYPE_REMOVED,description:(0,p.isSpecifiedScalarType)(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(const[e,n]of i.persisted)(0,c.isEnumType)(e)&&(0,c.isEnumType)(n)?t.push(...b(e,n)):(0,c.isUnionType)(e)&&(0,c.isUnionType)(n)?t.push(...T(e,n)):(0,c.isInputObjectType)(e)&&(0,c.isInputObjectType)(n)?t.push(...h(e,n)):(0,c.isObjectType)(e)&&(0,c.isObjectType)(n)||(0,c.isInterfaceType)(e)&&(0,c.isInterfaceType)(n)?t.push(...g(e,n),...v(e,n)):e.constructor!==n.constructor&&t.push({type:r.TYPE_CHANGED_KIND,description:`${e.name} changed from ${I(e)} to ${I(n)}.`});return t}function h(e,n){const t=[],o=L(Object.values(e.getFields()),Object.values(n.getFields()));for(const n of o.added)(0,c.isRequiredInputField)(n)?t.push({type:r.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${n.name} on input type ${e.name} was added.`}):t.push({type:i.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${n.name} on input type ${e.name} was added.`});for(const n of o.removed)t.push({type:r.FIELD_REMOVED,description:`${e.name}.${n.name} was removed.`});for(const[n,i]of o.persisted)O(n.type,i.type)||t.push({type:r.FIELD_CHANGED_KIND,description:`${e.name}.${n.name} changed type from ${String(n.type)} to ${String(i.type)}.`});return t}function T(e,n){const t=[],o=L(e.getTypes(),n.getTypes());for(const n of o.added)t.push({type:i.TYPE_ADDED_TO_UNION,description:`${n.name} was added to union type ${e.name}.`});for(const n of o.removed)t.push({type:r.TYPE_REMOVED_FROM_UNION,description:`${n.name} was removed from union type ${e.name}.`});return t}function b(e,n){const t=[],o=L(e.getValues(),n.getValues());for(const n of o.added)t.push({type:i.VALUE_ADDED_TO_ENUM,description:`${n.name} was added to enum type ${e.name}.`});for(const n of o.removed)t.push({type:r.VALUE_REMOVED_FROM_ENUM,description:`${n.name} was removed from enum type ${e.name}.`});return t}function v(e,n){const t=[],o=L(e.getInterfaces(),n.getInterfaces());for(const n of o.added)t.push({type:i.IMPLEMENTED_INTERFACE_ADDED,description:`${n.name} added to interfaces implemented by ${e.name}.`});for(const n of o.removed)t.push({type:r.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${n.name}.`});return t}function g(e,n){const t=[],i=L(Object.values(e.getFields()),Object.values(n.getFields()));for(const n of i.removed)t.push({type:r.FIELD_REMOVED,description:`${e.name}.${n.name} was removed.`});for(const[n,o]of i.persisted)t.push(...E(e,n,o)),N(n.type,o.type)||t.push({type:r.FIELD_CHANGED_KIND,description:`${e.name}.${n.name} changed type from ${String(n.type)} to ${String(o.type)}.`});return t}function E(e,n,t){const o=[],a=L(n.args,t.args);for(const t of a.removed)o.push({type:r.ARG_REMOVED,description:`${e.name}.${n.name} arg ${t.name} was removed.`});for(const[t,s]of a.persisted)if(O(t.type,s.type)){if(void 0!==t.defaultValue)if(void 0===s.defaultValue)o.push({type:i.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${n.name} arg ${t.name} defaultValue was removed.`});else{const r=_(t.defaultValue,t.type),a=_(s.defaultValue,s.type);r!==a&&o.push({type:i.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${n.name} arg ${t.name} has changed defaultValue from ${r} to ${a}.`})}}else o.push({type:r.ARG_CHANGED_KIND,description:`${e.name}.${n.name} arg ${t.name} has changed type from ${String(t.type)} to ${String(s.type)}.`});for(const t of a.added)(0,c.isRequiredArgument)(t)?o.push({type:r.REQUIRED_ARG_ADDED,description:`A required arg ${t.name} on ${e.name}.${n.name} was added.`}):o.push({type:i.OPTIONAL_ARG_ADDED,description:`An optional arg ${t.name} on ${e.name}.${n.name} was added.`});return o}function N(e,n){return(0,c.isListType)(e)?(0,c.isListType)(n)&&N(e.ofType,n.ofType)||(0,c.isNonNullType)(n)&&N(e,n.ofType):(0,c.isNonNullType)(e)?(0,c.isNonNullType)(n)&&N(e.ofType,n.ofType):(0,c.isNamedType)(n)&&e.name===n.name||(0,c.isNonNullType)(n)&&N(e,n.ofType)}function O(e,n){return(0,c.isListType)(e)?(0,c.isListType)(n)&&O(e.ofType,n.ofType):(0,c.isNonNullType)(e)?(0,c.isNonNullType)(n)&&O(e.ofType,n.ofType)||!(0,c.isNonNullType)(n)&&O(e.ofType,n):(0,c.isNamedType)(n)&&e.name===n.name}function I(e){return(0,c.isScalarType)(e)?"a Scalar type":(0,c.isObjectType)(e)?"an Object type":(0,c.isInterfaceType)(e)?"an Interface type":(0,c.isUnionType)(e)?"a Union type":(0,c.isEnumType)(e)?"an Enum type":(0,c.isInputObjectType)(e)?"an Input type":void(0,a.invariant)(!1,"Unexpected type: "+(0,o.inspect)(e))}function _(e,n){const t=(0,l.astFromValue)(e,n);return null!=t||(0,a.invariant)(!1),(0,u.print)((0,d.sortValueNode)(t))}function L(e,n){const t=[],r=[],i=[],o=(0,s.keyMap)(e,(({name:e})=>e)),a=(0,s.keyMap)(n,(({name:e})=>e));for(const n of e){const e=a[n.name];void 0===e?r.push(n):i.push([n,e])}for(const e of n)void 0===o[e.name]&&t.push(e);return{added:t,persisted:i,removed:r}}n.BreakingChangeType=r,function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"}(r||(n.BreakingChangeType=r={})),n.DangerousChangeType=i,function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"}(i||(n.DangerousChangeType=i={}))},9363:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.getIntrospectionQuery=function(e){const n={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},t=n.descriptions?"description":"",r=n.specifiedByUrl?"specifiedByURL":"",i=n.directiveIsRepeatable?"isRepeatable":"";function o(e){return n.inputValueDeprecation?e:""}return`\n query IntrospectionQuery {\n __schema {\n ${n.schemaDescription?t:""}\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ${t}\n ${i}\n locations\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ${t}\n ${r}\n fields(includeDeprecated: true) {\n name\n ${t}\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ${t}\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ${t}\n type { ...TypeRef }\n defaultValue\n ${o("isDeprecated")}\n ${o("deprecationReason")}\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n `}},9535:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.getOperationAST=function(e,n){let t=null;for(const o of e.definitions){var i;if(o.kind===r.Kind.OPERATION_DEFINITION)if(null==n){if(t)return null;t=o}else if((null===(i=o.name)||void 0===i?void 0:i.value)===n)return o}return t};var r=t(2828)},8678:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.getOperationRootType=function(e,n){if("query"===n.operation){const t=e.getQueryType();if(!t)throw new r.GraphQLError("Schema does not define the required query root type.",{nodes:n});return t}if("mutation"===n.operation){const t=e.getMutationType();if(!t)throw new r.GraphQLError("Schema is not configured for mutations.",{nodes:n});return t}if("subscription"===n.operation){const t=e.getSubscriptionType();if(!t)throw new r.GraphQLError("Schema is not configured for subscriptions.",{nodes:n});return t}throw new r.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:n})};var r=t(5822)},9548:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BreakingChangeType",{enumerable:!0,get:function(){return O.BreakingChangeType}}),Object.defineProperty(n,"DangerousChangeType",{enumerable:!0,get:function(){return O.DangerousChangeType}}),Object.defineProperty(n,"TypeInfo",{enumerable:!0,get:function(){return h.TypeInfo}}),Object.defineProperty(n,"assertValidName",{enumerable:!0,get:function(){return N.assertValidName}}),Object.defineProperty(n,"astFromValue",{enumerable:!0,get:function(){return m.astFromValue}}),Object.defineProperty(n,"buildASTSchema",{enumerable:!0,get:function(){return u.buildASTSchema}}),Object.defineProperty(n,"buildClientSchema",{enumerable:!0,get:function(){return s.buildClientSchema}}),Object.defineProperty(n,"buildSchema",{enumerable:!0,get:function(){return u.buildSchema}}),Object.defineProperty(n,"coerceInputValue",{enumerable:!0,get:function(){return T.coerceInputValue}}),Object.defineProperty(n,"concatAST",{enumerable:!0,get:function(){return b.concatAST}}),Object.defineProperty(n,"doTypesOverlap",{enumerable:!0,get:function(){return E.doTypesOverlap}}),Object.defineProperty(n,"extendSchema",{enumerable:!0,get:function(){return c.extendSchema}}),Object.defineProperty(n,"findBreakingChanges",{enumerable:!0,get:function(){return O.findBreakingChanges}}),Object.defineProperty(n,"findDangerousChanges",{enumerable:!0,get:function(){return O.findDangerousChanges}}),Object.defineProperty(n,"getIntrospectionQuery",{enumerable:!0,get:function(){return r.getIntrospectionQuery}}),Object.defineProperty(n,"getOperationAST",{enumerable:!0,get:function(){return i.getOperationAST}}),Object.defineProperty(n,"getOperationRootType",{enumerable:!0,get:function(){return o.getOperationRootType}}),Object.defineProperty(n,"introspectionFromSchema",{enumerable:!0,get:function(){return a.introspectionFromSchema}}),Object.defineProperty(n,"isEqualType",{enumerable:!0,get:function(){return E.isEqualType}}),Object.defineProperty(n,"isTypeSubTypeOf",{enumerable:!0,get:function(){return E.isTypeSubTypeOf}}),Object.defineProperty(n,"isValidNameError",{enumerable:!0,get:function(){return N.isValidNameError}}),Object.defineProperty(n,"lexicographicSortSchema",{enumerable:!0,get:function(){return p.lexicographicSortSchema}}),Object.defineProperty(n,"printIntrospectionSchema",{enumerable:!0,get:function(){return l.printIntrospectionSchema}}),Object.defineProperty(n,"printSchema",{enumerable:!0,get:function(){return l.printSchema}}),Object.defineProperty(n,"printType",{enumerable:!0,get:function(){return l.printType}}),Object.defineProperty(n,"separateOperations",{enumerable:!0,get:function(){return v.separateOperations}}),Object.defineProperty(n,"stripIgnoredCharacters",{enumerable:!0,get:function(){return g.stripIgnoredCharacters}}),Object.defineProperty(n,"typeFromAST",{enumerable:!0,get:function(){return d.typeFromAST}}),Object.defineProperty(n,"valueFromAST",{enumerable:!0,get:function(){return f.valueFromAST}}),Object.defineProperty(n,"valueFromASTUntyped",{enumerable:!0,get:function(){return y.valueFromASTUntyped}}),Object.defineProperty(n,"visitWithTypeInfo",{enumerable:!0,get:function(){return h.visitWithTypeInfo}});var r=t(9363),i=t(9535),o=t(8678),a=t(8039),s=t(8686),u=t(2906),c=t(3242),p=t(8163),l=t(2821),d=t(5115),f=t(3770),y=t(7784),m=t(8115),h=t(6226),T=t(3679),b=t(6078),v=t(8243),g=t(2307),E=t(298),N=t(6526),O=t(3298)},8039:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.introspectionFromSchema=function(e,n){const t={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,...n},s=(0,i.parse)((0,a.getIntrospectionQuery)(t)),u=(0,o.executeSync)({schema:e,document:s});return!u.errors&&u.data||(0,r.invariant)(!1),u.data};var r=t(7706),i=t(8370),o=t(192),a=t(9363)},8163:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.lexicographicSortSchema=function(e){const n=e.toConfig(),t=(0,o.keyValMap)(d(n.types),(e=>e.name),(function(e){if((0,s.isScalarType)(e)||(0,c.isIntrospectionType)(e))return e;if((0,s.isObjectType)(e)){const n=e.toConfig();return new s.GraphQLObjectType({...n,interfaces:()=>b(n.interfaces),fields:()=>T(n.fields)})}if((0,s.isInterfaceType)(e)){const n=e.toConfig();return new s.GraphQLInterfaceType({...n,interfaces:()=>b(n.interfaces),fields:()=>T(n.fields)})}if((0,s.isUnionType)(e)){const n=e.toConfig();return new s.GraphQLUnionType({...n,types:()=>b(n.types)})}if((0,s.isEnumType)(e)){const n=e.toConfig();return new s.GraphQLEnumType({...n,values:l(n.values,(e=>e))})}if((0,s.isInputObjectType)(e)){const n=e.toConfig();return new s.GraphQLInputObjectType({...n,fields:()=>l(n.fields,(e=>({...e,type:a(e.type)})))})}(0,i.invariant)(!1,"Unexpected type: "+(0,r.inspect)(e))}));return new p.GraphQLSchema({...n,types:Object.values(t),directives:d(n.directives).map((function(e){const n=e.toConfig();return new u.GraphQLDirective({...n,locations:f(n.locations,(e=>e)),args:h(n.args)})})),query:m(n.query),mutation:m(n.mutation),subscription:m(n.subscription)});function a(e){return(0,s.isListType)(e)?new s.GraphQLList(a(e.ofType)):(0,s.isNonNullType)(e)?new s.GraphQLNonNull(a(e.ofType)):y(e)}function y(e){return t[e.name]}function m(e){return e&&y(e)}function h(e){return l(e,(e=>({...e,type:a(e.type)})))}function T(e){return l(e,(e=>({...e,type:a(e.type),args:e.args&&h(e.args)})))}function b(e){return d(e).map(y)}};var r=t(8002),i=t(7706),o=t(7154),a=t(5250),s=t(5003),u=t(7197),c=t(8155),p=t(6829);function l(e,n){const t=Object.create(null);for(const r of Object.keys(e).sort(a.naturalCompare))t[r]=n(e[r]);return t}function d(e){return f(e,(e=>e.name))}function f(e,n){return e.slice().sort(((e,t)=>{const r=n(e),i=n(t);return(0,a.naturalCompare)(r,i)}))}},2821:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.printIntrospectionSchema=function(e){return y(e,c.isSpecifiedDirective,p.isIntrospectionType)},n.printSchema=function(e){return y(e,(e=>!(0,c.isSpecifiedDirective)(e)),f)},n.printType=h;var r=t(8002),i=t(7706),o=t(849),a=t(2828),s=t(3033),u=t(5003),c=t(7197),p=t(8155),l=t(2229),d=t(8115);function f(e){return!(0,l.isSpecifiedScalarType)(e)&&!(0,p.isIntrospectionType)(e)}function y(e,n,t){const r=e.getDirectives().filter(n),i=Object.values(e.getTypeMap()).filter(t);return[m(e),...r.map((e=>function(e){return O(e)+"directive @"+e.name+g(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...i.map((e=>h(e)))].filter(Boolean).join("\n\n")}function m(e){if(null==e.description&&function(e){const n=e.getQueryType();if(n&&"Query"!==n.name)return!1;const t=e.getMutationType();if(t&&"Mutation"!==t.name)return!1;const r=e.getSubscriptionType();return!r||"Subscription"===r.name}(e))return;const n=[],t=e.getQueryType();t&&n.push(` query: ${t.name}`);const r=e.getMutationType();r&&n.push(` mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&n.push(` subscription: ${i.name}`),O(e)+`schema {\n${n.join("\n")}\n}`}function h(e){return(0,u.isScalarType)(e)?function(e){return O(e)+`scalar ${e.name}`+(null==(n=e).specifiedByURL?"":` @specifiedBy(url: ${(0,s.print)({kind:a.Kind.STRING,value:n.specifiedByURL})})`);var n}(e):(0,u.isObjectType)(e)?function(e){return O(e)+`type ${e.name}`+T(e)+b(e)}(e):(0,u.isInterfaceType)(e)?function(e){return O(e)+`interface ${e.name}`+T(e)+b(e)}(e):(0,u.isUnionType)(e)?function(e){const n=e.getTypes(),t=n.length?" = "+n.join(" | "):"";return O(e)+"union "+e.name+t}(e):(0,u.isEnumType)(e)?function(e){const n=e.getValues().map(((e,n)=>O(e," ",!n)+" "+e.name+N(e.deprecationReason)));return O(e)+`enum ${e.name}`+v(n)}(e):(0,u.isInputObjectType)(e)?function(e){const n=Object.values(e.getFields()).map(((e,n)=>O(e," ",!n)+" "+E(e)));return O(e)+`input ${e.name}`+v(n)}(e):void(0,i.invariant)(!1,"Unexpected type: "+(0,r.inspect)(e))}function T(e){const n=e.getInterfaces();return n.length?" implements "+n.map((e=>e.name)).join(" & "):""}function b(e){return v(Object.values(e.getFields()).map(((e,n)=>O(e," ",!n)+" "+e.name+g(e.args," ")+": "+String(e.type)+N(e.deprecationReason))))}function v(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function g(e,n=""){return 0===e.length?"":e.every((e=>!e.description))?"("+e.map(E).join(", ")+")":"(\n"+e.map(((e,t)=>O(e," "+n,!t)+" "+n+E(e))).join("\n")+"\n"+n+")"}function E(e){const n=(0,d.astFromValue)(e.defaultValue,e.type);let t=e.name+": "+String(e.type);return n&&(t+=` = ${(0,s.print)(n)}`),t+N(e.deprecationReason)}function N(e){return null==e?"":e!==c.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,s.print)({kind:a.Kind.STRING,value:e})})`:" @deprecated"}function O(e,n="",t=!0){const{description:r}=e;return null==r?"":(n&&!t?"\n"+n:n)+(0,s.print)({kind:a.Kind.STRING,value:r,block:(0,o.isPrintableAsBlockString)(r)}).replace(/\n/g,"\n"+n)+"\n"}},8243:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.separateOperations=function(e){const n=[],t=Object.create(null);for(const i of e.definitions)switch(i.kind){case r.Kind.OPERATION_DEFINITION:n.push(i);break;case r.Kind.FRAGMENT_DEFINITION:t[i.name.value]=a(i.selectionSet)}const i=Object.create(null);for(const s of n){const n=new Set;for(const e of a(s.selectionSet))o(n,t,e);i[s.name?s.name.value:""]={kind:r.Kind.DOCUMENT,definitions:e.definitions.filter((e=>e===s||e.kind===r.Kind.FRAGMENT_DEFINITION&&n.has(e.name.value)))}}return i};var r=t(2828),i=t(285);function o(e,n,t){if(!e.has(t)){e.add(t);const r=n[t];if(void 0!==r)for(const t of r)o(e,n,t)}}function a(e){const n=[];return(0,i.visit)(e,{FragmentSpread(e){n.push(e.name.value)}}),n}},6830:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.sortValueNode=function e(n){switch(n.kind){case i.Kind.OBJECT:return{...n,fields:(t=n.fields,t.map((n=>({...n,value:e(n.value)}))).sort(((e,n)=>(0,r.naturalCompare)(e.name.value,n.name.value))))};case i.Kind.LIST:return{...n,values:n.values.map(e)};case i.Kind.INT:case i.Kind.FLOAT:case i.Kind.STRING:case i.Kind.BOOLEAN:case i.Kind.NULL:case i.Kind.ENUM:case i.Kind.VARIABLE:return n}var t};var r=t(5250),i=t(2828)},2307:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.stripIgnoredCharacters=function(e){const n=(0,o.isSource)(e)?e:new o.Source(e),t=n.body,s=new i.Lexer(n);let u="",c=!1;for(;s.advance().kind!==a.TokenKind.EOF;){const e=s.token,n=e.kind,o=!(0,i.isPunctuatorTokenKind)(e.kind);c&&(o||e.kind===a.TokenKind.SPREAD)&&(u+=" ");const p=t.slice(e.start,e.end);n===a.TokenKind.BLOCK_STRING?u+=(0,r.printBlockString)(e.value,{minimize:!0}):u+=p,c=o}return u};var r=t(849),i=t(4274),o=t(2412),a=t(3175)},298:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.doTypesOverlap=function(e,n,t){return n===t||((0,r.isAbstractType)(n)?(0,r.isAbstractType)(t)?e.getPossibleTypes(n).some((n=>e.isSubType(t,n))):e.isSubType(n,t):!!(0,r.isAbstractType)(t)&&e.isSubType(t,n))},n.isEqualType=function e(n,t){return n===t||((0,r.isNonNullType)(n)&&(0,r.isNonNullType)(t)||!(!(0,r.isListType)(n)||!(0,r.isListType)(t)))&&e(n.ofType,t.ofType)},n.isTypeSubTypeOf=function e(n,t,i){return t===i||((0,r.isNonNullType)(i)?!!(0,r.isNonNullType)(t)&&e(n,t.ofType,i.ofType):(0,r.isNonNullType)(t)?e(n,t.ofType,i):(0,r.isListType)(i)?!!(0,r.isListType)(t)&&e(n,t.ofType,i.ofType):!(0,r.isListType)(t)&&((0,r.isAbstractType)(i)&&((0,r.isInterfaceType)(t)||(0,r.isObjectType)(t))&&n.isSubType(i,t)))};var r=t(5003)},5115:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.typeFromAST=function e(n,t){switch(t.kind){case r.Kind.LIST_TYPE:{const r=e(n,t.type);return r&&new i.GraphQLList(r)}case r.Kind.NON_NULL_TYPE:{const r=e(n,t.type);return r&&new i.GraphQLNonNull(r)}case r.Kind.NAMED_TYPE:return n.getType(t.name.value)}};var r=t(2828),i=t(5003)},3770:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.valueFromAST=function e(n,t,c){if(n){if(n.kind===a.Kind.VARIABLE){const e=n.name.value;if(null==c||void 0===c[e])return;const r=c[e];if(null===r&&(0,s.isNonNullType)(t))return;return r}if((0,s.isNonNullType)(t)){if(n.kind===a.Kind.NULL)return;return e(n,t.ofType,c)}if(n.kind===a.Kind.NULL)return null;if((0,s.isListType)(t)){const r=t.ofType;if(n.kind===a.Kind.LIST){const t=[];for(const i of n.values)if(u(i,c)){if((0,s.isNonNullType)(r))return;t.push(null)}else{const n=e(i,r,c);if(void 0===n)return;t.push(n)}return t}const i=e(n,r,c);if(void 0===i)return;return[i]}if((0,s.isInputObjectType)(t)){if(n.kind!==a.Kind.OBJECT)return;const r=Object.create(null),i=(0,o.keyMap)(n.fields,(e=>e.name.value));for(const n of Object.values(t.getFields())){const t=i[n.name];if(!t||u(t.value,c)){if(void 0!==n.defaultValue)r[n.name]=n.defaultValue;else if((0,s.isNonNullType)(n.type))return;continue}const o=e(t.value,n.type,c);if(void 0===o)return;r[n.name]=o}return r}if((0,s.isLeafType)(t)){let e;try{e=t.parseLiteral(n,c)}catch(e){return}if(void 0===e)return;return e}(0,i.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(t))}};var r=t(8002),i=t(7706),o=t(2863),a=t(2828),s=t(5003);function u(e,n){return e.kind===a.Kind.VARIABLE&&(null==n||void 0===n[e.name.value])}},7784:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.valueFromASTUntyped=function e(n,t){switch(n.kind){case i.Kind.NULL:return null;case i.Kind.INT:return parseInt(n.value,10);case i.Kind.FLOAT:return parseFloat(n.value);case i.Kind.STRING:case i.Kind.ENUM:case i.Kind.BOOLEAN:return n.value;case i.Kind.LIST:return n.values.map((n=>e(n,t)));case i.Kind.OBJECT:return(0,r.keyValMap)(n.fields,(e=>e.name.value),(n=>e(n.value,t)));case i.Kind.VARIABLE:return null==t?void 0:t[n.name.value]}};var r=t(7154),i=t(2828)},3955:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.ValidationContext=n.SDLValidationContext=n.ASTValidationContext=void 0;var r=t(2828),i=t(285),o=t(6226);class a{constructor(e,n){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const e of this.getDocument().definitions)e.kind===r.Kind.FRAGMENT_DEFINITION&&(n[e.name.value]=e);this._fragments=n}return n[e]}getFragmentSpreads(e){let n=this._fragmentSpreads.get(e);if(!n){n=[];const t=[e];let i;for(;i=t.pop();)for(const e of i.selections)e.kind===r.Kind.FRAGMENT_SPREAD?n.push(e):e.selectionSet&&t.push(e.selectionSet);this._fragmentSpreads.set(e,n)}return n}getRecursivelyReferencedFragments(e){let n=this._recursivelyReferencedFragments.get(e);if(!n){n=[];const t=Object.create(null),r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!0!==t[i]){t[i]=!0;const e=this.getFragment(i);e&&(n.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,n)}return n}}n.ASTValidationContext=a;class s extends a{constructor(e,n,t){super(e,t),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}n.SDLValidationContext=s;class u extends a{constructor(e,n,t,r){super(n,r),this._schema=e,this._typeInfo=t,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let n=this._variableUsages.get(e);if(!n){const t=[],r=new o.TypeInfo(this._schema);(0,i.visit)(e,(0,o.visitWithTypeInfo)(r,{VariableDefinition:()=>!1,Variable(e){t.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),n=t,this._variableUsages.set(e,n)}return n}getRecursiveVariableUsages(e){let n=this._recursiveVariableUsages.get(e);if(!n){n=this.getVariableUsages(e);for(const t of this.getRecursivelyReferencedFragments(e))n=n.concat(this.getVariableUsages(t));this._recursiveVariableUsages.set(e,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}n.ValidationContext=u},1122:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return a.ExecutableDefinitionsRule}}),Object.defineProperty(n,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return s.FieldsOnCorrectTypeRule}}),Object.defineProperty(n,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return u.FragmentsOnCompositeTypesRule}}),Object.defineProperty(n,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return c.KnownArgumentNamesRule}}),Object.defineProperty(n,"KnownDirectivesRule",{enumerable:!0,get:function(){return p.KnownDirectivesRule}}),Object.defineProperty(n,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return l.KnownFragmentNamesRule}}),Object.defineProperty(n,"KnownTypeNamesRule",{enumerable:!0,get:function(){return d.KnownTypeNamesRule}}),Object.defineProperty(n,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return f.LoneAnonymousOperationRule}}),Object.defineProperty(n,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return R.LoneSchemaDefinitionRule}}),Object.defineProperty(n,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return M.NoDeprecatedCustomRule}}),Object.defineProperty(n,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return y.NoFragmentCyclesRule}}),Object.defineProperty(n,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return K.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(n,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return m.NoUndefinedVariablesRule}}),Object.defineProperty(n,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return h.NoUnusedFragmentsRule}}),Object.defineProperty(n,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return T.NoUnusedVariablesRule}}),Object.defineProperty(n,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return b.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(n,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return v.PossibleFragmentSpreadsRule}}),Object.defineProperty(n,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return C.PossibleTypeExtensionsRule}}),Object.defineProperty(n,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return g.ProvidedRequiredArgumentsRule}}),Object.defineProperty(n,"ScalarLeafsRule",{enumerable:!0,get:function(){return E.ScalarLeafsRule}}),Object.defineProperty(n,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return N.SingleFieldSubscriptionsRule}}),Object.defineProperty(n,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return G.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(n,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return O.UniqueArgumentNamesRule}}),Object.defineProperty(n,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return V.UniqueDirectiveNamesRule}}),Object.defineProperty(n,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return I.UniqueDirectivesPerLocationRule}}),Object.defineProperty(n,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return F.UniqueEnumValueNamesRule}}),Object.defineProperty(n,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return x.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(n,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return _.UniqueFragmentNamesRule}}),Object.defineProperty(n,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return L.UniqueInputFieldNamesRule}}),Object.defineProperty(n,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return S.UniqueOperationNamesRule}}),Object.defineProperty(n,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return w.UniqueOperationTypesRule}}),Object.defineProperty(n,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return k.UniqueTypeNamesRule}}),Object.defineProperty(n,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return D.UniqueVariableNamesRule}}),Object.defineProperty(n,"ValidationContext",{enumerable:!0,get:function(){return i.ValidationContext}}),Object.defineProperty(n,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return j.ValuesOfCorrectTypeRule}}),Object.defineProperty(n,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return A.VariablesAreInputTypesRule}}),Object.defineProperty(n,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return P.VariablesInAllowedPositionRule}}),Object.defineProperty(n,"specifiedRules",{enumerable:!0,get:function(){return o.specifiedRules}}),Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return r.validate}});var r=t(9504),i=t(3955),o=t(4710),a=t(5285),s=t(9426),u=t(3558),c=t(9989),p=t(2826),l=t(1843),d=t(5961),f=t(870),y=t(658),m=t(7459),h=t(7317),T=t(8769),b=t(4331),v=t(5904),g=t(4312),E=t(7168),N=t(4666),O=t(4986),I=t(3576),_=t(5883),L=t(4313),S=t(2139),D=t(4243),j=t(6869),A=t(4942),P=t(8034),R=t(3411),w=t(856),k=t(1686),F=t(6400),x=t(4046),G=t(3878),V=t(6753),C=t(5715),M=t(2860),K=t(2276)},5285:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.ExecutableDefinitionsRule=function(e){return{Document(n){for(const t of n.definitions)if(!(0,o.isExecutableDefinitionNode)(t)){const n=t.kind===i.Kind.SCHEMA_DEFINITION||t.kind===i.Kind.SCHEMA_EXTENSION?"schema":'"'+t.name.value+'"';e.reportError(new r.GraphQLError(`The ${n} definition is not executable.`,{nodes:t}))}return!1}}};var r=t(5822),i=t(2828),o=t(1352)},9426:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.FieldsOnCorrectTypeRule=function(e){return{Field(n){const t=e.getParentType();if(t&&!e.getFieldDef()){const u=e.getSchema(),c=n.name.value;let p=(0,r.didYouMean)("to use an inline fragment on",function(e,n,t){if(!(0,s.isAbstractType)(n))return[];const r=new Set,o=Object.create(null);for(const i of e.getPossibleTypes(n))if(i.getFields()[t]){r.add(i),o[i.name]=1;for(const e of i.getInterfaces()){var a;e.getFields()[t]&&(r.add(e),o[e.name]=(null!==(a=o[e.name])&&void 0!==a?a:0)+1)}}return[...r].sort(((n,t)=>{const r=o[t.name]-o[n.name];return 0!==r?r:(0,s.isInterfaceType)(n)&&e.isSubType(n,t)?-1:(0,s.isInterfaceType)(t)&&e.isSubType(t,n)?1:(0,i.naturalCompare)(n.name,t.name)})).map((e=>e.name))}(u,t,c));""===p&&(p=(0,r.didYouMean)(function(e,n){if((0,s.isObjectType)(e)||(0,s.isInterfaceType)(e)){const t=Object.keys(e.getFields());return(0,o.suggestionList)(n,t)}return[]}(t,c))),e.reportError(new a.GraphQLError(`Cannot query field "${c}" on type "${t.name}".`+p,{nodes:n}))}}}};var r=t(166),i=t(5250),o=t(8070),a=t(5822),s=t(5003)},3558:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.FragmentsOnCompositeTypesRule=function(e){return{InlineFragment(n){const t=n.typeCondition;if(t){const n=(0,a.typeFromAST)(e.getSchema(),t);if(n&&!(0,o.isCompositeType)(n)){const n=(0,i.print)(t);e.reportError(new r.GraphQLError(`Fragment cannot condition on non composite type "${n}".`,{nodes:t}))}}},FragmentDefinition(n){const t=(0,a.typeFromAST)(e.getSchema(),n.typeCondition);if(t&&!(0,o.isCompositeType)(t)){const t=(0,i.print)(n.typeCondition);e.reportError(new r.GraphQLError(`Fragment "${n.name.value}" cannot condition on non composite type "${t}".`,{nodes:n.typeCondition}))}}}};var r=t(5822),i=t(3033),o=t(5003),a=t(5115)},9989:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.KnownArgumentNamesOnDirectivesRule=u,n.KnownArgumentNamesRule=function(e){return{...u(e),Argument(n){const t=e.getArgument(),a=e.getFieldDef(),s=e.getParentType();if(!t&&a&&s){const t=n.name.value,u=a.args.map((e=>e.name)),c=(0,i.suggestionList)(t,u);e.reportError(new o.GraphQLError(`Unknown argument "${t}" on field "${s.name}.${a.name}".`+(0,r.didYouMean)(c),{nodes:n}))}}}};var r=t(166),i=t(8070),o=t(5822),a=t(2828),s=t(7197);function u(e){const n=Object.create(null),t=e.getSchema(),u=t?t.getDirectives():s.specifiedDirectives;for(const e of u)n[e.name]=e.args.map((e=>e.name));const c=e.getDocument().definitions;for(const e of c)if(e.kind===a.Kind.DIRECTIVE_DEFINITION){var p;const t=null!==(p=e.arguments)&&void 0!==p?p:[];n[e.name.value]=t.map((e=>e.name.value))}return{Directive(t){const a=t.name.value,s=n[a];if(t.arguments&&s)for(const n of t.arguments){const t=n.name.value;if(!s.includes(t)){const u=(0,i.suggestionList)(t,s);e.reportError(new o.GraphQLError(`Unknown argument "${t}" on directive "@${a}".`+(0,r.didYouMean)(u),{nodes:n}))}}return!1}}}},2826:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.KnownDirectivesRule=function(e){const n=Object.create(null),t=e.getSchema(),p=t?t.getDirectives():c.specifiedDirectives;for(const e of p)n[e.name]=e.locations;const l=e.getDocument().definitions;for(const e of l)e.kind===u.Kind.DIRECTIVE_DEFINITION&&(n[e.name.value]=e.locations.map((e=>e.value)));return{Directive(t,c,p,l,d){const f=t.name.value,y=n[f];if(!y)return void e.reportError(new o.GraphQLError(`Unknown directive "@${f}".`,{nodes:t}));const m=function(e){const n=e[e.length-1];switch("kind"in n||(0,i.invariant)(!1),n.kind){case u.Kind.OPERATION_DEFINITION:return function(e){switch(e){case a.OperationTypeNode.QUERY:return s.DirectiveLocation.QUERY;case a.OperationTypeNode.MUTATION:return s.DirectiveLocation.MUTATION;case a.OperationTypeNode.SUBSCRIPTION:return s.DirectiveLocation.SUBSCRIPTION}}(n.operation);case u.Kind.FIELD:return s.DirectiveLocation.FIELD;case u.Kind.FRAGMENT_SPREAD:return s.DirectiveLocation.FRAGMENT_SPREAD;case u.Kind.INLINE_FRAGMENT:return s.DirectiveLocation.INLINE_FRAGMENT;case u.Kind.FRAGMENT_DEFINITION:return s.DirectiveLocation.FRAGMENT_DEFINITION;case u.Kind.VARIABLE_DEFINITION:return s.DirectiveLocation.VARIABLE_DEFINITION;case u.Kind.SCHEMA_DEFINITION:case u.Kind.SCHEMA_EXTENSION:return s.DirectiveLocation.SCHEMA;case u.Kind.SCALAR_TYPE_DEFINITION:case u.Kind.SCALAR_TYPE_EXTENSION:return s.DirectiveLocation.SCALAR;case u.Kind.OBJECT_TYPE_DEFINITION:case u.Kind.OBJECT_TYPE_EXTENSION:return s.DirectiveLocation.OBJECT;case u.Kind.FIELD_DEFINITION:return s.DirectiveLocation.FIELD_DEFINITION;case u.Kind.INTERFACE_TYPE_DEFINITION:case u.Kind.INTERFACE_TYPE_EXTENSION:return s.DirectiveLocation.INTERFACE;case u.Kind.UNION_TYPE_DEFINITION:case u.Kind.UNION_TYPE_EXTENSION:return s.DirectiveLocation.UNION;case u.Kind.ENUM_TYPE_DEFINITION:case u.Kind.ENUM_TYPE_EXTENSION:return s.DirectiveLocation.ENUM;case u.Kind.ENUM_VALUE_DEFINITION:return s.DirectiveLocation.ENUM_VALUE;case u.Kind.INPUT_OBJECT_TYPE_DEFINITION:case u.Kind.INPUT_OBJECT_TYPE_EXTENSION:return s.DirectiveLocation.INPUT_OBJECT;case u.Kind.INPUT_VALUE_DEFINITION:{const n=e[e.length-3];return"kind"in n||(0,i.invariant)(!1),n.kind===u.Kind.INPUT_OBJECT_TYPE_DEFINITION?s.DirectiveLocation.INPUT_FIELD_DEFINITION:s.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,i.invariant)(!1,"Unexpected kind: "+(0,r.inspect)(n.kind))}}(d);m&&!y.includes(m)&&e.reportError(new o.GraphQLError(`Directive "@${f}" may not be used on ${m}.`,{nodes:t}))}}};var r=t(8002),i=t(7706),o=t(5822),a=t(1807),s=t(8333),u=t(2828),c=t(7197)},1843:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.KnownFragmentNamesRule=function(e){return{FragmentSpread(n){const t=n.name.value;e.getFragment(t)||e.reportError(new r.GraphQLError(`Unknown fragment "${t}".`,{nodes:n.name}))}}};var r=t(5822)},5961:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.KnownTypeNamesRule=function(e){const n=e.getSchema(),t=n?n.getTypeMap():Object.create(null),s=Object.create(null);for(const n of e.getDocument().definitions)(0,a.isTypeDefinitionNode)(n)&&(s[n.name.value]=!0);const c=[...Object.keys(t),...Object.keys(s)];return{NamedType(n,p,l,d,f){const y=n.name.value;if(!t[y]&&!s[y]){var m;const t=null!==(m=f[2])&&void 0!==m?m:l,s=null!=t&&"kind"in(h=t)&&((0,a.isTypeSystemDefinitionNode)(h)||(0,a.isTypeSystemExtensionNode)(h));if(s&&u.includes(y))return;const p=(0,i.suggestionList)(y,s?u.concat(c):c);e.reportError(new o.GraphQLError(`Unknown type "${y}".`+(0,r.didYouMean)(p),{nodes:n}))}var h}}};var r=t(166),i=t(8070),o=t(5822),a=t(1352),s=t(8155);const u=[...t(2229).specifiedScalarTypes,...s.introspectionTypes].map((e=>e.name))},870:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.LoneAnonymousOperationRule=function(e){let n=0;return{Document(e){n=e.definitions.filter((e=>e.kind===i.Kind.OPERATION_DEFINITION)).length},OperationDefinition(t){!t.name&&n>1&&e.reportError(new r.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:t}))}}};var r=t(5822),i=t(2828)},3411:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.LoneSchemaDefinitionRule=function(e){var n,t,i;const o=e.getSchema(),a=null!==(n=null!==(t=null!==(i=null==o?void 0:o.astNode)&&void 0!==i?i:null==o?void 0:o.getQueryType())&&void 0!==t?t:null==o?void 0:o.getMutationType())&&void 0!==n?n:null==o?void 0:o.getSubscriptionType();let s=0;return{SchemaDefinition(n){a?e.reportError(new r.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:n})):(s>0&&e.reportError(new r.GraphQLError("Must provide only one schema definition.",{nodes:n})),++s)}}};var r=t(5822)},658:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoFragmentCyclesRule=function(e){const n=Object.create(null),t=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(o(e),!1)};function o(a){if(n[a.name.value])return;const s=a.name.value;n[s]=!0;const u=e.getFragmentSpreads(a.selectionSet);if(0!==u.length){i[s]=t.length;for(const n of u){const a=n.name.value,s=i[a];if(t.push(n),void 0===s){const n=e.getFragment(a);n&&o(n)}else{const n=t.slice(s),i=n.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new r.GraphQLError(`Cannot spread fragment "${a}" within itself`+(""!==i?` via ${i}.`:"."),{nodes:n}))}t.pop()}i[s]=void 0}}};var r=t(5822)},7459:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoUndefinedVariablesRule=function(e){let n=Object.create(null);return{OperationDefinition:{enter(){n=Object.create(null)},leave(t){const i=e.getRecursiveVariableUsages(t);for(const{node:o}of i){const i=o.name.value;!0!==n[i]&&e.reportError(new r.GraphQLError(t.name?`Variable "$${i}" is not defined by operation "${t.name.value}".`:`Variable "$${i}" is not defined.`,{nodes:[o,t]}))}}},VariableDefinition(e){n[e.variable.name.value]=!0}}};var r=t(5822)},7317:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoUnusedFragmentsRule=function(e){const n=[],t=[];return{OperationDefinition:e=>(n.push(e),!1),FragmentDefinition:e=>(t.push(e),!1),Document:{leave(){const i=Object.create(null);for(const t of n)for(const n of e.getRecursivelyReferencedFragments(t))i[n.name.value]=!0;for(const n of t){const t=n.name.value;!0!==i[t]&&e.reportError(new r.GraphQLError(`Fragment "${t}" is never used.`,{nodes:n}))}}}}};var r=t(5822)},8769:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoUnusedVariablesRule=function(e){let n=[];return{OperationDefinition:{enter(){n=[]},leave(t){const i=Object.create(null),o=e.getRecursiveVariableUsages(t);for(const{node:e}of o)i[e.name.value]=!0;for(const o of n){const n=o.variable.name.value;!0!==i[n]&&e.reportError(new r.GraphQLError(t.name?`Variable "$${n}" is never used in operation "${t.name.value}".`:`Variable "$${n}" is never used.`,{nodes:o}))}}},VariableDefinition(e){n.push(e)}}};var r=t(5822)},4331:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.OverlappingFieldsCanBeMergedRule=function(e){const n=new g,t=new Map;return{SelectionSet(r){const o=function(e,n,t,r,i){const o=[],[a,s]=T(e,n,r,i);if(function(e,n,t,r,i){for(const[o,a]of Object.entries(i))if(a.length>1)for(let i=0;i`subfields "${e}" conflict because `+p(n))).join(" and "):e}function l(e,n,t,r,i,o,a){const s=e.getFragment(a);if(!s)return;const[u,c]=b(e,t,s);if(o!==u){f(e,n,t,r,i,o,u);for(const s of c)r.has(s,a,i)||(r.add(s,a,i),l(e,n,t,r,i,o,s))}}function d(e,n,t,r,i,o,a){if(o===a)return;if(r.has(o,a,i))return;r.add(o,a,i);const s=e.getFragment(o),u=e.getFragment(a);if(!s||!u)return;const[c,p]=b(e,t,s),[l,y]=b(e,t,u);f(e,n,t,r,i,c,l);for(const a of y)d(e,n,t,r,i,o,a);for(const o of p)d(e,n,t,r,i,o,a)}function f(e,n,t,r,i,o,a){for(const[s,u]of Object.entries(o)){const o=a[s];if(o)for(const a of u)for(const u of o){const o=y(e,t,r,i,s,a,u);o&&n.push(o)}}}function y(e,n,t,i,o,a,u){const[c,p,y]=a,[b,v,g]=u,E=i||c!==b&&(0,s.isObjectType)(c)&&(0,s.isObjectType)(b);if(!E){const e=p.name.value,n=v.name.value;if(e!==n)return[[o,`"${e}" and "${n}" are different fields`],[p],[v]];if(!function(e,n){const t=e.arguments,r=n.arguments;if(void 0===t||0===t.length)return void 0===r||0===r.length;if(void 0===r||0===r.length)return!1;if(t.length!==r.length)return!1;const i=new Map(r.map((({name:e,value:n})=>[e.value,n])));return t.every((e=>{const n=e.value,t=i.get(e.name.value);return void 0!==t&&m(n)===m(t)}))}(p,v))return[[o,"they have differing arguments"],[p],[v]]}const N=null==y?void 0:y.type,O=null==g?void 0:g.type;if(N&&O&&h(N,O))return[[o,`they return conflicting types "${(0,r.inspect)(N)}" and "${(0,r.inspect)(O)}"`],[p],[v]];const I=p.selectionSet,_=v.selectionSet;if(I&&_){const r=function(e,n,t,r,i,o,a,s){const u=[],[c,p]=T(e,n,i,o),[y,m]=T(e,n,a,s);f(e,u,n,t,r,c,y);for(const i of m)l(e,u,n,t,r,c,i);for(const i of p)l(e,u,n,t,r,y,i);for(const i of p)for(const o of m)d(e,u,n,t,r,i,o);return u}(e,n,t,E,(0,s.getNamedType)(N),I,(0,s.getNamedType)(O),_);return function(e,n,t,r){if(e.length>0)return[[n,e.map((([e])=>e))],[t,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,o,p,v)}}function m(e){return(0,a.print)((0,u.sortValueNode)(e))}function h(e,n){return(0,s.isListType)(e)?!(0,s.isListType)(n)||h(e.ofType,n.ofType):!!(0,s.isListType)(n)||((0,s.isNonNullType)(e)?!(0,s.isNonNullType)(n)||h(e.ofType,n.ofType):!!(0,s.isNonNullType)(n)||!(!(0,s.isLeafType)(e)&&!(0,s.isLeafType)(n))&&e!==n)}function T(e,n,t,r){const i=n.get(r);if(i)return i;const o=Object.create(null),a=Object.create(null);v(e,t,r,o,a);const s=[o,Object.keys(a)];return n.set(r,s),s}function b(e,n,t){const r=n.get(t.selectionSet);if(r)return r;const i=(0,c.typeFromAST)(e.getSchema(),t.typeCondition);return T(e,n,i,t.selectionSet)}function v(e,n,t,r,i){for(const a of t.selections)switch(a.kind){case o.Kind.FIELD:{const e=a.name.value;let t;((0,s.isObjectType)(n)||(0,s.isInterfaceType)(n))&&(t=n.getFields()[e]);const i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([n,a,t]);break}case o.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case o.Kind.INLINE_FRAGMENT:{const t=a.typeCondition,o=t?(0,c.typeFromAST)(e.getSchema(),t):n;v(e,o,a.selectionSet,r,i);break}}}class g{constructor(){this._data=new Map}has(e,n,t){var r;const[i,o]=ee.name.value)));for(const t of i.args)if(!a.has(t.name)&&(0,u.isRequiredArgument)(t)){const a=(0,r.inspect)(t.type);e.reportError(new o.GraphQLError(`Field "${i.name}" argument "${t.name}" of type "${a}" is required, but it was not provided.`,{nodes:n}))}}}}};var r=t(8002),i=t(2863),o=t(5822),a=t(2828),s=t(3033),u=t(5003),c=t(7197);function p(e){var n;const t=Object.create(null),p=e.getSchema(),d=null!==(n=null==p?void 0:p.getDirectives())&&void 0!==n?n:c.specifiedDirectives;for(const e of d)t[e.name]=(0,i.keyMap)(e.args.filter(u.isRequiredArgument),(e=>e.name));const f=e.getDocument().definitions;for(const e of f)if(e.kind===a.Kind.DIRECTIVE_DEFINITION){var y;const n=null!==(y=e.arguments)&&void 0!==y?y:[];t[e.name.value]=(0,i.keyMap)(n.filter(l),(e=>e.name.value))}return{Directive:{leave(n){const i=n.name.value,a=t[i];if(a){var c;const t=null!==(c=n.arguments)&&void 0!==c?c:[],p=new Set(t.map((e=>e.name.value)));for(const[t,c]of Object.entries(a))if(!p.has(t)){const a=(0,u.isType)(c.type)?(0,r.inspect)(c.type):(0,s.print)(c.type);e.reportError(new o.GraphQLError(`Directive "@${i}" argument "${t}" of type "${a}" is required, but it was not provided.`,{nodes:n}))}}}}}}function l(e){return e.type.kind===a.Kind.NON_NULL_TYPE&&null==e.defaultValue}},7168:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.ScalarLeafsRule=function(e){return{Field(n){const t=e.getType(),a=n.selectionSet;if(t)if((0,o.isLeafType)((0,o.getNamedType)(t))){if(a){const o=n.name.value,s=(0,r.inspect)(t);e.reportError(new i.GraphQLError(`Field "${o}" must not have a selection since type "${s}" has no subfields.`,{nodes:a}))}}else if(!a){const o=n.name.value,a=(0,r.inspect)(t);e.reportError(new i.GraphQLError(`Field "${o}" of type "${a}" must have a selection of subfields. Did you mean "${o} { ... }"?`,{nodes:n}))}}}};var r=t(8002),i=t(5822),o=t(5003)},4666:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.SingleFieldSubscriptionsRule=function(e){return{OperationDefinition(n){if("subscription"===n.operation){const t=e.getSchema(),a=t.getSubscriptionType();if(a){const s=n.name?n.name.value:null,u=Object.create(null),c=e.getDocument(),p=Object.create(null);for(const e of c.definitions)e.kind===i.Kind.FRAGMENT_DEFINITION&&(p[e.name.value]=e);const l=(0,o.collectFields)(t,p,u,a,n.selectionSet);if(l.size>1){const n=[...l.values()].slice(1).flat();e.reportError(new r.GraphQLError(null!=s?`Subscription "${s}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:n}))}for(const n of l.values())n[0].name.value.startsWith("__")&&e.reportError(new r.GraphQLError(null!=s?`Subscription "${s}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:n}))}}}}};var r=t(5822),i=t(2828),o=t(8950)},3878:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueArgumentDefinitionNamesRule=function(e){return{DirectiveDefinition(e){var n;const r=null!==(n=e.arguments)&&void 0!==n?n:[];return t(`@${e.name.value}`,r)},InterfaceTypeDefinition:n,InterfaceTypeExtension:n,ObjectTypeDefinition:n,ObjectTypeExtension:n};function n(e){var n;const r=e.name.value,i=null!==(n=e.fields)&&void 0!==n?n:[];for(const e of i){var o;t(`${r}.${e.name.value}`,null!==(o=e.arguments)&&void 0!==o?o:[])}return!1}function t(n,t){const o=(0,r.groupBy)(t,(e=>e.name.value));for(const[t,r]of o)r.length>1&&e.reportError(new i.GraphQLError(`Argument "${n}(${t}:)" can only be defined once.`,{nodes:r.map((e=>e.name))}));return!1}};var r=t(4620),i=t(5822)},4986:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueArgumentNamesRule=function(e){return{Field:n,Directive:n};function n(n){var t;const o=null!==(t=n.arguments)&&void 0!==t?t:[],a=(0,r.groupBy)(o,(e=>e.name.value));for(const[n,t]of a)t.length>1&&e.reportError(new i.GraphQLError(`There can be only one argument named "${n}".`,{nodes:t.map((e=>e.name))}))}};var r=t(4620),i=t(5822)},6753:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueDirectiveNamesRule=function(e){const n=Object.create(null),t=e.getSchema();return{DirectiveDefinition(i){const o=i.name.value;if(null==t||!t.getDirective(o))return n[o]?e.reportError(new r.GraphQLError(`There can be only one directive named "@${o}".`,{nodes:[n[o],i.name]})):n[o]=i.name,!1;e.reportError(new r.GraphQLError(`Directive "@${o}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}))}}};var r=t(5822)},3576:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueDirectivesPerLocationRule=function(e){const n=Object.create(null),t=e.getSchema(),s=t?t.getDirectives():a.specifiedDirectives;for(const e of s)n[e.name]=!e.isRepeatable;const u=e.getDocument().definitions;for(const e of u)e.kind===i.Kind.DIRECTIVE_DEFINITION&&(n[e.name.value]=!e.repeatable);const c=Object.create(null),p=Object.create(null);return{enter(t){if(!("directives"in t)||!t.directives)return;let a;if(t.kind===i.Kind.SCHEMA_DEFINITION||t.kind===i.Kind.SCHEMA_EXTENSION)a=c;else if((0,o.isTypeDefinitionNode)(t)||(0,o.isTypeExtensionNode)(t)){const e=t.name.value;a=p[e],void 0===a&&(p[e]=a=Object.create(null))}else a=Object.create(null);for(const i of t.directives){const t=i.name.value;n[t]&&(a[t]?e.reportError(new r.GraphQLError(`The directive "@${t}" can only be used once at this location.`,{nodes:[a[t],i]})):a[t]=i)}}}};var r=t(5822),i=t(2828),o=t(1352),a=t(7197)},6400:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueEnumValueNamesRule=function(e){const n=e.getSchema(),t=n?n.getTypeMap():Object.create(null),o=Object.create(null);return{EnumTypeDefinition:a,EnumTypeExtension:a};function a(n){var a;const s=n.name.value;o[s]||(o[s]=Object.create(null));const u=null!==(a=n.values)&&void 0!==a?a:[],c=o[s];for(const n of u){const o=n.name.value,a=t[s];(0,i.isEnumType)(a)&&a.getValue(o)?e.reportError(new r.GraphQLError(`Enum value "${s}.${o}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:n.name})):c[o]?e.reportError(new r.GraphQLError(`Enum value "${s}.${o}" can only be defined once.`,{nodes:[c[o],n.name]})):c[o]=n.name}return!1}};var r=t(5822),i=t(5003)},4046:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueFieldDefinitionNamesRule=function(e){const n=e.getSchema(),t=n?n.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:a,InputObjectTypeExtension:a,InterfaceTypeDefinition:a,InterfaceTypeExtension:a,ObjectTypeDefinition:a,ObjectTypeExtension:a};function a(n){var a;const s=n.name.value;i[s]||(i[s]=Object.create(null));const u=null!==(a=n.fields)&&void 0!==a?a:[],c=i[s];for(const n of u){const i=n.name.value;o(t[s],i)?e.reportError(new r.GraphQLError(`Field "${s}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:n.name})):c[i]?e.reportError(new r.GraphQLError(`Field "${s}.${i}" can only be defined once.`,{nodes:[c[i],n.name]})):c[i]=n.name}return!1}};var r=t(5822),i=t(5003);function o(e,n){return!!((0,i.isObjectType)(e)||(0,i.isInterfaceType)(e)||(0,i.isInputObjectType)(e))&&null!=e.getFields()[n]}},5883:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueFragmentNamesRule=function(e){const n=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(t){const i=t.name.value;return n[i]?e.reportError(new r.GraphQLError(`There can be only one fragment named "${i}".`,{nodes:[n[i],t.name]})):n[i]=t.name,!1}}};var r=t(5822)},4313:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueInputFieldNamesRule=function(e){const n=[];let t=Object.create(null);return{ObjectValue:{enter(){n.push(t),t=Object.create(null)},leave(){const e=n.pop();e||(0,r.invariant)(!1),t=e}},ObjectField(n){const r=n.name.value;t[r]?e.reportError(new i.GraphQLError(`There can be only one input field named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name}}};var r=t(7706),i=t(5822)},2139:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueOperationNamesRule=function(e){const n=Object.create(null);return{OperationDefinition(t){const i=t.name;return i&&(n[i.value]?e.reportError(new r.GraphQLError(`There can be only one operation named "${i.value}".`,{nodes:[n[i.value],i]})):n[i.value]=i),!1},FragmentDefinition:()=>!1}};var r=t(5822)},856:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueOperationTypesRule=function(e){const n=e.getSchema(),t=Object.create(null),i=n?{query:n.getQueryType(),mutation:n.getMutationType(),subscription:n.getSubscriptionType()}:{};return{SchemaDefinition:o,SchemaExtension:o};function o(n){var o;const a=null!==(o=n.operationTypes)&&void 0!==o?o:[];for(const n of a){const o=n.operation,a=t[o];i[o]?e.reportError(new r.GraphQLError(`Type for ${o} already defined in the schema. It cannot be redefined.`,{nodes:n})):a?e.reportError(new r.GraphQLError(`There can be only one ${o} type in schema.`,{nodes:[a,n]})):t[o]=n}return!1}};var r=t(5822)},1686:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueTypeNamesRule=function(e){const n=Object.create(null),t=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(i){const o=i.name.value;if(null==t||!t.getType(o))return n[o]?e.reportError(new r.GraphQLError(`There can be only one type named "${o}".`,{nodes:[n[o],i.name]})):n[o]=i.name,!1;e.reportError(new r.GraphQLError(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}))}};var r=t(5822)},4243:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueVariableNamesRule=function(e){return{OperationDefinition(n){var t;const o=null!==(t=n.variableDefinitions)&&void 0!==t?t:[],a=(0,r.groupBy)(o,(e=>e.variable.name.value));for(const[n,t]of a)t.length>1&&e.reportError(new i.GraphQLError(`There can be only one variable named "$${n}".`,{nodes:t.map((e=>e.variable.name))}))}}};var r=t(4620),i=t(5822)},6869:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.ValuesOfCorrectTypeRule=function(e){return{ListValue(n){const t=(0,c.getNullableType)(e.getParentInputType());if(!(0,c.isListType)(t))return p(e,n),!1},ObjectValue(n){const t=(0,c.getNamedType)(e.getInputType());if(!(0,c.isInputObjectType)(t))return p(e,n),!1;const r=(0,o.keyMap)(n.fields,(e=>e.name.value));for(const o of Object.values(t.getFields()))if(!r[o.name]&&(0,c.isRequiredInputField)(o)){const r=(0,i.inspect)(o.type);e.reportError(new s.GraphQLError(`Field "${t.name}.${o.name}" of required type "${r}" was not provided.`,{nodes:n}))}},ObjectField(n){const t=(0,c.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,c.isInputObjectType)(t)){const i=(0,a.suggestionList)(n.name.value,Object.keys(t.getFields()));e.reportError(new s.GraphQLError(`Field "${n.name.value}" is not defined by type "${t.name}".`+(0,r.didYouMean)(i),{nodes:n}))}},NullValue(n){const t=e.getInputType();(0,c.isNonNullType)(t)&&e.reportError(new s.GraphQLError(`Expected value of type "${(0,i.inspect)(t)}", found ${(0,u.print)(n)}.`,{nodes:n}))},EnumValue:n=>p(e,n),IntValue:n=>p(e,n),FloatValue:n=>p(e,n),StringValue:n=>p(e,n),BooleanValue:n=>p(e,n)}};var r=t(166),i=t(8002),o=t(2863),a=t(8070),s=t(5822),u=t(3033),c=t(5003);function p(e,n){const t=e.getInputType();if(!t)return;const r=(0,c.getNamedType)(t);if((0,c.isLeafType)(r))try{if(void 0===r.parseLiteral(n,void 0)){const r=(0,i.inspect)(t);e.reportError(new s.GraphQLError(`Expected value of type "${r}", found ${(0,u.print)(n)}.`,{nodes:n}))}}catch(r){const o=(0,i.inspect)(t);r instanceof s.GraphQLError?e.reportError(r):e.reportError(new s.GraphQLError(`Expected value of type "${o}", found ${(0,u.print)(n)}; `+r.message,{nodes:n,originalError:r}))}else{const r=(0,i.inspect)(t);e.reportError(new s.GraphQLError(`Expected value of type "${r}", found ${(0,u.print)(n)}.`,{nodes:n}))}}},4942:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.VariablesAreInputTypesRule=function(e){return{VariableDefinition(n){const t=(0,a.typeFromAST)(e.getSchema(),n.type);if(void 0!==t&&!(0,o.isInputType)(t)){const t=n.variable.name.value,o=(0,i.print)(n.type);e.reportError(new r.GraphQLError(`Variable "$${t}" cannot be non-input type "${o}".`,{nodes:n.type}))}}}};var r=t(5822),i=t(3033),o=t(5003),a=t(5115)},8034:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.VariablesInAllowedPositionRule=function(e){let n=Object.create(null);return{OperationDefinition:{enter(){n=Object.create(null)},leave(t){const o=e.getRecursiveVariableUsages(t);for(const{node:t,type:a,defaultValue:s}of o){const o=t.name.value,p=n[o];if(p&&a){const n=e.getSchema(),l=(0,u.typeFromAST)(n,p.type);if(l&&!c(n,l,p.defaultValue,a,s)){const n=(0,r.inspect)(l),s=(0,r.inspect)(a);e.reportError(new i.GraphQLError(`Variable "$${o}" of type "${n}" used in position expecting type "${s}".`,{nodes:[p,t]}))}}}}},VariableDefinition(e){n[e.variable.name.value]=e}}};var r=t(8002),i=t(5822),o=t(2828),a=t(5003),s=t(298),u=t(5115);function c(e,n,t,r,i){if((0,a.isNonNullType)(r)&&!(0,a.isNonNullType)(n)){const a=void 0!==i;if((null==t||t.kind===o.Kind.NULL)&&!a)return!1;const u=r.ofType;return(0,s.isTypeSubTypeOf)(e,n,u)}return(0,s.isTypeSubTypeOf)(e,n,r)}},2860:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoDeprecatedCustomRule=function(e){return{Field(n){const t=e.getFieldDef(),o=null==t?void 0:t.deprecationReason;if(t&&null!=o){const a=e.getParentType();null!=a||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`The field ${a.name}.${t.name} is deprecated. ${o}`,{nodes:n}))}},Argument(n){const t=e.getArgument(),o=null==t?void 0:t.deprecationReason;if(t&&null!=o){const a=e.getDirective();if(null!=a)e.reportError(new i.GraphQLError(`Directive "@${a.name}" argument "${t.name}" is deprecated. ${o}`,{nodes:n}));else{const a=e.getParentType(),s=e.getFieldDef();null!=a&&null!=s||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`Field "${a.name}.${s.name}" argument "${t.name}" is deprecated. ${o}`,{nodes:n}))}}},ObjectField(n){const t=(0,o.getNamedType)(e.getParentInputType());if((0,o.isInputObjectType)(t)){const r=t.getFields()[n.name.value],o=null==r?void 0:r.deprecationReason;null!=o&&e.reportError(new i.GraphQLError(`The input field ${t.name}.${r.name} is deprecated. ${o}`,{nodes:n}))}},EnumValue(n){const t=e.getEnumValue(),a=null==t?void 0:t.deprecationReason;if(t&&null!=a){const s=(0,o.getNamedType)(e.getInputType());null!=s||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`The enum value "${s.name}.${t.name}" is deprecated. ${a}`,{nodes:n}))}}}};var r=t(7706),i=t(5822),o=t(5003)},2276:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoSchemaIntrospectionCustomRule=function(e){return{Field(n){const t=(0,i.getNamedType)(e.getType());t&&(0,o.isIntrospectionType)(t)&&e.reportError(new r.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${n.name.value}".`,{nodes:n}))}}};var r=t(5822),i=t(5003),o=t(8155)},4710:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.specifiedSDLRules=n.specifiedRules=void 0;var r=t(5285),i=t(9426),o=t(3558),a=t(9989),s=t(2826),u=t(1843),c=t(5961),p=t(870),l=t(3411),d=t(658),f=t(7459),y=t(7317),m=t(8769),h=t(4331),T=t(5904),b=t(5715),v=t(4312),g=t(7168),E=t(4666),N=t(3878),O=t(4986),I=t(6753),_=t(3576),L=t(6400),S=t(4046),D=t(5883),j=t(4313),A=t(2139),P=t(856),R=t(1686),w=t(4243),k=t(6869),F=t(4942),x=t(8034);const G=Object.freeze([r.ExecutableDefinitionsRule,A.UniqueOperationNamesRule,p.LoneAnonymousOperationRule,E.SingleFieldSubscriptionsRule,c.KnownTypeNamesRule,o.FragmentsOnCompositeTypesRule,F.VariablesAreInputTypesRule,g.ScalarLeafsRule,i.FieldsOnCorrectTypeRule,D.UniqueFragmentNamesRule,u.KnownFragmentNamesRule,y.NoUnusedFragmentsRule,T.PossibleFragmentSpreadsRule,d.NoFragmentCyclesRule,w.UniqueVariableNamesRule,f.NoUndefinedVariablesRule,m.NoUnusedVariablesRule,s.KnownDirectivesRule,_.UniqueDirectivesPerLocationRule,a.KnownArgumentNamesRule,O.UniqueArgumentNamesRule,k.ValuesOfCorrectTypeRule,v.ProvidedRequiredArgumentsRule,x.VariablesInAllowedPositionRule,h.OverlappingFieldsCanBeMergedRule,j.UniqueInputFieldNamesRule]);n.specifiedRules=G;const V=Object.freeze([l.LoneSchemaDefinitionRule,P.UniqueOperationTypesRule,R.UniqueTypeNamesRule,L.UniqueEnumValueNamesRule,S.UniqueFieldDefinitionNamesRule,N.UniqueArgumentDefinitionNamesRule,I.UniqueDirectiveNamesRule,c.KnownTypeNamesRule,s.KnownDirectivesRule,_.UniqueDirectivesPerLocationRule,b.PossibleTypeExtensionsRule,a.KnownArgumentNamesOnDirectivesRule,O.UniqueArgumentNamesRule,j.UniqueInputFieldNamesRule,v.ProvidedRequiredArgumentsOnDirectivesRule]);n.specifiedSDLRules=V},9504:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.assertValidSDL=function(e){const n=p(e);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))},n.assertValidSDLExtension=function(e,n){const t=p(e,n);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))},n.validate=function(e,n,t=u.specifiedRules,p,l=new s.TypeInfo(e)){var d;const f=null!==(d=null==p?void 0:p.maxErrors)&&void 0!==d?d:100;n||(0,r.devAssert)(!1,"Must provide document."),(0,a.assertValidSchema)(e);const y=Object.freeze({}),m=[],h=new c.ValidationContext(e,n,l,(e=>{if(m.length>=f)throw m.push(new i.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),y;m.push(e)})),T=(0,o.visitInParallel)(t.map((e=>e(h))));try{(0,o.visit)(n,(0,s.visitWithTypeInfo)(l,T))}catch(e){if(e!==y)throw e}return m},n.validateSDL=p;var r=t(7242),i=t(5822),o=t(285),a=t(1671),s=t(6226),u=t(4710),c=t(3955);function p(e,n,t=u.specifiedSDLRules){const r=[],i=new c.SDLValidationContext(e,n,(e=>{r.push(e)})),a=t.map((e=>e(i)));return(0,o.visit)(e,(0,o.visitInParallel)(a)),r}},8696:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.versionInfo=n.version=void 0,n.version="16.8.1";const t=Object.freeze({major:16,minor:8,patch:1,preReleaseTag:null});n.versionInfo=t},9307:function(e){e.exports=window.wp.element}},n={};function t(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return e[r](o,o.exports,t),o.exports}t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t(6428)}(); \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/build/style-app.css b/lib/wp-graphql-1.17.0/build/style-app.css new file mode 100644 index 00000000..fefda03a --- /dev/null +++ b/lib/wp-graphql-1.17.0/build/style-app.css @@ -0,0 +1 @@ +#graphiql{display:flex;flex:1}#graphiql .spinner{background:none;visibility:visible}#wp-graphiql-wrapper .doc-explorer-title,#wp-graphiql-wrapper .history-title{overflow-x:visible;padding-top:7px}#wp-graphiql-wrapper .docExplorerWrap,#wp-graphiql-wrapper .historyPaneWrap{background:#fff;box-shadow:0 0 8px rgba(0,0,0,.15);position:relative;z-index:3}#wp-graphiql-wrapper .graphiql-container .doc-explorer-back{overflow:hidden} diff --git a/lib/wp-graphql-1.17.0/cli/wp-cli.php b/lib/wp-graphql-1.17.0/cli/wp-cli.php new file mode 100644 index 00000000..e2b9ade4 --- /dev/null +++ b/lib/wp-graphql-1.17.0/cli/wp-cli.php @@ -0,0 +1,64 @@ +init(); + $settings->register_settings(); + + // Get all the registered settings fields + $fields = $settings->settings_api->get_settings_fields(); + + // Loop over the registered settings fields and delete the options + if ( ! empty( $fields ) && is_array( $fields ) ) { + foreach ( $fields as $group => $fields ) { + delete_option( $group ); + } + } + + do_action( 'graphql_delete_data' ); +} diff --git a/lib/wp-graphql-1.17.0/phpcs.xml.dist b/lib/wp-graphql-1.17.0/phpcs.xml.dist new file mode 100644 index 00000000..fb4632c7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/phpcs.xml.dist @@ -0,0 +1,165 @@ + + + Coding standards for the WPGraphQL plugin + + + ./access-functions.php + ./activation.php + ./deactivation.php + ./wp-graphql.php + ./src + ./phpstan/* + */**/tests/ + */node_modules/* + */vendor/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/wp-graphql-1.17.0/readme.txt b/lib/wp-graphql-1.17.0/readme.txt new file mode 100644 index 00000000..b79fd009 --- /dev/null +++ b/lib/wp-graphql-1.17.0/readme.txt @@ -0,0 +1,1557 @@ +=== WPGraphQL === +Contributors: jasonbahl, tylerbarnes1, ryankanner, hughdevore, chopinbach, kidunot89 +Tags: GraphQL, JSON, API, Gatsby, Faust, Headless, Decoupled, Svelte, React, Nextjs, Vue, Apollo, REST, JSON, HTTP, Remote, Query Language +Requires at least: 5.0 +Tested up to: 6.2 +Requires PHP: 7.1 +Stable tag: 1.17.0 +License: GPL-3 +License URI: https://www.gnu.org/licenses/gpl-3.0.html + +=== Description === + +WPGraphQL is a free, open-source WordPress plugin that provides an extendable GraphQL schema and API for any WordPress site. + +Below are some links to help you get started with WPGraphQL + +- WPGraphQL.com +- Quick Start Guide +- Intro to GraphQL +- Intro to WordPress +- Join the WPGraphQL community on Slack + += Build rich JavaScript applications with WordPress and GraphQL = + +WPGraphQL allows you to separate your CMS from your presentation layer. Content creators can use the CMS they know, while developers can use the frameworks and tools they love. + +WPGraphQL works great with: + +- [Gatsby](https://gatsbyjs.com) +- [Apollo Client](https://www.apollographql.com/docs/react/) +- [NextJS](https://nextjs.org/) +- ...and more + += Query what you need. Get exactly that. = + +With GraphQL, the client makes declarative queries, asking for the exact data needed, and in exactly what was asked for is given in response, nothing more. This allows the client have control over their application, and allows the GraphQL server to perform more efficiently by only fetching the resources requested. + += Fetch many resources in a single request. = + +GraphQL queries allow access to multiple root resources, and also smoothly follow references between connected resources. While typical a REST API would require round-trip requests to many endpoints, GraphQL APIs can get all the data your app needs in a single request. Apps using GraphQL can be quick even on slow mobile network connections. + += Powerful Debugging Tools = + +WPGraphQL ships with GraphiQL in your WordPress dashboard, allowing you to browse your site's GraphQL Schema and test Queries and Mutations. + += Upgrading = + +It is recommended that anytime you want to update WPGraphQL that you get familiar with what's changed in the release. + +WPGraphQL publishes [release notes on Github](https://github.com/wp-graphql/wp-graphql/releases). + +WPGraphQL has been following Semver practices for a few years. We will continue to follow Semver and let version numbers communicate meaning. The summary of Semver versioning is as follows: + +- *MAJOR* version when you make incompatible API changes, +- *MINOR* version when you add functionality in a backwards compatible manner, and +- *PATCH* version when you make backwards compatible bug fixes. + +You can read more about the details of Semver at semver.org + +== Frequently Asked Questions == + += Can I use WPGraphQL with xx JavaScript Framework? = + +WPGraphQL turns your WordPress site into a GraphQL API. Any client that can make http requests to the GraphQL endpoint can be used to interact with WPGraphQL. + += Where do I get WPGraphQL Swag? = + +WPGraphQL Swag is available on the Gatsby Swag store. + += What's the relationship between Gatsby, WP Engine, and WPGraphQL? = + +[WP Engine](https://wpengine.com/) is the employer of Jason Bahl, the creator and maintainer of WPGraphQL. He was previously employed by [Gatsby](https://gatsbyjs.com). + +You can read more about this [here](https://www.wpgraphql.com/2021/02/07/whats-next-for-wpgraphql/). + +Gatsby and WP Engine both believe that a strong GraphQL API for WordPress is a benefit for the web. Neither Gatsby or WP Engine are required to be used with WPGraphQL, however it's important to acknowledge and understand what's possible because of their investments into WPGraphQL and the future of headless WordPress! + +== Privacy Policy == + +WPGraphQL uses [Appsero](https://appsero.com) SDK to collect some telemetry data upon user's confirmation. This helps us to troubleshoot problems faster & make product improvements. + +Appsero SDK **does not gather any data by default.** The SDK only starts gathering basic telemetry data **when a user allows it via the admin notice**. We collect the data to ensure a great user experience for all our users. + +Integrating Appsero SDK **DOES NOT IMMEDIATELY** start gathering data, **without confirmation from users in any case.** + +Learn more about how [Appsero collects and uses this data](https://appsero.com/privacy-policy/). + +== Upgrade Notice == + += 1.16.0 = + +**WPGraphQL Smart Cache** +For WPGraphQL Smart Cache users, you should update WPGraphQL Smart Cache to v1.2.0 when updating +WPGraphQL to v1.16.0 to ensure caches continue to purge as expected. + +**Cursor Pagination Updates** +This version fixes some behaviors of Cursor Pagination which _may_ lead to behavior changes in your application. + +As with any release, we recommend you test in staging environments. For this release, specifically any +queries you have using pagination arguments (`first`, `last`, `after`, `before`). + += 1.14.6 = + +This release includes a security patch. It's recommended to update as soon as possible. + +If you're unable to update to the latest version, we have a snippet you can add to your site. + +You can read more about it here: https://github.com/wp-graphql/wp-graphql/security/advisories/GHSA-cfh4-7wq9-6pgg + += 1.13.0 = + +The `ContentRevisionUnion` Union has been removed, and the `RootQuery.revisions` and `User.revisions` connections that used to resolve to this Type now resolve to the `ContentNode` Interface type. + +This is _technically_ a Schema Breaking change, however the behavior for most users querying these fields should remain the same. + +For example, this query worked before, and still works now: + +```graphql +{ + viewer { + revisions { + nodes { + __typename + ... on Post { + id + uri + isRevision + } + ... on Page { + id + uri + isRevision + } + } + } + } + revisions { + nodes { + __typename + ... on Post { + id + uri + isRevision + } + ... on Page { + id + uri + isRevision + } + } + } +} +``` + +If you were using a fragment to reference: `...on UserToContentRevisionUnionConnection` or `...on RootQueryToContentRevisionUnionConnection` you would need to update those references to `...on UserToRevisionsConnection` and `...on RootQueryToRevisionsConnection` respectively. + += 1.12.0 = + +This release removes the `ContentNode` and `DatabaseIdentifier` interfaces from the `NodeWithFeaturedImage` Interface. + +This is considered a breaking change for client applications using a `...on NodeWithFeaturedImage` fragment that reference fields applied by those interfaces. If you have client applications doing this (or are unsure if you do) you can use the following filter to bring back the previous behavior: + +```php +add_filter( 'graphql_wp_interface_type_config', function( $config ) { + if ( $config['name'] === 'NodeWithFeaturedImage' ) { + $config['interfaces'][] = 'ContentNode'; + $config['interfaces'][] = 'DatabaseIdentifier'; + } + return $config; +}, 10, 1 ); +``` + += 1.10.0 = + +PR ([#2490](https://github.com/wp-graphql/wp-graphql/pull/2490)) fixes a bug that some users were +using as a feature. + +When a page is marked as the "Posts Page" WordPress does not resolve that page by URI, and this +bugfix no longer will resolve that page by URI. + +You can [read more](https://github.com/wp-graphql/wp-graphql/issues/2486#issuecomment-1232169375) +about why this change was made and find a snippet of code that will bring the old functionality back +if you've built features around it. + + += 1.9.0 = + +There are 2 changes that **might** require action when updating to 1.9.0. + + +1. ([#2464](https://github.com/wp-graphql/wp-graphql/pull/2464)) + +When querying for a `nodeByUri`, if your site has the "page_for_posts" setting configured, the behavior of the `nodeByUri` query for that uri might be different for you. + +Previously a bug caused this query to return a "Page" type, when it should have returned a "ContentType" Type. + +The bug fix might change your application if you were using the bug as a feature. + + + +2. ([#2457](https://github.com/wp-graphql/wp-graphql/pull/2457)) + +There were a lot of bug fixes related to connections to ensure they behave as intended. If you were querying lists of data, in some cases the data might be returned in a different order than it was before. + +For example, using the "last" input on a Comment or User query should still return the same nodes, but in a different order than before. + +This might cause behavior you don't want in your application because you had coded around the bug. This change was needed to support proper backward pagination. + + + += 1.6.7 = + +There's been a bugfix in the Post Model layer which _might_ break existing behaviors. + +WordPress Post Type registry allows for a post_type to be registered as `public` (`true` or `false`) +and `publicly_queryable` (`true` or `false`). + +WPGraphQL's Model Layer was allowing published content of any post_type to be exposed publicly. This +change better respects the `public` and `publicly_queryable` properties of post types better. + +Now, if a post_type is `public=>true`, published content of that post_type can be queried by public +WPGraphQL requests. + +If a `post_type` is set to `public=>false`, then we fallback to the `publicly_queryable` property. +If a post_type is set to `publicly_queryable => true`, then published content of the Post Type can +be queried in WPGraphQL by public users. + +If both `public=>false` and `publicly_queryable` is `false` or not defined, then the content of the +post_type will only be accessible via authenticated queries by users with proper capabilities to +access the post_type. + +**Possible Action:** You might need to adjust your post_type registration to better reflect your intent. + +- `public=>true`: The entries in the post_type will be public in WPGraphQL and will have a public +URI in WordPress. +- `public=>false, publicly_queryable=>true`: The entries in the post_type will be public in WPGraphQL, +but will not have individually respected URI from WordPress, and can not be queried by URI in WPGraphQL. +- `public=>false,publicly_queryable=>false`: The entries in the post_type will only be accessible in +WPGraphQL by authenticated requests for users with proper capabilities to interact with the post_type. + += 1.5.0 = + +The `MenuItem.path` field was changed from `non-null` to nullable and some clients may need to make adjustments to support this. + += 1.4.0 = + +The `uri` field was non-null on some Types in the Schema but has been changed to be nullable on all types that have it. This might require clients to update code to expect possible null values. + += 1.2.0 = + +Composer dependencies are no longer versioned in Github. Recommended install source is WordPress.org or using Composer to get the code from Packagist.org or WPackagist.org. + +== Changelog == + += 1.17.0 = + +**New Features** + +- [#2940](https://github.com/wp-graphql/wp-graphql/pull/2940): feat: add graphql_format_name() access method +- [#2256](https://github.com/wp-graphql/wp-graphql/pull/2256): feat: add connectedTerms connection to Taxonomy Object + +**Chores / Bugfixes** + +- [#2808](https://github.com/wp-graphql/wp-graphql/pull/2808): fix: fallback to template filename if sanitized name is empty +- [#2968](https://github.com/wp-graphql/wp-graphql/pull/2968): fix: Add graphql_debug warning when using `hasPublishedPosts: ATTACHMENT` +- [#2968](https://github.com/wp-graphql/wp-graphql/pull/2968): fix: improve DX for updateComment mutation +- [#2962](https://github.com/wp-graphql/wp-graphql/pull/2962): fix: respect hasPublishedPosts where arg on unauthenticated users queries +- [#2967](https://github.com/wp-graphql/wp-graphql/pull/2967): fix: use all roles for UserRoleEnum instead of the filtered editible_roles +- [#2940](https://github.com/wp-graphql/wp-graphql/pull/2940): fix: Decode slug so it works with other languages +- [#2959](https://github.com/wp-graphql/wp-graphql/pull/2959): chore: remove @phpstan-ignore annotations +- [#2945](https://github.com/wp-graphql/wp-graphql/pull/2945): fix: rename fields registered by connections when using `rename_graphql_field()` +- [#2949](https://github.com/wp-graphql/wp-graphql/pull/2949): fix: correctly get default user role for settings selectbox +- [#2955](https://github.com/wp-graphql/wp-graphql/pull/2955): test: back-fill register_graphql_input|union_type() tests +- [#2953](https://github.com/wp-graphql/wp-graphql/pull/2953): fix: term uri, early return. (Follow up to [#2341](https://github.com/wp-graphql/wp-graphql/pull/2341)) +- [#2956](https://github.com/wp-graphql/wp-graphql/pull/2956): chore(deps-dev): bump postcss from 8.4.12 to 8.4.31 +- [#2954](https://github.com/wp-graphql/wp-graphql/pull/2954): fix: regression to autoloader for bedrock sites. (Follow-up to [#2935](https://github.com/wp-graphql/wp-graphql/pull/2935)) +- [#2950](https://github.com/wp-graphql/wp-graphql/pull/2950): fix: rename typo in component name - AuthSwitchProvider +- [#2948](https://github.com/wp-graphql/wp-graphql/pull/2948): chore: fix spelling mistakes (non-logical) +- [#2944](https://github.com/wp-graphql/wp-graphql/pull/2944): fix: skip setting if no $setting['group'] +- [#2934](https://github.com/wp-graphql/wp-graphql/pull/2934): chore(deps-dev): bump composer/composer from 2.2.21 to 2.2.22 +- [#2936](https://github.com/wp-graphql/wp-graphql/pull/2936): chore(deps): bump graphql from 16.5.0 to 16.8.1 +- [#2341](https://github.com/wp-graphql/wp-graphql/pull/2341): fix: wrong term URI on sub-sites of multisite subdomain installs +- [#2935](https://github.com/wp-graphql/wp-graphql/pull/2935): fix: admin notice wasn't displaying if composer dependencies were missing +- [#2933](https://github.com/wp-graphql/wp-graphql/pull/2933): chore: remove unused parameters from resolver callbacks +- [#2932](https://github.com/wp-graphql/wp-graphql/pull/2932): chore: cleanup PHPCS inline annotations +- [#2934](https://github.com/wp-graphql/wp-graphql/pull/2634): chore: use .php extension for stub files +- [#2924](https://github.com/wp-graphql/wp-graphql/pull/2924): chore: upgrade WPCS to v3.0 +- [#2921](https://github.com/wp-graphql/wp-graphql/pull/2921): fix: zip artifact in GitHub not in sub folder + += 1.16.0 = + +**New Features** + +- [#2918](https://github.com/wp-graphql/wp-graphql/pull/2918): feat: Use graphql endpoint without scheme in url header. +- [#2882](https://github.com/wp-graphql/wp-graphql/pull/2882): feat: Config and Cursor Classes refactor + + += 1.15.0 = + +**New Features** + +- [#2908](https://github.com/wp-graphql/wp-graphql/pull/2908): feat: Skip param added to Utils::map_input(). Thanks @kidunot89! + +**Chores / Bugfixes** + +- [#2907](https://github.com/wp-graphql/wp-graphql/pull/2907): ci: Use WP 6.3 image, not the beta one +- [#2902](https://github.com/wp-graphql/wp-graphql/pull/2902): chore: handle unused variables (phpcs). Thanks @justlevine! +- [#2901](https://github.com/wp-graphql/wp-graphql/pull/2901): chore: remove useless ternaries (phpcs). Thanks @justlevine! +- [#2898](https://github.com/wp-graphql/wp-graphql/pull/2898): chore: restore excluded PHPCS sniffs. Thanks @justlevine! +- [#2899](https://github.com/wp-graphql/wp-graphql/pull/2899): chore: Configure PHPCS blank line check and autofix. Thanks @justlevine! +- [#2900](https://github.com/wp-graphql/wp-graphql/pull/2900): chore: implement PHPCS sniffs from Slevomat Coding Standards. Thanks @justlevine! +- [#2897](https://github.com/wp-graphql/wp-graphql/pull/2897): fix: default excerptRendered to empty string. Thanks @izzygld! +- [#2890](https://github.com/wp-graphql/wp-graphql/pull/2890): fix: Use hostname for graphql cache header url for varnish +- [#2892](https://github.com/wp-graphql/wp-graphql/pull/2889): chore: GitHub template tweaks. Thanks @justlevine! +- [#2889](https://github.com/wp-graphql/wp-graphql/pull/2889): ci: update tests to test against WordPress 6.3, simplify the matrix +- [#2891](https://github.com/wp-graphql/wp-graphql/pull/2891): chore: bump graphql-php to 14.11.10 and update Composer dev-deps. Thanks @justlevine! + + += 1.14.10 = + +**Chores / Bugfixes** + +- [#2874](https://github.com/wp-graphql/wp-graphql/pull/2874): fix: improve PostObjectCursor support for meta queries. Thanks @kidunot89! +- [#2880](https://github.com/wp-graphql/wp-graphql/pull/2880): fix: increase clarity of the description of "asPreview" argument + += 1.14.9 = + +**Chores / Bugfixes** + +- [#2865](https://github.com/wp-graphql/wp-graphql/pull/2865): fix: user roles should return empty if user doesn't have roles. Thanks @j3ang! +- [#2870](https://github.com/wp-graphql/wp-graphql/pull/2870): fix: Type Loader returns null when "graphql_single_name" value has underscores [regression] +- [#2871](https://github.com/wp-graphql/wp-graphql/pull/2871): fix: update tests, follow-up to [#2865](https://github.com/wp-graphql/wp-graphql/pull/2865) + + += 1.14.8 = + +**Chores / Bugfixes** + +- [#2855](https://github.com/wp-graphql/wp-graphql/pull/2855): perf: enforce static closures when possible (PHPCS). Thanks @justlevine! +- [#2857](https://github.com/wp-graphql/wp-graphql/pull/2857): fix: Prevent truncation of query name inside the GraphiQL Query composer explorer tab. Thanks @LarsEjaas! +- [#2856](https://github.com/wp-graphql/wp-graphql/pull/2856): chore: add missing translator comments. Thanks @justlevine! +- [#2862](https://github.com/wp-graphql/wp-graphql/pull/2862): chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 +- [#2861](https://github.com/wp-graphql/wp-graphql/pull/2861): fix: output `list:$type` keys for Root fields that return a list of nodes + + += 1.14.7 = + +**Chores / Bugfixes** + +- [#2853](https://github.com/wp-graphql/wp-graphql/pull/2853): fix: internal server error when query max depth setting is left empty +- [#2851](https://github.com/wp-graphql/wp-graphql/pull/2851): fix: querying posts by slug or uri with non-ascii characters +- [#2849](https://github.com/wp-graphql/wp-graphql/pull/2849): ci: Indent WP 6.2 in workflow file. Fixes Docker deploys. Thanks @markkelnar! +- [#2846](https://github.com/wp-graphql/wp-graphql/pull/2846): chore(deps): bump tough-cookie from 4.0.0 to 4.1.3 + + += 1.14.6 = + +**Chores / Bugfixes** + +- [#2841](https://github.com/wp-graphql/wp-graphql/pull/2841): ci: support STEP_DEBUG in Code Quality workflow. Thanks @justlevine! +- [#2840](https://github.com/wp-graphql/wp-graphql/pull/2840): fix: update createMediaItem mutation to have better validation of input. +- [#2838](https://github.com/wp-graphql/wp-graphql/pull/2838): chore: update security.md + + += 1.14.5 = + +**Chores / Bugfixes** + +- [#2834](https://github.com/wp-graphql/wp-graphql/pull/2834): fix: improve how the Query Analyzer tracks list types, only tracking lists from the RootType and not nested lists. +- [#2828](https://github.com/wp-graphql/wp-graphql/pull/2828): chore: update composer dev-deps to latest. Thanks @justlevine! +- [#2835](https://github.com/wp-graphql/wp-graphql/pull/2835): ci: update docker deploy workflow to use latest docker actions. +- [#2836](https://github.com/wp-graphql/wp-graphql/pull/2836): ci: update schema upload workflow to pin mariadb to 10.8.2 + + += 1.14.4 = + +**New Features** + +- [#2826](https://github.com/wp-graphql/wp-graphql/pull/2826): feat: pass connection config to connection field + +**Chores / Bugfixes** + +- [#2818](https://github.com/wp-graphql/wp-graphql/pull/2818): chore: update webonyx/graphql-php to v14.11.9. Thanks @justlevine! +- [#2813](https://github.com/wp-graphql/wp-graphql/pull/2813): fix: replace double negation with true. Thanks @cesarkohl! + + += 1.14.3 = + +**Chores / Bugfixes** + +- [#2801](https://github.com/wp-graphql/wp-graphql/pull/2801): fix: conflict between custom post type and media slugs +- [#2799](https://github.com/wp-graphql/wp-graphql/pull/2794): fix: querying posts by slug fails when custom permalinks are set +- [#2794](https://github.com/wp-graphql/wp-graphql/pull/2794): chore(deps): bump guzzlehttp/psr7 from 1.9.0 to 1.9.1 + + += 1.14.2 = + +**Chores / Bugfixes** + +- [#2792](https://github.com/wp-graphql/wp-graphql/pull/2792): fix: uri field is null when querying the page for posts uri + += 1.14.1 = + +**New Features** + +- [#2763](https://github.com/wp-graphql/wp-graphql/pull/2763): feat: add `shouldShowAdminToolbar` field to the User type, resolving from the "show_admin_bar_front" meta value. Thanks @blakewilson! + +**Chores / Bugfixes** + +- [#2758](https://github.com/wp-graphql/wp-graphql/pull/2758): fix: Allow post types and taxonomies to be registered without "graphql_plural_name". +- [#2762](https://github.com/wp-graphql/wp-graphql/pull/2762): Bump webpack version. +- [#2770](https://github.com/wp-graphql/wp-graphql/pull/2770): fix: wrong order in term/post ancestor queries. Thanks @creative-andrew! +- [#2775](https://github.com/wp-graphql/wp-graphql/pull/2775): fix: properly resolve when querying terms filtered by multiple taxonomies. Thanks @thecodeassassin! +- [#2776](https://github.com/wp-graphql/wp-graphql/pull/2776): chore: remove internal usage of deprecated functions. Thanks @justlevine! +- [#2777](https://github.com/wp-graphql/wp-graphql/pull/2777): chore: update composer dev-deps (not PHPStan). Thanks @justlevine! +- [#2778](https://github.com/wp-graphql/wp-graphql/pull/2778): fix: Update PHPStan and fix smells. Thanks @justlevine! +- [#2779](https://github.com/wp-graphql/wp-graphql/pull/2779): ci: test against WordPress 6.2. Thanks @justlevine! +- [#2781](https://github.com/wp-graphql/wp-graphql/pull/2781): chore: call _doing_it_wrong() when using deprecated PostObjectUnion and TermObjectUnion. Thanks @justlevine! +- [#2782](https://github.com/wp-graphql/wp-graphql/pull/2782): ci: fix deprecation warnings in Github workflows. Thanks @justlevine! +- [#2786](https://github.com/wp-graphql/wp-graphql/pull/2786): fix: early return for HTTP OPTIONS requests. + += 1.14.0 = + +**New Features** + +- [#2745](https://github.com/wp-graphql/wp-graphql/pull/2745): feat: Allow fields, connections and mutations to optionally be registered with undersores in the field name. +- [#2651](https://github.com/wp-graphql/wp-graphql/pull/2651): feat: Add `deregister_graphql_mutation()` and `graphql_excluded_mutations` filter. Thanks @justlevine! +- [#2652](https://github.com/wp-graphql/wp-graphql/pull/2652): feat: Add `deregister_graphql_connection` and `graphql_excluded_connections` filter. Thanks @justlevine! +- [#2680](https://github.com/wp-graphql/wp-graphql/pull/2680): feat: Refactor the NodeResolver::resolve_uri to use WP_Query. Thanks @justlevine! +- [#2643](https://github.com/wp-graphql/wp-graphql/pull/2643): feat: Add post_lock check on edit/delete mutation. Thanks @markkelnar! +- [#2649](https://github.com/wp-graphql/wp-graphql/pull/2649): feat: Add `pageInfo` field to the Connection type. + +**Chores / Bugfixes** + +- [#2752](https://github.com/wp-graphql/wp-graphql/pull/2752): fix: handle 404s in NodeResolver.php. Thanks @justlevine! +- [#2735](https://github.com/wp-graphql/wp-graphql/pull/2735): fix: Explicitly check for DEBUG enabled value for tests. Thanks @markkelnar! +- [#2659](https://github.com/wp-graphql/wp-graphql/pull/2659): test: Add tests for nodeByUri. Thanks @justlevine! +- [#2724](https://github.com/wp-graphql/wp-graphql/pull/2724): test: Add test for graphql:Query key in headers. Thanks @markkelnar! +- [#2718](https://github.com/wp-graphql/wp-graphql/pull/2718): fix: deprecation notice. Thanks @decodekult! +- [#2705](https://github.com/wp-graphql/wp-graphql/pull/2705): chore: Use fully qualified classnames in PHPDoc annotations. Thanks @justlevine! +- [#2706](https://github.com/wp-graphql/wp-graphql/pull/2706): chore: update PHPStan and fix newly surfaced sniffs. Thanks @justlevine! +- [#2698](https://github.com/wp-graphql/wp-graphql/pull/2698): chore: bump simple-get from 3.15.1 to 3.16.0. Thanks @dependabot! +- [#2701](https://github.com/wp-graphql/wp-graphql/pull/2701): fix: navigation url. Thanks @jiwon-mun! +- [#2704](https://github.com/wp-graphql/wp-graphql/pull/2704): fix: missing apostrophe after escape. Thanks @i-mann! +- [#2709](https://github.com/wp-graphql/wp-graphql/pull/2709): chore: update http-cache-semantics. Thanks @dependabot! +- [#2707](https://github.com/wp-graphql/wp-graphql/pull/2707): ci: update and fix Lint PR workflow. Thanks @justlevine! +- [#2689](https://github.com/wp-graphql/wp-graphql/pull/2689): fix: prevent infinite recursion for interfaces that implement themselves as an interface. +- [#2691](https://github.com/wp-graphql/wp-graphql/pull/2691): fix: prevent non-node types from being output in the query analyzer lis-type +- [#2684](https://github.com/wp-graphql/wp-graphql/pull/2684): chore: remove deprecated use of WPGraphQL\Data\DataSource::resolve_user(). Thanks @renatonascalves +- [#2675](https://github.com/wp-graphql/wp-graphql/pull/2675): ci: keep the develop branch in sync with master. + += 1.13.10 = + +**Chores / Bugfixes** + +- [#2741](https://github.com/wp-graphql/wp-graphql/pull/2741): Change the plugin name from "WP GraphQL" to "WPGraphQL". Thanks @josephfusco! +- [#2742](https://github.com/wp-graphql/wp-graphql/pull/2742): Update Stalebot rules. Thanks @justlevine! + += 1.13.9 = + +**Chores / Bugfixes** + +- [#2726](https://github.com/wp-graphql/wp-graphql/pull/2726): fix: invalid schema when custom post types and custom taxonomies are registered with underscores in the "graphql_single_name" / "graphql_plural_name" + += 1.13.8 = + +**Chores / Bugfixes** + +- [#2712](https://github.com/wp-graphql/wp-graphql/pull/2712): fix: query analyzer outputting unexpected list types + += 1.13.7 = + +**Chores / Bugfixes** + +- ([#2661](https://github.com/wp-graphql/wp-graphql/pull/2661)): chore(deps): bump simple-git from 3.10.0 to 3.15.1 +- ([#2665](https://github.com/wp-graphql/wp-graphql/pull/2665)): chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 +- ([#2668](https://github.com/wp-graphql/wp-graphql/pull/2668)): test: Multiple domain tests. Thanks @markkelnar! +- ([#2669](https://github.com/wp-graphql/wp-graphql/pull/2669)): ci: Use last working version of xdebug for php7. Thanks @markkelnar! +- ([#2671](https://github.com/wp-graphql/wp-graphql/pull/2671)): fix: correct regressions to field formatting forcing snake_case and UcFirst fields to be lcfirst/camelCase +- ([#2672](https://github.com/wp-graphql/wp-graphql/pull/2672)): chore: update lint-pr workflow + + += 1.13.6 = + +**New Feature** + +- ([#2657](https://github.com/wp-graphql/wp-graphql/pull/2657)): feat: pass unfiltered args through to filters in the ConnectionResolver classes. Thanks @kidunot89! +- ([#2655](https://github.com/wp-graphql/wp-graphql/pull/2655)): feat: add `includeDefaultInterfaces` to connection config, allowing connections to be registered without the default `Connection` and `Edge` interfaces applied.. Thanks @justlevine! + +**Chores / Bugfixes** + +- ([#2656](https://github.com/wp-graphql/wp-graphql/pull/2656)): chore: clean up NodeResolver::resolve_uri() logic. Thanks @justlevine! + += 1.13.5 = + +**Chores / Bugfixes** + +- ([#2647](https://github.com/wp-graphql/wp-graphql/pull/2647)): fix: properly register the node field on ConnectionEdge interfaces +- ([#2645](https://github.com/wp-graphql/wp-graphql/pull/2645)): fix: regression where fields of an object type were forced to be camelCase. This allows snake_case fields again. + + += 1.13.4 = + +**Chores / Bugfixes** + +- ([#2631](https://github.com/wp-graphql/wp-graphql/pull/2631)): simplify (DRY up) connection interface registration. + += 1.13.3 = + +- fix: update versions for WordPress.org deploys + += 1.13.2 = + +**Chores / Bugfixes** + +- ([#2627](https://github.com/wp-graphql/wp-graphql/pull/2627)): fix: Fixes regression where Connection classes were moved to another namespace. This adds deprecated classes back to the old namespace to extend the new classes. Thanks @justlevine! + += 1.13.1 = + +**Chores / Bugfixes** + +- ([#2625](https://github.com/wp-graphql/wp-graphql/pull/2625)): fix: Fixes a regression to v1.13.0 where mutations registered with an uppercase first letter weren't properly being transformed to a lowercase first letter when the field is added to the Schema. + + += 1.13.0 = + +**Possible Breaking Change for some users** + +The work to introduce the `Connection` and `Edge` (and other) Interfaces required the `User.revisions` and `RootQuery.revisions` connection to +change from resolving to the `ContentRevisionUnion` type and instead resolve to the `ContentNode` type. + +We believe that it's highly likely that most users will not be impacted by this change. + +Any queries that directly reference the following types: + +- `...on UserToContentRevisionUnionConnection` +- `...on RootQueryToContentRevisionUnionConnection` + +Would need to be updated to reference these types instead: + +- `...on UserToRevisionsConnection` +- `...on RootQueryToRevisionsConnection` + +For example: + +**BEFORE** + +```graphql +{ + viewer { + revisions { + ... on UserToContentRevisionUnionConnection { + nodes { + __typename + ... on Post { + id + uri + isRevision + } + ... on Page { + id + uri + isRevision + } + } + } + } + } + revisions { + ... on RootQueryToContentRevisionUnionConnection { + nodes { + __typename + ... on Post { + id + uri + isRevision + } + ... on Page { + id + uri + isRevision + } + } + } + } +} +``` + +**AFTER** + +```graphql +{ + viewer { + revisions { + ... on UserToRevisionsConnection { + nodes { + __typename + ... on Post { + id + uri + isRevision + } + ... on Page { + id + uri + isRevision + } + } + } + } + } + revisions { + ... on RootQueryToRevisionsConnection { + nodes { + __typename + ... on Post { + id + uri + isRevision + } + ... on Page { + id + uri + isRevision + } + } + } + } +} +``` + +**New Features** + +- ([#2617](https://github.com/wp-graphql/wp-graphql/pull/2617): feat: Introduce Connection, Edge and other common Interfaces. +- ([#2563](https://github.com/wp-graphql/wp-graphql/pull/2563): feat: refactor mutation registration to use new `WPMutationType`. Thanks @justlevine! +- ([#2557](https://github.com/wp-graphql/wp-graphql/pull/2557): feat: add `deregister_graphql_type()` access function and corresponding `graphql_excluded_types` filter. Thanks @justlevine! +- ([#2546](https://github.com/wp-graphql/wp-graphql/pull/2546): feat: Add new `register_graphql_edge_fields()` and `register_graphql_connection_where_args()` access functions. Thanks @justlevine! + +**Chores / Bugfixes** + +- ([#2622](https://github.com/wp-graphql/wp-graphql/pull/2622): fix: deprecate the `previews` field for non-publicly queryable post types, and limit the `Previewable` Interface to publicly queryable post types. +- ([#2614](https://github.com/wp-graphql/wp-graphql/pull/2614): chore(deps): bump loader-utils from 2.0.3 to 2.0.4. +- ([#2540](https://github.com/wp-graphql/wp-graphql/pull/2540): fix: deprecate `Comment.approved` field in favor of `Comment.status: CommentStatusEnum`. Thanks @justlevine! +- ([#2542](https://github.com/wp-graphql/wp-graphql/pull/2542): Move parse_request logic in `NodeResolver::resolve_uri()` to its own method. Thanks @justlevine! + + += 1.12.2 = + +**New Features** + +- ([#2541](https://github.com/wp-graphql/wp-graphql/pull/2541)): feat: Obfuscate SendPasswordResetEmail response. Thanks @justlevine! + +**Chores / Bugfixes** + +- ([#2544](https://github.com/wp-graphql/wp-graphql/pull/2544)): chore: log and cleanup deprecations. Thanks @justlevine! +- ([#2605](https://github.com/wp-graphql/wp-graphql/pull/2605)): chore: bump tested version of WordPress to 6.1. Thanks @justlevine! +- ([#2606](https://github.com/wp-graphql/wp-graphql/pull/2606)): fix: update resolver in post->author connection to be more strict about the value of the author ID +- ([#2609](https://github.com/wp-graphql/wp-graphql/pull/2609)): chore(deps): bump loader-utils from 2.0.2 to 2.0.3 + + += 1.12.1 = + +**New Features** + +- ([#2593](https://github.com/wp-graphql/wp-graphql/pull/2593)): feat: use sha256 instead of md5 for hashing queryId +- ([#2581](https://github.com/wp-graphql/wp-graphql/pull/2581)): feat: support deprecation reason when using `register_graphql_connection`. +- ([#2603](https://github.com/wp-graphql/wp-graphql/pull/2603)): feat: add GraphQL operation name to x-graphql-keys headers. + +**Chores / Bugfixes** + +- ([#2472](https://github.com/wp-graphql/wp-graphql/pull/2472)): fix: Return CommentAuthor avatar urls in public requests. Thanks @justlevine! +- ([#2549](https://github.com/wp-graphql/wp-graphql/pull/2549)): chore: fix bug_report.yml description input. Thanks @justlevine! +- ([#2582](https://github.com/wp-graphql/wp-graphql/pull/2582)): fix(noderesolver): adding extra_query_vars in graphql_pre_resolve_uri. Thanks @yanmorinokamca! +- ([#2583](https://github.com/wp-graphql/wp-graphql/pull/2583)): chore: prepare docs for new website. Thanks @moonmeister! +- ([#2590](https://github.com/wp-graphql/wp-graphql/pull/2590)): fix: Add list of node types as X-GraphQL-Keys instead of list of edge types +- ([#2599](https://github.com/wp-graphql/wp-graphql/pull/2599)): fix: only use Appsero `add_plugin_data` if the method exists in the version of the Appsero client that's loaded. +- ([#2600](https://github.com/wp-graphql/wp-graphql/pull/2600)): docs: fix contributing doc render errors. Thanks @moonmeister! + + += 1.12.0 = + +**Upgrading** + +This release removes the `ContentNode` and `DatabaseIdentifier` interfaces from the `NodeWithFeaturedImage` Interface. + +This is considered a breaking change for client applications using a `...on NodeWithFeaturedImage` fragment that reference fields applied by those interfaces. If you have client applications doing this (or are unsure if you do) you can use the following filter to bring back the previous behavior: + +```php +add_filter( 'graphql_wp_interface_type_config', function( $config ) { + if ( $config['name'] === 'NodeWithFeaturedImage' ) { + $config['interfaces'][] = 'ContentNode'; + $config['interfaces'][] = 'DatabaseIdentifier'; + } + return $config; +}, 10, 1 ); +``` + +**New Features** + +- ([#2399](https://github.com/wp-graphql/wp-graphql/pull/2399)): New Schema Customization options for register_post_type and register_taxonomy. Thanks @justlevine! +- ([#2565](https://github.com/wp-graphql/wp-graphql/pull/2565)): Expose X-GraphQL-URL header. + +**Chores / Bugfixes** + +- ([#2568](https://github.com/wp-graphql/wp-graphql/pull/2568)): Fix typo in docs. Thanks @altearius! +- ([#2569](https://github.com/wp-graphql/wp-graphql/pull/2569)): Update Appsero Client SDK. +- ([#2571](https://github.com/wp-graphql/wp-graphql/pull/2571)): Dependabot bumps. +- ([#2572](https://github.com/wp-graphql/wp-graphql/pull/2572)): Fixes a bug in the GraphiQL Query Composer when working with fields that return Unions. Thanks @chrisherold! +- ([#2556](https://github.com/wp-graphql/wp-graphql/pull/2556)): Updates script that installs test environment to use env vars. Makes spinning up environments more convenient for contributors. Thanks @justlevine! +- ([#2538](https://github.com/wp-graphql/wp-graphql/pull/2538)): Updates phpstan and fixes surfaced issues. Thanks @justlevine! +- ([#2545](https://github.com/wp-graphql/wp-graphql/pull/2545)): Update WPBrowser to v3.1.6 and update test for SendPasswordResetEmail. Thanks @justlevine! + += 1.11.3 = + +**Chores / Bugfixes** + +- ([#2555](https://github.com/wp-graphql/wp-graphql/pull/2555)): Further changes to `X-GraphQL-Keys` header output. Truncate keys based on a filterable max length. Output the skipped keys in extensions payload for debugging, and add `skipped:$type` keys to the X-GraphQL-Keys header for nodes that are skipped. + + += 1.11.2 = + +**Chores / Bugfixes** + +- ([#2551](https://github.com/wp-graphql/wp-graphql/pull/2551)): Chunks X-GraphQL-Keys header into multiple headers under a set max header limit length. +- ([#2539](https://github.com/wp-graphql/wp-graphql/pull/2539)): Set IDE direction to prevent breaks in RTL mode. Thanks @justlevine! +- ([#2549](https://github.com/wp-graphql/wp-graphql/pull/2549)): Fix bug_report.yml field to be textarea instead of input. Thanks @justlevine! + += 1.11.1 = + +**Chores / Bugfixes** + +- ([#2530](https://github.com/wp-graphql/wp-graphql/pull/2530)): Fixes a regression introduced in v1.11.0 where querying menuItems with parentId where arg set to 0 was returning all menuItems instead of just top level items. + + += 1.11.0 = + +**New Features** + +- ([#2519](https://github.com/wp-graphql/wp-graphql/pull/2519)): Add new "QueryAnalyzer" class which tracks Types, Models and Nodes asked for and returned in a request and adds them to the response headers. +- ([#2519](https://github.com/wp-graphql/wp-graphql/pull/2519)): Add 2nd argument to `graphql()` function that will return the `Request` object instead executing and returning the response. +- ([#2522](https://github.com/wp-graphql/wp-graphql/pull/2522)): Allow global/database IDs in Comment connection where args. Thanks @justlevine! +- ([#2523](https://github.com/wp-graphql/wp-graphql/pull/2523)): Allow global/database IDs in MenuItem connection where args ID Inputs. Thanks @justlevine! +- ([#2524](https://github.com/wp-graphql/wp-graphql/pull/2524)): Allow global/database IDs in Term connection where args ID Inputs. Thanks @justlevine! +- ([#2525](https://github.com/wp-graphql/wp-graphql/pull/2525)): Allow global/database IDs in Post connection where args ID Inputs. Thanks @justlevine! + +**Chores / Bugfixes** + +- ([#2521](https://github.com/wp-graphql/wp-graphql/pull/2521)): Refactor `$args` in AbstractConnectionResolver. Thanks @justlevine! +- ([#2526](https://github.com/wp-graphql/wp-graphql/pull/2526)): Ensure tracked data in QueryAnalyzer is unique. + + += 1.10.0 = + +**New Features** + +- ([#2503](https://github.com/wp-graphql/wp-graphql/pull/2503)): Enable codeception debugging via Github Actions. Thanks @justlevine! +- ([#2502](https://github.com/wp-graphql/wp-graphql/pull/2502)): Add `idType` arg to `RootQuery.comment`. Thanks @justlevine! +- ([#2505](https://github.com/wp-graphql/wp-graphql/pull/2505)): Return user after `resetUserPassword` mutation. Thanks @justlevine! + +**Chores / Bugfixes** + +- ([#2482](https://github.com/wp-graphql/wp-graphql/pull/2482)): Add PHP Code Sniffer support for the WordPress.com VIP GO standard. Thanks @renatonascalves! +- ([#2490](https://github.com/wp-graphql/wp-graphql/pull/2490)): Fix bug related to querying the page set as "Posts Page" +- ([#2497](https://github.com/wp-graphql/wp-graphql/pull/2497)): Only enqueue admin scripts on the settings page. Thanks @justlevine! +- ([#2498](https://github.com/wp-graphql/wp-graphql/pull/2498)): Add `include` and `exclude` args to `MediaDetails.sizes`. Thanks @justlevine! +- ([#2499](https://github.com/wp-graphql/wp-graphql/pull/2499)): Check for multiple theme capabilities in the Theme Model. Thanks @justlevine! +- ([#2504](https://github.com/wp-graphql/wp-graphql/pull/2504)): Filter `mediaItems` query by `mimeType`. Thanks @justlevine! +- ([#2506](https://github.com/wp-graphql/wp-graphql/pull/2506)): Update descriptions for input fields that accept a `databaseId`. Thanks @justlevine! +- ([#2511](https://github.com/wp-graphql/wp-graphql/pull/2511)): Update link in docs to point to correct "nonce" example. Thanks @NielsdeBlaauw! + + += 1.9.1 = + +**Chores / Bugfixes** + +- ([#2471](https://github.com/wp-graphql/wp-graphql/pull/2471)): feat: PHPCS: enhancements to the Coding Standards Setup. Thanks @renatonascalves! +- ([#2472](https://github.com/wp-graphql/wp-graphql/pull/2472)): fix: return CommentAuthor avatar urls to public users. Thanks @justlevine! +- ([#2473](https://github.com/wp-graphql/wp-graphql/pull/2473)): fix: Update GraphiQL "user switch" to be accessible. Thanks @nickcernis! +- ([#2477](https://github.com/wp-graphql/wp-graphql/pull/2477)): fix(graphiql): graphiql fails if variables are invalid json + + += 1.9.0 = + +**Upgrading** + +There are 2 changes that **might** require action when updating to 1.9.0. + + +1. ([#2464](https://github.com/wp-graphql/wp-graphql/pull/2464)) + +When querying for a `nodeByUri`, if your site has the "page_for_posts" setting configured, the behavior of the `nodeByUri` query for that uri might be different for you. + +Previously a bug caused this query to return a "Page" type, when it should have returned a "ContentType" Type. + +The bug fix might change your application if you were using the bug as a feature. + + + +2. ([#2457](https://github.com/wp-graphql/wp-graphql/pull/2457)) + +There were a lot of bug fixes related to connections to ensure they behave as intended. If you were querying lists of data, in some cases the data might be returned in a different order than it was before. + +For example, using the "last" input on a Comment or User query should still return the same nodes, but in a different order than before. + +This might cause behavior you don't want in your application because you had coded around the bug. This change was needed to support proper backward pagination. + +** Chores / Bugfixes** + +- ([#2450](https://github.com/wp-graphql/wp-graphql/pull/2450)): Fix PHPCompatibility lint config. Thanks @justlevine! +- ([#2452](https://github.com/wp-graphql/wp-graphql/pull/2452)): Fixes a bug with `Comment.author` connections not properly resolving for public (non-authenticated) requests. +- ([#2453](https://github.com/wp-graphql/wp-graphql/pull/2453)): Update Github Workflows to use PHP 7.3. Thanks @justlevine! +- ([#2454](https://github.com/wp-graphql/wp-graphql/pull/2454)): Add linter to ensure Pull Requests use "Conventional Commit" standards. +- ([#2455](https://github.com/wp-graphql/wp-graphql/pull/2455)): Refactors and Lints the WPUnit tests. Cleans up some "leaky" data in test suites. Thanks @justlevine! +- ([#2457](https://github.com/wp-graphql/wp-graphql/pull/2457)): Refactor Connection Resolvers to better adhere to Relay Connection spec. This fixes several bugs related to pagination across connections, specifically User and Comment connections which didn't properly support backward pagination at all. Thanks @justlevine! +- ([#2460](https://github.com/wp-graphql/wp-graphql/pull/2460)): Update documentation for running tests with Docker. Thanks @markkelnar! +- ([#2463](https://github.com/wp-graphql/wp-graphql/pull/2463)): Add Issue templates to the repo. Thanks @justlevine! +- ([#2464](https://github.com/wp-graphql/wp-graphql/pull/2464)): Fixes node resolver when "page_for_posts" setting is set to a page. + + += 1.8.7 = + +**Chores / Bugfixes** + +- ([#2441](https://github.com/wp-graphql/wp-graphql/pull/2441)): Fix `contentNodes` field not showing if a taxonomy is registered without connected post types. Thanks @saimonh3! +- ([#2446](https://github.com/wp-graphql/wp-graphql/pull/2446)): Update "terser" from 5.11.0 to 5.14.2 (GraphiQL Dependency) +- ([#2440](https://github.com/wp-graphql/wp-graphql/pull/2440)): Update JS dependencies for GraphiQL + +**New Features** + +- ([#2435](https://github.com/wp-graphql/wp-graphql/pull/2435)): Add filter in execute for query string. Thanks @markkelnar! +- ([#2432](https://github.com/wp-graphql/wp-graphql/pull/2432)): Add `query_id` to `after_execute_actions` for batch requests. Thanks @markkelnar! + + += 1.8.6 = + +**Chores / Bugfixes** + +- ([#2427](https://github.com/wp-graphql/wp-graphql/pull/2427)): Fixes a regression of the 1.8.3 release where there could be fatal errors when GraphQL Tracing is enabled and a queryId is used as a query param. + + += 1.8.5 = + +**Chores / Bugfixes** + +- ([#2422](https://github.com/wp-graphql/wp-graphql/pull/2422)): Fixes a regression of the 1.8.3 release where there could be fatal errors when GraphQL Tracing is enabled. + + += 1.8.4 = + +**Chores / Bugfixes** + +- ([#2416](https://github.com/wp-graphql/wp-graphql/pull/2416)): Fixes schema artifact workflow in Github. + += 1.8.3 = + +**New Features** + +- ([#2388](https://github.com/wp-graphql/wp-graphql/pull/2388)): Adds ability to query menus by SLUG and LOCATION. Thanks @justlevine! + +**Chores / Bugfixes** + +- ([#2412](https://github.com/wp-graphql/wp-graphql/pull/2412)): Update tests to run in PHP 8, 8.1 and with WordPress 6.0. Updates Docker Deploy workflow as well. +- ([#2411](https://github.com/wp-graphql/wp-graphql/pull/2411)): Fixes bug where menuItems "location" arg was conflicting if a taxonomy is also registered with "location" as its name. +- ([#2410](https://github.com/wp-graphql/wp-graphql/pull/2410)): Fixes a regression with Taxonomy Connection pagination. +- ([#2406](https://github.com/wp-graphql/wp-graphql/pull/2406)): Updates PHPUnit, WPBrowser and WPGraphQL Test Case for use in workflows. Thanks @justlevine! +- ([#2387](https://github.com/wp-graphql/wp-graphql/pull/2387)): Fixes a bug with asset versions when querying for Enqueued Scripts and Styles. Thanks @justlevine! + + + += 1.8.2 = + +**New Features** + +- ([#2363](https://github.com/wp-graphql/wp-graphql/pull/2363)): Adds "uri" field to MenuItem type which resolves the path of the node which can then be used in a `nodeByUri` query to get the linked node. The path is relative and does not contain subdirectory path in a subdirectory multisite. the `path` field does include the multisite subdirectory path, still. Thanks @josephfusco and @justlevine! +- ([#2337](https://github.com/wp-graphql/wp-graphql/pull/2337)): Allows for either global ID or databaseId to be supplied in the ID field for user mutations. Thanks @justlevine! +- ([#2338](https://github.com/wp-graphql/wp-graphql/pull/2338)): Allows either global "relay" ID or databaseId for post object mutations. Thanks @justlevine! +- ([#2336](https://github.com/wp-graphql/wp-graphql/pull/2336)): Allows either global "relay" ID or databaseId for term object mutations. Thanks @justlevine! +- ([#2331](https://github.com/wp-graphql/wp-graphql/pull/2331)): Allows either global "relay" ID or databaseId for MediaItem object mutations. Thanks @justlevine! +- ([#2328](https://github.com/wp-graphql/wp-graphql/pull/2328)): Allows either global "relay" ID or databaseId for Comment object mutations. Thanks @justlevine! + + +**Chores/Bugfixes** + +- ([#2368](https://github.com/wp-graphql/wp-graphql/pull/2368)): Updates dependencies for Schema Linter workflow. +- ([#2369](https://github.com/wp-graphql/wp-graphql/pull/2369)): Replaces the Codecov badge in the README with Coveralls badge. Thanks @justlevine! +- ([#2374](https://github.com/wp-graphql/wp-graphql/pull/2374)): Updates descriptions for PostObjectFieldFormatEnum. Thanks @justlevine! +- ([#2375](https://github.com/wp-graphql/wp-graphql/pull/2375)): Sets up the testing integration workflow to be able to run in multisite. Adds one workflow that runs in multisite. Fixes tests related to multisite. +- ([#2376](https://github.com/wp-graphql/wp-graphql/pull/2276)): Adds support for `['auth']['callback']` and `isPrivate` for the `register_graphql_mutation()` API. +- ([#2379](https://github.com/wp-graphql/wp-graphql/pull/2379)): Fixes a bug where term mutations were adding slashes when being stored in the database. +- ([#2380](https://github.com/wp-graphql/wp-graphql/pull/2380)): Fixes a bug where WPGraphQL wasn't sending the Wp class to the `parse_request` filter as a reference. +- ([#2382](https://github.com/wp-graphql/wp-graphql/pull/2382)): Fixes a bug where `register_graphql_field()` was not being respected by GraphQL Types added to the schema to represent Setting Groups of the core WordPress `register_setting()` API. + + += 1.8.1 = + +**New Features** + +- ([#2349](https://github.com/wp-graphql/wp-graphql/pull/2349)): Adds tags to wpkses_post for WPGraphQL settings pages to be extended further. Thanks @eavonius! + +**Chores/Bugfixes** + +- ([#2358](https://github.com/wp-graphql/wp-graphql/pull/2358)): Updates NPM dependencies. Thanks @dependabot! +- ([#2357](https://github.com/wp-graphql/wp-graphql/pull/2357)): Updates NPM dependencies. Thanks @dependabot! +- ([#2356](https://github.com/wp-graphql/wp-graphql/pull/2356)): Refactors codebase to take advantage of the work done in #2353. Thanks @justlevine! +- ([#2354](https://github.com/wp-graphql/wp-graphql/pull/2354)): Fixes console warnings in GraphiQL related to missing React keys. +- ([#2353](https://github.com/wp-graphql/wp-graphql/pull/2353)): Refactors the WPGraphQL::get_allowed_post_types() and WPGraphQL::get_allowed_taxonomies() functions. Thanks @justlevine! +- ([#2350](https://github.com/wp-graphql/wp-graphql/pull/2350)): Fixes bug where Comment Authors were not always properly returning + += 1.8.0 = + +**New Features** + +- ([#2286](https://github.com/wp-graphql/wp-graphql/pull/2286)): Introduce new `Utils::get_database_id_from_id()` function to help DRY up some code around inputs that can accept Global IDs or Database IDs. Thanks @justlevine! +- ([#2327](https://github.com/wp-graphql/wp-graphql/pull/2327)): Update capability for plugin queries. Changes from `update_plugins` to `activate_plugins`. Thanks @justlevine! +- ([#2298](https://github.com/wp-graphql/wp-graphql/pull/2298)): Adds `$where` arguments to Plugin Connections. Thanks @justlevine! +- ([#2332](https://github.com/wp-graphql/wp-graphql/pull/2332)): Adds new Github workflow to build the GraphiQL App on pushes to `develop` and `master`. This should allow users that install WPGraphQL to install/update with Composer and have the GraphiQL app running, instead of having to run `npm install && npm run build` in addition to `composer install`. + +**Chores / Bugfixes** + +- ([#2286](https://github.com/wp-graphql/wp-graphql/pull/2286)): Remove old, no-longer used JS files. Remnant from 1.7.0 release. +- ([#2296](https://github.com/wp-graphql/wp-graphql/pull/2296)): Fixes bug with how post/page templates are added to the Schema. Thanks @justlevine! +- ([#2295](https://github.com/wp-graphql/wp-graphql/pull/2295)): Fixes bug where menus were returning when they shouldn't be. Thanks @justlevine! +- ([#2299](https://github.com/wp-graphql/wp-graphql/pull/2299)): Fixes bug with author ID not being cast to an integer properly in the MediaItemUpdate mutation. Thanks @abaicus! +- ([#2310](https://github.com/wp-graphql/wp-graphql/pull/2310)): Bumps node-forge npm dependency +- ([#2317](https://github.com/wp-graphql/wp-graphql/pull/2317)): Bumps composer dependencies +- ([#2291](https://github.com/wp-graphql/wp-graphql/pull/2291)): Add "allow-plugins" to composer.json to reduce warning output when running composer install. Thanks @justlevine! +- ([#2294](https://github.com/wp-graphql/wp-graphql/pull/2294)): Refactors AbstractConnectionResolver::get_nodes() to prevent double slicing. Thanks @justlevine! +- ([#2293](https://github.com/wp-graphql/wp-graphql/pull/2293)): Fixes connections that can be missing nodes when before/after arguments are empty. Thanks @justlevine! +- ([#2323](https://github.com/wp-graphql/wp-graphql/pull/2323)): Fixes bug in Comment mutations. Thanks @justlevine! +- ([#2320](https://github.com/wp-graphql/wp-graphql/pull/2320)): Fixes bug with filtering comments by commentType. Thanks @justlevine! +- ([#2319](https://github.com/wp-graphql/wp-graphql/pull/2319)): Fixes bug with the comment_text filter in Comment queries. Thanks @justlevine! + += 1.7.2 = + +**Chores / Bugfixes** + +- ([#2276](https://github.com/wp-graphql/wp-graphql/pull/2276)): Fixes a bug where `generalSettings.url` field was not in the Schema for multisite installs. +- ([#2278](https://github.com/wp-graphql/wp-graphql/pull/2278)): Adds a composer post-install script that installs JS dependencies and builds the JS app when `composer install` is run +- ([#2277](https://github.com/wp-graphql/wp-graphql/pull/2277)): Adds a condition to the docker image to only run `npm` scripts if the project has a package.json. Thanks @markkelnar! + + += 1.7.1 = + +**Chores / Bugfixes** + +- ([#2268](https://github.com/wp-graphql/wp-graphql/pull/2268)): Fixes a bug in GraphiQL that would update browser history with every change to a query param. + + += 1.7.0 = + +**Chores / Bugfixes** + +- ([#2228](https://github.com/wp-graphql/wp-graphql/pull/2228)): Allows optional fields to be set to empty values in the `updateUser` mutation. Thanks @victormattosvm! +- ([#2247](https://github.com/wp-graphql/wp-graphql/pull/2247)): Add WordPress 5.9 to the automated testing matrix. Thanks @markkelnar! +- ([#2242](https://github.com/wp-graphql/wp-graphql/pull/2242)): Adds End 2 End tests to test GraphiQL functionality in the admin. +- ([#2261](https://github.com/wp-graphql/wp-graphql/pull/2261)): Fixes a bug where the `pageByUri` query might return incorrect data when custom permalinks are set. Thanks @blakewilson! +- ([#2263](https://github.com/wp-graphql/wp-graphql/pull/2263)): Adds documentation entry for WordPress Application Passwords guide. Thanks @abhisekmazumdar! +- ([#2262](https://github.com/wp-graphql/wp-graphql/pull/2262)): Fixes a bug where settings registered via the core `register_setting()` API would cause Schema Introspection failures, causing GraphiQL and other tools to not work properly. + +**New Features** + +- ([#2248](https://github.com/wp-graphql/wp-graphql/pull/2248)): WPGraphiQL (the GraphiQL IDE in the WordPress dashboard) has been re-built to have an extension architecture and some updated user interfaces. Thanks for contributing to this effort @scottyzen! +- ([#2246](https://github.com/wp-graphql/wp-graphql/pull/2246)): Adds support for querying the `avatar` for the CommentAuthor Type and the Commenter Interface type. +- ([#2236](https://github.com/wp-graphql/wp-graphql/pull/2236)): Introduces new `graphql_model_prepare_fields` filter and deprecates `graphql_return_modeled_data` filter. Thanks @justlevine! +- ([#2265](https://github.com/wp-graphql/wp-graphql/pull/2265)): Adds opt-in telemetry tracking via Appsero, to allow us to collect helpful information for prioritizing future feature work, etc. + += 1.6.12 = + +**Chores / Bugfixes** + +- ([#2209](https://github.com/wp-graphql/wp-graphql/pull/2209)): Adds WordPress 5.8 to the testing matrix. Thanks @markkelnar! +- ([#2211](https://github.com/wp-graphql/wp-graphql/pull/2211)), ([#2216](https://github.com/wp-graphql/wp-graphql/pull/2216)), ([#2221](https://github.com/wp-graphql/wp-graphql/pull/2221)), ([#2223](https://github.com/wp-graphql/wp-graphql/pull/2223)): Bumps NPM dependencies for GraphiQL +- ([#2212](https://github.com/wp-graphql/wp-graphql/pull/2212)): Fixes how the `TermObject.uri` strips the link down to the path. Thanks @theodesp! +- ([#2215](https://github.com/wp-graphql/wp-graphql/pull/2215)): Fixes testing environment to play nice with a recent wp-browser update. +- ([#2218](https://github.com/wp-graphql/wp-graphql/pull/2218)): Update note on settings page explaining that Public Introspection is enabled when GraphQL Debug mode is enabled. +- ([#2220](https://github.com/wp-graphql/wp-graphql/pull/2220)): Adds CodeQL workflow to analyze JavaScript on PRs + + += 1.6.11 = + +**Chores / Bugfixes** + +- ([#2177](https://github.com/wp-graphql/wp-graphql/pull/2177)): Prevents PHP notice when clientMutationId is not set on mutations. Thanks @oskarmodig! +- ([#2182](https://github.com/wp-graphql/wp-graphql/pull/2182)): Fixes bug where the graphql endpoint couldn't be accessed by a site domain other than the site_url(). Thanks @moommeister! +- ([#2184](https://github.com/wp-graphql/wp-graphql/pull/2184)): Fixes regression where duplicate type warning was not being displayed after lazy type loading was added in v1.6.0. +- ([#2189](https://github.com/wp-graphql/wp-graphql/pull/2189)): Fixes bug with content node previews +- ([#2196](https://github.com/wp-graphql/wp-graphql/pull/2196)): Further bug fixes for content node previews. Thanks @apmattews! +- ([#2197](https://github.com/wp-graphql/wp-graphql/pull/2197)): Fixes call to prepare_fields() to not be called statically. Thanks @justlevine! + +**New Features** + +- ([#2188](https://github.com/wp-graphql/wp-graphql/pull/2188)): Adds `contentTypeName` to the `ContentNode` type. +- ([#2199](https://github.com/wp-graphql/wp-graphql/pull/2199)): Pass the TypeRegistry instance through to the `graphql_schema_config` filter. +- ([#2204](https://github.com/wp-graphql/wp-graphql/pull/2204)): Allow a `root_value` to be set when calling the `graphql()` function. +- ([#2203](https://github.com/wp-graphql/wp-graphql/pull/2203)): Adds new filter to mutations to filter the input args before execution, and a new action after execution, before returning the mutation, to allow additional data to be stored during mutations. Thanks @markkelnar! + += 1.6.10 = + +- Updating stable tag for WordPress.org + += 1.6.9 = + +- No functional changes from v1.6.8. Fixing an issue with deploy to WordPress.org + += 1.6.8 = + +**Chores / Bugfixes** + +- ([#2143](https://github.com/wp-graphql/wp-graphql/pull/2143)): Adds `taxonomyName` field to the `TermNode` interface. Thanks @jeanfredrik! +- ([#2168](https://github.com/wp-graphql/wp-graphql/pull/2168)): Allows the GraphiQL screen markup to be filtered +- ([#2150](https://github.com/wp-graphql/wp-graphql/pull/2150)): Updates GraphiQL npm dependency to v1.4.7 +- ([#2145](https://github.com/wp-graphql/wp-graphql/pull/2145)): Fixes a bug with cursor pagination stability + + +**New Features** + +- ([#2141](https://github.com/wp-graphql/wp-graphql/pull/2141)): Adds a new `graphql_wp_connection_type_config` filter to allow customizing connection configurations. Thanks @justlevine! + + += 1.6.7 + +**Chores / Bugfixes** + +- ([#2135](https://github.com/wp-graphql/wp-graphql/pull/2135)): Fixes permission check in the Post model layer. Posts of a `'publicly_queryable' => true` post_type can be queried publicly (non-authenticated requests) via WPGraphQL, even if the post_type is set to `'public' => false`. Thanks @kellenmace! +- ([#2093](https://github.com/wp-graphql/wp-graphql/pull/2093)): Fixes `Post.pinged` field to properly return an array. Thanks @justlevine! +- ([#2132](https://github.com/wp-graphql/wp-graphql/pull/2132)): Fix issue where querying posts by slug could erroneously return null. Thanks @ChrisWiegman! +- ([#2127](https://github.com/wp-graphql/wp-graphql/pull/2127)): Update endpoint in documentation examples. Thanks @RafidMuhyim! + + += 1.6.6 + +**New Features** + +- ([#2106](https://github.com/wp-graphql/wp-graphql/pull/2106)): Add new `pre_graphql_execute_request` filter to better support full query caching. Thanks @markkelnar! +- ([#2123](https://github.com/wp-graphql/wp-graphql/pull/2123)): Add new `graphql_dataloader_get_cached` filter to better support persistent object caching in the Model Layer. Thanks @kidunot89! + +**Chores / Bugfixes** + +- ([#2094](https://github.com/wp-graphql/wp-graphql/pull/2094)): fix broken link in docs. Thanks @duffn! +- ([#2108](https://github.com/wp-graphql/wp-graphql/pull/2108)): Update lucatume/wp-browser dependency. Thanks @markkelnar! +- ([#2111](https://github.com/wp-graphql/wp-graphql/pull/2111)): Correct variable name passed to filter. Thanks @markkelnar! +- ([#2112](https://github.com/wp-graphql/wp-graphql/pull/2112)): Doc typo corrections. Thanks @nexxai! +- ([#2115](https://github.com/wp-graphql/wp-graphql/pull/2115)): Updates to GraphiQL npm dependencies. Thanks @alexghirelli! +- ([#2124](https://github.com/wp-graphql/wp-graphql/pull/2124)): Updates `tmpl` npm dependency. + + += 1.6.5 + +**Chores / Bugfixes** + +- ([#2081](https://github.com/wp-graphql/wp-graphql/pull/2081)): Set `is_graphql_request` earlier in Request.php. Thanks @jordanmaslyn! +- ([#2085](https://github.com/wp-graphql/wp-graphql/pull/2085)): Bump codeception from 4.1.21 to 4.1.22 + +**New Features** + +- ([#2076](https://github.com/wp-graphql/wp-graphql/pull/2076)): Add `$graphiql` global variable to allow extensions the ability to more easily remove hooks/filters from the class. + + += 1.6.4 + +**Chores / Bugfixes** + +- ([#2076](https://github.com/wp-graphql/wp-graphql/pull/2076)): Updates WPGraphiQL IDE to use latest react, GraphiQL and other dependencies. + +**New Features** + +- ([#2076](https://github.com/wp-graphql/wp-graphql/pull/2076)): WPGraphiQL IDE now resizes when the browser window is resized. + + += 1.6.3 + +**Chores / Bugfixes** + +- ([#2064](https://github.com/wp-graphql/wp-graphql/pull/2064)): Fixes bug where using `asQuery` argument could return an error instead of a null when the ID passed could not be previewed. +- ([#2072](https://github.com/wp-graphql/wp-graphql/pull/2072)): Fixes bug (regression with 1.6) where Object Types for page templates were not properly loading in the Schema after Lazy Loading was introduced in 1.6. +- ([#2059](https://github.com/wp-graphql/wp-graphql/pull/2059)): Update typos and links in docs. Thanks @nicolnt! +- ([#2058](https://github.com/wp-graphql/wp-graphql/pull/2058)): Fixes bug in the filter_post_meta_for_previews was causing PHP warnings. Thanks @zolon4! + + += 1.6.2 = + +**Chores / Bugfixes** + +- ([#2051](https://github.com/wp-graphql/wp-graphql/pull/2051)): Fixes a bug where Types that share the same name as a PHP function (ex: `Header` / `header()`) would try and call the function when loading the Type. See ([Issue #2047](https://github.com/wp-graphql/wp-graphql/issues/2047)) +- ([#2055](https://github.com/wp-graphql/wp-graphql/pull/2055)): Fixes a bug where Connections registered from Types were adding connections to the registry too late causing some queries to fail. See Issue ([Issue #2054](https://github.com/wp-graphql/wp-graphql/issues/2054)) + + += 1.6.1 = + +**Chores / Bugfixes** + +- ([#2043](https://github.com/wp-graphql/wp-graphql/pull/2043)): Fixes a regression with GraphQL Request Execution that was causing Gatsby to fail builds. + + += 1.6.0 = + +**Chores / Bugfixes** + +- ([#2000](https://github.com/wp-graphql/wp-graphql/pull/2000)): This fixes issue where all Types of the Schema were loaded for each GraphQL request. Now only the types required to fulfill the request are loaded on each request. Thanks @chriszarate! +- ([#2031](https://github.com/wp-graphql/wp-graphql/pull/2031)): This fixes a performance issue in the WPGraphQL model layer where determining whether a User is a published author was generating expensive MySQL queries on sites with a lot of users and a lot of content. Thanks @chriszarate! + += 1.5.8 = + +**Chores / Bugfixes** + +- ([#2038](https://github.com/wp-graphql/wp-graphql/pull/2038)): Exclude documentation directory from code archived by composer and deployed to WordPress.org + += 1.5.7 = + +**Chores / Bugfixes** + +- Update to trigger a missed deploy to WordPress.org. no functional changes from v1.5.6 + += 1.5.6 = + +**Chores / Bugfixes** + +- ([#2035](https://github.com/wp-graphql/wp-graphql/pull/2035)): Fixes a bug where variables passed to `after_execute_actions` weren't properly set for Batch Queries. + +**New Features** + +- ([#2035](https://github.com/wp-graphql/wp-graphql/pull/2035)): (Yes, same PR as the bugfix above). Adds 2 new actions `graphql_before_execute` and `graphql_after_execute` to allow actions to run before/after the execution of entire Batch requests vs. the hooks that currently run _within_ each the execution of each operation within a request. + + += 1.5.5 = + +**Chores / Bugfixes** + +- ([#2023](https://github.com/wp-graphql/wp-graphql/pull/2023)): Fixes issue with deploying Docker Testing Images. Thanks @markkelnar! +- ([#2025](https://github.com/wp-graphql/wp-graphql/pull/2025)): Update test workflow to test against WordPress 5.8 (released today) and updates the readme.txt to reflect the plugin has been tested up to 5.8 +- ([#2028](https://github.com/wp-graphql/wp-graphql/pull/2028)): Update Codeception test environment to prevent WordPress from entering maintenance mode during tests. + += 1.5.4 = + +**Chores / Bugfixes** + +- ([#2012](https://github.com/wp-graphql/wp-graphql/pull/2012)): Adds functional tests back to the Github testing workflow! +- ([#2016](https://github.com/wp-graphql/wp-graphql/pull/2016)): Ignore Schema Linter workflow on releases, run on PRs only. +- ([#2019](https://github.com/wp-graphql/wp-graphql/pull/2019)): Deploy Docker Testing Image on releases. Thanks @markkelnar! + +**New Features** + +- ([#2011](https://github.com/wp-graphql/wp-graphql/pull/2011)): Introduces a new API to allow Types to register connections at the Type registration level and refactors several internal Types to use this new API. + + += 1.5.3 = + +**Chores / Bugfixes** + +- ([#2001](https://github.com/wp-graphql/wp-graphql/pull/2001)): Updates Docker environment to use MariaDB instead of MySQL to play nice with those fancy M1 Macs. Thanks @chriszarate! +- ([#2002](https://github.com/wp-graphql/wp-graphql/pull/2002)): Add PHP8 Docker image to deploy upon releases. Thanks @markkelnar! +- ([#2006](https://github.com/wp-graphql/wp-graphql/pull/2006)): Update Docker to use $PROJECT_DIR variable instead of hardcoded value to allow composed docker images to run their own tests from their own project. Thanks @markkelnar! +- ([#2007](https://github.com/wp-graphql/wp-graphql/pull/2007)): Update broken links to Relay spec. Thanks @ramyareye! + +**New Features** + +- ([#2009](https://github.com/wp-graphql/wp-graphql/pull/2009)): Adds new WPConnectionType class and refactors register_graphql_connection() to use the class. Functionality should be the same, but this sets the codebase up for some new connection APIs. + + += 1.5.2 = + +**Chores / Bugfixes** + +- ([#1992](https://github.com/wp-graphql/wp-graphql/pull/1992)): Fixes bug that caused conflict with the AmpWP plugin. +- ([#1994](https://github.com/wp-graphql/wp-graphql/pull/1994)): Fixes bug where querying a node by uri could return a node of a different post type. +- ([#1997](https://github.com/wp-graphql/wp-graphql/pull/1997)): Fixes bug where Enums could be generated with no values when a taxonomy was set to show in GraphQL but it's associated post_type(s) are not shown in graphql. + + += 1.5.1 = + +**Chores / Bugfixes** + +- ([#1987](https://github.com/wp-graphql/wp-graphql/pull/1987)): Fixes Relay Spec link in documentation Thanks @ramyareye! +- ([#1988](https://github.com/wp-graphql/wp-graphql/pull/1988)): Fixes docblock and parameter Type in preview filter callback. Thanks @zolon4! +- ([#1986](https://github.com/wp-graphql/wp-graphql/pull/1986)): Update WP environment variables for testing with PHP8. Thanks @markkelnar! + +**New Features** + +- ([#1984](https://github.com/wp-graphql/wp-graphql/pull/1984)): Support for PHP8! No functional changes to the code, just changes to dependency declarations and test environment. +- ([#1990](https://github.com/wp-graphql/wp-graphql/pull/1990)): Adds `isTermNode` and `isContentNode` to the `UniformResourceIdentifiable` Interface + + + += 1.5.0 = + +**Chores / Bugfixes** + +- ([#1865](https://github.com/wp-graphql/wp-graphql/pull/1865)): Change `MenuItem.path` field from `nonNull` to nullable as the value can be null in WordPress. Thanks @furedal! +- ([#1978](https://github.com/wp-graphql/wp-graphql/pull/1978)): Use "docker compose" instead of docker-compose in the run-docker.sh script. Thanks @markkelnar! +- ([#1974](https://github.com/wp-graphql/wp-graphql/pull/1974)): Separates app setup and app-post-setup scripts for use in the Docker/test environment setup. Thanks @markkelnar! +- ([#1972](https://github.com/wp-graphql/wp-graphql/pull/1972)): Pushes Docker images when new releases are tagged. Thanks @markkelnar! +- ([#1970](https://github.com/wp-graphql/wp-graphql/pull/1970)): Change Docker Image names specific to the WP and PHP versions. Thanks @markkelnar! +- ([#1967](https://github.com/wp-graphql/wp-graphql/pull/1967)): Update xdebug max nesting level to allow coverage to pass with resolver instrumentation active. Thanks @markkelnar! + + +**New Features** + +- ([#1977](https://github.com/wp-graphql/wp-graphql/pull/1977)): Allow same string to be passed for "graphql_single_name" and "graphql_plural_name" (ex: "deer" and "deer") when registering Post Types and Taxonomies. Same strings will be prefixed with "all" for plurals. Thanks @apmatthews! +- ([#1787](https://github.com/wp-graphql/wp-graphql/pull/1787)): Adds a new "ContentTypesOf. Thanks @plong0! + + += 1.4.3 = + +- No functional change. Version bump to fix previous deploy. + += 1.4.2 = + +**Chores / Bugfixes** + +- ([#1963](https://github.com/wp-graphql/wp-graphql/pull/1963)): Fixes a regression in v1.4.0 where the `uri` field on Terms was returning `null`. The issue was actually wider than that as resolvers on Object Types that implement interfaces weren't being fully respected. +- ([#1956](https://github.com/wp-graphql/wp-graphql/pull/1956)): Adds `SpaceAfterFunction` Code Sniffer rule and adjusts the codebase to respect the rule. Thanks @markkelnar! + + += 1.4.1 = + +**Chores / Bugfixes** + +- ([#1958](https://github.com/wp-graphql/wp-graphql/pull/1958)): Fixes a regression in 1.4.0 where `register_graphql_interfaces_to_types` was broken. + + += 1.4.0 = + +**Chores / Bugfixes** + +- ([#1951](https://github.com/wp-graphql/wp-graphql/pull/1951)): Fixes bug with the `uri` field. Some Types in the Schema had the `uri` field as nullable field and some as a non-null field. This fixes it and makes the field consistently nullable as some Nodes with a URI might have a `null` value if the node is private. +- ([#1953](https://github.com/wp-graphql/wp-graphql/pull/1953)): Fixes bug with Settings groups with underscores not showing in the Schema properly. Thanks @markkelnar! + +**New Features** + +- ([#1951](https://github.com/wp-graphql/wp-graphql/pull/1951)): Updates GraphQL-PHP to v14.8.0 (from 14.4.0) and Introduces the ability for Interfaces to implement other Interfaces! + += 1.3.10 = + +**Chores / Bugfixes** + +- ([#1940](https://github.com/wp-graphql/wp-graphql/pull/1940)): Adds Breaking Change inspector to run on new Pull Requests. Thanks @markkelnar! +- ([#1937](https://github.com/wp-graphql/wp-graphql/pull/1937)): Fixed typo in documentation. Thanks @LeonardoDB! +- ([#1923](https://github.com/wp-graphql/wp-graphql/issues/1923)): Fixed bug where User Model didn't support the databaseId field + +**New Features** + +- ([#1938](https://github.com/wp-graphql/wp-graphql/pull/1938)): Adds new functionality to the `register_graphql_connection()` API. Thanks @kidunot89! + += 1.3.9 = + +**Chores / Bugfixes** + +- ([#1902](https://github.com/wp-graphql/wp-graphql/pull/1902)): Moves more documentation into markdown. Thanks @markkelnar! +- ([#1917](https://github.com/wp-graphql/wp-graphql/pull/1917)): Updates docblock on WPObjectType. Thanks @markkelnar! +- ([#1926](https://github.com/wp-graphql/wp-graphql/pull/1926)): Removes Telemetry. +- ([#1928](https://github.com/wp-graphql/wp-graphql/pull/1928)): Fixes bug (#1864) that was causing errors when get_post_meta() was used with a null meta key. +- ([#1929](https://github.com/wp-graphql/wp-graphql/pull/1929)): Adds Github Workflow to upload schema.graphql as release asset. + +**New Features** + +- ([#1924](https://github.com/wp-graphql/wp-graphql/pull/1924)): Adds new `graphql_http_request_response_errors` filter. Thanks @kidunot89! +- ([#1908](https://github.com/wp-graphql/wp-graphql/pull/1908)): Adds new `graphql_pre_resolve_uri` filter, allowing 3rd parties to filter the behavior of the nodeByUri resolver. Thanks @renatonascalves! + += 1.3.8 = + +**Chores / Bugfixes** + +- ([#1897](https://github.com/wp-graphql/wp-graphql/pull/1897)): Fails batch requests when disabled earlier. +- ([#1893](https://github.com/wp-graphql/wp-graphql/pull/1893)): Moves more documentation into markdown. Thanks @markkelnar! + +**New Features** + +- ([#1897](https://github.com/wp-graphql/wp-graphql/pull/1897)): Adds new setting to set a max number of batch operations to allow per Batch request. + + += 1.3.7 = + +**Chores / Bugfixes** + +- ([#1885](https://github.com/wp-graphql/wp-graphql/pull/1885)): Fixes regression to `register_graphql_connection` that was breaking custom connections registered by 3rd party plugins. + + += 1.3.6 = + +**Chores / Bugfixes** + +- ([#1878](https://github.com/wp-graphql/wp-graphql/pull/1878)): Limits the x-hacker header to be output when in DEBUG mode by default. Thanks @wvffle! +- ([#1880](https://github.com/wp-graphql/wp-graphql/pull/1880)): Fixes the formatting of the modified date for Post objects. Thanks @chriszarate! +- ([#1851](https://github.com/wp-graphql/wp-graphql/pull/1851)): Update Schema Linker Github Action. Thanks @markkelnar! +- ([#1858](https://github.com/wp-graphql/wp-graphql/pull/1858)): Start migrating docs into markdown files within the repo. Thanks @markkelnar! +- ([#1856](https://github.com/wp-graphql/wp-graphql/pull/1856)): Move Schema Linter Github Action into multiple steps. Thanks @szepeviktor! + +**New Features** + +- ([#1872](https://github.com/wp-graphql/wp-graphql/pull/1872)): Adds new setting to the GraphQL Settings page to allow site administrators to restrict the endpoint to authenticated requests. +- ([#1874](https://github.com/wp-graphql/wp-graphql/pull/1874)): Adds new setting to the GraphQL Settings page to allow site administrators to disable Batch Queries. +- ([#1875](https://github.com/wp-graphql/wp-graphql/pull/1875)): Adds new setting to the GraphQL Settings page to allow site administrators to enable a max query depth and specify the depth. + + += 1.3.5 = + +**Chores / Bugfixes** + +- ([#1846](https://github.com/wp-graphql/wp-graphql/pull/1846)): Fixes bug where sites with no menu locations can throw a php error in the MenuItemConnectionResolver. Thanks @markkelnar! + += 1.3.4 = + +**New Features** + +- ([#1834](https://github.com/wp-graphql/wp-graphql/pull/1834)): Adds new `rename_graphql_type` function that allows Types to be given a new name in the Schema. Thanks @kidunot89! +- ([#1830](https://github.com/wp-graphql/wp-graphql/pull/1830)): Adds new `rename_graphql_field_name` function that allows fields to be given re-named in the Schema. Thanks @kidunot89! + +**Chores / Bugfixes** + +- ([#1820](https://github.com/wp-graphql/wp-graphql/pull/1820)): Fixes bug where one test in the test suite wasn't executing properly. Thanks @markkelnar! +- ([#1817](https://github.com/wp-graphql/wp-graphql/pull/1817)): Fixes docker environment to allow xdebug to run. Thanks @markkelnar! +- ([#1833](https://github.com/wp-graphql/wp-graphql/pull/1833)): Allow specific Test Suites to be executed when running tests with Docker. Thanks @markkelnar! +- ([#1816](https://github.com/wp-graphql/wp-graphql/pull/1816)): Fixes bug where user roles without a name caused errors when building the Schema +- ([#1824](https://github.com/wp-graphql/wp-graphql/pull/1824)): Fixes bug where setting the role of tracing/query logs to "any" wasn't being respected. Thanks @toriphes! +- ([#1828](https://github.com/wp-graphql/wp-graphql/pull/1828)): Fixes bug with Term connection pagination ordering + + + += 1.3.3 = + +**Bugfixes / Chores** + +- ([#1806](https://github.com/wp-graphql/wp-graphql/pull/1806)): Fixes bug where databaseId couldn't be queried on the CommentAuthor type +- ([#1808](https://github.com/wp-graphql/wp-graphql/pull/1808)) & ([#1811](https://github.com/wp-graphql/wp-graphql/pull/1811)): Updates Schema descriptions across the board. Thanks @markkelnar! +- ([#1809](https://github.com/wp-graphql/wp-graphql/pull/1809)): Fixes bug where child terms couldn't properly be queried by URI. +- ([#1812](https://github.com/wp-graphql/wp-graphql/pull/1812)): Fixes bug where querying users in a site with many non-published authors can return 0 results. + += 1.3.2 = + +**Bugfix** + +- Fixes ([#1802](https://github.com/wp-graphql/wp-graphql/issues/1802)) by reversing a change to how initial post types and taxonomies are setup. + += 1.3.1 = + +**Bugfix** + +- patches a bug where default post types and taxonomies disappeared from the Schema + += 1.3.0 = + +**Notable changes** + +Between this release and the prior release ([v1.2.6](https://github.com/wp-graphql/wp-graphql/releases/tag/v1.2.6)) includes changes to pagination under the hood. + +While these releases correcting mistakes and buggy behavior, it's possible that workarounds have already been implemented either in the server or in client applications. + +For example, there was a bug with `start/end` cursors being reversed for backward pagination. + +If a client application were reversing the cursors to fix the issue, the reversal in the client will now _cause_ the issue. + +It's recommended to test your applications against this release, _specifically_ in regards to pagination. + +**Bugfixes / Chores** + +- ([#1797](https://github.com/wp-graphql/wp-graphql/pull/1797)): Update test environment to allow custom permalink structures to be better tested. Moves the "show_in_graphql" setup of core post types and taxonomies into the `register_post_type_args` and `register_taxonomy_args` filters instead of modifying global filters directly. +- ([#1794](https://github.com/wp-graphql/wp-graphql/pull/1794)): Cleanup to PHPStan config. Thanks @szepeviktor! +- ([#1795](https://github.com/wp-graphql/wp-graphql/pull/1795)) and ([#1793](https://github.com/wp-graphql/wp-graphql/pull/1793)): Don't throw errors when external urls are provided as input for queries that try and resolve by uri +- ([#1792](https://github.com/wp-graphql/wp-graphql/pull/1792)): Add missing descriptions to various fields in the Schema. Thanks @markkelnar! +- ([#1791](https://github.com/wp-graphql/wp-graphql/pull/1791)): Update where `WP_GRAPHQL_URL` is defined to follow recommendation from WordPress.org. +- ([#1784](https://github.com/wp-graphql/wp-graphql/pull/1784)): Fix `UsersConnectionSearchColumnEnum` to show the proper values that were accidentally replaced. +- ([#1781](https://github.com/wp-graphql/wp-graphql/pull/1781)): Fixes various bugs related to pagination. Between this release and the v1.2.6 release the following bugs have been worked on in regards to pagination: ([#1780](https://github.com/wp-graphql/wp-graphql/pull/1780), [#1411](https://github.com/wp-graphql/wp-graphql/pull/1411), [#1552](https://github.com/wp-graphql/wp-graphql/pull/1552), [#1714](https://github.com/wp-graphql/wp-graphql/pull/1714), [#1440](https://github.com/wp-graphql/wp-graphql/pull/1440)) + += 1.2.6 = + +**Bugfixes / Chores** + +- ([#1773](https://github.com/wp-graphql/wp-graphql/pull/1773)) Fixes multiple issues ([#1411](https://github.com/wp-graphql/wp-graphql/pull/1411), [#1440](https://github.com/wp-graphql/wp-graphql/pull/1440), [#1714](https://github.com/wp-graphql/wp-graphql/pull/1714), [#1552](https://github.com/wp-graphql/wp-graphql/pull/1552)) related to backward pagination . +- ([#1775](https://github.com/wp-graphql/wp-graphql/pull/1775)) Updates resolver for `MenuItem.children` connection to ensure the children belong to the same menu as well to prevent orphaned items from being returned. +- ([#1774](https://github.com/wp-graphql/wp-graphql/pull/1774)) Fixes bug where the `terms` connection wasn't properly being added to all Post Types that have taxonomy relationships. Thanks @toriphes! +- ([#1752](https://github.com/wp-graphql/wp-graphql/pull/1752)) Update documentation in README. Thanks @markkelnar! +- ([#1759](https://github.com/wp-graphql/wp-graphql/pull/1759)) Update WPGraphQL Includes method to be called only if composer install has been run. Helpful for contributors that have cloned the plugin locally. Thanks @rsm0128! +- ([#1760](https://github.com/wp-graphql/wp-graphql/pull/1760)) Fixes the `MediaItem.sizes` resolver. (see: [#1758](https://github.com/wp-graphql/wp-graphql/pull/1758)). Thanks @rsm0128! +- ([#1763](https://github.com/wp-graphql/wp-graphql/pull/1763)) Update `testVersion` in phpcs.xml to match required php version. Thanks @GaryJones! + += 1.2.5 = + +**Bugfixes / Chores** + +- ([#1748](https://github.com/wp-graphql/wp-graphql/pull/1748)) Fixes issue where installing the plugin in Trellis using Composer was causing the plugin not to load properly. + += 1.2.4 = + +**Bugfixes / Chores** + +- More work to fix Github -> SVN deploys. 🤦‍♂️ + += 1.2.3 = + +**Bugfixes / Chores** + +- Addresses bug (still) causing deploys to WordPress.org to fail and not include the vendor directory. + += 1.2.2 = + +**Bugfixes / Chores** + +- Fixes Github workflow to deploy to WordPress.org + += 1.2.1 = + +**Bugfixes / Chores** + +- ([#1741](https://github.com/wp-graphql/wp-graphql/pull/1741)) Fix issue with DefaultTemplate not being registered to the Schema and throwing errors when no other templates are registered. + += 1.2.0 = + +**New** + +- ([#1732](https://github.com/wp-graphql/wp-graphql/pull/1732)) Add `isPrivacyPage` to the Schema for the Page type. Thanks @Marco-Daniel! + +**Bugfixes / Chores** + +- ([#1734](https://github.com/wp-graphql/wp-graphql/pull/1734)) Remove Composer dependencies from being versioned in Github. Update Github workflows to install dependencies for deploying to WordPress.org and uploading release assets on Github. + += 1.1.8 = + +**Bugfixes / Chores** + +- Fix release asset url in Github action. + += 1.1.7 = + +**Bugfixes / Chores** + +- Fix release upload url in Github action. + += 1.1.6 = + +**Bugfixes / Chores** + +- ([#1723](https://github.com/wp-graphql/wp-graphql/pull/1723)) Fix CI Schema Linter action. Thanks @szepeviktor! +- ([#1722](https://github.com/wp-graphql/wp-graphql/pull/1722)) Update PR Template message. Thanks @szepeviktor! +- ([#1730](https://github.com/wp-graphql/wp-graphql/pull/1730)) Updates redundant test configuration in Github workflow. Thanks @szepeviktor! + += 1.1.5 = + +**Bugfixes / Chores** + +- ([#1718](https://github.com/wp-graphql/wp-graphql/pull/1718)) Simplify the main plugin file to adhere to more modern WP plugin standards. Move the WPGraphQL class to it's own file under the src directory. Thanks @szepeviktor! +- ([#1704](https://github.com/wp-graphql/wp-graphql/pull/1704)) Fix end tags for inputs on the WPGraphQL Settings page to adhere to the w3 spec for inputs. Thanks @therealgilles! +- ([#1706](https://github.com/wp-graphql/wp-graphql/pull/1706)) Show all content types in the ContentTypeEnum, not just public ones. Thanks @ljanecek! +- ([#1699](https://github.com/wp-graphql/wp-graphql/pull/1699)) Set default value for 2nd parameter on `Tracker->get_info()` method. Thanks @SpartakusMd! + += 1.1.4 = + +**Bugfixes** + +- ([#1715](https://github.com/wp-graphql/wp-graphql/pull/1715)) Updates `WPGraphQL\Type\Object` namespace to be `WPGraphQL\Type\ObjectType` to play nice with newer versions of PHP where `Object` is a reserved namespace. +- ([#1711](https://github.com/wp-graphql/wp-graphql/pull/1711)) Updates regex in phpstan.neon.dist. Thanks @szepeviktor! +- ([#1719](https://github.com/wp-graphql/wp-graphql/pull/1719)) Update to backtrace that is output with graphql_debug messages to ensure it includes a `file` key in the returned array, before returning the trace. Thanks @kidunot89! + += 1.1.3 = + +**Bugfixes** + +- ([#1693](https://github.com/wp-graphql/wp-graphql/pull/1693)) Clear global user in the Router in case plugins have attempted to set the user before API authentication has been executed. Thanks @therealgilles! + +**New** + +- ([#972](https://github.com/wp-graphql/wp-graphql/pull/972)) `graphql_pre_model_data_is_private` filter was added to the Abstract Model.php allowing Model's `is_private()` check to be bypassed. + + += 1.1.2 = + +**Bugfixes** + +- ([#1676](https://github.com/wp-graphql/wp-graphql/pull/1676)) Add a `nav_menu_item` loader to allow previous menu item IDs to work properly with WPGraphQL should they be passed to a node query (like, if the ID were persisted somewhere already) +- Update cases of menu item IDs to be `post:$id` instead of `nav_menu_item:$id` +- Update tests to test that both the old `nav_menu_item:$id` and `post:$id` work for nav menu item node queries to support previously issued IDs + += 1.1.1 = + +**Bugfixes** + +- ([#1670](https://github.com/wp-graphql/wp-graphql/issues/1670)) Fixes a bug with querying pages that are set as to be the posts page + += 1.1.0 = + +This release centers around updating code quality by implementing [PHPStan](https://phpstan.org/) checks. PHPStan is a tool that statically analyzes PHP codebases to detect bugs. This release centers around updating Docblocks and overall code quality, and implements automated tests to check code quality on every pull request. + +**New** + +- Update PHPStan (Code Quality checker) to v0.12.64 +- Increases PHPStan code quality checks to Level 8 (highest level). + +**Bugfixes** +- ([#1653](https://github.com/wp-graphql/wp-graphql/issues/1653)) Fixes bug where WPGraphQL was explicitly setting `has_published_posts` on WP_Query but WP_Query does this under the hood already. Thanks @jmartinhoj! +- Fixes issue with Comment Model returning comments that are not associated with a Post object. Comments with no associated Post object are not public entities. +- Update docblocks to be compatible with PHPStan Level 8. +- Removed some uncalled code +- Added early returns in some places to prevent unnecessary added execution + += 1.0.5 = + +**New** + +- Updates GraphQL-PHP from v14.3.0 to v14.4.0 +- Updates GraphQL-Relay-PHP from v0.3.1 to v0.5.0 + +**Bugfixes** + +- Fixes a bug where CI Tests were not passing when code coverage is enabled +- ([#1633](https://github.com/wp-graphql/wp-graphql/pull/1633)) Fixes bug where Introspection Queries were showing fields with no deprecationReason as deprecated because it was outputting an empty string instead of a null value. +- ([#1627](https://github.com/wp-graphql/wp-graphql/pull/1627)) Fixes bug where fields on the Model called multiple times might weren't being set properly +- Updates Theme tests to be more resilient for WP Core updates where new themes are introduced + += 1.0.4 = + +**Bugfixes** + +- Fixes a regression to previews introduced by v1.0.3 + += 1.0.3 = + +**Bugfixes** + +- ([#1623](https://github.com/wp-graphql/wp-graphql/pull/1623)): Queries for single posts will only return posts of that post_type +- ([#1624](https://github.com/wp-graphql/wp-graphql/pull/1624)): Passes Menu Item Labels through html_entity_decode + += 1.0.2 = + +**Bugfixes** + +- fix issue with using the count() function on potentially not-countable value +- fix bug where post_status was being checked instead of comment_status +- fix error message when restoring a comment doesn't work +- ([#1610](https://github.com/wp-graphql/wp-graphql/issues/1610)) fix check to see if current user has permission to update another Author's post. Thanks @maximilianschmidt! + + +**New Features** + +- ([#1608](https://github.com/wp-graphql/wp-graphql/pull/1608)) move connections from each post type->contentType to be ContentNode->ContentType. Thanks @jeanfredrik! +- pass status code through as a param of the `graphql_process_http_request_response` action +- add test for mutating other authors posts + += 1.0.1 = + +**Bugfixes** +- ([#1589](https://github.com/wp-graphql/wp-graphql/pull/1589)) Fixes a php type bug in TypeRegistry.php. Thanks @szepeviktor! +- [Fixes bug](https://github.com/wp-graphql/wp-graphql/compare/master...release/v1.0.1?expand=1#diff-74d71c4d1f9d84b9b0d946ca96eb875274f95d60611611d84cc01cdf6ed04021) with how GraphQL PHP Debug flags are set. +- ([#1598](https://github.com/wp-graphql/wp-graphql/pull/1598)) Fixes bug where Post Types registered with the same graphql_single_name and graphql_plural_name are the same value. +- ([#1615](https://github.com/wp-graphql/wp-graphql/issues/1615)) Fixes bug where fields added to the Schema that that were using get_post_meta() for Previews weren't always resolving properly. + +**New Features** +- Adds a setting to allow users to opt-in to tracking active installs of WPGraphQL. +- Removed old docs that used to be in this repo as markdown. Docs are now written in WordPress and the wpgraphql.com is a Gatsby site built from the content in WordPress and the [code in this repo](https://github.com/wp-graphql/wpgraphql.com). Looking to contribute content to the docs? Open an issue on this repo or the wpgraphql.com repo and we'll work with you to get content updated. We have future plans to allow the community to contribute by writing content in the WordPress install, but for now, Github issues will do. + += 1.0 = + +Public Stable Release. + +This release contains no technical changes. + +Read the announcement: [https://www.wpgraphql.com/2020/11/16/announcing-wpgraphql-v1/](https://www.wpgraphql.com/2020/11/16/announcing-wpgraphql-v1/) + +Previous release notes can be found on Github: [https://github.com/wp-graphql/wp-graphql/releases](https://github.com/wp-graphql/wp-graphql/releases) diff --git a/lib/wp-graphql-1.17.0/src/Admin/Admin.php b/lib/wp-graphql-1.17.0/src/Admin/Admin.php new file mode 100644 index 00000000..eff2c92e --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Admin/Admin.php @@ -0,0 +1,70 @@ +admin_enabled = apply_filters( 'graphql_show_admin', true ); + $this->graphiql_enabled = apply_filters( 'graphql_enable_graphiql', get_graphql_setting( 'graphiql_enabled', true ) ); + + // This removes the menu page for WPGraphiQL as it's now built into WPGraphQL + if ( $this->graphiql_enabled ) { + add_action( + 'admin_menu', + static function () { + remove_menu_page( 'wp-graphiql/wp-graphiql.php' ); + } + ); + } + + // If the admin is disabled, prevent admin from being scaffolded. + if ( false === $this->admin_enabled ) { + return; + } + + $this->settings = new Settings(); + $this->settings->init(); + + if ( 'on' === $this->graphiql_enabled || true === $this->graphiql_enabled ) { + global $graphiql; + $graphiql = new GraphiQL(); + $graphiql->init(); + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Admin/GraphiQL/GraphiQL.php b/lib/wp-graphql-1.17.0/src/Admin/GraphiQL/GraphiQL.php new file mode 100644 index 00000000..f733277f --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Admin/GraphiQL/GraphiQL.php @@ -0,0 +1,249 @@ +is_enabled = get_graphql_setting( 'graphiql_enabled' ) !== 'off'; + + /** + * If GraphiQL is disabled, don't set it up in the Admin + */ + if ( ! $this->is_enabled ) { + return; + } + + // Register the admin page + add_action( 'admin_menu', [ $this, 'register_admin_page' ], 9 ); + add_action( 'admin_bar_menu', [ $this, 'register_admin_bar_menu' ], 100 ); + // Enqueue GraphiQL React App + add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_graphiql' ] ); + + /** + * Enqueue extension styles and scripts + * + * These extensions are part of WPGraphiQL core, but were built in a way + * to showcase how extension APIs can be used to extend WPGraphiQL + */ + add_action( 'enqueue_graphiql_extension', [ $this, 'graphiql_enqueue_query_composer' ] ); + add_action( 'enqueue_graphiql_extension', [ $this, 'graphiql_enqueue_auth_switch' ] ); + add_action( 'enqueue_graphiql_extension', [ $this, 'graphiql_enqueue_fullscreen_toggle' ] ); + } + + /** + * Registers admin bar menu + * + * @param \WP_Admin_Bar $admin_bar The Admin Bar Instance + * + * @return void + */ + public function register_admin_bar_menu( WP_Admin_Bar $admin_bar ) { + if ( ! current_user_can( 'manage_options' ) || 'off' === get_graphql_setting( 'show_graphiql_link_in_admin_bar' ) ) { + return; + } + + $icon_url = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTcuNDY4IDMwMi42NmwtMTQuMzc2LTguMyAxNjAuMTUtMjc3LjM4IDE0LjM3NiA4LjN6Ii8+PHBhdGggZmlsbD0iI0UxMDA5OCIgZD0iTTM5LjggMjcyLjJoMzIwLjN2MTYuNkgzOS44eiIvPjxwYXRoIGZpbGw9IiNFMTAwOTgiIGQ9Ik0yMDYuMzQ4IDM3NC4wMjZsLTE2MC4yMS05Mi41IDguMy0xNC4zNzYgMTYwLjIxIDkyLjV6TTM0NS41MjIgMTMyLjk0N2wtMTYwLjIxLTkyLjUgOC4zLTE0LjM3NiAxNjAuMjEgOTIuNXoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTQuNDgyIDEzMi44ODNsLTguMy0xNC4zNzUgMTYwLjIxLTkyLjUgOC4zIDE0LjM3NnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzQyLjU2OCAzMDIuNjYzbC0xNjAuMTUtMjc3LjM4IDE0LjM3Ni04LjMgMTYwLjE1IDI3Ny4zOHpNNTIuNSAxMDcuNWgxNi42djE4NUg1Mi41ek0zMzAuOSAxMDcuNWgxNi42djE4NWgtMTYuNnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMjAzLjUyMiAzNjdsLTcuMjUtMTIuNTU4IDEzOS4zNC04MC40NSA3LjI1IDEyLjU1N3oiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzY5LjUgMjk3LjljLTkuNiAxNi43LTMxIDIyLjQtNDcuNyAxMi44LTE2LjctOS42LTIyLjQtMzEtMTIuOC00Ny43IDkuNi0xNi43IDMxLTIyLjQgNDcuNy0xMi44IDE2LjggOS43IDIyLjUgMzEgMTIuOCA0Ny43TTkwLjkgMTM3Yy05LjYgMTYuNy0zMSAyMi40LTQ3LjcgMTIuOC0xNi43LTkuNi0yMi40LTMxLTEyLjgtNDcuNyA5LjYtMTYuNyAzMS0yMi40IDQ3LjctMTIuOCAxNi43IDkuNyAyMi40IDMxIDEyLjggNDcuN00zMC41IDI5Ny45Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi44IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMzA5LjEgMTM3Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi43IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMjAwIDM5NS44Yy0xOS4zIDAtMzQuOS0xNS42LTM0LjktMzQuOSAwLTE5LjMgMTUuNi0zNC45IDM0LjktMzQuOSAxOS4zIDAgMzQuOSAxNS42IDM0LjkgMzQuOSAwIDE5LjItMTUuNiAzNC45LTM0LjkgMzQuOU0yMDAgNzRjLTE5LjMgMC0zNC45LTE1LjYtMzQuOS0zNC45IDAtMTkuMyAxNS42LTM0LjkgMzQuOS0zNC45IDE5LjMgMCAzNC45IDE1LjYgMzQuOSAzNC45IDAgMTkuMy0xNS42IDM0LjktMzQuOSAzNC45Ii8+PC9zdmc+'; + + $icon = sprintf( + '', + $icon_url + ); + + $admin_bar->add_menu( + [ + 'id' => 'graphiql-ide', + 'title' => $icon . __( 'GraphiQL IDE', 'wp-graphql' ), + 'href' => trailingslashit( admin_url() ) . 'admin.php?page=graphiql-ide', + ] + ); + } + + /** + * Register the admin page as a subpage + * + * @return void + */ + public function register_admin_page() { + + // Top level menu page should be labeled GraphQL + add_menu_page( + __( 'GraphQL', 'wp-graphql' ), + __( 'GraphQL', 'wp-graphql' ), + 'manage_options', + 'graphiql-ide', + [ $this, 'render_graphiql_admin_page' ], + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTcuNDY4IDMwMi42NmwtMTQuMzc2LTguMyAxNjAuMTUtMjc3LjM4IDE0LjM3NiA4LjN6Ii8+PHBhdGggZmlsbD0iI0UxMDA5OCIgZD0iTTM5LjggMjcyLjJoMzIwLjN2MTYuNkgzOS44eiIvPjxwYXRoIGZpbGw9IiNFMTAwOTgiIGQ9Ik0yMDYuMzQ4IDM3NC4wMjZsLTE2MC4yMS05Mi41IDguMy0xNC4zNzYgMTYwLjIxIDkyLjV6TTM0NS41MjIgMTMyLjk0N2wtMTYwLjIxLTkyLjUgOC4zLTE0LjM3NiAxNjAuMjEgOTIuNXoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTQuNDgyIDEzMi44ODNsLTguMy0xNC4zNzUgMTYwLjIxLTkyLjUgOC4zIDE0LjM3NnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzQyLjU2OCAzMDIuNjYzbC0xNjAuMTUtMjc3LjM4IDE0LjM3Ni04LjMgMTYwLjE1IDI3Ny4zOHpNNTIuNSAxMDcuNWgxNi42djE4NUg1Mi41ek0zMzAuOSAxMDcuNWgxNi42djE4NWgtMTYuNnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMjAzLjUyMiAzNjdsLTcuMjUtMTIuNTU4IDEzOS4zNC04MC40NSA3LjI1IDEyLjU1N3oiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzY5LjUgMjk3LjljLTkuNiAxNi43LTMxIDIyLjQtNDcuNyAxMi44LTE2LjctOS42LTIyLjQtMzEtMTIuOC00Ny43IDkuNi0xNi43IDMxLTIyLjQgNDcuNy0xMi44IDE2LjggOS43IDIyLjUgMzEgMTIuOCA0Ny43TTkwLjkgMTM3Yy05LjYgMTYuNy0zMSAyMi40LTQ3LjcgMTIuOC0xNi43LTkuNi0yMi40LTMxLTEyLjgtNDcuNyA5LjYtMTYuNyAzMS0yMi40IDQ3LjctMTIuOCAxNi43IDkuNyAyMi40IDMxIDEyLjggNDcuN00zMC41IDI5Ny45Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi44IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMzA5LjEgMTM3Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi43IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMjAwIDM5NS44Yy0xOS4zIDAtMzQuOS0xNS42LTM0LjktMzQuOSAwLTE5LjMgMTUuNi0zNC45IDM0LjktMzQuOSAxOS4zIDAgMzQuOSAxNS42IDM0LjkgMzQuOSAwIDE5LjItMTUuNiAzNC45LTM0LjkgMzQuOU0yMDAgNzRjLTE5LjMgMC0zNC45LTE1LjYtMzQuOS0zNC45IDAtMTkuMyAxNS42LTM0LjkgMzQuOS0zNC45IDE5LjMgMCAzNC45IDE1LjYgMzQuOSAzNC45IDAgMTkuMy0xNS42IDM0LjktMzQuOSAzNC45Ii8+PC9zdmc+' + ); + + // Sub menu should be labeled GraphiQL IDE + add_submenu_page( + 'graphiql-ide', + __( 'GraphiQL IDE', 'wp-graphql' ), + __( 'GraphiQL IDE', 'wp-graphql' ), + 'manage_options', + 'graphiql-ide', + [ $this, 'render_graphiql_admin_page' ] + ); + } + + /** + * Render the markup to load GraphiQL to. + * + * @return void + */ + public function render_graphiql_admin_page() { + $rendered = apply_filters( 'graphql_render_admin_page', '
Loading ...
' ); + + echo wp_kses_post( $rendered ); + } + + /** + * Enqueues the stylesheet and js for the WPGraphiQL app + * + * @return void + */ + public function enqueue_graphiql() { + if ( null === get_current_screen() || ! strpos( get_current_screen()->id, 'graphiql' ) ) { + return; + } + + $asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/index.asset.php'; + + // Setup some globals that can be used by GraphiQL + // and extending scripts + wp_enqueue_script( + 'wp-graphiql', // Handle. + WPGRAPHQL_PLUGIN_URL . 'build/index.js', + $asset_file['dependencies'], + $asset_file['version'], + true + ); + + $app_asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/app.asset.php'; + + wp_enqueue_script( + 'wp-graphiql-app', // Handle. + WPGRAPHQL_PLUGIN_URL . 'build/app.js', + array_merge( [ 'wp-graphiql' ], $app_asset_file['dependencies'] ), + $app_asset_file['version'], + true + ); + + wp_enqueue_style( + 'wp-graphiql-app', + WPGRAPHQL_PLUGIN_URL . 'build/app.css', + [ 'wp-components' ], + $app_asset_file['version'] + ); + + wp_localize_script( + 'wp-graphiql', + 'wpGraphiQLSettings', + [ + 'nonce' => wp_create_nonce( 'wp_rest' ), + 'graphqlEndpoint' => trailingslashit( site_url() ) . 'index.php?' . graphql_get_endpoint(), + 'avatarUrl' => 0 !== get_current_user_id() ? get_avatar_url( get_current_user_id() ) : null, + 'externalFragments' => apply_filters( 'graphiql_external_fragments', [] ), + ] + ); + + // Extensions looking to extend GraphiQL can hook in here, + // after the window object is established, but before the App renders + do_action( 'enqueue_graphiql_extension' ); + } + + /** + * Enqueue the GraphiQL Auth Switch extension, which adds a button to the GraphiQL toolbar + * that allows the user to switch between the logged in user and the current user + * + * @return void + */ + public function graphiql_enqueue_auth_switch() { + $auth_switch_asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/graphiqlAuthSwitch.asset.php'; + + wp_enqueue_script( + 'wp-graphiql-auth-switch', // Handle. + WPGRAPHQL_PLUGIN_URL . 'build/graphiqlAuthSwitch.js', + array_merge( [ 'wp-graphiql', 'wp-graphiql-app' ], $auth_switch_asset_file['dependencies'] ), + $auth_switch_asset_file['version'], + true + ); + } + + /** + * Enqueue the Query Composer extension, which adds a button to the GraphiQL toolbar + * that allows the user to open the Query Composer and compose a query with a form-based UI + * + * @return void + */ + public function graphiql_enqueue_query_composer() { + + // Enqueue the assets for the Explorer before enqueueing the app, + // so that the JS in the exporter that hooks into the app will be available + // by time the app is enqueued + $composer_asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/graphiqlQueryComposer.asset.php'; + + wp_enqueue_script( + 'wp-graphiql-query-composer', // Handle. + WPGRAPHQL_PLUGIN_URL . 'build/graphiqlQueryComposer.js', + array_merge( [ 'wp-graphiql', 'wp-graphiql-app' ], $composer_asset_file['dependencies'] ), + $composer_asset_file['version'], + true + ); + + wp_enqueue_style( + 'wp-graphiql-query-composer', + WPGRAPHQL_PLUGIN_URL . 'build/graphiqlQueryComposer.css', + [ 'wp-components' ], + $composer_asset_file['version'] + ); + } + + /** + * Enqueue the GraphiQL Fullscreen Toggle extension, which adds a button to the GraphiQL toolbar + * that allows the user to toggle the fullscreen mode + * + * @return void + */ + public function graphiql_enqueue_fullscreen_toggle() { + $fullscreen_toggle_asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/graphiqlFullscreenToggle.asset.php'; + + wp_enqueue_script( + 'wp-graphiql-fullscreen-toggle', // Handle. + WPGRAPHQL_PLUGIN_URL . 'build/graphiqlFullscreenToggle.js', + array_merge( [ 'wp-graphiql', 'wp-graphiql-app' ], $fullscreen_toggle_asset_file['dependencies'] ), + $fullscreen_toggle_asset_file['version'], + true + ); + + wp_enqueue_style( + 'wp-graphiql-fullscreen-toggle', + WPGRAPHQL_PLUGIN_URL . 'build/graphiqlFullscreenToggle.css', + [ 'wp-components' ], + $fullscreen_toggle_asset_file['version'] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Admin/Settings/Settings.php b/lib/wp-graphql-1.17.0/src/Admin/Settings/Settings.php new file mode 100644 index 00000000..cde654c9 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Admin/Settings/Settings.php @@ -0,0 +1,281 @@ +wp_environment = $this->get_wp_environment(); + $this->settings_api = new SettingsRegistry(); + + add_action( 'admin_menu', [ $this, 'add_options_page' ] ); + add_action( 'init', [ $this, 'register_settings' ] ); + add_action( 'admin_init', [ $this, 'initialize_settings_page' ] ); + add_action( 'admin_enqueue_scripts', [ $this, 'initialize_settings_page_scripts' ] ); + } + + /** + * Return the environment. Default to production. + * + * @return string The environment set using WP_ENVIRONMENT_TYPE. + */ + protected function get_wp_environment() { + if ( function_exists( 'wp_get_environment_type' ) ) { + return wp_get_environment_type(); + } + + return 'production'; + } + + /** + * Add the options page to the WP Admin + * + * @return void + */ + public function add_options_page() { + $graphiql_enabled = get_graphql_setting( 'graphiql_enabled' ); + + if ( 'off' === $graphiql_enabled ) { + add_menu_page( + __( 'WPGraphQL Settings', 'wp-graphql' ), + __( 'GraphQL', 'wp-graphql' ), + 'manage_options', + 'graphql-settings', + [ $this, 'render_settings_page' ], + 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTcuNDY4IDMwMi42NmwtMTQuMzc2LTguMyAxNjAuMTUtMjc3LjM4IDE0LjM3NiA4LjN6Ii8+PHBhdGggZmlsbD0iI0UxMDA5OCIgZD0iTTM5LjggMjcyLjJoMzIwLjN2MTYuNkgzOS44eiIvPjxwYXRoIGZpbGw9IiNFMTAwOTgiIGQ9Ik0yMDYuMzQ4IDM3NC4wMjZsLTE2MC4yMS05Mi41IDguMy0xNC4zNzYgMTYwLjIxIDkyLjV6TTM0NS41MjIgMTMyLjk0N2wtMTYwLjIxLTkyLjUgOC4zLTE0LjM3NiAxNjAuMjEgOTIuNXoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTQuNDgyIDEzMi44ODNsLTguMy0xNC4zNzUgMTYwLjIxLTkyLjUgOC4zIDE0LjM3NnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzQyLjU2OCAzMDIuNjYzbC0xNjAuMTUtMjc3LjM4IDE0LjM3Ni04LjMgMTYwLjE1IDI3Ny4zOHpNNTIuNSAxMDcuNWgxNi42djE4NUg1Mi41ek0zMzAuOSAxMDcuNWgxNi42djE4NWgtMTYuNnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMjAzLjUyMiAzNjdsLTcuMjUtMTIuNTU4IDEzOS4zNC04MC40NSA3LjI1IDEyLjU1N3oiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzY5LjUgMjk3LjljLTkuNiAxNi43LTMxIDIyLjQtNDcuNyAxMi44LTE2LjctOS42LTIyLjQtMzEtMTIuOC00Ny43IDkuNi0xNi43IDMxLTIyLjQgNDcuNy0xMi44IDE2LjggOS43IDIyLjUgMzEgMTIuOCA0Ny43TTkwLjkgMTM3Yy05LjYgMTYuNy0zMSAyMi40LTQ3LjcgMTIuOC0xNi43LTkuNi0yMi40LTMxLTEyLjgtNDcuNyA5LjYtMTYuNyAzMS0yMi40IDQ3LjctMTIuOCAxNi43IDkuNyAyMi40IDMxIDEyLjggNDcuN00zMC41IDI5Ny45Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi44IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMzA5LjEgMTM3Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi43IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMjAwIDM5NS44Yy0xOS4zIDAtMzQuOS0xNS42LTM0LjktMzQuOSAwLTE5LjMgMTUuNi0zNC45IDM0LjktMzQuOSAxOS4zIDAgMzQuOSAxNS42IDM0LjkgMzQuOSAwIDE5LjItMTUuNiAzNC45LTM0LjkgMzQuOU0yMDAgNzRjLTE5LjMgMC0zNC45LTE1LjYtMzQuOS0zNC45IDAtMTkuMyAxNS42LTM0LjkgMzQuOS0zNC45IDE5LjMgMCAzNC45IDE1LjYgMzQuOSAzNC45IDAgMTkuMy0xNS42IDM0LjktMzQuOSAzNC45Ii8+PC9zdmc+' + ); + } else { + add_submenu_page( + 'graphiql-ide', + __( 'WPGraphQL Settings', 'wp-graphql' ), + __( 'Settings', 'wp-graphql' ), + 'manage_options', + 'graphql-settings', + [ $this, 'render_settings_page' ] + ); + } + } + + /** + * Registers the initial settings for WPGraphQL + * + * @return void + */ + public function register_settings() { + $this->settings_api->register_section( + 'graphql_general_settings', + [ + 'title' => __( 'WPGraphQL General Settings', 'wp-graphql' ), + ] + ); + + $custom_endpoint = apply_filters( 'graphql_endpoint', null ); + $this->settings_api->register_field( + 'graphql_general_settings', + [ + 'name' => 'graphql_endpoint', + 'label' => __( 'GraphQL Endpoint', 'wp-graphql' ), + 'desc' => sprintf( + // translators: %1$s is the site url, %2$s is the default endpoint + __( 'The endpoint (path) for the GraphQL API on the site. %1$s/%2$s.
Note: Changing the endpoint to something other than "graphql" could have an affect on tooling in the GraphQL ecosystem', 'wp-graphql' ), + site_url(), + get_graphql_setting( 'graphql_endpoint', 'graphql' ) + ), + 'type' => 'text', + 'value' => ! empty( $custom_endpoint ) ? $custom_endpoint : null, + 'default' => ! empty( $custom_endpoint ) ? $custom_endpoint : 'graphql', + 'disabled' => ! empty( $custom_endpoint ), + 'sanitize_callback' => static function ( $value ) { + if ( empty( $value ) ) { + add_settings_error( 'graphql_endpoint', 'required', __( 'The "GraphQL Endpoint" field is required and cannot be blank. The default endpoint is "graphql"', 'wp-graphql' ), 'error' ); + + return 'graphql'; + } + + return $value; + }, + ] + ); + + $this->settings_api->register_fields( + 'graphql_general_settings', + [ + [ + 'name' => 'restrict_endpoint_to_logged_in_users', + 'label' => __( 'Restrict Endpoint to Authenticated Users', 'wp-graphql' ), + 'desc' => __( 'Limit the execution of GraphQL operations to authenticated requests. Non-authenticated requests to the GraphQL endpoint will not execute and will return an error.', 'wp-graphql' ), + 'type' => 'checkbox', + 'default' => 'off', + ], + [ + 'name' => 'batch_queries_enabled', + 'label' => __( 'Enable Batch Queries', 'wp-graphql' ), + 'desc' => __( 'WPGraphQL supports batch queries, or the ability to send multiple GraphQL operations in a single HTTP request. Batch requests are enabled by default.', 'wp-graphql' ), + 'type' => 'checkbox', + 'default' => 'on', + ], + [ + 'name' => 'batch_limit', + 'label' => __( 'Batch Query Limit', 'wp-graphql' ), + 'desc' => __( 'If Batch Queries are enabled, this value sets the max number of batch operations to allow per request. Requests containing more batch operations than allowed will be rejected before execution.', 'wp-graphql' ), + 'type' => 'number', + 'default' => 10, + ], + [ + 'name' => 'query_depth_enabled', + 'label' => __( 'Enable Query Depth Limiting', 'wp-graphql' ), + 'desc' => __( 'Enabling this will limit the depth of queries WPGraphQL will execute using the value of the Max Depth setting.', 'wp-graphql' ), + 'type' => 'checkbox', + 'default' => 'off', + ], + [ + 'name' => 'query_depth_max', + 'label' => __( 'Max Depth to allow for GraphQL Queries', 'wp-graphql' ), + 'desc' => __( 'If Query Depth limiting is enabled, this is the number of levels WPGraphQL will allow. Queries with deeper nesting will be rejected. Must be a positive integer value. Default 10.', 'wp-graphql' ), + 'type' => 'number', + 'default' => 10, + 'sanitize_callback' => static function ( $value ) { + // if the entered value is not a positive integer, default to 10 + if ( ! absint( $value ) ) { + $value = 10; + } + return absint( $value ); + }, + ], + [ + 'name' => 'graphiql_enabled', + 'label' => __( 'Enable GraphiQL IDE', 'wp-graphql' ), + 'desc' => __( 'GraphiQL IDE is a tool for exploring the GraphQL Schema and test GraphQL operations. Uncheck this to disable GraphiQL in the Dashboard.', 'wp-graphql' ), + 'type' => 'checkbox', + 'default' => 'on', + ], + [ + 'name' => 'show_graphiql_link_in_admin_bar', + 'label' => __( 'GraphiQL IDE Admin Bar Link', 'wp-graphql' ), + 'desc' => __( 'Show GraphiQL IDE Link in the WordPress Admin Bar', 'wp-graphql' ), + 'type' => 'checkbox', + 'default' => 'on', + ], + [ + 'name' => 'delete_data_on_deactivate', + 'label' => __( 'Delete Data on Deactivation', 'wp-graphql' ), + 'desc' => __( 'Delete settings and any other data stored by WPGraphQL upon de-activation of the plugin. Un-checking this will keep data after the plugin is de-activated.', 'wp-graphql' ), + 'type' => 'checkbox', + 'default' => 'on', + ], + [ + 'name' => 'debug_mode_enabled', + 'label' => __( 'Enable GraphQL Debug Mode', 'wp-graphql' ), + 'desc' => defined( 'GRAPHQL_DEBUG' ) + // translators: %s is the value of the GRAPHQL_DEBUG constant + ? sprintf( __( 'This setting is disabled. "GRAPHQL_DEBUG" has been set to "%s" with code', 'wp-graphql' ), GRAPHQL_DEBUG ? 'true' : 'false' ) + : __( 'Whether GraphQL requests should execute in "debug" mode. This setting is disabled if GRAPHQL_DEBUG is defined in wp-config.php.
This will provide more information in GraphQL errors but can leak server implementation details so this setting is NOT RECOMMENDED FOR PRODUCTION ENVIRONMENTS.', 'wp-graphql' ), + 'type' => 'checkbox', + 'value' => true === \WPGraphQL::debug() ? 'on' : get_graphql_setting( 'debug_mode_enabled', 'off' ), + 'disabled' => defined( 'GRAPHQL_DEBUG' ), + ], + [ + 'name' => 'tracing_enabled', + 'label' => __( 'Enable GraphQL Tracing', 'wp-graphql' ), + 'desc' => __( 'Adds trace data to the extensions portion of GraphQL responses. This can help identify bottlenecks for specific fields.', 'wp-graphql' ), + 'type' => 'checkbox', + 'default' => 'off', + ], + [ + 'name' => 'tracing_user_role', + 'label' => __( 'Tracing Role', 'wp-graphql' ), + 'desc' => __( 'If Tracing is enabled, this limits it to requests from users with the specified User Role.', 'wp-graphql' ), + 'type' => 'user_role_select', + 'default' => 'administrator', + ], + [ + 'name' => 'query_logs_enabled', + 'label' => __( 'Enable GraphQL Query Logs', 'wp-graphql' ), + 'desc' => __( 'Adds SQL Query logs to the extensions portion of GraphQL responses.
Note: This is a debug tool that can have an impact on performance and is not recommended to have active in production.', 'wp-graphql' ), + 'type' => 'checkbox', + 'default' => 'off', + ], + [ + 'name' => 'query_log_user_role', + 'label' => __( 'Query Log Role', 'wp-graphql' ), + 'desc' => __( 'If Query Logs are enabled, this limits them to requests from users with the specified User Role.', 'wp-graphql' ), + 'type' => 'user_role_select', + 'default' => 'administrator', + ], + [ + 'name' => 'public_introspection_enabled', + 'label' => __( 'Enable Public Introspection', 'wp-graphql' ), + 'desc' => sprintf( + // translators: %s is either empty or a string with a note about debug mode. + __( 'GraphQL Introspection is a feature that allows the GraphQL Schema to be queried. For Production and Staging environments, WPGraphQL will by default limit introspection queries to authenticated requests. Checking this enables Introspection for public requests, regardless of environment. %s ', 'wp-graphql' ), + true === \WPGraphQL::debug() ? '' . __( 'NOTE: This setting is force enabled because GraphQL Debug Mode is enabled. ', 'wp-graphql' ) . '' : '' + ), + 'type' => 'checkbox', + 'default' => ( 'local' === $this->get_wp_environment() || 'development' === $this->get_wp_environment() ) ? 'on' : 'off', + 'value' => true === \WPGraphQL::debug() ? 'on' : get_graphql_setting( 'public_introspection_enabled', 'off' ), + 'disabled' => true === \WPGraphQL::debug(), + ], + ] + ); + + // Action to hook into to register settings + do_action( 'graphql_register_settings', $this ); + } + + /** + * Initialize the settings admin page + * + * @return void + */ + public function initialize_settings_page() { + $this->settings_api->admin_init(); + } + + /** + * Initialize the styles and scripts used on the settings admin page + * + * @param string $hook_suffix The current admin page. + */ + public function initialize_settings_page_scripts( string $hook_suffix ): void { + $this->settings_api->admin_enqueue_scripts( $hook_suffix ); + } + + /** + * Render the settings page in the admin + * + * @return void + */ + public function render_settings_page() { + ?> +
+ settings_api->show_navigation(); + $this->settings_api->show_forms(); + ?> +
+ + * @link https://tareq.co Tareq Hasan + * + * @package WPGraphQL\Admin\Settings + */ +class SettingsRegistry { + + /** + * Settings sections array + * + * @var array + */ + protected $settings_sections = []; + + /** + * Settings fields array + * + * @var array + */ + protected $settings_fields = []; + + /** + * @return array + */ + public function get_settings_sections() { + return $this->settings_sections; + } + + /** + * @return array + */ + public function get_settings_fields() { + return $this->settings_fields; + } + + /** + * Enqueue scripts and styles + * + * @param string $hook_suffix The current admin page. + * + * @return void + */ + public function admin_enqueue_scripts( string $hook_suffix ) { + if ( 'graphql_page_graphql-settings' !== $hook_suffix ) { + return; + } + + wp_enqueue_style( 'wp-color-picker' ); + wp_enqueue_media(); + wp_enqueue_script( 'wp-color-picker' ); + wp_enqueue_script( 'jquery' ); + + // Action to enqueue scripts on the WPGraphQL Settings page. + do_action( 'graphql_settings_enqueue_scripts' ); + } + + /** + * Set settings sections + * + * @param string $slug Setting Section Slug + * @param array $section setting section config + * + * @return \WPGraphQL\Admin\Settings\SettingsRegistry + */ + public function register_section( string $slug, array $section ) { + $section['id'] = $slug; + $this->settings_sections[ $slug ] = $section; + + return $this; + } + + /** + * Register fields to a section + * + * @param string $section The slug of the section to register a field to + * @param array $fields settings fields array + * + * @return \WPGraphQL\Admin\Settings\SettingsRegistry + */ + public function register_fields( string $section, array $fields ) { + foreach ( $fields as $field ) { + $this->register_field( $section, $field ); + } + + return $this; + } + + /** + * Register a field to a section + * + * @param string $section The slug of the section to register a field to + * @param array $field The config for the field being registered + * + * @return \WPGraphQL\Admin\Settings\SettingsRegistry + */ + public function register_field( string $section, array $field ) { + $defaults = [ + 'name' => '', + 'label' => '', + 'desc' => '', + 'type' => 'text', + ]; + + $field_config = wp_parse_args( $field, $defaults ); + + // Get the field name before the filter is passed. + $field_name = $field_config['name']; + + // Unset it, as we don't want it to be filterable + unset( $field_config['name'] ); + + /** + * Filter the setting field config + * + * @param array $field_config The field config for the setting + * @param string $field_name The name of the field (unfilterable in the config) + * @param string $section The slug of the section the field is registered to + */ + $field = apply_filters( 'graphql_setting_field_config', $field_config, $field_name, $section ); + + // Add the field name back after the filter has been applied + $field['name'] = $field_name; + + // Add the field to the section + $this->settings_fields[ $section ][] = $field; + + return $this; + } + + /** + * Initialize and registers the settings sections and fields to WordPress + * + * Usually this should be called at `admin_init` hook. + * + * This function gets the initiated settings sections and fields. Then + * registers them to WordPress and ready for use. + * + * @return void + */ + public function admin_init() { + // Action that fires when settings are being initialized + do_action( 'graphql_init_settings', $this ); + + /** + * Filter the settings sections + * + * @param array $setting_sections The registered settings sections + */ + $setting_sections = apply_filters( 'graphql_settings_sections', $this->settings_sections ); + + foreach ( $setting_sections as $id => $section ) { + if ( false === get_option( $id ) ) { + add_option( $id ); + } + + if ( isset( $section['desc'] ) && ! empty( $section['desc'] ) ) { + $section['desc'] = '
' . $section['desc'] . '
'; + $callback = static function () use ( $section ) { + echo wp_kses( str_replace( '"', '\"', $section['desc'] ), Utils::get_allowed_wp_kses_html() ); + }; + } elseif ( isset( $section['callback'] ) ) { + $callback = $section['callback']; + } else { + $callback = null; + } + + add_settings_section( $id, $section['title'], $callback, $id ); + } + + //register settings fields + foreach ( $this->settings_fields as $section => $field ) { + foreach ( $field as $option ) { + $name = $option['name']; + $type = isset( $option['type'] ) ? $option['type'] : 'text'; + $label = isset( $option['label'] ) ? $option['label'] : ''; + $callback = isset( $option['callback'] ) ? $option['callback'] : [ + $this, + 'callback_' . $type, + ]; + + $args = [ + 'id' => $name, + 'class' => isset( $option['class'] ) ? $option['class'] : $name, + 'label_for' => "{$section}[{$name}]", + 'desc' => isset( $option['desc'] ) ? $option['desc'] : '', + 'name' => $label, + 'section' => $section, + 'size' => isset( $option['size'] ) ? $option['size'] : null, + 'options' => isset( $option['options'] ) ? $option['options'] : '', + 'std' => isset( $option['default'] ) ? $option['default'] : '', + 'sanitize_callback' => isset( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : '', + 'type' => $type, + 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : '', + 'min' => isset( $option['min'] ) ? $option['min'] : '', + 'max' => isset( $option['max'] ) ? $option['max'] : '', + 'step' => isset( $option['step'] ) ? $option['step'] : '', + 'disabled' => isset( $option['disabled'] ) ? (bool) $option['disabled'] : false, + 'value' => isset( $option['value'] ) ? $option['value'] : null, + ]; + + add_settings_field( "{$section}[{$name}]", $label, $callback, $section, $section, $args ); + } + } + + // creates our settings in the options table + foreach ( $this->settings_sections as $id => $section ) { + register_setting( $id, $id, [ $this, 'sanitize_options' ] ); + } + } + + /** + * Get field description for display + * + * @param array $args settings field args + * + * @return string + */ + public function get_field_description( array $args ): string { + if ( ! empty( $args['desc'] ) ) { + $desc = sprintf( '

%s

', $args['desc'] ); + } else { + $desc = ''; + } + + return $desc; + } + + /** + * Displays a text field for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_text( array $args ) { + $value = isset( $args['value'] ) && ! empty( $args['value'] ) ? esc_attr( $args['value'] ) : esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); + $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; + $type = isset( $args['type'] ) ? $args['type'] : 'text'; + $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"'; + $disabled = isset( $args['disabled'] ) && true === $args['disabled'] ? 'disabled' : null; + $html = sprintf( '', $type, $size, $args['section'], $args['id'], $value, $placeholder, $disabled ); + $html .= $this->get_field_description( $args ); + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a url field for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_url( array $args ) { + $this->callback_text( $args ); + } + + /** + * Displays a number field for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_number( array $args ) { + $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); + $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; + $type = isset( $args['type'] ) ? $args['type'] : 'number'; + $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"'; + $min = ( '' === $args['min'] ) ? '' : ' min="' . $args['min'] . '"'; + $max = ( '' === $args['max'] ) ? '' : ' max="' . $args['max'] . '"'; + $step = ( '' === $args['step'] ) ? '' : ' step="' . $args['step'] . '"'; + + $html = sprintf( '', $type, $size, $args['section'], $args['id'], $value, $placeholder, $min, $max, $step ); + $html .= $this->get_field_description( $args ); + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a checkbox for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_checkbox( array $args ) { + $value = isset( $args['value'] ) && ! empty( $args['value'] ) ? esc_attr( $args['value'] ) : esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); + $disabled = isset( $args['disabled'] ) && true === $args['disabled'] ? 'disabled' : null; + + $html = '
'; + $html .= sprintf( '', $args['desc'] ); + $html .= '
'; + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a multicheckbox for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_multicheck( array $args ) { + $value = $this->get_option( $args['id'], $args['section'], $args['std'] ); + $html = '
'; + $html .= sprintf( '', $args['section'], $args['id'] ); + foreach ( $args['options'] as $key => $label ) { + $checked = isset( $value[ $key ] ) ? $value[ $key ] : '0'; + $html .= sprintf( '
', $label ); + } + + $html .= $this->get_field_description( $args ); + $html .= '
'; + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a radio button for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_radio( array $args ) { + $value = $this->get_option( $args['id'], $args['section'], $args['std'] ); + $html = '
'; + + foreach ( $args['options'] as $key => $label ) { + $html .= sprintf( '
', $label ); + } + + $html .= $this->get_field_description( $args ); + $html .= '
'; + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a selectbox for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_select( array $args ) { + $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); + $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; + $html = sprintf( '' ); + $html .= $this->get_field_description( $args ); + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a textarea for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_textarea( array $args ) { + $value = esc_textarea( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); + $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; + $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"'; + + $html = sprintf( '', $size, $args['section'], $args['id'], $placeholder, $value ); + $html .= $this->get_field_description( $args ); + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays the html for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_html( array $args ) { + echo wp_kses( $this->get_field_description( $args ), Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a rich text textarea for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_wysiwyg( array $args ) { + $value = $this->get_option( $args['id'], $args['section'], $args['std'] ); + $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : '500px'; + + echo '
'; + + $editor_settings = [ + 'teeny' => true, + 'textarea_name' => $args['section'] . '[' . $args['id'] . ']', + 'textarea_rows' => 10, + ]; + + if ( isset( $args['options'] ) && is_array( $args['options'] ) ) { + $editor_settings = array_merge( $editor_settings, $args['options'] ); + } + + wp_editor( $value, $args['section'] . '-' . $args['id'], $editor_settings ); + + echo '
'; + + echo wp_kses( $this->get_field_description( $args ), Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a file upload field for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_file( array $args ) { + $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); + $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; + $label = isset( $args['options']['button_label'] ) ? $args['options']['button_label'] : __( 'Choose File', 'wp-graphql' ); + + $html = sprintf( '', $size, $args['section'], $args['id'], $value ); + $html .= ''; + $html .= $this->get_field_description( $args ); + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a password field for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_password( array $args ) { + $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); + $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; + + $html = sprintf( '', $size, $args['section'], $args['id'], $value ); + $html .= $this->get_field_description( $args ); + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Displays a color picker field for a settings field + * + * @param array $args settings field args + * + * @return void + */ + public function callback_color( $args ) { + $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); + $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; + + $html = sprintf( '', $size, $args['section'], $args['id'], $value, $args['std'] ); + $html .= $this->get_field_description( $args ); + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + + /** + * Displays a select box for creating the pages select box + * + * @param array $args settings field args + * + * @return void + */ + public function callback_pages( array $args ) { + $dropdown_args = array_merge( + [ + 'selected' => esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ), + 'name' => $args['section'] . '[' . $args['id'] . ']', + 'id' => $args['section'] . '[' . $args['id'] . ']', + 'echo' => 0, + ], + $args + ); + + $clean_args = []; + foreach ( $dropdown_args as $key => $arg ) { + $clean_args[ $key ] = wp_kses( $arg, Utils::get_allowed_wp_kses_html() ); + } + + // Ignore phpstan as this is providing an array as expected + // @phpstan-ignore-next-line + echo wp_dropdown_pages( $clean_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped + } + + /** + * Displays a select box for user roles + * + * @param array $args settings field args + * + * @return void + */ + public function callback_user_role_select( array $args ) { + $selected = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); + + if ( empty( $selected ) ) { + $selected = isset( $args['default'] ) ? $args['default'] : null; + } + + $name = $args['section'] . '[' . $args['id'] . ']'; + $id = $args['section'] . '[' . $args['id'] . ']'; + + echo ''; + echo wp_kses( $this->get_field_description( $args ), Utils::get_allowed_wp_kses_html() ); + } + + /** + * Sanitize callback for Settings API + * + * @param array $options + * + * @return mixed + */ + public function sanitize_options( array $options ) { + if ( ! $options ) { + return $options; + } + + foreach ( $options as $option_slug => $option_value ) { + $sanitize_callback = $this->get_sanitize_callback( $option_slug ); + + // If callback is set, call it + if ( $sanitize_callback ) { + $options[ $option_slug ] = call_user_func( $sanitize_callback, $option_value ); + continue; + } + } + + return $options; + } + + /** + * Get sanitization callback for given option slug + * + * @param string $slug option slug + * + * @return mixed string or bool false + */ + public function get_sanitize_callback( $slug = '' ) { + if ( empty( $slug ) ) { + return false; + } + + // Iterate over registered fields and see if we can find proper callback + foreach ( $this->settings_fields as $options ) { + foreach ( $options as $option ) { + if ( $slug !== $option['name'] ) { + continue; + } + + // Return the callback name + return isset( $option['sanitize_callback'] ) && is_callable( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : false; + } + } + + return false; + } + + /** + * Get the value of a settings field + * + * @param string $option settings field name + * @param string $section the section name this field belongs to + * @param string $default_value default text if it's not found + * + * @return string + */ + public function get_option( $option, $section, $default_value = '' ) { + $options = get_option( $section ); + + if ( isset( $options[ $option ] ) ) { + return $options[ $option ]; + } + + return $default_value; + } + + /** + * Show navigations as tab + * + * Shows all the settings section labels as tab + * + * @return void + */ + public function show_navigation() { + $html = ''; + + echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); + } + + /** + * Show the section settings forms + * + * This function displays every sections in a different form + * + * @return void + */ + public function show_forms() { + ?> +
+ settings_sections as $id => $form ) { ?> + + +
+ script(); + } + + /** + * Tabbable JavaScript codes & Initiate Color Picker + * + * This code uses localstorage for displaying active tabs + * + * @return void + */ + public function script() { + ?> + + _style_fix(); + } + + /** + * Add styles to adjust some settings + * + * @return void + */ + public function _style_fix() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore + global $wp_version; + + if ( version_compare( $wp_version, '3.8', '<=' ) ) : + ?> + + new CommentAuthorLoader( $this ), + 'comment' => new CommentLoader( $this ), + 'enqueued_script' => new EnqueuedScriptLoader( $this ), + 'enqueued_stylesheet' => new EnqueuedStylesheetLoader( $this ), + 'plugin' => new PluginLoader( $this ), + 'nav_menu_item' => new PostObjectLoader( $this ), + 'post' => new PostObjectLoader( $this ), + 'post_type' => new PostTypeLoader( $this ), + 'taxonomy' => new TaxonomyLoader( $this ), + 'term' => new TermObjectLoader( $this ), + 'theme' => new ThemeLoader( $this ), + 'user' => new UserLoader( $this ), + 'user_role' => new UserRoleLoader( $this ), + ]; + + /** + * This filters the data loaders, allowing for additional loaders to be + * added to the AppContext or for existing loaders to be replaced if + * needed. + * + * @params array $loaders The loaders accessible in the AppContext + * @params AppContext $this The AppContext + */ + $this->loaders = apply_filters( 'graphql_data_loaders', $loaders, $this ); + + /** + * This sets up the NodeResolver to allow nodes to be resolved by URI + * + * @param \WPGraphQL\AppContext $app_context The AppContext instance + */ + $this->node_resolver = new NodeResolver( $this ); + + /** + * This filters the config for the AppContext. + * + * This can be used to store additional context config, which is available to resolvers + * throughout the resolution of a GraphQL request. + * + * @params array $config The config array of the AppContext object + */ + $this->config = apply_filters( 'graphql_app_context_config', $this->config ); + } + + /** + * Retrieves loader assigned to $key + * + * @param string $key The name of the loader to get + * + * @return mixed + * + * @deprecated Use get_loader instead. + */ + public function getLoader( $key ) { + _deprecated_function( __METHOD__, '0.8.4', self::class . '::get_loader()' ); + return $this->get_loader( $key ); + } + + /** + * Retrieves loader assigned to $key + * + * @param string $key The name of the loader to get + * + * @return mixed + */ + public function get_loader( $key ) { + if ( ! array_key_exists( $key, $this->loaders ) ) { + // translators: %s is the key of the loader that was not found. + throw new UserError( esc_html( sprintf( __( 'No loader assigned to the key %s', 'wp-graphql' ), $key ) ) ); + } + + return $this->loaders[ $key ]; + } + + /** + * Returns the $args for the connection the field is a part of + * + * @deprecated use get_connection_args() instead + * @return array|mixed + */ + public function getConnectionArgs() { + _deprecated_function( __METHOD__, '0.8.4', self::class . '::get_connection_args()' ); + return $this->get_connection_args(); + } + + /** + * Returns the $args for the connection the field is a part of + * + * @return array|mixed + */ + public function get_connection_args() { + return isset( $this->currentConnection ) && isset( $this->connectionArgs[ $this->currentConnection ] ) ? $this->connectionArgs[ $this->currentConnection ] : []; + } + + /** + * Returns the current connection + * + * @return mixed|null|String + */ + public function get_current_connection() { + return isset( $this->currentConnection ) ? $this->currentConnection : null; + } + + /** + * @return mixed|null|String + * @deprecated use get_current_connection instead. + */ + public function getCurrentConnection() { + return $this->get_current_connection(); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Connection/Comments.php b/lib/wp-graphql-1.17.0/src/Connection/Comments.php new file mode 100644 index 00000000..acb0351b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Connection/Comments.php @@ -0,0 +1,38 @@ + 1, + * 'comment_author' => 'admin', + * 'comment_author_email' => 'admin@admin.com', + * 'comment_author_url' => 'http://', + * 'comment_content' => 'content here', + * 'comment_type' => '', + * 'comment_parent' => 0, + * 'comment_date' => $time, + * 'comment_approved' => 1, + */ + + $user = self::get_comment_author( $input['authorEmail'] ?? null ); + + if ( false !== $user ) { + $output_args['user_id'] = $user->ID; + + $input['author'] = ! empty( $input['author'] ) ? $input['author'] : $user->display_name; + $input['authorEmail'] = ! empty( $input['authorEmail'] ) ? $input['authorEmail'] : $user->user_email; + $input['authorUrl'] = ! empty( $input['authorUrl'] ) ? $input['authorUrl'] : $user->user_url; + } + + if ( empty( $input['author'] ) ) { + if ( ! $update ) { + throw new UserError( esc_html__( 'Comment must include an authorName.', 'wp-graphql' ) ); + } + } else { + $output_args['comment_author'] = $input['author']; + } + + if ( ! empty( $input['authorEmail'] ) ) { + if ( false === is_email( apply_filters( 'pre_user_email', $input['authorEmail'] ) ) ) { + throw new UserError( esc_html__( 'The email address you are trying to use is invalid', 'wp-graphql' ) ); + } + $output_args['comment_author_email'] = $input['authorEmail']; + } + + if ( ! empty( $input['authorUrl'] ) ) { + $output_args['comment_author_url'] = $input['authorUrl']; + } + + if ( ! empty( $input['commentOn'] ) ) { + $output_args['comment_post_ID'] = $input['commentOn']; + } + + if ( ! empty( $input['date'] ) && false !== strtotime( $input['date'] ) ) { + $output_args['comment_date'] = gmdate( 'Y-m-d H:i:s', strtotime( $input['date'] ) ); + } + + if ( ! empty( $input['content'] ) ) { + $output_args['comment_content'] = $input['content']; + } + + if ( ! empty( $input['parent'] ) ) { + $output_args['comment_parent'] = Utils::get_database_id_from_id( $input['parent'] ); + } + + if ( ! empty( $input['type'] ) ) { + $output_args['comment_type'] = $input['type']; + } + + if ( ! empty( $input['status'] ) ) { + $output_args['comment_approved'] = $input['status']; + } + + // Fallback to deprecated `approved` input. + if ( empty( $output_args['comment_approved'] ) && isset( $input['approved'] ) ) { + $output_args['comment_approved'] = $input['approved']; + } + + /** + * Filter the $insert_post_args + * + * @param array $output_args The array of $input_post_args that will be passed to wp_new_comment + * @param array $input The data that was entered as input for the mutation + * @param string $mutation_type The type of mutation being performed ( create, edit, etc ) + */ + $output_args = apply_filters( 'graphql_comment_insert_post_args', $output_args, $input, $mutation_name ); + + return $output_args; + } + + /** + * This updates commentmeta. + * + * @param int $comment_id The ID of the postObject the comment is connected to + * @param array $input The input for the mutation + * @param string $mutation_name The name of the mutation ( ex: create, update, delete ) + * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers + * + * @return void + */ + public static function update_additional_comment_data( int $comment_id, array $input, string $mutation_name, AppContext $context, ResolveInfo $info ) { + + /** + * @todo: should account for authentication + */ + $intended_comment_status = 0; + $default_comment_status = 0; + + do_action( 'graphql_comment_object_mutation_update_additional_data', $comment_id, $input, $mutation_name, $context, $info, $intended_comment_status, $default_comment_status ); + } + + /** + * Gets the user object for the comment author. + * + * @param ?string $author_email The authorEmail provided to the mutation input. + * + * @return \WP_User|false + */ + protected static function get_comment_author( string $author_email = null ) { + $user = wp_get_current_user(); + + // Fail if no logged in user. + if ( 0 === $user->ID ) { + return false; + } + + // Return the current user if they can only handle their own comments or if there's no specified author. + if ( empty( $author_email ) || ! $user->has_cap( 'moderate_comments' ) ) { + return $user; + } + + $author = get_user_by( 'email', $author_email ); + + return ! empty( $author->ID ) ? $author : false; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Config.php b/lib/wp-graphql-1.17.0/src/Data/Config.php new file mode 100644 index 00000000..978a2964 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Config.php @@ -0,0 +1,477 @@ +get( 'suppress_filters' ) ) { + $query->set( 'suppress_filters', 0 ); + } + + if ( ! $query->get( 'suppress_filters' ) ) { + + /** + * Filters the WHERE clause of the query. + * + * Specifically for manipulating paging queries. + ** + * + * @param string $where The WHERE clause of the query. + * @param \WPGraphQL\Data\WP_User_Query $query The WP_User_Query instance (passed by reference). + */ + $query->query_where = apply_filters_ref_array( + 'graphql_users_where', + [ + $query->query_where, + &$query, + ] + ); + + /** + * Filters the ORDER BY clause of the query. + * + * @param string $orderby The ORDER BY clause of the query. + * @param \WPGraphQL\Data\WP_User_Query $query The WP_User_Query instance (passed by reference). + */ + $query->query_orderby = apply_filters_ref_array( + 'graphql_users_orderby', + [ + $query->query_orderby, + &$query, + ] + ); + } + + return $query; + } + ); + + /** + * Filter the WP_User_Query to support cursor based pagination where a user ID can be used + * as a point of comparison when slicing the results to return. + */ + add_filter( + 'graphql_users_where', + [ + $this, + 'graphql_wp_user_query_cursor_pagination_support', + ], + 10, + 2 + ); + + /** + * Filter WP_User_Query order by add some stability to meta query ordering + */ + add_filter( + 'graphql_users_orderby', + [ + $this, + 'graphql_wp_user_query_cursor_pagination_stability', + ], + 10, + 2 + ); + } + + /** + * When posts are ordered by fields that have duplicate values, we need to consider + * another field to "stabilize" the query order. We use IDs as they're always unique. + * + * This allows for posts with the same title or same date or same meta value to exist + * and for their cursors to properly go forward/backward to the proper place in the database. + * + * @param string $orderby The ORDER BY clause of the query. + * @param \WP_Query $query The WP_Query instance executing. + * + * @return string + */ + public function graphql_wp_query_cursor_pagination_stability( string $orderby, WP_Query $query ) { + // Bail early if it's not a GraphQL Request. + if ( true !== is_graphql_request() ) { + return $orderby; + } + + /** + * If pre-filter hooked, return $pre_orderby. + * + * @param null|string $pre_orderby The pre-filtered ORDER BY clause of the query. + * @param string $orderby The ORDER BY clause of the query. + * @param \WP_Query $query The WP_Query instance (passed by reference). + * + * @return null|string + */ + $pre_orderby = apply_filters( 'graphql_pre_wp_query_cursor_pagination_stability', null, $orderby, $query ); + if ( null !== $pre_orderby ) { + return $pre_orderby; + } + + // Bail early if disabled by connection. + if ( isset( $query->query_vars['graphql_apply_cursor_pagination_orderby'] ) + && false === $query->query_vars['graphql_apply_cursor_pagination_orderby'] ) { + return $orderby; + } + + // Bail early if the cursor "graphql_cursor_compare" arg is not in the query, + if ( ! isset( $query->query_vars['graphql_cursor_compare'] ) ) { + return $orderby; + } + + // Check the cursor compare order + $order = '>' === $query->query_vars['graphql_cursor_compare'] ? 'ASC' : 'DESC'; + + // Get Cursor ID key. + $cursor = new PostObjectCursor( $query->query_vars ); + $key = $cursor->get_cursor_id_key(); + + // If there is a cursor compare in the arguments, use it as the stablizer for cursors. + return "{$orderby}, {$key} {$order}"; + } + + /** + * This filters the WPQuery 'where' $args, enforcing the query to return results before or + * after the referenced cursor + * + * @param string $where The WHERE clause of the query. + * @param \WP_Query $query The WP_Query instance (passed by reference). + * + * @return string + */ + public function graphql_wp_query_cursor_pagination_support( string $where, WP_Query $query ) { + // Bail early if it's not a GraphQL Request. + if ( true !== is_graphql_request() ) { + return $where; + } + + /** + * If pre-filter hooked, return $pre_where. + * + * @param null|string $pre_where The pre-filtered WHERE clause of the query. + * @param string $where The WHERE clause of the query. + * @param \WP_Query $query The WP_Query instance (passed by reference). + * + * @return null|string + */ + $pre_where = apply_filters( 'graphql_pre_wp_query_cursor_pagination_support', null, $where, $query ); + if ( null !== $pre_where ) { + return $pre_where; + } + + // Bail early if disabled by connection. + if ( isset( $query->query_vars['graphql_apply_cursor_pagination_where'] ) + && false === $query->query_vars['graphql_apply_cursor_pagination_where'] ) { + return $where; + } + + // Apply the after cursor, moving forward through results + if ( ! empty( $query->query_vars['graphql_after_cursor'] ) ) { + $after_cursor = new PostObjectCursor( $query->query_vars, 'after' ); + $where .= $after_cursor->get_where(); + } + + // Apply the after cursor, moving backward through results. + if ( ! empty( $query->query_vars['graphql_before_cursor'] ) ) { + $before_cursor = new PostObjectCursor( $query->query_vars, 'before' ); + $where .= $before_cursor->get_where(); + } + + return $where; + } + + /** + * When users are ordered by a meta query the order might be random when + * the meta values have same values multiple times. This filter adds a + * secondary ordering by the post ID which forces stable order in such cases. + * + * @param string $orderby The ORDER BY clause of the query. + * + * @return string + */ + public function graphql_wp_user_query_cursor_pagination_stability( $orderby, \WP_User_Query $query ) { + + // Bail early if it's not a GraphQL Request. + if ( true !== is_graphql_request() ) { + return $orderby; + } + + /** + * If pre-filter hooked, return $pre_orderby. + * + * @param null|string $pre_orderby The pre-filtered ORDER BY clause of the query. + * @param string $orderby The ORDER BY clause of the query. + * @param \WP_User_Query $query The WP_User_Query instance (passed by reference). + * + * @return null|string + */ + $pre_orderby = apply_filters( 'graphql_pre_wp_user_query_cursor_pagination_stability', null, $orderby, $query ); + if ( null !== $pre_orderby ) { + return $pre_orderby; + } + + // Bail early if disabled by connection. + if ( isset( $query->query_vars['graphql_apply_cursor_pagination_orderby'] ) + && false === $query->query_vars['graphql_apply_cursor_pagination_orderby'] ) { + return $orderby; + } + + // Bail early if the cursor "graphql_cursor_compare" arg is not in the query, + if ( ! isset( $query->query_vars['graphql_cursor_compare'] ) ) { + return $orderby; + } + + // Check the cursor compare order + $order = '>' === $query->query_vars['graphql_cursor_compare'] ? 'ASC' : 'DESC'; + + // Get Cursor ID key. + $cursor = new UserCursor( $query->query_vars ); + $key = $cursor->get_cursor_id_key(); + + return "{$orderby}, {$key} {$order}"; + } + + /** + * This filters the WP_User_Query 'where' $args, enforcing the query to return results before or + * after the referenced cursor + * + * @param string $where The WHERE clause of the query. + * @param \WP_User_Query $query The WP_User_Query instance (passed by reference). + * + * @return string + */ + public function graphql_wp_user_query_cursor_pagination_support( $where, \WP_User_Query $query ) { + + // Bail early if it's not a GraphQL Request. + if ( true !== is_graphql_request() ) { + return $where; + } + + /** + * If pre-filter hooked, return $pre_where. + * + * @param null|string $pre_where The pre-filtered WHERE clause of the query. + * @param string $where The WHERE clause of the query. + * @param \WP_User_Query $query The WP_Query instance (passed by reference). + * + * @return null|string + */ + $pre_where = apply_filters( 'graphql_pre_wp_user_query_cursor_pagination_support', null, $where, $query ); + if ( null !== $pre_where ) { + return $pre_where; + } + + // Bail early if disabled by connection. + if ( isset( $query->query_vars['graphql_apply_cursor_pagination_where'] ) + && false === $query->query_vars['graphql_apply_cursor_pagination_where'] ) { + return $where; + } + + // Apply the after cursor. + if ( ! empty( $query->query_vars['graphql_after_cursor'] ) ) { + $after_cursor = new UserCursor( $query->query_vars, 'after' ); + $where = $where . $after_cursor->get_where(); + } + + // Apply the after cursor. + if ( ! empty( $query->query_vars['graphql_before_cursor'] ) ) { + $before_cursor = new UserCursor( $query->query_vars, 'before' ); + $where = $where . $before_cursor->get_where(); + } + + return $where; + } + + /** + * This filters the term_clauses in the WP_Term_Query to support cursor based pagination, where + * we can move forward or backward from a particular record, instead of typical offset + * pagination which can be much more expensive and less accurate. + * + * @param array $pieces Terms query SQL clauses. + * @param array $taxonomies An array of taxonomies. + * @param array $args An array of terms query arguments. + * + * @return array $pieces + */ + public function graphql_wp_term_query_cursor_pagination_support( array $pieces, array $taxonomies, array $args ) { + + // Bail early if it's not a GraphQL Request. + if ( true !== is_graphql_request() ) { + return $pieces; + } + + /** + * If pre-filter hooked, return $pre_pieces. + * + * @param null|array $pre_pieces The pre-filtered term query SQL clauses. + * @param array $pieces Terms query SQL clauses. + * @param array $taxonomies An array of taxonomies. + * @param array $args An array of terms query arguments. + * + * @return null|array + */ + $pre_pieces = apply_filters( 'graphql_pre_wp_term_query_cursor_pagination_support', null, $pieces, $taxonomies, $args ); + if ( null !== $pre_pieces ) { + return $pre_pieces; + } + + // Bail early if disabled by connection. + if ( isset( $args['graphql_apply_cursor_pagination_where'] ) + && false === $args['graphql_apply_cursor_pagination_where'] ) { + return $pieces; + } + + // Bail early if the cursor "graphql_cursor_compare" arg is not in the query, + if ( ! isset( $args['graphql_cursor_compare'] ) ) { + return $pieces; + } + + // Determine the limit for the query + if ( isset( $args['number'] ) && absint( $args['number'] ) ) { + $pieces['limits'] = sprintf( ' LIMIT 0, %d', absint( $args['number'] ) ); + } + + // Apply the after cursor. + if ( ! empty( $args['graphql_after_cursor'] ) ) { + $after_cursor = new TermObjectCursor( $args, 'after' ); + $pieces['where'] = $pieces['where'] . $after_cursor->get_where(); + } + + // Apply the before cursor. + if ( ! empty( $args['graphql_before_cursor'] ) ) { + $before_cursor = new TermObjectCursor( $args, 'before' ); + $pieces['where'] = $pieces['where'] . $before_cursor->get_where(); + } + + return $pieces; + } + + /** + * This returns a modified version of the $pieces of the comment query clauses if the request + * is a GraphQL Request and before or after cursors are passed to the query + * + * @param array $pieces A compacted array of comment query clauses. + * @param \WP_Comment_Query $query Current instance of WP_Comment_Query, passed by reference. + * + * @return array $pieces + */ + public function graphql_wp_comments_query_cursor_pagination_support( array $pieces, WP_Comment_Query $query ) { + + // Bail early if it's not a GraphQL Request. + if ( true !== is_graphql_request() ) { + return $pieces; + } + + /** + * If pre-filter hooked, return $pre_pieces. + * + * @param null|array $pre_pieces The pre-filtered comment query clauses. + * @param array $pieces A compacted array of comment query clauses. + * @param \WP_Comment_Query $query Current instance of WP_Comment_Query, passed by reference. + * + * @return null|array + */ + $pre_pieces = apply_filters( 'graphql_pre_wp_comments_query_cursor_pagination_support', null, $pieces, $query ); + if ( null !== $pre_pieces ) { + return $pre_pieces; + } + + // Bail early if disabled by connection. + if ( isset( $query->query_vars['graphql_apply_cursor_pagination_where'] ) + && false === $query->query_vars['graphql_apply_cursor_pagination_where'] ) { + return $pieces; + } + + // Apply the after cursor, moving forward through results. + if ( ! empty( $query->query_vars['graphql_after_cursor'] ) ) { + $after_cursor = new CommentObjectCursor( $query->query_vars, 'after' ); + $pieces['where'] .= $after_cursor->get_where(); + } + + // Apply the after cursor, moving backward through results. + if ( ! empty( $query->query_vars['graphql_before_cursor'] ) ) { + $before_cursor = new CommentObjectCursor( $query->query_vars, 'before' ); + $pieces['where'] .= $before_cursor->get_where(); + } + + return $pieces; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/AbstractConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/AbstractConnectionResolver.php new file mode 100644 index 00000000..fa6bfb25 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/AbstractConnectionResolver.php @@ -0,0 +1,1030 @@ +query_args ); + * return new WP_Comment_Query( $this->query_args ); + * return new WP_Term_Query( $this->query_args ); + * + * Whatever it is will be passed through filters so that fields throughout + * have context from what was queried and can make adjustments as needed, such + * as exposing `totalCount` in pageInfo, etc. + * + * @var mixed + */ + protected $query; + + /** + * @var array + */ + protected $items; + + /** + * @var array + */ + protected $ids; + + /** + * @var array + */ + protected $nodes; + + /** + * @var array + */ + protected $edges; + + /** + * @var int + */ + protected $query_amount; + + /** + * ConnectionResolver constructor. + * + * @param mixed $source source passed down from the resolve tree + * @param array $args array of arguments input in the field as part of the GraphQL + * query + * @param \WPGraphQL\AppContext $context Object containing app context that gets passed down the resolve + * tree + * @param \GraphQL\Type\Definition\ResolveInfo $info Info about fields passed down the resolve tree + * + * @throws \Exception + */ + public function __construct( $source, array $args, AppContext $context, ResolveInfo $info ) { + + // Bail if the Post->ID is empty, as that indicates a private post. + if ( $source instanceof Post && empty( $source->ID ) ) { + $this->should_execute = false; + } + + /** + * Set the source (the root object) for the resolver + */ + $this->source = $source; + + /** + * Set the context of the resolver + */ + $this->context = $context; + + /** + * Set the resolveInfo for the resolver + */ + $this->info = $info; + + /** + * Get the loader for the Connection + */ + $this->loader = $this->getLoader(); + + /** + * Set the args for the resolver + */ + $this->args = $args; + + /** + * + * Filters the GraphQL args before they are used in get_query_args(). + * + * @param array $args The GraphQL args passed to the resolver. + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the ConnectionResolver. + * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. + * + * @since 1.11.0 + */ + $this->args = apply_filters( 'graphql_connection_args', $this->get_args(), $this, $args ); + + /** + * Determine the query amount for the resolver. + * + * This is the amount of items to query from the database. We determine this by + * determining how many items were asked for (first/last), then compare with the + * max amount allowed to query (default is 100), and then we fetch 1 more than + * that amount, so we know whether hasNextPage/hasPreviousPage should be true. + * + * If there are more items than were asked for, then there's another page. + */ + $this->query_amount = $this->get_query_amount(); + + /** + * Get the Query Args. This accepts the input args and maps it to how it should be + * used in the WP_Query + * + * Filters the args + * + * @param array $query_args The query args to be used with the executable query to get data. + * This should take in the GraphQL args and return args for use in fetching the data. + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the ConnectionResolver + * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. + */ + $this->query_args = apply_filters( 'graphql_connection_query_args', $this->get_query_args(), $this, $args ); + } + + /** + * Returns the source of the connection + * + * @return mixed + */ + public function getSource() { + return $this->source; + } + + /** + * Get the loader name + * + * @return \WPGraphQL\Data\Loader\AbstractDataLoader + * @throws \Exception + */ + protected function getLoader() { + $name = $this->get_loader_name(); + if ( empty( $name ) || ! is_string( $name ) ) { + throw new Exception( esc_html__( 'The Connection Resolver needs to define a loader name', 'wp-graphql' ) ); + } + + return $this->context->get_loader( $name ); + } + + /** + * Returns the $args passed to the connection + * + * @deprecated Deprecated since v1.11.0 in favor of $this->get_args(); + * + * @codeCoverageIgnore + */ + public function getArgs(): array { + _deprecated_function( __METHOD__, '1.11.0', static::class . '::get_args()' ); + return $this->get_args(); + } + + /** + * Returns the $args passed to the connection. + * + * Useful for modifying the $args before they are passed to $this->get_query_args(). + * + * @return array + */ + public function get_args(): array { + return $this->args; + } + + /** + * Returns the AppContext of the connection + * + * @return \WPGraphQL\AppContext + */ + public function getContext(): AppContext { + return $this->context; + } + + /** + * Returns the ResolveInfo of the connection + * + * @return \GraphQL\Type\Definition\ResolveInfo + */ + public function getInfo(): ResolveInfo { + return $this->info; + } + + /** + * Returns whether the connection should execute + * + * @return bool + */ + public function getShouldExecute(): bool { + return $this->should_execute; + } + + /** + * @param string $key The key of the query arg to set + * @param mixed $value The value of the query arg to set + * + * @return \WPGraphQL\Data\Connection\AbstractConnectionResolver + * + * @deprecated 0.3.0 + * + * @codeCoverageIgnore + */ + public function setQueryArg( $key, $value ) { + _deprecated_function( __METHOD__, '0.3.0', static::class . '::set_query_arg()' ); + + return $this->set_query_arg( $key, $value ); + } + + /** + * Given a key and value, this sets a query_arg which will modify the query_args used by + * the connection resolvers get_query(); + * + * @param string $key The key of the query arg to set + * @param mixed $value The value of the query arg to set + * + * @return \WPGraphQL\Data\Connection\AbstractConnectionResolver + */ + public function set_query_arg( $key, $value ) { + $this->query_args[ $key ] = $value; + + return $this; + } + + /** + * Whether the connection should resolve as a one-to-one connection. + * + * @return \WPGraphQL\Data\Connection\AbstractConnectionResolver + */ + public function one_to_one() { + $this->one_to_one = true; + + return $this; + } + + /** + * Get_loader_name + * + * Return the name of the loader to be used with the connection resolver + * + * @return string + */ + abstract public function get_loader_name(); + + /** + * Get_query_args + * + * This method is used to accept the GraphQL Args input to the connection and return args + * that can be used in the Query to the datasource. + * + * For example, if the ConnectionResolver uses WP_Query to fetch the data, this + * should return $args for use in `new WP_Query` + * + * @return array + */ + abstract public function get_query_args(); + + /** + * Get_query + * + * The Query used to get items from the database (or even external datasource) are all + * different. + * + * Each connection resolver should be responsible for defining the Query object that + * is used to fetch items. + * + * @return mixed + */ + abstract public function get_query(); + + /** + * Should_execute + * + * Determine whether or not the query should execute. + * + * Return true to execute, return false to prevent execution. + * + * Various criteria can be used to determine whether a Connection Query should + * be executed. + * + * For example, if a user is requesting revisions of a Post, and the user doesn't have + * permission to edit the post, they don't have permission to view the revisions, and therefore + * we can prevent the query to fetch revisions from executing in the first place. + * + * @return bool + */ + abstract public function should_execute(); + + /** + * Is_valid_offset + * + * Determine whether or not the the offset is valid, i.e the item corresponding to the offset + * exists. Offset is equivalent to WordPress ID (e.g post_id, term_id). So this function is + * equivalent to checking if the WordPress object exists for the given ID. + * + * @param mixed $offset The offset to validate. Typically a WordPress Database ID + * + * @return bool + */ + abstract public function is_valid_offset( $offset ); + + /** + * Return an array of ids from the query + * + * Each Query class in WP and potential datasource handles this differently, so each connection + * resolver should handle getting the items into a uniform array of items. + * + * Note: This is not an abstract function to prevent backwards compatibility issues, so it + * instead throws an exception. Classes that extend AbstractConnectionResolver should + * override this method, instead of AbstractConnectionResolver::get_ids(). + * + * @since 1.9.0 + * + * @throws \Exception if child class forgot to implement this. + * + * @return array the array of IDs. + */ + public function get_ids_from_query() { + throw new Exception( + sprintf( + // translators: %s is the name of the connection resolver class. + esc_html__( 'Class %s does not implement a valid method `get_ids_from_query()`.', 'wp-graphql' ), + static::class + ) + ); + } + + /** + * Given an ID, return the model for the entity or null + * + * @param mixed $id The ID to identify the object by. Could be a database ID or an in-memory ID + * (like post_type name) + * + * @return mixed|\WPGraphQL\Model\Model|null + * @throws \Exception + */ + public function get_node_by_id( $id ) { + return $this->loader->load( $id ); + } + + /** + * Get_query_amount + * + * Returns the max between what was requested and what is defined as the $max_query_amount to + * ensure that queries don't exceed unwanted limits when querying data. + * + * @return int + * @throws \Exception + */ + public function get_query_amount() { + + /** + * Filter the maximum number of posts per page that should be queried. The default is 100 to prevent queries from + * being exceedingly resource intensive, however individual systems can override this for their specific needs. + * + * This filter is intentionally applied AFTER the query_args filter, as + * + * @param int $max_posts the maximum number of posts per page. + * @param mixed $source source passed down from the resolve tree + * @param array $args array of arguments input in the field as part of the GraphQL query + * @param \WPGraphQL\AppContext $context Object containing app context that gets passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info Info about fields passed down the resolve tree + * + * @since 0.0.6 + */ + $max_query_amount = apply_filters( 'graphql_connection_max_query_amount', 100, $this->source, $this->args, $this->context, $this->info ); + + return min( $max_query_amount, absint( $this->get_amount_requested() ) ); + } + + /** + * Get_amount_requested + * + * This checks the $args to determine the amount requested, and if + * + * @return int|null + * @throws \Exception + */ + public function get_amount_requested() { + + /** + * Set the default amount + */ + $amount_requested = 10; + + /** + * If both first & last are used in the input args, throw an exception as that won't + * work properly + */ + if ( ! empty( $this->args['first'] ) && ! empty( $this->args['last'] ) ) { + throw new UserError( esc_html__( 'first and last cannot be used together. For forward pagination, use first & after. For backward pagination, use last & before.', 'wp-graphql' ) ); + } + + /** + * If first is set, and is a positive integer, use it for the $amount_requested + * but if it's set to anything that isn't a positive integer, throw an exception + */ + if ( ! empty( $this->args['first'] ) && is_int( $this->args['first'] ) ) { + if ( 0 > $this->args['first'] ) { + throw new UserError( esc_html__( 'first must be a positive integer.', 'wp-graphql' ) ); + } + + $amount_requested = $this->args['first']; + } + + /** + * If last is set, and is a positive integer, use it for the $amount_requested + * but if it's set to anything that isn't a positive integer, throw an exception + */ + if ( ! empty( $this->args['last'] ) && is_int( $this->args['last'] ) ) { + if ( 0 > $this->args['last'] ) { + throw new UserError( esc_html__( 'last must be a positive integer.', 'wp-graphql' ) ); + } + + $amount_requested = $this->args['last']; + } + + /** + * This filter allows to modify the requested connection page size + * + * @param int $amount the requested amount + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $resolver Instance of the connection resolver class + */ + return max( 0, apply_filters( 'graphql_connection_amount_requested', $amount_requested, $this ) ); + } + + /** + * Gets the offset for the `after` cursor. + * + * @return int|string|null + */ + public function get_after_offset() { + if ( ! empty( $this->args['after'] ) ) { + return $this->get_offset_for_cursor( $this->args['after'] ); + } + + return null; + } + + /** + * Gets the offset for the `before` cursor. + * + * @return int|string|null + */ + public function get_before_offset() { + if ( ! empty( $this->args['before'] ) ) { + return $this->get_offset_for_cursor( $this->args['before'] ); + } + + return null; + } + + /** + * Gets the array index for the given offset. + * + * @param int|string|false $offset The cursor pagination offset. + * @param array $ids The array of ids from the query. + * + * @return int|false $index The array index of the offset. + */ + public function get_array_index_for_offset( $offset, $ids ) { + if ( false === $offset ) { + return false; + } + + // We use array_values() to ensure we're getting a positional index, and not a key. + return array_search( $offset, array_values( $ids ), true ); + } + + /** + * Returns an array slice of IDs, per the Relay Cursor Connection spec. + * + * The resulting array should be overfetched by 1. + * + * @see https://relay.dev/graphql/connections.htm#sec-Pagination-algorithm + * + * @param array $ids The array of IDs from the query to slice, ordered as expected by the GraphQL query. + * + * @since 1.9.0 + * + * @return array + */ + public function apply_cursors_to_ids( array $ids ) { + if ( empty( $ids ) ) { + return []; + } + + // First we slice the array from the front. + if ( ! empty( $this->args['after'] ) ) { + $offset = $this->get_offset_for_cursor( $this->args['after'] ); + $index = $this->get_array_index_for_offset( $offset, $ids ); + + if ( false !== $index ) { + // We want to start with the first id after the index. + $ids = array_slice( $ids, $index + 1, null, true ); + } + } + + // Then we slice the array from the back. + if ( ! empty( $this->args['before'] ) ) { + $offset = $this->get_offset_for_cursor( $this->args['before'] ); + $index = $this->get_array_index_for_offset( $offset, $ids ); + + if ( false !== $index ) { + // Because array indexes start at 0, we can overfetch without adding 1 to $index. + $ids = array_slice( $ids, 0, $index, true ); + } + } + + return $ids; + } + + /** + * Returns an array of IDs for the connection. + * + * These IDs have been fetched from the query with all the query args applied, + * then sliced (overfetching by 1) by pagination args. + * + * @return array + */ + public function get_ids() { + $ids = $this->get_ids_from_query(); + + return $this->apply_cursors_to_ids( $ids ); + } + + /** + * Get_offset + * + * This returns the offset to be used in the $query_args based on the $args passed to the + * GraphQL query. + * + * @deprecated 1.9.0 + * + * @codeCoverageIgnore + * + * @return int|mixed + */ + public function get_offset() { + _deprecated_function( __METHOD__, '1.9.0', static::class . '::get_offset_for_cursor()' ); + + // Using shorthand since this is for deprecated code. + $cursor = $this->args['after'] ?? null; + $cursor = $cursor ?: ( $this->args['before'] ?? null ); + + return $this->get_offset_for_cursor( $cursor ); + } + + /** + * Returns the offset for a given cursor. + * + * Connections that use a string-based offset should override this method. + * + * @return int|mixed + */ + public function get_offset_for_cursor( string $cursor = null ) { + $offset = false; + + // We avoid using ArrayConnection::cursorToOffset() because it assumes an `int` offset. + if ( ! empty( $cursor ) ) { + $offset = substr( base64_decode( $cursor ), strlen( 'arrayconnection:' ) ); + } + + /** + * We assume a numeric $offset is an integer ID. + * If it isn't this method should be overridden by the child class. + */ + return is_numeric( $offset ) ? absint( $offset ) : $offset; + } + + /** + * Has_next_page + * + * Whether there is a next page in the connection. + * + * If there are more "items" than were asked for in the "first" argument + * ore if there are more "items" after the "before" argument, has_next_page() + * will be set to true + * + * @return boolean + */ + public function has_next_page() { + if ( ! empty( $this->args['first'] ) ) { + return ! empty( $this->ids ) && count( $this->ids ) > $this->query_amount; + } + + $before_offset = $this->get_before_offset(); + + if ( $before_offset ) { + return $this->is_valid_offset( $before_offset ); + } + + return false; + } + + /** + * Has_previous_page + * + * Whether there is a previous page in the connection. + * + * If there are more "items" than were asked for in the "last" argument + * or if there are more "items" before the "after" argument, has_previous_page() + * will be set to true. + * + * @return boolean + */ + public function has_previous_page() { + if ( ! empty( $this->args['last'] ) ) { + return ! empty( $this->ids ) && count( $this->ids ) > $this->query_amount; + } + + $after_offset = $this->get_after_offset(); + if ( $after_offset ) { + return $this->is_valid_offset( $after_offset ); + } + + return false; + } + + /** + * Get_start_cursor + * + * Determine the start cursor from the connection + * + * @return mixed string|null + */ + public function get_start_cursor() { + $first_edge = $this->edges && ! empty( $this->edges ) ? $this->edges[0] : null; + + return isset( $first_edge['cursor'] ) ? $first_edge['cursor'] : null; + } + + /** + * Get_end_cursor + * + * Determine the end cursor from the connection + * + * @return mixed string|null + */ + public function get_end_cursor() { + $last_edge = ! empty( $this->edges ) ? $this->edges[ count( $this->edges ) - 1 ] : null; + + return isset( $last_edge['cursor'] ) ? $last_edge['cursor'] : null; + } + + /** + * Gets the IDs for the currently-paginated slice of nodes. + * + * We slice the array to match the amount of items that was asked for, as we over-fetched by 1 item to calculate pageInfo. + * + * @used-by AbstractConnectionResolver::get_nodes() + * + * @return array + */ + public function get_ids_for_nodes() { + if ( empty( $this->ids ) ) { + return []; + } + + // If we're going backwards then our overfetched ID is at the front. + if ( ! empty( $this->args['last'] ) && count( $this->ids ) > absint( $this->args['last'] ) ) { + return array_slice( $this->ids, count( $this->ids ) - absint( $this->args['last'] ), $this->query_amount, true ); + } + + // If we're going forwards, our overfetched ID is at the back. + return array_slice( $this->ids, 0, $this->query_amount, true ); + } + + /** + * Get_nodes + * + * Get the nodes from the query. + * + * @uses AbstractConnectionResolver::get_ids_for_nodes() + * + * @return array + * @throws \Exception + */ + public function get_nodes() { + $nodes = []; + + // These are already sliced and ordered, we're just populating node data. + $ids = $this->get_ids_for_nodes(); + + foreach ( $ids as $id ) { + $model = $this->get_node_by_id( $id ); + if ( true === $this->is_valid_model( $model ) ) { + $nodes[ $id ] = $model; + } + } + + return $nodes; + } + + /** + * Validates Model. + * + * If model isn't a class with a `fields` member, this function with have be overridden in + * the Connection class. + * + * @param \WPGraphQL\Model\Model|mixed $model The model being validated + * + * @return bool + */ + protected function is_valid_model( $model ) { + return isset( $model->fields ) && ! empty( $model->fields ); + } + + /** + * Given an ID, a cursor is returned + * + * @param int $id + * + * @return string + */ + protected function get_cursor_for_node( $id ) { + return base64_encode( 'arrayconnection:' . $id ); + } + + /** + * Get_edges + * + * This iterates over the nodes and returns edges + * + * @return array + */ + public function get_edges() { + // Bail early if there are no nodes. + if ( empty( $this->nodes ) ) { + return []; + } + + $edges = []; + + // The nodes are already ordered, sliced, and populated. What's left is to populate the edge data for each one. + foreach ( $this->nodes as $id => $node ) { + $edge = [ + 'cursor' => $this->get_cursor_for_node( $id ), + 'node' => $node, + 'source' => $this->source, + 'connection' => $this, + ]; + + /** + * Create the edge, pass it through a filter. + * + * @param array $edge The edge within the connection + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the connection resolver class + */ + $edge = apply_filters( + 'graphql_connection_edge', + $edge, + $this + ); + + /** + * If not empty, add the edge to the edges + */ + if ( ! empty( $edge ) ) { + $edges[] = $edge; + } + } + + return $edges; + } + + /** + * Get_page_info + * + * Returns pageInfo for the connection + * + * @return array + */ + public function get_page_info() { + $page_info = [ + 'startCursor' => $this->get_start_cursor(), + 'endCursor' => $this->get_end_cursor(), + 'hasNextPage' => (bool) $this->has_next_page(), + 'hasPreviousPage' => (bool) $this->has_previous_page(), + ]; + + /** + * Filter the pageInfo that is returned to the connection. + * + * This filter allows for additional fields to be filtered into the pageInfo + * of a connection, such as "totalCount", etc, because the filter has enough + * context of the query, args, request, etc to be able to calculate and return + * that information. + * + * example: + * + * You would want to register a "total" field to the PageInfo type, then filter + * the pageInfo to return the total for the query, something to this tune: + * + * add_filter( 'graphql_connection_page_info', function( $page_info, $connection ) { + * + * $page_info['total'] = null; + * + * if ( $connection->query instanceof WP_Query ) { + * if ( isset( $connection->query->found_posts ) { + * $page_info['total'] = (int) $connection->query->found_posts; + * } + * } + * + * return $page_info; + * + * }); + */ + return apply_filters( 'graphql_connection_page_info', $page_info, $this ); + } + + /** + * Execute the resolver query and get the data for the connection + * + * @return array + * + * @throws \Exception + */ + public function execute_and_get_ids() { + + /** + * If should_execute is explicitly set to false already, we can + * prevent execution quickly. If it's not, we need to + * call the should_execute() method to execute any situational logic + * to determine if the connection query should execute or not + */ + $should_execute = false === $this->should_execute ? false : $this->should_execute(); + + /** + * Check if the connection should execute. If conditions are met that should prevent + * the execution, we can bail from resolving early, before the query is executed. + * + * Filter whether the connection should execute. + * + * @param bool $should_execute Whether the connection should execute + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver + */ + $this->should_execute = apply_filters( 'graphql_connection_should_execute', $should_execute, $this ); + if ( false === $this->should_execute ) { + return []; + } + + /** + * Set the query for the resolver, for use as reference in filters, etc + * + * Filter the query. For core data, the query is typically an instance of: + * + * WP_Query + * WP_Comment_Query + * WP_User_Query + * WP_Term_Query + * ... + * + * But in some cases, the actual mechanism for querying data should be overridden. For + * example, perhaps you're using ElasticSearch or Solr (hypothetical) and want to offload + * the query to that instead of a native WP_Query class. You could override this with a + * query to that datasource instead. + * + * @param mixed $query Instance of the Query for the resolver + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver + */ + $this->query = apply_filters( 'graphql_connection_query', $this->get_query(), $this ); + + /** + * Filter the connection IDs + * + * @param array $ids Array of IDs this connection will be resolving + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver + */ + $this->ids = apply_filters( 'graphql_connection_ids', $this->get_ids(), $this ); + + if ( empty( $this->ids ) ) { + return []; + } + + /** + * Buffer the IDs for deferred resolution + */ + $this->loader->buffer( $this->ids ); + + return $this->ids; + } + + /** + * Get_connection + * + * Get the connection to return to the Connection Resolver + * + * @return mixed|array|\GraphQL\Deferred + * + * @throws \Exception + */ + public function get_connection() { + $this->execute_and_get_ids(); + + /** + * Return a Deferred function to load all buffered nodes before + * returning the connection. + */ + return new Deferred( + function () { + if ( ! empty( $this->ids ) ) { + $this->loader->load_many( $this->ids ); + } + + /** + * Set the items. These are the "nodes" that make up the connection. + * + * Filters the nodes in the connection + * + * @param array $nodes The nodes in the connection + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver + */ + $this->nodes = apply_filters( 'graphql_connection_nodes', $this->get_nodes(), $this ); + + /** + * Filters the edges in the connection + * + * @param array $nodes The nodes in the connection + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver + */ + $this->edges = apply_filters( 'graphql_connection_edges', $this->get_edges(), $this ); + + if ( true === $this->one_to_one ) { + // For one to one connections, return the first edge. + $connection = ! empty( $this->edges[ array_key_first( $this->edges ) ] ) ? $this->edges[ array_key_first( $this->edges ) ] : null; + } else { + // For plural connections (default) return edges/nodes/pageInfo + $connection = [ + 'nodes' => $this->nodes, + 'edges' => $this->edges, + 'pageInfo' => $this->get_page_info(), + ]; + } + + /** + * Filter the connection. In some cases, connections will want to provide + * additional information other than edges, nodes, and pageInfo + * + * This filter allows additional fields to be returned to the connection resolver + * + * @param array $connection The connection data being returned + * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver The instance of the connection resolver + */ + return apply_filters( 'graphql_connection', $connection, $this ); + } + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/CommentConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/CommentConnectionResolver.php new file mode 100644 index 00000000..6e047187 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/CommentConnectionResolver.php @@ -0,0 +1,338 @@ +args['last'] ) ? $this->args['last'] : null; + $first = ! empty( $this->args['first'] ) ? $this->args['first'] : null; + + $query_args = []; + + /** + * Don't calculate the total rows, it's not needed and can be expensive + */ + $query_args['no_found_rows'] = true; + + /** + * Set the default comment_status for Comment Queries to be "comment_approved" + */ + $query_args['status'] = 'approve'; + + /** + * Set the number, ensuring it doesn't exceed the amount set as the $max_query_amount + * + * @since 0.0.6 + */ + $query_args['number'] = min( max( absint( $first ), absint( $last ), 10 ), $this->get_query_amount() ) + 1; + + /** + * Set the default order + */ + $query_args['orderby'] = 'comment_date'; + + /** + * Take any of the $this->args that were part of the GraphQL query and map their + * GraphQL names to the WP_Term_Query names to be used in the WP_Term_Query + * + * @since 0.0.5 + */ + $input_fields = []; + if ( ! empty( $this->args['where'] ) ) { + $input_fields = $this->sanitize_input_fields( $this->args['where'] ); + } + + /** + * Merge the default $query_args with the $this->args that were entered + * in the query. + * + * @since 0.0.5 + */ + if ( ! empty( $input_fields ) ) { + $query_args = array_merge( $query_args, $input_fields ); + } + + /** + * If the current user cannot moderate comments, do not include unapproved comments + */ + if ( ! current_user_can( 'moderate_comments' ) ) { + $query_args['status'] = [ 'approve' ]; + $query_args['include_unapproved'] = get_current_user_id() ? [ get_current_user_id() ] : []; + if ( empty( $query_args['include_unapproved'] ) ) { + unset( $query_args['include_unapproved'] ); + } + } + + /** + * Throw an exception if the query is attempted to be queried by + */ + if ( 'comment__in' === $query_args['orderby'] && empty( $query_args['comment__in'] ) ) { + throw new UserError( esc_html__( 'In order to sort by comment__in, an array of IDs must be passed as the commentIn argument', 'wp-graphql' ) ); + } + + /** + * If there's no orderby params in the inputArgs, set order based on the first/last argument + */ + if ( empty( $query_args['order'] ) ) { + $query_args['order'] = ! empty( $last ) ? 'ASC' : 'DESC'; + } + + /** + * Set the graphql_cursor_compare to determine + * whether the data is being paginated forward (>) or backward (<) + * default to forward + */ + $query_args['graphql_cursor_compare'] = ( isset( $last ) ) ? '>' : '<'; + + // these args are used by the cursor builder to generate the proper SQL needed to respect the cursors + $query_args['graphql_after_cursor'] = $this->get_after_offset(); + $query_args['graphql_before_cursor'] = $this->get_before_offset(); + + /** + * Pass the graphql $this->args to the WP_Query + */ + $query_args['graphql_args'] = $this->args; + + // encode the graphql args as a cache domain to ensure the + // graphql_args are used to identify different queries. + // see: https://core.trac.wordpress.org/ticket/35075 + $encoded_args = wp_json_encode( $this->args ); + $query_args['cache_domain'] = ! empty( $encoded_args ) ? 'graphql:' . md5( $encoded_args ) : 'graphql'; + + /** + * We only want to query IDs because deferred resolution will resolve the full + * objects. + */ + $query_args['fields'] = 'ids'; + + /** + * Filter the query_args that should be applied to the query. This filter is applied AFTER the input args from + * the GraphQL Query have been applied and has the potential to override the GraphQL Query Input Args. + * + * @param array $query_args array of query_args being passed to the + * @param mixed $source source passed down from the resolve tree + * @param array $args array of arguments input in the field as part of the GraphQL query + * @param \WPGraphQL\AppContext $context object passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info info about fields passed down the resolve tree + * + * @since 0.0.6 + */ + return apply_filters( 'graphql_comment_connection_query_args', $query_args, $this->source, $this->args, $this->context, $this->info ); + } + + /** + * Get_query + * + * Return the instance of the WP_Comment_Query + * + * @return \WP_Comment_Query + * @throws \Exception + */ + public function get_query() { + return new WP_Comment_Query( $this->query_args ); + } + + /** + * Return the name of the loader + * + * @return string + */ + public function get_loader_name() { + return 'comment'; + } + + /** + * {@inheritDoc} + */ + public function get_ids_from_query() { + /** @var array $ids */ + $ids = ! empty( $this->query->get_comments() ) ? $this->query->get_comments() : []; + + // If we're going backwards, we need to reverse the array. + if ( ! empty( $this->args['last'] ) ) { + $ids = array_reverse( $ids ); + } + + return $ids; + } + + /** + * This can be used to determine whether the connection query should even execute. + * + * For example, if the $source were a post_type that didn't support comments, we could prevent + * the connection query from even executing. In our case, we prevent comments from even showing + * in the Schema for post types that don't have comment support, so we don't need to worry + * about that, but there may be other situations where we'd need to prevent it. + * + * @return boolean + */ + public function should_execute() { + return true; + } + + + /** + * Filters the GraphQL args before they are used in get_query_args(). + * + * @return array + */ + public function get_args(): array { + $args = $this->args; + + if ( ! empty( $args['where'] ) ) { + // Ensure all IDs are converted to database IDs. + foreach ( $args['where'] as $input_key => $input_value ) { + if ( empty( $input_value ) ) { + continue; + } + + switch ( $input_key ) { + case 'authorIn': + case 'authorNotIn': + case 'commentIn': + case 'commentNotIn': + case 'parentIn': + case 'parentNotIn': + case 'contentAuthorIn': + case 'contentAuthorNotIn': + case 'contentId': + case 'contentIdIn': + case 'contentIdNotIn': + case 'contentAuthor': + case 'userId': + if ( is_array( $input_value ) ) { + $args['where'][ $input_key ] = array_map( + static function ( $id ) { + return Utils::get_database_id_from_id( $id ); + }, + $input_value + ); + break; + } + $args['where'][ $input_key ] = Utils::get_database_id_from_id( $input_value ); + break; + case 'includeUnapproved': + if ( is_string( $input_value ) ) { + $input_value = [ $input_value ]; + } + $args['where'][ $input_key ] = array_map( + static function ( $id ) { + if ( is_email( $id ) ) { + return $id; + } + + return Utils::get_database_id_from_id( $id ); + }, + $input_value + ); + break; + } + } + } + + /** + * + * Filters the GraphQL args before they are used in get_query_args(). + * + * @param array $args The GraphQL args passed to the resolver. + * @param \WPGraphQL\Data\Connection\CommentConnectionResolver $connection_resolver Instance of the ConnectionResolver + * + * @since 1.11.0 + */ + return apply_filters( 'graphql_comment_connection_args', $args, $this ); + } + + /** + * This sets up the "allowed" args, and translates the GraphQL-friendly keys to + * WP_Comment_Query friendly keys. + * + * There's probably a cleaner/more dynamic way to approach this, but this was quick. I'd be + * down to explore more dynamic ways to map this, but for now this gets the job done. + * + * @param array $args The array of query arguments + * + * @since 0.0.5 + * @return array + */ + public function sanitize_input_fields( array $args ) { + $arg_mapping = [ + 'authorEmail' => 'author_email', + 'authorIn' => 'author__in', + 'authorNotIn' => 'author__not_in', + 'authorUrl' => 'author_url', + 'commentIn' => 'comment__in', + 'commentNotIn' => 'comment__not_in', + 'commentType' => 'type', + 'commentTypeIn' => 'type__in', + 'commentTypeNotIn' => 'type__not_in', + 'contentAuthor' => 'post_author', + 'contentAuthorIn' => 'post_author__in', + 'contentAuthorNotIn' => 'post_author__not_in', + 'contentId' => 'post_id', + 'contentIdIn' => 'post__in', + 'contentIdNotIn' => 'post__not_in', + 'contentName' => 'post_name', + 'contentParent' => 'post_parent', + 'contentStatus' => 'post_status', + 'contentType' => 'post_type', + 'includeUnapproved' => 'include_unapproved', + 'parentIn' => 'parent__in', + 'parentNotIn' => 'parent__not_in', + 'userId' => 'user_id', + ]; + + /** + * Map and sanitize the input args to the WP_Comment_Query compatible args + */ + $query_args = Utils::map_input( $args, $arg_mapping ); + + /** + * Filter the input fields + * + * This allows plugins/themes to hook in and alter what $args should be allowed to be passed + * from a GraphQL Query to the get_terms query + * + * @since 0.0.5 + */ + $query_args = apply_filters( 'graphql_map_input_fields_to_wp_comment_query', $query_args, $args, $this->source, $this->args, $this->context, $this->info ); + + return ! empty( $query_args ) && is_array( $query_args ) ? $query_args : []; + } + + /** + * Determine whether or not the the offset is valid, i.e the comment corresponding to the + * offset exists. Offset is equivalent to comment_id. So this function is equivalent to + * checking if the comment with the given ID exists. + * + * @param int $offset The ID of the node used for the cursor offset + * + * @return bool + */ + public function is_valid_offset( $offset ) { + return ! empty( get_comment( $offset ) ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/ContentTypeConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/ContentTypeConnectionResolver.php new file mode 100644 index 00000000..36aa2db8 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/ContentTypeConnectionResolver.php @@ -0,0 +1,90 @@ +query; + + if ( empty( $queried ) ) { + return $ids; + } + + foreach ( $queried as $item ) { + $ids[] = $item; + } + + return $ids; + } + + /** + * {@inheritDoc} + */ + public function get_query_args() { + // If any args are added to filter/sort the connection + return []; + } + + + /** + * Get the items from the source + * + * @return array + */ + public function get_query() { + if ( isset( $this->query_args['contentTypeNames'] ) && is_array( $this->query_args['contentTypeNames'] ) ) { + return $this->query_args['contentTypeNames']; + } + + if ( isset( $this->query_args['name'] ) ) { + return [ $this->query_args['name'] ]; + } + + $query_args = $this->query_args; + return \WPGraphQL::get_allowed_post_types( 'names', $query_args ); + } + + /** + * The name of the loader to load the data + * + * @return string + */ + public function get_loader_name() { + return 'post_type'; + } + + /** + * Determine if the offset used for pagination is valid + * + * @param mixed $offset + * + * @return bool + */ + public function is_valid_offset( $offset ) { + return (bool) get_post_type_object( $offset ); + } + + /** + * Determine if the query should execute + * + * @return bool + */ + public function should_execute() { + return true; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedScriptsConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedScriptsConnectionResolver.php new file mode 100644 index 00000000..05323ec4 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedScriptsConnectionResolver.php @@ -0,0 +1,120 @@ +fieldName || 'registeredScripts' === $info->fieldName ) { + return 1000; + } + return $max; + }, + 10, + 5 + ); + + parent::__construct( $source, $args, $context, $info ); + } + + /** + * {@inheritDoc} + */ + public function get_ids_from_query() { + $ids = []; + $queried = $this->get_query(); + + if ( empty( $queried ) ) { + return $ids; + } + + foreach ( $queried as $key => $item ) { + $ids[ $key ] = $item; + } + + return $ids; + } + + /** + * {@inheritDoc} + */ + public function get_query_args() { + // If any args are added to filter/sort the connection + return []; + } + + + /** + * Get the items from the source + * + * @return array + */ + public function get_query() { + return $this->source->enqueuedScriptsQueue ? $this->source->enqueuedScriptsQueue : []; + } + + /** + * The name of the loader to load the data + * + * @return string + */ + public function get_loader_name() { + return 'enqueued_script'; + } + + /** + * Determine if the model is valid + * + * @param ?\_WP_Dependency $model + * + * @return bool + */ + protected function is_valid_model( $model ) { + return isset( $model->handle ); + } + + /** + * Determine if the offset used for pagination is valid + * + * @param mixed $offset + * + * @return bool + */ + public function is_valid_offset( $offset ) { + global $wp_scripts; + return isset( $wp_scripts->registered[ $offset ] ); + } + + /** + * Determine if the query should execute + * + * @return bool + */ + public function should_execute() { + return true; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php new file mode 100644 index 00000000..ee7cdad6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php @@ -0,0 +1,128 @@ +fieldName || 'registeredStylesheets' === $info->fieldName ) { + return 1000; + } + return $max; + }, + 10, + 5 + ); + + parent::__construct( $source, $args, $context, $info ); + } + + /** + * Get the IDs from the source + * + * @return array + */ + public function get_ids_from_query() { + $ids = []; + $queried = $this->get_query(); + + if ( empty( $queried ) ) { + return $ids; + } + + foreach ( $queried as $key => $item ) { + $ids[ $key ] = $item; + } + + return $ids; + } + + /** + * {@inheritDoc} + */ + public function get_query_args() { + // If any args are added to filter/sort the connection + return []; + } + + + /** + * Get the items from the source + * + * @return array + */ + public function get_query() { + return $this->source->enqueuedStylesheetsQueue ? $this->source->enqueuedStylesheetsQueue : []; + } + + /** + * The name of the loader to load the data + * + * @return string + */ + public function get_loader_name() { + return 'enqueued_stylesheet'; + } + + /** + * Determine if the model is valid + * + * @param ?\_WP_Dependency $model + * + * @return bool + */ + protected function is_valid_model( $model ) { + return isset( $model->handle ); + } + + /** + * Determine if the offset used for pagination is valid + * + * @param mixed $offset + * + * @return bool + */ + public function is_valid_offset( $offset ) { + global $wp_styles; + return isset( $wp_styles->registered[ $offset ] ); + } + + /** + * Determine if the query should execute + * + * @return bool + */ + public function should_execute() { + return true; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/MenuConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/MenuConnectionResolver.php new file mode 100644 index 00000000..a2800663 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/MenuConnectionResolver.php @@ -0,0 +1,50 @@ + false, + 'include' => [], + 'taxonomy' => 'nav_menu', + 'fields' => 'ids', + ]; + + if ( ! empty( $this->args['where']['slug'] ) ) { + $term_args['slug'] = $this->args['where']['slug']; + $term_args['include'] = null; + } + + $theme_locations = get_nav_menu_locations(); + + // If a location is specified in the args, use it + if ( ! empty( $this->args['where']['location'] ) ) { + // Exclude unset and non-existent locations + $term_args['include'] = ! empty( $theme_locations[ $this->args['where']['location'] ] ) ? $theme_locations[ $this->args['where']['location'] ] : -1; + // If the current user cannot edit theme options + } elseif ( ! current_user_can( 'edit_theme_options' ) ) { + $term_args['include'] = array_values( $theme_locations ); + } + + if ( ! empty( $this->args['where']['id'] ) ) { + $term_args['include'] = $this->args['where']['id']; + } + + $query_args = parent::get_query_args(); + + return array_merge( $query_args, $term_args ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/MenuItemConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/MenuItemConnectionResolver.php new file mode 100644 index 00000000..17a7dcc3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/MenuItemConnectionResolver.php @@ -0,0 +1,125 @@ +args['last'] ) ? $this->args['last'] : null; + + $menu_locations = get_theme_mod( 'nav_menu_locations' ); + + $query_args = parent::get_query_args(); + $query_args['orderby'] = 'menu_order'; + $query_args['order'] = isset( $last ) ? 'DESC' : 'ASC'; + + if ( isset( $this->args['where']['parentDatabaseId'] ) ) { + $query_args['meta_key'] = '_menu_item_menu_item_parent'; + $query_args['meta_value'] = (int) $this->args['where']['parentDatabaseId']; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value + } + + if ( ! empty( $this->args['where']['parentId'] ) || ( isset( $this->args['where']['parentId'] ) && 0 === (int) $this->args['where']['parentId'] ) ) { + $query_args['meta_key'] = '_menu_item_menu_item_parent'; + $query_args['meta_value'] = $this->args['where']['parentId']; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value + } + + // Get unique list of locations as the default limitation of + // locations to allow public queries for. + // Public queries should only be allowed to query for + // Menu Items assigned to a Menu Location + $locations = is_array( $menu_locations ) && ! empty( $menu_locations ) ? array_unique( array_values( $menu_locations ) ) : []; + + // If the location argument is set, set the argument to the input argument + if ( isset( $this->args['where']['location'], $menu_locations[ $this->args['where']['location'] ] ) ) { + $locations = [ $menu_locations[ $this->args['where']['location'] ] ]; + + // if the $locations are NOT set and the user has proper capabilities, let the user query + // all menu items connected to any menu + } elseif ( current_user_can( 'edit_theme_options' ) ) { + $locations = null; + } + + // Only query for menu items in assigned locations. + if ( ! empty( $locations ) && is_array( $locations ) ) { + + // unset the location arg + // we don't need this passed as a taxonomy parameter to wp_query + unset( $query_args['location'] ); + + $query_args['tax_query'][] = [ + 'taxonomy' => 'nav_menu', + 'field' => 'term_id', + 'terms' => $locations, + 'include_children' => false, + 'operator' => 'IN', + ]; + } + + return $query_args; + } + + /** + * Filters the GraphQL args before they are used in get_query_args(). + * + * @return array + */ + public function get_args(): array { + $args = $this->args; + + if ( ! empty( $args['where'] ) ) { + // Ensure all IDs are converted to database IDs. + foreach ( $args['where'] as $input_key => $input_value ) { + if ( empty( $input_value ) ) { + continue; + } + + switch ( $input_key ) { + case 'parentId': + $args['where'][ $input_key ] = Utils::get_database_id_from_id( $input_value ); + break; + } + } + } + + /** + * + * Filters the GraphQL args before they are used in get_query_args(). + * + * @param array $args The GraphQL args passed to the resolver. + * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. + * + * @since 1.11.0 + */ + return apply_filters( 'graphql_menu_item_connection_args', $args, $this->args ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/PluginConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/PluginConnectionResolver.php new file mode 100644 index 00000000..026c1c26 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/PluginConnectionResolver.php @@ -0,0 +1,261 @@ +query ) ? $this->query : []; + + if ( empty( $queried ) ) { + return $ids; + } + + foreach ( $queried as $key => $item ) { + $ids[ $key ] = $key; + } + + return $ids; + } + + /** + * {@inheritDoc} + */ + public function get_query_args() { + if ( ! empty( $this->args['where']['status'] ) ) { + $this->args['where']['stati'] = [ $this->args['where']['status'] ]; + } elseif ( ! empty( $this->args['where']['stati'] ) && is_string( $this->args['where']['stati'] ) ) { + $this->args['where']['stati'] = [ $this->args['where']['stati'] ]; + } + + return $this->args; + } + + /** + * {@inheritDoc} + * + * @return array + */ + public function get_query() { + // File has not loaded. + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + // This is missing must use and drop in plugins, so we need to fetch and merge them separately. + $site_plugins = apply_filters( 'all_plugins', get_plugins() ); + $mu_plugins = apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ? get_mu_plugins() : []; + $dropin_plugins = apply_filters( 'show_advanced_plugins', true, 'dropins' ) ? get_dropins() : []; + + $all_plugins = array_merge( $site_plugins, $mu_plugins, $dropin_plugins ); + + // Bail early if no plugins. + if ( empty( $all_plugins ) ) { + return []; + } + + // Holds the plugin names sorted by status. The other ` status => [ plugin_names ] ` will be added later. + $plugins_by_status = [ + 'mustuse' => array_flip( array_keys( $mu_plugins ) ), + 'dropins' => array_flip( array_keys( $dropin_plugins ) ), + ]; + + // Permissions. + $can_update = current_user_can( 'update_plugins' ); + $can_view_autoupdates = $can_update && function_exists( 'wp_is_auto_update_enabled_for_type' ) && wp_is_auto_update_enabled_for_type( 'plugin' ); + $show_network_plugins = apply_filters( 'show_network_active_plugins', current_user_can( 'manage_network_plugins' ) ); + + // Store the plugin stati as array keys for performance. + $active_stati = ! empty( $this->args['where']['stati'] ) ? array_flip( $this->args['where']['stati'] ) : []; + + // Get additional plugin info. + $upgradable_list = $can_update && isset( $active_stati['upgrade'] ) ? get_site_transient( 'update_plugins' ) : []; + $recently_activated_list = isset( $active_stati['recently_activated'] ) ? get_site_option( 'recently_activated', [] ) : []; + + // Loop through the plugins, add additional data, and store them in $plugins_by_status. + foreach ( (array) $all_plugins as $plugin_file => $plugin_data ) { + if ( ! file_exists( WP_PLUGIN_DIR . '/' . $plugin_file ) ) { + unset( $all_plugins[ $plugin_file ] ); + continue; + } + + // Handle multisite plugins. + if ( is_multisite() && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) { + + // Check for inactive network plugins. + if ( $show_network_plugins ) { + + // add the plugin to the network_inactive and network_inactive list since "network_inactive" are considered inactive + $plugins_by_status['inactive'][ $plugin_file ] = $plugin_file; + $plugins_by_status['network_inactive'][ $plugin_file ] = $plugin_file; + } else { + // Unset and skip to next plugin. + unset( $all_plugins[ $plugin_file ] ); + continue; + } + } elseif ( is_plugin_active_for_network( $plugin_file ) ) { + // Check for active network plugins. + if ( $show_network_plugins ) { + // add the plugin to the network_activated and active list, since "network_activated" are active + $plugins_by_status['active'][ $plugin_file ] = $plugin_file; + $plugins_by_status['network_activated'][ $plugin_file ] = $plugin_file; + } else { + // Unset and skip to next plugin. + unset( $all_plugins[ $plugin_file ] ); + continue; + } + } + + // Populate active/inactive lists. + // @todo should this include MU/Dropins? + if ( is_plugin_active( $plugin_file ) ) { + $plugins_by_status['active'][ $plugin_file ] = $plugin_file; + } else { + $plugins_by_status['inactive'][ $plugin_file ] = $plugin_file; + } + + // Populate recently activated list. + if ( isset( $recently_activated_list[ $plugin_file ] ) ) { + $plugins_by_status['recently_activated'][ $plugin_file ] = $plugin_file; + } + + // Populate paused list. + if ( is_plugin_paused( $plugin_file ) ) { + $plugins_by_status['paused'][ $plugin_file ] = $plugin_file; + } + + // Get update information. + if ( $can_update && isset( $upgradable_list->response[ $plugin_file ] ) ) { + // An update is available. + $plugin_data['update'] = true; + // Extra info if known. + $plugin_data = array_merge( (array) $upgradable_list->response[ $plugin_file ], [ 'update-supported' => true ], $plugin_data ); + + // Populate upgradable list. + $plugins_by_status['upgrade'][ $plugin_file ] = $plugin_file; + } elseif ( isset( $upgradable_list->no_update[ $plugin_file ] ) ) { + $plugin_data = array_merge( (array) $upgradable_list->no_update[ $plugin_file ], [ 'update-supported' => true ], $plugin_data ); + } elseif ( empty( $plugin_data['update-supported'] ) ) { + $plugin_data['update-supported'] = false; + } + + // Get autoupdate information. + if ( $can_view_autoupdates ) { + /* + * Create the payload that's used for the auto_update_plugin filter. + * This is the same data contained within $upgradable_list->(response|no_update) however + * not all plugins will be contained in those keys, this avoids unexpected warnings. + */ + $filter_payload = [ + 'id' => $plugin_file, + 'slug' => '', + 'plugin' => $plugin_file, + 'new_version' => '', + 'url' => '', + 'package' => '', + 'icons' => [], + 'banners' => [], + 'banners_rtl' => [], + 'tested' => '', + 'requires_php' => '', + 'compatibility' => new \stdClass(), + ]; + $filter_payload = (object) wp_parse_args( $plugin_data, $filter_payload ); + + if ( function_exists( 'wp_is_auto_update_forced_for_item' ) ) { + $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, $filter_payload ); + $plugin_data['auto-update-forced'] = $auto_update_forced; + } + } + + // Save any changes to the plugin data. + $all_plugins[ $plugin_file ] = $plugin_data; + } + + $plugins_by_status['all'] = array_flip( array_keys( $all_plugins ) ); + + /** + * Filters the plugins by status. + * */ + $filtered_plugins = ! empty( $active_stati ) ? array_values( array_intersect_key( $plugins_by_status, $active_stati ) ) : []; + // If plugins exist for the filter, flatten and return them. Otherwise, return the full list. + $filtered_plugins = ! empty( $filtered_plugins ) ? array_merge( [], ...$filtered_plugins ) : $plugins_by_status['all']; + + if ( ! empty( $this->args['where']['search'] ) ) { + // Filter by search args. + $s = sanitize_text_field( $this->args['where']['search'] ); + $matches = array_keys( + array_filter( + $all_plugins, + static function ( $plugin ) use ( $s ) { + foreach ( $plugin as $value ) { + if ( is_string( $value ) && false !== stripos( wp_strip_all_tags( $value ), $s ) ) { + return true; + } + } + + return false; + } + ) + ); + if ( ! empty( $matches ) ) { + $filtered_plugins = array_intersect_key( $filtered_plugins, array_flip( $matches ) ); + } + } + + // Return plugin data filtered by args. + return ! empty( $filtered_plugins ) ? array_intersect_key( $all_plugins, $filtered_plugins ) : []; + } + + /** + * {@inheritDoc} + */ + public function get_loader_name() { + return 'plugin'; + } + + /** + * {@inheritDoc} + */ + public function is_valid_offset( $offset ) { + // File has not loaded. + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + // This is missing must use and drop in plugins, so we need to fetch and merge them separately. + $site_plugins = apply_filters( 'all_plugins', get_plugins() ); + $mu_plugins = apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ? get_mu_plugins() : []; + $dropin_plugins = apply_filters( 'show_advanced_plugins', true, 'dropins' ) ? get_dropins() : []; + + $all_plugins = array_merge( $site_plugins, $mu_plugins, $dropin_plugins ); + + return array_key_exists( $offset, $all_plugins ); + } + + /** + * @return bool + */ + public function should_execute() { + if ( is_multisite() ) { + // update_, install_, and delete_ are handled above with is_super_admin(). + $menu_perms = get_site_option( 'menu_items', [] ); + if ( empty( $menu_perms['plugins'] ) && ! current_user_can( 'manage_network_plugins' ) ) { + return false; + } + } elseif ( ! current_user_can( 'activate_plugins' ) ) { + return false; + } + + return true; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/PostObjectConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/PostObjectConnectionResolver.php new file mode 100644 index 00000000..03881b0b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/PostObjectConnectionResolver.php @@ -0,0 +1,622 @@ +post_type = $post_type; + } elseif ( 'any' === $post_type ) { + $post_types = \WPGraphQL::get_allowed_post_types(); + $this->post_type = ! empty( $post_types ) ? array_values( $post_types ) : []; + } else { + $post_type = is_array( $post_type ) ? $post_type : [ $post_type ]; + unset( $post_type['attachment'] ); + unset( $post_type['revision'] ); + $this->post_type = $post_type; + } + + /** + * Call the parent construct to setup class data + */ + parent::__construct( $source, $args, $context, $info ); + } + + /** + * Return the name of the loader + * + * @return string + */ + public function get_loader_name() { + return 'post'; + } + + /** + * Returns the query being executed + * + * @return \WP_Query|object + * + * @throws \Exception + */ + public function get_query() { + // Get query class. + $queryClass = ! empty( $this->context->queryClass ) + ? $this->context->queryClass + : '\WP_Query'; + + $query = new $queryClass( $this->query_args ); + + if ( isset( $query->query_vars['suppress_filters'] ) && true === $query->query_vars['suppress_filters'] ) { + throw new InvariantViolation( esc_html__( 'WP_Query has been modified by a plugin or theme to suppress_filters, which will cause issues with WPGraphQL Execution. If you need to suppress filters for a specific reason within GraphQL, consider registering a custom field to the WPGraphQL Schema with a custom resolver.', 'wp-graphql' ) ); + } + + return $query; + } + + /** + * {@inheritDoc} + */ + public function get_ids_from_query() { + $ids = ! empty( $this->query->posts ) ? $this->query->posts : []; + + // If we're going backwards, we need to reverse the array. + if ( ! empty( $this->args['last'] ) ) { + $ids = array_reverse( $ids ); + } + + return $ids; + } + + /** + * Determine whether the Query should execute. If it's determined that the query should + * not be run based on context such as, but not limited to, who the user is, where in the + * ResolveTree the Query is, the relation to the node the Query is connected to, etc + * + * Return false to prevent the query from executing. + * + * @return bool + */ + public function should_execute() { + if ( false === $this->should_execute ) { + return false; + } + + /** + * For revisions, we only want to execute the connection query if the user + * has access to edit the parent post. + * + * If the user doesn't have permission to edit the parent post, then we shouldn't + * even execute the connection + */ + if ( isset( $this->post_type ) && 'revision' === $this->post_type ) { + if ( $this->source instanceof Post ) { + $parent_post_type_obj = get_post_type_object( $this->source->post_type ); + if ( ! isset( $parent_post_type_obj->cap->edit_post ) || ! current_user_can( $parent_post_type_obj->cap->edit_post, $this->source->ID ) ) { + $this->should_execute = false; + } + /** + * If the connection is from the RootQuery, check if the user + * has the 'edit_posts' capability + */ + } elseif ( ! current_user_can( 'edit_posts' ) ) { + $this->should_execute = false; + } + } + + return $this->should_execute; + } + + /** + * Here, we map the args from the input, then we make sure that we're only querying + * for IDs. The IDs are then passed down the resolve tree, and deferred resolvers + * handle batch resolution of the posts. + * + * @return array + */ + public function get_query_args() { + /** + * Prepare for later use + */ + $last = ! empty( $this->args['last'] ) ? $this->args['last'] : null; + $first = ! empty( $this->args['first'] ) ? $this->args['first'] : null; + + $query_args = []; + /** + * Ignore sticky posts by default + */ + $query_args['ignore_sticky_posts'] = true; + + /** + * Set the post_type for the query based on the type of post being queried + */ + $query_args['post_type'] = ! empty( $this->post_type ) ? $this->post_type : 'post'; + + /** + * Don't calculate the total rows, it's not needed and can be expensive + */ + $query_args['no_found_rows'] = true; + + /** + * Set the post_status to "publish" by default + */ + $query_args['post_status'] = 'publish'; + + /** + * Set posts_per_page the highest value of $first and $last, with a (filterable) max of 100 + */ + $query_args['posts_per_page'] = $this->one_to_one ? 1 : min( max( absint( $first ), absint( $last ), 10 ), $this->query_amount ) + 1; + + // set the graphql cursor args + $query_args['graphql_cursor_compare'] = ( ! empty( $last ) ) ? '>' : '<'; + $query_args['graphql_after_cursor'] = $this->get_after_offset(); + $query_args['graphql_before_cursor'] = $this->get_before_offset(); + + /** + * If the cursor offsets not empty, + * ignore sticky posts on the query + */ + if ( ! empty( $this->get_after_offset() ) || ! empty( $this->get_after_offset() ) ) { + $query_args['ignore_sticky_posts'] = true; + } + + /** + * Pass the graphql $args to the WP_Query + */ + $query_args['graphql_args'] = $this->args; + + /** + * Collect the input_fields and sanitize them to prepare them for sending to the WP_Query + */ + $input_fields = []; + if ( ! empty( $this->args['where'] ) ) { + $input_fields = $this->sanitize_input_fields( $this->args['where'] ); + } + + /** + * If the post_type is "attachment" set the default "post_status" $query_arg to "inherit" + */ + if ( 'attachment' === $this->post_type || 'revision' === $this->post_type ) { + $query_args['post_status'] = 'inherit'; + } + + /** + * Unset the "post_parent" for attachments, as we don't really care if they + * have a post_parent set by default + */ + if ( 'attachment' === $this->post_type && isset( $input_fields['parent'] ) ) { + unset( $input_fields['parent'] ); + } + + /** + * Merge the input_fields with the default query_args + */ + if ( ! empty( $input_fields ) ) { + $query_args = array_merge( $query_args, $input_fields ); + } + + /** + * If the query is a search, the source is not another Post, and the parent input $arg is not + * explicitly set in the query, unset the $query_args['post_parent'] so the search + * can search all posts, not just top level posts. + */ + if ( ! $this->source instanceof \WP_Post && isset( $query_args['search'] ) && ! isset( $input_fields['parent'] ) ) { + unset( $query_args['post_parent'] ); + } + + /** + * If the query contains search default the results to + */ + if ( isset( $query_args['search'] ) && ! empty( $query_args['search'] ) ) { + /** + * Don't order search results by title (causes funky issues with cursors) + */ + $query_args['search_orderby_title'] = false; + $query_args['orderby'] = 'date'; + $query_args['order'] = isset( $last ) ? 'ASC' : 'DESC'; + } + + if ( empty( $this->args['where']['orderby'] ) && ! empty( $query_args['post__in'] ) ) { + $post_in = $query_args['post__in']; + // Make sure the IDs are integers + $post_in = array_map( + static function ( $id ) { + return absint( $id ); + }, + $post_in + ); + + // If we're coming backwards, let's reverse the IDs + if ( ! empty( $this->args['last'] ) || ! empty( $this->args['before'] ) ) { + $post_in = array_reverse( $post_in ); + } + + $cursor_offset = $this->get_offset_for_cursor( $this->args['after'] ?? ( $this->args['before'] ?? 0 ) ); + + if ( ! empty( $cursor_offset ) ) { + // Determine if the offset is in the array + $key = array_search( $cursor_offset, $post_in, true ); + + // If the offset is in the array + if ( false !== $key ) { + $key = absint( $key ); + $post_in = array_slice( $post_in, $key + 1, null, true ); + } + } + + $query_args['post__in'] = $post_in; + $query_args['orderby'] = 'post__in'; + $query_args['order'] = isset( $last ) ? 'ASC' : 'DESC'; + } + + /** + * Map the orderby inputArgs to the WP_Query + */ + if ( isset( $this->args['where']['orderby'] ) && is_array( $this->args['where']['orderby'] ) ) { + $query_args['orderby'] = []; + + foreach ( $this->args['where']['orderby'] as $orderby_input ) { + // Create a type hint for orderby_input. This is an array with a field and order key. + /** @var array $orderby_input */ + if ( empty( $orderby_input['field'] ) ) { + continue; + } + + /** + * These orderby options should not include the order parameter. + */ + if ( in_array( + $orderby_input['field'], + [ + 'post__in', + 'post_name__in', + 'post_parent__in', + ], + true + ) ) { + $query_args['orderby'] = esc_sql( $orderby_input['field'] ); + + // If we're ordering explicitly, there's no reason to check other orderby inputs. + break; + } + + $order = $orderby_input['order']; + + if ( isset( $query_args['graphql_args']['last'] ) && ! empty( $query_args['graphql_args']['last'] ) ) { + if ( 'ASC' === $order ) { + $order = 'DESC'; + } else { + $order = 'ASC'; + } + } + + $query_args['orderby'][ esc_sql( $orderby_input['field'] ) ] = esc_sql( $order ); + } + } + + /** + * Convert meta_value_num to separate meta_value value field which our + * graphql_wp_term_query_cursor_pagination_support knowns how to handle + */ + if ( isset( $query_args['orderby'] ) && 'meta_value_num' === $query_args['orderby'] ) { + $query_args['orderby'] = [ + 'meta_value' => empty( $query_args['order'] ) ? 'DESC' : $query_args['order'], // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value + ]; + unset( $query_args['order'] ); + $query_args['meta_type'] = 'NUMERIC'; + } + + /** + * If there's no orderby params in the inputArgs, set order based on the first/last argument + */ + if ( empty( $query_args['orderby'] ) ) { + $query_args['order'] = ! empty( $last ) ? 'ASC' : 'DESC'; + } + + /** + * NOTE: Only IDs should be queried here as the Deferred resolution will handle + * fetching the full objects, either from cache of from a follow-up query to the DB + */ + $query_args['fields'] = 'ids'; + + /** + * Filter the $query args to allow folks to customize queries programmatically + * + * @param array $query_args The args that will be passed to the WP_Query + * @param mixed $source The source that's passed down the GraphQL queries + * @param array $args The inputArgs on the field + * @param \WPGraphQL\AppContext $context The AppContext passed down the GraphQL tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the GraphQL tree + */ + return apply_filters( 'graphql_post_object_connection_query_args', $query_args, $this->source, $this->args, $this->context, $this->info ); + } + + /** + * This sets up the "allowed" args, and translates the GraphQL-friendly keys to WP_Query + * friendly keys. There's probably a cleaner/more dynamic way to approach this, but + * this was quick. I'd be down to explore more dynamic ways to map this, but for + * now this gets the job done. + * + * @param array $where_args The args passed to the connection + * + * @return array + * @since 0.0.5 + */ + public function sanitize_input_fields( array $where_args ) { + $arg_mapping = [ + 'authorIn' => 'author__in', + 'authorName' => 'author_name', + 'authorNotIn' => 'author__not_in', + 'categoryId' => 'cat', + 'categoryIn' => 'category__in', + 'categoryName' => 'category_name', + 'categoryNotIn' => 'category__not_in', + 'contentTypes' => 'post_type', + 'dateQuery' => 'date_query', + 'hasPassword' => 'has_password', + 'id' => 'p', + 'in' => 'post__in', + 'mimeType' => 'post_mime_type', + 'nameIn' => 'post_name__in', + 'notIn' => 'post__not_in', + 'parent' => 'post_parent', + 'parentIn' => 'post_parent__in', + 'parentNotIn' => 'post_parent__not_in', + 'password' => 'post_password', + 'search' => 's', + 'stati' => 'post_status', + 'status' => 'post_status', + 'tagId' => 'tag_id', + 'tagIds' => 'tag__and', + 'tagIn' => 'tag__in', + 'tagNotIn' => 'tag__not_in', + 'tagSlugAnd' => 'tag_slug__and', + 'tagSlugIn' => 'tag_slug__in', + ]; + + /** + * Map and sanitize the input args to the WP_Query compatible args + */ + $query_args = Utils::map_input( $where_args, $arg_mapping ); + + if ( ! empty( $query_args['post_status'] ) ) { + $allowed_stati = $this->sanitize_post_stati( $query_args['post_status'] ); + $query_args['post_status'] = ! empty( $allowed_stati ) ? $allowed_stati : [ 'publish' ]; + } + + /** + * Filter the input fields + * This allows plugins/themes to hook in and alter what $args should be allowed to be passed + * from a GraphQL Query to the WP_Query + * + * @param array $query_args The mapped query arguments + * @param array $args Query "where" args + * @param mixed $source The query results for a query calling this + * @param array $all_args All of the arguments for the query (not just the "where" args) + * @param \WPGraphQL\AppContext $context The AppContext object + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * @param mixed|string|array $post_type The post type for the query + * + * @return array + * @since 0.0.5 + */ + $query_args = apply_filters( 'graphql_map_input_fields_to_wp_query', $query_args, $where_args, $this->source, $this->args, $this->context, $this->info, $this->post_type ); + + /** + * Return the Query Args + */ + return ! empty( $query_args ) && is_array( $query_args ) ? $query_args : []; + } + + /** + * Limit the status of posts a user can query. + * + * By default, published posts are public, and other statuses require permission to access. + * + * This strips the status from the query_args if the user doesn't have permission to query for + * posts of that status. + * + * @param mixed $stati The status(es) to sanitize + * + * @return array|null + */ + public function sanitize_post_stati( $stati ) { + + /** + * If no stati is explicitly set by the input, default to publish. This will be the + * most common scenario. + */ + if ( empty( $stati ) ) { + $stati = [ 'publish' ]; + } + + /** + * Parse the list of stati + */ + $statuses = wp_parse_slug_list( $stati ); + + /** + * Get the Post Type object + */ + $post_type_objects = []; + if ( is_array( $this->post_type ) ) { + foreach ( $this->post_type as $post_type ) { + $post_type_objects[] = get_post_type_object( $post_type ); + } + } else { + $post_type_objects[] = get_post_type_object( $this->post_type ); + } + + /** + * Make sure the statuses are allowed to be queried by the current user. If so, allow it, + * otherwise return null, effectively removing it from the $allowed_statuses that will + * be passed to WP_Query + */ + $allowed_statuses = array_filter( + array_map( + static function ( $status ) use ( $post_type_objects ) { + foreach ( $post_type_objects as $post_type_object ) { + if ( 'publish' === $status ) { + return $status; + } + + if ( 'private' === $status && ( ! isset( $post_type_object->cap->read_private_posts ) || ! current_user_can( $post_type_object->cap->read_private_posts ) ) ) { + return null; + } + + if ( ! isset( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->edit_posts ) ) { + return null; + } + + return $status; + } + }, + $statuses + ) + ); + + /** + * If there are no allowed statuses to pass to WP_Query, prevent the connection + * from executing + * + * For example, if a subscriber tries to query: + * + * { + * posts( where: { stati: [ DRAFT ] } ) { + * ...fields + * } + * } + * + * We can safely prevent the execution of the query because they are asking for content + * in a status that we know they can't ask for. + */ + if ( empty( $allowed_statuses ) ) { + $this->should_execute = false; + } + + /** + * Return the $allowed_statuses to the query args + */ + return $allowed_statuses; + } + + /** + * Filters the GraphQL args before they are used in get_query_args(). + * + * @return array + */ + public function get_args(): array { + $args = $this->args; + + if ( ! empty( $args['where'] ) ) { + // Ensure all IDs are converted to database IDs. + foreach ( $args['where'] as $input_key => $input_value ) { + if ( empty( $input_value ) ) { + continue; + } + + switch ( $input_key ) { + case 'in': + case 'notIn': + case 'parent': + case 'parentIn': + case 'parentNotIn': + case 'authorIn': + case 'authorNotIn': + case 'categoryIn': + case 'categoryNotIn': + case 'tagId': + case 'tagIn': + case 'tagNotIn': + if ( is_array( $input_value ) ) { + $args['where'][ $input_key ] = array_map( + static function ( $id ) { + return Utils::get_database_id_from_id( $id ); + }, + $input_value + ); + break; + } + + $args['where'][ $input_key ] = Utils::get_database_id_from_id( $input_value ); + break; + } + } + } + + /** + * + * Filters the GraphQL args before they are used in get_query_args(). + * + * @param array $args The GraphQL args passed to the resolver. + * @param \WPGraphQL\Data\Connection\PostObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver. + * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. + * + * @since 1.11.0 + */ + return apply_filters( 'graphql_post_object_connection_args', $args, $this, $this->args ); + } + + /** + * Determine whether or not the the offset is valid, i.e the post corresponding to the offset + * exists. Offset is equivalent to post_id. So this function is equivalent to checking if the + * post with the given ID exists. + * + * @param int $offset The ID of the node used in the cursor offset + * + * @return bool + */ + public function is_valid_offset( $offset ) { + return (bool) get_post( absint( $offset ) ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/TaxonomyConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/TaxonomyConnectionResolver.php new file mode 100644 index 00000000..76235289 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/TaxonomyConnectionResolver.php @@ -0,0 +1,90 @@ +query; + + if ( empty( $queried ) ) { + return $ids; + } + + foreach ( $queried as $item ) { + $ids[] = $item; + } + + return $ids; + } + + /** + * {@inheritDoc} + */ + public function get_query_args() { + // If any args are added to filter/sort the connection + return []; + } + + + /** + * Get the items from the source + * + * @return array + */ + public function get_query() { + if ( isset( $this->query_args['name'] ) ) { + return [ $this->query_args['name'] ]; + } + + if ( isset( $this->query_args['in'] ) ) { + return is_array( $this->query_args['in'] ) ? $this->query_args['in'] : [ $this->query_args['in'] ]; + } + + $query_args = $this->query_args; + return \WPGraphQL::get_allowed_taxonomies( 'names', $query_args ); + } + + /** + * The name of the loader to load the data + * + * @return string + */ + public function get_loader_name() { + return 'taxonomy'; + } + + /** + * Determine if the offset used for pagination is valid + * + * @param mixed $offset + * + * @return bool + */ + public function is_valid_offset( $offset ) { + return (bool) get_taxonomy( $offset ); + } + + /** + * Determine if the query should execute + * + * @return bool + */ + public function should_execute() { + return true; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/TermObjectConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/TermObjectConnectionResolver.php new file mode 100644 index 00000000..c0b4583b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/TermObjectConnectionResolver.php @@ -0,0 +1,324 @@ +taxonomy = $taxonomy; + parent::__construct( $source, $args, $context, $info ); + } + + /** + * {@inheritDoc} + */ + public function get_query_args() { + $all_taxonomies = \WPGraphQL::get_allowed_taxonomies(); + $taxonomy = ! empty( $this->taxonomy ) && in_array( $this->taxonomy, $all_taxonomies, true ) ? [ $this->taxonomy ] : $all_taxonomies; + + if ( ! empty( $this->args['where']['taxonomies'] ) ) { + /** + * Set the taxonomy for the $args + */ + $requested_taxonomies = $this->args['where']['taxonomies']; + $taxonomy = array_intersect( $all_taxonomies, $requested_taxonomies ); + } + + + $query_args = [ + 'taxonomy' => $taxonomy, + ]; + + /** + * Prepare for later use + */ + $last = ! empty( $this->args['last'] ) ? $this->args['last'] : null; + $first = ! empty( $this->args['first'] ) ? $this->args['first'] : null; + + /** + * Set hide_empty as false by default + */ + $query_args['hide_empty'] = false; + + /** + * Set the number, ensuring it doesn't exceed the amount set as the $max_query_amount + */ + $query_args['number'] = min( max( absint( $first ), absint( $last ), 10 ), $this->query_amount ) + 1; + + /** + * Don't calculate the total rows, it's not needed and can be expensive + */ + $query_args['count'] = false; + + /** + * Take any of the $args that were part of the GraphQL query and map their + * GraphQL names to the WP_Term_Query names to be used in the WP_Term_Query + * + * @since 0.0.5 + */ + $input_fields = []; + if ( ! empty( $this->args['where'] ) ) { + $input_fields = $this->sanitize_input_fields(); + } + + /** + * Merge the default $query_args with the $args that were entered + * in the query. + * + * @since 0.0.5 + */ + if ( ! empty( $input_fields ) ) { + $query_args = array_merge( $query_args, $input_fields ); + } + + $query_args['graphql_cursor_compare'] = ( ! empty( $last ) ) ? '>' : '<'; + $query_args['graphql_after_cursor'] = $this->get_after_offset(); + $query_args['graphql_before_cursor'] = $this->get_before_offset(); + + /** + * Pass the graphql $args to the WP_Query + */ + $query_args['graphql_args'] = $this->args; + + /** + * NOTE: We query for JUST the IDs here as deferred resolution of the nodes gets the full + * object from the cache or a follow-up request for the full object if it's not cached. + */ + $query_args['fields'] = 'ids'; + + /** + * If there's no orderby params in the inputArgs, default to ordering by name. + */ + if ( empty( $query_args['orderby'] ) ) { + $query_args['orderby'] = 'name'; + } + + /** + * If orderby params set but not order, default to ASC if going forward, DESC if going backward. + */ + if ( empty( $query_args['order'] ) && 'name' === $query_args['orderby'] ) { + $query_args['order'] = ! empty( $last ) ? 'DESC' : 'ASC'; + } elseif ( empty( $query_args['order'] ) ) { + $query_args['order'] = ! empty( $last ) ? 'ASC' : 'DESC'; + } + + /** + * Filter the query_args that should be applied to the query. This filter is applied AFTER the input args from + * the GraphQL Query have been applied and has the potential to override the GraphQL Query Input Args. + * + * @param array $query_args array of query_args being passed to the + * @param mixed $source source passed down from the resolve tree + * @param array $args array of arguments input in the field as part of the GraphQL query + * @param \WPGraphQL\AppContext $context object passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info info about fields passed down the resolve tree + * + * @since 0.0.6 + */ + $query_args = apply_filters( 'graphql_term_object_connection_query_args', $query_args, $this->source, $this->args, $this->context, $this->info ); + + return $query_args; + } + + /** + * Return an instance of WP_Term_Query with the args mapped to the query + * + * @return \WP_Term_Query + * @throws \Exception + */ + public function get_query() { + return new \WP_Term_Query( $this->query_args ); + } + + /** + * {@inheritDoc} + */ + public function get_ids_from_query() { + /** @var string[] $ids **/ + $ids = ! empty( $this->query->get_terms() ) ? $this->query->get_terms() : []; + + // If we're going backwards, we need to reverse the array. + if ( ! empty( $this->args['last'] ) ) { + $ids = array_reverse( $ids ); + } + + return $ids; + } + + /** + * {@inheritDoc} + */ + public function get_loader_name() { + return 'term'; + } + + /** + * Whether the connection query should execute. Certain contexts _may_ warrant + * restricting the query to execute at all. Default is true, meaning any time + * a TermObjectConnection resolver is asked for, it will execute. + * + * @return bool + */ + public function should_execute() { + return true; + } + + /** + * This maps the GraphQL "friendly" args to get_terms $args. + * There's probably a cleaner/more dynamic way to approach this, but this was quick. I'd be down + * to explore more dynamic ways to map this, but for now this gets the job done. + * + * @since 0.0.5 + * @return array + */ + public function sanitize_input_fields() { + $arg_mapping = [ + 'objectIds' => 'object_ids', + 'hideEmpty' => 'hide_empty', + 'excludeTree' => 'exclude_tree', + 'termTaxonomId' => 'term_taxonomy_id', + 'termTaxonomyId' => 'term_taxonomy_id', + 'nameLike' => 'name__like', + 'descriptionLike' => 'description__like', + 'padCounts' => 'pad_counts', + 'childOf' => 'child_of', + 'cacheDomain' => 'cache_domain', + 'updateTermMetaCache' => 'update_term_meta_cache', + 'taxonomies' => 'taxonomy', + ]; + + $where_args = ! empty( $this->args['where'] ) ? $this->args['where'] : null; + + // Deprecate usage of 'termTaxonomId'. + if ( ! empty( $where_args['termTaxonomId'] ) ) { + _deprecated_argument( 'where.termTaxonomId', '1.11.0', 'The `termTaxonomId` where arg is deprecated. Use `termTaxonomyId` instead.' ); + + // Only convert value if 'termTaxonomyId' isnt already set. + if ( empty( $where_args['termTaxonomyId'] ) ) { + $where_args['termTaxonomyId'] = $where_args['termTaxonomId']; + } + } + + /** + * Map and sanitize the input args to the WP_Term_Query compatible args + */ + $query_args = Utils::map_input( $where_args, $arg_mapping ); + + /** + * Filter the input fields + * This allows plugins/themes to hook in and alter what $args should be allowed to be passed + * from a GraphQL Query to the get_terms query + * + * @param array $query_args Array of mapped query args + * @param array $where_args Array of query "where" args + * @param string $taxonomy The name of the taxonomy + * @param mixed $source The query results + * @param array $all_args All of the query arguments (not just the "where" args) + * @param \WPGraphQL\AppContext $context The AppContext object + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * + * @since 0.0.5 + * @return array + */ + $query_args = apply_filters( 'graphql_map_input_fields_to_get_terms', $query_args, $where_args, $this->taxonomy, $this->source, $this->args, $this->context, $this->info ); + + return ! empty( $query_args ) && is_array( $query_args ) ? $query_args : []; + } + + /** + * Filters the GraphQL args before they are used in get_query_args(). + * + * @return array + */ + public function get_args(): array { + $args = $this->args; + + if ( ! empty( $args['where'] ) ) { + // Ensure all IDs are converted to database IDs. + foreach ( $args['where'] as $input_key => $input_value ) { + if ( empty( $input_value ) ) { + continue; + } + + switch ( $input_key ) { + case 'exclude': + case 'excludeTree': + case 'include': + case 'objectIds': + case 'termTaxonomId': + case 'termTaxonomyId': + if ( is_array( $input_value ) ) { + $args['where'][ $input_key ] = array_map( + static function ( $id ) { + return Utils::get_database_id_from_id( $id ); + }, + $input_value + ); + break; + } + + $args['where'][ $input_key ] = Utils::get_database_id_from_id( $input_value ); + break; + } + } + } + + /** + * + * Filters the GraphQL args before they are used in get_query_args(). + * + * @param array $args The GraphQL args passed to the resolver. + * @param \WPGraphQL\Data\Connection\TermObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver + * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. + * + * @since 1.11.0 + */ + return apply_filters( 'graphql_term_object_connection_args', $args, $this, $this->args ); + } + + /** + * Determine whether or not the the offset is valid, i.e the term corresponding to the offset + * exists. Offset is equivalent to term_id. So this function is equivalent to checking if the + * term with the given ID exists. + * + * @param int $offset The ID of the node used in the cursor for offset + * + * @return bool + */ + public function is_valid_offset( $offset ) { + return get_term( absint( $offset ) ) instanceof \WP_Term; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/ThemeConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/ThemeConnectionResolver.php new file mode 100644 index 00000000..0c08f4c1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/ThemeConnectionResolver.php @@ -0,0 +1,88 @@ +query ) ? $this->query : []; + + if ( empty( $queried ) ) { + return $ids; + } + + foreach ( $queried as $key => $item ) { + $ids[ $key ] = $item; + } + + return $ids; + } + + /** + * {@inheritDoc} + */ + public function get_query_args() { + $query_args = [ + 'allowed' => null, + ]; + + return $query_args; + } + + + /** + * Get the items from the source + * + * @return array + */ + public function get_query() { + $query_args = $this->query_args; + + return array_keys( wp_get_themes( $query_args ) ); + } + + /** + * The name of the loader to load the data + * + * @return string + */ + public function get_loader_name() { + return 'theme'; + } + + /** + * Determine if the offset used for pagination is valid + * + * @param mixed $offset + * + * @return bool + */ + public function is_valid_offset( $offset ) { + $theme = wp_get_theme( $offset ); + return $theme->exists(); + } + + /** + * Determine if the query should execute + * + * @return bool + */ + public function should_execute() { + return true; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/UserConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/UserConnectionResolver.php new file mode 100644 index 00000000..7a02db68 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/UserConnectionResolver.php @@ -0,0 +1,299 @@ +args['last'] ) ? $this->args['last'] : null; + + /** + * Set the $query_args based on various defaults and primary input $args + */ + $query_args['count_total'] = false; + + /** + * Pass the graphql $args to the WP_Query + */ + $query_args['graphql_args'] = $this->args; + + /** + * Set the graphql_cursor_compare to determine what direction the + * query should be paginated + */ + $query_args['graphql_cursor_compare'] = ( ! empty( $last ) ) ? '>' : '<'; + + $query_args['graphql_after_cursor'] = $this->get_after_offset(); + $query_args['graphql_before_cursor'] = $this->get_before_offset(); + + /** + * Set the number, ensuring it doesn't exceed the amount set as the $max_query_amount + * + * We query one extra than what is being asked for so that we can determine if there is a next + * page. + */ + $query_args['number'] = $this->get_query_amount() + 1; + + /** + * Take any of the input $args (under the "where" input) that were part of the GraphQL query and map and + * sanitize their GraphQL input to apply to the WP_Query + */ + $input_fields = []; + if ( ! empty( $this->args['where'] ) ) { + $input_fields = $this->sanitize_input_fields( $this->args['where'] ); + } + + /** + * Merge the default $query_args with the $args that were entered in the query. + * + * @since 0.0.5 + */ + if ( ! empty( $input_fields ) ) { + $query_args = array_merge( $query_args, $input_fields ); + } + + /** + * Only query the IDs and let deferred resolution query the nodes + */ + $query_args['fields'] = 'ID'; + + /** + * If the request is not authenticated, limit the query to users that have + * published posts, as they're considered publicly facing users. + */ + if ( ! is_user_logged_in() && empty( $query_args['has_published_posts'] ) ) { + $query_args['has_published_posts'] = true; + } + + /** + * If `has_published_posts` is set to `attachment`, throw a warning. + * + * @todo Remove this when the `hasPublishedPosts` enum type changes. + * + * @see https://github.com/wp-graphql/wp-graphql/issues/2963 + */ + if ( ! empty( $query_args['has_published_posts'] ) && 'attachment' === $query_args['has_published_posts'] ) { + graphql_debug( + __( 'The `hasPublishedPosts` where arg does not support the `ATTACHMENT` value, and will be removed from the possible enum values in a future release.', 'wp-graphql' ), + [ + 'operationName' => $this->context->operationName ?? '', + 'query' => $this->context->query ?? '', + 'variables' => $this->context->variables ?? '', + ] + ); + } + + if ( ! empty( $query_args['search'] ) ) { + $query_args['search'] = '*' . $query_args['search'] . '*'; + $query_args['orderby'] = 'user_login'; + $query_args['order'] = ! empty( $last ) ? 'DESC' : 'ASC'; + } + + /** + * Map the orderby inputArgs to the WP_User_Query + */ + if ( ! empty( $this->args['where']['orderby'] ) && is_array( $this->args['where']['orderby'] ) ) { + foreach ( $this->args['where']['orderby'] as $orderby_input ) { + /** + * These orderby options should not include the order parameter. + */ + if ( in_array( + $orderby_input['field'], + [ + 'login__in', + 'nicename__in', + ], + true + ) ) { + $query_args['orderby'] = esc_sql( $orderby_input['field'] ); + } elseif ( ! empty( $orderby_input['field'] ) ) { + $order = $orderby_input['order']; + if ( ! empty( $this->args['last'] ) ) { + if ( 'ASC' === $order ) { + $order = 'DESC'; + } else { + $order = 'ASC'; + } + } + + $query_args['orderby'] = esc_sql( $orderby_input['field'] ); + $query_args['order'] = esc_sql( $order ); + } + } + } + + /** + * Convert meta_value_num to separate meta_value value field which our + * graphql_wp_term_query_cursor_pagination_support knowns how to handle + */ + if ( isset( $query_args['orderby'] ) && 'meta_value_num' === $query_args['orderby'] ) { + $query_args['orderby'] = [ + 'meta_value' => empty( $query_args['order'] ) ? 'DESC' : $query_args['order'], // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value + ]; + unset( $query_args['order'] ); + $query_args['meta_type'] = 'NUMERIC'; + } + + /** + * If there's no orderby params in the inputArgs, set order based on the first/last argument + */ + if ( empty( $query_args['order'] ) ) { + $query_args['order'] = ! empty( $last ) ? 'DESC' : 'ASC'; + } + + return $query_args; + } + + /** + * Return an instance of the WP_User_Query with the args for the connection being executed + * + * @return object|\WP_User_Query + * @throws \Exception + */ + public function get_query() { + // Get query class. + $queryClass = ! empty( $this->context->queryClass ) + ? $this->context->queryClass + : '\WP_User_Query'; + + return new $queryClass( $this->query_args ); + } + + /** + * Returns an array of ids from the query being executed. + * + * @return array + */ + public function get_ids_from_query() { + $ids = method_exists( $this->query, 'get_results' ) ? $this->query->get_results() : []; + + // If we're going backwards, we need to reverse the array. + if ( ! empty( $this->args['last'] ) ) { + $ids = array_reverse( $ids ); + } + + return $ids; + } + + /** + * This sets up the "allowed" args, and translates the GraphQL-friendly keys to WP_User_Query + * friendly keys. + * + * There's probably a cleaner/more dynamic way to approach this, but this was quick. I'd be + * down to explore more dynamic ways to map this, but for now this gets the job done. + * + * @param array $args The query "where" args + * + * @return array + * @since 0.0.5 + */ + protected function sanitize_input_fields( array $args ) { + + /** + * Only users with the "list_users" capability can filter users by roles + */ + if ( + ( + ! empty( $args['roleIn'] ) || + ! empty( $args['roleNotIn'] ) || + ! empty( $args['role'] ) + ) && + ! current_user_can( 'list_users' ) + ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to filter users by role.', 'wp-graphql' ) ); + } + + $arg_mapping = [ + 'roleIn' => 'role__in', + 'roleNotIn' => 'role__not_in', + 'searchColumns' => 'search_columns', + 'hasPublishedPosts' => 'has_published_posts', + 'nicenameIn' => 'nicename__in', + 'nicenameNotIn' => 'nicename__not_in', + 'loginIn' => 'login__in', + 'loginNotIn' => 'login__not_in', + ]; + + /** + * Map and sanitize the input args to the WP_User_Query compatible args + */ + $query_args = Utils::map_input( $args, $arg_mapping ); + + /** + * Filter the input fields + * + * This allows plugins/themes to hook in and alter what $args should be allowed to be passed + * from a GraphQL Query to the WP_User_Query + * + * @param array $query_args The mapped query args + * @param array $args The query "where" args + * @param mixed $source The query results of the query calling this relation + * @param array $all_args Array of all the query args (not just the "where" args) + * @param \WPGraphQL\AppContext $context The AppContext object + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * + * @return array + * @since 0.0.5 + */ + $query_args = apply_filters( 'graphql_map_input_fields_to_wp_user_query', $query_args, $args, $this->source, $this->args, $this->context, $this->info ); + + return ! empty( $query_args ) && is_array( $query_args ) ? $query_args : []; + } + + /** + * Determine whether or not the the offset is valid, i.e the user corresponding to the offset + * exists. Offset is equivalent to user_id. So this function is equivalent to checking if the + * user with the given ID exists. + * + * @param int $offset The ID of the node used as the offset in the cursor + * + * @return bool + */ + public function is_valid_offset( $offset ) { + return (bool) get_user_by( 'ID', absint( $offset ) ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/UserRoleConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/UserRoleConnectionResolver.php new file mode 100644 index 00000000..be0c9946 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Connection/UserRoleConnectionResolver.php @@ -0,0 +1,97 @@ +query_args['slugIn'] ) ) { + return $this->query_args['slugIn']; + } + + $ids = []; + $queried = $this->get_query(); + + if ( empty( $queried ) ) { + return $ids; + } + + foreach ( $queried as $key => $item ) { + $ids[ $key ] = $item; + } + + return $ids; + } + + /** + * {@inheritDoc} + */ + public function get_query_args() { + // If any args are added to filter/sort the connection + return []; + } + + /** + * {@inheritDoc} + * + * @return array + */ + public function get_query() { + $wp_roles = wp_roles(); + $roles = ! empty( $wp_roles->get_names() ) ? array_keys( $wp_roles->get_names() ) : []; + + return $roles; + } + + /** + * {@inheritDoc} + */ + public function get_loader_name() { + return 'user_role'; + } + + /** + * @param mixed $offset Whether the provided offset is valid for the connection + * + * @return bool + */ + public function is_valid_offset( $offset ) { + return (bool) get_role( $offset ); + } + + /** + * @return bool + */ + public function should_execute() { + if ( + current_user_can( 'list_users' ) || + ( + $this->source instanceof User && + get_current_user_id() === $this->source->userId + ) + ) { + return true; + } + + return false; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/AbstractCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/AbstractCursor.php new file mode 100644 index 00000000..309a2f09 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Cursor/AbstractCursor.php @@ -0,0 +1,329 @@ +wpdb = $wpdb; + $this->query_vars = $query_vars; + $this->cursor = $cursor; + + /** + * Get the cursor offset if any + */ + $offset = $this->get_query_var( 'graphql_' . $cursor . '_cursor' ); + + // Handle deprecated use of `graphql_cursor_offset`. + if ( empty( $offset ) ) { + $offset = $this->get_query_var( 'graphql_cursor_offset' ); + + if ( ! empty( $offset ) ) { + _doing_it_wrong( self::class . "::get_query_var('graphql_cursor_offset')", "Use 'graphql_before_cursor' or 'graphql_after_cursor' instead.", '1.9.0' ); + } + } + + $this->cursor_offset = ! empty( $offset ) ? absint( $offset ) : 0; + + // Get the WP Object for the cursor. + $this->cursor_node = $this->get_cursor_node(); + + // Get the direction for the builder query. + $this->compare = $this->get_cursor_compare(); + + $this->builder = new CursorBuilder( $this->compare ); + } + + /** + * Get the query variable for the provided name. + * + * @param string $name . + * + * @return mixed|null + */ + public function get_query_var( string $name ) { + if ( isset( $this->query_vars[ $name ] ) && '' !== $this->query_vars[ $name ] ) { + return $this->query_vars[ $name ]; + } + return null; + } + + /** + * Get the direction pagination is going in. + * + * @return string + */ + public function get_cursor_compare() { + if ( 'before' === $this->cursor ) { + return '>'; + } + + return '<'; + } + + /** + * Ensure the cursor_offset is a positive integer and we have a valid object for our cursor node. + * + * @return bool + */ + protected function is_valid_offset_and_node() { + if ( + ! is_int( $this->cursor_offset ) || + 0 >= $this->cursor_offset || + ! $this->cursor_node + ) { + return false; + } + + return true; + } + + /** + * Validates cursor compare field configuration. Validation failure results in a fatal + * error because query execution is guaranteed to fail. + * + * @param array|mixed $field Threshold configuration. + * + * @throws \GraphQL\Error\InvariantViolation Invalid configuration format. + * + * @return void + */ + protected function validate_cursor_compare_field( $field ): void { + // Throw if an array not provided. + if ( ! is_array( $field ) ) { + throw new InvariantViolation( + esc_html( + sprintf( + /* translators: %1$s: Cursor class name. %2$s: value type. */ + __( 'Invalid value provided for %1$s cursor compare field. Expected Array, %2$s given.', 'wp-graphql' ), + static::class, + gettype( $field ) + ) + ) + ); + } + + // Guard against missing or invalid "table column". + if ( empty( $field['key'] ) || ! is_string( $field['key'] ) ) { + throw new InvariantViolation( + esc_html( + sprintf( + /* translators: %s: Cursor class name. */ + __( 'Expected "key" value to be provided for %s cursor compare field. A string value must be given.', 'wp-graphql' ), + static::class + ) + ) + ); + } + + // Guard against missing or invalid "by". + if ( ! isset( $field['value'] ) ) { + throw new InvariantViolation( + esc_html( + sprintf( + /* translators: %s: Cursor class name. */ + __( 'Expected "value" value to be provided for %s cursor compare field. A scalar value must be given.', 'wp-graphql' ), + static::class + ) + ) + ); + } + + // Guard against invalid "type". + if ( ! empty( $field['type'] ) && ! is_string( $field['type'] ) ) { + throw new InvariantViolation( + esc_html( + sprintf( + /* translators: %s: Cursor class name. */ + __( 'Invalid value provided for "type" value to be provided for type of %s cursor compare field. A string value must be given.', 'wp-graphql' ), + static::class + ) + ) + ); + } + + // Guard against invalid "order". + if ( ! empty( $field['order'] ) && ! in_array( strtoupper( $field['order'] ), [ 'ASC', 'DESC' ], true ) ) { + throw new InvariantViolation( + esc_html( + sprintf( + /* translators: %s: Cursor class name. */ + __( 'Invalid value provided for "order" value to be provided for type of %s cursor compare field. Either "ASC" or "DESC" must be given.', 'wp-graphql' ), + static::class + ) + ) + ); + } + } + + /** + * Returns the ID key. + * + * @return mixed + */ + public function get_cursor_id_key() { + $key = $this->get_query_var( 'graphql_cursor_id_key' ); + if ( null === $key ) { + $key = $this->id_key; + } + + return $key; + } + + /** + * Applies cursor compare fields to the cursor cutoff. + * + * @param array $fallback Fallback cursor compare fields. + * + * @throws \GraphQL\Error\InvariantViolation Invalid configuration format. + */ + protected function compare_with_cursor_fields( $fallback = [] ): void { + /** + * Get cursor compare fields from query vars. + * + * @var array|null $cursor_compare_fields + */ + $cursor_compare_fields = $this->get_query_var( 'graphql_cursor_compare_fields' ); + if ( null === $cursor_compare_fields ) { + $cursor_compare_fields = $fallback; + } + // Bail early if no cursor compare fields. + if ( empty( $cursor_compare_fields ) ) { + return; + } + + if ( ! is_array( $cursor_compare_fields ) ) { + throw new InvariantViolation( + esc_html( + sprintf( + /* translators: %s: value type. */ + __( 'Invalid value provided for graphql_cursor_compare_fields. Expected Array, %s given.', 'wp-graphql' ), + gettype( $cursor_compare_fields ) + ) + ) + ); + } + + // Check if only one cursor compare field provided, wrap it in an array. + if ( ! isset( $cursor_compare_fields[0] ) ) { + $cursor_compare_fields = [ $cursor_compare_fields ]; + } + + foreach ( $cursor_compare_fields as $field ) { + $this->validate_cursor_compare_field( $field ); + + $key = $field['key']; + $value = $field['value']; + $type = ! empty( $field['type'] ) ? $field['type'] : null; + $order = ! empty( $field['order'] ) ? $field['order'] : null; + + $this->builder->add_field( $key, $value, $type, $order ); + } + } + + /** + * Applies ID field to the cursor builder. + */ + protected function compare_with_id_field(): void { + // Get ID value. + $value = $this->get_query_var( 'graphql_cursor_id_value' ); + if ( null === $value ) { + $value = (string) $this->cursor_offset; + } + + // Get ID SQL Query alias. + $key = $this->get_cursor_id_key(); + + $this->builder->add_field( $key, $value, 'ID' ); + } + + /** + * Get the WP Object instance for the cursor. + * + * This is cached internally so it should not generate additionl queries. + * + * @return mixed|null; + */ + abstract public function get_cursor_node(); + + /** + * Return the additional AND operators for the where statement + * + * @return string + */ + abstract public function get_where(); + + /** + * Generate the final SQL string to be appended to WHERE clause + * + * @return string + */ + abstract public function to_sql(); +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/CommentObjectCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/CommentObjectCursor.php new file mode 100644 index 00000000..018d738c --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Cursor/CommentObjectCursor.php @@ -0,0 +1,148 @@ +query_vars; + } + + // Initialize the class properties. + parent::__construct( $query_vars, $cursor ); + + // Set ID Key. + $this->id_key = "{$this->wpdb->comments}.comment_ID"; + } + + /** + * {@inheritDoc} + * + * @return ?\WP_Comment + */ + public function get_cursor_node() { + // Bail if no offset. + if ( ! $this->cursor_offset ) { + return null; + } + + /** + * If pre-hooked, return filtered node. + * + * @param null|\WP_Comment $pre_comment The pre-filtered comment node. + * @param int $offset The cursor offset. + * @param \WPGraphQL\Data\Cursor\CommentObjectCursor $node The cursor instance. + * + * @return null|\WP_Comment + */ + $pre_comment = apply_filters( 'graphql_pre_comment_cursor_node', null, $this->cursor_offset, $this ); + if ( null !== $pre_comment ) { + return $pre_comment; + } + + // Get cursor node. + $comment = WP_Comment::get_instance( $this->cursor_offset ); + + return false !== $comment ? $comment : null; + } + + /** + * {@inheritDoc} + */ + public function get_where() { + // If we have a bad cursor, just skip. + if ( ! $this->is_valid_offset_and_node() ) { + return ''; + } + + $orderby = $this->get_query_var( 'orderby' ); + $order = $this->get_query_var( 'order' ); + + // if there's custom ordering, use it to determine the cursor + if ( ! empty( $orderby ) ) { + $this->compare_with( $orderby, $order ); + } + + /** + * If there's no orderby specified yet, compare with the following fields. + */ + if ( ! $this->builder->has_fields() ) { + $this->compare_with_cursor_fields( + [ + [ + 'key' => "{$this->wpdb->comments}.comment_date", + 'by' => $this->cursor_node ? $this->cursor_node->comment_date : null, + 'type' => 'DATETIME', + ], + ] + ); + } + + $this->compare_with_id_field(); + + return $this->to_sql(); + } + + /** + * Get AND operator for given order by key + * + * @param string $by The order by key + * @param string $order The order direction ASC or DESC + * + * @return void + */ + public function compare_with( $by, $order ) { + // Bail early, if "key" and "value" provided in query_vars. + $key = $this->get_query_var( "graphql_cursor_compare_by_{$by}_key" ); + $value = $this->get_query_var( "graphql_cursor_compare_by_{$by}_value" ); + if ( ! empty( $key ) && ! empty( $value ) ) { + $this->builder->add_field( $key, $value, null, $order ); + return; + } + + $key = "{$this->wpdb->comments}.{$by}"; + $value = $this->cursor_node->{$by}; + $type = null; + + if ( 'comment_date' === $by ) { + $type = 'DATETIME'; + } + + $value = $this->cursor_node->{$by} ?? null; + if ( ! empty( $value ) ) { + $this->builder->add_field( $key, $value, $type ); + return; + } + } + + /** + *{@inheritDoc} + */ + public function to_sql() { + $sql = $this->builder->to_sql(); + return ! empty( $sql ) ? ' AND ' . $sql : ''; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/CursorBuilder.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/CursorBuilder.php new file mode 100644 index 00000000..7c726941 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Cursor/CursorBuilder.php @@ -0,0 +1,176 @@ + + * + * @var string + */ + public $compare; + + /** + * CursorBuilder constructor. + * + * @param string $compare + * + * @return void + */ + public function __construct( $compare = '>' ) { + $this->compare = $compare; + $this->fields = []; + } + + /** + * Add ordering field. The order you call this method matters. First field + * will be the primary field and latter ones will be used if the primary + * field has duplicate values + * + * @param string $key database column + * @param mixed|string|int $value value from the current cursor + * @param string|null $type type cast + * @param string|null $order custom order + * @param object|null $object_cursor The Cursor class + * + * @return void + */ + public function add_field( string $key, $value, string $type = null, string $order = null, $object_cursor = null ) { + + /** + * Filters the field used for ordering when cursors are used for pagination + * + * @param array $field The field key, value, type and order + * @param \WPGraphQL\Data\Cursor\CursorBuilder $cursor_builder The CursorBuilder class + * @param ?object $object_cursor The Cursor class + */ + $field = apply_filters( + 'graphql_cursor_ordering_field', + [ + 'key' => esc_sql( $key ), + 'value' => esc_sql( $value ), + 'type' => ! empty( $type ) ? esc_sql( $type ) : '', + 'order' => ! empty( $order ) ? esc_sql( $order ) : '', + ], + $this, + $object_cursor + ); + + // Bail if the filtered field comes back empty + if ( empty( $field ) ) { + return; + } + + // Bail if the filtered field doesn't come back as an array + if ( ! is_array( $field ) ) { + return; + } + + $escaped_field = []; + + // Escape the filtered array + foreach ( $field as $field_key => $value ) { + $escaped_field[ $field_key ] = esc_sql( $value ); + } + + $this->fields[] = $escaped_field; + } + + /** + * Returns true at least one ordering field has been added + * + * @return boolean + */ + public function has_fields() { + return count( $this->fields ) > 0; + } + + /** + * Generate the final SQL string to be appended to WHERE clause + * + * @param mixed|array|null $fields + * + * @return string + */ + public function to_sql( $fields = null ) { + if ( null === $fields ) { + $fields = $this->fields; + } + + if ( count( $fields ) === 0 ) { + return ''; + } + + $field = $fields[0]; + + $key = $field['key']; + $value = $field['value']; + $type = $field['type']; + $order = $field['order']; + + $compare = $this->compare; + + if ( $order ) { + $compare = 'DESC' === $order ? '<' : '>'; + } + + if ( 'ID' !== $type ) { + $cast = $this->get_cast_for_type( $type ); + if ( 'CHAR' === $cast ) { + $value = '"' . wp_unslash( $value ) . '"'; + } elseif ( $cast ) { + $key = "CAST( $key as $cast )"; + $value = "CAST( '$value' as $cast )"; + } + } + + if ( count( $fields ) === 1 ) { + return " {$key} {$compare} {$value} "; + } + + $nest = $this->to_sql( \array_slice( $fields, 1 ) ); + + $sql = ' %1$s %2$s= %3$s AND ( %1$s %2$s %3$s OR ( %4$s ) ) '; + + return sprintf( $sql, $key, $compare, $value, $nest ); + } + + + /** + * Copied from + * https://github.com/WordPress/WordPress/blob/c4f8bc468db56baa2a3bf917c99cdfd17c3391ce/wp-includes/class-wp-meta-query.php#L272-L296 + * + * It's an instance method. No way to call it without creating the instance? + * + * Return the appropriate alias for the given meta type if applicable. + * + * @param string $type MySQL type to cast meta_value. + * + * @return string MySQL type. + */ + public function get_cast_for_type( $type = '' ) { + if ( empty( $type ) ) { + return 'CHAR'; + } + $meta_type = strtoupper( $type ); + if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) ) { + return 'CHAR'; + } + if ( 'NUMERIC' === $meta_type ) { + $meta_type = 'SIGNED'; + } + + return $meta_type; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/PostObjectCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/PostObjectCursor.php new file mode 100644 index 00000000..70d34143 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Cursor/PostObjectCursor.php @@ -0,0 +1,293 @@ +query_vars; + } + + // Initialize the class properties. + parent::__construct( $query_vars, $cursor ); + + // Set ID key. + $this->id_key = "{$this->wpdb->posts}.ID"; + } + + /** + * {@inheritDoc} + * + * @return ?\WP_Post + */ + public function get_cursor_node() { + // Bail if no offset. + if ( ! $this->cursor_offset ) { + return null; + } + + /** + * If pre-hooked, return filtered node. + * + * @param null|\WP_Post $pre_post The pre-filtered post node. + * @param int $offset The cursor offset. + * @param \WPGraphQL\Data\Cursor\PostObjectCursor $node The cursor instance. + * + * @return null|\WP_Post + */ + $pre_post = apply_filters( 'graphql_pre_post_cursor_node', null, $this->cursor_offset, $this ); + if ( null !== $pre_post ) { + return $pre_post; + } + + // Get cursor node. + $post = \WP_Post::get_instance( $this->cursor_offset ); + + return false !== $post ? $post : null; + } + + /** + * @deprecated 1.9.0 + * + * @return ?\WP_Post + */ + public function get_cursor_post() { + _deprecated_function( __METHOD__, '1.9.0', self::class . '::get_cursor_node()' ); + + return $this->cursor_node; + } + + /** + * {@inheritDoc} + */ + public function to_sql() { + $orderby = isset( $this->query_vars['orderby'] ) ? $this->query_vars['orderby'] : null; + + $orderby_should_not_convert_to_sql = isset( $orderby ) && in_array( + $orderby, + [ + 'post__in', + 'post_name__in', + 'post_parent__in', + ], + true + ); + + if ( true === $orderby_should_not_convert_to_sql ) { + return ''; + } + + $sql = $this->builder->to_sql(); + + if ( empty( $sql ) ) { + return ''; + } + + return ' AND ' . $sql; + } + + /** + * {@inheritDoc} + */ + public function get_where() { + // If we have a bad cursor, just skip. + if ( ! $this->is_valid_offset_and_node() ) { + return ''; + } + + $orderby = $this->get_query_var( 'orderby' ); + $order = $this->get_query_var( 'order' ); + + if ( 'menu_order' === $orderby ) { + if ( '>' === $this->compare ) { + $order = 'DESC'; + $this->compare = '<'; + } elseif ( '<' === $this->compare ) { + $this->compare = '>'; + $order = 'ASC'; + } + } + + if ( ! empty( $orderby ) && is_array( $orderby ) ) { + + /** + * Loop through all order keys if it is an array + */ + foreach ( $orderby as $by => $order ) { + $this->compare_with( $by, $order ); + } + } elseif ( ! empty( $orderby ) && is_string( $orderby ) ) { + + /** + * If $orderby is just a string just compare with it directly as DESC + */ + $this->compare_with( $orderby, $order ); + } + + /** + * If there's no orderby specified yet, compare with the following fields. + */ + if ( ! $this->builder->has_fields() ) { + $this->compare_with_cursor_fields( + [ + [ + 'key' => "{$this->wpdb->posts}.post_date", + 'value' => $this->cursor_node ? $this->cursor_node->post_date : null, + 'type' => 'DATETIME', + ], + ] + ); + } + + $this->compare_with_id_field(); + + return $this->to_sql(); + } + + /** + * Get AND operator for given order by key + * + * @param string $by The order by key + * @param string $order The order direction ASC or DESC + * + * @return void + */ + private function compare_with( $by, $order ) { + // Bail early, if "key" and "value" provided in query_vars. + $key = $this->get_query_var( "graphql_cursor_compare_by_{$by}_key" ); + $value = $this->get_query_var( "graphql_cursor_compare_by_{$by}_value" ); + if ( ! empty( $key ) && ! empty( $value ) ) { + $this->builder->add_field( $key, $value, null, $order ); + return; + } + + /** + * Find out whether this is a post field + */ + $orderby_post_fields = [ + 'post_author', + 'post_title', + 'post_type', + 'post_name', + 'post_modified', + 'post_date', + 'post_parent', + 'menu_order', + ]; + if ( in_array( $by, $orderby_post_fields, true ) ) { + $key = "{$this->wpdb->posts}.{$by}"; + $value = $this->cursor_node->{$by} ?? null; + } + + /** + * If key or value are null, check whether this is a meta key based ordering before bailing. + */ + if ( null === $key || null === $value ) { + $meta_key = $this->get_meta_key( $by ); + if ( $meta_key ) { + $this->compare_with_meta_field( $meta_key, $order ); + } + return; + } + + // Add field to build. + $this->builder->add_field( $key, $value, null, $order ); + } + + /** + * Compare with meta key field + * + * @param string $meta_key post meta key + * @param string $order The comparison string + * + * @return void + */ + private function compare_with_meta_field( string $meta_key, string $order ) { + $meta_type = $this->get_query_var( 'meta_type' ); + $meta_value = get_post_meta( $this->cursor_offset, $meta_key, true ); + + $key = "{$this->wpdb->postmeta}.meta_value"; + + /** + * WP uses mt1, mt2 etc. style aliases for additional meta value joins. + */ + $meta_query = $this->get_query_var( 'meta_query' ); + if ( ! empty( $meta_query ) && is_array( $meta_query ) ) { + if ( ! empty( $meta_query['relation'] ) ) { + unset( $meta_query['relation'] ); + } + + $meta_keys = array_column( $meta_query, 'key' ); + $index = array_search( $meta_key, $meta_keys, true ); + + if ( $index && 1 < count( $meta_query ) ) { + $key = "mt{$index}.meta_value"; + } + } + + /** + * Allow filtering the meta key used for cursor based pagination + * + * @param string $key The meta key to use for cursor based pagination + * @param string $meta_key The original meta key + * @param string $meta_type The meta type + * @param string $order The order direction + * @param object $cursor The PostObjectCursor instance + */ + $key = apply_filters( 'graphql_post_object_cursor_meta_key', $key, $meta_key, $meta_type, $order, $this ); + + $this->builder->add_field( $key, $meta_value, $meta_type, $order, $this ); + } + + /** + * Get the actual meta key if any + * + * @param string $by The order by key + * + * @return string|null + */ + private function get_meta_key( $by ) { + if ( 'meta_value' === $by || 'meta_value_num' === $by ) { + return $this->get_query_var( 'meta_key' ); + } + + /** + * Check for the WP 4.2+ style meta clauses + * https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ + */ + if ( ! isset( $this->query_vars['meta_query'][ $by ] ) ) { + return null; + } + + $clause = $this->query_vars['meta_query'][ $by ]; + + return empty( $clause['key'] ) ? null : $clause['key']; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/TermObjectCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/TermObjectCursor.php new file mode 100644 index 00000000..45d1eb34 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Cursor/TermObjectCursor.php @@ -0,0 +1,227 @@ +get_query_var( $name ); + } + + /** + * {@inheritDoc} + * + * @return ?\WP_Term ; + */ + public function get_cursor_node() { + // Bail if no offset. + if ( ! $this->cursor_offset ) { + return null; + } + + /** + * If pre-hooked, return filtered node. + * + * @param null|\WP_Term $pre_term The pre-filtered term node. + * @param int $offset The cursor offset. + * @param \WPGraphQL\Data\Cursor\TermObjectCursor $node The cursor instance. + * + * @return null|\WP_Term + */ + $pre_term = apply_filters( 'graphql_pre_term_cursor_node', null, $this->cursor_offset, $this ); + if ( null !== $pre_term ) { + return $pre_term; + } + + // Get cursor node. + $term = WP_Term::get_instance( $this->cursor_offset ); + + return $term instanceof WP_Term ? $term : null; + } + + /** + * @return ?\WP_Term ; + * @deprecated 1.9.0 + */ + public function get_cursor_term() { + _deprecated_function( __METHOD__, '1.9.0', self::class . '::get_cursor_node()' ); + + return $this->cursor_node; + } + + /** + * Build and return the SQL statement to add to the Query + * + * @param array|null $fields The fields from the CursorBuilder to convert to SQL + * + * @return string + */ + public function to_sql( $fields = null ) { + $sql = $this->builder->to_sql( $fields ); + if ( empty( $sql ) ) { + return ''; + } + return ' AND ' . $sql; + } + + /** + * {@inheritDoc} + */ + public function get_where() { + // If we have a bad cursor, just skip. + if ( ! $this->is_valid_offset_and_node() ) { + return ''; + } + + $orderby = $this->get_query_var( 'orderby' ); + $order = $this->get_query_var( 'order' ); + + if ( 'name' === $orderby ) { + if ( '>' === $this->compare ) { + $order = 'DESC'; + $this->compare = '<'; + } elseif ( '<' === $this->compare ) { + $this->compare = '>'; + $order = 'ASC'; + } + } + + /** + * If $orderby is just a string just compare with it directly as DESC + */ + if ( ! empty( $orderby ) && is_string( $orderby ) ) { + $this->compare_with( $orderby, $order ); + } + + /** + * If there's no orderby specified yet, compare with the following fields. + */ + if ( ! $this->builder->has_fields() ) { + $this->compare_with_cursor_fields(); + } + + /** + * If there's no cursor_compare fields applied then compare by the ID field. + */ + if ( ! $this->builder->has_fields() ) { + $this->compare_with_id_field(); + } + + + return $this->to_sql(); + } + + /** + * Get AND operator for given order by key + * + * @param string $by The order by key + * @param string $order The order direction ASC or DESC + * + * @return void + */ + private function compare_with( string $by, string $order ) { + + // Bail early, if "key" and "value" provided in query_vars. + $key = $this->get_query_var( "graphql_cursor_compare_by_{$by}_key" ); + $value = $this->get_query_var( "graphql_cursor_compare_by_{$by}_value" ); + if ( ! empty( $key ) && ! empty( $value ) ) { + $this->builder->add_field( $key, $value, null, $order ); + return; + } + + // Set "key" as term table column and get "value" from cursor node. + $key = "t.{$by}"; + $value = $this->cursor_node->{$by}; + + /** + * If key or value are null, check whether this is a meta key based ordering before bailing. + */ + if ( null === $value ) { + $meta_key = $this->get_meta_key( $by ); + if ( $meta_key ) { + $this->compare_with_meta_field( $meta_key, $order ); + } + return; + } + + $this->builder->add_field( $key, $value, null, $order ); + } + + /** + * Compare with meta key field + * + * @param string $meta_key meta key + * @param string $order The comparison string + * + * @return void + */ + private function compare_with_meta_field( string $meta_key, string $order ) { + $meta_type = $this->get_query_var( 'meta_type' ); + $meta_value = get_term_meta( $this->cursor_offset, $meta_key, true ); + + $key = "{$this->wpdb->termmeta}.meta_value"; + + /** + * WP uses mt1, mt2 etc. style aliases for additional meta value joins. + */ + if ( 0 !== $this->meta_join_alias ) { + $key = "mt{$this->meta_join_alias}.meta_value"; + } + + ++$this->meta_join_alias; + + $this->builder->add_field( $key, $meta_value, $meta_type, $order, $this ); + } + + /** + * Get the actual meta key if any + * + * @param string $by The order by key + * + * @return string|null + */ + private function get_meta_key( string $by ) { + if ( 'meta_value' === $by || 'meta_value_num' === $by ) { + return $this->get_query_var( 'meta_key' ); + } + + /** + * Check for the WP 4.2+ style meta clauses + * https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ + */ + if ( ! isset( $this->query_vars['meta_query'][ $by ] ) ) { + return null; + } + + $clause = $this->query_vars['meta_query'][ $by ]; + + return empty( $clause['key'] ) ? null : $clause['key']; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/UserCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/UserCursor.php new file mode 100644 index 00000000..23812026 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Cursor/UserCursor.php @@ -0,0 +1,255 @@ +query_vars; + } + + // Initialize the class properties. + parent::__construct( $query_vars, $cursor ); + + // Set ID key. + $this->id_key = "{$this->wpdb->users}.ID"; + } + + /** + * {@inheritDoc} + * + * Unlike most queries, users by default are in ascending order. + */ + public function get_cursor_compare() { + if ( 'before' === $this->cursor ) { + return '<'; + } + return '>'; + } + + /** + * {@inheritDoc} + * + * @return ?\WP_User + */ + public function get_cursor_node() { + // Bail if no offset. + if ( ! $this->cursor_offset ) { + return null; + } + + /** + * If pre-hooked, return filtered node. + * + * @param null|\WP_User $pre_user The pre-filtered user node. + * @param int $offset The cursor offset. + * @param \WPGraphQL\Data\Cursor\UserCursor $node The cursor instance. + * + * @return null|\WP_User + */ + $pre_user = apply_filters( 'graphql_pre_user_cursor_node', null, $this->cursor_offset, $this ); + if ( null !== $pre_user ) { + return $pre_user; + } + + // Get cursor node. + $user = get_user_by( 'id', $this->cursor_offset ); + + return false !== $user ? $user : null; + } + + /** + * @return ?\WP_User + * @deprecated 1.9.0 + */ + public function get_cursor_user() { + _deprecated_function( __METHOD__, '1.9.0', self::class . '::get_cursor_node()' ); + + return $this->cursor_node; + } + + /** + * {@inheritDoc} + */ + public function to_sql() { + return ' AND ' . $this->builder->to_sql(); + } + + /** + * {@inheritDoc} + */ + public function get_where() { + // If we have a bad cursor, just skip. + if ( ! $this->is_valid_offset_and_node() ) { + return ''; + } + + $orderby = $this->get_query_var( 'orderby' ); + $order = $this->get_query_var( 'order' ); + + if ( ! empty( $orderby ) && is_array( $orderby ) ) { + + /** + * Loop through all order keys if it is an array + */ + foreach ( $orderby as $by => $order ) { + $this->compare_with( $by, $order ); + } + } elseif ( ! empty( $orderby ) && is_string( $orderby ) && 'login' !== $orderby ) { + + /** + * If $orderby is just a string just compare with it directly as DESC + */ + $this->compare_with( $orderby, $order ); + } + + /** + * If there's no orderby specified yet, compare with the following fields. + */ + if ( ! $this->builder->has_fields() ) { + $this->compare_with_cursor_fields( + [ + [ + 'key' => "{$this->wpdb->users}.user_login", + 'value' => $this->cursor_node ? $this->cursor_node->user_login : null, + 'type' => 'CHAR', + ], + ] + ); + } + + $this->compare_with_id_field(); + + return $this->to_sql(); + } + + /** + * Get AND operator for given order by key + * + * @param string $by The order by key + * @param string $order The order direction ASC or DESC + * + * @return void + */ + private function compare_with( $by, $order ) { + // Bail early, if "key" and "value" provided in query_vars. + $key = $this->get_query_var( "graphql_cursor_compare_by_{$by}_key" ); + $value = $this->get_query_var( "graphql_cursor_compare_by_{$by}_value" ); + if ( ! empty( $key ) && ! empty( $value ) ) { + $this->builder->add_field( $key, $value, null, $order ); + return; + } + + /** + * Find out whether this is a user field + */ + $orderby_user_fields = [ + 'user_email', + 'user_login', + 'user_nicename', + 'user_registered', + 'user_url', + ]; + if ( in_array( $by, $orderby_user_fields, true ) ) { + $key = "{$this->wpdb->users}.{$by}"; + $value = $this->cursor_node->{$by} ?? null; + } + + /** + * If key or value are null, check whether this is a meta key based ordering before bailing. + */ + if ( null === $key || null === $value ) { + $meta_key = $this->get_meta_key( $by ); + if ( $meta_key ) { + $this->compare_with_meta_field( $meta_key, $order ); + } + return; + } + + // Add field to build. + $this->builder->add_field( $key, $value, null, $order ); + } + + /** + * Compare with meta key field + * + * @param string $meta_key user meta key + * @param string $order The comparison string + * + * @return void + */ + private function compare_with_meta_field( string $meta_key, string $order ) { + $meta_type = $this->get_query_var( 'meta_type' ); + $meta_value = get_user_meta( $this->cursor_offset, $meta_key, true ); + + $key = "{$this->wpdb->usermeta}.meta_value"; + + /** + * WP uses mt1, mt2 etc. style aliases for additional meta value joins. + */ + if ( 0 !== $this->meta_join_alias ) { + $key = "mt{$this->meta_join_alias}.meta_value"; + } + + ++$this->meta_join_alias; + + $this->builder->add_field( $key, $meta_value, $meta_type, $order ); + } + + /** + * Get the actual meta key if any + * + * @param string $by The order by key + * + * @return string|null + */ + private function get_meta_key( $by ) { + if ( 'meta_value' === $by ) { + return $this->get_query_var( 'meta_key' ); + } + + /** + * Check for the WP 4.2+ style meta clauses + * https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ + */ + if ( ! isset( $this->query_vars['meta_query'][ $by ] ) ) { + return null; + } + + $clause = $this->query_vars['meta_query'][ $by ]; + + return empty( $clause['key'] ) ? null : $clause['key']; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/DataSource.php b/lib/wp-graphql-1.17.0/src/Data/DataSource.php new file mode 100644 index 00000000..39624552 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/DataSource.php @@ -0,0 +1,727 @@ +get_loader( \'comment\' )->load_deferred( $id ) instead.' ); + + return $context->get_loader( 'comment' )->load_deferred( $id ); + } + + /** + * Retrieves a WP_Comment object for the ID that gets passed + * + * @param int $comment_id The ID of the comment the comment author is associated with. + * + * @return mixed|\WPGraphQL\Model\CommentAuthor|null + * @throws \Exception Throws Exception. + */ + public static function resolve_comment_author( int $comment_id ) { + $comment_author = get_comment( $comment_id ); + + return ! empty( $comment_author ) ? new CommentAuthor( $comment_author ) : null; + } + + /** + * Wrapper for the CommentsConnectionResolver class + * + * @param mixed $source The object the connection is coming from + * @param array $args Query args to pass to the connection resolver + * @param \WPGraphQL\AppContext $context The context of the query to pass along + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * + * @return mixed + * @throws \Exception + * @since 0.0.5 + */ + public static function resolve_comments_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { + $resolver = new CommentConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + } + + /** + * Wrapper for PluginsConnectionResolver::resolve + * + * @param mixed $source The object the connection is coming from + * @param array $args Array of arguments to pass to resolve method + * @param \WPGraphQL\AppContext $context AppContext object passed down + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * + * @return array + * @throws \Exception + * @since 0.0.5 + */ + public static function resolve_plugins_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { + $resolver = new PluginConnectionResolver( $source, $args, $context, $info ); + return $resolver->get_connection(); + } + + /** + * Returns the post object for the ID and post type passed + * + * @param int $id ID of the post you are trying to retrieve + * @param \WPGraphQL\AppContext $context The context of the GraphQL Request + * + * @return \GraphQL\Deferred + * + * @throws \GraphQL\Error\UserError + * @throws \Exception + * + * @since 0.0.5 + * @deprecated Use the Loader passed in $context instead + */ + public static function resolve_post_object( int $id, AppContext $context ) { + _deprecated_function( __METHOD__, '0.8.4', 'Use $context->get_loader( \'post\' )->load_deferred( $id ) instead.' ); + return $context->get_loader( 'post' )->load_deferred( $id ); + } + + /** + * @param int $id The ID of the menu item to load + * @param \WPGraphQL\AppContext $context The context of the GraphQL request + * + * @return \GraphQL\Deferred|null + * @throws \Exception + * + * @deprecated Use the Loader passed in $context instead + */ + public static function resolve_menu_item( int $id, AppContext $context ) { + _deprecated_function( __METHOD__, '0.8.4', 'Use $context->get_loader( \'post\' )->load_deferred( $id ) instead.' ); + return $context->get_loader( 'post' )->load_deferred( $id ); + } + + /** + * Wrapper for PostObjectsConnectionResolver + * + * @param mixed $source The object the connection is coming from + * @param array $args Arguments to pass to the resolve method + * @param \WPGraphQL\AppContext $context AppContext object to pass down + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * @param mixed|string|array $post_type Post type of the post we are trying to resolve + * + * @return mixed + * @throws \Exception + * @since 0.0.5 + */ + public static function resolve_post_objects_connection( $source, array $args, AppContext $context, ResolveInfo $info, $post_type ) { + $resolver = new PostObjectConnectionResolver( $source, $args, $context, $info, $post_type ); + + return $resolver->get_connection(); + } + + /** + * Retrieves the taxonomy object for the name of the taxonomy passed + * + * @param string $taxonomy Name of the taxonomy you want to retrieve the taxonomy object for + * + * @return \WPGraphQL\Model\Taxonomy object + * @throws \GraphQL\Error\UserError|\Exception + * @since 0.0.5 + */ + public static function resolve_taxonomy( $taxonomy ) { + + /** + * Get the allowed_taxonomies + * + * @var string[] $allowed_taxonomies + */ + $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies(); + + if ( ! in_array( $taxonomy, $allowed_taxonomies, true ) ) { + // translators: %s is the name of the taxonomy. + throw new UserError( esc_html( sprintf( __( 'No taxonomy was found with the name %s', 'wp-graphql' ), $taxonomy ) ) ); + } + + $tax_object = get_taxonomy( $taxonomy ); + + if ( ! $tax_object instanceof \WP_Taxonomy ) { + // translators: %s is the name of the taxonomy. + throw new UserError( esc_html( sprintf( __( 'No taxonomy was found with the name %s', 'wp-graphql' ), $taxonomy ) ) ); + } + + return new Taxonomy( $tax_object ); + } + + /** + * Get the term object for a term + * + * @param int $id ID of the term you are trying to retrieve the object for + * @param \WPGraphQL\AppContext $context The context of the GraphQL Request + * + * @return mixed + * @throws \Exception + * @since 0.0.5 + * + * @deprecated Use the Loader passed in $context instead + */ + public static function resolve_term_object( $id, AppContext $context ) { + _deprecated_function( __METHOD__, '0.8.4', 'Use $context->get_loader( \'term\' )->load_deferred( $id ) instead.' ); + return $context->get_loader( 'term' )->load_deferred( $id ); + } + + /** + * Wrapper for TermObjectConnectionResolver::resolve + * + * @param mixed $source The object the connection is coming from + * @param array $args Array of args to be passed to the resolve method + * @param \WPGraphQL\AppContext $context The AppContext object to be passed down + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * @param string $taxonomy The name of the taxonomy the term belongs to + * + * @return array + * @throws \Exception + * @since 0.0.5 + */ + public static function resolve_term_objects_connection( $source, array $args, AppContext $context, ResolveInfo $info, string $taxonomy ) { + $resolver = new TermObjectConnectionResolver( $source, $args, $context, $info, $taxonomy ); + + return $resolver->get_connection(); + } + + /** + * Retrieves the theme object for the theme you are looking for + * + * @param string $stylesheet Directory name for the theme. + * + * @return \WPGraphQL\Model\Theme object + * @throws \GraphQL\Error\UserError + * @throws \Exception + * @since 0.0.5 + */ + public static function resolve_theme( $stylesheet ) { + $theme = wp_get_theme( $stylesheet ); + if ( $theme->exists() ) { + return new Theme( $theme ); + } else { + // translators: %s is the name of the theme stylesheet. + throw new UserError( esc_html( sprintf( __( 'No theme was found with the stylesheet: %s', 'wp-graphql' ), $stylesheet ) ) ); + } + } + + /** + * Wrapper for the ThemesConnectionResolver::resolve method + * + * @param mixed $source The object the connection is coming from + * @param array $args Passes an array of arguments to the resolve method + * @param \WPGraphQL\AppContext $context The AppContext object to be passed down + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * + * @return array + * @throws \Exception + * @since 0.0.5 + */ + public static function resolve_themes_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { + $resolver = new ThemeConnectionResolver( $source, $args, $context, $info ); + return $resolver->get_connection(); + } + + /** + * Gets the user object for the user ID specified + * + * @param int $id ID of the user you want the object for + * @param \WPGraphQL\AppContext $context The AppContext + * + * @return \GraphQL\Deferred + * @throws \Exception + * + * @since 0.0.5 + * @deprecated Use the Loader passed in $context instead + */ + public static function resolve_user( $id, AppContext $context ) { + _deprecated_function( __METHOD__, '0.8.4', 'Use $context->get_loader( \'user\' )->load_deferred( $id ) instead.' ); + return $context->get_loader( 'user' )->load_deferred( $id ); + } + + /** + * Wrapper for the UsersConnectionResolver::resolve method + * + * @param mixed $source The object the connection is coming from + * @param array $args Array of args to be passed down to the resolve method + * @param \WPGraphQL\AppContext $context The AppContext object to be passed down + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * + * @return array + * @throws \Exception + * @since 0.0.5 + */ + public static function resolve_users_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { + $resolver = new UserConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + } + + /** + * Returns an array of data about the user role you are requesting + * + * @param string $name Name of the user role you want info for + * + * @return \WPGraphQL\Model\UserRole + * @throws \Exception + * @since 0.0.30 + */ + public static function resolve_user_role( $name ) { + $role = isset( wp_roles()->roles[ $name ] ) ? wp_roles()->roles[ $name ] : null; + + if ( null === $role ) { + // translators: %s is the name of the user role. + throw new UserError( esc_html( sprintf( __( 'No user role was found with the name %s', 'wp-graphql' ), $name ) ) ); + } else { + $role = (array) $role; + $role['id'] = $name; + $role['displayName'] = $role['name']; + $role['name'] = $name; + + return new UserRole( $role ); + } + } + + /** + * Resolve the avatar for a user + * + * @param int $user_id ID of the user to get the avatar data for + * @param array $args The args to pass to the get_avatar_data function + * + * @return \WPGraphQL\Model\Avatar|null + * @throws \Exception + */ + public static function resolve_avatar( int $user_id, array $args ) { + $avatar = get_avatar_data( absint( $user_id ), $args ); + + // if there's no url returned, return null + if ( empty( $avatar['url'] ) ) { + return null; + } + + return new Avatar( $avatar ); + } + + /** + * Resolve the connection data for user roles + * + * @param array $source The Query results + * @param array $args The query arguments + * @param \WPGraphQL\AppContext $context The AppContext passed down to the query + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object + * + * @return array + * @throws \Exception + */ + public static function resolve_user_role_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { + $resolver = new UserRoleConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + } + + /** + * Format the setting group name to our standard. + * + * @param string $group + * + * @return string $group + */ + public static function format_group_name( string $group ) { + $replaced_group = graphql_format_name( $group, ' ', '/[^a-zA-Z0-9 -]/' ); + + if ( ! empty( $replaced_group ) ) { + $group = $replaced_group; + } + + $group = lcfirst( str_replace( '_', ' ', ucwords( $group, '_' ) ) ); + $group = lcfirst( str_replace( '-', ' ', ucwords( $group, '_' ) ) ); + $group = lcfirst( str_replace( ' ', '', ucwords( $group, ' ' ) ) ); + + return $group; + } + + /** + * Get all of the allowed settings by group and return the + * settings group that matches the group param + * + * @param string $group + * + * @return array $settings_groups[ $group ] + */ + public static function get_setting_group_fields( string $group, TypeRegistry $type_registry ) { + + /** + * Get all of the settings, sorted by group + */ + $settings_groups = self::get_allowed_settings_by_group( $type_registry ); + + return ! empty( $settings_groups[ $group ] ) ? $settings_groups[ $group ] : []; + } + + /** + * Get all of the allowed settings by group + * + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry + * + * @return array $allowed_settings_by_group + */ + public static function get_allowed_settings_by_group( TypeRegistry $type_registry ) { + + /** + * Get all registered settings + */ + $registered_settings = get_registered_settings(); + + /** + * Loop through the $registered_settings array and build an array of + * settings for each group ( general, reading, discussion, writing, reading, etc. ) + * if the setting is allowed in REST or GraphQL + */ + $allowed_settings_by_group = []; + foreach ( $registered_settings as $key => $setting ) { + // Bail if the setting doesn't have a group. + if ( empty( $setting['group'] ) ) { + continue; + } + + $group = self::format_group_name( $setting['group'] ); + + if ( ! isset( $setting['type'] ) || ! $type_registry->get_type( $setting['type'] ) ) { + continue; + } + + if ( ! isset( $setting['show_in_graphql'] ) ) { + if ( isset( $setting['show_in_rest'] ) && false !== $setting['show_in_rest'] ) { + $setting['key'] = $key; + $allowed_settings_by_group[ $group ][ $key ] = $setting; + } + } elseif ( true === $setting['show_in_graphql'] ) { + $setting['key'] = $key; + $allowed_settings_by_group[ $group ][ $key ] = $setting; + } + } + + /** + * Set the setting groups that are allowed + */ + $allowed_settings_by_group = ! empty( $allowed_settings_by_group ) && is_array( $allowed_settings_by_group ) ? $allowed_settings_by_group : []; + + /** + * Filter the $allowed_settings_by_group to allow enabling or disabling groups in the GraphQL Schema. + * + * @param array $allowed_settings_by_group + */ + return apply_filters( 'graphql_allowed_settings_by_group', $allowed_settings_by_group ); + } + + /** + * Get all of the $allowed_settings + * + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry + * + * @return array $allowed_settings + */ + public static function get_allowed_settings( TypeRegistry $type_registry ) { + + /** + * Get all registered settings + */ + $registered_settings = get_registered_settings(); + + /** + * Set allowed settings variable. + */ + $allowed_settings = []; + + if ( ! empty( $registered_settings ) ) { + + /** + * Loop through the $registered_settings and if the setting is allowed in REST or GraphQL + * add it to the $allowed_settings array + */ + foreach ( $registered_settings as $key => $setting ) { + if ( ! isset( $setting['type'] ) || ! $type_registry->get_type( $setting['type'] ) ) { + continue; + } + + if ( ! isset( $setting['show_in_graphql'] ) ) { + if ( isset( $setting['show_in_rest'] ) && false !== $setting['show_in_rest'] ) { + $setting['key'] = $key; + $allowed_settings[ $key ] = $setting; + } + } elseif ( true === $setting['show_in_graphql'] ) { + $setting['key'] = $key; + $allowed_settings[ $key ] = $setting; + } + } + } + + /** + * Verify that we have the allowed settings + */ + $allowed_settings = ! empty( $allowed_settings ) && is_array( $allowed_settings ) ? $allowed_settings : []; + + /** + * Filter the $allowed_settings to allow some to be enabled or disabled from showing in + * the GraphQL Schema. + * + * @param array $allowed_settings + * + * @return array + */ + return apply_filters( 'graphql_allowed_setting_groups', $allowed_settings ); + } + + /** + * We get the node interface and field from the relay library. + * + * The first method is the way we resolve an ID to its object. The second is the way we resolve + * an object that implements node to its type. + * + * @return array + * @throws \GraphQL\Error\UserError + */ + public static function get_node_definition() { + if ( null === self::$node_definition ) { + $node_definition = Relay::nodeDefinitions( + // The ID fetcher definition + static function ( $global_id, AppContext $context, ResolveInfo $info ) { + self::resolve_node( $global_id, $context, $info ); + }, + // Type resolver + static function ( $node ) { + self::resolve_node_type( $node ); + } + ); + + self::$node_definition = $node_definition; + } + + return self::$node_definition; + } + + /** + * Given a node, returns the GraphQL Type + * + * @param mixed $node The node to resolve the type of + * + * @return string + */ + public static function resolve_node_type( $node ) { + $type = null; + + if ( true === is_object( $node ) ) { + switch ( true ) { + case $node instanceof Post: + if ( $node->isRevision ) { + $parent_post = get_post( $node->parentDatabaseId ); + if ( ! empty( $parent_post ) ) { + $parent_post_type = $parent_post->post_type; + /** @var \WP_Post_Type $post_type_object */ + $post_type_object = get_post_type_object( $parent_post_type ); + $type = $post_type_object->graphql_single_name; + } + } else { + /** @var \WP_Post_Type $post_type_object */ + $post_type_object = get_post_type_object( $node->post_type ); + $type = $post_type_object->graphql_single_name; + } + break; + case $node instanceof Term: + /** @var \WP_Taxonomy $tax_object */ + $tax_object = get_taxonomy( $node->taxonomyName ); + $type = $tax_object->graphql_single_name; + break; + case $node instanceof Comment: + $type = 'Comment'; + break; + case $node instanceof PostType: + $type = 'ContentType'; + break; + case $node instanceof Taxonomy: + $type = 'Taxonomy'; + break; + case $node instanceof Theme: + $type = 'Theme'; + break; + case $node instanceof User: + $type = 'User'; + break; + case $node instanceof Plugin: + $type = 'Plugin'; + break; + case $node instanceof CommentAuthor: + $type = 'CommentAuthor'; + break; + case $node instanceof Menu: + $type = 'Menu'; + break; + case $node instanceof \_WP_Dependency: + $type = isset( $node->type ) ? $node->type : null; + break; + default: + $type = null; + } + } + + /** + * Add a filter to allow externally registered node types to return the proper type + * based on the node_object that's returned + * + * @param mixed|object|array $type The type definition the node should resolve to. + * @param mixed|object|array $node The $node that is being resolved + * + * @since 0.0.6 + */ + $type = apply_filters( 'graphql_resolve_node_type', $type, $node ); + $type = ucfirst( $type ); + + /** + * If the $type is not properly resolved, throw an exception + * + * @since 0.0.6 + */ + if ( empty( $type ) ) { + throw new UserError( esc_html__( 'No type was found matching the node', 'wp-graphql' ) ); + } + + /** + * Return the resolved $type for the $node + * + * @since 0.0.5 + */ + return $type; + } + + /** + * Given the ID of a node, this resolves the data + * + * @param string $global_id The Global ID of the node + * @param \WPGraphQL\AppContext $context The Context of the GraphQL Request + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo for the GraphQL Request + * + * @return null|string + * @throws \Exception + */ + public static function resolve_node( $global_id, AppContext $context, ResolveInfo $info ) { + if ( empty( $global_id ) ) { + throw new UserError( esc_html__( 'An ID needs to be provided to resolve a node.', 'wp-graphql' ) ); + } + + /** + * Convert the encoded ID into an array we can work with + * + * @since 0.0.4 + */ + $id_components = Relay::fromGlobalId( $global_id ); + + /** + * If the $id_components is a proper array with a type and id + * + * @since 0.0.5 + */ + if ( is_array( $id_components ) && ! empty( $id_components['id'] ) && ! empty( $id_components['type'] ) ) { + + /** + * Get the allowed_post_types and allowed_taxonomies + * + * @since 0.0.5 + */ + + $loader = $context->get_loader( $id_components['type'] ); + + if ( $loader ) { + return $loader->load_deferred( $id_components['id'] ); + } + + return null; + } else { + // translators: %s is the global ID. + throw new UserError( esc_html( sprintf( __( 'The global ID isn\'t recognized ID: %s', 'wp-graphql' ), $global_id ) ) ); + } + } + + /** + * Returns array of nav menu location names + * + * @return array + */ + public static function get_registered_nav_menu_locations() { + global $_wp_registered_nav_menus; + + return ! empty( $_wp_registered_nav_menus ) && is_array( $_wp_registered_nav_menus ) ? array_keys( $_wp_registered_nav_menus ) : []; + } + + /** + * This resolves a resource, given a URI (the path / permalink to a resource) + * + * Based largely on the core parse_request function in wp-includes/class-wp.php + * + * @param string $uri The URI to fetch a resource from + * @param \WPGraphQL\AppContext $context The AppContext passed through the GraphQL Resolve Tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed through the GraphQL Resolve tree + * + * @return mixed + * @throws \Exception + */ + public static function resolve_resource_by_uri( $uri, $context, $info ) { + $node_resolver = new NodeResolver( $context ); + + return $node_resolver->resolve_uri( $uri ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/AbstractDataLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/AbstractDataLoader.php new file mode 100644 index 00000000..fa530daf --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/AbstractDataLoader.php @@ -0,0 +1,509 @@ +context = $context; + } + + /** + * Given a Database ID, the particular loader will buffer it and resolve it deferred. + * + * @param mixed|int|string $database_id The database ID for a particular loader to load an + * object + * + * @return \GraphQL\Deferred|null + * @throws \Exception + */ + public function load_deferred( $database_id ) { + if ( empty( $database_id ) ) { + return null; + } + + $database_id = absint( $database_id ) ? absint( $database_id ) : sanitize_text_field( $database_id ); + + $this->buffer( [ $database_id ] ); + + return new Deferred( + function () use ( $database_id ) { + return $this->load( $database_id ); + } + ); + } + + /** + * Add keys to buffer to be loaded in single batch later. + * + * @param array $keys The keys of the objects to buffer + * + * @return $this + * @throws \Exception + */ + public function buffer( array $keys ) { + foreach ( $keys as $index => $key ) { + $key = $this->key_to_scalar( $key ); + if ( ! is_scalar( $key ) ) { + throw new Exception( + static::class . '::buffer expects all keys to be scalars, but key ' . + 'at position ' . esc_html( $index ) . ' is ' . esc_html( + Utils::printSafe( $keys ) . '. ' . + $this->get_scalar_key_hint( $key ) + ) + ); + } + $this->buffer[ $key ] = 1; + } + + return $this; + } + + /** + * Loads a key and returns value represented by this key. + * Internally this method will load all currently buffered items and cache them locally. + * + * @param mixed $key + * + * @return mixed + * @throws \Exception + */ + public function load( $key ) { + $key = $this->key_to_scalar( $key ); + if ( ! is_scalar( $key ) ) { + throw new Exception( + static::class . '::load expects key to be scalar, but got ' . esc_html( + Utils::printSafe( $key ) . + $this->get_scalar_key_hint( $key ) + ) + ); + } + if ( ! $this->shouldCache ) { + $this->buffer = []; + } + $keys = [ $key ]; + $this->buffer( $keys ); + $result = $this->load_buffered(); + + return isset( $result[ $key ] ) ? $this->normalize_entry( $result[ $key ], $key ) : null; + } + + /** + * Adds the provided key and value to the cache. If the key already exists, no + * change is made. Returns itself for method chaining. + * + * @param mixed $key + * @param mixed $value + * + * @return $this + * @throws \Exception + */ + public function prime( $key, $value ) { + $key = $this->key_to_scalar( $key ); + if ( ! is_scalar( $key ) ) { + throw new Exception( + static::class . '::prime is expecting scalar $key, but got ' . esc_html( + Utils::printSafe( $key ) + . $this->get_scalar_key_hint( $key ) + ) + ); + } + if ( null === $value ) { + throw new Exception( + static::class . '::prime is expecting non-null $value, but got null. Double-check for null or ' . + ' use `clear` if you want to clear the cache' + ); + } + if ( ! $this->get_cached( $key ) ) { + /** + * For adding third-party caching support. + * Use this filter to store the queried value in a cache. + * + * @param mixed $value Queried object. + * @param mixed $key Object key. + * @param string $loader_class Loader classname. Use as a means of identified the loader. + * @param mixed $loader Loader instance. + */ + $this->set_cached( $key, $value ); + } + + return $this; + } + + /** + * Clears the value at `key` from the cache, if it exists. Returns itself for + * method chaining. + * + * @param array $keys + * + * @return $this + */ + public function clear( array $keys ) { + foreach ( $keys as $key ) { + $key = $this->key_to_scalar( $key ); + if ( isset( $this->cached[ $key ] ) ) { + unset( $this->cached[ $key ] ); + } + } + + return $this; + } + + /** + * Clears the entire cache. To be used when some event results in unknown + * invalidations across this particular `DataLoader`. Returns itself for + * method chaining. + * + * @return \WPGraphQL\Data\Loader\AbstractDataLoader + * @deprecated in favor of clear_all + */ + public function clearAll() { + _deprecated_function( __METHOD__, '0.8.4', static::class . '::clear_all()' ); + return $this->clear_all(); + } + + /** + * Clears the entire cache. To be used when some event results in unknown + * invalidations across this particular `DataLoader`. Returns itself for + * method chaining. + * + * @return \WPGraphQL\Data\Loader\AbstractDataLoader + */ + public function clear_all() { + $this->cached = []; + + return $this; + } + + /** + * Loads multiple keys. Returns generator where each entry directly corresponds to entry in + * $keys. If second argument $asArray is set to true, returns array instead of generator + * + * @param array $keys + * @param bool $asArray + * + * @return array|\Generator + * @throws \Exception + * + * @deprecated Use load_many instead + */ + public function loadMany( array $keys, $asArray = false ) { + _deprecated_function( __METHOD__, '0.8.4', static::class . '::load_many()' ); + return $this->load_many( $keys, $asArray ); + } + + /** + * Loads multiple keys. Returns generator where each entry directly corresponds to entry in + * $keys. If second argument $asArray is set to true, returns array instead of generator + * + * @param array $keys + * @param bool $asArray + * + * @return array|\Generator + * @throws \Exception + */ + public function load_many( array $keys, $asArray = false ) { + if ( empty( $keys ) ) { + return []; + } + if ( ! $this->shouldCache ) { + $this->buffer = []; + } + $this->buffer( $keys ); + $generator = $this->generate_many( $keys, $this->load_buffered() ); + + return $asArray ? iterator_to_array( $generator ) : $generator; + } + + /** + * Given an array of keys, this yields the object from the cached results + * + * @param array $keys The keys to generate results for + * @param array $result The results for all keys + * + * @return \Generator + */ + private function generate_many( array $keys, array $result ) { + foreach ( $keys as $key ) { + $key = $this->key_to_scalar( $key ); + yield isset( $result[ $key ] ) ? $this->get_model( $result[ $key ], $key ) : null; + } + } + + /** + * This checks to see if any items are in the buffer, and if there are this + * executes the loaders `loadKeys` method to load the items and adds them + * to the cache if necessary + * + * @return array + * @throws \Exception + */ + private function load_buffered() { + // Do not load previously-cached entries: + $keysToLoad = []; + foreach ( $this->buffer as $key => $unused ) { + if ( ! $this->get_cached( $key ) ) { + $keysToLoad[] = $key; + } + } + + $result = []; + if ( ! empty( $keysToLoad ) ) { + try { + $loaded = $this->loadKeys( $keysToLoad ); + } catch ( \Throwable $e ) { + throw new Exception( + 'Method ' . static::class . '::loadKeys is expected to return array, but it threw: ' . + esc_html( $e->getMessage() ), + 0, + $e // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped + ); + } + + if ( ! is_array( $loaded ) ) { + throw new Exception( + 'Method ' . static::class . '::loadKeys is expected to return an array with keys ' . + 'but got: ' . esc_html( Utils::printSafe( $loaded ) ) + ); + } + if ( $this->shouldCache ) { + foreach ( $loaded as $key => $value ) { + $this->set_cached( $key, $value ); + } + } + } + + // Re-include previously-cached entries to result: + $result += array_intersect_key( $this->cached, $this->buffer ); + + $this->buffer = []; + + return $result; + } + + /** + * This helps to ensure null values aren't being loaded by accident. + * + * @param mixed $key + * + * @return string + */ + private function get_scalar_key_hint( $key ) { + if ( null === $key ) { + return ' Make sure to add additional checks for null values.'; + } else { + return ' Try overriding ' . self::class . '::key_to_scalar if your keys are composite.'; + } + } + + /** + * For loaders that need to decode keys, this method can help with that. + * For example, if we wanted to accept a list of RELAY style global IDs and pass them + * to the loader, we could have the loader centrally decode the keys into their + * integer values in the PostObjectLoader by overriding this method. + * + * @param mixed $key + * + * @return mixed + */ + protected function key_to_scalar( $key ) { + return $key; + } + + /** + * @param mixed $key + * + * @return mixed + * @deprecated Use key_to_scalar instead + */ + protected function keyToScalar( $key ) { + _deprecated_function( __METHOD__, '0.8.4', static::class . '::key_to_scalar()' ); + return $this->key_to_scalar( $key ); + } + + /** + * @param mixed $entry The entry loaded from the dataloader to be used to generate a Model + * @param mixed $key The Key used to identify the loaded entry + * + * @return null|\WPGraphQL\Model\Model + */ + protected function normalize_entry( $entry, $key ) { + + /** + * This filter allows the model generated by the DataLoader to be filtered. + * + * Returning anything other than null here will bypass the default model generation + * for an object. + * + * One example would be WooCommerce Products returning a custom Model for posts of post_type "product". + * + * @param null $model The filtered model to return. Default null + * @param mixed $entry The entry loaded from the dataloader to be used to generate a Model + * @param mixed $key The Key used to identify the loaded entry + * @param \WPGraphQL\Data\Loader\AbstractDataLoader $abstract_data_loader The AbstractDataLoader instance + */ + $model = null; + $pre_get_model = apply_filters( 'graphql_dataloader_pre_get_model', $model, $entry, $key, $this ); + + /** + * If a Model has been pre-loaded via filter, return it and skip the + */ + if ( ! empty( $pre_get_model ) ) { + $model = $pre_get_model; + } else { + $model = $this->get_model( $entry, $key ); + } + + if ( $model instanceof Model && 'private' === $model->get_visibility() ) { + return null; + } + + /** + * Filter the model before returning. + * + * @param mixed $model The Model to be returned by the loader + * @param mixed $entry The entry loaded by dataloader that was used to create the Model + * @param mixed $key The Key that was used to load the entry + * @param \WPGraphQL\Data\Loader\AbstractDataLoader $loader The AbstractDataLoader Instance + */ + return apply_filters( 'graphql_dataloader_get_model', $model, $entry, $key, $this ); + } + + /** + * Returns a cached data object by key. + * + * @param mixed $key Key. + * + * @return mixed + */ + protected function get_cached( $key ) { + $value = null; + if ( isset( $this->cached[ $key ] ) ) { + $value = $this->cached[ $key ]; + } + + /** + * Use this filter to retrieving cached data objects from third-party caching system. + * + * @param mixed $value Value to be cached. + * @param mixed $key Key identifying object. + * @param string $loader_class Loader class name. + * @param mixed $loader Loader instance. + */ + $value = apply_filters( + 'graphql_dataloader_get_cached', + $value, + $key, + static::class, + $this + ); + + if ( $value && ! isset( $this->cached[ $key ] ) ) { + $this->cached[ $key ] = $value; + } + + return $value; + } + + /** + * Caches a data object by key. + * + * @param mixed $key Key. + * @param mixed $value Data object. + * + * @return mixed + */ + protected function set_cached( $key, $value ) { + /** + * Use this filter to store entry in a third-party caching system. + * + * @param mixed $value Value to be cached. + * @param mixed $key Key identifying object. + * @param string $loader_class Loader class name. + * @param mixed $loader Loader instance. + */ + $this->cached[ $key ] = apply_filters( + 'graphql_dataloader_set_cached', + $value, + $key, + static::class, + $this + ); + } + + /** + * If the loader needs to do any tweaks between getting raw data from the DB and caching, + * this can be overridden by the specific loader and used for transformations, etc. + * + * @param mixed $entry The User Role object + * @param mixed $key The Key to identify the user role by + * + * @return \WPGraphQL\Model\Model + */ + protected function get_model( $entry, $key ) { + return $entry; + } + + /** + * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded + * values + * + * Note that order of returned values must match exactly the order of keys. + * If some entry is not available for given key - it must include null for the missing key. + * + * For example: + * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] + * + * @param array $keys + * + * @return array + */ + abstract protected function loadKeys( array $keys ); +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/CommentAuthorLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/CommentAuthorLoader.php new file mode 100644 index 00000000..e2788cc1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/CommentAuthorLoader.php @@ -0,0 +1,58 @@ + $keys, + 'orderby' => 'comment__in', + 'number' => count( $keys ), + 'no_found_rows' => true, + 'count' => false, + ]; + + /** + * Execute the query. Call get_comments() to add them to the cache. + */ + $query = new \WP_Comment_Query( $args ); + $query->get_comments(); + $loaded = []; + foreach ( $keys as $key ) { + $loaded[ $key ] = \WP_Comment::get_instance( $key ); + } + return $loaded; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/CommentLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/CommentLoader.php new file mode 100644 index 00000000..82da2f30 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/CommentLoader.php @@ -0,0 +1,75 @@ +fields ) ) { + return null; + } + + return $comment_model; + } + + /** + * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded + * comments as the values + * + * Note that order of returned values must match exactly the order of keys. + * If some entry is not available for given key - it must include null for the missing key. + * + * For example: + * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] + * + * @param array $keys + * + * @return array + * @throws \Exception + */ + public function loadKeys( array $keys = [] ) { + + /** + * Prepare the args for the query. We're provided a specific set of IDs of comments + * so we want to query as efficiently as possible with as little overhead to get the comment + * objects. No need to count the rows, etc. + */ + $args = [ + 'comment__in' => $keys, + 'orderby' => 'comment__in', + 'number' => count( $keys ), + 'no_found_rows' => true, + 'count' => false, + ]; + + /** + * Execute the query. Call get_comments() to add them to the cache. + */ + $query = new \WP_Comment_Query( $args ); + $query->get_comments(); + $loaded = []; + foreach ( $keys as $key ) { + $loaded[ $key ] = \WP_Comment::get_instance( $key ); + } + return $loaded; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedScriptLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedScriptLoader.php new file mode 100644 index 00000000..9b237433 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedScriptLoader.php @@ -0,0 +1,35 @@ +registered[ $key ] ) ) { + $script = $wp_scripts->registered[ $key ]; + $script->type = 'EnqueuedScript'; + $loaded[ $key ] = $script; + } else { + $loaded[ $key ] = null; + } + } + return $loaded; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedStylesheetLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedStylesheetLoader.php new file mode 100644 index 00000000..ef46a443 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedStylesheetLoader.php @@ -0,0 +1,33 @@ +registered[ $key ] ) ) { + $stylesheet = $wp_styles->registered[ $key ]; + $stylesheet->type = 'EnqueuedStylesheet'; + $loaded[ $key ] = $stylesheet; + } else { + $loaded[ $key ] = null; + } + } + return $loaded; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/PluginLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/PluginLoader.php new file mode 100644 index 00000000..2d2fc75d --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/PluginLoader.php @@ -0,0 +1,60 @@ +context; + + if ( ! empty( $entry->post_author ) && absint( $entry->post_author ) ) { + $user_id = $entry->post_author; + $context->get_loader( 'user' )->load_deferred( $user_id ); + } + + if ( 'revision' === $entry->post_type && ! empty( $entry->post_parent ) && absint( $entry->post_parent ) ) { + $post_parent = $entry->post_parent; + $context->get_loader( 'post' )->load_deferred( $post_parent ); + } + + if ( 'nav_menu_item' === $entry->post_type ) { + return new MenuItem( $entry ); + } + + $post = new Post( $entry ); + if ( empty( $post->fields ) ) { + return null; + } + + return $post; + } + + /** + * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded + * posts as the values + * + * Note that order of returned values must match exactly the order of keys. + * If some entry is not available for given key - it must include null for the missing key. + * + * For example: + * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] + * + * @param array $keys + * + * @return array + * @throws \Exception + */ + public function loadKeys( array $keys ) { + if ( empty( $keys ) ) { + return $keys; + } + + /** + * Prepare the args for the query. We're provided a specific + * set of IDs, so we want to query as efficiently as possible with + * as little overhead as possible. We don't want to return post counts, + * we don't want to include sticky posts, and we want to limit the query + * to the count of the keys provided. The query must also return results + * in the same order the keys were provided in. + */ + $post_types = \WPGraphQL::get_allowed_post_types(); + $post_types = array_merge( $post_types, [ 'revision', 'nav_menu_item' ] ); + $args = [ + 'post_type' => $post_types, + 'post_status' => 'any', + 'posts_per_page' => count( $keys ), + 'post__in' => $keys, + 'orderby' => 'post__in', + 'no_found_rows' => true, + 'split_the_query' => false, + 'ignore_sticky_posts' => true, + ]; + + /** + * Ensure that WP_Query doesn't first ask for IDs since we already have them. + */ + add_filter( + 'split_the_query', + static function ( $split, \WP_Query $query ) { + if ( false === $query->get( 'split_the_query' ) ) { + return false; + } + + return $split; + }, + 10, + 2 + ); + new \WP_Query( $args ); + $loaded_posts = []; + foreach ( $keys as $key ) { + /** + * The query above has added our objects to the cache + * so now we can pluck them from the cache to return here + * and if they don't exist we can throw an error, otherwise + * we can proceed to resolve the object via the Model layer. + */ + $post_object = get_post( (int) $key ); + + if ( ! $post_object instanceof \WP_Post ) { + $loaded_posts[ $key ] = null; + } else { + + /** + * Once dependencies are loaded, return the Post Object + */ + $loaded_posts[ $key ] = $post_object; + } + } + return $loaded_posts; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/PostTypeLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/PostTypeLoader.php new file mode 100644 index 00000000..00ff7a77 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/PostTypeLoader.php @@ -0,0 +1,46 @@ +taxonomy ) { + $menu = new Menu( $entry ); + if ( empty( $menu->fields ) ) { + return null; + } else { + return $menu; + } + } else { + $term = new Term( $entry ); + if ( empty( $term->fields ) ) { + return null; + } else { + return $term; + } + } + } + return null; + } + + /** + * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded + * posts as the values + * + * Note that order of returned values must match exactly the order of keys. + * If some entry is not available for given key - it must include null for the missing key. + * + * For example: + * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] + * + * @param int[] $keys + * + * @return array + * @throws \Exception + */ + public function loadKeys( array $keys ) { + if ( empty( $keys ) ) { + return $keys; + } + + /** + * Prepare the args for the query. We're provided a specific set of IDs for terms, + * so we want to query as efficiently as possible with as little overhead as possible. + */ + $args = [ + 'include' => $keys, + 'number' => count( $keys ), + 'orderby' => 'include', + 'hide_empty' => false, + ]; + + /** + * Execute the query. This adds the terms to the cache + */ + $query = new \WP_Term_Query( $args ); + $terms = $query->get_terms(); + + if ( empty( $terms ) || ! is_array( $terms ) ) { + return []; + } + + $loaded = []; + + /** + * Loop over the keys and return an array of loaded_terms, where the key is the ID and the value is + * the Term passed through the Model layer + */ + foreach ( $keys as $key ) { + + /** + * The query above has added our objects to the cache, so now we can pluck + * them from the cache to pass through the model layer, or return null if the + * object isn't in the cache, meaning it didn't come back when queried. + */ + $loaded[ $key ] = get_term( (int) $key ); + } + + return $loaded; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/ThemeLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/ThemeLoader.php new file mode 100644 index 00000000..20c9020c --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/ThemeLoader.php @@ -0,0 +1,52 @@ +get_stylesheet(); + $theme = wp_get_theme( $stylesheet ); + if ( $theme->exists() ) { + $loaded[ $key ] = $theme; + } else { + $loaded[ $key ] = null; + } + } + } + } + + return $loaded; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/UserLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/UserLoader.php new file mode 100644 index 00000000..a0ebdd6a --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/UserLoader.php @@ -0,0 +1,179 @@ + true, // User 2 is public (has published posts) + * ] + * + * In this example, user 1 is not public (has no published posts) and is + * omitted from the returned array. + * + * @param array $keys Array of author IDs (int). + * + * @return array + */ + public function get_public_users( array $keys ) { + + // Get public post types that are set to show in GraphQL + // as public users are determined by whether they've published + // content in one of these post types + $post_types = \WPGraphQL::get_allowed_post_types( + 'names', + [ + 'public' => true, + ] + ); + + /** + * Exclude revisions and attachments, since neither ever receive the + * "publish" post status. + */ + unset( $post_types['revision'], $post_types['attachment'] ); + + /** + * Only retrieve public posts by the provided author IDs. Also, + * get_posts_by_author_sql only accepts a single author ID, so we'll need to + * add our own IN statement. + */ + $author_id = null; + $public_only = true; + + $where = get_posts_by_author_sql( $post_types, true, $author_id, $public_only ); + $ids = implode( ', ', array_fill( 0, count( $keys ), '%d' ) ); + $count = count( $keys ); + + global $wpdb; + + $results = $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery + $wpdb->prepare( + "SELECT DISTINCT `post_author` FROM $wpdb->posts $where AND `post_author` IN ( $ids ) LIMIT $count", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare + $keys + ) + ); + + /** + * Empty results or error. + */ + if ( ! is_array( $results ) ) { + return []; + } + + /** + * Reduce to an associative array that can be easily consumed. + */ + return array_reduce( + $results, + static function ( $carry, $result ) { + $carry[ (int) $result->post_author ] = true; + return $carry; + }, + [] + ); + } + + /** + * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded + * values + * + * Note that order of returned values must match exactly the order of keys. + * If some entry is not available for given key - it must include null for the missing key. + * + * For example: + * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] + * + * @param array $keys + * + * @return array + * @throws \Exception + */ + public function loadKeys( array $keys ) { + if ( empty( $keys ) ) { + return $keys; + } + + /** + * Prepare the args for the query. We're provided a specific + * set of IDs, so we want to query as efficiently as possible with + * as little overhead as possible. We don't want to return post counts, + * we don't want to include sticky posts, and we want to limit the query + * to the count of the keys provided. We don't care about the order since we + * will reorder them ourselves to match the order of the provided keys. + */ + $args = [ + 'include' => $keys, + 'number' => count( $keys ), + 'count_total' => false, + 'fields' => 'all_with_meta', + ]; + + /** + * Query for the users and get the results + */ + $query = new \WP_User_Query( $args ); + $query->get_results(); + + /** + * Determine which of the users are public (have published posts). + */ + $public_users = $this->get_public_users( $keys ); + + /** + * Loop over the keys and reduce to an associative array, providing the + * WP_User instance (if found) or null. This ensures that the returned array + * has the same keys that were provided and in the same order. + */ + return array_reduce( + $keys, + static function ( $carry, $key ) use ( $public_users ) { + $user = get_user_by( 'id', $key ); // Cached via previous WP_User_Query. + + if ( $user instanceof \WP_User ) { + /** + * Set a property on the user that can be accessed by the User model. + */ + // @phpstan-ignore-next-line + $user->is_private = ! isset( $public_users[ $key ] ); + + $carry[ $key ] = $user; + } else { + $carry[ $key ] = null; + } + + return $carry; + }, + [] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/UserRoleLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/UserRoleLoader.php new file mode 100644 index 00000000..c438baf1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/Loader/UserRoleLoader.php @@ -0,0 +1,52 @@ +roles; + + $loaded = []; + if ( ! empty( $wp_roles ) && is_array( $wp_roles ) ) { + foreach ( $keys as $key ) { + if ( isset( $wp_roles[ $key ] ) ) { + $role = $wp_roles[ $key ]; + $role['slug'] = $key; + $role['id'] = $key; + $role['displayName'] = $role['name']; + $role['name'] = $key; + $loaded[ $key ] = $role; + } else { + $loaded[ $key ] = null; + } + } + } + + return $loaded; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/MediaItemMutation.php b/lib/wp-graphql-1.17.0/src/Data/MediaItemMutation.php new file mode 100644 index 00000000..8a026ef3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/MediaItemMutation.php @@ -0,0 +1,144 @@ +name; + + /** + * Prepare the data for inserting the mediaItem + * NOTE: These are organized in the same order as: http://v2.wp-api.org/reference/media/#schema-meta + */ + if ( ! empty( $input['date'] ) && false !== strtotime( $input['date'] ) ) { + $insert_post_args['post_date'] = gmdate( 'Y-m-d H:i:s', strtotime( $input['date'] ) ); + } + + if ( ! empty( $input['dateGmt'] ) && false !== strtotime( $input['dateGmt'] ) ) { + $insert_post_args['post_date_gmt'] = gmdate( 'Y-m-d H:i:s', strtotime( $input['dateGmt'] ) ); + } + + if ( ! empty( $input['slug'] ) ) { + $insert_post_args['post_name'] = $input['slug']; + } + + if ( ! empty( $input['status'] ) ) { + $insert_post_args['post_status'] = $input['status']; + } else { + $insert_post_args['post_status'] = 'inherit'; + } + + if ( ! empty( $input['title'] ) ) { + $insert_post_args['post_title'] = $input['title']; + } elseif ( ! empty( $file['file'] ) ) { + $insert_post_args['post_title'] = basename( $file['file'] ); + } + + if ( ! empty( $input['authorId'] ) ) { + $insert_post_args['post_author'] = Utils::get_database_id_from_id( $input['authorId'] ); + } + + if ( ! empty( $input['commentStatus'] ) ) { + $insert_post_args['comment_status'] = $input['commentStatus']; + } + + if ( ! empty( $input['pingStatus'] ) ) { + $insert_post_args['ping_status'] = $input['pingStatus']; + } + + if ( ! empty( $input['caption'] ) ) { + $insert_post_args['post_excerpt'] = $input['caption']; + } + + if ( ! empty( $input['description'] ) ) { + $insert_post_args['post_content'] = $input['description']; + } else { + $insert_post_args['post_content'] = ''; + } + + if ( ! empty( $file['type'] ) ) { + $insert_post_args['post_mime_type'] = $file['type']; + } elseif ( ! empty( $input['fileType'] ) ) { + $insert_post_args['post_mime_type'] = $input['fileType']; + } + + if ( ! empty( $input['parentId'] ) ) { + $insert_post_args['post_parent'] = Utils::get_database_id_from_id( $input['parentId'] ); + } + + /** + * Filter the $insert_post_args + * + * @param array $insert_post_args The array of $input_post_args that will be passed to wp_insert_attachment + * @param array $input The data that was entered as input for the mutation + * @param \WP_Post_Type $post_type_object The post_type_object that the mutation is affecting + * @param string $mutation_type The type of mutation being performed (create, update, delete) + */ + $insert_post_args = apply_filters( 'graphql_media_item_insert_post_args', $insert_post_args, $input, $post_type_object, $mutation_name ); + + return $insert_post_args; + } + + /** + * This updates additional data related to a mediaItem, such as postmeta. + * + * @param int $media_item_id The ID of the media item being mutated + * @param array $input The input on the mutation + * @param \WP_Post_Type $post_type_object The Post Type Object for the item being mutated + * @param string $mutation_name The name of the mutation + * @param \WPGraphQL\AppContext $context The AppContext that is passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo that is passed down the resolve tree + * + * @return void + */ + public static function update_additional_media_item_data( int $media_item_id, array $input, WP_Post_Type $post_type_object, string $mutation_name, AppContext $context, ResolveInfo $info ) { + + /** + * Update alt text postmeta for the mediaItem + */ + if ( ! empty( $input['altText'] ) ) { + update_post_meta( $media_item_id, '_wp_attachment_image_alt', $input['altText'] ); + } + + /** + * Run an action after the additional data has been updated. This is a great spot to hook into to + * update additional data related to mediaItems, such as updating additional postmeta, + * or sending emails to Kevin. . .whatever you need to do with the mediaItem. + * + * @param int $media_item_id The ID of the mediaItem being mutated + * @param array $input The input for the mutation + * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated + * @param string $mutation_name The name of the mutation (ex: create, update, delete) + * @param \WPGraphQL\AppContext $context The AppContext that is passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo that is passed down the resolve tree + */ + do_action( 'graphql_media_item_mutation_update_additional_data', $media_item_id, $input, $post_type_object, $mutation_name, $context, $info ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/NodeResolver.php b/lib/wp-graphql-1.17.0/src/Data/NodeResolver.php new file mode 100644 index 00000000..ecd96185 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/NodeResolver.php @@ -0,0 +1,622 @@ +wp = $wp; + $this->wp->matched_rule = Router::$route . '/?$'; + $this->context = $context; + } + + /** + * Given a Post object, validates it before returning it. + * + * @param \WP_Post $post + * + * @return \WP_Post|null + */ + public function validate_post( WP_Post $post ) { + if ( isset( $this->wp->query_vars['post_type'] ) && ( $post->post_type !== $this->wp->query_vars['post_type'] ) ) { + return null; + } + + if ( ! $this->is_valid_node_type( 'ContentNode' ) ) { + return null; + } + + /** + * Disabling the following code for now, since add_rewrite_uri() would cause a request to direct to a different valid permalink. + */ + /* phpcs:disable + if ( ! isset( $this->wp->query_vars['uri'] ) ) { + return $post; + } + $permalink = get_permalink( $post ); + $parsed_path = $permalink ? wp_parse_url( $permalink, PHP_URL_PATH ) : null; + $trimmed_path = $parsed_path ? rtrim( ltrim( $parsed_path, '/' ), '/' ) : null; + $uri_path = rtrim( ltrim( $this->wp->query_vars['uri'], '/' ), '/' ); + if ( $trimmed_path !== $uri_path ) { + return null; + } + phpcs:enable */ + + if ( empty( $this->wp->query_vars['uri'] ) ) { + return $post; + } + + // if the uri doesn't have the post's urlencoded name or ID in it, we must've found something we didn't expect + // so we will return null + if ( false === strpos( $this->wp->query_vars['uri'], (string) $post->ID ) && false === strpos( $this->wp->query_vars['uri'], urldecode( sanitize_title( $post->post_name ) ) ) ) { + return null; + } + + return $post; + } + + /** + * Given a Term object, validates it before returning it. + * + * @param \WP_Term $term + * + * @return \WP_Term|null + */ + public function validate_term( \WP_Term $term ) { + if ( ! $this->is_valid_node_type( 'TermNode' ) ) { + return null; + } + + if ( isset( $this->wp->query_vars['taxonomy'] ) && $term->taxonomy !== $this->wp->query_vars['taxonomy'] ) { + return null; + } + + return $term; + } + + /** + * Given the URI of a resource, this method attempts to resolve it and return the + * appropriate related object + * + * @param string $uri The path to be used as an identifier for the + * resource. + * @param mixed|array|string $extra_query_vars Any extra query vars to consider + * + * @return mixed + * @throws \Exception + */ + public function resolve_uri( string $uri, $extra_query_vars = '' ) { + + /** + * When this filter return anything other than null, it will be used as a resolved node + * and the execution will be skipped. + * + * This is to be used in extensions to resolve their own nodes which might not use + * WordPress permalink structure. + * + * @param mixed|null $node The node, defaults to nothing. + * @param string $uri The uri being searched. + * @param \WPGraphQL\AppContext $content The app context. + * @param \WP $wp WP object. + * @param mixed|array|string $extra_query_vars Any extra query vars to consider. + */ + $node = apply_filters( 'graphql_pre_resolve_uri', null, $uri, $this->context, $this->wp, $extra_query_vars ); + + if ( ! empty( $node ) ) { + return $node; + } + + /** + * Try to resolve the URI with WP_Query. + * + * This is the way WordPress native permalinks are resolved. + * + * @see \WP::main() + */ + + // Parse the URI and sets the $wp->query_vars property. + $uri = $this->parse_request( $uri, $extra_query_vars ); + + /** + * If the URI is '/', we can resolve it now. + * + * We don't rely on $this->parse_request(), since the home page doesn't get a rewrite rule. + */ + if ( '/' === $uri ) { + return $this->resolve_home_page(); + } + + /** + * Filter the query class used to resolve the URI. By default this is WP_Query. + * + * This can be used by Extensions which use a different query class to resolve data. + * + * @param class-string $query_class The query class used to resolve the URI. Defaults to WP_Query. + * @param ?string $uri The uri being searched. + * @param \WPGraphQL\AppContext $content The app context. + * @param \WP $wp WP object. + * @param mixed|array|string $extra_query_vars Any extra query vars to consider. + */ + $query_class = apply_filters( 'graphql_resolve_uri_query_class', 'WP_Query', $uri, $this->context, $this->wp, $extra_query_vars ); + + if ( ! class_exists( $query_class ) ) { + throw new UserError( + esc_html( + sprintf( + /* translators: %s: The query class used to resolve the URI */ + __( 'The query class %s used to resolve the URI does not exist.', 'wp-graphql' ), + $query_class + ) + ) + ); + } + + /** @var \WP_Query $query */ + $query = new $query_class( $this->wp->query_vars ); + + // is the query is an archive + if ( isset( $query->posts[0] ) && $query->posts[0] instanceof WP_Post && ! $query->is_archive() ) { + $queried_object = $query->posts[0]; + } else { + $queried_object = $query->get_queried_object(); + } + + /** + * When this filter return anything other than null, it will be used as a resolved node + * and the execution will be skipped. + * + * This is to be used in extensions to resolve their own nodes which might not use + * WordPress permalink structure. + * + * It differs from 'graphql_pre_resolve_uri' in that it has been called after the query has been run using the query vars. + * + * @param mixed|null $node The node, defaults to nothing. + * @param ?string $uri The uri being searched. + * @param \WP_Term|\WP_Post_Type|\WP_Post|\WP_User|null $queried_object The queried object, if WP_Query returns one. + * @param \WP_Query $query The query object. + * @param \WPGraphQL\AppContext $content The app context. + * @param \WP $wp WP object. + * @param mixed|array|string $extra_query_vars Any extra query vars to consider. + */ + $node = apply_filters( 'graphql_resolve_uri', null, $uri, $queried_object, $query, $this->context, $this->wp, $extra_query_vars ); + + if ( ! empty( $node ) ) { + return $node; + } + + + // Resolve Post Objects. + if ( $queried_object instanceof WP_Post ) { + // If Page for Posts is set, we need to return the Page archive, not the page. + if ( $query->is_posts_page ) { + // If were intentionally querying for a something other than a ContentType, we need to return null instead of the archive. + if ( ! $this->is_valid_node_type( 'ContentType' ) ) { + return null; + } + + $post_type_object = get_post_type_object( 'post' ); + + if ( ! $post_type_object ) { + return null; + } + + return ! empty( $post_type_object->name ) ? $this->context->get_loader( 'post_type' )->load_deferred( $post_type_object->name ) : null; + } + + // Validate the post before returning it. + if ( ! $this->validate_post( $queried_object ) ) { + return null; + } + + return ! empty( $queried_object->ID ) ? $this->context->get_loader( 'post' )->load_deferred( $queried_object->ID ) : null; + } + + // Resolve Terms. + if ( $queried_object instanceof \WP_Term ) { + // Validate the term before returning it. + if ( ! $this->validate_term( $queried_object ) ) { + return null; + } + + return ! empty( $queried_object->term_id ) ? $this->context->get_loader( 'term' )->load_deferred( $queried_object->term_id ) : null; + } + + // Resolve Post Types. + if ( $queried_object instanceof \WP_Post_Type ) { + + // Bail if we're explicitly requesting a different GraphQL type. + if ( ! $this->is_valid_node_type( 'ContentType' ) ) { + return null; + } + + + + return ! empty( $queried_object->name ) ? $this->context->get_loader( 'post_type' )->load_deferred( $queried_object->name ) : null; + } + + // Resolve Users + if ( $queried_object instanceof \WP_User ) { + // Bail if we're explicitly requesting a different GraphQL type. + if ( ! $this->is_valid_node_type( 'User' ) ) { + return null; + } + + return ! empty( $queried_object->ID ) ? $this->context->get_loader( 'user' )->load_deferred( $queried_object->ID ) : null; + } + + /** + * This filter provides a fallback for resolving nodes that were unable to be resolved by NodeResolver::resolve_uri. + * + * This can be used by Extensions to resolve edge cases that are not handled by the core NodeResolver. + * + * @param mixed|null $node The node, defaults to nothing. + * @param ?string $uri The uri being searched. + * @param \WP_Term|\WP_Post_Type|\WP_Post|\WP_User|null $queried_object The queried object, if WP_Query returns one. + * @param \WP_Query $query The query object. + * @param \WPGraphQL\AppContext $content The app context. + * @param \WP $wp WP object. + * @param mixed|array|string $extra_query_vars Any extra query vars to consider. + */ + return apply_filters( 'graphql_post_resolve_uri', $node, $uri, $queried_object, $query, $this->context, $this->wp, $extra_query_vars ); + } + + /** + * Parses a URL to produce an array of query variables. + * + * Mimics WP::parse_request() + * + * @param string $uri + * @param array|string $extra_query_vars + * + * @return string|null The parsed uri. + */ + public function parse_request( string $uri, $extra_query_vars = '' ) { + // Attempt to parse the provided URI. + $parsed_url = wp_parse_url( $uri ); + + if ( false === $parsed_url ) { + graphql_debug( + __( 'Cannot parse provided URI', 'wp-graphql' ), + [ + 'uri' => $uri, + ] + ); + return null; + } + + // Bail if external URI. + if ( isset( $parsed_url['host'] ) ) { + $site_url = wp_parse_url( site_url() ); + $home_url = wp_parse_url( home_url() ); + + /** + * @var array $home_url + * @var array $site_url + */ + if ( ! in_array( + $parsed_url['host'], + [ + $site_url['host'], + $home_url['host'], + ], + true + ) ) { + graphql_debug( + __( 'Cannot return a resource for an external URI', 'wp-graphql' ), + [ + 'uri' => $uri, + ] + ); + return null; + } + } + + if ( isset( $parsed_url['query'] ) && ( empty( $parsed_url['path'] ) || '/' === $parsed_url['path'] ) ) { + $uri = $parsed_url['query']; + } elseif ( isset( $parsed_url['path'] ) ) { + $uri = $parsed_url['path']; + } + + /** + * Follows pattern from WP::parse_request() + * + * @see https://github.com/WordPress/wordpress-develop/blob/6.0.2/src/wp-includes/class-wp.php#L135 + */ + global $wp_rewrite; + + $this->wp->query_vars = []; + $post_type_query_vars = []; + + if ( is_array( $extra_query_vars ) ) { + $this->wp->query_vars = &$extra_query_vars; + } elseif ( ! empty( $extra_query_vars ) ) { + parse_str( $extra_query_vars, $this->wp->extra_query_vars ); + } + + // Set uri to Query vars. + $this->wp->query_vars['uri'] = $uri; + + // Process PATH_INFO, REQUEST_URI, and 404 for permalinks. + + // Fetch the rewrite rules. + $rewrite = $wp_rewrite->wp_rewrite_rules(); + if ( ! empty( $rewrite ) ) { + // If we match a rewrite rule, this will be cleared. + $error = '404'; + $this->wp->did_permalink = true; + + $pathinfo = ! empty( $uri ) ? $uri : ''; + list( $pathinfo ) = explode( '?', $pathinfo ); + $pathinfo = str_replace( '%', '%25', $pathinfo ); + + list( $req_uri ) = explode( '?', $pathinfo ); + $home_path = parse_url( home_url(), PHP_URL_PATH ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url + $home_path_regex = ''; + if ( is_string( $home_path ) && '' !== $home_path ) { + $home_path = trim( $home_path, '/' ); + $home_path_regex = sprintf( '|^%s|i', preg_quote( $home_path, '|' ) ); + } + + /* + * Trim path info from the end and the leading home path from the front. + * For path info requests, this leaves us with the requesting filename, if any. + * For 404 requests, this leaves us with the requested permalink. + */ + $query = ''; + $matches = null; + $req_uri = str_replace( $pathinfo, '', $req_uri ); + $req_uri = trim( $req_uri, '/' ); + $pathinfo = trim( $pathinfo, '/' ); + + if ( ! empty( $home_path_regex ) ) { + $req_uri = preg_replace( $home_path_regex, '', $req_uri ); + $req_uri = trim( $req_uri, '/' ); // @phpstan-ignore-line + $pathinfo = preg_replace( $home_path_regex, '', $pathinfo ); + $pathinfo = trim( $pathinfo, '/' ); // @phpstan-ignore-line + } + + // The requested permalink is in $pathinfo for path info requests and + // $req_uri for other requests. + if ( ! empty( $pathinfo ) && ! preg_match( '|^.*' . $wp_rewrite->index . '$|', $pathinfo ) ) { + $requested_path = $pathinfo; + } else { + // If the request uri is the index, blank it out so that we don't try to match it against a rule. + if ( $req_uri === $wp_rewrite->index ) { + $req_uri = ''; + } + $requested_path = $req_uri; + } + $requested_file = $req_uri; + + $this->wp->request = $requested_path; + + // Look for matches. + $request_match = $requested_path; + if ( empty( $request_match ) ) { + // An empty request could only match against ^$ regex + if ( isset( $rewrite['$'] ) ) { + $this->wp->matched_rule = '$'; + $query = $rewrite['$']; + $matches = [ '' ]; + } + } else { + foreach ( (array) $rewrite as $match => $query ) { + // If the requested file is the anchor of the match, prepend it to the path info. + if ( ! empty( $requested_file ) && strpos( $match, $requested_file ) === 0 && $requested_file !== $requested_path ) { + $request_match = $requested_file . '/' . $requested_path; + } + + if ( + preg_match( "#^$match#", $request_match, $matches ) || + preg_match( "#^$match#", urldecode( $request_match ), $matches ) + ) { + if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$matches\[([0-9]+)\]/', $query, $varmatch ) ) { + // This is a verbose page match, let's check to be sure about it. + $page = get_page_by_path( $matches[ $varmatch[1] ] ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_page_by_path_get_page_by_path + if ( ! $page ) { + continue; + } + + $post_status_obj = get_post_status_object( $page->post_status ); + if ( + ( ! isset( $post_status_obj->public ) || ! $post_status_obj->public ) && + ( ! isset( $post_status_obj->protected ) || ! $post_status_obj->protected ) && + ( ! isset( $post_status_obj->private ) || ! $post_status_obj->private ) && + ( ! isset( $post_status_obj->exclude_from_search ) || $post_status_obj->exclude_from_search ) + ) { + continue; + } + } + + // Got a match. + $this->wp->matched_rule = $match; + break; + } + } + } + + if ( ! empty( $this->wp->matched_rule ) ) { + // Trim the query of everything up to the '?'. + $query = preg_replace( '!^.+\?!', '', $query ); + + // Substitute the substring matches into the query. + $query = addslashes( \WP_MatchesMapRegex::apply( $query, $matches ) ); // @phpstan-ignore-line + + $this->wp->matched_query = $query; + + // Parse the query. + parse_str( $query, $perma_query_vars ); + + // If we're processing a 404 request, clear the error var since we found something. + // @phpstan-ignore-next-line + if ( '404' == $error ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual + unset( $error ); + } + } + } + + /** + * Filters the query variables allowed before processing. + * + * Allows (publicly allowed) query vars to be added, removed, or changed prior + * to executing the query. Needed to allow custom rewrite rules using your own arguments + * to work, or any other custom query variables you want to be publicly available. + * + * @since 1.5.0 + * + * @param string[] $public_query_vars The array of allowed query variable names. + */ + $this->wp->public_query_vars = apply_filters( 'query_vars', $this->wp->public_query_vars ); + + foreach ( get_post_types( [ 'show_in_graphql' => true ], 'objects' ) as $post_type => $t ) { + /** @var \WP_Post_Type $t */ + if ( $t->query_var ) { + $post_type_query_vars[ $t->query_var ] = $post_type; + } + } + + foreach ( $this->wp->public_query_vars as $wpvar ) { + $parsed_query = []; + if ( isset( $parsed_url['query'] ) ) { + parse_str( $parsed_url['query'], $parsed_query ); + } + + if ( isset( $this->wp->extra_query_vars[ $wpvar ] ) ) { + $this->wp->query_vars[ $wpvar ] = $this->wp->extra_query_vars[ $wpvar ]; + } elseif ( isset( $_GET[ $wpvar ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification + $this->wp->query_vars[ $wpvar ] = $_GET[ $wpvar ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.NonceVerification.Recommended + } elseif ( isset( $perma_query_vars[ $wpvar ] ) ) { + $this->wp->query_vars[ $wpvar ] = $perma_query_vars[ $wpvar ]; + } elseif ( isset( $parsed_query[ $wpvar ] ) ) { + $this->wp->query_vars[ $wpvar ] = $parsed_query[ $wpvar ]; + } + + if ( ! empty( $this->wp->query_vars[ $wpvar ] ) ) { + if ( ! is_array( $this->wp->query_vars[ $wpvar ] ) ) { + $this->wp->query_vars[ $wpvar ] = (string) $this->wp->query_vars[ $wpvar ]; + } else { + foreach ( $this->wp->query_vars[ $wpvar ] as $vkey => $v ) { + if ( is_scalar( $v ) ) { + $this->wp->query_vars[ $wpvar ][ $vkey ] = (string) $v; + } + } + } + + if ( isset( $post_type_query_vars[ $wpvar ] ) ) { + $this->wp->query_vars['post_type'] = $post_type_query_vars[ $wpvar ]; + $this->wp->query_vars['name'] = $this->wp->query_vars[ $wpvar ]; + } + } + } + + // Convert urldecoded spaces back into '+'. + foreach ( get_taxonomies( [ 'show_in_graphql' => true ], 'objects' ) as $t ) { + if ( $t->query_var && isset( $this->wp->query_vars[ $t->query_var ] ) ) { + $this->wp->query_vars[ $t->query_var ] = str_replace( ' ', '+', $this->wp->query_vars[ $t->query_var ] ); + } + } + + // Limit publicly queried post_types to those that are publicly_queryable + if ( isset( $this->wp->query_vars['post_type'] ) ) { + $queryable_post_types = get_post_types( [ 'show_in_graphql' => true ] ); + if ( ! is_array( $this->wp->query_vars['post_type'] ) ) { + if ( ! in_array( $this->wp->query_vars['post_type'], $queryable_post_types, true ) ) { + unset( $this->wp->query_vars['post_type'] ); + } + } else { + $this->wp->query_vars['post_type'] = array_intersect( $this->wp->query_vars['post_type'], $queryable_post_types ); + } + } + + // Resolve conflicts between posts with numeric slugs and date archive queries. + $this->wp->query_vars = wp_resolve_numeric_slug_conflicts( $this->wp->query_vars ); + + foreach ( (array) $this->wp->private_query_vars as $var ) { + if ( isset( $this->wp->extra_query_vars[ $var ] ) ) { + $this->wp->query_vars[ $var ] = $this->wp->extra_query_vars[ $var ]; + } + } + + if ( isset( $error ) ) { + $this->wp->query_vars['error'] = $error; + } + + /** + * Filters the array of parsed query variables. + * + * @param array $query_vars The array of requested query variables. + * + * @since 2.1.0 + */ + $this->wp->query_vars = apply_filters( 'request', $this->wp->query_vars ); + + // We don't need the GraphQL args anymore. + unset( $this->wp->query_vars['graphql'] ); + + do_action_ref_array( 'parse_request', [ &$this->wp ] ); + + return $uri; + } + + /** + * Checks if the node type is set in the query vars and, if so, whether it matches the node type. + */ + protected function is_valid_node_type( string $node_type ): bool { + return ! isset( $this->wp->query_vars['nodeType'] ) || $this->wp->query_vars['nodeType'] === $node_type; + } + + /** + * Resolves the home page. + * + * If the homepage is a static page, return the page, otherwise we return the Posts `ContentType`. + * + * @todo Replace `ContentType` with an `Archive` type. + */ + protected function resolve_home_page(): ?Deferred { + $page_id = get_option( 'page_on_front', 0 ); + $show_on_front = get_option( 'show_on_front', 'posts' ); + + // If the homepage is a static page, return the page. + if ( 'page' === $show_on_front && ! empty( $page_id ) ) { + $page = get_post( $page_id ); + + if ( empty( $page ) ) { + return null; + } + + return $this->context->get_loader( 'post' )->load_deferred( $page->ID ); + } + + // If the homepage is set to latest posts, we need to make sure not to resolve it when when for other types. + if ( ! $this->is_valid_node_type( 'ContentType' ) ) { + return null; + } + + // We dont have an 'Archive' type, so we resolve to the ContentType. + return $this->context->get_loader( 'post_type' )->load_deferred( 'post' ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/PostObjectMutation.php b/lib/wp-graphql-1.17.0/src/Data/PostObjectMutation.php new file mode 100644 index 00000000..7c2261eb --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/PostObjectMutation.php @@ -0,0 +1,496 @@ +name; + + /** + * Prepare the data for inserting the post + * NOTE: These are organized in the same order as: https://developer.wordpress.org/reference/functions/wp_insert_post/ + */ + if ( ! empty( $input['authorId'] ) ) { + $insert_post_args['post_author'] = Utils::get_database_id_from_id( $input['authorId'] ); + } + + if ( ! empty( $input['date'] ) && false !== strtotime( $input['date'] ) ) { + $insert_post_args['post_date'] = gmdate( 'Y-m-d H:i:s', strtotime( $input['date'] ) ); + } + + if ( ! empty( $input['content'] ) ) { + $insert_post_args['post_content'] = $input['content']; + } + + if ( ! empty( $input['title'] ) ) { + $insert_post_args['post_title'] = $input['title']; + } + + if ( ! empty( $input['excerpt'] ) ) { + $insert_post_args['post_excerpt'] = $input['excerpt']; + } + + if ( ! empty( $input['status'] ) ) { + $insert_post_args['post_status'] = $input['status']; + } + + if ( ! empty( $input['commentStatus'] ) ) { + $insert_post_args['comment_status'] = $input['commentStatus']; + } + + if ( ! empty( $input['pingStatus'] ) ) { + $insert_post_args['ping_status'] = $input['pingStatus']; + } + + if ( ! empty( $input['password'] ) ) { + $insert_post_args['post_password'] = $input['password']; + } + + if ( ! empty( $input['slug'] ) ) { + $insert_post_args['post_name'] = $input['slug']; + } + + if ( ! empty( $input['toPing'] ) ) { + $insert_post_args['to_ping'] = $input['toPing']; + } + + if ( ! empty( $input['pinged'] ) ) { + $insert_post_args['pinged'] = $input['pinged']; + } + + if ( ! empty( $input['parentId'] ) ) { + $insert_post_args['post_parent'] = Utils::get_database_id_from_id( $input['parentId'] ); + } + + if ( ! empty( $input['menuOrder'] ) ) { + $insert_post_args['menu_order'] = $input['menuOrder']; + } + + if ( ! empty( $input['mimeType'] ) ) { + $insert_post_args['post_mime_type'] = $input['mimeType']; + } + + if ( ! empty( $input['commentCount'] ) ) { + $insert_post_args['comment_count'] = $input['commentCount']; + } + + /** + * Filter the $insert_post_args + * + * @param array $insert_post_args The array of $input_post_args that will be passed to wp_insert_post + * @param array $input The data that was entered as input for the mutation + * @param \WP_Post_Type $post_type_object The post_type_object that the mutation is affecting + * @param string $mutation_type The type of mutation being performed (create, edit, etc) + */ + $insert_post_args = apply_filters( 'graphql_post_object_insert_post_args', $insert_post_args, $input, $post_type_object, $mutation_name ); + + /** + * Return the $args + */ + return $insert_post_args; + } + + /** + * This updates additional data related to a post object, such as postmeta, term relationships, + * etc. + * + * @param int $post_id $post_id The ID of the postObject being + * mutated + * @param array $input The input for the mutation + * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being + * mutated + * @param string $mutation_name The name of the mutation (ex: create, update, + * delete) + * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers + * @param string $intended_post_status The intended post_status the post should have + * according to the mutation input + * @param string $default_post_status The default status posts should use if an + * intended status wasn't set + * + * @return void + */ + public static function update_additional_post_object_data( $post_id, $input, $post_type_object, $mutation_name, AppContext $context, ResolveInfo $info, $default_post_status = null, $intended_post_status = null ) { + + /** + * Sets the post lock + * + * @param bool $is_locked Whether the post is locked + * @param int $post_id The ID of the postObject being mutated + * @param array $input The input for the mutation + * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated + * @param string $mutation_name The name of the mutation (ex: create, update, delete) + * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers + * @param ?string $intended_post_status The intended post_status the post should have according to the mutation input + * @param ?string $default_post_status The default status posts should use if an intended status wasn't set + * + * @return bool + */ + if ( true === apply_filters( 'graphql_post_object_mutation_set_edit_lock', true, $post_id, $input, $post_type_object, $mutation_name, $context, $info, $default_post_status, $intended_post_status ) ) { + /** + * Set the post_lock for the $new_post_id + */ + self::set_edit_lock( $post_id ); + } + + /** + * Update the _edit_last field + */ + update_post_meta( $post_id, '_edit_last', get_current_user_id() ); + + /** + * Update the postmeta fields + */ + if ( ! empty( $input['desiredSlug'] ) ) { + update_post_meta( $post_id, '_wp_desired_post_slug', $input['desiredSlug'] ); + } + + /** + * Set the object terms + * + * @param int $post_id The ID of the postObject being mutated + * @param array $input The input for the mutation + * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated + * @param string $mutation_name The name of the mutation (ex: create, update, delete) + */ + self::set_object_terms( $post_id, $input, $post_type_object, $mutation_name ); + + /** + * Run an action after the additional data has been updated. This is a great spot to hook into to + * update additional data related to postObjects, such as setting relationships, updating additional postmeta, + * or sending emails to Kevin. . .whatever you need to do with the postObject. + * + * @param int $post_id The ID of the postObject being mutated + * @param array $input The input for the mutation + * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated + * @param string $mutation_name The name of the mutation (ex: create, update, delete) + * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers + * @param ?string $intended_post_status The intended post_status the post should have according to the mutation input + * @param ?string $default_post_status The default status posts should use if an intended status wasn't set + */ + do_action( 'graphql_post_object_mutation_update_additional_data', $post_id, $input, $post_type_object, $mutation_name, $context, $info, $default_post_status, $intended_post_status ); + + /** + * Sets the post lock + * + * @param bool $is_locked Whether the post is locked. + * @param int $post_id The ID of the postObject being mutated + * @param array $input The input for the mutation + * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated + * @param string $mutation_name The name of the mutation (ex: create, update, delete) + * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers + * @param ?string $intended_post_status The intended post_status the post should have according to the mutation input + * @param ?string $default_post_status The default status posts should use if an intended status wasn't set + * + * @return bool + */ + if ( true === apply_filters( 'graphql_post_object_mutation_set_edit_lock', true, $post_id, $input, $post_type_object, $mutation_name, $context, $info, $default_post_status, $intended_post_status ) ) { + /** + * Set the post_lock for the $new_post_id + */ + self::remove_edit_lock( $post_id ); + } + } + + /** + * Given a $post_id and $input from the mutation, check to see if any term associations are + * being made, and properly set the relationships + * + * @param int $post_id The ID of the postObject being mutated + * @param array $input The input for the mutation + * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being + * mutated + * @param string $mutation_name The name of the mutation (ex: create, update, delete) + * + * @return void + */ + protected static function set_object_terms( int $post_id, array $input, WP_Post_Type $post_type_object, string $mutation_name ) { + + /** + * Fire an action before setting object terms during a GraphQL Post Object Mutation. + * + * One example use for this hook would be to create terms from the input that may not exist yet, so that they can be set as a relation below. + * + * @param int $post_id The ID of the postObject being mutated + * @param array $input The input for the mutation + * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated + * @param string $mutation_name The name of the mutation (ex: create, update, delete) + */ + do_action( 'graphql_post_object_mutation_set_object_terms', $post_id, $input, $post_type_object, $mutation_name ); + + /** + * Get the allowed taxonomies and iterate through them to find the term inputs to use for setting relationships + * + * @var \WP_Taxonomy[] $allowed_taxonomies + */ + $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); + + foreach ( $allowed_taxonomies as $tax_object ) { + + /** + * If the taxonomy is in the array of taxonomies registered to the post_type + */ + if ( in_array( $tax_object->name, get_object_taxonomies( $post_type_object->name ), true ) ) { + + /** + * If there is input for the taxonomy, process it + */ + if ( isset( $input[ lcfirst( $tax_object->graphql_plural_name ) ] ) ) { + $term_input = $input[ lcfirst( $tax_object->graphql_plural_name ) ]; + + /** + * Default append to true, but allow input to set it to false. + */ + $append = ! isset( $term_input['append'] ) || false !== $term_input['append']; + + /** + * Start an array of terms to connect + */ + $terms_to_connect = []; + + /** + * Filter whether to allow terms to be created during a post mutation. + * + * If a post mutation includes term input for a term that does not already exist, + * this will allow terms to be created in order to connect the term to the post object, + * but if filtered to false, this will prevent the term that doesn't already exist + * from being created during the mutation of the post. + * + * @param bool $allow_term_creation Whether new terms should be created during the post object mutation + * @param \WP_Taxonomy $tax_object The Taxonomy object for the term being added to the Post Object + */ + $allow_term_creation = apply_filters( 'graphql_post_object_mutations_allow_term_creation', true, $tax_object ); + + /** + * If there are nodes in the term_input + */ + if ( ! empty( $term_input['nodes'] ) && is_array( $term_input['nodes'] ) ) { + foreach ( $term_input['nodes'] as $node ) { + $term_exists = false; + + /** + * Handle the input for ID first. + */ + if ( ! empty( $node['id'] ) ) { + if ( ! absint( $node['id'] ) ) { + $id_parts = Relay::fromGlobalId( $node['id'] ); + + if ( ! empty( $id_parts['id'] ) ) { + $term_exists = get_term_by( 'id', absint( $id_parts['id'] ), $tax_object->name ); + if ( isset( $term_exists->term_id ) ) { + $terms_to_connect[] = $term_exists->term_id; + } + } + } else { + $term_exists = get_term_by( 'id', absint( $node['id'] ), $tax_object->name ); + if ( isset( $term_exists->term_id ) ) { + $terms_to_connect[] = $term_exists->term_id; + } + } + + /** + * Next, handle the input for slug if there wasn't an ID input + */ + } elseif ( ! empty( $node['slug'] ) ) { + $sanitized_slug = sanitize_text_field( $node['slug'] ); + $term_exists = get_term_by( 'slug', $sanitized_slug, $tax_object->name ); + if ( isset( $term_exists->term_id ) ) { + $terms_to_connect[] = $term_exists->term_id; + } + /** + * If the input for the term isn't an existing term, check to make sure + * we're allowed to create new terms during a Post Object mutation + */ + } + + /** + * If no term exists so far, and terms are set to be allowed to be created + * during a post object mutation, create the term to connect based on the + * input + */ + if ( ! $term_exists && true === $allow_term_creation ) { + + /** + * If the current user cannot edit terms, don't create terms to connect + */ + if ( ! isset( $tax_object->cap->edit_terms ) || ! current_user_can( $tax_object->cap->edit_terms ) ) { + return; + } + + $created_term = self::create_term_to_connect( $node, $tax_object->name ); + + if ( ! empty( $created_term ) ) { + $terms_to_connect[] = $created_term; + } + } + } + } + + /** + * If the current user cannot edit terms, don't create terms to connect + */ + if ( ! isset( $tax_object->cap->assign_terms ) || ! current_user_can( $tax_object->cap->assign_terms ) ) { + return; + } + + wp_set_object_terms( $post_id, $terms_to_connect, $tax_object->name, $append ); + } + } + } + } + + /** + * Given an array of Term properties (slug, name, description, etc), create the term and return + * a term_id + * + * @param array $node The node input for the term + * @param string $taxonomy The taxonomy the term input is for + * + * @return int $term_id The ID of the created term. 0 if no term was created. + */ + protected static function create_term_to_connect( $node, $taxonomy ) { + $created_term = []; + $term_to_create = []; + $term_args = []; + + if ( ! empty( $node['name'] ) ) { + $term_to_create['name'] = sanitize_text_field( $node['name'] ); + } elseif ( ! empty( $node['slug'] ) ) { + $term_to_create['name'] = sanitize_text_field( $node['slug'] ); + } + + if ( ! empty( $node['slug'] ) ) { + $term_args['slug'] = sanitize_text_field( $node['slug'] ); + } + + if ( ! empty( $node['description'] ) ) { + $term_args['description'] = sanitize_text_field( $node['description'] ); + } + + /** + * @todo: consider supporting "parent" input in $term_args + */ + + if ( isset( $term_to_create['name'] ) && ! empty( $term_to_create['name'] ) ) { + $created_term = wp_insert_term( $term_to_create['name'], $taxonomy, $term_args ); + } + + if ( is_wp_error( $created_term ) ) { + if ( isset( $created_term->error_data['term_exists'] ) ) { + return $created_term->error_data['term_exists']; + } + + return 0; + } + + /** + * Return the created term, or 0 + */ + return isset( $created_term['term_id'] ) ? absint( $created_term['term_id'] ) : 0; + } + + /** + * This is a copy of the wp_set_post_lock function that exists in WordPress core, but is not + * accessible because that part of WordPress is never loaded for WPGraphQL executions + * + * Mark the post as currently being edited by the current user + * + * @param int $post_id ID of the post being edited. + * + * @return array|false Array of the lock time and user ID. False if the post does not exist, or + * there is no current user. + */ + public static function set_edit_lock( $post_id ) { + $post = get_post( $post_id ); + $user_id = get_current_user_id(); + + if ( empty( $post ) ) { + return false; + } + + if ( 0 === $user_id ) { + return false; + } + + $now = time(); + $lock = "$now:$user_id"; + update_post_meta( $post->ID, '_edit_lock', $lock ); + + return [ $now, $user_id ]; + } + + /** + * Remove the edit lock for a post + * + * @param int $post_id ID of the post to delete the lock for + * + * @return bool + */ + public static function remove_edit_lock( int $post_id ) { + $post = get_post( $post_id ); + + if ( empty( $post ) ) { + return false; + } + + return delete_post_meta( $post->ID, '_edit_lock' ); + } + + /** + * Check the edit lock for a post + * + * @param false|int $post_id ID of the post to delete the lock for + * @param array $input The input for the mutation + * + * @return false|int Return false if no lock or the user_id of the owner of the lock + */ + public static function check_edit_lock( $post_id, array $input ) { + if ( false === $post_id ) { + return false; + } + + // If override the edit lock is set, return early + if ( isset( $input['ignoreEditLock'] ) && true === $input['ignoreEditLock'] ) { + return false; + } + + require_once ABSPATH . 'wp-admin/includes/post.php'; + + if ( function_exists( 'wp_check_post_lock' ) ) { + return wp_check_post_lock( $post_id ); + } + + return false; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/TermObjectMutation.php b/lib/wp-graphql-1.17.0/src/Data/TermObjectMutation.php new file mode 100644 index 00000000..caeeb5db --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/TermObjectMutation.php @@ -0,0 +1,87 @@ +name; + + /** + * Prepare the data for inserting the term + */ + if ( ! empty( $input['aliasOf'] ) ) { + $insert_args['alias_of'] = $input['aliasOf']; + } + + if ( ! empty( $input['name'] ) ) { + $insert_args['name'] = $input['name']; + } + + if ( ! empty( $input['description'] ) ) { + $insert_args['description'] = $input['description']; + } + + if ( ! empty( $input['slug'] ) ) { + $insert_args['slug'] = $input['slug']; + } + + /** + * If the parentId argument was entered, we need to validate that it's actually a legit term that can + * be set as a parent + */ + if ( ! empty( $input['parentId'] ) ) { + + /** + * Convert parent ID to WordPress ID + */ + $parent_id = Utils::get_database_id_from_id( $input['parentId'] ); + + if ( empty( $parent_id ) ) { + throw new UserError( esc_html__( 'The parent ID is not a valid ID', 'wp-graphql' ) ); + } + + /** + * Ensure there's actually a parent term to be associated with + */ + $parent_term = get_term( absint( $parent_id ), $taxonomy->name ); + + if ( ! $parent_term instanceof \WP_Term ) { + throw new UserError( esc_html__( 'The parent does not exist', 'wp-graphql' ) ); + } + + $insert_args['parent'] = $parent_term->term_id; + } + + /** + * Filter the $insert_args + * + * @param array $insert_args The array of input args that will be passed to the functions that insert terms + * @param array $input The data that was entered as input for the mutation + * @param \WP_Taxonomy $taxonomy The taxonomy object of the term being mutated + * @param string $mutation_name The name of the mutation being performed (create, edit, etc) + */ + return apply_filters( 'graphql_term_object_insert_term_args', $insert_args, $input, $taxonomy, $mutation_name ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Data/UserMutation.php b/lib/wp-graphql-1.17.0/src/Data/UserMutation.php new file mode 100644 index 00000000..207fb171 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Data/UserMutation.php @@ -0,0 +1,314 @@ + [ + 'type' => 'String', + 'description' => __( 'A string that contains the plain text password for the user.', 'wp-graphql' ), + ], + 'nicename' => [ + 'type' => 'String', + 'description' => __( 'A string that contains a URL-friendly name for the user. The default is the user\'s username.', 'wp-graphql' ), + ], + 'websiteUrl' => [ + 'type' => 'String', + 'description' => __( 'A string containing the user\'s URL for the user\'s web site.', 'wp-graphql' ), + ], + 'email' => [ + 'type' => 'String', + 'description' => __( 'A string containing the user\'s email address.', 'wp-graphql' ), + ], + 'displayName' => [ + 'type' => 'String', + 'description' => __( 'A string that will be shown on the site. Defaults to user\'s username. It is likely that you will want to change this, for both appearance and security through obscurity (that is if you dont use and delete the default admin user).', 'wp-graphql' ), + ], + 'nickname' => [ + 'type' => 'String', + 'description' => __( 'The user\'s nickname, defaults to the user\'s username.', 'wp-graphql' ), + ], + 'firstName' => [ + 'type' => 'String', + 'description' => __( ' The user\'s first name.', 'wp-graphql' ), + ], + 'lastName' => [ + 'type' => 'String', + 'description' => __( 'The user\'s last name.', 'wp-graphql' ), + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'A string containing content about the user.', 'wp-graphql' ), + ], + 'richEditing' => [ + 'type' => 'String', + 'description' => __( 'A string for whether to enable the rich editor or not. False if not empty.', 'wp-graphql' ), + ], + 'registered' => [ + 'type' => 'String', + 'description' => __( 'The date the user registered. Format is Y-m-d H:i:s.', 'wp-graphql' ), + ], + 'roles' => [ + 'type' => [ 'list_of' => 'String' ], + 'description' => __( 'An array of roles to be assigned to the user.', 'wp-graphql' ), + ], + 'jabber' => [ + 'type' => 'String', + 'description' => __( 'User\'s Jabber account.', 'wp-graphql' ), + ], + 'aim' => [ + 'type' => 'String', + 'description' => __( 'User\'s AOL IM account.', 'wp-graphql' ), + ], + 'yim' => [ + 'type' => 'String', + 'description' => __( 'User\'s Yahoo IM account.', 'wp-graphql' ), + ], + 'locale' => [ + 'type' => 'String', + 'description' => __( 'User\'s locale.', 'wp-graphql' ), + ], + ]; + + /** + * Filters all of the fields available for input + * + * @var array $input_fields + */ + self::$input_fields = apply_filters( 'graphql_user_mutation_input_fields', $input_fields ); + } + + return ( ! empty( self::$input_fields ) ) ? self::$input_fields : null; + } + + /** + * Maps the GraphQL input to a format that the WordPress functions can use + * + * @param array $input Data coming from the GraphQL mutation query input + * @param string $mutation_name Name of the mutation being performed + * + * @return array + */ + public static function prepare_user_object( $input, $mutation_name ) { + $insert_user_args = []; + + /** + * Optional fields + */ + if ( isset( $input['nicename'] ) ) { + $insert_user_args['user_nicename'] = $input['nicename']; + } + + if ( isset( $input['websiteUrl'] ) ) { + $insert_user_args['user_url'] = esc_url( $input['websiteUrl'] ); + } + + if ( isset( $input['displayName'] ) ) { + $insert_user_args['display_name'] = $input['displayName']; + } + + if ( isset( $input['nickname'] ) ) { + $insert_user_args['nickname'] = $input['nickname']; + } + + if ( isset( $input['firstName'] ) ) { + $insert_user_args['first_name'] = $input['firstName']; + } + + if ( isset( $input['lastName'] ) ) { + $insert_user_args['last_name'] = $input['lastName']; + } + + if ( isset( $input['description'] ) ) { + $insert_user_args['description'] = $input['description']; + } + + if ( isset( $input['richEditing'] ) ) { + $insert_user_args['rich_editing'] = $input['richEditing']; + } + + if ( isset( $input['registered'] ) ) { + $insert_user_args['user_registered'] = $input['registered']; + } + + if ( isset( $input['locale'] ) ) { + $insert_user_args['locale'] = $input['locale']; + } + + /** + * Required fields + */ + if ( ! empty( $input['email'] ) ) { + if ( false === is_email( apply_filters( 'pre_user_email', $input['email'] ) ) ) { + throw new UserError( esc_html__( 'The email address you are trying to use is invalid', 'wp-graphql' ) ); + } + $insert_user_args['user_email'] = $input['email']; + } + + if ( ! empty( $input['password'] ) ) { + $insert_user_args['user_pass'] = $input['password']; + } else { + $insert_user_args['user_pass'] = null; + } + + if ( ! empty( $input['username'] ) ) { + $insert_user_args['user_login'] = $input['username']; + } + + if ( ! empty( $input['roles'] ) ) { + /** + * Pluck the first role out of the array since the insert and update functions only + * allow one role to be set at a time. We will add all of the roles passed to the + * mutation later on after the initial object has been created or updated. + */ + $insert_user_args['role'] = $input['roles'][0]; + } + + /** + * Filters the mappings for input to arguments + * + * @param array $insert_user_args The arguments to ultimately be passed to the WordPress function + * @param array $input Input data from the GraphQL mutation + * @param string $mutation_name What user mutation is being performed for context + */ + $insert_user_args = apply_filters( 'graphql_user_insert_post_args', $insert_user_args, $input, $mutation_name ); + + return $insert_user_args; + } + + /** + * This updates additional data related to the user object after the initial mutation has + * happened + * + * @param int $user_id The ID of the user being mutated + * @param array $input The input data from the GraphQL query + * @param string $mutation_name Name of the mutation currently being run + * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the Resolve Tree + * + * @return void + * @throws \Exception + */ + public static function update_additional_user_object_data( $user_id, $input, $mutation_name, AppContext $context, ResolveInfo $info ) { + $roles = ! empty( $input['roles'] ) ? $input['roles'] : []; + self::add_user_roles( $user_id, $roles ); + + /** + * Run an action after the additional data has been updated. This is a great spot to hook into to + * update additional data related to users, such as setting relationships, updating additional usermeta, + * or sending emails to Kevin... whatever you need to do with the userObject. + * + * @param int $user_id The ID of the user being mutated + * @param array $input The input for the mutation + * @param string $mutation_name The name of the mutation (ex: create, update, delete) + * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the Resolve Tree + */ + do_action( 'graphql_user_object_mutation_update_additional_data', $user_id, $input, $mutation_name, $context, $info ); + } + + /** + * Method to add user roles to a user object + * + * @param int $user_id The ID of the user + * @param array $roles List of roles that need to get added to the user + * + * @return void + * @throws \Exception + */ + private static function add_user_roles( $user_id, $roles ) { + if ( empty( $roles ) || ! is_array( $roles ) || ! current_user_can( 'edit_user', $user_id ) ) { + return; + } + + $user = get_user_by( 'ID', $user_id ); + + if ( false !== $user ) { + foreach ( $roles as $role ) { + $verified = self::verify_user_role( $role, $user_id ); + + if ( true === $verified ) { + $user->add_role( $role ); + } elseif ( is_wp_error( $verified ) ) { + throw new Exception( esc_html( $verified->get_error_message() ) ); + } elseif ( false === $verified ) { + // Translators: The placeholder is the name of the user role + throw new Exception( esc_html( sprintf( __( 'The %s role cannot be added to this user', 'wp-graphql' ), $role ) ) ); + } + } + } + } + + /** + * Method to check if the user role is valid, and if the current user has permission to add, or + * remove it from a user. + * + * @param string $role Name of the role trying to get added to a user object + * @param int $user_id The ID of the user being mutated + * + * @return mixed|bool|\WP_Error + */ + private static function verify_user_role( $role, $user_id ) { + global $wp_roles; + + $potential_role = isset( $wp_roles->role_objects[ $role ] ) ? $wp_roles->role_objects[ $role ] : ''; + + if ( empty( $wp_roles->role_objects[ $role ] ) ) { + // Translators: The placeholder is the name of the user role + return new \WP_Error( 'wpgraphql_user_invalid_role', sprintf( __( 'The role %s does not exist', 'wp-graphql' ), $role ) ); + } + + /* + * Don't let anyone with 'edit_users' (admins) edit their own role to something without it. + * Multisite super admins can freely edit their blog roles -- they possess all caps. + */ + if ( + ! ( is_multisite() && current_user_can( 'manage_sites' ) ) && + get_current_user_id() === $user_id && + ! $potential_role->has_cap( 'edit_users' ) + ) { + return new \WP_Error( 'wpgraphql_user_invalid_role', __( 'Sorry, you cannot remove user editing permissions for your own account.', 'wp-graphql' ) ); + } + + /** + * The function for this is only loaded on admin pages. See note: https://codex.wordpress.org/Function_Reference/get_editable_roles#Notes + */ + if ( ! function_exists( 'get_editable_roles' ) ) { + require_once ABSPATH . 'wp-admin/includes/admin.php'; + } + + $editable_roles = get_editable_roles(); + + if ( empty( $editable_roles[ $role ] ) ) { + // Translators: %s is the name of the role that can't be added to the user. + return new \WP_Error( 'wpgraphql_user_invalid_role', sprintf( __( 'Sorry, you are not allowed to give this the following role: %s.', 'wp-graphql' ), $role ) ); + } else { + return true; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/Avatar.php b/lib/wp-graphql-1.17.0/src/Model/Avatar.php new file mode 100644 index 00000000..4a9a64e6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/Avatar.php @@ -0,0 +1,83 @@ +data = $avatar; + parent::__construct(); + } + + /** + * Initializes the object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'size' => function () { + return ! empty( $this->data['size'] ) ? absint( $this->data['size'] ) : null; + }, + 'height' => function () { + return ! empty( $this->data['height'] ) ? absint( $this->data['height'] ) : null; + }, + 'width' => function () { + return ! empty( $this->data['width'] ) ? absint( $this->data['width'] ) : null; + }, + 'default' => function () { + return ! empty( $this->data['default'] ) ? $this->data['default'] : null; + }, + 'forceDefault' => function () { + return ! empty( $this->data['force_default'] ); + }, + 'rating' => function () { + return ! empty( $this->data['rating'] ) ? $this->data['rating'] : null; + }, + 'scheme' => function () { + return ! empty( $this->data['scheme'] ) ? $this->data['scheme'] : null; + }, + 'extraAttr' => function () { + return ! empty( $this->data['extra_attr'] ) ? $this->data['extra_attr'] : null; + }, + 'foundAvatar' => function () { + return ! empty( $this->data['found_avatar'] ); + }, + 'url' => function () { + return ! empty( $this->data['url'] ) ? $this->data['url'] : null; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/Comment.php b/lib/wp-graphql-1.17.0/src/Model/Comment.php new file mode 100644 index 00000000..3e6203ec --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/Comment.php @@ -0,0 +1,194 @@ +data = $comment; + $owner = ! empty( $comment->user_id ) ? absint( $comment->user_id ) : null; + parent::__construct( 'moderate_comments', $allowed_restricted_fields, $owner ); + } + + /** + * Method for determining if the data should be considered private or not + * + * @return bool + * @throws \Exception + */ + protected function is_private() { + if ( empty( $this->data->comment_post_ID ) ) { + return true; + } + + // if the current user is the author of the comment, the comment should not be private + if ( 0 !== wp_get_current_user()->ID && absint( $this->data->user_id ) === absint( wp_get_current_user()->ID ) ) { + return false; + } + + $commented_on = get_post( (int) $this->data->comment_post_ID ); + + if ( ! $commented_on instanceof \WP_Post ) { + return true; + } + + // A comment is considered private if it is attached to a private post. + if ( true === ( new Post( $commented_on ) )->is_private() ) { + return true; + } + + if ( 0 === absint( $this->data->comment_approved ) && ! current_user_can( 'moderate_comments' ) ) { + return true; + } + + return false; + } + + /** + * Initializes the object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + return ! empty( $this->data->comment_ID ) ? Relay::toGlobalId( 'comment', $this->data->comment_ID ) : null; + }, + 'commentId' => function () { + return ! empty( $this->data->comment_ID ) ? absint( $this->data->comment_ID ) : 0; + }, + 'databaseId' => function () { + return ! empty( $this->data->comment_ID ) ? $this->data->comment_ID : 0; + }, + 'commentAuthorEmail' => function () { + return ! empty( $this->data->comment_author_email ) ? $this->data->comment_author_email : 0; + }, + 'comment_ID' => function () { + return ! empty( $this->data->comment_ID ) ? absint( $this->data->comment_ID ) : 0; + }, + 'comment_post_ID' => function () { + return ! empty( $this->data->comment_post_ID ) ? absint( $this->data->comment_post_ID ) : null; + }, + 'comment_parent_id' => function () { + return ! empty( $this->data->comment_parent ) ? absint( $this->data->comment_parent ) : 0; + }, + 'parentDatabaseId' => function () { + return ! empty( $this->data->comment_parent ) ? absint( $this->data->comment_parent ) : 0; + }, + 'parentId' => function () { + return ! empty( $this->comment_parent_id ) ? Relay::toGlobalId( 'comment', $this->data->comment_parent ) : null; + }, + 'comment_author' => function () { + return ! empty( $this->data->comment_author ) ? absint( $this->data->comment_author ) : null; + }, + 'comment_author_url' => function () { + return ! empty( $this->data->comment_author_url ) ? absint( $this->data->comment_author_url ) : null; + }, + 'authorIp' => function () { + return ! empty( $this->data->comment_author_IP ) ? $this->data->comment_author_IP : null; + }, + 'date' => function () { + return ! empty( $this->data->comment_date ) ? $this->data->comment_date : null; + }, + 'dateGmt' => function () { + return ! empty( $this->data->comment_date_gmt ) ? $this->data->comment_date_gmt : null; + }, + 'contentRaw' => function () { + return ! empty( $this->data->comment_content ) ? $this->data->comment_content : null; + }, + 'contentRendered' => function () { + $content = ! empty( $this->data->comment_content ) ? $this->data->comment_content : null; + + return $this->html_entity_decode( apply_filters( 'comment_text', $content, $this->data ), 'contentRendered', false ); + }, + 'karma' => function () { + return ! empty( $this->data->comment_karma ) ? $this->data->comment_karma : null; + }, + 'approved' => function () { + _doing_it_wrong( __METHOD__, 'The approved field is deprecated in favor of `status`', '1.13.0' ); + return ! empty( $this->data->comment_approved ) && 'hold' !== $this->data->comment_approved; + }, + 'status' => function () { + if ( ! is_numeric( $this->data->comment_approved ) ) { + return $this->data->comment_approved; + } + + return '1' === $this->data->comment_approved ? 'approve' : 'hold'; + }, + 'agent' => function () { + return ! empty( $this->data->comment_agent ) ? $this->data->comment_agent : null; + }, + 'type' => function () { + return ! empty( $this->data->comment_type ) ? $this->data->comment_type : null; + }, + 'userId' => function () { + return ! empty( $this->data->user_id ) ? absint( $this->data->user_id ) : null; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/CommentAuthor.php b/lib/wp-graphql-1.17.0/src/Model/CommentAuthor.php new file mode 100644 index 00000000..00edc766 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/CommentAuthor.php @@ -0,0 +1,66 @@ +data = $comment_author; + parent::__construct(); + } + + /** + * Initializes the object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + return ! empty( $this->data->comment_ID ) ? Relay::toGlobalId( 'comment_author', $this->data->comment_ID ) : null; + }, + 'databaseId' => function () { + return ! empty( $this->data->comment_ID ) ? absint( $this->data->comment_ID ) : null; + }, + 'name' => function () { + return ! empty( $this->data->comment_author ) ? $this->data->comment_author : null; + }, + 'email' => function () { + return current_user_can( 'moderate_comments' ) && ! empty( $this->data->comment_author_email ) ? $this->data->comment_author_email : null; + }, + 'url' => function () { + return ! empty( $this->data->comment_author_url ) ? $this->data->comment_author_url : ''; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/Menu.php b/lib/wp-graphql-1.17.0/src/Model/Menu.php new file mode 100644 index 00000000..0cd8f586 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/Menu.php @@ -0,0 +1,114 @@ +data = $term; + parent::__construct(); + } + + /** + * Determines whether a Menu should be considered private. + * + * If a Menu is not connected to a menu that's assigned to a location + * it's not considered a public node + * + * @return bool + * @throws \Exception + */ + public function is_private() { + + // If the current user can edit theme options, consider the menu public + if ( current_user_can( 'edit_theme_options' ) ) { + return false; + } + + $locations = get_theme_mod( 'nav_menu_locations' ); + if ( empty( $locations ) ) { + return true; + } + $location_ids = array_values( $locations ); + if ( empty( $location_ids ) || ! in_array( $this->data->term_id, array_values( $location_ids ), true ) ) { + return true; + } + + return false; + } + + /** + * Initializes the Menu object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + return ! empty( $this->data->term_id ) ? Relay::toGlobalId( 'term', (string) $this->data->term_id ) : null; + }, + 'count' => function () { + return ! empty( $this->data->count ) ? absint( $this->data->count ) : null; + }, + 'menuId' => function () { + return ! empty( $this->data->term_id ) ? absint( $this->data->term_id ) : null; + }, + 'databaseId' => function () { + return ! empty( $this->data->term_id ) ? absint( $this->data->term_id ) : null; + }, + 'name' => function () { + return ! empty( $this->data->name ) ? $this->data->name : null; + }, + 'slug' => function () { + return ! empty( $this->data->slug ) ? urldecode( $this->data->slug ) : null; + }, + 'locations' => function () { + $menu_locations = get_theme_mod( 'nav_menu_locations' ); + + if ( empty( $menu_locations ) || ! is_array( $menu_locations ) ) { + return null; + } + + $locations = null; + foreach ( $menu_locations as $location => $id ) { + if ( absint( $id ) === ( $this->data->term_id ) ) { + $locations[] = $location; + } + } + + return $locations; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/MenuItem.php b/lib/wp-graphql-1.17.0/src/Model/MenuItem.php new file mode 100644 index 00000000..a406a666 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/MenuItem.php @@ -0,0 +1,206 @@ +data = wp_setup_nav_menu_item( $post ); + parent::__construct(); + } + + /** + * Determines whether a MenuItem should be considered private. + * + * If a MenuItem is not connected to a menu that's assigned to a location + * it's not considered a public node + * + * @return bool + * @throws \Exception + */ + public function is_private() { + + // If the current user can edit theme options, consider the menu item public + if ( current_user_can( 'edit_theme_options' ) ) { + return false; + } + + // Get menu locations for the active theme + $locations = get_theme_mod( 'nav_menu_locations' ); + + // If there are no menu locations, consider the MenuItem private + if ( empty( $locations ) ) { + return true; + } + + // Get the values of the locations + $location_ids = array_values( $locations ); + $menus = wp_get_object_terms( $this->data->ID, 'nav_menu', [ 'fields' => 'ids' ] ); + + // If there are no menus + if ( empty( $menus ) ) { + return true; + } + + if ( is_wp_error( $menus ) ) { + // translators: %s is the menu item ID. + throw new Exception( esc_html( sprintf( __( 'No menus could be found for menu item %s', 'wp-graphql' ), $this->data->ID ) ) ); + } + + $menu_id = $menus[0]; + if ( empty( $location_ids ) || ! in_array( $menu_id, $location_ids, true ) ) { + return true; + } + + return false; + } + + /** + * Initialize the MenuItem object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + return ! empty( $this->data->ID ) ? Relay::toGlobalId( 'post', $this->data->ID ) : null; + }, + 'parentId' => function () { + return ! empty( $this->data->menu_item_parent ) ? Relay::toGlobalId( 'post', $this->data->menu_item_parent ) : null; + }, + 'parentDatabaseId' => function () { + return $this->data->menu_item_parent; + }, + 'cssClasses' => function () { + // If all we have is a non-array or an array with one empty + // string, return an empty array. + if ( ! isset( $this->data->classes ) || ! is_array( $this->data->classes ) || empty( $this->data->classes ) || empty( $this->data->classes[0] ) ) { + return []; + } + + return $this->data->classes; + }, + 'description' => function () { + return ( ! empty( $this->data->description ) ) ? $this->data->description : null; + }, + 'label' => function () { + return ( ! empty( $this->data->title ) ) ? $this->html_entity_decode( $this->data->title, 'label', true ) : null; + }, + 'linkRelationship' => function () { + return ! empty( $this->data->xfn ) ? $this->data->xfn : null; + }, + 'menuItemId' => function () { + return absint( $this->data->ID ); + }, + 'databaseId' => function () { + return absint( $this->data->ID ); + }, + 'objectId' => function () { + return ( absint( $this->data->object_id ) ); + }, + 'target' => function () { + return ! empty( $this->data->target ) ? $this->data->target : null; + }, + 'title' => function () { + return ( ! empty( $this->data->attr_title ) ) ? $this->data->attr_title : null; + }, + 'uri' => function () { + $url = $this->data->url; + + return ! empty( $url ) ? str_ireplace( home_url(), '', $url ) : null; + }, + 'url' => function () { + return ! empty( $this->data->url ) ? $this->data->url : null; + }, + 'path' => function () { + $url = $this->url; + + if ( ! empty( $url ) ) { + /** @var array $parsed */ + $parsed = wp_parse_url( $url ); + if ( isset( $parsed['host'] ) && strpos( home_url(), $parsed['host'] ) ) { + return $parsed['path']; + } + } + + return $url; + }, + 'order' => function () { + return $this->data->menu_order; + }, + 'menuId' => function () { + return ! empty( $this->menuDatabaseId ) ? Relay::toGlobalId( 'term', (string) $this->menuDatabaseId ) : null; + }, + 'menuDatabaseId' => function () { + $menus = wp_get_object_terms( $this->data->ID, 'nav_menu' ); + if ( is_wp_error( $menus ) ) { + throw new UserError( esc_html( $menus->get_error_message() ) ); + } + + return ! empty( $menus[0]->term_id ) ? $menus[0]->term_id : null; + }, + 'locations' => function () { + if ( empty( $this->menuDatabaseId ) ) { + return null; + } + + $menu_locations = get_theme_mod( 'nav_menu_locations' ); + + if ( empty( $menu_locations ) || ! is_array( $menu_locations ) ) { + return null; + } + + $locations = null; + foreach ( $menu_locations as $location => $id ) { + if ( absint( $id ) === ( $this->menuDatabaseId ) ) { + $locations[] = $location; + } + } + + return $locations; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/Model.php b/lib/wp-graphql-1.17.0/src/Model/Model.php new file mode 100644 index 00000000..ab28ce6b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/Model.php @@ -0,0 +1,552 @@ +data ) ) { + // translators: %s is the name of the model. + throw new Exception( esc_html( sprintf( __( 'An empty data set was used to initialize the modeling of this %s object', 'wp-graphql' ), $this->get_model_name() ) ) ); + } + + $this->restricted_cap = $restricted_cap; + $this->allowed_restricted_fields = $allowed_restricted_fields; + $this->owner = $owner; + $this->current_user = wp_get_current_user(); + + if ( 'private' === $this->get_visibility() ) { + return; + } + + $this->init(); + $this->prepare_fields(); + } + + /** + * Magic method to re-map the isset check on the child class looking for properties when + * resolving the fields + * + * @param string $key The name of the field you are trying to retrieve + * + * @return bool + */ + public function __isset( $key ) { + return isset( $this->fields[ $key ] ); + } + + /** + * Magic method to re-map setting new properties to the class inside of the $fields prop rather + * than on the class in unique properties + * + * @param string $key Name of the key to set the data to + * @param callable|int|string|mixed $value The value to set to the key + * + * @return void + */ + public function __set( $key, $value ) { + $this->fields[ $key ] = $value; + } + + /** + * Magic method to re-map where external calls go to look for properties on the child objects. + * This is crucial to let objects modeled through this class work with the default field + * resolver. + * + * @param string $key Name of the property that is trying to be accessed + * + * @return mixed|null + */ + public function __get( $key ) { + if ( isset( $this->fields[ $key ] ) ) { + /** + * If the property has already been processed and cached to the model + * return the processed value. + * + * Otherwise, if it's a callable, process it and cache the value. + */ + if ( is_scalar( $this->fields[ $key ] ) || ( is_object( $this->fields[ $key ] ) && ! is_callable( $this->fields[ $key ] ) ) || is_array( $this->fields[ $key ] ) ) { + return $this->fields[ $key ]; + } elseif ( is_callable( $this->fields[ $key ] ) ) { + $data = call_user_func( $this->fields[ $key ] ); + $this->$key = $data; + + return $data; + } else { + return $this->fields[ $key ]; + } + } else { + return null; + } + } + + /** + * Generic model setup before the resolver function executes + * + * @return void + */ + public function setup() { + } + + /** + * Generic model tear down after the fields are setup. This can be used + * to reset state to where it was before the model was setup. + * + * @return void + */ + public function tear_down() { + } + + /** + * Returns the name of the model, built from the child className + * + * @return string + */ + protected function get_model_name() { + $name = static::class; + + if ( empty( $this->model_name ) ) { + if ( false !== strpos( static::class, '\\' ) ) { + $starting_character = strrchr( static::class, '\\' ); + if ( ! empty( $starting_character ) ) { + $name = substr( $starting_character, 1 ); + } + } + $this->model_name = $name . 'Object'; + } + + return ! empty( $this->model_name ) ? $this->model_name : $name; + } + + /** + * Return the visibility state for the current piece of data + * + * @return string|null + */ + public function get_visibility() { + if ( null === $this->visibility ) { + + /** + * Filter for the capability to check against for restricted data + * + * @param string $restricted_cap The capability to check against + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param string|null $visibility The visibility that has currently been set for the data at this point + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return string + */ + $protected_cap = apply_filters( 'graphql_restricted_data_cap', $this->restricted_cap, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); + + /** + * Filter to short circuit default is_private check for the model. This is expensive in some cases so + * this filter lets you prevent this from running by returning a true or false value. + * + * @param ?bool $is_private Whether the model data is private. Defaults to null. + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param string|null $visibility The visibility that has currently been set for the data at this point + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return bool|null + */ + $pre_is_private = apply_filters( 'graphql_pre_model_data_is_private', null, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); + + // If 3rd party code has not filtered this, use the Models default logic to determine + // whether the model should be considered private + if ( null !== $pre_is_private ) { + $is_private = $pre_is_private; + } else { + $is_private = $this->is_private(); + } + + /** + * Filter to determine if the data should be considered private or not + * + * @param boolean $is_private Whether the model is private + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param string|null $visibility The visibility that has currently been set for the data at this point + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return bool + */ + $is_private = apply_filters( 'graphql_data_is_private', (bool) $is_private, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); + + if ( true === $is_private ) { + $this->visibility = 'private'; + } elseif ( null !== $this->owner && true === $this->owner_matches_current_user() ) { + $this->visibility = 'public'; + } elseif ( empty( $protected_cap ) || current_user_can( $protected_cap ) ) { + $this->visibility = 'public'; + } else { + $this->visibility = 'restricted'; + } + } + + /** + * Filter the visibility name to be returned + * + * @param string|null $visibility The visibility that has currently been set for the data at this point + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return string + */ + return apply_filters( 'graphql_object_visibility', $this->visibility, $this->get_model_name(), $this->data, $this->owner, $this->current_user ); + } + + /** + * Method to return the private state of the object. Can be overwritten in classes extending + * this one. + * + * @return bool + */ + protected function is_private() { + return false; + } + + /** + * Whether or not the owner of the data matches the current user + * + * @return bool + */ + protected function owner_matches_current_user() { + if ( empty( $this->current_user->ID ) || empty( $this->owner ) ) { + return false; + } + + return absint( $this->owner ) === absint( $this->current_user->ID ); + } + + /** + * Restricts fields for the data to only return the allowed fields if the data is restricted + * + * @return void + */ + protected function restrict_fields() { + $this->fields = array_intersect_key( + $this->fields, + array_flip( + /** + * Filter for the allowed restricted fields + * + * @param array $allowed_restricted_fields The fields to allow when the data is designated as restricted to the current user + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param string|null $visibility The visibility that has currently been set for the data at this point + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return array + */ + apply_filters( 'graphql_allowed_fields_on_restricted_type', $this->allowed_restricted_fields, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ) + ) + ); + } + + /** + * Wraps all fields with another callback layer so we can inject hooks & filters into them + * + * @return void + */ + protected function wrap_fields() { + if ( ! is_array( $this->fields ) || empty( $this->fields ) ) { + return; + } + + $clean_array = []; + $self = $this; + foreach ( $this->fields as $key => $data ) { + $clean_array[ $key ] = function () use ( $key, $data, $self ) { + if ( is_array( $data ) ) { + $callback = ( ! empty( $data['callback'] ) ) ? $data['callback'] : null; + + /** + * Capability to check required for the field + * + * @param string $capability The capability to check against to return the field + * @param string $key The name of the field on the type + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param string $visibility The visibility setting for this piece of data + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return string + */ + $cap_check = ( ! empty( $data['capability'] ) ) ? apply_filters( 'graphql_model_field_capability', $data['capability'], $key, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ) : ''; + if ( ! empty( $cap_check ) ) { + if ( ! current_user_can( $data['capability'] ) ) { + $callback = null; + } + } + } else { + $callback = $data; + } + + /** + * Filter to short circuit the callback for any field on a type. Returning anything + * other than null will stop the callback for the field from executing, and will + * return your data or execute your callback instead. + * + * @param ?string $result The data returned from the callback. Null by default. + * @param string $key The name of the field on the type + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param string $visibility The visibility setting for this piece of data + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return null|callable|int|string|array|mixed + */ + $pre = apply_filters( 'graphql_pre_return_field_from_model', null, $key, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); + + if ( ! is_null( $pre ) ) { + $result = $pre; + } else { + if ( is_callable( $callback ) ) { + $self->setup(); + $field = call_user_func( $callback ); + $self->tear_down(); + } else { + $field = $callback; + } + + /** + * Filter the data returned by the default callback for the field + * + * @param string $field The data returned from the callback + * @param string $key The name of the field on the type + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param string $visibility The visibility setting for this piece of data + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return mixed + */ + $result = apply_filters( 'graphql_return_field_from_model', $field, $key, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); + } + + /** + * Hook that fires after the data is returned for the field + * + * @param string $result The returned data for the field + * @param string $key The name of the field on the type + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param string $visibility The visibility setting for this piece of data + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + */ + do_action( 'graphql_after_return_field_from_model', $result, $key, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); + + return $result; + }; + } + + $this->fields = $clean_array; + } + + /** + * Adds the model visibility fields to the data + * + * @return void + */ + private function add_model_visibility() { + + /** + * @TODO: potentially abstract this out into a more central spot + */ + $this->fields['isPublic'] = function () { + return 'public' === $this->get_visibility(); + }; + $this->fields['isRestricted'] = function () { + return 'restricted' === $this->get_visibility(); + }; + $this->fields['isPrivate'] = function () { + return 'private' === $this->get_visibility(); + }; + } + + /** + * Returns instance of the data fully modeled + * + * @return void + */ + protected function prepare_fields() { + if ( 'restricted' === $this->get_visibility() ) { + $this->restrict_fields(); + } + + /** + * Add support for the deprecated "graphql_return_modeled_data" filter. + * + * @param array $fields The array of fields for the model + * @param string $model_name Name of the model the filter is currently being executed in + * @param string $visibility The visibility setting for this piece of data + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return array + * + * @deprecated 1.7.0 use "graphql_model_prepare_fields" filter instead, which passes additional context to the filter + */ + $this->fields = apply_filters_deprecated( 'graphql_return_modeled_data', [ $this->fields, $this->get_model_name(), $this->visibility, $this->owner, $this->current_user ], '1.7.0', 'graphql_model_prepare_fields' ); + + /** + * Filter the array of fields for the Model before the object is hydrated with it + * + * @param array $fields The array of fields for the model + * @param string $model_name Name of the model the filter is currently being executed in + * @param mixed $data The un-modeled incoming data + * @param string $visibility The visibility setting for this piece of data + * @param null|int $owner The user ID for the owner of this piece of data + * @param \WP_User $current_user The current user for the session + * + * @return array + */ + $this->fields = apply_filters( 'graphql_model_prepare_fields', $this->fields, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); + $this->wrap_fields(); + $this->add_model_visibility(); + } + + /** + * Given a string, and optional context, this decodes html entities if html_entity_decode is + * enabled. + * + * @param string $str The string to decode + * @param string $field_name The name of the field being encoded + * @param bool $enabled Whether decoding is enabled by default for the string passed in + * + * @return string + */ + public function html_entity_decode( $str, $field_name, $enabled = false ) { + + /** + * Determine whether html_entity_decode should be applied to the string + * + * @param bool $enabled Whether decoding is enabled by default for the string passed in + * @param string $str The string to decode + * @param string $field_name The name of the field being encoded + * @param \WPGraphQL\Model\Model $model The Model the field is being decoded on + */ + $decoding_enabled = apply_filters( 'graphql_html_entity_decoding_enabled', $enabled, $str, $field_name, $this ); + + if ( false === $decoding_enabled ) { + return $str; + } + + return html_entity_decode( $str ); + } + + /** + * Filter the fields returned for the object + * + * @param null|string|array $fields The field or fields to build in the modeled object. You can + * pass null to build all of the fields, a string to only + * build an object with one field, or an array of field keys + * to build an object with those keys and their respective + * values. + * + * @return void + */ + public function filter( $fields ) { + if ( is_string( $fields ) ) { + $fields = [ $fields ]; + } + + if ( is_array( $fields ) ) { + $this->fields = array_intersect_key( $this->fields, array_flip( $fields ) ); + } + } + + /** + * @return mixed + */ + abstract protected function init(); +} diff --git a/lib/wp-graphql-1.17.0/src/Model/Plugin.php b/lib/wp-graphql-1.17.0/src/Model/Plugin.php new file mode 100644 index 00000000..9af0b640 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/Plugin.php @@ -0,0 +1,96 @@ +data = $plugin; + parent::__construct(); + } + + /** + * Method for determining if the data should be considered private or not + * + * @return bool + */ + protected function is_private() { + if ( is_multisite() ) { + // update_, install_, and delete_ are handled above with is_super_admin(). + $menu_perms = get_site_option( 'menu_items', [] ); + if ( empty( $menu_perms['plugins'] ) && ! current_user_can( 'manage_network_plugins' ) ) { + return true; + } + } elseif ( ! current_user_can( 'activate_plugins' ) ) { + return true; + } + + return false; + } + + /** + * Initializes the object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + return ! empty( $this->data['Path'] ) ? Relay::toGlobalId( 'plugin', $this->data['Path'] ) : null; + }, + 'name' => function () { + return ! empty( $this->data['Name'] ) ? $this->data['Name'] : null; + }, + 'pluginUri' => function () { + return ! empty( $this->data['PluginURI'] ) ? $this->data['PluginURI'] : null; + }, + 'description' => function () { + return ! empty( $this->data['Description'] ) ? $this->data['Description'] : null; + }, + 'author' => function () { + return ! empty( $this->data['Author'] ) ? $this->data['Author'] : null; + }, + 'authorUri' => function () { + return ! empty( $this->data['AuthorURI'] ) ? $this->data['AuthorURI'] : null; + }, + 'version' => function () { + return ! empty( $this->data['Version'] ) ? $this->data['Version'] : null; + }, + 'path' => function () { + return ! empty( $this->data['Path'] ) ? $this->data['Path'] : null; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/Post.php b/lib/wp-graphql-1.17.0/src/Model/Post.php new file mode 100644 index 00000000..55b6f7cf --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/Post.php @@ -0,0 +1,852 @@ +data = $post; + $this->post_type_object = get_post_type_object( $post->post_type ); + + /** + * If the post type is 'revision', we need to get the post_type_object + * of the parent post type to determine capabilities from + */ + if ( 'revision' === $post->post_type && ! empty( $post->post_parent ) ) { + $parent = get_post( absint( $post->post_parent ) ); + if ( ! empty( $parent ) ) { + $this->post_type_object = get_post_type_object( $parent->post_type ); + } + } + + /** + * Mimic core functionality for templates, as seen here: + * https://github.com/WordPress/WordPress/blob/6fd8080e7ee7599b36d4528f72a8ced612130b8c/wp-includes/template-loader.php#L56 + */ + if ( 'attachment' === $this->data->post_type ) { + remove_filter( 'the_content', 'prepend_attachment' ); + } + + $allowed_restricted_fields = [ + 'databaseId', + 'enqueuedScriptsQueue', + 'enqueuedStylesheetsQueue', + 'id', + 'isRestricted', + 'link', + 'post_status', + 'post_type', + 'slug', + 'status', + 'titleRendered', + 'uri', + 'isPostsPage', + 'isFrontPage', + 'isPrivacyPage', + ]; + + if ( isset( $this->post_type_object->graphql_single_name ) ) { + $allowed_restricted_fields[] = $this->post_type_object->graphql_single_name . 'Id'; + } + + $restricted_cap = $this->get_restricted_cap(); + + parent::__construct( $restricted_cap, $allowed_restricted_fields, (int) $post->post_author ); + } + + /** + * Setup the global data for the model to have proper context when resolving + * + * @return void + */ + public function setup() { + global $wp_query, $post; + + /** + * Store the global post before overriding + */ + $this->global_post = $post; + + /** + * Set the resolving post to the global $post. That way any filters that + * might be applied when resolving fields can rely on global post and + * post data being set up. + */ + if ( $this->data instanceof WP_Post ) { + $id = $this->data->ID; + $post_type = $this->data->post_type; + $post_name = $this->data->post_name; + $data = $this->data; + + if ( 'revision' === $this->data->post_type ) { + $id = $this->data->post_parent; + $parent = get_post( $this->data->post_parent ); + if ( empty( $parent ) ) { + $this->fields = []; + return; + } + $post_type = $parent->post_type; + $post_name = $parent->post_name; + $data = $parent; + } + + /** + * Clear out existing postdata + */ + $wp_query->reset_postdata(); + + /** + * Parse the query to tell WordPress how to + * setup global state + */ + if ( 'post' === $post_type ) { + $wp_query->parse_query( + [ + 'page' => '', + 'p' => $id, + ] + ); + } elseif ( 'page' === $post_type ) { + $wp_query->parse_query( + [ + 'page' => '', + 'pagename' => $post_name, + ] + ); + } elseif ( 'attachment' === $post_type ) { + $wp_query->parse_query( + [ + 'attachment' => $post_name, + ] + ); + } else { + $wp_query->parse_query( + [ + $post_type => $post_name, + 'post_type' => $post_type, + 'name' => $post_name, + ] + ); + } + + $wp_query->setup_postdata( $data ); + $GLOBALS['post'] = $data; // phpcs:ignore WordPress.WP.GlobalVariablesOverride + $wp_query->queried_object = get_post( $this->data->ID ); + $wp_query->queried_object_id = $this->data->ID; + } + } + + /** + * Retrieve the cap to check if the data should be restricted for the post + * + * @return string + */ + protected function get_restricted_cap() { + if ( ! empty( $this->data->post_password ) ) { + return isset( $this->post_type_object->cap->edit_others_posts ) ? $this->post_type_object->cap->edit_others_posts : 'edit_others_posts'; + } + + switch ( $this->data->post_status ) { + case 'trash': + $cap = isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts'; + break; + case 'draft': + case 'future': + case 'pending': + $cap = isset( $this->post_type_object->cap->edit_others_posts ) ? $this->post_type_object->cap->edit_others_posts : 'edit_others_posts'; + break; + default: + $cap = ''; + break; + } + + return $cap; + } + + /** + * Determine if the model is private + * + * @return bool + */ + public function is_private() { + + /** + * If the post is of post_type "revision", we need to access the parent of the Post + * so that we can check access rights of the parent post. Revision access is inherit + * to the Parent it is a revision of. + */ + if ( 'revision' === $this->data->post_type ) { + + // Get the post + $parent_post = get_post( $this->data->post_parent ); + + // If the parent post doesn't exist, the revision should be considered private + if ( ! $parent_post instanceof WP_Post ) { + return true; + } + + // Determine if the revision is private using capabilities relative to the parent + return $this->is_post_private( $parent_post ); + } + + /** + * Media Items (attachments) are all public. Once uploaded to the media library + * they are exposed with a public URL on the site. + * + * The WP REST API sets media items to private if they don't have a `post_parent` set, but + * this has broken production apps, because media items can be uploaded directly to the + * media library and published as a featured image, published inline within content, or + * within a Gutenberg block, etc, but then a consumer tries to ask for data of a published + * image and REST returns nothing because the media item is treated as private. + * + * Currently, we're treating all media items as public because there's nothing explicit in + * how WP Core handles privacy of media library items. By default they're publicly exposed. + */ + if ( 'attachment' === $this->data->post_type ) { + return false; + } + + /** + * Published content is public, not private + */ + if ( 'publish' === $this->data->post_status && $this->post_type_object && ( true === $this->post_type_object->public || true === $this->post_type_object->publicly_queryable ) ) { + return false; + } + + return $this->is_post_private( $this->data ); + } + + /** + * Method for determining if the data should be considered private or not + * + * @param \WP_Post $post_object The object of the post we need to verify permissions for + * + * @return bool + */ + protected function is_post_private( $post_object = null ) { + $post_type_object = $this->post_type_object; + + if ( ! $post_type_object ) { + return true; + } + + if ( ! $post_object ) { + $post_object = $this->data; + } + + /** + * If the status is NOT publish and the user does NOT have capabilities to edit posts, + * consider the post private. + */ + if ( ! isset( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->edit_posts ) ) { + return true; + } + + /** + * If the owner of the content is the current user + */ + if ( ( true === $this->owner_matches_current_user() ) && 'revision' !== $post_object->post_type ) { + return false; + } + + /** + * If the post_type isn't (not registered) or is not allowed in WPGraphQL, + * mark the post as private + */ + + if ( empty( $post_type_object->name ) || ! in_array( $post_type_object->name, \WPGraphQL::get_allowed_post_types(), true ) ) { + return true; + } + + if ( 'private' === $this->data->post_status && ( ! isset( $post_type_object->cap->read_private_posts ) || ! current_user_can( $post_type_object->cap->read_private_posts ) ) ) { + return true; + } + + if ( 'revision' === $this->data->post_type || 'auto-draft' === $this->data->post_status ) { + $parent = get_post( (int) $this->data->post_parent ); + + if ( empty( $parent ) ) { + return true; + } + + $parent_post_type_obj = $post_type_object; + + if ( 'private' === $parent->post_status ) { + $cap = isset( $parent_post_type_obj->cap->read_private_posts ) ? $parent_post_type_obj->cap->read_private_posts : 'read_private_posts'; + } else { + $cap = isset( $parent_post_type_obj->cap->edit_post ) ? $parent_post_type_obj->cap->edit_post : 'edit_post'; + } + + if ( ! current_user_can( $cap, $parent->ID ) ) { + return true; + } + } + + return false; + } + + /** + * Initialize the Post object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'ID' => function () { + return $this->data->ID; + }, + 'post_author' => function () { + if ( $this->isPreview ) { + $parent_post = get_post( $this->parentDatabaseId ); + if ( empty( $parent_post ) ) { + return null; + } + + return (int) $parent_post->post_author; + } + + return ! empty( $this->data->post_author ) ? $this->data->post_author : null; + }, + 'id' => function () { + return ( ! empty( $this->data->post_type ) && ! empty( $this->databaseId ) ) ? Relay::toGlobalId( 'post', (string) $this->databaseId ) : null; + }, + 'databaseId' => function () { + return ! empty( $this->data->ID ) ? absint( $this->data->ID ) : null; + }, + 'post_type' => function () { + return ! empty( $this->data->post_type ) ? $this->data->post_type : null; + }, + 'authorId' => function () { + if ( true === $this->isPreview ) { + $parent_post = get_post( $this->data->post_parent ); + if ( empty( $parent_post ) ) { + return null; + } + $id = (int) $parent_post->post_author; + } else { + $id = ! empty( $this->data->post_author ) ? (int) $this->data->post_author : null; + } + + return Relay::toGlobalId( 'user', (string) $id ); + }, + 'authorDatabaseId' => function () { + if ( true === $this->isPreview ) { + $parent_post = get_post( $this->data->post_parent ); + if ( empty( $parent_post ) ) { + return null; + } + + return $parent_post->post_author; + } + + return ! empty( $this->data->post_author ) ? (int) $this->data->post_author : null; + }, + 'date' => function () { + return ! empty( $this->data->post_date ) && '0000-00-00 00:00:00' !== $this->data->post_date ? Utils::prepare_date_response( $this->data->post_date_gmt, $this->data->post_date ) : null; + }, + 'dateGmt' => function () { + return ! empty( $this->data->post_date_gmt ) ? Utils::prepare_date_response( $this->data->post_date_gmt ) : null; + }, + 'contentRendered' => function () { + $content = ! empty( $this->data->post_content ) ? $this->data->post_content : null; + + return ! empty( $content ) ? $this->html_entity_decode( apply_filters( 'the_content', $content ), 'contentRendered', false ) : null; + }, + 'pageTemplate' => function () { + $slug = get_page_template_slug( $this->data->ID ); + + return ! empty( $slug ) ? $slug : null; + }, + 'contentRaw' => [ + 'callback' => function () { + return ! empty( $this->data->post_content ) ? $this->data->post_content : null; + }, + 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', + ], + 'titleRendered' => function () { + $id = ! empty( $this->data->ID ) ? $this->data->ID : null; + $title = ! empty( $this->data->post_title ) ? $this->data->post_title : null; + + return $this->html_entity_decode( apply_filters( 'the_title', $title, $id ), 'titleRendered', true ); + }, + 'titleRaw' => [ + 'callback' => function () { + return ! empty( $this->data->post_title ) ? $this->data->post_title : null; + }, + 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', + ], + 'excerptRendered' => function () { + $excerpt = ! empty( $this->data->post_excerpt ) ? $this->data->post_excerpt : ''; + $excerpt = apply_filters( 'get_the_excerpt', $excerpt, $this->data ); + + return $this->html_entity_decode( apply_filters( 'the_excerpt', $excerpt ), 'excerptRendered' ); + }, + 'excerptRaw' => [ + 'callback' => function () { + return ! empty( $this->data->post_excerpt ) ? $this->data->post_excerpt : null; + }, + 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', + ], + 'post_status' => function () { + return ! empty( $this->data->post_status ) ? $this->data->post_status : null; + }, + 'status' => function () { + return ! empty( $this->data->post_status ) ? $this->data->post_status : null; + }, + 'commentStatus' => function () { + return ! empty( $this->data->comment_status ) ? $this->data->comment_status : null; + }, + 'pingStatus' => function () { + return ! empty( $this->data->ping_status ) ? $this->data->ping_status : null; + }, + 'slug' => function () { + return ! empty( $this->data->post_name ) ? urldecode( $this->data->post_name ) : null; + }, + 'template' => function () { + $registered_templates = wp_get_theme()->get_page_templates( null, $this->data->post_type ); + + $template = [ + '__typename' => 'DefaultTemplate', + 'templateName' => 'Default', + ]; + + if ( true === $this->isPreview ) { + $parent_post = get_post( $this->parentDatabaseId ); + + if ( empty( $parent_post ) ) { + return $template; + } + + $registered_templates = wp_get_theme()->get_page_templates( $parent_post ); + + if ( empty( $registered_templates ) ) { + return $template; + } + $set_template = get_post_meta( $this->parentDatabaseId, '_wp_page_template', true ); + $template_name = get_page_template_slug( $this->parentDatabaseId ); + + if ( empty( $set_template ) ) { + $set_template = get_post_meta( $this->data->ID, '_wp_page_template', true ); + } + + if ( empty( $template_name ) ) { + $template_name = get_page_template_slug( $this->data->ID ); + } + + $template_name = ! empty( $template_name ) ? $template_name : 'Default'; + } else { + if ( empty( $registered_templates ) ) { + return $template; + } + + $set_template = get_post_meta( $this->data->ID, '_wp_page_template', true ); + $template_name = get_page_template_slug( $this->data->ID ); + + $template_name = ! empty( $template_name ) ? $template_name : 'Default'; + } + + if ( ! empty( $registered_templates[ $set_template ] ) ) { + $name = Utils::format_type_name_for_wp_template( $registered_templates[ $set_template ], $set_template ); + + // If the name is empty, fallback to DefaultTemplate + if ( empty( $name ) ) { + $name = 'DefaultTemplate'; + } + + $template = [ + '__typename' => $name, + 'templateName' => ucwords( $registered_templates[ $set_template ] ), + ]; + } + + return $template; + }, + 'isFrontPage' => function () { + if ( 'page' !== $this->data->post_type || 'page' !== get_option( 'show_on_front' ) ) { + return false; + } + if ( absint( get_option( 'page_on_front', 0 ) ) === $this->data->ID ) { + return true; + } + + return false; + }, + 'isPrivacyPage' => function () { + if ( 'page' !== $this->data->post_type ) { + return false; + } + if ( absint( get_option( 'wp_page_for_privacy_policy', 0 ) ) === $this->data->ID ) { + return true; + } + + return false; + }, + 'isPostsPage' => function () { + if ( 'page' !== $this->data->post_type ) { + return false; + } + if ( 'posts' !== get_option( 'show_on_front', 'posts' ) && absint( get_option( 'page_for_posts', 0 ) ) === $this->data->ID ) { + return true; + } + + return false; + }, + 'toPing' => function () { + $to_ping = get_to_ping( $this->databaseId ); + + return ! empty( $to_ping ) ? implode( ',', (array) $to_ping ) : null; + }, + 'pinged' => function () { + $punged = get_pung( $this->databaseId ); + + return ! empty( implode( ',', (array) $punged ) ) ? $punged : null; + }, + 'modified' => function () { + return ! empty( $this->data->post_modified ) && '0000-00-00 00:00:00' !== $this->data->post_modified ? Utils::prepare_date_response( $this->data->post_modified ) : null; + }, + 'modifiedGmt' => function () { + return ! empty( $this->data->post_modified_gmt ) ? Utils::prepare_date_response( $this->data->post_modified_gmt ) : null; + }, + 'parentId' => function () { + return ( ! empty( $this->data->post_type ) && ! empty( $this->data->post_parent ) ) ? Relay::toGlobalId( 'post', (string) $this->data->post_parent ) : null; + }, + 'parentDatabaseId' => function () { + return ! empty( $this->data->post_parent ) ? absint( $this->data->post_parent ) : null; + }, + 'editLastId' => function () { + $edit_last = get_post_meta( $this->data->ID, '_edit_last', true ); + + return ! empty( $edit_last ) ? absint( $edit_last ) : null; + }, + 'editLock' => function () { + require_once ABSPATH . 'wp-admin/includes/post.php'; + if ( ! wp_check_post_lock( $this->data->ID ) ) { + return null; + } + + $edit_lock = get_post_meta( $this->data->ID, '_edit_lock', true ); + $edit_lock_parts = ! empty( $edit_lock ) ? explode( ':', $edit_lock ) : null; + + return ! empty( $edit_lock_parts ) ? $edit_lock_parts : null; + }, + 'enclosure' => function () { + $enclosure = get_post_meta( $this->data->ID, 'enclosure', true ); + + return ! empty( $enclosure ) ? $enclosure : null; + }, + 'guid' => function () { + return ! empty( $this->data->guid ) ? $this->data->guid : null; + }, + 'menuOrder' => function () { + return ! empty( $this->data->menu_order ) ? absint( $this->data->menu_order ) : null; + }, + 'link' => function () { + $link = get_permalink( $this->data->ID ); + + if ( $this->isPreview ) { + $link = get_preview_post_link( $this->parentDatabaseId ); + } elseif ( $this->isRevision ) { + $link = get_permalink( $this->data->ID ); + } + + return ! empty( $link ) ? urldecode( $link ) : null; + }, + 'uri' => function () { + $uri = $this->link; + + if ( true === $this->isFrontPage ) { + return '/'; + } + + // if the page is set as the posts page + // the page node itself is not identifiable + // by URI. Instead, the uri would return the + // Post content type as that uri + // represents the blog archive instead of a page + if ( true === $this->isPostsPage ) { + return null; + } + + return ! empty( $uri ) ? str_ireplace( home_url(), '', $uri ) : null; + }, + 'commentCount' => function () { + return ! empty( $this->data->comment_count ) ? absint( $this->data->comment_count ) : null; + }, + 'featuredImageId' => function () { + return ! empty( $this->featuredImageDatabaseId ) ? Relay::toGlobalId( 'post', (string) $this->featuredImageDatabaseId ) : null; + }, + 'featuredImageDatabaseId' => function () { + if ( $this->isRevision ) { + $id = $this->parentDatabaseId; + } else { + $id = $this->data->ID; + } + + $thumbnail_id = get_post_thumbnail_id( $id ); + + return ! empty( $thumbnail_id ) ? absint( $thumbnail_id ) : null; + }, + 'password' => [ + 'callback' => function () { + return ! empty( $this->data->post_password ) ? $this->data->post_password : null; + }, + 'capability' => isset( $this->post_type_object->cap->edit_others_posts ) ?: 'edit_others_posts', + ], + 'enqueuedScriptsQueue' => static function () { + global $wp_scripts; + do_action( 'wp_enqueue_scripts' ); + $queue = $wp_scripts->queue; + $wp_scripts->reset(); + $wp_scripts->queue = []; + + return $queue; + }, + 'enqueuedStylesheetsQueue' => static function () { + global $wp_styles; + do_action( 'wp_enqueue_scripts' ); + $queue = $wp_styles->queue; + $wp_styles->reset(); + $wp_styles->queue = []; + + return $queue; + }, + 'isRevision' => function () { + return 'revision' === $this->data->post_type; + }, + 'previewRevisionDatabaseId' => [ + 'callback' => function () { + $revisions = wp_get_post_revisions( + $this->data->ID, + [ + 'posts_per_page' => 1, + 'fields' => 'ids', + 'check_enabled' => false, + ] + ); + + return is_array( $revisions ) && ! empty( $revisions ) ? array_values( $revisions )[0] : null; + }, + 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', + ], + 'previewRevisionId' => function () { + return ! empty( $this->previewRevisionDatabaseId ) ? Relay::toGlobalId( 'post', (string) $this->previewRevisionDatabaseId ) : null; + }, + 'isPreview' => function () { + if ( $this->isRevision ) { + $revisions = wp_get_post_revisions( + $this->parentDatabaseId, + [ + 'posts_per_page' => 1, + 'fields' => 'ids', + 'check_enabled' => false, + ] + ); + + if ( in_array( $this->data->ID, array_values( $revisions ), true ) ) { + return true; + } + } + + if ( ! post_type_supports( $this->data->post_type, 'revisions' ) && 'draft' === $this->data->post_status ) { + return true; + } + + return false; + }, + 'isSticky' => function () { + return is_sticky( $this->databaseId ); + }, + ]; + + if ( 'attachment' === $this->data->post_type ) { + $attachment_fields = [ + 'captionRendered' => function () { + $caption = apply_filters( 'the_excerpt', apply_filters( 'get_the_excerpt', $this->data->post_excerpt, $this->data ) ); + + return ! empty( $caption ) ? $caption : null; + }, + 'captionRaw' => [ + 'callback' => function () { + return ! empty( $this->data->post_excerpt ) ? $this->data->post_excerpt : null; + }, + 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', + ], + 'altText' => function () { + return get_post_meta( $this->data->ID, '_wp_attachment_image_alt', true ); + }, + 'descriptionRendered' => function () { + return ! empty( $this->data->post_content ) ? apply_filters( 'the_content', $this->data->post_content ) : null; + }, + 'descriptionRaw' => [ + 'callback' => function () { + return ! empty( $this->data->post_content ) ? $this->data->post_content : null; + }, + 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', + ], + 'mediaType' => function () { + return wp_attachment_is_image( $this->data->ID ) ? 'image' : 'file'; + }, + 'mediaItemUrl' => function () { + return wp_get_attachment_url( $this->data->ID ); + }, + 'sourceUrl' => function () { + $source_url = wp_get_attachment_image_src( $this->data->ID, 'full' ); + + return ! empty( $source_url ) ? $source_url[0] : null; + }, + 'sourceUrlsBySize' => function () { + /** + * This returns an empty array on the VIP Go platform. + */ + $sizes = get_intermediate_image_sizes(); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_intermediate_image_sizes_get_intermediate_image_sizes + $urls = []; + if ( ! empty( $sizes ) && is_array( $sizes ) ) { + foreach ( $sizes as $size ) { + $img_src = wp_get_attachment_image_src( $this->data->ID, $size ); + $urls[ $size ] = ! empty( $img_src ) ? $img_src[0] : null; + } + } + + return $urls; + }, + 'mimeType' => function () { + return ! empty( $this->data->post_mime_type ) ? $this->data->post_mime_type : null; + }, + 'mediaDetails' => function () { + $media_details = wp_get_attachment_metadata( $this->data->ID ); + if ( ! empty( $media_details ) ) { + $media_details['ID'] = $this->data->ID; + + return $media_details; + } + + return null; + }, + ]; + + $this->fields = array_merge( $this->fields, $attachment_fields ); + } + + /** + * Set the {post_type}Id field to the Model. + */ + if ( isset( $this->post_type_object ) && isset( $this->post_type_object->graphql_single_name ) ) { + $type_id = $this->post_type_object->graphql_single_name . 'Id'; + $this->fields[ $type_id ] = function () { + return absint( $this->data->ID ); + }; + } + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/PostType.php b/lib/wp-graphql-1.17.0/src/Model/PostType.php new file mode 100644 index 00000000..e80b1a17 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/PostType.php @@ -0,0 +1,218 @@ +data = $post_type; + + $allowed_restricted_fields = [ + 'id', + 'name', + 'description', + 'hierarchical', + 'slug', + 'taxonomies', + 'graphql_single_name', + 'graphqlSingleName', + 'graphql_plural_name', + 'graphqlPluralName', + 'showInGraphql', + 'isRestricted', + 'uri', + 'isPostsPage', + 'isFrontPage', + 'label', + ]; + + $capability = isset( $post_type->cap->edit_posts ) ? $post_type->cap->edit_posts : 'edit_posts'; + + parent::__construct( $capability, $allowed_restricted_fields ); + } + + /** + * Method for determining if the data should be considered private or not + * + * @return bool + */ + protected function is_private() { + if ( false === $this->data->public && ( ! isset( $this->data->cap->edit_posts ) || ! current_user_can( $this->data->cap->edit_posts ) ) ) { + return true; + } + + return false; + } + + /** + * Initializes the object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + return ! empty( $this->data->name ) ? Relay::toGlobalId( 'post_type', $this->data->name ) : null; + }, + 'name' => function () { + return ! empty( $this->data->name ) ? $this->data->name : null; + }, + 'label' => function () { + return ! empty( $this->data->label ) ? $this->data->label : null; + }, + 'labels' => function () { + return get_post_type_labels( $this->data ); + }, + 'description' => function () { + return ! empty( $this->data->description ) ? $this->data->description : ''; + }, + 'public' => function () { + return ! empty( $this->data->public ) ? (bool) $this->data->public : null; + }, + 'hierarchical' => function () { + return true === $this->data->hierarchical || ! empty( $this->data->hierarchical ); + }, + 'excludeFromSearch' => function () { + return true === $this->data->exclude_from_search; + }, + 'publiclyQueryable' => function () { + return true === $this->data->publicly_queryable; + }, + 'showUi' => function () { + return true === $this->data->show_ui; + }, + 'showInMenu' => function () { + return true === $this->data->show_in_menu; + }, + 'showInNavMenus' => function () { + return true === $this->data->show_in_nav_menus; + }, + 'showInAdminBar' => function () { + return true === $this->data->show_in_admin_bar; + }, + 'menuPosition' => function () { + return ! empty( $this->data->menu_position ) ? $this->data->menu_position : null; + }, + 'menuIcon' => function () { + return ! empty( $this->data->menu_icon ) ? $this->data->menu_icon : null; + }, + 'hasArchive' => function () { + return ! empty( $this->uri ); + }, + 'canExport' => function () { + return true === $this->data->can_export; + }, + 'deleteWithUser' => function () { + return true === $this->data->delete_with_user; + }, + 'taxonomies' => function () { + $object_taxonomies = get_object_taxonomies( $this->data->name ); + return ( ! empty( $object_taxonomies ) ) ? $object_taxonomies : null; + }, + 'showInRest' => function () { + return true === $this->data->show_in_rest; + }, + 'restBase' => function () { + return ! empty( $this->data->rest_base ) ? $this->data->rest_base : null; + }, + 'restControllerClass' => function () { + return ! empty( $this->data->rest_controller_class ) ? $this->data->rest_controller_class : null; + }, + 'showInGraphql' => function () { + return true === $this->data->show_in_graphql; + }, + 'graphqlSingleName' => function () { + return ! empty( $this->data->graphql_single_name ) ? $this->data->graphql_single_name : null; + }, + 'graphql_single_name' => function () { + return ! empty( $this->data->graphql_single_name ) ? $this->data->graphql_single_name : null; + }, + 'graphqlPluralName' => function () { + return ! empty( $this->data->graphql_plural_name ) ? $this->data->graphql_plural_name : null; + }, + 'graphql_plural_name' => function () { + return ! empty( $this->data->graphql_plural_name ) ? $this->data->graphql_plural_name : null; + }, + 'uri' => function () { + $link = get_post_type_archive_link( $this->name ); + return ! empty( $link ) ? trailingslashit( str_ireplace( home_url(), '', $link ) ) : null; + }, + // If the homepage settings are to set to + 'isPostsPage' => function () { + if ( + 'post' === $this->name && + ( + 'posts' === get_option( 'show_on_front', 'posts' ) || + empty( (int) get_option( 'page_for_posts', 0 ) ) ) + ) { + return true; + } + + return false; + }, + 'isFrontPage' => function () { + if ( + 'post' === $this->name && + ( + 'posts' === get_option( 'show_on_front', 'posts' ) || + empty( (int) get_option( 'page_on_front', 0 ) ) + ) + ) { + return true; + } + + return false; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/Taxonomy.php b/lib/wp-graphql-1.17.0/src/Model/Taxonomy.php new file mode 100644 index 00000000..c6a9b296 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/Taxonomy.php @@ -0,0 +1,160 @@ +data = $taxonomy; + + $allowed_restricted_fields = [ + 'id', + 'name', + 'description', + 'hierarchical', + 'object_type', + 'restBase', + 'graphql_single_name', + 'graphqlSingleName', + 'graphql_plural_name', + 'graphqlPluralName', + 'showInGraphql', + 'isRestricted', + ]; + + $capability = isset( $this->data->cap->edit_terms ) ? $this->data->cap->edit_terms : 'edit_terms'; + + parent::__construct( $capability, $allowed_restricted_fields ); + } + + /** + * Method for determining if the data should be considered private or not + * + * @return bool + */ + protected function is_private() { + if ( false === $this->data->public && ( ! isset( $this->data->cap->edit_terms ) || ! current_user_can( $this->data->cap->edit_terms ) ) ) { + return true; + } + + return false; + } + + /** + * Initializes the object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + return ! empty( $this->data->name ) ? Relay::toGlobalId( 'taxonomy', $this->data->name ) : null; + }, + 'object_type' => function () { + return ! empty( $this->data->object_type ) ? $this->data->object_type : null; + }, + 'name' => function () { + return ! empty( $this->data->name ) ? $this->data->name : null; + }, + 'label' => function () { + return ! empty( $this->data->label ) ? $this->data->label : null; + }, + 'description' => function () { + return ! empty( $this->data->description ) ? $this->data->description : ''; + }, + 'public' => function () { + return ! empty( $this->data->public ) ? (bool) $this->data->public : true; + }, + 'hierarchical' => function () { + return true === $this->data->hierarchical; + }, + 'showUi' => function () { + return true === $this->data->show_ui; + }, + 'showInMenu' => function () { + return true === $this->data->show_in_menu; + }, + 'showInNavMenus' => function () { + return true === $this->data->show_in_nav_menus; + }, + 'showCloud' => function () { + return true === $this->data->show_tagcloud; + }, + 'showInQuickEdit' => function () { + return true === $this->data->show_in_quick_edit; + }, + 'showInAdminColumn' => function () { + return true === $this->data->show_admin_column; + }, + 'showInRest' => function () { + return true === $this->data->show_in_rest; + }, + 'restBase' => function () { + return ! empty( $this->data->rest_base ) ? $this->data->rest_base : null; + }, + 'restControllerClass' => function () { + return ! empty( $this->data->rest_controller_class ) ? $this->data->rest_controller_class : null; + }, + 'showInGraphql' => function () { + return true === $this->data->show_in_graphql; + }, + 'graphqlSingleName' => function () { + return ! empty( $this->data->graphql_single_name ) ? $this->data->graphql_single_name : null; + }, + 'graphql_single_name' => function () { + return ! empty( $this->data->graphql_single_name ) ? $this->data->graphql_single_name : null; + }, + 'graphqlPluralName' => function () { + return ! empty( $this->data->graphql_plural_name ) ? $this->data->graphql_plural_name : null; + }, + 'graphql_plural_name' => function () { + return ! empty( $this->data->graphql_plural_name ) ? $this->data->graphql_plural_name : null; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/Term.php b/lib/wp-graphql-1.17.0/src/Model/Term.php new file mode 100644 index 00000000..d330a4d7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/Term.php @@ -0,0 +1,211 @@ +data = $term; + $taxonomy = get_taxonomy( $term->taxonomy ); + $this->taxonomy_object = $taxonomy instanceof WP_Taxonomy ? $taxonomy : null; + parent::__construct(); + } + + /** + * Setup the global state for the model to have proper context when resolving + * + * @return void + */ + public function setup() { + global $wp_query, $post; + + /** + * Store the global post before overriding + */ + $this->global_post = $post; + + if ( $this->data instanceof WP_Term ) { + + /** + * Reset global post + */ + $GLOBALS['post'] = get_post( 0 ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride + + /** + * Parse the query to tell WordPress + * how to setup global state + */ + if ( 'category' === $this->data->taxonomy ) { + $wp_query->parse_query( + [ + 'category_name' => $this->data->slug, + ] + ); + } elseif ( 'post_tag' === $this->data->taxonomy ) { + $wp_query->parse_query( + [ + 'tag' => $this->data->slug, + ] + ); + } + + $wp_query->queried_object = get_term( $this->data->term_id, $this->data->taxonomy ); + $wp_query->queried_object_id = $this->data->term_id; + } + } + + /** + * Reset global state after the model fields + * have been generated + * + * @return void + */ + public function tear_down() { + $GLOBALS['post'] = $this->global_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride + wp_reset_postdata(); + } + + /** + * Initializes the Term object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + return ( ! empty( $this->data->taxonomy ) && ! empty( $this->data->term_id ) ) ? Relay::toGlobalId( 'term', (string) $this->data->term_id ) : null; + }, + 'term_id' => function () { + return ( ! empty( $this->data->term_id ) ) ? absint( $this->data->term_id ) : null; + }, + 'databaseId' => function () { + return ( ! empty( $this->data->term_id ) ) ? absint( $this->data->term_id ) : null; + }, + 'count' => function () { + return ! empty( $this->data->count ) ? absint( $this->data->count ) : null; + }, + 'description' => function () { + return ! empty( $this->data->description ) ? $this->html_entity_decode( $this->data->description, 'description' ) : null; + }, + 'name' => function () { + return ! empty( $this->data->name ) ? $this->html_entity_decode( $this->data->name, 'name', true ) : null; + }, + 'slug' => function () { + return ! empty( $this->data->slug ) ? urldecode( $this->data->slug ) : null; + }, + 'termGroupId' => function () { + return ! empty( $this->data->term_group ) ? absint( $this->data->term_group ) : null; + }, + 'termTaxonomyId' => function () { + return ! empty( $this->data->term_taxonomy_id ) ? absint( $this->data->term_taxonomy_id ) : null; + }, + 'taxonomyName' => function () { + return ! empty( $this->taxonomy_object->name ) ? $this->taxonomy_object->name : null; + }, + 'link' => function () { + $link = get_term_link( $this->data->term_id ); + + return ( ! is_wp_error( $link ) ) ? $link : null; + }, + 'parentId' => function () { + return ! empty( $this->data->parent ) ? Relay::toGlobalId( 'term', (string) $this->data->parent ) : null; + }, + 'parentDatabaseId' => function () { + return ! empty( $this->data->parent ) ? $this->data->parent : null; + }, + 'enqueuedScriptsQueue' => static function () { + global $wp_scripts; + $wp_scripts->reset(); + do_action( 'wp_enqueue_scripts' ); + $queue = $wp_scripts->queue; + $wp_scripts->reset(); + $wp_scripts->queue = []; + + return $queue; + }, + 'enqueuedStylesheetsQueue' => static function () { + global $wp_styles; + do_action( 'wp_enqueue_scripts' ); + $queue = $wp_styles->queue; + $wp_styles->reset(); + $wp_styles->queue = []; + + return $queue; + }, + 'uri' => function () { + $link = $this->link; + + $maybe_url = wp_parse_url( $link ); + + // If this isn't a URL, we can assume it's been filtered and just return the link value. + if ( false === $maybe_url ) { + return $link; + } + + // Replace the home_url in the link in order to return a relative uri. + // For subdirectory multisites, this replaces the home_url which includes the subdirectory. + return ! empty( $link ) ? str_ireplace( home_url(), '', $link ) : null; + }, + ]; + + if ( isset( $this->taxonomy_object, $this->taxonomy_object->graphql_single_name ) ) { + $type_id = $this->taxonomy_object->graphql_single_name . 'Id'; + $this->fields[ $type_id ] = absint( $this->data->term_id ); + } + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/Theme.php b/lib/wp-graphql-1.17.0/src/Model/Theme.php new file mode 100644 index 00000000..3e221f66 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/Theme.php @@ -0,0 +1,110 @@ +data = $theme; + parent::__construct(); + } + + /** + * Method for determining if the data should be considered private or not + * + * @return bool + */ + protected function is_private() { + // Don't assume a capabilities hierarchy, since it's likely headless sites might disable some capabilities site-wide. + if ( current_user_can( 'edit_themes' ) || current_user_can( 'switch_themes' ) || current_user_can( 'update_themes' ) ) { + return false; + } + + if ( wp_get_theme()->get_stylesheet() !== $this->data->get_stylesheet() ) { + return true; + } + + return false; + } + + /** + * Initialize the object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + $stylesheet = $this->data->get_stylesheet(); + return ( ! empty( $stylesheet ) ) ? Relay::toGlobalId( 'theme', $stylesheet ) : null; + }, + 'slug' => function () { + $stylesheet = $this->data->get_stylesheet(); + return ! empty( $stylesheet ) ? $stylesheet : null; + }, + 'name' => function () { + $name = $this->data->get( 'Name' ); + return ! empty( $name ) ? $name : null; + }, + 'screenshot' => function () { + $screenshot = $this->data->get_screenshot(); + return ! empty( $screenshot ) ? $screenshot : null; + }, + 'themeUri' => function () { + $theme_uri = $this->data->get( 'ThemeURI' ); + return ! empty( $theme_uri ) ? $theme_uri : null; + }, + 'description' => function () { + return ! empty( $this->data->description ) ? $this->data->description : null; + }, + 'author' => function () { + return ! empty( $this->data->author ) ? $this->data->author : null; + }, + 'authorUri' => function () { + $author_uri = $this->data->get( 'AuthorURI' ); + return ! empty( $author_uri ) ? $author_uri : null; + }, + 'tags' => function () { + return ! empty( $this->data->tags ) ? $this->data->tags : null; + }, + 'version' => function () { + return ! empty( $this->data->version ) ? $this->data->version : null; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/User.php b/lib/wp-graphql-1.17.0/src/Model/User.php new file mode 100644 index 00000000..2c495921 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/User.php @@ -0,0 +1,271 @@ +user_pass = ''; + $this->data = $user; + + $allowed_restricted_fields = [ + 'isRestricted', + 'id', + 'userId', + 'databaseId', + 'name', + 'firstName', + 'lastName', + 'description', + 'slug', + 'uri', + 'enqueuedScriptsQueue', + 'enqueuedStylesheetsQueue', + ]; + + parent::__construct( 'list_users', $allowed_restricted_fields, $user->ID ); + } + + /** + * Setup the global data for the model to have proper context when resolving + * + * @return void + */ + public function setup() { + global $wp_query, $post, $authordata; + + // Store variables for resetting at tear down + $this->global_post = $post; + $this->global_authordata = $authordata; + + if ( $this->data instanceof WP_User ) { + + // Reset postdata + $wp_query->reset_postdata(); + + // Parse the query to setup global state + $wp_query->parse_query( + [ + 'author_name' => $this->data->user_nicename, + ] + ); + + // Setup globals + $wp_query->is_author = true; + $GLOBALS['authordata'] = $this->data; // phpcs:ignore WordPress.WP.GlobalVariablesOverride + $wp_query->queried_object = get_user_by( 'id', $this->data->ID ); + $wp_query->queried_object_id = $this->data->ID; + } + } + + /** + * Reset global state after the model fields + * have been generated + * + * @return void + */ + public function tear_down() { + $GLOBALS['authordata'] = $this->global_authordata; // phpcs:ignore WordPress.WP.GlobalVariablesOverride + $GLOBALS['post'] = $this->global_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride + wp_reset_postdata(); + } + + /** + * Method for determining if the data should be considered private or not + * + * @return bool + */ + protected function is_private() { + /** + * If the user has permissions to list users. + */ + if ( current_user_can( $this->restricted_cap ) ) { + return false; + } + + /** + * If the owner of the content is the current user + */ + if ( true === $this->owner_matches_current_user() ) { + return false; + } + + return $this->data->is_private ?? true; + } + + /** + * Initialize the User object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + return ( ! empty( $this->data->ID ) ) ? Relay::toGlobalId( 'user', (string) $this->data->ID ) : null; + }, + 'databaseId' => function () { + return $this->userId; + }, + 'capabilities' => function () { + if ( ! empty( $this->data->allcaps ) ) { + + /** + * Reformat the array of capabilities from the user object so that it is a true + * ListOf type + */ + $capabilities = array_keys( + array_filter( + $this->data->allcaps, + static function ( $cap ) { + return true === $cap; + } + ) + ); + } + + return ! empty( $capabilities ) ? $capabilities : null; + }, + 'capKey' => function () { + return ! empty( $this->data->cap_key ) ? $this->data->cap_key : null; + }, + 'roles' => function () { + return ! empty( $this->data->roles ) ? $this->data->roles : null; + }, + 'email' => function () { + return ! empty( $this->data->user_email ) ? $this->data->user_email : null; + }, + 'firstName' => function () { + return ! empty( $this->data->first_name ) ? $this->data->first_name : null; + }, + 'lastName' => function () { + return ! empty( $this->data->last_name ) ? $this->data->last_name : null; + }, + 'extraCapabilities' => function () { + return ! empty( $this->data->allcaps ) ? array_keys( $this->data->allcaps ) : null; + }, + 'description' => function () { + return ! empty( $this->data->description ) ? $this->data->description : null; + }, + 'username' => function () { + return ! empty( $this->data->user_login ) ? $this->data->user_login : null; + }, + 'name' => function () { + return ! empty( $this->data->display_name ) ? $this->data->display_name : null; + }, + 'registeredDate' => function () { + $timestamp = ! empty( $this->data->user_registered ) ? strtotime( $this->data->user_registered ) : null; + return ! empty( $timestamp ) ? gmdate( 'c', $timestamp ) : null; + }, + 'nickname' => function () { + return ! empty( $this->data->nickname ) ? $this->data->nickname : null; + }, + 'url' => function () { + return ! empty( $this->data->user_url ) ? $this->data->user_url : null; + }, + 'slug' => function () { + return ! empty( $this->data->user_nicename ) ? $this->data->user_nicename : null; + }, + 'nicename' => function () { + return ! empty( $this->data->user_nicename ) ? $this->data->user_nicename : null; + }, + 'locale' => function () { + $user_locale = get_user_locale( $this->data ); + + return ! empty( $user_locale ) ? $user_locale : null; + }, + 'shouldShowAdminToolbar' => function () { + $toolbar_preference_meta = get_user_meta( $this->data->ID, 'show_admin_bar_front', true ); + + return 'true' === $toolbar_preference_meta; + }, + 'userId' => ! empty( $this->data->ID ) ? absint( $this->data->ID ) : null, + 'uri' => function () { + $user_profile_url = get_author_posts_url( $this->data->ID ); + + return ! empty( $user_profile_url ) ? str_ireplace( home_url(), '', $user_profile_url ) : ''; + }, + 'enqueuedScriptsQueue' => static function () { + global $wp_scripts; + do_action( 'wp_enqueue_scripts' ); + $queue = $wp_scripts->queue; + $wp_scripts->reset(); + $wp_scripts->queue = []; + + return $queue; + }, + 'enqueuedStylesheetsQueue' => static function () { + global $wp_styles; + do_action( 'wp_enqueue_scripts' ); + $queue = $wp_styles->queue; + $wp_styles->reset(); + $wp_styles->queue = []; + + return $queue; + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Model/UserRole.php b/lib/wp-graphql-1.17.0/src/Model/UserRole.php new file mode 100644 index 00000000..17711c03 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Model/UserRole.php @@ -0,0 +1,86 @@ +data = $user_role; + parent::__construct(); + } + + /** + * Method for determining if the data should be considered private or not + * + * @return bool + */ + protected function is_private() { + if ( current_user_can( 'list_users' ) ) { + return false; + } + + $current_user_roles = wp_get_current_user()->roles; + + if ( in_array( $this->data['slug'], $current_user_roles, true ) ) { + return false; + } + + return true; + } + + /** + * Initializes the object + * + * @return void + */ + protected function init() { + if ( empty( $this->fields ) ) { + $this->fields = [ + 'id' => function () { + $id = Relay::toGlobalId( 'user_role', $this->data['id'] ); + return $id; + }, + 'name' => function () { + return ! empty( $this->data['name'] ) ? esc_html( $this->data['name'] ) : null; + }, + 'displayName' => function () { + return ! empty( $this->data['displayName'] ) ? esc_html( $this->data['displayName'] ) : null; + }, + 'capabilities' => function () { + if ( empty( $this->data['capabilities'] ) || ! is_array( $this->data['capabilities'] ) ) { + return null; + } else { + return array_keys( $this->data['capabilities'] ); + } + }, + ]; + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/CommentCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/CommentCreate.php new file mode 100644 index 00000000..6e2f9451 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/CommentCreate.php @@ -0,0 +1,203 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return [ + 'approved' => [ + 'type' => 'String', + 'description' => __( 'The approval status of the comment.', 'wp-graphql' ), + 'deprecationReason' => __( 'Deprecated in favor of the status field', 'wp-graphql' ), + ], + 'author' => [ + 'type' => 'String', + 'description' => __( 'The name of the comment\'s author.', 'wp-graphql' ), + ], + 'authorEmail' => [ + 'type' => 'String', + 'description' => __( 'The email of the comment\'s author.', 'wp-graphql' ), + ], + 'authorUrl' => [ + 'type' => 'String', + 'description' => __( 'The url of the comment\'s author.', 'wp-graphql' ), + ], + 'commentOn' => [ + 'type' => 'Int', + 'description' => __( 'The database ID of the post object the comment belongs to.', 'wp-graphql' ), + ], + 'content' => [ + 'type' => 'String', + 'description' => __( 'Content of the comment.', 'wp-graphql' ), + ], + 'date' => [ + 'type' => 'String', + 'description' => __( 'The date of the object. Preferable to enter as year/month/day ( e.g. 01/31/2017 ) as it will rearrange date as fit if it is not specified. Incomplete dates may have unintended results for example, "2017" as the input will use current date with timestamp 20:17 ', 'wp-graphql' ), + ], + 'parent' => [ + 'type' => 'ID', + 'description' => __( 'Parent comment ID of current comment.', 'wp-graphql' ), + ], + 'status' => [ + 'type' => 'CommentStatusEnum', + 'description' => __( 'The approval status of the comment', 'wp-graphql' ), + ], + 'type' => [ + 'type' => 'String', + 'description' => __( 'Type of comment.', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return [ + 'comment' => [ + 'type' => 'Comment', + 'description' => __( 'The comment that was created', 'wp-graphql' ), + 'resolve' => static function ( $payload, $args, AppContext $context ) { + if ( ! isset( $payload['id'] ) || ! absint( $payload['id'] ) ) { + return null; + } + + return $context->get_loader( 'comment' )->load_deferred( absint( $payload['id'] ) ); + }, + ], + /** + * Comments can be created by non-authenticated users, but if the comment is not approved + * the user will not have access to the comment in response to the mutation. + * + * This field allows for the mutation to respond with a success message that the + * comment was indeed created, even if it cannot be returned in the response to respect + * server privacy. + * + * If the success comes back as true, the client can then use that response to + * dictate if they should use the input values as an optimistic response to the mutation + * and store in the cache, localStorage, cookie or whatever else so that the + * client can see their comment while it's still pending approval. + */ + 'success' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the mutation succeeded. If the comment is not approved, the server will not return the comment to a non authenticated user, but a success message can be returned if the create succeeded, and the client can optimistically add the comment to the client cache', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input, AppContext $context, ResolveInfo $info ) { + + /** + * Throw an exception if there's no input + */ + if ( ( empty( $input ) || ! is_array( $input ) ) ) { + throw new UserError( esc_html__( 'Mutation not processed. There was no input for the mutation or the comment_object was invalid', 'wp-graphql' ) ); + } + + $commented_on = get_post( absint( $input['commentOn'] ) ); + + if ( empty( $commented_on ) ) { + throw new UserError( esc_html__( 'The ID of the node to comment on is invalid', 'wp-graphql' ) ); + } + + /** + * Stop if post not open to comments + */ + if ( empty( $input['commentOn'] ) || 'closed' === $commented_on->comment_status ) { + throw new UserError( esc_html__( 'Sorry, this post is closed to comments at the moment', 'wp-graphql' ) ); + } + + if ( '1' === get_option( 'comment_registration' ) && ! is_user_logged_in() ) { + throw new UserError( esc_html__( 'This site requires you to be logged in to leave a comment', 'wp-graphql' ) ); + } + + /** + * Map all of the args from GraphQL to WordPress friendly args array + */ + $comment_args = [ + 'comment_author_url' => '', + 'comment_type' => '', + 'comment_parent' => 0, + 'user_id' => 0, + 'comment_date' => gmdate( 'Y-m-d H:i:s' ), + ]; + + CommentMutation::prepare_comment_object( $input, $comment_args, 'createComment' ); + + /** + * Insert the comment and retrieve the ID + */ + $comment_id = wp_new_comment( $comment_args, true ); + + /** + * Throw an exception if the comment failed to be created + */ + if ( is_wp_error( $comment_id ) ) { + $error_message = $comment_id->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } else { + throw new UserError( esc_html__( 'The object failed to create but no error was provided', 'wp-graphql' ) ); + } + } + + /** + * If the $comment_id is empty, we should throw an exception + */ + if ( empty( $comment_id ) ) { + throw new UserError( esc_html__( 'The object failed to create', 'wp-graphql' ) ); + } + + /** + * This updates additional data not part of the comments table ( commentmeta, other relations, etc ) + * + * The input for the commentMutation will be passed, along with the $new_comment_id for the + * comment that was created so that relations can be set, meta can be updated, etc. + */ + CommentMutation::update_additional_comment_data( $comment_id, $input, 'createComment', $context, $info ); + + /** + * Return the comment object + */ + return [ + 'id' => $comment_id, + 'success' => true, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/CommentDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/CommentDelete.php new file mode 100644 index 00000000..7faf0ec9 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/CommentDelete.php @@ -0,0 +1,136 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The deleted comment ID', 'wp-graphql' ), + ], + 'forceDelete' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the comment should be force deleted instead of being moved to the trash', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return [ + 'deletedId' => [ + 'type' => 'Id', + 'description' => __( 'The deleted comment ID', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + $deleted = (object) $payload['commentObject']; + + return ! empty( $deleted->comment_ID ) ? Relay::toGlobalId( 'comment', $deleted->comment_ID ) : null; + }, + ], + 'comment' => [ + 'type' => 'Comment', + 'description' => __( 'The deleted comment object', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + return $payload['commentObject'] ? $payload['commentObject'] : null; + }, + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input ) { + // Get the database ID for the comment. + $comment_id = Utils::get_database_id_from_id( $input['id'] ); + + // Get the post object before deleting it. + $comment_before_delete = ! empty( $comment_id ) ? get_comment( $comment_id ) : false; + + if ( empty( $comment_before_delete ) ) { + throw new UserError( esc_html__( 'The Comment could not be deleted', 'wp-graphql' ) ); + } + + /** + * Stop now if a user isn't allowed to delete the comment + */ + $user_id = $comment_before_delete->user_id; + + // Prevent comment deletions by default + $not_allowed = true; + + // If the current user can moderate comments proceed + if ( current_user_can( 'moderate_comments' ) ) { + $not_allowed = false; + } else { + // Get the current user id + $current_user_id = absint( get_current_user_id() ); + // If the current user ID is the same as the comment author's ID, then the + // current user is the comment author and can delete the comment + if ( 0 !== $current_user_id && absint( $user_id ) === $current_user_id ) { + $not_allowed = false; + } + } + + /** + * If the mutation has been prevented + */ + if ( true === $not_allowed ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to delete this comment.', 'wp-graphql' ) ); + } + + /** + * Check if we should force delete or not + */ + $force_delete = ! empty( $input['forceDelete'] ) && true === $input['forceDelete']; + + $comment_before_delete = new Comment( $comment_before_delete ); + + /** + * Delete the comment + */ + wp_delete_comment( (int) $comment_id, $force_delete ); + + return [ + 'commentObject' => $comment_before_delete, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/CommentRestore.php b/lib/wp-graphql-1.17.0/src/Mutation/CommentRestore.php new file mode 100644 index 00000000..3196d30e --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/CommentRestore.php @@ -0,0 +1,106 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The ID of the comment to be restored', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return [ + 'restoredId' => [ + 'type' => 'Id', + 'description' => __( 'The ID of the restored comment', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + $restore = (object) $payload['commentObject']; + + return ! empty( $restore->comment_ID ) ? Relay::toGlobalId( 'comment', $restore->comment_ID ) : null; + }, + ], + 'comment' => [ + 'type' => 'Comment', + 'description' => __( 'The restored comment object', 'wp-graphql' ), + 'resolve' => static function ( $payload, $args, AppContext $context ) { + if ( ! isset( $payload['commentObject']->comment_ID ) || ! absint( $payload['commentObject']->comment_ID ) ) { + return null; + } + return $context->get_loader( 'comment' )->load_deferred( absint( $payload['commentObject']->comment_ID ) ); + }, + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input ) { + // Stop now if a user isn't allowed to delete the comment. + if ( ! current_user_can( 'moderate_comments' ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to restore this comment.', 'wp-graphql' ) ); + } + + // Get the database ID for the comment. + $comment_id = Utils::get_database_id_from_id( $input['id'] ); + + if ( false === $comment_id ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to restore this comment.', 'wp-graphql' ) ); + } + + // Delete the comment. + wp_untrash_comment( $comment_id ); + + $comment = get_comment( $comment_id ); + + return [ + 'commentObject' => $comment, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/CommentUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/CommentUpdate.php new file mode 100644 index 00000000..7601d0e5 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/CommentUpdate.php @@ -0,0 +1,144 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return array_merge( + CommentCreate::get_input_fields(), + [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The ID of the comment being updated.', 'wp-graphql' ), + ], + ] + ); + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return CommentCreate::get_output_fields(); + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input, AppContext $context, ResolveInfo $info ) { + // Get the database ID for the comment. + $comment_id = ! empty( $input['id'] ) ? Utils::get_database_id_from_id( $input['id'] ) : null; + + // Get the args from the existing comment. + $comment_args = ! empty( $comment_id ) ? get_comment( $comment_id, ARRAY_A ) : null; + + if ( empty( $comment_id ) || empty( $comment_args ) ) { + throw new UserError( esc_html__( 'The Comment could not be updated', 'wp-graphql' ) ); + } + + /** + * Map all of the args from GraphQL to WordPress friendly args array + */ + $user_id = $comment_args['user_id'] ?? null; + $raw_comment_args = $comment_args; + CommentMutation::prepare_comment_object( $input, $comment_args, 'update', true ); + + // Prevent comment deletions by default + $not_allowed = true; + + // If the current user can moderate comments proceed + if ( current_user_can( 'moderate_comments' ) ) { + $not_allowed = false; + } else { + // Get the current user id + $current_user_id = absint( get_current_user_id() ); + // If the current user ID is the same as the comment author's ID, then the + // current user is the comment author and can delete the comment + if ( 0 !== $current_user_id && absint( $user_id ) === $current_user_id ) { + $not_allowed = false; + } + } + + /** + * If the mutation has been prevented + */ + if ( true === $not_allowed ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to update this comment.', 'wp-graphql' ) ); + } + + // If there are no changes between the existing comment and the incoming comment + if ( $comment_args === $raw_comment_args ) { + throw new UserError( esc_html__( 'No changes have been provided to the comment.', 'wp-graphql' ) ); + } + + /** + * Update comment + * $success int 1 on success and 0 on fail + */ + $success = wp_update_comment( $comment_args, true ); + + /** + * Throw an exception if the comment failed to be created + */ + if ( is_wp_error( $success ) ) { + throw new UserError( esc_html( $success->get_error_message() ) ); + } + + /** + * This updates additional data not part of the comments table ( commentmeta, other relations, etc ) + * + * The input for the commentMutation will be passed, along with the $new_comment_id for the + * comment that was created so that relations can be set, meta can be updated, etc. + */ + CommentMutation::update_additional_comment_data( $comment_id, $input, 'create', $context, $info ); + + /** + * Return the comment object + */ + return [ + 'id' => $comment_id, + 'success' => (bool) $success, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/MediaItemCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/MediaItemCreate.php new file mode 100644 index 00000000..f2ee2431 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/MediaItemCreate.php @@ -0,0 +1,328 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return [ + 'altText' => [ + 'type' => 'String', + 'description' => __( 'Alternative text to display when mediaItem is not displayed', 'wp-graphql' ), + ], + 'authorId' => [ + 'type' => 'ID', + 'description' => __( 'The userId to assign as the author of the mediaItem', 'wp-graphql' ), + ], + 'caption' => [ + 'type' => 'String', + 'description' => __( 'The caption for the mediaItem', 'wp-graphql' ), + ], + 'commentStatus' => [ + 'type' => 'String', + 'description' => __( 'The comment status for the mediaItem', 'wp-graphql' ), + ], + 'date' => [ + 'type' => 'String', + 'description' => __( 'The date of the mediaItem', 'wp-graphql' ), + ], + 'dateGmt' => [ + 'type' => 'String', + 'description' => __( 'The date (in GMT zone) of the mediaItem', 'wp-graphql' ), + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'Description of the mediaItem', 'wp-graphql' ), + ], + 'filePath' => [ + 'type' => 'String', + 'description' => __( 'The file name of the mediaItem', 'wp-graphql' ), + ], + 'fileType' => [ + 'type' => 'MimeTypeEnum', + 'description' => __( 'The file type of the mediaItem', 'wp-graphql' ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => __( 'The slug of the mediaItem', 'wp-graphql' ), + ], + 'status' => [ + 'type' => 'MediaItemStatusEnum', + 'description' => __( 'The status of the mediaItem', 'wp-graphql' ), + ], + 'title' => [ + 'type' => 'String', + 'description' => __( 'The title of the mediaItem', 'wp-graphql' ), + ], + 'pingStatus' => [ + 'type' => 'String', + 'description' => __( 'The ping status for the mediaItem', 'wp-graphql' ), + ], + 'parentId' => [ + 'type' => 'ID', + 'description' => __( 'The ID of the parent object', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return [ + 'mediaItem' => [ + 'type' => 'MediaItem', + 'description' => __( 'The MediaItem object mutation type.', 'wp-graphql' ), + 'resolve' => static function ( $payload, $args, AppContext $context ) { + if ( empty( $payload['postObjectId'] ) || ! absint( $payload['postObjectId'] ) ) { + return null; + } + + return $context->get_loader( 'post' )->load_deferred( $payload['postObjectId'] ); + }, + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input, AppContext $context, ResolveInfo $info ) { + /** + * Stop now if a user isn't allowed to upload a mediaItem + */ + if ( ! current_user_can( 'upload_files' ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to upload mediaItems', 'wp-graphql' ) ); + } + + $post_type_object = get_post_type_object( 'attachment' ); + if ( empty( $post_type_object ) ) { + throw new UserError( esc_html__( 'The Media Item could not be created', 'wp-graphql' ) ); + } + + /** + * If the mediaItem being created is being assigned to another user that's not the current user, make sure + * the current user has permission to edit others mediaItems + */ + if ( ! empty( $input['authorId'] ) ) { + // Ensure authorId is a valid databaseId. + $input['authorId'] = Utils::get_database_id_from_id( $input['authorId'] ); + + // Bail if can't edit other users' attachments. + if ( get_current_user_id() !== $input['authorId'] && ( ! isset( $post_type_object->cap->edit_others_posts ) || ! current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to create mediaItems as this user', 'wp-graphql' ) ); + } + } + + /** + * Set the file name, whether it's a local file or from a URL. + * Then set the url for the uploaded file + */ + $file_name = basename( $input['filePath'] ); + $uploaded_file_url = $input['filePath']; + $sanitized_file_path = sanitize_file_name( $input['filePath'] ); + + // Check that the filetype is allowed + $check_file = wp_check_filetype( $sanitized_file_path ); + + // if the file doesn't pass the check, throw an error + if ( ! $check_file['ext'] || ! $check_file['type'] || ! wp_http_validate_url( $uploaded_file_url ) ) { + // translators: %s is the file path. + throw new UserError( esc_html( sprintf( __( 'Invalid filePath "%s"', 'wp-graphql' ), $input['filePath'] ) ) ); + } + + $protocol = wp_parse_url( $input['filePath'], PHP_URL_SCHEME ); + + // prevent the filePath from being submitted with a non-allowed protocols + $allowed_protocols = [ 'https', 'http', 'file' ]; + + /** + * Filter the allowed protocols for the mutation + * + * @param array $allowed_protocols The allowed protocols for filePaths to be submitted + * @param mixed $protocol The current protocol of the filePath + * @param array $input The input of the current mutation + * @param \WPGraphQL\AppContext $context The context of the current request + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo of the current field + */ + $allowed_protocols = apply_filters( 'graphql_media_item_create_allowed_protocols', $allowed_protocols, $protocol, $input, $context, $info ); + + if ( ! in_array( $protocol, $allowed_protocols, true ) ) { + throw new UserError( + esc_html( + sprintf( + // translators: %1$s is the protocol, %2$s is the list of allowed protocols. + __( 'Invalid protocol. "%1$s". Only "%2$s" allowed.', 'wp-graphql' ), + $protocol, + implode( '", "', $allowed_protocols ) + ) + ) + ); + } + + /** + * Require the file.php file from wp-admin. This file includes the + * download_url and wp_handle_sideload methods + */ + require_once ABSPATH . 'wp-admin/includes/file.php'; + + $file_contents = file_get_contents( $input['filePath'] ); + + /** + * If the mediaItem file is from a local server, use wp_upload_bits before saving it to the uploads folder + */ + if ( 'file' === wp_parse_url( $input['filePath'], PHP_URL_SCHEME ) && ! empty( $file_contents ) ) { + $uploaded_file = wp_upload_bits( $file_name, null, $file_contents ); + $uploaded_file_url = ( empty( $uploaded_file['error'] ) ? $uploaded_file['url'] : null ); + } + + /** + * URL data for the mediaItem, timeout value is the default, see: + * https://developer.wordpress.org/reference/functions/download_url/ + */ + $timeout_seconds = 300; + $temp_file = download_url( $uploaded_file_url, $timeout_seconds ); + + /** + * Handle the error from download_url if it occurs + */ + if ( is_wp_error( $temp_file ) ) { + throw new UserError( esc_html__( 'Sorry, the URL for this file is invalid, it must be a valid URL', 'wp-graphql' ) ); + } + + /** + * Build the file data for side loading + */ + $file_data = [ + 'name' => $file_name, + 'type' => ! empty( $input['fileType'] ) ? $input['fileType'] : wp_check_filetype( $temp_file ), + 'tmp_name' => $temp_file, + 'error' => 0, + 'size' => filesize( $temp_file ), + ]; + + /** + * Tells WordPress to not look for the POST form fields that would normally be present as + * we downloaded the file from a remote server, so there will be no form fields + * The default is true + */ + $overrides = [ + 'test_form' => false, + ]; + + /** + * Insert the mediaItem and retrieve it's data + */ + $file = wp_handle_sideload( $file_data, $overrides ); + + /** + * Handle the error from wp_handle_sideload if it occurs + */ + if ( ! empty( $file['error'] ) ) { + throw new UserError( esc_html__( 'Sorry, the URL for this file is invalid, it must be a path to the mediaItem file', 'wp-graphql' ) ); + } + + /** + * Insert the mediaItem object and get the ID + */ + $media_item_args = MediaItemMutation::prepare_media_item( $input, $post_type_object, 'createMediaItem', $file ); + + /** + * Get the post parent and if it's not set, set it to 0 + */ + $attachment_parent_id = ! empty( $media_item_args['post_parent'] ) ? $media_item_args['post_parent'] : 0; + + /** + * Stop now if a user isn't allowed to edit the parent post + */ + $parent = get_post( $attachment_parent_id ); + + if ( null !== $parent ) { + $post_parent_type = get_post_type_object( $parent->post_type ); + + if ( empty( $post_parent_type ) ) { + throw new UserError( esc_html__( 'The parent of the Media Item is of an invalid type', 'wp-graphql' ) ); + } + + if ( 'attachment' !== $post_parent_type->name && ( ! isset( $post_parent_type->cap->edit_post ) || ! current_user_can( $post_parent_type->cap->edit_post, $attachment_parent_id ) ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to upload mediaItems assigned to this parent node', 'wp-graphql' ) ); + } + } + + /** + * Insert the mediaItem + * + * Required Argument defaults are set in the main MediaItemMutation.php if they aren't set + * by the user during input, they are: + * post_title (pulled from file if not entered) + * post_content (empty string if not entered) + * post_status (inherit if not entered) + * post_mime_type (pulled from the file if not entered in the mutation) + */ + $attachment_id = wp_insert_attachment( $media_item_args, $file['file'], $attachment_parent_id, true ); + + if ( is_wp_error( $attachment_id ) ) { + $error_message = $attachment_id->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } + + throw new UserError( esc_html__( 'The media item failed to create but no error was provided', 'wp-graphql' ) ); + } + + /** + * Check if the wp_generate_attachment_metadata method exists and include it if not + */ + require_once ABSPATH . 'wp-admin/includes/image.php'; + + /** + * Generate and update the mediaItem's metadata. + * If we make it this far the file and attachment + * have been validated and we will not receive any errors + */ + $attachment_data = wp_generate_attachment_metadata( $attachment_id, $file['file'] ); + wp_update_attachment_metadata( $attachment_id, $attachment_data ); + + /** + * Update alt text postmeta for mediaItem + */ + MediaItemMutation::update_additional_media_item_data( $attachment_id, $input, $post_type_object, 'createMediaItem', $context, $info ); + + return [ + 'postObjectId' => $attachment_id, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/MediaItemDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/MediaItemDelete.php new file mode 100644 index 00000000..64ed2651 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/MediaItemDelete.php @@ -0,0 +1,146 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The ID of the mediaItem to delete', 'wp-graphql' ), + ], + 'forceDelete' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the mediaItem should be force deleted instead of being moved to the trash', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return [ + 'deletedId' => [ + 'type' => 'ID', + 'description' => __( 'The ID of the deleted mediaItem', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + $deleted = (object) $payload['mediaItemObject']; + + return ! empty( $deleted->ID ) ? Relay::toGlobalId( 'post', $deleted->ID ) : null; + }, + ], + 'mediaItem' => [ + 'type' => 'MediaItem', + 'description' => __( 'The mediaItem before it was deleted', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + /** @var \WPGraphQL\Model\Post $deleted */ + $deleted = $payload['mediaItemObject']; + + return ! empty( $deleted->ID ) ? $deleted : null; + }, + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input ) { + // Get the database ID for the comment. + $media_item_id = Utils::get_database_id_from_id( $input['id'] ); + + /** + * Get the mediaItem object before deleting it + */ + $existing_media_item = ! empty( $media_item_id ) ? get_post( $media_item_id ) : null; + + // If there's no existing mediaItem, throw an exception. + if ( null === $existing_media_item ) { + throw new UserError( esc_html__( 'No mediaItem with that ID could be found to delete', 'wp-graphql' ) ); + } + + // Stop now if the post isn't a mediaItem. + if ( 'attachment' !== $existing_media_item->post_type ) { + // Translators: the placeholder is the post_type of the object being deleted + throw new UserError( esc_html( sprintf( __( 'Sorry, the item you are trying to delete is a %1%s, not a mediaItem', 'wp-graphql' ), $existing_media_item->post_type ) ) ); + } + + /** + * Stop now if a user isn't allowed to delete a mediaItem + */ + $post_type_object = get_post_type_object( 'attachment' ); + + if ( ! isset( $post_type_object->cap->delete_post ) || ! current_user_can( $post_type_object->cap->delete_post, $media_item_id ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to delete mediaItems', 'wp-graphql' ) ); + } + + /** + * Check if we should force delete or not + */ + $force_delete = ! empty( $input['forceDelete'] ) && true === $input['forceDelete']; + + /** + * If the mediaItem is already in the trash, and the forceDelete input was not passed, + * don't remove from the trash + */ + if ( 'trash' === $existing_media_item->post_status && true !== $force_delete ) { + // translators: the first placeholder is the post_type of the object being deleted and the second placeholder is the unique ID of that object + throw new UserError( esc_html( sprintf( __( 'The mediaItem with id %1$s is already in the trash. To remove from the trash, use the forceDelete input', 'wp-graphql' ), $input['id'] ) ) ); + } + + /** + * Delete the mediaItem. This will not throw false thanks to + * all of the above validation + */ + $deleted = wp_delete_attachment( (int) $media_item_id, $force_delete ); + + /** + * If the post was moved to the trash, spoof the object's status before returning it + */ + $existing_media_item->post_status = ( false !== $deleted && true !== $force_delete ) ? 'trash' : $existing_media_item->post_status; + + $media_item_before_delete = new Post( $existing_media_item ); + + /** + * Return the deletedId and the mediaItem before it was deleted + */ + return [ + 'mediaItemObject' => $media_item_before_delete, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/MediaItemUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/MediaItemUpdate.php new file mode 100644 index 00000000..a000f971 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/MediaItemUpdate.php @@ -0,0 +1,171 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + /** @var \WP_Post_Type $post_type_object */ + $post_type_object = get_post_type_object( 'attachment' ); + return array_merge( + MediaItemCreate::get_input_fields(), + [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + // translators: the placeholder is the name of the type of post object being updated + 'description' => sprintf( __( 'The ID of the %1$s object', 'wp-graphql' ), $post_type_object->graphql_single_name ), + ], + ] + ); + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return MediaItemCreate::get_output_fields(); + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input, AppContext $context, ResolveInfo $info ) { + $post_type_object = get_post_type_object( 'attachment' ); + + if ( empty( $post_type_object ) ) { + return null; + } + + // Get the database ID for the comment. + $media_item_id = Utils::get_database_id_from_id( $input['id'] ); + + /** + * Get the mediaItem object before deleting it + */ + $existing_media_item = ! empty( $media_item_id ) ? get_post( $media_item_id ) : null; + + $mutation_name = 'updateMediaItem'; + + /** + * If there's no existing mediaItem, throw an exception + */ + if ( null === $existing_media_item ) { + throw new UserError( esc_html__( 'No mediaItem with that ID could be found to update', 'wp-graphql' ) ); + } + + /** + * Stop now if the post isn't a mediaItem + */ + if ( $post_type_object->name !== $existing_media_item->post_type ) { + // translators: The placeholder is the ID of the mediaItem being edited + throw new UserError( esc_html( sprintf( __( 'The id %1$d is not of the type mediaItem', 'wp-graphql' ), $input['id'] ) ) ); + } + + /** + * Stop now if a user isn't allowed to edit mediaItems + */ + if ( ! isset( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->edit_posts ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to update mediaItems', 'wp-graphql' ) ); + } + + $author_id = absint( $existing_media_item->post_author ); + + /** + * If the mutation is setting the author to be someone other than the user making the request + * make sure they have permission to edit others posts + */ + if ( ! empty( $input['authorId'] ) ) { + // Ensure authorId is a valid databaseId. + $input['authorId'] = Utils::get_database_id_from_id( $input['authorId'] ); + // Use the new author for checks. + $author_id = $input['authorId']; + } + + /** + * Check to see if the existing_media_item author matches the current user, + * if not they need to be able to edit others posts to proceed + */ + if ( get_current_user_id() !== $author_id && ( ! isset( $post_type_object->cap->edit_others_posts ) || ! current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to update mediaItems as this user.', 'wp-graphql' ) ); + } + + /** + * Insert the post object and get the ID + */ + $post_args = MediaItemMutation::prepare_media_item( $input, $post_type_object, $mutation_name, false ); + $post_args['ID'] = $media_item_id; + + $clean_args = wp_slash( (array) $post_args ); + + if ( ! is_array( $clean_args ) || empty( $clean_args ) ) { + throw new UserError( esc_html__( 'The media item failed to update', 'wp-graphql' ) ); + } + + /** + * Insert the post and retrieve the ID + * + * This will not fail as long as we have an ID in $post_args + * Thanks to the validation above we will always have the ID + */ + $post_id = wp_update_post( $clean_args, true ); + + if ( is_wp_error( $post_id ) ) { + $error_message = $post_id->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } + + throw new UserError( esc_html__( 'The media item failed to update but no error was provided', 'wp-graphql' ) ); + } + + /** + * This updates additional data not part of the posts table (postmeta, terms, other relations, etc) + * + * The input for the postObjectMutation will be passed, along with the $new_post_id for the + * postObject that was updated so that relations can be set, meta can be updated, etc. + */ + MediaItemMutation::update_additional_media_item_data( $post_id, $input, $post_type_object, $mutation_name, $context, $info ); + + /** + * Return the payload + */ + return [ + 'postObjectId' => $post_id, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/PostObjectCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/PostObjectCreate.php new file mode 100644 index 00000000..bf99f77b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/PostObjectCreate.php @@ -0,0 +1,379 @@ +graphql_single_name ); + + register_graphql_mutation( + $mutation_name, + [ + 'inputFields' => self::get_input_fields( $post_type_object ), + 'outputFields' => self::get_output_fields( $post_type_object ), + 'mutateAndGetPayload' => self::mutate_and_get_payload( $post_type_object, $mutation_name ), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @param \WP_Post_Type $post_type_object The post type of the mutation. + * + * @return array + */ + public static function get_input_fields( $post_type_object ) { + $fields = [ + 'date' => [ + 'type' => 'String', + 'description' => __( 'The date of the object. Preferable to enter as year/month/day (e.g. 01/31/2017) as it will rearrange date as fit if it is not specified. Incomplete dates may have unintended results for example, "2017" as the input will use current date with timestamp 20:17 ', 'wp-graphql' ), + ], + 'menuOrder' => [ + 'type' => 'Int', + 'description' => __( 'A field used for ordering posts. This is typically used with nav menu items or for special ordering of hierarchical content types.', 'wp-graphql' ), + ], + 'password' => [ + 'type' => 'String', + 'description' => __( 'The password used to protect the content of the object', 'wp-graphql' ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => __( 'The slug of the object', 'wp-graphql' ), + ], + 'status' => [ + 'type' => 'PostStatusEnum', + 'description' => __( 'The status of the object', 'wp-graphql' ), + ], + ]; + + if ( post_type_supports( $post_type_object->name, 'author' ) ) { + $fields['authorId'] = [ + 'type' => 'ID', + 'description' => __( 'The userId to assign as the author of the object', 'wp-graphql' ), + ]; + } + + if ( post_type_supports( $post_type_object->name, 'comments' ) ) { + $fields['commentStatus'] = [ + 'type' => 'String', + 'description' => __( 'The comment status for the object', 'wp-graphql' ), + ]; + } + + if ( post_type_supports( $post_type_object->name, 'editor' ) ) { + $fields['content'] = [ + 'type' => 'String', + 'description' => __( 'The content of the object', 'wp-graphql' ), + ]; + } + + if ( post_type_supports( $post_type_object->name, 'excerpt' ) ) { + $fields['excerpt'] = [ + 'type' => 'String', + 'description' => __( 'The excerpt of the object', 'wp-graphql' ), + ]; + } + + if ( post_type_supports( $post_type_object->name, 'title' ) ) { + $fields['title'] = [ + 'type' => 'String', + 'description' => __( 'The title of the object', 'wp-graphql' ), + ]; + } + + if ( post_type_supports( $post_type_object->name, 'trackbacks' ) ) { + $fields['pinged'] = [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'URLs that have been pinged.', 'wp-graphql' ), + ]; + + $fields['pingStatus'] = [ + 'type' => 'String', + 'description' => __( 'The ping status for the object', 'wp-graphql' ), + ]; + + $fields['toPing'] = [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'URLs queued to be pinged.', 'wp-graphql' ), + ]; + } + + if ( $post_type_object->hierarchical || in_array( + $post_type_object->name, + [ + 'attachment', + 'revision', + ], + true + ) ) { + $fields['parentId'] = [ + 'type' => 'ID', + 'description' => __( 'The ID of the parent object', 'wp-graphql' ), + ]; + } + + if ( 'attachment' === $post_type_object->name ) { + $fields['mimeType'] = [ + 'type' => 'MimeTypeEnum', + 'description' => __( 'If the post is an attachment or a media file, this field will carry the corresponding MIME type. This field is equivalent to the value of WP_Post->post_mime_type and the post_mime_type column in the "post_objects" database table.', 'wp-graphql' ), + ]; + } + + /** @var \WP_Taxonomy[] $allowed_taxonomies */ + $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); + + foreach ( $allowed_taxonomies as $tax_object ) { + // If the taxonomy is in the array of taxonomies registered to the post_type + if ( in_array( $tax_object->name, get_object_taxonomies( $post_type_object->name ), true ) ) { + $fields[ $tax_object->graphql_plural_name ] = [ + 'description' => sprintf( + // translators: %1$s is the post type GraphQL name, %2$s is the taxonomy GraphQL name. + __( 'Set connections between the %1$s and %2$s', 'wp-graphql' ), + $post_type_object->graphql_single_name, + $tax_object->graphql_plural_name + ), + 'type' => ucfirst( $post_type_object->graphql_single_name ) . ucfirst( $tax_object->graphql_plural_name ) . 'Input', + ]; + } + } + + return $fields; + } + + /** + * Defines the mutation output field configuration. + * + * @param \WP_Post_Type $post_type_object The post type of the mutation. + * + * @return array + */ + public static function get_output_fields( WP_Post_Type $post_type_object ) { + return [ + $post_type_object->graphql_single_name => [ + 'type' => $post_type_object->graphql_single_name, + 'description' => __( 'The Post object mutation type.', 'wp-graphql' ), + 'resolve' => static function ( $payload, $_args, AppContext $context ) { + if ( empty( $payload['postObjectId'] ) || ! absint( $payload['postObjectId'] ) ) { + return null; + } + + return $context->get_loader( 'post' )->load_deferred( $payload['postObjectId'] ); + }, + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @param \WP_Post_Type $post_type_object The post type of the mutation. + * @param string $mutation_name The mutation name. + * + * @return callable + */ + public static function mutate_and_get_payload( $post_type_object, $mutation_name ) { + return static function ( $input, AppContext $context, ResolveInfo $info ) use ( $post_type_object, $mutation_name ) { + + /** + * Throw an exception if there's no input + */ + if ( ( empty( $post_type_object->name ) ) || ( empty( $input ) || ! is_array( $input ) ) ) { + throw new UserError( esc_html__( 'Mutation not processed. There was no input for the mutation or the post_type_object was invalid', 'wp-graphql' ) ); + } + + /** + * Stop now if a user isn't allowed to create a post + */ + if ( ! isset( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) { + // translators: the $post_type_object->graphql_plural_name placeholder is the name of the object being mutated + throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to create %1$s', 'wp-graphql' ), $post_type_object->graphql_plural_name ) ) ); + } + + /** + * If the post being created is being assigned to another user that's not the current user, make sure + * the current user has permission to edit others posts for this post_type + */ + if ( ! empty( $input['authorId'] ) ) { + // Ensure authorId is a valid databaseId. + $input['authorId'] = Utils::get_database_id_from_id( $input['authorId'] ); + + $author = ! empty( $input['authorId'] ) ? get_user_by( 'ID', $input['authorId'] ) : false; + + if ( false === $author ) { + throw new UserError( esc_html__( 'The provided `authorId` is not a valid user', 'wp-graphql' ) ); + } + + if ( get_current_user_id() !== $input['authorId'] && ( ! isset( $post_type_object->cap->edit_others_posts ) || ! current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { + // translators: the $post_type_object->graphql_plural_name placeholder is the name of the object being mutated + throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to create %1$s as this user', 'wp-graphql' ), $post_type_object->graphql_plural_name ) ) ); + } + } + + /** + * @todo: When we support assigning terms and setting posts as "sticky" we need to check permissions + * @see :https://github.com/WordPress/WordPress/blob/e357195ce303017d517aff944644a7a1232926f7/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L504-L506 + * @see : https://github.com/WordPress/WordPress/blob/e357195ce303017d517aff944644a7a1232926f7/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L496-L498 + */ + + /** + * Insert the post object and get the ID + */ + $post_args = PostObjectMutation::prepare_post_object( $input, $post_type_object, $mutation_name ); + + /** + * Filter the default post status to use when the post is initially created. Pass through a filter to + * allow other plugins to override the default (for example, Edit Flow, which provides control over + * customizing stati or various E-commerce plugins that make heavy use of custom stati) + * + * @param string $default_status The default status to be used when the post is initially inserted + * @param \WP_Post_Type $post_type_object The Post Type that is being inserted + * @param string $mutation_name The name of the mutation currently in progress + */ + $default_post_status = apply_filters( 'graphql_post_object_create_default_post_status', 'draft', $post_type_object, $mutation_name ); + + /** + * We want to cache the "post_status" and set the status later. We will set the initial status + * of the inserted post as the default status for the site, allow side effects to process with the + * inserted post (set term object connections, set meta input, sideload images if necessary, etc) + * Then will follow up with setting the status as what it was declared to be later + */ + $intended_post_status = ! empty( $post_args['post_status'] ) ? $post_args['post_status'] : $default_post_status; + + /** + * If the current user cannot publish posts but their intent was to publish, + * default the status to pending. + */ + if ( ( ! isset( $post_type_object->cap->publish_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) && ! in_array( + $intended_post_status, + [ + 'draft', + 'pending', + ], + true + ) ) { + $intended_post_status = 'pending'; + } + + /** + * Set the post_status as the default for the initial insert. The intended $post_status will be set after + * side effects are complete. + */ + $post_args['post_status'] = $default_post_status; + + $clean_args = wp_slash( (array) $post_args ); + + if ( ! is_array( $clean_args ) || empty( $clean_args ) ) { + throw new UserError( esc_html__( 'The object failed to create', 'wp-graphql' ) ); + } + + /** + * Insert the post and retrieve the ID + */ + $post_id = wp_insert_post( $clean_args, true ); + + /** + * Throw an exception if the post failed to create + */ + if ( is_wp_error( $post_id ) ) { + $error_message = $post_id->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } + + throw new UserError( esc_html__( 'The object failed to create but no error was provided', 'wp-graphql' ) ); + } + + /** + * This updates additional data not part of the posts table (postmeta, terms, other relations, etc) + * + * The input for the postObjectMutation will be passed, along with the $new_post_id for the + * postObject that was created so that relations can be set, meta can be updated, etc. + */ + PostObjectMutation::update_additional_post_object_data( $post_id, $input, $post_type_object, $mutation_name, $context, $info, $default_post_status, $intended_post_status ); + + /** + * Determine whether the intended status should be set or not. + * + * By filtering to false, the $intended_post_status will not be set at the completion of the mutation. + * + * This allows for side-effect actions to set the status later. For example, if a post + * was being created via a GraphQL Mutation, the post had additional required assets, such as images + * that needed to be sideloaded or some other semi-time-consuming side effect, those actions could + * be deferred (cron or whatever), and when those actions complete they could come back and set + * the $intended_status. + * + * @param boolean $should_set_intended_status Whether to set the intended post_status or not. Default true. + * @param \WP_Post_Type $post_type_object The Post Type Object for the post being mutated + * @param string $mutation_name The name of the mutation currently in progress + * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers + * @param string $intended_post_status The intended post_status the post should have according to the mutation input + * @param string $default_post_status The default status posts should use if an intended status wasn't set + */ + $should_set_intended_status = apply_filters( 'graphql_post_object_create_should_set_intended_post_status', true, $post_type_object, $mutation_name, $context, $info, $intended_post_status, $default_post_status ); + + /** + * If the intended post status and the default post status are not the same, + * update the post with the intended status now that side effects are complete. + */ + if ( $intended_post_status !== $default_post_status && true === $should_set_intended_status ) { + + /** + * If the post was deleted by a side effect action before getting here, + * don't proceed. + */ + $new_post = get_post( $post_id ); + if ( empty( $new_post ) ) { + throw new UserError( esc_html__( 'The status of the post could not be set', 'wp-graphql' ) ); + } + + /** + * If the $intended_post_status is different than the current status of the post + * proceed and update the status. + */ + if ( $intended_post_status !== $new_post->post_status ) { + $update_args = [ + 'ID' => $post_id, + 'post_status' => $intended_post_status, + // Prevent the post_date from being reset if the date was included in the create post $args + // see: https://core.trac.wordpress.org/browser/tags/4.9/src/wp-includes/post.php#L3637 + 'edit_date' => ! empty( $post_args['post_date'] ) ? $post_args['post_date'] : false, + ]; + + wp_update_post( $update_args ); + } + } + + /** + * Return the post object + */ + return [ + 'postObjectId' => $post_id, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/PostObjectDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/PostObjectDelete.php new file mode 100644 index 00000000..33489058 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/PostObjectDelete.php @@ -0,0 +1,167 @@ +graphql_single_name ); + + register_graphql_mutation( + $mutation_name, + [ + 'inputFields' => self::get_input_fields( $post_type_object ), + 'outputFields' => self::get_output_fields( $post_type_object ), + 'mutateAndGetPayload' => self::mutate_and_get_payload( $post_type_object, $mutation_name ), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @param \WP_Post_Type $post_type_object The post type of the mutation. + * + * @return array + */ + public static function get_input_fields( $post_type_object ) { + return [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + // translators: The placeholder is the name of the post's post_type being deleted + 'description' => sprintf( __( 'The ID of the %1$s to delete', 'wp-graphql' ), $post_type_object->graphql_single_name ), + ], + 'forceDelete' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object should be force deleted instead of being moved to the trash', 'wp-graphql' ), + ], + 'ignoreEditLock' => [ + 'type' => 'Boolean', + 'description' => __( 'Override the edit lock when another user is editing the post', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @param \WP_Post_Type $post_type_object The post type of the mutation. + * + * @return array + */ + public static function get_output_fields( WP_Post_Type $post_type_object ) { + return [ + 'deletedId' => [ + 'type' => 'ID', + 'description' => __( 'The ID of the deleted object', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + /** @var \WPGraphQL\Model\Post $deleted */ + $deleted = $payload['postObject']; + + return ! empty( $deleted->ID ) ? Relay::toGlobalId( 'post', (string) $deleted->ID ) : null; + }, + ], + $post_type_object->graphql_single_name => [ + 'type' => $post_type_object->graphql_single_name, + 'description' => __( 'The object before it was deleted', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + /** @var \WPGraphQL\Model\Post $deleted */ + $deleted = $payload['postObject']; + + return ! empty( $deleted->ID ) ? $deleted : null; + }, + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @param \WP_Post_Type $post_type_object The post type of the mutation. + * @param string $mutation_name The mutation name. + * + * @return callable + */ + public static function mutate_and_get_payload( WP_Post_Type $post_type_object, string $mutation_name ) { + return static function ( $input ) use ( $post_type_object ) { + // Get the database ID for the post. + $post_id = Utils::get_database_id_from_id( $input['id'] ); + + /** + * Stop now if a user isn't allowed to delete a post + */ + if ( ! isset( $post_type_object->cap->delete_post ) || ! current_user_can( $post_type_object->cap->delete_post, $post_id ) ) { + // translators: the $post_type_object->graphql_plural_name placeholder is the name of the object being mutated + throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to delete %1$s', 'wp-graphql' ), $post_type_object->graphql_plural_name ) ) ); + } + + /** + * Check if we should force delete or not + */ + $force_delete = ! empty( $input['forceDelete'] ) && true === $input['forceDelete']; + + /** + * Get the post object before deleting it + */ + $post_before_delete = ! empty( $post_id ) ? get_post( $post_id ) : null; + + if ( empty( $post_before_delete ) ) { + throw new UserError( esc_html__( 'The post could not be deleted', 'wp-graphql' ) ); + } + + $post_before_delete = new Post( $post_before_delete ); + + /** + * If the post is already in the trash, and the forceDelete input was not passed, + * don't remove from the trash + */ + if ( 'trash' === $post_before_delete->post_status && true !== $force_delete ) { + // Translators: the first placeholder is the post_type of the object being deleted and the second placeholder is the unique ID of that object + throw new UserError( esc_html( sprintf( __( 'The %1$s with id %2$s is already in the trash. To remove from the trash, use the forceDelete input', 'wp-graphql' ), $post_type_object->graphql_single_name, $post_id ) ) ); + } + + // If post is locked and the override is not specified, do not allow the edit + $locked_user_id = PostObjectMutation::check_edit_lock( $post_id, $input ); + if ( false !== $locked_user_id ) { + $user = get_userdata( (int) $locked_user_id ); + $display_name = isset( $user->display_name ) ? $user->display_name : 'unknown'; + /* translators: %s: User's display name. */ + throw new UserError( esc_html( sprintf( __( 'You cannot delete this item. %s is currently editing.', 'wp-graphql' ), $display_name ) ) ); + } + + /** + * Delete the post + */ + $deleted = wp_delete_post( (int) $post_id, $force_delete ); + + /** + * If the post was moved to the trash, spoof the object's status before returning it + */ + $post_before_delete->post_status = ( false !== $deleted && true !== $force_delete ) ? 'trash' : $post_before_delete->post_status; + + /** + * Return the deletedId and the object before it was deleted + */ + return [ + 'postObject' => $post_before_delete, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/PostObjectUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/PostObjectUpdate.php new file mode 100644 index 00000000..d8d4776c --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/PostObjectUpdate.php @@ -0,0 +1,222 @@ +graphql_single_name ); + + register_graphql_mutation( + $mutation_name, + [ + 'inputFields' => self::get_input_fields( $post_type_object ), + 'outputFields' => self::get_output_fields( $post_type_object ), + 'mutateAndGetPayload' => self::mutate_and_get_payload( $post_type_object, $mutation_name ), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @param \WP_Post_Type $post_type_object The post type of the mutation. + * + * @return array + */ + public static function get_input_fields( $post_type_object ) { + return array_merge( + PostObjectCreate::get_input_fields( $post_type_object ), + [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + // translators: the placeholder is the name of the type of post object being updated + 'description' => sprintf( __( 'The ID of the %1$s object', 'wp-graphql' ), $post_type_object->graphql_single_name ), + ], + 'ignoreEditLock' => [ + 'type' => 'Boolean', + 'description' => __( 'Override the edit lock when another user is editing the post', 'wp-graphql' ), + ], + ] + ); + } + + /** + * Defines the mutation output field configuration. + * + * @param \WP_Post_Type $post_type_object The post type of the mutation. + * + * @return array + */ + public static function get_output_fields( $post_type_object ) { + return PostObjectCreate::get_output_fields( $post_type_object ); + } + + /** + * Defines the mutation data modification closure. + * + * @param \WP_Post_Type $post_type_object The post type of the mutation. + * @param string $mutation_name The mutation name. + * + * @return callable + */ + public static function mutate_and_get_payload( $post_type_object, $mutation_name ) { + return static function ( $input, AppContext $context, ResolveInfo $info ) use ( $post_type_object, $mutation_name ) { + // Get the database ID for the comment. + $post_id = Utils::get_database_id_from_id( $input['id'] ); + $existing_post = ! empty( $post_id ) ? get_post( $post_id ) : null; + + /** + * If there's no existing post, throw an exception + */ + if ( null === $existing_post ) { + // translators: the placeholder is the name of the type of post being updated + throw new UserError( esc_html( sprintf( __( 'No %1$s could be found to update', 'wp-graphql' ), $post_type_object->graphql_single_name ) ) ); + } + + if ( $post_type_object->name !== $existing_post->post_type ) { + // translators: The first placeholder is an ID and the second placeholder is the name of the post type being edited + throw new UserError( esc_html( sprintf( __( 'The id %1$d is not of the type "%2$s"', 'wp-graphql' ), $post_id, $post_type_object->name ) ) ); + } + + /** + * Stop now if a user isn't allowed to edit posts + */ + if ( ! isset( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->edit_posts ) ) { + // translators: the $post_type_object->graphql_single_name placeholder is the name of the object being mutated + throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to update a %1$s', 'wp-graphql' ), $post_type_object->graphql_single_name ) ) ); + } + + /** + * If the existing post was authored by another author, ensure the requesting user has permission to edit it + */ + if ( get_current_user_id() !== (int) $existing_post->post_author && ( ! isset( $post_type_object->cap->edit_others_posts ) || true !== current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { + // translators: the $post_type_object->graphql_single_name placeholder is the name of the object being mutated + throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to update another author\'s %1$s', 'wp-graphql' ), $post_type_object->graphql_single_name ) ) ); + } + + $author_id = absint( $existing_post->post_author ); + + /** + * If the mutation is setting the author to be someone other than the user making the request + * make sure they have permission to edit others posts + */ + if ( ! empty( $input['authorId'] ) ) { + // Ensure authorId is a valid databaseId. + $input['authorId'] = Utils::get_database_id_from_id( $input['authorId'] ); + // Use the new author for checks. + $author_id = $input['authorId']; + } + + /** + * Check to see if the existing_media_item author matches the current user, + * if not they need to be able to edit others posts to proceed + */ + if ( get_current_user_id() !== $author_id && ( ! isset( $post_type_object->cap->edit_others_posts ) || ! current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { + // translators: the $post_type_object->graphql_single_name placeholder is the name of the object being mutated + throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to update %1$s as this user.', 'wp-graphql' ), $post_type_object->graphql_plural_name ) ) ); + } + + // If post is locked and the override is not specified, do not allow the edit + $locked_user_id = PostObjectMutation::check_edit_lock( $post_id, $input ); + if ( false !== $locked_user_id ) { + $user = get_userdata( (int) $locked_user_id ); + $display_name = isset( $user->display_name ) ? $user->display_name : 'unknown'; + /* translators: %s: User's display name. */ + throw new UserError( esc_html( sprintf( __( 'You cannot update this item. %s is currently editing.', 'wp-graphql' ), $display_name ) ) ); + } + + /** + * @todo: when we add support for making posts sticky, we should check permissions to make sure users can make posts sticky + * @see : https://github.com/WordPress/WordPress/blob/e357195ce303017d517aff944644a7a1232926f7/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L640-L642 + */ + + /** + * @todo: when we add support for assigning terms to posts, we should check permissions to make sure they can assign terms + * @see : https://github.com/WordPress/WordPress/blob/e357195ce303017d517aff944644a7a1232926f7/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L644-L646 + */ + + /** + * Insert the post object and get the ID + */ + $post_args = PostObjectMutation::prepare_post_object( $input, $post_type_object, $mutation_name ); + $post_args['ID'] = $post_id; + + $clean_args = wp_slash( (array) $post_args ); + + if ( ! is_array( $clean_args ) || empty( $clean_args ) ) { + throw new UserError( esc_html__( 'The object failed to update.', 'wp-graphql' ) ); + } + + /** + * Insert the post and retrieve the ID + */ + $updated_post_id = wp_update_post( $clean_args, true ); + + /** + * Throw an exception if the post failed to update + */ + if ( is_wp_error( $updated_post_id ) ) { + $error_message = $updated_post_id->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } + + throw new UserError( esc_html__( 'The object failed to update but no error was provided', 'wp-graphql' ) ); + } + + /** + * Fires after a single term is created or updated via a GraphQL mutation + * + * The dynamic portion of the hook name, `$taxonomy->name` refers to the taxonomy of the term being mutated + * + * @param int $post_id Inserted post ID + * @param \WP_Post_Type $post_type_object The Post Type object for the post being mutated + * @param array $args The args used to insert the term + * @param string $mutation_name The name of the mutation being performed + */ + do_action( 'graphql_insert_post_object', absint( $post_id ), $post_type_object, $post_args, $mutation_name ); + + /** + * Fires after a single term is created or updated via a GraphQL mutation + * + * The dynamic portion of the hook name, `$taxonomy->name` refers to the taxonomy of the term being mutated + * + * @param int $post_id Inserted post ID + * @param array $args The args used to insert the term + * @param string $mutation_name The name of the mutation being performed + */ + do_action( "graphql_insert_{$post_type_object->name}", absint( $post_id ), $post_args, $mutation_name ); + + /** + * This updates additional data not part of the posts table (postmeta, terms, other relations, etc) + * + * The input for the postObjectMutation will be passed, along with the $new_post_id for the + * postObject that was updated so that relations can be set, meta can be updated, etc. + */ + PostObjectMutation::update_additional_post_object_data( (int) $post_id, $input, $post_type_object, $mutation_name, $context, $info ); + + /** + * Return the payload + */ + return [ + 'postObjectId' => $post_id, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/ResetUserPassword.php b/lib/wp-graphql-1.17.0/src/Mutation/ResetUserPassword.php new file mode 100644 index 00000000..249cf8e8 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/ResetUserPassword.php @@ -0,0 +1,114 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return [ + 'key' => [ + 'type' => 'String', + 'description' => __( 'Password reset key', 'wp-graphql' ), + ], + 'login' => [ + 'type' => 'String', + 'description' => __( 'The user\'s login (username).', 'wp-graphql' ), + ], + 'password' => [ + 'type' => 'String', + 'description' => __( 'The new password.', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return UserCreate::get_output_fields(); + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input, AppContext $context ) { + if ( empty( $input['key'] ) ) { + throw new UserError( esc_html__( 'A password reset key is required.', 'wp-graphql' ) ); + } + + if ( empty( $input['login'] ) ) { + throw new UserError( esc_html__( 'A user login is required.', 'wp-graphql' ) ); + } + + if ( empty( $input['password'] ) ) { + throw new UserError( esc_html__( 'A new password is required.', 'wp-graphql' ) ); + } + + $user = check_password_reset_key( $input['key'], $input['login'] ); + + /** + * If the password reset key check returns an error + */ + if ( is_wp_error( $user ) ) { + + /** + * Determine the message to return + */ + if ( 'expired_key' === $user->get_error_code() ) { + $message = __( 'Password reset link has expired.', 'wp-graphql' ); + } else { + $message = __( 'Password reset link is invalid.', 'wp-graphql' ); + } + + /** + * Throw an error with the message + */ + throw new UserError( esc_html( $message ) ); + } + + /** + * Reset the password + */ + reset_password( $user, $input['password'] ); + + // Log in the user, since they already authenticated with the reset key. + wp_set_current_user( $user->ID ); + + /** + * Return the user ID + */ + return [ + 'id' => $user->ID, + 'user' => $context->get_loader( 'user' )->load_deferred( $user->ID ), + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/SendPasswordResetEmail.php b/lib/wp-graphql-1.17.0/src/Mutation/SendPasswordResetEmail.php new file mode 100644 index 00000000..aca4150e --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/SendPasswordResetEmail.php @@ -0,0 +1,258 @@ + __( 'Send password reset email to user', 'wp-graphql' ), + 'inputFields' => self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields(): array { + return [ + 'username' => [ + 'type' => [ + 'non_null' => 'String', + ], + 'description' => __( 'A string that contains the user\'s username or email address.', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields(): array { + return [ + 'user' => [ + 'type' => 'User', + 'description' => __( 'The user that the password reset email was sent to', 'wp-graphql' ), + 'deprecationReason' => __( 'This field will be removed in a future version of WPGraphQL', 'wp-graphql' ), + 'resolve' => static function ( $payload, $args, AppContext $context ) { + return ! empty( $payload['id'] ) ? $context->get_loader( 'user' )->load_deferred( $payload['id'] ) : null; + }, + ], + 'success' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the mutation completed successfully. This does NOT necessarily mean that an email was sent.', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload(): callable { + return static function ( $input ) { + if ( ! self::was_username_provided( $input ) ) { + throw new UserError( esc_html__( 'Enter a username or email address.', 'wp-graphql' ) ); + } + + // We obsfucate the actual success of this mutation to prevent user enumeration. + $payload = [ + 'success' => true, + 'id' => null, + ]; + + $user_data = self::get_user_data( $input['username'] ); + + if ( ! $user_data ) { + graphql_debug( self::get_user_not_found_error_message( $input['username'] ) ); + + return $payload; + } + + // Get the password reset key. + $key = get_password_reset_key( $user_data ); + if ( is_wp_error( $key ) ) { + graphql_debug( __( 'Unable to generate a password reset key.', 'wp-graphql' ) ); + + return $payload; + } + + // Mail the reset key. + $subject = self::get_email_subject( $user_data ); + $message = self::get_email_message( $user_data, $key ); + + $email_sent = wp_mail( // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_mail_wp_mail + $user_data->user_email, + wp_specialchars_decode( $subject ), + $message + ); + + // wp_mail can return a wp_error, but the docblock for it in WP Core is incorrect. + // phpstan should ignore this check. + // @phpstan-ignore-next-line + if ( is_wp_error( $email_sent ) ) { + graphql_debug( __( 'The email could not be sent.', 'wp-graphql' ) . "
\n" . __( 'Possible reason: your host may have disabled the mail() function.', 'wp-graphql' ) ); + + return $payload; + } + + /** + * Return the ID of the user + */ + return [ + 'id' => $user_data->ID, + 'success' => true, + ]; + }; + } + + /** + * Was a username or email address provided? + * + * @param array $input The input args. + * + * @return bool + */ + private static function was_username_provided( $input ) { + return ! empty( $input['username'] ) && is_string( $input['username'] ); + } + + /** + * Get WP_User object representing this user + * + * @param string $username The user's username or email address. + * + * @return \WP_User|false WP_User object on success, false on failure. + */ + private static function get_user_data( $username ) { + if ( self::is_email_address( $username ) ) { + $username = wp_unslash( $username ); + + if ( ! is_string( $username ) ) { + return false; + } + + return get_user_by( 'email', trim( $username ) ); + } + + return get_user_by( 'login', trim( $username ) ); + } + + /** + * Get the error message indicating why the user wasn't found + * + * @param string $username The user's username or email address. + * + * @return string + */ + private static function get_user_not_found_error_message( string $username ) { + if ( self::is_email_address( $username ) ) { + return __( 'There is no user registered with that email address.', 'wp-graphql' ); + } + + return __( 'Invalid username.', 'wp-graphql' ); + } + + /** + * Is the provided username arg an email address? + * + * @param string $username The user's username or email address. + * + * @return bool + */ + private static function is_email_address( string $username ) { + return (bool) strpos( $username, '@' ); + } + + /** + * Get the subject of the password reset email + * + * @param \WP_User $user_data User data + * + * @return string + */ + private static function get_email_subject( $user_data ) { + /* translators: Password reset email subject. %s: Site name */ + $title = sprintf( __( '[%s] Password Reset', 'wp-graphql' ), self::get_site_name() ); + + /** + * Filters the subject of the password reset email. + * + * @param string $title Default email title. + * @param string $user_login The username for the user. + * @param \WP_User $user_data WP_User object. + */ + return apply_filters( 'retrieve_password_title', $title, $user_data->user_login, $user_data ); + } + + /** + * Get the site name. + * + * @return string + */ + private static function get_site_name() { + if ( is_multisite() ) { + $network = get_network(); + if ( isset( $network->site_name ) ) { + return $network->site_name; + } + } + + /* + * The blogname option is escaped with esc_html on the way into the database + * in sanitize_option we want to reverse this for the plain text arena of emails. + */ + + return wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); + } + + /** + * Get the message body of the password reset email + * + * @param \WP_User $user_data User data + * @param string $key Password reset key + * + * @return string + */ + private static function get_email_message( $user_data, $key ) { + $message = __( 'Someone has requested a password reset for the following account:', 'wp-graphql' ) . "\r\n\r\n"; + /* translators: %s: site name */ + $message .= sprintf( __( 'Site Name: %s', 'wp-graphql' ), self::get_site_name() ) . "\r\n\r\n"; + /* translators: %s: user login */ + $message .= sprintf( __( 'Username: %s', 'wp-graphql' ), $user_data->user_login ) . "\r\n\r\n"; + $message .= __( 'If this was a mistake, just ignore this email and nothing will happen.', 'wp-graphql' ) . "\r\n\r\n"; + $message .= __( 'To reset your password, visit the following address:', 'wp-graphql' ) . "\r\n\r\n"; + $message .= '<' . network_site_url( "wp-login.php?action=rp&key={$key}&login=" . rawurlencode( $user_data->user_login ), 'login' ) . ">\r\n"; + + /** + * Filters the message body of the password reset mail. + * + * If the filtered message is empty, the password reset email will not be sent. + * + * @param string $message Default mail message. + * @param string $key The activation key. + * @param string $user_login The username for the user. + * @param \WP_User $user_data WP_User object. + */ + return apply_filters( 'retrieve_password_message', $message, $key, $user_data->user_login, $user_data ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/TermObjectCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/TermObjectCreate.php new file mode 100644 index 00000000..04cf02b1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/TermObjectCreate.php @@ -0,0 +1,197 @@ +graphql_single_name ); + + register_graphql_mutation( + $mutation_name, + [ + 'inputFields' => array_merge( + self::get_input_fields( $taxonomy ), + [ + 'name' => [ + 'type' => [ + 'non_null' => 'String', + ], + // translators: The placeholder is the name of the taxonomy for the object being mutated + 'description' => sprintf( __( 'The name of the %1$s object to mutate', 'wp-graphql' ), $taxonomy->name ), + ], + ] + ), + 'outputFields' => self::get_output_fields( $taxonomy ), + 'mutateAndGetPayload' => self::mutate_and_get_payload( $taxonomy, $mutation_name ), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. + * + * @return array + */ + public static function get_input_fields( WP_Taxonomy $taxonomy ) { + $fields = [ + 'aliasOf' => [ + 'type' => 'String', + // translators: The placeholder is the name of the taxonomy for the object being mutated + 'description' => sprintf( __( 'The slug that the %1$s will be an alias of', 'wp-graphql' ), $taxonomy->name ), + ], + 'description' => [ + 'type' => 'String', + // translators: The placeholder is the name of the taxonomy for the object being mutated + 'description' => sprintf( __( 'The description of the %1$s object', 'wp-graphql' ), $taxonomy->name ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => __( 'If this argument exists then the slug will be checked to see if it is not an existing valid term. If that check succeeds (it is not a valid term), then it is added and the term id is given. If it fails, then a check is made to whether the taxonomy is hierarchical and the parent argument is not empty. If the second check succeeds, the term will be inserted and the term id will be given. If the slug argument is empty, then it will be calculated from the term name.', 'wp-graphql' ), + ], + ]; + + /** + * Add a parentId field to hierarchical taxonomies to allow parents to be set + */ + if ( true === $taxonomy->hierarchical ) { + $fields['parentId'] = [ + 'type' => 'ID', + // translators: The placeholder is the name of the taxonomy for the object being mutated + 'description' => sprintf( __( 'The ID of the %1$s that should be set as the parent', 'wp-graphql' ), $taxonomy->name ), + ]; + } + + return $fields; + } + + /** + * Defines the mutation output field configuration. + * + * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. + * + * @return array + */ + public static function get_output_fields( WP_Taxonomy $taxonomy ) { + return [ + $taxonomy->graphql_single_name => [ + 'type' => $taxonomy->graphql_single_name, + // translators: Placeholder is the name of the taxonomy + 'description' => sprintf( __( 'The created %s', 'wp-graphql' ), $taxonomy->name ), + 'resolve' => static function ( $payload, $_args, AppContext $context ) { + $id = isset( $payload['termId'] ) ? absint( $payload['termId'] ) : null; + + return $context->get_loader( 'term' )->load_deferred( $id ); + }, + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. + * @param string $mutation_name The name of the mutation. + * + * @return callable + */ + public static function mutate_and_get_payload( WP_Taxonomy $taxonomy, string $mutation_name ) { + return static function ( $input, AppContext $context, ResolveInfo $info ) use ( $taxonomy, $mutation_name ) { + + /** + * Ensure the user can edit_terms + */ + if ( ! isset( $taxonomy->cap->edit_terms ) || ! current_user_can( $taxonomy->cap->edit_terms ) ) { + // translators: the $taxonomy->graphql_plural_name placeholder is the name of the object being mutated + throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to create %1$s', 'wp-graphql' ), $taxonomy->graphql_plural_name ) ) ); + } + + /** + * Prepare the object for insertion + */ + $args = TermObjectMutation::prepare_object( $input, $taxonomy, $mutation_name ); + + /** + * Ensure a name was provided + */ + if ( empty( $args['name'] ) ) { + // translators: The placeholder is the name of the taxonomy of the term being mutated + throw new UserError( esc_html( sprintf( __( 'A name is required to create a %1$s', 'wp-graphql' ), $taxonomy->name ) ) ); + } + + $term_name = wp_slash( $args['name'] ); + + if ( ! is_string( $term_name ) ) { + // translators: The placeholder is the name of the taxonomy of the term being mutated + throw new UserError( esc_html( sprintf( __( 'A valid name is required to create a %1$s', 'wp-graphql' ), $taxonomy->name ) ) ); + } + + /** + * Insert the term + */ + $term = wp_insert_term( $term_name, $taxonomy->name, wp_slash( (array) $args ) ); + + /** + * If it was an error, return the message as an exception + */ + if ( is_wp_error( $term ) ) { + $error_message = $term->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } else { + throw new UserError( esc_html__( 'The object failed to update but no error was provided', 'wp-graphql' ) ); + } + } + + /** + * If the response to creating the term didn't respond with a term_id, throw an exception + */ + if ( empty( $term['term_id'] ) ) { + throw new UserError( esc_html__( 'The object failed to create', 'wp-graphql' ) ); + } + + /** + * Fires after a single term is created or updated via a GraphQL mutation + * + * @param int $term_id Inserted term object + * @param \WP_Taxonomy $taxonomy The taxonomy of the term being updated + * @param array $args The args used to insert the term + * @param string $mutation_name The name of the mutation being performed + * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the resolve tree + */ + do_action( 'graphql_insert_term', $term['term_id'], $taxonomy, $args, $mutation_name, $context, $info ); + + /** + * Fires after a single term is created or updated via a GraphQL mutation + * + * The dynamic portion of the hook name, `$taxonomy->name` refers to the taxonomy of the term being mutated + * + * @param int $term_id Inserted term object + * @param array $args The args used to insert the term + * @param string $mutation_name The name of the mutation being performed + * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the resolve tree + */ + do_action( "graphql_insert_{$taxonomy->name}", $term['term_id'], $args, $mutation_name, $context, $info ); + + return [ + 'termId' => $term['term_id'], + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/TermObjectDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/TermObjectDelete.php new file mode 100644 index 00000000..9d512444 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/TermObjectDelete.php @@ -0,0 +1,153 @@ +graphql_single_name ); + + register_graphql_mutation( + $mutation_name, + [ + 'inputFields' => self::get_input_fields( $taxonomy ), + 'outputFields' => self::get_output_fields( $taxonomy ), + 'mutateAndGetPayload' => self::mutate_and_get_payload( $taxonomy, $mutation_name ), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. + * + * @return array + */ + public static function get_input_fields( WP_Taxonomy $taxonomy ) { + return [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + // translators: The placeholder is the name of the taxonomy for the term being deleted + 'description' => sprintf( __( 'The ID of the %1$s to delete', 'wp-graphql' ), $taxonomy->graphql_single_name ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. + * + * @return array + */ + public static function get_output_fields( WP_Taxonomy $taxonomy ) { + return [ + 'deletedId' => [ + 'type' => 'ID', + 'description' => __( 'The ID of the deleted object', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + $deleted = (object) $payload['termObject']; + + return ! empty( $deleted->term_id ) ? Relay::toGlobalId( 'term', $deleted->term_id ) : null; + }, + ], + $taxonomy->graphql_single_name => [ + 'type' => $taxonomy->graphql_single_name, + 'description' => __( 'The deleted term object', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + return new Term( $payload['termObject'] ); + }, + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. + * @param string $mutation_name The name of the mutation. + * + * @return callable + */ + public static function mutate_and_get_payload( WP_Taxonomy $taxonomy, string $mutation_name ) { + return static function ( $input ) use ( $taxonomy ) { + // Get the database ID for the comment. + $term_id = Utils::get_database_id_from_id( $input['id'] ); + + if ( empty( $term_id ) ) { + // Translators: The placeholder is the name of the taxonomy for the term being deleted + throw new UserError( esc_html( sprintf( __( 'The ID for the %1$s was not valid', 'wp-graphql' ), $taxonomy->graphql_single_name ) ) ); + } + + /** + * Get the term before deleting it + */ + $term_object = get_term( $term_id, $taxonomy->name ); + + if ( ! $term_object instanceof \WP_Term ) { + throw new UserError( esc_html__( 'The ID passed is invalid', 'wp-graphql' ) ); + } + + /** + * Ensure the type for the Global ID matches the type being mutated + */ + if ( $taxonomy->name !== $term_object->taxonomy ) { + // Translators: The placeholder is the name of the taxonomy for the term being edited + throw new UserError( esc_html( sprintf( __( 'The ID passed is not for a %1$s object', 'wp-graphql' ), $taxonomy->graphql_single_name ) ) ); + } + + /** + * Ensure the user can delete terms of this taxonomy + */ + if ( ! current_user_can( 'delete_term', $term_object->term_id ) ) { + // Translators: The placeholder is the name of the taxonomy for the term being deleted + throw new UserError( esc_html( sprintf( __( 'You do not have permission to delete %1$s', 'wp-graphql' ), $taxonomy->graphql_plural_name ) ) ); + } + + /** + * Delete the term and get the response + */ + $deleted = wp_delete_term( $term_id, $taxonomy->name ); + + /** + * If there was an error deleting the term, get the error message and return it + */ + if ( is_wp_error( $deleted ) ) { + $error_message = $deleted->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } else { + // Translators: The placeholder is the name of the taxonomy for the term being deleted + throw new UserError( esc_html( sprintf( __( 'The %1$s failed to delete but no error was provided', 'wp-graphql' ), $taxonomy->name ) ) ); + } + } + + /** + * Return the term object that was retrieved prior to deletion + */ + return [ + 'termObject' => $term_object, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/TermObjectUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/TermObjectUpdate.php new file mode 100644 index 00000000..d292690d --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/TermObjectUpdate.php @@ -0,0 +1,182 @@ +graphql_single_name ); + register_graphql_mutation( + $mutation_name, + [ + 'inputFields' => self::get_input_fields( $taxonomy ), + 'outputFields' => self::get_output_fields( $taxonomy ), + 'mutateAndGetPayload' => self::mutate_and_get_payload( $taxonomy, $mutation_name ), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. + * + * @return array + */ + public static function get_input_fields( WP_Taxonomy $taxonomy ) { + return array_merge( + TermObjectCreate::get_input_fields( $taxonomy ), + [ + 'name' => [ + 'type' => 'String', + // Translators: The placeholder is the name of the taxonomy for the object being mutated + 'description' => sprintf( __( 'The name of the %1$s object to mutate', 'wp-graphql' ), $taxonomy->name ), + ], + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + // Translators: The placeholder is the taxonomy of the term being updated + 'description' => sprintf( __( 'The ID of the %1$s object to update', 'wp-graphql' ), $taxonomy->graphql_single_name ), + ], + ] + ); + } + + /** + * Defines the mutation output field configuration. + * + * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. + * + * @return array + */ + public static function get_output_fields( WP_Taxonomy $taxonomy ) { + return TermObjectCreate::get_output_fields( $taxonomy ); + } + + /** + * Defines the mutation data modification closure. + * + * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. + * @param string $mutation_name The name of the mutation. + * + * @return callable + */ + public static function mutate_and_get_payload( WP_Taxonomy $taxonomy, $mutation_name ) { + return static function ( $input, AppContext $context, ResolveInfo $info ) use ( $taxonomy, $mutation_name ) { + $term_id = Utils::get_database_id_from_id( $input['id'] ); + + /** + * Ensure the type for the Global ID matches the type being mutated + */ + if ( empty( $term_id ) ) { + // Translators: The placeholder is the name of the taxonomy for the term being edited + throw new UserError( esc_html( sprintf( __( 'The ID passed is not for a %1$s object', 'wp-graphql' ), $taxonomy->graphql_single_name ) ) ); + } + + /** + * Get the existing term + */ + $existing_term = get_term( $term_id, $taxonomy->name ); + + /** + * If there was an error getting the existing term, return the error message + */ + if ( ! $existing_term instanceof \WP_Term ) { + if ( is_wp_error( $existing_term ) ) { + $error_message = $existing_term->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } else { + // Translators: The placeholder is the name of the taxonomy for the term being deleted + throw new UserError( esc_html( sprintf( __( 'The %1$s node failed to update', 'wp-graphql' ), $taxonomy->name ) ) ); + } + } + + // Translators: The placeholder is the name of the taxonomy for the term being deleted + throw new UserError( esc_html( sprintf( __( 'The %1$s node failed to update', 'wp-graphql' ), $taxonomy->name ) ) ); + } + + if ( $taxonomy->name !== $existing_term->taxonomy ) { + // translators: The first placeholder is an ID and the second placeholder is the name of the post type being edited + throw new UserError( esc_html( sprintf( __( 'The id %1$d is not of the type "%2$s"', 'wp-graphql' ), $term_id, $taxonomy->name ) ) ); + } + + /** + * Ensure the user has permission to edit terms + */ + if ( ! current_user_can( 'edit_term', $existing_term->term_id ) ) { + // Translators: The placeholder is the name of the taxonomy for the term being deleted + throw new UserError( esc_html( sprintf( __( 'You do not have permission to update %1$s', 'wp-graphql' ), $taxonomy->graphql_plural_name ) ) ); + } + + /** + * Prepare the $args for mutation + */ + $args = TermObjectMutation::prepare_object( $input, $taxonomy, $mutation_name ); + + if ( ! empty( $args ) ) { + + /** + * Update the term + */ + $update = wp_update_term( $existing_term->term_id, $taxonomy->name, wp_slash( (array) $args ) ); + + /** + * Respond with any errors + */ + if ( is_wp_error( $update ) ) { + // Translators: the placeholder is the name of the taxonomy + throw new UserError( esc_html( sprintf( __( 'The %1$s failed to update', 'wp-graphql' ), $taxonomy->name ) ) ); + } + } + + /** + * Fires an action when a term is updated via a GraphQL Mutation + * + * @param int $term_id The ID of the term object that was mutated + * @param \WP_Taxonomy $taxonomy The taxonomy of the term being updated + * @param array $args The args used to update the term + * @param string $mutation_name The name of the mutation being performed (create, update, delete, etc) + * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the resolve tree + */ + do_action( 'graphql_update_term', $existing_term->term_id, $taxonomy, $args, $mutation_name, $context, $info ); + + /** + * Fires an action when a term is updated via a GraphQL Mutation + * + * @param int $term_id The ID of the term object that was mutated + * @param array $args The args used to update the term + * @param string $mutation_name The name of the mutation being performed (create, update, delete, etc) + * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the resolve tree + */ + do_action( "graphql_update_{$taxonomy->name}", $existing_term->term_id, $args, $mutation_name, $context, $info ); + + /** + * Return the payload + */ + return [ + 'termId' => $existing_term->term_id, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UpdateSettings.php b/lib/wp-graphql-1.17.0/src/Mutation/UpdateSettings.php new file mode 100644 index 00000000..e821b766 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/UpdateSettings.php @@ -0,0 +1,221 @@ + $input_fields, + 'outputFields' => $output_fields, + 'mutateAndGetPayload' => static function ( $input ) use ( $type_registry ) { + return self::mutate_and_get_payload( $input, $type_registry ); + }, + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry + * + * @return array + */ + public static function get_input_fields( TypeRegistry $type_registry ) { + $allowed_settings = DataSource::get_allowed_settings( $type_registry ); + + $input_fields = []; + + if ( ! empty( $allowed_settings ) ) { + + /** + * Loop through the $allowed_settings and build fields + * for the individual settings + */ + foreach ( $allowed_settings as $key => $setting ) { + if ( ! isset( $setting['type'] ) || ! $type_registry->get_type( $setting['type'] ) ) { + continue; + } + + /** + * Determine if the individual setting already has a + * REST API name, if not use the option name. + * Sanitize the field name to be camelcase + */ + if ( ! empty( $setting['show_in_rest']['name'] ) ) { + $individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $setting['show_in_rest']['name'], '_' ) ) ); + } else { + $individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $key, '_' ) ) ); + } + + $replaced_setting_key = graphql_format_name( $individual_setting_key, ' ', '/[^a-zA-Z0-9 -]/' ); + + if ( ! empty( $replaced_setting_key ) ) { + $individual_setting_key = $replaced_setting_key; + } + + $individual_setting_key = lcfirst( $individual_setting_key ); + $individual_setting_key = lcfirst( str_replace( '_', ' ', ucwords( $individual_setting_key, '_' ) ) ); + $individual_setting_key = lcfirst( str_replace( '-', ' ', ucwords( $individual_setting_key, '_' ) ) ); + $individual_setting_key = lcfirst( str_replace( ' ', '', ucwords( $individual_setting_key, ' ' ) ) ); + + /** + * Dynamically build the individual setting, + * then add it to the $input_fields + */ + $input_fields[ $individual_setting_key ] = [ + 'type' => $setting['type'], + 'description' => $setting['description'], + ]; + } + } + + return $input_fields; + } + + /** + * Defines the mutation output field configuration. + * + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry + * + * @return array + */ + public static function get_output_fields( TypeRegistry $type_registry ) { + + /** + * Get the allowed setting groups and their fields + */ + $allowed_setting_groups = DataSource::get_allowed_settings_by_group( $type_registry ); + + $output_fields = []; + + /** + * Get all of the settings, regardless of group + */ + $output_fields['allSettings'] = [ + 'type' => 'Settings', + 'description' => __( 'Update all settings.', 'wp-graphql' ), + 'resolve' => static function () { + return true; + }, + ]; + + if ( ! empty( $allowed_setting_groups ) && is_array( $allowed_setting_groups ) ) { + foreach ( $allowed_setting_groups as $group => $setting_type ) { + $setting_type = DataSource::format_group_name( $group ); + $setting_type_name = Utils::format_type_name( $setting_type . 'Settings' ); + + $output_fields[ Utils::format_field_name( $setting_type_name ) ] = [ + 'type' => $setting_type_name, + // translators: %s is the setting type name + 'description' => sprintf( __( 'Update the %s setting.', 'wp-graphql' ), $setting_type_name ), + 'resolve' => static function () use ( $setting_type_name ) { + return $setting_type_name; + }, + ]; + } + } + return $output_fields; + } + + /** + * Defines the mutation data modification closure. + * + * @param array $input The mutation input + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry + * + * @return array + * + * @throws \GraphQL\Error\UserError + */ + public static function mutate_and_get_payload( array $input, TypeRegistry $type_registry ): array { + /** + * Check that the user can manage setting options + */ + if ( ! current_user_can( 'manage_options' ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to edit settings as this user.', 'wp-graphql' ) ); + } + + /** + * The $updatable_settings_options will store all of the allowed + * settings in a WP ready format + */ + $updatable_settings_options = []; + + $allowed_settings = DataSource::get_allowed_settings( $type_registry ); + + /** + * Loop through the $allowed_settings and build the insert options array + */ + foreach ( $allowed_settings as $key => $setting ) { + + /** + * Determine if the individual setting already has a + * REST API name, if not use the option name. + * Sanitize the field name to be camelcase + */ + if ( isset( $setting['show_in_rest']['name'] ) && ! empty( $setting['show_in_rest']['name'] ) ) { + $individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $setting['show_in_rest']['name'], '_' ) ) ); + } else { + $individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $key, '_' ) ) ); + } + + /** + * Dynamically build the individual setting, + * then add it to $updatable_settings_options + */ + $updatable_settings_options[ Utils::format_field_name( $individual_setting_key ) ] = [ + 'option' => $key, + 'group' => $setting['group'], + ]; + } + + foreach ( $input as $key => $value ) { + /** + * Throw an error if the input field is the site url, + * as we do not want users changing it and breaking all + * the things + */ + if ( 'generalSettingsUrl' === $key ) { + throw new UserError( esc_html__( 'Sorry, that is not allowed, speak with your site administrator to change the site URL.', 'wp-graphql' ) ); + } + + /** + * Check to see that the input field exists in settings, if so grab the option + * name and update the option + */ + if ( array_key_exists( $key, $updatable_settings_options ) ) { + update_option( $updatable_settings_options[ $key ]['option'], $value ); + } + } + + return $updatable_settings_options; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UserCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/UserCreate.php new file mode 100644 index 00000000..9909d972 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/UserCreate.php @@ -0,0 +1,187 @@ + array_merge( + [ + 'username' => [ + 'type' => [ + 'non_null' => 'String', + ], + // translators: the placeholder is the name of the type of post object being updated + 'description' => __( 'A string that contains the user\'s username for logging in.', 'wp-graphql' ), + ], + ], + self::get_input_fields() + ), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return [ + 'password' => [ + 'type' => 'String', + 'description' => __( 'A string that contains the plain text password for the user.', 'wp-graphql' ), + ], + 'nicename' => [ + 'type' => 'String', + 'description' => __( 'A string that contains a URL-friendly name for the user. The default is the user\'s username.', 'wp-graphql' ), + ], + 'websiteUrl' => [ + 'type' => 'String', + 'description' => __( 'A string containing the user\'s URL for the user\'s web site.', 'wp-graphql' ), + ], + 'email' => [ + 'type' => 'String', + 'description' => __( 'A string containing the user\'s email address.', 'wp-graphql' ), + ], + 'displayName' => [ + 'type' => 'String', + 'description' => __( 'A string that will be shown on the site. Defaults to user\'s username. It is likely that you will want to change this, for both appearance and security through obscurity (that is if you dont use and delete the default admin user).', 'wp-graphql' ), + ], + 'nickname' => [ + 'type' => 'String', + 'description' => __( 'The user\'s nickname, defaults to the user\'s username.', 'wp-graphql' ), + ], + 'firstName' => [ + 'type' => 'String', + 'description' => __( ' The user\'s first name.', 'wp-graphql' ), + ], + 'lastName' => [ + 'type' => 'String', + 'description' => __( 'The user\'s last name.', 'wp-graphql' ), + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'A string containing content about the user.', 'wp-graphql' ), + ], + 'richEditing' => [ + 'type' => 'String', + 'description' => __( 'A string for whether to enable the rich editor or not. False if not empty.', 'wp-graphql' ), + ], + 'registered' => [ + 'type' => 'String', + 'description' => __( 'The date the user registered. Format is Y-m-d H:i:s.', 'wp-graphql' ), + ], + 'roles' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'An array of roles to be assigned to the user.', 'wp-graphql' ), + ], + 'jabber' => [ + 'type' => 'String', + 'description' => __( 'User\'s Jabber account.', 'wp-graphql' ), + ], + 'aim' => [ + 'type' => 'String', + 'description' => __( 'User\'s AOL IM account.', 'wp-graphql' ), + ], + 'yim' => [ + 'type' => 'String', + 'description' => __( 'User\'s Yahoo IM account.', 'wp-graphql' ), + ], + 'locale' => [ + 'type' => 'String', + 'description' => __( 'User\'s locale.', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return [ + 'user' => [ + 'type' => 'User', + 'description' => __( 'The User object mutation type.', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input, AppContext $context, ResolveInfo $info ) { + if ( ! current_user_can( 'create_users' ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to create a new user.', 'wp-graphql' ) ); + } + + /** + * Map all of the args from GQL to WP friendly + */ + $user_args = UserMutation::prepare_user_object( $input, 'createUser' ); + + /** + * Create the new user + */ + $user_id = wp_insert_user( $user_args ); + + /** + * Throw an exception if the post failed to create + */ + if ( is_wp_error( $user_id ) ) { + $error_message = $user_id->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } else { + throw new UserError( esc_html__( 'The object failed to create but no error was provided', 'wp-graphql' ) ); + } + } + + /** + * If the $post_id is empty, we should throw an exception + */ + if ( empty( $user_id ) ) { + throw new UserError( esc_html__( 'The object failed to create', 'wp-graphql' ) ); + } + + /** + * Update additional user data + */ + UserMutation::update_additional_user_object_data( $user_id, $input, 'createUser', $context, $info ); + + /** + * Return the new user ID + */ + return [ + 'id' => $user_id, + 'user' => $context->get_loader( 'user' )->load_deferred( $user_id ), + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UserDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/UserDelete.php new file mode 100644 index 00000000..22cc929d --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/UserDelete.php @@ -0,0 +1,168 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The ID of the user you want to delete', 'wp-graphql' ), + ], + 'reassignId' => [ + 'type' => 'ID', + 'description' => __( 'Reassign posts and links to new User ID.', 'wp-graphql' ), + ], + ]; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return [ + 'deletedId' => [ + 'type' => 'ID', + 'description' => __( 'The ID of the user that you just deleted', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + $deleted = (object) $payload['user']; + return ( ! empty( $deleted->ID ) ) ? Relay::toGlobalId( 'user', $deleted->ID ) : null; + }, + ], + 'user' => [ + 'type' => 'User', + 'description' => __( 'The deleted user object', 'wp-graphql' ), + 'resolve' => static function ( $payload ) { + return new User( $payload['user'] ); + }, + ], + ]; + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input ) { + // Get the user ID. + $user_id = Utils::get_database_id_from_id( $input['id'] ); + + if ( empty( $user_id ) ) { + throw new UserError( esc_html__( 'The user ID passed is invalid', 'wp-graphql' ) ); + } + + if ( ! current_user_can( 'delete_users', $user_id ) ) { + throw new UserError( esc_html__( 'Sorry, you are not allowed to delete users.', 'wp-graphql' ) ); + } + + /** + * Retrieve the user object before it's deleted + */ + $user_before_delete = get_user_by( 'id', $user_id ); + + /** + * Throw an error if the user we are trying to delete doesn't exist + */ + if ( false === $user_before_delete ) { + throw new UserError( esc_html__( 'Could not find an existing user to delete', 'wp-graphql' ) ); + } + + /** + * Get the user to reassign posts to. + */ + $reassign_id = 0; + if ( ! empty( $input['reassignId'] ) ) { + $reassign_id = Utils::get_database_id_from_id( $input['reassignId'] ); + + if ( empty( $reassign_id ) ) { + throw new UserError( esc_html__( 'The user ID passed to `reassignId` is invalid', 'wp-graphql' ) ); + } + /** + * Retrieve the user object before it's deleted + */ + $reassign_user = get_user_by( 'id', $reassign_id ); + + if ( false === $reassign_user ) { + throw new UserError( esc_html__( 'Could not find the existing user to reassign.', 'wp-graphql' ) ); + } + } + + if ( ! function_exists( 'wp_delete_user' ) ) { + require_once ABSPATH . 'wp-admin/includes/user.php'; + } + + if ( is_multisite() ) { + + /** + * If wpmu_delete_user() or remove_user_from_blog() doesn't exist yet, + * load the files in which each is defined. I think we need to + * load this manually here because WordPress only uses this + * function on the user edit screen normally. + */ + + // only include these files for multisite requests + if ( ! function_exists( 'wpmu_delete_user' ) ) { + require_once ABSPATH . 'wp-admin/includes/ms.php'; + } + if ( ! function_exists( 'remove_user_from_blog' ) ) { + require_once ABSPATH . 'wp-admin/includes/ms-functions.php'; + } + + $blog_id = get_current_blog_id(); + + // remove the user from the blog and reassign their posts + remove_user_from_blog( $user_id, $blog_id, $reassign_id ); + + // delete the user + $deleted_user = wpmu_delete_user( $user_id ); + } else { + $deleted_user = wp_delete_user( $user_id, $reassign_id ); + } + + if ( true !== $deleted_user ) { + throw new UserError( esc_html__( 'Could not delete the user.', 'wp-graphql' ) ); + } + + return [ + 'user' => $user_before_delete, + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UserRegister.php b/lib/wp-graphql-1.17.0/src/Mutation/UserRegister.php new file mode 100644 index 00000000..d316f93d --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/UserRegister.php @@ -0,0 +1,171 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + $input_fields = array_merge( + UserCreate::get_input_fields(), + [ + 'username' => [ + 'type' => [ + 'non_null' => 'String', + ], + // translators: the placeholder is the name of the type of object being updated + 'description' => __( 'A string that contains the user\'s username.', 'wp-graphql' ), + ], + 'email' => [ + 'type' => 'String', + 'description' => __( 'A string containing the user\'s email address.', 'wp-graphql' ), + ], + ] + ); + + /** + * Make sure we don't allow input for role or roles + */ + unset( $input_fields['role'], $input_fields['roles'] ); + + return $input_fields; + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return UserCreate::get_output_fields(); + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input, AppContext $context, ResolveInfo $info ) { + if ( ! get_option( 'users_can_register' ) ) { + throw new UserError( esc_html__( 'User registration is currently not allowed.', 'wp-graphql' ) ); + } + + if ( empty( $input['username'] ) ) { + throw new UserError( esc_html__( 'A username was not provided.', 'wp-graphql' ) ); + } + + if ( empty( $input['email'] ) ) { + throw new UserError( esc_html__( 'An email address was not provided.', 'wp-graphql' ) ); + } + + /** + * Map all of the args from GQL to WP friendly + */ + $user_args = UserMutation::prepare_user_object( $input, 'registerUser' ); + + /** + * Register the new user + */ + $user_id = register_new_user( $user_args['user_login'], $user_args['user_email'] ); + + /** + * Throw an exception if the user failed to register + */ + if ( is_wp_error( $user_id ) ) { + $error_message = $user_id->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } else { + throw new UserError( esc_html__( 'The user failed to register but no error was provided', 'wp-graphql' ) ); + } + } + + /** + * If the $user_id is empty, we should throw an exception + */ + if ( empty( $user_id ) ) { + throw new UserError( esc_html__( 'The user failed to create', 'wp-graphql' ) ); + } + + /** + * If the client isn't already authenticated, set the state in the current session to + * the user they just registered. This is mostly so that they can get a response from + * the mutation about the user they just registered after the user object passes + * through the user model. + */ + if ( ! is_user_logged_in() ) { + wp_set_current_user( $user_id ); + } + + /** + * Set the ID of the user to be used in the update + */ + $user_args['ID'] = absint( $user_id ); + + /** + * Make sure we don't accept any role input during registration + */ + unset( $user_args['role'] ); + + /** + * Prevent "Password Changed" emails from being sent. + */ + add_filter( 'send_password_change_email', [ self::class, 'return_false' ] ); + + /** + * Update the registered user with the additional input (firstName, lastName, etc) from the mutation + */ + wp_update_user( $user_args ); + + /** + * Remove filter preventing "Password Changed" emails. + */ + remove_filter( 'send_password_change_email', [ self::class, 'return_false' ] ); + + /** + * Update additional user data + */ + UserMutation::update_additional_user_object_data( $user_id, $input, 'registerUser', $context, $info ); + + /** + * Return the new user ID + */ + return [ + 'id' => $user_id, + 'user' => $context->get_loader( 'user' )->load_deferred( $user_id ), + ]; + }; + } + + /** + * @return bool False. + */ + public static function return_false(): bool { + return false; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UserUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/UserUpdate.php new file mode 100644 index 00000000..a0daba98 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Mutation/UserUpdate.php @@ -0,0 +1,129 @@ + self::get_input_fields(), + 'outputFields' => self::get_output_fields(), + 'mutateAndGetPayload' => self::mutate_and_get_payload(), + ] + ); + } + + /** + * Defines the mutation input field configuration. + * + * @return array + */ + public static function get_input_fields() { + return array_merge( + [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + // translators: the placeholder is the name of the type of post object being updated + 'description' => __( 'The ID of the user', 'wp-graphql' ), + ], + ], + UserCreate::get_input_fields() + ); + } + + /** + * Defines the mutation output field configuration. + * + * @return array + */ + public static function get_output_fields() { + return UserCreate::get_output_fields(); + } + + /** + * Defines the mutation data modification closure. + * + * @return callable + */ + public static function mutate_and_get_payload() { + return static function ( $input, AppContext $context, ResolveInfo $info ) { + // Get the user ID. + $user_id = Utils::get_database_id_from_id( $input['id'] ); + + if ( empty( $user_id ) ) { + throw new UserError( esc_html__( 'The user ID passed is invalid', 'wp-graphql' ) ); + } + $existing_user = get_user_by( 'ID', $user_id ); + + /** + * If there's no existing user, throw an exception + */ + if ( false === $existing_user ) { + throw new UserError( esc_html__( 'A user could not be updated with the provided ID', 'wp-graphql' ) ); + } + + if ( ! current_user_can( 'edit_user', $existing_user->ID ) ) { + throw new UserError( esc_html__( 'You do not have the appropriate capabilities to perform this action', 'wp-graphql' ) ); + } + + if ( isset( $input['roles'] ) && ! current_user_can( 'edit_users' ) ) { + unset( $input['roles'] ); + throw new UserError( esc_html__( 'You do not have the appropriate capabilities to perform this action', 'wp-graphql' ) ); + } + + $user_args = UserMutation::prepare_user_object( $input, 'updateUser' ); + $user_args['ID'] = $user_id; + + /** + * Update the user + */ + $updated_user_id = wp_update_user( $user_args ); + + /** + * Throw an exception if the post failed to create + */ + if ( is_wp_error( $updated_user_id ) ) { + $error_message = $updated_user_id->get_error_message(); + if ( ! empty( $error_message ) ) { + throw new UserError( esc_html( $error_message ) ); + } else { + throw new UserError( esc_html__( 'The user failed to update but no error was provided', 'wp-graphql' ) ); + } + } + + /** + * If the $updated_user_id is empty, we should throw an exception + */ + if ( empty( $updated_user_id ) ) { + throw new UserError( esc_html__( 'The user failed to update', 'wp-graphql' ) ); + } + + /** + * Update additional user data + */ + UserMutation::update_additional_user_object_data( $updated_user_id, $input, 'updateUser', $context, $info ); + + /** + * Return the new user ID + */ + return [ + 'id' => $updated_user_id, + 'user' => $context->get_loader( 'user' )->load_deferred( $updated_user_id ), + ]; + }; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Registry/SchemaRegistry.php b/lib/wp-graphql-1.17.0/src/Registry/SchemaRegistry.php new file mode 100644 index 00000000..197a3068 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Registry/SchemaRegistry.php @@ -0,0 +1,59 @@ +type_registry = \WPGraphQL::get_type_registry(); + } + + /** + * Returns the Schema to use for execution of the GraphQL Request + * + * @return \WPGraphQL\WPSchema + * @throws \Exception + */ + public function get_schema() { + $this->type_registry->init(); + + $schema_config = new SchemaConfig(); + $schema_config->query = $this->type_registry->get_type( 'RootQuery' ); + $schema_config->mutation = $this->type_registry->get_type( 'RootMutation' ); + $schema_config->typeLoader = function ( $type ) { + return $this->type_registry->get_type( $type ); + }; + $schema_config->types = $this->type_registry->get_types(); + + /** + * Create a new instance of the Schema + */ + $schema = new WPSchema( $schema_config, $this->type_registry ); + + /** + * Filter the Schema + * + * @param \WPGraphQL\WPSchema $schema The generated Schema + * @param \WPGraphQL\Registry\SchemaRegistry $registry The Schema Registry Instance + */ + return apply_filters( 'graphql_schema', $schema, $this ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Registry/TypeRegistry.php b/lib/wp-graphql-1.17.0/src/Registry/TypeRegistry.php new file mode 100644 index 00000000..e8fef9c2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Registry/TypeRegistry.php @@ -0,0 +1,1363 @@ +types = []; + $this->type_loaders = []; + $this->eager_type_map = []; + } + + /** + * Formats the array key to a more friendly format + * + * @param string $key Name of the array key to format + * + * @return string + */ + protected function format_key( string $key ) { + return strtolower( $key ); + } + + /** + * Returns the eager type map, an array of Type definitions for Types that + * are not directly referenced in the schema. + * + * Types can add "eagerlyLoadType => true" when being registered to be included + * in the eager_type_map. + * + * @return array + */ + protected function get_eager_type_map() { + if ( ! empty( $this->eager_type_map ) ) { + return array_map( + function ( $type_name ) { + return $this->get_type( $type_name ); + }, + $this->eager_type_map + ); + } + + return []; + } + + /** + * Initialize the TypeRegistry + * + * @throws \Exception + * + * @return void + */ + public function init() { + $this->register_type( 'Bool', Type::boolean() ); + $this->register_type( 'Boolean', Type::boolean() ); + $this->register_type( 'Float', Type::float() ); + $this->register_type( 'Number', Type::float() ); + $this->register_type( 'Id', Type::id() ); + $this->register_type( 'Int', Type::int() ); + $this->register_type( 'Integer', Type::int() ); + $this->register_type( 'String', Type::string() ); + + /** + * When the Type Registry is initialized execute these files + */ + add_action( 'init_graphql_type_registry', [ $this, 'init_type_registry' ], 5, 1 ); + + /** + * Fire an action as the Type registry is being initiated + * + * @param \WPGraphQL\Registry\TypeRegistry $registry Instance of the TypeRegistry + */ + do_action( 'init_graphql_type_registry', $this ); + } + + /** + * Initialize the Type Registry + * + * @param \WPGraphQL\Registry\TypeRegistry $type_registry + * + * @return void + * @throws \Exception + */ + public function init_type_registry( self $type_registry ) { + + /** + * Fire an action as the type registry is initialized. This executes + * before the `graphql_register_types` action to allow for earlier hooking + * + * @param \WPGraphQL\Registry\TypeRegistry $registry Instance of the TypeRegistry + */ + do_action( 'graphql_register_initial_types', $type_registry ); + + // Register Interfaces. + Node::register_type(); + Commenter::register_type( $type_registry ); + Connection::register_type( $type_registry ); + ContentNode::register_type( $type_registry ); + ContentTemplate::register_type(); + DatabaseIdentifier::register_type(); + Edge::register_type( $type_registry ); + EnqueuedAsset::register_type( $type_registry ); + HierarchicalContentNode::register_type( $type_registry ); + HierarchicalNode::register_type( $type_registry ); + HierarchicalTermNode::register_type( $type_registry ); + MenuItemLinkable::register_type( $type_registry ); + NodeWithAuthor::register_type( $type_registry ); + NodeWithComments::register_type( $type_registry ); + NodeWithContentEditor::register_type( $type_registry ); + NodeWithExcerpt::register_type( $type_registry ); + NodeWithFeaturedImage::register_type( $type_registry ); + NodeWithRevisions::register_type( $type_registry ); + NodeWithTitle::register_type( $type_registry ); + NodeWithTemplate::register_type( $type_registry ); + NodeWithTrackbacks::register_type( $type_registry ); + NodeWithPageAttributes::register_type( $type_registry ); + PageInfo::register_type( $type_registry ); + Previewable::register_type( $type_registry ); + OneToOneConnection::register_type( $type_registry ); + TermNode::register_type( $type_registry ); + UniformResourceIdentifiable::register_type( $type_registry ); + + // register types + RootQuery::register_type(); + RootQuery::register_post_object_fields(); + RootQuery::register_term_object_fields(); + RootMutation::register_type(); + Avatar::register_type(); + Comment::register_type(); + CommentAuthor::register_type(); + ContentTemplate::register_content_template_types(); + EnqueuedStylesheet::register_type(); + EnqueuedScript::register_type(); + MediaDetails::register_type(); + MediaItemMeta::register_type(); + MediaSize::register_type(); + Menu::register_type(); + MenuItem::register_type(); + Plugin::register_type(); + ContentType::register_type(); + PostTypeLabelDetails::register_type(); + Settings::register_type( $this ); + Taxonomy::register_type(); + Theme::register_type(); + User::register_type(); + UserRole::register_type(); + + AvatarRatingEnum::register_type(); + CommentNodeIdTypeEnum::register_type(); + CommentsConnectionOrderbyEnum::register_type(); + CommentStatusEnum::register_type(); + ContentNodeIdTypeEnum::register_type(); + ContentTypeEnum::register_type(); + ContentTypeIdTypeEnum::register_type(); + MediaItemSizeEnum::register_type(); + MediaItemStatusEnum::register_type(); + MenuLocationEnum::register_type(); + MenuItemNodeIdTypeEnum::register_type(); + MenuNodeIdTypeEnum::register_type(); + MimeTypeEnum::register_type(); + OrderEnum::register_type(); + PluginStatusEnum::register_type(); + PostObjectFieldFormatEnum::register_type(); + PostObjectsConnectionDateColumnEnum::register_type(); + PostObjectsConnectionOrderbyEnum::register_type(); + PostStatusEnum::register_type(); + RelationEnum::register_type(); + TaxonomyEnum::register_type(); + TaxonomyIdTypeEnum::register_type(); + TermNodeIdTypeEnum::register_type(); + TermObjectsConnectionOrderbyEnum::register_type(); + TimezoneEnum::register_type(); + UserNodeIdTypeEnum::register_type(); + UserRoleEnum::register_type(); + UsersConnectionOrderbyEnum::register_type(); + UsersConnectionSearchColumnEnum::register_type(); + + DateInput::register_type(); + DateQueryInput::register_type(); + PostObjectsConnectionOrderbyInput::register_type(); + UsersConnectionOrderbyInput::register_type(); + + MenuItemObjectUnion::register_type( $this ); + PostObjectUnion::register_type( $this ); + TermObjectUnion::register_type( $this ); + + /** + * Register core connections + */ + Comments::register_connections(); + MenuItems::register_connections(); + PostObjects::register_connections(); + Taxonomies::register_connections(); + TermObjects::register_connections(); + Users::register_connections(); + + /** + * Register core mutations + */ + CommentCreate::register_mutation(); + CommentDelete::register_mutation(); + CommentRestore::register_mutation(); + CommentUpdate::register_mutation(); + MediaItemCreate::register_mutation(); + MediaItemDelete::register_mutation(); + MediaItemUpdate::register_mutation(); + ResetUserPassword::register_mutation(); + SendPasswordResetEmail::register_mutation(); + UserCreate::register_mutation(); + UserDelete::register_mutation(); + UserUpdate::register_mutation(); + UserRegister::register_mutation(); + UpdateSettings::register_mutation( $this ); + + /** + * Register PostObject types based on post_types configured to show_in_graphql + * + * @var \WP_Post_Type[] $allowed_post_types + */ + $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects' ); + + /** @var \WP_Taxonomy[] $allowed_taxonomies */ + $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); + + foreach ( $allowed_post_types as $post_type_object ) { + PostObject::register_types( $post_type_object ); + + /** + * Mutations for attachments are handled differently + * because they require different inputs + */ + if ( 'attachment' !== $post_type_object->name ) { + + /** + * Revisions are created behind the scenes as a side effect of post updates, + * they aren't created manually. + */ + if ( 'revision' !== $post_type_object->name ) { + if ( empty( $post_type_object->graphql_exclude_mutations ) || ! in_array( 'create', $post_type_object->graphql_exclude_mutations, true ) ) { + PostObjectCreate::register_mutation( $post_type_object ); + } + + if ( empty( $post_type_object->graphql_exclude_mutations ) || ! in_array( 'update', $post_type_object->graphql_exclude_mutations, true ) ) { + PostObjectUpdate::register_mutation( $post_type_object ); + } + } + + if ( empty( $post_type_object->graphql_exclude_mutations ) || ! in_array( 'delete', $post_type_object->graphql_exclude_mutations, true ) ) { + PostObjectDelete::register_mutation( $post_type_object ); + } + } + + foreach ( $allowed_taxonomies as $tax_object ) { + // If the taxonomy is in the array of taxonomies registered to the post_type + if ( in_array( $tax_object->name, get_object_taxonomies( $post_type_object->name ), true ) ) { + register_graphql_input_type( + $post_type_object->graphql_single_name . ucfirst( $tax_object->graphql_plural_name ) . 'NodeInput', + [ + 'description' => sprintf( + // translators: %1$s is the GraphQL plural name of the taxonomy, %2$s is the GraphQL singular name of the post type. + __( 'List of %1$s to connect the %2$s to. If an ID is set, it will be used to create the connection. If not, it will look for a slug. If neither are valid existing terms, and the site is configured to allow terms to be created during post mutations, a term will be created using the Name if it exists in the input, then fallback to the slug if it exists.', 'wp-graphql' ), + $tax_object->graphql_plural_name, + $post_type_object->graphql_single_name + ), + 'fields' => [ + 'id' => [ + 'type' => 'Id', + 'description' => sprintf( + // translators: %1$s is the GraphQL name of the taxonomy, %2$s is the GraphQL name of the post type. + __( 'The ID of the %1$s. If present, this will be used to connect to the %2$s. If no existing %1$s exists with this ID, no connection will be made.', 'wp-graphql' ), + $tax_object->graphql_single_name, + $post_type_object->graphql_single_name + ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => sprintf( + // translators: %1$s is the GraphQL name of the taxonomy. + __( 'The slug of the %1$s. If no ID is present, this field will be used to make a connection. If no existing term exists with this slug, this field will be used as a fallback to the Name field when creating a new term to connect to, if term creation is enabled as a nested mutation.', 'wp-graphql' ), + $tax_object->graphql_single_name + ), + ], + 'description' => [ + 'type' => 'String', + 'description' => sprintf( + // translators: %1$s is the GraphQL name of the taxonomy. + __( 'The description of the %1$s. This field is used to set a description of the %1$s if a new one is created during the mutation.', 'wp-graphql' ), + $tax_object->graphql_single_name + ), + ], + 'name' => [ + 'type' => 'String', + 'description' => sprintf( + // translators: %1$s is the GraphQL name of the taxonomy. + __( 'The name of the %1$s. This field is used to create a new term, if term creation is enabled in nested mutations, and if one does not already exist with the provided slug or ID or if a slug or ID is not provided. If no name is included and a term is created, the creation will fallback to the slug field.', 'wp-graphql' ), + $tax_object->graphql_single_name + ), + ], + ], + ] + ); + + register_graphql_input_type( + ucfirst( $post_type_object->graphql_single_name ) . ucfirst( $tax_object->graphql_plural_name ) . 'Input', + [ + 'description' => sprintf( + // translators: %1$s is the GraphQL name of the post type, %2$s is the plural GraphQL name of the taxonomy. + __( 'Set relationships between the %1$s to %2$s', 'wp-graphql' ), + $post_type_object->graphql_single_name, + $tax_object->graphql_plural_name + ), + 'fields' => [ + 'append' => [ + 'type' => 'Boolean', + 'description' => sprintf( + // translators: %1$s is the GraphQL name of the taxonomy, %2$s is the plural GraphQL name of the taxonomy. + __( 'If true, this will append the %1$s to existing related %2$s. If false, this will replace existing relationships. Default true.', 'wp-graphql' ), + $tax_object->graphql_single_name, + $tax_object->graphql_plural_name + ), + ], + 'nodes' => [ + 'type' => [ + 'list_of' => $post_type_object->graphql_single_name . ucfirst( $tax_object->graphql_plural_name ) . 'NodeInput', + ], + 'description' => __( 'The input list of items to set.', 'wp-graphql' ), + ], + ], + ] + ); + } + } + } + + /** + * Register TermObject types based on taxonomies configured to show_in_graphql + */ + foreach ( $allowed_taxonomies as $tax_object ) { + TermObject::register_types( $tax_object ); + + if ( empty( $tax_object->graphql_exclude_mutations ) || ! in_array( 'create', $tax_object->graphql_exclude_mutations, true ) ) { + TermObjectCreate::register_mutation( $tax_object ); + } + + if ( empty( $tax_object->graphql_exclude_mutations ) || ! in_array( 'update', $tax_object->graphql_exclude_mutations, true ) ) { + TermObjectUpdate::register_mutation( $tax_object ); + } + + if ( empty( $tax_object->graphql_exclude_mutations ) || ! in_array( 'delete', $tax_object->graphql_exclude_mutations, true ) ) { + TermObjectDelete::register_mutation( $tax_object ); + } + } + + /** + * Create the root query fields for any setting type in + * the $allowed_setting_types array. + */ + $allowed_setting_types = DataSource::get_allowed_settings_by_group( $this ); + + /** + * The url is not a registered setting for multisite, so this is a polyfill + * to expose the URL to the Schema for multisite sites + */ + if ( is_multisite() ) { + $this->register_field( + 'GeneralSettings', + 'url', + [ + 'type' => 'String', + 'description' => __( 'Site URL.', 'wp-graphql' ), + 'resolve' => static function () { + return get_site_url(); + }, + ] + ); + } + + if ( ! empty( $allowed_setting_types ) && is_array( $allowed_setting_types ) ) { + foreach ( $allowed_setting_types as $group_name => $setting_type ) { + $group_name = DataSource::format_group_name( $group_name ); + $type_name = SettingGroup::register_settings_group( $group_name, $group_name, $this ); + + if ( ! $type_name ) { + continue; + } + + register_graphql_field( + 'RootQuery', + Utils::format_field_name( $type_name ), + [ + 'type' => $type_name, + 'description' => sprintf( + // translators: %s is the GraphQL name of the settings group. + __( "Fields of the '%s' settings group", 'wp-graphql' ), + ucfirst( $group_name ) . 'Settings' + ), + 'resolve' => static function () use ( $setting_type ) { + return $setting_type; + }, + ] + ); + } + } + + /** + * Fire an action as the type registry is initialized. This executes + * before the `graphql_register_types` action to allow for earlier hooking + * + * @param \WPGraphQL\Registry\TypeRegistry $registry Instance of the TypeRegistry + */ + do_action( 'graphql_register_types', $type_registry ); + + /** + * Fire an action as the type registry is initialized. This executes + * during the `graphql_register_types` action to allow for earlier hooking + * + * @param \WPGraphQL\Registry\TypeRegistry $registry Instance of the TypeRegistry + */ + do_action( 'graphql_register_types_late', $type_registry ); + } + + /** + * Given a config for a custom Scalar, this adds the Scalar for use in the Schema. + * + * @param string $type_name The name of the Type to register + * @param array $config The config for the scalar type to register + * + * @throws \Exception + * + * @return void + */ + public function register_scalar( string $type_name, array $config ) { + $config['kind'] = 'scalar'; + $this->register_type( $type_name, $config ); + } + + /** + * Registers connections that were passed through the Type registration config + * + * @param array $config Type config + * + * @return void + * + * @throws \Exception + */ + protected function register_connections_from_config( array $config ) { + $connections = $config['connections'] ?? null; + + if ( ! is_array( $connections ) ) { + return; + } + + foreach ( $connections as $field_name => $connection_config ) { + if ( ! is_array( $connection_config ) ) { + continue; + } + + $connection_config['fromType'] = $config['name']; + $connection_config['fromFieldName'] = $field_name; + register_graphql_connection( $connection_config ); + } + } + + /** + * Add a Type to the Registry + * + * @param string $type_name The name of the type to register + * @param mixed|array|\GraphQL\Type\Definition\Type $config The config for the type + * + * @throws \Exception + * + * @return void + */ + public function register_type( string $type_name, $config ): void { + /** + * If the type should be excluded from the schema, skip it. + */ + if ( in_array( strtolower( $type_name ), $this->get_excluded_types(), true ) ) { + return; + } + /** + * If the Type Name starts with a number, skip it. + */ + if ( ! is_valid_graphql_name( $type_name ) ) { + graphql_debug( + sprintf( + // translators: %s is the name of the type. + __( 'The Type name \'%1$s\' is invalid and has not been added to the GraphQL Schema.', 'wp-graphql' ), + $type_name + ), + [ + 'type' => 'INVALID_TYPE_NAME', + 'type_name' => $type_name, + ] + ); + return; + } + + /** + * If the Type Name is already registered, skip it. + */ + if ( isset( $this->types[ $this->format_key( $type_name ) ] ) || isset( $this->type_loaders[ $this->format_key( $type_name ) ] ) ) { + graphql_debug( + sprintf( + // translators: %s is the name of the type. + __( 'You cannot register duplicate Types to the Schema. The Type \'%1$s\' already exists in the Schema. Make sure to give new Types a unique name.', 'wp-graphql' ), + $type_name + ), + [ + 'type' => 'DUPLICATE_TYPE', + 'type_name' => $type_name, + ] + ); + return; + } + + /** + * Register any connections that were passed through the Type config + */ + if ( is_array( $config ) && isset( $config['connections'] ) ) { + $config['name'] = ucfirst( $type_name ); + $this->register_connections_from_config( $config ); + } + + $this->type_loaders[ $this->format_key( $type_name ) ] = function () use ( $type_name, $config ) { + return $this->prepare_type( $type_name, $config ); + }; + + if ( is_array( $config ) && isset( $config['eagerlyLoadType'] ) && true === $config['eagerlyLoadType'] && ! isset( $this->eager_type_map[ $this->format_key( $type_name ) ] ) ) { + $this->eager_type_map[ $this->format_key( $type_name ) ] = $this->format_key( $type_name ); + } + } + + /** + * Add an Object Type to the Registry + * + * @param string $type_name The name of the type to register + * @param array $config The configuration of the type + * + * @throws \Exception + * @return void + */ + public function register_object_type( string $type_name, array $config ): void { + $config['kind'] = 'object'; + $this->register_type( $type_name, $config ); + } + + /** + * Add an Interface Type to the registry + * + * @param string $type_name The name of the type to register + * @param mixed|array|\GraphQL\Type\Definition\Type $config The configuration of the type + * + * @throws \Exception + * @return void + */ + public function register_interface_type( string $type_name, $config ): void { + $config['kind'] = 'interface'; + $this->register_type( $type_name, $config ); + } + + /** + * Add an Enum Type to the registry + * + * @param string $type_name The name of the type to register + * @param array $config he configuration of the type + * + * @return void + * @throws \Exception + */ + public function register_enum_type( string $type_name, array $config ): void { + $config['kind'] = 'enum'; + $this->register_type( $type_name, $config ); + } + + /** + * Add an Input Type to the Registry + * + * @param string $type_name The name of the type to register + * @param array $config he configuration of the type + * + * @return void + * @throws \Exception + */ + public function register_input_type( string $type_name, array $config ): void { + $config['kind'] = 'input'; + $this->register_type( $type_name, $config ); + } + + /** + * Add a Union Type to the Registry + * + * @param string $type_name The name of the type to register + * @param array $config he configuration of the type + * + * @return void + * + * @throws \Exception + */ + public function register_union_type( string $type_name, array $config ): void { + $config['kind'] = 'union'; + $this->register_type( $type_name, $config ); + } + + /** + * @param string $type_name The name of the type to register + * @param mixed|array|\GraphQL\Type\Definition\Type $config he configuration of the type + * + * @return mixed|array|\GraphQL\Type\Definition\Type|null + * @throws \Exception + */ + public function prepare_type( string $type_name, $config ) { + /** + * Uncomment to help trace eagerly (not lazy) loaded types. + * + * Use: graphql_debug( "prepare_type: {$type_name}", [ 'type' => $type_name ] );. + */ + + if ( ! is_array( $config ) ) { + return $config; + } + + $prepared_type = null; + + if ( ! empty( $config ) ) { + $kind = isset( $config['kind'] ) ? $config['kind'] : null; + $config['name'] = ucfirst( $type_name ); + + switch ( $kind ) { + case 'enum': + $prepared_type = new WPEnumType( $config ); + break; + case 'input': + $prepared_type = new WPInputObjectType( $config, $this ); + break; + case 'scalar': + $prepared_type = new WPScalar( $config, $this ); + break; + case 'union': + $prepared_type = new WPUnionType( $config, $this ); + break; + case 'interface': + $prepared_type = new WPInterfaceType( $config, $this ); + break; + case 'object': + default: + $prepared_type = new WPObjectType( $config, $this ); + } + } + + return $prepared_type; + } + + /** + * Given a type name, returns the type or null if not found + * + * @param string $type_name The name of the Type to get from the registry + * + * @return mixed + * |null + */ + public function get_type( string $type_name ) { + $key = $this->format_key( $type_name ); + + if ( isset( $this->type_loaders[ $key ] ) ) { + $type = $this->type_loaders[ $key ](); + $this->types[ $key ] = apply_filters( 'graphql_get_type', $type, $type_name ); + unset( $this->type_loaders[ $key ] ); + } + + return $this->types[ $key ] ?? null; + } + + /** + * Given a type name, determines if the type is already present in the Type Loader + * + * @param string $type_name The name of the type to check the registry for + * + * @return bool + */ + public function has_type( string $type_name ): bool { + return isset( $this->type_loaders[ $this->format_key( $type_name ) ] ); + } + + /** + * Return the Types in the registry + * + * @return array + */ + public function get_types(): array { + + // The full map of types is merged with eager types to support the + // rename_graphql_type API. + // + // All of the types are closures, but eager Types are the full + // Type definitions up front + return array_merge( $this->types, $this->get_eager_type_map() ); + } + + /** + * Wrapper for prepare_field to prepare multiple fields for registration at once + * + * @param array $fields Array of fields and their settings to register on a Type + * @param string $type_name Name of the Type to register the fields to + * + * @return array + * @throws \Exception + */ + public function prepare_fields( array $fields, string $type_name ): array { + $prepared_fields = []; + if ( ! empty( $fields ) && is_array( $fields ) ) { + foreach ( $fields as $field_name => $field_config ) { + if ( is_array( $field_config ) && isset( $field_config['type'] ) ) { + $prepared_field = $this->prepare_field( $field_name, $field_config, $type_name ); + if ( ! empty( $prepared_field ) ) { + $prepared_fields[ $this->format_key( $field_name ) ] = $prepared_field; + } + } + } + } + + return $prepared_fields; + } + + /** + * Prepare the field to be registered on the type + * + * @param string $field_name Friendly name of the field + * @param array $field_config Config data about the field to prepare + * @param string $type_name Name of the type to prepare the field for + * + * @return array|null + * @throws \Exception + */ + protected function prepare_field( string $field_name, array $field_config, string $type_name ): ?array { + if ( ! isset( $field_config['name'] ) ) { + $field_config['name'] = lcfirst( $field_name ); + } + + if ( ! isset( $field_config['type'] ) ) { + graphql_debug( + sprintf( + /* translators: %s is the Field name. */ + __( 'The registered field \'%s\' does not have a Type defined. Make sure to define a type for all fields.', 'wp-graphql' ), + $field_name + ), + [ + 'type' => 'INVALID_FIELD_TYPE', + 'type_name' => $type_name, + 'field_name' => $field_name, + ] + ); + return null; + } + + /** + * If the type is a string, create a callable wrapper to get the type from + * type registry. This preserves lazy-loading and prevents a bug where a type + * has the same name as a function in the global scope (e.g., `header()`) and + * is called since it passes `is_callable`. + */ + if ( is_string( $field_config['type'] ) ) { + // Bail if the type is excluded from the Schema. + if ( in_array( strtolower( $field_config['type'] ), $this->get_excluded_types(), true ) ) { + return null; + } + + $field_config['type'] = function () use ( $field_config ) { + return $this->get_type( $field_config['type'] ); + }; + } + + /** + * If the type is an array, it contains type modifiers (e.g., "non_null"). + * Create a callable wrapper to preserve lazy-loading. + */ + if ( is_array( $field_config['type'] ) ) { + // Bail if the type is excluded from the Schema. + $unmodified_type_name = $this->get_unmodified_type_name( $field_config['type'] ); + + if ( empty( $unmodified_type_name ) || in_array( strtolower( $unmodified_type_name ), $this->get_excluded_types(), true ) ) { + return null; + } + + $field_config['type'] = function () use ( $field_config ) { + return $this->setup_type_modifiers( $field_config['type'] ); + }; + } + + /** + * If the field has arguments, each one must be prepared. + */ + if ( isset( $field_config['args'] ) && is_array( $field_config['args'] ) ) { + foreach ( $field_config['args'] as $arg_name => $arg_config ) { + $arg = $this->prepare_field( $arg_name, $arg_config, $type_name ); + + // Remove the arg if the field could not be prepared. + if ( empty( $arg ) ) { + unset( $field_config['args'][ $arg_name ] ); + continue; + } + + $field_config['args'][ $arg_name ] = $arg; + } + } + + /** + * If the field has no (remaining) valid arguments, unset the key. + */ + if ( empty( $field_config['args'] ) ) { + unset( $field_config['args'] ); + } + + return $field_config; + } + + /** + * Processes type modifiers (e.g., "non-null"). Loads types immediately, so do + * not call before types are ready to be loaded. + * + * @param mixed|string|array $type The type definition + * + * @return mixed + * @throws \Exception + */ + public function setup_type_modifiers( $type ) { + if ( ! is_array( $type ) ) { + return $type; + } + + if ( isset( $type['non_null'] ) ) { + return $this->non_null( + $this->setup_type_modifiers( $type['non_null'] ) + ); + } + + if ( isset( $type['list_of'] ) ) { + return $this->list_of( + $this->setup_type_modifiers( $type['list_of'] ) + ); + } + + return $type; + } + + /** + * Wrapper for the register_field method to register multiple fields at once + * + * @param string $type_name Name of the type in the Type Registry to add the fields to + * @param array $fields Fields to register + * + * @return void + * @throws \Exception + */ + public function register_fields( string $type_name, array $fields = [] ): void { + if ( ! empty( $fields ) ) { + foreach ( $fields as $field_name => $config ) { + if ( is_string( $field_name ) && ! empty( $config ) && is_array( $config ) ) { + $this->register_field( $type_name, $field_name, $config ); + } + } + } + } + + /** + * Add a field to a Type in the Type Registry + * + * @param string $type_name Name of the type in the Type Registry to add + * the fields to + * @param string $field_name Name of the field to add to the type + * @param array $config Info about the field to register to the type + * + * @return void + * @throws \Exception + */ + public function register_field( string $type_name, string $field_name, array $config ): void { + add_filter( + 'graphql_' . $type_name . '_fields', + function ( $fields ) use ( $type_name, $field_name, $config ) { + + // Whether the field should be allowed to have underscores in the field name + $allow_field_underscores = isset( $config['allowFieldUnderscores'] ) && true === $config['allowFieldUnderscores']; + + $field_name = Utils::format_field_name( $field_name, $allow_field_underscores ); + + if ( preg_match( '/^\d/', $field_name ) ) { + graphql_debug( + sprintf( + // translators: %1$s is the field name, %2$s is the type name. + __( 'The field \'%1$s\' on Type \'%2$s\' is invalid. Field names cannot start with a number.', 'wp-graphql' ), + $field_name, + $type_name + ), + [ + 'type' => 'INVALID_FIELD_NAME', + 'field_name' => $field_name, + 'type_name' => $type_name, + ] + ); + return $fields; + } + + if ( isset( $fields[ $field_name ] ) ) { + graphql_debug( + sprintf( + // translators: %1$s is the field name, %2$s is the type name. + __( 'You cannot register duplicate fields on the same Type. The field \'%1$s\' already exists on the type \'%2$s\'. Make sure to give the field a unique name.', 'wp-graphql' ), + $field_name, + $type_name + ), + [ + 'type' => 'DUPLICATE_FIELD', + 'field_name' => $field_name, + 'type_name' => $type_name, + ] + ); + return $fields; + } + + /** + * If the field returns a properly prepared field, add it the the field registry + */ + $field = $this->prepare_field( $field_name, $config, $type_name ); + + if ( ! empty( $field ) ) { + $fields[ $field_name ] = $field; + } + + return $fields; + }, + 10, + 1 + ); + } + + /** + * Remove a field from a type + * + * @param string $type_name Name of the Type the field is registered to + * @param string $field_name Name of the field you would like to remove from the type + * + * @return void + */ + public function deregister_field( string $type_name, string $field_name ) { + add_filter( + 'graphql_' . $type_name . '_fields', + static function ( $fields ) use ( $field_name ) { + if ( isset( $fields[ $field_name ] ) ) { + unset( $fields[ $field_name ] ); + } + + return $fields; + } + ); + } + + /** + * Method to register a new connection in the Type registry + * + * @param array $config The info about the connection being registered + * + * @return void + * @throws \InvalidArgumentException + * @throws \Exception + */ + public function register_connection( array $config ): void { + new WPConnectionType( $config, $this ); + } + + /** + * Handles registration of a mutation to the Type registry + * + * @param string $mutation_name Name of the mutation being registered + * @param array $config Info about the mutation being registered + * + * @return void + * @throws \Exception + */ + public function register_mutation( string $mutation_name, array $config ): void { + // Bail if the mutation has been excluded from the schema. + if ( in_array( strtolower( $mutation_name ), $this->get_excluded_mutations(), true ) ) { + return; + } + + $config['name'] = $mutation_name; + new WPMutationType( $config, $this ); + } + + /** + * Removes a GraphQL mutation from the schema. + * + * This works by preventing the mutation from being registered in the first place. + * + * @uses 'graphql_excluded_mutations' filter. + * + * @param string $mutation_name Name of the mutation to remove from the schema. + * + * @since 1.14.0 + */ + public function deregister_mutation( string $mutation_name ): void { + // Prevent the mutation from being registered to the scheme directly. + add_filter( + 'graphql_excluded_mutations', + static function ( $excluded_mutations ) use ( $mutation_name ): array { + // Normalize the types to prevent case sensitivity issues. + $mutation_name = strtolower( $mutation_name ); + // If the type isn't already excluded, add it to the array. + if ( ! in_array( $mutation_name, $excluded_mutations, true ) ) { + $excluded_mutations[] = $mutation_name; + } + + return $excluded_mutations; + }, + 10 + ); + } + + /** + * Removes a GraphQL connection from the schema. + * + * This works by preventing the connection from being registered in the first place. + * + * @uses 'graphql_excluded_connections' filter. + * + * @param string $connection_name The GraphQL connection name. + */ + public function deregister_connection( string $connection_name ): void { + add_filter( + 'graphql_excluded_connections', + static function ( $excluded_connections ) use ( $connection_name ) { + $connection_name = strtolower( $connection_name ); + + if ( ! in_array( $connection_name, $excluded_connections, true ) ) { + $excluded_connections[] = $connection_name; + } + + return $excluded_connections; + } + ); + } + + /** + * Given a Type, this returns an instance of a NonNull of that type + * + * @param mixed $type The Type being wrapped + * + * @return \GraphQL\Type\Definition\NonNull + */ + public function non_null( $type ) { + if ( is_string( $type ) ) { + $type_def = $this->get_type( $type ); + + return Type::nonNull( $type_def ); + } + + return Type::nonNull( $type ); + } + + /** + * Given a Type, this returns an instance of a listOf of that type + * + * @param mixed $type The Type being wrapped + * + * @return \GraphQL\Type\Definition\ListOfType + */ + public function list_of( $type ) { + if ( is_string( $type ) ) { + $type_def = $this->get_type( $type ); + + if ( is_null( $type_def ) ) { + return Type::listOf( Type::string() ); + } + + return Type::listOf( $type_def ); + } + + return Type::listOf( $type ); + } + + /** + * Get the list of GraphQL type names to exclude from the schema. + * + * Type names are normalized using `strtolower()`, to avoid case sensitivity issues. + * + * @since 1.13.0 + */ + public function get_excluded_types(): array { + if ( null === $this->excluded_types ) { + /** + * Filter the list of GraphQL types to exclude from the schema. + * + * Note: using this filter directly will NOT remove the type from being referenced as a possible interface or a union type. + * To remove a GraphQL from the schema **entirely**, please use deregister_graphql_type(); + * + * @param string[] $excluded_types The names of the GraphQL Types to exclude. + * + * @since 1.13.0 + */ + $excluded_types = apply_filters( 'graphql_excluded_types', [] ); + + // Normalize the types to be lowercase, to avoid case-sensitivity issue when comparing. + $this->excluded_types = ! empty( $excluded_types ) ? array_map( 'strtolower', $excluded_types ) : []; + } + + return $this->excluded_types; + } + + /** + * Get the list of GraphQL connections to exclude from the schema. + * + * Type names are normalized using `strtolower()`, to avoid case sensitivity issues. + * + * @since 1.14.0 + */ + public function get_excluded_connections(): array { + if ( null === $this->excluded_connections ) { + /** + * Filter the list of GraphQL connections to excluded from the registry. + * + * @param string[] $excluded_connections The names of the GraphQL connections to exclude. + * + * @since 1.14.0 + */ + $excluded_connections = apply_filters( 'graphql_excluded_connections', [] ); + + // Normalize the types to be lowercase, to avoid case-sensitivity issue when comparing. + $this->excluded_connections = ! empty( $excluded_connections ) ? array_map( 'strtolower', $excluded_connections ) : []; + } + + return $this->excluded_connections; + } + + /** + * Get the list of GraphQL mutation names to exclude from the schema. + * + * Mutation names are normalized using `strtolower()`, to avoid case sensitivity issues. + * + * @since 1.14.0 + */ + public function get_excluded_mutations(): array { + if ( null === $this->excluded_mutations ) { + /** + * Filter the list of GraphQL mutations to excluded from the registry. + * + * @param string[] $excluded_mutations The names of the GraphQL mutations to exclude. + * + * @since 1.14.0 + */ + $excluded_mutations = apply_filters( 'graphql_excluded_mutations', [] ); + + // Normalize the types to be lowercase, to avoid case-sensitivity issue when comparing. + $this->excluded_mutations = ! empty( $excluded_mutations ) ? array_map( 'strtolower', $excluded_mutations ) : []; + } + + return $this->excluded_mutations; + } + + /** + * Gets the actual type name, stripped of possible NonNull and ListOf wrappers. + * + * Returns an empty string if the type modifiers are malformed. + * + * @param string|array $type The (possibly-wrapped) type name. + */ + protected function get_unmodified_type_name( $type ): string { + if ( ! is_array( $type ) ) { + return $type; + } + + $type = array_values( $type )[0] ?? ''; + + return $this->get_unmodified_type_name( $type ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Registry/Utils/PostObject.php b/lib/wp-graphql-1.17.0/src/Registry/Utils/PostObject.php new file mode 100644 index 00000000..bf9f516f --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Registry/Utils/PostObject.php @@ -0,0 +1,589 @@ +graphql_single_name; + + $config = [ + /* translators: post object singular name w/ description */ + 'description' => sprintf( __( 'The %s type', 'wp-graphql' ), $single_name ), + 'connections' => static::get_connections( $post_type_object ), + 'interfaces' => static::get_interfaces( $post_type_object ), + 'fields' => static::get_fields( $post_type_object ), + 'model' => Post::class, + ]; + + // Register as GraphQL objects. + if ( 'object' === $post_type_object->graphql_kind ) { + register_graphql_object_type( $single_name, $config ); + + // Register fields to the Type used for attachments (MediaItem) + if ( 'attachment' === $post_type_object->name && true === $post_type_object->show_in_graphql && isset( $post_type_object->graphql_single_name ) ) { + self::register_attachment_fields( $post_type_object ); + } + + return; + } + + /** + * Register as GraphQL interfaces or unions. + * + * It's assumed that the types used in `resolveType` have already been registered to the schema. + */ + + // Bail early if graphql_resolve_type isnt a vallable callback. + if ( empty( $post_type_object->graphql_resolve_type ) || ! is_callable( $post_type_object->graphql_resolve_type ) ) { + graphql_debug( + sprintf( + // translators: %1$s is the post type name, %2$s is the graphql kind. + __( '%1$s is registered as a GraphQL %2$s, but has no way to resolve the type. Ensure "graphql_resolve_type" is a valid callback function', 'wp-graphql' ), + $single_name, + $post_type_object->graphql_kind + ), + [ 'registered_post_type_object' => $post_type_object ] + ); + + return; + } + + $config['resolveType'] = $post_type_object->graphql_resolve_type; + + if ( 'interface' === $post_type_object->graphql_kind ) { + register_graphql_interface_type( $single_name, $config ); + + return; + } elseif ( 'union' === $post_type_object->graphql_kind ) { + + // Bail early if graphql_union_types is not defined. + if ( empty( $post_type_object->graphql_union_types ) || ! is_array( $post_type_object->graphql_union_types ) ) { + graphql_debug( + __( 'Registering a post type with "graphql_kind" => "union" requires "graphql_union_types" to be a valid array of possible GraphQL type names.', 'wp-graphql' ), + [ 'registered_post_type_object' => $post_type_object ] + ); + + return; + } + + // Set the possible types for the union. + $config['typeNames'] = $post_type_object->graphql_union_types; + + register_graphql_union_type( $single_name, $config ); + } + } + + /** + * Gets all the connections for the given post type. + * + * @param \WP_Post_Type $post_type_object + * + * @return array + */ + protected static function get_connections( WP_Post_Type $post_type_object ) { + $connections = []; + + // Comments. + if ( post_type_supports( $post_type_object->name, 'comments' ) ) { + $connections['comments'] = [ + 'toType' => 'Comment', + 'connectionArgs' => Comments::get_connection_args(), + 'resolve' => static function ( Post $post, $args, $context, $info ) { + if ( $post->isRevision ) { + $id = $post->parentDatabaseId; + } else { + $id = $post->ID; + } + + $resolver = new CommentConnectionResolver( $post, $args, $context, $info ); + + return $resolver->set_query_arg( 'post_id', absint( $id ) )->get_connection(); + }, + ]; + } + + // Previews. + if ( ! in_array( $post_type_object->name, [ 'attachment', 'revision' ], true ) ) { + $connections['preview'] = [ + 'toType' => $post_type_object->graphql_single_name, + 'connectionTypeName' => ucfirst( $post_type_object->graphql_single_name ) . 'ToPreviewConnection', + 'oneToOne' => true, + 'deprecationReason' => ( true === $post_type_object->publicly_queryable || true === $post_type_object->public ) ? null + : sprintf( + // translators: %s is the post type's GraphQL name. + __( 'The "%s" Type is not publicly queryable and does not support previews. This field will be removed in the future.', 'wp-graphql' ), + WPGraphQL\Utils\Utils::format_type_name( $post_type_object->graphql_single_name ) + ), + 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { + if ( $post->isRevision ) { + return null; + } + + if ( empty( $post->previewRevisionDatabaseId ) ) { + return null; + } + + $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info, 'revision' ); + $resolver->set_query_arg( 'p', $post->previewRevisionDatabaseId ); + + return $resolver->one_to_one()->get_connection(); + }, + ]; + } + + // Revisions. + if ( true === post_type_supports( $post_type_object->name, 'revisions' ) ) { + $connections['revisions'] = [ + 'connectionTypeName' => ucfirst( $post_type_object->graphql_single_name ) . 'ToRevisionConnection', + 'toType' => $post_type_object->graphql_single_name, + 'queryClass' => 'WP_Query', + 'connectionArgs' => PostObjects::get_connection_args( [], $post_type_object ), + 'resolve' => static function ( Post $post, $args, $context, $info ) { + $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info, 'revision' ); + $resolver->set_query_arg( 'post_parent', $post->ID ); + + return $resolver->get_connection(); + }, + ]; + } + + // Used to ensure TermNode connection doesn't get registered multiple times. + $already_registered = false; + $allowed_taxonomies = WPGraphQL::get_allowed_taxonomies( 'objects' ); + + foreach ( $allowed_taxonomies as $tax_object ) { + if ( ! in_array( $post_type_object->name, $tax_object->object_type, true ) ) { + continue; + } + + // TermNode. + if ( ! $already_registered ) { + $connections['terms'] = [ + 'toType' => 'TermNode', + 'queryClass' => 'WP_Term_Query', + 'connectionArgs' => TermObjects::get_connection_args( + [ + 'taxonomies' => [ + 'type' => [ 'list_of' => 'TaxonomyEnum' ], + 'description' => __( 'The Taxonomy to filter terms by', 'wp-graphql' ), + ], + ] + ), + 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { + $taxonomies = \WPGraphQL::get_allowed_taxonomies(); + $terms = wp_get_post_terms( $post->ID, $taxonomies, [ 'fields' => 'ids' ] ); + + if ( empty( $terms ) || is_wp_error( $terms ) ) { + return null; + } + $resolver = new TermObjectConnectionResolver( $post, $args, $context, $info, $taxonomies ); + $resolver->set_query_arg( 'include', $terms ); + + return $resolver->get_connection(); + }, + ]; + + // We won't need to register this connection again. + $already_registered = true; + } + + // TermObjects. + $connections[ $tax_object->graphql_plural_name ] = [ + 'toType' => $tax_object->graphql_single_name, + 'queryClass' => 'WP_Term_Query', + 'connectionArgs' => TermObjects::get_connection_args(), + 'resolve' => static function ( Post $post, $args, AppContext $context, $info ) use ( $tax_object ) { + $object_id = true === $post->isPreview && ! empty( $post->parentDatabaseId ) ? $post->parentDatabaseId : $post->ID; + + if ( empty( $object_id ) || ! absint( $object_id ) ) { + return null; + } + + $resolver = new TermObjectConnectionResolver( $post, $args, $context, $info, $tax_object->name ); + $resolver->set_query_arg( 'object_ids', absint( $object_id ) ); + + return $resolver->get_connection(); + }, + ]; + } + + // Merge with connections set in register_post_type. + if ( ! empty( $post_type_object->graphql_connections ) ) { + $connections = array_merge( $connections, $post_type_object->graphql_connections ); + } + + // Remove excluded connections. + if ( ! empty( $post_type_object->graphql_exclude_connections ) ) { + foreach ( $post_type_object->graphql_exclude_connections as $connection_name ) { + unset( $connections[ lcfirst( $connection_name ) ] ); + } + } + + return $connections; + } + + /** + * Gets all the interfaces for the given post type. + * + * @param \WP_Post_Type $post_type_object Post type. + * + * @return array + */ + protected static function get_interfaces( WP_Post_Type $post_type_object ) { + $interfaces = [ 'Node', 'ContentNode', 'DatabaseIdentifier', 'NodeWithTemplate' ]; + + if ( true === $post_type_object->public ) { + $interfaces[] = 'UniformResourceIdentifiable'; + } + + // Only post types that are publicly_queryable are previewable + if ( 'attachment' !== $post_type_object->name && ( true === $post_type_object->publicly_queryable || true === $post_type_object->public ) ) { + $interfaces[] = 'Previewable'; + } + + if ( post_type_supports( $post_type_object->name, 'title' ) ) { + $interfaces[] = 'NodeWithTitle'; + } + + if ( post_type_supports( $post_type_object->name, 'editor' ) ) { + $interfaces[] = 'NodeWithContentEditor'; + } + + if ( post_type_supports( $post_type_object->name, 'author' ) ) { + $interfaces[] = 'NodeWithAuthor'; + } + + if ( post_type_supports( $post_type_object->name, 'thumbnail' ) ) { + $interfaces[] = 'NodeWithFeaturedImage'; + } + + if ( post_type_supports( $post_type_object->name, 'excerpt' ) ) { + $interfaces[] = 'NodeWithExcerpt'; + } + + if ( post_type_supports( $post_type_object->name, 'comments' ) ) { + $interfaces[] = 'NodeWithComments'; + } + + if ( post_type_supports( $post_type_object->name, 'trackbacks' ) ) { + $interfaces[] = 'NodeWithTrackbacks'; + } + + if ( post_type_supports( $post_type_object->name, 'revisions' ) ) { + $interfaces[] = 'NodeWithRevisions'; + } + + if ( post_type_supports( $post_type_object->name, 'page-attributes' ) ) { + $interfaces[] = 'NodeWithPageAttributes'; + } + + if ( $post_type_object->hierarchical || in_array( + $post_type_object->name, + [ + 'attachment', + 'revision', + ], + true + ) ) { + $interfaces[] = 'HierarchicalContentNode'; + } + + if ( true === $post_type_object->show_in_nav_menus ) { + $interfaces[] = 'MenuItemLinkable'; + } + + // Merge with interfaces set in register_post_type. + if ( ! empty( $post_type_object->graphql_interfaces ) ) { + $interfaces = array_merge( $interfaces, $post_type_object->graphql_interfaces ); + } + + // Remove excluded interfaces. + if ( ! empty( $post_type_object->graphql_exclude_interfaces ) ) { + $interfaces = array_diff( $interfaces, $post_type_object->graphql_exclude_interfaces ); + } + + return $interfaces; + } + + /** + * Registers common post type fields on schema type corresponding to provided post type object. + * + * @param \WP_Post_Type $post_type_object Post type. + * + * @return array + * @todo make protected after \Type\ObjectType\PostObject::get_fields() is removed. + */ + public static function get_fields( WP_Post_Type $post_type_object ) { + $single_name = $post_type_object->graphql_single_name; + $fields = [ + 'id' => [ + 'description' => sprintf( + /* translators: %s: custom post-type name */ + __( 'The globally unique identifier of the %s object.', 'wp-graphql' ), + $post_type_object->name + ), + ], + $single_name . 'Id' => [ + 'type' => [ + 'non_null' => 'Int', + ], + 'deprecationReason' => __( 'Deprecated in favor of the databaseId field', 'wp-graphql' ), + 'description' => __( 'The id field matches the WP_Post->ID field.', 'wp-graphql' ), + 'resolve' => static function ( Post $post ) { + return absint( $post->ID ); + }, + ], + ]; + + if ( 'page' === $post_type_object->name ) { + $fields['isFrontPage'] = [ + 'type' => [ 'non_null' => 'Bool' ], + 'description' => __( 'Whether this page is set to the static front page.', 'wp-graphql' ), + ]; + + $fields['isPostsPage'] = [ + 'type' => [ 'non_null' => 'Bool' ], + 'description' => __( 'Whether this page is set to the blog posts page.', 'wp-graphql' ), + ]; + + $fields['isPrivacyPage'] = [ + 'type' => [ 'non_null' => 'Bool' ], + 'description' => __( 'Whether this page is set to the privacy page.', 'wp-graphql' ), + ]; + } + + if ( 'post' === $post_type_object->name ) { + $fields['isSticky'] = [ + 'type' => [ 'non_null' => 'Bool' ], + 'description' => __( 'Whether this page is sticky', 'wp-graphql' ), + ]; + } + + if ( ! $post_type_object->hierarchical && + ! in_array( + $post_type_object->name, + [ + 'attachment', + 'revision', + ], + true + ) ) { + $fields['ancestors']['deprecationReason'] = __( 'This content type is not hierarchical and typically will not have ancestors', 'wp-graphql' ); + $fields['parent']['deprecationReason'] = __( 'This content type is not hierarchical and typically will not have a parent', 'wp-graphql' ); + } + + // Merge with fields set in register_post_type. + if ( ! empty( $post_type_object->graphql_fields ) ) { + $fields = array_merge( $fields, $post_type_object->graphql_fields ); + } + + // Remove excluded fields. + if ( ! empty( $post_type_object->graphql_exclude_fields ) ) { + foreach ( $post_type_object->graphql_exclude_fields as $field_name ) { + unset( $fields[ $field_name ] ); + } + } + + return $fields; + } + + + /** + * Register fields to the Type used for attachments (MediaItem). + * + * @return void + */ + private static function register_attachment_fields( WP_Post_Type $post_type_object ) { + /** + * Register fields custom to the MediaItem Type + */ + register_graphql_fields( + $post_type_object->graphql_single_name, + [ + 'caption' => [ + 'type' => 'String', + 'description' => __( 'The caption for the resource', 'wp-graphql' ), + 'args' => [ + 'format' => [ + 'type' => 'PostObjectFieldFormatEnum', + 'description' => __( 'Format of the field output', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, $args ) { + if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { + // @codingStandardsIgnoreLine. + return $source->captionRaw; + } + + // @codingStandardsIgnoreLine. + return $source->captionRendered; + }, + ], + 'altText' => [ + 'type' => 'String', + 'description' => __( 'Alternative text to display when resource is not displayed', 'wp-graphql' ), + ], + 'srcSet' => [ + 'type' => 'string', + 'args' => [ + 'size' => [ + 'type' => 'MediaItemSizeEnum', + 'description' => __( 'Size of the MediaItem to calculate srcSet with', 'wp-graphql' ), + ], + ], + 'description' => __( 'The srcset attribute specifies the URL of the image to use in different situations. It is a comma separated string of urls and their widths.', 'wp-graphql' ), + 'resolve' => static function ( $source, $args ) { + $size = 'medium'; + if ( ! empty( $args['size'] ) ) { + $size = $args['size']; + } + + $src_set = wp_get_attachment_image_srcset( $source->ID, $size ); + + return ! empty( $src_set ) ? $src_set : null; + }, + ], + 'sizes' => [ + 'type' => 'string', + 'args' => [ + 'size' => [ + 'type' => 'MediaItemSizeEnum', + 'description' => __( 'Size of the MediaItem to calculate sizes with', 'wp-graphql' ), + ], + ], + 'description' => __( 'The sizes attribute value for an image.', 'wp-graphql' ), + 'resolve' => static function ( $source, $args ) { + $size = 'medium'; + if ( ! empty( $args['size'] ) ) { + $size = $args['size']; + } + + $image = wp_get_attachment_image_src( $source->ID, $size ); + if ( $image ) { + list( $src, $width, $height ) = $image; + $sizes = wp_calculate_image_sizes( + [ + absint( $width ), + absint( $height ), + ], + $src, + null, + $source->ID + ); + + return ! empty( $sizes ) ? $sizes : null; + } + + return null; + }, + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'Description of the image (stored as post_content)', 'wp-graphql' ), + 'args' => [ + 'format' => [ + 'type' => 'PostObjectFieldFormatEnum', + 'description' => __( 'Format of the field output', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, $args ) { + if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { + // @codingStandardsIgnoreLine. + return $source->descriptionRaw; + } + + // @codingStandardsIgnoreLine. + return $source->descriptionRendered; + }, + ], + 'mediaItemUrl' => [ + 'type' => 'String', + 'description' => __( 'Url of the mediaItem', 'wp-graphql' ), + ], + 'mediaType' => [ + 'type' => 'String', + 'description' => __( 'Type of resource', 'wp-graphql' ), + ], + 'sourceUrl' => [ + 'type' => 'String', + 'description' => __( 'Url of the mediaItem', 'wp-graphql' ), + 'args' => [ + 'size' => [ + 'type' => 'MediaItemSizeEnum', + 'description' => __( 'Size of the MediaItem to return', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $image, $args ) { + // @codingStandardsIgnoreLine. + $size = null; + if ( isset( $args['size'] ) ) { + $size = ( 'full' === $args['size'] ) ? 'large' : $args['size']; + } + + return ! empty( $size ) ? $image->sourceUrlsBySize[ $size ] : $image->sourceUrl; + }, + ], + 'fileSize' => [ + 'type' => 'Int', + 'description' => __( 'The filesize in bytes of the resource', 'wp-graphql' ), + 'args' => [ + 'size' => [ + 'type' => 'MediaItemSizeEnum', + 'description' => __( 'Size of the MediaItem to return', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $image, $args ) { + + // @codingStandardsIgnoreLine. + $size = null; + if ( isset( $args['size'] ) ) { + $size = ( 'full' === $args['size'] ) ? 'large' : $args['size']; + } + + $sourceUrl = ! empty( $size ) ? $image->sourceUrlsBySize[ $size ] : $image->mediaItemUrl; + $path_parts = pathinfo( $sourceUrl ); + $original_file = get_attached_file( absint( $image->databaseId ) ); + $filesize_path = ! empty( $original_file ) ? path_join( dirname( $original_file ), $path_parts['basename'] ) : null; + + return ! empty( $filesize_path ) ? filesize( $filesize_path ) : null; + }, + ], + 'mimeType' => [ + 'type' => 'String', + 'description' => __( 'The mime type of the mediaItem', 'wp-graphql' ), + ], + 'mediaDetails' => [ + 'type' => 'MediaDetails', + 'description' => __( 'Details about the mediaItem', 'wp-graphql' ), + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Registry/Utils/TermObject.php b/lib/wp-graphql-1.17.0/src/Registry/Utils/TermObject.php new file mode 100644 index 00000000..0db7e300 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Registry/Utils/TermObject.php @@ -0,0 +1,339 @@ +graphql_single_name; + + $config = [ + 'description' => sprintf( + // translators: %s is the term object singular name. + __( 'The %s type', 'wp-graphql' ), + $single_name + ), + 'connections' => static::get_connections( $tax_object ), + 'interfaces' => static::get_interfaces( $tax_object ), + 'fields' => static::get_fields( $tax_object ), + 'model' => Term::class, + ]; + + // Register as GraphQL objects. + if ( 'object' === $tax_object->graphql_kind ) { + register_graphql_object_type( $single_name, $config ); + return; + } + + /** + * Register as GraphQL interfaces or unions. + * + * It's assumed that the types used in `resolveType` have already been registered to the schema. + */ + + // Bail early if graphql_resolve_type isnt a vallable callback. + if ( empty( $tax_object->graphql_resolve_type ) || ! is_callable( $tax_object->graphql_resolve_type ) ) { + graphql_debug( + sprintf( + // translators: %1$s is the term object singular name, %2$s is the graphql kind. + __( '%1$s is registered as a GraphQL %2$s, but has no way to resolve the type. Ensure "graphql_resolve_type" is a valid callback function', 'wp-graphql' ), + $single_name, + $tax_object->graphql_kind + ), + [ 'registered_taxonomy_object' => $tax_object ] + ); + + return; + } + + $config['resolveType'] = $tax_object->graphql_resolve_type; + + if ( 'interface' === $tax_object->graphql_kind ) { + register_graphql_interface_type( $single_name, $config ); + + return; + } elseif ( 'union' === $tax_object->graphql_kind ) { + + // Bail early if graphql_union_types is not defined. + if ( empty( $tax_object->graphql_union_types ) || ! is_array( $tax_object->graphql_union_types ) ) { + graphql_debug( + __( 'Registering a taxonomy with "graphql_kind" => "union" requires "graphql_union_types" to be a valid array of possible GraphQL type names.', 'wp-graphql' ), + [ 'registered_taxonomy_object' => $tax_object ] + ); + + return; + } + + // Set the possible types for the union. + $config['typeNames'] = $tax_object->graphql_union_types; + + register_graphql_union_type( $single_name, $config ); + } + } + + /** + * Gets all the connections for the given post type. + * + * @param \WP_Taxonomy $tax_object + * + * @return array + */ + protected static function get_connections( WP_Taxonomy $tax_object ) { + $connections = []; + + // Taxonomy. + // @todo connection move to TermNode (breaking). + $connections['taxonomy'] = [ + 'toType' => 'Taxonomy', + 'oneToOne' => true, + 'resolve' => static function ( Term $source, $args, $context, $info ) { + if ( empty( $source->taxonomyName ) ) { + return null; + } + $resolver = new TaxonomyConnectionResolver( $source, $args, $context, $info ); + $resolver->set_query_arg( 'name', $source->taxonomyName ); + return $resolver->one_to_one()->get_connection(); + }, + ]; + + if ( true === $tax_object->hierarchical ) { + // Children. + $connections['children'] = [ + 'toType' => $tax_object->graphql_single_name, + 'description' => sprintf( + // translators: %1$s is the term object singular name, %2$s is the term object plural name. + __( 'Connection between the %1$s type and its children %2$s.', 'wp-graphql' ), + $tax_object->graphql_single_name, + $tax_object->graphql_plural_name + ), + 'connectionArgs' => TermObjects::get_connection_args(), + 'queryClass' => 'WP_Term_Query', + 'resolve' => static function ( Term $term, $args, AppContext $context, $info ) { + $resolver = new TermObjectConnectionResolver( $term, $args, $context, $info ); + $resolver->set_query_arg( 'parent', $term->term_id ); + + return $resolver->get_connection(); + }, + ]; + + // Parent. + $connections['parent'] = [ + 'toType' => $tax_object->graphql_single_name, + 'description' => sprintf( + // translators: %s is the term object singular name. + __( 'Connection between the %1$s type and its parent %1$s.', 'wp-graphql' ), + $tax_object->graphql_single_name + ), + 'connectionTypeName' => ucfirst( $tax_object->graphql_single_name ) . 'ToParent' . ucfirst( $tax_object->graphql_single_name ) . 'Connection', + 'oneToOne' => true, + 'resolve' => static function ( Term $term, $args, AppContext $context, $info ) use ( $tax_object ) { + if ( ! isset( $term->parentDatabaseId ) || empty( $term->parentDatabaseId ) ) { + return null; + } + + $resolver = new TermObjectConnectionResolver( $term, $args, $context, $info, $tax_object->name ); + $resolver->set_query_arg( 'include', $term->parentDatabaseId ); + + return $resolver->one_to_one()->get_connection(); + }, + ]; + + // Ancestors. + $connections['ancestors'] = [ + 'toType' => $tax_object->graphql_single_name, + 'description' => __( 'The ancestors of the node. Default ordered as lowest (closest to the child) to highest (closest to the root).', 'wp-graphql' ), + 'connectionTypeName' => ucfirst( $tax_object->graphql_single_name ) . 'ToAncestors' . ucfirst( $tax_object->graphql_single_name ) . 'Connection', + 'resolve' => static function ( Term $term, $args, AppContext $context, $info ) use ( $tax_object ) { + if ( ! $tax_object instanceof WP_Taxonomy ) { + return null; + } + + $ancestor_ids = get_ancestors( absint( $term->term_id ), $term->taxonomyName, 'taxonomy' ); + + if ( empty( $ancestor_ids ) ) { + return null; + } + + $resolver = new TermObjectConnectionResolver( $term, $args, $context, $info, $tax_object->name ); + $resolver->set_query_arg( 'include', $ancestor_ids ); + $resolver->set_query_arg( 'orderby', 'include' ); + + return $resolver->get_connection(); + }, + ]; + } + + // Used to ensure contentNodes connection doesn't get registered multiple times. + $already_registered = false; + $allowed_post_types = WPGraphQL::get_allowed_post_types( 'objects' ); + + foreach ( $allowed_post_types as $post_type_object ) { + if ( ! in_array( $tax_object->name, get_object_taxonomies( $post_type_object->name ), true ) ) { + continue; + } + + // ContentNodes. + if ( ! $already_registered ) { + $connections['contentNodes'] = PostObjects::get_connection_config( + $tax_object, + [ + 'toType' => 'ContentNode', + 'resolve' => static function ( Term $term, $args, $context, $info ) { + $resolver = new PostObjectConnectionResolver( $term, $args, $context, $info, 'any' ); + $resolver->set_query_arg( + 'tax_query', + [ + [ + 'taxonomy' => $term->taxonomyName, + 'terms' => [ $term->term_id ], + 'field' => 'term_id', + 'include_children' => false, + ], + ] + ); + + return $resolver->get_connection(); + }, + ] + ); + + // We won't need to register this connection again. + $already_registered = true; + } + + // PostObjects. + $connections[ $post_type_object->graphql_plural_name ] = PostObjects::get_connection_config( + $post_type_object, + [ + 'toType' => $post_type_object->graphql_single_name, + 'queryClass' => 'WP_Query', + 'resolve' => static function ( Term $term, $args, AppContext $context, ResolveInfo $info ) use ( $post_type_object ) { + $resolver = new PostObjectConnectionResolver( $term, $args, $context, $info, $post_type_object->name ); + $resolver->set_query_arg( + 'tax_query', + [ + [ + 'taxonomy' => $term->taxonomyName, + 'terms' => [ $term->term_id ], + 'field' => 'term_id', + 'include_children' => false, + ], + ] + ); + + return $resolver->get_connection(); + }, + ] + ); + } + + // Merge with connections set in register_taxonomy. + if ( ! empty( $tax_object->graphql_connections ) ) { + $connections = array_merge( $connections, $tax_object->graphql_connections ); + } + + // Remove excluded connections. + if ( ! empty( $tax_object->graphql_exclude_connections ) ) { + foreach ( $tax_object->graphql_exclude_connections as $connection_name ) { + unset( $connections[ lcfirst( $connection_name ) ] ); + } + } + + return $connections; + } + /** + * Gets all the interfaces for the given Taxonomy. + * + * @param \WP_Taxonomy $tax_object Taxonomy. + * + * @return array + */ + protected static function get_interfaces( WP_Taxonomy $tax_object ) { + $interfaces = [ 'Node', 'TermNode', 'DatabaseIdentifier' ]; + + if ( true === $tax_object->public ) { + $interfaces[] = 'UniformResourceIdentifiable'; + } + + if ( $tax_object->hierarchical ) { + $interfaces[] = 'HierarchicalTermNode'; + } + + if ( true === $tax_object->show_in_nav_menus ) { + $interfaces[] = 'MenuItemLinkable'; + } + + // Merge with interfaces set in register_taxonomy. + if ( ! empty( $tax_object->graphql_interfaces ) ) { + $interfaces = array_merge( $interfaces, $tax_object->graphql_interfaces ); + } + + // Remove excluded interfaces. + if ( ! empty( $tax_object->graphql_exclude_interfaces ) ) { + $interfaces = array_diff( $interfaces, $tax_object->graphql_exclude_interfaces ); + } + + return $interfaces; + } + + /** + * Registers common Taxonomy fields on schema type corresponding to provided Taxonomy object. + * + * @param \WP_Taxonomy $tax_object Taxonomy. + * + * @return array + */ + protected static function get_fields( WP_Taxonomy $tax_object ) { + $single_name = $tax_object->graphql_single_name; + $fields = [ + $single_name . 'Id' => [ + 'type' => 'Int', + 'deprecationReason' => __( 'Deprecated in favor of databaseId', 'wp-graphql' ), + 'description' => __( 'The id field matches the WP_Post->ID field.', 'wp-graphql' ), + 'resolve' => static function ( Term $term ) { + return absint( $term->term_id ); + }, + ], + ]; + + // Merge with fields set in register_taxonomy. + if ( ! empty( $tax_object->graphql_fields ) ) { + $fields = array_merge( $fields, $tax_object->graphql_fields ); + } + + // Remove excluded fields. + if ( ! empty( $tax_object->graphql_exclude_fields ) ) { + foreach ( $tax_object->graphql_exclude_fields as $field_name ) { + unset( $fields[ $field_name ] ); + } + } + + return $fields; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Request.php b/lib/wp-graphql-1.17.0/src/Request.php new file mode 100644 index 00000000..a6ac7248 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Request.php @@ -0,0 +1,798 @@ +debug_log = new DebugLog(); + + // Set request data for passed-in (non-HTTP) requests. + $this->data = $data; + + // Get the Type Registry + $this->type_registry = \WPGraphQL::get_type_registry(); + + // Get the Schema + $this->schema = \WPGraphQL::get_schema(); + + // Get the App Context + $this->app_context = \WPGraphQL::get_app_context(); + + $this->root_value = $this->get_root_value(); + $this->validation_rules = $this->get_validation_rules(); + $this->field_resolver = $this->get_field_resolver(); + + /** + * Configure the app_context which gets passed down to all the resolvers. + * + * @since 0.0.4 + */ + $app_context = new AppContext(); + $app_context->viewer = wp_get_current_user(); + $app_context->root_url = get_bloginfo( 'url' ); + $app_context->request = ! empty( $_REQUEST ) ? $_REQUEST : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + $app_context->type_registry = $this->type_registry; + $this->app_context = $app_context; + + $this->query_analyzer = new QueryAnalyzer( $this ); + + // The query analyzer tracks nodes, models, list types and more + // to return in headers and debug messages to help developers understand + // what was resolved, how to cache it, etc. + $this->query_analyzer->init(); + } + + /** + * @return \WPGraphQL\Utils\QueryAnalyzer + */ + public function get_query_analyzer(): QueryAnalyzer { + return $this->query_analyzer; + } + + /** + * @return mixed + */ + protected function get_field_resolver() { + return $this->field_resolver; + } + + /** + * Return the validation rules to use in the request + * + * @return array + */ + protected function get_validation_rules(): array { + $validation_rules = GraphQL::getStandardValidationRules(); + + $validation_rules['require_authentication'] = new RequireAuthentication(); + $validation_rules['disable_introspection'] = new DisableIntrospection(); + $validation_rules['query_depth'] = new QueryDepth(); + + /** + * Return the validation rules to use in the request + * + * @param array $validation_rules The validation rules to use in the request + * @param \WPGraphQL\Request $request The Request instance + */ + return apply_filters( 'graphql_validation_rules', $validation_rules, $this ); + } + + /** + * Returns the root value to use in the request. + * + * @return mixed|null + */ + protected function get_root_value() { + /** + * Set the root value based on what was passed to the request + */ + $root_value = isset( $this->data['root_value'] ) && ! empty( $this->data['root_value'] ) ? $this->data['root_value'] : null; + + /** + * Return the filtered root value + * + * @param mixed $root_value The root value the Schema should use to resolve with. Default null. + * @param \WPGraphQL\Request $request The Request instance + */ + return apply_filters( 'graphql_root_value', $root_value, $this ); + } + + /** + * Apply filters and do actions before GraphQL execution + * + * @return void + * @throws \GraphQL\Error\Error + */ + private function before_execute(): void { + + /** + * Store the global post so that it can be reset after GraphQL execution + * + * This allows for a GraphQL query to be used in the middle of post content, such as in a Shortcode + * without disrupting the flow of the post as the global POST before and after GraphQL execution will be + * the same. + */ + if ( ! empty( $GLOBALS['post'] ) ) { + $this->global_post = $GLOBALS['post']; + } + + if ( ! empty( $GLOBALS['wp_query'] ) ) { + $this->global_wp_the_query = clone $GLOBALS['wp_the_query']; + } + + /** + * If the request is a batch request it will come back as an array + */ + if ( is_array( $this->params ) ) { + + // If the request is a batch request, but batch requests are disabled, + // bail early + if ( ! $this->is_batch_queries_enabled() ) { + throw new Error( esc_html__( 'Batch Queries are not supported', 'wp-graphql' ) ); + } + + $batch_limit = get_graphql_setting( 'batch_limit', 10 ); + $batch_limit = absint( $batch_limit ) ? absint( $batch_limit ) : 10; + + // If batch requests are enabled, but a limit is set and the request exceeds the limit + // fail now + if ( $batch_limit < count( $this->params ) ) { + // translators: First placeholder is the max number of batch operations allowed in a GraphQL request. The 2nd placeholder is the number of operations requested in the current request. + throw new Error( sprintf( esc_html__( 'Batch requests are limited to %1$d operations. This request contained %2$d', 'wp-graphql' ), absint( $batch_limit ), count( $this->params ) ) ); + } + + /** + * Execute batch queries + * + * @param \GraphQL\Server\OperationParams[] $params The operation params of the batch request + */ + do_action( 'graphql_execute_batch_queries', $this->params ); + + // Process the batched requests + array_walk( $this->params, [ $this, 'do_action' ] ); + } else { + $this->do_action( $this->params ); + } + + /** + * This action runs before execution of a GraphQL request (regardless if it's a single or batch request) + * + * @param \WPGraphQL\Request $request The instance of the Request being executed + */ + do_action( 'graphql_before_execute', $this ); + } + + /** + * Checks authentication errors. + * + * False will mean there are no detected errors and + * execution will continue. + * + * Anything else (true, WP_Error, thrown exception, etc) will prevent execution of the GraphQL + * request. + * + * @return boolean + * @throws \Exception + */ + protected function has_authentication_errors() { + /** + * Bail if this is not an HTTP request. + * + * Auth for internal requests will happen + * via WordPress internals. + */ + if ( ! is_graphql_http_request() ) { + return false; + } + + /** + * Access the global $wp_rest_auth_cookie + */ + global $wp_rest_auth_cookie; + + /** + * Default state of the authentication errors + */ + $authentication_errors = false; + + /** + * Is cookie authentication NOT being used? + * + * If we get an auth error, but the user is still logged in, another auth mechanism + * (JWT, oAuth, etc) must have been used. + */ + if ( true !== $wp_rest_auth_cookie && is_user_logged_in() ) { + + /** + * Return filtered authentication errors + */ + return $this->filtered_authentication_errors( $authentication_errors ); + + /** + * If the user is not logged in, determine if there's a nonce + */ + } else { + $nonce = null; + + if ( isset( $_REQUEST['_wpnonce'] ) ) { + $nonce = $_REQUEST['_wpnonce']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + } elseif ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) { + $nonce = $_SERVER['HTTP_X_WP_NONCE']; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + } + + if ( null === $nonce ) { + // No nonce at all, so act as if it's an unauthenticated request. + wp_set_current_user( 0 ); + + return $this->filtered_authentication_errors( $authentication_errors ); + } + + // Check the nonce. + $result = wp_verify_nonce( $nonce, 'wp_rest' ); + + if ( ! $result ) { + throw new Exception( esc_html__( 'Cookie nonce is invalid', 'wp-graphql' ) ); + } + } + + /** + * Return the filtered authentication errors + */ + return $this->filtered_authentication_errors( $authentication_errors ); + } + + /** + * Filter Authentication errors. Allows plugins that authenticate to hook in and prevent + * execution if Authentication errors exist. + * + * @param boolean $authentication_errors Whether there are authentication errors with the + * request + * + * @return boolean + */ + protected function filtered_authentication_errors( $authentication_errors = false ) { + + /** + * If false, there are no authentication errors. If true, execution of the + * GraphQL request will be prevented and an error will be thrown. + * + * @param boolean $authentication_errors Whether there are authentication errors with the request + * @param \WPGraphQL\Request $request Instance of the Request + */ + return apply_filters( 'graphql_authentication_errors', $authentication_errors, $this ); + } + + /** + * Performs actions and runs filters after execution completes + * + * @param mixed|array|object $response The response from execution. Array for batch requests, + * single object for individual requests + * + * @return array + * + * @throws \Exception + */ + private function after_execute( $response ) { + + /** + * If there are authentication errors, prevent execution and throw an exception. + */ + if ( false !== $this->has_authentication_errors() ) { + throw new Exception( esc_html__( 'Authentication Error', 'wp-graphql' ) ); + } + + /** + * If the params and the $response are both arrays + * treat this as a batch request and map over the array to apply the + * after_execute_actions, otherwise apply them to the current response + */ + if ( is_array( $this->params ) && is_array( $response ) ) { + $filtered_response = []; + foreach ( $response as $key => $resp ) { + $filtered_response[] = $this->after_execute_actions( $resp, (int) $key ); + } + } else { + $filtered_response = $this->after_execute_actions( $response, null ); + } + + /** + * Reset the global post after execution + * + * This allows for a GraphQL query to be used in the middle of post content, such as in a Shortcode + * without disrupting the flow of the post as the global POST before and after GraphQL execution will be + * the same. + * + * We cannot use wp_reset_postdata here because it just resets the post from the global query which can + * be anything the because the resolvers themself can set it to whatever. So we just manually reset the + * post with setup_postdata we cached before this request. + */ + + if ( ! empty( $this->global_wp_the_query ) ) { + $GLOBALS['wp_the_query'] = $this->global_wp_the_query; // phpcs:ignore WordPress.WP.GlobalVariablesOverride + wp_reset_query(); // phpcs:ignore WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query + } + + if ( ! empty( $this->global_post ) ) { + $GLOBALS['post'] = $this->global_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride + setup_postdata( $this->global_post ); + } + + /** + * Run an action after GraphQL Execution + * + * @param array $filtered_response The response of the entire operation. Could be a single operation or a batch operation + * @param \WPGraphQL\Request $request Instance of the Request being executed + */ + do_action( 'graphql_after_execute', $filtered_response, $this ); + + /** + * Return the filtered response + */ + return $filtered_response; + } + + /** + * Apply filters and do actions after GraphQL execution + * + * @param mixed|array|object $response The response for your GraphQL request + * @param mixed|int|null $key The array key of the params for batch requests + * + * @return array + */ + private function after_execute_actions( $response, $key = null ) { + + /** + * Determine which params (batch or single request) to use when passing through to the actions + */ + $query = null; + $operation = null; + $variables = null; + $query_id = null; + + if ( $this->params instanceof OperationParams ) { + $operation = $this->params->operation; + $query = $this->params->query; + $query_id = $this->params->queryId; + $variables = $this->params->variables; + } elseif ( is_array( $this->params ) ) { + $operation = $this->params[ $key ]->operation ?? ''; + $query = $this->params[ $key ]->query ?? ''; + $query_id = $this->params[ $key ]->queryId ?? null; + $variables = $this->params[ $key ]->variables ?? null; + } + + /** + * Run an action. This is a good place for debug tools to hook in to log things, etc. + * + * @param mixed|array $response The response your GraphQL request + * @param \WPGraphQL\WPSchema $schema The schema object for the root request + * @param mixed|string|null $operation The name of the operation + * @param string $query The query that GraphQL executed + * @param array|null $variables Variables to passed to your GraphQL query + * @param \WPGraphQL\Request $request Instance of the Request + * + * @since 0.0.4 + */ + do_action( 'graphql_execute', $response, $this->schema, $operation, $query, $variables, $this ); + + /** + * Add the debug log to the request + */ + if ( ! empty( $response ) ) { + if ( is_array( $response ) ) { + $response['extensions']['debug'] = $this->debug_log->get_logs(); + } else { + $response->extensions['debug'] = $this->debug_log->get_logs(); + } + } + + /** + * Filter the $response of the GraphQL execution. This allows for the response to be filtered + * before it's returned, allowing granular control over the response at the latest point. + * + * POSSIBLE USAGE EXAMPLES: + * This could be used to ensure that certain fields never make it to the response if they match + * certain criteria, etc. For example, this filter could be used to check if a current user is + * allowed to see certain things, and if they are not, the $response could be filtered to remove + * the data they should not be allowed to see. + * + * Or, perhaps some systems want the response to always include some additional piece of data in + * every response, regardless of the request that was sent to it, this could allow for that + * to be hooked in and included in the $response. + * + * @param array $response The response for your GraphQL query + * @param \WPGraphQL\WPSchema $schema The schema object for the root query + * @param string $operation The name of the operation + * @param string $query The query that GraphQL executed + * @param array|null $variables Variables to passed to your GraphQL request + * @param \WPGraphQL\Request $request Instance of the Request + * @param string|null $query_id The query id that GraphQL executed + * + * @since 0.0.5 + */ + $filtered_response = apply_filters( 'graphql_request_results', $response, $this->schema, $operation, $query, $variables, $this, $query_id ); + + /** + * Run an action after the response has been filtered, as the response is being returned. + * This is a good place for debug tools to hook in to log things, etc. + * + * @param array $filtered_response The filtered response for the GraphQL request + * @param array $response The response for your GraphQL request + * @param \WPGraphQL\WPSchema $schema The schema object for the root request + * @param string $operation The name of the operation + * @param string $query The query that GraphQL executed + * @param array|null $variables Variables to passed to your GraphQL query + * @param \WPGraphQL\Request $request Instance of the Request + * @param string|null $query_id The query id that GraphQL executed + */ + do_action( 'graphql_return_response', $filtered_response, $response, $this->schema, $operation, $query, $variables, $this, $query_id ); + + /** + * Filter "is_graphql_request" back to false. + */ + \WPGraphQL::set_is_graphql_request( false ); + + return $filtered_response; + } + + /** + * Run action for a request. + * + * @param \GraphQL\Server\OperationParams $params OperationParams for the request. + * + * @return void + */ + private function do_action( OperationParams $params ) { + + /** + * Run an action for each request. + * + * @param ?string $query The GraphQL query + * @param ?string $operation The name of the operation + * @param ?array $variables Variables to be passed to your GraphQL request + * @param \GraphQL\Server\OperationParams $params The Operation Params. This includes any extra params, + * such as extenions or any other modifications to the request body + */ + do_action( 'do_graphql_request', $params->query, $params->operation, $params->variables, $params ); + } + + /** + * Execute an internal request (graphql() function call). + * + * @return array + * @throws \Exception + */ + public function execute() { + $helper = new WPHelper(); + + if ( ! $this->data instanceof OperationParams ) { + $this->params = $helper->parseRequestParams( 'POST', $this->data, [] ); + } else { + $this->params = $this->data; + } + + if ( is_array( $this->params ) ) { + return array_map( + function ( $data ) { + $this->data = $data; + return $this->execute(); + }, + $this->params + ); + } + + // If $this->params isnt an array or an OperationParams instance, then something probably went wrong. + if ( ! $this->params instanceof OperationParams ) { + throw new \Exception( 'Invalid request params.' ); + } + + /** + * Initialize the GraphQL Request + */ + $this->before_execute(); + $response = apply_filters( 'pre_graphql_execute_request', null, $this ); + + if ( null === $response ) { + + /** + * Allow the query string to be determined by a filter. Ex, when params->queryId is present, query can be retrieved. + */ + $query = apply_filters( + 'graphql_execute_query_params', + isset( $this->params->query ) ? $this->params->query : '', + $this->params + ); + + $result = GraphQL::executeQuery( + $this->schema, + $query, + $this->root_value, + $this->app_context, + isset( $this->params->variables ) ? $this->params->variables : null, + isset( $this->params->operation ) ? $this->params->operation : null, + $this->field_resolver, + $this->validation_rules + ); + + /** + * Return the result of the request + */ + $response = $result->toArray( $this->get_debug_flag() ); + } + + /** + * Ensure the response is returned as a proper, populated array. Otherwise add an error. + */ + if ( empty( $response ) || ! is_array( $response ) ) { + $response = [ + 'errors' => __( 'The GraphQL request returned an invalid response', 'wp-graphql' ), + ]; + } + + /** + * If the request is a batch request it will come back as an array + */ + return $this->after_execute( $response ); + } + + /** + * Execute an HTTP request. + * + * @return array + * @throws \Exception + */ + public function execute_http() { + /** + * Parse HTTP request. + */ + $helper = new WPHelper(); + $this->params = $helper->parseHttpRequest(); + + /** + * Initialize the GraphQL Request + */ + $this->before_execute(); + + /** + * Get the response. + */ + $response = apply_filters( 'pre_graphql_execute_request', null, $this ); + + /** + * If no cached response, execute the query + */ + if ( null === $response ) { + $server = $this->get_server(); + $response = $server->executeRequest( $this->params ); + } + + return $this->after_execute( $response ); + } + + /** + * Get the operation params for the request. + * + * @return \GraphQL\Server\OperationParams|\GraphQL\Server\OperationParams[] + */ + public function get_params() { + return $this->params; + } + + /** + * Returns the debug flag value + * + * @return int + */ + public function get_debug_flag() { + $flag = DebugFlag::INCLUDE_DEBUG_MESSAGE; + if ( 0 !== get_current_user_id() ) { + // Flag 2 shows the trace data, which should require user to be logged in to see by default + $flag = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE; + } + + return true === \WPGraphQL::debug() ? $flag : DebugFlag::NONE; + } + + /** + * Determines if batch queries are enabled for the server. + * + * Default is to have batch queries enabled. + * + * @return bool + */ + private function is_batch_queries_enabled() { + $batch_queries_enabled = true; + + $batch_queries_setting = get_graphql_setting( 'batch_queries_enabled', 'on' ); + if ( 'off' === $batch_queries_setting ) { + $batch_queries_enabled = false; + } + + /** + * Filter whether batch queries are supported or not + * + * @param boolean $batch_queries_enabled Whether Batch Queries should be enabled + * @param \GraphQL\Server\OperationParams $params Request operation params + */ + return apply_filters( 'graphql_is_batch_queries_enabled', $batch_queries_enabled, $this->params ); + } + + /** + * Create the GraphQL server that will process the request. + * + * @return \GraphQL\Server\StandardServer + */ + private function get_server() { + $debug_flag = $this->get_debug_flag(); + + $config = new ServerConfig(); + $config + ->setDebugFlag( $debug_flag ) + ->setSchema( $this->schema ) + ->setContext( $this->app_context ) + ->setValidationRules( $this->validation_rules ) + ->setQueryBatching( $this->is_batch_queries_enabled() ); + + if ( ! empty( $this->root_value ) ) { + $config->setFieldResolver( $this->root_value ); + } + + if ( ! empty( $this->field_resolver ) ) { + $config->setFieldResolver( $this->field_resolver ); + } + + /** + * Run an action when the server config is created. The config can be acted + * upon directly to override default values or implement new features, e.g., + * $config->setValidationRules(). + * + * @param \GraphQL\Server\ServerConfig $config Server config + * @param \GraphQL\Server\OperationParams $params Request operation params + * + * @since 0.2.0 + */ + do_action( 'graphql_server_config', $config, $this->params ); + + return new StandardServer( $config ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Router.php b/lib/wp-graphql-1.17.0/src/Router.php new file mode 100644 index 00000000..2b3e80bf --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Router.php @@ -0,0 +1,564 @@ +is_home = false; + + /** + * Whether it's a GraphQL HTTP Request + * + * @since 0.0.5 + */ + if ( ! defined( 'GRAPHQL_HTTP_REQUEST' ) ) { + define( 'GRAPHQL_HTTP_REQUEST', true ); + } + + /** + * Process the GraphQL query Request + */ + self::process_http_request(); + } + + /** + * Sends an HTTP header. + * + * @param string $key Header key. + * @param string $value Header value. + * + * @return void + * @since 0.0.5 + */ + public static function send_header( $key, $value ) { + + /** + * Sanitize as per RFC2616 (Section 4.2): + * + * Any LWS that occurs between field-content MAY be replaced with a + * single SP before interpreting the field value or forwarding the + * message downstream. + */ + $value = preg_replace( '/\s+/', ' ', $value ); + header( apply_filters( 'graphql_send_header', sprintf( '%s: %s', $key, $value ), $key, $value ) ); + } + + /** + * Sends an HTTP status code. + * + * @return void + */ + protected static function set_status() { + status_header( self::$http_status_code ); + } + + /** + * Returns an array of headers to send with the HTTP response + * + * @return array + */ + protected static function get_response_headers() { + + /** + * Filtered list of access control headers. + * + * @param array $access_control_headers Array of headers to allow. + */ + $access_control_allow_headers = apply_filters( + 'graphql_access_control_allow_headers', + [ + 'Authorization', + 'Content-Type', + ] + ); + + // For cache url header, use the domain without protocol. Path for when it's multisite. + // Remove the starting http://, https://, :// from the full hostname/path. + $host_and_path = preg_replace( '#^.*?://#', '', graphql_get_endpoint_url() ); + + $headers = [ + 'Access-Control-Allow-Origin' => '*', + 'Access-Control-Allow-Headers' => implode( ', ', $access_control_allow_headers ), + 'Access-Control-Max-Age' => 600, + // cache the result of preflight requests (600 is the upper limit for Chromium). + 'Content-Type' => 'application/json ; charset=' . get_option( 'blog_charset' ), + 'X-Robots-Tag' => 'noindex', + 'X-Content-Type-Options' => 'nosniff', + 'X-GraphQL-URL' => $host_and_path, + ]; + + + // If the Query Analyzer was instantiated + // Get the headers determined from its Analysis + if ( self::get_request() instanceof Request && self::get_request()->get_query_analyzer() instanceof QueryAnalyzer ) { + $headers = self::get_request()->get_query_analyzer()->get_headers( $headers ); + } + + if ( true === \WPGraphQL::debug() ) { + $headers['X-hacker'] = __( 'If you\'re reading this, you should visit github.com/wp-graphql/wp-graphql and contribute!', 'wp-graphql' ); + } + + /** + * Send nocache headers on authenticated requests. + * + * @param bool $rest_send_nocache_headers Whether to send no-cache headers. + * + * @since 0.0.5 + */ + $send_no_cache_headers = apply_filters( 'graphql_send_nocache_headers', is_user_logged_in() ); + if ( $send_no_cache_headers ) { + foreach ( wp_get_nocache_headers() as $no_cache_header_key => $no_cache_header_value ) { + $headers[ $no_cache_header_key ] = $no_cache_header_value; + } + } + + /** + * Filter the $headers to send + */ + return apply_filters( 'graphql_response_headers_to_send', $headers ); + } + + /** + * Set the response headers + * + * @return void + * @since 0.0.1 + */ + public static function set_headers() { + if ( false === headers_sent() ) { + + /** + * Set the HTTP response status + */ + self::set_status(); + + /** + * Get the response headers + */ + $headers = self::get_response_headers(); + + /** + * If there are headers, set them for the response + */ + if ( ! empty( $headers ) && is_array( $headers ) ) { + foreach ( $headers as $key => $value ) { + self::send_header( $key, $value ); + } + } + + /** + * Fire an action when the headers are set + * + * @param array $headers The headers sent in the response + */ + do_action( 'graphql_response_set_headers', $headers ); + } + } + + /** + * Retrieves the raw request entity (body). + * + * @since 0.0.5 + * + * @global string php://input Raw post data. + * + * @return string|false Raw request data. + */ + public static function get_raw_data() { + $input = file_get_contents( 'php://input' ); // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsRemoteFile + + return ! empty( $input ) ? $input : ''; + } + + /** + * This processes the graphql requests that come into the /graphql endpoint via an HTTP request + * + * @return mixed + * @throws \Exception Throws Exception. + * @throws \Throwable Throws Exception. + * @global WP_User $current_user The currently authenticated user. + * @since 0.0.1 + */ + public static function process_http_request() { + global $current_user; + + if ( $current_user instanceof WP_User && ! $current_user->exists() ) { + /* + * If there is no current user authenticated via other means, clear + * the cached lack of user, so that an authenticate check can set it + * properly. + * + * This is done because for authentications such as Application + * Passwords, we don't want it to be accepted unless the current HTTP + * request is a GraphQL API request, which can't always be identified early + * enough in evaluation. + * + * See serve_request in wp-includes/rest-api/class-wp-rest-server.php. + */ + $current_user = null; // phpcs:ignore WordPress.WP.GlobalVariablesOverride + } + + /** + * This action can be hooked to to enable various debug tools, + * such as enableValidation from the GraphQL Config. + * + * @since 0.0.4 + */ + do_action( 'graphql_process_http_request' ); + + /** + * Respond to pre-flight requests. + * + * Bail before Request() execution begins. + * + * @see: https://apollographql.slack.com/archives/C10HTKHPC/p1507649812000123 + * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests + */ + if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) { + self::$http_status_code = 200; + self::set_headers(); + exit; + } + + $query = ''; + $operation_name = ''; + $variables = []; + self::$request = new Request(); + + try { + $response = self::$request->execute_http(); + + // Get the operation params from the request. + $params = self::$request->get_params(); + $query = isset( $params->query ) ? $params->query : ''; + $operation_name = isset( $params->operation ) ? $params->operation : ''; + $variables = isset( $params->variables ) ? $params->variables : null; + } catch ( \Throwable $error ) { + + /** + * If there are errors, set the status to 500 + * and format the captured errors to be output properly + * + * @since 0.0.4 + */ + self::$http_status_code = 500; + + /** + * Filter thrown GraphQL errors + * + * @param array $errors Formatted errors object. + * @param \Throwable $error Thrown error. + * @param \WPGraphQL\Request $request WPGraphQL Request object. + */ + $response['errors'] = apply_filters( + 'graphql_http_request_response_errors', + [ FormattedError::createFromException( $error, self::$request->get_debug_flag() ) ], + $error, + self::$request + ); + } + + // Previously there was a small distinction between the response and the result, but + // now that we are delegating to Request, just send the response for both. + $result = $response; + + if ( false === headers_sent() ) { + self::prepare_headers( $response, $result, $query, $operation_name, $variables ); + } + + /** + * Run an action after the HTTP Response is ready to be sent back. This might be a good place for tools + * to hook in to track metrics, such as how long the process took from `graphql_process_http_request` + * to here, etc. + * + * @param array $response The GraphQL response + * @param array $result The result of the GraphQL Query + * @param string $operation_name The name of the operation + * @param string $query The request that GraphQL executed + * @param ?array $variables Variables to passed to your GraphQL query + * @param mixed $status_code The status code for the response + * + * @since 0.0.5 + */ + do_action( 'graphql_process_http_request_response', $response, $result, $operation_name, $query, $variables, self::$http_status_code ); + + /** + * Send the response + */ + wp_send_json( $response ); + } + + /** + * Prepare headers for response + * + * @param mixed|array|\GraphQL\Executor\ExecutionResult $response The response of the GraphQL Request. + * @param mixed|array|\GraphQL\Executor\ExecutionResult $graphql_results The results of the GraphQL execution. + * @param string $query The GraphQL query. + * @param string $operation_name The operation name of the GraphQL + * Request. + * @param mixed|array|null $variables The variables applied to the GraphQL + * Request. + * @param mixed|\WP_User|null $user The current user object. + * + * @return void + */ + protected static function prepare_headers( $response, $graphql_results, string $query, string $operation_name, $variables, $user = null ) { + + /** + * Filter the $status_code before setting the headers + * + * @param int $status_code The status code to apply to the headers + * @param array $response The response of the GraphQL Request + * @param array $graphql_results The results of the GraphQL execution + * @param string $query The GraphQL query + * @param string $operation_name The operation name of the GraphQL Request + * @param array $variables The variables applied to the GraphQL Request + * @param \WP_User $user The current user object + */ + self::$http_status_code = apply_filters( 'graphql_response_status_code', self::$http_status_code, $response, $graphql_results, $query, $operation_name, $variables, $user ); + + /** + * Set the response headers + */ + self::set_headers(); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Server/ValidationRules/DisableIntrospection.php b/lib/wp-graphql-1.17.0/src/Server/ValidationRules/DisableIntrospection.php new file mode 100644 index 00000000..29e037bf --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Server/ValidationRules/DisableIntrospection.php @@ -0,0 +1,24 @@ +setMaxQueryDepth( $max_query_depth ); + } + + /** + * @param \GraphQL\Validator\ValidationContext $context + * + * @return callable[]|mixed[] + */ + public function getVisitor( ValidationContext $context ) { + return $this->invokeIfNeeded( + $context, + // @phpstan-ignore-next-line + [ + NodeKind::OPERATION_DEFINITION => [ + 'leave' => function ( OperationDefinitionNode $operationDefinition ) use ( $context ): void { + $maxDepth = $this->fieldDepth( $operationDefinition ); + + if ( $maxDepth <= $this->getMaxQueryDepth() ) { + return; + } + + $context->reportError( + new Error( $this->errorMessage( $this->getMaxQueryDepth(), $maxDepth ) ) + ); + }, + ], + ] + ); + } + + /** + * Determine field depth + * + * @param mixed $node The node being analyzed + * @param int $depth The depth of the field + * @param int $maxDepth The max depth allowed + * + * @return int|mixed + */ + private function fieldDepth( $node, $depth = 0, $maxDepth = 0 ) { + if ( isset( $node->selectionSet ) && $node->selectionSet instanceof SelectionSetNode ) { + foreach ( $node->selectionSet->selections as $childNode ) { + $maxDepth = $this->nodeDepth( $childNode, $depth, $maxDepth ); + } + } + + return $maxDepth; + } + + /** + * Determine node depth + * + * @param \GraphQL\Language\AST\Node $node The node being analyzed in the operation + * @param int $depth The depth of the operation + * @param int $maxDepth The Max Depth of the operation + * + * @return int|mixed + */ + private function nodeDepth( Node $node, $depth = 0, $maxDepth = 0 ) { + switch ( true ) { + case $node instanceof FieldNode: + // node has children? + if ( isset( $node->selectionSet ) ) { + // update maxDepth if needed + if ( $depth > $maxDepth ) { + $maxDepth = $depth; + } + $maxDepth = $this->fieldDepth( $node, $depth + 1, $maxDepth ); + } + break; + + case $node instanceof InlineFragmentNode: + // node has children? + $maxDepth = $this->fieldDepth( $node, $depth, $maxDepth ); + break; + + case $node instanceof FragmentSpreadNode: + $fragment = $this->getFragment( $node ); + + if ( null !== $fragment ) { + $maxDepth = $this->fieldDepth( $fragment, $depth, $maxDepth ); + } + break; + } + + return $maxDepth; + } + + /** + * Return the maxQueryDepth allowed + * + * @return int + */ + public function getMaxQueryDepth() { + return $this->maxQueryDepth; + } + + /** + * Set max query depth. If equal to 0 no check is done. Must be greater or equal to 0. + * + * @param int $maxQueryDepth The max query depth to allow for GraphQL operations + * + * @return void + */ + public function setMaxQueryDepth( int $maxQueryDepth ) { + $this->checkIfGreaterOrEqualToZero( 'maxQueryDepth', $maxQueryDepth ); + + $this->maxQueryDepth = (int) $maxQueryDepth; + } + + /** + * Return the max query depth error message + * + * @param int $max The max number of levels to allow in GraphQL operation + * @param int $count The number of levels in the current operation + * + * @return string + */ + public function errorMessage( $max, $count ) { + return sprintf( 'The server administrator has limited the max query depth to %d, but the requested query has %d levels.', $max, $count ); + } + + /** + * Determine whether the rule should be enabled + * + * @return bool + */ + protected function isEnabled() { + $is_enabled = false; + + $enabled = get_graphql_setting( 'query_depth_enabled', 'off' ); + + if ( 'on' === $enabled && absint( $this->getMaxQueryDepth() ) && 1 <= $this->getMaxQueryDepth() ) { + $is_enabled = true; + } + + return $is_enabled; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Server/ValidationRules/RequireAuthentication.php b/lib/wp-graphql-1.17.0/src/Server/ValidationRules/RequireAuthentication.php new file mode 100644 index 00000000..b7312c96 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Server/ValidationRules/RequireAuthentication.php @@ -0,0 +1,106 @@ +ID ) { + return false; + } + + return true; + } + + /** + * @param \GraphQL\Validator\ValidationContext $context + * + * @return callable[]|mixed[] + */ + public function getVisitor( ValidationContext $context ) { + $allowed_root_fields = []; + + /** + * Filters the allowed + * + * @param array $allowed_root_fields The Root fields allowed to be requested without authentication + * @param \GraphQL\Validator\ValidationContext $context The Validation context of the field being executed. + */ + $allowed_root_fields = apply_filters( 'graphql_require_authentication_allowed_fields', $allowed_root_fields, $context ); + + return $this->invokeIfNeeded( + $context, + [ + NodeKind::FIELD => static function ( FieldNode $node ) use ( $context, $allowed_root_fields ) { + $parent_type = $context->getParentType(); + + if ( ! $parent_type instanceof Type || empty( $parent_type->name ) ) { + return; + } + + if ( ! in_array( $parent_type->name, [ 'RootQuery', 'RootSubscription', 'RootMutation' ], true ) ) { + return; + } + + if ( empty( $allowed_root_fields ) || ! is_array( $allowed_root_fields ) || ! in_array( $node->name->value, $allowed_root_fields, true ) ) { + $context->reportError( + new Error( + sprintf( + // translators: %s is the field name + __( 'The field "%s" cannot be accessed without authentication.', 'wp-graphql' ), + $context->getParentType() . '.' . $node->name->value + ), + //@phpstan-ignore-next-line + [ $node ] + ) + ); + } + }, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Server/WPHelper.php b/lib/wp-graphql-1.17.0/src/Server/WPHelper.php new file mode 100644 index 00000000..3604531d --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Server/WPHelper.php @@ -0,0 +1,99 @@ +parse_params( $bodyParams ); + + $parsed_query_params = $this->parse_extensions( wp_unslash( $queryParams ) ); + + $request_context = [ + 'method' => $method, + 'query_params' => ! empty( $parsed_query_params ) ? $parsed_query_params : null, + 'body_params' => ! empty( $parsed_body_params ) ? $parsed_body_params : null, + ]; + + /** + * Allow the request data to be filtered. Previously this filter was only + * applied to non-HTTP requests. Since 0.2.0, we will apply it to all + * requests. + * + * This is a great place to hook if you are interested in implementing + * persisted queries (and ends up being a bit more flexible than + * graphql-php's built-in persistentQueryLoader). + * + * @param array $data An array containing the pieces of the data of the GraphQL request + * @param array $request_context An array containing the both body and query params + */ + if ( 'GET' === $method ) { + $parsed_query_params = apply_filters( 'graphql_request_data', $parsed_query_params, $request_context ); + // In GET requests there cannot be any body params so it's empty. + return parent::parseRequestParams( $method, [], $parsed_query_params ); + } + + // In POST requests the query params are ignored by default but users can + // merge them into the body params manually using the $request_context if + // needed. + $parsed_body_params = apply_filters( 'graphql_request_data', $parsed_body_params, $request_context ); + return parent::parseRequestParams( $method, $parsed_body_params, [] ); + } + + /** + * Parse parameters and proxy to parse_extensions. + * + * @param array $params Request parameters. + * @return array + */ + private function parse_params( $params ) { + if ( isset( $params[0] ) ) { + return array_map( [ $this, 'parse_extensions' ], $params ); + } + + return $this->parse_extensions( $params ); + } + + /** + * Parse query extensions. + * + * @param array $params Request parameters. + * @return array + */ + private function parse_extensions( $params ) { + if ( isset( $params['extensions'] ) && is_string( $params['extensions'] ) ) { + $tmp = json_decode( $params['extensions'], true ); + if ( ! json_last_error() ) { + $params['extensions'] = $tmp; + } + } + + // Apollo server/client compatibility: look for the query id in extensions + if ( isset( $params['extensions']['persistedQuery']['sha256Hash'] ) && ! isset( $params['queryId'] ) ) { + $params['queryId'] = $params['extensions']['persistedQuery']['sha256Hash']; + unset( $params['extensions']['persistedQuery'] ); + } + + return $params; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/Comments.php b/lib/wp-graphql-1.17.0/src/Type/Connection/Comments.php new file mode 100644 index 00000000..63605618 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Connection/Comments.php @@ -0,0 +1,263 @@ + 'User', + 'resolve' => static function ( User $user, $args, $context, $info ) { + $resolver = new CommentConnectionResolver( $user, $args, $context, $info ); + + return $resolver->set_query_arg( 'user_id', absint( $user->userId ) )->get_connection(); + }, + + ] + ) + ); + + register_graphql_connection( + self::get_connection_config( + [ + 'fromType' => 'Comment', + 'toType' => 'Comment', + 'fromFieldName' => 'parent', + 'connectionTypeName' => 'CommentToParentCommentConnection', + 'oneToOne' => true, + 'resolve' => static function ( Comment $comment, $args, $context, $info ) { + $resolver = new CommentConnectionResolver( $comment, $args, $context, $info ); + + return ! empty( $comment->comment_parent_id ) ? $resolver->one_to_one()->set_query_arg( 'comment__in', [ $comment->comment_parent_id ] )->get_connection() : null; + }, + ] + ) + ); + + /** + * Register connection from Comment to children comments + */ + register_graphql_connection( + self::get_connection_config( + [ + 'fromType' => 'Comment', + 'fromFieldName' => 'replies', + 'resolve' => static function ( Comment $comment, $args, $context, $info ) { + $resolver = new CommentConnectionResolver( $comment, $args, $context, $info ); + + return $resolver->set_query_arg( 'parent', absint( $comment->commentId ) )->get_connection(); + }, + ] + ) + ); + } + + /** + * Given an array of $args, this returns the connection config, merging the provided args + * with the defaults + * + * @param array $args + * + * @return array + */ + public static function get_connection_config( $args = [] ) { + $defaults = [ + 'fromType' => 'RootQuery', + 'toType' => 'Comment', + 'fromFieldName' => 'comments', + 'connectionArgs' => self::get_connection_args(), + 'resolve' => static function ( $root, $args, $context, $info ) { + return DataSource::resolve_comments_connection( $root, $args, $context, $info ); + }, + ]; + + return array_merge( $defaults, $args ); + } + + /** + * This returns the connection args for the Comment connection + * + * @return array + */ + public static function get_connection_args() { + return [ + 'authorEmail' => [ + 'type' => 'String', + 'description' => __( 'Comment author email address.', 'wp-graphql' ), + ], + 'authorUrl' => [ + 'type' => 'String', + 'description' => __( 'Comment author URL.', 'wp-graphql' ), + ], + 'authorIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of author IDs to include comments for.', 'wp-graphql' ), + ], + 'authorNotIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of author IDs to exclude comments for.', 'wp-graphql' ), + ], + 'commentIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of comment IDs to include.', 'wp-graphql' ), + ], + 'commentNotIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of IDs of users whose unapproved comments will be returned by the query regardless of status.', 'wp-graphql' ), + ], + 'commentType' => [ + 'type' => 'String', + 'description' => __( 'Include comments of a given type.', 'wp-graphql' ), + ], + 'commentTypeIn' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'Include comments from a given array of comment types.', 'wp-graphql' ), + ], + 'commentTypeNotIn' => [ + 'type' => 'String', + 'description' => __( 'Exclude comments from a given array of comment types.', 'wp-graphql' ), + ], + 'contentAuthor' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Content object author ID to limit results by.', 'wp-graphql' ), + ], + 'contentAuthorIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of author IDs to retrieve comments for.', 'wp-graphql' ), + ], + 'contentAuthorNotIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of author IDs *not* to retrieve comments for.', 'wp-graphql' ), + ], + 'contentId' => [ + 'type' => 'ID', + 'description' => __( 'Limit results to those affiliated with a given content object ID.', 'wp-graphql' ), + ], + 'contentIdIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of content object IDs to include affiliated comments for.', 'wp-graphql' ), + ], + 'contentIdNotIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of content object IDs to exclude affiliated comments for.', 'wp-graphql' ), + ], + 'contentStatus' => [ + 'type' => [ + 'list_of' => 'PostStatusEnum', + ], + 'description' => __( 'Array of content object statuses to retrieve affiliated comments for. Pass \'any\' to match any value.', 'wp-graphql' ), + ], + 'contentType' => [ + 'type' => [ + 'list_of' => 'ContentTypeEnum', + ], + 'description' => __( 'Content object type or array of types to retrieve affiliated comments for. Pass \'any\' to match any value.', 'wp-graphql' ), + ], + 'contentName' => [ + 'type' => 'String', + 'description' => __( 'Content object name (i.e. slug ) to retrieve affiliated comments for.', 'wp-graphql' ), + ], + 'contentParent' => [ + 'type' => 'Int', + 'description' => __( 'Content Object parent ID to retrieve affiliated comments for.', 'wp-graphql' ), + ], + 'includeUnapproved' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of IDs or email addresses of users whose unapproved comments will be returned by the query regardless of $status. Default empty', 'wp-graphql' ), + ], + 'karma' => [ + 'type' => 'Int', + 'description' => __( 'Karma score to retrieve matching comments for.', 'wp-graphql' ), + ], + 'orderby' => [ + 'type' => 'CommentsConnectionOrderbyEnum', + 'description' => __( 'Field to order the comments by.', 'wp-graphql' ), + ], + 'order' => [ + 'type' => 'OrderEnum', + 'description' => __( 'The cardinality of the order of the connection', 'wp-graphql' ), + ], + 'parent' => [ + 'type' => 'Int', + 'description' => __( 'Parent ID of comment to retrieve children of.', 'wp-graphql' ), + ], + 'parentIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of parent IDs of comments to retrieve children for.', 'wp-graphql' ), + ], + 'parentNotIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of parent IDs of comments *not* to retrieve children for.', 'wp-graphql' ), + ], + 'search' => [ + 'type' => 'String', + 'description' => __( 'Search term(s) to retrieve matching comments for.', 'wp-graphql' ), + ], + 'status' => [ + 'type' => 'String', + 'description' => __( 'Comment status to limit results by.', 'wp-graphql' ), + ], + 'userId' => [ + 'type' => 'ID', + 'description' => __( 'Include comments for a specific user ID.', 'wp-graphql' ), + ], + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/MenuItems.php b/lib/wp-graphql-1.17.0/src/Type/Connection/MenuItems.php new file mode 100644 index 00000000..54033039 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Connection/MenuItems.php @@ -0,0 +1,128 @@ + 'MenuItem', + 'fromFieldName' => 'childItems', + 'resolve' => static function ( MenuItem $menu_item, $args, AppContext $context, ResolveInfo $info ) { + if ( empty( $menu_item->menuId ) || empty( $menu_item->databaseId ) ) { + return null; + } + + $resolver = new MenuItemConnectionResolver( $menu_item, $args, $context, $info ); + $resolver->set_query_arg( 'nav_menu', $menu_item->menuId ); + $resolver->set_query_arg( 'meta_key', '_menu_item_menu_item_parent' ); + $resolver->set_query_arg( 'meta_value', (int) $menu_item->databaseId ); + return $resolver->get_connection(); + }, + ] + ) + ); + + /** + * Register the MenuToMenuItemsConnection + */ + register_graphql_connection( + self::get_connection_config( + [ + 'fromType' => 'Menu', + 'toType' => 'MenuItem', + 'resolve' => static function ( Menu $menu, $args, AppContext $context, ResolveInfo $info ) { + $resolver = new MenuItemConnectionResolver( $menu, $args, $context, $info ); + $resolver->set_query_arg( + 'tax_query', + [ + [ + 'taxonomy' => 'nav_menu', + 'field' => 'term_id', + 'terms' => (int) $menu->menuId, + 'include_children' => true, + 'operator' => 'IN', + ], + ] + ); + + return $resolver->get_connection(); + }, + ] + ) + ); + } + + /** + * Given an array of $args, returns the args for the connection with the provided args merged + * + * @param array $args + * + * @return array + */ + public static function get_connection_config( $args = [] ) { + return array_merge( + [ + 'fromType' => 'RootQuery', + 'fromFieldName' => 'menuItems', + 'toType' => 'MenuItem', + 'connectionArgs' => [ + 'id' => [ + 'type' => 'Int', + 'description' => __( 'The database ID of the object', 'wp-graphql' ), + ], + 'location' => [ + 'type' => 'MenuLocationEnum', + 'description' => __( 'The menu location for the menu being queried', 'wp-graphql' ), + ], + 'parentId' => [ + 'type' => 'ID', + 'description' => __( 'The ID of the parent menu object', 'wp-graphql' ), + ], + 'parentDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'The database ID of the parent menu object', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new MenuItemConnectionResolver( $source, $args, $context, $info ); + $connection = $resolver->get_connection(); + + return $connection; + }, + ], + $args + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/PostObjects.php b/lib/wp-graphql-1.17.0/src/Type/Connection/PostObjects.php new file mode 100644 index 00000000..fa577221 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Connection/PostObjects.php @@ -0,0 +1,599 @@ + 'ContentType', + 'toType' => 'ContentNode', + 'fromFieldName' => 'contentNodes', + 'connectionArgs' => self::get_connection_args(), + 'queryClass' => 'WP_Query', + 'resolve' => static function ( PostType $post_type, $args, AppContext $context, ResolveInfo $info ) { + $resolver = new PostObjectConnectionResolver( $post_type, $args, $context, $info ); + $resolver->set_query_arg( 'post_type', $post_type->name ); + + return $resolver->get_connection(); + }, + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'Comment', + 'toType' => 'ContentNode', + 'queryClass' => 'WP_Query', + 'oneToOne' => true, + 'fromFieldName' => 'commentedOn', + 'resolve' => static function ( Comment $comment, $args, AppContext $context, ResolveInfo $info ) { + if ( empty( $comment->comment_post_ID ) || ! absint( $comment->comment_post_ID ) ) { + return null; + } + $id = absint( $comment->comment_post_ID ); + $resolver = new PostObjectConnectionResolver( $comment, $args, $context, $info, 'any' ); + + return $resolver->one_to_one()->set_query_arg( 'p', $id )->set_query_arg( 'post_parent', null )->get_connection(); + }, + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'NodeWithRevisions', + 'toType' => 'ContentNode', + 'fromFieldName' => 'revisionOf', + 'description' => __( 'If the current node is a revision, this field exposes the node this is a revision of. Returns null if the node is not a revision of another node.', 'wp-graphql' ), + 'oneToOne' => true, + 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { + if ( ! $post->isRevision || ! isset( $post->parentDatabaseId ) || ! absint( $post->parentDatabaseId ) ) { + return null; + } + + $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info ); + $resolver->set_query_arg( 'p', $post->parentDatabaseId ); + + return $resolver->one_to_one()->get_connection(); + }, + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'RootQuery', + 'toType' => 'ContentNode', + 'queryClass' => 'WP_Query', + 'fromFieldName' => 'contentNodes', + 'connectionArgs' => self::get_connection_args(), + 'resolve' => static function ( $source, $args, $context, $info ) { + $post_types = isset( $args['where']['contentTypes'] ) && is_array( $args['where']['contentTypes'] ) ? $args['where']['contentTypes'] : \WPGraphQL::get_allowed_post_types(); + + return DataSource::resolve_post_objects_connection( $source, $args, $context, $info, $post_types ); + }, + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'HierarchicalContentNode', + 'toType' => 'ContentNode', + 'fromFieldName' => 'parent', + 'connectionTypeName' => 'HierarchicalContentNodeToParentContentNodeConnection', + 'description' => __( 'The parent of the node. The parent object can be of various types', 'wp-graphql' ), + 'oneToOne' => true, + 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { + if ( ! isset( $post->parentDatabaseId ) || ! absint( $post->parentDatabaseId ) ) { + return null; + } + + $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info ); + $resolver->set_query_arg( 'p', $post->parentDatabaseId ); + + return $resolver->one_to_one()->get_connection(); + }, + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'HierarchicalContentNode', + 'fromFieldName' => 'children', + 'toType' => 'ContentNode', + 'connectionTypeName' => 'HierarchicalContentNodeToContentNodeChildrenConnection', + 'connectionArgs' => self::get_connection_args(), + 'queryClass' => 'WP_Query', + 'resolve' => static function ( Post $post, $args, $context, $info ) { + if ( $post->isRevision ) { + $id = $post->parentDatabaseId; + } else { + $id = $post->ID; + } + + $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info, 'any' ); + $resolver->set_query_arg( 'post_parent', $id ); + + return $resolver->get_connection(); + }, + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'HierarchicalContentNode', + 'toType' => 'ContentNode', + 'fromFieldName' => 'ancestors', + 'connectionArgs' => self::get_connection_args(), + 'connectionTypeName' => 'HierarchicalContentNodeToContentNodeAncestorsConnection', + 'queryClass' => 'WP_Query', + 'description' => __( 'Returns ancestors of the node. Default ordered as lowest (closest to the child) to highest (closest to the root).', 'wp-graphql' ), + 'resolve' => static function ( Post $post, $args, $context, $info ) { + $ancestors = get_ancestors( $post->ID, '', 'post_type' ); + if ( empty( $ancestors ) || ! is_array( $ancestors ) ) { + return null; + } + $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info ); + $resolver->set_query_arg( 'post__in', $ancestors ); + $resolver->set_query_arg( 'orderby', 'post__in' ); + + return $resolver->get_connection(); + }, + ] + ); + + /** + * Register Connections to PostObjects + * + * @var \WP_Post_Type[] $allowed_post_types + */ + $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects' ); + + foreach ( $allowed_post_types as $post_type_object ) { + + /** + * Registers the RootQuery connection for each post_type + */ + if ( true === $post_type_object->graphql_register_root_connection && 'revision' !== $post_type_object->name ) { + $root_query_from_field_name = Utils::format_field_name( $post_type_object->graphql_plural_name ); + + // Prevent field name conflicts with the singular PostObject type. + if ( $post_type_object->graphql_single_name === $post_type_object->graphql_plural_name ) { + $root_query_from_field_name = 'all' . ucfirst( $post_type_object->graphql_single_name ); + } + + register_graphql_connection( + self::get_connection_config( + $post_type_object, + [ + 'fromFieldName' => $root_query_from_field_name, + ] + ) + ); + } + + /** + * Any post type that supports author should have a connection from User->Author + */ + if ( true === post_type_supports( $post_type_object->name, 'author' ) ) { + + /** + * Registers the User connection for each post_type + */ + register_graphql_connection( + self::get_connection_config( + $post_type_object, + [ + 'fromType' => 'User', + 'resolve' => static function ( User $user, $args, AppContext $context, ResolveInfo $info ) use ( $post_type_object ) { + $resolver = new PostObjectConnectionResolver( $user, $args, $context, $info, $post_type_object->name ); + $resolver->set_query_arg( 'author', $user->userId ); + + return $resolver->get_connection(); + }, + ] + ) + ); + } + } + } + + /** + * Given the Post Type Object and an array of args, this returns an array of args for use in + * registering a connection. + * + * @param mixed|\WP_Post_Type|\WP_Taxonomy $graphql_object The post type object for the post_type having a + * connection registered to it + * @param array $args The custom args to modify the connection registration + * + * @return array + */ + public static function get_connection_config( $graphql_object, $args = [] ) { + $connection_args = self::get_connection_args( [], $graphql_object ); + + if ( 'revision' === $graphql_object->name ) { + unset( $connection_args['status'] ); + unset( $connection_args['stati'] ); + } + + return array_merge( + [ + 'fromType' => 'RootQuery', + 'toType' => $graphql_object->graphql_single_name, + 'queryClass' => 'WP_Query', + 'fromFieldName' => lcfirst( $graphql_object->graphql_plural_name ), + 'connectionArgs' => $connection_args, + 'resolve' => static function ( $root, $args, $context, $info ) use ( $graphql_object ) { + return DataSource::resolve_post_objects_connection( $root, $args, $context, $info, $graphql_object->name ); + }, + ], + $args + ); + } + + /** + * Given an optional array of args, this returns the args to be used in the connection + * + * @param array $args The args to modify the defaults + * @param mixed|\WP_Post_Type|\WP_Taxonomy $post_type_object The post type the connection is going to + * + * @return array + */ + public static function get_connection_args( $args = [], $post_type_object = null ) { + $fields = [ + /** + * Search Parameter + * + * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter + * @since 0.0.5 + */ + 'search' => [ + 'name' => 'search', + 'type' => 'String', + 'description' => __( 'Show Posts based on a keyword search', 'wp-graphql' ), + ], + + /** + * Post & Page Parameters + * + * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Post_.26_Page_Parameters + * @since 0.0.5 + */ + 'id' => [ + 'type' => 'Int', + 'description' => __( 'Specific database ID of the object', 'wp-graphql' ), + ], + 'in' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of IDs for the objects to retrieve', 'wp-graphql' ), + ], + 'notIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Specify IDs NOT to retrieve. If this is used in the same query as "in", it will be ignored', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'Slug / post_name of the object', 'wp-graphql' ), + ], + 'nameIn' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'Specify objects to retrieve. Use slugs', 'wp-graphql' ), + ], + 'parent' => [ + 'type' => 'ID', + 'description' => __( 'Use ID to return only children. Use 0 to return only top-level items', 'wp-graphql' ), + ], + 'parentIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Specify objects whose parent is in an array', 'wp-graphql' ), + ], + 'parentNotIn' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Specify posts whose parent is not in an array', 'wp-graphql' ), + ], + 'title' => [ + 'type' => 'String', + 'description' => __( 'Title of the object', 'wp-graphql' ), + ], + + /** + * Password parameters + * + * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Password_Parameters + * @since 0.0.2 + */ + 'hasPassword' => [ + 'type' => 'Boolean', + 'description' => __( 'True for objects with passwords; False for objects without passwords; null for all objects with or without passwords', 'wp-graphql' ), + ], + 'password' => [ + 'type' => 'String', + 'description' => __( 'Show posts with a specific password.', 'wp-graphql' ), + ], + + /** + * NOTE: post_type is intentionally not supported on connections to Single post types as + * the connection to the singular Post Type already sets this argument as the entry + * point to the Graph + * + * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters + * @since 0.0.2 + */ + + /** + * Status parameters + * + * @see : https://developer.wordpress.org/reference/classes/wp_query/#status-parameters + * @since 0.0.2 + */ + 'status' => [ + 'type' => 'PostStatusEnum', + 'description' => __( 'Show posts with a specific status.', 'wp-graphql' ), + ], + 'stati' => [ + 'type' => [ + 'list_of' => 'PostStatusEnum', + ], + 'description' => __( 'Retrieve posts where post status is in an array.', 'wp-graphql' ), + ], + + /** + * Order & Orderby parameters + * + * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters + * @since 0.0.2 + */ + 'orderby' => [ + 'type' => [ + 'list_of' => 'PostObjectsConnectionOrderbyInput', + ], + 'description' => __( 'What parameter to use to order the objects by.', 'wp-graphql' ), + ], + + /** + * Date parameters + * + * @see https://developer.wordpress.org/reference/classes/wp_query/#date-parameters + */ + 'dateQuery' => [ + 'type' => 'DateQueryInput', + 'description' => __( 'Filter the connection based on dates', 'wp-graphql' ), + ], + + /** + * Mime type parameters + * + * @see https://developer.wordpress.org/reference/classes/wp_query/#mime-type-parameters + */ + 'mimeType' => [ + 'type' => 'MimeTypeEnum', + 'description' => __( 'Get objects with a specific mimeType property', 'wp-graphql' ), + ], + ]; + + /** + * If the connection is to a single post type, add additional arguments. + * + * If the connection is to many post types, the `$post_type_object` will not be an instance + * of \WP_Post_Type, and we should not add these additional arguments because it + * confuses the connection args for connections of plural post types. + * + * For example, if you have one Post Type that supports author and another that doesn't + * we don't want to expose the `author` filter for a plural connection of multiple post types + * as it's misleading to be able to filter by author on a post type that doesn't have + * authors. + * + * If folks want to enable these arguments, they can filter them back in per-connection, but + * by default WPGraphQL is exposing the least common denominator (the fields that are shared + * by _all_ post types in a multi-post-type connection) + * + * Here's a practical example: + * + * Lets's say you register a "House" post type and it doesn't support author. + * + * The "House" Post Type will show in the `contentNodes` connection, which is a connection + * to many post types. + * + * We could (pseudo code) query like so: + * + * { + * contentNodes( where: { contentTypes: [ HOUSE ] ) { + * nodes { + * id + * title + * ...on House { + * ...someHouseFields + * } + * } + * } + * } + * + * But since houses don't have authors, it doesn't make sense to have WPGraphQL expose the + * ability to query four houses filtered by author. + * + * ``` + *{ + * contentNodes( where: { author: "some author input" contentTypes: [ HOUSE ] ) { + * nodes { + * id + * title + * ...on House { + * ...someHouseFields + * } + * } + * } + * } + * ``` + * + * We want to output filters on connections based on what's actually possible, and filtering + * houses by author isn't possible, so exposing it in the Schema is quite misleading to + * consumers. + */ + if ( isset( $post_type_object ) && $post_type_object instanceof WP_Post_Type ) { + + /** + * Add arguments to post types that support author + */ + if ( true === post_type_supports( $post_type_object->name, 'author' ) ) { + /** + * Author $args + * + * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters + * @since 0.0.5 + */ + $fields['author'] = [ + 'type' => 'Int', + 'description' => __( 'The user that\'s connected as the author of the object. Use the userId for the author object.', 'wp-graphql' ), + ]; + $fields['authorName'] = [ + 'type' => 'String', + 'description' => __( 'Find objects connected to the author by the author\'s nicename', 'wp-graphql' ), + ]; + $fields['authorIn'] = [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Find objects connected to author(s) in the array of author\'s userIds', 'wp-graphql' ), + ]; + $fields['authorNotIn'] = [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Find objects NOT connected to author(s) in the array of author\'s userIds', 'wp-graphql' ), + ]; + } + + $connected_taxonomies = get_object_taxonomies( $post_type_object->name ); + if ( ! empty( $connected_taxonomies ) && in_array( 'category', $connected_taxonomies, true ) ) { + /** + * Category $args + * + * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters + * @since 0.0.5 + */ + $fields['categoryId'] = [ + 'type' => 'Int', + 'description' => __( 'Category ID', 'wp-graphql' ), + ]; + $fields['categoryName'] = [ + 'type' => 'String', + 'description' => __( 'Use Category Slug', 'wp-graphql' ), + ]; + $fields['categoryIn'] = [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of category IDs, used to display objects from one category OR another', 'wp-graphql' ), + ]; + $fields['categoryNotIn'] = [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of category IDs, used to display objects from one category OR another', 'wp-graphql' ), + ]; + } + + if ( ! empty( $connected_taxonomies ) && in_array( 'post_tag', $connected_taxonomies, true ) ) { + /** + * Tag $args + * + * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters + * @since 0.0.5 + */ + $fields['tag'] = [ + 'type' => 'String', + 'description' => __( 'Tag Slug', 'wp-graphql' ), + ]; + $fields['tagId'] = [ + 'type' => 'String', + 'description' => __( 'Use Tag ID', 'wp-graphql' ), + ]; + $fields['tagIn'] = [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of tag IDs, used to display objects from one tag OR another', 'wp-graphql' ), + ]; + $fields['tagNotIn'] = [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of tag IDs, used to display objects from one tag OR another', 'wp-graphql' ), + ]; + $fields['tagSlugAnd'] = [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'Array of tag slugs, used to display objects from one tag AND another', 'wp-graphql' ), + ]; + $fields['tagSlugIn'] = [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'Array of tag slugs, used to include objects in ANY specified tags', 'wp-graphql' ), + ]; + } + } elseif ( $post_type_object instanceof WP_Taxonomy ) { + /** + * Taxonomy-specific Content Type $args + * + * @see : https://developer.wordpress.org/reference/classes/wp_query/#post-type-parameters + */ + $args['contentTypes'] = [ + 'type' => [ 'list_of' => 'ContentTypesOf' . \WPGraphQL\Utils\Utils::format_type_name( $post_type_object->graphql_single_name ) . 'Enum' ], + 'description' => __( 'The Types of content to filter', 'wp-graphql' ), + ]; + } else { + /** + * Handle cases when the connection is for many post types + */ + + /** + * Content Type $args + * + * @see : https://developer.wordpress.org/reference/classes/wp_query/#post-type-parameters + */ + $args['contentTypes'] = [ + 'type' => [ 'list_of' => 'ContentTypeEnum' ], + 'description' => __( 'The Types of content to filter', 'wp-graphql' ), + ]; + } + + return array_merge( $fields, $args ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/Taxonomies.php b/lib/wp-graphql-1.17.0/src/Type/Connection/Taxonomies.php new file mode 100644 index 00000000..61fe35fb --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Connection/Taxonomies.php @@ -0,0 +1,44 @@ + 'RootQuery', + 'toType' => 'Taxonomy', + 'fromFieldName' => 'taxonomies', + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new TaxonomyConnectionResolver( $source, $args, $context, $info ); + return $resolver->get_connection(); + }, + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'ContentType', + 'toType' => 'Taxonomy', + 'fromFieldName' => 'connectedTaxonomies', + 'resolve' => static function ( PostType $source, $args, $context, $info ) { + if ( empty( $source->taxonomies ) ) { + return null; + } + $resolver = new TaxonomyConnectionResolver( $source, $args, $context, $info ); + $resolver->setQueryArg( 'in', $source->taxonomies ); + return $resolver->get_connection(); + }, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/TermObjects.php b/lib/wp-graphql-1.17.0/src/Type/Connection/TermObjects.php new file mode 100644 index 00000000..a8f054c4 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Connection/TermObjects.php @@ -0,0 +1,220 @@ + 'RootQuery', + 'toType' => 'TermNode', + 'queryClass' => 'WP_Term_Query', + 'fromFieldName' => 'terms', + 'connectionArgs' => self::get_connection_args( + [ + 'taxonomies' => [ + 'type' => [ 'list_of' => 'TaxonomyEnum' ], + 'description' => __( 'The Taxonomy to filter terms by', 'wp-graphql' ), + ], + ] + ), + 'resolve' => static function ( $source, $args, $context, $info ) { + $taxonomies = isset( $args['where']['taxonomies'] ) && is_array( $args['where']['taxonomies'] ) ? $args['where']['taxonomies'] : \WPGraphQL::get_allowed_taxonomies(); + $resolver = new TermObjectConnectionResolver( $source, $args, $context, $info, array_values( $taxonomies ) ); + $connection = $resolver->get_connection(); + + return $connection; + }, + ] + ); + + /** @var \WP_Taxonomy[] $allowed_taxonomies */ + $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); + + /** + * Loop through the allowed_taxonomies to register appropriate connections + */ + foreach ( $allowed_taxonomies as $tax_object ) { + if ( ! $tax_object->graphql_register_root_connection ) { + continue; + } + + $root_query_from_field_name = Utils::format_field_name( $tax_object->graphql_plural_name ); + + // Prevent field name conflicts with the singular TermObject type. + if ( $tax_object->graphql_single_name === $tax_object->graphql_plural_name ) { + $root_query_from_field_name = 'all' . ucfirst( $tax_object->graphql_single_name ); + } + + /** + * Registers the RootQuery connection for each allowed taxonomy's TermObjects + */ + register_graphql_connection( + self::get_connection_config( + $tax_object, + [ + 'fromFieldName' => $root_query_from_field_name, + ] + ) + ); + } + } + + /** + * Given the Taxonomy Object and an array of args, this returns an array of args for use in + * registering a connection. + * + * @param \WP_Taxonomy $tax_object The taxonomy object for the taxonomy having a + * connection registered to it + * @param array $args The custom args to modify the connection registration + * + * @return array + */ + public static function get_connection_config( $tax_object, $args = [] ) { + $defaults = [ + 'fromType' => 'RootQuery', + 'queryClass' => 'WP_Term_Query', + 'toType' => $tax_object->graphql_single_name, + 'fromFieldName' => $tax_object->graphql_plural_name, + 'connectionArgs' => self::get_connection_args(), + 'resolve' => static function ( $root, $args, $context, $info ) use ( $tax_object ) { + return DataSource::resolve_term_objects_connection( $root, $args, $context, $info, $tax_object->name ); + }, + ]; + + return array_merge( $defaults, $args ); + } + + /** + * Given an optional array of args, this returns the args to be used in the connection + * + * @param array $args The args to modify the defaults + * + * @return array + */ + public static function get_connection_args( $args = [] ) { + return array_merge( + [ + 'childless' => [ + 'type' => 'Boolean', + 'description' => __( 'True to limit results to terms that have no children. This parameter has no effect on non-hierarchical taxonomies. Default false.', 'wp-graphql' ), + ], + 'childOf' => [ + 'type' => 'Int', + 'description' => __( 'Term ID to retrieve child terms of. If multiple taxonomies are passed, $child_of is ignored. Default 0.', 'wp-graphql' ), + ], + 'cacheDomain' => [ + 'type' => 'String', + 'description' => __( 'Unique cache key to be produced when this query is stored in an object cache. Default is \'core\'.', 'wp-graphql' ), + ], + 'descriptionLike' => [ + 'type' => 'String', + 'description' => __( 'Retrieve terms where the description is LIKE the input value. Default empty.', 'wp-graphql' ), + ], + 'exclude' => [ // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of term ids to exclude. If $include is non-empty, $exclude is ignored. Default empty array.', 'wp-graphql' ), + ], + 'excludeTree' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of term ids to exclude along with all of their descendant terms. If $include is non-empty, $exclude_tree is ignored. Default empty array.', 'wp-graphql' ), + ], + 'hideEmpty' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to hide terms not assigned to any posts. Accepts true or false. Default false', 'wp-graphql' ), + ], + 'hierarchical' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to include terms that have non-empty descendants (even if $hide_empty is set to true). Default true.', 'wp-graphql' ), + ], + 'include' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of term ids to include. Default empty array.', 'wp-graphql' ), + ], + 'name' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'Array of names to return term(s) for. Default empty.', 'wp-graphql' ), + ], + 'nameLike' => [ + 'type' => 'String', + 'description' => __( 'Retrieve terms where the name is LIKE the input value. Default empty.', 'wp-graphql' ), + ], + 'objectIds' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of object IDs. Results will be limited to terms associated with these objects.', 'wp-graphql' ), + ], + 'orderby' => [ + 'type' => 'TermObjectsConnectionOrderbyEnum', + 'description' => __( 'Field(s) to order terms by. Defaults to \'name\'.', 'wp-graphql' ), + ], + 'order' => [ + 'type' => 'OrderEnum', + 'description' => __( 'Direction the connection should be ordered in', 'wp-graphql' ), + ], + 'padCounts' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to pad the quantity of a term\'s children in the quantity of each term\'s "count" object variable. Default false.', 'wp-graphql' ), + ], + 'parent' => [ + 'type' => 'Int', + 'description' => __( 'Parent term ID to retrieve direct-child terms of. Default empty.', 'wp-graphql' ), + ], + 'search' => [ + 'type' => 'String', + 'description' => __( 'Search criteria to match terms. Will be SQL-formatted with wildcards before and after. Default empty.', 'wp-graphql' ), + ], + 'slug' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'Array of slugs to return term(s) for. Default empty.', 'wp-graphql' ), + ], + 'termTaxonomId' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of term taxonomy IDs, to match when querying terms.', 'wp-graphql' ), + 'deprecationReason' => __( 'Use `termTaxonomyId` instead', 'wp-graphql' ), + ], + 'termTaxonomyId' => [ + 'type' => [ + 'list_of' => 'ID', + ], + 'description' => __( 'Array of term taxonomy IDs, to match when querying terms.', 'wp-graphql' ), + ], + 'updateTermMetaCache' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to prime meta caches for matched terms. Default true.', 'wp-graphql' ), + ], + ], + $args + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/Users.php b/lib/wp-graphql-1.17.0/src/Type/Connection/Users.php new file mode 100644 index 00000000..347f7ef1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Connection/Users.php @@ -0,0 +1,207 @@ + 'RootQuery', + 'toType' => 'User', + 'fromFieldName' => 'users', + 'resolve' => static function ( $source, $args, $context, $info ) { + return DataSource::resolve_users_connection( $source, $args, $context, $info ); + }, + 'connectionArgs' => self::get_connection_args(), + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'ContentNode', + 'toType' => 'User', + 'connectionTypeName' => 'ContentNodeToEditLockConnection', + 'edgeFields' => [ + 'lockTimestamp' => [ + 'type' => 'String', + 'description' => __( 'The timestamp for when the node was last edited', 'wp-graphql' ), + 'resolve' => static function ( $edge ) { + if ( isset( $edge['source'] ) && ( $edge['source'] instanceof Post ) ) { + $edit_lock = $edge['source']->editLock; + $time = ( is_array( $edit_lock ) && ! empty( $edit_lock[0] ) ) ? $edit_lock[0] : null; + return ! empty( $time ) ? Utils::prepare_date_response( $time, gmdate( 'Y-m-d H:i:s', $time ) ) : null; + } + return null; + }, + ], + ], + 'fromFieldName' => 'editingLockedBy', + 'description' => __( 'If a user has edited the node within the past 15 seconds, this will return the user that last edited. Null if the edit lock doesn\'t exist or is greater than 15 seconds', 'wp-graphql' ), + 'oneToOne' => true, + 'resolve' => static function ( Post $source, $args, $context, $info ) { + if ( ! isset( $source->editLock[1] ) || ! absint( $source->editLock[1] ) ) { + return null; + } + + $resolver = new UserConnectionResolver( $source, $args, $context, $info ); + $resolver->one_to_one()->set_query_arg( 'include', [ absint( $source->editLock[1] ) ] ); + + return $resolver->get_connection(); + }, + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'ContentNode', + 'toType' => 'User', + 'fromFieldName' => 'lastEditedBy', + 'connectionTypeName' => 'ContentNodeToEditLastConnection', + 'description' => __( 'The user that most recently edited the node', 'wp-graphql' ), + 'oneToOne' => true, + 'resolve' => static function ( Post $source, $args, $context, $info ) { + if ( empty( $source->editLastId ) ) { + return null; + } + + $resolver = new UserConnectionResolver( $source, $args, $context, $info ); + $resolver->set_query_arg( 'include', [ absint( $source->editLastId ) ] ); + return $resolver->one_to_one()->get_connection(); + }, + ] + ); + + register_graphql_connection( + [ + 'fromType' => 'NodeWithAuthor', + 'toType' => 'User', + 'fromFieldName' => 'author', + 'oneToOne' => true, + 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { + if ( empty( $post->authorDatabaseId ) ) { + return null; + } + + $resolver = new UserConnectionResolver( $post, $args, $context, $info ); + $resolver->set_query_arg( 'include', [ absint( $post->authorDatabaseId ) ] ); + return $resolver->one_to_one()->get_connection(); + }, + ] + ); + } + + /** + * Returns the connection args for use in the connection + * + * @return array + */ + public static function get_connection_args() { + return [ + 'role' => [ + 'type' => 'UserRoleEnum', + 'description' => __( 'An array of role names that users must match to be included in results. Note that this is an inclusive list: users must match *each* role.', 'wp-graphql' ), + ], + 'roleIn' => [ + 'type' => [ + 'list_of' => 'UserRoleEnum', + ], + 'description' => __( 'An array of role names. Matched users must have at least one of these roles.', 'wp-graphql' ), + ], + 'roleNotIn' => [ + 'type' => [ + 'list_of' => 'UserRoleEnum', + ], + 'description' => __( 'An array of role names to exclude. Users matching one or more of these roles will not be included in results.', 'wp-graphql' ), + ], + 'include' => [ + 'type' => [ + 'list_of' => 'Int', + ], + 'description' => __( 'Array of userIds to include.', 'wp-graphql' ), + ], + 'exclude' => [ // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude + 'type' => [ + 'list_of' => 'Int', + ], + 'description' => __( 'Array of userIds to exclude.', 'wp-graphql' ), + ], + 'search' => [ + 'type' => 'String', + 'description' => __( 'Search keyword. Searches for possible string matches on columns. When "searchColumns" is left empty, it tries to determine which column to search in based on search string.', 'wp-graphql' ), + ], + 'searchColumns' => [ + 'type' => [ + 'list_of' => 'UsersConnectionSearchColumnEnum', + ], + 'description' => __( 'Array of column names to be searched. Accepts \'ID\', \'login\', \'nicename\', \'email\', \'url\'.', 'wp-graphql' ), + ], + 'hasPublishedPosts' => [ + 'type' => [ + 'list_of' => 'ContentTypeEnum', + ], + 'description' => __( 'Pass an array of post types to filter results to users who have published posts in those post types.', 'wp-graphql' ), + ], + 'nicename' => [ + 'type' => 'String', + 'description' => __( 'The user nicename.', 'wp-graphql' ), + ], + 'nicenameIn' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'An array of nicenames to include. Users matching one of these nicenames will be included in results.', 'wp-graphql' ), + ], + 'nicenameNotIn' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'An array of nicenames to exclude. Users matching one of these nicenames will not be included in results.', 'wp-graphql' ), + ], + 'login' => [ + 'type' => 'String', + 'description' => __( 'The user login.', 'wp-graphql' ), + ], + 'loginIn' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'An array of logins to include. Users matching one of these logins will be included in results.', 'wp-graphql' ), + ], + 'loginNotIn' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'An array of logins to exclude. Users matching one of these logins will not be included in results.', 'wp-graphql' ), + ], + 'orderby' => [ + 'type' => [ + 'list_of' => 'UsersConnectionOrderbyInput', + ], + 'description' => __( 'What parameter to use to order the objects by.', 'wp-graphql' ), + ], + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/AvatarRatingEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/AvatarRatingEnum.php new file mode 100644 index 00000000..8d071dbd --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/AvatarRatingEnum.php @@ -0,0 +1,37 @@ + __( "What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are judged in that order. Default is the value of the 'avatar_rating' option", 'wp-graphql' ), + 'values' => [ + 'G' => [ + 'description' => 'Indicates a G level avatar rating level.', + 'value' => 'G', + ], + 'PG' => [ + 'description' => 'Indicates a PG level avatar rating level.', + 'value' => 'PG', + ], + 'R' => [ + 'description' => 'Indicates an R level avatar rating level.', + 'value' => 'R', + ], + 'X' => [ + 'description' => 'Indicates an X level avatar rating level.', + 'value' => 'X', + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/CommentNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/CommentNodeIdTypeEnum.php new file mode 100644 index 00000000..e5250288 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/CommentNodeIdTypeEnum.php @@ -0,0 +1,36 @@ + __( 'The Type of Identifier used to fetch a single comment node. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), + 'values' => [ + 'ID' => [ + 'name' => 'ID', + 'value' => 'global_id', + 'description' => __( 'Identify a resource by the (hashed) Global ID.', 'wp-graphql' ), + ], + 'DATABASE_ID' => [ + 'name' => 'DATABASE_ID', + 'value' => 'database_id', + 'description' => __( 'Identify a resource by the Database ID.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/CommentStatusEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/CommentStatusEnum.php new file mode 100644 index 00000000..560d8238 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/CommentStatusEnum.php @@ -0,0 +1,38 @@ + $name ) { + $values[ WPEnumType::get_safe_name( $status ) ] = [ + // translators: %s is the name of the comment status + 'description' => sprintf( __( 'Comments with the %1$s status', 'wp-graphql' ), $name ), + 'value' => $status, + ]; + } + + register_graphql_enum_type( + 'CommentStatusEnum', + [ + 'description' => __( 'The status of the comment object.', 'wp-graphql' ), + 'values' => $values, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/CommentsConnectionOrderbyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/CommentsConnectionOrderbyEnum.php new file mode 100644 index 00000000..45b8ec9e --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/CommentsConnectionOrderbyEnum.php @@ -0,0 +1,85 @@ + __( 'Options for ordering the connection', 'wp-graphql' ), + 'values' => [ + 'COMMENT_AGENT' => [ + 'description' => __( 'Order by browser user agent of the commenter.', 'wp-graphql' ), + 'value' => 'comment_agent', + ], + 'COMMENT_APPROVED' => [ + 'description' => __( 'Order by approval status of the comment.', 'wp-graphql' ), + 'value' => 'comment_approved', + ], + 'COMMENT_AUTHOR' => [ + 'description' => __( 'Order by name of the comment author.', 'wp-graphql' ), + 'value' => 'comment_author', + ], + 'COMMENT_AUTHOR_EMAIL' => [ + 'description' => __( 'Order by e-mail of the comment author.', 'wp-graphql' ), + 'value' => 'comment_author_email', + ], + 'COMMENT_AUTHOR_IP' => [ + 'description' => __( 'Order by IP address of the comment author.', 'wp-graphql' ), + 'value' => 'comment_author_IP', + ], + 'COMMENT_AUTHOR_URL' => [ + 'description' => __( 'Order by URL address of the comment author.', 'wp-graphql' ), + 'value' => 'comment_author_url', + ], + 'COMMENT_CONTENT' => [ + 'description' => __( 'Order by the comment contents.', 'wp-graphql' ), + 'value' => 'comment_content', + ], + 'COMMENT_DATE' => [ + 'description' => __( 'Order by date/time timestamp of the comment.', 'wp-graphql' ), + 'value' => 'comment_date', + ], + 'COMMENT_DATE_GMT' => [ + 'description' => __( 'Order by GMT timezone date/time timestamp of the comment.', 'wp-graphql' ), + 'value' => 'comment_date_gmt', + ], + 'COMMENT_ID' => [ + 'description' => __( 'Order by the globally unique identifier for the comment object', 'wp-graphql' ), + 'value' => 'comment_ID', + ], + 'COMMENT_IN' => [ + 'description' => __( 'Order by the array list of comment IDs listed in the where clause.', 'wp-graphql' ), + 'value' => 'comment__in', + ], + 'COMMENT_KARMA' => [ + 'description' => __( 'Order by the comment karma score.', 'wp-graphql' ), + 'value' => 'comment_karma', + ], + 'COMMENT_PARENT' => [ + 'description' => __( 'Order by the comment parent ID.', 'wp-graphql' ), + 'value' => 'comment_parent', + ], + 'COMMENT_POST_ID' => [ + 'description' => __( 'Order by the post object ID.', 'wp-graphql' ), + 'value' => 'comment_post_ID', + ], + 'COMMENT_TYPE' => [ + 'description' => __( 'Order by the the type of comment, such as \'comment\', \'pingback\', or \'trackback\'.', 'wp-graphql' ), + 'value' => 'comment_type', + ], + 'USER_ID' => [ + 'description' => __( 'Order by the user ID.', 'wp-graphql' ), + 'value' => 'user_id', + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/ContentNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/ContentNodeIdTypeEnum.php new file mode 100644 index 00000000..6f14af23 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/ContentNodeIdTypeEnum.php @@ -0,0 +1,81 @@ + __( 'The Type of Identifier used to fetch a single resource. Default is ID.', 'wp-graphql' ), + 'values' => self::get_values(), + ] + ); + + /** @var \WP_Post_Type[] */ + $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects' ); + + foreach ( $allowed_post_types as $post_type_object ) { + $values = self::get_values(); + + if ( ! $post_type_object->hierarchical ) { + $values['SLUG'] = [ + 'name' => 'SLUG', + 'value' => 'slug', + 'description' => __( 'Identify a resource by the slug. Available to non-hierarchcial Types where the slug is a unique identifier.', 'wp-graphql' ), + ]; + } + + if ( 'attachment' === $post_type_object->name ) { + $values['SOURCE_URL'] = [ + 'name' => 'SOURCE_URL', + 'value' => 'source_url', + 'description' => __( 'Identify a media item by its source url', 'wp-graphql' ), + ]; + } + + /** + * Register a unique Enum per Post Type. This allows for granular control + * over filtering and customizing the values available per Post Type. + */ + register_graphql_enum_type( + $post_type_object->graphql_single_name . 'IdType', + [ + 'description' => __( 'The Type of Identifier used to fetch a single resource. Default is ID.', 'wp-graphql' ), + 'values' => $values, + ] + ); + } + } + + /** + * Get the values for the Enum definitions + * + * @return array + */ + public static function get_values() { + return [ + 'ID' => [ + 'name' => 'ID', + 'value' => 'global_id', + 'description' => __( 'Identify a resource by the (hashed) Global ID.', 'wp-graphql' ), + ], + 'DATABASE_ID' => [ + 'name' => 'DATABASE_ID', + 'value' => 'database_id', + 'description' => __( 'Identify a resource by the Database ID.', 'wp-graphql' ), + ], + 'URI' => [ + 'name' => 'URI', + 'value' => 'uri', + 'description' => __( 'Identify a resource by the URI.', 'wp-graphql' ), + ], + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeEnum.php new file mode 100644 index 00000000..308acad7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeEnum.php @@ -0,0 +1,84 @@ + $allowed_post_type, + 'description' => __( 'The Type of Content object', 'wp-graphql' ), + ]; + } + + register_graphql_enum_type( + 'ContentTypeEnum', + [ + 'description' => __( 'Allowed Content Types', 'wp-graphql' ), + 'values' => $values, + ] + ); + + /** + * Register a ContentTypesOf${taxonomyName}Enum for each taxonomy + * + * @var \WP_Taxonomy[] $allowed_taxonomies + */ + $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); + foreach ( $allowed_taxonomies as $tax_object ) { + /** + * Loop through the taxonomy's object type and create an array + * of values for use in the enum type. + */ + $taxonomy_values = []; + foreach ( $tax_object->object_type as $tax_object_type ) { + // Skip object types that are not allowed by WPGraphQL + if ( ! array_key_exists( $tax_object_type, $allowed_post_types ) ) { + continue; + } + + $taxonomy_values[ WPEnumType::get_safe_name( $tax_object_type ) ] = [ + 'name' => WPEnumType::get_safe_name( $tax_object_type ), + 'value' => $tax_object_type, + 'description' => __( 'The Type of Content object', 'wp-graphql' ), + ]; + } + + if ( ! empty( $taxonomy_values ) ) { + register_graphql_enum_type( + 'ContentTypesOf' . Utils::format_type_name( $tax_object->graphql_single_name ) . 'Enum', + [ + 'description' => sprintf( + // translators: %s is the taxonomy's GraphQL name. + __( 'Allowed Content Types of the %s taxonomy.', 'wp-graphql' ), + Utils::format_type_name( $tax_object->graphql_single_name ) + ), + 'values' => $taxonomy_values, + ] + ); + } + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeIdTypeEnum.php new file mode 100644 index 00000000..f36166c3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeIdTypeEnum.php @@ -0,0 +1,32 @@ + __( 'The Type of Identifier used to fetch a single Content Type node. To be used along with the "id" field. Default is "ID".', 'wp-graphql' ), + 'values' => [ + 'ID' => [ + 'name' => 'ID', + 'value' => 'id', + 'description' => __( 'The globally unique ID', 'wp-graphql' ), + ], + 'NAME' => [ + 'name' => 'NAME', + 'value' => 'name', + 'description' => __( 'The name of the content type.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemSizeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemSizeEnum.php new file mode 100644 index 00000000..852bc925 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemSizeEnum.php @@ -0,0 +1,51 @@ + sprintf( + // translators: %1$s is the image size. + __( 'MediaItem with the %1$s size', 'wp-graphql' ), + $image_size + ), + 'value' => $image_size, + ]; + } + + register_graphql_enum_type( + 'MediaItemSizeEnum', + [ + 'description' => __( 'The size of the media item object.', 'wp-graphql' ), + 'values' => $values, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemStatusEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemStatusEnum.php new file mode 100644 index 00000000..267e6e6b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemStatusEnum.php @@ -0,0 +1,46 @@ + sprintf( + // translators: %1$s is the post status. + __( 'Objects with the %1$s status', 'wp-graphql' ), + $status + ), + 'value' => $status, + ]; + } + + register_graphql_enum_type( + 'MediaItemStatusEnum', + [ + 'description' => __( 'The status of the media item object.', 'wp-graphql' ), + 'values' => $values, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MenuItemNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MenuItemNodeIdTypeEnum.php new file mode 100644 index 00000000..c28be2f5 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/MenuItemNodeIdTypeEnum.php @@ -0,0 +1,36 @@ + __( 'The Type of Identifier used to fetch a single node. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), + 'values' => [ + 'ID' => [ + 'name' => 'ID', + 'value' => 'global_id', + 'description' => __( 'Identify a resource by the (hashed) Global ID.', 'wp-graphql' ), + ], + 'DATABASE_ID' => [ + 'name' => 'DATABASE_ID', + 'value' => 'database_id', + 'description' => __( 'Identify a resource by the Database ID.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MenuLocationEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MenuLocationEnum.php new file mode 100644 index 00000000..d45a38ce --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/MenuLocationEnum.php @@ -0,0 +1,47 @@ + $location, + 'description' => sprintf( + // translators: %s is the menu location name. + __( 'Put the menu in the %s location', 'wp-graphql' ), + $location + ), + ]; + } + } + + if ( empty( $values ) ) { + $values['EMPTY'] = [ + 'value' => 'Empty menu location', + 'description' => __( 'Empty menu location', 'wp-graphql' ), + ]; + } + + register_graphql_enum_type( + 'MenuLocationEnum', + [ + 'description' => __( 'Registered menu locations', 'wp-graphql' ), + 'values' => $values, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MenuNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MenuNodeIdTypeEnum.php new file mode 100644 index 00000000..51e4c0f5 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/MenuNodeIdTypeEnum.php @@ -0,0 +1,51 @@ + __( 'The Type of Identifier used to fetch a single node. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), + 'values' => [ + 'ID' => [ + 'name' => 'ID', + 'value' => 'global_id', + 'description' => __( 'Identify a menu node by the (hashed) Global ID.', 'wp-graphql' ), + ], + 'DATABASE_ID' => [ + 'name' => 'DATABASE_ID', + 'value' => 'database_id', + 'description' => __( 'Identify a menu node by the Database ID.', 'wp-graphql' ), + ], + 'LOCATION' => [ + 'name' => 'LOCATION', + 'value' => 'location', + 'description' => __( 'Identify a menu node by the slug of menu location to which it is assigned', 'wp-graphql' ), + ], + 'NAME' => [ + 'name' => 'NAME', + 'value' => 'name', + 'description' => __( 'Identify a menu node by its name', 'wp-graphql' ), + ], + 'SLUG' => [ + 'name' => 'SLUG', + 'value' => 'slug', + 'description' => __( 'Identify a menu node by its slug', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MimeTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MimeTypeEnum.php new file mode 100644 index 00000000..daa4dbc2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/MimeTypeEnum.php @@ -0,0 +1,46 @@ + [ + 'value' => 'image/jpeg', + 'description' => __( 'An image in the JPEG format', 'wp-graphql' ), + ], + ]; + + $allowed_mime_types = get_allowed_mime_types(); + + if ( ! empty( $allowed_mime_types ) ) { + $values = []; + foreach ( $allowed_mime_types as $mime_type ) { + $values[ WPEnumType::get_safe_name( $mime_type ) ] = [ + 'value' => $mime_type, + 'description' => sprintf( + // translators: %s is the mime type. + __( '%s mime type.', 'wp-graphql' ), + $mime_type + ), + ]; + } + } + + register_graphql_enum_type( + 'MimeTypeEnum', + [ + 'description' => __( 'The MimeType of the object', 'wp-graphql' ), + 'values' => $values, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/OrderEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/OrderEnum.php new file mode 100644 index 00000000..fa713e80 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/OrderEnum.php @@ -0,0 +1,31 @@ + __( 'The cardinality of the connection order', 'wp-graphql' ), + 'values' => [ + 'ASC' => [ + 'value' => 'ASC', + 'description' => __( 'Sort the query result set in an ascending order', 'wp-graphql' ), + ], + 'DESC' => [ + 'value' => 'DESC', + 'description' => __( 'Sort the query result set in a descending order', 'wp-graphql' ), + ], + ], + 'defaultValue' => 'DESC', + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PluginStatusEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PluginStatusEnum.php new file mode 100644 index 00000000..8d27c4e2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/PluginStatusEnum.php @@ -0,0 +1,75 @@ + __( 'The status of the WordPress plugin.', 'wp-graphql' ), + 'values' => self::get_enum_values(), + 'defaultValue' => 'ACTIVE', + ] + ); + } + + /** + * Returns the array configuration for the GraphQL enum values. + * + * @return array + */ + protected static function get_enum_values() { + $values = [ + 'ACTIVE' => [ + 'value' => 'active', + 'description' => __( 'The plugin is currently active.', 'wp-graphql' ), + ], + 'DROP_IN' => [ + 'value' => 'dropins', + 'description' => __( 'The plugin is a drop-in plugin.', 'wp-graphql' ), + + ], + 'INACTIVE' => [ + 'value' => 'inactive', + 'description' => __( 'The plugin is currently inactive.', 'wp-graphql' ), + ], + 'MUST_USE' => [ + 'value' => 'mustuse', + 'description' => __( 'The plugin is a must-use plugin.', 'wp-graphql' ), + ], + 'PAUSED' => [ + 'value' => 'paused', + 'description' => __( 'The plugin is technically active but was paused while loading.', 'wp-graphql' ), + ], + 'RECENTLY_ACTIVE' => [ + 'value' => 'recently_activated', + 'description' => __( 'The plugin was active recently.', 'wp-graphql' ), + ], + 'UPGRADE' => [ + 'value' => 'upgrade', + 'description' => __( 'The plugin has an upgrade available.', 'wp-graphql' ), + ], + ]; + + // Multisite enums + if ( is_multisite() ) { + $values['NETWORK_ACTIVATED'] = [ + 'value' => 'network_activated', + 'description' => __( 'The plugin is activated on the multisite network.', 'wp-graphql' ), + ]; + $values['NETWORK_INACTIVE'] = [ + 'value' => 'network_inactive', + 'description' => __( 'The plugin is installed on the multisite network, but is currently inactive.', 'wp-graphql' ), + ]; + } + + return $values; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectFieldFormatEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectFieldFormatEnum.php new file mode 100644 index 00000000..80f09bf0 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectFieldFormatEnum.php @@ -0,0 +1,32 @@ + __( 'The format of post field data.', 'wp-graphql' ), + 'values' => [ + 'RAW' => [ + 'name' => 'RAW', + 'description' => __( 'Provide the field value directly from database. Null on unauthenticated requests.', 'wp-graphql' ), + 'value' => 'raw', + ], + 'RENDERED' => [ + 'name' => 'RENDERED', + 'description' => __( 'Provide the field value as rendered by WordPress. Default.', 'wp-graphql' ), + 'value' => 'rendered', + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php new file mode 100644 index 00000000..0aa9f7d7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php @@ -0,0 +1,30 @@ + __( 'The column to use when filtering by date', 'wp-graphql' ), + 'values' => [ + 'DATE' => [ + 'value' => 'post_date', + 'description' => __( 'The date the comment was created in local time.', 'wp-graphql' ), + ], + 'MODIFIED' => [ + 'value' => 'post_modified', + 'description' => __( 'The most recent modification date of the comment.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php new file mode 100644 index 00000000..deaf59f1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php @@ -0,0 +1,62 @@ + __( 'Field to order the connection by', 'wp-graphql' ), + 'values' => [ + 'AUTHOR' => [ + 'value' => 'post_author', + 'description' => __( 'Order by author', 'wp-graphql' ), + ], + 'TITLE' => [ + 'value' => 'post_title', + 'description' => __( 'Order by title', 'wp-graphql' ), + ], + 'SLUG' => [ + 'value' => 'post_name', + 'description' => __( 'Order by slug', 'wp-graphql' ), + ], + 'MODIFIED' => [ + 'value' => 'post_modified', + 'description' => __( 'Order by last modified date', 'wp-graphql' ), + ], + 'DATE' => [ + 'value' => 'post_date', + 'description' => __( 'Order by publish date', 'wp-graphql' ), + ], + 'PARENT' => [ + 'value' => 'post_parent', + 'description' => __( 'Order by parent ID', 'wp-graphql' ), + ], + 'IN' => [ + 'value' => 'post__in', + 'description' => __( 'Preserve the ID order given in the IN array', 'wp-graphql' ), + ], + 'NAME_IN' => [ + 'value' => 'post_name__in', + 'description' => __( 'Preserve slug order given in the NAME_IN array', 'wp-graphql' ), + ], + 'MENU_ORDER' => [ + 'value' => 'menu_order', + 'description' => __( 'Order by the menu order value', 'wp-graphql' ), + ], + 'COMMENT_COUNT' => [ + 'value' => 'comment_count', + 'description' => __( 'Order by the number of comments it has acquired', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PostStatusEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PostStatusEnum.php new file mode 100644 index 00000000..51b24416 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/PostStatusEnum.php @@ -0,0 +1,54 @@ + 'PUBLISH', + 'value' => 'publish', + ]; + + $post_stati = get_post_stati(); + + if ( ! empty( $post_stati ) && is_array( $post_stati ) ) { + /** + * Reset the array + */ + $post_status_enum_values = []; + /** + * Loop through the post_stati + */ + foreach ( $post_stati as $status ) { + if ( ! is_string( $status ) ) { + continue; + } + + $post_status_enum_values[ WPEnumType::get_safe_name( $status ) ] = [ + 'description' => sprintf( + // translators: %1$s is the post status. + __( 'Objects with the %1$s status', 'wp-graphql' ), + $status + ), + 'value' => $status, + ]; + } + } + + register_graphql_enum_type( + 'PostStatusEnum', + [ + 'description' => __( 'The status of the object.', 'wp-graphql' ), + 'values' => $post_status_enum_values, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/RelationEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/RelationEnum.php new file mode 100644 index 00000000..63c944eb --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/RelationEnum.php @@ -0,0 +1,32 @@ + __( 'The logical relation between each item in the array when there are more than one.', 'wp-graphql' ), + 'values' => [ + 'AND' => [ + 'name' => 'AND', + 'value' => 'AND', + 'description' => __( 'The logical AND condition returns true if both operands are true, otherwise, it returns false.', 'wp-graphql' ), + ], + 'OR' => [ + 'name' => 'OR', + 'value' => 'OR', + 'description' => __( 'The logical OR condition returns false if both operands are false, otherwise, it returns true.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyEnum.php new file mode 100644 index 00000000..2574d478 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyEnum.php @@ -0,0 +1,46 @@ +graphql_single_name ) ] ) ) { + $values[ WPEnumType::get_safe_name( $tax_object->graphql_single_name ) ] = [ + 'value' => $tax_object->name, + 'description' => sprintf( + // translators: %s is the taxonomy name. + __( 'Taxonomy enum %s', 'wp-graphql' ), + $tax_object->name + ), + ]; + } + } + + register_graphql_enum_type( + 'TaxonomyEnum', + [ + 'description' => __( 'Allowed taxonomies', 'wp-graphql' ), + 'values' => $values, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyIdTypeEnum.php new file mode 100644 index 00000000..de6743c6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyIdTypeEnum.php @@ -0,0 +1,32 @@ + __( 'The Type of Identifier used to fetch a single Taxonomy node. To be used along with the "id" field. Default is "ID".', 'wp-graphql' ), + 'values' => [ + 'ID' => [ + 'name' => 'ID', + 'value' => 'id', + 'description' => __( 'The globally unique ID', 'wp-graphql' ), + ], + 'NAME' => [ + 'name' => 'NAME', + 'value' => 'name', + 'description' => __( 'The name of the taxonomy', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TermNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TermNodeIdTypeEnum.php new file mode 100644 index 00000000..52ff6b8b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/TermNodeIdTypeEnum.php @@ -0,0 +1,74 @@ + __( 'The Type of Identifier used to fetch a single resource. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), + 'values' => self::get_values(), + ] + ); + + /** + * Register a unique Enum per Taxonomy. This allows for granular control + * over filtering and customizing the values available per Taxonomy. + * + * @var \WP_Taxonomy[] $allowed_taxonomies + */ + $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); + + foreach ( $allowed_taxonomies as $tax_object ) { + register_graphql_enum_type( + $tax_object->graphql_single_name . 'IdType', + [ + 'description' => __( 'The Type of Identifier used to fetch a single resource. Default is ID.', 'wp-graphql' ), + 'values' => self::get_values(), + ] + ); + } + } + + /** + * Get the values for the Enum definitions + * + * @return array + */ + public static function get_values() { + return [ + 'SLUG' => [ + 'name' => 'SLUG', + 'value' => 'slug', + 'description' => __( 'Url friendly name of the node', 'wp-graphql' ), + ], + 'NAME' => [ + 'name' => 'NAME', + 'value' => 'name', + 'description' => __( 'The name of the node', 'wp-graphql' ), + ], + 'ID' => [ + 'name' => 'ID', + 'value' => 'global_id', + 'description' => __( 'The hashed Global ID', 'wp-graphql' ), + ], + 'DATABASE_ID' => [ + 'name' => 'DATABASE_ID', + 'value' => 'database_id', + 'description' => __( 'The Database ID for the node', 'wp-graphql' ), + ], + 'URI' => [ + 'name' => 'URI', + 'value' => 'uri', + 'description' => __( 'The URI for the node', 'wp-graphql' ), + ], + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php new file mode 100644 index 00000000..d7f0414c --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php @@ -0,0 +1,49 @@ + __( 'Options for ordering the connection by', 'wp-graphql' ), + 'values' => [ + 'NAME' => [ + 'value' => 'name', + 'description' => __( 'Order the connection by name.', 'wp-graphql' ), + ], + 'SLUG' => [ + 'value' => 'slug', + 'description' => __( 'Order the connection by slug.', 'wp-graphql' ), + ], + 'TERM_GROUP' => [ + 'value' => 'term_group', + 'description' => __( 'Order the connection by term group.', 'wp-graphql' ), + ], + 'TERM_ID' => [ + 'value' => 'term_id', + 'description' => __( 'Order the connection by term id.', 'wp-graphql' ), + ], + 'TERM_ORDER' => [ + 'value' => 'term_order', + 'description' => __( 'Order the connection by term order.', 'wp-graphql' ), + ], + 'DESCRIPTION' => [ + 'value' => 'description', + 'description' => __( 'Order the connection by description.', 'wp-graphql' ), + ], + 'COUNT' => [ + 'value' => 'count', + 'description' => __( 'Order the connection by item count.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TimezoneEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TimezoneEnum.php new file mode 100644 index 00000000..fc1b583e --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/TimezoneEnum.php @@ -0,0 +1,194 @@ + $zone[0], + 'city' => $exists[1] ? $zone[1] : '', + 'subcity' => $exists[2] ? $zone[2] : '', + 't_continent' => translate( str_replace( '_', ' ', $zone[0] ), 'wp-graphql' ), + 't_city' => $exists[1] ? translate( str_replace( '_', ' ', $zone[1] ), 'wp-graphql' ) : '', + 't_subcity' => $exists[2] ? translate( str_replace( '_', ' ', $zone[2] ), 'wp-graphql' ) : '', + ]; + // phpcs:enable + } + usort( $zonen, '_wp_timezone_choice_usort_callback' ); + + foreach ( $zonen as $zone ) { + // Build value in an array to join later + $value = [ $zone['continent'] ]; + if ( empty( $zone['city'] ) ) { + // It's at the continent level (generally won't happen) + $display = $zone['t_continent']; + } else { + // Add the city to the value + $value[] = $zone['city']; + $display = $zone['t_city']; + if ( ! empty( $zone['subcity'] ) ) { + // Add the subcity to the value + $value[] = $zone['subcity']; + $display .= ' - ' . $zone['t_subcity']; + } + } + // Build the value + $value = join( '/', $value ); + + $enum_values[ WPEnumType::get_safe_name( $value ) ] = [ + 'value' => $value, + 'description' => $display, + ]; + } + $offset_range = [ + - 12, + - 11.5, + - 11, + - 10.5, + - 10, + - 9.5, + - 9, + - 8.5, + - 8, + - 7.5, + - 7, + - 6.5, + - 6, + - 5.5, + - 5, + - 4.5, + - 4, + - 3.5, + - 3, + - 2.5, + - 2, + - 1.5, + - 1, + - 0.5, + 0, + 0.5, + 1, + 1.5, + 2, + 2.5, + 3, + 3.5, + 4, + 4.5, + 5, + 5.5, + 5.75, + 6, + 6.5, + 7, + 7.5, + 8, + 8.5, + 8.75, + 9, + 9.5, + 10, + 10.5, + 11, + 11.5, + 12, + 12.75, + 13, + 13.75, + 14, + ]; + foreach ( $offset_range as $offset ) { + if ( 0 <= $offset ) { + $offset_name = '+' . $offset; + } else { + $offset_name = (string) $offset; + } + $offset_value = $offset_name; + $offset_name = str_replace( + [ '.25', '.5', '.75' ], + [ + ':15', + ':30', + ':45', + ], + $offset_name + ); + $offset_name = 'UTC' . $offset_name; + $offset_value = 'UTC' . $offset_value; + + // Intentionally avoid WPEnumType::get_safe_name here for specific timezone formatting + $enum_values[ WPEnumType::get_safe_name( $offset_name ) ] = [ + 'value' => $offset_value, + 'description' => sprintf( + // translators: %s is the UTC offset. + __( 'UTC offset: %s', 'wp-graphql' ), + $offset_name + ), + ]; + } + + register_graphql_enum_type( + 'TimezoneEnum', + [ + 'description' => __( 'Available timezones', 'wp-graphql' ), + 'values' => $enum_values, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/UserNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/UserNodeIdTypeEnum.php new file mode 100644 index 00000000..c4f61df0 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/UserNodeIdTypeEnum.php @@ -0,0 +1,60 @@ + __( 'The Type of Identifier used to fetch a single User node. To be used along with the "id" field. Default is "ID".', 'wp-graphql' ), + 'values' => self::get_values(), + ] + ); + } + + /** + * Returns the values for the Enum. + * + * @return array + */ + public static function get_values() { + return [ + 'ID' => [ + 'name' => 'ID', + 'value' => 'global_id', + 'description' => __( 'The hashed Global ID', 'wp-graphql' ), + ], + 'DATABASE_ID' => [ + 'name' => 'DATABASE_ID', + 'value' => 'database_id', + 'description' => __( 'The Database ID for the node', 'wp-graphql' ), + ], + 'URI' => [ + 'name' => 'URI', + 'value' => 'uri', + 'description' => __( 'The URI for the node', 'wp-graphql' ), + ], + 'SLUG' => [ + 'name' => 'SLUG', + 'value' => 'slug', + 'description' => __( 'The slug of the User', 'wp-graphql' ), + ], + 'EMAIL' => [ + 'name' => 'EMAIL', + 'value' => 'email', + 'description' => __( 'The Email of the User', 'wp-graphql' ), + ], + 'USERNAME' => [ + 'name' => 'USERNAME', + 'value' => 'login', + 'description' => __( 'The username the User uses to login with', 'wp-graphql' ), + ], + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/UserRoleEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/UserRoleEnum.php new file mode 100644 index 00000000..76f4f5ab --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/UserRoleEnum.php @@ -0,0 +1,40 @@ +roles; + $roles = []; + + foreach ( $all_roles as $key => $role ) { + $formatted_role = WPEnumType::get_safe_name( isset( $role['name'] ) ? $role['name'] : $key ); + + $roles[ $formatted_role ] = [ + 'description' => __( 'User role with specific capabilities', 'wp-graphql' ), + 'value' => $key, + ]; + } + + // Bail if there are no roles to register. + if ( empty( $roles ) ) { + return; + } + + register_graphql_enum_type( + 'UserRoleEnum', + [ + 'description' => __( 'Names of available user roles', 'wp-graphql' ), + 'values' => $roles, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionOrderbyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionOrderbyEnum.php new file mode 100644 index 00000000..ba6e8ddc --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionOrderbyEnum.php @@ -0,0 +1,54 @@ + __( 'Field to order the connection by', 'wp-graphql' ), + 'values' => [ + 'DISPLAY_NAME' => [ + 'value' => 'display_name', + 'description' => __( 'Order by display name', 'wp-graphql' ), + ], + 'EMAIL' => [ + 'value' => 'user_email', + 'description' => __( 'Order by email address', 'wp-graphql' ), + ], + 'LOGIN' => [ + 'value' => 'user_login', + 'description' => __( 'Order by login', 'wp-graphql' ), + ], + 'LOGIN_IN' => [ + 'value' => 'login__in', + 'description' => __( 'Preserve the login order given in the LOGIN_IN array', 'wp-graphql' ), + ], + 'NICE_NAME' => [ + 'value' => 'user_nicename', + 'description' => __( 'Order by nice name', 'wp-graphql' ), + ], + 'NICE_NAME_IN' => [ + 'value' => 'nicename__in', + 'description' => __( 'Preserve the nice name order given in the NICE_NAME_IN array', 'wp-graphql' ), + ], + 'REGISTERED' => [ + 'value' => 'user_registered', + 'description' => __( 'Order by registration date', 'wp-graphql' ), + ], + 'URL' => [ + 'value' => 'user_url', + 'description' => __( 'Order by URL', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionSearchColumnEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionSearchColumnEnum.php new file mode 100644 index 00000000..66e51310 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionSearchColumnEnum.php @@ -0,0 +1,42 @@ + __( 'Column used for searching for users.', 'wp-graphql' ), + 'values' => [ + 'ID' => [ + 'value' => 'ID', + 'description' => __( 'The globally unique ID.', 'wp-graphql' ), + ], + 'LOGIN' => [ + 'value' => 'login', + 'description' => __( 'The username the User uses to login with.', 'wp-graphql' ), + ], + 'NICENAME' => [ + 'value' => 'nicename', + 'description' => __( 'A URL-friendly name for the user. The default is the user\'s username.', 'wp-graphql' ), + ], + 'EMAIL' => [ + 'value' => 'email', + 'description' => __( 'The user\'s email address.', 'wp-graphql' ), + ], + 'URL' => [ + 'value' => 'url', + 'description' => __( 'The URL of the user\'s website.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Input/DateInput.php b/lib/wp-graphql-1.17.0/src/Type/Input/DateInput.php new file mode 100644 index 00000000..1dbe465e --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Input/DateInput.php @@ -0,0 +1,33 @@ + __( 'Date values', 'wp-graphql' ), + 'fields' => [ + 'year' => [ + 'type' => 'Int', + 'description' => __( '4 digit year (e.g. 2017)', 'wp-graphql' ), + ], + 'month' => [ + 'type' => 'Int', + 'description' => __( 'Month number (from 1 to 12)', 'wp-graphql' ), + ], + 'day' => [ + 'type' => 'Int', + 'description' => __( 'Day of the month (from 1 to 31)', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Input/DateQueryInput.php b/lib/wp-graphql-1.17.0/src/Type/Input/DateQueryInput.php new file mode 100644 index 00000000..d1ea6765 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Input/DateQueryInput.php @@ -0,0 +1,74 @@ + __( 'Filter the connection based on input', 'wp-graphql' ), + 'fields' => [ + 'year' => [ + 'type' => 'Int', + 'description' => __( '4 digit year (e.g. 2017)', 'wp-graphql' ), + ], + 'month' => [ + 'type' => 'Int', + 'description' => __( 'Month number (from 1 to 12)', 'wp-graphql' ), + ], + 'week' => [ + 'type' => 'Int', + 'description' => __( 'Week of the year (from 0 to 53)', 'wp-graphql' ), + ], + 'day' => [ + 'type' => 'Int', + 'description' => __( 'Day of the month (from 1 to 31)', 'wp-graphql' ), + ], + 'hour' => [ + 'type' => 'Int', + 'description' => __( 'Hour (from 0 to 23)', 'wp-graphql' ), + ], + 'minute' => [ + 'type' => 'Int', + 'description' => __( 'Minute (from 0 to 59)', 'wp-graphql' ), + ], + 'second' => [ + 'type' => 'Int', + 'description' => __( 'Second (0 to 59)', 'wp-graphql' ), + ], + 'after' => [ + 'type' => 'DateInput', + 'description' => __( 'Nodes should be returned after this date', 'wp-graphql' ), + ], + 'before' => [ + 'type' => 'DateInput', + 'description' => __( 'Nodes should be returned before this date', 'wp-graphql' ), + ], + 'inclusive' => [ + 'type' => 'Boolean', + 'description' => __( 'For after/before, whether exact value should be matched or not', 'wp-graphql' ), + ], + 'compare' => [ + 'type' => 'String', + 'description' => __( 'For after/before, whether exact value should be matched or not', 'wp-graphql' ), + ], + 'column' => [ + 'type' => 'PostObjectsConnectionDateColumnEnum', + 'description' => __( 'Column to query against', 'wp-graphql' ), + ], + 'relation' => [ + 'type' => 'RelationEnum', + 'description' => __( 'OR or AND, how the sub-arrays should be compared', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Input/PostObjectsConnectionOrderbyInput.php b/lib/wp-graphql-1.17.0/src/Type/Input/PostObjectsConnectionOrderbyInput.php new file mode 100644 index 00000000..737343a9 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Input/PostObjectsConnectionOrderbyInput.php @@ -0,0 +1,34 @@ + __( 'Options for ordering the connection', 'wp-graphql' ), + 'fields' => [ + 'field' => [ + 'type' => [ + 'non_null' => 'PostObjectsConnectionOrderbyEnum', + ], + 'description' => __( 'The field to order the connection by', 'wp-graphql' ), + ], + 'order' => [ + 'type' => [ + 'non_null' => 'OrderEnum', + ], + 'description' => __( 'Possible directions in which to order a list of items', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Input/UsersConnectionOrderbyInput.php b/lib/wp-graphql-1.17.0/src/Type/Input/UsersConnectionOrderbyInput.php new file mode 100644 index 00000000..2df8ce60 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Input/UsersConnectionOrderbyInput.php @@ -0,0 +1,32 @@ + __( 'Options for ordering the connection', 'wp-graphql' ), + 'fields' => [ + 'field' => [ + 'description' => __( 'The field name used to sort the results.', 'wp-graphql' ), + 'type' => [ + 'non_null' => 'UsersConnectionOrderbyEnum', + ], + ], + 'order' => [ + 'description' => __( 'The cardinality of the order of the connection', 'wp-graphql' ), + 'type' => 'OrderEnum', + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Commenter.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Commenter.php new file mode 100644 index 00000000..df9da9b8 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Commenter.php @@ -0,0 +1,74 @@ + __( 'The author of a comment', 'wp-graphql' ), + 'interfaces' => [ 'Node', 'DatabaseIdentifier' ], + 'resolveType' => static function ( $comment_author ) use ( $type_registry ) { + if ( $comment_author instanceof User ) { + $type = $type_registry->get_type( 'User' ); + } else { + $type = $type_registry->get_type( 'CommentAuthor' ); + } + + return $type; + }, + 'fields' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The globally unique identifier for the comment author.', 'wp-graphql' ), + ], + 'avatar' => [ + 'type' => 'Avatar', + 'description' => __( 'Avatar object for user. The avatar object can be retrieved in different sizes by specifying the size argument.', 'wp-graphql' ), + ], + 'databaseId' => [ + 'type' => [ + 'non_null' => 'Int', + ], + 'description' => __( 'Identifies the primary key from the database.', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'The name of the author of a comment.', 'wp-graphql' ), + ], + 'email' => [ + 'type' => 'String', + 'description' => __( 'The email address of the author of a comment.', 'wp-graphql' ), + ], + 'url' => [ + 'type' => 'String', + 'description' => __( 'The url of the author of a comment.', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the author information is considered restricted. (not fully public)', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Connection.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Connection.php new file mode 100644 index 00000000..396a9e1f --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Connection.php @@ -0,0 +1,38 @@ + __( 'A plural connection from one Node Type in the Graph to another Node Type, with support for relational data via "edges".', 'wp-graphql' ), + 'fields' => [ + 'pageInfo' => [ + 'type' => [ 'non_null' => 'PageInfo' ], + 'description' => __( 'Information about pagination in a connection.', 'wp-graphql' ), + ], + 'edges' => [ + 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => 'Edge' ] ] ], + 'description' => __( 'A list of edges (relational context) between connected nodes', 'wp-graphql' ), + ], + 'nodes' => [ + 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => 'Node' ] ] ], + 'description' => __( 'A list of connected nodes', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentNode.php new file mode 100644 index 00000000..b808e780 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentNode.php @@ -0,0 +1,174 @@ + [ 'Node', 'UniformResourceIdentifiable' ], + 'description' => __( 'Nodes used to manage content', 'wp-graphql' ), + 'connections' => [ + 'contentType' => [ + 'toType' => 'ContentType', + 'resolve' => static function ( Post $source, $args, $context, $info ) { + if ( $source->isRevision ) { + $parent = get_post( $source->parentDatabaseId ); + $post_type = $parent->post_type ?? null; + } else { + $post_type = $source->post_type ?? null; + } + + if ( empty( $post_type ) ) { + return null; + } + + $resolver = new ContentTypeConnectionResolver( $source, $args, $context, $info ); + + return $resolver->one_to_one()->set_query_arg( 'name', $post_type )->get_connection(); + }, + 'oneToOne' => true, + ], + 'enqueuedScripts' => [ + 'toType' => 'EnqueuedScript', + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new EnqueuedScriptsConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + }, + ], + 'enqueuedStylesheets' => [ + 'toType' => 'EnqueuedStylesheet', + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new EnqueuedStylesheetConnectionResolver( $source, $args, $context, $info ); + return $resolver->get_connection(); + }, + ], + ], + 'resolveType' => static function ( Post $post ) use ( $type_registry ) { + + /** + * The resolveType callback is used at runtime to determine what Type an object + * implementing the ContentNode Interface should be resolved as. + * + * You can filter this centrally using the "graphql_wp_interface_type_config" filter + * to override if you need something other than a Post object to be resolved via the + * $post->post_type attribute. + */ + $type = null; + $post_type = isset( $post->post_type ) ? $post->post_type : null; + + if ( isset( $post->post_type ) && 'revision' === $post->post_type ) { + $parent = get_post( $post->parentDatabaseId ); + if ( $parent instanceof \WP_Post ) { + $post_type = $parent->post_type; + } + } + + $post_type_object = ! empty( $post_type ) ? get_post_type_object( $post_type ) : null; + + if ( isset( $post_type_object->graphql_single_name ) ) { + $type = $type_registry->get_type( $post_type_object->graphql_single_name ); + } + + return ! empty( $type ) ? $type : null; + }, + 'fields' => [ + 'contentTypeName' => [ + 'type' => [ 'non_null' => 'String' ], + 'description' => __( 'The name of the Content Type the node belongs to', 'wp-graphql' ), + 'resolve' => static function ( $node ) { + return $node->post_type; + }, + ], + 'template' => [ + 'type' => 'ContentTemplate', + 'description' => __( 'The template assigned to a node of content', 'wp-graphql' ), + ], + 'databaseId' => [ + 'type' => [ + 'non_null' => 'Int', + ], + 'description' => __( 'The ID of the node in the database.', 'wp-graphql' ), + ], + 'date' => [ + 'type' => 'String', + 'description' => __( 'Post publishing date.', 'wp-graphql' ), + ], + 'dateGmt' => [ + 'type' => 'String', + 'description' => __( 'The publishing date set in GMT.', 'wp-graphql' ), + ], + 'enclosure' => [ + 'type' => 'String', + 'description' => __( 'The RSS enclosure for the object', 'wp-graphql' ), + ], + 'status' => [ + 'type' => 'String', + 'description' => __( 'The current status of the object', 'wp-graphql' ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => __( 'The uri slug for the post. This is equivalent to the WP_Post->post_name field and the post_name column in the database for the "post_objects" table.', 'wp-graphql' ), + ], + 'modified' => [ + 'type' => 'String', + 'description' => __( 'The local modified time for a post. If a post was recently updated the modified field will change to match the corresponding time.', 'wp-graphql' ), + ], + 'modifiedGmt' => [ + 'type' => 'String', + 'description' => __( 'The GMT modified time for a post. If a post was recently updated the modified field will change to match the corresponding time in GMT.', 'wp-graphql' ), + ], + 'guid' => [ + 'type' => 'String', + 'description' => __( 'The global unique identifier for this post. This currently matches the value stored in WP_Post->guid and the guid column in the "post_objects" database table.', 'wp-graphql' ), + ], + 'desiredSlug' => [ + 'type' => 'String', + 'description' => __( 'The desired slug of the post', 'wp-graphql' ), + ], + 'link' => [ + 'type' => 'String', + 'description' => __( 'The permalink of the post', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'isPreview' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is a node in the preview state', 'wp-graphql' ), + ], + 'previewRevisionDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'The database id of the preview node', 'wp-graphql' ), + ], + 'previewRevisionId' => [ + 'type' => 'ID', + 'description' => __( 'Whether the object is a node in the preview state', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentTemplate.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentTemplate.php new file mode 100644 index 00000000..f559ba85 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentTemplate.php @@ -0,0 +1,86 @@ + __( 'The template assigned to a node of content', 'wp-graphql' ), + 'fields' => [ + 'templateName' => [ + 'type' => 'String', + 'description' => __( 'The name of the template', 'wp-graphql' ), + ], + ], + 'resolveType' => static function ( $value ) { + return isset( $value['__typename'] ) ? $value['__typename'] : 'DefaultTemplate'; + }, + ] + ); + } + + /** + * Register individual GraphQL objects for supported theme templates. + * + * @return void + */ + public static function register_content_template_types() { + $page_templates = []; + $page_templates['default'] = 'DefaultTemplate'; + + // Cycle through the registered post types and get the template information + $allowed_post_types = \WPGraphQL::get_allowed_post_types(); + foreach ( $allowed_post_types as $post_type ) { + $post_type_templates = wp_get_theme()->get_page_templates( null, $post_type ); + + foreach ( $post_type_templates as $file => $name ) { + $page_templates[ $file ] = $name; + } + } + + // Register each template to the schema + foreach ( $page_templates as $file => $name ) { + $template_type_name = Utils::format_type_name_for_wp_template( $name, $file ); + + // If the type name is empty, log an error and continue. + if ( empty( $template_type_name ) ) { + graphql_debug( + sprintf( + // Translators: %s is the file name. + __( 'Unable to register the %1s template file as a GraphQL Type. Either the template name or the file name must only use ASCII characters. "DefaultTemplate" will be used instead.', 'wp-graphql' ), + (string) $file + ) + ); + + continue; + } + + register_graphql_object_type( + $template_type_name, + [ + 'interfaces' => [ 'ContentTemplate' ], + // Translators: Placeholder is the name of the GraphQL Type in the Schema + 'description' => __( 'The template assigned to the node', 'wp-graphql' ), + 'fields' => [ + 'templateName' => [ + 'resolve' => static function ( $template ) { + return isset( $template['templateName'] ) ? $template['templateName'] : null; + }, + ], + ], + 'eagerlyLoadType' => true, + ] + ); + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/DatabaseIdentifier.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/DatabaseIdentifier.php new file mode 100644 index 00000000..e02489c4 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/DatabaseIdentifier.php @@ -0,0 +1,31 @@ + __( 'Object that can be identified with a Database ID', 'wp-graphql' ), + 'fields' => [ + 'databaseId' => [ + 'type' => [ 'non_null' => 'Int' ], + 'description' => __( 'The unique identifier stored in the database', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Edge.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Edge.php new file mode 100644 index 00000000..7cc4f530 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Edge.php @@ -0,0 +1,34 @@ + __( 'Relational context between connected nodes', 'wp-graphql' ), + 'fields' => [ + 'cursor' => [ + 'type' => 'String', + 'description' => __( 'Opaque reference to the nodes position in the connection. Value can be used with pagination args.', 'wp-graphql' ), + ], + 'node' => [ + 'type' => [ 'non_null' => 'Node' ], + 'description' => __( 'The connected node', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/EnqueuedAsset.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/EnqueuedAsset.php new file mode 100644 index 00000000..8332c924 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/EnqueuedAsset.php @@ -0,0 +1,83 @@ + __( 'Asset enqueued by the CMS', 'wp-graphql' ), + 'resolveType' => static function ( $asset ) use ( $type_registry ) { + + /** + * The resolveType callback is used at runtime to determine what Type an object + * implementing the EnqueuedAsset Interface should be resolved as. + * + * You can filter this centrally using the "graphql_wp_interface_type_config" filter + * to override if you need something other than a Post object to be resolved via the + * $post->post_type attribute. + */ + $type = null; + + if ( isset( $asset['type'] ) ) { + $type = $type_registry->get_type( $asset['type'] ); + } + + return ! empty( $type ) ? $type : null; + }, + 'fields' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The ID of the enqueued asset', 'wp-graphql' ), + ], + 'handle' => [ + 'type' => 'String', + 'description' => __( 'The handle of the enqueued asset', 'wp-graphql' ), + ], + 'version' => [ + 'type' => 'String', + 'description' => __( 'The version of the enqueued asset', 'wp-graphql' ), + ], + 'src' => [ + 'type' => 'String', + 'description' => __( 'The source of the asset', 'wp-graphql' ), + ], + 'dependencies' => [ + 'type' => [ + 'list_of' => 'EnqueuedScript', + ], + 'description' => __( 'Dependencies needed to use this asset', 'wp-graphql' ), + ], + 'args' => [ + 'type' => 'Boolean', + 'description' => __( '@todo', 'wp-graphql' ), + ], + 'extra' => [ + 'type' => 'String', + 'description' => __( 'Extra information needed for the script', 'wp-graphql' ), + 'resolve' => static function ( $asset ) { + return isset( $asset->extra['data'] ) ? $asset->extra['data'] : null; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalContentNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalContentNode.php new file mode 100644 index 00000000..322c8479 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalContentNode.php @@ -0,0 +1,45 @@ + __( 'Content node with hierarchical (parent/child) relationships', 'wp-graphql' ), + 'interfaces' => [ + 'Node', + 'ContentNode', + 'DatabaseIdentifier', + 'HierarchicalNode', + ], + 'fields' => [ + 'parentId' => [ + 'type' => 'ID', + 'description' => __( 'The globally unique identifier of the parent node.', 'wp-graphql' ), + ], + 'parentDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'Database id of the parent node', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalNode.php new file mode 100644 index 00000000..570fb781 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalNode.php @@ -0,0 +1,44 @@ + __( 'Node with hierarchical (parent/child) relationships', 'wp-graphql' ), + 'interfaces' => [ + 'Node', + 'DatabaseIdentifier', + ], + 'fields' => [ + 'parentId' => [ + 'type' => 'ID', + 'description' => __( 'The globally unique identifier of the parent node.', 'wp-graphql' ), + ], + 'parentDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'Database id of the parent node', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalTermNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalTermNode.php new file mode 100644 index 00000000..131a9752 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalTermNode.php @@ -0,0 +1,45 @@ + __( 'Term node with hierarchical (parent/child) relationships', 'wp-graphql' ), + 'interfaces' => [ + 'Node', + 'TermNode', + 'DatabaseIdentifier', + 'HierarchicalNode', + ], + 'fields' => [ + 'parentId' => [ + 'type' => 'ID', + 'description' => __( 'The globally unique identifier of the parent node.', 'wp-graphql' ), + ], + 'parentDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'Database id of the parent node', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/MenuItemLinkable.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/MenuItemLinkable.php new file mode 100644 index 00000000..2bbc2719 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/MenuItemLinkable.php @@ -0,0 +1,47 @@ + __( 'Nodes that can be linked to as Menu Items', 'wp-graphql' ), + 'interfaces' => [ 'Node', 'UniformResourceIdentifiable', 'DatabaseIdentifier' ], + 'fields' => [], + 'resolveType' => static function ( $node ) use ( $type_registry ) { + switch ( true ) { + case $node instanceof Post: + /** @var \WP_Post_Type $post_type_object */ + $post_type_object = get_post_type_object( $node->post_type ); + $type = $type_registry->get_type( $post_type_object->graphql_single_name ); + break; + case $node instanceof Term: + /** @var \WP_Taxonomy $tax_object */ + $tax_object = get_taxonomy( $node->taxonomyName ); + $type = $type_registry->get_type( $tax_object->graphql_single_name ); + break; + default: + $type = null; + } + + return $type; + }, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Node.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Node.php new file mode 100644 index 00000000..18ae2bd1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Node.php @@ -0,0 +1,30 @@ + __( 'An object with an ID', 'wp-graphql' ), + 'fields' => [ + 'id' => [ + 'type' => [ 'non_null' => 'ID' ], + 'description' => __( 'The globally unique ID for the object', 'wp-graphql' ), + ], + ], + 'resolveType' => static function ( $node ) { + return DataSource::resolve_node_type( $node ); + }, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithAuthor.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithAuthor.php new file mode 100644 index 00000000..05846131 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithAuthor.php @@ -0,0 +1,33 @@ + [ 'Node' ], + 'description' => __( 'A node that can have an author assigned to it', 'wp-graphql' ), + 'fields' => [ + 'authorId' => [ + 'type' => 'ID', + 'description' => __( 'The globally unique identifier of the author of the node', 'wp-graphql' ), + ], + 'authorDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'The database identifier of the author of the node', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithComments.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithComments.php new file mode 100644 index 00000000..73ab815b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithComments.php @@ -0,0 +1,33 @@ + [ 'Node' ], + 'description' => __( 'A node that can have comments associated with it', 'wp-graphql' ), + 'fields' => [ + 'commentCount' => [ + 'type' => 'Int', + 'description' => __( 'The number of comments. Even though WPGraphQL denotes this field as an integer, in WordPress this field should be saved as a numeric string for compatibility.', 'wp-graphql' ), + ], + 'commentStatus' => [ + 'type' => 'String', + 'description' => __( 'Whether the comments are open or closed for this particular post.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithContentEditor.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithContentEditor.php new file mode 100644 index 00000000..7d114036 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithContentEditor.php @@ -0,0 +1,44 @@ + [ 'Node' ], + 'description' => __( 'A node that supports the content editor', 'wp-graphql' ), + 'fields' => [ + 'content' => [ + 'type' => 'String', + 'description' => __( 'The content of the post.', 'wp-graphql' ), + 'args' => [ + 'format' => [ + 'type' => 'PostObjectFieldFormatEnum', + 'description' => __( 'Format of the field output', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, $args ) { + if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { + // @codingStandardsIgnoreLine. + return $source->contentRaw; + } + + // @codingStandardsIgnoreLine. + return $source->contentRendered; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithExcerpt.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithExcerpt.php new file mode 100644 index 00000000..b5b5bcae --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithExcerpt.php @@ -0,0 +1,45 @@ + [ 'Node' ], + 'description' => __( 'A node that can have an excerpt', 'wp-graphql' ), + 'fields' => [ + 'excerpt' => [ + 'type' => 'String', + 'description' => __( 'The excerpt of the post.', 'wp-graphql' ), + 'args' => [ + 'format' => [ + 'type' => 'PostObjectFieldFormatEnum', + 'description' => __( 'Format of the field output', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, $args ) { + if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { + // @codingStandardsIgnoreLine. + return $source->excerptRaw; + } + + // @codingStandardsIgnoreLine. + return $source->excerptRendered; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithFeaturedImage.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithFeaturedImage.php new file mode 100644 index 00000000..d426b407 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithFeaturedImage.php @@ -0,0 +1,55 @@ + __( 'A node that can have a featured image set', 'wp-graphql' ), + 'interfaces' => [ 'Node' ], + 'connections' => [ + 'featuredImage' => [ + 'toType' => 'MediaItem', + 'oneToOne' => true, + 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { + if ( empty( $post->featuredImageDatabaseId ) ) { + return null; + } + + $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info, 'attachment' ); + $resolver->set_query_arg( 'p', absint( $post->featuredImageDatabaseId ) ); + + return $resolver->one_to_one()->get_connection(); + }, + ], + ], + 'fields' => [ + 'featuredImageId' => [ + 'type' => 'ID', + 'description' => __( 'Globally unique ID of the featured image assigned to the node', 'wp-graphql' ), + ], + 'featuredImageDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'The database identifier for the featured image node assigned to the content node', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithPageAttributes.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithPageAttributes.php new file mode 100644 index 00000000..3e641dc3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithPageAttributes.php @@ -0,0 +1,30 @@ + [ 'Node' ], + 'description' => __( 'A node that can have page attributes', 'wp-graphql' ), + 'fields' => [ + 'menuOrder' => [ + 'type' => 'Int', + 'description' => __( 'A field used for ordering posts. This is typically used with nav menu items or for special ordering of hierarchical content types.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithRevisions.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithRevisions.php new file mode 100644 index 00000000..17ef51bf --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithRevisions.php @@ -0,0 +1,30 @@ + [ 'Node' ], + 'description' => __( 'A node that can have revisions', 'wp-graphql' ), + 'fields' => [ + 'isRevision' => [ + 'type' => 'Boolean', + 'description' => __( 'True if the node is a revision of another node', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTemplate.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTemplate.php new file mode 100644 index 00000000..00f9c2ed --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTemplate.php @@ -0,0 +1,30 @@ + __( 'A node that can have a template associated with it', 'wp-graphql' ), + 'interfaces' => [ 'Node' ], + 'fields' => [ + 'template' => [ + 'description' => __( 'The template assigned to the node', 'wp-graphql' ), + 'type' => 'ContentTemplate', + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTitle.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTitle.php new file mode 100644 index 00000000..9c3bfb0a --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTitle.php @@ -0,0 +1,45 @@ + [ 'Node' ], + 'description' => __( 'A node that NodeWith a title', 'wp-graphql' ), + 'fields' => [ + 'title' => [ + 'type' => 'String', + 'description' => __( 'The title of the post. This is currently just the raw title. An amendment to support rendered title needs to be made.', 'wp-graphql' ), + 'args' => [ + 'format' => [ + 'type' => 'PostObjectFieldFormatEnum', + 'description' => __( 'Format of the field output', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, $args ) { + if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { + // @codingStandardsIgnoreLine. + return $source->titleRaw; + } + + // @codingStandardsIgnoreLine. + return $source->titleRendered; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTrackbacks.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTrackbacks.php new file mode 100644 index 00000000..e6fcb7f1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTrackbacks.php @@ -0,0 +1,38 @@ + [ 'Node' ], + 'description' => __( 'A node that can have trackbacks and pingbacks', 'wp-graphql' ), + 'fields' => [ + 'toPing' => [ + 'type' => [ 'list_of' => 'String' ], + 'description' => __( 'URLs queued to be pinged.', 'wp-graphql' ), + ], + 'pinged' => [ + 'type' => [ 'list_of' => 'String' ], + 'description' => __( 'URLs that have been pinged.', 'wp-graphql' ), + ], + 'pingStatus' => [ + 'type' => 'String', + 'description' => __( 'Whether the pings are open or closed for this particular post.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/OneToOneConnection.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/OneToOneConnection.php new file mode 100644 index 00000000..67452caa --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/OneToOneConnection.php @@ -0,0 +1,31 @@ + __( 'A singular connection from one Node to another, with support for relational data on the "edge" of the connection.', 'wp-graphql' ), + 'interfaces' => [ 'Edge' ], + 'fields' => [ + 'node' => [ + 'type' => [ 'non_null' => 'Node' ], + 'description' => __( 'The connected node', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/PageInfo.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/PageInfo.php new file mode 100644 index 00000000..03d9d448 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/PageInfo.php @@ -0,0 +1,64 @@ + __( 'Information about pagination in a connection.', 'wp-graphql' ), + 'interfaces' => [ 'PageInfo' ], + 'fields' => self::get_fields(), + ] + ); + + register_graphql_interface_type( + 'PageInfo', + [ + 'description' => __( 'Information about pagination in a connection.', 'wp-graphql' ), + 'fields' => self::get_fields(), + ] + ); + } + + /** + * Get the fields for the PageInfo Type + * + * @return array[] + */ + public static function get_fields(): array { + return [ + 'hasNextPage' => [ + 'type' => [ + 'non_null' => 'Boolean', + ], + 'description' => __( 'When paginating forwards, are there more items?', 'wp-graphql' ), + ], + 'hasPreviousPage' => [ + 'type' => [ + 'non_null' => 'Boolean', + ], + 'description' => __( 'When paginating backwards, are there more items?', 'wp-graphql' ), + ], + 'startCursor' => [ + 'type' => 'String', + 'description' => __( 'When paginating backwards, the cursor to continue.', 'wp-graphql' ), + ], + 'endCursor' => [ + 'type' => 'String', + 'description' => __( 'When paginating forwards, the cursor to continue.', 'wp-graphql' ), + ], + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Previewable.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Previewable.php new file mode 100644 index 00000000..7b968662 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Previewable.php @@ -0,0 +1,51 @@ + __( 'Nodes that can be seen in a preview (unpublished) state.', 'wp-graphql' ), + 'fields' => [ + 'isPreview' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is a node in the preview state', 'wp-graphql' ), + ], + 'previewRevisionDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'The database id of the preview node', 'wp-graphql' ), + ], + 'previewRevisionId' => [ + 'type' => 'ID', + 'description' => __( 'Whether the object is a node in the preview state', 'wp-graphql' ), + ], + ], + 'resolveType' => static function ( Post $post ) use ( $type_registry ) { + $type = 'Post'; + + $post_type_object = isset( $post->post_type ) ? get_post_type_object( $post->post_type ) : null; + + if ( isset( $post_type_object->graphql_single_name ) ) { + $type = $type_registry->get_type( $post_type_object->graphql_single_name ); + } + + return $type; + }, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/TermNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/TermNode.php new file mode 100644 index 00000000..0da6f7b8 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/TermNode.php @@ -0,0 +1,112 @@ + [ 'Node', 'UniformResourceIdentifiable' ], + 'connections' => [ + 'enqueuedScripts' => [ + 'toType' => 'EnqueuedScript', + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new EnqueuedScriptsConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + }, + ], + 'enqueuedStylesheets' => [ + 'toType' => 'EnqueuedStylesheet', + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new EnqueuedStylesheetConnectionResolver( $source, $args, $context, $info ); + return $resolver->get_connection(); + }, + ], + ], + 'description' => __( 'Terms are nodes within a Taxonomy, used to group and relate other nodes.', 'wp-graphql' ), + 'resolveType' => static function ( $term ) use ( $type_registry ) { + + /** + * The resolveType callback is used at runtime to determine what Type an object + * implementing the TermNode Interface should be resolved as. + * + * You can filter this centrally using the "graphql_wp_interface_type_config" filter + * to override if you need something other than a Post object to be resolved via the + * $post->post_type attribute. + */ + $type = null; + + if ( isset( $term->taxonomyName ) ) { + $tax_object = get_taxonomy( $term->taxonomyName ); + if ( isset( $tax_object->graphql_single_name ) ) { + $type = $type_registry->get_type( $tax_object->graphql_single_name ); + } + } + + return ! empty( $type ) ? $type : null; + }, + 'fields' => [ + 'databaseId' => [ + 'type' => [ 'non_null' => 'Int' ], + 'description' => __( 'Identifies the primary key from the database.', 'wp-graphql' ), + 'resolve' => static function ( Term $term ) { + return absint( $term->term_id ); + }, + ], + 'count' => [ + 'type' => 'Int', + 'description' => __( 'The number of objects connected to the object', 'wp-graphql' ), + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'The description of the object', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'The human friendly name of the object.', 'wp-graphql' ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => __( 'An alphanumeric identifier for the object unique to its type.', 'wp-graphql' ), + ], + 'termGroupId' => [ + 'type' => 'Int', + 'description' => __( 'The ID of the term group that this term object belongs to', 'wp-graphql' ), + ], + 'termTaxonomyId' => [ + 'type' => 'Int', + 'description' => __( 'The taxonomy ID that the object is associated with', 'wp-graphql' ), + ], + 'taxonomyName' => [ + 'type' => 'String', + 'description' => __( 'The name of the taxonomy that the object is associated with', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'link' => [ + 'type' => 'String', + 'description' => __( 'The link to the term', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/UniformResourceIdentifiable.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/UniformResourceIdentifiable.php new file mode 100644 index 00000000..ffb30038 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/UniformResourceIdentifiable.php @@ -0,0 +1,76 @@ + [ 'Node' ], + 'description' => __( 'Any node that has a URI', 'wp-graphql' ), + 'fields' => [ + 'uri' => [ + 'type' => 'String', + 'description' => __( 'The unique resource identifier path', 'wp-graphql' ), + ], + 'id' => [ + 'type' => [ 'non_null' => 'ID' ], + 'description' => __( 'The unique resource identifier path', 'wp-graphql' ), + ], + 'isContentNode' => [ + 'type' => [ 'non_null' => 'Boolean' ], + 'description' => __( 'Whether the node is a Content Node', 'wp-graphql' ), + 'resolve' => static function ( $node ) { + return $node instanceof Post; + }, + ], + 'isTermNode' => [ + 'type' => [ 'non_null' => 'Boolean' ], + 'description' => __( 'Whether the node is a Term', 'wp-graphql' ), + 'resolve' => static function ( $node ) { + return $node instanceof Term; + }, + ], + ], + 'resolveType' => static function ( $node ) use ( $type_registry ) { + switch ( true ) { + case $node instanceof Post: + /** @var \WP_Post_Type $post_type_object */ + $post_type_object = get_post_type_object( $node->post_type ); + $type = $type_registry->get_type( $post_type_object->graphql_single_name ); + break; + case $node instanceof Term: + /** @var \WP_Taxonomy $tax_object */ + $tax_object = get_taxonomy( $node->taxonomyName ); + $type = $type_registry->get_type( $tax_object->graphql_single_name ); + break; + case $node instanceof User: + $type = $type_registry->get_type( 'User' ); + break; + case $node instanceof PostType: + $type = $type_registry->get_type( 'ContentType' ); + break; + default: + $type = null; + } + + return $type; + }, + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Avatar.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Avatar.php new file mode 100644 index 00000000..dd9461e7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Avatar.php @@ -0,0 +1,69 @@ + __( 'Avatars are profile images for users. WordPress by default uses the Gravatar service to host and fetch avatars from.', 'wp-graphql' ), + 'model' => AvatarModel::class, + 'fields' => [ + 'size' => [ + 'type' => 'Int', + 'description' => __( 'The size of the avatar in pixels. A value of 96 will match a 96px x 96px gravatar image.', 'wp-graphql' ), + ], + 'height' => [ + 'type' => 'Int', + 'description' => __( 'Height of the avatar image.', 'wp-graphql' ), + ], + 'width' => [ + 'type' => 'Int', + 'description' => __( 'Width of the avatar image.', 'wp-graphql' ), + ], + 'default' => [ + 'type' => 'String', + 'description' => __( "URL for the default image or a default type. Accepts '404' (return a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon' (the 'quilt'), 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or 'gravatar_default' (the Gravatar logo).", 'wp-graphql' ), + ], + 'forceDefault' => [ + 'type' => 'Bool', + 'description' => __( 'Whether to always show the default image, never the Gravatar.', 'wp-graphql' ), + ], + 'rating' => [ + 'type' => 'String', + 'description' => __( "What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are judged in that order.", 'wp-graphql' ), + ], + 'scheme' => [ + 'type' => 'String', + 'description' => __( 'Type of url scheme to use. Typically HTTP vs. HTTPS.', 'wp-graphql' ), + ], + 'extraAttr' => [ + 'type' => 'String', + 'description' => __( 'HTML attributes to insert in the IMG element. Is not sanitized.', 'wp-graphql' ), + ], + 'foundAvatar' => [ + 'type' => 'Bool', + 'description' => __( 'Whether the avatar was successfully found.', 'wp-graphql' ), + ], + 'url' => [ + 'type' => 'String', + 'description' => __( 'URL for the gravatar image source.', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Comment.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Comment.php new file mode 100644 index 00000000..03f9197b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Comment.php @@ -0,0 +1,131 @@ + __( 'A Comment object', 'wp-graphql' ), + 'model' => CommentModel::class, + 'interfaces' => [ 'Node', 'DatabaseIdentifier' ], + 'connections' => [ + 'author' => [ + 'toType' => 'Commenter', + 'description' => __( 'The author of the comment', 'wp-graphql' ), + 'oneToOne' => true, + 'resolve' => static function ( $comment, $_args, AppContext $context ) { + $node = null; + + // try and load the user node + if ( ! empty( $comment->userId ) ) { + $node = $context->get_loader( 'user' )->load( absint( $comment->userId ) ); + } + + // If no node is loaded, fallback to the + // public comment author data + if ( ! $node || ( true === $node->isPrivate ) ) { + $node = ! empty( $comment->commentId ) ? $context->get_loader( 'comment_author' )->load( $comment->commentId ) : null; + } + + return [ + 'node' => $node, + 'source' => $comment, + ]; + }, + ], + ], + 'fields' => [ + 'agent' => [ + 'type' => 'String', + 'description' => __( 'User agent used to post the comment. This field is equivalent to WP_Comment->comment_agent and the value matching the "comment_agent" column in SQL.', 'wp-graphql' ), + ], + 'approved' => [ + 'type' => 'Boolean', + 'description' => __( 'The approval status of the comment. This field is equivalent to WP_Comment->comment_approved and the value matching the "comment_approved" column in SQL.', 'wp-graphql' ), + 'deprecationReason' => __( 'Deprecated in favor of the `status` field', 'wp-graphql' ), + 'resolve' => static function ( $comment ) { + return 'approve' === $comment->status; + }, + ], + 'authorIp' => [ + 'type' => 'String', + 'description' => __( 'IP address for the author. This field is equivalent to WP_Comment->comment_author_IP and the value matching the "comment_author_IP" column in SQL.', 'wp-graphql' ), + ], + 'commentId' => [ + 'type' => 'Int', + 'description' => __( 'ID for the comment, unique among comments.', 'wp-graphql' ), + 'deprecationReason' => __( 'Deprecated in favor of databaseId', 'wp-graphql' ), + ], + 'content' => [ + 'type' => 'String', + 'description' => __( 'Content of the comment. This field is equivalent to WP_Comment->comment_content and the value matching the "comment_content" column in SQL.', 'wp-graphql' ), + 'args' => [ + 'format' => [ + 'type' => 'PostObjectFieldFormatEnum', + 'description' => __( 'Format of the field output', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( \WPGraphQL\Model\Comment $comment, $args ) { + if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { + return isset( $comment->contentRaw ) ? $comment->contentRaw : null; + } else { + return isset( $comment->contentRendered ) ? $comment->contentRendered : null; + } + }, + ], + 'date' => [ + 'type' => 'String', + 'description' => __( 'Date the comment was posted in local time. This field is equivalent to WP_Comment->date and the value matching the "date" column in SQL.', 'wp-graphql' ), + ], + 'dateGmt' => [ + 'type' => 'String', + 'description' => __( 'Date the comment was posted in GMT. This field is equivalent to WP_Comment->date_gmt and the value matching the "date_gmt" column in SQL.', 'wp-graphql' ), + ], + 'id' => [ + 'description' => __( 'The globally unique identifier for the comment object', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'karma' => [ + 'type' => 'Int', + 'description' => __( 'Karma value for the comment. This field is equivalent to WP_Comment->comment_karma and the value matching the "comment_karma" column in SQL.', 'wp-graphql' ), + ], + 'parentId' => [ + 'type' => 'ID', + 'description' => __( 'The globally unique identifier of the parent comment node.', 'wp-graphql' ), + ], + 'parentDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'The database id of the parent comment node or null if it is the root comment', 'wp-graphql' ), + ], + 'status' => [ + 'type' => 'CommentStatusEnum', + 'description' => __( 'The approval status of the comment. This field is equivalent to WP_Comment->comment_approved and the value matching the "comment_approved" column in SQL.', 'wp-graphql' ), + ], + 'type' => [ + 'type' => 'String', + 'description' => __( 'Type of comment. This field is equivalent to WP_Comment->comment_type and the value matching the "comment_type" column in SQL.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/CommentAuthor.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/CommentAuthor.php new file mode 100644 index 00000000..a5c7cb06 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/CommentAuthor.php @@ -0,0 +1,104 @@ + __( 'A Comment Author object', 'wp-graphql' ), + 'interfaces' => [ 'Node', 'Commenter' ], + 'model' => CommentAuthorModel::class, + 'eagerlyLoadType' => true, + 'fields' => [ + 'id' => [ + 'description' => __( 'The globally unique identifier for the comment author object', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'The name for the comment author.', 'wp-graphql' ), + ], + 'email' => [ + 'type' => 'String', + 'description' => __( 'The email for the comment author', 'wp-graphql' ), + ], + 'url' => [ + 'type' => 'String', + 'description' => __( 'The url the comment author.', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'avatar' => [ + 'args' => [ + 'size' => [ + 'type' => 'Int', + 'description' => __( 'The size attribute of the avatar field can be used to fetch avatars of different sizes. The value corresponds to the dimension in pixels to fetch. The default is 96 pixels.', 'wp-graphql' ), + 'defaultValue' => 96, + ], + 'forceDefault' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to always show the default image, never the Gravatar. Default false', 'wp-graphql' ), + ], + 'rating' => [ + 'type' => 'AvatarRatingEnum', + 'description' => __( 'The rating level of the avatar.', 'wp-graphql' ), + ], + + ], + 'resolve' => static function ( $comment_author, $args ) { + /** + * If the $comment_author is a user, the User model only returns the email address if the requesting user is authenticated. + * But, to resolve the Avatar we need a valid email, even for unauthenticated requests. + * + * If the email isn't visible, we use the comment ID to retrieve it, then use it to resolve the avatar. + * + * The email address is not publicly exposed, adhering to the rules of the User model. + */ + $comment_author_email = ! empty( $comment_author->email ) ? $comment_author->email : get_comment_author_email( $comment_author->databaseId ); + + if ( empty( $comment_author_email ) ) { + return null; + } + + $avatar_args = []; + if ( is_numeric( $args['size'] ) ) { + $avatar_args['size'] = absint( $args['size'] ); + if ( ! $avatar_args['size'] ) { + $avatar_args['size'] = 96; + } + } + + if ( ! empty( $args['forceDefault'] ) && true === $args['forceDefault'] ) { + $avatar_args['force_default'] = true; + } + + if ( ! empty( $args['rating'] ) ) { + $avatar_args['rating'] = esc_sql( (string) $args['rating'] ); + } + + $avatar = get_avatar_data( $comment_author_email, $avatar_args ); + + // if there's no url returned, return null + if ( empty( $avatar['url'] ) ) { + return null; + } + + return new \WPGraphQL\Model\Avatar( $avatar ); + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/ContentType.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/ContentType.php new file mode 100644 index 00000000..234241c3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/ContentType.php @@ -0,0 +1,136 @@ + __( 'An Post Type object', 'wp-graphql' ), + 'interfaces' => $interfaces, + 'model' => PostType::class, + 'fields' => [ + 'id' => [ + 'description' => __( 'The globally unique identifier of the post-type object.', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'The internal name of the post type. This should not be used for display purposes.', 'wp-graphql' ), + ], + 'label' => [ + 'type' => 'String', + 'description' => __( 'Display name of the content type.', 'wp-graphql' ), + ], + 'labels' => [ + 'type' => 'PostTypeLabelDetails', + 'description' => __( 'Details about the content type labels.', 'wp-graphql' ), + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'Description of the content type.', 'wp-graphql' ), + ], + 'public' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether a content type is intended for use publicly either via the admin interface or by front-end users. While the default settings of exclude_from_search, publicly_queryable, show_ui, and show_in_nav_menus are inherited from public, each does not rely on this relationship and controls a very specific intention.', 'wp-graphql' ), + ], + 'hierarchical' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the content type is hierarchical, for example pages.', 'wp-graphql' ), + ], + 'excludeFromSearch' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to exclude nodes of this content type from front end search results.', 'wp-graphql' ), + ], + 'publiclyQueryable' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether queries can be performed on the front end for the content type as part of parse_request().', 'wp-graphql' ), + ], + 'showUi' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to generate and allow a UI for managing this content type in the admin.', 'wp-graphql' ), + ], + 'showInMenu' => [ + 'type' => 'Boolean', + 'description' => __( 'Where to show the content type in the admin menu. To work, $show_ui must be true. If true, the post type is shown in its own top level menu. If false, no menu is shown. If a string of an existing top level menu (eg. "tools.php" or "edit.php?post_type=page"), the post type will be placed as a sub-menu of that.', 'wp-graphql' ), + ], + 'showInNavMenus' => [ + 'type' => 'Boolean', + 'description' => __( 'Makes this content type available for selection in navigation menus.', 'wp-graphql' ), + ], + 'showInAdminBar' => [ + 'type' => 'Boolean', + 'description' => __( 'Makes this content type available via the admin bar.', 'wp-graphql' ), + ], + 'menuPosition' => [ + 'type' => 'Int', + 'description' => __( 'The position of this post type in the menu. Only applies if show_in_menu is true.', 'wp-graphql' ), + ], + 'menuIcon' => [ + 'type' => 'String', + 'description' => __( 'The name of the icon file to display as a menu icon.', 'wp-graphql' ), + ], + 'hasArchive' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether this content type should have archives. Content archives are generated by type and by date.', 'wp-graphql' ), + ], + 'canExport' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether this content type should can be exported.', 'wp-graphql' ), + ], + 'deleteWithUser' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether content of this type should be deleted when the author of it is deleted from the system.', 'wp-graphql' ), + ], + 'showInRest' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the content type is associated with a route under the the REST API "wp/v2" namespace.', 'wp-graphql' ), + ], + 'restBase' => [ + 'type' => 'String', + 'description' => __( 'Name of content type to display in REST API "wp/v2" namespace.', 'wp-graphql' ), + ], + 'restControllerClass' => [ + 'type' => 'String', + 'description' => __( 'The REST Controller class assigned to handling this content type.', 'wp-graphql' ), + ], + 'showInGraphql' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to add the content type to the GraphQL Schema.', 'wp-graphql' ), + ], + 'graphqlSingleName' => [ + 'type' => 'String', + 'description' => __( 'The singular name of the content type within the GraphQL Schema.', 'wp-graphql' ), + ], + 'graphqlPluralName' => [ + 'type' => 'String', + 'description' => __( 'The plural name of the content type within the GraphQL Schema.', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'isFrontPage' => [ + 'type' => [ 'non_null' => 'Bool' ], + 'description' => __( 'Whether this page is set to the static front page.', 'wp-graphql' ), + ], + 'isPostsPage' => [ + 'type' => [ 'non_null' => 'Bool' ], + 'description' => __( 'Whether this page is set to the blog posts page.', 'wp-graphql' ), + ], + ], + + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedScript.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedScript.php new file mode 100644 index 00000000..1db90261 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedScript.php @@ -0,0 +1,50 @@ + __( 'Script enqueued by the CMS', 'wp-graphql' ), + 'interfaces' => [ 'Node', 'EnqueuedAsset' ], + 'fields' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'resolve' => static function ( $asset ) { + return isset( $asset->handle ) ? Relay::toGlobalId( 'enqueued_script', $asset->handle ) : null; + }, + ], + 'src' => [ + 'resolve' => static function ( \_WP_Dependency $script ) { + return ! empty( $script->src ) && is_string( $script->src ) ? $script->src : null; + }, + ], + 'version' => [ + 'resolve' => static function ( \_WP_Dependency $script ) { + global $wp_scripts; + + return ! empty( $script->ver ) && is_string( $script->ver ) ? (string) $script->ver : $wp_scripts->default_version; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedStylesheet.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedStylesheet.php new file mode 100644 index 00000000..5d8e861d --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedStylesheet.php @@ -0,0 +1,50 @@ + __( 'Stylesheet enqueued by the CMS', 'wp-graphql' ), + 'interfaces' => [ 'Node', 'EnqueuedAsset' ], + 'fields' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'resolve' => static function ( $asset ) { + return isset( $asset->handle ) ? Relay::toGlobalId( 'enqueued_stylesheet', $asset->handle ) : null; + }, + ], + 'src' => [ + 'resolve' => static function ( \_WP_Dependency $stylesheet ) { + return ! empty( $stylesheet->src ) && is_string( $stylesheet->src ) ? $stylesheet->src : null; + }, + ], + 'version' => [ + 'resolve' => static function ( \_WP_Dependency $stylesheet ) { + global $wp_styles; + + return ! empty( $stylesheet->ver ) && is_string( $stylesheet->ver ) ? $stylesheet->ver : $wp_styles->default_version; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaDetails.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaDetails.php new file mode 100644 index 00000000..dff2b131 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaDetails.php @@ -0,0 +1,83 @@ + __( 'File details for a Media Item', 'wp-graphql' ), + 'fields' => [ + 'width' => [ + 'type' => 'Int', + 'description' => __( 'The width of the mediaItem', 'wp-graphql' ), + ], + 'height' => [ + 'type' => 'Int', + 'description' => __( 'The height of the mediaItem', 'wp-graphql' ), + ], + 'file' => [ + 'type' => 'String', + 'description' => __( 'The filename of the mediaItem', 'wp-graphql' ), + ], + 'sizes' => [ + 'type' => [ + 'list_of' => 'MediaSize', + ], + 'args' => [ + 'exclude' => [ // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude + 'type' => [ 'list_of' => 'MediaItemSizeEnum' ], + 'description' => __( 'The sizes to exclude. Will take precedence over `include`.', 'wp-graphql' ), + ], + 'include' => [ + 'type' => [ 'list_of' => 'MediaItemSizeEnum' ], + 'description' => __( 'The sizes to include. Can be overridden by `exclude`.', 'wp-graphql' ), + ], + ], + 'description' => __( 'The available sizes of the mediaItem', 'wp-graphql' ), + 'resolve' => static function ( $media_details, array $args ) { + // Bail early. + if ( empty( $media_details['sizes'] ) ) { + return null; + } + + // If the include arg is set, only include the sizes specified. + if ( ! empty( $args['include'] ) ) { + $media_details['sizes'] = array_intersect_key( $media_details['sizes'], array_flip( $args['include'] ) ); + } + + // If the exclude arg is set, exclude the sizes specified. + if ( ! empty( $args['exclude'] ) ) { + $media_details['sizes'] = array_diff_key( $media_details['sizes'], array_flip( $args['exclude'] ) ); + } + + $sizes = []; + + foreach ( $media_details['sizes'] as $size_name => $size ) { + $size['ID'] = $media_details['ID']; + $size['name'] = $size_name; + $sizes[] = $size; + } + + return ! empty( $sizes ) ? $sizes : null; + }, + ], + 'meta' => [ + 'type' => 'MediaItemMeta', + 'description' => __( 'Meta information associated with the mediaItem', 'wp-graphql' ), + 'resolve' => static function ( $media_details ) { + return ! empty( $media_details['image_meta'] ) ? $media_details['image_meta'] : null; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaItemMeta.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaItemMeta.php new file mode 100644 index 00000000..d8fec8dd --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaItemMeta.php @@ -0,0 +1,86 @@ + __( 'Meta connected to a MediaItem', 'wp-graphql' ), + 'fields' => [ + 'aperture' => [ + 'type' => 'Float', + 'description' => __( 'Aperture measurement of the media item.', 'wp-graphql' ), + ], + 'credit' => [ + 'type' => 'String', + 'description' => __( 'The original creator of the media item.', 'wp-graphql' ), + ], + 'camera' => [ + 'type' => 'String', + 'description' => __( 'Information about the camera used to create the media item.', 'wp-graphql' ), + ], + 'caption' => [ + 'type' => 'String', + 'description' => __( 'The text string description associated with the media item.', 'wp-graphql' ), + ], + 'createdTimestamp' => [ + 'type' => 'Int', + 'description' => __( 'The date/time when the media was created.', 'wp-graphql' ), + 'resolve' => static function ( $meta ) { + return ! empty( $meta['created_timestamp'] ) ? $meta['created_timestamp'] : null; + }, + ], + 'copyright' => [ + 'type' => 'String', + 'description' => __( 'Copyright information associated with the media item.', 'wp-graphql' ), + ], + 'focalLength' => [ + 'type' => 'Float', + 'description' => __( 'The focal length value of the media item.', 'wp-graphql' ), + 'resolve' => static function ( $meta ) { + return ! empty( $meta['focal_length'] ) ? $meta['focal_length'] : null; + }, + ], + 'iso' => [ + 'type' => 'Int', + 'description' => __( 'The ISO (International Organization for Standardization) value of the media item.', 'wp-graphql' ), + ], + 'shutterSpeed' => [ + 'type' => 'Float', + 'description' => __( 'The shutter speed information of the media item.', 'wp-graphql' ), + 'resolve' => static function ( $meta ) { + return ! empty( $meta['shutter_speed'] ) ? $meta['shutter_speed'] : null; + }, + ], + 'title' => [ + 'type' => 'String', + 'description' => __( 'A useful title for the media item.', 'wp-graphql' ), + ], + 'orientation' => [ + 'type' => 'String', + 'description' => __( 'The vertical or horizontal aspect of the media item.', 'wp-graphql' ), + ], + 'keywords' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'List of keywords used to describe or identfy the media item.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaSize.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaSize.php new file mode 100644 index 00000000..ddd44bd8 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaSize.php @@ -0,0 +1,77 @@ + __( 'Details of an available size for a media item', 'wp-graphql' ), + 'fields' => [ + 'name' => [ + 'type' => 'String', + 'description' => __( 'The referenced size name', 'wp-graphql' ), + ], + 'file' => [ + 'type' => 'String', + 'description' => __( 'The filename of the referenced size', 'wp-graphql' ), + ], + 'width' => [ + 'type' => 'String', + 'description' => __( 'The width of the referenced size', 'wp-graphql' ), + ], + 'height' => [ + 'type' => 'String', + 'description' => __( 'The height of the referenced size', 'wp-graphql' ), + ], + 'mimeType' => [ + 'type' => 'String', + 'description' => __( 'The mime type of the referenced size', 'wp-graphql' ), + 'resolve' => static function ( $image ) { + return ! empty( $image['mime-type'] ) ? $image['mime-type'] : null; + }, + ], + 'fileSize' => [ + 'type' => 'Int', + 'description' => __( 'The filesize of the resource', 'wp-graphql' ), + 'resolve' => static function ( $image ) { + if ( ! empty( $image['ID'] ) && ! empty( $image['file'] ) ) { + $original_file = get_attached_file( absint( $image['ID'] ) ); + $filesize_path = ! empty( $original_file ) ? path_join( dirname( $original_file ), $image['file'] ) : null; + + return ! empty( $filesize_path ) ? filesize( $filesize_path ) : null; + } + + return null; + }, + ], + 'sourceUrl' => [ + 'type' => 'String', + 'description' => __( 'The url of the referenced size', 'wp-graphql' ), + 'resolve' => static function ( $image ) { + $src_url = null; + + if ( ! empty( $image['ID'] ) ) { + $src = wp_get_attachment_image_src( absint( $image['ID'] ), $image['name'] ); + if ( ! empty( $src ) ) { + $src_url = $src[0]; + } + } elseif ( ! empty( $image['file'] ) ) { + $src_url = $image['file']; + } + + return $src_url; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Menu.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Menu.php new file mode 100644 index 00000000..ae293bdf --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Menu.php @@ -0,0 +1,56 @@ + __( 'Menus are the containers for navigation items. Menus can be assigned to menu locations, which are typically registered by the active theme.', 'wp-graphql' ), + 'interfaces' => [ 'Node', 'DatabaseIdentifier' ], + 'model' => MenuModel::class, + 'fields' => [ + 'id' => [ + 'description' => __( 'The globally unique identifier of the nav menu object.', 'wp-graphql' ), + ], + 'count' => [ + 'type' => 'Int', + 'description' => __( 'The number of items in the menu', 'wp-graphql' ), + ], + 'menuId' => [ + 'type' => 'Int', + 'description' => __( 'WP ID of the nav menu.', 'wp-graphql' ), + 'deprecationReason' => __( 'Deprecated in favor of the databaseId field', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => esc_html__( 'Display name of the menu. Equivalent to WP_Term->name.', 'wp-graphql' ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => esc_html__( 'The url friendly name of the menu. Equivalent to WP_Term->slug', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'locations' => [ + 'type' => [ + 'list_of' => 'MenuLocationEnum', + ], + 'description' => __( 'The locations a menu is assigned to', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MenuItem.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MenuItem.php new file mode 100644 index 00000000..9b126e0f --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MenuItem.php @@ -0,0 +1,198 @@ + __( 'Navigation menu items are the individual items assigned to a menu. These are rendered as the links in a navigation menu.', 'wp-graphql' ), + 'interfaces' => [ 'Node', 'DatabaseIdentifier' ], + 'model' => MenuItemModel::class, + 'connections' => [ + 'connectedNode' => [ + 'toType' => 'MenuItemLinkable', + 'description' => __( 'Connection from MenuItem to it\'s connected node', 'wp-graphql' ), + 'oneToOne' => true, + 'resolve' => static function ( MenuItemModel $menu_item, $args, AppContext $context, ResolveInfo $info ) { + if ( ! isset( $menu_item->databaseId ) ) { + return null; + } + + $object_id = (int) get_post_meta( $menu_item->databaseId, '_menu_item_object_id', true ); + $object_type = get_post_meta( $menu_item->databaseId, '_menu_item_type', true ); + + $resolver = null; + switch ( $object_type ) { + // Post object + case 'post_type': + $resolver = new PostObjectConnectionResolver( $menu_item, $args, $context, $info, 'any' ); + $resolver->set_query_arg( 'p', $object_id ); + + // connected objects to menu items can be any post status + $resolver->set_query_arg( 'post_status', 'any' ); + break; + + // Taxonomy term + case 'taxonomy': + $resolver = new TermObjectConnectionResolver( $menu_item, $args, $context, $info ); + $resolver->set_query_arg( 'include', $object_id ); + break; + default: + break; + } + + return null !== $resolver ? $resolver->one_to_one()->get_connection() : null; + }, + ], + 'menu' => [ + 'toType' => 'Menu', + 'description' => __( 'The Menu a MenuItem is part of', 'wp-graphql' ), + 'oneToOne' => true, + 'resolve' => static function ( MenuItemModel $menu_item, $args, $context, $info ) { + $resolver = new MenuConnectionResolver( $menu_item, $args, $context, $info ); + $resolver->set_query_arg( 'include', $menu_item->menuDatabaseId ); + + return $resolver->one_to_one()->get_connection(); + }, + ], + ], + 'fields' => [ + 'id' => [ + 'description' => __( 'The globally unique identifier of the nav menu item object.', 'wp-graphql' ), + ], + 'parentId' => [ + 'type' => 'ID', + 'description' => __( 'The globally unique identifier of the parent nav menu item object.', 'wp-graphql' ), + ], + 'parentDatabaseId' => [ + 'type' => 'Int', + 'description' => __( 'The database id of the parent menu item or null if it is the root', 'wp-graphql' ), + ], + 'cssClasses' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'Class attribute for the menu item link', 'wp-graphql' ), + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'Description of the menu item.', 'wp-graphql' ), + ], + 'label' => [ + 'type' => 'String', + 'description' => __( 'Label or title of the menu item.', 'wp-graphql' ), + ], + 'linkRelationship' => [ + 'type' => 'String', + 'description' => __( 'Link relationship (XFN) of the menu item.', 'wp-graphql' ), + ], + 'menuItemId' => [ + 'type' => 'Int', + 'description' => __( 'WP ID of the menu item.', 'wp-graphql' ), + 'deprecationReason' => __( 'Deprecated in favor of the databaseId field', 'wp-graphql' ), + ], + 'target' => [ + 'type' => 'String', + 'description' => __( 'Target attribute for the menu item link.', 'wp-graphql' ), + ], + 'title' => [ + 'type' => 'String', + 'description' => __( 'Title attribute for the menu item link', 'wp-graphql' ), + ], + 'url' => [ + 'type' => 'String', + 'description' => __( 'URL or destination of the menu item.', 'wp-graphql' ), + ], + // Note: this field is added to the MenuItem type instead of applied by the "UniformResourceIdentifiable" interface + // because a MenuItem is not identifiable by a uri, the connected resource is identifiable by the uri. + 'uri' => [ + 'type' => 'String', + 'description' => __( 'The uri of the resource the menu item links to', 'wp-graphql' ), + ], + 'path' => [ + 'type' => 'String', + 'description' => __( 'Path for the resource. Relative path for internal resources. Absolute path for external resources.', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'order' => [ + 'type' => 'Int', + 'description' => __( 'Menu item order', 'wp-graphql' ), + ], + 'locations' => [ + 'type' => [ + 'list_of' => 'MenuLocationEnum', + ], + 'description' => __( 'The locations the menu item\'s Menu is assigned to', 'wp-graphql' ), + ], + 'connectedObject' => [ + 'type' => 'MenuItemObjectUnion', + 'deprecationReason' => __( 'Deprecated in favor of the connectedNode field', 'wp-graphql' ), + 'description' => __( 'The object connected to this menu item.', 'wp-graphql' ), + 'resolve' => static function ( $menu_item, array $args, AppContext $context, $info ) { + $object_id = intval( get_post_meta( $menu_item->menuItemId, '_menu_item_object_id', true ) ); + $object_type = get_post_meta( $menu_item->menuItemId, '_menu_item_type', true ); + + switch ( $object_type ) { + // Post object + case 'post_type': + $resolved_object = $context->get_loader( 'post' )->load_deferred( $object_id ); + break; + + // Taxonomy term + case 'taxonomy': + $resolved_object = $context->get_loader( 'term' )->load_deferred( $object_id ); + break; + default: + $resolved_object = null; + break; + } + + /** + * Allow users to override how nav menu items are resolved. + * This is useful since we often add taxonomy terms to menus + * but would prefer to represent the menu item in other ways, + * e.g., a linked post object (or vice-versa). + * + * @param \WP_Post|\WP_Term $resolved_object Post or term connected to MenuItem + * @param array $args Array of arguments input in the field as part of the GraphQL query + * @param \WPGraphQL\AppContext $context Object containing app context that gets passed down the resolve tree + * @param \GraphQL\Type\Definition\ResolveInfo $info Info about fields passed down the resolve tree + * @param int $object_id Post or term ID of connected object + * @param string $object_type Type of connected object ("post_type" or "taxonomy") + * + * @since 0.0.30 + */ + return apply_filters( + 'graphql_resolve_menu_item', + $resolved_object, + $args, + $context, + $info, + $object_id, + $object_type + ); + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Plugin.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Plugin.php new file mode 100644 index 00000000..639666ae --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Plugin.php @@ -0,0 +1,66 @@ + [ 'Node' ], + 'model' => PluginModel::class, + 'description' => __( 'An plugin object', 'wp-graphql' ), + 'fields' => [ + 'id' => [ + 'description' => __( 'The globally unique identifier of the plugin object.', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'Display name of the plugin.', 'wp-graphql' ), + ], + 'pluginUri' => [ + 'type' => 'String', + 'description' => __( 'URI for the plugin website. This is useful for directing users for support requests etc.', 'wp-graphql' ), + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'Description of the plugin.', 'wp-graphql' ), + ], + 'author' => [ + 'type' => 'String', + 'description' => __( 'Name of the plugin author(s), may also be a company name.', 'wp-graphql' ), + ], + 'authorUri' => [ + 'type' => 'String', + 'description' => __( 'URI for the related author(s)/company website.', 'wp-graphql' ), + ], + 'version' => [ + 'type' => 'String', + 'description' => __( 'Current version of the plugin.', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'path' => [ + 'type' => 'String', + 'description' => __( 'Plugin path.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/PostObject.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/PostObject.php new file mode 100644 index 00000000..ca8154f0 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/PostObject.php @@ -0,0 +1,48 @@ + __( 'Details for labels of the PostType', 'wp-graphql' ), + 'fields' => [ + 'name' => [ + 'type' => 'String', + 'description' => __( 'General name for the post type, usually plural.', 'wp-graphql' ), + ], + 'singularName' => [ + 'type' => 'String', + 'description' => __( 'Name for one object of this post type.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->singular_name ) ? $labels->singular_name : null; + }, + ], + 'addNew' => [ + 'type' => 'String', + 'description' => __( 'Default is ‘Add New’ for both hierarchical and non-hierarchical types.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->add_new ) ? $labels->add_new : null; + }, + ], + 'addNewItem' => [ + 'type' => 'String', + 'description' => __( 'Label for adding a new singular item.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->add_new_item ) ? $labels->add_new_item : null; + }, + ], + 'editItem' => [ + 'type' => 'String', + 'description' => __( 'Label for editing a singular item.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->edit_item ) ? $labels->edit_item : null; + }, + ], + 'newItem' => [ + 'type' => 'String', + 'description' => __( 'Label for the new item page title.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->new_item ) ? $labels->new_item : null; + }, + ], + 'viewItem' => [ + 'type' => 'String', + 'description' => __( 'Label for viewing a singular item.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->view_item ) ? $labels->view_item : null; + }, + ], + 'viewItems' => [ + 'type' => 'String', + 'description' => __( 'Label for viewing post type archives.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->view_items ) ? $labels->view_items : null; + }, + ], + 'searchItems' => [ + 'type' => 'String', + 'description' => __( 'Label for searching plural items.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->search_items ) ? $labels->search_items : null; + }, + ], + 'notFound' => [ + 'type' => 'String', + 'description' => __( 'Label used when no items are found.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->not_found ) ? $labels->not_found : null; + }, + ], + 'notFoundInTrash' => [ + 'type' => 'String', + 'description' => __( 'Label used when no items are in the trash.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->not_found_in_trash ) ? $labels->not_found_in_trash : null; + }, + ], + 'parentItemColon' => [ + 'type' => 'String', + 'description' => __( 'Label used to prefix parents of hierarchical items.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->parent_item_colon ) ? $labels->parent_item_colon : null; + }, + ], + 'allItems' => [ + 'type' => 'String', + 'description' => __( 'Label to signify all items in a submenu link.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->all_items ) ? $labels->all_items : null; + }, + ], + 'archives' => [ + 'type' => 'String', + 'description' => __( 'Label for archives in nav menus', 'wp-graphql' ), + ], + 'attributes' => [ + 'type' => 'String', + 'description' => __( 'Label for the attributes meta box.', 'wp-graphql' ), + ], + 'insertIntoItem' => [ + 'type' => 'String', + 'description' => __( 'Label for the media frame button.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->insert_into_item ) ? $labels->insert_into_item : null; + }, + ], + 'uploadedToThisItem' => [ + 'type' => 'String', + 'description' => __( 'Label for the media frame filter.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->uploaded_to_this_item ) ? $labels->uploaded_to_this_item : null; + }, + ], + 'featuredImage' => [ + 'type' => 'String', + 'description' => __( 'Label for the Featured Image meta box title.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->featured_image ) ? $labels->featured_image : null; + }, + ], + 'setFeaturedImage' => [ + 'type' => 'String', + 'description' => __( 'Label for setting the featured image.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->set_featured_image ) ? $labels->set_featured_image : null; + }, + ], + 'removeFeaturedImage' => [ + 'type' => 'String', + 'description' => __( 'Label for removing the featured image.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->remove_featured_image ) ? $labels->remove_featured_image : null; + }, + ], + 'useFeaturedImage' => [ + 'type' => 'String', + 'description' => __( 'Label in the media frame for using a featured image.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->use_featured_item ) ? $labels->use_featured_item : null; + }, + ], + 'menuName' => [ + 'type' => 'String', + 'description' => __( 'Label for the menu name.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->menu_name ) ? $labels->menu_name : null; + }, + ], + 'filterItemsList' => [ + 'type' => 'String', + 'description' => __( 'Label for the table views hidden heading.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->filter_items_list ) ? $labels->filter_items_list : null; + }, + ], + 'itemsListNavigation' => [ + 'type' => 'String', + 'description' => __( 'Label for the table pagination hidden heading.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->items_list_navigation ) ? $labels->items_list_navigation : null; + }, + ], + 'itemsList' => [ + 'type' => 'String', + 'description' => __( 'Label for the table hidden heading.', 'wp-graphql' ), + 'resolve' => static function ( $labels ) { + return ! empty( $labels->items_list ) ? $labels->items_list : null; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootMutation.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootMutation.php new file mode 100644 index 00000000..a819cf21 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootMutation.php @@ -0,0 +1,35 @@ + __( 'The root mutation', 'wp-graphql' ), + 'fields' => [ + 'increaseCount' => [ + 'type' => 'Int', + 'description' => __( 'Increase the count.', 'wp-graphql' ), + 'args' => [ + 'count' => [ + 'type' => 'Int', + 'description' => __( 'The count to increase', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $root, $args ) { + return isset( $args['count'] ) ? absint( $args['count'] ) + 1 : null; + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootQuery.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootQuery.php new file mode 100644 index 00000000..3dcea5c4 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootQuery.php @@ -0,0 +1,963 @@ + __( 'The root entry point into the Graph', 'wp-graphql' ), + 'connections' => [ + 'contentTypes' => [ + 'toType' => 'ContentType', + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new ContentTypeConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + }, + ], + 'menus' => [ + 'toType' => 'Menu', + 'connectionArgs' => [ + 'id' => [ + 'type' => 'Int', + 'description' => __( 'The database ID of the object', 'wp-graphql' ), + ], + 'location' => [ + 'type' => 'MenuLocationEnum', + 'description' => __( 'The menu location for the menu being queried', 'wp-graphql' ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => __( 'The slug of the menu to query items for', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new MenuConnectionResolver( $source, $args, $context, $info, 'nav_menu' ); + + return $resolver->get_connection(); + }, + ], + 'plugins' => [ + 'toType' => 'Plugin', + 'connectionArgs' => [ + 'search' => [ + 'name' => 'search', + 'type' => 'String', + 'description' => __( 'Show plugin based on a keyword search.', 'wp-graphql' ), + ], + 'status' => [ + 'type' => 'PluginStatusEnum', + 'description' => __( 'Show plugins with a specific status.', 'wp-graphql' ), + ], + 'stati' => [ + 'type' => [ 'list_of' => 'PluginStatusEnum' ], + 'description' => __( 'Retrieve plugins where plugin status is in an array.', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $root, $args, $context, $info ) { + return DataSource::resolve_plugins_connection( $root, $args, $context, $info ); + }, + ], + 'registeredScripts' => [ + 'toType' => 'EnqueuedScript', + 'resolve' => static function ( $source, $args, $context, $info ) { + + // The connection resolver expects the source to include + // enqueuedScriptsQueue + $source = new \stdClass(); + $source->enqueuedScriptsQueue = []; + global $wp_scripts; + do_action( 'wp_enqueue_scripts' ); + $source->enqueuedScriptsQueue = array_keys( $wp_scripts->registered ); + $resolver = new EnqueuedScriptsConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + }, + ], + 'registeredStylesheets' => [ + 'toType' => 'EnqueuedStylesheet', + 'resolve' => static function ( $source, $args, $context, $info ) { + + // The connection resolver expects the source to include + // enqueuedStylesheetsQueue + $source = new \stdClass(); + $source->enqueuedStylesheetsQueue = []; + global $wp_styles; + do_action( 'wp_enqueue_scripts' ); + $source->enqueuedStylesheetsQueue = array_keys( $wp_styles->registered ); + $resolver = new EnqueuedStylesheetConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + }, + ], + 'themes' => [ + 'toType' => 'Theme', + 'resolve' => static function ( $root, $args, $context, $info ) { + $resolver = new ThemeConnectionResolver( $root, $args, $context, $info ); + + return $resolver->get_connection(); + }, + ], + 'revisions' => [ + 'toType' => 'ContentNode', + 'queryClass' => 'WP_Query', + 'connectionArgs' => PostObjects::get_connection_args(), + 'resolve' => static function ( $root, $args, $context, $info ) { + $resolver = new PostObjectConnectionResolver( $root, $args, $context, $info, 'revision' ); + + return $resolver->get_connection(); + }, + ], + 'userRoles' => [ + 'toType' => 'UserRole', + 'fromFieldName' => 'userRoles', + 'resolve' => static function ( $user, $args, $context, $info ) { + $resolver = new UserRoleConnectionResolver( $user, $args, $context, $info ); + + return $resolver->get_connection(); + }, + ], + ], + 'fields' => [ + 'allSettings' => [ + 'type' => 'Settings', + 'description' => __( 'Entry point to get all settings for the site', 'wp-graphql' ), + 'resolve' => static function () { + return true; + }, + ], + 'comment' => [ + 'type' => 'Comment', + 'description' => __( 'Returns a Comment', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'Unique identifier for the comment node.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => 'CommentNodeIdTypeEnum', + 'description' => __( 'Type of unique identifier to fetch a comment by. Default is Global ID', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $_source, array $args, AppContext $context ) { + $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; + + switch ( $id_type ) { + case 'database_id': + $id = absint( $args['id'] ); + break; + default: + $id_components = Relay::fromGlobalId( $args['id'] ); + if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { + throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); + } + $id = absint( $id_components['id'] ); + + break; + } + + return $context->get_loader( 'comment' )->load_deferred( $id ); + }, + ], + 'contentNode' => [ + 'type' => 'ContentNode', + 'description' => __( 'A node used to manage content', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'Unique identifier for the content node.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => 'ContentNodeIdTypeEnum', + 'description' => __( 'Type of unique identifier to fetch a content node by. Default is Global ID', 'wp-graphql' ), + ], + 'contentType' => [ + 'type' => 'ContentTypeEnum', + 'description' => __( 'The content type the node is used for. Required when idType is set to "name" or "slug"', 'wp-graphql' ), + ], + 'asPreview' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to return the Preview Node instead of the Published Node. When the ID of a Node is provided along with asPreview being set to true, the preview node with un-published changes will be returned instead of the published node. If no preview node exists or the requester doesn\'t have proper capabilities to preview, no node will be returned.', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $_root, $args, AppContext $context ) { + $idType = $args['idType'] ?? 'global_id'; + switch ( $idType ) { + case 'uri': + return $context->node_resolver->resolve_uri( + $args['id'], + [ + 'nodeType' => 'ContentNode', + ] + ); + case 'database_id': + $post_id = absint( $args['id'] ); + break; + case 'global_id': + default: + $id_components = Relay::fromGlobalId( $args['id'] ); + if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { + throw new UserError( esc_html__( 'The ID input is invalid. Make sure you set the proper idType for your input.', 'wp-graphql' ) ); + } + $post_id = absint( $id_components['id'] ); + break; + } + + if ( isset( $args['asPreview'] ) && true === $args['asPreview'] ) { + $revisions = wp_get_post_revisions( + $post_id, + [ + 'posts_per_page' => 1, + 'fields' => 'ids', + 'check_enabled' => false, + ] + ); + $post_id = ! empty( $revisions ) ? array_values( $revisions )[0] : $post_id; + } + + $allowed_post_types = \WPGraphQL::get_allowed_post_types(); + $allowed_post_types[] = 'revision'; + + return absint( $post_id ) ? $context->get_loader( 'post' )->load_deferred( $post_id )->then( + static function ( $post ) use ( $allowed_post_types ) { + + // if the post isn't an instance of a Post model, return + if ( ! $post instanceof Post ) { + return null; + } + + if ( ! isset( $post->post_type ) || ! in_array( $post->post_type, $allowed_post_types, true ) ) { + return null; + } + + return $post; + } + ) : null; + }, + ], + 'contentType' => [ + 'type' => 'ContentType', + 'description' => __( 'Fetch a Content Type node by unique Identifier', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ 'non_null' => 'ID' ], + 'description' => __( 'Unique Identifier for the Content Type node.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => 'ContentTypeIdTypeEnum', + 'description' => __( 'Type of unique identifier to fetch a content type by. Default is Global ID', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $_root, $args, $context ) { + $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; + + $id = null; + switch ( $id_type ) { + case 'name': + $id = $args['id']; + break; + case 'id': + default: + $id_parts = Relay::fromGlobalId( $args['id'] ); + if ( isset( $id_parts['id'] ) ) { + $id = $id_parts['id']; + } + } + + return ! empty( $id ) ? $context->get_loader( 'post_type' )->load_deferred( $id ) : null; + }, + ], + 'taxonomy' => [ + 'type' => 'Taxonomy', + 'description' => __( 'Fetch a Taxonomy node by unique Identifier', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ 'non_null' => 'ID' ], + 'description' => __( 'Unique Identifier for the Taxonomy node.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => 'TaxonomyIdTypeEnum', + 'description' => __( 'Type of unique identifier to fetch a taxonomy by. Default is Global ID', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $_root, $args, $context ) { + $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; + + $id = null; + switch ( $id_type ) { + case 'name': + $id = $args['id']; + break; + case 'id': + default: + $id_parts = Relay::fromGlobalId( $args['id'] ); + if ( isset( $id_parts['id'] ) ) { + $id = $id_parts['id']; + } + } + + return ! empty( $id ) ? $context->get_loader( 'taxonomy' )->load_deferred( $id ) : null; + }, + ], + 'node' => [ + 'type' => 'Node', + 'description' => __( 'Fetches an object given its ID', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => 'ID', + 'description' => __( 'The unique identifier of the node', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $root, $args, AppContext $context, ResolveInfo $info ) { + return ! empty( $args['id'] ) ? DataSource::resolve_node( $args['id'], $context, $info ) : null; + }, + ], + 'nodeByUri' => [ + 'type' => 'UniformResourceIdentifiable', + 'description' => __( 'Fetches an object given its Unique Resource Identifier', 'wp-graphql' ), + 'args' => [ + 'uri' => [ + 'type' => [ 'non_null' => 'String' ], + 'description' => __( 'Unique Resource Identifier in the form of a path or permalink for a node. Ex: "/hello-world"', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $root, $args, AppContext $context ) { + return ! empty( $args['uri'] ) ? $context->node_resolver->resolve_uri( $args['uri'] ) : null; + }, + ], + 'menu' => [ + 'type' => 'Menu', + 'description' => __( 'A WordPress navigation menu', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The globally unique identifier of the menu.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => 'MenuNodeIdTypeEnum', + 'description' => __( 'Type of unique identifier to fetch a menu by. Default is Global ID', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, array $args, AppContext $context ) { + $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; + + switch ( $id_type ) { + case 'database_id': + $id = absint( $args['id'] ); + break; + case 'location': + $locations = get_nav_menu_locations(); + + if ( ! isset( $locations[ $args['id'] ] ) || ! absint( $locations[ $args['id'] ] ) ) { + throw new UserError( esc_html__( 'No menu set for the provided location', 'wp-graphql' ) ); + } + + $id = absint( $locations[ $args['id'] ] ); + break; + case 'name': + $menu = new \WP_Term_Query( + [ + 'taxonomy' => 'nav_menu', + 'fields' => 'ids', + 'name' => $args['id'], + 'include_children' => false, + 'count' => false, + ] + ); + $id = ! empty( $menu->terms ) ? (int) $menu->terms[0] : null; + break; + case 'slug': + $menu = new \WP_Term_Query( + [ + 'taxonomy' => 'nav_menu', + 'fields' => 'ids', + 'slug' => $args['id'], + 'include_children' => false, + 'count' => false, + ] + ); + $id = ! empty( $menu->terms ) ? (int) $menu->terms[0] : null; + break; + default: + $id_components = Relay::fromGlobalId( $args['id'] ); + if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { + throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); + } + $id = absint( $id_components['id'] ); + + break; + } + + return ! empty( $id ) ? $context->get_loader( 'term' )->load_deferred( absint( $id ) ) : null; + }, + ], + 'menuItem' => [ + 'type' => 'MenuItem', + 'description' => __( 'A WordPress navigation menu item', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The globally unique identifier of the menu item.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => 'MenuItemNodeIdTypeEnum', + 'description' => __( 'Type of unique identifier to fetch a menu item by. Default is Global ID', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, array $args, AppContext $context ) { + $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; + + switch ( $id_type ) { + case 'database_id': + $id = absint( $args['id'] ); + break; + default: + $id_components = Relay::fromGlobalId( $args['id'] ); + if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { + throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); + } + $id = absint( $id_components['id'] ); + + break; + } + + return $context->get_loader( 'post' )->load_deferred( absint( $id ) ); + }, + ], + 'plugin' => [ + 'type' => 'Plugin', + 'description' => __( 'A WordPress plugin', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The globally unique identifier of the plugin.', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, array $args, AppContext $context ) { + $id_components = Relay::fromGlobalId( $args['id'] ); + + return ! empty( $id_components['id'] ) ? $context->get_loader( 'plugin' )->load_deferred( $id_components['id'] ) : null; + }, + ], + 'termNode' => [ + 'type' => 'TermNode', + 'description' => __( 'A node in a taxonomy used to group and relate content nodes', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'Unique identifier for the term node.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => 'TermNodeIdTypeEnum', + 'description' => __( 'Type of unique identifier to fetch a term node by. Default is Global ID', 'wp-graphql' ), + ], + 'taxonomy' => [ + 'type' => 'TaxonomyEnum', + 'description' => __( 'The taxonomy of the tern node. Required when idType is set to "name" or "slug"', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $root, $args, AppContext $context ) { + $idType = isset( $args['idType'] ) ? $args['idType'] : 'global_id'; + $term_id = null; + + switch ( $idType ) { + case 'slug': + case 'name': + case 'database_id': + $taxonomy = isset( $args['taxonomy'] ) ? $args['taxonomy'] : null; + if ( empty( $taxonomy ) && in_array( + $idType, + [ + 'name', + 'slug', + ], + true + ) ) { + throw new UserError( esc_html__( 'When fetching a Term Node by "slug" or "name", the "taxonomy" also needs to be set as an input.', 'wp-graphql' ) ); + } + if ( 'database_id' === $idType ) { + $term = get_term( absint( $args['id'] ) ); + } else { + $term = get_term_by( $idType, $args['id'], $taxonomy ); + } + $term_id = isset( $term->term_id ) ? absint( $term->term_id ) : null; + + break; + case 'uri': + return $context->node_resolver->resolve_uri( + $args['id'], + [ + 'nodeType' => 'TermNode', + ] + ); + case 'global_id': + default: + $id_components = Relay::fromGlobalId( $args['id'] ); + if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { + throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); + } + $term_id = absint( $id_components['id'] ); + break; + } + + return ! empty( $term_id ) ? $context->get_loader( 'term' )->load_deferred( $term_id ) : null; + }, + ], + 'theme' => [ + 'type' => 'Theme', + 'description' => __( 'A Theme object', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The globally unique identifier of the theme.', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, array $args ) { + $id_components = Relay::fromGlobalId( $args['id'] ); + + return DataSource::resolve_theme( $id_components['id'] ); + }, + ], + 'user' => [ + 'type' => 'User', + 'description' => __( 'Returns a user', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The globally unique identifier of the user.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => 'UserNodeIdTypeEnum', + 'description' => __( 'Type of unique identifier to fetch a user by. Default is Global ID', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, array $args, $context ) { + $idType = isset( $args['idType'] ) ? $args['idType'] : 'id'; + + switch ( $idType ) { + case 'database_id': + $id = absint( $args['id'] ); + break; + case 'uri': + return $context->node_resolver->resolve_uri( + $args['id'], + [ + 'nodeType' => 'User', + ] + ); + case 'login': + $current_user = wp_get_current_user(); + if ( $current_user->user_login !== $args['id'] ) { + if ( ! current_user_can( 'list_users' ) ) { + throw new UserError( esc_html__( 'You do not have permission to request a User by Username', 'wp-graphql' ) ); + } + } + + $user = get_user_by( 'login', $args['id'] ); + $id = isset( $user->ID ) ? $user->ID : null; + break; + case 'email': + $current_user = wp_get_current_user(); + if ( $current_user->user_email !== $args['id'] ) { + if ( ! current_user_can( 'list_users' ) ) { + throw new UserError( esc_html__( 'You do not have permission to request a User by Email', 'wp-graphql' ) ); + } + } + + $user = get_user_by( 'email', $args['id'] ); + $id = isset( $user->ID ) ? $user->ID : null; + break; + case 'slug': + $user = get_user_by( 'slug', $args['id'] ); + $id = isset( $user->ID ) ? $user->ID : null; + break; + case 'id': + default: + $id_components = Relay::fromGlobalId( $args['id'] ); + $id = absint( $id_components['id'] ); + break; + } + + return ! empty( $id ) ? $context->get_loader( 'user' )->load_deferred( $id ) : null; + }, + ], + 'userRole' => [ + 'type' => 'UserRole', + 'description' => __( 'Returns a user role', 'wp-graphql' ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The globally unique identifier of the user object.', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, array $args ) { + $id_components = Relay::fromGlobalId( $args['id'] ); + + return DataSource::resolve_user_role( $id_components['id'] ); + }, + ], + 'viewer' => [ + 'type' => 'User', + 'description' => __( 'Returns the current user', 'wp-graphql' ), + 'resolve' => static function ( $source, array $args, AppContext $context ) { + return ! empty( $context->viewer->ID ) ? $context->get_loader( 'user' )->load_deferred( $context->viewer->ID ) : null; + }, + ], + ], + ] + ); + } + + /** + * Register RootQuery fields for Post Objects of supported post types + * + * @return void + */ + public static function register_post_object_fields() { + /** @var \WP_Post_Type[] */ + $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects', [ 'graphql_register_root_field' => true ] ); + + foreach ( $allowed_post_types as $post_type_object ) { + register_graphql_field( + 'RootQuery', + $post_type_object->graphql_single_name, + [ + 'type' => $post_type_object->graphql_single_name, + 'description' => sprintf( + // translators: %1$s is the post type GraphQL name, %2$s is the post type description + __( 'An object of the %1$s Type. %2$s', 'wp-graphql' ), + $post_type_object->graphql_single_name, + $post_type_object->description + ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The globally unique identifier of the object.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => $post_type_object->graphql_single_name . 'IdType', + 'description' => __( 'Type of unique identifier to fetch by. Default is Global ID', 'wp-graphql' ), + ], + 'asPreview' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to return the Preview Node instead of the Published Node. When the ID of a Node is provided along with asPreview being set to true, the preview node with un-published changes will be returned instead of the published node. If no preview node exists or the requester doesn\'t have proper capabilities to preview, no node will be returned.', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $source, array $args, AppContext $context ) use ( $post_type_object ) { + $idType = isset( $args['idType'] ) ? $args['idType'] : 'global_id'; + $post_id = null; + switch ( $idType ) { + case 'slug': + return $context->node_resolver->resolve_uri( + $args['id'], + [ + 'name' => $args['id'], + 'post_type' => $post_type_object->name, + 'nodeType' => 'ContentNode', + ] + ); + case 'uri': + return $context->node_resolver->resolve_uri( + $args['id'], + [ + 'post_type' => $post_type_object->name, + 'archive' => false, + 'nodeType' => 'ContentNode', + ] + ); + case 'database_id': + $post_id = absint( $args['id'] ); + break; + case 'source_url': + $url = $args['id']; + $post_id = attachment_url_to_postid( $url ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.attachment_url_to_postid_attachment_url_to_postid + if ( empty( $post_id ) ) { + return null; + } + $post_id = absint( attachment_url_to_postid( $url ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.attachment_url_to_postid_attachment_url_to_postid + break; + case 'global_id': + default: + $id_components = Relay::fromGlobalId( $args['id'] ); + if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { + throw new UserError( esc_html__( 'The ID input is invalid. Make sure you set the proper idType for your input.', 'wp-graphql' ) ); + } + $post_id = absint( $id_components['id'] ); + break; + } + + if ( isset( $args['asPreview'] ) && true === $args['asPreview'] ) { + $revisions = wp_get_post_revisions( + $post_id, + [ + 'posts_per_page' => 1, + 'fields' => 'ids', + 'check_enabled' => false, + ] + ); + $post_id = ! empty( $revisions ) ? array_values( $revisions )[0] : $post_id; + } + + return absint( $post_id ) ? $context->get_loader( 'post' )->load_deferred( $post_id )->then( + static function ( $post ) use ( $post_type_object ) { + + // if the post isn't an instance of a Post model, return + if ( ! $post instanceof Post ) { + return null; + } + + if ( ! isset( $post->post_type ) || ! in_array( + $post->post_type, + [ + 'revision', + $post_type_object->name, + ], + true + ) ) { + return null; + } + + return $post; + } + ) : null; + }, + ] + ); + $post_by_args = [ + 'id' => [ + 'type' => 'ID', + 'description' => sprintf( + // translators: %s is the post type's GraphQL name. + __( 'Get the %s object by its global ID', 'wp-graphql' ), + $post_type_object->graphql_single_name + ), + ], + $post_type_object->graphql_single_name . 'Id' => [ + 'type' => 'Int', + 'description' => sprintf( + // translators: %s is the post type's GraphQL name. + __( 'Get the %s by its database ID', 'wp-graphql' ), + $post_type_object->graphql_single_name + ), + ], + 'uri' => [ + 'type' => 'String', + 'description' => sprintf( + // translators: %s is the post type's GraphQL name. + __( 'Get the %s by its uri', 'wp-graphql' ), + $post_type_object->graphql_single_name + ), + ], + ]; + if ( false === $post_type_object->hierarchical ) { + $post_by_args['slug'] = [ + 'type' => 'String', + 'description' => sprintf( + // translators: %s is the post type's GraphQL name. + __( 'Get the %s by its slug (only available for non-hierarchical types)', 'wp-graphql' ), + $post_type_object->graphql_single_name + ), + ]; + } + + /** + * @deprecated Deprecated in favor of single node entry points + */ + register_graphql_field( + 'RootQuery', + $post_type_object->graphql_single_name . 'By', + [ + 'type' => $post_type_object->graphql_single_name, + 'deprecationReason' => __( 'Deprecated in favor of using the single entry point for this type with ID and IDType fields. For example, instead of postBy( id: "" ), use post(id: "" idType: "")', 'wp-graphql' ), + 'description' => sprintf( + // translators: %s is the post type's GraphQL name. + __( 'A %s object', 'wp-graphql' ), + $post_type_object->graphql_single_name + ), + 'args' => $post_by_args, + 'resolve' => static function ( $source, array $args, $context ) use ( $post_type_object ) { + $post_id = 0; + + if ( ! empty( $args['id'] ) ) { + $id_components = Relay::fromGlobalId( $args['id'] ); + if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) { + throw new UserError( esc_html__( 'The "id" is invalid', 'wp-graphql' ) ); + } + $post_id = absint( $id_components['id'] ); + } elseif ( ! empty( $args[ lcfirst( $post_type_object->graphql_single_name . 'Id' ) ] ) ) { + $id = $args[ lcfirst( $post_type_object->graphql_single_name . 'Id' ) ]; + $post_id = absint( $id ); + } elseif ( ! empty( $args['uri'] ) ) { + return $context->node_resolver->resolve_uri( + $args['uri'], + [ + 'post_type' => $post_type_object->name, + 'archive' => false, + 'nodeType' => 'ContentNode', + ] + ); + } elseif ( ! empty( $args['slug'] ) ) { + $slug = esc_html( $args['slug'] ); + + return $context->node_resolver->resolve_uri( + $slug, + [ + 'name' => $slug, + 'post_type' => $post_type_object->name, + 'nodeType' => 'ContentNode', + ] + ); + } + + return $context->get_loader( 'post' )->load_deferred( $post_id )->then( + static function ( $post ) use ( $post_type_object ) { + + // if the post type object isn't an instance of WP_Post_Type, return + if ( ! $post_type_object instanceof \WP_Post_Type ) { + return null; + } + + // if the post isn't an instance of a Post model, return + if ( ! $post instanceof Post ) { + return null; + } + + if ( ! isset( $post->post_type ) || ! in_array( + $post->post_type, + [ + 'revision', + $post_type_object->name, + ], + true + ) ) { + return null; + } + + return $post; + } + ); + }, + ] + ); + } + } + + /** + * Register RootQuery fields for Term Objects of supported taxonomies + * + * @return void + */ + public static function register_term_object_fields() { + /** @var \WP_Taxonomy[] $allowed_taxonomies */ + $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects', [ 'graphql_register_root_field' => true ] ); + + foreach ( $allowed_taxonomies as $tax_object ) { + register_graphql_field( + 'RootQuery', + $tax_object->graphql_single_name, + [ + 'type' => $tax_object->graphql_single_name, + 'description' => sprintf( + // translators: %s is the taxonomys' GraphQL name. + __( 'A % object', 'wp-graphql' ), + $tax_object->graphql_single_name + ), + 'args' => [ + 'id' => [ + 'type' => [ + 'non_null' => 'ID', + ], + 'description' => __( 'The globally unique identifier of the object.', 'wp-graphql' ), + ], + 'idType' => [ + 'type' => $tax_object->graphql_single_name . 'IdType', + 'description' => __( 'Type of unique identifier to fetch by. Default is Global ID', 'wp-graphql' ), + ], + ], + 'resolve' => static function ( $_source, array $args, $context ) use ( $tax_object ) { + $idType = isset( $args['idType'] ) ? $args['idType'] : 'global_id'; + $term_id = null; + + switch ( $idType ) { + case 'slug': + case 'name': + case 'database_id': + if ( 'database_id' === $idType ) { + $idType = 'id'; + } + $term = get_term_by( $idType, $args['id'], $tax_object->name ); + $term_id = isset( $term->term_id ) ? absint( $term->term_id ) : null; + break; + case 'uri': + return $context->node_resolver->resolve_uri( + $args['id'], + [ + 'nodeType' => 'TermNode', + 'taxonomy' => $tax_object->name, + ] + ); + case 'global_id': + default: + $id_components = Relay::fromGlobalId( $args['id'] ); + if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { + throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); + } + $term_id = absint( $id_components['id'] ); + break; + } + + return ! empty( $term_id ) ? $context->get_loader( 'term' )->load_deferred( (int) $term_id ) : null; + }, + ] + ); + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/SettingGroup.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/SettingGroup.php new file mode 100644 index 00000000..cdbd60cc --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/SettingGroup.php @@ -0,0 +1,125 @@ + sprintf( __( 'The %s setting type', 'wp-graphql' ), $group_name ), + 'fields' => $fields, + ] + ); + + return ucfirst( $group_name ) . 'Settings'; + } + + /** + * Given the name of a registered settings group, retrieve GraphQL fields for the group + * + * @param string $group_name Name of the settings group to retrieve fields for + * @param string $group The settings group config + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry + * + * @return array + */ + public static function get_settings_group_fields( string $group_name, string $group, TypeRegistry $type_registry ) { + $setting_fields = DataSource::get_setting_group_fields( $group, $type_registry ); + $fields = []; + + if ( ! empty( $setting_fields ) && is_array( $setting_fields ) ) { + foreach ( $setting_fields as $key => $setting_field ) { + if ( ! isset( $setting_field['type'] ) || ! $type_registry->get_type( $setting_field['type'] ) ) { + continue; + } + + /** + * Determine if the individual setting already has a + * REST API name, if not use the option name. + * Then, sanitize the field name to be camelcase + */ + if ( ! empty( $setting_field['show_in_rest']['name'] ) ) { + $field_key = $setting_field['show_in_rest']['name']; + } else { + $field_key = $key; + } + + $field_key = graphql_format_name( $field_key, ' ', '/[^a-zA-Z0-9 -]/' ); + $field_key = lcfirst( str_replace( '_', ' ', ucwords( $field_key, '_' ) ) ); + $field_key = lcfirst( str_replace( '-', ' ', ucwords( $field_key, '_' ) ) ); + $field_key = lcfirst( str_replace( ' ', '', ucwords( $field_key, ' ' ) ) ); + + if ( ! empty( $key ) && ! empty( $field_key ) ) { + + /** + * Dynamically build the individual setting and it's fields + * then add it to the fields array + */ + $fields[ $field_key ] = [ + 'type' => $type_registry->get_type( $setting_field['type'] ), + // translators: %s is the name of the setting group. + 'description' => isset( $setting_field['description'] ) && ! empty( $setting_field['description'] ) ? $setting_field['description'] : sprintf( __( 'The %s Settings Group', 'wp-graphql' ), $setting_field['type'] ), + 'resolve' => static function () use ( $setting_field ) { + + /** + * Check to see if the user querying the email field has the 'manage_options' capability + * All other options should be public by default + */ + if ( 'admin_email' === $setting_field['key'] ) { + if ( ! current_user_can( 'manage_options' ) ) { + throw new UserError( esc_html__( 'Sorry, you do not have permission to view this setting.', 'wp-graphql' ) ); + } + } + + $option = ! empty( $setting_field['key'] ) ? get_option( $setting_field['key'] ) : null; + + switch ( $setting_field['type'] ) { + case 'integer': + case 'int': + return absint( $option ); + case 'string': + return (string) $option; + case 'boolean': + case 'bool': + return (bool) $option; + case 'number': + case 'float': + return (float) $option; + } + + return ! empty( $option ) ? $option : null; + }, + ]; + } + } + } + + return $fields; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Settings.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Settings.php new file mode 100644 index 00000000..d513c73e --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Settings.php @@ -0,0 +1,128 @@ + __( 'All of the registered settings', 'wp-graphql' ), + 'fields' => $fields, + ] + ); + } + + /** + * Returns an array of fields for all settings based on the `register_setting` WordPress API + * + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry + * + * @return array + */ + public static function get_fields( TypeRegistry $type_registry ) { + $registered_settings = DataSource::get_allowed_settings( $type_registry ); + $fields = []; + + if ( ! empty( $registered_settings ) && is_array( $registered_settings ) ) { + + /** + * Loop through the $settings_array and build thevar + * setting with + * proper fields + */ + foreach ( $registered_settings as $key => $setting_field ) { + if ( ! isset( $setting_field['type'] ) || ! $type_registry->get_type( $setting_field['type'] ) ) { + continue; + } + + /** + * Determine if the individual setting already has a + * REST API name, if not use the option name. + * Then, sanitize the field name to be camelcase + */ + if ( ! empty( $setting_field['show_in_rest']['name'] ) ) { + $field_key = $setting_field['show_in_rest']['name']; + } else { + $field_key = $key; + } + + $group = DataSource::format_group_name( $setting_field['group'] ); + + $field_key = lcfirst( graphql_format_name( $field_key, ' ', '/[^a-zA-Z0-9 -]/' ) ); + $field_key = lcfirst( str_replace( '_', ' ', ucwords( $field_key, '_' ) ) ); + $field_key = lcfirst( str_replace( '-', ' ', ucwords( $field_key, '_' ) ) ); + $field_key = lcfirst( str_replace( ' ', '', ucwords( $field_key, ' ' ) ) ); + + $field_key = $group . 'Settings' . ucfirst( $field_key ); + + if ( ! empty( $key ) ) { + + /** + * Dynamically build the individual setting and it's fields + * then add it to $fields + */ + $fields[ $field_key ] = [ + 'type' => $setting_field['type'], + // translators: %s is the name of the setting group. + 'description' => sprintf( __( 'Settings of the the %s Settings Group', 'wp-graphql' ), $setting_field['type'] ), + 'resolve' => static function () use ( $setting_field, $key ) { + /** + * Check to see if the user querying the email field has the 'manage_options' capability + * All other options should be public by default + */ + if ( 'admin_email' === $key && ! current_user_can( 'manage_options' ) ) { + throw new UserError( esc_html__( 'Sorry, you do not have permission to view this setting.', 'wp-graphql' ) ); + } + + $option = get_option( (string) $key ); + + switch ( $setting_field['type'] ) { + case 'integer': + $option = absint( $option ); + break; + case 'string': + $option = ! empty( $option ) ? (string) $option : ''; + break; + case 'boolean': + $option = (bool) $option; + break; + case 'number': + $option = (float) $option; + break; + } + + return isset( $option ) ? $option : null; + }, + ]; + } + } + } + + return $fields; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Taxonomy.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Taxonomy.php new file mode 100644 index 00000000..9922039f --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Taxonomy.php @@ -0,0 +1,130 @@ + __( 'A taxonomy object', 'wp-graphql' ), + 'interfaces' => [ 'Node' ], + 'model' => TaxonomyModel::class, + 'connections' => [ + 'connectedContentTypes' => [ + 'toType' => 'ContentType', + 'description' => __( 'List of Content Types associated with the Taxonomy', 'wp-graphql' ), + 'resolve' => static function ( TaxonomyModel $taxonomy, $args, AppContext $context, ResolveInfo $info ) { + $connected_post_types = ! empty( $taxonomy->object_type ) ? $taxonomy->object_type : []; + $resolver = new ContentTypeConnectionResolver( $taxonomy, $args, $context, $info ); + $resolver->set_query_arg( 'contentTypeNames', $connected_post_types ); + return $resolver->get_connection(); + }, + ], + 'connectedTerms' => [ + 'toType' => 'TermNode', + 'connectionInterfaces' => [ 'TermNodeConnection' ], + 'description' => __( 'List of Term Nodes associated with the Taxonomy', 'wp-graphql' ), + 'resolve' => static function ( TaxonomyModel $source, $args, AppContext $context, ResolveInfo $info ) { + $taxonomies = [ $source->name ]; + + $resolver = new TermObjectConnectionResolver( $source, $args, $context, $info, $taxonomies ); + + return $resolver->get_connection(); + }, + ], + ], + 'fields' => [ + 'id' => [ + 'description' => __( 'The globally unique identifier of the taxonomy object.', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'The display name of the taxonomy. This field is equivalent to WP_Taxonomy->label', 'wp-graphql' ), + ], + 'label' => [ + 'type' => 'String', + 'description' => __( 'Name of the taxonomy shown in the menu. Usually plural.', 'wp-graphql' ), + ], + // @todo: add "labels" field + 'description' => [ + 'type' => 'String', + 'description' => __( 'Description of the taxonomy. This field is equivalent to WP_Taxonomy->description', 'wp-graphql' ), + ], + 'public' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the taxonomy is publicly queryable', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'hierarchical' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the taxonomy is hierarchical', 'wp-graphql' ), + ], + 'showUi' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to generate and allow a UI for managing terms in this taxonomy in the admin', 'wp-graphql' ), + ], + 'showInMenu' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to show the taxonomy in the admin menu', 'wp-graphql' ), + ], + 'showInNavMenus' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the taxonomy is available for selection in navigation menus.', 'wp-graphql' ), + ], + 'showCloud' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to show the taxonomy as part of a tag cloud widget. This field is equivalent to WP_Taxonomy->show_tagcloud', 'wp-graphql' ), + ], + 'showInQuickEdit' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to show the taxonomy in the quick/bulk edit panel.', 'wp-graphql' ), + ], + 'showInAdminColumn' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to display a column for the taxonomy on its post type listing screens.', 'wp-graphql' ), + ], + 'showInRest' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to add the post type route in the REST API "wp/v2" namespace.', 'wp-graphql' ), + ], + 'restBase' => [ + 'type' => 'String', + 'description' => __( 'Name of content type to display in REST API "wp/v2" namespace.', 'wp-graphql' ), + ], + 'restControllerClass' => [ + 'type' => 'String', + 'description' => __( 'The REST Controller class assigned to handling this content type.', 'wp-graphql' ), + ], + 'showInGraphql' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to add the post type to the GraphQL Schema.', 'wp-graphql' ), + ], + 'graphqlSingleName' => [ + 'type' => 'String', + 'description' => __( 'The singular name of the post type within the GraphQL Schema.', 'wp-graphql' ), + ], + 'graphqlPluralName' => [ + 'type' => 'String', + 'description' => __( 'The plural name of the post type within the GraphQL Schema.', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/TermObject.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/TermObject.php new file mode 100644 index 00000000..8009999b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/TermObject.php @@ -0,0 +1,29 @@ + __( 'A theme object', 'wp-graphql' ), + 'interfaces' => [ 'Node' ], + 'model' => ThemeModel::class, + 'fields' => [ + 'id' => [ + 'description' => __( 'The globally unique identifier of the theme object.', 'wp-graphql' ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => __( 'The theme slug is used to internally match themes. Theme slugs can have subdirectories like: my-theme/sub-theme. This field is equivalent to WP_Theme->get_stylesheet().', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'Display name of the theme. This field is equivalent to WP_Theme->get( "Name" ).', 'wp-graphql' ), + ], + 'screenshot' => [ + 'type' => 'String', + 'description' => __( 'The URL of the screenshot for the theme. The screenshot is intended to give an overview of what the theme looks like. This field is equivalent to WP_Theme->get_screenshot().', 'wp-graphql' ), + ], + 'themeUri' => [ + 'type' => 'String', + 'description' => __( 'A URI if the theme has a website associated with it. The Theme URI is handy for directing users to a theme site for support etc. This field is equivalent to WP_Theme->get( "ThemeURI" ).', 'wp-graphql' ), + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'The description of the theme. This field is equivalent to WP_Theme->get( "Description" ).', 'wp-graphql' ), + ], + 'author' => [ + 'type' => 'String', + 'description' => __( 'Name of the theme author(s), could also be a company name. This field is equivalent to WP_Theme->get( "Author" ).', 'wp-graphql' ), + ], + 'authorUri' => [ + 'type' => 'String', + 'description' => __( 'URI for the author/company website. This field is equivalent to WP_Theme->get( "AuthorURI" ).', 'wp-graphql' ), + ], + 'tags' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'URI for the author/company website. This field is equivalent to WP_Theme->get( "Tags" ).', 'wp-graphql' ), + ], + 'version' => [ + 'type' => 'String', + 'description' => __( 'The current version of the theme. This field is equivalent to WP_Theme->get( "Version" ).', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + ], + + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/User.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/User.php new file mode 100644 index 00000000..28c9e546 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/User.php @@ -0,0 +1,207 @@ + __( 'A User object', 'wp-graphql' ), + 'model' => UserModel::class, + 'interfaces' => [ 'Node', 'UniformResourceIdentifiable', 'Commenter', 'DatabaseIdentifier' ], + 'connections' => [ + 'enqueuedScripts' => [ + 'toType' => 'EnqueuedScript', + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new EnqueuedScriptsConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + }, + ], + 'enqueuedStylesheets' => [ + 'toType' => 'EnqueuedStylesheet', + 'resolve' => static function ( $source, $args, $context, $info ) { + $resolver = new EnqueuedStylesheetConnectionResolver( $source, $args, $context, $info ); + + return $resolver->get_connection(); + }, + ], + 'revisions' => [ + 'toType' => 'ContentNode', + 'connectionTypeName' => 'UserToRevisionsConnection', + 'queryClass' => 'WP_Query', + 'description' => __( 'Connection between the User and Revisions authored by the user', 'wp-graphql' ), + 'connectionArgs' => PostObjects::get_connection_args(), + 'resolve' => static function ( $root, $args, $context, $info ) { + $resolver = new PostObjectConnectionResolver( $root, $args, $context, $info, 'revision' ); + + return $resolver->get_connection(); + }, + ], + 'roles' => [ + 'toType' => 'UserRole', + 'fromFieldName' => 'roles', + 'resolve' => static function ( UserModel $user, $args, $context, $info ) { + $resolver = new UserRoleConnectionResolver( $user, $args, $context, $info ); + + // abort if no roles are set + if ( empty( $user->roles ) ) { + return null; + } + + // Only get roles matching the slugs of the roles belonging to the user + $resolver->set_query_arg( 'slugIn', $user->roles ); + return $resolver->get_connection(); + }, + ], + ], + 'fields' => [ + 'id' => [ + 'description' => __( 'The globally unique identifier for the user object.', 'wp-graphql' ), + ], + 'databaseId' => [ + 'type' => [ 'non_null' => 'Int' ], + 'description' => __( 'Identifies the primary key from the database.', 'wp-graphql' ), + 'resolve' => static function ( \WPGraphQL\Model\User $user ) { + return absint( $user->userId ); + }, + ], + 'capabilities' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'A list of capabilities (permissions) granted to the user', 'wp-graphql' ), + ], + 'capKey' => [ + 'type' => 'String', + 'description' => __( 'User metadata option name. Usually it will be "wp_capabilities".', 'wp-graphql' ), + ], + 'email' => [ + 'type' => 'String', + 'description' => __( 'Email address of the user. This is equivalent to the WP_User->user_email property.', 'wp-graphql' ), + ], + 'firstName' => [ + 'type' => 'String', + 'description' => __( 'First name of the user. This is equivalent to the WP_User->user_first_name property.', 'wp-graphql' ), + ], + 'lastName' => [ + 'type' => 'String', + 'description' => __( 'Last name of the user. This is equivalent to the WP_User->user_last_name property.', 'wp-graphql' ), + ], + 'extraCapabilities' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'A complete list of capabilities including capabilities inherited from a role. This is equivalent to the array keys of WP_User->allcaps.', 'wp-graphql' ), + ], + 'description' => [ + 'type' => 'String', + 'description' => __( 'Description of the user.', 'wp-graphql' ), + ], + 'username' => [ + 'type' => 'String', + 'description' => __( 'Username for the user. This field is equivalent to WP_User->user_login.', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'Display name of the user. This is equivalent to the WP_User->display_name property.', 'wp-graphql' ), + ], + 'registeredDate' => [ + 'type' => 'String', + 'description' => __( 'The date the user registered or was created. The field follows a full ISO8601 date string format.', 'wp-graphql' ), + ], + 'nickname' => [ + 'type' => 'String', + 'description' => __( 'Nickname of the user.', 'wp-graphql' ), + ], + 'url' => [ + 'type' => 'String', + 'description' => __( 'A website url that is associated with the user.', 'wp-graphql' ), + ], + 'slug' => [ + 'type' => 'String', + 'description' => __( 'The slug for the user. This field is equivalent to WP_User->user_nicename', 'wp-graphql' ), + ], + 'nicename' => [ + 'type' => 'String', + 'description' => __( 'The nicename for the user. This field is equivalent to WP_User->user_nicename', 'wp-graphql' ), + ], + 'locale' => [ + 'type' => 'String', + 'description' => __( 'The preferred language locale set for the user. Value derived from get_user_locale().', 'wp-graphql' ), + ], + 'userId' => [ + 'type' => 'Int', + 'description' => __( 'The Id of the user. Equivalent to WP_User->ID', 'wp-graphql' ), + 'deprecationReason' => __( 'Deprecated in favor of the databaseId field', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + 'shouldShowAdminToolbar' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the Toolbar should be displayed when the user is viewing the site.', 'wp-graphql' ), + ], + 'avatar' => [ + 'args' => [ + 'size' => [ + 'type' => 'Int', + 'description' => __( 'The size attribute of the avatar field can be used to fetch avatars of different sizes. The value corresponds to the dimension in pixels to fetch. The default is 96 pixels.', 'wp-graphql' ), + 'defaultValue' => 96, + ], + 'forceDefault' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether to always show the default image, never the Gravatar. Default false', 'wp-graphql' ), + ], + 'rating' => [ + 'type' => 'AvatarRatingEnum', + 'description' => __( 'The rating level of the avatar.', 'wp-graphql' ), + ], + + ], + 'resolve' => static function ( $user, $args ) { + $avatar_args = []; + if ( is_numeric( $args['size'] ) ) { + $avatar_args['size'] = absint( $args['size'] ); + if ( ! $avatar_args['size'] ) { + $avatar_args['size'] = 96; + } + } + + if ( ! empty( $args['forceDefault'] ) && true === $args['forceDefault'] ) { + $avatar_args['force_default'] = true; + } + + if ( ! empty( $args['rating'] ) ) { + $avatar_args['rating'] = esc_sql( $args['rating'] ); + } + + return DataSource::resolve_avatar( $user->userId, $avatar_args ); + }, + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/UserRole.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/UserRole.php new file mode 100644 index 00000000..b3c94a5c --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/ObjectType/UserRole.php @@ -0,0 +1,47 @@ + __( 'A user role object', 'wp-graphql' ), + 'model' => UserRoleModel::class, + 'interfaces' => [ 'Node' ], + 'fields' => [ + 'id' => [ + 'description' => __( 'The globally unique identifier for the user role object.', 'wp-graphql' ), + ], + 'name' => [ + 'type' => 'String', + 'description' => __( 'The registered name of the role', 'wp-graphql' ), + ], + 'capabilities' => [ + 'type' => [ + 'list_of' => 'String', + ], + 'description' => __( 'The capabilities that belong to this role', 'wp-graphql' ), + ], + 'displayName' => [ + 'type' => 'String', + 'description' => __( 'The display name of the role', 'wp-graphql' ), + ], + 'isRestricted' => [ + 'type' => 'Boolean', + 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), + ], + ], + ] + ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Union/MenuItemObjectUnion.php b/lib/wp-graphql-1.17.0/src/Type/Union/MenuItemObjectUnion.php new file mode 100644 index 00000000..96ebced0 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Union/MenuItemObjectUnion.php @@ -0,0 +1,93 @@ + self::get_possible_types(), + 'description' => __( 'Deprecated in favor of MenuItemLinkeable Interface', 'wp-graphql' ), + 'resolveType' => static function ( $obj ) use ( $type_registry ) { + _doing_it_wrong( 'MenuItemObjectUnion', esc_attr__( 'The MenuItemObjectUnion GraphQL type is deprecated in favor of MenuItemLinkeable Interface', 'wp-graphql' ), '0.10.3' ); + // Post object + if ( $obj instanceof Post && isset( $obj->post_type ) && ! empty( $obj->post_type ) ) { + /** @var \WP_Post_Type $post_type_object */ + $post_type_object = get_post_type_object( $obj->post_type ); + + return $type_registry->get_type( $post_type_object->graphql_single_name ); + } + + // Taxonomy term + if ( $obj instanceof Term && ! empty( $obj->taxonomyName ) ) { + /** @var \WP_Taxonomy $tax_object */ + $tax_object = get_taxonomy( $obj->taxonomyName ); + + return $type_registry->get_type( $tax_object->graphql_single_name ); + } + + return $obj; + }, + ] + ); + } + + /** + * Returns a list of possible types for the union + * + * @return array + */ + public static function get_possible_types() { + + /** + * The possible types for MenuItems should be just the TermObjects and PostTypeObjects that are + * registered to "show_in_graphql" and "show_in_nav_menus" + */ + $args = [ + 'show_in_nav_menus' => true, + 'graphql_kind' => 'object', + ]; + + $possible_types = []; + + /** + * Add post types that are allowed in WPGraphQL. + * + * @var \WP_Post_Type $post_type_object + */ + foreach ( \WPGraphQL::get_allowed_post_types( 'objects', $args ) as $post_type_object ) { + if ( isset( $post_type_object->graphql_single_name ) ) { + $possible_types[] = $post_type_object->graphql_single_name; + } + } + + // Add taxonomies that are allowed in WPGraphQL. + foreach ( \WPGraphQL::get_allowed_taxonomies( 'objects', $args ) as $tax_object ) { + if ( isset( $tax_object->graphql_single_name ) ) { + $possible_types[] = $tax_object->graphql_single_name; + } + } + + return $possible_types; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Union/PostObjectUnion.php b/lib/wp-graphql-1.17.0/src/Type/Union/PostObjectUnion.php new file mode 100644 index 00000000..71a13667 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Union/PostObjectUnion.php @@ -0,0 +1,65 @@ + 'PostObjectUnion', + 'typeNames' => self::get_possible_types(), + 'description' => __( 'Union between the post, page and media item types', 'wp-graphql' ), + 'resolveType' => static function ( $value ) use ( $type_registry ) { + _doing_it_wrong( 'PostObjectUnion', esc_attr__( 'The PostObjectUnion GraphQL type is deprecated. Use the ContentNode interface instead.', 'wp-graphql' ), '1.14.1' ); + + $type = null; + if ( isset( $value->post_type ) ) { + $post_type_object = get_post_type_object( $value->post_type ); + if ( isset( $post_type_object->graphql_single_name ) ) { + $type = $type_registry->get_type( $post_type_object->graphql_single_name ); + } + } + + return ! empty( $type ) ? $type : null; + }, + ] + ); + } + + /** + * Returns a list of possible types for the union + * + * @return array + */ + public static function get_possible_types() { + $possible_types = []; + /** @var \WP_Post_Type[] */ + $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects', [ 'graphql_kind' => 'object' ] ); + + foreach ( $allowed_post_types as $post_type_object ) { + if ( empty( $possible_types[ $post_type_object->name ] ) && isset( $post_type_object->graphql_single_name ) ) { + $possible_types[ $post_type_object->name ] = $post_type_object->graphql_single_name; + } + } + + return $possible_types; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/Union/TermObjectUnion.php b/lib/wp-graphql-1.17.0/src/Type/Union/TermObjectUnion.php new file mode 100644 index 00000000..599f912b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/Union/TermObjectUnion.php @@ -0,0 +1,66 @@ + 'union', + 'typeNames' => self::get_possible_types(), + 'description' => __( 'Union between the Category, Tag and PostFormatPost types', 'wp-graphql' ), + 'resolveType' => static function ( $value ) use ( $type_registry ) { + _doing_it_wrong( 'TermObjectUnion', esc_attr__( 'The TermObjectUnion GraphQL type is deprecated. Use the TermNode interface instead.', 'wp-graphql' ), '1.14.1' ); + + $type = null; + if ( isset( $value->taxonomyName ) ) { + $tax_object = get_taxonomy( $value->taxonomyName ); + if ( isset( $tax_object->graphql_single_name ) ) { + $type = $type_registry->get_type( $tax_object->graphql_single_name ); + } + } + + return ! empty( $type ) ? $type : null; + }, + ] + ); + } + + /** + * Returns a list of possible types for the union + * + * @return array + */ + public static function get_possible_types() { + $possible_types = []; + /** @var \WP_Taxonomy[] $allowed_taxonomies */ + $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects', [ 'graphql_kind' => 'object' ] ); + + foreach ( $allowed_taxonomies as $tax_object ) { + if ( empty( $possible_types[ $tax_object->name ] ) ) { + if ( isset( $tax_object->graphql_single_name ) ) { + $possible_types[ $tax_object->name ] = $tax_object->graphql_single_name; + } + } + } + + return $possible_types; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPConnectionType.php b/lib/wp-graphql-1.17.0/src/Type/WPConnectionType.php new file mode 100644 index 00000000..9883ccc3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/WPConnectionType.php @@ -0,0 +1,674 @@ +type_registry = $type_registry; + + /** + * Filter the config of WPConnectionType + * + * @param array $config Array of configuration options passed to the WPConnectionType when instantiating a new type + * @param \WPGraphQL\Type\WPConnectionType $wp_connection_type The instance of the WPConnectionType class + */ + $config = apply_filters( 'graphql_wp_connection_type_config', $config, $this ); + + $this->validate_config( $config ); + + $this->config = $config; + $this->from_type = $config['fromType']; + $this->to_type = $config['toType']; + + /** + * Filter the connection field name. + * + * @internal This filter is internal and used by rename_graphql_field(). It is not intended for use by external code. + * + * @param string $from_field_name The name of the field the connection will be exposed as. + */ + $this->from_field_name = apply_filters( "graphql_wp_connection_{$this->from_type}_from_field_name", $config['fromFieldName'] ); + + $this->connection_name = ! empty( $config['connectionTypeName'] ) ? $config['connectionTypeName'] : $this->get_connection_name( $this->from_type, $this->to_type, $this->from_field_name ); + + /** + * Bail if the connection has been de-registered or excluded. + */ + if ( ! $this->should_register() ) { + return; + } + + $this->auth = array_key_exists( 'auth', $config ) && is_array( $config['auth'] ) ? $config['auth'] : []; + $this->connection_fields = array_key_exists( 'connectionFields', $config ) && is_array( $config['connectionFields'] ) ? $config['connectionFields'] : []; + $this->connection_args = array_key_exists( 'connectionArgs', $config ) && is_array( $config['connectionArgs'] ) ? $config['connectionArgs'] : []; + $this->edge_fields = array_key_exists( 'edgeFields', $config ) && is_array( $config['edgeFields'] ) ? $config['edgeFields'] : []; + $this->resolve_cursor = array_key_exists( 'resolveCursor', $config ) && is_callable( $config['resolve'] ) ? $config['resolveCursor'] : null; + $this->resolve_connection = array_key_exists( 'resolve', $config ) && is_callable( $config['resolve'] ) ? $config['resolve'] : static function () { + return null; + }; + $this->where_args = []; + $this->one_to_one = isset( $config['oneToOne'] ) && true === $config['oneToOne']; + $this->connection_interfaces = isset( $config['connectionInterfaces'] ) && is_array( $config['connectionInterfaces'] ) ? $config['connectionInterfaces'] : []; + $this->include_default_interfaces = isset( $config['includeDefaultInterfaces'] ) ? (bool) $config['includeDefaultInterfaces'] : true; + $this->query_class = array_key_exists( 'queryClass', $config ) && ! empty( $config['queryClass'] ) ? $config['queryClass'] : null; + + /** + * Run an action when the WPConnectionType is instantiating. + * + * @param array $config Array of configuration options passed to the WPObjectType when instantiating a new type + * @param \WPGraphQL\Type\WPConnectionType $wp_connection_type The instance of the WPConnectionType class + * + * @since 1.13.0 + */ + do_action( 'graphql_wp_connection_type', $config, $this ); + + $this->register_connection(); + } + + /** + * Validates that essential key/value pairs are passed to the connection config. + * + * @param array $config + * + * @return void + */ + protected function validate_config( array $config ): void { + if ( ! array_key_exists( 'fromType', $config ) ) { + throw new InvalidArgument( esc_html__( 'Connection config needs to have at least a fromType defined', 'wp-graphql' ) ); + } + + if ( ! array_key_exists( 'toType', $config ) ) { + throw new InvalidArgument( esc_html__( 'Connection config needs to have a "toType" defined', 'wp-graphql' ) ); + } + + if ( ! array_key_exists( 'fromFieldName', $config ) || ! is_string( $config['fromFieldName'] ) ) { + throw new InvalidArgument( esc_html__( 'Connection config needs to have "fromFieldName" defined as a string value', 'wp-graphql' ) ); + } + } + + /** + * Get edge interfaces + * + * @param array $interfaces + * + * @return array + */ + protected function get_edge_interfaces( array $interfaces = [] ): array { + + // Only include the default interfaces if the user hasnt explicitly opted out. + if ( false !== $this->include_default_interfaces ) { + $interfaces[] = Utils::format_type_name( $this->to_type . 'ConnectionEdge' ); + } + + if ( ! empty( $this->connection_interfaces ) ) { + foreach ( $this->connection_interfaces as $connection_interface ) { + $interfaces[] = str_ends_with( $connection_interface, 'Edge' ) ? $connection_interface : $connection_interface . 'Edge'; + } + } + return $interfaces; + } + + /** + * Utility method that formats the connection name given the name of the from Type and the to + * Type + * + * @param string $from_type Name of the Type the connection is coming from + * @param string $to_type Name of the Type the connection is going to + * @param string $from_field_name Acts as an alternative "toType" if connection type already defined using $to_type. + * + * @return string + */ + public function get_connection_name( string $from_type, string $to_type, string $from_field_name ): string { + + // Create connection name using $from_type + To + $to_type + Connection. + $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'Connection'; + + // If connection type already exists with that connection name. Set connection name using + // $from_field_name + To + $to_type + Connection. + if ( $this->type_registry->has_type( $connection_name ) ) { + $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $from_field_name ) . 'Connection'; + } + + return $connection_name; + } + + /** + * If the connection includes connection args in the config, this registers the input args + * for the connection + * + * @return void + * + * @throws \Exception + */ + protected function register_connection_input() { + if ( empty( $this->connection_args ) ) { + return; + } + + $input_name = $this->connection_name . 'WhereArgs'; + + if ( $this->type_registry->has_type( $input_name ) ) { + return; + } + + $this->type_registry->register_input_type( + $input_name, + [ + 'description' => sprintf( + // translators: %s is the name of the connection + __( 'Arguments for filtering the %s connection', 'wp-graphql' ), + $this->connection_name + ), + 'fields' => $this->connection_args, + 'queryClass' => $this->query_class, + ] + ); + + $this->where_args = [ + 'where' => [ + 'description' => __( 'Arguments for filtering the connection', 'wp-graphql' ), + 'type' => $this->connection_name . 'WhereArgs', + ], + ]; + } + + /** + * Registers the One to One Connection Edge type to the Schema + * + * @return void + * + * @throws \Exception + */ + protected function register_one_to_one_connection_edge_type(): void { + if ( $this->type_registry->has_type( $this->connection_name . 'Edge' ) ) { + return; + } + + // Only include the default interfaces if the user hasnt explicitly opted out. + $default_interfaces = false !== $this->include_default_interfaces ? [ + 'OneToOneConnection', + 'Edge', + ] : []; + $interfaces = $this->get_edge_interfaces( $default_interfaces ); + + $this->type_registry->register_object_type( + $this->connection_name . 'Edge', + [ + 'interfaces' => $interfaces, + 'description' => sprintf( + // translators: Placeholders are for the name of the Type the connection is coming from and the name of the Type the connection is going to + __( 'Connection between the %1$s type and the %2$s type', 'wp-graphql' ), + $this->from_type, + $this->to_type + ), + 'fields' => array_merge( + [ + 'node' => [ + 'type' => [ 'non_null' => $this->to_type ], + 'description' => __( 'The node of the connection, without the edges', 'wp-graphql' ), + 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, + ], + ], + $this->edge_fields + ), + ] + ); + } + + /** + * Registers the PageInfo type for the connection + * + * @return void + * + * @throws \Exception + */ + public function register_connection_page_info_type(): void { + if ( $this->type_registry->has_type( $this->connection_name . 'PageInfo' ) ) { + return; + } + + $this->type_registry->register_object_type( + $this->connection_name . 'PageInfo', + [ + 'interfaces' => [ $this->to_type . 'ConnectionPageInfo' ], + 'description' => sprintf( + // translators: %s is the name of the connection. + __( 'Page Info on the "%s"', 'wp-graphql' ), + $this->connection_name + ), + 'fields' => PageInfo::get_fields(), + ] + ); + } + + /** + * Registers the Connection Edge type to the Schema + * + * @return void + * + * @throws \Exception + */ + protected function register_connection_edge_type(): void { + if ( $this->type_registry->has_type( $this->connection_name . 'Edge' ) ) { + return; + } + // Only include the default interfaces if the user hasnt explicitly opted out. + $default_interfaces = false === $this->include_default_interfaces ? [ + 'Edge', + ] : []; + $interfaces = $this->get_edge_interfaces( $default_interfaces ); + + $this->type_registry->register_object_type( + $this->connection_name . 'Edge', + [ + 'description' => __( 'An edge in a connection', 'wp-graphql' ), + 'interfaces' => $interfaces, + 'fields' => array_merge( + [ + 'cursor' => [ + 'type' => 'String', + 'description' => __( 'A cursor for use in pagination', 'wp-graphql' ), + 'resolve' => $this->resolve_cursor, + 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, + ], + 'node' => [ + 'type' => [ 'non_null' => $this->to_type ], + 'description' => __( 'The item at the end of the edge', 'wp-graphql' ), + 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, + ], + ], + $this->edge_fields + ), + ] + ); + } + + /** + * Registers the Connection Type to the Schema + * + * @return void + * + * @throws \Exception + */ + protected function register_connection_type(): void { + if ( $this->type_registry->has_type( $this->connection_name ) ) { + return; + } + + $interfaces = ! empty( $this->connection_interfaces ) ? $this->connection_interfaces : []; + $interfaces[] = Utils::format_type_name( $this->to_type . 'Connection' ); + + // Only include the default interfaces if the user hasnt explicitly opted out. + if ( false !== $this->include_default_interfaces ) { + $interfaces[] = 'Connection'; + } + + $this->type_registry->register_object_type( + $this->connection_name, + [ + 'description' => sprintf( + // translators: the placeholders are the name of the Types the connection is between. + __( 'Connection between the %1$s type and the %2$s type', 'wp-graphql' ), + $this->from_type, + $this->to_type + ), + 'interfaces' => $interfaces, + 'connection_config' => $this->config, + 'fields' => $this->get_connection_fields(), + ] + ); + } + + /** + * Returns fields to be used on the connection + * + * @return array + */ + protected function get_connection_fields(): array { + return array_merge( + [ + 'pageInfo' => [ + 'type' => [ 'non_null' => $this->connection_name . 'PageInfo' ], + 'description' => __( 'Information about pagination in a connection.', 'wp-graphql' ), + ], + 'edges' => [ + 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => $this->connection_name . 'Edge' ] ] ], + // translators: %s is the name of the connection. + 'description' => sprintf( __( 'Edges for the %s connection', 'wp-graphql' ), $this->connection_name ), + ], + 'nodes' => [ + 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => $this->to_type ] ] ], + 'description' => __( 'The nodes of the connection, without the edges', 'wp-graphql' ), + ], + ], + $this->connection_fields + ); + } + + /** + * Get the args used for pagination on connections + * + * @return array|array[] + */ + protected function get_pagination_args(): array { + if ( true === $this->one_to_one ) { + $pagination_args = []; + } else { + $pagination_args = [ + 'first' => [ + 'type' => 'Int', + 'description' => __( 'The number of items to return after the referenced "after" cursor', 'wp-graphql' ), + ], + 'last' => [ + 'type' => 'Int', + 'description' => __( 'The number of items to return before the referenced "before" cursor', 'wp-graphql' ), + ], + 'after' => [ + 'type' => 'String', + 'description' => __( 'Cursor used along with the "first" argument to reference where in the dataset to get data', 'wp-graphql' ), + ], + 'before' => [ + 'type' => 'String', + 'description' => __( 'Cursor used along with the "last" argument to reference where in the dataset to get data', 'wp-graphql' ), + ], + ]; + } + + return $pagination_args; + } + + /** + * Registers the connection in the Graph + * + * @return void + * @throws \Exception + */ + public function register_connection_field(): void { + + // merge the config so the raw data passed to the connection + // is passed to the field and can be accessed via $info in resolvers + $field_config = array_merge( + $this->config, + [ + 'type' => true === $this->one_to_one ? $this->connection_name . 'Edge' : $this->connection_name, + 'args' => array_merge( $this->get_pagination_args(), $this->where_args ), + 'auth' => $this->auth, + 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, + 'description' => ! empty( $this->config['description'] ) + ? $this->config['description'] + : sprintf( + // translators: the placeholders are the name of the Types the connection is between. + __( 'Connection between the %1$s type and the %2$s type', 'wp-graphql' ), + $this->from_type, + $this->to_type + ), + 'resolve' => function ( $root, $args, $context, $info ) { + $context->connection_query_class = $this->query_class; + $resolve_connection = $this->resolve_connection; + + /** + * Return the results of the connection resolver + */ + return $resolve_connection( $root, $args, $context, $info ); + }, + 'allowFieldUnderscores' => isset( $this->config['allowFieldUnderscores'] ) && true === $this->config['allowFieldUnderscores'], + ] + ); + + $this->type_registry->register_field( + $this->from_type, + $this->from_field_name, + $field_config + ); + } + + /** + * @return void + * @throws \Exception + */ + public function register_connection_interfaces(): void { + $connection_edge_type = Utils::format_type_name( $this->to_type . 'ConnectionEdge' ); + + if ( ! $this->type_registry->has_type( $this->to_type . 'ConnectionPageInfo' ) ) { + $this->type_registry->register_interface_type( + $this->to_type . 'ConnectionPageInfo', + [ + 'interfaces' => [ 'WPPageInfo' ], + // translators: %s is the name of the connection edge. + 'description' => sprintf( __( 'Page Info on the connected %s', 'wp-graphql' ), $connection_edge_type ), + 'fields' => PageInfo::get_fields(), + ] + ); + } + + + if ( ! $this->type_registry->has_type( $connection_edge_type ) ) { + $this->type_registry->register_interface_type( + $connection_edge_type, + [ + 'interfaces' => [ 'Edge' ], + // translators: %s is the name of the type the connection edge is to. + 'description' => sprintf( __( 'Edge between a Node and a connected %s', 'wp-graphql' ), $this->to_type ), + 'fields' => [ + 'node' => [ + 'type' => [ 'non_null' => $this->to_type ], + // translators: %s is the name of the type the connection edge is to. + 'description' => sprintf( __( 'The connected %s Node', 'wp-graphql' ), $this->to_type ), + ], + ], + ] + ); + } + + if ( ! $this->one_to_one && ! $this->type_registry->has_type( $this->to_type . 'Connection' ) ) { + $this->type_registry->register_interface_type( + $this->to_type . 'Connection', + [ + 'interfaces' => [ 'Connection' ], + // translators: %s is the name of the type the connection is to. + 'description' => sprintf( __( 'Connection to %s Nodes', 'wp-graphql' ), $this->to_type ), + 'fields' => [ + 'edges' => [ + 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => $connection_edge_type ] ] ], + 'description' => sprintf( + // translators: %1$s is the name of the type the connection is from, %2$s is the name of the type the connection is to. + __( 'A list of edges (relational context) between %1$s and connected %2$s Nodes', 'wp-graphql' ), + $this->from_type, + $this->to_type + ), + ], + 'pageInfo' => [ + 'type' => [ 'non_null' => $this->to_type . 'ConnectionPageInfo' ], + ], + 'nodes' => [ + 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => $this->to_type ] ] ], + // translators: %s is the name of the type the connection is to. + 'description' => sprintf( __( 'A list of connected %s Nodes', 'wp-graphql' ), $this->to_type ), + ], + ], + ] + ); + } + } + + /** + * Registers the connection Types and field to the Schema. + * + * @todo change to 'Protected'. This is public for now to allow for backwards compatibility. + * + * @return void + * + * @throws \Exception + */ + public function register_connection(): void { + $this->register_connection_input(); + + if ( false !== $this->include_default_interfaces ) { + $this->register_connection_interfaces(); + } + + if ( true === $this->one_to_one ) { + $this->register_one_to_one_connection_edge_type(); + } else { + $this->register_connection_page_info_type(); + $this->register_connection_edge_type(); + $this->register_connection_type(); + } + + $this->register_connection_field(); + } + + /** + * Checks whether the connection should be registered to the Schema. + */ + protected function should_register(): bool { + + // Don't register if the connection has been excluded from the schema. + $excluded_connections = $this->type_registry->get_excluded_connections(); + if ( in_array( strtolower( $this->connection_name ), $excluded_connections, true ) ) { + return false; + } + + // Don't register if one of the connection types has been excluded from the schema. + $excluded_types = $this->type_registry->get_excluded_types(); + if ( ( in_array( strtolower( $this->from_type ), $excluded_types, true ) || in_array( strtolower( $this->to_type ), $excluded_types, true ) ) ) { + return false; + } + + return true; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPEnumType.php b/lib/wp-graphql-1.17.0/src/Type/WPEnumType.php new file mode 100644 index 00000000..27d39b0f --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/WPEnumType.php @@ -0,0 +1,100 @@ +prepare_fields( $config['fields'], $config['name'], $config, $type_registry ); + $fields = $type_registry->prepare_fields( $fields, $config['name'] ); + + return $fields; + }; + } + + parent::__construct( $config ); + } + + /** + * Prepare_fields + * + * This function sorts the fields and applies a filter to allow for easily + * extending/modifying the shape of the Schema for the type. + * + * @param array $fields + * @param string $type_name + * @param array $config + * @param \WPGraphQL\Registry\TypeRegistry $type_registry + * @return mixed + * @since 0.0.5 + */ + public function prepare_fields( array $fields, string $type_name, array $config, TypeRegistry $type_registry ) { + + /** + * Filter all object fields, passing the $typename as a param + * + * This is useful when several different types need to be easily filtered at once. . .for example, + * if ALL types with a field of a certain name needed to be adjusted, or something to that tune + * + * @param array $fields The array of fields for the object config + * @param string $type_name The name of the object type + * @param array $config The type config + * + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The TypeRegistry instance + */ + $fields = apply_filters( 'graphql_input_fields', $fields, $type_name, $config, $type_registry ); + + /** + * Filter once with lowercase, once with uppercase for Back Compat. + */ + $lc_type_name = lcfirst( $type_name ); + $uc_type_name = ucfirst( $type_name ); + + /** + * Filter the fields with the typename explicitly in the filter name + * + * This is useful for more targeted filtering, and is applied after the general filter, to allow for + * more specific overrides + * + * @param array $fields The array of fields for the object config + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The TypeRegistry instance + */ + $fields = apply_filters( "graphql_{$lc_type_name}_fields", $fields, $type_registry ); + + /** + * Filter the fields with the typename explicitly in the filter name + * + * This is useful for more targeted filtering, and is applied after the general filter, to allow for + * more specific overrides + * + * @param array $fields The array of fields for the object config + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The TypeRegistry instance + */ + $fields = apply_filters( "graphql_{$uc_type_name}_fields", $fields, $type_registry ); + + /** + * Sort the fields alphabetically by key. This makes reading through docs much easier + * + * @since 0.0.2 + */ + ksort( $fields ); + + /** + * Return the filtered, sorted $fields + * + * @since 0.0.5 + */ + return $fields; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPInterfaceTrait.php b/lib/wp-graphql-1.17.0/src/Type/WPInterfaceTrait.php new file mode 100644 index 00000000..a904b424 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/WPInterfaceTrait.php @@ -0,0 +1,106 @@ +config['interfaces'] ) || ! is_array( $this->config['interfaces'] ) || empty( $this->config['interfaces'] ) ) { + $interfaces = parent::getInterfaces(); + } else { + $interfaces = $this->config['interfaces']; + } + + /** + * Filters the interfaces applied to an object type + * + * @param array $interfaces List of interfaces applied to the Object Type + * @param array $config The config for the Object Type + * @param mixed|\WPGraphQL\Type\WPInterfaceType|\WPGraphQL\Type\WPObjectType $type The Type instance + */ + $interfaces = apply_filters( 'graphql_type_interfaces', $interfaces, $this->config, $this ); + + if ( empty( $interfaces ) || ! is_array( $interfaces ) ) { + return $interfaces; + } + + $new_interfaces = []; + + foreach ( $interfaces as $interface ) { + if ( $interface instanceof InterfaceType && $interface->name !== $this->name ) { + $new_interfaces[ $interface->name ] = $interface; + continue; + } + + // surface when interfaces are trying to be registered with invalid configuration + if ( ! is_string( $interface ) ) { + graphql_debug( + sprintf( + // translators: %s is the name of the GraphQL type. + __( 'Invalid Interface registered to the "%s" Type. Interfaces can only be registered with an interface name or a valid instance of an InterfaceType', 'wp-graphql' ), + $this->name + ), + [ 'invalid_interface' => $interface ] + ); + continue; + } + + // Prevent an interface from implementing itself + if ( strtolower( $this->config['name'] ) === strtolower( $interface ) ) { + graphql_debug( + sprintf( + // translators: %s is the name of the interface. + __( 'The "%s" Interface attempted to implement itself, which is not allowed', 'wp-graphql' ), + $interface + ) + ); + continue; + } + + $interface_type = $this->type_registry->get_type( $interface ); + if ( ! $interface_type instanceof InterfaceType ) { + graphql_debug( + sprintf( + // translators: %1$s is the name of the interface, %2$s is the name of the type. + __( '"%1$s" is not a valid Interface Type and cannot be implemented as an Interface on the "%2$s" Type', 'wp-graphql' ), + $interface, + $this->name + ) + ); + continue; + } + + $new_interfaces[ $interface ] = $interface_type; + $interface_interfaces = $interface_type->getInterfaces(); + + if ( empty( $interface_interfaces ) ) { + continue; + } + + foreach ( $interface_interfaces as $interface_interface_name => $interface_interface ) { + if ( ! $interface_interface instanceof InterfaceType ) { + continue; + } + + $new_interfaces[ $interface_interface_name ] = $interface_interface; + } + } + + return array_unique( $new_interfaces ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPInterfaceType.php b/lib/wp-graphql-1.17.0/src/Type/WPInterfaceType.php new file mode 100644 index 00000000..b97c6b1e --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/WPInterfaceType.php @@ -0,0 +1,174 @@ +type_registry = $type_registry; + + $this->config = $config; + + $name = ucfirst( $config['name'] ); + $config['name'] = apply_filters( 'graphql_type_name', $name, $config, $this ); + $config['fields'] = function () use ( $config ) { + $fields = $config['fields']; + + /** + * Get the fields of interfaces and ensure they exist as fields of this type. + * + * Types are still responsible for ensuring the fields resolve properly. + */ + if ( ! empty( $this->getInterfaces() ) && is_array( $this->getInterfaces() ) ) { + $interface_fields = []; + + foreach ( $this->getInterfaces() as $interface_type ) { + if ( ! $interface_type instanceof InterfaceType ) { + $interface_type = $this->type_registry->get_type( $interface_type ); + } + + if ( ! $interface_type instanceof InterfaceType ) { + continue; + } + + $interface_config_fields = $interface_type->getFields(); + + if ( empty( $interface_config_fields ) || ! is_array( $interface_config_fields ) ) { + continue; + } + + foreach ( $interface_config_fields as $interface_field_name => $interface_field ) { + $interface_fields[ $interface_field_name ] = $interface_field->config; + } + } + } + + if ( ! empty( $interface_fields ) ) { + $fields = array_replace_recursive( $interface_fields, $fields ); + } + + $fields = $this->prepare_fields( $fields, $config['name'] ); + $fields = $this->type_registry->prepare_fields( $fields, $config['name'] ); + + return $fields; + }; + + $config['resolveType'] = function ( $obj ) use ( $config ) { + $type = null; + if ( is_callable( $config['resolveType'] ) ) { + $type = call_user_func( $config['resolveType'], $obj ); + } + + /** + * Filter the resolve type method for all interfaces + * + * @param mixed $type The Type to resolve to, based on the object being resolved. + * @param mixed $obj The Object being resolved. + * @param \WPGraphQL\Type\WPInterfaceType $wp_interface_type The WPInterfaceType instance. + */ + return apply_filters( 'graphql_interface_resolve_type', $type, $obj, $this ); + }; + + /** + * Filter the config of WPInterfaceType + * + * @param array $config Array of configuration options passed to the WPInterfaceType when instantiating a new type + * @param \WPGraphQL\Type\WPInterfaceType $wp_interface_type The instance of the WPInterfaceType class + */ + $config = apply_filters( 'graphql_wp_interface_type_config', $config, $this ); + + parent::__construct( $config ); + } + + /** + * Get interfaces implemented by this Interface + * + * @return array + */ + public function getInterfaces(): array { + return $this->get_implemented_interfaces(); + } + + /** + * This function sorts the fields and applies a filter to allow for easily + * extending/modifying the shape of the Schema for the type. + * + * @param array $fields + * @param string $type_name + * + * @return mixed + * @since 0.0.5 + */ + public function prepare_fields( array $fields, string $type_name ) { + + /** + * Filter all object fields, passing the $typename as a param + * + * This is useful when several different types need to be easily filtered at once. . .for example, + * if ALL types with a field of a certain name needed to be adjusted, or something to that tune + * + * @param array $fields The array of fields for the object config + * @param string $type_name The name of the object type + */ + $fields = apply_filters( 'graphql_interface_fields', $fields, $type_name ); + + /** + * Filter once with lowercase, once with uppercase for Back Compat. + */ + $lc_type_name = lcfirst( $type_name ); + $uc_type_name = ucfirst( $type_name ); + + /** + * Filter the fields with the typename explicitly in the filter name + * + * This is useful for more targeted filtering, and is applied after the general filter, to allow for + * more specific overrides + * + * @param array $fields The array of fields for the object config + */ + $fields = apply_filters( "graphql_{$lc_type_name}_fields", $fields ); + + /** + * Filter the fields with the typename explicitly in the filter name + * + * This is useful for more targeted filtering, and is applied after the general filter, to allow for + * more specific overrides + * + * @param array $fields The array of fields for the object config + */ + $fields = apply_filters( "graphql_{$uc_type_name}_fields", $fields ); + + /** + * This sorts the fields alphabetically by the key, which is super handy for making the schema readable, + * as it ensures it's not output in just random order + */ + ksort( $fields ); + + return $fields; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPMutationType.php b/lib/wp-graphql-1.17.0/src/Type/WPMutationType.php new file mode 100644 index 00000000..4a305132 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/WPMutationType.php @@ -0,0 +1,355 @@ +is_config_valid( $config ) ) { + return; + } + + $this->config = $config; + $this->type_registry = $type_registry; + $this->mutation_name = $config['name']; + + // Bail if the mutation should be excluded from the schema. + if ( ! $this->should_register() ) { + return; + } + + $this->auth = array_key_exists( 'auth', $config ) && is_array( $config['auth'] ) ? $config['auth'] : []; + $this->is_private = array_key_exists( 'isPrivate', $config ) ? $config['isPrivate'] : false; + $this->input_fields = $this->get_input_fields(); + $this->output_fields = $this->get_output_fields(); + $this->resolve_mutation = $this->get_resolver(); + + /** + * Run an action when the WPMutationType is instantiating. + * + * @param array $config Array of configuration options passed to the WPObjectType when instantiating a new type + * @param \WPGraphQL\Type\WPMutationType $wp_mutation_type The instance of the WPMutationType class + * + * @since 1.13.0 + */ + do_action( 'graphql_wp_mutation_type', $config, $this ); + + $this->register_mutation(); + } + + /** + * Validates that essential key/value pairs are passed to the connection config. + * + * @param array $config + * + * @return bool + */ + protected function is_config_valid( array $config ): bool { + $is_valid = true; + + if ( ! array_key_exists( 'name', $config ) || ! is_string( $config['name'] ) ) { + graphql_debug( + __( 'Mutation config needs to have a valid name.', 'wp-graphql' ), + [ + 'config' => $config, + ] + ); + $is_valid = false; + } + + if ( ! array_key_exists( 'mutateAndGetPayload', $config ) || ! is_callable( $config['mutateAndGetPayload'] ) ) { + graphql_debug( + __( 'Mutation config needs to have "mutateAndGetPayload" defined as a callable.', 'wp-graphql' ), + [ + 'config' => $config, + ] + ); + $is_valid = false; + } + + return (bool) $is_valid; + } + + /** + * Gets the mutation input fields. + */ + protected function get_input_fields(): array { + $input_fields = [ + 'clientMutationId' => [ + 'type' => 'String', + 'description' => __( 'This is an ID that can be passed to a mutation by the client to track the progress of mutations and catch possible duplicate mutation submissions.', 'wp-graphql' ), + ], + ]; + + if ( ! empty( $this->config['inputFields'] ) && is_array( $this->config['inputFields'] ) ) { + $input_fields = array_merge( $input_fields, $this->config['inputFields'] ); + } + + return $input_fields; + } + + /** + * Gets the mutation output fields. + */ + protected function get_output_fields(): array { + $output_fields = [ + 'clientMutationId' => [ + 'type' => 'String', + 'description' => __( 'If a \'clientMutationId\' input is provided to the mutation, it will be returned as output on the mutation. This ID can be used by the client to track the progress of mutations and catch possible duplicate mutation submissions.', 'wp-graphql' ), + ], + ]; + + if ( ! empty( $this->config['outputFields'] ) && is_array( $this->config['outputFields'] ) ) { + $output_fields = array_merge( $output_fields, $this->config['outputFields'] ); + } + + return $output_fields; + } + + protected function get_resolver(): callable { + return function ( $root, array $args, AppContext $context, ResolveInfo $info ) { + $unfiltered_input = $args['input']; + + $unfiltered_input = $args['input']; + + /** + * Filters the mutation input before it's passed to the `mutateAndGetPayload` callback. + * + * @param array $input The mutation input args. + * @param \WPGraphQL\AppContext $context The AppContext object. + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object. + * @param string $mutation_name The name of the mutation field. + */ + $input = apply_filters( 'graphql_mutation_input', $unfiltered_input, $context, $info, $this->mutation_name ); + + /** + * Filter to short circuit the mutateAndGetPayload callback. + * Returning anything other than null will stop the callback for the mutation from executing, + * and will return your data or execute your callback instead. + * + * @param array|callable|null $payload. The payload returned from the callback. Null by default. + * @param string $mutation_name The name of the mutation field. + * @param callable|\Closure $mutateAndGetPayload The callback for the mutation. + * @param array $input The mutation input args. + * @param \WPGraphQL\AppContext $context The AppContext object. + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object. + */ + $pre = apply_filters( 'graphql_pre_mutate_and_get_payload', null, $this->mutation_name, $this->config['mutateAndGetPayload'], $input, $context, $info ); + + if ( ! is_null( $pre ) ) { + $payload = is_callable( $pre ) ? $pre( $input, $context, $info ) : $pre; + } else { + $payload = $this->config['mutateAndGetPayload']( $input, $context, $info ); + + /** + * Filters the payload returned from the default mutateAndGetPayload callback. + * + * @param array $payload The payload returned from the callback. + * @param string $mutation_name The name of the mutation field. + * @param array $input The mutation input args. + * @param \WPGraphQL\AppContext $context The AppContext object. + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object. + */ + $payload = apply_filters( 'graphql_mutation_payload', $payload, $this->mutation_name, $input, $context, $info ); + } + + /** + * Fires after the mutation payload has been returned from the `mutateAndGetPayload` callback. + * + * @param array $payload The Payload returned from the mutation. + * @param array $input The mutation input args, after being filtered by 'graphql_mutation_input'. + * @param array $unfiltered_input The unfiltered input args of the mutation + * @param \WPGraphQL\AppContext $context The AppContext object. + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object. + * @param string $mutation_name The name of the mutation field. + */ + do_action( 'graphql_mutation_response', $payload, $input, $unfiltered_input, $context, $info, $this->mutation_name ); + + // Add the client mutation ID to the payload + if ( ! empty( $input['clientMutationId'] ) ) { + $payload['clientMutationId'] = $input['clientMutationId']; + } + + return $payload; + }; + } + + /** + * Registers the input args for the mutation. + */ + protected function register_mutation_input(): void { + $input_name = $this->mutation_name . 'Input'; + + if ( $this->type_registry->has_type( $input_name ) ) { + return; + } + + $this->type_registry->register_input_type( + $input_name, + [ + // translators: %s is the name of the mutation. + 'description' => sprintf( __( 'Input for the %1$s mutation.', 'wp-graphql' ), $this->mutation_name ), + 'fields' => $this->input_fields, + 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, + ] + ); + } + + protected function register_mutation_payload(): void { + $object_name = $this->mutation_name . 'Payload'; + + if ( $this->type_registry->has_type( $object_name ) ) { + return; + } + + $this->type_registry->register_object_type( + $object_name, + [ + // translators: %s is the name of the mutation. + 'description' => sprintf( __( 'The payload for the %s mutation.', 'wp-graphql' ), $this->mutation_name ), + 'fields' => $this->output_fields, + 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, + ] + ); + } + + /** + * Registers the mutation in the Graph. + * + * @throws \Exception + */ + protected function register_mutation_field(): void { + $field_config = array_merge( + $this->config, + [ + 'args' => [ + 'input' => [ + 'type' => [ 'non_null' => $this->mutation_name . 'Input' ], + // translators: %s is the name of the mutation. + 'description' => sprintf( __( 'Input for the %s mutation', 'wp-graphql' ), $this->mutation_name ), + 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, + ], + ], + 'auth' => $this->auth, + // translators: %s is the name of the mutation. + 'description' => ! empty( $this->config['description'] ) ? $this->config['description'] : sprintf( __( 'The %s mutation', 'wp-graphql' ), $this->mutation_name ), + 'isPrivate' => $this->is_private, + 'type' => $this->mutation_name . 'Payload', + 'resolve' => $this->resolve_mutation, + 'name' => lcfirst( $this->mutation_name ), + ] + ); + + $this->type_registry->register_field( + 'RootMutation', + lcfirst( $this->mutation_name ), + $field_config + ); + } + + /** + * Registers the Mutation Types and field to the Schema. + * + * @throws \Exception + */ + protected function register_mutation(): void { + $this->register_mutation_payload(); + $this->register_mutation_input(); + $this->register_mutation_field(); + } + + /** + * Checks whether the mutation should be registered to the schema. + */ + protected function should_register(): bool { + // Dont register mutations if they have been excluded from the schema. + $excluded_mutations = $this->type_registry->get_excluded_mutations(); + if ( in_array( strtolower( $this->mutation_name ), $excluded_mutations, true ) ) { + return false; + } + + return true; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPObjectType.php b/lib/wp-graphql-1.17.0/src/Type/WPObjectType.php new file mode 100644 index 00000000..1c6ac852 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/WPObjectType.php @@ -0,0 +1,226 @@ +type_registry = $type_registry; + + /** + * Filter the config of WPObjectType + * + * @param array $config Array of configuration options passed to the WPObjectType when instantiating a new type + * @param \WPGraphQL\Type\WPObjectType $wp_object_type The instance of the WPObjectType class + */ + $config = apply_filters( 'graphql_wp_object_type_config', $config, $this ); + + $this->config = $config; + + /** + * Set the Types to start with capitals + */ + $name = ucfirst( $config['name'] ); + $config['name'] = apply_filters( 'graphql_type_name', $name, $config, $this ); + + /** + * Setup the fields + * + * @return array|mixed + */ + $config['fields'] = function () use ( $config ) { + $fields = $config['fields']; + + /** + * Get the fields of interfaces and ensure they exist as fields of this type. + * + * Types are still responsible for ensuring the fields resolve properly. + */ + if ( ! empty( $this->getInterfaces() ) && is_array( $this->getInterfaces() ) ) { + $interface_fields = []; + + foreach ( $this->getInterfaces() as $interface_type ) { + if ( ! $interface_type instanceof InterfaceType ) { + $interface_type = $this->type_registry->get_type( $interface_type ); + } + + if ( ! $interface_type instanceof InterfaceType ) { + continue; + } + + $interface_config_fields = $interface_type->getFields(); + + if ( empty( $interface_config_fields ) || ! is_array( $interface_config_fields ) ) { + continue; + } + + foreach ( $interface_config_fields as $interface_field_name => $interface_field ) { + $interface_fields[ $interface_field_name ] = $interface_field->config; + } + } + } + + if ( ! empty( $interface_fields ) ) { + $fields = array_replace_recursive( $interface_fields, $fields ); + } + + $fields = $this->prepare_fields( $fields, $config['name'], $config ); + $fields = $this->type_registry->prepare_fields( $fields, $config['name'] ); + + return $fields; + }; + + /** + * Run an action when the WPObjectType is instantiating + * + * @param array $config Array of configuration options passed to the WPObjectType when instantiating a new type + * @param \WPGraphQL\Type\WPObjectType $wp_object_type The instance of the WPObjectType class + */ + do_action( 'graphql_wp_object_type', $config, $this ); + + parent::__construct( $config ); + } + + /** + * Get the interfaces implemented by the ObjectType + * + * @return array + */ + public function getInterfaces(): array { + return $this->get_implemented_interfaces(); + } + + /** + * Node_interface + * + * This returns the node_interface definition allowing + * WPObjectTypes to easily implement the node_interface + * + * @return array|\WPGraphQL\Type\InterfaceType\Node + * @since 0.0.5 + */ + public static function node_interface() { + if ( null === self::$node_interface ) { + $node_interface = DataSource::get_node_definition(); + self::$node_interface = $node_interface['nodeInterface']; + } + + return self::$node_interface; + } + + /** + * This function sorts the fields and applies a filter to allow for easily + * extending/modifying the shape of the Schema for the type. + * + * @param array $fields + * @param string $type_name + * @param array $config + * + * @return mixed + * @since 0.0.5 + */ + public function prepare_fields( $fields, $type_name, $config ) { + + /** + * Filter all object fields, passing the $typename as a param + * + * This is useful when several different types need to be easily filtered at once. . .for example, + * if ALL types with a field of a certain name needed to be adjusted, or something to that tune + * + * @param array $fields The array of fields for the object config + * @param string $type_name The name of the object type + * @param \WPGraphQL\Type\WPObjectType $wp_object_type The WPObjectType Class + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The Type Registry + */ + $fields = apply_filters( 'graphql_object_fields', $fields, $type_name, $this, $this->type_registry ); + + /** + * Filter once with lowercase, once with uppercase for Back Compat. + */ + $lc_type_name = lcfirst( $type_name ); + $uc_type_name = ucfirst( $type_name ); + + /** + * Filter the fields with the typename explicitly in the filter name + * + * This is useful for more targeted filtering, and is applied after the general filter, to allow for + * more specific overrides + * + * @param array $fields The array of fields for the object config + * @param \WPGraphQL\Type\WPObjectType $wp_object_type The WPObjectType Class + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The Type Registry + */ + $fields = apply_filters( "graphql_{$lc_type_name}_fields", $fields, $this, $this->type_registry ); + + /** + * Filter the fields with the typename explicitly in the filter name + * + * This is useful for more targeted filtering, and is applied after the general filter, to allow for + * more specific overrides + * + * @param array $fields The array of fields for the object config + * @param \WPGraphQL\Type\WPObjectType $wp_object_type The WPObjectType Class + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The Type Registry + */ + $fields = apply_filters( "graphql_{$uc_type_name}_fields", $fields, $this, $this->type_registry ); + + /** + * This sorts the fields alphabetically by the key, which is super handy for making the schema readable, + * as it ensures it's not output in just random order + */ + ksort( $fields ); + + return $fields; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPScalar.php b/lib/wp-graphql-1.17.0/src/Type/WPScalar.php new file mode 100644 index 00000000..bd285513 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Type/WPScalar.php @@ -0,0 +1,27 @@ +type_registry = $type_registry; + + /** + * Set the Types to start with capitals + */ + $name = ucfirst( $config['name'] ); + $config['name'] = apply_filters( 'graphql_type_name', $name, $config, $this ); + + $config['types'] = function () use ( $config ) { + $prepared_types = []; + if ( ! empty( $config['typeNames'] ) && is_array( $config['typeNames'] ) ) { + $prepared_types = []; + foreach ( $config['typeNames'] as $type_name ) { + /** + * Skip if the type is excluded from the schema. + */ + if ( in_array( strtolower( $type_name ), $this->type_registry->get_excluded_types(), true ) ) { + continue; + } + + $prepared_types[] = $this->type_registry->get_type( $type_name ); + } + } + + return $prepared_types; + }; + + $config['resolveType'] = function ( $obj ) use ( $config ) { + $type = null; + if ( is_callable( $config['resolveType'] ) ) { + $type = call_user_func( $config['resolveType'], $obj ); + } + + /** + * Filter the resolve type method for all unions + * + * @param mixed $type The Type to resolve to, based on the object being resolved + * @param mixed $obj The Object being resolved + * @param \WPGraphQL\Type\WPUnionType $wp_union_type The WPUnionType instance + */ + return apply_filters( 'graphql_union_resolve_type', $type, $obj, $this ); + }; + + /** + * Filter the possible_types to allow systems to add to the possible resolveTypes. + * + * @param mixed $types The possible types for the Union + * @param array $config The config for the Union Type + * @param \WPGraphQL\Type\WPUnionType $wp_union_type The WPUnionType instance + * + * @return mixed|array + */ + $config['types'] = apply_filters( 'graphql_union_possible_types', $config['types'], $config, $this ); + + /** + * Filter the config of WPUnionType + * + * @param array $config Array of configuration options passed to the WPUnionType when instantiating a new type + * @param \WPGraphQL\Type\WPUnionType $wp_union_type The instance of the WPUnionType class + * + * @since 0.0.30 + */ + $config = apply_filters( 'graphql_wp_union_type_config', $config, $this ); + + /** + * Run an action when the WPUnionType is instantiating + * + * @param array $config Array of configuration options passed to the WPUnionType when instantiating a new type + * @param \WPGraphQL\Type\WPUnionType $wp_union_type The instance of the WPUnionType class + */ + do_action( 'graphql_wp_union_type', $config, $this ); + + parent::__construct( $config ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Types.php b/lib/wp-graphql-1.17.0/src/Types.php new file mode 100644 index 00000000..db4cd0f5 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Types.php @@ -0,0 +1,40 @@ +logs = []; + + // Whether WPGraphQL Debug is enabled + $enabled = \WPGraphQL::debug(); + + /** + * Filters whether GraphQL Debug is enabled enabled. Serves as the default state for enabling debug logs. + * + * @param bool $enabled Whether logs are enabled or not + * @param \WPGraphQL\Utils\DebugLog $debug_log The DebugLog class instance + */ + $this->logs_enabled = apply_filters( 'graphql_debug_logs_enabled', $enabled, $this ); + } + + /** + * Given a message and a config, a log entry is added to the log + * + * @param mixed|string|array $message The debug log message + * @param array $config Config for the debug log. Set type and any additional information to log + * + * @return array + */ + public function add_log_entry( $message, $config = [] ) { + if ( empty( $message ) ) { + return []; + } + + $type = 'GRAPHQL_DEBUG'; + + if ( ! is_array( $config ) ) { + $config = []; + } + + if ( isset( $config['type'] ) ) { + unset( $config['message'] ); + } + + if ( isset( $config['backtrace'] ) ) { + $config['stack'] = $config['backtrace']; + unset( $config['backtrace'] ); + } + + if ( isset( $config['type'] ) ) { + $type = $config['type']; + unset( $config['type'] ); + } + + if ( ! isset( $this->logs[ wp_json_encode( $message ) ] ) ) { + $log_entry = array_merge( + [ + 'type' => $type, + 'message' => $message, + ], + $config + ); + + $this->logs[ wp_json_encode( $message ) ] = $log_entry; + + /** + * Filter the log entry for the debug log + * + * @param array $log The log entry + * @param array $config The config passed in with the log entry + */ + return apply_filters( 'graphql_debug_log_entry', $log_entry, $config ); + } + + return []; + } + + /** + * Returns the debug log + * + * @return array + */ + public function get_logs() { + + /** + * Init the debug logger + * + * @param \WPGraphQL\Utils\DebugLog $instance The DebugLog instance + */ + do_action( 'graphql_get_debug_log', $this ); + + // If GRAPHQL_DEBUG is not enabled on the server, set a default message + if ( ! $this->logs_enabled ) { + $this->logs = [ + [ + 'type' => 'DEBUG_LOGS_INACTIVE', + 'message' => __( 'GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled.', 'wp-graphql' ), + ], + ]; + } + + /** + * Return the filtered debug log + * + * @param array $logs The logs to be output with the request + * @param \WPGraphQL\Utils\DebugLog $instance The Debug Log class + */ + return apply_filters( 'graphql_debug_log', array_values( $this->logs ), $this ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Utils/InstrumentSchema.php b/lib/wp-graphql-1.17.0/src/Utils/InstrumentSchema.php new file mode 100644 index 00000000..efe03fd2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Utils/InstrumentSchema.php @@ -0,0 +1,273 @@ +getFields(); + + $fields = ! empty( $fields ) ? self::wrap_fields( $fields, $type->name ) : []; + $type->name = ucfirst( esc_html( $type->name ) ); + $type->description = ! empty( $type->description ) ? esc_html( $type->description ) : ''; + $type->config['fields'] = $fields; + + return $type; + } + + /** + * Wrap Fields + * + * This wraps fields to provide sanitization on fields output by introspection queries + * (description/deprecation reason) and provides hooks to resolvers. + * + * @param array $fields The fields configured for a Type + * @param string $type_name The Type name + * + * @return mixed + */ + protected static function wrap_fields( array $fields, string $type_name ) { + if ( empty( $fields ) || ! is_array( $fields ) ) { + return $fields; + } + + foreach ( $fields as $field_key => $field ) { + + /** + * Filter the field definition + * + * @param \GraphQL\Type\Definition\FieldDefinition $field The field definition + * @param string $type_name The name of the Type the field belongs to + */ + $field = apply_filters( 'graphql_field_definition', $field, $type_name ); + + if ( ! $field instanceof FieldDefinition ) { + return $field; + } + + /** + * Get the fields resolve function + * + * @since 0.0.1 + */ + $field_resolver = is_callable( $field->resolveFn ) ? $field->resolveFn : null; + + /** + * Sanitize the description and deprecation reason + */ + $field->description = ! empty( $field->description ) && is_string( $field->description ) ? esc_html( $field->description ) : ''; + $field->deprecationReason = ! empty( $field->deprecationReason ) && is_string( $field->description ) ? esc_html( $field->deprecationReason ) : null; + + /** + * Replace the existing field resolve method with a new function that captures data about + * the resolver to be stored in the resolver_report + * + * @param mixed $source The source passed down the Resolve Tree + * @param array $args The args for the field + * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree + * + * @return mixed + * @throws \Exception + * @since 0.0.1 + */ + $field->resolveFn = static function ( $source, array $args, AppContext $context, ResolveInfo $info ) use ( $field_resolver, $type_name, $field_key, $field ) { + + /** + * Fire an action BEFORE the field resolves + * + * @param mixed $source The source passed down the Resolve Tree + * @param array $args The args for the field + * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree + * @param ?callable $field_resolver The Resolve function for the field + * @param string $type_name The name of the type the fields belong to + * @param string $field_key The name of the field + * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field + */ + do_action( 'graphql_before_resolve_field', $source, $args, $context, $info, $field_resolver, $type_name, $field_key, $field ); + + /** + * Create unique custom "nil" value which is different from the build-in PHP null, false etc. + * When this custom "nil" is returned we can know that the filter did not try to preresolve + * the field because it does not equal with anything but itself. + */ + $nil = new \stdClass(); + + /** + * When this filter return anything other than the $nil it will be used as the resolved value + * and the execution of the actual resolved is skipped. This filter can be used to implement + * field level caches or for efficiently hiding data by returning null. + * + * @param mixed $nil Unique nil value + * @param mixed $source The source passed down the Resolve Tree + * @param array $args The args for the field + * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree + * @param string $type_name The name of the type the fields belong to + * @param string $field_key The name of the field + * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field + * @param mixed $field_resolver The default field resolver + */ + $result = apply_filters( 'graphql_pre_resolve_field', $nil, $source, $args, $context, $info, $type_name, $field_key, $field, $field_resolver ); + + /** + * Check if the field pre-resolved + */ + if ( $nil === $result ) { + /** + * If the current field doesn't have a resolve function, use the defaultFieldResolver, + * otherwise use the $field_resolver + */ + if ( null === $field_resolver || ! is_callable( $field_resolver ) ) { + $result = Executor::defaultFieldResolver( $source, $args, $context, $info ); + } else { + $result = $field_resolver( $source, $args, $context, $info ); + } + } + + /** + * Fire an action before the field resolves + * + * @param mixed $result The result of the field resolution + * @param mixed $source The source passed down the Resolve Tree + * @param array $args The args for the field + * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree + * @param string $type_name The name of the type the fields belong to + * @param string $field_key The name of the field + * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field + * @param mixed $field_resolver The default field resolver + */ + $result = apply_filters( 'graphql_resolve_field', $result, $source, $args, $context, $info, $type_name, $field_key, $field, $field_resolver ); + + /** + * Fire an action AFTER the field resolves + * + * @param mixed $source The source passed down the Resolve Tree + * @param array $args The args for the field + * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree + * @param ?callable $field_resolver The Resolve function for the field + * @param string $type_name The name of the type the fields belong to + * @param string $field_key The name of the field + * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field + * @param mixed $result The result of the field resolver + */ + do_action( 'graphql_after_resolve_field', $source, $args, $context, $info, $field_resolver, $type_name, $field_key, $field, $result ); + + return $result; + }; + } + + /** + * Return the fields + */ + return $fields; + } + + /** + * Check field permissions when resolving. If the check fails, an error will be thrown. + * + * This takes into account auth params defined in the Schema + * + * @param mixed $source The source passed down the Resolve Tree + * @param array $args The args for the field + * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree + * @param mixed|callable|string $field_resolver The Resolve function for the field + * @param string $type_name The name of the type the fields belong to + * @param string $field_key The name of the field + * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field + * + * @return void + * + * @throws \GraphQL\Error\UserError + */ + public static function check_field_permissions( $source, array $args, AppContext $context, ResolveInfo $info, $field_resolver, string $type_name, string $field_key, FieldDefinition $field ) { + if ( ( ! isset( $field->config['auth'] ) || ! is_array( $field->config['auth'] ) ) && ! isset( $field->config['isPrivate'] ) ) { + return; + } + + /** + * Set the default auth error message + */ + $default_auth_error_message = __( 'You do not have permission to view this', 'wp-graphql' ); + $default_auth_error_message = apply_filters( 'graphql_field_resolver_auth_error_message', $default_auth_error_message, $field ); + + /** + * Retrieve permissions error message. + */ + $auth_error = isset( $field->config['auth']['errorMessage'] ) && ! empty( $field->config['auth']['errorMessage'] ) + ? $field->config['auth']['errorMessage'] + : $default_auth_error_message; + + /** + * If the user is authenticated, and the field has a custom auth callback configured + * execute the callback before continuing resolution + */ + if ( isset( $field->config['auth']['callback'] ) && is_callable( $field->config['auth']['callback'] ) ) { + $authorized = call_user_func( $field->config['auth']['callback'], $field, $field_key, $source, $args, $context, $info, $field_resolver ); + + // If callback returns explicit false throw. + if ( false === $authorized ) { + throw new UserError( esc_html( $auth_error ) ); + } + + return; + } + + /** + * If the schema for the field is configured to "isPrivate" or has "auth" configured, + * make sure the user is authenticated before resolving the field + */ + if ( isset( $field->config['isPrivate'] ) && true === $field->config['isPrivate'] && empty( get_current_user_id() ) ) { + throw new UserError( esc_html( $auth_error ) ); + } + + /** + * If the user is authenticated and the field has "allowedCaps" configured, + * ensure the user has at least one of the allowedCaps before resolving + */ + if ( isset( $field->config['auth']['allowedCaps'] ) && is_array( $field->config['auth']['allowedCaps'] ) ) { + $caps = ! empty( wp_get_current_user()->allcaps ) ? wp_get_current_user()->allcaps : []; + if ( empty( array_intersect( array_keys( $caps ), array_values( $field->config['auth']['allowedCaps'] ) ) ) ) { + throw new UserError( esc_html( $auth_error ) ); + } + } + + /** + * If the user is authenticated and the field has "allowedRoles" configured, + * ensure the user has at least one of the allowedRoles before resolving + */ + if ( isset( $field->config['auth']['allowedRoles'] ) && is_array( $field->config['auth']['allowedRoles'] ) ) { + $roles = ! empty( wp_get_current_user()->roles ) ? wp_get_current_user()->roles : []; + $allowed_roles = array_values( $field->config['auth']['allowedRoles'] ); + if ( empty( array_intersect( array_values( $roles ), array_values( $allowed_roles ) ) ) ) { + throw new UserError( esc_html( $auth_error ) ); + } + } + } +} diff --git a/lib/wp-graphql-1.17.0/src/Utils/Preview.php b/lib/wp-graphql-1.17.0/src/Utils/Preview.php new file mode 100644 index 00000000..e6e1d332 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Utils/Preview.php @@ -0,0 +1,58 @@ +post_type ) { + $parent = get_post( $post->post_parent ); + $meta_key = ! empty( $meta_key ) ? $meta_key : ''; + + return isset( $parent->ID ) && absint( $parent->ID ) ? get_post_meta( $parent->ID, $meta_key, (bool) $single ) : $default_value; + } + + return $default_value; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Utils/QueryAnalyzer.php b/lib/wp-graphql-1.17.0/src/Utils/QueryAnalyzer.php new file mode 100644 index 00000000..46c1624b --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Utils/QueryAnalyzer.php @@ -0,0 +1,800 @@ +request = $request; + $this->schema = $request->schema; + $this->runtime_nodes = []; + $this->models = []; + $this->list_types = []; + $this->queried_types = []; + } + + /** + * @return \WPGraphQL\Request + */ + public function get_request(): Request { + return $this->request; + } + + /** + * @return void + */ + public function init(): void { + + /** + * Filters whether to analyze queries or not + * + * @param bool $should_analyze_queries Whether to analyze queries or not. Default true + * @param \WPGraphQL\Utils\QueryAnalyzer $query_analyzer The QueryAnalyzer instance + */ + $should_analyze_queries = apply_filters( 'graphql_should_analyze_queries', true, $this ); + + // If query analyzer is disabled, bail + if ( true !== $should_analyze_queries ) { + return; + } + + $this->graphql_keys = []; + $this->skipped_keys = ''; + + /** + * Many clients have an 8k (8192 characters) header length cap. + * + * This is the total for ALL headers, not just individual headers. + * + * SEE: https://nodejs.org/en/blog/vulnerability/november-2018-security-releases/#denial-of-service-with-large-http-headers-cve-2018-12121 + * + * In order to respect this, we have a default limit of 4000 characters for the X-GraphQL-Keys header + * to allow for other headers to total up to 8k. + * + * This value can be filtered to be increased or decreased. + * + * If you see "Parse Error: Header overflow" errors in your client, you might want to decrease this value. + * + * On the other hand, if you've increased your allowed header length in your client + * (i.e. https://github.com/wp-graphql/wp-graphql/issues/2535#issuecomment-1262499064) then you might want to increase this so that keys are not truncated. + * + * @param int $header_length_limit The max limit in (binary) bytes headers should be. Anything longer will be truncated. + */ + $this->header_length_limit = apply_filters( 'graphql_query_analyzer_header_length_limit', 4000 ); + + // track keys related to the query + add_action( 'do_graphql_request', [ $this, 'determine_graphql_keys' ], 10, 4 ); + + // Track models loaded during execution + add_filter( 'graphql_dataloader_get_model', [ $this, 'track_nodes' ], 10, 1 ); + + // Expose query analyzer data in extensions + add_filter( + 'graphql_request_results', + [ + $this, + 'show_query_analyzer_in_extensions', + ], + 10, + 5 + ); + } + + /** + * Determine the keys associated with the GraphQL document being executed + * + * @param ?string $query The GraphQL query + * @param ?string $operation The name of the operation + * @param ?array $variables Variables to be passed to your GraphQL request + * @param \GraphQL\Server\OperationParams $params The Operation Params. This includes any extra params, + * such as extensions or any other modifications to the request body + * + * @return void + * @throws \Exception + */ + public function determine_graphql_keys( ?string $query, ?string $operation, ?array $variables, OperationParams $params ): void { + + // @todo: support for QueryID? + + // if the query is empty, get it from the request params + if ( empty( $query ) ) { + $query = $this->request->params->query ?: null; + } + + if ( empty( $query ) ) { + return; + } + + $query_id = Utils::get_query_id( $query ); + $this->query_id = $query_id ?: uniqid( 'gql:', true ); + + // if there's a query (either saved or part of the request params) + // get the GraphQL Types being asked for by the query + $this->list_types = $this->set_list_types( $this->schema, $query ); + $this->queried_types = $this->set_query_types( $this->schema, $query ); + $this->models = $this->set_query_models( $this->schema, $query ); + + /** + * @param \WPGraphQL\Utils\QueryAnalyzer $query_analyzer The instance of the query analyzer + * @param string $query The query string being executed + */ + do_action( 'graphql_determine_graphql_keys', $this, $query ); + } + + /** + * @return array + */ + public function get_list_types(): array { + return array_unique( $this->list_types ); + } + + /** + * @return array + */ + public function get_query_types(): array { + return array_unique( $this->queried_types ); + } + + /** + * @return array + */ + public function get_query_models(): array { + return array_unique( $this->models ); + } + + /** + * @return array + */ + public function get_runtime_nodes(): array { + /** + * @param array $runtime_nodes Nodes that were resolved during execution + */ + $runtime_nodes = apply_filters( 'graphql_query_analyzer_get_runtime_nodes', $this->runtime_nodes ); + + return array_unique( $runtime_nodes ); + } + + /** + * @return string + */ + public function get_root_operation(): string { + return $this->root_operation; + } + + /** + * Returns the operation name of the query, if there is one + * + * @return string|null + */ + public function get_operation_name(): ?string { + $operation_name = ! empty( $this->request->params->operation ) ? $this->request->params->operation : null; + + if ( empty( $operation_name ) ) { + + // If the query is not set on the params, return null + if ( ! isset( $this->request->params->query ) ) { + return null; + } + + try { + $ast = Parser::parse( $this->request->params->query ); + $operation_name = ! empty( $ast->definitions[0]->name->value ) ? $ast->definitions[0]->name->value : null; + } catch ( SyntaxError $error ) { + return null; + } + } + + return ! empty( $operation_name ) ? 'operation:' . $operation_name : null; + } + + /** + * @return string|null + */ + public function get_query_id(): ?string { + return $this->query_id; + } + + + /** + * @param \GraphQL\Type\Definition\Type $type The Type of field + * @param \GraphQL\Type\Definition\FieldDefinition $field_def The field definition the type is for + * @param mixed $parent_type The Parent Type + * @param bool $is_list_type Whether the field is a list type field + * + * @return \GraphQL\Type\Definition\Type|String|null + */ + public static function get_wrapped_field_type( Type $type, FieldDefinition $field_def, $parent_type, bool $is_list_type = false ) { + if ( ! isset( $parent_type->name ) || 'RootQuery' !== $parent_type->name ) { + return null; + } + + if ( $type instanceof NonNull || $type instanceof ListOfType ) { + if ( $type instanceof ListOfType && isset( $parent_type->name ) && 'RootQuery' === $parent_type->name ) { + $is_list_type = true; + } + + return self::get_wrapped_field_type( $type->getWrappedType(), $field_def, $parent_type, $is_list_type ); + } + + // Determine if we're dealing with a connection + if ( $type instanceof ObjectType || $type instanceof InterfaceType ) { + $interfaces = method_exists( $type, 'getInterfaces' ) ? $type->getInterfaces() : []; + $interface_names = ! empty( $interfaces ) ? array_map( + static function ( InterfaceType $interface_obj ) { + return $interface_obj->name; + }, + $interfaces + ) : []; + + if ( array_key_exists( 'Connection', $interface_names ) ) { + if ( isset( $field_def->config['fromType'] ) && ( 'rootquery' !== strtolower( $field_def->config['fromType'] ) ) ) { + return null; + } + + $to_type = $field_def->config['toType'] ?? null; + if ( empty( $to_type ) ) { + return null; + } + + return $to_type; + } + + if ( ! $is_list_type ) { + return null; + } + + return $type; + } + + return null; + } + + /** + * Given the Schema and a query string, return a list of GraphQL Types that are being asked for + * by the query. + * + * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema + * @param ?string $query The query string + * + * @return array + * @throws \GraphQL\Error\SyntaxError|\Exception + */ + public function set_list_types( ?Schema $schema, ?string $query ): array { + + /** + * @param array|null $null Default value for the filter + * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema for the current request + * @param ?string $query The query string being requested + */ + $null = null; + $pre_get_list_types = apply_filters( 'graphql_pre_query_analyzer_get_list_types', $null, $schema, $query ); + + if ( null !== $pre_get_list_types ) { + return $pre_get_list_types; + } + + if ( empty( $query ) || null === $schema ) { + return []; + } + + try { + $ast = Parser::parse( $query ); + } catch ( SyntaxError $error ) { + return []; + } + + $type_map = []; + $type_info = new TypeInfo( $schema ); + + $visitor = [ + 'enter' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info, &$type_map, $schema ) { + $parent_type = $type_info->getParentType(); + + if ( 'Field' !== $node->kind ) { + Visitor::skipNode(); + } + + $type_info->enter( $node ); + $field_def = $type_info->getFieldDef(); + + if ( ! $field_def instanceof FieldDefinition ) { + return; + } + + // Determine the wrapped type, which also determines if it's a listOf + $field_type = $field_def->getType(); + $field_type = self::get_wrapped_field_type( $field_type, $field_def, $parent_type ); + + if ( null === $field_type ) { + return; + } + + if ( ! empty( $field_type ) && is_string( $field_type ) ) { + $field_type = $schema->getType( ucfirst( $field_type ) ); + } + + if ( ! $field_type ) { + return; + } + + $field_type = $schema->getType( $field_type ); + + if ( ! $field_type instanceof ObjectType && ! $field_type instanceof InterfaceType ) { + return; + } + + // If the type being queried is an interface (i.e. ContentNode) the publishing a new + // item of any of the possible types (post, page, etc) should invalidate + // this query, so we need to tag this query with `list:$possible_type` for each possible type + if ( $field_type instanceof InterfaceType ) { + $possible_types = $schema->getPossibleTypes( $field_type ); + if ( ! empty( $possible_types ) ) { + foreach ( $possible_types as $possible_type ) { + $type_map[] = 'list:' . strtolower( $possible_type ); + } + } + } else { + $type_map[] = 'list:' . strtolower( $field_type ); + } + }, + 'leave' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info ) { + $type_info->leave( $node ); + }, + ]; + + Visitor::visit( $ast, Visitor::visitWithTypeInfo( $type_info, $visitor ) ); + $map = array_values( array_unique( array_filter( $type_map ) ) ); + + return apply_filters( 'graphql_cache_collection_get_list_types', $map, $schema, $query, $type_info ); + } + + /** + * Given the Schema and a query string, return a list of GraphQL Types that are being asked for + * by the query. + * + * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema + * @param ?string $query The query string + * + * @return array + * @throws \Exception + */ + public function set_query_types( ?Schema $schema, ?string $query ): array { + + /** + * @param array|null $null Default value for the filter + * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema for the current request + * @param ?string $query The query string being requested + */ + $null = null; + $pre_get_query_types = apply_filters( 'graphql_pre_query_analyzer_get_query_types', $null, $schema, $query ); + + if ( null !== $pre_get_query_types ) { + return $pre_get_query_types; + } + + if ( empty( $query ) || null === $schema ) { + return []; + } + try { + $ast = Parser::parse( $query ); + } catch ( SyntaxError $error ) { + return []; + } + $type_map = []; + $type_info = new TypeInfo( $schema ); + $visitor = [ + 'enter' => function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info, &$type_map, $schema ) { + $type_info->enter( $node ); + $type = $type_info->getType(); + if ( ! $type ) { + return; + } + + if ( empty( $this->root_operation ) ) { + if ( $type === $schema->getQueryType() ) { + $this->root_operation = 'Query'; + } + + if ( $type === $schema->getMutationType() ) { + $this->root_operation = 'Mutation'; + } + + if ( $type === $schema->getSubscriptionType() ) { + $this->root_operation = 'Subscription'; + } + } + + $named_type = Type::getNamedType( $type ); + + if ( $named_type instanceof InterfaceType ) { + $possible_types = $schema->getPossibleTypes( $named_type ); + foreach ( $possible_types as $possible_type ) { + $type_map[] = strtolower( $possible_type ); + } + } elseif ( $named_type instanceof ObjectType ) { + $type_map[] = strtolower( $named_type ); + } + }, + 'leave' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info ) { + $type_info->leave( $node ); + }, + ]; + + Visitor::visit( $ast, Visitor::visitWithTypeInfo( $type_info, $visitor ) ); + $map = array_values( array_unique( array_filter( $type_map ) ) ); + + return apply_filters( 'graphql_cache_collection_get_query_types', $map, $schema, $query, $type_info ); + } + + /** + * Given the Schema and a query string, return a list of GraphQL model names that are being + * asked for by the query. + * + * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema + * @param ?string $query The query string + * + * @return array + * @throws \GraphQL\Error\SyntaxError|\Exception + */ + public function set_query_models( ?Schema $schema, ?string $query ): array { + + /** + * @param array|null $null Default value for the filter + * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema for the current request + * @param ?string $query The query string being requested + */ + $null = null; + $pre_get_models = apply_filters( 'graphql_pre_query_analyzer_get_models', $null, $schema, $query ); + + if ( null !== $pre_get_models ) { + return $pre_get_models; + } + + if ( empty( $query ) || null === $schema ) { + return []; + } + try { + $ast = Parser::parse( $query ); + } catch ( SyntaxError $error ) { + return []; + } + $type_map = []; + $type_info = new TypeInfo( $schema ); + $visitor = [ + 'enter' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info, &$type_map, $schema ) { + $type_info->enter( $node ); + $type = $type_info->getType(); + if ( ! $type ) { + return; + } + + $named_type = Type::getNamedType( $type ); + + if ( $named_type instanceof InterfaceType ) { + $possible_types = $schema->getPossibleTypes( $named_type ); + foreach ( $possible_types as $possible_type ) { + if ( ! isset( $possible_type->config['model'] ) ) { + continue; + } + $type_map[] = $possible_type->config['model']; + } + } elseif ( $named_type instanceof ObjectType ) { + if ( ! isset( $named_type->config['model'] ) ) { + return; + } + $type_map[] = $named_type->config['model']; + } + }, + 'leave' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info ) { + $type_info->leave( $node ); + }, + ]; + + Visitor::visit( $ast, Visitor::visitWithTypeInfo( $type_info, $visitor ) ); + $map = array_values( array_unique( array_filter( $type_map ) ) ); + + return apply_filters( 'graphql_cache_collection_get_query_models', $map, $schema, $query, $type_info ); + } + + /** + * Track the nodes that were resolved by ensuring the Node's model + * matches one of the models asked for in the query + * + * @param mixed $model The Model to be returned by the loader + * + * @return mixed + */ + public function track_nodes( $model ) { + if ( isset( $model->id ) && in_array( get_class( $model ), $this->get_query_models(), true ) ) { + // Is this model type part of the requested/returned data in the asked for query? + + /** + * Filter the node ID before returning to the list of resolved nodes + * + * @param int $model_id The ID of the model (node) being returned + * @param object $model The Model object being returned + * @param array $runtime_nodes The runtimes nodes already collected + */ + $node_id = apply_filters( 'graphql_query_analyzer_runtime_node', $model->id, $model, $this->runtime_nodes ); + + $node_type = Utils::get_node_type_from_id( $node_id ); + + if ( empty( $this->runtime_nodes_by_type[ $node_type ] ) || ! in_array( $node_id, $this->runtime_nodes_by_type[ $node_type ], true ) ) { + $this->runtime_nodes_by_type[ $node_type ][] = $node_id; + } + + $this->runtime_nodes[] = $node_id; + } + + return $model; + } + + /** + * Returns graphql keys for use in debugging and headers. + * + * @return array + */ + public function get_graphql_keys() { + if ( ! empty( $this->graphql_keys ) ) { + return $this->graphql_keys; + } + + $keys = []; + $return_keys = ''; + + if ( $this->get_query_id() ) { + $keys[] = $this->get_query_id(); + } + + if ( ! empty( $this->get_root_operation() ) ) { + $keys[] = 'graphql:' . $this->get_root_operation(); + } + + if ( ! empty( $this->get_operation_name() ) ) { + $keys[] = $this->get_operation_name(); + } + + if ( ! empty( $this->get_list_types() ) ) { + $keys = array_merge( $keys, $this->get_list_types() ); + } + + if ( ! empty( $this->get_runtime_nodes() ) ) { + $keys = array_merge( $keys, $this->get_runtime_nodes() ); + } + + if ( ! empty( $keys ) ) { + $all_keys = implode( ' ', array_unique( array_values( $keys ) ) ); + + // Use the header_length_limit to wrap the words with a separator + $wrapped = wordwrap( $all_keys, $this->header_length_limit, '\n' ); + + // explode the string at the separator. This creates an array of chunks that + // can be used to expose the keys in multiple headers, each under the header_length_limit + $chunks = explode( '\n', $wrapped ); + + // Iterate over the chunks + foreach ( $chunks as $index => $chunk ) { + if ( 0 === $index ) { + $return_keys = $chunk; + } else { + $this->skipped_keys = trim( $this->skipped_keys . ' ' . $chunk ); + } + } + } + + $skipped_keys_array = ! empty( $this->skipped_keys ) ? explode( ' ', $this->skipped_keys ) : []; + $return_keys_array = ! empty( $return_keys ) ? explode( ' ', $return_keys ) : []; + $skipped_types = []; + + $runtime_node_types = array_keys( $this->runtime_nodes_by_type ); + + if ( ! empty( $skipped_keys_array ) ) { + foreach ( $skipped_keys_array as $skipped_key ) { + foreach ( $runtime_node_types as $node_type ) { + if ( in_array( 'skipped:' . $node_type, $skipped_types, true ) ) { + continue; + } + if ( in_array( $skipped_key, $this->runtime_nodes_by_type[ $node_type ], true ) ) { + $skipped_types[] = 'skipped:' . $node_type; + break; + } + } + } + } + + // If there are any skipped types, append them to the GraphQL Keys + if ( ! empty( $skipped_types ) ) { + $skipped_types_string = implode( ' ', $skipped_types ); + $return_keys .= ' ' . $skipped_types_string; + } + + /** + * @param array $graphql_keys Information about the keys and skipped keys returned by the Query Analyzer + * @param string $return_keys The keys returned to the X-GraphQL-Keys header + * @param string $skipped_keys The Keys that were skipped (truncated due to size limit) from the X-GraphQL-Keys header + * @param array $return_keys_array The keys returned to the X-GraphQL-Keys header, in array instead of string + * @param array $skipped_keys_array The keys skipped, in array instead of string + */ + $this->graphql_keys = apply_filters( + 'graphql_query_analyzer_graphql_keys', + [ + 'keys' => $return_keys, + 'keysLength' => strlen( $return_keys ), + 'keysCount' => ! empty( $return_keys_array ) ? count( $return_keys_array ) : 0, + 'skippedKeys' => $this->skipped_keys, + 'skippedKeysSize' => strlen( $this->skipped_keys ), + 'skippedKeysCount' => ! empty( $skipped_keys_array ) ? count( $skipped_keys_array ) : 0, + 'skippedTypes' => $skipped_types, + ], + $return_keys, + $this->skipped_keys, + $return_keys_array, + $skipped_keys_array + ); + + return $this->graphql_keys; + } + + + /** + * Return headers + * + * @param array $headers The array of headers being returned + * + * @return array + */ + public function get_headers( array $headers = [] ): array { + $keys = $this->get_graphql_keys(); + + if ( ! empty( $keys ) ) { + $headers['X-GraphQL-Query-ID'] = $this->query_id ?: null; + $headers['X-GraphQL-Keys'] = $keys['keys'] ?: null; + } + + return $headers; + } + + /** + * Outputs Query Analyzer data in the extensions response + * + * @param mixed $response + * @param \WPGraphQL\WPSchema $schema The WPGraphQL Schema + * @param string|null $operation_name The operation name being executed + * @param string|null $request The GraphQL Request being made + * @param array|null $variables The variables sent with the request + * + * @return array|object|null + */ + public function show_query_analyzer_in_extensions( $response, WPSchema $schema, ?string $operation_name, ?string $request, ?array $variables ) { + $should = \WPGraphQL::debug(); + + /** + * @param bool $should Whether the query analyzer output should be displayed in the Extensions output. Default to the value of WPGraphQL Debug. + * @param mixed $response The response of the WPGraphQL Request being executed + * @param \WPGraphQL\WPSchema $schema The WPGraphQL Schema + * @param string|null $operation_name The operation name being executed + * @param string|null $request The GraphQL Request being made + * @param array|null $variables The variables sent with the request + */ + $should_show_query_analyzer_in_extensions = apply_filters( 'graphql_should_show_query_analyzer_in_extensions', $should, $response, $schema, $operation_name, $request, $variables ); + + // If the query analyzer output is disabled, + // don't show the output in the response + if ( false === $should_show_query_analyzer_in_extensions ) { + return $response; + } + + $keys = $this->get_graphql_keys(); + + if ( ! empty( $response ) ) { + if ( is_array( $response ) ) { + $response['extensions']['queryAnalyzer'] = $keys ?: null; + } elseif ( is_object( $response ) ) { + // @phpstan-ignore-next-line + $response->extensions['queryAnalyzer'] = $keys ?: null; + } + } + + return $response; + } +} diff --git a/lib/wp-graphql-1.17.0/src/Utils/QueryLog.php b/lib/wp-graphql-1.17.0/src/Utils/QueryLog.php new file mode 100644 index 00000000..df5628e0 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Utils/QueryLog.php @@ -0,0 +1,171 @@ +query_logs_enabled = 'on' === $enabled; + + $this->query_log_user_role = get_graphql_setting( 'query_log_user_role', 'manage_options' ); + + if ( ! $this->query_logs_enabled ) { + return; + } + + add_action( 'init', [ $this, 'init_save_queries' ] ); + add_filter( 'graphql_request_results', [ $this, 'show_results' ], 10, 5 ); + } + + /** + * Tell WordPress to start saving queries. + * + * NOTE: This will affect all requests, not just GraphQL requests. + * + * @return void + */ + public function init_save_queries() { + if ( is_graphql_http_request() && ! defined( 'SAVEQUERIES' ) ) { + define( 'SAVEQUERIES', true ); + } + } + + /** + * Determine if the requesting user can see logs + * + * @return boolean + */ + public function user_can_see_logs() { + $can_see = false; + + // If logs are disabled, user cannot see logs + if ( ! $this->query_logs_enabled ) { + $can_see = false; + } elseif ( 'any' === $this->query_log_user_role ) { + // If "any" is the selected role, anyone can see the logs + $can_see = true; + } else { + // Get the current users roles + $user = wp_get_current_user(); + + // If the user doesn't have roles or the selected role isn't one the user has, the + // user cannot see roles; + if ( in_array( $this->query_log_user_role, $user->roles, true ) ) { + $can_see = true; + } + } + + /** + * Filter whether the logs can be seen in the request results or not + * + * @param boolean $can_see Whether the requester can see the logs or not + */ + return apply_filters( 'graphql_user_can_see_query_logs', $can_see ); + } + + /** + * Filter the results of the GraphQL Response to include the Query Log + * + * @param mixed $response + * @param \WPGraphQL\WPSchema $schema The WPGraphQL Schema + * @param string $operation_name The operation name being executed + * @param string $request The GraphQL Request being made + * @param array $variables The variables sent with the request + * + * @return array + */ + public function show_results( $response, $schema, $operation_name, $request, $variables ) { + $query_log = $this->get_query_log(); + + // If the user cannot see the logs, return the response as-is without the logs + if ( ! $this->user_can_see_logs() ) { + return $response; + } + + if ( ! empty( $response ) ) { + if ( is_array( $response ) ) { + $response['extensions']['queryLog'] = $query_log; + } elseif ( is_object( $response ) ) { + // @phpstan-ignore-next-line + $response->extensions['queryLog'] = $query_log; + } + } + + return $response; + } + + /** + * Return the query log produced from the logs stored by WPDB. + * + * @return array + */ + public function get_query_log() { + global $wpdb; + + $save_queries_value = defined( 'SAVEQUERIES' ) && true === SAVEQUERIES ? 'true' : 'false'; + $default_message = sprintf( + // translators: %s is the value of the SAVEQUERIES constant + __( 'Query Logging has been disabled. The \'SAVEQUERIES\' Constant is set to \'%s\' on your server.', 'wp-graphql' ), + $save_queries_value + ); + + // Default message + $trace = [ $default_message ]; + + if ( ! empty( $wpdb->queries ) && is_array( $wpdb->queries ) ) { + $queries = array_map( + static function ( $query ) { + return [ + 'sql' => $query[0], + 'time' => $query[1], + 'stack' => $query[2], + ]; + }, + $wpdb->queries + ); + + $times = wp_list_pluck( $queries, 'time' ); + $total_time = array_sum( $times ); + $trace = [ + 'queryCount' => count( $queries ), + 'totalTime' => $total_time, + 'queries' => $queries, + ]; + } + + /** + * Filter the trace + * + * @param array $trace The trace to return + * @param \WPGraphQL\Utils\QueryLog $instance The QueryLog class instance + */ + return apply_filters( 'graphql_tracing_response', $trace, $this ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Utils/Tracing.php b/lib/wp-graphql-1.17.0/src/Utils/Tracing.php new file mode 100644 index 00000000..eba7f97a --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Utils/Tracing.php @@ -0,0 +1,360 @@ +tracing_enabled = 'on' === $enabled; + + $this->tracing_user_role = get_graphql_setting( 'tracing_user_role', 'manage_options' ); + + if ( ! $this->tracing_enabled ) { + return; + } + + add_filter( 'do_graphql_request', [ $this, 'init_trace' ] ); + add_action( 'graphql_execute', [ $this, 'end_trace' ], 99, 0 ); + add_filter( 'graphql_access_control_allow_headers', [ $this, 'return_tracing_headers' ] ); + add_filter( + 'graphql_request_results', + [ + $this, + 'add_tracing_to_response_extensions', + ], + 10, + 1 + ); + add_action( 'graphql_before_resolve_field', [ $this, 'init_field_resolver_trace' ], 10, 4 ); + add_action( 'graphql_after_resolve_field', [ $this, 'end_field_resolver_trace' ], 10 ); + } + + /** + * Sets the timestamp and microtime for the start of the request + * + * @return float + */ + public function init_trace() { + $this->request_start_microtime = microtime( true ); + $this->request_start_timestamp = $this->format_timestamp( $this->request_start_microtime ); + + return $this->request_start_timestamp; + } + + /** + * Sets the timestamp and microtime for the end of the request + * + * @return void + */ + public function end_trace() { + $this->request_end_microtime = microtime( true ); + $this->request_end_timestamp = $this->format_timestamp( $this->request_end_microtime ); + } + + /** + * Initialize tracing for an individual field + * + * @param mixed $source The source passed down the Resolve Tree + * @param array $args The args for the field + * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree + * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree + * + * @return void + */ + public function init_field_resolver_trace( $source, array $args, AppContext $context, ResolveInfo $info ) { + $this->field_trace = [ + 'path' => $info->path, + 'parentType' => $info->parentType->name, + 'fieldName' => $info->fieldName, + 'returnType' => $info->returnType->name ? $info->returnType->name : $info->returnType, + 'startOffset' => $this->get_start_offset(), + 'startMicrotime' => microtime( true ), + ]; + } + + /** + * End the tracing for a resolver + * + * @return void + */ + public function end_field_resolver_trace() { + if ( ! empty( $this->field_trace ) ) { + $this->field_trace['duration'] = $this->get_field_resolver_duration(); + $sanitized_trace = $this->sanitize_resolver_trace( $this->field_trace ); + $this->trace_logs[] = $sanitized_trace; + } + + // reset the field trace + $this->field_trace = []; + } + + /** + * Given a resolver start time, returns the duration of a resolver + * + * @return float|int + */ + public function get_field_resolver_duration() { + return ( microtime( true ) - $this->field_trace['startMicrotime'] ) * 1000000; + } + + /** + * Get the offset between the start of the request and now + * + * @return float|int + */ + public function get_start_offset() { + return ( microtime( true ) - $this->request_start_microtime ) * 1000000; + } + + /** + * Given a trace, sanitizes the values and returns the sanitized_trace + * + * @param array $trace + * + * @return mixed + */ + public function sanitize_resolver_trace( array $trace ) { + $sanitized_trace = []; + $sanitized_trace['path'] = ! empty( $trace['path'] ) && is_array( $trace['path'] ) ? array_map( + [ + $this, + 'sanitize_trace_resolver_path', + ], + $trace['path'] + ) : []; + $sanitized_trace['parentType'] = ! empty( $trace['parentType'] ) ? esc_html( $trace['parentType'] ) : ''; + $sanitized_trace['fieldName'] = ! empty( $trace['fieldName'] ) ? esc_html( $trace['fieldName'] ) : ''; + $sanitized_trace['returnType'] = ! empty( $trace['returnType'] ) ? esc_html( $trace['returnType'] ) : ''; + $sanitized_trace['startOffset'] = ! empty( $trace['startOffset'] ) ? absint( $trace['startOffset'] ) : ''; + $sanitized_trace['duration'] = ! empty( $trace['duration'] ) ? absint( $trace['duration'] ) : ''; + + return $sanitized_trace; + } + + /** + * Given input from a Resolver Path, this sanitizes the input for output in the trace + * + * @param mixed $input The input to sanitize + * + * @return int|null|string + */ + public static function sanitize_trace_resolver_path( $input ) { + $sanitized_input = null; + if ( is_numeric( $input ) ) { + $sanitized_input = absint( $input ); + } else { + $sanitized_input = esc_html( $input ); + } + + return $sanitized_input; + } + + /** + * Formats a timestamp to be RFC 3339 compliant + * + * @see https://github.com/apollographql/apollo-tracing + * + * @param mixed|string|float|int $time The timestamp to format + * + * @return float + */ + public function format_timestamp( $time ) { + $time_as_float = sprintf( '%.4f', $time ); + $timestamp = \DateTime::createFromFormat( 'U.u', $time_as_float ); + + return ! empty( $timestamp ) ? (float) $timestamp->format( 'Y-m-d\TH:i:s.uP' ) : (float) 0; + } + + /** + * Filter the headers that WPGraphQL returns to include headers that indicate the WPGraphQL + * server supports Apollo Tracing and Credentials + * + * @param array $headers The headers to return + * + * @return array + */ + public function return_tracing_headers( array $headers ) { + $headers[] = 'X-Insights-Include-Tracing'; + $headers[] = 'X-Apollo-Tracing'; + $headers[] = 'Credentials'; + + return (array) $headers; + } + + /** + * Filter the results of the GraphQL Response to include the Query Log + * + * @param mixed|array|object $response The response of the GraphQL Request + * + * @return mixed $response + */ + public function add_tracing_to_response_extensions( $response ) { + + // Get the trace + $trace = $this->get_trace(); + + // If a specific capability is set for tracing and the requesting user + // doesn't have the capability, return the unmodified response + if ( ! $this->user_can_see_trace_data() ) { + return $response; + } + + if ( is_array( $response ) ) { + $response['extensions']['tracing'] = $trace; + } elseif ( is_object( $response ) ) { + // @phpstan-ignore-next-line + $response->extensions['tracing'] = $trace; + } + + return $response; + } + + /** + * Returns the request duration calculated from the start and end times + * + * @return float|int + */ + public function get_request_duration() { + return ( $this->request_end_microtime - $this->request_start_microtime ) * 1000000; + } + + /** + * Determine if the requesting user can see trace data + * + * @return boolean + */ + public function user_can_see_trace_data(): bool { + $can_see = false; + + // If logs are disabled, user cannot see logs + if ( ! $this->tracing_enabled ) { + $can_see = false; + } elseif ( 'any' === $this->tracing_user_role ) { + // If "any" is the selected role, anyone can see the logs + $can_see = true; + } else { + // Get the current users roles + $user = wp_get_current_user(); + + // If the user doesn't have roles or the selected role isn't one the user has, the user cannot see roles. + if ( in_array( $this->tracing_user_role, $user->roles, true ) ) { + $can_see = true; + } + } + + /** + * Filter whether the logs can be seen in the request results or not + * + * @param boolean $can_see Whether the requester can see the logs or not + */ + return apply_filters( 'graphql_user_can_see_trace_data', $can_see ); + } + + /** + * Get the trace to add to the response + * + * @return array + */ + public function get_trace(): array { + + // Compile the trace to return with the GraphQL Response + $trace = [ + 'version' => absint( $this->trace_spec_version ), + 'startTime' => (float) $this->request_start_microtime, + 'endTime' => (float) $this->request_end_microtime, + 'duration' => absint( $this->get_request_duration() ), + 'execution' => [ + 'resolvers' => $this->trace_logs, + ], + ]; + + /** + * Filter the trace + * + * @param array $trace The trace to return + * @param \WPGraphQL\Utils\Tracing $instance The Tracing class instance + */ + return apply_filters( 'graphql_tracing_response', (array) $trace, $this ); + } +} diff --git a/lib/wp-graphql-1.17.0/src/Utils/Utils.php b/lib/wp-graphql-1.17.0/src/Utils/Utils.php new file mode 100644 index 00000000..0d195075 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/Utils/Utils.php @@ -0,0 +1,367 @@ + $value ) { + if ( [] !== $skip && in_array( $arg, $skip, true ) ) { + continue; + } + + if ( is_array( $value ) && ! empty( $value ) ) { + $value = array_map( + static function ( $value ) { + if ( is_string( $value ) ) { + $value = sanitize_text_field( $value ); + } + + return $value; + }, + $value + ); + } elseif ( is_string( $value ) ) { + $value = sanitize_text_field( $value ); + } + + if ( array_key_exists( $arg, $map ) ) { + $query_args[ $map[ $arg ] ] = $value; + } else { + $query_args[ $arg ] = $value; + } + } + + return $query_args; + } + + /** + * Checks the post_date_gmt or modified_gmt and prepare any post or + * modified date for single post output. + * + * @param string $date_gmt GMT publication time. + * @param mixed|string|null $date Optional. Local publication time. Default null. + * + * @return string|null ISO8601/RFC3339 formatted datetime. + * @since 4.7.0 + */ + public static function prepare_date_response( string $date_gmt, $date = null ) { + // Use the date if passed. + if ( isset( $date ) ) { + return mysql_to_rfc3339( $date ); + } + // Return null if $date_gmt is empty/zeros. + if ( '0000-00-00 00:00:00' === $date_gmt ) { + return null; + } + + // Return the formatted datetime. + return mysql_to_rfc3339( $date_gmt ); + } + + /** + * Format a GraphQL name according to the GraphQL spec. + * + * Per the GraphQL spec, characters in names are limited to Latin ASCII letter, digits, or underscores. + * + * @see http://spec.graphql.org/draft/#sec-Names + * + * @param string $name The name to format. + * @param string $replacement The replacement character for invalid characters. Defaults to '_'. + * @param string $regex The regex to use to match invalid characters. Defaults to '/[^A-Za-z0-9_]/i'. + * + * @since v1.17.0 + */ + public static function format_graphql_name( string $name, string $replacement = '_', string $regex = '/[^A-Za-z0-9_]/i' ): string { + if ( empty( $name ) ) { + return ''; + } + + /** + * Filter to manually format a GraphQL name according to custom rules. + * + * If anything other than null is returned, the result will be used for the name instead of the standard regex. + * + * Useful for providing custom transliteration rules that will convert non ASCII characters to ASCII. + * + * @param null|string $formatted_name The name to format. If not null, the result will be returned as the formatted name. + * @param string $original_name The name to format. + * @param string $replacement The replacement character for invalid characters. Defaults to '_'. + * @param string $regex The regex to use to match invalid characters. Defaults to '/[^A-Za-z0-9_]/i'. + * + * @return string|null + */ + $pre_format_name = apply_filters( 'graphql_pre_format_name', null, $name, $replacement, $regex ); + + // Check whether the filter is being used (correctly). + if ( ! empty( $pre_format_name ) && is_string( $pre_format_name ) ) { + // Don't trust the filter to return a formatted string. + $name = trim( sanitize_text_field( $pre_format_name ) ); + } else { + // Throw a warning if someone is using the filter incorrectly. + if ( null !== $pre_format_name ) { + graphql_debug( + esc_html__( 'The `graphql_pre_format_name` filter must return a string or null.', 'wp-graphql' ), + [ + 'type' => 'INVALID_GRAPHQL_NAME', + 'original_name' => esc_html( $name ), + ] + ); + } + + // Remove all non-alphanumeric characters. + $name = preg_replace( $regex, $replacement, $name ); + } + + if ( empty( $name ) ) { + return ''; + } + + // Replace multiple consecutive leading underscores with a single underscore, since those are reserved. + $name = preg_replace( '/^_+/', '_', trim( $name ) ); + + return ! empty( $name ) ? $name : ''; + } + + /** + * Given a field name, formats it for GraphQL + * + * @param string $field_name The field name to format + * @param bool $allow_underscores Whether the field should be formatted with underscores allowed. Default false. + * + * @return string + */ + public static function format_field_name( string $field_name, bool $allow_underscores = false ): string { + // Bail if empty. + if ( empty( $field_name ) ) { + return ''; + } + + $formatted_field_name = graphql_format_name( $field_name, '_', '/[^a-zA-Z0-9 -]/' ); + + // If the formatted name is empty, we want to return the original value so it displays in the error. + if ( empty( $formatted_field_name ) ) { + return $field_name; + } + + // underscores are allowed by GraphQL, but WPGraphQL has historically + // stripped them when formatting field names. + // The $allow_underscores argument allows functions to opt-in to allowing underscores + if ( true !== $allow_underscores ) { + // uppercase words separated by an underscore, then replace the underscores with a space + $formatted_field_name = lcfirst( str_replace( '_', ' ', ucwords( $formatted_field_name, '_' ) ) ); + } + + // uppercase words separated by a dash, then replace the dashes with a space + $formatted_field_name = lcfirst( str_replace( '-', ' ', ucwords( $formatted_field_name, '-' ) ) ); + + // uppercace words separated by a space, and replace spaces with no space + $formatted_field_name = lcfirst( str_replace( ' ', '', ucwords( $formatted_field_name, ' ' ) ) ); + + // Field names should be lcfirst. + return lcfirst( $formatted_field_name ); + } + + /** + * Given a type name, formats it for GraphQL + * + * @param string $type_name The type name to format + * + * @return string + */ + public static function format_type_name( $type_name ) { + return ucfirst( self::format_field_name( $type_name ) ); + } + + /** + * Returns a GraphQL type name for a given WordPress template name. + * + * If the template name has no ASCII characters, the file name will be used instead. + * + * @param string $name The template name. + * @param string $file The file name. + * @return string The formatted type name. If the name is empty, an empty string will be returned. + */ + public static function format_type_name_for_wp_template( string $name, string $file ): string { + $name = ucwords( $name ); + // Strip out not ASCII characters. + $name = graphql_format_name( $name, '', '/[^\w]/' ); + + // If replaced_name is empty, use the file name. + if ( empty( $name ) ) { + $file_parts = explode( '.', $file ); + $file_name = ! empty( $file_parts[0] ) ? self::format_type_name( $file_parts[0] ) : ''; + $replaced_name = ! empty( $file_name ) ? graphql_format_name( $file_name, '', '/[^\w]/' ) : ''; + + $name = ! empty( $replaced_name ) ? $replaced_name : $name; + } + + // If the name is still empty, we don't have a valid type. + if ( empty( $name ) ) { + return ''; + } + + // Maybe prefix the name with "Template_". + if ( preg_match( '/^\d/', $name ) || false === strpos( strtolower( $name ), 'template' ) ) { + $name = 'Template_' . $name; + } + + return $name; + } + + /** + * Helper function that defines the allowed HTML to use on the Settings pages + * + * @return array + */ + public static function get_allowed_wp_kses_html() { + $allowed_atts = [ + 'align' => [], + 'class' => [], + 'type' => [], + 'id' => [], + 'dir' => [], + 'lang' => [], + 'style' => [], + 'xml:lang' => [], + 'src' => [], + 'alt' => [], + 'href' => [], + 'rel' => [], + 'rev' => [], + 'target' => [], + 'novalidate' => [], + 'value' => [], + 'name' => [], + 'tabindex' => [], + 'action' => [], + 'method' => [], + 'for' => [], + 'width' => [], + 'height' => [], + 'data' => [], + 'title' => [], + 'checked' => [], + 'disabled' => [], + 'selected' => [], + ]; + + return [ + 'form' => $allowed_atts, + 'label' => $allowed_atts, + 'input' => $allowed_atts, + 'textarea' => $allowed_atts, + 'iframe' => $allowed_atts, + 'script' => $allowed_atts, + 'select' => $allowed_atts, + 'option' => $allowed_atts, + 'style' => $allowed_atts, + 'strong' => $allowed_atts, + 'small' => $allowed_atts, + 'table' => $allowed_atts, + 'span' => $allowed_atts, + 'abbr' => $allowed_atts, + 'code' => $allowed_atts, + 'pre' => $allowed_atts, + 'div' => $allowed_atts, + 'img' => $allowed_atts, + 'h1' => $allowed_atts, + 'h2' => $allowed_atts, + 'h3' => $allowed_atts, + 'h4' => $allowed_atts, + 'h5' => $allowed_atts, + 'h6' => $allowed_atts, + 'ol' => $allowed_atts, + 'ul' => $allowed_atts, + 'li' => $allowed_atts, + 'em' => $allowed_atts, + 'hr' => $allowed_atts, + 'br' => $allowed_atts, + 'tr' => $allowed_atts, + 'td' => $allowed_atts, + 'p' => $allowed_atts, + 'a' => $allowed_atts, + 'b' => $allowed_atts, + 'i' => $allowed_atts, + ]; + } + + /** + * Helper function to get the WordPress database ID from a GraphQL ID type input. + * + * Returns false if not a valid ID. + * + * @param int|string $id The ID from the input args. Can be either the database ID (as either a string or int) or the global Relay ID. + * + * @return int|false + */ + public static function get_database_id_from_id( $id ) { + // If we already have the database ID, send it back as an integer. + if ( is_numeric( $id ) ) { + return absint( $id ); + } + + $id_parts = Relay::fromGlobalId( $id ); + + return ! empty( $id_parts['id'] ) && is_numeric( $id_parts['id'] ) ? absint( $id_parts['id'] ) : false; + } + + /** + * Get the node type from the ID + * + * @param int|string $id The encoded Node ID. + * + * @return bool|null + */ + public static function get_node_type_from_id( $id ) { + if ( is_numeric( $id ) ) { + return null; + } + + $id_parts = Relay::fromGlobalId( $id ); + return $id_parts['type'] ?: null; + } +} diff --git a/lib/wp-graphql-1.17.0/src/WPGraphQL.php b/lib/wp-graphql-1.17.0/src/WPGraphQL.php new file mode 100644 index 00000000..e72794db --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/WPGraphQL.php @@ -0,0 +1,823 @@ +setup_constants(); + self::$instance->includes(); + self::$instance->actions(); + self::$instance->filters(); + } + + /** + * Return the WPGraphQL Instance + */ + return self::$instance; + } + + /** + * Throw error on object clone. + * The whole idea of the singleton design pattern is that there is a single object + * therefore, we don't want the object to be cloned. + * + * @return void + * @since 0.0.1 + */ + public function __clone() { + // Cloning instances of the class is forbidden. + _doing_it_wrong( __FUNCTION__, esc_html__( 'The WPGraphQL class should not be cloned.', 'wp-graphql' ), '0.0.1' ); + } + + /** + * Disable unserializing of the class. + * + * @return void + * @since 0.0.1 + */ + public function __wakeup() { + // De-serializing instances of the class is forbidden. + _doing_it_wrong( __FUNCTION__, esc_html__( 'De-serializing instances of the WPGraphQL class is not allowed', 'wp-graphql' ), '0.0.1' ); + } + + /** + * Setup plugin constants. + * + * @return void + * @since 0.0.1 + */ + private function setup_constants() { + graphql_setup_constants(); + } + + /** + * Include required files. + * Uses composer's autoload + * + * @return void + * @since 0.0.1 + */ + private function includes(): void { + } + + /** + * Set whether the request is a GraphQL request or not + * + * @param bool $is_graphql_request + * + * @return void + */ + public static function set_is_graphql_request( $is_graphql_request = false ) { + self::$is_graphql_request = $is_graphql_request; + } + + /** + * @return bool + */ + public static function is_graphql_request() { + return self::$is_graphql_request; + } + + /** + * Sets up actions to run at certain spots throughout WordPress and the WPGraphQL execution + * cycle + * + * @return void + */ + private function actions(): void { + /** + * Init WPGraphQL after themes have been setup, + * allowing for both plugins and themes to register + * things before graphql_init + */ + add_action( + 'after_setup_theme', + static function () { + new \WPGraphQL\Data\Config(); + $router = new Router(); + $router->init(); + $instance = self::instance(); + + /** + * Fire off init action + * + * @param \WPGraphQL $instance The instance of the WPGraphQL class + */ + do_action( 'graphql_init', $instance ); + } + ); + + // Initialize the plugin url constant + // see: https://developer.wordpress.org/reference/functions/plugins_url/#more-information + add_action( 'init', [ $this, 'setup_plugin_url' ] ); + + // Prevent WPGraphQL Insights from running + remove_action( 'init', '\WPGraphQL\Extensions\graphql_insights_init' ); + + /** + * Flush permalinks if the registered GraphQL endpoint has not yet been registered. + */ + add_action( 'wp_loaded', [ $this, 'maybe_flush_permalinks' ] ); + + /** + * Hook in before fields resolve to check field permissions + */ + add_action( + 'graphql_before_resolve_field', + [ + '\WPGraphQL\Utils\InstrumentSchema', + 'check_field_permissions', + ], + 10, + 8 + ); + + // Determine what to show in graphql + add_action( 'init_graphql_request', 'register_initial_settings', 10 ); + + // Throw an exception + add_action( 'do_graphql_request', [ $this, 'min_php_version_check' ] ); + + // Initialize Admin functionality + add_action( 'after_setup_theme', [ $this, 'init_admin' ] ); + + add_action( + 'init_graphql_request', + static function () { + $tracing = new \WPGraphQL\Utils\Tracing(); + $tracing->init(); + + $query_log = new \WPGraphQL\Utils\QueryLog(); + $query_log->init(); + } + ); + } + + /** + * Check if the minimum PHP version requirement is met before execution begins. + * + * If the server is running a lower version than required, throw an exception and prevent + * further execution. + * + * @return void + * @throws \Exception + */ + public function min_php_version_check() { + if ( defined( 'GRAPHQL_MIN_PHP_VERSION' ) && version_compare( PHP_VERSION, GRAPHQL_MIN_PHP_VERSION, '<' ) ) { + throw new \Exception( + esc_html( + sprintf( + // translators: %1$s is the current PHP version, %2$s is the minimum required PHP version. + __( 'The server\'s current PHP version %1$s is lower than the WPGraphQL minimum required version: %2$s', 'wp-graphql' ), + PHP_VERSION, + GRAPHQL_MIN_PHP_VERSION + ) + ) + ); + } + } + + /** + * Sets up the plugin url + * + * @return void + */ + public function setup_plugin_url() { + // Plugin Folder URL. + if ( ! defined( 'WPGRAPHQL_PLUGIN_URL' ) ) { + define( 'WPGRAPHQL_PLUGIN_URL', plugin_dir_url( dirname( __DIR__ ) . '/wp-graphql.php' ) ); + } + } + + /** + * Determine the post_types and taxonomies, etc that should show in GraphQL + * + * @return void + */ + public function setup_types() { + /** + * Setup the settings, post_types and taxonomies to show_in_graphql + */ + self::show_in_graphql(); + } + + /** + * Flush permalinks if the GraphQL Endpoint route isn't yet registered + * + * @return void + */ + public function maybe_flush_permalinks() { + $rules = get_option( 'rewrite_rules' ); + if ( ! isset( $rules[ graphql_get_endpoint() . '/?$' ] ) ) { + flush_rewrite_rules(); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.flush_rewrite_rules_flush_rewrite_rules + } + } + + /** + * Setup filters + * + * @return void + */ + private function filters(): void { + // Filter the post_types and taxonomies to show in the GraphQL Schema + $this->setup_types(); + + /** + * Instrument the Schema to provide Resolve Hooks and sanitize Schema output + */ + add_filter( + 'graphql_get_type', + [ + InstrumentSchema::class, + 'instrument_resolvers', + ], + 10, + 2 + ); + + // Filter how metadata is retrieved during GraphQL requests + add_filter( + 'get_post_metadata', + [ + Preview::class, + 'filter_post_meta_for_previews', + ], + 10, + 4 + ); + + /** + * Adds back compat support for the `graphql_object_type_interfaces` filter which was renamed + * to support both ObjectTypes and InterfaceTypes + * + * @deprecated + */ + add_filter( + 'graphql_type_interfaces', + static function ( $interfaces, $config, $type ) { + if ( $type instanceof WPObjectType ) { + /** + * Filters the interfaces applied to an object type + * + * @param array $interfaces List of interfaces applied to the Object Type + * @param array $config The config for the Object Type + * @param mixed|\WPGraphQL\Type\WPInterfaceType|\WPGraphQL\Type\WPObjectType $type The Type instance + */ + return apply_filters_deprecated( 'graphql_object_type_interfaces', [ $interfaces, $config, $type ], '1.4.1', 'graphql_type_interfaces' ); + } + + return $interfaces; + }, + 10, + 3 + ); + } + + /** + * Initialize admin functionality + * + * @return void + */ + public function init_admin() { + $admin = new Admin(); + $admin->init(); + } + + /** + * This sets up built-in post_types and taxonomies to show in the GraphQL Schema + * + * @return void + * @since 0.0.2 + */ + public static function show_in_graphql() { + add_filter( 'register_post_type_args', [ self::class, 'setup_default_post_types' ], 10, 2 ); + add_filter( 'register_taxonomy_args', [ self::class, 'setup_default_taxonomies' ], 10, 2 ); + + // Run late so the user can filter the args themselves. + add_filter( 'register_post_type_args', [ self::class, 'register_graphql_post_type_args' ], 99, 2 ); + add_filter( 'register_taxonomy_args', [ self::class, 'register_graphql_taxonomy_args' ], 99, 2 ); + } + + /** + * Sets up the default post types to show_in_graphql. + * + * @param array $args Array of arguments for registering a post type. + * @param string $post_type Post type key. + * + * @return array + */ + public static function setup_default_post_types( $args, $post_type ) { + // Adds GraphQL support for attachments. + if ( 'attachment' === $post_type ) { + $args['show_in_graphql'] = true; + $args['graphql_single_name'] = 'mediaItem'; + $args['graphql_plural_name'] = 'mediaItems'; + } elseif ( 'page' === $post_type ) { // Adds GraphQL support for pages. + $args['show_in_graphql'] = true; + $args['graphql_single_name'] = 'page'; + $args['graphql_plural_name'] = 'pages'; + } elseif ( 'post' === $post_type ) { // Adds GraphQL support for posts. + $args['show_in_graphql'] = true; + $args['graphql_single_name'] = 'post'; + $args['graphql_plural_name'] = 'posts'; + } + + return $args; + } + + /** + * Sets up the default taxonomies to show_in_graphql. + * + * @param array $args Array of arguments for registering a taxonomy. + * @param string $taxonomy Taxonomy key. + * + * @return array + * @since 1.12.0 + */ + public static function setup_default_taxonomies( $args, $taxonomy ) { + // Adds GraphQL support for categories. + if ( 'category' === $taxonomy ) { + $args['show_in_graphql'] = true; + $args['graphql_single_name'] = 'category'; + $args['graphql_plural_name'] = 'categories'; + } elseif ( 'post_tag' === $taxonomy ) { // Adds GraphQL support for tags. + $args['show_in_graphql'] = true; + $args['graphql_single_name'] = 'tag'; + $args['graphql_plural_name'] = 'tags'; + } elseif ( 'post_format' === $taxonomy ) { // Adds GraphQL support for post formats. + $args['show_in_graphql'] = true; + $args['graphql_single_name'] = 'postFormat'; + $args['graphql_plural_name'] = 'postFormats'; + } + + return $args; + } + + /** + * Set the GraphQL Post Type Args and pass them through a filter. + * + * @param array $args The graphql specific args for the post type + * @param string $post_type_name The name of the post type being registered + * + * @return array + * @throws \Exception + * @since 1.12.0 + */ + public static function register_graphql_post_type_args( array $args, string $post_type_name ) { + // Bail early if the post type is hidden from the WPGraphQL schema. + if ( empty( $args['show_in_graphql'] ) ) { + return $args; + } + + $graphql_args = self::get_default_graphql_type_args(); + + /** + * Filters the graphql args set on a post type + * + * @param array $args The graphql specific args for the post type + * @param string $post_type_name The name of the post type being registered + */ + $graphql_args = apply_filters( 'register_graphql_post_type_args', $graphql_args, $post_type_name ); + + return wp_parse_args( $args, $graphql_args ); + } + + /** + * Set the GraphQL Taxonomy Args and pass them through a filter. + * + * @param array $args The graphql specific args for the taxonomy + * @param string $taxonomy_name The name of the taxonomy being registered + * + * @return array + * @throws \Exception + * @since 1.12.0 + */ + public static function register_graphql_taxonomy_args( array $args, string $taxonomy_name ) { + // Bail early if the taxonomy is hidden from the WPGraphQL schema. + if ( empty( $args['show_in_graphql'] ) ) { + return $args; + } + + $graphql_args = self::get_default_graphql_type_args(); + + /** + * Filters the graphql args set on a taxonomy + * + * @param array $args The graphql specific args for the taxonomy + * @param string $taxonomy_name The name of the taxonomy being registered + */ + $graphql_args = apply_filters( 'register_graphql_taxonomy_args', $graphql_args, $taxonomy_name ); + + return wp_parse_args( $args, $graphql_args ); + } + + /** + * This sets the post type /taxonomy GraphQL properties. + * + * @since 1.12.0 + */ + public static function get_default_graphql_type_args(): array { + return [ + // The "kind" of GraphQL type to register. Can be `interface`, `object`, or `union`. + 'graphql_kind' => 'object', + // The callback used to resolve the type. Only used if `graphql_kind` is an `interface` or `union`. + 'graphql_resolve_type' => null, + // An array of custom interfaces the type should implement. + 'graphql_interfaces' => [], + // An array of default interfaces the type should exclude. + 'graphql_exclude_interfaces' => [], + // An array of custom connections the type should implement. + 'graphql_connections' => [], + // An array of default connection field names the type should exclude. + 'graphql_exclude_connections' => [], + // An array of possible type the union can resolve to. Only used if `graphql_kind` is a `union`. + 'graphql_union_types' => [], + // Whether to register default connections to the schema. + 'graphql_register_root_field' => true, + 'graphql_register_root_connection' => true, + ]; + } + + /** + * Get the post types that are allowed to be used in GraphQL. + * This gets all post_types that are set to show_in_graphql, but allows for external code + * (plugins/theme) to filter the list of allowed_post_types to add/remove additional post_types + * + * @param string|array $output Optional. The type of output to return. Accepts post type + * 'names' or 'objects'. Default 'names'. + * @param array $args Optional. Arguments to filter allowed post types + * + * @return array + * @since 0.0.4 + * @since 1.8.1 adds $output as first param, and stores post type objects in class property. + */ + public static function get_allowed_post_types( $output = 'names', $args = [] ) { + // Support deprecated param order. + if ( is_array( $output ) ) { + _deprecated_argument( __METHOD__, '1.8.1', '$args should be passed as the second parameter.' ); + $args = $output; + $output = 'names'; + } + + // Initialize array of allowed post type objects. + if ( empty( self::$allowed_post_types ) ) { + /** + * Get all post types objects. + * + * @var \WP_Post_Type[] $post_type_objects + */ + $post_type_objects = get_post_types( + [ 'show_in_graphql' => true ], + 'objects' + ); + + $post_type_names = wp_list_pluck( $post_type_objects, 'name' ); + + /** + * Pass through a filter to allow the post_types to be modified. + * For example if a certain post_type should not be exposed to the GraphQL API. + * + * @param array $post_type_names Array of post type names. + * @param array $post_type_objects Array of post type objects. + * + * @return array + * @since 1.8.1 add $post_type_objects parameter. + * + * @since 0.0.2 + */ + $allowed_post_type_names = apply_filters( 'graphql_post_entities_allowed_post_types', $post_type_names, $post_type_objects ); + + // Filter the post type objects if the list of allowed types have changed. + $post_type_objects = array_filter( + $post_type_objects, + static function ( $obj ) use ( $allowed_post_type_names ) { + if ( empty( $obj->graphql_plural_name ) && ! empty( $obj->graphql_single_name ) ) { + $obj->graphql_plural_name = $obj->graphql_single_name; + } + + /** + * Validate that the post_types have a graphql_single_name and graphql_plural_name + */ + if ( empty( $obj->graphql_single_name ) || empty( $obj->graphql_plural_name ) ) { + graphql_debug( + sprintf( + /* translators: %s will replaced with the registered type */ + __( 'The "%s" post_type isn\'t configured properly to show in GraphQL. It needs a "graphql_single_name" and a "graphql_plural_name"', 'wp-graphql' ), + $obj->name + ), + [ + 'invalid_post_type' => $obj, + ] + ); + return false; + } + + return in_array( $obj->name, $allowed_post_type_names, true ); + } + ); + + self::$allowed_post_types = $post_type_objects; + } + + /** + * Filter the list of allowed post types either by the provided args or to only return an array of names. + */ + if ( ! empty( $args ) || 'names' === $output ) { + $field = 'names' === $output ? 'name' : false; + + return wp_filter_object_list( self::$allowed_post_types, $args, 'and', $field ); + } + + return self::$allowed_post_types; + } + + /** + * Get the taxonomies that are allowed to be used in GraphQL. + * This gets all taxonomies that are set to "show_in_graphql" but allows for external code + * (plugins/themes) to filter the list of allowed_taxonomies to add/remove additional + * taxonomies + * + * @param string $output Optional. The type of output to return. Accepts taxonomy 'names' or 'objects'. Default 'names'. + * @param array $args Optional. Arguments to filter allowed taxonomies. + * + * @return array + * @since 0.0.4 + */ + public static function get_allowed_taxonomies( $output = 'names', $args = [] ) { + + // Initialize array of allowed post type objects. + if ( empty( self::$allowed_taxonomies ) ) { + /** + * Get all post types objects. + * + * @var \WP_Taxonomy[] $tax_objects + */ + $tax_objects = get_taxonomies( + [ 'show_in_graphql' => true ], + 'objects' + ); + + $tax_names = wp_list_pluck( $tax_objects, 'name' ); + + /** + * Pass through a filter to allow the taxonomies to be modified. + * For example if a certain taxonomy should not be exposed to the GraphQL API. + * + * @param array $tax_names Array of taxonomy names + * @param array $tax_objects Array of taxonomy objects. + * + * @return array + * @since 1.8.1 add $tax_names and $tax_objects parameters. + * + * @since 0.0.2 + */ + $allowed_tax_names = apply_filters( 'graphql_term_entities_allowed_taxonomies', $tax_names, $tax_objects ); + + $tax_objects = array_filter( + $tax_objects, + static function ( $obj ) use ( $allowed_tax_names ) { + if ( empty( $obj->graphql_plural_name ) && ! empty( $obj->graphql_single_name ) ) { + $obj->graphql_plural_name = $obj->graphql_single_name; + } + + /** + * Validate that the post_types have a graphql_single_name and graphql_plural_name + */ + if ( empty( $obj->graphql_single_name ) || empty( $obj->graphql_plural_name ) ) { + graphql_debug( + sprintf( + /* translators: %s will replaced with the registered taxonomty */ + __( 'The "%s" taxonomy isn\'t configured properly to show in GraphQL. It needs a "graphql_single_name" and a "graphql_plural_name"', 'wp-graphql' ), + $obj->name + ), + [ + 'invalid_taxonomy' => $obj, + ] + ); + return false; + } + + return in_array( $obj->name, $allowed_tax_names, true ); + } + ); + + self::$allowed_taxonomies = $tax_objects; + } + + $taxonomies = self::$allowed_taxonomies; + /** + * Filter the list of allowed taxonomies either by the provided args or to only return an array of names. + */ + if ( ! empty( $args ) || 'names' === $output ) { + $field = 'names' === $output ? 'name' : false; + + $taxonomies = wp_filter_object_list( $taxonomies, $args, 'and', $field ); + } + + return $taxonomies; + } + + /** + * Allow Schema to be cleared + * + * @return void + */ + public static function clear_schema() { + self::$type_registry = null; + self::$schema = null; + self::$allowed_post_types = null; + self::$allowed_taxonomies = null; + } + + /** + * Returns the Schema as defined by static registrations throughout + * the WP Load. + * + * @return \WPGraphQL\WPSchema + * + * @throws \Exception + */ + public static function get_schema() { + if ( null === self::$schema ) { + $schema_registry = new SchemaRegistry(); + $schema = $schema_registry->get_schema(); + + /** + * Generate & Filter the schema. + * + * @param \WPGraphQL\WPSchema $schema The executable Schema that GraphQL executes against + * @param \WPGraphQL\AppContext $app_context Object The AppContext object containing all of the + * information about the context we know at this point + * + * @since 0.0.5 + */ + self::$schema = apply_filters( 'graphql_schema', $schema, self::get_app_context() ); + } + + /** + * Fire an action when the Schema is returned + */ + do_action( 'graphql_get_schema', self::$schema ); + + /** + * Return the Schema after applying filters + */ + return ! empty( self::$schema ) ? self::$schema : null; + } + + /** + * Whether WPGraphQL is operating in Debug mode + * + * @return bool + */ + public static function debug(): bool { + if ( defined( 'GRAPHQL_DEBUG' ) ) { + $enabled = (bool) GRAPHQL_DEBUG; + } else { + $enabled = get_graphql_setting( 'debug_mode_enabled', 'off' ); + $enabled = 'on' === $enabled; + } + + /** + * @param bool $enabled Whether GraphQL Debug is enabled or not + */ + return (bool) apply_filters( 'graphql_debug_enabled', $enabled ); + } + + /** + * Returns the Schema as defined by static registrations throughout + * the WP Load. + * + * @return \WPGraphQL\Registry\TypeRegistry + * + * @throws \Exception + */ + public static function get_type_registry() { + if ( null === self::$type_registry ) { + $type_registry = new TypeRegistry(); + + /** + * Generate & Filter the schema. + * + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The TypeRegistry for the API + * @param \WPGraphQL\AppContext $app_context Object The AppContext object containing all of the + * information about the context we know at this point + * + * @since 0.0.5 + */ + self::$type_registry = apply_filters( 'graphql_type_registry', $type_registry, self::get_app_context() ); + } + + /** + * Fire an action when the Type Registry is returned + */ + do_action( 'graphql_get_type_registry', self::$type_registry ); + + /** + * Return the Schema after applying filters + */ + return ! empty( self::$type_registry ) ? self::$type_registry : null; + } + + /** + * Return the static schema if there is one + * + * @return null|string + */ + public static function get_static_schema() { + $schema = null; + if ( file_exists( WPGRAPHQL_PLUGIN_DIR . 'schema.graphql' ) && ! empty( file_get_contents( WPGRAPHQL_PLUGIN_DIR . 'schema.graphql' ) ) ) { + $schema = file_get_contents( WPGRAPHQL_PLUGIN_DIR . 'schema.graphql' ); + } + + return $schema; + } + + /** + * Get the AppContext for use in passing down the Resolve Tree + * + * @return \WPGraphQL\AppContext + */ + public static function get_app_context() { + /** + * Configure the app_context which gets passed down to all the resolvers. + * + * @since 0.0.4 + */ + $app_context = new AppContext(); + $app_context->viewer = wp_get_current_user(); + $app_context->root_url = get_bloginfo( 'url' ); + $app_context->request = ! empty( $_REQUEST ) ? $_REQUEST : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended + + return $app_context; + } +} diff --git a/lib/wp-graphql-1.17.0/src/WPSchema.php b/lib/wp-graphql-1.17.0/src/WPSchema.php new file mode 100644 index 00000000..0e378fd9 --- /dev/null +++ b/lib/wp-graphql-1.17.0/src/WPSchema.php @@ -0,0 +1,54 @@ +config = $config; + + /** + * Set the $filterable_config as the $config that was passed to the WPSchema when instantiated + * + * @param \GraphQL\Type\SchemaConfig $config The config for the Schema. + * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL type registry. + * + * @since 0.0.9 + */ + $this->filterable_config = apply_filters( 'graphql_schema_config', $config, $type_registry ); + parent::__construct( $this->filterable_config ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/appsero/client/readme.md b/lib/wp-graphql-1.17.0/vendor/appsero/client/readme.md new file mode 100644 index 00000000..7157c5bd --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/appsero/client/readme.md @@ -0,0 +1,266 @@ +# Appsero - Client + +- [Installation](#installation) +- [Insights](#insights) +- [Dynamic Usage](#dynamic-usage) + + +## Installation + +You can install AppSero Client in two ways, via composer and manually. + +### 1. Composer Installation + +Add dependency in your project (theme/plugin): + +``` +composer require appsero/client +``` + +Now add `autoload.php` in your file if you haven't done already. + +```php +require __DIR__ . '/vendor/autoload.php'; +``` + +### 2. Manual Installation + +Clone the repository in your project. + +``` +cd /path/to/your/project/folder +git clone https://github.com/AppSero/client.git appsero +``` + +Now include the dependencies in your plugin/theme. + +```php +require __DIR__ . '/appsero/src/Client.php'; +``` + +## Insights + +AppSero can be used in both themes and plugins. + +The `Appsero\Client` class has *three* parameters: + +```php +$client = new Appsero\Client( $hash, $name, $file ); +``` + +- **hash** (*string*, *required*) - The unique identifier for a plugin or theme. +- **name** (*string*, *required*) - The name of the plugin or theme. +- **file** (*string*, *required*) - The **main file** path of the plugin. For theme, path to `functions.php` + +### Usage Example + +Please refer to the **installation** step before start using the class. + +You can obtain the **hash** for your plugin for the [Appsero Dashboard](https://dashboard.appsero.com). The 3rd parameter **must** have to be the main file of the plugin. + +```php +/** + * Initialize the tracker + * + * @return void + */ +function appsero_init_tracker_appsero_test() { + + if ( ! class_exists( 'Appsero\Client' ) ) { + require_once __DIR__ . '/appsero/src/Client.php'; + } + + $client = new Appsero\Client( 'a4a8da5b-b419-4656-98e9-4a42e9044891', 'Akismet', __FILE__ ); + + // Active insights + $client->insights()->init(); + + // Active automatic updater + $client->updater(); + + // Active license page and checker + $args = array( + 'type' => 'options', + 'menu_title' => 'Akismet', + 'page_title' => 'Akismet License Settings', + 'menu_slug' => 'akismet_settings', + ); + $client->license()->add_settings_page( $args ); +} + +appsero_init_tracker_appsero_test(); +``` + +Make sure you call this function directly, never use any action hook to call this function. + +> For plugins example code that needs to be used on your main plugin file. +> For themes example code that needs to be used on your themes `functions.php` file. + +## More Usage + +```php +$client = new Appsero\Client( 'a4a8da5b-b419-4656-98e9-4a42e9044892', 'Twenty Twelve', __FILE__ ); +``` + +#### 1. Hiding the notice + +Sometimes you wouldn't want to show the notice, or want to customize the notice message. You can do that as well. + +```php +$client->insights() + ->hide_notice() + ->init(); +``` + +#### 2. Customizing the notice message + +```php +$client->insights() + ->notice( 'My Custom Notice Message' ) + ->init(); +``` + +#### 3. Adding extra data + +You can add extra metadata from your theme or plugin. In that case, the **keys** has to be whitelisted from the Appsero dashboard. +`add_extra` method also support callback as parameter, If you need database call then callback is best for you. + +```php +$metadata = array( + 'key' => 'value', + 'another' => 'another_value' +); +$client->insights() + ->add_extra( $metadata ) + ->init(); +``` + +Or if you want to run a query then pass callback, we will call the function when it is necessary. + +```php +$metadata = function () { + $total_posts = wp_count_posts(); + + return array( + 'total_posts' => $total_posts, + 'another' => 'another_value' + ); +}; +$client->insights() + ->add_extra( $metadata ) + ->init(); +``` + +#### 4. Set textdomain + +You may set your own textdomain to translate text. + +```php +$client->set_textdomain( 'your-project-textdomain' ); +``` + + + + +#### 5. Get Plugin Data +If you want to get the most used plugins with your plugin or theme, send the active plugins' data to Appsero. +```php +$client->insights() + ->add_plugin_data() + ->init(); +``` +--- + +#### 6. Set Notice Message +Change opt-in message text +```php +$client->insights() + ->notice("Your custom notice text") + ->init(); +``` +--- + +### Check License Validity + +Check your plugin/theme is using with valid license or not, First create a global variable of `License` object then use it anywhere in your code. +If you are using it outside of same function make sure you global the variable before using the condition. + +```php +$client = new Appsero\Client( 'a4a8da5b-b419-4656-98e9-4a42e9044892', 'Twenty Twelve', __FILE__ ); + +$args = array( + 'type' => 'submenu', + 'menu_title' => 'Twenty Twelve License', + 'page_title' => 'Twenty Twelve License Settings', + 'menu_slug' => 'twenty_twelve_settings', + 'parent_slug' => 'themes.php', +); + +global $twenty_twelve_license; +$twenty_twelve_license = $client->license(); +$twenty_twelve_license->add_settings_page( $args ); + +if ( $twenty_twelve_license->is_valid() ) { + // Your special code here +} + +Or check by pricing plan title + +if ( $twenty_twelve_license->is_valid_by( 'title', 'Business' ) ) { + // Your special code here +} + +// Set custom options key for storing the license info +$twenty_twelve_license->set_option_key( 'my_plugin_license' ); +``` + +### Use your own license form + +You can easily manage license by creating a form using HTTP request. Call `license_form_submit` method from License object. + +```php +global $twenty_twelve_license; // License object +$twenty_twelve_license->license_form_submit([ + '_nonce' => wp_create_nonce( 'Twenty Twelve' ), // create a nonce with name + '_action' => 'active', // active, deactive + 'license_key' => 'random-license-key', // no need to provide if you want to deactive +]); +if ( ! $twenty_twelve_license->error ) { + // license activated + $twenty_twelve_license->success; // Success message is here +} else { + $twenty_twelve_license->error; // has error message here +} +``` + +### Set Custom Deactivation Reasons + +First set your deactivation reasons in Appsero dashboard then map them in your plugin/theme using filter hook. + +- **id** is the deactivation slug +- **text** is the deactivation title +- **placeholder** will show on textarea field +- **icon** You can set SVG icon with 23x23 size + +```php +add_filter( 'appsero_custom_deactivation_reasons', function () { + return [ + [ + 'id' => 'looks-buggy', + 'text' => 'Looks buggy', + 'placeholder' => 'Can you please tell which feature looks buggy?', + 'icon' => '', + ], + [ + 'id' => 'bad-ui', + 'text' => 'Bad UI', + 'placeholder' => 'Could you tell us a bit more?', + 'icon' => '', + ], + ]; +} ); +``` + +## Credits + +Created and maintained by [Appsero](https://appsero.com). diff --git a/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Client.php b/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Client.php new file mode 100644 index 00000000..f51b1e7e --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Client.php @@ -0,0 +1,280 @@ +hash = $hash; + $this->name = $name; + $this->file = $file; + + $this->set_basename_and_slug(); + } + + /** + * Initialize insights class + * + * @return Appsero\Insights + */ + public function insights() { + + if ( ! class_exists( __NAMESPACE__ . '\Insights') ) { + require_once __DIR__ . '/Insights.php'; + } + + // if already instantiated, return the cached one + if ( $this->insights ) { + return $this->insights; + } + + $this->insights = new Insights( $this ); + + return $this->insights; + } + + /** + * Initialize plugin/theme updater + * + * @return Appsero\Updater + */ + public function updater() { + + if ( ! class_exists( __NAMESPACE__ . '\Updater') ) { + require_once __DIR__ . '/Updater.php'; + } + + // if already instantiated, return the cached one + if ( $this->updater ) { + return $this->updater; + } + + $this->updater = new Updater( $this ); + + return $this->updater; + } + + /** + * Initialize license checker + * + * @return Appsero\License + */ + public function license() { + + if ( ! class_exists( __NAMESPACE__ . '\License') ) { + require_once __DIR__ . '/License.php'; + } + + // if already instantiated, return the cached one + if ( $this->license ) { + return $this->license; + } + + $this->license = new License( $this ); + + return $this->license; + } + + /** + * API Endpoint + * + * @return string + */ + public function endpoint() { + $endpoint = apply_filters( 'appsero_endpoint', 'https://api.appsero.com' ); + + return trailingslashit( $endpoint ); + } + + /** + * Set project basename, slug and version + * + * @return void + */ + protected function set_basename_and_slug() { + + if ( strpos( $this->file, WP_CONTENT_DIR . '/themes/' ) === false ) { + $this->basename = plugin_basename( $this->file ); + + list( $this->slug, $mainfile) = explode( '/', $this->basename ); + + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + + $plugin_data = get_plugin_data( $this->file ); + + $this->project_version = $plugin_data['Version']; + $this->type = 'plugin'; + } else { + $this->basename = str_replace( WP_CONTENT_DIR . '/themes/', '', $this->file ); + + list( $this->slug, $mainfile) = explode( '/', $this->basename ); + + $theme = wp_get_theme( $this->slug ); + + $this->project_version = $theme->version; + $this->type = 'theme'; + } + + $this->textdomain = $this->slug; + } + + /** + * Send request to remote endpoint + * + * @param array $params + * @param string $route + * + * @return array|WP_Error Array of results including HTTP headers or WP_Error if the request failed. + */ + public function send_request( $params, $route, $blocking = false ) { + $url = $this->endpoint() . $route; + + $headers = array( + 'user-agent' => 'Appsero/' . md5( esc_url( home_url() ) ) . ';', + 'Accept' => 'application/json', + ); + + $response = wp_remote_post( $url, array( + 'method' => 'POST', + 'timeout' => 30, + 'redirection' => 5, + 'httpversion' => '1.0', + 'blocking' => $blocking, + 'headers' => $headers, + 'body' => array_merge( $params, array( 'client' => $this->version ) ), + 'cookies' => array() + ) ); + + return $response; + } + + /** + * Check if the current server is localhost + * + * @return boolean + */ + public function is_local_server() { + $is_local = in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', '::1' ) ); + + return apply_filters( 'appsero_is_local', $is_local ); + } + + /** + * Translate function _e() + */ + public function _etrans( $text ) { + call_user_func( '_e', $text, $this->textdomain ); + } + + /** + * Translate function __() + */ + public function __trans( $text ) { + return call_user_func( '__', $text, $this->textdomain ); + } + + /** + * Set project textdomain + */ + public function set_textdomain( $textdomain ) { + $this->textdomain = $textdomain; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Insights.php b/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Insights.php new file mode 100644 index 00000000..13184596 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Insights.php @@ -0,0 +1,1184 @@ +client = $client; + } + } + + /** + * Don't show the notice + * + * @return \self + */ + public function hide_notice() { + $this->show_notice = false; + + return $this; + } + + /** + * Add plugin data if needed + * + * @return \self + */ + public function add_plugin_data() { + $this->plugin_data = true; + + return $this; + } + + /** + * Add extra data if needed + * + * @param array $data + * + * @return \self + */ + public function add_extra( $data = array() ) { + $this->extra_data = $data; + + return $this; + } + + /** + * Set custom notice text + * + * @param string $text + * + * @return \self + */ + public function notice($text='' ) { + $this->notice = $text; + + return $this; + } + + /** + * Initialize insights + * + * @return void + */ + public function init() { + if ( $this->client->type == 'plugin' ) { + $this->init_plugin(); + } else if ( $this->client->type == 'theme' ) { + $this->init_theme(); + } + } + + /** + * Initialize theme hooks + * + * @return void + */ + public function init_theme() { + $this->init_common(); + + add_action( 'switch_theme', array( $this, 'deactivation_cleanup' ) ); + add_action( 'switch_theme', array( $this, 'theme_deactivated' ), 12, 3 ); + } + + /** + * Initialize plugin hooks + * + * @return void + */ + public function init_plugin() { + // plugin deactivate popup + if ( ! $this->is_local_server() ) { + add_filter( 'plugin_action_links_' . $this->client->basename, array( $this, 'plugin_action_links' ) ); + add_action( 'admin_footer', array( $this, 'deactivate_scripts' ) ); + } + + $this->init_common(); + + register_activation_hook( $this->client->file, array( $this, 'activate_plugin' ) ); + register_deactivation_hook( $this->client->file, array( $this, 'deactivation_cleanup' ) ); + } + + /** + * Initialize common hooks + * + * @return void + */ + protected function init_common() { + + if ( $this->show_notice ) { + // tracking notice + add_action( 'admin_notices', array( $this, 'admin_notice' ) ); + } + + add_action( 'admin_init', array( $this, 'handle_optin_optout' ) ); + + // uninstall reason + add_action( 'wp_ajax_' . $this->client->slug . '_submit-uninstall-reason', array( $this, 'uninstall_reason_submission' ) ); + + // cron events + add_filter( 'cron_schedules', array( $this, 'add_weekly_schedule' ) ); + add_action( $this->client->slug . '_tracker_send_event', array( $this, 'send_tracking_data' ) ); + // add_action( 'admin_init', array( $this, 'send_tracking_data' ) ); // test + } + + /** + * Send tracking data to AppSero server + * + * @param boolean $override + * + * @return void + */ + public function send_tracking_data( $override = false ) { + if ( ! $this->tracking_allowed() && ! $override ) { + return; + } + + // Send a maximum of once per week + $last_send = $this->get_last_send(); + + if ( $last_send && $last_send > strtotime( '-1 week' ) ) { + return; + } + + $tracking_data = $this->get_tracking_data(); + + $response = $this->client->send_request( $tracking_data, 'track' ); + + update_option( $this->client->slug . '_tracking_last_send', time() ); + } + + /** + * Get the tracking data points + * + * @return array + */ + protected function get_tracking_data() { + $all_plugins = $this->get_all_plugins(); + + $users = get_users( array( + 'role' => 'administrator', + 'orderby' => 'ID', + 'order' => 'ASC', + 'number' => 1, + 'paged' => 1, + ) ); + + $admin_user = ( is_array( $users ) && ! empty( $users ) ) ? $users[0] : false; + $first_name = $last_name = ''; + + if ( $admin_user ) { + $first_name = $admin_user->first_name ? $admin_user->first_name : $admin_user->display_name; + $last_name = $admin_user->last_name; + } + + $data = array( + 'url' => esc_url( home_url() ), + 'site' => $this->get_site_name(), + 'admin_email' => get_option( 'admin_email' ), + 'first_name' => $first_name, + 'last_name' => $last_name, + 'hash' => $this->client->hash, + 'server' => $this->get_server_info(), + 'wp' => $this->get_wp_info(), + 'users' => $this->get_user_counts(), + 'active_plugins' => count( $all_plugins['active_plugins'] ), + 'inactive_plugins' => count( $all_plugins['inactive_plugins'] ), + 'ip_address' => $this->get_user_ip_address(), + 'project_version' => $this->client->project_version, + 'tracking_skipped' => false, + 'is_local' => $this->is_local_server(), + ); + + // Add Plugins + if ($this->plugin_data) { + + $plugins_data = array(); + + foreach ($all_plugins['active_plugins'] as $slug => $plugin) { + $slug = strstr($slug, '/', true); + if (! $slug) { + continue; + } + + $plugins_data[ $slug ] = array( + 'name' => isset($plugin['name']) ? $plugin['name'] : '', + 'version' => isset($plugin['version']) ? $plugin['version'] : '', + ); + } + + if (array_key_exists($this->client->slug, $plugins_data)) { + unset($plugins_data[$this->client->slug]); + } + + $data['plugins'] = $plugins_data; + } + + // Add metadata + if ( $extra = $this->get_extra_data() ) { + $data['extra'] = $extra; + } + + // Check this has previously skipped tracking + $skipped = get_option( $this->client->slug . '_tracking_skipped' ); + + if ( $skipped === 'yes' ) { + delete_option( $this->client->slug . '_tracking_skipped' ); + + $data['tracking_skipped'] = true; + } + + return apply_filters( $this->client->slug . '_tracker_data', $data ); + } + + /** + * If a child class wants to send extra data + * + * @return mixed + */ + protected function get_extra_data() { + if ( is_callable( $this->extra_data ) ) { + return call_user_func( $this->extra_data ); + } + + if ( is_array( $this->extra_data ) ) { + return $this->extra_data; + } + + return array(); + } + + /** + * Explain the user which data we collect + * + * @return array + */ + protected function data_we_collect() { + $data = array( + 'Server environment details (php, mysql, server, WordPress versions)', + 'Number of users in your site', + 'Site language', + 'Number of active and inactive plugins', + 'Site name and URL', + 'Your name and email address', + ); + + if ($this->plugin_data) { + array_splice($data, 4, 0, ["active plugins' name"]); + } + + return $data; + } + + /** + * Check if the user has opted into tracking + * + * @return bool + */ + public function tracking_allowed() { + $allow_tracking = get_option( $this->client->slug . '_allow_tracking', 'no' ); + + return $allow_tracking == 'yes'; + } + + /** + * Get the last time a tracking was sent + * + * @return false|string + */ + private function get_last_send() { + return get_option( $this->client->slug . '_tracking_last_send', false ); + } + + /** + * Check if the notice has been dismissed or enabled + * + * @return boolean + */ + public function notice_dismissed() { + $hide_notice = get_option( $this->client->slug . '_tracking_notice', null ); + + if ( 'hide' == $hide_notice ) { + return true; + } + + return false; + } + + /** + * Check if the current server is localhost + * + * @return boolean + */ + private function is_local_server() { + + $host = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : 'localhost'; + $ip = isset( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '127.0.0.1'; + $is_local = false; + + if( in_array( $ip,array( '127.0.0.1', '::1' ) ) + || ! strpos( $host, '.' ) + || in_array( strrchr( $host, '.' ), array( '.test', '.testing', '.local', '.localhost', '.localdomain' ) ) + ) { + $is_local = true; + } + + return apply_filters( 'appsero_is_local', $is_local ); + } + + /** + * Schedule the event weekly + * + * @return void + */ + private function schedule_event() { + $hook_name = $this->client->slug . '_tracker_send_event'; + + if ( ! wp_next_scheduled( $hook_name ) ) { + wp_schedule_event( time(), 'weekly', $hook_name ); + } + } + + /** + * Clear any scheduled hook + * + * @return void + */ + private function clear_schedule_event() { + wp_clear_scheduled_hook( $this->client->slug . '_tracker_send_event' ); + } + + /** + * Display the admin notice to users that have not opted-in or out + * + * @return void + */ + public function admin_notice() { + + if ( $this->notice_dismissed() ) { + return; + } + + if ( $this->tracking_allowed() ) { + return; + } + + if ( ! current_user_can( 'manage_options' ) ) { + return; + } + + // don't show tracking if a local server + if ( $this->is_local_server() ) { + return; + } + + $optin_url = add_query_arg( $this->client->slug . '_tracker_optin', 'true' ); + $optout_url = add_query_arg( $this->client->slug . '_tracker_optout', 'true' ); + + if ( empty( $this->notice ) ) { + $notice = sprintf( $this->client->__trans( 'Want to help make %1$s even more awesome? Allow %1$s to collect non-sensitive diagnostic data and usage information.' ), $this->client->name ); + } else { + $notice = $this->notice; + } + + $policy_url = 'https://' . 'appsero.com/privacy-policy/'; + + $notice .= ' (' . $this->client->__trans( 'what we collect' ) . ')'; + $notice .= ''; + + echo '

'; + echo $notice; + echo '

'; + echo ' ' . $this->client->__trans( 'Allow' ) . ''; + echo ' ' . $this->client->__trans( 'No thanks' ) . ''; + echo '

'; + + echo " + "; + } + + /** + * handle the optin/optout + * + * @return void + */ + public function handle_optin_optout() { + + if ( isset( $_GET[ $this->client->slug . '_tracker_optin' ] ) && $_GET[ $this->client->slug . '_tracker_optin' ] == 'true' ) { + $this->optin(); + + wp_redirect( remove_query_arg( $this->client->slug . '_tracker_optin' ) ); + exit; + } + + if ( isset( $_GET[ $this->client->slug . '_tracker_optout' ] ) && $_GET[ $this->client->slug . '_tracker_optout' ] == 'true' ) { + $this->optout(); + + wp_redirect( remove_query_arg( $this->client->slug . '_tracker_optout' ) ); + exit; + } + } + + /** + * Tracking optin + * + * @return void + */ + public function optin() { + update_option( $this->client->slug . '_allow_tracking', 'yes' ); + update_option( $this->client->slug . '_tracking_notice', 'hide' ); + + $this->clear_schedule_event(); + $this->schedule_event(); + $this->send_tracking_data(); + } + + /** + * Optout from tracking + * + * @return void + */ + public function optout() { + update_option( $this->client->slug . '_allow_tracking', 'no' ); + update_option( $this->client->slug . '_tracking_notice', 'hide' ); + + $this->send_tracking_skipped_request(); + + $this->clear_schedule_event(); + } + + /** + * Get the number of post counts + * + * @param string $post_type + * + * @return integer + */ + public function get_post_count( $post_type ) { + global $wpdb; + + return (int) $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts WHERE post_type = '$post_type' and post_status = 'publish'"); + } + + /** + * Get server related info. + * + * @return array + */ + private static function get_server_info() { + global $wpdb; + + $server_data = array(); + + if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && ! empty( $_SERVER['SERVER_SOFTWARE'] ) ) { + $server_data['software'] = $_SERVER['SERVER_SOFTWARE']; + } + + if ( function_exists( 'phpversion' ) ) { + $server_data['php_version'] = phpversion(); + } + + $server_data['mysql_version'] = $wpdb->db_version(); + + $server_data['php_max_upload_size'] = size_format( wp_max_upload_size() ); + $server_data['php_default_timezone'] = date_default_timezone_get(); + $server_data['php_soap'] = class_exists( 'SoapClient' ) ? 'Yes' : 'No'; + $server_data['php_fsockopen'] = function_exists( 'fsockopen' ) ? 'Yes' : 'No'; + $server_data['php_curl'] = function_exists( 'curl_init' ) ? 'Yes' : 'No'; + + return $server_data; + } + + /** + * Get WordPress related data. + * + * @return array + */ + private function get_wp_info() { + $wp_data = array(); + + $wp_data['memory_limit'] = WP_MEMORY_LIMIT; + $wp_data['debug_mode'] = ( defined('WP_DEBUG') && WP_DEBUG ) ? 'Yes' : 'No'; + $wp_data['locale'] = get_locale(); + $wp_data['version'] = get_bloginfo( 'version' ); + $wp_data['multisite'] = is_multisite() ? 'Yes' : 'No'; + $wp_data['theme_slug'] = get_stylesheet(); + + $theme = wp_get_theme( $wp_data['theme_slug'] ); + + $wp_data['theme_name'] = $theme->get( 'Name' ); + $wp_data['theme_version'] = $theme->get( 'Version' ); + $wp_data['theme_uri'] = $theme->get( 'ThemeURI' ); + $wp_data['theme_author'] = $theme->get( 'Author' ); + + return $wp_data; + } + + /** + * Get the list of active and inactive plugins + * + * @return array + */ + private function get_all_plugins() { + // Ensure get_plugins function is loaded + if ( ! function_exists( 'get_plugins' ) ) { + include ABSPATH . '/wp-admin/includes/plugin.php'; + } + + $plugins = get_plugins(); + $active_plugins_keys = get_option( 'active_plugins', array() ); + $active_plugins = array(); + + foreach ( $plugins as $k => $v ) { + // Take care of formatting the data how we want it. + $formatted = array(); + $formatted['name'] = strip_tags( $v['Name'] ); + + if ( isset( $v['Version'] ) ) { + $formatted['version'] = strip_tags( $v['Version'] ); + } + + if ( isset( $v['Author'] ) ) { + $formatted['author'] = strip_tags( $v['Author'] ); + } + + if ( isset( $v['Network'] ) ) { + $formatted['network'] = strip_tags( $v['Network'] ); + } + + if ( isset( $v['PluginURI'] ) ) { + $formatted['plugin_uri'] = strip_tags( $v['PluginURI'] ); + } + + if ( in_array( $k, $active_plugins_keys ) ) { + // Remove active plugins from list so we can show active and inactive separately + unset( $plugins[$k] ); + $active_plugins[$k] = $formatted; + } else { + $plugins[$k] = $formatted; + } + } + + return array( 'active_plugins' => $active_plugins, 'inactive_plugins' => $plugins ); + } + + /** + * Get user totals based on user role. + * + * @return array + */ + public function get_user_counts() { + $user_count = array(); + $user_count_data = count_users(); + $user_count['total'] = $user_count_data['total_users']; + + // Get user count based on user role + foreach ( $user_count_data['avail_roles'] as $role => $count ) { + if ( ! $count ) { + continue; + } + + $user_count[ $role ] = $count; + } + + return $user_count; + } + + /** + * Add weekly cron schedule + * + * @param array $schedules + * + * @return array + */ + public function add_weekly_schedule( $schedules ) { + + $schedules['weekly'] = array( + 'interval' => DAY_IN_SECONDS * 7, + 'display' => 'Once Weekly', + ); + + return $schedules; + } + + /** + * Plugin activation hook + * + * @return void + */ + public function activate_plugin() { + $allowed = get_option( $this->client->slug . '_allow_tracking', 'no' ); + + // if it wasn't allowed before, do nothing + if ( 'yes' !== $allowed ) { + return; + } + + // re-schedule and delete the last sent time so we could force send again + $hook_name = $this->client->slug . '_tracker_send_event'; + if ( ! wp_next_scheduled( $hook_name ) ) { + wp_schedule_event( time(), 'weekly', $hook_name ); + } + + delete_option( $this->client->slug . '_tracking_last_send' ); + + $this->send_tracking_data( true ); + } + + /** + * Clear our options upon deactivation + * + * @return void + */ + public function deactivation_cleanup() { + $this->clear_schedule_event(); + + if ( 'theme' == $this->client->type ) { + delete_option( $this->client->slug . '_tracking_last_send' ); + delete_option( $this->client->slug . '_allow_tracking' ); + } + + delete_option( $this->client->slug . '_tracking_notice' ); + } + + /** + * Hook into action links and modify the deactivate link + * + * @param array $links + * + * @return array + */ + public function plugin_action_links( $links ) { + + if ( array_key_exists( 'deactivate', $links ) ) { + $links['deactivate'] = str_replace( ' 'could-not-understand', + 'text' => $this->client->__trans( "Couldn't understand" ), + 'placeholder' => $this->client->__trans( 'Would you like us to assist you?' ), + 'icon' => '' + ), + array( + 'id' => 'found-better-plugin', + 'text' => $this->client->__trans( 'Found a better plugin' ), + 'placeholder' => $this->client->__trans( 'Which plugin?' ), + 'icon' => '', + ), + array( + 'id' => 'not-have-that-feature', + 'text' => $this->client->__trans( "Missing a specific feature" ), + 'placeholder' => $this->client->__trans( 'Could you tell us more about that feature?' ), + 'icon' => '', + ), + array( + 'id' => 'is-not-working', + 'text' => $this->client->__trans( 'Not working' ), + 'placeholder' => $this->client->__trans( 'Could you tell us a bit more whats not working?' ), + 'icon' => '', + ), + array( + 'id' => 'looking-for-other', + 'text' => $this->client->__trans( "Not what I was looking" ), + 'placeholder' => $this->client->__trans( 'Could you tell us a bit more?' ), + 'icon' => '', + ), + array( + 'id' => 'did-not-work-as-expected', + 'text' => $this->client->__trans( "Didn't work as expected" ), + 'placeholder' => $this->client->__trans( 'What did you expect?' ), + 'icon' => '', + ), + array( + 'id' => 'other', + 'text' => $this->client->__trans( 'Others' ), + 'placeholder' => $this->client->__trans( 'Could you tell us a bit more?' ), + 'icon' => '', + ), + ); + + return $reasons; + } + + /** + * Plugin deactivation uninstall reason submission + * + * @return void + */ + public function uninstall_reason_submission() { + + if ( ! isset( $_POST['reason_id'] ) ) { + wp_send_json_error(); + } + + if ( ! wp_verify_nonce( $_POST['nonce'], 'appsero-security-nonce' ) ) { + wp_send_json_error( 'Nonce verification failed' ); + } + + $data = $this->get_tracking_data(); + $data['reason_id'] = sanitize_text_field( $_POST['reason_id'] ); + $data['reason_info'] = isset( $_REQUEST['reason_info'] ) ? trim( stripslashes( $_REQUEST['reason_info'] ) ) : ''; + + $this->client->send_request( $data, 'deactivate' ); + + wp_send_json_success(); + } + + /** + * Handle the plugin deactivation feedback + * + * @return void + */ + public function deactivate_scripts() { + global $pagenow; + + if ( 'plugins.php' != $pagenow ) { + return; + } + + $this->deactivation_modal_styles(); + $reasons = $this->get_uninstall_reasons(); + $custom_reasons = apply_filters( 'appsero_custom_deactivation_reasons', array() ); + ?> + +
+
+
+

client->_etrans( 'Goodbyes are always hard. If you have a moment, please let us know how we can improve.' ); ?>

+
+ +
+
    + +
  • + +
  • + +
+ +
    + +
  • + +
  • + +
+ +
+

+ client->__trans( 'We share your data with Appsero to troubleshoot problems & make product improvements. Learn more about how Appsero handles your data.'), + esc_url( 'https://appsero.com/' ), + esc_url( 'https://appsero.com/privacy-policy' ) + ); + ?> +

+
+ + +
+
+ + + + get_template() == $this->client->slug ) { + $this->client->send_request( $this->get_tracking_data(), 'deactivate' ); + } + } + + /** + * Get user IP Address + */ + private function get_user_ip_address() { + $response = wp_remote_get( 'https://icanhazip.com/' ); + + if ( is_wp_error( $response ) ) { + return ''; + } + + $ip = trim( wp_remote_retrieve_body( $response ) ); + + if ( ! filter_var( $ip, FILTER_VALIDATE_IP ) ) { + return ''; + } + + return $ip; + } + + /** + * Get site name + */ + private function get_site_name() { + $site_name = get_bloginfo( 'name' ); + + if ( empty( $site_name ) ) { + $site_name = get_bloginfo( 'description' ); + $site_name = wp_trim_words( $site_name, 3, '' ); + } + + if ( empty( $site_name ) ) { + $site_name = esc_url( home_url() ); + } + + return $site_name; + } + + /** + * Send request to appsero if user skip to send tracking data + */ + private function send_tracking_skipped_request() { + $skipped = get_option( $this->client->slug . '_tracking_skipped' ); + + $data = array( + 'hash' => $this->client->hash, + 'previously_skipped' => false, + ); + + if ( $skipped === 'yes' ) { + $data['previously_skipped'] = true; + } else { + update_option( $this->client->slug . '_tracking_skipped', 'yes' ); + } + + $this->client->send_request( $data, 'tracking-skipped' ); + } + + /** + * Deactivation modal styles + */ + private function deactivation_modal_styles() { + ?> + + client = $client; + + $this->option_key = 'appsero_' . md5( $this->client->slug ) . '_manage_license'; + + $this->schedule_hook = $this->client->slug . '_license_check_event'; + + // Creating WP Ajax Endpoint to refresh license remotely + add_action( "wp_ajax_appsero_refresh_license_" . $this->client->hash, array( $this, 'refresh_license_api' ) ); + + // Run hook to check license status daily + add_action( $this->schedule_hook, array( $this, 'check_license_status' ) ); + + // Active/Deactive corn schedule + $this->run_schedule(); + } + + /** + * Set the license option key. + * + * If someone wants to override the default generated key. + * + * @param string $key + * + * @since 1.3.0 + * + * @return License + */ + public function set_option_key( $key ) { + $this->option_key = $key; + + return $this; + } + + /** + * Get the license key + * + * @since 1.3.0 + * + * @return string|null + */ + public function get_license() { + return get_option( $this->option_key, null ); + } + + /** + * Check license + * + * @return bool + */ + public function check( $license_key ) { + $route = 'public/license/' . $this->client->hash . '/check'; + + return $this->send_request( $license_key, $route ); + } + + /** + * Active a license + * + * @return bool + */ + public function activate( $license_key ) { + $route = 'public/license/' . $this->client->hash . '/activate'; + + return $this->send_request( $license_key, $route ); + } + + /** + * Deactivate a license + * + * @return bool + */ + public function deactivate( $license_key ) { + $route = 'public/license/' . $this->client->hash . '/deactivate'; + + return $this->send_request( $license_key, $route ); + } + + /** + * Send common request + * + * @param $license_key + * @param $route + * + * @return array + */ + protected function send_request( $license_key, $route ) { + $params = array( + 'license_key' => $license_key, + 'url' => esc_url( home_url() ), + 'is_local' => $this->client->is_local_server(), + ); + + $response = $this->client->send_request( $params, $route, true ); + + if ( is_wp_error( $response ) ) { + return array( + 'success' => false, + 'error' => $response->get_error_message() + ); + } + + $response = json_decode( wp_remote_retrieve_body( $response ), true ); + + if ( empty( $response ) || isset( $response['exception'] )) { + return array( + 'success' => false, + 'error' => $this->client->__trans( 'Unknown error occurred, Please try again.' ), + ); + } + + if ( isset( $response['errors'] ) && isset( $response['errors']['license_key'] ) ) { + $response = array( + 'success' => false, + 'error' => $response['errors']['license_key'][0] + ); + } + + return $response; + } + + /** + * License Refresh Endpoint + */ + public function refresh_license_api() { + $this->check_license_status(); + + return wp_send_json( + array( + 'message' => 'License refreshed successfully.' + ), + 200 + ); + } + + /** + * Add settings page for license + * + * @param array $args + * + * @return void + */ + public function add_settings_page( $args = array() ) { + $defaults = array( + 'type' => 'menu', // Can be: menu, options, submenu + 'page_title' => 'Manage License', + 'menu_title' => 'Manage License', + 'capability' => 'manage_options', + 'menu_slug' => $this->client->slug . '-manage-license', + 'icon_url' => '', + 'position' => null, + 'parent_slug' => '', + ); + + $this->menu_args = wp_parse_args( $args, $defaults ); + + add_action( 'admin_menu', array( $this, 'admin_menu' ), 99 ); + } + + /** + * Admin Menu hook + * + * @return void + */ + public function admin_menu() { + switch ( $this->menu_args['type'] ) { + case 'menu': + $this->create_menu_page(); + break; + + case 'submenu': + $this->create_submenu_page(); + break; + + case 'options': + $this->create_options_page(); + break; + } + } + + /** + * License menu output + */ + public function menu_output() { + if ( isset( $_POST['submit'] ) ) { + $this->license_form_submit( $_POST ); + } + + $license = $this->get_license(); + $action = ( $license && isset( $license['status'] ) && 'activate' == $license['status'] ) ? 'deactive' : 'active'; + $this->licenses_style(); + ?> + +
+

License Settings

+ + show_license_page_notices(); + do_action( 'before_appsero_license_section' ); + ?> + +
+ show_license_page_card_header( $license ); ?> + +
+

+ client->__trans( 'Activate %s by your license key to get professional support and automatic update from your WordPress dashboard.' ), $this->client->name ); ?> +

+
+ + +
+
+ + + + + /> +
+ +
+
+ + show_active_license_info( $license ); + } ?> +
+
+ + +
+ error = $this->client->__trans( 'Please add all information' ); + + return; + } + + if ( ! wp_verify_nonce( $form['_nonce'], $this->client->name ) ) { + $this->error = $this->client->__trans( "You don't have permission to manage license." ); + + return; + } + + switch ( $form['_action'] ) { + case 'active': + $this->active_client_license( $form ); + break; + + case 'deactive': + $this->deactive_client_license( $form ); + break; + + case 'refresh': + $this->refresh_client_license( $form ); + break; + } + } + + /** + * Check license status on schedule + */ + public function check_license_status() { + $license = $this->get_license(); + + if ( isset( $license['key'] ) && ! empty( $license['key'] ) ) { + $response = $this->check( $license['key'] ); + + if ( isset( $response['success'] ) && $response['success'] ) { + $license['status'] = 'activate'; + $license['remaining'] = $response['remaining']; + $license['activation_limit'] = $response['activation_limit']; + $license['expiry_days'] = $response['expiry_days']; + $license['title'] = $response['title']; + $license['source_id'] = $response['source_identifier']; + $license['recurring'] = $response['recurring']; + } else { + $license['status'] = 'deactivate'; + $license['expiry_days'] = 0; + } + + update_option( $this->option_key, $license, false ); + } + } + + /** + * Check this is a valid license + */ + public function is_valid() { + if ( null !== $this->is_valid_licnese ) { + return $this->is_valid_licnese; + } + + $license = $this->get_license(); + + if ( ! empty( $license['key'] ) && isset( $license['status'] ) && $license['status'] == 'activate' ) { + $this->is_valid_licnese = true; + } else { + $this->is_valid_licnese = false; + } + + return $this->is_valid_licnese; + } + + /** + * Check this is a valid license + */ + public function is_valid_by( $option, $value ) { + $license = $this->get_license(); + + if ( ! empty( $license['key'] ) && isset( $license['status'] ) && $license['status'] == 'activate' ) { + if ( isset( $license[ $option ] ) && $license[ $option ] == $value ) { + return true; + } + } + + return false; + } + + /** + * Styles for licenses page + */ + private function licenses_style() { + ?> + + +
+
+

client->_etrans( 'Activations Remaining' ); ?>

+ +

client->_etrans( 'Unlimited' ); ?>

+ +

+ client->__trans( '%1$d out of %2$d' ), $license['remaining'], $license['activation_limit'] ); ?> +

+ +
+
+

client->_etrans( 'Expires in' ); ?>

+ 21 ? '' : 'occupied'; + echo '

' . $license['expiry_days'] . ' days

'; + } else { + echo '

' . $this->client->__trans( 'Never' ) . '

'; + } ?> +
+
+ error ) ) { + ?> +
+

error; ?>

+
+ success ) ) { + ?> +
+

success; ?>

+
+ '; + } + + /** + * Card header + */ + private function show_license_page_card_header( $license ) { + ?> +
+ + + + + + client->__trans( 'Activate License' ); ?> + + +
+ + + +
+ + +
+ error = $this->client->__trans( 'The license key field is required.' ); + + return; + } + + $license_key = sanitize_text_field( $form['license_key'] ); + $response = $this->activate( $license_key ); + + if ( ! $response['success'] ) { + $this->error = $response['error'] ? $response['error'] : $this->client->__trans( 'Unknown error occurred.' ); + + return; + } + + $data = array( + 'key' => $license_key, + 'status' => 'activate', + 'remaining' => $response['remaining'], + 'activation_limit' => $response['activation_limit'], + 'expiry_days' => $response['expiry_days'], + 'title' => $response['title'], + 'source_id' => $response['source_identifier'], + 'recurring' => $response['recurring'], + ); + + update_option( $this->option_key, $data, false ); + + $this->success = $this->client->__trans( 'License activated successfully.' ); + } + + /** + * Deactive client license + */ + private function deactive_client_license( $form ) { + $license = $this->get_license(); + + if ( empty( $license['key'] ) ) { + $this->error = $this->client->__trans( 'License key not found.' ); + + return; + } + + $response = $this->deactivate( $license['key'] ); + + $data = array( + 'key' => '', + 'status' => 'deactivate', + ); + + update_option( $this->option_key, $data, false ); + + if ( ! $response['success'] ) { + $this->error = $response['error'] ? $response['error'] : $this->client->__trans( 'Unknown error occurred.' ); + + return; + } + + $this->success = $this->client->__trans( 'License deactivated successfully.' ); + } + + /** + * Refresh Client License + */ + private function refresh_client_license( $form = null ) { + $license = $this->get_license(); + + if( !$license || ! isset( $license['key'] ) || empty( $license['key'] ) ) { + $this->error = $this->client->__trans( "License key not found" ); + return; + } + + $this->check_license_status(); + + $this->success = $this->client->__trans( 'License refreshed successfully.' ); + } + + /** + * Add license menu page + */ + private function create_menu_page() { + call_user_func( + 'add_' . 'menu' . '_page', + $this->menu_args['page_title'], + $this->menu_args['menu_title'], + $this->menu_args['capability'], + $this->menu_args['menu_slug'], + array( $this, 'menu_output' ), + $this->menu_args['icon_url'], + $this->menu_args['position'] + ); + } + + /** + * Add submenu page + */ + private function create_submenu_page() { + call_user_func( + 'add_' . 'submenu' . '_page', + $this->menu_args['parent_slug'], + $this->menu_args['page_title'], + $this->menu_args['menu_title'], + $this->menu_args['capability'], + $this->menu_args['menu_slug'], + array( $this, 'menu_output' ), + $this->menu_args['position'] + ); + } + + /** + * Add submenu page + */ + private function create_options_page() { + call_user_func( + 'add_' . 'options' . '_page', + $this->menu_args['page_title'], + $this->menu_args['menu_title'], + $this->menu_args['capability'], + $this->menu_args['menu_slug'], + array( $this, 'menu_output' ), + $this->menu_args['position'] + ); + } + + /** + * Schedule daily sicense checker event + */ + public function schedule_cron_event() { + if ( ! wp_next_scheduled( $this->schedule_hook ) ) { + wp_schedule_event( time(), 'daily', $this->schedule_hook ); + + wp_schedule_single_event( time() + 20, $this->schedule_hook ); + } + } + + /** + * Clear any scheduled hook + */ + public function clear_scheduler() { + wp_clear_scheduled_hook( $this->schedule_hook ); + } + + /** + * Enable/Disable schedule + */ + private function run_schedule() { + switch ( $this->client->type ) { + case 'plugin': + register_activation_hook( $this->client->file, array( $this, 'schedule_cron_event' ) ); + register_deactivation_hook( $this->client->file, array( $this, 'clear_scheduler' ) ); + break; + + case 'theme': + add_action( 'after_switch_theme', array( $this, 'schedule_cron_event' ) ); + add_action( 'switch_theme', array( $this, 'clear_scheduler' ) ); + break; + } + } + + /** + * Form action URL + */ + private function form_action_url() { + $url = add_query_arg( + $_GET, + admin_url( basename( $_SERVER['SCRIPT_NAME'] ) ) + ); + + echo apply_filters( 'appsero_client_license_form_action', $url ); + } + + /** + * Get input license key + * + * @param $action + * + * @return $license + */ + private function get_input_license_value( $action, $license ) { + if ( 'active' == $action ) { + return isset( $license['key'] ) ? $license['key'] : ''; + } + + if ( 'deactive' == $action ) { + $key_length = strlen( $license['key'] ); + + return str_pad( + substr( $license['key'], 0, $key_length / 2 ), $key_length, '*' + ); + } + + return ''; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Updater.php b/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Updater.php new file mode 100644 index 00000000..33b1cef3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Updater.php @@ -0,0 +1,258 @@ +client = $client; + $this->cache_key = 'appsero_' . md5( $this->client->slug ) . '_version_info'; + + // Run hooks. + if ( $this->client->type == 'plugin' ) { + $this->run_plugin_hooks(); + } elseif ( $this->client->type == 'theme' ) { + $this->run_theme_hooks(); + } + } + + /** + * Set up WordPress filter to hooks to get update. + * + * @return void + */ + public function run_plugin_hooks() { + add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_plugin_update' ) ); + add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 ); + } + + /** + * Set up WordPress filter to hooks to get update. + * + * @return void + */ + public function run_theme_hooks() { + add_filter( 'pre_set_site_transient_update_themes', array( $this, 'check_theme_update' ) ); + } + + /** + * Check for Update for this specific project + */ + public function check_plugin_update( $transient_data ) { + global $pagenow; + + if ( ! is_object( $transient_data ) ) { + $transient_data = new \stdClass; + } + + if ( 'plugins.php' == $pagenow && is_multisite() ) { + return $transient_data; + } + + if ( ! empty( $transient_data->response ) && ! empty( $transient_data->response[ $this->client->basename ] ) ) { + return $transient_data; + } + + $version_info = $this->get_version_info(); + + if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) { + + unset( $version_info->sections ); + + // If new version available then set to `response` + if ( version_compare( $this->client->project_version, $version_info->new_version, '<' ) ) { + $transient_data->response[ $this->client->basename ] = $version_info; + } else { + // If new version is not available then set to `no_update` + $transient_data->no_update[ $this->client->basename ] = $version_info; + } + + $transient_data->last_checked = time(); + $transient_data->checked[ $this->client->basename ] = $this->client->project_version; + } + + return $transient_data; + } + + /** + * Get version info from database + * + * @return Object or Boolean + */ + private function get_cached_version_info() { + global $pagenow; + + // If updater page then fetch from API now + if ( 'update-core.php' == $pagenow ) { + return false; // Force to fetch data + } + + $value = get_transient( $this->cache_key ); + + if( ! $value && ! isset( $value->name ) ) { + return false; // Cache is expired + } + + // We need to turn the icons into an array + if ( isset( $value->icons ) ) { + $value->icons = (array) $value->icons; + } + + // We need to turn the banners into an array + if ( isset( $value->banners ) ) { + $value->banners = (array) $value->banners; + } + + if ( isset( $value->sections ) ) { + $value->sections = (array) $value->sections; + } + + return $value; + } + + /** + * Set version info to database + */ + private function set_cached_version_info( $value ) { + if ( ! $value ) { + return; + } + + set_transient( $this->cache_key, $value, 3 * HOUR_IN_SECONDS ); + } + + /** + * Get plugin info from Appsero + */ + private function get_project_latest_version() { + + $license = $this->client->license()->get_license(); + + $params = array( + 'version' => $this->client->project_version, + 'name' => $this->client->name, + 'slug' => $this->client->slug, + 'basename' => $this->client->basename, + 'license_key' => ! empty( $license ) && isset( $license['key'] ) ? $license['key'] : '', + ); + + $route = 'update/' . $this->client->hash . '/check'; + + $response = $this->client->send_request( $params, $route, true ); + + if ( is_wp_error( $response ) ) { + return false; + } + + $response = json_decode( wp_remote_retrieve_body( $response ) ); + + if ( ! isset( $response->slug ) ) { + return false; + } + + if ( isset( $response->icons ) ) { + $response->icons = (array) $response->icons; + } + + if ( isset( $response->banners ) ) { + $response->banners = (array) $response->banners; + } + + if ( isset( $response->sections ) ) { + $response->sections = (array) $response->sections; + } + + return $response; + } + + /** + * Updates information on the "View version x.x details" page with custom data. + * + * @param mixed $data + * @param string $action + * @param object $args + * + * @return object $data + */ + public function plugins_api_filter( $data, $action = '', $args = null ) { + + if ( $action != 'plugin_information' ) { + return $data; + } + + if ( ! isset( $args->slug ) || ( $args->slug != $this->client->slug ) ) { + return $data; + } + + return $this->get_version_info(); + } + + /** + * Check theme upate + */ + public function check_theme_update( $transient_data ) { + global $pagenow; + + if ( ! is_object( $transient_data ) ) { + $transient_data = new \stdClass; + } + + if ( 'themes.php' == $pagenow && is_multisite() ) { + return $transient_data; + } + + if ( ! empty( $transient_data->response ) && ! empty( $transient_data->response[ $this->client->slug ] ) ) { + return $transient_data; + } + + $version_info = $this->get_version_info(); + + if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) { + + // If new version available then set to `response` + if ( version_compare( $this->client->project_version, $version_info->new_version, '<' ) ) { + $transient_data->response[ $this->client->slug ] = (array) $version_info; + } else { + // If new version is not available then set to `no_update` + $transient_data->no_update[ $this->client->slug ] = (array) $version_info; + } + + $transient_data->last_checked = time(); + $transient_data->checked[ $this->client->slug ] = $this->client->project_version; + } + + return $transient_data; + } + + /** + * Get version information + */ + private function get_version_info() { + $version_info = $this->get_cached_version_info(); + + if ( false === $version_info ) { + $version_info = $this->get_project_latest_version(); + $this->set_cached_version_info( $version_info ); + } + + return $version_info; + } + +} diff --git a/lib/wp-graphql-1.17.0/vendor/autoload.php b/lib/wp-graphql-1.17.0/vendor/autoload.php new file mode 100644 index 00000000..6446f328 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/autoload.php @@ -0,0 +1,25 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + + // PSR-4 + /** + * @var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var list + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> + */ + private $prefixesPsr0 = array(); + /** + * @var list + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var array + */ + private $missingClasses = array(); + + /** @var string|null */ + private $apcuPrefix; + + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return list + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return list + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return array Array of classname => path + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param array $classMap Class to filename map + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + $paths = (array) $paths; + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + $includeFile = self::$includeFile; + $includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } + + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/InstalledVersions.php b/lib/wp-graphql-1.17.0/vendor/composer/InstalledVersions.php new file mode 100644 index 00000000..51e734a7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/composer/InstalledVersions.php @@ -0,0 +1,359 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; + } else { + self::$installed = array(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/LICENSE b/lib/wp-graphql-1.17.0/vendor/composer/LICENSE new file mode 100644 index 00000000..f27399a0 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/lib/wp-graphql-1.17.0/vendor/composer/autoload_classmap.php b/lib/wp-graphql-1.17.0/vendor/composer/autoload_classmap.php new file mode 100644 index 00000000..68444926 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/composer/autoload_classmap.php @@ -0,0 +1,420 @@ + $vendorDir . '/appsero/client/src/Client.php', + 'Appsero\\Insights' => $vendorDir . '/appsero/client/src/Insights.php', + 'Appsero\\License' => $vendorDir . '/appsero/client/src/License.php', + 'Appsero\\Updater' => $vendorDir . '/appsero/client/src/Updater.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', + 'GraphQLRelay\\Connection\\ArrayConnection' => $vendorDir . '/ivome/graphql-relay-php/src/Connection/ArrayConnection.php', + 'GraphQLRelay\\Connection\\Connection' => $vendorDir . '/ivome/graphql-relay-php/src/Connection/Connection.php', + 'GraphQLRelay\\Mutation\\Mutation' => $vendorDir . '/ivome/graphql-relay-php/src/Mutation/Mutation.php', + 'GraphQLRelay\\Node\\Node' => $vendorDir . '/ivome/graphql-relay-php/src/Node/Node.php', + 'GraphQLRelay\\Node\\Plural' => $vendorDir . '/ivome/graphql-relay-php/src/Node/Plural.php', + 'GraphQLRelay\\Relay' => $vendorDir . '/ivome/graphql-relay-php/src/Relay.php', + 'GraphQL\\Deferred' => $vendorDir . '/webonyx/graphql-php/src/Deferred.php', + 'GraphQL\\Error\\ClientAware' => $vendorDir . '/webonyx/graphql-php/src/Error/ClientAware.php', + 'GraphQL\\Error\\DebugFlag' => $vendorDir . '/webonyx/graphql-php/src/Error/DebugFlag.php', + 'GraphQL\\Error\\Error' => $vendorDir . '/webonyx/graphql-php/src/Error/Error.php', + 'GraphQL\\Error\\FormattedError' => $vendorDir . '/webonyx/graphql-php/src/Error/FormattedError.php', + 'GraphQL\\Error\\InvariantViolation' => $vendorDir . '/webonyx/graphql-php/src/Error/InvariantViolation.php', + 'GraphQL\\Error\\SyntaxError' => $vendorDir . '/webonyx/graphql-php/src/Error/SyntaxError.php', + 'GraphQL\\Error\\UserError' => $vendorDir . '/webonyx/graphql-php/src/Error/UserError.php', + 'GraphQL\\Error\\Warning' => $vendorDir . '/webonyx/graphql-php/src/Error/Warning.php', + 'GraphQL\\Exception\\InvalidArgument' => $vendorDir . '/webonyx/graphql-php/src/Exception/InvalidArgument.php', + 'GraphQL\\Executor\\ExecutionContext' => $vendorDir . '/webonyx/graphql-php/src/Executor/ExecutionContext.php', + 'GraphQL\\Executor\\ExecutionResult' => $vendorDir . '/webonyx/graphql-php/src/Executor/ExecutionResult.php', + 'GraphQL\\Executor\\Executor' => $vendorDir . '/webonyx/graphql-php/src/Executor/Executor.php', + 'GraphQL\\Executor\\ExecutorImplementation' => $vendorDir . '/webonyx/graphql-php/src/Executor/ExecutorImplementation.php', + 'GraphQL\\Executor\\Promise\\Adapter\\AmpPromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/AmpPromiseAdapter.php', + 'GraphQL\\Executor\\Promise\\Adapter\\ReactPromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php', + 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromise' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php', + 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php', + 'GraphQL\\Executor\\Promise\\Promise' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Promise.php', + 'GraphQL\\Executor\\Promise\\PromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php', + 'GraphQL\\Executor\\ReferenceExecutor' => $vendorDir . '/webonyx/graphql-php/src/Executor/ReferenceExecutor.php', + 'GraphQL\\Executor\\Values' => $vendorDir . '/webonyx/graphql-php/src/Executor/Values.php', + 'GraphQL\\Experimental\\Executor\\Collector' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/Collector.php', + 'GraphQL\\Experimental\\Executor\\CoroutineContext' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php', + 'GraphQL\\Experimental\\Executor\\CoroutineContextShared' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php', + 'GraphQL\\Experimental\\Executor\\CoroutineExecutor' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php', + 'GraphQL\\Experimental\\Executor\\Runtime' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/Runtime.php', + 'GraphQL\\Experimental\\Executor\\Strand' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/Strand.php', + 'GraphQL\\GraphQL' => $vendorDir . '/webonyx/graphql-php/src/GraphQL.php', + 'GraphQL\\Language\\AST\\ArgumentNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ArgumentNode.php', + 'GraphQL\\Language\\AST\\BooleanValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/BooleanValueNode.php', + 'GraphQL\\Language\\AST\\DefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DefinitionNode.php', + 'GraphQL\\Language\\AST\\DirectiveDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DirectiveDefinitionNode.php', + 'GraphQL\\Language\\AST\\DirectiveNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DirectiveNode.php', + 'GraphQL\\Language\\AST\\DocumentNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DocumentNode.php', + 'GraphQL\\Language\\AST\\EnumTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\EnumTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\EnumValueDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php', + 'GraphQL\\Language\\AST\\EnumValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumValueNode.php', + 'GraphQL\\Language\\AST\\ExecutableDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ExecutableDefinitionNode.php', + 'GraphQL\\Language\\AST\\FieldDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FieldDefinitionNode.php', + 'GraphQL\\Language\\AST\\FieldNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FieldNode.php', + 'GraphQL\\Language\\AST\\FloatValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FloatValueNode.php', + 'GraphQL\\Language\\AST\\FragmentDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FragmentDefinitionNode.php', + 'GraphQL\\Language\\AST\\FragmentSpreadNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php', + 'GraphQL\\Language\\AST\\HasSelectionSet' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php', + 'GraphQL\\Language\\AST\\InlineFragmentNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InlineFragmentNode.php', + 'GraphQL\\Language\\AST\\InputObjectTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\InputObjectTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\InputValueDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php', + 'GraphQL\\Language\\AST\\IntValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/IntValueNode.php', + 'GraphQL\\Language\\AST\\InterfaceTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\InterfaceTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\ListTypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ListTypeNode.php', + 'GraphQL\\Language\\AST\\ListValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ListValueNode.php', + 'GraphQL\\Language\\AST\\Location' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/Location.php', + 'GraphQL\\Language\\AST\\NameNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NameNode.php', + 'GraphQL\\Language\\AST\\NamedTypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NamedTypeNode.php', + 'GraphQL\\Language\\AST\\Node' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/Node.php', + 'GraphQL\\Language\\AST\\NodeKind' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NodeKind.php', + 'GraphQL\\Language\\AST\\NodeList' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NodeList.php', + 'GraphQL\\Language\\AST\\NonNullTypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php', + 'GraphQL\\Language\\AST\\NullValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NullValueNode.php', + 'GraphQL\\Language\\AST\\ObjectFieldNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectFieldNode.php', + 'GraphQL\\Language\\AST\\ObjectTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\ObjectTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\ObjectValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php', + 'GraphQL\\Language\\AST\\OperationDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php', + 'GraphQL\\Language\\AST\\OperationTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\ScalarTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ScalarTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\ScalarTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\SchemaDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php', + 'GraphQL\\Language\\AST\\SchemaTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\SelectionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SelectionNode.php', + 'GraphQL\\Language\\AST\\SelectionSetNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SelectionSetNode.php', + 'GraphQL\\Language\\AST\\StringValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/StringValueNode.php', + 'GraphQL\\Language\\AST\\TypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\TypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeExtensionNode.php', + 'GraphQL\\Language\\AST\\TypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeNode.php', + 'GraphQL\\Language\\AST\\TypeSystemDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeSystemDefinitionNode.php', + 'GraphQL\\Language\\AST\\UnionTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/UnionTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\UnionTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\ValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ValueNode.php', + 'GraphQL\\Language\\AST\\VariableDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/VariableDefinitionNode.php', + 'GraphQL\\Language\\AST\\VariableNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/VariableNode.php', + 'GraphQL\\Language\\DirectiveLocation' => $vendorDir . '/webonyx/graphql-php/src/Language/DirectiveLocation.php', + 'GraphQL\\Language\\Lexer' => $vendorDir . '/webonyx/graphql-php/src/Language/Lexer.php', + 'GraphQL\\Language\\Parser' => $vendorDir . '/webonyx/graphql-php/src/Language/Parser.php', + 'GraphQL\\Language\\Printer' => $vendorDir . '/webonyx/graphql-php/src/Language/Printer.php', + 'GraphQL\\Language\\Source' => $vendorDir . '/webonyx/graphql-php/src/Language/Source.php', + 'GraphQL\\Language\\SourceLocation' => $vendorDir . '/webonyx/graphql-php/src/Language/SourceLocation.php', + 'GraphQL\\Language\\Token' => $vendorDir . '/webonyx/graphql-php/src/Language/Token.php', + 'GraphQL\\Language\\Visitor' => $vendorDir . '/webonyx/graphql-php/src/Language/Visitor.php', + 'GraphQL\\Language\\VisitorOperation' => $vendorDir . '/webonyx/graphql-php/src/Language/VisitorOperation.php', + 'GraphQL\\Server\\Helper' => $vendorDir . '/webonyx/graphql-php/src/Server/Helper.php', + 'GraphQL\\Server\\OperationParams' => $vendorDir . '/webonyx/graphql-php/src/Server/OperationParams.php', + 'GraphQL\\Server\\RequestError' => $vendorDir . '/webonyx/graphql-php/src/Server/RequestError.php', + 'GraphQL\\Server\\ServerConfig' => $vendorDir . '/webonyx/graphql-php/src/Server/ServerConfig.php', + 'GraphQL\\Server\\StandardServer' => $vendorDir . '/webonyx/graphql-php/src/Server/StandardServer.php', + 'GraphQL\\Type\\Definition\\AbstractType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/AbstractType.php', + 'GraphQL\\Type\\Definition\\BooleanType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/BooleanType.php', + 'GraphQL\\Type\\Definition\\CompositeType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/CompositeType.php', + 'GraphQL\\Type\\Definition\\CustomScalarType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/CustomScalarType.php', + 'GraphQL\\Type\\Definition\\Directive' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/Directive.php', + 'GraphQL\\Type\\Definition\\EnumType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/EnumType.php', + 'GraphQL\\Type\\Definition\\EnumValueDefinition' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php', + 'GraphQL\\Type\\Definition\\FieldArgument' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/FieldArgument.php', + 'GraphQL\\Type\\Definition\\FieldDefinition' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php', + 'GraphQL\\Type\\Definition\\FloatType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/FloatType.php', + 'GraphQL\\Type\\Definition\\HasFieldsType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php', + 'GraphQL\\Type\\Definition\\IDType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/IDType.php', + 'GraphQL\\Type\\Definition\\ImplementingType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ImplementingType.php', + 'GraphQL\\Type\\Definition\\InputObjectField' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InputObjectField.php', + 'GraphQL\\Type\\Definition\\InputObjectType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InputObjectType.php', + 'GraphQL\\Type\\Definition\\InputType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InputType.php', + 'GraphQL\\Type\\Definition\\IntType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/IntType.php', + 'GraphQL\\Type\\Definition\\InterfaceType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InterfaceType.php', + 'GraphQL\\Type\\Definition\\LeafType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/LeafType.php', + 'GraphQL\\Type\\Definition\\ListOfType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ListOfType.php', + 'GraphQL\\Type\\Definition\\NamedType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/NamedType.php', + 'GraphQL\\Type\\Definition\\NonNull' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/NonNull.php', + 'GraphQL\\Type\\Definition\\NullableType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/NullableType.php', + 'GraphQL\\Type\\Definition\\ObjectType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ObjectType.php', + 'GraphQL\\Type\\Definition\\OutputType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/OutputType.php', + 'GraphQL\\Type\\Definition\\QueryPlan' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/QueryPlan.php', + 'GraphQL\\Type\\Definition\\ResolveInfo' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php', + 'GraphQL\\Type\\Definition\\ScalarType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ScalarType.php', + 'GraphQL\\Type\\Definition\\StringType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/StringType.php', + 'GraphQL\\Type\\Definition\\Type' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/Type.php', + 'GraphQL\\Type\\Definition\\TypeWithFields' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php', + 'GraphQL\\Type\\Definition\\UnionType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/UnionType.php', + 'GraphQL\\Type\\Definition\\UnmodifiedType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php', + 'GraphQL\\Type\\Definition\\UnresolvedFieldDefinition' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/UnresolvedFieldDefinition.php', + 'GraphQL\\Type\\Definition\\WrappingType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/WrappingType.php', + 'GraphQL\\Type\\Introspection' => $vendorDir . '/webonyx/graphql-php/src/Type/Introspection.php', + 'GraphQL\\Type\\Schema' => $vendorDir . '/webonyx/graphql-php/src/Type/Schema.php', + 'GraphQL\\Type\\SchemaConfig' => $vendorDir . '/webonyx/graphql-php/src/Type/SchemaConfig.php', + 'GraphQL\\Type\\SchemaValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Type/SchemaValidationContext.php', + 'GraphQL\\Type\\TypeKind' => $vendorDir . '/webonyx/graphql-php/src/Type/TypeKind.php', + 'GraphQL\\Type\\Validation\\InputObjectCircularRefs' => $vendorDir . '/webonyx/graphql-php/src/Type/Validation/InputObjectCircularRefs.php', + 'GraphQL\\Utils\\AST' => $vendorDir . '/webonyx/graphql-php/src/Utils/AST.php', + 'GraphQL\\Utils\\ASTDefinitionBuilder' => $vendorDir . '/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php', + 'GraphQL\\Utils\\BlockString' => $vendorDir . '/webonyx/graphql-php/src/Utils/BlockString.php', + 'GraphQL\\Utils\\BreakingChangesFinder' => $vendorDir . '/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php', + 'GraphQL\\Utils\\BuildClientSchema' => $vendorDir . '/webonyx/graphql-php/src/Utils/BuildClientSchema.php', + 'GraphQL\\Utils\\BuildSchema' => $vendorDir . '/webonyx/graphql-php/src/Utils/BuildSchema.php', + 'GraphQL\\Utils\\InterfaceImplementations' => $vendorDir . '/webonyx/graphql-php/src/Utils/InterfaceImplementations.php', + 'GraphQL\\Utils\\MixedStore' => $vendorDir . '/webonyx/graphql-php/src/Utils/MixedStore.php', + 'GraphQL\\Utils\\PairSet' => $vendorDir . '/webonyx/graphql-php/src/Utils/PairSet.php', + 'GraphQL\\Utils\\SchemaExtender' => $vendorDir . '/webonyx/graphql-php/src/Utils/SchemaExtender.php', + 'GraphQL\\Utils\\SchemaPrinter' => $vendorDir . '/webonyx/graphql-php/src/Utils/SchemaPrinter.php', + 'GraphQL\\Utils\\TypeComparators' => $vendorDir . '/webonyx/graphql-php/src/Utils/TypeComparators.php', + 'GraphQL\\Utils\\TypeInfo' => $vendorDir . '/webonyx/graphql-php/src/Utils/TypeInfo.php', + 'GraphQL\\Utils\\Utils' => $vendorDir . '/webonyx/graphql-php/src/Utils/Utils.php', + 'GraphQL\\Utils\\Value' => $vendorDir . '/webonyx/graphql-php/src/Utils/Value.php', + 'GraphQL\\Validator\\ASTValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Validator/ASTValidationContext.php', + 'GraphQL\\Validator\\DocumentValidator' => $vendorDir . '/webonyx/graphql-php/src/Validator/DocumentValidator.php', + 'GraphQL\\Validator\\Rules\\CustomValidationRule' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php', + 'GraphQL\\Validator\\Rules\\DisableIntrospection' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php', + 'GraphQL\\Validator\\Rules\\ExecutableDefinitions' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php', + 'GraphQL\\Validator\\Rules\\FieldsOnCorrectType' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php', + 'GraphQL\\Validator\\Rules\\FragmentsOnCompositeTypes' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php', + 'GraphQL\\Validator\\Rules\\KnownArgumentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php', + 'GraphQL\\Validator\\Rules\\KnownArgumentNamesOnDirectives' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php', + 'GraphQL\\Validator\\Rules\\KnownDirectives' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php', + 'GraphQL\\Validator\\Rules\\KnownFragmentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php', + 'GraphQL\\Validator\\Rules\\KnownTypeNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php', + 'GraphQL\\Validator\\Rules\\LoneAnonymousOperation' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php', + 'GraphQL\\Validator\\Rules\\LoneSchemaDefinition' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php', + 'GraphQL\\Validator\\Rules\\NoFragmentCycles' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php', + 'GraphQL\\Validator\\Rules\\NoUndefinedVariables' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php', + 'GraphQL\\Validator\\Rules\\NoUnusedFragments' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php', + 'GraphQL\\Validator\\Rules\\NoUnusedVariables' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php', + 'GraphQL\\Validator\\Rules\\OverlappingFieldsCanBeMerged' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php', + 'GraphQL\\Validator\\Rules\\PossibleFragmentSpreads' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php', + 'GraphQL\\Validator\\Rules\\ProvidedRequiredArguments' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php', + 'GraphQL\\Validator\\Rules\\ProvidedRequiredArgumentsOnDirectives' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php', + 'GraphQL\\Validator\\Rules\\QueryComplexity' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php', + 'GraphQL\\Validator\\Rules\\QueryDepth' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php', + 'GraphQL\\Validator\\Rules\\QuerySecurityRule' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php', + 'GraphQL\\Validator\\Rules\\ScalarLeafs' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php', + 'GraphQL\\Validator\\Rules\\SingleFieldSubscription' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php', + 'GraphQL\\Validator\\Rules\\UniqueArgumentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php', + 'GraphQL\\Validator\\Rules\\UniqueDirectivesPerLocation' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php', + 'GraphQL\\Validator\\Rules\\UniqueFragmentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php', + 'GraphQL\\Validator\\Rules\\UniqueInputFieldNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php', + 'GraphQL\\Validator\\Rules\\UniqueOperationNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php', + 'GraphQL\\Validator\\Rules\\UniqueVariableNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php', + 'GraphQL\\Validator\\Rules\\ValidationRule' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php', + 'GraphQL\\Validator\\Rules\\ValuesOfCorrectType' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php', + 'GraphQL\\Validator\\Rules\\VariablesAreInputTypes' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php', + 'GraphQL\\Validator\\Rules\\VariablesInAllowedPosition' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php', + 'GraphQL\\Validator\\SDLValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Validator/SDLValidationContext.php', + 'GraphQL\\Validator\\ValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Validator/ValidationContext.php', + 'WPGraphQL\\Admin\\Admin' => $baseDir . '/src/Admin/Admin.php', + 'WPGraphQL\\Admin\\GraphiQL\\GraphiQL' => $baseDir . '/src/Admin/GraphiQL/GraphiQL.php', + 'WPGraphQL\\Admin\\Settings\\Settings' => $baseDir . '/src/Admin/Settings/Settings.php', + 'WPGraphQL\\Admin\\Settings\\SettingsRegistry' => $baseDir . '/src/Admin/Settings/SettingsRegistry.php', + 'WPGraphQL\\AppContext' => $baseDir . '/src/AppContext.php', + 'WPGraphQL\\Connection\\Comments' => $baseDir . '/src/Connection/Comments.php', + 'WPGraphQL\\Connection\\MenuItems' => $baseDir . '/src/Connection/MenuItems.php', + 'WPGraphQL\\Connection\\PostObjects' => $baseDir . '/src/Connection/PostObjects.php', + 'WPGraphQL\\Connection\\Taxonomies' => $baseDir . '/src/Connection/Taxonomies.php', + 'WPGraphQL\\Connection\\TermObjects' => $baseDir . '/src/Connection/TermObjects.php', + 'WPGraphQL\\Connection\\Users' => $baseDir . '/src/Connection/Users.php', + 'WPGraphQL\\Data\\CommentMutation' => $baseDir . '/src/Data/CommentMutation.php', + 'WPGraphQL\\Data\\Config' => $baseDir . '/src/Data/Config.php', + 'WPGraphQL\\Data\\Connection\\AbstractConnectionResolver' => $baseDir . '/src/Data/Connection/AbstractConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\CommentConnectionResolver' => $baseDir . '/src/Data/Connection/CommentConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\ContentTypeConnectionResolver' => $baseDir . '/src/Data/Connection/ContentTypeConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\EnqueuedScriptsConnectionResolver' => $baseDir . '/src/Data/Connection/EnqueuedScriptsConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\EnqueuedStylesheetConnectionResolver' => $baseDir . '/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\MenuConnectionResolver' => $baseDir . '/src/Data/Connection/MenuConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\MenuItemConnectionResolver' => $baseDir . '/src/Data/Connection/MenuItemConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\PluginConnectionResolver' => $baseDir . '/src/Data/Connection/PluginConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\PostObjectConnectionResolver' => $baseDir . '/src/Data/Connection/PostObjectConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\TaxonomyConnectionResolver' => $baseDir . '/src/Data/Connection/TaxonomyConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\TermObjectConnectionResolver' => $baseDir . '/src/Data/Connection/TermObjectConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\ThemeConnectionResolver' => $baseDir . '/src/Data/Connection/ThemeConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\UserConnectionResolver' => $baseDir . '/src/Data/Connection/UserConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\UserRoleConnectionResolver' => $baseDir . '/src/Data/Connection/UserRoleConnectionResolver.php', + 'WPGraphQL\\Data\\Cursor\\AbstractCursor' => $baseDir . '/src/Data/Cursor/AbstractCursor.php', + 'WPGraphQL\\Data\\Cursor\\CommentObjectCursor' => $baseDir . '/src/Data/Cursor/CommentObjectCursor.php', + 'WPGraphQL\\Data\\Cursor\\CursorBuilder' => $baseDir . '/src/Data/Cursor/CursorBuilder.php', + 'WPGraphQL\\Data\\Cursor\\PostObjectCursor' => $baseDir . '/src/Data/Cursor/PostObjectCursor.php', + 'WPGraphQL\\Data\\Cursor\\TermObjectCursor' => $baseDir . '/src/Data/Cursor/TermObjectCursor.php', + 'WPGraphQL\\Data\\Cursor\\UserCursor' => $baseDir . '/src/Data/Cursor/UserCursor.php', + 'WPGraphQL\\Data\\DataSource' => $baseDir . '/src/Data/DataSource.php', + 'WPGraphQL\\Data\\Loader\\AbstractDataLoader' => $baseDir . '/src/Data/Loader/AbstractDataLoader.php', + 'WPGraphQL\\Data\\Loader\\CommentAuthorLoader' => $baseDir . '/src/Data/Loader/CommentAuthorLoader.php', + 'WPGraphQL\\Data\\Loader\\CommentLoader' => $baseDir . '/src/Data/Loader/CommentLoader.php', + 'WPGraphQL\\Data\\Loader\\EnqueuedScriptLoader' => $baseDir . '/src/Data/Loader/EnqueuedScriptLoader.php', + 'WPGraphQL\\Data\\Loader\\EnqueuedStylesheetLoader' => $baseDir . '/src/Data/Loader/EnqueuedStylesheetLoader.php', + 'WPGraphQL\\Data\\Loader\\PluginLoader' => $baseDir . '/src/Data/Loader/PluginLoader.php', + 'WPGraphQL\\Data\\Loader\\PostObjectLoader' => $baseDir . '/src/Data/Loader/PostObjectLoader.php', + 'WPGraphQL\\Data\\Loader\\PostTypeLoader' => $baseDir . '/src/Data/Loader/PostTypeLoader.php', + 'WPGraphQL\\Data\\Loader\\TaxonomyLoader' => $baseDir . '/src/Data/Loader/TaxonomyLoader.php', + 'WPGraphQL\\Data\\Loader\\TermObjectLoader' => $baseDir . '/src/Data/Loader/TermObjectLoader.php', + 'WPGraphQL\\Data\\Loader\\ThemeLoader' => $baseDir . '/src/Data/Loader/ThemeLoader.php', + 'WPGraphQL\\Data\\Loader\\UserLoader' => $baseDir . '/src/Data/Loader/UserLoader.php', + 'WPGraphQL\\Data\\Loader\\UserRoleLoader' => $baseDir . '/src/Data/Loader/UserRoleLoader.php', + 'WPGraphQL\\Data\\MediaItemMutation' => $baseDir . '/src/Data/MediaItemMutation.php', + 'WPGraphQL\\Data\\NodeResolver' => $baseDir . '/src/Data/NodeResolver.php', + 'WPGraphQL\\Data\\PostObjectMutation' => $baseDir . '/src/Data/PostObjectMutation.php', + 'WPGraphQL\\Data\\TermObjectMutation' => $baseDir . '/src/Data/TermObjectMutation.php', + 'WPGraphQL\\Data\\UserMutation' => $baseDir . '/src/Data/UserMutation.php', + 'WPGraphQL\\Model\\Avatar' => $baseDir . '/src/Model/Avatar.php', + 'WPGraphQL\\Model\\Comment' => $baseDir . '/src/Model/Comment.php', + 'WPGraphQL\\Model\\CommentAuthor' => $baseDir . '/src/Model/CommentAuthor.php', + 'WPGraphQL\\Model\\Menu' => $baseDir . '/src/Model/Menu.php', + 'WPGraphQL\\Model\\MenuItem' => $baseDir . '/src/Model/MenuItem.php', + 'WPGraphQL\\Model\\Model' => $baseDir . '/src/Model/Model.php', + 'WPGraphQL\\Model\\Plugin' => $baseDir . '/src/Model/Plugin.php', + 'WPGraphQL\\Model\\Post' => $baseDir . '/src/Model/Post.php', + 'WPGraphQL\\Model\\PostType' => $baseDir . '/src/Model/PostType.php', + 'WPGraphQL\\Model\\Taxonomy' => $baseDir . '/src/Model/Taxonomy.php', + 'WPGraphQL\\Model\\Term' => $baseDir . '/src/Model/Term.php', + 'WPGraphQL\\Model\\Theme' => $baseDir . '/src/Model/Theme.php', + 'WPGraphQL\\Model\\User' => $baseDir . '/src/Model/User.php', + 'WPGraphQL\\Model\\UserRole' => $baseDir . '/src/Model/UserRole.php', + 'WPGraphQL\\Mutation\\CommentCreate' => $baseDir . '/src/Mutation/CommentCreate.php', + 'WPGraphQL\\Mutation\\CommentDelete' => $baseDir . '/src/Mutation/CommentDelete.php', + 'WPGraphQL\\Mutation\\CommentRestore' => $baseDir . '/src/Mutation/CommentRestore.php', + 'WPGraphQL\\Mutation\\CommentUpdate' => $baseDir . '/src/Mutation/CommentUpdate.php', + 'WPGraphQL\\Mutation\\MediaItemCreate' => $baseDir . '/src/Mutation/MediaItemCreate.php', + 'WPGraphQL\\Mutation\\MediaItemDelete' => $baseDir . '/src/Mutation/MediaItemDelete.php', + 'WPGraphQL\\Mutation\\MediaItemUpdate' => $baseDir . '/src/Mutation/MediaItemUpdate.php', + 'WPGraphQL\\Mutation\\PostObjectCreate' => $baseDir . '/src/Mutation/PostObjectCreate.php', + 'WPGraphQL\\Mutation\\PostObjectDelete' => $baseDir . '/src/Mutation/PostObjectDelete.php', + 'WPGraphQL\\Mutation\\PostObjectUpdate' => $baseDir . '/src/Mutation/PostObjectUpdate.php', + 'WPGraphQL\\Mutation\\ResetUserPassword' => $baseDir . '/src/Mutation/ResetUserPassword.php', + 'WPGraphQL\\Mutation\\SendPasswordResetEmail' => $baseDir . '/src/Mutation/SendPasswordResetEmail.php', + 'WPGraphQL\\Mutation\\TermObjectCreate' => $baseDir . '/src/Mutation/TermObjectCreate.php', + 'WPGraphQL\\Mutation\\TermObjectDelete' => $baseDir . '/src/Mutation/TermObjectDelete.php', + 'WPGraphQL\\Mutation\\TermObjectUpdate' => $baseDir . '/src/Mutation/TermObjectUpdate.php', + 'WPGraphQL\\Mutation\\UpdateSettings' => $baseDir . '/src/Mutation/UpdateSettings.php', + 'WPGraphQL\\Mutation\\UserCreate' => $baseDir . '/src/Mutation/UserCreate.php', + 'WPGraphQL\\Mutation\\UserDelete' => $baseDir . '/src/Mutation/UserDelete.php', + 'WPGraphQL\\Mutation\\UserRegister' => $baseDir . '/src/Mutation/UserRegister.php', + 'WPGraphQL\\Mutation\\UserUpdate' => $baseDir . '/src/Mutation/UserUpdate.php', + 'WPGraphQL\\Registry\\SchemaRegistry' => $baseDir . '/src/Registry/SchemaRegistry.php', + 'WPGraphQL\\Registry\\TypeRegistry' => $baseDir . '/src/Registry/TypeRegistry.php', + 'WPGraphQL\\Registry\\Utils\\PostObject' => $baseDir . '/src/Registry/Utils/PostObject.php', + 'WPGraphQL\\Registry\\Utils\\TermObject' => $baseDir . '/src/Registry/Utils/TermObject.php', + 'WPGraphQL\\Request' => $baseDir . '/src/Request.php', + 'WPGraphQL\\Router' => $baseDir . '/src/Router.php', + 'WPGraphQL\\Server\\ValidationRules\\DisableIntrospection' => $baseDir . '/src/Server/ValidationRules/DisableIntrospection.php', + 'WPGraphQL\\Server\\ValidationRules\\QueryDepth' => $baseDir . '/src/Server/ValidationRules/QueryDepth.php', + 'WPGraphQL\\Server\\ValidationRules\\RequireAuthentication' => $baseDir . '/src/Server/ValidationRules/RequireAuthentication.php', + 'WPGraphQL\\Server\\WPHelper' => $baseDir . '/src/Server/WPHelper.php', + 'WPGraphQL\\Type\\Connection\\Comments' => $baseDir . '/src/Type/Connection/Comments.php', + 'WPGraphQL\\Type\\Connection\\MenuItems' => $baseDir . '/src/Type/Connection/MenuItems.php', + 'WPGraphQL\\Type\\Connection\\PostObjects' => $baseDir . '/src/Type/Connection/PostObjects.php', + 'WPGraphQL\\Type\\Connection\\Taxonomies' => $baseDir . '/src/Type/Connection/Taxonomies.php', + 'WPGraphQL\\Type\\Connection\\TermObjects' => $baseDir . '/src/Type/Connection/TermObjects.php', + 'WPGraphQL\\Type\\Connection\\Users' => $baseDir . '/src/Type/Connection/Users.php', + 'WPGraphQL\\Type\\Enum\\AvatarRatingEnum' => $baseDir . '/src/Type/Enum/AvatarRatingEnum.php', + 'WPGraphQL\\Type\\Enum\\CommentNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/CommentNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\CommentStatusEnum' => $baseDir . '/src/Type/Enum/CommentStatusEnum.php', + 'WPGraphQL\\Type\\Enum\\CommentsConnectionOrderbyEnum' => $baseDir . '/src/Type/Enum/CommentsConnectionOrderbyEnum.php', + 'WPGraphQL\\Type\\Enum\\ContentNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/ContentNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\ContentTypeEnum' => $baseDir . '/src/Type/Enum/ContentTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\ContentTypeIdTypeEnum' => $baseDir . '/src/Type/Enum/ContentTypeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\MediaItemSizeEnum' => $baseDir . '/src/Type/Enum/MediaItemSizeEnum.php', + 'WPGraphQL\\Type\\Enum\\MediaItemStatusEnum' => $baseDir . '/src/Type/Enum/MediaItemStatusEnum.php', + 'WPGraphQL\\Type\\Enum\\MenuItemNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/MenuItemNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\MenuLocationEnum' => $baseDir . '/src/Type/Enum/MenuLocationEnum.php', + 'WPGraphQL\\Type\\Enum\\MenuNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/MenuNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\MimeTypeEnum' => $baseDir . '/src/Type/Enum/MimeTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\OrderEnum' => $baseDir . '/src/Type/Enum/OrderEnum.php', + 'WPGraphQL\\Type\\Enum\\PluginStatusEnum' => $baseDir . '/src/Type/Enum/PluginStatusEnum.php', + 'WPGraphQL\\Type\\Enum\\PostObjectFieldFormatEnum' => $baseDir . '/src/Type/Enum/PostObjectFieldFormatEnum.php', + 'WPGraphQL\\Type\\Enum\\PostObjectsConnectionDateColumnEnum' => $baseDir . '/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php', + 'WPGraphQL\\Type\\Enum\\PostObjectsConnectionOrderbyEnum' => $baseDir . '/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php', + 'WPGraphQL\\Type\\Enum\\PostStatusEnum' => $baseDir . '/src/Type/Enum/PostStatusEnum.php', + 'WPGraphQL\\Type\\Enum\\RelationEnum' => $baseDir . '/src/Type/Enum/RelationEnum.php', + 'WPGraphQL\\Type\\Enum\\TaxonomyEnum' => $baseDir . '/src/Type/Enum/TaxonomyEnum.php', + 'WPGraphQL\\Type\\Enum\\TaxonomyIdTypeEnum' => $baseDir . '/src/Type/Enum/TaxonomyIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\TermNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/TermNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\TermObjectsConnectionOrderbyEnum' => $baseDir . '/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php', + 'WPGraphQL\\Type\\Enum\\TimezoneEnum' => $baseDir . '/src/Type/Enum/TimezoneEnum.php', + 'WPGraphQL\\Type\\Enum\\UserNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/UserNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\UserRoleEnum' => $baseDir . '/src/Type/Enum/UserRoleEnum.php', + 'WPGraphQL\\Type\\Enum\\UsersConnectionOrderbyEnum' => $baseDir . '/src/Type/Enum/UsersConnectionOrderbyEnum.php', + 'WPGraphQL\\Type\\Enum\\UsersConnectionSearchColumnEnum' => $baseDir . '/src/Type/Enum/UsersConnectionSearchColumnEnum.php', + 'WPGraphQL\\Type\\Input\\DateInput' => $baseDir . '/src/Type/Input/DateInput.php', + 'WPGraphQL\\Type\\Input\\DateQueryInput' => $baseDir . '/src/Type/Input/DateQueryInput.php', + 'WPGraphQL\\Type\\Input\\PostObjectsConnectionOrderbyInput' => $baseDir . '/src/Type/Input/PostObjectsConnectionOrderbyInput.php', + 'WPGraphQL\\Type\\Input\\UsersConnectionOrderbyInput' => $baseDir . '/src/Type/Input/UsersConnectionOrderbyInput.php', + 'WPGraphQL\\Type\\InterfaceType\\Commenter' => $baseDir . '/src/Type/InterfaceType/Commenter.php', + 'WPGraphQL\\Type\\InterfaceType\\Connection' => $baseDir . '/src/Type/InterfaceType/Connection.php', + 'WPGraphQL\\Type\\InterfaceType\\ContentNode' => $baseDir . '/src/Type/InterfaceType/ContentNode.php', + 'WPGraphQL\\Type\\InterfaceType\\ContentTemplate' => $baseDir . '/src/Type/InterfaceType/ContentTemplate.php', + 'WPGraphQL\\Type\\InterfaceType\\DatabaseIdentifier' => $baseDir . '/src/Type/InterfaceType/DatabaseIdentifier.php', + 'WPGraphQL\\Type\\InterfaceType\\Edge' => $baseDir . '/src/Type/InterfaceType/Edge.php', + 'WPGraphQL\\Type\\InterfaceType\\EnqueuedAsset' => $baseDir . '/src/Type/InterfaceType/EnqueuedAsset.php', + 'WPGraphQL\\Type\\InterfaceType\\HierarchicalContentNode' => $baseDir . '/src/Type/InterfaceType/HierarchicalContentNode.php', + 'WPGraphQL\\Type\\InterfaceType\\HierarchicalNode' => $baseDir . '/src/Type/InterfaceType/HierarchicalNode.php', + 'WPGraphQL\\Type\\InterfaceType\\HierarchicalTermNode' => $baseDir . '/src/Type/InterfaceType/HierarchicalTermNode.php', + 'WPGraphQL\\Type\\InterfaceType\\MenuItemLinkable' => $baseDir . '/src/Type/InterfaceType/MenuItemLinkable.php', + 'WPGraphQL\\Type\\InterfaceType\\Node' => $baseDir . '/src/Type/InterfaceType/Node.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithAuthor' => $baseDir . '/src/Type/InterfaceType/NodeWithAuthor.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithComments' => $baseDir . '/src/Type/InterfaceType/NodeWithComments.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithContentEditor' => $baseDir . '/src/Type/InterfaceType/NodeWithContentEditor.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithExcerpt' => $baseDir . '/src/Type/InterfaceType/NodeWithExcerpt.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithFeaturedImage' => $baseDir . '/src/Type/InterfaceType/NodeWithFeaturedImage.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithPageAttributes' => $baseDir . '/src/Type/InterfaceType/NodeWithPageAttributes.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithRevisions' => $baseDir . '/src/Type/InterfaceType/NodeWithRevisions.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithTemplate' => $baseDir . '/src/Type/InterfaceType/NodeWithTemplate.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithTitle' => $baseDir . '/src/Type/InterfaceType/NodeWithTitle.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithTrackbacks' => $baseDir . '/src/Type/InterfaceType/NodeWithTrackbacks.php', + 'WPGraphQL\\Type\\InterfaceType\\OneToOneConnection' => $baseDir . '/src/Type/InterfaceType/OneToOneConnection.php', + 'WPGraphQL\\Type\\InterfaceType\\PageInfo' => $baseDir . '/src/Type/InterfaceType/PageInfo.php', + 'WPGraphQL\\Type\\InterfaceType\\Previewable' => $baseDir . '/src/Type/InterfaceType/Previewable.php', + 'WPGraphQL\\Type\\InterfaceType\\TermNode' => $baseDir . '/src/Type/InterfaceType/TermNode.php', + 'WPGraphQL\\Type\\InterfaceType\\UniformResourceIdentifiable' => $baseDir . '/src/Type/InterfaceType/UniformResourceIdentifiable.php', + 'WPGraphQL\\Type\\ObjectType\\Avatar' => $baseDir . '/src/Type/ObjectType/Avatar.php', + 'WPGraphQL\\Type\\ObjectType\\Comment' => $baseDir . '/src/Type/ObjectType/Comment.php', + 'WPGraphQL\\Type\\ObjectType\\CommentAuthor' => $baseDir . '/src/Type/ObjectType/CommentAuthor.php', + 'WPGraphQL\\Type\\ObjectType\\ContentType' => $baseDir . '/src/Type/ObjectType/ContentType.php', + 'WPGraphQL\\Type\\ObjectType\\EnqueuedScript' => $baseDir . '/src/Type/ObjectType/EnqueuedScript.php', + 'WPGraphQL\\Type\\ObjectType\\EnqueuedStylesheet' => $baseDir . '/src/Type/ObjectType/EnqueuedStylesheet.php', + 'WPGraphQL\\Type\\ObjectType\\MediaDetails' => $baseDir . '/src/Type/ObjectType/MediaDetails.php', + 'WPGraphQL\\Type\\ObjectType\\MediaItemMeta' => $baseDir . '/src/Type/ObjectType/MediaItemMeta.php', + 'WPGraphQL\\Type\\ObjectType\\MediaSize' => $baseDir . '/src/Type/ObjectType/MediaSize.php', + 'WPGraphQL\\Type\\ObjectType\\Menu' => $baseDir . '/src/Type/ObjectType/Menu.php', + 'WPGraphQL\\Type\\ObjectType\\MenuItem' => $baseDir . '/src/Type/ObjectType/MenuItem.php', + 'WPGraphQL\\Type\\ObjectType\\Plugin' => $baseDir . '/src/Type/ObjectType/Plugin.php', + 'WPGraphQL\\Type\\ObjectType\\PostObject' => $baseDir . '/src/Type/ObjectType/PostObject.php', + 'WPGraphQL\\Type\\ObjectType\\PostTypeLabelDetails' => $baseDir . '/src/Type/ObjectType/PostTypeLabelDetails.php', + 'WPGraphQL\\Type\\ObjectType\\RootMutation' => $baseDir . '/src/Type/ObjectType/RootMutation.php', + 'WPGraphQL\\Type\\ObjectType\\RootQuery' => $baseDir . '/src/Type/ObjectType/RootQuery.php', + 'WPGraphQL\\Type\\ObjectType\\SettingGroup' => $baseDir . '/src/Type/ObjectType/SettingGroup.php', + 'WPGraphQL\\Type\\ObjectType\\Settings' => $baseDir . '/src/Type/ObjectType/Settings.php', + 'WPGraphQL\\Type\\ObjectType\\Taxonomy' => $baseDir . '/src/Type/ObjectType/Taxonomy.php', + 'WPGraphQL\\Type\\ObjectType\\TermObject' => $baseDir . '/src/Type/ObjectType/TermObject.php', + 'WPGraphQL\\Type\\ObjectType\\Theme' => $baseDir . '/src/Type/ObjectType/Theme.php', + 'WPGraphQL\\Type\\ObjectType\\User' => $baseDir . '/src/Type/ObjectType/User.php', + 'WPGraphQL\\Type\\ObjectType\\UserRole' => $baseDir . '/src/Type/ObjectType/UserRole.php', + 'WPGraphQL\\Type\\Union\\MenuItemObjectUnion' => $baseDir . '/src/Type/Union/MenuItemObjectUnion.php', + 'WPGraphQL\\Type\\Union\\PostObjectUnion' => $baseDir . '/src/Type/Union/PostObjectUnion.php', + 'WPGraphQL\\Type\\Union\\TermObjectUnion' => $baseDir . '/src/Type/Union/TermObjectUnion.php', + 'WPGraphQL\\Type\\WPConnectionType' => $baseDir . '/src/Type/WPConnectionType.php', + 'WPGraphQL\\Type\\WPEnumType' => $baseDir . '/src/Type/WPEnumType.php', + 'WPGraphQL\\Type\\WPInputObjectType' => $baseDir . '/src/Type/WPInputObjectType.php', + 'WPGraphQL\\Type\\WPInterfaceTrait' => $baseDir . '/src/Type/WPInterfaceTrait.php', + 'WPGraphQL\\Type\\WPInterfaceType' => $baseDir . '/src/Type/WPInterfaceType.php', + 'WPGraphQL\\Type\\WPMutationType' => $baseDir . '/src/Type/WPMutationType.php', + 'WPGraphQL\\Type\\WPObjectType' => $baseDir . '/src/Type/WPObjectType.php', + 'WPGraphQL\\Type\\WPScalar' => $baseDir . '/src/Type/WPScalar.php', + 'WPGraphQL\\Type\\WPUnionType' => $baseDir . '/src/Type/WPUnionType.php', + 'WPGraphQL\\Types' => $baseDir . '/src/Types.php', + 'WPGraphQL\\Utils\\DebugLog' => $baseDir . '/src/Utils/DebugLog.php', + 'WPGraphQL\\Utils\\InstrumentSchema' => $baseDir . '/src/Utils/InstrumentSchema.php', + 'WPGraphQL\\Utils\\Preview' => $baseDir . '/src/Utils/Preview.php', + 'WPGraphQL\\Utils\\QueryAnalyzer' => $baseDir . '/src/Utils/QueryAnalyzer.php', + 'WPGraphQL\\Utils\\QueryLog' => $baseDir . '/src/Utils/QueryLog.php', + 'WPGraphQL\\Utils\\Tracing' => $baseDir . '/src/Utils/Tracing.php', + 'WPGraphQL\\Utils\\Utils' => $baseDir . '/src/Utils/Utils.php', + 'WPGraphQL\\WPSchema' => $baseDir . '/src/WPSchema.php', +); diff --git a/lib/wp-graphql-1.17.0/vendor/composer/autoload_namespaces.php b/lib/wp-graphql-1.17.0/vendor/composer/autoload_namespaces.php new file mode 100644 index 00000000..15a2ff3a --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/composer/autoload_namespaces.php @@ -0,0 +1,9 @@ + array($baseDir . '/src'), + 'GraphQL\\' => array($vendorDir . '/webonyx/graphql-php/src'), + 'Appsero\\' => array($vendorDir . '/appsero/client/src'), +); diff --git a/lib/wp-graphql-1.17.0/vendor/composer/autoload_real.php b/lib/wp-graphql-1.17.0/vendor/composer/autoload_real.php new file mode 100644 index 00000000..2d674fef --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/composer/autoload_real.php @@ -0,0 +1,38 @@ +register(true); + + return $loader; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/autoload_static.php b/lib/wp-graphql-1.17.0/vendor/composer/autoload_static.php new file mode 100644 index 00000000..3b0d3d8d --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/composer/autoload_static.php @@ -0,0 +1,462 @@ + + array ( + 'WPGraphQL\\' => 10, + ), + 'G' => + array ( + 'GraphQL\\' => 8, + ), + 'A' => + array ( + 'Appsero\\' => 8, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'WPGraphQL\\' => + array ( + 0 => __DIR__ . '/../..' . '/src', + ), + 'GraphQL\\' => + array ( + 0 => __DIR__ . '/..' . '/webonyx/graphql-php/src', + ), + 'Appsero\\' => + array ( + 0 => __DIR__ . '/..' . '/appsero/client/src', + ), + ); + + public static $classMap = array ( + 'Appsero\\Client' => __DIR__ . '/..' . '/appsero/client/src/Client.php', + 'Appsero\\Insights' => __DIR__ . '/..' . '/appsero/client/src/Insights.php', + 'Appsero\\License' => __DIR__ . '/..' . '/appsero/client/src/License.php', + 'Appsero\\Updater' => __DIR__ . '/..' . '/appsero/client/src/Updater.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'GraphQLRelay\\Connection\\ArrayConnection' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Connection/ArrayConnection.php', + 'GraphQLRelay\\Connection\\Connection' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Connection/Connection.php', + 'GraphQLRelay\\Mutation\\Mutation' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Mutation/Mutation.php', + 'GraphQLRelay\\Node\\Node' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Node/Node.php', + 'GraphQLRelay\\Node\\Plural' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Node/Plural.php', + 'GraphQLRelay\\Relay' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Relay.php', + 'GraphQL\\Deferred' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Deferred.php', + 'GraphQL\\Error\\ClientAware' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/ClientAware.php', + 'GraphQL\\Error\\DebugFlag' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/DebugFlag.php', + 'GraphQL\\Error\\Error' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/Error.php', + 'GraphQL\\Error\\FormattedError' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/FormattedError.php', + 'GraphQL\\Error\\InvariantViolation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/InvariantViolation.php', + 'GraphQL\\Error\\SyntaxError' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/SyntaxError.php', + 'GraphQL\\Error\\UserError' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/UserError.php', + 'GraphQL\\Error\\Warning' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/Warning.php', + 'GraphQL\\Exception\\InvalidArgument' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Exception/InvalidArgument.php', + 'GraphQL\\Executor\\ExecutionContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/ExecutionContext.php', + 'GraphQL\\Executor\\ExecutionResult' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/ExecutionResult.php', + 'GraphQL\\Executor\\Executor' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Executor.php', + 'GraphQL\\Executor\\ExecutorImplementation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/ExecutorImplementation.php', + 'GraphQL\\Executor\\Promise\\Adapter\\AmpPromiseAdapter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Adapter/AmpPromiseAdapter.php', + 'GraphQL\\Executor\\Promise\\Adapter\\ReactPromiseAdapter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php', + 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromise' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php', + 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php', + 'GraphQL\\Executor\\Promise\\Promise' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Promise.php', + 'GraphQL\\Executor\\Promise\\PromiseAdapter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php', + 'GraphQL\\Executor\\ReferenceExecutor' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/ReferenceExecutor.php', + 'GraphQL\\Executor\\Values' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Values.php', + 'GraphQL\\Experimental\\Executor\\Collector' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/Collector.php', + 'GraphQL\\Experimental\\Executor\\CoroutineContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php', + 'GraphQL\\Experimental\\Executor\\CoroutineContextShared' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php', + 'GraphQL\\Experimental\\Executor\\CoroutineExecutor' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php', + 'GraphQL\\Experimental\\Executor\\Runtime' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/Runtime.php', + 'GraphQL\\Experimental\\Executor\\Strand' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/Strand.php', + 'GraphQL\\GraphQL' => __DIR__ . '/..' . '/webonyx/graphql-php/src/GraphQL.php', + 'GraphQL\\Language\\AST\\ArgumentNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ArgumentNode.php', + 'GraphQL\\Language\\AST\\BooleanValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/BooleanValueNode.php', + 'GraphQL\\Language\\AST\\DefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/DefinitionNode.php', + 'GraphQL\\Language\\AST\\DirectiveDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/DirectiveDefinitionNode.php', + 'GraphQL\\Language\\AST\\DirectiveNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/DirectiveNode.php', + 'GraphQL\\Language\\AST\\DocumentNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/DocumentNode.php', + 'GraphQL\\Language\\AST\\EnumTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\EnumTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\EnumValueDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php', + 'GraphQL\\Language\\AST\\EnumValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/EnumValueNode.php', + 'GraphQL\\Language\\AST\\ExecutableDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ExecutableDefinitionNode.php', + 'GraphQL\\Language\\AST\\FieldDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FieldDefinitionNode.php', + 'GraphQL\\Language\\AST\\FieldNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FieldNode.php', + 'GraphQL\\Language\\AST\\FloatValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FloatValueNode.php', + 'GraphQL\\Language\\AST\\FragmentDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FragmentDefinitionNode.php', + 'GraphQL\\Language\\AST\\FragmentSpreadNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php', + 'GraphQL\\Language\\AST\\HasSelectionSet' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php', + 'GraphQL\\Language\\AST\\InlineFragmentNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InlineFragmentNode.php', + 'GraphQL\\Language\\AST\\InputObjectTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\InputObjectTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\InputValueDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php', + 'GraphQL\\Language\\AST\\IntValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/IntValueNode.php', + 'GraphQL\\Language\\AST\\InterfaceTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\InterfaceTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\ListTypeNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ListTypeNode.php', + 'GraphQL\\Language\\AST\\ListValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ListValueNode.php', + 'GraphQL\\Language\\AST\\Location' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/Location.php', + 'GraphQL\\Language\\AST\\NameNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NameNode.php', + 'GraphQL\\Language\\AST\\NamedTypeNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NamedTypeNode.php', + 'GraphQL\\Language\\AST\\Node' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/Node.php', + 'GraphQL\\Language\\AST\\NodeKind' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NodeKind.php', + 'GraphQL\\Language\\AST\\NodeList' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NodeList.php', + 'GraphQL\\Language\\AST\\NonNullTypeNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php', + 'GraphQL\\Language\\AST\\NullValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NullValueNode.php', + 'GraphQL\\Language\\AST\\ObjectFieldNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ObjectFieldNode.php', + 'GraphQL\\Language\\AST\\ObjectTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ObjectTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\ObjectTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\ObjectValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php', + 'GraphQL\\Language\\AST\\OperationDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php', + 'GraphQL\\Language\\AST\\OperationTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\ScalarTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ScalarTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\ScalarTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\SchemaDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php', + 'GraphQL\\Language\\AST\\SchemaTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\SelectionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/SelectionNode.php', + 'GraphQL\\Language\\AST\\SelectionSetNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/SelectionSetNode.php', + 'GraphQL\\Language\\AST\\StringValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/StringValueNode.php', + 'GraphQL\\Language\\AST\\TypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/TypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\TypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/TypeExtensionNode.php', + 'GraphQL\\Language\\AST\\TypeNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/TypeNode.php', + 'GraphQL\\Language\\AST\\TypeSystemDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/TypeSystemDefinitionNode.php', + 'GraphQL\\Language\\AST\\UnionTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/UnionTypeDefinitionNode.php', + 'GraphQL\\Language\\AST\\UnionTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php', + 'GraphQL\\Language\\AST\\ValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ValueNode.php', + 'GraphQL\\Language\\AST\\VariableDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/VariableDefinitionNode.php', + 'GraphQL\\Language\\AST\\VariableNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/VariableNode.php', + 'GraphQL\\Language\\DirectiveLocation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/DirectiveLocation.php', + 'GraphQL\\Language\\Lexer' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Lexer.php', + 'GraphQL\\Language\\Parser' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Parser.php', + 'GraphQL\\Language\\Printer' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Printer.php', + 'GraphQL\\Language\\Source' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Source.php', + 'GraphQL\\Language\\SourceLocation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/SourceLocation.php', + 'GraphQL\\Language\\Token' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Token.php', + 'GraphQL\\Language\\Visitor' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Visitor.php', + 'GraphQL\\Language\\VisitorOperation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/VisitorOperation.php', + 'GraphQL\\Server\\Helper' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/Helper.php', + 'GraphQL\\Server\\OperationParams' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/OperationParams.php', + 'GraphQL\\Server\\RequestError' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/RequestError.php', + 'GraphQL\\Server\\ServerConfig' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/ServerConfig.php', + 'GraphQL\\Server\\StandardServer' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/StandardServer.php', + 'GraphQL\\Type\\Definition\\AbstractType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/AbstractType.php', + 'GraphQL\\Type\\Definition\\BooleanType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/BooleanType.php', + 'GraphQL\\Type\\Definition\\CompositeType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/CompositeType.php', + 'GraphQL\\Type\\Definition\\CustomScalarType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/CustomScalarType.php', + 'GraphQL\\Type\\Definition\\Directive' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/Directive.php', + 'GraphQL\\Type\\Definition\\EnumType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/EnumType.php', + 'GraphQL\\Type\\Definition\\EnumValueDefinition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php', + 'GraphQL\\Type\\Definition\\FieldArgument' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/FieldArgument.php', + 'GraphQL\\Type\\Definition\\FieldDefinition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php', + 'GraphQL\\Type\\Definition\\FloatType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/FloatType.php', + 'GraphQL\\Type\\Definition\\HasFieldsType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php', + 'GraphQL\\Type\\Definition\\IDType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/IDType.php', + 'GraphQL\\Type\\Definition\\ImplementingType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ImplementingType.php', + 'GraphQL\\Type\\Definition\\InputObjectField' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/InputObjectField.php', + 'GraphQL\\Type\\Definition\\InputObjectType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/InputObjectType.php', + 'GraphQL\\Type\\Definition\\InputType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/InputType.php', + 'GraphQL\\Type\\Definition\\IntType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/IntType.php', + 'GraphQL\\Type\\Definition\\InterfaceType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/InterfaceType.php', + 'GraphQL\\Type\\Definition\\LeafType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/LeafType.php', + 'GraphQL\\Type\\Definition\\ListOfType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ListOfType.php', + 'GraphQL\\Type\\Definition\\NamedType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/NamedType.php', + 'GraphQL\\Type\\Definition\\NonNull' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/NonNull.php', + 'GraphQL\\Type\\Definition\\NullableType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/NullableType.php', + 'GraphQL\\Type\\Definition\\ObjectType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ObjectType.php', + 'GraphQL\\Type\\Definition\\OutputType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/OutputType.php', + 'GraphQL\\Type\\Definition\\QueryPlan' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/QueryPlan.php', + 'GraphQL\\Type\\Definition\\ResolveInfo' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php', + 'GraphQL\\Type\\Definition\\ScalarType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ScalarType.php', + 'GraphQL\\Type\\Definition\\StringType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/StringType.php', + 'GraphQL\\Type\\Definition\\Type' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/Type.php', + 'GraphQL\\Type\\Definition\\TypeWithFields' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php', + 'GraphQL\\Type\\Definition\\UnionType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/UnionType.php', + 'GraphQL\\Type\\Definition\\UnmodifiedType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php', + 'GraphQL\\Type\\Definition\\UnresolvedFieldDefinition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/UnresolvedFieldDefinition.php', + 'GraphQL\\Type\\Definition\\WrappingType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/WrappingType.php', + 'GraphQL\\Type\\Introspection' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Introspection.php', + 'GraphQL\\Type\\Schema' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Schema.php', + 'GraphQL\\Type\\SchemaConfig' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/SchemaConfig.php', + 'GraphQL\\Type\\SchemaValidationContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/SchemaValidationContext.php', + 'GraphQL\\Type\\TypeKind' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/TypeKind.php', + 'GraphQL\\Type\\Validation\\InputObjectCircularRefs' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Validation/InputObjectCircularRefs.php', + 'GraphQL\\Utils\\AST' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/AST.php', + 'GraphQL\\Utils\\ASTDefinitionBuilder' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php', + 'GraphQL\\Utils\\BlockString' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/BlockString.php', + 'GraphQL\\Utils\\BreakingChangesFinder' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php', + 'GraphQL\\Utils\\BuildClientSchema' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/BuildClientSchema.php', + 'GraphQL\\Utils\\BuildSchema' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/BuildSchema.php', + 'GraphQL\\Utils\\InterfaceImplementations' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/InterfaceImplementations.php', + 'GraphQL\\Utils\\MixedStore' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/MixedStore.php', + 'GraphQL\\Utils\\PairSet' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/PairSet.php', + 'GraphQL\\Utils\\SchemaExtender' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/SchemaExtender.php', + 'GraphQL\\Utils\\SchemaPrinter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/SchemaPrinter.php', + 'GraphQL\\Utils\\TypeComparators' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/TypeComparators.php', + 'GraphQL\\Utils\\TypeInfo' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/TypeInfo.php', + 'GraphQL\\Utils\\Utils' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/Utils.php', + 'GraphQL\\Utils\\Value' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/Value.php', + 'GraphQL\\Validator\\ASTValidationContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/ASTValidationContext.php', + 'GraphQL\\Validator\\DocumentValidator' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/DocumentValidator.php', + 'GraphQL\\Validator\\Rules\\CustomValidationRule' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php', + 'GraphQL\\Validator\\Rules\\DisableIntrospection' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php', + 'GraphQL\\Validator\\Rules\\ExecutableDefinitions' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php', + 'GraphQL\\Validator\\Rules\\FieldsOnCorrectType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php', + 'GraphQL\\Validator\\Rules\\FragmentsOnCompositeTypes' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php', + 'GraphQL\\Validator\\Rules\\KnownArgumentNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php', + 'GraphQL\\Validator\\Rules\\KnownArgumentNamesOnDirectives' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php', + 'GraphQL\\Validator\\Rules\\KnownDirectives' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php', + 'GraphQL\\Validator\\Rules\\KnownFragmentNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php', + 'GraphQL\\Validator\\Rules\\KnownTypeNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php', + 'GraphQL\\Validator\\Rules\\LoneAnonymousOperation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php', + 'GraphQL\\Validator\\Rules\\LoneSchemaDefinition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php', + 'GraphQL\\Validator\\Rules\\NoFragmentCycles' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php', + 'GraphQL\\Validator\\Rules\\NoUndefinedVariables' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php', + 'GraphQL\\Validator\\Rules\\NoUnusedFragments' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php', + 'GraphQL\\Validator\\Rules\\NoUnusedVariables' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php', + 'GraphQL\\Validator\\Rules\\OverlappingFieldsCanBeMerged' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php', + 'GraphQL\\Validator\\Rules\\PossibleFragmentSpreads' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php', + 'GraphQL\\Validator\\Rules\\ProvidedRequiredArguments' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php', + 'GraphQL\\Validator\\Rules\\ProvidedRequiredArgumentsOnDirectives' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php', + 'GraphQL\\Validator\\Rules\\QueryComplexity' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php', + 'GraphQL\\Validator\\Rules\\QueryDepth' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php', + 'GraphQL\\Validator\\Rules\\QuerySecurityRule' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php', + 'GraphQL\\Validator\\Rules\\ScalarLeafs' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php', + 'GraphQL\\Validator\\Rules\\SingleFieldSubscription' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php', + 'GraphQL\\Validator\\Rules\\UniqueArgumentNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php', + 'GraphQL\\Validator\\Rules\\UniqueDirectivesPerLocation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php', + 'GraphQL\\Validator\\Rules\\UniqueFragmentNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php', + 'GraphQL\\Validator\\Rules\\UniqueInputFieldNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php', + 'GraphQL\\Validator\\Rules\\UniqueOperationNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php', + 'GraphQL\\Validator\\Rules\\UniqueVariableNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php', + 'GraphQL\\Validator\\Rules\\ValidationRule' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php', + 'GraphQL\\Validator\\Rules\\ValuesOfCorrectType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php', + 'GraphQL\\Validator\\Rules\\VariablesAreInputTypes' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php', + 'GraphQL\\Validator\\Rules\\VariablesInAllowedPosition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php', + 'GraphQL\\Validator\\SDLValidationContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/SDLValidationContext.php', + 'GraphQL\\Validator\\ValidationContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/ValidationContext.php', + 'WPGraphQL\\Admin\\Admin' => __DIR__ . '/../..' . '/src/Admin/Admin.php', + 'WPGraphQL\\Admin\\GraphiQL\\GraphiQL' => __DIR__ . '/../..' . '/src/Admin/GraphiQL/GraphiQL.php', + 'WPGraphQL\\Admin\\Settings\\Settings' => __DIR__ . '/../..' . '/src/Admin/Settings/Settings.php', + 'WPGraphQL\\Admin\\Settings\\SettingsRegistry' => __DIR__ . '/../..' . '/src/Admin/Settings/SettingsRegistry.php', + 'WPGraphQL\\AppContext' => __DIR__ . '/../..' . '/src/AppContext.php', + 'WPGraphQL\\Connection\\Comments' => __DIR__ . '/../..' . '/src/Connection/Comments.php', + 'WPGraphQL\\Connection\\MenuItems' => __DIR__ . '/../..' . '/src/Connection/MenuItems.php', + 'WPGraphQL\\Connection\\PostObjects' => __DIR__ . '/../..' . '/src/Connection/PostObjects.php', + 'WPGraphQL\\Connection\\Taxonomies' => __DIR__ . '/../..' . '/src/Connection/Taxonomies.php', + 'WPGraphQL\\Connection\\TermObjects' => __DIR__ . '/../..' . '/src/Connection/TermObjects.php', + 'WPGraphQL\\Connection\\Users' => __DIR__ . '/../..' . '/src/Connection/Users.php', + 'WPGraphQL\\Data\\CommentMutation' => __DIR__ . '/../..' . '/src/Data/CommentMutation.php', + 'WPGraphQL\\Data\\Config' => __DIR__ . '/../..' . '/src/Data/Config.php', + 'WPGraphQL\\Data\\Connection\\AbstractConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/AbstractConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\CommentConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/CommentConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\ContentTypeConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/ContentTypeConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\EnqueuedScriptsConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/EnqueuedScriptsConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\EnqueuedStylesheetConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\MenuConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/MenuConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\MenuItemConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/MenuItemConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\PluginConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/PluginConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\PostObjectConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/PostObjectConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\TaxonomyConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/TaxonomyConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\TermObjectConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/TermObjectConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\ThemeConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/ThemeConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\UserConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/UserConnectionResolver.php', + 'WPGraphQL\\Data\\Connection\\UserRoleConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/UserRoleConnectionResolver.php', + 'WPGraphQL\\Data\\Cursor\\AbstractCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/AbstractCursor.php', + 'WPGraphQL\\Data\\Cursor\\CommentObjectCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/CommentObjectCursor.php', + 'WPGraphQL\\Data\\Cursor\\CursorBuilder' => __DIR__ . '/../..' . '/src/Data/Cursor/CursorBuilder.php', + 'WPGraphQL\\Data\\Cursor\\PostObjectCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/PostObjectCursor.php', + 'WPGraphQL\\Data\\Cursor\\TermObjectCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/TermObjectCursor.php', + 'WPGraphQL\\Data\\Cursor\\UserCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/UserCursor.php', + 'WPGraphQL\\Data\\DataSource' => __DIR__ . '/../..' . '/src/Data/DataSource.php', + 'WPGraphQL\\Data\\Loader\\AbstractDataLoader' => __DIR__ . '/../..' . '/src/Data/Loader/AbstractDataLoader.php', + 'WPGraphQL\\Data\\Loader\\CommentAuthorLoader' => __DIR__ . '/../..' . '/src/Data/Loader/CommentAuthorLoader.php', + 'WPGraphQL\\Data\\Loader\\CommentLoader' => __DIR__ . '/../..' . '/src/Data/Loader/CommentLoader.php', + 'WPGraphQL\\Data\\Loader\\EnqueuedScriptLoader' => __DIR__ . '/../..' . '/src/Data/Loader/EnqueuedScriptLoader.php', + 'WPGraphQL\\Data\\Loader\\EnqueuedStylesheetLoader' => __DIR__ . '/../..' . '/src/Data/Loader/EnqueuedStylesheetLoader.php', + 'WPGraphQL\\Data\\Loader\\PluginLoader' => __DIR__ . '/../..' . '/src/Data/Loader/PluginLoader.php', + 'WPGraphQL\\Data\\Loader\\PostObjectLoader' => __DIR__ . '/../..' . '/src/Data/Loader/PostObjectLoader.php', + 'WPGraphQL\\Data\\Loader\\PostTypeLoader' => __DIR__ . '/../..' . '/src/Data/Loader/PostTypeLoader.php', + 'WPGraphQL\\Data\\Loader\\TaxonomyLoader' => __DIR__ . '/../..' . '/src/Data/Loader/TaxonomyLoader.php', + 'WPGraphQL\\Data\\Loader\\TermObjectLoader' => __DIR__ . '/../..' . '/src/Data/Loader/TermObjectLoader.php', + 'WPGraphQL\\Data\\Loader\\ThemeLoader' => __DIR__ . '/../..' . '/src/Data/Loader/ThemeLoader.php', + 'WPGraphQL\\Data\\Loader\\UserLoader' => __DIR__ . '/../..' . '/src/Data/Loader/UserLoader.php', + 'WPGraphQL\\Data\\Loader\\UserRoleLoader' => __DIR__ . '/../..' . '/src/Data/Loader/UserRoleLoader.php', + 'WPGraphQL\\Data\\MediaItemMutation' => __DIR__ . '/../..' . '/src/Data/MediaItemMutation.php', + 'WPGraphQL\\Data\\NodeResolver' => __DIR__ . '/../..' . '/src/Data/NodeResolver.php', + 'WPGraphQL\\Data\\PostObjectMutation' => __DIR__ . '/../..' . '/src/Data/PostObjectMutation.php', + 'WPGraphQL\\Data\\TermObjectMutation' => __DIR__ . '/../..' . '/src/Data/TermObjectMutation.php', + 'WPGraphQL\\Data\\UserMutation' => __DIR__ . '/../..' . '/src/Data/UserMutation.php', + 'WPGraphQL\\Model\\Avatar' => __DIR__ . '/../..' . '/src/Model/Avatar.php', + 'WPGraphQL\\Model\\Comment' => __DIR__ . '/../..' . '/src/Model/Comment.php', + 'WPGraphQL\\Model\\CommentAuthor' => __DIR__ . '/../..' . '/src/Model/CommentAuthor.php', + 'WPGraphQL\\Model\\Menu' => __DIR__ . '/../..' . '/src/Model/Menu.php', + 'WPGraphQL\\Model\\MenuItem' => __DIR__ . '/../..' . '/src/Model/MenuItem.php', + 'WPGraphQL\\Model\\Model' => __DIR__ . '/../..' . '/src/Model/Model.php', + 'WPGraphQL\\Model\\Plugin' => __DIR__ . '/../..' . '/src/Model/Plugin.php', + 'WPGraphQL\\Model\\Post' => __DIR__ . '/../..' . '/src/Model/Post.php', + 'WPGraphQL\\Model\\PostType' => __DIR__ . '/../..' . '/src/Model/PostType.php', + 'WPGraphQL\\Model\\Taxonomy' => __DIR__ . '/../..' . '/src/Model/Taxonomy.php', + 'WPGraphQL\\Model\\Term' => __DIR__ . '/../..' . '/src/Model/Term.php', + 'WPGraphQL\\Model\\Theme' => __DIR__ . '/../..' . '/src/Model/Theme.php', + 'WPGraphQL\\Model\\User' => __DIR__ . '/../..' . '/src/Model/User.php', + 'WPGraphQL\\Model\\UserRole' => __DIR__ . '/../..' . '/src/Model/UserRole.php', + 'WPGraphQL\\Mutation\\CommentCreate' => __DIR__ . '/../..' . '/src/Mutation/CommentCreate.php', + 'WPGraphQL\\Mutation\\CommentDelete' => __DIR__ . '/../..' . '/src/Mutation/CommentDelete.php', + 'WPGraphQL\\Mutation\\CommentRestore' => __DIR__ . '/../..' . '/src/Mutation/CommentRestore.php', + 'WPGraphQL\\Mutation\\CommentUpdate' => __DIR__ . '/../..' . '/src/Mutation/CommentUpdate.php', + 'WPGraphQL\\Mutation\\MediaItemCreate' => __DIR__ . '/../..' . '/src/Mutation/MediaItemCreate.php', + 'WPGraphQL\\Mutation\\MediaItemDelete' => __DIR__ . '/../..' . '/src/Mutation/MediaItemDelete.php', + 'WPGraphQL\\Mutation\\MediaItemUpdate' => __DIR__ . '/../..' . '/src/Mutation/MediaItemUpdate.php', + 'WPGraphQL\\Mutation\\PostObjectCreate' => __DIR__ . '/../..' . '/src/Mutation/PostObjectCreate.php', + 'WPGraphQL\\Mutation\\PostObjectDelete' => __DIR__ . '/../..' . '/src/Mutation/PostObjectDelete.php', + 'WPGraphQL\\Mutation\\PostObjectUpdate' => __DIR__ . '/../..' . '/src/Mutation/PostObjectUpdate.php', + 'WPGraphQL\\Mutation\\ResetUserPassword' => __DIR__ . '/../..' . '/src/Mutation/ResetUserPassword.php', + 'WPGraphQL\\Mutation\\SendPasswordResetEmail' => __DIR__ . '/../..' . '/src/Mutation/SendPasswordResetEmail.php', + 'WPGraphQL\\Mutation\\TermObjectCreate' => __DIR__ . '/../..' . '/src/Mutation/TermObjectCreate.php', + 'WPGraphQL\\Mutation\\TermObjectDelete' => __DIR__ . '/../..' . '/src/Mutation/TermObjectDelete.php', + 'WPGraphQL\\Mutation\\TermObjectUpdate' => __DIR__ . '/../..' . '/src/Mutation/TermObjectUpdate.php', + 'WPGraphQL\\Mutation\\UpdateSettings' => __DIR__ . '/../..' . '/src/Mutation/UpdateSettings.php', + 'WPGraphQL\\Mutation\\UserCreate' => __DIR__ . '/../..' . '/src/Mutation/UserCreate.php', + 'WPGraphQL\\Mutation\\UserDelete' => __DIR__ . '/../..' . '/src/Mutation/UserDelete.php', + 'WPGraphQL\\Mutation\\UserRegister' => __DIR__ . '/../..' . '/src/Mutation/UserRegister.php', + 'WPGraphQL\\Mutation\\UserUpdate' => __DIR__ . '/../..' . '/src/Mutation/UserUpdate.php', + 'WPGraphQL\\Registry\\SchemaRegistry' => __DIR__ . '/../..' . '/src/Registry/SchemaRegistry.php', + 'WPGraphQL\\Registry\\TypeRegistry' => __DIR__ . '/../..' . '/src/Registry/TypeRegistry.php', + 'WPGraphQL\\Registry\\Utils\\PostObject' => __DIR__ . '/../..' . '/src/Registry/Utils/PostObject.php', + 'WPGraphQL\\Registry\\Utils\\TermObject' => __DIR__ . '/../..' . '/src/Registry/Utils/TermObject.php', + 'WPGraphQL\\Request' => __DIR__ . '/../..' . '/src/Request.php', + 'WPGraphQL\\Router' => __DIR__ . '/../..' . '/src/Router.php', + 'WPGraphQL\\Server\\ValidationRules\\DisableIntrospection' => __DIR__ . '/../..' . '/src/Server/ValidationRules/DisableIntrospection.php', + 'WPGraphQL\\Server\\ValidationRules\\QueryDepth' => __DIR__ . '/../..' . '/src/Server/ValidationRules/QueryDepth.php', + 'WPGraphQL\\Server\\ValidationRules\\RequireAuthentication' => __DIR__ . '/../..' . '/src/Server/ValidationRules/RequireAuthentication.php', + 'WPGraphQL\\Server\\WPHelper' => __DIR__ . '/../..' . '/src/Server/WPHelper.php', + 'WPGraphQL\\Type\\Connection\\Comments' => __DIR__ . '/../..' . '/src/Type/Connection/Comments.php', + 'WPGraphQL\\Type\\Connection\\MenuItems' => __DIR__ . '/../..' . '/src/Type/Connection/MenuItems.php', + 'WPGraphQL\\Type\\Connection\\PostObjects' => __DIR__ . '/../..' . '/src/Type/Connection/PostObjects.php', + 'WPGraphQL\\Type\\Connection\\Taxonomies' => __DIR__ . '/../..' . '/src/Type/Connection/Taxonomies.php', + 'WPGraphQL\\Type\\Connection\\TermObjects' => __DIR__ . '/../..' . '/src/Type/Connection/TermObjects.php', + 'WPGraphQL\\Type\\Connection\\Users' => __DIR__ . '/../..' . '/src/Type/Connection/Users.php', + 'WPGraphQL\\Type\\Enum\\AvatarRatingEnum' => __DIR__ . '/../..' . '/src/Type/Enum/AvatarRatingEnum.php', + 'WPGraphQL\\Type\\Enum\\CommentNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/CommentNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\CommentStatusEnum' => __DIR__ . '/../..' . '/src/Type/Enum/CommentStatusEnum.php', + 'WPGraphQL\\Type\\Enum\\CommentsConnectionOrderbyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/CommentsConnectionOrderbyEnum.php', + 'WPGraphQL\\Type\\Enum\\ContentNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/ContentNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\ContentTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/ContentTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\ContentTypeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/ContentTypeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\MediaItemSizeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MediaItemSizeEnum.php', + 'WPGraphQL\\Type\\Enum\\MediaItemStatusEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MediaItemStatusEnum.php', + 'WPGraphQL\\Type\\Enum\\MenuItemNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MenuItemNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\MenuLocationEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MenuLocationEnum.php', + 'WPGraphQL\\Type\\Enum\\MenuNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MenuNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\MimeTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MimeTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\OrderEnum' => __DIR__ . '/../..' . '/src/Type/Enum/OrderEnum.php', + 'WPGraphQL\\Type\\Enum\\PluginStatusEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PluginStatusEnum.php', + 'WPGraphQL\\Type\\Enum\\PostObjectFieldFormatEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PostObjectFieldFormatEnum.php', + 'WPGraphQL\\Type\\Enum\\PostObjectsConnectionDateColumnEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php', + 'WPGraphQL\\Type\\Enum\\PostObjectsConnectionOrderbyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php', + 'WPGraphQL\\Type\\Enum\\PostStatusEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PostStatusEnum.php', + 'WPGraphQL\\Type\\Enum\\RelationEnum' => __DIR__ . '/../..' . '/src/Type/Enum/RelationEnum.php', + 'WPGraphQL\\Type\\Enum\\TaxonomyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TaxonomyEnum.php', + 'WPGraphQL\\Type\\Enum\\TaxonomyIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TaxonomyIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\TermNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TermNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\TermObjectsConnectionOrderbyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php', + 'WPGraphQL\\Type\\Enum\\TimezoneEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TimezoneEnum.php', + 'WPGraphQL\\Type\\Enum\\UserNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/UserNodeIdTypeEnum.php', + 'WPGraphQL\\Type\\Enum\\UserRoleEnum' => __DIR__ . '/../..' . '/src/Type/Enum/UserRoleEnum.php', + 'WPGraphQL\\Type\\Enum\\UsersConnectionOrderbyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/UsersConnectionOrderbyEnum.php', + 'WPGraphQL\\Type\\Enum\\UsersConnectionSearchColumnEnum' => __DIR__ . '/../..' . '/src/Type/Enum/UsersConnectionSearchColumnEnum.php', + 'WPGraphQL\\Type\\Input\\DateInput' => __DIR__ . '/../..' . '/src/Type/Input/DateInput.php', + 'WPGraphQL\\Type\\Input\\DateQueryInput' => __DIR__ . '/../..' . '/src/Type/Input/DateQueryInput.php', + 'WPGraphQL\\Type\\Input\\PostObjectsConnectionOrderbyInput' => __DIR__ . '/../..' . '/src/Type/Input/PostObjectsConnectionOrderbyInput.php', + 'WPGraphQL\\Type\\Input\\UsersConnectionOrderbyInput' => __DIR__ . '/../..' . '/src/Type/Input/UsersConnectionOrderbyInput.php', + 'WPGraphQL\\Type\\InterfaceType\\Commenter' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Commenter.php', + 'WPGraphQL\\Type\\InterfaceType\\Connection' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Connection.php', + 'WPGraphQL\\Type\\InterfaceType\\ContentNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/ContentNode.php', + 'WPGraphQL\\Type\\InterfaceType\\ContentTemplate' => __DIR__ . '/../..' . '/src/Type/InterfaceType/ContentTemplate.php', + 'WPGraphQL\\Type\\InterfaceType\\DatabaseIdentifier' => __DIR__ . '/../..' . '/src/Type/InterfaceType/DatabaseIdentifier.php', + 'WPGraphQL\\Type\\InterfaceType\\Edge' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Edge.php', + 'WPGraphQL\\Type\\InterfaceType\\EnqueuedAsset' => __DIR__ . '/../..' . '/src/Type/InterfaceType/EnqueuedAsset.php', + 'WPGraphQL\\Type\\InterfaceType\\HierarchicalContentNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/HierarchicalContentNode.php', + 'WPGraphQL\\Type\\InterfaceType\\HierarchicalNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/HierarchicalNode.php', + 'WPGraphQL\\Type\\InterfaceType\\HierarchicalTermNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/HierarchicalTermNode.php', + 'WPGraphQL\\Type\\InterfaceType\\MenuItemLinkable' => __DIR__ . '/../..' . '/src/Type/InterfaceType/MenuItemLinkable.php', + 'WPGraphQL\\Type\\InterfaceType\\Node' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Node.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithAuthor' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithAuthor.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithComments' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithComments.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithContentEditor' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithContentEditor.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithExcerpt' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithExcerpt.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithFeaturedImage' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithFeaturedImage.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithPageAttributes' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithPageAttributes.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithRevisions' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithRevisions.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithTemplate' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithTemplate.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithTitle' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithTitle.php', + 'WPGraphQL\\Type\\InterfaceType\\NodeWithTrackbacks' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithTrackbacks.php', + 'WPGraphQL\\Type\\InterfaceType\\OneToOneConnection' => __DIR__ . '/../..' . '/src/Type/InterfaceType/OneToOneConnection.php', + 'WPGraphQL\\Type\\InterfaceType\\PageInfo' => __DIR__ . '/../..' . '/src/Type/InterfaceType/PageInfo.php', + 'WPGraphQL\\Type\\InterfaceType\\Previewable' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Previewable.php', + 'WPGraphQL\\Type\\InterfaceType\\TermNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/TermNode.php', + 'WPGraphQL\\Type\\InterfaceType\\UniformResourceIdentifiable' => __DIR__ . '/../..' . '/src/Type/InterfaceType/UniformResourceIdentifiable.php', + 'WPGraphQL\\Type\\ObjectType\\Avatar' => __DIR__ . '/../..' . '/src/Type/ObjectType/Avatar.php', + 'WPGraphQL\\Type\\ObjectType\\Comment' => __DIR__ . '/../..' . '/src/Type/ObjectType/Comment.php', + 'WPGraphQL\\Type\\ObjectType\\CommentAuthor' => __DIR__ . '/../..' . '/src/Type/ObjectType/CommentAuthor.php', + 'WPGraphQL\\Type\\ObjectType\\ContentType' => __DIR__ . '/../..' . '/src/Type/ObjectType/ContentType.php', + 'WPGraphQL\\Type\\ObjectType\\EnqueuedScript' => __DIR__ . '/../..' . '/src/Type/ObjectType/EnqueuedScript.php', + 'WPGraphQL\\Type\\ObjectType\\EnqueuedStylesheet' => __DIR__ . '/../..' . '/src/Type/ObjectType/EnqueuedStylesheet.php', + 'WPGraphQL\\Type\\ObjectType\\MediaDetails' => __DIR__ . '/../..' . '/src/Type/ObjectType/MediaDetails.php', + 'WPGraphQL\\Type\\ObjectType\\MediaItemMeta' => __DIR__ . '/../..' . '/src/Type/ObjectType/MediaItemMeta.php', + 'WPGraphQL\\Type\\ObjectType\\MediaSize' => __DIR__ . '/../..' . '/src/Type/ObjectType/MediaSize.php', + 'WPGraphQL\\Type\\ObjectType\\Menu' => __DIR__ . '/../..' . '/src/Type/ObjectType/Menu.php', + 'WPGraphQL\\Type\\ObjectType\\MenuItem' => __DIR__ . '/../..' . '/src/Type/ObjectType/MenuItem.php', + 'WPGraphQL\\Type\\ObjectType\\Plugin' => __DIR__ . '/../..' . '/src/Type/ObjectType/Plugin.php', + 'WPGraphQL\\Type\\ObjectType\\PostObject' => __DIR__ . '/../..' . '/src/Type/ObjectType/PostObject.php', + 'WPGraphQL\\Type\\ObjectType\\PostTypeLabelDetails' => __DIR__ . '/../..' . '/src/Type/ObjectType/PostTypeLabelDetails.php', + 'WPGraphQL\\Type\\ObjectType\\RootMutation' => __DIR__ . '/../..' . '/src/Type/ObjectType/RootMutation.php', + 'WPGraphQL\\Type\\ObjectType\\RootQuery' => __DIR__ . '/../..' . '/src/Type/ObjectType/RootQuery.php', + 'WPGraphQL\\Type\\ObjectType\\SettingGroup' => __DIR__ . '/../..' . '/src/Type/ObjectType/SettingGroup.php', + 'WPGraphQL\\Type\\ObjectType\\Settings' => __DIR__ . '/../..' . '/src/Type/ObjectType/Settings.php', + 'WPGraphQL\\Type\\ObjectType\\Taxonomy' => __DIR__ . '/../..' . '/src/Type/ObjectType/Taxonomy.php', + 'WPGraphQL\\Type\\ObjectType\\TermObject' => __DIR__ . '/../..' . '/src/Type/ObjectType/TermObject.php', + 'WPGraphQL\\Type\\ObjectType\\Theme' => __DIR__ . '/../..' . '/src/Type/ObjectType/Theme.php', + 'WPGraphQL\\Type\\ObjectType\\User' => __DIR__ . '/../..' . '/src/Type/ObjectType/User.php', + 'WPGraphQL\\Type\\ObjectType\\UserRole' => __DIR__ . '/../..' . '/src/Type/ObjectType/UserRole.php', + 'WPGraphQL\\Type\\Union\\MenuItemObjectUnion' => __DIR__ . '/../..' . '/src/Type/Union/MenuItemObjectUnion.php', + 'WPGraphQL\\Type\\Union\\PostObjectUnion' => __DIR__ . '/../..' . '/src/Type/Union/PostObjectUnion.php', + 'WPGraphQL\\Type\\Union\\TermObjectUnion' => __DIR__ . '/../..' . '/src/Type/Union/TermObjectUnion.php', + 'WPGraphQL\\Type\\WPConnectionType' => __DIR__ . '/../..' . '/src/Type/WPConnectionType.php', + 'WPGraphQL\\Type\\WPEnumType' => __DIR__ . '/../..' . '/src/Type/WPEnumType.php', + 'WPGraphQL\\Type\\WPInputObjectType' => __DIR__ . '/../..' . '/src/Type/WPInputObjectType.php', + 'WPGraphQL\\Type\\WPInterfaceTrait' => __DIR__ . '/../..' . '/src/Type/WPInterfaceTrait.php', + 'WPGraphQL\\Type\\WPInterfaceType' => __DIR__ . '/../..' . '/src/Type/WPInterfaceType.php', + 'WPGraphQL\\Type\\WPMutationType' => __DIR__ . '/../..' . '/src/Type/WPMutationType.php', + 'WPGraphQL\\Type\\WPObjectType' => __DIR__ . '/../..' . '/src/Type/WPObjectType.php', + 'WPGraphQL\\Type\\WPScalar' => __DIR__ . '/../..' . '/src/Type/WPScalar.php', + 'WPGraphQL\\Type\\WPUnionType' => __DIR__ . '/../..' . '/src/Type/WPUnionType.php', + 'WPGraphQL\\Types' => __DIR__ . '/../..' . '/src/Types.php', + 'WPGraphQL\\Utils\\DebugLog' => __DIR__ . '/../..' . '/src/Utils/DebugLog.php', + 'WPGraphQL\\Utils\\InstrumentSchema' => __DIR__ . '/../..' . '/src/Utils/InstrumentSchema.php', + 'WPGraphQL\\Utils\\Preview' => __DIR__ . '/../..' . '/src/Utils/Preview.php', + 'WPGraphQL\\Utils\\QueryAnalyzer' => __DIR__ . '/../..' . '/src/Utils/QueryAnalyzer.php', + 'WPGraphQL\\Utils\\QueryLog' => __DIR__ . '/../..' . '/src/Utils/QueryLog.php', + 'WPGraphQL\\Utils\\Tracing' => __DIR__ . '/../..' . '/src/Utils/Tracing.php', + 'WPGraphQL\\Utils\\Utils' => __DIR__ . '/../..' . '/src/Utils/Utils.php', + 'WPGraphQL\\WPSchema' => __DIR__ . '/../..' . '/src/WPSchema.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit9722c19e535d86fc968bdbe1abcb61b0::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit9722c19e535d86fc968bdbe1abcb61b0::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit9722c19e535d86fc968bdbe1abcb61b0::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/installed.json b/lib/wp-graphql-1.17.0/vendor/composer/installed.json new file mode 100644 index 00000000..cf32b8f7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/composer/installed.json @@ -0,0 +1,171 @@ +{ + "packages": [ + { + "name": "appsero/client", + "version": "v1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "https://github.com/Appsero/client.git", + "reference": "d110c537f4ca92ac7f3398eee67cc6bdf506a4fb" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Appsero/client/zipball/d110c537f4ca92ac7f3398eee67cc6bdf506a4fb", + "reference": "d110c537f4ca92ac7f3398eee67cc6bdf506a4fb", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "time": "2022-06-30T12:01:38+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Appsero\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tareq Hasan", + "email": "tareq@appsero.com" + } + ], + "description": "Appsero Client", + "keywords": [ + "analytics", + "plugin", + "theme", + "wordpress" + ], + "support": { + "issues": "https://github.com/Appsero/client/issues", + "source": "https://github.com/Appsero/client/tree/v1.2.1" + }, + "install-path": "../appsero/client" + }, + { + "name": "ivome/graphql-relay-php", + "version": "v0.6.0", + "version_normalized": "0.6.0.0", + "source": { + "type": "git", + "url": "https://github.com/ivome/graphql-relay-php.git", + "reference": "7055fd45b7e552cee4d1290849b84294b0049373" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ivome/graphql-relay-php/zipball/7055fd45b7e552cee4d1290849b84294b0049373", + "reference": "7055fd45b7e552cee4d1290849b84294b0049373", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "webonyx/graphql-php": "^14.0" + }, + "require-dev": { + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "satooshi/php-coveralls": "~1.0" + }, + "time": "2021-04-24T19:31:29+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "A PHP port of GraphQL Relay reference implementation", + "homepage": "https://github.com/ivome/graphql-relay-php", + "keywords": [ + "Relay", + "api", + "graphql" + ], + "support": { + "issues": "https://github.com/ivome/graphql-relay-php/issues", + "source": "https://github.com/ivome/graphql-relay-php/tree/v0.6.0" + }, + "install-path": "../ivome/graphql-relay-php" + }, + { + "name": "webonyx/graphql-php", + "version": "v14.11.10", + "version_normalized": "14.11.10.0", + "source": { + "type": "git", + "url": "https://github.com/webonyx/graphql-php.git", + "reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/d9c2fdebc6aa01d831bc2969da00e8588cffef19", + "reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-mbstring": "*", + "php": "^7.1 || ^8" + }, + "require-dev": { + "amphp/amp": "^2.3", + "doctrine/coding-standard": "^6.0", + "nyholm/psr7": "^1.2", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "0.12.82", + "phpstan/phpstan-phpunit": "0.12.18", + "phpstan/phpstan-strict-rules": "0.12.9", + "phpunit/phpunit": "^7.2 || ^8.5", + "psr/http-message": "^1.0", + "react/promise": "2.*", + "simpod/php-coveralls-mirror": "^3.0" + }, + "suggest": { + "psr/http-message": "To use standard GraphQL server", + "react/promise": "To leverage async resolving on React PHP platform" + }, + "time": "2023-07-05T14:23:37+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "GraphQL\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP port of GraphQL reference implementation", + "homepage": "https://github.com/webonyx/graphql-php", + "keywords": [ + "api", + "graphql" + ], + "support": { + "issues": "https://github.com/webonyx/graphql-php/issues", + "source": "https://github.com/webonyx/graphql-php/tree/v14.11.10" + }, + "funding": [ + { + "url": "https://opencollective.com/webonyx-graphql-php", + "type": "open_collective" + } + ], + "install-path": "../webonyx/graphql-php" + } + ], + "dev": false, + "dev-package-names": [] +} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/installed.php b/lib/wp-graphql-1.17.0/vendor/composer/installed.php new file mode 100644 index 00000000..42a9eb87 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/composer/installed.php @@ -0,0 +1,50 @@ + array( + 'name' => 'wp-graphql/wp-graphql', + 'pretty_version' => 'v1.17.0', + 'version' => '1.17.0.0', + 'reference' => '1ec24256362b86d7f857efc285fbe0cacea2f67e', + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => false, + ), + 'versions' => array( + 'appsero/client' => array( + 'pretty_version' => 'v1.2.1', + 'version' => '1.2.1.0', + 'reference' => 'd110c537f4ca92ac7f3398eee67cc6bdf506a4fb', + 'type' => 'library', + 'install_path' => __DIR__ . '/../appsero/client', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ivome/graphql-relay-php' => array( + 'pretty_version' => 'v0.6.0', + 'version' => '0.6.0.0', + 'reference' => '7055fd45b7e552cee4d1290849b84294b0049373', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ivome/graphql-relay-php', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'webonyx/graphql-php' => array( + 'pretty_version' => 'v14.11.10', + 'version' => '14.11.10.0', + 'reference' => 'd9c2fdebc6aa01d831bc2969da00e8588cffef19', + 'type' => 'library', + 'install_path' => __DIR__ . '/../webonyx/graphql-php', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'wp-graphql/wp-graphql' => array( + 'pretty_version' => 'v1.17.0', + 'version' => '1.17.0.0', + 'reference' => '1ec24256362b86d7f857efc285fbe0cacea2f67e', + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/lib/wp-graphql-1.17.0/vendor/composer/platform_check.php b/lib/wp-graphql-1.17.0/vendor/composer/platform_check.php new file mode 100644 index 00000000..6d3407db --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70100)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/.travis.yml b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/.travis.yml new file mode 100644 index 00000000..c2bd8fc7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/.travis.yml @@ -0,0 +1,19 @@ +language: php + +php: + - 7.1 + - 7.2 + - 7.3 + - 7.4 + - 8.0 + - nightly + +install: + - composer install --prefer-dist + +script: + - mkdir -p build/logs + - ./bin/phpunit --coverage-clover build/logs/clover.xml tests/ + +after_script: + - ./bin/coveralls -v diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/LICENSE b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/LICENSE new file mode 100644 index 00000000..73ee842d --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/LICENSE @@ -0,0 +1,29 @@ +BSD 3-Clause License + +Copyright (c) 2018, Ivo Meißner +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +* Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/contributors.txt b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/contributors.txt new file mode 100644 index 00000000..d2150072 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/contributors.txt @@ -0,0 +1 @@ +Ivo Meißner diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/phpunit.xml b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/phpunit.xml new file mode 100644 index 00000000..6f884372 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/phpunit.xml @@ -0,0 +1,12 @@ + + + + tests + + + + + src + + + diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/ArrayConnection.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/ArrayConnection.php new file mode 100644 index 00000000..b580b7c6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/ArrayConnection.php @@ -0,0 +1,178 @@ + 0, + 'arrayLength' => count($data) + ]); + } + + /** + * Given a slice (subset) of an array, returns a connection object for use in + * GraphQL. + * + * This function is similar to `connectionFromArray`, but is intended for use + * cases where you know the cardinality of the connection, consider it too large + * to materialize the entire array, and instead wish pass in a slice of the + * total result large enough to cover the range specified in `args`. + * + * @return array + */ + public static function connectionFromArraySlice(array $arraySlice, $args, $meta) + { + $after = self::getArrayValueSafe($args, 'after'); + $before = self::getArrayValueSafe($args, 'before'); + $first = self::getArrayValueSafe($args, 'first'); + $last = self::getArrayValueSafe($args, 'last'); + $sliceStart = self::getArrayValueSafe($meta, 'sliceStart'); + $arrayLength = self::getArrayValueSafe($meta, 'arrayLength'); + $sliceEnd = $sliceStart + count($arraySlice); + $beforeOffset = self::getOffsetWithDefault($before, $arrayLength); + $afterOffset = self::getOffsetWithDefault($after, -1); + + $startOffset = max([ + $sliceStart - 1, + $afterOffset, + -1 + ]) + 1; + + $endOffset = min([ + $sliceEnd, + $beforeOffset, + $arrayLength + ]); + if ($first !== null) { + $endOffset = min([ + $endOffset, + $startOffset + $first + ]); + } + + if ($last !== null) { + $startOffset = max([ + $startOffset, + $endOffset - $last + ]); + } + + $slice = array_slice($arraySlice, + max($startOffset - $sliceStart, 0), + count($arraySlice) - ($sliceEnd - $endOffset) - max($startOffset - $sliceStart, 0) + ); + + $edges = array_map(function($item, $index) use ($startOffset) { + return [ + 'cursor' => self::offsetToCursor($startOffset + $index), + 'node' => $item + ]; + }, $slice, array_keys($slice)); + + $firstEdge = $edges ? $edges[0] : null; + $lastEdge = $edges ? $edges[count($edges) - 1] : null; + $lowerBound = $after ? ($afterOffset + 1) : 0; + $upperBound = $before ? ($beforeOffset) : $arrayLength; + + return [ + 'edges' => $edges, + 'pageInfo' => [ + 'startCursor' => $firstEdge ? $firstEdge['cursor'] : null, + 'endCursor' => $lastEdge ? $lastEdge['cursor'] : null, + 'hasPreviousPage' => $last !== null ? $startOffset > $lowerBound : false, + 'hasNextPage' => $first !== null ? $endOffset < $upperBound : false + ] + ]; + } + + /** + * Return the cursor associated with an object in an array. + * + * @param array $data + * @param $object + * @return null|string + */ + public static function cursorForObjectInConnection(array $data, $object) + { + $offset = -1; + for ($i = 0; $i < count($data); $i++) { + if ($data[$i] == $object){ + $offset = $i; + break; + } + } + + if ($offset === -1) { + return null; + } + + return self::offsetToCursor($offset); + } + + /** + * Returns the value for the given array key, NULL, if it does not exist + * + * @param array $array + * @param string $key + * @return mixed + */ + protected static function getArrayValueSafe(array $array, $key) + { + return array_key_exists($key, $array) ? $array[$key] : null; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/Connection.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/Connection.php new file mode 100644 index 00000000..46443594 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/Connection.php @@ -0,0 +1,195 @@ + [ + 'type' => Type::string() + ], + 'first' => [ + 'type' => Type::int() + ] + ]; + } + + /** + * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field + * whose return type is a connection type with backward pagination. + * + * @return array + */ + public static function backwardConnectionArgs() + { + return [ + 'before' => [ + 'type' => Type::string() + ], + 'last' => [ + 'type' => Type::int() + ] + ]; + } + + /** + * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field + * whose return type is a connection type with bidirectional pagination. + * + * @return array + */ + public static function connectionArgs() + { + return array_merge( + self::forwardConnectionArgs(), + self::backwardConnectionArgs() + ); + } + + /** + * Returns a GraphQLObjectType for a connection with the given name, + * and whose nodes are of the specified type. + */ + public static function connectionDefinitions(array $config) + { + return [ + 'edgeType' => self::createEdgeType($config), + 'connectionType' => self::createConnectionType($config) + ]; + } + + /** + * Returns a GraphQLObjectType for a connection with the given name, + * and whose nodes are of the specified type. + * + * @return ObjectType + */ + public static function createConnectionType(array $config) + { + if (!array_key_exists('nodeType', $config)){ + throw new \InvalidArgumentException('Connection config needs to have at least a node definition'); + } + $nodeType = $config['nodeType']; + $name = array_key_exists('name', $config) ? $config['name'] : $nodeType->name; + $connectionFields = array_key_exists('connectionFields', $config) ? $config['connectionFields'] : []; + $edgeType = array_key_exists('edgeType', $config) ? $config['edgeType'] : null; + + $connectionType = new ObjectType([ + 'name' => $name . 'Connection', + 'description' => 'A connection to a list of items.', + 'fields' => function() use ($edgeType, $connectionFields, $config) { + return array_merge([ + 'pageInfo' => [ + 'type' => Type::nonNull(self::pageInfoType()), + 'description' => 'Information to aid in pagination.' + ], + 'edges' => [ + 'type' => Type::listOf($edgeType ?: self::createEdgeType($config)), + 'description' => 'Information to aid in pagination' + ] + ], self::resolveMaybeThunk($connectionFields)); + } + ]); + + return $connectionType; + } + + /** + * Returns a GraphQLObjectType for an edge with the given name, + * and whose nodes are of the specified type. + * + * @param array $config + * @return ObjectType + */ + public static function createEdgeType(array $config) + { + if (!array_key_exists('nodeType', $config)){ + throw new \InvalidArgumentException('Edge config needs to have at least a node definition'); + } + $nodeType = $config['nodeType']; + $name = array_key_exists('name', $config) ? $config['name'] : $nodeType->name; + $edgeFields = array_key_exists('edgeFields', $config) ? $config['edgeFields'] : []; + $resolveNode = array_key_exists('resolveNode', $config) ? $config['resolveNode'] : null; + $resolveCursor = array_key_exists('resolveCursor', $config) ? $config['resolveCursor'] : null; + + $edgeType = new ObjectType(array_merge([ + 'name' => $name . 'Edge', + 'description' => 'An edge in a connection', + 'fields' => function() use ($nodeType, $resolveNode, $resolveCursor, $edgeFields) { + return array_merge([ + 'node' => [ + 'type' => $nodeType, + 'resolve' => $resolveNode, + 'description' => 'The item at the end of the edge' + ], + 'cursor' => [ + 'type' => Type::nonNull(Type::string()), + 'resolve' => $resolveCursor, + 'description' => 'A cursor for use in pagination' + ] + ], self::resolveMaybeThunk($edgeFields)); + } + ])); + + return $edgeType; + } + + /** + * The common page info type used by all connections. + * + * @return ObjectType + */ + public static function pageInfoType() + { + if (self::$pageInfoType === null){ + self::$pageInfoType = new ObjectType([ + 'name' => 'PageInfo', + 'description' => 'Information about pagination in a connection.', + 'fields' => [ + 'hasNextPage' => [ + 'type' => Type::nonNull(Type::boolean()), + 'description' => 'When paginating forwards, are there more items?' + ], + 'hasPreviousPage' => [ + 'type' => Type::nonNull(Type::boolean()), + 'description' => 'When paginating backwards, are there more items?' + ], + 'startCursor' => [ + 'type' => Type::string(), + 'description' => 'When paginating backwards, the cursor to continue.' + ], + 'endCursor' => [ + 'type' => Type::string(), + 'description' => 'When paginating forwards, the cursor to continue.' + ] + ] + ]); + } + return self::$pageInfoType; + } + + protected static function resolveMaybeThunk ($thinkOrThunk) + { + return is_callable($thinkOrThunk) ? call_user_func($thinkOrThunk) : $thinkOrThunk; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Mutation/Mutation.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Mutation/Mutation.php new file mode 100644 index 00000000..3f640caf --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Mutation/Mutation.php @@ -0,0 +1,120 @@ + [ + 'type' => Type::string() + ] + ]); + }; + + $augmentedOutputFields = function () use ($outputFields) { + $outputFieldsResolved = self::resolveMaybeThunk($outputFields); + return array_merge($outputFieldsResolved !== null ? $outputFieldsResolved : [], [ + 'clientMutationId' => [ + 'type' => Type::string() + ] + ]); + }; + + $outputType = new ObjectType([ + 'name' => $name . 'Payload', + 'fields' => $augmentedOutputFields + ]); + + $inputType = new InputObjectType([ + 'name' => $name . 'Input', + 'fields' => $augmentedInputFields + ]); + + $definition = [ + 'type' => $outputType, + 'args' => [ + 'input' => [ + 'type' => Type::nonNull($inputType) + ] + ], + 'resolve' => function ($query, $args, $context, ResolveInfo $info) use ($mutateAndGetPayload) { + $payload = call_user_func($mutateAndGetPayload, $args['input'], $context, $info); + $payload['clientMutationId'] = isset($args['input']['clientMutationId']) ? $args['input']['clientMutationId'] : null; + return $payload; + } + ]; + if (array_key_exists('description', $config)){ + $definition['description'] = $config['description']; + } + if (array_key_exists('deprecationReason', $config)){ + $definition['deprecationReason'] = $config['deprecationReason']; + } + return $definition; + } + + /** + * Returns the value for the given array key, NULL, if it does not exist + * + * @param array $array + * @param string $key + * @return mixed + */ + protected static function getArrayValue(array $array, $key) + { + if (array_key_exists($key, $array)){ + return $array[$key]; + } else { + throw new \InvalidArgumentException('The config value for "' . $key . '" is required, but missing in MutationConfig."'); + } + } + + protected static function resolveMaybeThunk($thinkOrThunk) + { + return is_callable($thinkOrThunk) ? call_user_func($thinkOrThunk) : $thinkOrThunk; + } +} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Node.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Node.php new file mode 100644 index 00000000..e5d672a5 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Node.php @@ -0,0 +1,117 @@ + 'Node', + 'description' => 'An object with an ID', + 'fields' => [ + 'id' => [ + 'type' => Type::nonNull(Type::id()), + 'description' => 'The id of the object', + ] + ], + 'resolveType' => $typeResolver + ]); + + $nodeField = [ + 'name' => 'node', + 'description' => 'Fetches an object given its ID', + 'type' => $nodeInterface, + 'args' => [ + 'id' => [ + 'type' => Type::nonNull(Type::id()), + 'description' => 'The ID of an object' + ] + ], + 'resolve' => function ($obj, $args, $context, $info) use ($idFetcher) { + return $idFetcher($args['id'], $context, $info); + } + ]; + + return [ + 'nodeInterface' => $nodeInterface, + 'nodeField' => $nodeField + ]; + } + + /** + * Takes a type name and an ID specific to that type name, and returns a + * "global ID" that is unique among all types. + * + * @param string $type + * @param string $id + * @return string + */ + public static function toGlobalId($type, $id) { + return base64_encode($type . GLOBAL_ID_DELIMITER . $id); + } + + /** + * Takes the "global ID" created by self::toGlobalId, and returns the type name and ID + * used to create it. + * + * @param $globalId + * @return array + */ + public static function fromGlobalId($globalId) { + $unbasedGlobalId = base64_decode($globalId); + $delimiterPos = strpos($unbasedGlobalId, GLOBAL_ID_DELIMITER); + return [ + 'type' => substr($unbasedGlobalId, 0, $delimiterPos), + 'id' => substr($unbasedGlobalId, $delimiterPos + 1) + ]; + } + + /** + * Creates the configuration for an id field on a node, using `self::toGlobalId` to + * construct the ID from the provided typename. The type-specific ID is fetched + * by calling idFetcher on the object, or if not provided, by accessing the `id` + * property on the object. + * + * @param string|null $typeName + * @param callable|null $idFetcher + * @return array + */ + public static function globalIdField($typeName = null, callable $idFetcher = null) { + return [ + 'name' => 'id', + 'description' => 'The ID of an object', + 'type' => Type::nonNull(Type::id()), + 'resolve' => function($obj, $args, $context, $info) use ($typeName, $idFetcher) { + return self::toGlobalId( + $typeName !== null ? $typeName : $info->parentType->name, + $idFetcher ? $idFetcher($obj, $info) : $obj['id'] + ); + } + ]; + } + +} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Plural.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Plural.php new file mode 100644 index 00000000..7c6ab027 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Plural.php @@ -0,0 +1,69 @@ + ?any, + * description?: ?string, + * }; + * + * @param array $config + * @return array + */ + public static function pluralIdentifyingRootField(array $config) + { + $inputArgs = []; + $argName = self::getArrayValue($config, 'argName'); + $inputArgs[$argName] = [ + 'type' => Type::nonNull( + Type::listOf( + Type::nonNull(self::getArrayValue($config, 'inputType')) + ) + ) + ]; + + return [ + 'description' => isset($config['description']) ? $config['description'] : null, + 'type' => Type::listOf(self::getArrayValue($config, 'outputType')), + 'args' => $inputArgs, + 'resolve' => function ($obj, $args, $context, ResolveInfo $info) use ($argName, $config) { + $inputs = $args[$argName]; + return array_map(function($input) use ($config, $context, $info) { + return call_user_func(self::getArrayValue($config, 'resolveSingleInput'), $input, $context, $info); + }, $inputs); + } + ]; + } + + /** + * Returns the value for the given array key, NULL, if it does not exist + * + * @param array $array + * @param string $key + * @return mixed + */ + protected static function getArrayValue(array $array, $key) + { + if (array_key_exists($key, $array)){ + return $array[$key]; + } else { + throw new \InvalidArgumentException('The config value for "' . $key . '" is required, but missing in PluralIdentifyingRootFieldConfig."'); + } + } +} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Relay.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Relay.php new file mode 100644 index 00000000..45f2ab87 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Relay.php @@ -0,0 +1,219 @@ +letters, []); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'A', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + ), + 1 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 2 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 3 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + 4 => + array ( + 'node' => 'E', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsASmallerFirst() + { + $connection = ArrayConnection::connectionFromArray($this->letters, ['first' => 2]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'A', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + ), + 1 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsAnOverlyLargeFirst() + { + $connection = ArrayConnection::connectionFromArray($this->letters, ['first' => 10]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'A', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + ), + 1 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 2 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 3 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + 4 => + array ( + 'node' => 'E', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsASmallerLast() + { + $connection = ArrayConnection::connectionFromArray($this->letters, ['last' => 2]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + 1 => + array ( + 'node' => 'E', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + 'hasPreviousPage' => true, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsAnOverlyLargeLast() + { + $connection = ArrayConnection::connectionFromArray($this->letters, ['last' => 10]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'A', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + ), + 1 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 2 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 3 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + 4 => + array ( + 'node' => 'E', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsFirstAndAfter() + { + $connection = ArrayConnection::connectionFromArray($this->letters, ['first' => 2, 'after' => 'YXJyYXljb25uZWN0aW9uOjE=']); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 1 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($connection, $expected); + } + + public function testRespectsFirstAndAfterWithLongFirst() + { + $connection = ArrayConnection::connectionFromArray($this->letters, ['first' => 10, 'after' => 'YXJyYXljb25uZWN0aW9uOjE=']); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 1 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + 2 => + array ( + 'node' => 'E', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsLastAndBefore() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'last' => 2, + 'before' => 'YXJyYXljb25uZWN0aW9uOjM=' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 1 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'hasPreviousPage' => true, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsLastAndBeforeWithLongLast() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'last' => 10, + 'before' => 'YXJyYXljb25uZWN0aW9uOjM=' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'A', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + ), + 1 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 2 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsFirstAndAfterAndBeforeTooFew() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'first' => 2, + 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 1 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsFirstAndAfterAndBeforeTooMany() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'first' => 3, + 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 1 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 2 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsFirstAndAfterAndBeforeExactlyRight() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'first' => 3, + 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 1 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 2 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsLastAndAfterAndBeforeTooFew() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'last' => 2, + 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 1 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'hasPreviousPage' => true, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsLastAndAfterAndBeforeTooMany() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'last' => 4, + 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 1 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 2 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testRespectsLastAndAfterAndBeforeExactlyRight() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'last' => 3, + 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 1 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 2 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testReturnsNoElementsIfFirstIs0() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'first' => 0 + ]); + + $expected = array ( + 'edges' => + array ( + ), + 'pageInfo' => + array ( + 'startCursor' => NULL, + 'endCursor' => NULL, + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testReturnsAllElementsIfCursorsAreInvalid() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'before' => 'invalid', + 'after' => 'invalid' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'A', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + ), + 1 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 2 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 3 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + 4 => + array ( + 'node' => 'E', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testReturnsAllElementsIfCursorsAreOnTheOutside() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'before' => 'YXJyYXljb25uZWN0aW9uOjYK', + 'after' => 'YXJyYXljb25uZWN0aW9uOi0xCg==' + ]); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'A', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + ), + 1 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 2 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 3 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + 4 => + array ( + 'node' => 'E', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testReturnsNoElementsIfCursorsCross() + { + $connection = ArrayConnection::connectionFromArray($this->letters, [ + 'before' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'after' => 'YXJyYXljb25uZWN0aW9uOjQ=' + ]); + + $expected = array ( + 'edges' => + array ( + ), + 'pageInfo' => + array ( + 'startCursor' => NULL, + 'endCursor' => NULL, + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testReturnsAnEdgeCursorGivenAnArrayAndAMemberObject() + { + $cursor = ArrayConnection::cursorForObjectInConnection($this->letters, 'B'); + + $this->assertEquals('YXJyYXljb25uZWN0aW9uOjE=', $cursor); + } + + public function testReturnsNullGivenAnArrayAndANonMemberObject() + { + $cursor = ArrayConnection::cursorForObjectInConnection($this->letters, 'F'); + + $this->assertEquals(null, $cursor); + } + + public function testWorksWithAJustRightArraySlice() + { + $connection = ArrayConnection::connectionFromArraySlice( + array_slice($this->letters, 1, 2), + [ + 'first' => 2, + 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', + ], + [ + 'sliceStart' => 1, + 'arrayLength' => 5 + ] + ); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 1 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testWorksWithAnOversizedArraySliceLeftSide() + { + $connection = ArrayConnection::connectionFromArraySlice( + array_slice($this->letters, 0, 3), + [ + 'first' => 2, + 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', + ], + [ + 'sliceStart' => 0, + 'arrayLength' => 5 + ] + ); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'B', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + ), + 1 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testWorksWithAnOversizedArraySliceRightSide() + { + $connection = ArrayConnection::connectionFromArraySlice( + array_slice($this->letters, 2, 2), + [ + 'first' => 1, + 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', + ], + [ + 'sliceStart' => 2, + 'arrayLength' => 5 + ] + ); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testWorksWithAnOversizedArraySliceBothSides() + { + $connection = ArrayConnection::connectionFromArraySlice( + array_slice($this->letters, 1, 3), + [ + 'first' => 1, + 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', + ], + [ + 'sliceStart' => 1, + 'arrayLength' => 5 + ] + ); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testWorksWithAnUndersizedArraySliceLeftSide() + { + $connection = ArrayConnection::connectionFromArraySlice( + array_slice($this->letters, 3, 2), + [ + 'first' => 3, + 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', + ], + [ + 'sliceStart' => 3, + 'arrayLength' => 5 + ] + ); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + 1 => + array ( + 'node' => 'E', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + 'hasPreviousPage' => false, + 'hasNextPage' => false, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testWorksWithAnUndersizedArraySliceRightSide() + { + $connection = ArrayConnection::connectionFromArraySlice( + array_slice($this->letters, 2, 2), + [ + 'first' => 3, + 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', + ], + [ + 'sliceStart' => 2, + 'arrayLength' => 5 + ] + ); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'C', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + ), + 1 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($expected, $connection); + } + + public function testWorksWithAnUndersizedArraySliceBothSides() + { + $connection = ArrayConnection::connectionFromArraySlice( + array_slice($this->letters, 3, 1), + [ + 'first' => 3, + 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', + ], + [ + 'sliceStart' => 3, + 'arrayLength' => 5 + ] + ); + + $expected = array ( + 'edges' => + array ( + 0 => + array ( + 'node' => 'D', + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + ), + ), + 'pageInfo' => + array ( + 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'hasPreviousPage' => false, + 'hasNextPage' => true, + ), + ); + + $this->assertEquals($expected, $connection); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ConnectionTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ConnectionTest.php new file mode 100644 index 00000000..7a40004c --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ConnectionTest.php @@ -0,0 +1,278 @@ +allUsers = [ + [ 'name' => 'Dan', 'friends' => [1, 2, 3, 4] ], + [ 'name' => 'Nick', 'friends' => [0, 2, 3, 4] ], + [ 'name' => 'Lee', 'friends' => [0, 1, 3, 4] ], + [ 'name' => 'Joe', 'friends' => [0, 1, 2, 4] ], + [ 'name' => 'Tim', 'friends' => [0, 1, 2, 3] ], + ]; + + $this->userType = new ObjectType([ + 'name' => 'User', + 'fields' => function(){ + return [ + 'name' => [ + 'type' => Type::string() + ], + 'friends' => [ + 'type' => $this->friendConnection, + 'args' => Connection::connectionArgs(), + 'resolve' => function ($user, $args) { + return ArrayConnection::connectionFromArray($user['friends'], $args); + } + ], + 'friendsForward' => [ + 'type' => $this->userConnection, + 'args' => Connection::forwardConnectionArgs(), + 'resolve' => function ($user, $args) { + return ArrayConnection::connectionFromArray($user['friends'], $args); + } + ], + 'friendsBackward' => [ + 'type' => $this->userConnection, + 'args' => Connection::backwardConnectionArgs(), + 'resolve' => function ($user, $args) { + return ArrayConnection::connectionFromArray($user['friends'], $args); + } + ] + ]; + } + ]); + + $this->friendConnection = Connection::connectionDefinitions([ + 'name' => 'Friend', + 'nodeType' => $this->userType, + 'resolveNode' => function ($edge) { + return $this->allUsers[$edge['node']]; + }, + 'edgeFields' => function() { + return [ + 'friendshipTime' => [ + 'type' => Type::string(), + 'resolve' => function() { return 'Yesterday'; } + ] + ]; + }, + 'connectionFields' => function() { + return [ + 'totalCount' => [ + 'type' => Type::int(), + 'resolve' => function() { + return count($this->allUsers) -1; + } + ] + ]; + } + ])['connectionType']; + + $this->userConnection = Connection::connectionDefinitions([ + 'nodeType' => $this->userType, + 'resolveNode' => function ($edge) { + return $this->allUsers[$edge['node']]; + } + ])['connectionType']; + + $this->queryType = new ObjectType([ + 'name' => 'Query', + 'fields' => function() { + return [ + 'user' => [ + 'type' => $this->userType, + 'resolve' => function() { + return $this->allUsers[0]; + } + ] + ]; + } + ]); + + $this->schema = new Schema([ + 'query' => $this->queryType + ]); + } + + public function testIncludesConnectionAndEdgeFields() + { + $query = 'query FriendsQuery { + user { + friends(first: 2) { + totalCount + edges { + friendshipTime + node { + name + } + } + } + } + }'; + + $expected = [ + 'user' => [ + 'friends' => [ + 'totalCount' => 4, + 'edges' => [ + [ + 'friendshipTime' => 'Yesterday', + 'node' => [ + 'name' => 'Nick' + ] + ], + [ + 'friendshipTime' => 'Yesterday', + 'node' => [ + 'name' => 'Lee' + ] + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testWorksWithForwardConnectionArgs() + { + $query = 'query FriendsQuery { + user { + friendsForward(first: 2) { + edges { + node { + name + } + } + } + } + }'; + $expected = [ + 'user' => [ + 'friendsForward' => [ + 'edges' => [ + [ + 'node' => [ + 'name' => 'Nick' + ] + ], + [ + 'node' => [ + 'name' => 'Lee' + ] + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testWorksWithBackwardConnectionArgs() + { + $query = 'query FriendsQuery { + user { + friendsBackward(last: 2) { + edges { + node { + name + } + } + } + } + }'; + + $expected = [ + 'user' => [ + 'friendsBackward' => [ + 'edges' => [ + [ + 'node' => [ + 'name' => 'Joe' + ] + ], + [ + 'node' => [ + 'name' => 'Tim' + ] + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testEdgeTypeThrowsWithoutNodeType() { + $this->expectException(\InvalidArgumentException::class); + Connection::createEdgeType([]); + } + + public function testConnectionTypeThrowsWithoutNodeType() { + $this->expectException(\InvalidArgumentException::class); + Connection::createConnectionType([]); + } + + public function testConnectionDefinitionThrowsWithoutNodeType() { + $this->expectException(\InvalidArgumentException::class); + Connection::connectionDefinitions([]); + } + + /** + * Helper function to test a query and the expected response. + */ + protected function assertValidQuery($query, $expected) + { + $result = GraphQL::executeQuery($this->schema, $query)->toArray(); + $this->assertEquals(['data' => $expected], $result); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/SeparateConnectionTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/SeparateConnectionTest.php new file mode 100644 index 00000000..696f48dc --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/SeparateConnectionTest.php @@ -0,0 +1,284 @@ +allUsers = [ + [ 'name' => 'Dan', 'friends' => [1, 2, 3, 4] ], + [ 'name' => 'Nick', 'friends' => [0, 2, 3, 4] ], + [ 'name' => 'Lee', 'friends' => [0, 1, 3, 4] ], + [ 'name' => 'Joe', 'friends' => [0, 1, 2, 4] ], + [ 'name' => 'Tim', 'friends' => [0, 1, 2, 3] ], + ]; + + $this->userType = new ObjectType([ + 'name' => 'User', + 'fields' => function(){ + return [ + 'name' => [ + 'type' => Type::string() + ], + 'friends' => [ + 'type' => $this->friendConnection, + 'args' => Connection::connectionArgs(), + 'resolve' => function ($user, $args) { + return ArrayConnection::connectionFromArray($user['friends'], $args); + } + ], + 'friendsForward' => [ + 'type' => $this->userConnection, + 'args' => Connection::forwardConnectionArgs(), + 'resolve' => function ($user, $args) { + return ArrayConnection::connectionFromArray($user['friends'], $args); + } + ], + 'friendsBackward' => [ + 'type' => $this->userConnection, + 'args' => Connection::backwardConnectionArgs(), + 'resolve' => function ($user, $args) { + return ArrayConnection::connectionFromArray($user['friends'], $args); + } + ] + ]; + } + ]); + + $this->friendEdge = Connection::createEdgeType([ + 'name' => 'Friend', + 'nodeType' => $this->userType, + 'resolveNode' => function ($edge) { + return $this->allUsers[$edge['node']]; + }, + 'edgeFields' => function() { + return [ + 'friendshipTime' => [ + 'type' => Type::string(), + 'resolve' => function() { return 'Yesterday'; } + ] + ]; + } + ]); + + $this->friendConnection = Connection::createConnectionType([ + 'name' => 'Friend', + 'nodeType' => $this->userType, + 'edgeType' => $this->friendEdge, + 'connectionFields' => function() { + return [ + 'totalCount' => [ + 'type' => Type::int(), + 'resolve' => function() { + return count($this->allUsers) -1; + } + ] + ]; + } + ]); + + $this->userEdge = Connection::createEdgeType([ + 'nodeType' => $this->userType, + 'resolveNode' => function ($edge) { + return $this->allUsers[$edge['node']]; + } + ]); + + $this->userConnection = Connection::createConnectionType([ + 'nodeType' => $this->userType, + 'edgeType' => $this->userEdge + ]); + + $this->queryType = new ObjectType([ + 'name' => 'Query', + 'fields' => function() { + return [ + 'user' => [ + 'type' => $this->userType, + 'resolve' => function() { + return $this->allUsers[0]; + } + ] + ]; + } + ]); + + $this->schema = new Schema([ + 'query' => $this->queryType + ]); + } + + public function testIncludesConnectionAndEdgeFields() + { + $query = 'query FriendsQuery { + user { + friends(first: 2) { + totalCount + edges { + friendshipTime + node { + name + } + } + } + } + }'; + + $expected = [ + 'user' => [ + 'friends' => [ + 'totalCount' => 4, + 'edges' => [ + [ + 'friendshipTime' => 'Yesterday', + 'node' => [ + 'name' => 'Nick' + ] + ], + [ + 'friendshipTime' => 'Yesterday', + 'node' => [ + 'name' => 'Lee' + ] + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testWorksWithForwardConnectionArgs() + { + $query = 'query FriendsQuery { + user { + friendsForward(first: 2) { + edges { + node { + name + } + } + } + } + }'; + $expected = [ + 'user' => [ + 'friendsForward' => [ + 'edges' => [ + [ + 'node' => [ + 'name' => 'Nick' + ] + ], + [ + 'node' => [ + 'name' => 'Lee' + ] + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testWorksWithBackwardConnectionArgs() + { + $query = 'query FriendsQuery { + user { + friendsBackward(last: 2) { + edges { + node { + name + } + } + } + } + }'; + + $expected = [ + 'user' => [ + 'friendsBackward' => [ + 'edges' => [ + [ + 'node' => [ + 'name' => 'Joe' + ] + ], + [ + 'node' => [ + 'name' => 'Tim' + ] + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + /** + * Helper function to test a query and the expected response. + */ + protected function assertValidQuery($query, $expected) + { + $result = GraphQL::executeQuery($this->schema, $query)->toArray(); + $this->assertEquals(['data' => $expected], $result); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Mutation/MutationTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Mutation/MutationTest.php new file mode 100644 index 00000000..fa9147c6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Mutation/MutationTest.php @@ -0,0 +1,565 @@ +simpleMutation = Mutation::mutationWithClientMutationId([ + 'name' => 'SimpleMutation', + 'inputFields' => [], + 'outputFields' => [ + 'result' => [ + 'type' => Type::int() + ] + ], + 'mutateAndGetPayload' => function () { + return ['result' => 1]; + } + ]); + + $this->simpleMutationWithDescription = Mutation::mutationWithClientMutationId([ + 'name' => 'SimpleMutationWithDescription', + 'description' => 'Simple Mutation Description', + 'inputFields' => [], + 'outputFields' => [ + 'result' => [ + 'type' => Type::int() + ] + ], + 'mutateAndGetPayload' => function () { + return ['result' => 1]; + } + ]); + + $this->simpleMutationWithDeprecationReason = Mutation::mutationWithClientMutationId([ + 'name' => 'SimpleMutationWithDeprecationReason', + 'inputFields' => [], + 'outputFields' => [ + 'result' => [ + 'type' => Type::int() + ] + ], + 'mutateAndGetPayload' => function () { + return ['result' => 1]; + }, + 'deprecationReason' => 'Just because' + ]); + + $this->simpleMutationWithThunkFields = Mutation::mutationWithClientMutationId([ + 'name' => 'SimpleMutationWithThunkFields', + 'inputFields' => function() { + return [ + 'inputData' => [ + 'type' => Type::int() + ] + ]; + }, + 'outputFields' => function() { + return [ + 'result' => [ + 'type' => Type::int() + ] + ]; + }, + 'mutateAndGetPayload' => function($inputData) { + return [ + 'result' => $inputData['inputData'] + ]; + } + ]); + + $userType = new ObjectType([ + 'name' => 'User', + 'fields' => [ + 'name' => [ + 'type' => Type::string() + ] + ] + ]); + + $this->edgeMutation = Mutation::mutationWithClientMutationId([ + 'name' => 'EdgeMutation', + 'inputFields' => [], + 'outputFields' => [ + 'result' => [ + 'type' => Connection::createEdgeType(['nodeType' => $userType ]) + ] + ], + 'mutateAndGetPayload' => function () { + return ['result' => ['node' => ['name' => 'Robert'], 'cursor' => 'SWxvdmVHcmFwaFFM']]; + } + ]); + + $this->mutation = new ObjectType([ + 'name' => 'Mutation', + 'fields' => [ + 'simpleMutation' => $this->simpleMutation, + 'simpleMutationWithDescription' => $this->simpleMutationWithDescription, + 'simpleMutationWithDeprecationReason' => $this->simpleMutationWithDeprecationReason, + 'simpleMutationWithThunkFields' => $this->simpleMutationWithThunkFields, + 'edgeMutation' => $this->edgeMutation + ] + ]); + + $this->schema = new Schema([ + 'mutation' => $this->mutation, + 'query' => $this->mutation + ]); + } + + public function testRequiresAnArgument() { + $query = 'mutation M { + simpleMutation { + result + } + }'; + + $result = GraphQL::executeQuery($this->schema, $query)->toArray(); + + $this->assertEquals(count($result['errors']), 1); + $this->assertEquals($result['errors'][0]['message'], 'Field "simpleMutation" argument "input" of type "SimpleMutationInput!" is required but not provided.'); + } + + public function testReturnsTheSameClientMutationID() + { + $query = 'mutation M { + simpleMutation(input: {clientMutationId: "abc"}) { + result + clientMutationId + } + }'; + + $expected = [ + 'simpleMutation' => [ + 'result' => 1, + 'clientMutationId' => 'abc' + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testReturnsNullWithOmittedClientMutationID() + { + $query = 'mutation M { + simpleMutation(input: {}) { + result + clientMutationId + } + }'; + + $expected = [ + 'simpleMutation' => [ + 'result' => 1, + 'clientMutationId' => null + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testSupportsEdgeAsOutputField() + { + $query = 'mutation M { + edgeMutation(input: {clientMutationId: "abc"}) { + result { + node { + name + } + cursor + } + clientMutationId + } + }'; + + $expected = [ + 'edgeMutation' => [ + 'result' => [ + 'node' => ['name' => 'Robert'], + 'cursor' => 'SWxvdmVHcmFwaFFM' + ], + 'clientMutationId' => 'abc' + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testIntrospection() + { + $query = '{ + __type(name: "SimpleMutationInput") { + name + kind + inputFields { + name + type { + name + kind + ofType { + name + kind + } + } + } + } + }'; + + $expected = [ + '__type' => [ + 'name' => 'SimpleMutationInput', + 'kind' => 'INPUT_OBJECT', + 'inputFields' => [ + [ + 'name' => 'clientMutationId', + 'type' => [ + 'name' => 'String', + 'kind' => 'SCALAR', + 'ofType' => null + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testContainsCorrectPayload() { + $query = '{ + __type(name: "SimpleMutationPayload") { + name + kind + fields { + name + type { + name + kind + ofType { + name + kind + } + } + } + } + }'; + + $expected = [ + '__type' => [ + 'name' => 'SimpleMutationPayload', + 'kind' => 'OBJECT', + 'fields' => [ + [ + 'name' => 'result', + 'type' => [ + 'name' => 'Int', + 'kind' => 'SCALAR', + 'ofType' => null + ] + ], + [ + 'name' => 'clientMutationId', + 'type' => [ + 'name' => 'String', + 'kind' => 'SCALAR', + 'ofType' => null + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testContainsCorrectField() + { + $query = '{ + __schema { + mutationType { + fields { + name + args { + name + type { + name + kind + ofType { + name + kind + } + } + } + type { + name + kind + } + } + } + } + }'; + + $expected = [ + '__schema' => [ + 'mutationType' => [ + 'fields' => [ + [ + 'name' => 'simpleMutation', + 'args' => [ + [ + 'name' => 'input', + 'type' => [ + 'name' => null, + 'kind' => 'NON_NULL', + 'ofType' => [ + 'name' => 'SimpleMutationInput', + 'kind' => 'INPUT_OBJECT' + ] + ], + ] + ], + 'type' => [ + 'name' => 'SimpleMutationPayload', + 'kind' => 'OBJECT', + ] + ], + [ + 'name' => 'simpleMutationWithDescription', + 'args' => [ + [ + 'name' => 'input', + 'type' => [ + 'name' => null, + 'kind' => 'NON_NULL', + 'ofType' => [ + 'name' => 'SimpleMutationWithDescriptionInput', + 'kind' => 'INPUT_OBJECT' + ] + ], + ] + ], + 'type' => [ + 'name' => 'SimpleMutationWithDescriptionPayload', + 'kind' => 'OBJECT', + ] + ], + [ + 'name' => 'simpleMutationWithThunkFields', + 'args' => [ + [ + 'name' => 'input', + 'type' => [ + 'name' => null, + 'kind' => 'NON_NULL', + 'ofType' => [ + 'name' => 'SimpleMutationWithThunkFieldsInput', + 'kind' => 'INPUT_OBJECT' + ] + ], + ] + ], + 'type' => [ + 'name' => 'SimpleMutationWithThunkFieldsPayload', + 'kind' => 'OBJECT', + ] + ], + [ + 'name' => 'edgeMutation', + 'args' => [ + [ + 'name' => 'input', + 'type' => [ + 'name' => null, + 'kind' => 'NON_NULL', + 'ofType' => [ + 'name' => 'EdgeMutationInput', + 'kind' => 'INPUT_OBJECT' + ] + ], + ] + ], + 'type' => [ + 'name' => 'EdgeMutationPayload', + 'kind' => 'OBJECT', + ] + ], + /* + * Promises not implemented right now + [ + 'name' => 'simplePromiseMutation', + 'args' => [ + [ + 'name' => 'input', + 'type' => [ + 'name' => null, + 'kind' => 'NON_NULL', + 'ofType' => [ + 'name' => 'SimplePromiseMutationInput', + 'kind' => 'INPUT_OBJECT' + ] + ], + ] + ], + 'type' => [ + 'name' => 'SimplePromiseMutationPayload', + 'kind' => 'OBJECT', + ] + ]*/ + ] + ] + ] + ]; + + $result = GraphQL::executeQuery($this->schema, $query)->toArray(); + + $this->assertValidQuery($query, $expected); + } + + public function testContainsCorrectDescriptions() { + $query = '{ + __schema { + mutationType { + fields { + name + description + } + } + } + }'; + + $expected = [ + '__schema' => [ + 'mutationType' => [ + 'fields' => [ + [ + 'name' => 'simpleMutation', + 'description' => null + ], + [ + 'name' => 'simpleMutationWithDescription', + 'description' => 'Simple Mutation Description' + ], + [ + 'name' => 'simpleMutationWithThunkFields', + 'description' => null + ], + [ + 'name' => 'edgeMutation', + 'description' => null + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testContainsCorrectDeprecationReasons() { + $query = '{ + __schema { + mutationType { + fields(includeDeprecated: true) { + name + isDeprecated + deprecationReason + } + } + } + }'; + + $expected = [ + '__schema' => [ + 'mutationType' => [ + 'fields' => [ + [ + 'name' => 'simpleMutation', + 'isDeprecated' => false, + 'deprecationReason' => null + ], + [ + 'name' => 'simpleMutationWithDescription', + 'isDeprecated' => false, + 'deprecationReason' => null + ], + [ + 'name' => 'simpleMutationWithDeprecationReason', + 'isDeprecated' => true, + 'deprecationReason' => 'Just because', + ], + [ + 'name' => 'simpleMutationWithThunkFields', + 'isDeprecated' => false, + 'deprecationReason' => null + ], + [ + 'name' => 'edgeMutation', + 'isDeprecated' => false, + 'deprecationReason' => null + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + /** + * Helper function to test a query and the expected response. + */ + protected function assertValidQuery($query, $expected) + { + $this->assertEquals(['data' => $expected], GraphQL::executeQuery($this->schema, $query)->toArray()); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/NodeTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/NodeTest.php new file mode 100644 index 00000000..a3050baa --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/NodeTest.php @@ -0,0 +1,411 @@ + [ + 'id' => 1 + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testGetsCorrectIDForPhotos() { + $query = '{ + node(id: "4") { + id + } + }'; + + $expected = [ + 'node' => [ + 'id' => 4 + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testGetsCorrectNameForUsers() { + $query = '{ + node(id: "1") { + id + ... on User { + name + } + } + }'; + + $expected = [ + 'node' => [ + 'id' => '1', + 'name' => 'John Doe' + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testGetsCorrectWidthForPhotos() { + $query = '{ + node(id: "4") { + id + ... on Photo { + width + } + } + }'; + + $expected = [ + 'node' => [ + 'id' => '4', + 'width' => 400 + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testGetsCorrectTypeNameForUsers() { + $query = '{ + node(id: "1") { + id + __typename + } + }'; + + $expected = [ + 'node' => [ + 'id' => '1', + '__typename' => 'User' + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testCorrectWidthForPhotos() { + $query = '{ + node(id: "4") { + id + __typename + } + }'; + + $expected = [ + 'node' => [ + 'id' => '4', + '__typename' => 'Photo' + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testIgnoresPhotoFragmentsOnUser() { + $query = '{ + node(id: "1") { + id + ... on Photo { + width + } + } + }'; + $expected = [ + 'node' => [ + 'id' => '1' + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testReturnsNullForBadIDs() { + $query = '{ + node(id: "5") { + id + } + }'; + + $expected = [ + 'node' => null + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testHasCorrectNodeInterface() { + $query = '{ + __type(name: "Node") { + name + kind + fields { + name + type { + kind + ofType { + name + kind + } + } + } + } + }'; + + $expected = [ + '__type' => [ + 'name' => 'Node', + 'kind' => 'INTERFACE', + 'fields' => [ + [ + 'name' => 'id', + 'type' => [ + 'kind' => 'NON_NULL', + 'ofType' => [ + 'name' => 'ID', + 'kind' => 'SCALAR' + ] + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + public function testHasCorrectNodeRootField() { + $query = '{ + __schema { + queryType { + fields { + name + type { + name + kind + } + args { + name + type { + kind + ofType { + name + kind + } + } + } + } + } + } + }'; + + $expected = [ + '__schema' => [ + 'queryType' => [ + 'fields' => [ + [ + 'name' => 'node', + 'type' => [ + 'name' => 'Node', + 'kind' => 'INTERFACE' + ], + 'args' => [ + [ + 'name' => 'id', + 'type' => [ + 'kind' => 'NON_NULL', + 'ofType' => [ + 'name' => 'ID', + 'kind' => 'SCALAR' + ] + ] + ] + ] + ] + ] + ] + ] + ]; + + $this->assertValidQuery($query, $expected); + } + + /** + * Returns test schema + * + * @return Schema + */ + protected function getSchema() { + return new Schema([ + 'query' => $this->getQueryType(), + + // We have to pass the types here manually because graphql-php cannot + // recognize types that are only available through interfaces + // https://github.com/webonyx/graphql-php/issues/38 + 'types' => [ + self::$userType, + self::$photoType + ] + ]); + } + + /** + * Returns test query type + * + * @return ObjectType + */ + protected function getQueryType() { + $nodeField = $this->getNodeDefinitions(); + return new ObjectType([ + 'name' => 'Query', + 'fields' => [ + 'node' => $nodeField['nodeField'] + ] + ]); + } + + /** + * Returns node definitions + * + * @return array + */ + protected function getNodeDefinitions() { + if (!self::$nodeDefinition){ + self::$nodeDefinition = Node::nodeDefinitions( + function($id, $context, ResolveInfo $info) { + $userData = $this->getUserData(); + if (array_key_exists($id, $userData)){ + return $userData[$id]; + } else { + $photoData = $this->getPhotoData(); + if (array_key_exists($id, $photoData)){ + return $photoData[$id]; + } + } + }, + function($obj) { + if (array_key_exists($obj['id'], $this->getUserData())){ + return self::$userType; + } else { + return self::$photoType; + } + } + ); + + self::$userType = new ObjectType([ + 'name' => 'User', + 'fields' => [ + 'id' => [ + 'type' => Type::nonNull(Type::id()), + ], + 'name' => [ + 'type' => Type::string() + ] + ], + 'interfaces' => [self::$nodeDefinition['nodeInterface']] + ]); + + self::$photoType = new ObjectType([ + 'name' => 'Photo', + 'fields' => [ + 'id' => [ + 'type' => Type::nonNull(Type::id()) + ], + 'width' => [ + 'type' => Type::int() + ] + ], + 'interfaces' => [self::$nodeDefinition['nodeInterface']] + ]); + } + return self::$nodeDefinition; + } + + /** + * Returns photo data + * + * @return array + */ + protected function getPhotoData() { + return [ + '3' => [ + 'id' => 3, + 'width' => 300 + ], + '4' => [ + 'id' => 4, + 'width' => 400 + ] + ]; + } + + /** + * Returns user data + * + * @return array + */ + protected function getUserData() { + return [ + '1' => [ + 'id' => 1, + 'name' => 'John Doe' + ], + '2' => [ + 'id' => 2, + 'name' => 'Jane Smith' + ] + ]; + } + + /** + * Helper function to test a query and the expected response. + */ + private function assertValidQuery($query, $expected) + { + $result = GraphQL::executeQuery($this->getSchema(), $query)->toArray(); + + $this->assertEquals(['data' => $expected], $result); + } + +} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/PluralTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/PluralTest.php new file mode 100644 index 00000000..6bae1a49 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/PluralTest.php @@ -0,0 +1,186 @@ + 'User', + 'fields' => function() { + return [ + 'username' => [ + 'type' => Type::string() + ], + 'url' => [ + 'type' => Type::string() + ] + ]; + } + ]); + + $queryType = new ObjectType([ + 'name' => 'Query', + 'fields' => function() use ($userType) { + return [ + 'usernames' => Plural::pluralIdentifyingRootField([ + 'argName' => 'usernames', + 'description' => 'Map from a username to the user', + 'inputType' => Type::string(), + 'outputType' => $userType, + 'resolveSingleInput' => function ($userName, $context, $info) { + return [ + 'username' => $userName, + 'url' => 'www.facebook.com/' . $userName . '?lang=' . $info->rootValue['lang'] + ]; + } + ]) + ]; + } + ]); + + return new Schema([ + 'query' => $queryType + ]); + } + + public function testAllowsFetching() { + $query = '{ + usernames(usernames:["dschafer", "leebyron", "schrockn"]) { + username + url + } + }'; + + $expected = array ( + 'usernames' => + array ( + 0 => + array ( + 'username' => 'dschafer', + 'url' => 'www.facebook.com/dschafer?lang=en', + ), + 1 => + array ( + 'username' => 'leebyron', + 'url' => 'www.facebook.com/leebyron?lang=en', + ), + 2 => + array ( + 'username' => 'schrockn', + 'url' => 'www.facebook.com/schrockn?lang=en', + ), + ), + ); + + $this->assertValidQuery($query, $expected); + } + + public function testCorrectlyIntrospects() + { + $query = '{ + __schema { + queryType { + fields { + name + args { + name + type { + kind + ofType { + kind + ofType { + kind + ofType { + name + kind + } + } + } + } + } + type { + kind + ofType { + name + kind + } + } + } + } + } + }'; + $expected = array ( + '__schema' => + array ( + 'queryType' => + array ( + 'fields' => + array ( + 0 => + array ( + 'name' => 'usernames', + 'args' => + array ( + 0 => + array ( + 'name' => 'usernames', + 'type' => + array ( + 'kind' => 'NON_NULL', + 'ofType' => + array ( + 'kind' => 'LIST', + 'ofType' => + array ( + 'kind' => 'NON_NULL', + 'ofType' => + array ( + 'name' => 'String', + 'kind' => 'SCALAR', + ), + ), + ), + ), + ), + ), + 'type' => + array ( + 'kind' => 'LIST', + 'ofType' => + array ( + 'name' => 'User', + 'kind' => 'OBJECT', + ), + ), + ), + ), + ), + ), + ); + + $this->assertValidQuery($query, $expected); + } + + /** + * Helper function to test a query and the expected response. + */ + private function assertValidQuery($query, $expected) + { + $result = GraphQL::executeQuery($this->getSchema(), $query, ['lang' => 'en'])->toArray(); + $this->assertEquals(['data' => $expected], $result); + } +} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/RelayTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/RelayTest.php new file mode 100644 index 00000000..0c6e4175 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/RelayTest.php @@ -0,0 +1,73 @@ +assertEquals( + Connection::forwardConnectionArgs(), + Relay::forwardConnectionArgs() + ); + } + + public function testBackwardConnectionArgs() + { + $this->assertEquals( + Connection::backwardConnectionArgs(), + Relay::backwardConnectionArgs() + ); + } + + public function testConnectionArgs() + { + $this->assertEquals( + Connection::connectionArgs(), + Relay::connectionArgs() + ); + } + + public function testConnectionDefinitions() + { + $nodeType = new ObjectType(['name' => 'test']); + $config = ['nodeType' => $nodeType]; + + $this->assertEquals( + Connection::connectionDefinitions($config), + Relay::connectionDefinitions($config) + ); + } + + public function testConnectionType() + { + $nodeType = new ObjectType(['name' => 'test']); + $config = ['nodeType' => $nodeType]; + + $this->assertEquals( + Connection::createConnectionType($config), + Relay::connectionType($config) + ); + } + + public function testEdgeType() + { + $nodeType = new ObjectType(['name' => 'test']); + $config = ['nodeType' => $nodeType]; + + $this->assertEquals( + Connection::createEdgeType($config), + Relay::edgeType($config) + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsConnectionTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsConnectionTest.php new file mode 100644 index 00000000..d060e493 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsConnectionTest.php @@ -0,0 +1,291 @@ + + array ( + 'name' => 'Alliance to Restore the Republic', + 'ships' => + array ( + 'edges' => + array ( + 0 => + array ( + 'node' => + array ( + 'name' => 'X-Wing', + ), + ), + ), + ), + ), + ); + + $this->assertValidQuery($query, $expected); + } + + public function testFetchesTheFirstTwoShipsOfTheRebelsWithACursor() + { + $query = 'query MoreRebelShipsQuery { + rebels { + name, + ships(first: 2) { + edges { + cursor, + node { + name + } + } + } + } + }'; + + $expected = array ( + 'rebels' => + array ( + 'name' => 'Alliance to Restore the Republic', + 'ships' => + array ( + 'edges' => + array ( + 0 => + array ( + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', + 'node' => + array ( + 'name' => 'X-Wing', + ), + ), + 1 => + array ( + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', + 'node' => + array ( + 'name' => 'Y-Wing', + ), + ), + ), + ), + ), + ); + + $this->assertValidQuery($query, $expected); + } + + public function testFetchesTheNextThreeShipsOfTHeRebelsWithACursor() + { + $query = 'query EndOfRebelShipsQuery { + rebels { + name, + ships(first: 3 after: "YXJyYXljb25uZWN0aW9uOjE=") { + edges { + cursor, + node { + name + } + } + } + } + }'; + + $expected = array ( + 'rebels' => + array ( + 'name' => 'Alliance to Restore the Republic', + 'ships' => + array ( + 'edges' => + array ( + 0 => + array ( + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', + 'node' => + array ( + 'name' => 'A-Wing', + ), + ), + 1 => + array ( + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', + 'node' => + array ( + 'name' => 'Millenium Falcon', + ), + ), + 2 => + array ( + 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', + 'node' => + array ( + 'name' => 'Home One', + ), + ), + ), + ), + ), + ); + + $this->assertValidQuery($query, $expected); + } + + public function testFetchesNoShipsOfTheRebelsAtTheEndOfConnection() + { + $query = 'query RebelsQuery { + rebels { + name, + ships(first: 3 after: "YXJyYXljb25uZWN0aW9uOjQ=") { + edges { + cursor, + node { + name + } + } + } + } + }'; + + $expected = array ( + 'rebels' => + array ( + 'name' => 'Alliance to Restore the Republic', + 'ships' => + array ( + 'edges' => + array ( + ), + ), + ), + ); + + $this->assertValidQuery($query, $expected); + } + + public function testIdentifiesTheEndOfTheList() + { + $query = 'query EndOfRebelShipsQuery { + rebels { + name, + originalShips: ships(first: 2) { + edges { + node { + name + } + } + pageInfo { + hasNextPage + } + } + moreShips: ships(first: 3 after: "YXJyYXljb25uZWN0aW9uOjE=") { + edges { + node { + name + } + } + pageInfo { + hasNextPage + } + } + } + }'; + $expected = array ( + 'rebels' => + array ( + 'name' => 'Alliance to Restore the Republic', + 'originalShips' => + array ( + 'edges' => + array ( + 0 => + array ( + 'node' => + array ( + 'name' => 'X-Wing', + ), + ), + 1 => + array ( + 'node' => + array ( + 'name' => 'Y-Wing', + ), + ), + ), + 'pageInfo' => + array ( + 'hasNextPage' => true, + ), + ), + 'moreShips' => + array ( + 'edges' => + array ( + 0 => + array ( + 'node' => + array ( + 'name' => 'A-Wing', + ), + ), + 1 => + array ( + 'node' => + array ( + 'name' => 'Millenium Falcon', + ), + ), + 2 => + array ( + 'node' => + array ( + 'name' => 'Home One', + ), + ), + ), + 'pageInfo' => + array ( + 'hasNextPage' => false, + ), + ), + ), + ); + + $this->assertValidQuery($query, $expected); + } + + /** + * Helper function to test a query and the expected response. + */ + private function assertValidQuery($query, $expected) + { + $result = GraphQL::executeQuery(StarWarsSchema::getSchema(), $query)->toArray(); + + $this->assertEquals(['data' => $expected], $result); + } +} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsData.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsData.php new file mode 100644 index 00000000..bcbbb49b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsData.php @@ -0,0 +1,139 @@ + '1', + 'name' => 'X-Wing' + ]; + + protected static $ywing = [ + 'id' => '2', + 'name' => 'Y-Wing' + ]; + + protected static $awing = [ + 'id' => '3', + 'name' => 'A-Wing' + ]; + + protected static $falcon = [ + 'id' => '4', + 'name' => 'Millenium Falcon' + ]; + + protected static $homeOne = [ + 'id' => '5', + 'name' => 'Home One' + ]; + + protected static $tieFighter = [ + 'id' => '6', + 'name' => 'TIE Fighter' + ]; + + protected static $tieInterceptor = [ + 'id' => '7', + 'name' => 'TIE Interceptor' + ]; + + protected static $executor = [ + 'id' => '8', + 'name' => 'TIE Interceptor' + ]; + + protected static $rebels = [ + 'id' => '1', + 'name' => 'Alliance to Restore the Republic', + 'ships' => ['1', '2', '3', '4', '5'] + ]; + + protected static $empire = [ + 'id' => '2', + 'name' => 'Galactic Empire', + 'ships' => ['6', '7', '8'] + ]; + + protected static $nextShip = 9; + + protected static $data; + + /** + * Returns the data object + * + * @return array $array + */ + protected static function getData() + { + if (self::$data === null) { + self::$data = [ + 'Faction' => [ + '1' => self::$rebels, + '2' => self::$empire + ], + 'Ship' => [ + '1' => self::$xwing, + '2' => self::$ywing, + '3' => self::$awing, + '4' => self::$falcon, + '5' => self::$homeOne, + '6' => self::$tieFighter, + '7' => self::$tieInterceptor, + '8' => self::$executor + ] + ]; + } + return self::$data; + } + + /** + * @param $shipName + * @param $factionId + * @return array + */ + public static function createShip($shipName, $factionId) + { + $data = self::getData(); + + $newShip = [ + 'id' => (string) self::$nextShip++, + 'name' => $shipName + ]; + $data['Ship'][$newShip['id']] = $newShip; + $data['Faction'][$factionId]['ships'][] = $newShip['id']; + + // Save + self::$data = $data; + + return $newShip; + } + + public static function getShip($id) + { + $data = self::getData(); + return $data['Ship'][$id]; + } + + public static function getFaction($id) + { + $data = self::getData(); + return $data['Faction'][$id]; + } + + public static function getRebels() + { + return self::$rebels; + } + + public static function getEmpire() + { + return self::$empire; + } +} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsMutationTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsMutationTest.php new file mode 100644 index 00000000..b7d6c247 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsMutationTest.php @@ -0,0 +1,60 @@ + + array ( + 'shipName' => 'B-Wing', + 'factionId' => '1', + 'clientMutationId' => 'abcde', + ), + ); + + $expected = array ( + 'introduceShip' => + array ( + 'ship' => + array ( + 'id' => 'U2hpcDo5', + 'name' => 'B-Wing', + ), + 'faction' => + array ( + 'name' => 'Alliance to Restore the Republic', + ), + 'clientMutationId' => 'abcde', + ), + ); + + $result = GraphQL::executeQuery(StarWarsSchema::getSchema(), $mutation, null, null, $params)->toArray(); + + $this->assertEquals(['data' => $expected], $result); + } +} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsObjectIdentificationTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsObjectIdentificationTest.php new file mode 100644 index 00000000..78eea925 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsObjectIdentificationTest.php @@ -0,0 +1,131 @@ + + array ( + 'id' => 'RmFjdGlvbjox', + 'name' => 'Alliance to Restore the Republic', + ), + ); + + $this->assertValidQuery($query, $expected); + } + + public function testRefetchesTheRebels() + { + $query = 'query RebelsRefetchQuery { + node(id: "RmFjdGlvbjox") { + id + ... on Faction { + name + } + } + }'; + + $expected = array ( + 'node' => + array ( + 'id' => 'RmFjdGlvbjox', + 'name' => 'Alliance to Restore the Republic', + ), + ); + + $this->assertValidQuery($query, $expected); + } + + public function testFetchesTheIDAndNameOfTheEmpire() + { + $query = 'query EmpireQuery { + empire { + id + name + } + }'; + + $expected = array ( + 'empire' => + array ( + 'id' => 'RmFjdGlvbjoy', + 'name' => 'Galactic Empire', + ), + ); + + $this->assertValidQuery($query, $expected); + } + + public function testRefetchesTheEmpire() + { + $query = 'query EmpireRefetchQuery { + node(id: "RmFjdGlvbjoy") { + id + ... on Faction { + name + } + } + }'; + + $expected = array ( + 'node' => + array ( + 'id' => 'RmFjdGlvbjoy', + 'name' => 'Galactic Empire', + ), + ); + + $this->assertValidQuery($query, $expected); + } + + public function testRefetchesTheXWing() + { + $query = 'query XWingRefetchQuery { + node(id: "U2hpcDox") { + id + ... on Ship { + name + } + } + }'; + + $expected = array ( + 'node' => + array ( + 'id' => 'U2hpcDox', + 'name' => 'X-Wing', + ), + ); + + $this->assertValidQuery($query, $expected); + } + + /** + * Helper function to test a query and the expected response. + */ + private function assertValidQuery($query, $expected) + { + $result = GraphQL::executeQuery(StarWarsSchema::getSchema(), $query)->toArray(); + + $this->assertEquals(['data' => $expected], $result); + } +} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsSchema.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsSchema.php new file mode 100644 index 00000000..b2897919 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsSchema.php @@ -0,0 +1,379 @@ + 'Ship', + 'description' => 'A ship in the Star Wars saga', + 'fields' => function() { + return [ + 'id' => Relay::globalIdField(), + 'name' => [ + 'type' => Type::string(), + 'description' => 'The name of the ship.' + ] + ]; + }, + 'interfaces' => [$nodeDefinition['nodeInterface']] + ]); + self::$shipType = $shipType; + } + return self::$shipType; + } + + /** + * We define our faction type, which implements the node interface. + * + * This implements the following type system shorthand: + * type Faction : Node { + * id: String! + * name: String + * ships: ShipConnection + * } + * + * @return ObjectType + */ + protected static function getFactionType() + { + if (self::$factionType === null){ + $shipConnection = self::getShipConnection(); + $nodeDefinition = self::getNodeDefinition(); + + $factionType = new ObjectType([ + 'name' => 'Faction', + 'description' => 'A faction in the Star Wars saga', + 'fields' => function() use ($shipConnection) { + return [ + 'id' => Relay::globalIdField(), + 'name' => [ + 'type' => Type::string(), + 'description' => 'The name of the faction.' + ], + 'ships' => [ + 'type' => $shipConnection['connectionType'], + 'description' => 'The ships used by the faction.', + 'args' => Relay::connectionArgs(), + 'resolve' => function($faction, $args) { + // Map IDs from faction back to ships + $data = array_map(function($id) { + return StarWarsData::getShip($id); + }, $faction['ships']); + return Relay::connectionFromArray($data, $args); + } + ] + ]; + }, + 'interfaces' => [$nodeDefinition['nodeInterface']] + ]); + + self::$factionType = $factionType; + } + + return self::$factionType; + } + + /** + * We define a connection between a faction and its ships. + * + * connectionType implements the following type system shorthand: + * type ShipConnection { + * edges: [ShipEdge] + * pageInfo: PageInfo! + * } + * + * connectionType has an edges field - a list of edgeTypes that implement the + * following type system shorthand: + * type ShipEdge { + * cursor: String! + * node: Ship + * } + */ + protected static function getShipConnection() + { + if (self::$shipConnection === null){ + $shipType = self::getShipType(); + $shipConnection = Relay::connectionDefinitions([ + 'nodeType' => $shipType + ]); + + self::$shipConnection = $shipConnection; + } + + return self::$shipConnection; + } + + /** + * This will return a GraphQLFieldConfig for our ship + * mutation. + * + * It creates these two types implicitly: + * input IntroduceShipInput { + * clientMutationId: string! + * shipName: string! + * factionId: ID! + * } + * + * input IntroduceShipPayload { + * clientMutationId: string! + * ship: Ship + * faction: Faction + * } + */ + public static function getShipMutation() + { + if (self::$shipMutation === null){ + $shipType = self::getShipType(); + $factionType = self::getFactionType(); + + $shipMutation = Relay::mutationWithClientMutationId([ + 'name' => 'IntroduceShip', + 'inputFields' => [ + 'shipName' => [ + 'type' => Type::nonNull(Type::string()) + ], + 'factionId' => [ + 'type' => Type::nonNull(Type::id()) + ] + ], + 'outputFields' => [ + 'ship' => [ + 'type' => $shipType, + 'resolve' => function ($payload) { + return StarWarsData::getShip($payload['shipId']); + } + ], + 'faction' => [ + 'type' => $factionType, + 'resolve' => function ($payload) { + return StarWarsData::getFaction($payload['factionId']); + } + ] + ], + 'mutateAndGetPayload' => function ($input) { + $newShip = StarWarsData::createShip($input['shipName'], $input['factionId']); + return [ + 'shipId' => $newShip['id'], + 'factionId' => $input['factionId'] + ]; + } + ]); + self::$shipMutation = $shipMutation; + } + + return self::$shipMutation; + } + + /** + * Returns the complete schema for StarWars tests + * + * @return Schema + */ + public static function getSchema() + { + $factionType = self::getFactionType(); + $nodeDefinition = self::getNodeDefinition(); + $shipMutation = self::getShipMutation(); + + /** + * This is the type that will be the root of our query, and the + * entry point into our schema. + * + * This implements the following type system shorthand: + * type Query { + * rebels: Faction + * empire: Faction + * node(id: String!): Node + * } + */ + $queryType = new ObjectType([ + 'name' => 'Query', + 'fields' => function () use ($factionType, $nodeDefinition) { + return [ + 'rebels' => [ + 'type' => $factionType, + 'resolve' => function (){ + return StarWarsData::getRebels(); + } + ], + 'empire' => [ + 'type' => $factionType, + 'resolve' => function () { + return StarWarsData::getEmpire(); + } + ], + 'node' => $nodeDefinition['nodeField'] + ]; + }, + ]); + + /** + * This is the type that will be the root of our mutations, and the + * entry point into performing writes in our schema. + * + * This implements the following type system shorthand: + * type Mutation { + * introduceShip(input IntroduceShipInput!): IntroduceShipPayload + * } + */ + $mutationType = new ObjectType([ + 'name' => 'Mutation', + 'fields' => function () use ($shipMutation) { + return [ + 'introduceShip' => $shipMutation + ]; + } + ]); + + /** + * Finally, we construct our schema (whose starting query type is the query + * type we defined above) and export it. + */ + $schema = new Schema([ + 'query' => $queryType, + 'mutation' => $mutationType + ]); + + return $schema; + } +} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/FUNDING.yml b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/FUNDING.yml new file mode 100644 index 00000000..0306338f --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/FUNDING.yml @@ -0,0 +1,2 @@ +# These are supported funding model platforms +open_collective: webonyx-graphql-php diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/workflows/validate.yml b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/workflows/validate.yml new file mode 100644 index 00000000..75cfb7ad --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/workflows/validate.yml @@ -0,0 +1,69 @@ +name: Validate + +on: + push: + branches: + tags: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2] + env: [ + 'EXECUTOR= DEPENDENCIES=--prefer-lowest', + 'EXECUTOR=coroutine DEPENDENCIES=--prefer-lowest', + 'EXECUTOR=', + 'EXECUTOR=coroutine', + ] + name: PHP ${{ matrix.php }} Test ${{ matrix.env }} + + steps: + - uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@2.18.1 + with: + php-version: ${{ matrix.php }} + coverage: none + extensions: json, mbstring + + - name: Remove dependencies not used in this job for PHP 8 compatibility + run: | + composer remove --dev --no-update phpbench/phpbench + composer remove --dev --no-update phpstan/phpstan + composer remove --dev --no-update phpstan/phpstan-phpunit + composer remove --dev --no-update phpstan/phpstan-strict-rules + composer remove --dev --no-update doctrine/coding-standard + + - name: Install Dependencies + run: composer update + + - name: Run unit tests + run: | + export $ENV + vendor/bin/phpunit --group default,ReactPromise + env: + ENV: ${{ matrix.env}} + + phpstan: + runs-on: ubuntu-latest + name: PHPStan + + steps: + - uses: actions/checkout@v2 + + - name: Install PHP + uses: shivammathur/setup-php@2.9.0 + with: + php-version: 7.4 + coverage: none + extensions: json, mbstring + + - name: Install Dependencies + run: composer install + + - name: PHPStan + run: composer stan diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/LICENSE b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/LICENSE new file mode 100644 index 00000000..8671fe43 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2015-present, Webonyx, LLC. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/UPGRADE.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/UPGRADE.md new file mode 100644 index 00000000..23813e60 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/UPGRADE.md @@ -0,0 +1,731 @@ +## v0.13.x > v14.x.x + +### BREAKING: Strict coercion of scalar types (#278) + +**Impact: Major** + +This change may break API clients if they were sending loose variable values. + +
+ See Examples + +Consider the following query: + +```graphql +query($intQueryVariable: Int) { + test(intInput: $intQueryVariable) +} +``` + +What happens if we pass non-integer values as `$intQueryVariable`: +``` +[true, false, 1, 0, 0.0, 'true', 'false', '1', '0', '0.0', [], [0,1]] +``` + +#### Integer coercion, changed behavior: + +``` +bool(true): + 0.13.x: coerced to int(1) + 14.x.x: Error: Variable "$queryVariable" got invalid value true; Expected type Int; Int cannot represent non-integer value: true + +bool(false): + 0.13.x: coerced to int(0) + 14.x.x: Error: Variable "$queryVariable" got invalid value false; Expected type Int; Int cannot represent non-integer value: false + +string(1) "1" + 0.13.x: was coerced to int(1) + 14.x.x: Error: Variable "$queryVariable" got invalid value "1"; Expected type Int; Int cannot represent non-integer value: 1 + +string(1) "0" + 0.13.x: was coerced to int(0) + 14.x.x: Error: Variable "$queryVariable" got invalid value "0"; Expected type Int; Int cannot represent non-integer value: 0 + +string(3) "0.0" + 0.13.x: was coerced to int(0) + 14.x.x: Error: Variable "$queryVariable" got invalid value "0.0"; Expected type Int; Int cannot represent non-integer value: 0.0 +``` + +Did not change: +``` +int(1): coerced to int(1) +int(0) was coerced to int(0) +float(0) was coerced to int(0) + +string(4) "true": + Error: Variable "$queryVariable" got invalid value "true"; Expected type Int; Int cannot represent non 32-bit signed integer value: true + +string(5) "false": + Error: Variable "$queryVariable" got invalid value "false"; Expected type Int; Int cannot represent non 32-bit signed integer value: false + +array(0) {} + Error: Variable "$queryVariable" got invalid value []; Expected type Int; Int cannot represent non 32-bit signed integer value: [] + +array(2) { [0]=> int(0) [1]=> int(1) } + Error: Variable "$queryVariable" got invalid value [0,1]; Expected type Int; Int cannot represent non 32-bit signed integer value: [0,1] +``` + +#### Float coercion, changed behavior: +```graphql +query($queryVariable: Float) { + test(floatInput: $queryVariable) +} +``` + +``` +bool(true) + 0.13.x: was coerced to float(1) + 14.x.x: Error: Variable "$queryVariable" got invalid value true; Expected type Float; Float cannot represent non numeric value: true + +bool(false) + 0.13.x: was coerced to float(0) + 14.x.x: Error: Variable "$queryVariable" got invalid value false; Expected type Float; Float cannot represent non numeric value: false + +string(1) "1" + 0.13.x: was coerced to float(1) + 14.x.x: Error: Variable "$queryVariable" got invalid value "1"; Expected type Float; Float cannot represent non numeric value: 1 + +string(1) "0" + 0.13.x: was coerced to float(0) + 14.x.x: Error: Variable "$queryVariable" got invalid value "0"; Expected type Float; Float cannot represent non numeric value: 0 + +string(3) "0.0" + 0.13.x: was coerced to float(0) + 14.x.x: Error: Variable "$queryVariable" got invalid value "0.0"; Expected type Float; Float cannot represent non numeric value: 0.0 +``` + +#### String coercion, changed behavior: +```graphql +query($queryVariable: String) { + test(stringInput: $queryVariable) +} +``` + +``` +bool(true) + 0.13.x: was coerced to string(1) "1" + 14.x.x: Error: Variable "$queryVariable" got invalid value true; Expected type String; String cannot represent a non string value: true + +bool(false) + 0.13.x: was coerced to string(0) "" + 14.x.x: Error: Variable "$queryVariable" got invalid value false; Expected type String; String cannot represent a non string value: false + +int(1) + 0.13.x: was coerced to string(1) "1" + 14.x.x: Error: Variable "$queryVariable" got invalid value 1; Expected type String; String cannot represent a non string value: 1 + +int(0) + 0.13.x: was coerced to string(1) "0" + 14.x.x: Error: Variable "$queryVariable" got invalid value 0; Expected type String; String cannot represent a non string value: 0 + +float(0) + 0.13.x: was coerced to string(1) "0" + 14.x.x: Error: Variable "$queryVariable" got invalid value 0; Expected type String; String cannot represent a non string value: 0 +``` + +#### Boolean coercion did not change. + +
+ +### Breaking: renamed classes and changed signatures + +**Impact: Medium** + +- Dropped previously deprecated `GraphQL\Schema`. Use `GraphQL\Type\Schema`. +- Renamed `GraphQL\Error\Debug` to `GraphQL\Error\DebugFlag`. +- Debug flags in `GraphQL\Executor\ExecutionResult`, `GraphQL\Error\FormattedError` and `GraphQL\Server\ServerConfig` + do not accept `boolean` value anymore but `int` only (pass values of `GraphQL\Error\DebugFlag` constants) +- `$positions` in `GraphQL\Error\Error` are not nullable anymore. Same can be expressesed by passing empty array. + +### BREAKING: Removed deprecated directive introspection fields (onOperation, onFragment, onField) + +**Impact: Minor** + +Could affect developer tools relying on old introspection format. +Replaced with [Directive Locations](https://spec.graphql.org/June2018/#sec-Type-System.Directives). + +### BREAKING: Changes in validation rules: + +**Impact: Minor** + + - Removal of `VariablesDefaultValueAllowed` validation rule. All variables may now specify a default value. + - Renamed `ProvidedNonNullArguments` to `ProvidedRequiredArguments` (no longer require values to be provided to non-null arguments which provide a default value). + +Could affect projects using custom sets of validation rules. + +### BREAKING: `GraphQL\Deferred` now extends `GraphQL\Executor\Promise\Adapter\SyncPromise` + +**Impact: Minor** + +Can only affect a few projects that were somehow customizing deferreds or the default sync promise adapter. + + +### BREAKING: renamed several types of dangerous/breaking changes (returned by `BreakingChangesFinder`): + +**Impact: Minor** + +Can affect projects relying on `BreakingChangesFinder` utility in their CI. + +Following types of changes were renamed: + +``` +- `NON_NULL_ARG_ADDED` to `REQUIRED_ARG_ADDED` +- `NON_NULL_INPUT_FIELD_ADDED` to `REQUIRED_INPUT_FIELD_ADDED` +- `NON_NULL_DIRECTIVE_ARG_ADDED` to `REQUIRED_DIRECTIVE_ARG_ADDED` +- `NULLABLE_INPUT_FIELD_ADDED` to `OPTIONAL_INPUT_FIELD_ADDED` +- `NULLABLE_ARG_ADDED` to `OPTIONAL_ARG_ADDED` +``` + +### Breaking: Dropped `GraphQL\Error\Error::$message` + +**Impact: Minor** + +Use `GraphQL\Error\Error->getMessage()` instead. + +### Breaking: change TypeKind constants + +**Impact: Minor** + +The constants in `\GraphQL\Type\TypeKind` were partly renamed and their values +have been changed to match their name instead of a numeric index. + +### Breaking: some error messages were changed + +**Impact: Minor** + +Can affect projects relying on error messages parsing. + +One example: added quotes around `parentType.fieldName` in error message: +```diff +- Cannot return null for non-nullable field parentType.fieldName. ++ Cannot return null for non-nullable field "parentType.fieldName". +``` +But expect other simiar changes like this. + +## Upgrade v0.12.x > v0.13.x + +### Breaking (major): minimum supported version of PHP +New minimum required version of PHP is **7.1+** + +### Breaking (major): default errors formatting changed according to spec +**Category** and extensions assigned to errors are shown under `extensions` key +```php +$e = new Error( + 'msg', + null, + null, + null, + null, + null, + ['foo' => 'bar'] +); +``` +Formatting before the change: +``` +'errors' => [ + [ + 'message' => 'msg', + 'category' => 'graphql', + 'foo' => 'bar' + ] +] +``` +After the change: +``` +'errors' => [ + [ + 'message' => 'msg', + 'extensions' => [ + 'category' => 'graphql', + 'foo' => 'bar', + ], + ] +] +``` + +Note: if error extensions contain `category` key - it has a priority over default category. + +You can always switch to [custom error formatting](https://webonyx.github.io/graphql-php/error-handling/#custom-error-handling-and-formatting) to revert to the old format. + +### Try it: Experimental Executor with improved performance +It is disabled by default. To enable it, do the following +```php + true]) +``` + +### Breaking: several classes renamed + +- `AbstractValidationRule` renamed to `ValidationRule` (NS `GraphQL\Validator\Rules`) +- `AbstractQuerySecurity` renamed to `QuerySecurityRule` (NS `GraphQL\Validator\Rules`) +- `FindBreakingChanges` renamed to `BreakingChangesFinder` (NS `GraphQL\Utils`) + +### Breaking: new constructors + +`GraphQL\Type\Definition\ResolveInfo` now takes 10 arguments instead of one array. + +## Upgrade v0.11.x > v0.12.x + +### Breaking: Minimum supported version is PHP5.6 +Dropped support for PHP 5.5. This release still supports PHP 5.6 and PHP 7.0 +**But the next major release will require PHP7.1+** + +### Breaking: Custom scalar types need to throw on invalid value +As null might be a valid value custom types need to throw an +Exception inside `parseLiteral()`, `parseValue()` and `serialize()`. + +Returning null from any of these methods will now be treated as valid result. + +### Breaking: Custom scalar types parseLiteral() declaration changed +A new parameter was added to `parseLiteral()`, which also needs to be added to any custom scalar type extending from `ScalarType` + +Before: +```php +class MyType extends ScalarType { + + ... + + public function parseLiteral($valueNode) { + //custom implementation + } +} +``` + +After: +```php +class MyType extends ScalarType { + + ... + + public function parseLiteral($valueNode, array $variables = null) { + //custom implementation + } +} +``` + +### Breaking: Descriptions in comments are not used as descriptions by default anymore +Descriptions now need to be inside Strings or BlockStrings in order to be picked up as +description. If you want to keep the old behaviour you can supply the option `commentDescriptions` +to BuildSchema::buildAST(), BuildSchema::build() or Printer::doPrint(). + +Here is the official way now to define descriptions in the graphQL language: + +Old: + +```graphql +# Description +type Dog { + ... +} +``` + +New: + +```graphql +"Description" +type Dog { + ... +} + +""" +Long Description +""" +type Dog { + ... +} +``` + +### Breaking: Cached AST of version 0.11.x is not compatible with 0.12.x. +That's because description in AST is now a separate node, not just a string. +Make sure to renew caches. + +### Breaking: Most of previously deprecated classes and methods were removed +See deprecation notices for previous versions in details. + +### Breaking: Standard server expects `operationName` vs `operation` for multi-op queries +Before the change: +```json +{ + "queryId": "persisted-query-id", + "operation": "QueryFromPersistedDocument", + "variables": {} +} +``` +After the change: +```json +{ + "queryId": "persisted-query-id", + "operationName": "QueryFromPersistedDocument", + "variables": {} +} +``` +This naming is aligned with graphql-express version. + +### Possibly Breaking: AST to array serialization excludes nulls +Most users won't be affected. It *may* affect you only if you do your own manipulations +with exported AST. + +Example of json-serialized AST before the change: +```json +{ + "kind": "Field", + "loc": null, + "name": { + "kind": "Name", + "loc": null, + "value": "id" + }, + "alias": null, + "arguments": [], + "directives": [], + "selectionSet": null +} +``` +After the change: +```json +{ + "kind": "Field", + "name": { + "kind": "Name", + "value": "id" + }, + "arguments": [], + "directives": [] +} +``` + +## Upgrade v0.8.x, v0.9.x > v0.10.x + +### Breaking: changed minimum PHP version from 5.4 to 5.5 +It allows us to leverage `::class` constant, `generators` and other features of newer PHP versions. + +### Breaking: default error formatting +By default exceptions thrown in resolvers will be reported with generic message `"Internal server error"`. +Only exceptions implementing interface `GraphQL\Error\ClientAware` and claiming themselves as `safe` will +be reported with full error message. + +This breaking change is done to avoid information leak in production when unhandled +exceptions were reported to clients (e.g. database connection errors, file access errors, etc). + +Also every error reported to client now has new `category` key which is either `graphql` or `internal`. +Exceptions implementing `ClientAware` interface may define their own custom categories. + +During development or debugging use `$executionResult->toArray(true)`. It will add `debugMessage` key to +each error entry in result. If you also want to add `trace` for each error - pass flags instead: + +``` +use GraphQL\Error\FormattedError; +$debug = FormattedError::INCLUDE_DEBUG_MESSAGE | FormattedError::INCLUDE_TRACE; +$result = GraphQL::executeAndReturnResult(/*args*/)->toArray($debug); +``` + +To change default `"Internal server error"` message to something else, use: +``` +GraphQL\Error\FormattedError::setInternalErrorMessage("Unexpected error"); +``` + +**This change only affects default error reporting mechanism. If you set your own error formatter using +`$executionResult->setErrorFormatter($myFormatter)` you won't be affected by this change.** + +If you need to revert to old behavior temporary, use: + +```php +GraphQL::executeAndReturnResult(/**/) + ->setErrorFormatter('\GraphQL\Error\Error::formatError') + ->toArray(); +``` +But note that this is deprecated format and will be removed in future versions. + +In general, if new default formatting doesn't work for you - just set [your own error +formatter](http://webonyx.github.io/graphql-php/error-handling/#custom-error-handling-and-formatting). + +### Breaking: Validation rules now have abstract base class +Previously any callable was accepted by DocumentValidator as validation rule. Now only instances of +`GraphQL\Validator\Rules\AbstractValidationRule` are allowed. + +If you were using custom validation rules, just wrap them with +`GraphQL\Validator\Rules\CustomValidationRule` (created for backwards compatibility). + +Before: +```php +use GraphQL\Validator\DocumentValidator; + +$myRule = function(ValidationContext $context) {}; +DocumentValidator::validate($schema, $ast, [$myRule]); +``` + +After: +```php +use GraphQL\Validator\Rules\CustomValidationRule; +use GraphQL\Validator\DocumentValidator; + +$myRule = new CustomValidationRule('MyRule', function(ValidationContext $context) {}); +DocumentValidator::validate($schema, $ast, [$myRule]); +``` + +Also `DocumentValidator::addRule()` signature changed. + +Before the change: +```php +use GraphQL\Validator\DocumentValidator; + +$myRule = function(ValidationContext $context) {}; +DocumentValidator::addRule('MyRuleName', $myRule); +``` + +After the change: +```php +use GraphQL\Validator\DocumentValidator; + +$myRule = new CustomValidationRulefunction('MyRule', ValidationContext $context) {}); +DocumentValidator::addRule($myRule); +``` + + +### Breaking: AST now uses `NodeList` vs array for lists of nodes +It helps us unserialize AST from array lazily. This change affects you only if you use `array_` +functions with AST or mutate AST directly. + +Before the change: +```php +new GraphQL\Language\AST\DocumentNode([ + 'definitions' => array(/*...*/) +]); +``` +After the change: +``` +new GraphQL\Language\AST\DocumentNode([ + 'definitions' => new NodeList([/*...*/]) +]); +``` + + +### Breaking: scalar types now throw different exceptions when parsing and serializing +On invalid client input (`parseValue` and `parseLiteral`) they throw standard `GraphQL\Error\Error` +but when they encounter invalid output (in `serialize`) they throw `GraphQL\Error\InvariantViolation`. + +Previously they were throwing `GraphQL\Error\UserError`. This exception is no longer used so make sure +to adjust if you were checking for this error in your custom error formatters. + +### Breaking: removed previously deprecated ability to define type as callable +See https://github.com/webonyx/graphql-php/issues/35 + +### Deprecated: `GraphQL\GraphQL::executeAndReturnResult` +Method is renamed to `GraphQL\GraphQL::executeQuery`. Old method name is still available, +but will trigger deprecation warning in the next version. + +### Deprecated: `GraphQL\GraphQL::execute` +Use `GraphQL\GraphQL::executeQuery()->toArray()` instead. +Old method still exists, but will trigger deprecation warning in next version. + +### Deprecated: `GraphQL\Schema` moved to `GraphQL\Type\Schema` +Old class still exists, but will trigger deprecation warning in next version. + +### Deprecated: `GraphQL\Utils` moved to `GraphQL\Utils\Utils` +Old class still exists, but triggers deprecation warning when referenced. + +### Deprecated: `GraphQL\Type\Definition\Config` +If you were using config validation in previous versions, replace: +```php +GraphQL\Type\Definition\Config::enableValidation(); +``` +with: +```php +$schema->assertValid(); +``` +See https://github.com/webonyx/graphql-php/issues/148 + +### Deprecated: experimental `GraphQL\Server` +Use [new PSR-7 compliant implementation](docs/executing-queries.md#using-server) instead. + +### Deprecated: experimental `GraphQL\Type\Resolution` interface and implementations +Use schema [**typeLoader** option](docs/type-system/schema.md#lazy-loading-of-types) instead. + +### Non-breaking: usage on async platforms +When using the library on async platforms use separate method `GraphQL::promiseToExecute()`. +It requires promise adapter in it's first argument and always returns a `Promise`. + +Old methods `GraphQL::execute` and `GraphQL::executeAndReturnResult` still work in backwards-compatible manner, +but they are deprecated and will be removed eventually. + +Same applies to Executor: use `Executor::promiseToExecute()` vs `Executor::execute()`. + +## Upgrade v0.7.x > v0.8.x +All of those changes apply to those who extends various parts of this library. +If you only use the library and don't try to extend it - everything should work without breaks. + + +### Breaking: Custom directives handling +When passing custom directives to schema, default directives (like `@skip` and `@include`) +are not added to schema automatically anymore. If you need them - add them explicitly with +your other directives. + +Before the change: +```php +$schema = new Schema([ + // ... + 'directives' => [$myDirective] +]); +``` + +After the change: +```php +$schema = new Schema([ + // ... + 'directives' => array_merge(GraphQL::getInternalDirectives(), [$myDirective]) +]); +``` + +### Breaking: Schema protected property and methods visibility +Most of the `protected` properties and methods of `GraphQL\Schema` were changed to `private`. +Please use public interface instead. + +### Breaking: Node kind constants +Node kind constants were extracted from `GraphQL\Language\AST\Node` to +separate class `GraphQL\Language\AST\NodeKind` + +### Non-breaking: AST node classes renamed +AST node classes were renamed to disambiguate with types. e.g.: + +``` +GraphQL\Language\AST\Field -> GraphQL\Language\AST\FieldNode +GraphQL\Language\AST\OjbectValue -> GraphQL\Language\AST\OjbectValueNode +``` +etc. + +Old names are still available via `class_alias` defined in `src/deprecated.php`. +This file is included automatically when using composer autoloading. + +### Deprecations +There are several deprecations which still work, but trigger `E_USER_DEPRECATED` when used. + +For example `GraphQL\Executor\Executor::setDefaultResolveFn()` is renamed to `setDefaultResolver()` +but still works with old name. + +## Upgrade v0.6.x > v0.7.x + +There are a few new breaking changes in v0.7.0 that were added to the graphql-js reference implementation +with the spec of April2016 + +### 1. Context for resolver + +You can now pass a custom context to the `GraphQL::execute` function that is available in all resolvers as 3rd argument. +This can for example be used to pass the current user etc. + +Make sure to update all calls to `GraphQL::execute`, `GraphQL::executeAndReturnResult`, `Executor::execute` and all +`'resolve'` callbacks in your app. + +Before v0.7.0 `GraphQL::execute` signature looked this way: + ```php + GraphQL::execute( + $schema, + $query, + $rootValue, + $variables, + $operationName + ); + ``` + +Starting from v0.7.0 the signature looks this way (note the new `$context` argument): +```php +GraphQL::execute( + $schema, + $query, + $rootValue, + $context, + $variables, + $operationName +); +``` + +Before v.0.7.0 resolve callbacks had following signature: +```php +/** + * @param mixed $object The parent resolved object + * @param array $args Input arguments + * @param ResolveInfo $info ResolveInfo object + * @return mixed + */ +function resolveMyField($object, array $args, ResolveInfo $info) { + //... +} +``` + +Starting from v0.7.0 the signature has changed to (note the new `$context` argument): +```php +/** + * @param mixed $object The parent resolved object + * @param array $args Input arguments + * @param mixed $context The context object hat was passed to GraphQL::execute + * @param ResolveInfo $info ResolveInfo object + * @return mixed + */ +function resolveMyField($object, array $args, $context, ResolveInfo $info){ + //... +} +``` + +### 2. Schema constructor signature + +The signature of the Schema constructor now accepts an associative config array instead of positional arguments: + +Before v0.7.0: +```php +$schema = new Schema($queryType, $mutationType); +``` + +Starting from v0.7.0: +```php +$schema = new Schema([ + 'query' => $queryType, + 'mutation' => $mutationType, + 'types' => $arrayOfTypesWithInterfaces // See 3. +]); +``` + +### 3. Types can be directly passed to schema + +There are edge cases when GraphQL cannot infer some types from your schema. +One example is when you define a field of interface type and object types implementing +this interface are not referenced anywhere else. + +In such case object types might not be available when an interface is queried and query +validation will fail. In that case, you need to pass the types that implement the +interfaces directly to the schema, so that GraphQL knows of their existence during query validation. + +For example: +```php +$schema = new Schema([ + 'query' => $queryType, + 'mutation' => $mutationType, + 'types' => $arrayOfTypesWithInterfaces +]); +``` + +Note that you don't need to pass all types here - only those types that GraphQL "doesn't see" +automatically. Before v7.0.0 the workaround for this was to create a dumb (non-used) field per +each "invisible" object type. + +Also see [webonyx/graphql-php#38](https://github.com/webonyx/graphql-php/issues/38) diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/best-practices.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/best-practices.md new file mode 100644 index 00000000..4b7fc247 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/best-practices.md @@ -0,0 +1,9 @@ +# Type Registry +**graphql-php** expects that each type in Schema is presented by single instance. Therefore +if you define your types as separate PHP classes you need to ensure that each type is referenced only once. + +Technically you can create several instances of your type (for example for tests), but `GraphQL\Type\Schema` +will throw on attempt to add different instances with the same name. + +There are several ways to achieve this depending on your preferences. We provide reference +implementation below that introduces TypeRegistry class: diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/complementary-tools.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/complementary-tools.md new file mode 100644 index 00000000..5262649e --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/complementary-tools.md @@ -0,0 +1,28 @@ +# Integrations + +* [Standard Server](executing-queries.md/#using-server) – Out of the box integration with any PSR-7 compatible framework (like [Slim](http://slimframework.com) or [Zend Expressive](http://zendframework.github.io/zend-expressive/)). +* [Relay Library for graphql-php](https://github.com/ivome/graphql-relay-php) – Helps construct Relay related schema definitions. +* [Lighthouse](https://github.com/nuwave/lighthouse) – Laravel based, uses Schema Definition Language +* [Laravel GraphQL](https://github.com/rebing/graphql-laravel) - Laravel wrapper for Facebook's GraphQL +* [OverblogGraphQLBundle](https://github.com/overblog/GraphQLBundle) – Bundle for Symfony +* [WP-GraphQL](https://github.com/wp-graphql/wp-graphql) - GraphQL API for WordPress +* [Siler](https://github.com/leocavalcante/siler) - Straightforward way to map GraphQL SDL to resolver callables, also built-in support for Swoole + +# GraphQL PHP Tools + +* [GraphQLite](https://graphqlite.thecodingmachine.io) – Define your complete schema with annotations +* [GraphQL Doctrine](https://github.com/Ecodev/graphql-doctrine) – Define types with Doctrine ORM annotations +* [DataLoaderPHP](https://github.com/overblog/dataloader-php) – as a ready implementation for [deferred resolvers](data-fetching.md#solving-n1-problem) +* [GraphQL Uploads](https://github.com/Ecodev/graphql-upload) – A PSR-15 middleware to support file uploads in GraphQL. +* [GraphQL Batch Processor](https://github.com/vasily-kartashov/graphql-batch-processing) – Provides a builder interface for defining collection, querying, filtering, and post-processing logic of batched data fetches. +* [GraphQL Utils](https://github.com/simPod/GraphQL-Utils) – Objective schema definition builders (no need for arrays anymore) and `DateTime` scalar +* [PSR 15 compliant middleware](https://github.com/phps-cans/psr7-middleware-graphql) for the Standard Server _(experimental)_ + +# General GraphQL Tools + +* [GraphQL Playground](https://github.com/prismagraphql/graphql-playground) – GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration). +* [GraphiQL](https://github.com/graphql/graphiql) – An in-browser IDE for exploring GraphQL +* [ChromeiQL](https://chrome.google.com/webstore/detail/chromeiql/fkkiamalmpiidkljmicmjfbieiclmeij) + or [GraphiQL Feen](https://chrome.google.com/webstore/detail/graphiql-feen/mcbfdonlkfpbfdpimkjilhdneikhfklp) – + GraphiQL as Google Chrome extension +* [Altair GraphQL Client](https://altair.sirmuel.design/) - A beautiful feature-rich GraphQL Client for all platforms diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/concepts.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/concepts.md new file mode 100644 index 00000000..91fe6421 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/concepts.md @@ -0,0 +1,139 @@ +# Overview +GraphQL is data-centric. On the very top level it is built around three major concepts: +**Schema**, **Query** and **Mutation**. + +You are expected to express your application as **Schema** (aka Type System) and expose it +with single HTTP endpoint (e.g. using our [standard server](executing-queries.md#using-server)). +Application clients (e.g. web or mobile clients) send **Queries** +to this endpoint to request structured data and **Mutations** to perform changes (usually with HTTP POST method). + +## Queries +Queries are expressed in simple language that resembles JSON: + +```graphql +{ + hero { + name + friends { + name + } + } +} +``` + +It was designed to mirror the structure of expected response: +```json +{ + "hero": { + "name": "R2-D2", + "friends": [ + {"name": "Luke Skywalker"}, + {"name": "Han Solo"}, + {"name": "Leia Organa"} + ] + } +} +``` +**graphql-php** runtime parses Queries, makes sure that they are valid for given Type System +and executes using [data fetching tools](data-fetching.md) provided by you +as a part of integration. Queries are supposed to be idempotent. + +## Mutations +Mutations use advanced features of the very same query language (like arguments and variables) +and have only semantic difference from Queries: + +```graphql +mutation CreateReviewForEpisode($ep: Episode!, $review: ReviewInput!) { + createReview(episode: $ep, review: $review) { + stars + commentary + } +} +``` +Variables `$ep` and `$review` are sent alongside with mutation. Full HTTP request might look like this: +```json +// POST /graphql-endpoint +// Content-Type: application/javascript +// +{ + "query": "mutation CreateReviewForEpisode...", + "variables": { + "ep": "JEDI", + "review": { + "stars": 5, + "commentary": "This is a great movie!" + } + } +} +``` +As you see variables may include complex objects and they will be correctly validated by +**graphql-php** runtime. + +Another nice feature of GraphQL mutations is that they also hold the query for data to be +returned after mutation. In our example mutation will return: +``` +{ + "createReview": { + "stars": 5, + "commentary": "This is a great movie!" + } +} +``` + +# Type System +Conceptually GraphQL type is a collection of fields. Each field in turn +has it's own type which allows to build complex hierarchies. + +Quick example on pseudo-language: +``` +type BlogPost { + title: String! + author: User + body: String +} + +type User { + id: Id! + firstName: String + lastName: String +} +``` + +Type system is a heart of GraphQL integration. That's where **graphql-php** comes into play. + +It provides following tools and primitives to describe your App as hierarchy of types: + + * Primitives for defining **objects** and **interfaces** + * Primitives for defining **enumerations** and **unions** + * Primitives for defining custom **scalar types** + * Built-in scalar types: `ID`, `String`, `Int`, `Float`, `Boolean` + * Built-in type modifiers: `ListOf` and `NonNull` + +Same example expressed in **graphql-php**: +```php + 'User', + 'fields' => [ + 'id' => Type::nonNull(Type::id()), + 'firstName' => Type::string(), + 'lastName' => Type::string() + ] +]); + +$blogPostType = new ObjectType([ + 'name' => 'BlogPost', + 'fields' => [ + 'title' => Type::nonNull(Type::string()), + 'author' => $userType + ] +]); +``` + +# Further Reading +To get deeper understanding of GraphQL concepts - [read the docs on official GraphQL website](http://graphql.org/learn/) + +To get started with **graphql-php** - continue to next section ["Getting Started"](getting-started.md) diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/data-fetching.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/data-fetching.md new file mode 100644 index 00000000..c5152ba5 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/data-fetching.md @@ -0,0 +1,274 @@ +# Overview +GraphQL is data-storage agnostic. You can use any underlying data storage engine, including SQL or NoSQL database, +plain files or in-memory data structures. + +In order to convert the GraphQL query to PHP array, **graphql-php** traverses query fields (using depth-first algorithm) and +runs special **resolve** function on each field. This **resolve** function is provided by you as a part of +[field definition](type-system/object-types.md#field-configuration-options) or [query execution call](executing-queries.md#overview). + +Result returned by **resolve** function is directly included in the response (for scalars and enums) +or passed down to nested fields (for objects). + +Let's walk through an example. Consider following GraphQL query: + +```graphql +{ + lastStory { + title + author { + name + } + } +} +``` + +We need a Schema that can fulfill it. On the very top level the Schema contains Query type: + +```php + 'Query', + 'fields' => [ + + 'lastStory' => [ + 'type' => $blogStoryType, + 'resolve' => function() { + return [ + 'id' => 1, + 'title' => 'Example blog post', + 'authorId' => 1 + ]; + } + ] + + ] +]); +``` + +As we see field **lastStory** has **resolve** function that is responsible for fetching data. + +In our example, we simply return array value, but in the real-world application you would query +your database/cache/search index and return the result. + +Since **lastStory** is of composite type **BlogStory** this result is passed down to fields of this type: + +```php + 'BlogStory', + 'fields' => [ + + 'author' => [ + 'type' => $userType, + 'resolve' => function($blogStory) { + $users = [ + 1 => [ + 'id' => 1, + 'name' => 'Smith' + ], + 2 => [ + 'id' => 2, + 'name' => 'Anderson' + ] + ]; + return $users[$blogStory['authorId']]; + } + ], + + 'title' => [ + 'type' => Type::string() + ] + + ] +]); +``` + +Here **$blogStory** is the array returned by **lastStory** field above. + +Again: in the real-world applications you would fetch user data from data store by **authorId** and return it. +Also, note that you don't have to return arrays. You can return any value, **graphql-php** will pass it untouched +to nested resolvers. + +But then the question appears - field **title** has no **resolve** option. How is it resolved? + +There is a default resolver for all fields. When you define your own **resolve** function +for a field you simply override this default resolver. + +# Default Field Resolver +**graphql-php** provides following default field resolver: +```php +fieldName; + $property = null; + + if (is_array($objectValue) || $objectValue instanceof \ArrayAccess) { + if (isset($objectValue[$fieldName])) { + $property = $objectValue[$fieldName]; + } + } elseif (is_object($objectValue)) { + if (isset($objectValue->{$fieldName})) { + $property = $objectValue->{$fieldName}; + } + } + + return $property instanceof Closure + ? $property($objectValue, $args, $context, $info) + : $property; + } +``` + +As you see it returns value by key (for arrays) or property (for objects). +If the value is not set - it returns **null**. + +To override the default resolver, pass it as an argument of [executeQuery](executing-queries.md) call. + +# Default Field Resolver per Type +Sometimes it might be convenient to set default field resolver per type. You can do so by providing +[resolveField option in type config](type-system/object-types.md#configuration-options). For example: + +```php + 'User', + 'fields' => [ + + 'name' => Type::string(), + 'email' => Type::string() + + ], + 'resolveField' => function(User $user, $args, $context, ResolveInfo $info) { + switch ($info->fieldName) { + case 'name': + return $user->getName(); + case 'email': + return $user->getEmail(); + default: + return null; + } + } +]); +``` + +Keep in mind that **field resolver** has precedence over **default field resolver per type** which in turn + has precedence over **default field resolver**. + +# Solving N+1 Problem +Since: 0.9.0 + +One of the most annoying problems with data fetching is a so-called +[N+1 problem](https://secure.phabricator.com/book/phabcontrib/article/n_plus_one/).
+Consider following GraphQL query: +``` +{ + topStories(limit: 10) { + title + author { + name + email + } + } +} +``` + +Naive field resolution process would require up to 10 calls to the underlying data store to fetch authors for all 10 stories. + +**graphql-php** provides tools to mitigate this problem: it allows you to defer actual field resolution to a later stage +when one batched query could be executed instead of 10 distinct queries. + +Here is an example of **BlogStory** resolver for field **author** that uses deferring: +```php + function($blogStory) { + MyUserBuffer::add($blogStory['authorId']); + + return new GraphQL\Deferred(function () use ($blogStory) { + MyUserBuffer::loadBuffered(); + return MyUserBuffer::get($blogStory['authorId']); + }); +} +``` + +In this example, we fill up the buffer with 10 author ids first. Then **graphql-php** continues +resolving other non-deferred fields until there are none of them left. + +After that, it calls closures wrapped by `GraphQL\Deferred` which in turn load all buffered +ids once (using SQL IN(?), Redis MGET or other similar tools) and returns final field value. + +Originally this approach was advocated by Facebook in their [Dataloader](https://github.com/facebook/dataloader) +project. This solution enables very interesting optimizations at no cost. Consider the following query: + +```graphql +{ + topStories(limit: 10) { + author { + email + } + } + category { + stories(limit: 10) { + author { + email + } + } + } +} +``` + +Even though **author** field is located on different levels of the query - it can be buffered in the same buffer. +In this example, only one query will be executed for all story authors comparing to 20 queries +in a naive implementation. + +# Async PHP +Since: 0.10.0 (version 0.9.0 had slightly different API which still works, but is deprecated) + +If your project runs in an environment that supports async operations +(like HHVM, ReactPHP, Icicle.io, appserver.io, PHP threads, etc) +you can leverage the power of your platform to resolve some fields asynchronously. + +The only requirement: your platform must support the concept of Promises compatible with +[Promises A+](https://promisesaplus.com/) specification. + +To start using this feature, switch facade method for query execution from +**executeQuery** to **promiseToExecute**: + +```php +then(function(ExecutionResult $result) { + return $result->toArray(); +}); +``` + +Where **$promiseAdapter** is an instance of: + +* For [ReactPHP](https://github.com/reactphp/react) (requires **react/promise** as composer dependency):
+ `GraphQL\Executor\Promise\Adapter\ReactPromiseAdapter` + +* Other platforms: write your own class implementing interface:
+ [`GraphQL\Executor\Promise\PromiseAdapter`](reference.md#graphqlexecutorpromisepromiseadapter). + +Then your **resolve** functions should return promises of your platform instead of `GraphQL\Deferred`s. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/error-handling.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/error-handling.md new file mode 100644 index 00000000..c3841b21 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/error-handling.md @@ -0,0 +1,199 @@ +# Errors in GraphQL + +Query execution process never throws exceptions. Instead, all errors are caught and collected. +After execution, they are available in **$errors** prop of +[`GraphQL\Executor\ExecutionResult`](reference.md#graphqlexecutorexecutionresult). + +When the result is converted to a serializable array using its **toArray()** method, all errors are +converted to arrays as well using default error formatting (see below). + +Alternatively, you can apply [custom error filtering and formatting](#custom-error-handling-and-formatting) +for your specific requirements. + +# Default Error formatting +By default, each error entry is converted to an associative array with following structure: + +```php + 'Error message', + 'extensions' => [ + 'category' => 'graphql' + ], + 'locations' => [ + ['line' => 1, 'column' => 2] + ], + 'path' => [ + 'listField', + 0, + 'fieldWithException' + ] +]; +``` +Entry at key **locations** points to a character in query string which caused the error. +In some cases (like deep fragment fields) locations will include several entries to track down +the path to field with the error in query. + +Entry at key **path** exists only for errors caused by exceptions thrown in resolvers. +It contains a path from the very root field to actual field value producing an error +(including indexes for list types and field names for composite types). + +**Internal errors** + +As of version **0.10.0**, all exceptions thrown in resolvers are reported with generic message **"Internal server error"**. +This is done to avoid information leak in production environments (e.g. database connection errors, file access errors, etc). + +Only exceptions implementing interface [`GraphQL\Error\ClientAware`](reference.md#graphqlerrorclientaware) and claiming themselves as **safe** will +be reported with a full error message. + +For example: +```php + 'My reported error', + 'extensions' => [ + 'category' => 'businessLogic' + ], + 'locations' => [ + ['line' => 10, 'column' => 2] + ], + 'path' => [ + 'path', + 'to', + 'fieldWithException' + ] +]; +``` + +To change default **"Internal server error"** message to something else, use: +``` +GraphQL\Error\FormattedError::setInternalErrorMessage("Unexpected error"); +``` + +# Debugging tools + +During development or debugging use `$result->toArray(DebugFlag::INCLUDE_DEBUG_MESSAGE)` to add **debugMessage** key to +each formatted error entry. If you also want to add exception trace - pass flags instead: + +```php +use GraphQL\Error\DebugFlag; +$debug = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE; +$result = GraphQL::executeQuery(/*args*/)->toArray($debug); +``` + +This will make each error entry to look like this: +```php + 'Actual exception message', + 'message' => 'Internal server error', + 'extensions' => [ + 'category' => 'internal' + ], + 'locations' => [ + ['line' => 10, 'column' => 2] + ], + 'path' => [ + 'listField', + 0, + 'fieldWithException' + ], + 'trace' => [ + /* Formatted original exception trace */ + ] +]; +``` + +If you prefer the first resolver exception to be re-thrown, use following flags: +```php +toArray($debug); +``` + +If you only want to re-throw Exceptions that are not marked as safe through the `ClientAware` interface, use +the flag `Debug::RETHROW_UNSAFE_EXCEPTIONS`. + +# Custom Error Handling and Formatting +It is possible to define custom **formatter** and **handler** for result errors. + +**Formatter** is responsible for converting instances of [`GraphQL\Error\Error`](reference.md#graphqlerrorerror) +to an array. **Handler** is useful for error filtering and logging. + +For example, these are default formatter and handler: + +```php +setErrorFormatter($myErrorFormatter) + ->setErrorsHandler($myErrorHandler) + ->toArray(); +``` + +Note that when you pass [debug flags](#debugging-tools) to **toArray()** your custom formatter will still be +decorated with same debugging information mentioned above. + +# Schema Errors +So far we only covered errors which occur during query execution process. But schema definition can +also throw `GraphQL\Error\InvariantViolation` if there is an error in one of type definitions. + +Usually such errors mean that there is some logical error in your schema and it is the only case +when it makes sense to return `500` error code for GraphQL endpoint: + +```php + [FormattedError::createFromException($e)] + ]; + $status = 500; +} + +header('Content-Type: application/json', true, $status); +echo json_encode($body); +``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/executing-queries.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/executing-queries.md new file mode 100644 index 00000000..54f82da0 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/executing-queries.md @@ -0,0 +1,208 @@ +# Using Facade Method +Query execution is a complex process involving multiple steps, including query **parsing**, +**validating** and finally **executing** against your [schema](type-system/schema.md). + +**graphql-php** provides a convenient facade for this process in class +[`GraphQL\GraphQL`](reference.md#graphqlgraphql): + +```php +toArray(); +``` + +Returned array contains **data** and **errors** keys, as described by the +[GraphQL spec](http://facebook.github.io/graphql/#sec-Response-Format). +This array is suitable for further serialization (e.g. using **json_encode**). +See also the section on [error handling and formatting](error-handling.md). + +Description of **executeQuery** method arguments: + +Argument | Type | Notes +------------ | -------- | ----- +schema | [`GraphQL\Type\Schema`](#) | **Required.** Instance of your application [Schema](type-system/schema.md) +queryString | `string` or `GraphQL\Language\AST\DocumentNode` | **Required.** Actual GraphQL query string to be parsed, validated and executed. If you parse query elsewhere before executing - pass corresponding AST document here to avoid new parsing. +rootValue | `mixed` | Any value that represents a root of your data graph. It is passed as the 1st argument to field resolvers of [Query type](type-system/schema.md#query-and-mutation-types). Can be omitted or set to null if actual root values are fetched by Query type itself. +context | `mixed` | Any value that holds information shared between all field resolvers. Most often they use it to pass currently logged in user, locale details, etc.

It will be available as the 3rd argument in all field resolvers. (see section on [Field Definitions](type-system/object-types.md#field-configuration-options) for reference) **graphql-php** never modifies this value and passes it *as is* to all underlying resolvers. +variableValues | `array` | Map of variable values passed along with query string. See section on [query variables on official GraphQL website](http://graphql.org/learn/queries/#variables). Note that while variableValues must be an associative array, the values inside it can be nested using \stdClass if desired. +operationName | `string` | Allows the caller to specify which operation in queryString will be run, in cases where queryString contains multiple top-level operations. +fieldResolver | `callable` | A resolver function to use when one is not provided by the schema. If not provided, the [default field resolver is used](data-fetching.md#default-field-resolver). +validationRules | `array` | A set of rules for query validation step. The default value is all available rules. Empty array would allow skipping query validation (may be convenient for persisted queries which are validated before persisting and assumed valid during execution) + +# Using Server +If you are building HTTP GraphQL API, you may prefer our Standard Server +(compatible with [express-graphql](https://github.com/graphql/express-graphql)). +It supports more features out of the box, including parsing HTTP requests, producing a spec-compliant response; [batched queries](#query-batching); persisted queries. + +Usage example (with plain PHP): + +```php +handleRequest(); // parses PHP globals and emits response +``` + +Server also supports [PSR-7 request/response interfaces](http://www.php-fig.org/psr/psr-7/): +```php +processPsrRequest($psrRequest, $psrResponse, $psrBodyStream); + + +// Alternatively create PSR-7 response yourself: + +/** @var ExecutionResult|ExecutionResult[] $result */ +$result = $server->executePsrRequest($psrRequest); +$psrResponse = new SomePsr7ResponseImplementation(json_encode($result)); +``` + +PSR-7 is useful when you want to integrate the server into existing framework: + +- [PSR-7 for Laravel](https://laravel.com/docs/requests#psr7-requests) +- [Symfony PSR-7 Bridge](https://symfony.com/doc/current/components/psr7.html) +- [Slim](https://www.slimframework.com/docs/v4/concepts/value-objects.html) +- [Zend Expressive](http://zendframework.github.io/zend-expressive/) + +## Server configuration options + +Argument | Type | Notes +------------ | -------- | ----- +schema | [`Schema`](reference.md#graphqltypeschema) | **Required.** Instance of your application [Schema](type-system/schema/) +rootValue | `mixed` | Any value that represents a root of your data graph. It is passed as the 1st argument to field resolvers of [Query type](type-system/schema.md#query-and-mutation-types). Can be omitted or set to null if actual root values are fetched by Query type itself. +context | `mixed` | Any value that holds information shared between all field resolvers. Most often they use it to pass currently logged in user, locale details, etc.

It will be available as the 3rd argument in all field resolvers. (see section on [Field Definitions](type-system/object-types.md#field-configuration-options) for reference) **graphql-php** never modifies this value and passes it *as is* to all underlying resolvers. +fieldResolver | `callable` | A resolver function to use when one is not provided by the schema. If not provided, the [default field resolver is used](data-fetching.md#default-field-resolver). +validationRules | `array` or `callable` | A set of rules for query validation step. The default value is all available rules. The empty array would allow skipping query validation (may be convenient for persisted queries which are validated before persisting and assumed valid during execution).

Pass `callable` to return different validation rules for different queries (e.g. empty array for persisted query and a full list of rules for regular queries). When passed, it is expected to have the following signature:

**function ([OperationParams](reference.md#graphqlserveroperationparams) $params, DocumentNode $node, $operationType): array** +queryBatching | `bool` | Flag indicating whether this server supports query batching ([apollo-style](https://dev-blog.apollodata.com/query-batching-in-apollo-63acfd859862)).

Defaults to **false** +debug | `int` | Debug flags. See [docs on error debugging](error-handling.md#debugging-tools) (flag values are the same). +persistentQueryLoader | `callable` | A function which is called to fetch actual query when server encounters **queryId** in request vs **query**.

The server does not implement persistence part (which you will have to build on your own), but it allows you to execute queries which were persisted previously.

Expected function signature:
**function ($queryId, [OperationParams](reference.md#graphqlserveroperationparams) $params)**

Function is expected to return query **string** or parsed **DocumentNode**

[Read more about persisted queries](https://dev-blog.apollodata.com/persisted-graphql-queries-with-apollo-client-119fd7e6bba5). +errorFormatter | `callable` | Custom error formatter. See [error handling docs](error-handling.md#custom-error-handling-and-formatting). +errorsHandler | `callable` | Custom errors handler. See [error handling docs](error-handling.md#custom-error-handling-and-formatting). +promiseAdapter | [`PromiseAdapter`](reference.md#graphqlexecutorpromisepromiseadapter) | Required for [Async PHP](data-fetching/#async-php) only. + +**Server config instance** + +If you prefer fluid interface for config with autocomplete in IDE and static time validation, +use [`GraphQL\Server\ServerConfig`](reference.md#graphqlserverserverconfig) instead of an array: + +```php +setSchema($schema) + ->setErrorFormatter($myFormatter) + ->setDebugFlag($debug) +; + +$server = new StandardServer($config); +``` + +## Query batching +Standard Server supports query batching ([apollo-style](https://dev-blog.apollodata.com/query-batching-in-apollo-63acfd859862)). + +One of the major benefits of Server over a sequence of **executeQuery()** calls is that +[Deferred resolvers](data-fetching.md#solving-n1-problem) won't be isolated in queries. +So for example following batch will require single DB request (if user field is deferred): + +```json +[ + { + "query": "{user(id: 1) { id }}" + }, + { + "query": "{user(id: 2) { id }}" + }, + { + "query": "{user(id: 3) { id }}" + } +] +``` + +To enable query batching, pass **queryBatching** option in server config: +```php + true +]); +``` + +# Custom Validation Rules +Before execution, a query is validated using a set of standard rules defined by the GraphQL spec. +It is possible to override standard set of rules globally or per execution. + +Add rules globally: +```php + $myValiationRules +]); +``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/getting-started.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/getting-started.md new file mode 100644 index 00000000..69abf8ee --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/getting-started.md @@ -0,0 +1,125 @@ +# Prerequisites +This documentation assumes your familiarity with GraphQL concepts. If it is not the case - +first learn about GraphQL on [the official website](http://graphql.org/learn/). + +# Installation + +Using [composer](https://getcomposer.org/doc/00-intro.md), run: + +```sh +composer require webonyx/graphql-php +``` + +# Upgrading +We try to keep library releases backwards compatible. But when breaking changes are inevitable +they are explained in [upgrade instructions](https://github.com/webonyx/graphql-php/blob/master/UPGRADE.md). + +# Install Tools (optional) +While it is possible to communicate with GraphQL API using regular HTTP tools it is way +more convenient for humans to use [GraphiQL](https://github.com/graphql/graphiql) - an in-browser +IDE for exploring GraphQL APIs. + +It provides syntax-highlighting, auto-completion and auto-generated documentation for +GraphQL API. + +The easiest way to use it is to install one of the existing Google Chrome extensions: + + - [ChromeiQL](https://chrome.google.com/webstore/detail/chromeiql/fkkiamalmpiidkljmicmjfbieiclmeij) + - [GraphiQL Feen](https://chrome.google.com/webstore/detail/graphiql-feen/mcbfdonlkfpbfdpimkjilhdneikhfklp) + +Alternatively, you can follow instructions on [the GraphiQL](https://github.com/graphql/graphiql) +page and install it locally. + + +# Hello World +Let's create a type system that will be capable to process following simple query: +``` +query { + echo(message: "Hello World") +} +``` + +To do so we need an object type with field `echo`: + +```php + 'Query', + 'fields' => [ + 'echo' => [ + 'type' => Type::string(), + 'args' => [ + 'message' => Type::nonNull(Type::string()), + ], + 'resolve' => function ($rootValue, $args) { + return $rootValue['prefix'] . $args['message']; + } + ], + ], +]); + +``` + +(Note: type definition can be expressed in [different styles](type-system/index.md#type-definition-styles), +but this example uses **inline** style for simplicity) + +The interesting piece here is **resolve** option of field definition. It is responsible for returning +a value of our field. Values of **scalar** fields will be directly included in response while values of +**composite** fields (objects, interfaces, unions) will be passed down to nested field resolvers +(not in this example though). + +Now when our type is ready, let's create GraphQL endpoint file for it **graphql.php**: + +```php + $queryType +]); + +$rawInput = file_get_contents('php://input'); +$input = json_decode($rawInput, true); +$query = $input['query']; +$variableValues = isset($input['variables']) ? $input['variables'] : null; + +try { + $rootValue = ['prefix' => 'You said: ']; + $result = GraphQL::executeQuery($schema, $query, $rootValue, null, $variableValues); + $output = $result->toArray(); +} catch (\Exception $e) { + $output = [ + 'errors' => [ + [ + 'message' => $e->getMessage() + ] + ] + ]; +} +header('Content-Type: application/json'); +echo json_encode($output); +``` + +Our example is finished. Try it by running: +```sh +php -S localhost:8080 graphql.php +curl http://localhost:8080 -d '{"query": "query { echo(message: \"Hello World\") }" }' +``` + +Check out the full [source code](https://github.com/webonyx/graphql-php/blob/master/examples/00-hello-world) of this example +which also includes simple mutation. + +Obviously hello world only scratches the surface of what is possible. +So check out next example, which is closer to real-world apps. +Or keep reading about [schema definition](type-system/index.md). + +# Blog example +It is often easier to start with a full-featured example and then get back to documentation +for your own work. + +Check out [Blog example of GraphQL API](https://github.com/webonyx/graphql-php/tree/master/examples/01-blog). +It is quite close to real-world GraphQL hierarchies. Follow instructions and try it yourself in ~10 minutes. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/how-it-works.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/how-it-works.md new file mode 100644 index 00000000..fd57e2bd --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/how-it-works.md @@ -0,0 +1,35 @@ +# Overview +Following reading describes implementation details of query execution process. It may clarify some +internals of GraphQL runtime but is not required to use it. + +# Parsing + +TODOC + +# Validating +TODOC + +# Executing +TODOC + +# Errors explained +There are 3 types of errors in GraphQL: + +- **Syntax**: query has invalid syntax and could not be parsed; +- **Validation**: query is incompatible with type system (e.g. unknown field is requested); +- **Execution**: occurs when some field resolver throws (or returns unexpected value). + +Obviously, when **Syntax** or **Validation** error is detected - the process is interrupted and +the query is not executed. + +Execution process never throws exceptions. Instead, all errors are caught and collected in +execution result. + +GraphQL is forgiving to **Execution** errors which occur in resolvers of nullable fields. +If such field throws or returns unexpected value the value of the field in response will be simply +replaced with **null** and error entry will be registered. + +If an exception is thrown in the non-null field - error bubbles up to the first nullable field. +This nullable field is replaced with **null** and error entry is added to the result. +If all fields up to the root are non-null - **data** entry will be removed from the result +and only **errors** key will be presented. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/index.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/index.md new file mode 100644 index 00000000..a031a423 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/index.md @@ -0,0 +1,55 @@ +[![GitHub stars](https://img.shields.io/github/stars/webonyx/graphql-php.svg?style=social&label=Star)](https://github.com/webonyx/graphql-php) +[![Build Status](https://travis-ci.org/webonyx/graphql-php.svg?branch=master)](https://travis-ci.org/webonyx/graphql-php) +[![Coverage Status](https://coveralls.io/repos/github/webonyx/graphql-php/badge.svg)](https://coveralls.io/github/webonyx/graphql-php) +[![Latest Stable Version](https://poser.pugx.org/webonyx/graphql-php/version)](https://packagist.org/packages/webonyx/graphql-php) +[![License](https://poser.pugx.org/webonyx/graphql-php/license)](https://packagist.org/packages/webonyx/graphql-php) + +# About GraphQL + +GraphQL is a modern way to build HTTP APIs consumed by the web and mobile clients. +It is intended to be an alternative to REST and SOAP APIs (even for **existing applications**). + +GraphQL itself is a [specification](https://github.com/facebook/graphql) designed by Facebook +engineers. Various implementations of this specification were written +[in different languages and environments](http://graphql.org/code/). + +Great overview of GraphQL features and benefits is presented on [the official website](http://graphql.org/). +All of them equally apply to this PHP implementation. + + +# About graphql-php + +**graphql-php** is a feature-complete implementation of GraphQL specification in PHP (5.5+, 7.0+). +It was originally inspired by [reference JavaScript implementation](https://github.com/graphql/graphql-js) +published by Facebook. + +This library is a thin wrapper around your existing data layer and business logic. +It doesn't dictate how these layers are implemented or which storage engines +are used. Instead, it provides tools for creating rich API for your existing app. + +Library features include: + + - Primitives to express your app as a [Type System](type-system/index.md) + - Validation and introspection of this Type System (for compatibility with tools like [GraphiQL](complementary-tools.md#tools)) + - Parsing, validating and [executing GraphQL queries](executing-queries.md) against this Type System + - Rich [error reporting](error-handling.md), including query validation and execution errors + - Optional tools for [parsing GraphQL Type language](type-system/type-language.md) + - Tools for [batching requests](data-fetching.md#solving-n1-problem) to backend storage + - [Async PHP platforms support](data-fetching.md#async-php) via promises + - [Standard HTTP server](executing-queries.md#using-server) + +Also, several [complementary tools](complementary-tools.md) are available which provide integrations with +existing PHP frameworks, add support for Relay, etc. + +## Current Status +The first version of this library (v0.1) was released on August 10th 2015. + +The current version supports all features described by GraphQL specification +as well as some experimental features like +[Schema Language parser](type-system/type-language.md) and +[Schema printer](reference.md#graphqlutilsschemaprinter). + +Ready for real-world usage. + +## GitHub +Project source code is [hosted on GitHub](https://github.com/webonyx/graphql-php). diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/reference.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/reference.md new file mode 100644 index 00000000..73f81148 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/reference.md @@ -0,0 +1,2332 @@ +# GraphQL\GraphQL +This is the primary facade for fulfilling GraphQL operations. +See [related documentation](executing-queries.md). + +**Class Methods:** +```php +/** + * Executes graphql query. + * + * More sophisticated GraphQL servers, such as those which persist queries, + * may wish to separate the validation and execution phases to a static time + * tooling step, and a server runtime step. + * + * Available options: + * + * schema: + * The GraphQL type system to use when validating and executing a query. + * source: + * A GraphQL language formatted string representing the requested operation. + * rootValue: + * The value provided as the first argument to resolver functions on the top + * level type (e.g. the query object type). + * contextValue: + * The context value is provided as an argument to resolver functions after + * field arguments. It is used to pass shared information useful at any point + * during executing this query, for example the currently logged in user and + * connections to databases or other services. + * variableValues: + * A mapping of variable name to runtime value to use for all variables + * defined in the requestString. + * operationName: + * The name of the operation to use if requestString contains multiple + * possible operations. Can be omitted if requestString contains only + * one operation. + * fieldResolver: + * A resolver function to use when one is not provided by the schema. + * If not provided, the default field resolver is used (which looks for a + * value on the source value with the field's name). + * validationRules: + * A set of rules for query validation step. Default value is all available rules. + * Empty array would allow to skip query validation (may be convenient for persisted + * queries which are validated before persisting and assumed valid during execution) + * + * @param string|DocumentNode $source + * @param mixed $rootValue + * @param mixed $contextValue + * @param mixed[]|null $variableValues + * @param ValidationRule[] $validationRules + * + * @api + */ +static function executeQuery( + GraphQL\Type\Schema $schema, + $source, + $rootValue = null, + $contextValue = null, + $variableValues = null, + string $operationName = null, + callable $fieldResolver = null, + array $validationRules = null +): GraphQL\Executor\ExecutionResult +``` + +```php +/** + * Same as executeQuery(), but requires PromiseAdapter and always returns a Promise. + * Useful for Async PHP platforms. + * + * @param string|DocumentNode $source + * @param mixed $rootValue + * @param mixed $context + * @param mixed[]|null $variableValues + * @param ValidationRule[]|null $validationRules + * + * @api + */ +static function promiseToExecute( + GraphQL\Executor\Promise\PromiseAdapter $promiseAdapter, + GraphQL\Type\Schema $schema, + $source, + $rootValue = null, + $context = null, + $variableValues = null, + string $operationName = null, + callable $fieldResolver = null, + array $validationRules = null +): GraphQL\Executor\Promise\Promise +``` + +```php +/** + * Returns directives defined in GraphQL spec + * + * @return Directive[] + * + * @api + */ +static function getStandardDirectives(): array +``` + +```php +/** + * Returns types defined in GraphQL spec + * + * @return Type[] + * + * @api + */ +static function getStandardTypes(): array +``` + +```php +/** + * Replaces standard types with types from this list (matching by name) + * Standard types not listed here remain untouched. + * + * @param array $types + * + * @api + */ +static function overrideStandardTypes(array $types) +``` + +```php +/** + * Returns standard validation rules implementing GraphQL spec + * + * @return ValidationRule[] + * + * @api + */ +static function getStandardValidationRules(): array +``` + +```php +/** + * Set default resolver implementation + * + * @api + */ +static function setDefaultFieldResolver(callable $fn): void +``` +# GraphQL\Type\Definition\Type +Registry of standard GraphQL types +and a base class for all other types. + +**Class Methods:** +```php +/** + * @api + */ +static function id(): GraphQL\Type\Definition\ScalarType +``` + +```php +/** + * @api + */ +static function string(): GraphQL\Type\Definition\ScalarType +``` + +```php +/** + * @api + */ +static function boolean(): GraphQL\Type\Definition\ScalarType +``` + +```php +/** + * @api + */ +static function int(): GraphQL\Type\Definition\ScalarType +``` + +```php +/** + * @api + */ +static function float(): GraphQL\Type\Definition\ScalarType +``` + +```php +/** + * @api + */ +static function listOf(GraphQL\Type\Definition\Type $wrappedType): GraphQL\Type\Definition\ListOfType +``` + +```php +/** + * @param callable|NullableType $wrappedType + * + * @api + */ +static function nonNull($wrappedType): GraphQL\Type\Definition\NonNull +``` + +```php +/** + * @param Type $type + * + * @api + */ +static function isInputType($type): bool +``` + +```php +/** + * @param Type $type + * + * @api + */ +static function getNamedType($type): GraphQL\Type\Definition\Type +``` + +```php +/** + * @param Type $type + * + * @api + */ +static function isOutputType($type): bool +``` + +```php +/** + * @param Type $type + * + * @api + */ +static function isLeafType($type): bool +``` + +```php +/** + * @param Type $type + * + * @api + */ +static function isCompositeType($type): bool +``` + +```php +/** + * @param Type $type + * + * @api + */ +static function isAbstractType($type): bool +``` + +```php +/** + * @api + */ +static function getNullableType(GraphQL\Type\Definition\Type $type): GraphQL\Type\Definition\Type +``` +# GraphQL\Type\Definition\ResolveInfo +Structure containing information useful for field resolution process. + +Passed as 4th argument to every field resolver. See [docs on field resolving (data fetching)](data-fetching.md). + +**Class Props:** +```php +/** + * The definition of the field being resolved. + * + * @api + * @var FieldDefinition + */ +public $fieldDefinition; + +/** + * The name of the field being resolved. + * + * @api + * @var string + */ +public $fieldName; + +/** + * Expected return type of the field being resolved. + * + * @api + * @var Type + */ +public $returnType; + +/** + * AST of all nodes referencing this field in the query. + * + * @api + * @var FieldNode[] + */ +public $fieldNodes; + +/** + * Parent type of the field being resolved. + * + * @api + * @var ObjectType + */ +public $parentType; + +/** + * Path to this field from the very root value. + * + * @api + * @var string[] + */ +public $path; + +/** + * Instance of a schema used for execution. + * + * @api + * @var Schema + */ +public $schema; + +/** + * AST of all fragments defined in query. + * + * @api + * @var FragmentDefinitionNode[] + */ +public $fragments; + +/** + * Root value passed to query execution. + * + * @api + * @var mixed + */ +public $rootValue; + +/** + * AST of operation definition node (query, mutation). + * + * @api + * @var OperationDefinitionNode|null + */ +public $operation; + +/** + * Array of variables passed to query execution. + * + * @api + * @var mixed[] + */ +public $variableValues; +``` + +**Class Methods:** +```php +/** + * Helper method that returns names of all fields selected in query for + * $this->fieldName up to $depth levels. + * + * Example: + * query MyQuery{ + * { + * root { + * id, + * nested { + * nested1 + * nested2 { + * nested3 + * } + * } + * } + * } + * + * Given this ResolveInfo instance is a part of "root" field resolution, and $depth === 1, + * method will return: + * [ + * 'id' => true, + * 'nested' => [ + * nested1 => true, + * nested2 => true + * ] + * ] + * + * Warning: this method it is a naive implementation which does not take into account + * conditional typed fragments. So use it with care for fields of interface and union types. + * + * @param int $depth How many levels to include in output + * + * @return array + * + * @api + */ +function getFieldSelection($depth = 0) +``` +# GraphQL\Language\DirectiveLocation +List of available directive locations + +**Class Constants:** +```php +const QUERY = "QUERY"; +const MUTATION = "MUTATION"; +const SUBSCRIPTION = "SUBSCRIPTION"; +const FIELD = "FIELD"; +const FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION"; +const FRAGMENT_SPREAD = "FRAGMENT_SPREAD"; +const INLINE_FRAGMENT = "INLINE_FRAGMENT"; +const VARIABLE_DEFINITION = "VARIABLE_DEFINITION"; +const SCHEMA = "SCHEMA"; +const SCALAR = "SCALAR"; +const OBJECT = "OBJECT"; +const FIELD_DEFINITION = "FIELD_DEFINITION"; +const ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION"; +const IFACE = "INTERFACE"; +const UNION = "UNION"; +const ENUM = "ENUM"; +const ENUM_VALUE = "ENUM_VALUE"; +const INPUT_OBJECT = "INPUT_OBJECT"; +const INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION"; +``` + +# GraphQL\Type\SchemaConfig +Schema configuration class. +Could be passed directly to schema constructor. List of options accepted by **create** method is +[described in docs](type-system/schema.md#configuration-options). + +Usage example: + + $config = SchemaConfig::create() + ->setQuery($myQueryType) + ->setTypeLoader($myTypeLoader); + + $schema = new Schema($config); + +**Class Methods:** +```php +/** + * Converts an array of options to instance of SchemaConfig + * (or just returns empty config when array is not passed). + * + * @param mixed[] $options + * + * @return SchemaConfig + * + * @api + */ +static function create(array $options = []) +``` + +```php +/** + * @return ObjectType|null + * + * @api + */ +function getQuery() +``` + +```php +/** + * @param ObjectType|null $query + * + * @return SchemaConfig + * + * @api + */ +function setQuery($query) +``` + +```php +/** + * @return ObjectType|null + * + * @api + */ +function getMutation() +``` + +```php +/** + * @param ObjectType|null $mutation + * + * @return SchemaConfig + * + * @api + */ +function setMutation($mutation) +``` + +```php +/** + * @return ObjectType|null + * + * @api + */ +function getSubscription() +``` + +```php +/** + * @param ObjectType|null $subscription + * + * @return SchemaConfig + * + * @api + */ +function setSubscription($subscription) +``` + +```php +/** + * @return Type[]|callable + * + * @api + */ +function getTypes() +``` + +```php +/** + * @param Type[]|callable $types + * + * @return SchemaConfig + * + * @api + */ +function setTypes($types) +``` + +```php +/** + * @return Directive[]|null + * + * @api + */ +function getDirectives() +``` + +```php +/** + * @param Directive[] $directives + * + * @return SchemaConfig + * + * @api + */ +function setDirectives(array $directives) +``` + +```php +/** + * @return callable(string $name):Type|null + * + * @api + */ +function getTypeLoader() +``` + +```php +/** + * @return SchemaConfig + * + * @api + */ +function setTypeLoader(callable $typeLoader) +``` +# GraphQL\Type\Schema +Schema Definition (see [related docs](type-system/schema.md)) + +A Schema is created by supplying the root types of each type of operation: +query, mutation (optional) and subscription (optional). A schema definition is +then supplied to the validator and executor. Usage Example: + + $schema = new GraphQL\Type\Schema([ + 'query' => $MyAppQueryRootType, + 'mutation' => $MyAppMutationRootType, + ]); + +Or using Schema Config instance: + + $config = GraphQL\Type\SchemaConfig::create() + ->setQuery($MyAppQueryRootType) + ->setMutation($MyAppMutationRootType); + + $schema = new GraphQL\Type\Schema($config); + +**Class Methods:** +```php +/** + * @param mixed[]|SchemaConfig $config + * + * @api + */ +function __construct($config) +``` + +```php +/** + * Returns array of all types in this schema. Keys of this array represent type names, values are instances + * of corresponding type definitions + * + * This operation requires full schema scan. Do not use in production environment. + * + * @return Type[] + * + * @api + */ +function getTypeMap() +``` + +```php +/** + * Returns a list of directives supported by this schema + * + * @return Directive[] + * + * @api + */ +function getDirectives() +``` + +```php +/** + * Returns schema query type + * + * @return ObjectType + * + * @api + */ +function getQueryType(): GraphQL\Type\Definition\Type +``` + +```php +/** + * Returns schema mutation type + * + * @return ObjectType|null + * + * @api + */ +function getMutationType(): GraphQL\Type\Definition\Type +``` + +```php +/** + * Returns schema subscription + * + * @return ObjectType|null + * + * @api + */ +function getSubscriptionType(): GraphQL\Type\Definition\Type +``` + +```php +/** + * @return SchemaConfig + * + * @api + */ +function getConfig() +``` + +```php +/** + * Returns type by its name + * + * @api + */ +function getType(string $name): GraphQL\Type\Definition\Type +``` + +```php +/** + * Returns all possible concrete types for given abstract type + * (implementations for interfaces and members of union type for unions) + * + * This operation requires full schema scan. Do not use in production environment. + * + * @param InterfaceType|UnionType $abstractType + * + * @return array + * + * @api + */ +function getPossibleTypes(GraphQL\Type\Definition\Type $abstractType): array +``` + +```php +/** + * Returns true if object type is concrete type of given abstract type + * (implementation for interfaces and members of union type for unions) + * + * @api + */ +function isPossibleType( + GraphQL\Type\Definition\AbstractType $abstractType, + GraphQL\Type\Definition\ObjectType $possibleType +): bool +``` + +```php +/** + * Returns instance of directive by name + * + * @api + */ +function getDirective(string $name): GraphQL\Type\Definition\Directive +``` + +```php +/** + * Validates schema. + * + * This operation requires full schema scan. Do not use in production environment. + * + * @throws InvariantViolation + * + * @api + */ +function assertValid() +``` + +```php +/** + * Validates schema. + * + * This operation requires full schema scan. Do not use in production environment. + * + * @return InvariantViolation[]|Error[] + * + * @api + */ +function validate() +``` +# GraphQL\Language\Parser +Parses string containing GraphQL query or [type definition](type-system/type-language.md) to Abstract Syntax Tree. + +Those magic functions allow partial parsing: + +@method static DocumentNode document(Source|string $source, bool[] $options = []) +@method static ExecutableDefinitionNode executableDefinition(Source|string $source, bool[] $options = []) +@method static string operationType(Source|string $source, bool[] $options = []) +@method static VariableDefinitionNode variableDefinition(Source|string $source, bool[] $options = []) +@method static SelectionSetNode selectionSet(Source|string $source, bool[] $options = []) +@method static FieldNode field(Source|string $source, bool[] $options = []) +@method static NodeList constArguments(Source|string $source, bool[] $options = []) +@method static ArgumentNode constArgument(Source|string $source, bool[] $options = []) +@method static FragmentDefinitionNode fragmentDefinition(Source|string $source, bool[] $options = []) +@method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|NullValueNode|ObjectValueNode|StringValueNode|VariableNode valueLiteral(Source|string $source, bool[] $options = []) +@method static StringValueNode stringLiteral(Source|string $source, bool[] $options = []) +@method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode variableValue(Source|string $source, bool[] $options = []) +@method static ListValueNode constArray(Source|string $source, bool[] $options = []) +@method static ObjectValueNode constObject(Source|string $source, bool[] $options = []) +@method static ObjectFieldNode constObjectField(Source|string $source, bool[] $options = []) +@method static NodeList constDirectives(Source|string $source, bool[] $options = []) +@method static DirectiveNode constDirective(Source|string $source, bool[] $options = []) +@method static NamedTypeNode namedType(Source|string $source, bool[] $options = []) +@method static StringValueNode|null description(Source|string $source, bool[] $options = []) +@method static OperationTypeDefinitionNode operationTypeDefinition(Source|string $source, bool[] $options = []) +@method static ObjectTypeDefinitionNode objectTypeDefinition(Source|string $source, bool[] $options = []) +@method static NodeList fieldsDefinition(Source|string $source, bool[] $options = []) +@method static NodeList argumentsDefinition(Source|string $source, bool[] $options = []) +@method static InterfaceTypeDefinitionNode interfaceTypeDefinition(Source|string $source, bool[] $options = []) +@method static NamedTypeNode[] unionMemberTypes(Source|string $source, bool[] $options = []) +@method static NodeList enumValuesDefinition(Source|string $source, bool[] $options = []) +@method static InputObjectTypeDefinitionNode inputObjectTypeDefinition(Source|string $source, bool[] $options = []) +@method static TypeExtensionNode typeExtension(Source|string $source, bool[] $options = []) +@method static ScalarTypeExtensionNode scalarTypeExtension(Source|string $source, bool[] $options = []) +@method static InterfaceTypeExtensionNode interfaceTypeExtension(Source|string $source, bool[] $options = []) +@method static EnumTypeExtensionNode enumTypeExtension(Source|string $source, bool[] $options = []) +@method static DirectiveDefinitionNode directiveDefinition(Source|string $source, bool[] $options = []) +@method static DirectiveLocation directiveLocation(Source|string $source, bool[] $options = []) + +**Class Methods:** +```php +/** + * Given a GraphQL source, parses it into a `GraphQL\Language\AST\DocumentNode`. + * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. + * + * Available options: + * + * noLocation: boolean, + * (By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing.) + * + * allowLegacySDLEmptyFields: boolean + * If enabled, the parser will parse empty fields sets in the Schema + * Definition Language. Otherwise, the parser will follow the current + * specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in a future major release. + * + * allowLegacySDLImplementsInterfaces: boolean + * If enabled, the parser will parse implemented interfaces with no `&` + * character between each interface. Otherwise, the parser will follow the + * current specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in a future major release. + * + * experimentalFragmentVariables: boolean, + * (If enabled, the parser will understand and parse variable definitions + * contained in a fragment definition. They'll be represented in the + * `variableDefinitions` field of the FragmentDefinitionNode. + * + * The syntax is identical to normal, query-defined variables. For example: + * + * fragment A($var: Boolean = false) on T { + * ... + * } + * + * Note: this feature is experimental and may change or be removed in the + * future.) + * + * @param Source|string $source + * @param bool[] $options + * + * @return DocumentNode + * + * @throws SyntaxError + * + * @api + */ +static function parse($source, array $options = []) +``` + +```php +/** + * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for + * that value. + * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Values directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: `GraphQL\Utils\AST::valueFromAST()`. + * + * @param Source|string $source + * @param bool[] $options + * + * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode + * + * @api + */ +static function parseValue($source, array $options = []) +``` + +```php +/** + * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for + * that type. + * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Types directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: `GraphQL\Utils\AST::typeFromAST()`. + * + * @param Source|string $source + * @param bool[] $options + * + * @return ListTypeNode|NamedTypeNode|NonNullTypeNode + * + * @api + */ +static function parseType($source, array $options = []) +``` +# GraphQL\Language\Printer +Prints AST to string. Capable of printing GraphQL queries and Type definition language. +Useful for pretty-printing queries or printing back AST for logging, documentation, etc. + +Usage example: + +```php +$query = 'query myQuery {someField}'; +$ast = GraphQL\Language\Parser::parse($query); +$printed = GraphQL\Language\Printer::doPrint($ast); +``` + +**Class Methods:** +```php +/** + * Prints AST to string. Capable of printing GraphQL queries and Type definition language. + * + * @param Node $ast + * + * @return string + * + * @api + */ +static function doPrint($ast) +``` +# GraphQL\Language\Visitor +Utility for efficient AST traversal and modification. + +`visit()` will walk through an AST using a depth first traversal, calling +the visitor's enter function at each node in the traversal, and calling the +leave function after visiting that node and all of it's child nodes. + +By returning different values from the enter and leave functions, the +behavior of the visitor can be altered, including skipping over a sub-tree of +the AST (by returning false), editing the AST by returning a value or null +to remove the value, or to stop the whole traversal by returning BREAK. + +When using `visit()` to edit an AST, the original AST will not be modified, and +a new version of the AST with the changes applied will be returned from the +visit function. + + $editedAST = Visitor::visit($ast, [ + 'enter' => function ($node, $key, $parent, $path, $ancestors) { + // return + // null: no action + // Visitor::skipNode(): skip visiting this node + // Visitor::stop(): stop visiting altogether + // Visitor::removeNode(): delete this node + // any value: replace this node with the returned value + }, + 'leave' => function ($node, $key, $parent, $path, $ancestors) { + // return + // null: no action + // Visitor::stop(): stop visiting altogether + // Visitor::removeNode(): delete this node + // any value: replace this node with the returned value + } + ]); + +Alternatively to providing enter() and leave() functions, a visitor can +instead provide functions named the same as the [kinds of AST nodes](reference.md#graphqllanguageastnodekind), +or enter/leave visitors at a named key, leading to four permutations of +visitor API: + +1) Named visitors triggered when entering a node a specific kind. + + Visitor::visit($ast, [ + 'Kind' => function ($node) { + // enter the "Kind" node + } + ]); + +2) Named visitors that trigger upon entering and leaving a node of + a specific kind. + + Visitor::visit($ast, [ + 'Kind' => [ + 'enter' => function ($node) { + // enter the "Kind" node + } + 'leave' => function ($node) { + // leave the "Kind" node + } + ] + ]); + +3) Generic visitors that trigger upon entering and leaving any node. + + Visitor::visit($ast, [ + 'enter' => function ($node) { + // enter any node + }, + 'leave' => function ($node) { + // leave any node + } + ]); + +4) Parallel visitors for entering and leaving nodes of a specific kind. + + Visitor::visit($ast, [ + 'enter' => [ + 'Kind' => function($node) { + // enter the "Kind" node + } + }, + 'leave' => [ + 'Kind' => function ($node) { + // leave the "Kind" node + } + ] + ]); + +**Class Methods:** +```php +/** + * Visit the AST (see class description for details) + * + * @param Node|ArrayObject|stdClass $root + * @param callable[] $visitor + * @param mixed[]|null $keyMap + * + * @return Node|mixed + * + * @throws Exception + * + * @api + */ +static function visit($root, $visitor, $keyMap = null) +``` + +```php +/** + * Returns marker for visitor break + * + * @return VisitorOperation + * + * @api + */ +static function stop() +``` + +```php +/** + * Returns marker for skipping current node + * + * @return VisitorOperation + * + * @api + */ +static function skipNode() +``` + +```php +/** + * Returns marker for removing a node + * + * @return VisitorOperation + * + * @api + */ +static function removeNode() +``` +# GraphQL\Language\AST\NodeKind + + +**Class Constants:** +```php +const NAME = "Name"; +const DOCUMENT = "Document"; +const OPERATION_DEFINITION = "OperationDefinition"; +const VARIABLE_DEFINITION = "VariableDefinition"; +const VARIABLE = "Variable"; +const SELECTION_SET = "SelectionSet"; +const FIELD = "Field"; +const ARGUMENT = "Argument"; +const FRAGMENT_SPREAD = "FragmentSpread"; +const INLINE_FRAGMENT = "InlineFragment"; +const FRAGMENT_DEFINITION = "FragmentDefinition"; +const INT = "IntValue"; +const FLOAT = "FloatValue"; +const STRING = "StringValue"; +const BOOLEAN = "BooleanValue"; +const ENUM = "EnumValue"; +const NULL = "NullValue"; +const LST = "ListValue"; +const OBJECT = "ObjectValue"; +const OBJECT_FIELD = "ObjectField"; +const DIRECTIVE = "Directive"; +const NAMED_TYPE = "NamedType"; +const LIST_TYPE = "ListType"; +const NON_NULL_TYPE = "NonNullType"; +const SCHEMA_DEFINITION = "SchemaDefinition"; +const OPERATION_TYPE_DEFINITION = "OperationTypeDefinition"; +const SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition"; +const OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition"; +const FIELD_DEFINITION = "FieldDefinition"; +const INPUT_VALUE_DEFINITION = "InputValueDefinition"; +const INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition"; +const UNION_TYPE_DEFINITION = "UnionTypeDefinition"; +const ENUM_TYPE_DEFINITION = "EnumTypeDefinition"; +const ENUM_VALUE_DEFINITION = "EnumValueDefinition"; +const INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition"; +const SCALAR_TYPE_EXTENSION = "ScalarTypeExtension"; +const OBJECT_TYPE_EXTENSION = "ObjectTypeExtension"; +const INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension"; +const UNION_TYPE_EXTENSION = "UnionTypeExtension"; +const ENUM_TYPE_EXTENSION = "EnumTypeExtension"; +const INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension"; +const DIRECTIVE_DEFINITION = "DirectiveDefinition"; +const SCHEMA_EXTENSION = "SchemaExtension"; +``` + +# GraphQL\Executor\Executor +Implements the "Evaluating requests" section of the GraphQL specification. + +**Class Methods:** +```php +/** + * Executes DocumentNode against given $schema. + * + * Always returns ExecutionResult and never throws. All errors which occur during operation + * execution are collected in `$result->errors`. + * + * @param mixed|null $rootValue + * @param mixed|null $contextValue + * @param mixed[]|ArrayAccess|null $variableValues + * @param string|null $operationName + * + * @return ExecutionResult|Promise + * + * @api + */ +static function execute( + GraphQL\Type\Schema $schema, + GraphQL\Language\AST\DocumentNode $documentNode, + $rootValue = null, + $contextValue = null, + $variableValues = null, + $operationName = null, + callable $fieldResolver = null +) +``` + +```php +/** + * Same as execute(), but requires promise adapter and returns a promise which is always + * fulfilled with an instance of ExecutionResult and never rejected. + * + * Useful for async PHP platforms. + * + * @param mixed|null $rootValue + * @param mixed|null $contextValue + * @param mixed[]|null $variableValues + * @param string|null $operationName + * + * @return Promise + * + * @api + */ +static function promiseToExecute( + GraphQL\Executor\Promise\PromiseAdapter $promiseAdapter, + GraphQL\Type\Schema $schema, + GraphQL\Language\AST\DocumentNode $documentNode, + $rootValue = null, + $contextValue = null, + $variableValues = null, + $operationName = null, + callable $fieldResolver = null +) +``` +# GraphQL\Executor\ExecutionResult +Returned after [query execution](executing-queries.md). +Represents both - result of successful execution and of a failed one +(with errors collected in `errors` prop) + +Could be converted to [spec-compliant](https://facebook.github.io/graphql/#sec-Response-Format) +serializable array using `toArray()` + +**Class Props:** +```php +/** + * Data collected from resolvers during query execution + * + * @api + * @var mixed[] + */ +public $data; + +/** + * Errors registered during query execution. + * + * If an error was caused by exception thrown in resolver, $error->getPrevious() would + * contain original exception. + * + * @api + * @var Error[] + */ +public $errors; + +/** + * User-defined serializable array of extensions included in serialized result. + * Conforms to + * + * @api + * @var mixed[] + */ +public $extensions; +``` + +**Class Methods:** +```php +/** + * Define custom error formatting (must conform to http://facebook.github.io/graphql/#sec-Errors) + * + * Expected signature is: function (GraphQL\Error\Error $error): array + * + * Default formatter is "GraphQL\Error\FormattedError::createFromException" + * + * Expected returned value must be an array: + * array( + * 'message' => 'errorMessage', + * // ... other keys + * ); + * + * @return self + * + * @api + */ +function setErrorFormatter(callable $errorFormatter) +``` + +```php +/** + * Define custom logic for error handling (filtering, logging, etc). + * + * Expected handler signature is: function (array $errors, callable $formatter): array + * + * Default handler is: + * function (array $errors, callable $formatter) { + * return array_map($formatter, $errors); + * } + * + * @return self + * + * @api + */ +function setErrorsHandler(callable $handler) +``` + +```php +/** + * Converts GraphQL query result to spec-compliant serializable array using provided + * errors handler and formatter. + * + * If debug argument is passed, output of error formatter is enriched which debugging information + * ("debugMessage", "trace" keys depending on flags). + * + * $debug argument must sum of flags from @see \GraphQL\Error\DebugFlag + * + * @return mixed[] + * + * @api + */ +function toArray(int $debug = "GraphQL\Error\DebugFlag::NONE"): array +``` +# GraphQL\Executor\Promise\PromiseAdapter +Provides a means for integration of async PHP platforms ([related docs](data-fetching.md#async-php)) + +**Interface Methods:** +```php +/** + * Return true if the value is a promise or a deferred of the underlying platform + * + * @param mixed $value + * + * @return bool + * + * @api + */ +function isThenable($value) +``` + +```php +/** + * Converts thenable of the underlying platform into GraphQL\Executor\Promise\Promise instance + * + * @param object $thenable + * + * @return Promise + * + * @api + */ +function convertThenable($thenable) +``` + +```php +/** + * Accepts our Promise wrapper, extracts adopted promise out of it and executes actual `then` logic described + * in Promises/A+ specs. Then returns new wrapped instance of GraphQL\Executor\Promise\Promise. + * + * @return Promise + * + * @api + */ +function then( + GraphQL\Executor\Promise\Promise $promise, + callable $onFulfilled = null, + callable $onRejected = null +) +``` + +```php +/** + * Creates a Promise + * + * Expected resolver signature: + * function(callable $resolve, callable $reject) + * + * @return Promise + * + * @api + */ +function create(callable $resolver) +``` + +```php +/** + * Creates a fulfilled Promise for a value if the value is not a promise. + * + * @param mixed $value + * + * @return Promise + * + * @api + */ +function createFulfilled($value = null) +``` + +```php +/** + * Creates a rejected promise for a reason if the reason is not a promise. If + * the provided reason is a promise, then it is returned as-is. + * + * @param Throwable $reason + * + * @return Promise + * + * @api + */ +function createRejected($reason) +``` + +```php +/** + * Given an array of promises (or values), returns a promise that is fulfilled when all the + * items in the array are fulfilled. + * + * @param Promise[]|mixed[] $promisesOrValues Promises or values. + * + * @return Promise + * + * @api + */ +function all(array $promisesOrValues) +``` +# GraphQL\Validator\DocumentValidator +Implements the "Validation" section of the spec. + +Validation runs synchronously, returning an array of encountered errors, or +an empty array if no errors were encountered and the document is valid. + +A list of specific validation rules may be provided. If not provided, the +default list of rules defined by the GraphQL specification will be used. + +Each validation rule is an instance of GraphQL\Validator\Rules\ValidationRule +which returns a visitor (see the [GraphQL\Language\Visitor API](reference.md#graphqllanguagevisitor)). + +Visitor methods are expected to return an instance of [GraphQL\Error\Error](reference.md#graphqlerrorerror), +or array of such instances when invalid. + +Optionally a custom TypeInfo instance may be provided. If not provided, one +will be created from the provided schema. + +**Class Methods:** +```php +/** + * Primary method for query validation. See class description for details. + * + * @param ValidationRule[]|null $rules + * + * @return Error[] + * + * @api + */ +static function validate( + GraphQL\Type\Schema $schema, + GraphQL\Language\AST\DocumentNode $ast, + array $rules = null, + GraphQL\Utils\TypeInfo $typeInfo = null +) +``` + +```php +/** + * Returns all global validation rules. + * + * @return ValidationRule[] + * + * @api + */ +static function allRules() +``` + +```php +/** + * Returns global validation rule by name. Standard rules are named by class name, so + * example usage for such rules: + * + * $rule = DocumentValidator::getRule(GraphQL\Validator\Rules\QueryComplexity::class); + * + * @param string $name + * + * @return ValidationRule + * + * @api + */ +static function getRule($name) +``` + +```php +/** + * Add rule to list of global validation rules + * + * @api + */ +static function addRule(GraphQL\Validator\Rules\ValidationRule $rule) +``` +# GraphQL\Error\Error +Describes an Error found during the parse, validate, or +execute phases of performing a GraphQL operation. In addition to a message +and stack trace, it also includes information about the locations in a +GraphQL document and/or execution result that correspond to the Error. + +When the error was caused by an exception thrown in resolver, original exception +is available via `getPrevious()`. + +Also read related docs on [error handling](error-handling.md) + +Class extends standard PHP `\Exception`, so all standard methods of base `\Exception` class +are available in addition to those listed below. + +**Class Constants:** +```php +const CATEGORY_GRAPHQL = "graphql"; +const CATEGORY_INTERNAL = "internal"; +``` + +**Class Methods:** +```php +/** + * An array of locations within the source GraphQL document which correspond to this error. + * + * Each entry has information about `line` and `column` within source GraphQL document: + * $location->line; + * $location->column; + * + * Errors during validation often contain multiple locations, for example to + * point out to field mentioned in multiple fragments. Errors during execution include a + * single location, the field which produced the error. + * + * @return SourceLocation[] + * + * @api + */ +function getLocations() +``` + +```php +/** + * Returns an array describing the path from the root value to the field which produced this error. + * Only included for execution errors. + * + * @return mixed[]|null + * + * @api + */ +function getPath() +``` +# GraphQL\Error\Warning +Encapsulates warnings produced by the library. + +Warnings can be suppressed (individually or all) if required. +Also it is possible to override warning handler (which is **trigger_error()** by default) + +**Class Constants:** +```php +const WARNING_ASSIGN = 2; +const WARNING_CONFIG = 4; +const WARNING_FULL_SCHEMA_SCAN = 8; +const WARNING_CONFIG_DEPRECATION = 16; +const WARNING_NOT_A_TYPE = 32; +const ALL = 63; +``` + +**Class Methods:** +```php +/** + * Sets warning handler which can intercept all system warnings. + * When not set, trigger_error() is used to notify about warnings. + * + * @api + */ +static function setWarningHandler(callable $warningHandler = null): void +``` + +```php +/** + * Suppress warning by id (has no effect when custom warning handler is set) + * + * Usage example: + * Warning::suppress(Warning::WARNING_NOT_A_TYPE) + * + * When passing true - suppresses all warnings. + * + * @param bool|int $suppress + * + * @api + */ +static function suppress($suppress = true): void +``` + +```php +/** + * Re-enable previously suppressed warning by id + * + * Usage example: + * Warning::suppress(Warning::WARNING_NOT_A_TYPE) + * + * When passing true - re-enables all warnings. + * + * @param bool|int $enable + * + * @api + */ +static function enable($enable = true): void +``` +# GraphQL\Error\ClientAware +This interface is used for [default error formatting](error-handling.md). + +Only errors implementing this interface (and returning true from `isClientSafe()`) +will be formatted with original error message. + +All other errors will be formatted with generic "Internal server error". + +**Interface Methods:** +```php +/** + * Returns true when exception message is safe to be displayed to a client. + * + * @return bool + * + * @api + */ +function isClientSafe() +``` + +```php +/** + * Returns string describing a category of the error. + * + * Value "graphql" is reserved for errors produced by query parsing or validation, do not use it. + * + * @return string + * + * @api + */ +function getCategory() +``` +# GraphQL\Error\DebugFlag +Collection of flags for [error debugging](error-handling.md#debugging-tools). + +**Class Constants:** +```php +const NONE = 0; +const INCLUDE_DEBUG_MESSAGE = 1; +const INCLUDE_TRACE = 2; +const RETHROW_INTERNAL_EXCEPTIONS = 4; +const RETHROW_UNSAFE_EXCEPTIONS = 8; +``` + +# GraphQL\Error\FormattedError +This class is used for [default error formatting](error-handling.md). +It converts PHP exceptions to [spec-compliant errors](https://facebook.github.io/graphql/#sec-Errors) +and provides tools for error debugging. + +**Class Methods:** +```php +/** + * Set default error message for internal errors formatted using createFormattedError(). + * This value can be overridden by passing 3rd argument to `createFormattedError()`. + * + * @param string $msg + * + * @api + */ +static function setInternalErrorMessage($msg) +``` + +```php +/** + * Standard GraphQL error formatter. Converts any exception to array + * conforming to GraphQL spec. + * + * This method only exposes exception message when exception implements ClientAware interface + * (or when debug flags are passed). + * + * For a list of available debug flags @see \GraphQL\Error\DebugFlag constants. + * + * @param string $internalErrorMessage + * + * @return mixed[] + * + * @throws Throwable + * + * @api + */ +static function createFromException( + Throwable $exception, + int $debug = "GraphQL\Error\DebugFlag::NONE", + $internalErrorMessage = null +): array +``` + +```php +/** + * Returns error trace as serializable array + * + * @param Throwable $error + * + * @return mixed[] + * + * @api + */ +static function toSafeTrace($error) +``` +# GraphQL\Server\StandardServer +GraphQL server compatible with both: [express-graphql](https://github.com/graphql/express-graphql) +and [Apollo Server](https://github.com/apollographql/graphql-server). +Usage Example: + + $server = new StandardServer([ + 'schema' => $mySchema + ]); + $server->handleRequest(); + +Or using [ServerConfig](reference.md#graphqlserverserverconfig) instance: + + $config = GraphQL\Server\ServerConfig::create() + ->setSchema($mySchema) + ->setContext($myContext); + + $server = new GraphQL\Server\StandardServer($config); + $server->handleRequest(); + +See [dedicated section in docs](executing-queries.md#using-server) for details. + +**Class Methods:** +```php +/** + * Converts and exception to error and sends spec-compliant HTTP 500 error. + * Useful when an exception is thrown somewhere outside of server execution context + * (e.g. during schema instantiation). + * + * @param Throwable $error + * @param bool $debug + * @param bool $exitWhenDone + * + * @api + */ +static function send500Error($error, $debug = false, $exitWhenDone = false) +``` + +```php +/** + * Creates new instance of a standard GraphQL HTTP server + * + * @param ServerConfig|mixed[] $config + * + * @api + */ +function __construct($config) +``` + +```php +/** + * Parses HTTP request, executes and emits response (using standard PHP `header` function and `echo`) + * + * By default (when $parsedBody is not set) it uses PHP globals to parse a request. + * It is possible to implement request parsing elsewhere (e.g. using framework Request instance) + * and then pass it to the server. + * + * See `executeRequest()` if you prefer to emit response yourself + * (e.g. using Response object of some framework) + * + * @param OperationParams|OperationParams[] $parsedBody + * @param bool $exitWhenDone + * + * @api + */ +function handleRequest($parsedBody = null, $exitWhenDone = false) +``` + +```php +/** + * Executes GraphQL operation and returns execution result + * (or promise when promise adapter is different from SyncPromiseAdapter). + * + * By default (when $parsedBody is not set) it uses PHP globals to parse a request. + * It is possible to implement request parsing elsewhere (e.g. using framework Request instance) + * and then pass it to the server. + * + * PSR-7 compatible method executePsrRequest() does exactly this. + * + * @param OperationParams|OperationParams[] $parsedBody + * + * @return ExecutionResult|ExecutionResult[]|Promise + * + * @throws InvariantViolation + * + * @api + */ +function executeRequest($parsedBody = null) +``` + +```php +/** + * Executes PSR-7 request and fulfills PSR-7 response. + * + * See `executePsrRequest()` if you prefer to create response yourself + * (e.g. using specific JsonResponse instance of some framework). + * + * @return ResponseInterface|Promise + * + * @api + */ +function processPsrRequest( + Psr\Http\Message\RequestInterface $request, + Psr\Http\Message\ResponseInterface $response, + Psr\Http\Message\StreamInterface $writableBodyStream +) +``` + +```php +/** + * Executes GraphQL operation and returns execution result + * (or promise when promise adapter is different from SyncPromiseAdapter) + * + * @return ExecutionResult|ExecutionResult[]|Promise + * + * @api + */ +function executePsrRequest(Psr\Http\Message\RequestInterface $request) +``` + +```php +/** + * Returns an instance of Server helper, which contains most of the actual logic for + * parsing / validating / executing request (which could be re-used by other server implementations) + * + * @return Helper + * + * @api + */ +function getHelper() +``` +# GraphQL\Server\ServerConfig +Server configuration class. +Could be passed directly to server constructor. List of options accepted by **create** method is +[described in docs](executing-queries.md#server-configuration-options). + +Usage example: + + $config = GraphQL\Server\ServerConfig::create() + ->setSchema($mySchema) + ->setContext($myContext); + + $server = new GraphQL\Server\StandardServer($config); + +**Class Methods:** +```php +/** + * Converts an array of options to instance of ServerConfig + * (or just returns empty config when array is not passed). + * + * @param mixed[] $config + * + * @return ServerConfig + * + * @api + */ +static function create(array $config = []) +``` + +```php +/** + * @return self + * + * @api + */ +function setSchema(GraphQL\Type\Schema $schema) +``` + +```php +/** + * @param mixed|callable $context + * + * @return self + * + * @api + */ +function setContext($context) +``` + +```php +/** + * @param mixed|callable $rootValue + * + * @return self + * + * @api + */ +function setRootValue($rootValue) +``` + +```php +/** + * Expects function(Throwable $e) : array + * + * @return self + * + * @api + */ +function setErrorFormatter(callable $errorFormatter) +``` + +```php +/** + * Expects function(array $errors, callable $formatter) : array + * + * @return self + * + * @api + */ +function setErrorsHandler(callable $handler) +``` + +```php +/** + * Set validation rules for this server. + * + * @param ValidationRule[]|callable|null $validationRules + * + * @return self + * + * @api + */ +function setValidationRules($validationRules) +``` + +```php +/** + * @return self + * + * @api + */ +function setFieldResolver(callable $fieldResolver) +``` + +```php +/** + * Expects function($queryId, OperationParams $params) : string|DocumentNode + * + * This function must return query string or valid DocumentNode. + * + * @return self + * + * @api + */ +function setPersistentQueryLoader(callable $persistentQueryLoader) +``` + +```php +/** + * Set response debug flags. @see \GraphQL\Error\DebugFlag class for a list of all available flags + * + * @api + */ +function setDebugFlag(int $debugFlag = "GraphQL\Error\DebugFlag::INCLUDE_DEBUG_MESSAGE"): self +``` + +```php +/** + * Allow batching queries (disabled by default) + * + * @api + */ +function setQueryBatching(bool $enableBatching): self +``` + +```php +/** + * @return self + * + * @api + */ +function setPromiseAdapter(GraphQL\Executor\Promise\PromiseAdapter $promiseAdapter) +``` +# GraphQL\Server\Helper +Contains functionality that could be re-used by various server implementations + +**Class Methods:** +```php +/** + * Parses HTTP request using PHP globals and returns GraphQL OperationParams + * contained in this request. For batched requests it returns an array of OperationParams. + * + * This function does not check validity of these params + * (validation is performed separately in validateOperationParams() method). + * + * If $readRawBodyFn argument is not provided - will attempt to read raw request body + * from `php://input` stream. + * + * Internally it normalizes input to $method, $bodyParams and $queryParams and + * calls `parseRequestParams()` to produce actual return value. + * + * For PSR-7 request parsing use `parsePsrRequest()` instead. + * + * @return OperationParams|OperationParams[] + * + * @throws RequestError + * + * @api + */ +function parseHttpRequest(callable $readRawBodyFn = null) +``` + +```php +/** + * Parses normalized request params and returns instance of OperationParams + * or array of OperationParams in case of batch operation. + * + * Returned value is a suitable input for `executeOperation` or `executeBatch` (if array) + * + * @param string $method + * @param mixed[] $bodyParams + * @param mixed[] $queryParams + * + * @return OperationParams|OperationParams[] + * + * @throws RequestError + * + * @api + */ +function parseRequestParams($method, array $bodyParams, array $queryParams) +``` + +```php +/** + * Checks validity of OperationParams extracted from HTTP request and returns an array of errors + * if params are invalid (or empty array when params are valid) + * + * @return array + * + * @api + */ +function validateOperationParams(GraphQL\Server\OperationParams $params) +``` + +```php +/** + * Executes GraphQL operation with given server configuration and returns execution result + * (or promise when promise adapter is different from SyncPromiseAdapter) + * + * @return ExecutionResult|Promise + * + * @api + */ +function executeOperation(GraphQL\Server\ServerConfig $config, GraphQL\Server\OperationParams $op) +``` + +```php +/** + * Executes batched GraphQL operations with shared promise queue + * (thus, effectively batching deferreds|promises of all queries at once) + * + * @param OperationParams[] $operations + * + * @return ExecutionResult|ExecutionResult[]|Promise + * + * @api + */ +function executeBatch(GraphQL\Server\ServerConfig $config, array $operations) +``` + +```php +/** + * Send response using standard PHP `header()` and `echo`. + * + * @param Promise|ExecutionResult|ExecutionResult[] $result + * @param bool $exitWhenDone + * + * @api + */ +function sendResponse($result, $exitWhenDone = false) +``` + +```php +/** + * Converts PSR-7 request to OperationParams[] + * + * @return OperationParams[]|OperationParams + * + * @throws RequestError + * + * @api + */ +function parsePsrRequest(Psr\Http\Message\RequestInterface $request) +``` + +```php +/** + * Converts query execution result to PSR-7 response + * + * @param Promise|ExecutionResult|ExecutionResult[] $result + * + * @return Promise|ResponseInterface + * + * @api + */ +function toPsrResponse( + $result, + Psr\Http\Message\ResponseInterface $response, + Psr\Http\Message\StreamInterface $writableBodyStream +) +``` +# GraphQL\Server\OperationParams +Structure representing parsed HTTP parameters for GraphQL operation + +**Class Props:** +```php +/** + * Id of the query (when using persistent queries). + * + * Valid aliases (case-insensitive): + * - id + * - queryId + * - documentId + * + * @api + * @var string + */ +public $queryId; + +/** + * @api + * @var string + */ +public $query; + +/** + * @api + * @var string + */ +public $operation; + +/** + * @api + * @var mixed[]|null + */ +public $variables; + +/** + * @api + * @var mixed[]|null + */ +public $extensions; +``` + +**Class Methods:** +```php +/** + * Creates an instance from given array + * + * @param mixed[] $params + * + * @api + */ +static function create(array $params, bool $readonly = false): GraphQL\Server\OperationParams +``` + +```php +/** + * @param string $key + * + * @return mixed + * + * @api + */ +function getOriginalInput($key) +``` + +```php +/** + * Indicates that operation is executed in read-only context + * (e.g. via HTTP GET request) + * + * @return bool + * + * @api + */ +function isReadOnly() +``` +# GraphQL\Utils\BuildSchema +Build instance of `GraphQL\Type\Schema` out of type language definition (string or parsed AST) +See [section in docs](type-system/type-language.md) for details. + +**Class Methods:** +```php +/** + * A helper function to build a GraphQLSchema directly from a source + * document. + * + * @param DocumentNode|Source|string $source + * @param bool[] $options + * + * @return Schema + * + * @api + */ +static function build($source, callable $typeConfigDecorator = null, array $options = []) +``` + +```php +/** + * This takes the ast of a schema document produced by the parse function in + * GraphQL\Language\Parser. + * + * If no schema definition is provided, then it will look for types named Query + * and Mutation. + * + * Given that AST it constructs a GraphQL\Type\Schema. The resulting schema + * has no resolve methods, so execution will use default resolvers. + * + * Accepts options as a third argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * This option is provided to ease adoption and will be removed in v16. + * + * @param bool[] $options + * + * @return Schema + * + * @throws Error + * + * @api + */ +static function buildAST( + GraphQL\Language\AST\DocumentNode $ast, + callable $typeConfigDecorator = null, + array $options = [] +) +``` +# GraphQL\Utils\AST +Various utilities dealing with AST + +**Class Methods:** +```php +/** + * Convert representation of AST as an associative array to instance of GraphQL\Language\AST\Node. + * + * For example: + * + * ```php + * AST::fromArray([ + * 'kind' => 'ListValue', + * 'values' => [ + * ['kind' => 'StringValue', 'value' => 'my str'], + * ['kind' => 'StringValue', 'value' => 'my other str'] + * ], + * 'loc' => ['start' => 21, 'end' => 25] + * ]); + * ``` + * + * Will produce instance of `ListValueNode` where `values` prop is a lazily-evaluated `NodeList` + * returning instances of `StringValueNode` on access. + * + * This is a reverse operation for AST::toArray($node) + * + * @param mixed[] $node + * + * @api + */ +static function fromArray(array $node): GraphQL\Language\AST\Node +``` + +```php +/** + * Convert AST node to serializable array + * + * @return mixed[] + * + * @api + */ +static function toArray(GraphQL\Language\AST\Node $node): array +``` + +```php +/** + * Produces a GraphQL Value AST given a PHP value. + * + * Optionally, a GraphQL type may be provided, which will be used to + * disambiguate between value primitives. + * + * | PHP Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Assoc Array | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Int | Int | + * | Float | Int / Float | + * | Mixed | Enum Value | + * | null | NullValue | + * + * @param Type|mixed|null $value + * + * @return ObjectValueNode|ListValueNode|BooleanValueNode|IntValueNode|FloatValueNode|EnumValueNode|StringValueNode|NullValueNode|null + * + * @api + */ +static function astFromValue($value, GraphQL\Type\Definition\InputType $type) +``` + +```php +/** + * Produces a PHP value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `null` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | PHP Value | + * | -------------------- | ------------- | + * | Input Object | Assoc Array | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Int / Float | + * | Enum Value | Mixed | + * | Null Value | null | + * + * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode|null $valueNode + * @param mixed[]|null $variables + * + * @return mixed[]|stdClass|null + * + * @throws Exception + * + * @api + */ +static function valueFromAST( + GraphQL\Language\AST\ValueNode $valueNode, + GraphQL\Type\Definition\Type $type, + array $variables = null +) +``` + +```php +/** + * Produces a PHP value given a GraphQL Value AST. + * + * Unlike `valueFromAST()`, no type is provided. The resulting PHP value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | PHP Value | + * | -------------------- | ------------- | + * | Input Object | Assoc Array | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Int / Float | + * | Enum | Mixed | + * | Null | null | + * + * @param Node $valueNode + * @param mixed[]|null $variables + * + * @return mixed + * + * @throws Exception + * + * @api + */ +static function valueFromASTUntyped($valueNode, array $variables = null) +``` + +```php +/** + * Returns type definition for given AST Type node + * + * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode + * + * @return Type|null + * + * @throws Exception + * + * @api + */ +static function typeFromAST(GraphQL\Type\Schema $schema, $inputTypeNode) +``` + +```php +/** + * Returns operation type ("query", "mutation" or "subscription") given a document and operation name + * + * @param string $operationName + * + * @return bool|string + * + * @api + */ +static function getOperation(GraphQL\Language\AST\DocumentNode $document, $operationName = null) +``` +# GraphQL\Utils\SchemaPrinter +Given an instance of Schema, prints it in GraphQL type language. + +**Class Methods:** +```php +/** + * @param array $options + * Available options: + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * This option is provided to ease adoption and will be removed in v16. + * + * @api + */ +static function doPrint(GraphQL\Type\Schema $schema, array $options = []): string +``` + +```php +/** + * @param array $options + * + * @api + */ +static function printIntrospectionSchema(GraphQL\Type\Schema $schema, array $options = []): string +``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/security.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/security.md new file mode 100644 index 00000000..5f1cc610 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/security.md @@ -0,0 +1,94 @@ +# Query Complexity Analysis + +This is a PHP port of [Query Complexity Analysis](http://sangria-graphql.org/learn/#query-complexity-analysis) in Sangria implementation. + +Complexity analysis is a separate validation rule which calculates query complexity score before execution. +Every field in the query gets a default score 1 (including ObjectType nodes). Total complexity of the +query is the sum of all field scores. For example, the complexity of introspection query is **109**. + +If this score exceeds a threshold, a query is not executed and an error is returned instead. + +Complexity analysis is disabled by default. To enabled it, add validation rule: + +```php + 'MyType', + 'fields' => [ + 'someList' => [ + 'type' => Type::listOf(Type::string()), + 'args' => [ + 'limit' => [ + 'type' => Type::int(), + 'defaultValue' => 10 + ] + ], + 'complexity' => function($childrenComplexity, $args) { + return $childrenComplexity * $args['limit']; + } + ] + ] +]); +``` + +# Limiting Query Depth + +This is a PHP port of [Limiting Query Depth](http://sangria-graphql.org/learn/#limiting-query-depth) in Sangria implementation. +For example, max depth of the introspection query is **7**. + +It is disabled by default. To enable it, add following validation rule: + +```php + 'track', + 'description' => 'Instruction to record usage of the field by client', + 'locations' => [ + DirectiveLocation::FIELD, + ], + 'args' => [ + new FieldArgument([ + 'name' => 'details', + 'type' => Type::string(), + 'description' => 'String with additional details of field usage scenario', + 'defaultValue' => '' + ]) + ] +]); +``` + +See possible directive locations in +[`GraphQL\Language\DirectiveLocation`](../reference.md#graphqllanguagedirectivelocation). diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/enum-types.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/enum-types.md new file mode 100644 index 00000000..bfab3a54 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/enum-types.md @@ -0,0 +1,182 @@ +# Enum Type Definition +Enumeration types are a special kind of scalar that is restricted to a particular set +of allowed values. + +In **graphql-php** enum type is an instance of `GraphQL\Type\Definition\EnumType` +which accepts configuration array in constructor: + +```php + 'Episode', + 'description' => 'One of the films in the Star Wars Trilogy', + 'values' => [ + 'NEWHOPE' => [ + 'value' => 4, + 'description' => 'Released in 1977.' + ], + 'EMPIRE' => [ + 'value' => 5, + 'description' => 'Released in 1980.' + ], + 'JEDI' => [ + 'value' => 6, + 'description' => 'Released in 1983.' + ], + ] +]); +``` + +This example uses an **inline** style for Enum Type definition, but you can also use +[inheritance or type language](index.md#type-definition-styles). + +# Configuration options +Enum Type constructor accepts an array with following options: + +Option | Type | Notes +------ | ---- | ----- +name | `string` | **Required.** Name of the type. When not set - inferred from array key (read about [shorthand field definition](#shorthand-definitions) below) +description | `string` | Plain-text description of the type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) +values | `array` | List of enumerated items, see below for expected structure of each entry + +Each entry of **values** array in turn accepts following options: + +Option | Type | Notes +------ | ---- | ----- +name | `string` | **Required.** Name of the item. When not set - inferred from array key (read about [shorthand field definition](#shorthand-definitions) below) +value | `mixed` | Internal representation of enum item in your application (could be any value, including complex objects or callbacks) +description | `string` | Plain-text description of enum value for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) +deprecationReason | `string` | Text describing why this enum value is deprecated. When not empty - item will not be returned by introspection queries (unless forced) + + +# Shorthand definitions +If internal representation of enumerated item is the same as item name, then you can use +following shorthand for definition: + +```php + 'Episode', + 'description' => 'One of the films in the Star Wars Trilogy', + 'values' => ['NEWHOPE', 'EMPIRE', 'JEDI'] +]); +``` + +which is equivalent of: +```php + 'Episode', + 'description' => 'One of the films in the Star Wars Trilogy', + 'values' => [ + 'NEWHOPE' => ['value' => 'NEWHOPE'], + 'EMPIRE' => ['value' => 'EMPIRE'], + 'JEDI' => ['value' => 'JEDI'] + ] +]); +``` + +which is in turn equivalent of the full form: + +```php + 'Episode', + 'description' => 'One of the films in the Star Wars Trilogy', + 'values' => [ + ['name' => 'NEWHOPE', 'value' => 'NEWHOPE'], + ['name' => 'EMPIRE', 'value' => 'EMPIRE'], + ['name' => 'JEDI', 'value' => 'JEDI'] + ] +]); +``` + +# Field Resolution +When object field is of Enum Type, field resolver is expected to return an internal +representation of corresponding Enum item (**value** in config). **graphql-php** will +then serialize this **value** to **name** to include in response: + +```php + 'Episode', + 'description' => 'One of the films in the Star Wars Trilogy', + 'values' => [ + 'NEWHOPE' => [ + 'value' => 4, + 'description' => 'Released in 1977.' + ], + 'EMPIRE' => [ + 'value' => 5, + 'description' => 'Released in 1980.' + ], + 'JEDI' => [ + 'value' => 6, + 'description' => 'Released in 1983.' + ], + ] +]); + +$heroType = new ObjectType([ + 'name' => 'Hero', + 'fields' => [ + 'appearsIn' => [ + 'type' => $episodeEnum, + 'resolve' => function() { + return 5; // Actual entry in response will be 'appearsIn' => 'EMPIRE' + } + ] + ] +]); +``` + +The Reverse is true when the enum is used as input type (e.g. as field argument). +GraphQL will treat enum input as **name** and convert it into **value** before passing to your app. + +For example, given object type definition: +```php + 'Hero', + 'fields' => [ + 'appearsIn' => [ + 'type' => Type::boolean(), + 'args' => [ + 'episode' => Type::nonNull($enumType) + ], + 'resolve' => function($hero, $args) { + return $args['episode'] === 5 ? true : false; + } + ] + ] +]); +``` + +Then following query: +```graphql +fragment on Hero { + appearsInNewHope: appearsIn(NEWHOPE) + appearsInEmpire: appearsIn(EMPIRE) +} +``` +will return: +```php +[ + 'appearsInNewHope' => false, + 'appearsInEmpire' => true +] +``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/index.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/index.md new file mode 100644 index 00000000..5aea26c4 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/index.md @@ -0,0 +1,127 @@ +# Type System +To start using GraphQL you are expected to implement a type hierarchy and expose it as [Schema](schema.md). + +In graphql-php **type** is an instance of internal class from +`GraphQL\Type\Definition` namespace: [`ObjectType`](object-types.md), +[`InterfaceType`](interfaces.md), [`UnionType`](unions.md), [`InputObjectType`](input-types.md), +[`ScalarType`](scalar-types.md), [`EnumType`](enum-types.md) (or one of subclasses). + +But most of the types in your schema will be [object types](object-types.md). + +# Type Definition Styles +Several styles of type definitions are supported depending on your preferences. + +Inline definitions: +```php + 'MyType', + 'fields' => [ + 'id' => Type::id() + ] +]); +``` + +Class per type: +```php + [ + 'id' => Type::id() + ] + ]; + parent::__construct($config); + } +} +``` + +Using [GraphQL Type language](http://graphql.org/learn/schema/#type-language): + +```graphql +schema { + query: Query + mutation: Mutation +} + +type Query { + greetings(input: HelloInput!): String! +} + +input HelloInput { + firstName: String! + lastName: String +} +``` + +Read more about type language definitions in a [dedicated docs section](type-language.md). + +# Type Registry +Every type must be presented in Schema by a single instance (**graphql-php** +throws when it discovers several instances with the same **name** in the schema). + +Therefore if you define your type as separate PHP class you must ensure that only one +instance of that class is added to the schema. + +The typical way to do this is to create a registry of your types: + +```php +myAType ?: ($this->myAType = new MyAType($this)); + } + + public function myBType() + { + return $this->myBType ?: ($this->myBType = new MyBType($this)); + } +} +``` +And use this registry in type definition: + +```php + [ + 'b' => $types->myBType() + ] + ]); + } +} +``` +Obviously, you can automate this registry as you wish to reduce boilerplate or even +introduce Dependency Injection Container if your types have other dependencies. + +Alternatively, all methods of the registry could be static - then there is no need +to pass it in constructor - instead just use use **TypeRegistry::myAType()** in your +type definitions. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/input-types.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/input-types.md new file mode 100644 index 00000000..7138557b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/input-types.md @@ -0,0 +1,172 @@ +# Mutations +Mutation is just a field of a regular [Object Type](object-types.md) with arguments. +For GraphQL PHP runtime there is no difference between query fields with arguments and mutations. +They are executed [almost](http://facebook.github.io/graphql/#sec-Mutation) identically. +To some extent, Mutation is just a convention described in the GraphQL spec. + +Here is an example of a mutation operation: +```graphql +mutation CreateReviewForEpisode($ep: EpisodeInput!, $review: ReviewInput!) { + createReview(episode: $ep, review: $review) { + stars + commentary + } +} +``` + +To execute such a mutation, you need **Mutation** type [at the root of your schema](schema.md): + +```php + 'Mutation', + 'fields' => [ + // List of mutations: + 'createReview' => [ + 'args' => [ + 'episode' => Type::nonNull($episodeInputType), + 'review' => Type::nonNull($reviewInputType) + ], + 'type' => new ObjectType([ + 'name' => 'CreateReviewOutput', + 'fields' => [ + 'stars' => ['type' => Type::int()], + 'commentary' => ['type' => Type::string()] + ] + ]), + ], + // ... other mutations + ] +]); +``` +As you can see, the only difference from regular object type is the semantics of field names +(verbs vs nouns). + +Also as we see arguments can be of complex types. To leverage the full power of mutations +(and field arguments in general) you must learn how to create complex input types. + + +# About Input and Output Types +All types in GraphQL are of two categories: **input** and **output**. + +* **Output** types (or field types) are: [Scalar](scalar-types.md), [Enum](enum-types.md), [Object](object-types.md), +[Interface](interfaces.md), [Union](unions.md) + +* **Input** types (or argument types) are: [Scalar](scalar-types.md), [Enum](enum-types.md), InputObject + +Obviously, [NonNull and List](lists-and-nonnulls.md) types belong to both categories depending on their +inner type. + +Until now all examples of field **arguments** in this documentation were of [Scalar](scalar-types.md) or +[Enum](enum-types.md) types. But you can also pass complex objects. + +This is particularly valuable in case of mutations, where input data might be rather complex. + +# Input Object Type +GraphQL specification defines Input Object Type for complex inputs. It is similar to ObjectType +except that it's fields have no **args** or **resolve** options and their **type** must be input type. + +In graphql-php **Input Object Type** is an instance of `GraphQL\Type\Definition\InputObjectType` +(or one of it subclasses) which accepts configuration array in constructor: + +```php + 'StoryFiltersInput', + 'fields' => [ + 'author' => [ + 'type' => Type::id(), + 'description' => 'Only show stories with this author id' + ], + 'popular' => [ + 'type' => Type::boolean(), + 'description' => 'Only show popular stories (liked by several people)' + ], + 'tags' => [ + 'type' => Type::listOf(Type::string()), + 'description' => 'Only show stories which contain all of those tags' + ] + ] +]); +``` + +Every field may be of other InputObjectType (thus complex hierarchies of inputs are possible) + +# Configuration options +The constructor of InputObjectType accepts array with only 3 options: + +Option | Type | Notes +------------ | -------- | ----- +name | `string` | **Required.** Unique name of this object type within Schema +fields | `array` or `callable` | **Required**. An array describing object fields or callable returning such an array (see below). +description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) + +Every field is an array with following entries: + +Option | Type | Notes +------ | ---- | ----- +name | `string` | **Required.** Name of the input field. When not set - inferred from **fields** array key +type | `Type` | **Required.** Instance of one of [Input Types](input-types.md) (**Scalar**, **Enum**, **InputObjectType** + any combination of those with **nonNull** and **listOf** modifiers) +description | `string` | Plain-text description of this input field for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) +defaultValue | `scalar` | Default value of this input field. Use the internal value if specifying a default for an **enum** type + +# Using Input Object Type +In the example above we defined our InputObjectType. Now let's use it in one of field arguments: + +```php + 'Query', + 'fields' => [ + 'stories' => [ + 'type' => Type::listOf($storyType), + 'args' => [ + 'filters' => [ + 'type' => $filters, + 'defaultValue' => [ + 'popular' => true + ] + ] + ], + 'resolve' => function($rootValue, $args) { + return DataSource::filterStories($args['filters']); + } + ] + ] +]); +``` +(note that you can define **defaultValue** for fields with complex inputs as associative array). + +Then GraphQL query could include filters as literal value: +```graphql +{ + stories(filters: {author: "1", popular: false}) +} +``` + +Or as query variable: +```graphql +query($filters: StoryFiltersInput!) { + stories(filters: $filters) +} +``` +```php +$variables = [ + 'filters' => [ + "author" => "1", + "popular" => false + ] +]; +``` + +**graphql-php** will validate the input against your InputObjectType definition and pass it to your +resolver as `$args['filters']` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/interfaces.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/interfaces.md new file mode 100644 index 00000000..100d510e --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/interfaces.md @@ -0,0 +1,174 @@ +# Interface Type Definition +An Interface is an abstract type that includes a certain set of fields that a +type must include to implement the interface. + +In **graphql-php** interface type is an instance of `GraphQL\Type\Definition\InterfaceType` +(or one of its subclasses) which accepts configuration array in a constructor: + +```php + 'Character', + 'description' => 'A character in the Star Wars Trilogy', + 'fields' => [ + 'id' => [ + 'type' => Type::nonNull(Type::string()), + 'description' => 'The id of the character.', + ], + 'name' => [ + 'type' => Type::string(), + 'description' => 'The name of the character.' + ] + ], + 'resolveType' => function ($value) { + if ($value->type === 'human') { + return MyTypes::human(); + } else { + return MyTypes::droid(); + } + } +]); +``` +This example uses **inline** style for Interface definition, but you can also use +[inheritance or type language](index.md#type-definition-styles). + +# Configuration options +The constructor of InterfaceType accepts an array. Below is a full list of allowed options: + +Option | Type | Notes +------ | ---- | ----- +name | `string` | **Required.** Unique name of this interface type within Schema +fields | `array` | **Required.** List of fields required to be defined by interface implementors. Same as [Fields for Object Type](object-types.md#field-configuration-options) +description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) +resolveType | `callback` | **function($value, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Receives **$value** from resolver of the parent field and returns concrete interface implementor for this **$value**. + +# Implementing interface +To implement the Interface simply add it to **interfaces** array of Object Type definition: +```php + 'Human', + 'fields' => [ + 'id' => [ + 'type' => Type::nonNull(Type::string()), + 'description' => 'The id of the character.', + ], + 'name' => [ + 'type' => Type::string(), + 'description' => 'The name of the character.' + ] + ], + 'interfaces' => [ + $character + ] +]); +``` +Note that Object Type must include all fields of interface with exact same types +(including **nonNull** specification) and arguments. + +The only exception is when object's field type is more specific than the type of this field defined in interface +(see [Covariant return types for interface fields](#covariant-return-types-for-interface-fields) below) + +# Covariant return types for interface fields +Object types implementing interface may change the field type to more specific. +Example: + +``` +interface A { + field1: A +} + +type B implements A { + field1: B +} +``` + +# Sharing Interface fields +Since every Object Type implementing an Interface must have the same set of fields - it often makes +sense to reuse field definitions of Interface in Object Types: + +```php + 'Human', + 'interfaces' => [ + $character + ], + 'fields' => [ + 'height' => Type::float(), + $character->getField('id'), + $character->getField('name') + ] +]); +``` + +In this case, field definitions are created only once (as a part of Interface Type) and then +reused by all interface implementors. It can save several microseconds and kilobytes + ensures that +field definitions of Interface and implementors are always in sync. + +Yet it creates a problem with the resolution of such fields. There are two ways how shared fields could +be resolved: + +1. If field resolution algorithm is the same for all Interface implementors - you can simply add +**resolve** option to field definition in Interface itself. + +2. If field resolution varies for different implementations - you can specify **resolveField** +option in [Object Type config](object-types.md#configuration-options) and handle field +resolutions there +(Note: **resolve** option in field definition has precedence over **resolveField** option in object type definition) + +# Interface role in data fetching +The only responsibility of interface in Data Fetching process is to return concrete Object Type +for given **$value** in **resolveType**. Then resolution of fields is delegated to resolvers of this +concrete Object Type. + +If a **resolveType** option is omitted, graphql-php will loop through all interface implementors and +use their **isTypeOf** callback to pick the first suitable one. This is obviously less efficient +than single **resolveType** call. So it is recommended to define **resolveType** whenever possible. + +# Prevent invisible types +When object types that implement an interface are not directly referenced by a field, they cannot +be discovered during schema introspection. For example: + +```graphql +type Query { + animal: Animal +} + +interface Animal {...} + +type Cat implements Animal {...} +type Dog implements Animal {...} +``` + +In this example, `Cat` and `Dog` would be considered *invisible* types. Querying the `animal` field +would fail, since no possible implementing types for `Animal` can be found. + +There are two possible solutions: + +1. Add fields that reference the invisible types directly, e.g.: + + ```graphql + type Query { + dog: Dog + cat: Cat + } + ``` + +2. Pass the invisible types during schema construction, e.g.: + +```php +new GraphQLSchema([ + 'query' => ..., + 'types' => [$cat, $dog] +]); +``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/lists-and-nonnulls.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/lists-and-nonnulls.md new file mode 100644 index 00000000..8f3743db --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/lists-and-nonnulls.md @@ -0,0 +1,62 @@ +# Lists +**graphql-php** provides built-in support for lists. In order to create list type - wrap +existing type with `GraphQL\Type\Definition\Type::listOf()` modifier: +```php + 'User', + 'fields' => [ + 'emails' => [ + 'type' => Type::listOf(Type::string()), + 'resolve' => function() { + return ['jon@example.com', 'jonny@example.com']; + } + ] + ] +]); +``` + +Resolvers for such fields are expected to return **array** or instance of PHP's built-in **Traversable** +interface (**null** is allowed by default too). + +If returned value is not of one of these types - **graphql-php** will add an error to result +and set the field value to **null** (only if the field is nullable, see below for non-null fields). + +# Non-Null fields +By default in GraphQL, every field can have a **null** value. To indicate that some field always +returns **non-null** value - use `GraphQL\Type\Definition\Type::nonNull()` modifier: + +```php + 'User', + 'fields' => [ + 'id' => [ + 'type' => Type::nonNull(Type::id()), + 'resolve' => function() { + return uniqid(); + } + ], + 'emails' => [ + 'type' => Type::nonNull(Type::listOf(Type::string())), + 'resolve' => function() { + return ['jon@example.com', 'jonny@example.com']; + } + ] + ] +]); +``` + +If resolver of non-null field returns **null**, graphql-php will add an error to +result and exclude the whole object from the output (an error will bubble to first +nullable parent field which will be set to **null**). + +Read the section on [Data Fetching](../data-fetching.md) for details. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/object-types.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/object-types.md new file mode 100644 index 00000000..0b950c02 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/object-types.md @@ -0,0 +1,210 @@ +# Object Type Definition +Object Type is the most frequently used primitive in a typical GraphQL application. + +Conceptually Object Type is a collection of Fields. Each field, in turn, +has its own type which allows building complex hierarchies. + +In **graphql-php** object type is an instance of `GraphQL\Type\Definition\ObjectType` +(or one of it subclasses) which accepts configuration array in constructor: + +```php + 'User', + 'description' => 'Our blog visitor', + 'fields' => [ + 'firstName' => [ + 'type' => Type::string(), + 'description' => 'User first name' + ], + 'email' => Type::string() + ] +]); + +$blogStory = new ObjectType([ + 'name' => 'Story', + 'fields' => [ + 'body' => Type::string(), + 'author' => [ + 'type' => $userType, + 'description' => 'Story author', + 'resolve' => function(Story $blogStory) { + return DataSource::findUser($blogStory->authorId); + } + ], + 'likes' => [ + 'type' => Type::listOf($userType), + 'description' => 'List of users who liked the story', + 'args' => [ + 'limit' => [ + 'type' => Type::int(), + 'description' => 'Limit the number of recent likes returned', + 'defaultValue' => 10 + ] + ], + 'resolve' => function(Story $blogStory, $args) { + return DataSource::findLikes($blogStory->id, $args['limit']); + } + ] + ] +]); +``` +This example uses **inline** style for Object Type definitions, but you can also use +[inheritance or type language](index.md#type-definition-styles). + + +# Configuration options +Object type constructor expects configuration array. Below is a full list of available options: + +Option | Type | Notes +------------ | -------- | ----- +name | `string` | **Required.** Unique name of this object type within Schema +fields | `array` or `callable` | **Required**. An array describing object fields or callable returning such an array. See [Fields](#field-definitions) section below for expected structure of each array entry. See also the section on [Circular types](#recurring-and-circular-types) for an explanation of when to use callable for this option. +description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) +interfaces | `array` or `callable` | List of interfaces implemented by this type or callable returning such a list. See [Interface Types](interfaces.md) for details. See also the section on [Circular types](#recurring-and-circular-types) for an explanation of when to use callable for this option. +isTypeOf | `callable` | **function($value, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Expected to return **true** if **$value** qualifies for this type (see section about [Abstract Type Resolution](interfaces.md#interface-role-in-data-fetching) for explanation). +resolveField | `callable` | **function($value, $args, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Given the **$value** of this type, it is expected to return value for a field defined in **$info->fieldName**. A good place to define a type-specific strategy for field resolution. See section on [Data Fetching](../data-fetching.md) for details. + +# Field configuration options +Below is a full list of available field configuration options: + +Option | Type | Notes +------ | ---- | ----- +name | `string` | **Required.** Name of the field. When not set - inferred from **fields** array key (read about [shorthand field definition](#shorthand-field-definitions) below) +type | `Type` | **Required.** An instance of internal or custom type. Note: type must be represented by a single instance within one schema (see also [Type Registry](index.md#type-registry)) +args | `array` | An array of possible type arguments. Each entry is expected to be an array with keys: **name**, **type**, **description**, **defaultValue**. See [Field Arguments](#field-arguments) section below. +resolve | `callable` | **function($objectValue, $args, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Given the **$objectValue** of this type, it is expected to return actual value of the current field. See section on [Data Fetching](../data-fetching.md) for details +complexity | `callable` | **function($childrenComplexity, $args)**
Used to restrict query complexity. The feature is disabled by default, read about [Security](../security.md#query-complexity-analysis) to use it. +description | `string` | Plain-text description of this field for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) +deprecationReason | `string` | Text describing why this field is deprecated. When not empty - field will not be returned by introspection queries (unless forced) + +# Field arguments +Every field on a GraphQL object type can have zero or more arguments, defined in **args** option of field definition. +Each argument is an array with following options: + +Option | Type | Notes +------ | ---- | ----- +name | `string` | **Required.** Name of the argument. When not set - inferred from **args** array key +type | `Type` | **Required.** Instance of one of [Input Types](input-types.md) (**scalar**, **enum**, **InputObjectType** + any combination of those with **nonNull** and **listOf** modifiers) +description | `string` | Plain-text description of this argument for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) +defaultValue | `scalar` | Default value for this argument. Use the internal value if specifying a default for an **enum** type + +# Shorthand field definitions +Fields can be also defined in **shorthand** notation (with only **name** and **type** options): +```php +'fields' => [ + 'id' => Type::id(), + 'fieldName' => $fieldType +] +``` +which is equivalent of: +```php +'fields' => [ + 'id' => ['type' => Type::id()], + 'fieldName' => ['type' => $fieldName] +] +``` +which is in turn equivalent of the full form: +```php +'fields' => [ + ['name' => 'id', 'type' => Type::id()], + ['name' => 'fieldName', 'type' => $fieldName] +] +``` +Same shorthand notation applies to field arguments as well. + +# Recurring and circular types +Almost all real-world applications contain recurring or circular types. +Think user friends or nested comments for example. + +**graphql-php** allows such types, but you have to use `callable` in +option **fields** (and/or **interfaces**). + +For example: +```php + 'User', + 'fields' => function() use (&$userType) { + return [ + 'email' => [ + 'type' => Type::string() + ], + 'friends' => [ + 'type' => Type::listOf($userType) + ] + ]; + } +]); +``` + +Same example for [inheritance style of type definitions](index.md#type-definition-styles) using [TypeRegistry](index.md#type-registry): +```php + function() { + return [ + 'email' => MyTypes::string(), + 'friends' => MyTypes::listOf(MyTypes::user()) + ]; + } + ]; + parent::__construct($config); + } +} + +class MyTypes +{ + private static $user; + + public static function user() + { + return self::$user ?: (self::$user = new UserType()); + } + + public static function string() + { + return Type::string(); + } + + public static function listOf($type) + { + return Type::listOf($type); + } +} +``` + +# Field Resolution +Field resolution is the primary mechanism in **graphql-php** for returning actual data for your fields. +It is implemented using **resolveField** callable in type definition or **resolve** +callable in field definition (which has precedence). + +Read the section on [Data Fetching](../data-fetching.md) for a complete description of this process. + +# Custom Metadata +All types in **graphql-php** accept configuration array. In some cases, you may be interested in +passing your own metadata for type or field definition. + +**graphql-php** preserves original configuration array in every type or field instance in +public property **$config**. Use it to implement app-level mappings and definitions. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/scalar-types.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/scalar-types.md new file mode 100644 index 00000000..074e8c69 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/scalar-types.md @@ -0,0 +1,130 @@ +# Built-in Scalar Types +GraphQL specification describes several built-in scalar types. In **graphql-php** they are +exposed as static methods of [`GraphQL\Type\Definition\Type`](../reference.md#graphqltypedefinitiontype) class: + +```php +parseValue($value); + } + + /** + * Parses an externally provided value (query variable) to use as an input + * + * @param mixed $value + * @return mixed + */ + public function parseValue($value) + { + if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { + throw new Error("Cannot represent following value as email: " . Utils::printSafeJson($value)); + } + return $value; + } + + /** + * Parses an externally provided literal value (hardcoded in GraphQL query) to use as an input. + * + * E.g. + * { + * user(email: "user@example.com") + * } + * + * @param \GraphQL\Language\AST\Node $valueNode + * @param array|null $variables + * @return string + * @throws Error + */ + public function parseLiteral(Node $valueNode, ?array $variables = null) + { + // Note: throwing GraphQL\Error\Error vs \UnexpectedValueException to benefit from GraphQL + // error location in query: + if (!$valueNode instanceof StringValueNode) { + throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, [$valueNode]); + } + if (!filter_var($valueNode->value, FILTER_VALIDATE_EMAIL)) { + throw new Error("Not a valid email", [$valueNode]); + } + return $valueNode->value; + } +} +``` + +Or with inline style: + +```php + 'Email', + 'serialize' => function($value) {/* See function body above */}, + 'parseValue' => function($value) {/* See function body above */}, + 'parseLiteral' => function($valueNode, array $variables = null) {/* See function body above */}, +]); +``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/schema.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/schema.md new file mode 100644 index 00000000..e3ae6e05 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/schema.md @@ -0,0 +1,194 @@ +# Schema Definition +The schema is a container of your type hierarchy, which accepts root types in a constructor and provides +methods for receiving information about your types to internal GrahpQL tools. + +In **graphql-php** schema is an instance of [`GraphQL\Type\Schema`](../reference.md#graphqltypeschema) +which accepts configuration array in a constructor: + +```php + $queryType, + 'mutation' => $mutationType, +]); +``` +See possible constructor options [below](#configuration-options). + +# Query and Mutation types +The schema consists of two root types: + +* **Query** type is a surface of your read API +* **Mutation** type (optional) exposes write API by declaring all possible mutations in your app. + +Query and Mutation types are regular [object types](object-types.md) containing root-level fields +of your API: + +```php + 'Query', + 'fields' => [ + 'hello' => [ + 'type' => Type::string(), + 'resolve' => function() { + return 'Hello World!'; + } + ], + 'hero' => [ + 'type' => $characterInterface, + 'args' => [ + 'episode' => [ + 'type' => $episodeEnum + ] + ], + 'resolve' => function ($rootValue, $args) { + return StarWarsData::getHero(isset($args['episode']) ? $args['episode'] : null); + }, + ] + ] +]); + +$mutationType = new ObjectType([ + 'name' => 'Mutation', + 'fields' => [ + 'createReview' => [ + 'type' => $createReviewOutput, + 'args' => [ + 'episode' => $episodeEnum, + 'review' => $reviewInputObject + ], + 'resolve' => function($rootValue, $args) { + // TODOC + } + ] + ] +]); +``` + +Keep in mind that other than the special meaning of declaring a surface area of your API, +those types are the same as any other [object type](object-types.md), and their fields work +exactly the same way. + +**Mutation** type is also just a regular object type. The difference is in semantics. +Field names of Mutation type are usually verbs and they almost always have arguments - quite often +with complex input values (see [Mutations and Input Types](input-types.md) for details). + +# Configuration Options +Schema constructor expects an instance of [`GraphQL\Type\SchemaConfig`](../reference.md#graphqltypeschemaconfig) +or an array with following options: + +Option | Type | Notes +------------ | -------- | ----- +query | `ObjectType` | **Required.** Object type (usually named "Query") containing root-level fields of your read API +mutation | `ObjectType` | Object type (usually named "Mutation") containing root-level fields of your write API +subscription | `ObjectType` | Reserved for future subscriptions implementation. Currently presented for compatibility with introspection query of **graphql-js**, used by various clients (like Relay or GraphiQL) +directives | `Directive[]` | A full list of [directives](directives.md) supported by your schema. By default, contains built-in **@skip** and **@include** directives.

If you pass your own directives and still want to use built-in directives - add them explicitly. For example:

*array_merge(GraphQL::getStandardDirectives(), [$myCustomDirective]);* +types | `ObjectType[]` | List of object types which cannot be detected by **graphql-php** during static schema analysis.

Most often it happens when the object type is never referenced in fields directly but is still a part of a schema because it implements an interface which resolves to this object type in its **resolveType** callable.

Note that you are not required to pass all of your types here - it is simply a workaround for concrete use-case. +typeLoader | `callable` | **function($name)** Expected to return type instance given the name. Must always return the same instance if called multiple times. See section below on lazy type loading. + +# Using config class +If you prefer fluid interface for config with auto-completion in IDE and static time validation, +use [`GraphQL\Type\SchemaConfig`](../reference.md#graphqltypeschemaconfig) instead of an array: + +```php +setQuery($myQueryType) + ->setTypeLoader($myTypeLoader); + +$schema = new Schema($config); +``` + + +# Lazy loading of types +By default, the schema will scan all of your type, field and argument definitions to serve GraphQL queries. +It may cause performance overhead when there are many types in the schema. + +In this case, it is recommended to pass **typeLoader** option to schema constructor and define all +of your object **fields** as callbacks. + +Type loading concept is very similar to PHP class loading, but keep in mind that **typeLoader** must +always return the same instance of a type. + +Usage example: +```php +types[$name])) { + $this->types[$name] = $this->{$name}(); + } + return $this->types[$name]; + } + + private function MyTypeA() + { + return new ObjectType([ + 'name' => 'MyTypeA', + 'fields' => function() { + return [ + 'b' => ['type' => $this->get('MyTypeB')] + ]; + } + ]); + } + + private function MyTypeB() + { + // ... + } +} + +$registry = new Types(); + +$schema = new Schema([ + 'query' => $registry->get('Query'), + 'typeLoader' => function($name) use ($registry) { + return $registry->get($name); + } +]); +``` + + +# Schema Validation +By default, the schema is created with only shallow validation of type and field definitions +(because validation requires full schema scan and is very costly on bigger schemas). + +But there is a special method **assertValid()** on schema instance which throws +`GraphQL\Error\InvariantViolation` exception when it encounters any error, like: + +- Invalid types used for fields/arguments +- Missing interface implementations +- Invalid interface implementations +- Other schema errors... + +Schema validation is supposed to be used in CLI commands or during build step of your app. +Don't call it in web requests in production. + +Usage example: +```php + $myQueryType + ]); + $schema->assertValid(); +} catch (GraphQL\Error\InvariantViolation $e) { + echo $e->getMessage(); +} +``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/type-language.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/type-language.md new file mode 100644 index 00000000..29615512 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/type-language.md @@ -0,0 +1,91 @@ +# Defining your schema +Since 0.9.0 + +[Type language](http://graphql.org/learn/schema/#type-language) is a convenient way to define your schema, +especially with IDE autocompletion and syntax validation. + +Here is a simple schema defined in GraphQL type language (e.g. in a separate **schema.graphql** file): + +```graphql +schema { + query: Query + mutation: Mutation +} + +type Query { + greetings(input: HelloInput!): String! +} + +input HelloInput { + firstName: String! + lastName: String +} +``` + +In order to create schema instance out of this file, use +[`GraphQL\Utils\BuildSchema`](../reference.md#graphqlutilsbuildschema): + +```php + 'SearchResult', + 'types' => [ + MyTypes::story(), + MyTypes::user() + ], + 'resolveType' => function($value) { + if ($value->type === 'story') { + return MyTypes::story(); + } else { + return MyTypes::user(); + } + } +]); +``` + +This example uses **inline** style for Union definition, but you can also use +[inheritance or type language](index.md#type-definition-styles). + +# Configuration options +The constructor of UnionType accepts an array. Below is a full list of allowed options: + +Option | Type | Notes +------ | ---- | ----- +name | `string` | **Required.** Unique name of this interface type within Schema +types | `array` | **Required.** List of Object Types included in this Union. Note that you can't create a Union type out of Interfaces or other Unions. +description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) +resolveType | `callback` | **function($value, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Receives **$value** from resolver of the parent field and returns concrete Object Type for this **$value**. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/phpstan-baseline.neon b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/phpstan-baseline.neon new file mode 100644 index 00000000..0cb1ba54 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/phpstan-baseline.neon @@ -0,0 +1,647 @@ +parameters: + ignoreErrors: + - + message: "#^Variable property access on object\\.$#" + count: 2 + path: src/Executor/Executor.php + + - + message: "#^Variable property access on object\\.$#" + count: 2 + path: src/Experimental/Executor/CoroutineExecutor.php + + - + message: "#^Variable property access on mixed\\.$#" + count: 1 + path: src/Experimental/Executor/CoroutineExecutor.php + + - + message: "#^Variable property access on GraphQL\\\\Language\\\\AST\\\\Node\\.$#" + count: 1 + path: src/Language/AST/Node.php + + - + message: "#^Method GraphQL\\\\Language\\\\AST\\\\NodeList\\:\\:splice\\(\\) should return GraphQL\\\\Language\\\\AST\\\\NodeList\\ but returns GraphQL\\\\Language\\\\AST\\\\NodeList\\\\.$#" + count: 1 + path: src/Language/AST/NodeList.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: src/Language/Visitor.php + + - + message: "#^Variable property access on GraphQL\\\\Language\\\\AST\\\\Node\\|null\\.$#" + count: 1 + path: src/Language/Visitor.php + + - + message: "#^Variable property access on GraphQL\\\\Language\\\\AST\\\\Node\\.$#" + count: 1 + path: src/Language/Visitor.php + + - + message: "#^Only booleans are allowed in a negated boolean, \\(callable\\)\\|null given\\.$#" + count: 1 + path: src/Language/Visitor.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, \\(callable\\)\\|null given\\.$#" + count: 2 + path: src/Server/Helper.php + + - + message: "#^Only booleans are allowed in an if condition, int given\\.$#" + count: 1 + path: src/Server/Helper.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 2 + path: src/Server/Helper.php + + - + message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" + count: 1 + path: src/Server/Helper.php + + - + message: "#^Only booleans are allowed in &&, string given on the right side\\.$#" + count: 1 + path: src/Server/Helper.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string given\\.$#" + count: 1 + path: src/Server/Helper.php + + - + message: "#^Only booleans are allowed in an if condition, \\(callable\\)\\|null given\\.$#" + count: 1 + path: src/Server/Helper.php + + - + message: "#^Only booleans are allowed in \\|\\|, \\(callable\\)\\|null given on the left side\\.$#" + count: 1 + path: src/Server/Helper.php + + - + message: "#^Only booleans are allowed in a negated boolean, ArrayObject\\ given\\.$#" + count: 1 + path: src/Type/Definition/EnumType.php + + - + message: "#^Variable property access on \\$this\\(GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\)\\.$#" + count: 3 + path: src/Type/Definition/FieldDefinition.php + + - + message: "#^Variable property access on \\$this\\(GraphQL\\\\Type\\\\Definition\\\\InputObjectField\\)\\.$#" + count: 4 + path: src/Type/Definition/InputObjectField.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\SelectionSetNode\\|null given\\.$#" + count: 1 + path: src/Type/Definition/QueryPlan.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\SelectionSetNode\\|null given\\.$#" + count: 1 + path: src/Type/Definition/QueryPlan.php + + - + message: "#^Only booleans are allowed in an if condition, string given\\.$#" + count: 1 + path: src/Type/Definition/Type.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 2 + path: src/Type/Introspection.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\|\\(callable\\) given\\.$#" + count: 1 + path: src/Type/Schema.php + + - + message: "#^Only booleans are allowed in an if condition, \\(callable\\)\\|null given\\.$#" + count: 1 + path: src/Type/Schema.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" + count: 1 + path: src/Type/Schema.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: src/Type/Schema.php + + - + message: "#^Only booleans are allowed in a negated boolean, \\(callable\\)\\|null given\\.$#" + count: 1 + path: src/Type/Schema.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\ObjectType\\|null given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in &&, GraphQL\\\\Type\\\\Definition\\\\ObjectType\\|null given on the left side\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in &&, array\\\\|GraphQL\\\\Language\\\\AST\\\\Node\\|GraphQL\\\\Language\\\\AST\\\\TypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\TypeNode\\|null given on the left side\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\OperationTypeDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Definition\\\\Type given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Error\\\\Error\\|null given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\InputValueDefinitionNode given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\DirectiveDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the left side\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\DirectiveDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\EnumTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\InputObjectTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\InterfaceTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\ObjectTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\SchemaDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\UnionTypeDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\InterfaceTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\InterfaceTypeExtensionNode\\|GraphQL\\\\Language\\\\AST\\\\ObjectTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\ObjectTypeExtensionNode given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\FieldDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in &&, GraphQL\\\\Language\\\\AST\\\\FieldDefinitionNode\\|null given on the left side\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in &&, GraphQL\\\\Language\\\\AST\\\\NodeList\\ given on the right side\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\InputValueDefinitionNode\\|null given\\.$#" + count: 2 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\|null given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\FieldArgument\\|null given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in \\|\\|, GraphQL\\\\Type\\\\Definition\\\\FieldArgument\\|null given on the left side\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in &&, array\\ given on the left side\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: src/Type/SchemaValidationContext.php + + - + message: "#^Variable property access on mixed\\.$#" + count: 2 + path: src/Utils/AST.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\BooleanValueNode\\|GraphQL\\\\Language\\\\AST\\\\EnumValueNode\\|GraphQL\\\\Language\\\\AST\\\\FloatValueNode\\|GraphQL\\\\Language\\\\AST\\\\IntValueNode\\|GraphQL\\\\Language\\\\AST\\\\ListValueNode\\|GraphQL\\\\Language\\\\AST\\\\NullValueNode\\|GraphQL\\\\Language\\\\AST\\\\ObjectValueNode\\|GraphQL\\\\Language\\\\AST\\\\StringValueNode\\|null given\\.$#" + count: 2 + path: src/Utils/AST.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\|null given\\.$#" + count: 1 + path: src/Utils/AST.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\EnumValueDefinition\\|null given\\.$#" + count: 1 + path: src/Utils/AST.php + + - + message: "#^Only booleans are allowed in &&, array\\|null given on the left side\\.$#" + count: 1 + path: src/Utils/AST.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" + count: 2 + path: src/Utils/AST.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\NodeList\\ given\\.$#" + count: 1 + path: src/Utils/AST.php + + - + message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" + count: 1 + path: src/Utils/AST.php + + - + message: "#^Only booleans are allowed in an if condition, callable given\\.$#" + count: 1 + path: src/Utils/ASTDefinitionBuilder.php + + - + message: "#^Only booleans are allowed in &&, array\\\\|null given on the left side\\.$#" + count: 1 + path: src/Utils/PairSet.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" + count: 1 + path: src/Utils/SchemaExtender.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\SchemaDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Utils/SchemaExtender.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\\\|null given\\.$#" + count: 1 + path: src/Utils/TypeInfo.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" + count: 1 + path: src/Utils/TypeInfo.php + + - + message: "#^Only booleans are allowed in an if condition, \\(GraphQL\\\\Type\\\\Definition\\\\CompositeType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" + count: 1 + path: src/Utils/TypeInfo.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\|null given\\.$#" + count: 1 + path: src/Utils/TypeInfo.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\NamedTypeNode given\\.$#" + count: 1 + path: src/Utils/TypeInfo.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\Directive\\|GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\|null given\\.$#" + count: 1 + path: src/Utils/TypeInfo.php + + - + message: "#^Only booleans are allowed in &&, GraphQL\\\\Type\\\\Definition\\\\FieldArgument\\|null given on the left side\\.$#" + count: 1 + path: src/Utils/TypeInfo.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Definition\\\\InputObjectField\\|null given\\.$#" + count: 1 + path: src/Utils/TypeInfo.php + + - + message: "#^Only booleans are allowed in &&, GraphQL\\\\Type\\\\Definition\\\\InputObjectField\\|null given on the left side\\.$#" + count: 1 + path: src/Utils/TypeInfo.php + + - + message: "#^Variable property access on object\\.$#" + count: 1 + path: src/Utils/Utils.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: src/Utils/Utils.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Error\\\\Error\\|null given\\.$#" + count: 1 + path: src/Utils/Utils.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\EnumValueDefinition\\|null given\\.$#" + count: 1 + path: src/Utils/Value.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" + count: 2 + path: src/Utils/Value.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" + count: 2 + path: src/Utils/Value.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string given\\.$#" + count: 2 + path: src/Utils/Value.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" + count: 1 + path: src/Utils/Value.php + + - + message: "#^Only booleans are allowed in a negated boolean, \\(GraphQL\\\\Type\\\\Definition\\\\CompositeType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/FieldsOnCorrectType.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\FieldDefinition given\\.$#" + count: 1 + path: src/Validator/Rules/FieldsOnCorrectType.php + + - + message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" + count: 1 + path: src/Validator/Rules/FieldsOnCorrectType.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\NamedTypeNode given\\.$#" + count: 1 + path: src/Validator/Rules/FragmentsOnCompositeTypes.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" + count: 2 + path: src/Validator/Rules/FragmentsOnCompositeTypes.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Schema\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/KnownDirectives.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/KnownDirectives.php + + - + message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" + count: 1 + path: src/Validator/Rules/KnownDirectives.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/KnownFragmentNames.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/NoFragmentCycles.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\NameNode\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\NamedTypeNode given\\.$#" + count: 1 + path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\|null given\\.$#" + count: 2 + path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\ArgumentNode\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\Node given\\.$#" + count: 2 + path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" + count: 3 + path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php + + - + message: "#^Only booleans are allowed in a negated boolean, \\(GraphQL\\\\Type\\\\Definition\\\\CompositeType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/PossibleFragmentSpreads.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/PossibleFragmentSpreads.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\FieldDefinition given\\.$#" + count: 1 + path: src/Validator/Rules/ProvidedRequiredArguments.php + + - + message: "#^Only booleans are allowed in \\|\\|, GraphQL\\\\Language\\\\AST\\\\ArgumentNode\\|null given on the left side\\.$#" + count: 1 + path: src/Validator/Rules/ProvidedRequiredArguments.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Schema\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/QuerySecurityRule.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\NameNode\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/QuerySecurityRule.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\OutputType\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/ScalarLeafs.php + + - + message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\SelectionSetNode\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/ScalarLeafs.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\SelectionSetNode\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/ScalarLeafs.php + + - + message: "#^Only booleans are allowed in \\|\\|, GraphQL\\\\Type\\\\Definition\\\\EnumType\\|GraphQL\\\\Type\\\\Definition\\\\InputObjectType\\|GraphQL\\\\Type\\\\Definition\\\\ListOfType\\|GraphQL\\\\Type\\\\Definition\\\\NonNull\\|GraphQL\\\\Type\\\\Definition\\\\ScalarType given on the left side\\.$#" + count: 1 + path: src/Validator/Rules/ValuesOfCorrectType.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\EnumValueDefinition\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/ValuesOfCorrectType.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\EnumType\\|GraphQL\\\\Type\\\\Definition\\\\InputObjectType\\|GraphQL\\\\Type\\\\Definition\\\\ListOfType\\|GraphQL\\\\Type\\\\Definition\\\\NonNull\\|GraphQL\\\\Type\\\\Definition\\\\ScalarType given\\.$#" + count: 1 + path: src/Validator/Rules/ValuesOfCorrectType.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" + count: 1 + path: src/Validator/Rules/ValuesOfCorrectType.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/VariablesAreInputTypes.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" + count: 1 + path: src/Validator/Rules/VariablesInAllowedPosition.php + + - + message: "#^Only booleans are allowed in &&, GraphQL\\\\Language\\\\AST\\\\ValueNode\\|null given on the left side\\.$#" + count: 1 + path: src/Validator/Rules/VariablesInAllowedPosition.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" + count: 1 + path: src/Validator/ValidationContext.php + + - + message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" + count: 1 + path: src/Validator/ValidationContext.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Schema given\\.$#" + count: 1 + path: tests/Executor/DirectivesTest.php + + - + message: "#^Anonymous function should have native return typehint \"class@anonymous/tests/Executor/ExecutorTest\\.php\\:1333\"\\.$#" + count: 1 + path: tests/Executor/ExecutorTest.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\InterfaceType given\\.$#" + count: 1 + path: tests/Executor/LazyInterfaceTest.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\ObjectType given\\.$#" + count: 1 + path: tests/Executor/LazyInterfaceTest.php + + - + message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Schema given\\.$#" + count: 1 + path: tests/Executor/ValuesTest.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, \\(GraphQL\\\\Type\\\\Definition\\\\CompositeType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" + count: 4 + path: tests/Language/VisitorTest.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, \\(GraphQL\\\\Type\\\\Definition\\\\OutputType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" + count: 4 + path: tests/Language/VisitorTest.php + + - + message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Definition\\\\EnumType\\|GraphQL\\\\Type\\\\Definition\\\\InputObjectType\\|GraphQL\\\\Type\\\\Definition\\\\ListOfType\\|GraphQL\\\\Type\\\\Definition\\\\NonNull\\|GraphQL\\\\Type\\\\Definition\\\\ScalarType\\|null given\\.$#" + count: 4 + path: tests/Language/VisitorTest.php + + - + message: "#^Access to an undefined property GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\:\\:\\$nonExistentProp\\.$#" + count: 2 + path: tests/Type/DefinitionTest.php + + - + message: "#^Access to an undefined property GraphQL\\\\Type\\\\Definition\\\\InputObjectField\\:\\:\\$nonExistentProp\\.$#" + count: 1 + path: tests/Type/DefinitionTest.php + + - + message: "#^Variable property access on \\$this\\(GraphQL\\\\Tests\\\\Type\\\\TypeLoaderTest\\)\\.$#" + count: 1 + path: tests/Type/TypeLoaderTest.php + + - + message: "#^Only booleans are allowed in a negated boolean, stdClass given\\.$#" + count: 1 + path: tests/Utils/AstFromValueTest.php + diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Deferred.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Deferred.php new file mode 100644 index 00000000..ff79ea6b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Deferred.php @@ -0,0 +1,26 @@ +nodes = $nodes; + $this->source = $source; + $this->positions = $positions; + $this->path = $path; + $this->extensions = count($extensions) > 0 ? $extensions : ( + $previous instanceof self + ? $previous->extensions + : [] + ); + + if ($previous instanceof ClientAware) { + $this->isClientSafe = $previous->isClientSafe(); + $cat = $previous->getCategory(); + $this->category = $cat === '' || $cat === null ? self::CATEGORY_INTERNAL: $cat; + } elseif ($previous !== null) { + $this->isClientSafe = false; + $this->category = self::CATEGORY_INTERNAL; + } else { + $this->isClientSafe = true; + $this->category = self::CATEGORY_GRAPHQL; + } + } + + /** + * Given an arbitrary Error, presumably thrown while attempting to execute a + * GraphQL operation, produce a new GraphQLError aware of the location in the + * document responsible for the original Error. + * + * @param mixed $error + * @param Node[]|null $nodes + * @param mixed[]|null $path + * + * @return Error + */ + public static function createLocatedError($error, $nodes = null, $path = null) + { + if ($error instanceof self) { + if ($error->path !== null && $error->nodes !== null && count($error->nodes) !== 0) { + return $error; + } + + $nodes = $nodes ?? $error->nodes; + $path = $path ?? $error->path; + } + + $source = null; + $originalError = null; + $positions = []; + $extensions = []; + + if ($error instanceof self) { + $message = $error->getMessage(); + $originalError = $error; + $nodes = $error->nodes ?? $nodes; + $source = $error->source; + $positions = $error->positions; + $extensions = $error->extensions; + } elseif ($error instanceof Throwable) { + $message = $error->getMessage(); + $originalError = $error; + } else { + $message = (string) $error; + } + + return new static( + $message === '' || $message === null ? 'An unknown error occurred.' : $message, + $nodes, + $source, + $positions, + $path, + $originalError, + $extensions + ); + } + + /** + * @return mixed[] + */ + public static function formatError(Error $error) + { + return $error->toSerializableArray(); + } + + /** + * @inheritdoc + */ + public function isClientSafe() + { + return $this->isClientSafe; + } + + /** + * @inheritdoc + */ + public function getCategory() + { + return $this->category; + } + + public function getSource() : ?Source + { + if ($this->source === null) { + if (isset($this->nodes[0]) && $this->nodes[0]->loc !== null) { + $this->source = $this->nodes[0]->loc->source; + } + } + + return $this->source; + } + + /** + * @return int[] + */ + public function getPositions() : array + { + if (count($this->positions) === 0 && count($this->nodes ?? []) > 0) { + $positions = array_map( + static function ($node) : ?int { + return isset($node->loc) ? $node->loc->start : null; + }, + $this->nodes + ); + + $positions = array_filter( + $positions, + static function ($p) : bool { + return $p !== null; + } + ); + + $this->positions = array_values($positions); + } + + return $this->positions; + } + + /** + * An array of locations within the source GraphQL document which correspond to this error. + * + * Each entry has information about `line` and `column` within source GraphQL document: + * $location->line; + * $location->column; + * + * Errors during validation often contain multiple locations, for example to + * point out to field mentioned in multiple fragments. Errors during execution include a + * single location, the field which produced the error. + * + * @return SourceLocation[] + * + * @api + */ + public function getLocations() : array + { + if (! isset($this->locations)) { + $positions = $this->getPositions(); + $source = $this->getSource(); + $nodes = $this->nodes; + + if ($source !== null && count($positions) !== 0) { + $this->locations = array_map( + static function ($pos) use ($source) : SourceLocation { + return $source->getLocation($pos); + }, + $positions + ); + } elseif ($nodes !== null && count($nodes) !== 0) { + $locations = array_filter( + array_map( + static function ($node) : ?SourceLocation { + if (isset($node->loc->source)) { + return $node->loc->source->getLocation($node->loc->start); + } + + return null; + }, + $nodes + ) + ); + $this->locations = array_values($locations); + } else { + $this->locations = []; + } + } + + return $this->locations; + } + + /** + * @return Node[]|null + */ + public function getNodes() + { + return $this->nodes; + } + + /** + * Returns an array describing the path from the root value to the field which produced this error. + * Only included for execution errors. + * + * @return mixed[]|null + * + * @api + */ + public function getPath() + { + return $this->path; + } + + /** + * @return mixed[] + */ + public function getExtensions() + { + return $this->extensions; + } + + /** + * Returns array representation of error suitable for serialization + * + * @deprecated Use FormattedError::createFromException() instead + * + * @return mixed[] + * + * @codeCoverageIgnore + */ + public function toSerializableArray() + { + $arr = [ + 'message' => $this->getMessage(), + ]; + + $locations = Utils::map( + $this->getLocations(), + static function (SourceLocation $loc) : array { + return $loc->toSerializableArray(); + } + ); + + if (count($locations) > 0) { + $arr['locations'] = $locations; + } + if (count($this->path ?? []) > 0) { + $arr['path'] = $this->path; + } + if (count($this->extensions ?? []) > 0) { + $arr['extensions'] = $this->extensions; + } + + return $arr; + } + + /** + * Specify data which should be serialized to JSON + * + * @link http://php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed data which can be serialized by json_encode, + * which is a value of any type other than a resource. + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->toSerializableArray(); + } + + /** + * @return string + */ + public function __toString() + { + return FormattedError::printError($this); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/FormattedError.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/FormattedError.php new file mode 100644 index 00000000..4748b69f --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/FormattedError.php @@ -0,0 +1,418 @@ +nodes ?? []) !== 0) { + /** @var Node $node */ + foreach ($error->nodes as $node) { + if ($node->loc === null) { + continue; + } + + if ($node->loc->source === null) { + continue; + } + + $printedLocations[] = self::highlightSourceAtLocation( + $node->loc->source, + $node->loc->source->getLocation($node->loc->start) + ); + } + } elseif ($error->getSource() !== null && count($error->getLocations()) !== 0) { + $source = $error->getSource(); + foreach (($error->getLocations() ?? []) as $location) { + $printedLocations[] = self::highlightSourceAtLocation($source, $location); + } + } + + return count($printedLocations) === 0 + ? $error->getMessage() + : implode("\n\n", array_merge([$error->getMessage()], $printedLocations)) . "\n"; + } + + /** + * Render a helpful description of the location of the error in the GraphQL + * Source document. + * + * @return string + */ + private static function highlightSourceAtLocation(Source $source, SourceLocation $location) + { + $line = $location->line; + $lineOffset = $source->locationOffset->line - 1; + $columnOffset = self::getColumnOffset($source, $location); + $contextLine = $line + $lineOffset; + $contextColumn = $location->column + $columnOffset; + $prevLineNum = (string) ($contextLine - 1); + $lineNum = (string) $contextLine; + $nextLineNum = (string) ($contextLine + 1); + $padLen = strlen($nextLineNum); + $lines = preg_split('/\r\n|[\n\r]/', $source->body); + + $lines[0] = self::whitespace($source->locationOffset->column - 1) . $lines[0]; + + $outputLines = [ + sprintf('%s (%s:%s)', $source->name, $contextLine, $contextColumn), + $line >= 2 ? (self::lpad($padLen, $prevLineNum) . ': ' . $lines[$line - 2]) : null, + self::lpad($padLen, $lineNum) . ': ' . $lines[$line - 1], + self::whitespace(2 + $padLen + $contextColumn - 1) . '^', + $line < count($lines) ? self::lpad($padLen, $nextLineNum) . ': ' . $lines[$line] : null, + ]; + + return implode("\n", array_filter($outputLines)); + } + + /** + * @return int + */ + private static function getColumnOffset(Source $source, SourceLocation $location) + { + return $location->line === 1 ? $source->locationOffset->column - 1 : 0; + } + + /** + * @param int $len + * + * @return string + */ + private static function whitespace($len) + { + return str_repeat(' ', $len); + } + + /** + * @param int $len + * + * @return string + */ + private static function lpad($len, $str) + { + return self::whitespace($len - mb_strlen($str)) . $str; + } + + /** + * Standard GraphQL error formatter. Converts any exception to array + * conforming to GraphQL spec. + * + * This method only exposes exception message when exception implements ClientAware interface + * (or when debug flags are passed). + * + * For a list of available debug flags @see \GraphQL\Error\DebugFlag constants. + * + * @param string $internalErrorMessage + * + * @return mixed[] + * + * @throws Throwable + * + * @api + */ + public static function createFromException(Throwable $exception, int $debug = DebugFlag::NONE, $internalErrorMessage = null) : array + { + $internalErrorMessage = $internalErrorMessage ?? self::$internalErrorMessage; + + if ($exception instanceof ClientAware) { + $formattedError = [ + 'message' => $exception->isClientSafe() ? $exception->getMessage() : $internalErrorMessage, + 'extensions' => [ + 'category' => $exception->getCategory(), + ], + ]; + } else { + $formattedError = [ + 'message' => $internalErrorMessage, + 'extensions' => [ + 'category' => Error::CATEGORY_INTERNAL, + ], + ]; + } + + if ($exception instanceof Error) { + $locations = Utils::map( + $exception->getLocations(), + static function (SourceLocation $loc) : array { + return $loc->toSerializableArray(); + } + ); + if (count($locations) > 0) { + $formattedError['locations'] = $locations; + } + + if (count($exception->path ?? []) > 0) { + $formattedError['path'] = $exception->path; + } + if (count($exception->getExtensions() ?? []) > 0) { + $formattedError['extensions'] = $exception->getExtensions() + $formattedError['extensions']; + } + } + + if ($debug !== DebugFlag::NONE) { + $formattedError = self::addDebugEntries($formattedError, $exception, $debug); + } + + return $formattedError; + } + + /** + * Decorates spec-compliant $formattedError with debug entries according to $debug flags + * (@see \GraphQL\Error\DebugFlag for available flags) + * + * @param mixed[] $formattedError + * + * @return mixed[] + * + * @throws Throwable + */ + public static function addDebugEntries(array $formattedError, Throwable $e, int $debugFlag) : array + { + if ($debugFlag === DebugFlag::NONE) { + return $formattedError; + } + + if (( $debugFlag & DebugFlag::RETHROW_INTERNAL_EXCEPTIONS) !== 0) { + if (! $e instanceof Error) { + throw $e; + } + + if ($e->getPrevious() !== null) { + throw $e->getPrevious(); + } + } + + $isUnsafe = ! $e instanceof ClientAware || ! $e->isClientSafe(); + + if (($debugFlag & DebugFlag::RETHROW_UNSAFE_EXCEPTIONS) !== 0 && $isUnsafe && $e->getPrevious() !== null) { + throw $e->getPrevious(); + } + + if (($debugFlag & DebugFlag::INCLUDE_DEBUG_MESSAGE) !== 0 && $isUnsafe) { + // Displaying debugMessage as a first entry: + $formattedError = ['debugMessage' => $e->getMessage()] + $formattedError; + } + + if (($debugFlag & DebugFlag::INCLUDE_TRACE) !== 0) { + if ($e instanceof ErrorException || $e instanceof \Error) { + $formattedError += [ + 'file' => $e->getFile(), + 'line' => $e->getLine(), + ]; + } + + $isTrivial = $e instanceof Error && $e->getPrevious() === null; + + if (! $isTrivial) { + $debugging = $e->getPrevious() ?? $e; + $formattedError['trace'] = static::toSafeTrace($debugging); + } + } + + return $formattedError; + } + + /** + * Prepares final error formatter taking in account $debug flags. + * If initial formatter is not set, FormattedError::createFromException is used + */ + public static function prepareFormatter(?callable $formatter, int $debug) : callable + { + $formatter = $formatter ?? static function ($e) : array { + return FormattedError::createFromException($e); + }; + if ($debug !== DebugFlag::NONE) { + $formatter = static function ($e) use ($formatter, $debug) : array { + return FormattedError::addDebugEntries($formatter($e), $e, $debug); + }; + } + + return $formatter; + } + + /** + * Returns error trace as serializable array + * + * @param Throwable $error + * + * @return mixed[] + * + * @api + */ + public static function toSafeTrace($error) + { + $trace = $error->getTrace(); + + if (isset($trace[0]['function']) && isset($trace[0]['class']) && + // Remove invariant entries as they don't provide much value: + ($trace[0]['class'] . '::' . $trace[0]['function'] === 'GraphQL\Utils\Utils::invariant')) { + array_shift($trace); + } elseif (! isset($trace[0]['file'])) { + // Remove root call as it's likely error handler trace: + array_shift($trace); + } + + return array_map( + static function ($err) : array { + $safeErr = array_intersect_key($err, ['file' => true, 'line' => true]); + + if (isset($err['function'])) { + $func = $err['function']; + $args = array_map([self::class, 'printVar'], $err['args'] ?? []); + $funcStr = $func . '(' . implode(', ', $args) . ')'; + + if (isset($err['class'])) { + $safeErr['call'] = $err['class'] . '::' . $funcStr; + } else { + $safeErr['function'] = $funcStr; + } + } + + return $safeErr; + }, + $trace + ); + } + + /** + * @param mixed $var + * + * @return string + */ + public static function printVar($var) + { + if ($var instanceof Type) { + // FIXME: Replace with schema printer call + if ($var instanceof WrappingType) { + $var = $var->getWrappedType(true); + } + + return 'GraphQLType: ' . $var->name; + } + + if (is_object($var)) { + return 'instance of ' . get_class($var) . ($var instanceof Countable ? '(' . count($var) . ')' : ''); + } + if (is_array($var)) { + return 'array(' . count($var) . ')'; + } + if ($var === '') { + return '(empty string)'; + } + if (is_string($var)) { + return "'" . addcslashes($var, "'") . "'"; + } + if (is_bool($var)) { + return $var ? 'true' : 'false'; + } + if (is_scalar($var)) { + return $var; + } + if ($var === null) { + return 'null'; + } + + return gettype($var); + } + + /** + * @deprecated as of v0.8.0 + * + * @param string $error + * @param SourceLocation[] $locations + * + * @return mixed[] + */ + public static function create($error, array $locations = []) + { + $formatted = ['message' => $error]; + + if (count($locations) > 0) { + $formatted['locations'] = array_map( + static function ($loc) : array { + return $loc->toArray(); + }, + $locations + ); + } + + return $formatted; + } + + /** + * @deprecated as of v0.10.0, use general purpose method createFromException() instead + * + * @return mixed[] + * + * @codeCoverageIgnore + */ + public static function createFromPHPError(ErrorException $e) + { + return [ + 'message' => $e->getMessage(), + 'severity' => $e->getSeverity(), + 'trace' => self::toSafeTrace($e), + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/InvariantViolation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/InvariantViolation.php new file mode 100644 index 00000000..c3cb8abe --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/InvariantViolation.php @@ -0,0 +1,20 @@ + 0 && ! isset(self::$warned[$warningId])) { + self::$warned[$warningId] = true; + trigger_error($errorMessage, $messageLevel); + } + } + + public static function warn(string $errorMessage, int $warningId, ?int $messageLevel = null) : void + { + $messageLevel = $messageLevel ?? E_USER_WARNING; + + if (self::$warningHandler !== null) { + $fn = self::$warningHandler; + $fn($errorMessage, $warningId, $messageLevel); + } elseif ((self::$enableWarnings & $warningId) > 0) { + trigger_error($errorMessage, $messageLevel); + } + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Exception/InvalidArgument.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Exception/InvalidArgument.php new file mode 100644 index 00000000..eea34d56 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Exception/InvalidArgument.php @@ -0,0 +1,20 @@ +schema = $schema; + $this->fragments = $fragments; + $this->rootValue = $rootValue; + $this->contextValue = $contextValue; + $this->operation = $operation; + $this->variableValues = $variableValues; + $this->errors = $errors ?? []; + $this->fieldResolver = $fieldResolver; + $this->promiseAdapter = $promiseAdapter; + } + + public function addError(Error $error) + { + $this->errors[] = $error; + + return $this; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php new file mode 100644 index 00000000..6bc7931c --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php @@ -0,0 +1,166 @@ +getPrevious() would + * contain original exception. + * + * @api + * @var Error[] + */ + public $errors; + + /** + * User-defined serializable array of extensions included in serialized result. + * Conforms to + * + * @api + * @var mixed[] + */ + public $extensions; + + /** @var callable */ + private $errorFormatter; + + /** @var callable */ + private $errorsHandler; + + /** + * @param mixed[] $data + * @param Error[] $errors + * @param mixed[] $extensions + */ + public function __construct($data = null, array $errors = [], array $extensions = []) + { + $this->data = $data; + $this->errors = $errors; + $this->extensions = $extensions; + } + + /** + * Define custom error formatting (must conform to http://facebook.github.io/graphql/#sec-Errors) + * + * Expected signature is: function (GraphQL\Error\Error $error): array + * + * Default formatter is "GraphQL\Error\FormattedError::createFromException" + * + * Expected returned value must be an array: + * array( + * 'message' => 'errorMessage', + * // ... other keys + * ); + * + * @return self + * + * @api + */ + public function setErrorFormatter(callable $errorFormatter) + { + $this->errorFormatter = $errorFormatter; + + return $this; + } + + /** + * Define custom logic for error handling (filtering, logging, etc). + * + * Expected handler signature is: function (array $errors, callable $formatter): array + * + * Default handler is: + * function (array $errors, callable $formatter) { + * return array_map($formatter, $errors); + * } + * + * @return self + * + * @api + */ + public function setErrorsHandler(callable $handler) + { + $this->errorsHandler = $handler; + + return $this; + } + + /** + * @return mixed[] + */ + public function jsonSerialize() : array + { + return $this->toArray(); + } + + /** + * Converts GraphQL query result to spec-compliant serializable array using provided + * errors handler and formatter. + * + * If debug argument is passed, output of error formatter is enriched which debugging information + * ("debugMessage", "trace" keys depending on flags). + * + * $debug argument must sum of flags from @see \GraphQL\Error\DebugFlag + * + * @return mixed[] + * + * @api + */ + public function toArray(int $debug = DebugFlag::NONE) : array + { + $result = []; + + if (count($this->errors ?? []) > 0) { + $errorsHandler = $this->errorsHandler ?? static function (array $errors, callable $formatter) : array { + return array_map($formatter, $errors); + }; + + $handledErrors = $errorsHandler( + $this->errors, + FormattedError::prepareFormatter($this->errorFormatter, $debug) + ); + + // While we know that there were errors initially, they might have been discarded + if ($handledErrors !== []) { + $result['errors'] = $handledErrors; + } + } + + if ($this->data !== null) { + $result['data'] = $this->data; + } + + if (count($this->extensions ?? []) > 0) { + $result['extensions'] = $this->extensions; + } + + return $result; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Executor.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Executor.php new file mode 100644 index 00000000..c6040bdf --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Executor.php @@ -0,0 +1,190 @@ +errors`. + * + * @param mixed|null $rootValue + * @param mixed|null $contextValue + * @param array|ArrayAccess|null $variableValues + * @param string|null $operationName + * + * @return ExecutionResult|Promise + * + * @api + */ + public static function execute( + Schema $schema, + DocumentNode $documentNode, + $rootValue = null, + $contextValue = null, + $variableValues = null, + $operationName = null, + ?callable $fieldResolver = null + ) { + // TODO: deprecate (just always use SyncAdapter here) and have `promiseToExecute()` for other cases + + $promiseAdapter = static::getPromiseAdapter(); + + $result = static::promiseToExecute( + $promiseAdapter, + $schema, + $documentNode, + $rootValue, + $contextValue, + $variableValues, + $operationName, + $fieldResolver + ); + + if ($promiseAdapter instanceof SyncPromiseAdapter) { + $result = $promiseAdapter->wait($result); + } + + return $result; + } + + /** + * Same as execute(), but requires promise adapter and returns a promise which is always + * fulfilled with an instance of ExecutionResult and never rejected. + * + * Useful for async PHP platforms. + * + * @param mixed|null $rootValue + * @param mixed|null $contextValue + * @param array|null $variableValues + * @param string|null $operationName + * + * @return Promise + * + * @api + */ + public static function promiseToExecute( + PromiseAdapter $promiseAdapter, + Schema $schema, + DocumentNode $documentNode, + $rootValue = null, + $contextValue = null, + $variableValues = null, + $operationName = null, + ?callable $fieldResolver = null + ) { + $factory = self::$implementationFactory; + + /** @var ExecutorImplementation $executor */ + $executor = $factory( + $promiseAdapter, + $schema, + $documentNode, + $rootValue, + $contextValue, + $variableValues, + $operationName, + $fieldResolver ?? self::$defaultFieldResolver + ); + + return $executor->doExecute(); + } + + /** + * If a resolve function is not given, then a default resolve behavior is used + * which takes the property of the root value of the same name as the field + * and returns it as the result, or if it's a function, returns the result + * of calling that function while passing along args and context. + * + * @param mixed $objectValue + * @param array $args + * @param mixed|null $contextValue + * + * @return mixed|null + */ + public static function defaultFieldResolver($objectValue, $args, $contextValue, ResolveInfo $info) + { + $fieldName = $info->fieldName; + $property = null; + + if (is_array($objectValue) || $objectValue instanceof ArrayAccess) { + if (isset($objectValue[$fieldName])) { + $property = $objectValue[$fieldName]; + } + } elseif (is_object($objectValue)) { + if (isset($objectValue->{$fieldName})) { + $property = $objectValue->{$fieldName}; + } + } + + return $property instanceof Closure + ? $property($objectValue, $args, $contextValue, $info) + : $property; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutorImplementation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutorImplementation.php new file mode 100644 index 00000000..46cb2b72 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutorImplementation.php @@ -0,0 +1,15 @@ +resolve($value); + } elseif ($onRejected !== null) { + self::resolveWithCallable($deferred, $onRejected, $reason); + } else { + $deferred->fail($reason); + } + }; + + /** @var AmpPromise $adoptedPromise */ + $adoptedPromise = $promise->adoptedPromise; + $adoptedPromise->onResolve($onResolve); + + return new Promise($deferred->promise(), $this); + } + + /** + * @inheritdoc + */ + public function create(callable $resolver) : Promise + { + $deferred = new Deferred(); + + $resolver( + static function ($value) use ($deferred) : void { + $deferred->resolve($value); + }, + static function (Throwable $exception) use ($deferred) : void { + $deferred->fail($exception); + } + ); + + return new Promise($deferred->promise(), $this); + } + + /** + * @inheritdoc + */ + public function createFulfilled($value = null) : Promise + { + $promise = new Success($value); + + return new Promise($promise, $this); + } + + /** + * @inheritdoc + */ + public function createRejected($reason) : Promise + { + $promise = new Failure($reason); + + return new Promise($promise, $this); + } + + /** + * @inheritdoc + */ + public function all(array $promisesOrValues) : Promise + { + /** @var AmpPromise[] $promises */ + $promises = []; + foreach ($promisesOrValues as $key => $item) { + if ($item instanceof Promise) { + $promises[$key] = $item->adoptedPromise; + } elseif ($item instanceof AmpPromise) { + $promises[$key] = $item; + } + } + + $deferred = new Deferred(); + + $onResolve = static function (?Throwable $reason, ?array $values) use ($promisesOrValues, $deferred) : void { + if ($reason === null) { + $deferred->resolve(array_replace($promisesOrValues, $values)); + + return; + } + + $deferred->fail($reason); + }; + + all($promises)->onResolve($onResolve); + + return new Promise($deferred->promise(), $this); + } + + private static function resolveWithCallable(Deferred $deferred, callable $callback, $argument) : void + { + try { + $result = $callback($argument); + } catch (Throwable $exception) { + $deferred->fail($exception); + + return; + } + + if ($result instanceof Promise) { + $result = $result->adoptedPromise; + } + + $deferred->resolve($result); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php new file mode 100644 index 00000000..14ff5027 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php @@ -0,0 +1,100 @@ +adoptedPromise; + + return new Promise($adoptedPromise->then($onFulfilled, $onRejected), $this); + } + + /** + * @inheritdoc + */ + public function create(callable $resolver) + { + $promise = new ReactPromise($resolver); + + return new Promise($promise, $this); + } + + /** + * @inheritdoc + */ + public function createFulfilled($value = null) + { + $promise = resolve($value); + + return new Promise($promise, $this); + } + + /** + * @inheritdoc + */ + public function createRejected($reason) + { + $promise = reject($reason); + + return new Promise($promise, $this); + } + + /** + * @inheritdoc + */ + public function all(array $promisesOrValues) + { + // TODO: rework with generators when PHP minimum required version is changed to 5.5+ + $promisesOrValues = Utils::map( + $promisesOrValues, + static function ($item) { + return $item instanceof Promise ? $item->adoptedPromise : $item; + } + ); + + $promise = all($promisesOrValues)->then(static function ($values) use ($promisesOrValues) : array { + $orderedResults = []; + + foreach ($promisesOrValues as $key => $value) { + $orderedResults[$key] = $values[$key]; + } + + return $orderedResults; + }); + + return new Promise($promise, $this); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php new file mode 100644 index 00000000..d0b94b18 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php @@ -0,0 +1,202 @@ +isEmpty()) { + $task = $q->dequeue(); + $task(); + } + } + + /** + * @param callable() : mixed $executor + */ + public function __construct(?callable $executor = null) + { + if ($executor === null) { + return; + } + self::getQueue()->enqueue(function () use ($executor) : void { + try { + $this->resolve($executor()); + } catch (Throwable $e) { + $this->reject($e); + } + }); + } + + public function resolve($value) : self + { + switch ($this->state) { + case self::PENDING: + if ($value === $this) { + throw new Exception('Cannot resolve promise with self'); + } + if (is_object($value) && method_exists($value, 'then')) { + $value->then( + function ($resolvedValue) : void { + $this->resolve($resolvedValue); + }, + function ($reason) : void { + $this->reject($reason); + } + ); + + return $this; + } + + $this->state = self::FULFILLED; + $this->result = $value; + $this->enqueueWaitingPromises(); + break; + case self::FULFILLED: + if ($this->result !== $value) { + throw new Exception('Cannot change value of fulfilled promise'); + } + break; + case self::REJECTED: + throw new Exception('Cannot resolve rejected promise'); + } + + return $this; + } + + public function reject($reason) : self + { + if (! $reason instanceof Throwable) { + throw new Exception('SyncPromise::reject() has to be called with an instance of \Throwable'); + } + + switch ($this->state) { + case self::PENDING: + $this->state = self::REJECTED; + $this->result = $reason; + $this->enqueueWaitingPromises(); + break; + case self::REJECTED: + if ($reason !== $this->result) { + throw new Exception('Cannot change rejection reason'); + } + break; + case self::FULFILLED: + throw new Exception('Cannot reject fulfilled promise'); + } + + return $this; + } + + private function enqueueWaitingPromises() : void + { + Utils::invariant( + $this->state !== self::PENDING, + 'Cannot enqueue derived promises when parent is still pending' + ); + + foreach ($this->waiting as $descriptor) { + self::getQueue()->enqueue(function () use ($descriptor) : void { + /** @var self $promise */ + [$promise, $onFulfilled, $onRejected] = $descriptor; + + if ($this->state === self::FULFILLED) { + try { + $promise->resolve($onFulfilled === null ? $this->result : $onFulfilled($this->result)); + } catch (Throwable $e) { + $promise->reject($e); + } + } elseif ($this->state === self::REJECTED) { + try { + if ($onRejected === null) { + $promise->reject($this->result); + } else { + $promise->resolve($onRejected($this->result)); + } + } catch (Throwable $e) { + $promise->reject($e); + } + } + }); + } + $this->waiting = []; + } + + public static function getQueue() : SplQueue + { + return self::$queue ?? self::$queue = new SplQueue(); + } + + /** + * @param callable(mixed) : mixed $onFulfilled + * @param callable(Throwable) : mixed $onRejected + */ + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) : self + { + if ($this->state === self::REJECTED && $onRejected === null) { + return $this; + } + if ($this->state === self::FULFILLED && $onFulfilled === null) { + return $this; + } + $tmp = new self(); + $this->waiting[] = [$tmp, $onFulfilled, $onRejected]; + + if ($this->state !== self::PENDING) { + $this->enqueueWaitingPromises(); + } + + return $tmp; + } + + /** + * @param callable(Throwable) : mixed $onRejected + */ + public function catch(callable $onRejected) : self + { + return $this->then(null, $onRejected); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php new file mode 100644 index 00000000..f088aec2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php @@ -0,0 +1,180 @@ +adoptedPromise; + + return new Promise($adoptedPromise->then($onFulfilled, $onRejected), $this); + } + + /** + * @inheritdoc + */ + public function create(callable $resolver) + { + $promise = new SyncPromise(); + + try { + $resolver( + [ + $promise, + 'resolve', + ], + [ + $promise, + 'reject', + ] + ); + } catch (Throwable $e) { + $promise->reject($e); + } + + return new Promise($promise, $this); + } + + /** + * @inheritdoc + */ + public function createFulfilled($value = null) + { + $promise = new SyncPromise(); + + return new Promise($promise->resolve($value), $this); + } + + /** + * @inheritdoc + */ + public function createRejected($reason) + { + $promise = new SyncPromise(); + + return new Promise($promise->reject($reason), $this); + } + + /** + * @inheritdoc + */ + public function all(array $promisesOrValues) + { + $all = new SyncPromise(); + + $total = count($promisesOrValues); + $count = 0; + $result = []; + + foreach ($promisesOrValues as $index => $promiseOrValue) { + if ($promiseOrValue instanceof Promise) { + $result[$index] = null; + $promiseOrValue->then( + static function ($value) use ($index, &$count, $total, &$result, $all) : void { + $result[$index] = $value; + $count++; + if ($count < $total) { + return; + } + + $all->resolve($result); + }, + [$all, 'reject'] + ); + } else { + $result[$index] = $promiseOrValue; + $count++; + } + } + if ($count === $total) { + $all->resolve($result); + } + + return new Promise($all, $this); + } + + /** + * Synchronously wait when promise completes + * + * @return ExecutionResult + */ + public function wait(Promise $promise) + { + $this->beforeWait($promise); + $taskQueue = SyncPromise::getQueue(); + + while ($promise->adoptedPromise->state === SyncPromise::PENDING && + ! $taskQueue->isEmpty() + ) { + SyncPromise::runQueue(); + $this->onWait($promise); + } + + /** @var SyncPromise $syncPromise */ + $syncPromise = $promise->adoptedPromise; + + if ($syncPromise->state === SyncPromise::FULFILLED) { + return $syncPromise->result; + } + + if ($syncPromise->state === SyncPromise::REJECTED) { + throw $syncPromise->result; + } + + throw new InvariantViolation('Could not resolve promise'); + } + + /** + * Execute just before starting to run promise completion + */ + protected function beforeWait(Promise $promise) + { + } + + /** + * Execute while running promise completion + */ + protected function onWait(Promise $promise) + { + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Promise.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Promise.php new file mode 100644 index 00000000..5823d14b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Promise.php @@ -0,0 +1,40 @@ +adapter = $adapter; + $this->adoptedPromise = $adoptedPromise; + } + + /** + * @return Promise + */ + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) + { + return $this->adapter->then($this, $onFulfilled, $onRejected); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php new file mode 100644 index 00000000..c3d40984 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php @@ -0,0 +1,92 @@ +exeContext = $context; + $this->subFieldCache = new SplObjectStorage(); + } + + /** + * @param mixed $rootValue + * @param mixed $contextValue + * @param array|Traversable $variableValues + */ + public static function create( + PromiseAdapter $promiseAdapter, + Schema $schema, + DocumentNode $documentNode, + $rootValue, + $contextValue, + $variableValues, + ?string $operationName, + callable $fieldResolver + ) : ExecutorImplementation { + $exeContext = static::buildExecutionContext( + $schema, + $documentNode, + $rootValue, + $contextValue, + $variableValues, + $operationName, + $fieldResolver, + $promiseAdapter + ); + + if (is_array($exeContext)) { + return new class($promiseAdapter->createFulfilled(new ExecutionResult(null, $exeContext))) implements ExecutorImplementation + { + /** @var Promise */ + private $result; + + public function __construct(Promise $result) + { + $this->result = $result; + } + + public function doExecute() : Promise + { + return $this->result; + } + }; + } + + return new static($exeContext); + } + + /** + * Constructs an ExecutionContext object from the arguments passed to + * execute, which we will pass throughout the other execution methods. + * + * @param mixed $rootValue + * @param mixed $contextValue + * @param array|Traversable $rawVariableValues + * + * @return ExecutionContext|array + */ + protected static function buildExecutionContext( + Schema $schema, + DocumentNode $documentNode, + $rootValue, + $contextValue, + $rawVariableValues, + ?string $operationName = null, + ?callable $fieldResolver = null, + ?PromiseAdapter $promiseAdapter = null + ) { + $errors = []; + $fragments = []; + /** @var OperationDefinitionNode|null $operation */ + $operation = null; + $hasMultipleAssumedOperations = false; + foreach ($documentNode->definitions as $definition) { + switch (true) { + case $definition instanceof OperationDefinitionNode: + if ($operationName === null && $operation !== null) { + $hasMultipleAssumedOperations = true; + } + if ($operationName === null || + (isset($definition->name) && $definition->name->value === $operationName)) { + $operation = $definition; + } + break; + case $definition instanceof FragmentDefinitionNode: + $fragments[$definition->name->value] = $definition; + break; + } + } + if ($operation === null) { + if ($operationName === null) { + $errors[] = new Error('Must provide an operation.'); + } else { + $errors[] = new Error(sprintf('Unknown operation named "%s".', $operationName)); + } + } elseif ($hasMultipleAssumedOperations) { + $errors[] = new Error( + 'Must provide operation name if query contains multiple operations.' + ); + } + $variableValues = null; + if ($operation !== null) { + [$coercionErrors, $coercedVariableValues] = Values::getVariableValues( + $schema, + $operation->variableDefinitions ?? [], + $rawVariableValues ?? [] + ); + if (count($coercionErrors ?? []) === 0) { + $variableValues = $coercedVariableValues; + } else { + $errors = array_merge($errors, $coercionErrors); + } + } + if (count($errors) > 0) { + return $errors; + } + Utils::invariant($operation, 'Has operation if no errors.'); + Utils::invariant($variableValues !== null, 'Has variables if no errors.'); + + return new ExecutionContext( + $schema, + $fragments, + $rootValue, + $contextValue, + $operation, + $variableValues, + $errors, + $fieldResolver, + $promiseAdapter + ); + } + + public function doExecute() : Promise + { + // Return a Promise that will eventually resolve to the data described by + // the "Response" section of the GraphQL specification. + // + // If errors are encountered while executing a GraphQL field, only that + // field and its descendants will be omitted, and sibling fields will still + // be executed. An execution which encounters errors will still result in a + // resolved Promise. + $data = $this->executeOperation($this->exeContext->operation, $this->exeContext->rootValue); + $result = $this->buildResponse($data); + + // Note: we deviate here from the reference implementation a bit by always returning promise + // But for the "sync" case it is always fulfilled + return $this->isPromise($result) + ? $result + : $this->exeContext->promiseAdapter->createFulfilled($result); + } + + /** + * @param mixed|Promise|null $data + * + * @return ExecutionResult|Promise + */ + protected function buildResponse($data) + { + if ($this->isPromise($data)) { + return $data->then(function ($resolved) { + return $this->buildResponse($resolved); + }); + } + if ($data !== null) { + $data = (array) $data; + } + + return new ExecutionResult($data, $this->exeContext->errors); + } + + /** + * Implements the "Evaluating operations" section of the spec. + * + * @param mixed $rootValue + * + * @return array|Promise|stdClass|null + */ + protected function executeOperation(OperationDefinitionNode $operation, $rootValue) + { + $type = $this->getOperationRootType($this->exeContext->schema, $operation); + $fields = $this->collectFields($type, $operation->selectionSet, new ArrayObject(), new ArrayObject()); + $path = []; + // Errors from sub-fields of a NonNull type may propagate to the top level, + // at which point we still log the error and null the parent field, which + // in this case is the entire response. + // + // Similar to completeValueCatchingError. + try { + $result = $operation->operation === 'mutation' + ? $this->executeFieldsSerially($type, $rootValue, $path, $fields) + : $this->executeFields($type, $rootValue, $path, $fields); + if ($this->isPromise($result)) { + return $result->then( + null, + function ($error) : ?Promise { + if ($error instanceof Error) { + $this->exeContext->addError($error); + + return $this->exeContext->promiseAdapter->createFulfilled(null); + } + + return null; + } + ); + } + + return $result; + } catch (Error $error) { + $this->exeContext->addError($error); + + return null; + } + } + + /** + * Extracts the root type of the operation from the schema. + * + * @throws Error + */ + protected function getOperationRootType(Schema $schema, OperationDefinitionNode $operation) : ObjectType + { + switch ($operation->operation) { + case 'query': + $queryType = $schema->getQueryType(); + if ($queryType === null) { + throw new Error( + 'Schema does not define the required query root type.', + [$operation] + ); + } + + return $queryType; + case 'mutation': + $mutationType = $schema->getMutationType(); + if ($mutationType === null) { + throw new Error( + 'Schema is not configured for mutations.', + [$operation] + ); + } + + return $mutationType; + case 'subscription': + $subscriptionType = $schema->getSubscriptionType(); + if ($subscriptionType === null) { + throw new Error( + 'Schema is not configured for subscriptions.', + [$operation] + ); + } + + return $subscriptionType; + default: + throw new Error( + 'Can only execute queries, mutations and subscriptions.', + [$operation] + ); + } + } + + /** + * Given a selectionSet, adds all of the fields in that selection to + * the passed in map of fields, and returns it at the end. + * + * CollectFields requires the "runtime type" of an object. For a field which + * returns an Interface or Union type, the "runtime type" will be the actual + * Object type returned by that field. + */ + protected function collectFields( + ObjectType $runtimeType, + SelectionSetNode $selectionSet, + ArrayObject $fields, + ArrayObject $visitedFragmentNames + ) : ArrayObject { + $exeContext = $this->exeContext; + foreach ($selectionSet->selections as $selection) { + switch (true) { + case $selection instanceof FieldNode: + if (! $this->shouldIncludeNode($selection)) { + break; + } + $name = static::getFieldEntryKey($selection); + if (! isset($fields[$name])) { + $fields[$name] = new ArrayObject(); + } + $fields[$name][] = $selection; + break; + case $selection instanceof InlineFragmentNode: + if (! $this->shouldIncludeNode($selection) || + ! $this->doesFragmentConditionMatch($selection, $runtimeType) + ) { + break; + } + $this->collectFields( + $runtimeType, + $selection->selectionSet, + $fields, + $visitedFragmentNames + ); + break; + case $selection instanceof FragmentSpreadNode: + $fragName = $selection->name->value; + + if (($visitedFragmentNames[$fragName] ?? false) === true || ! $this->shouldIncludeNode($selection)) { + break; + } + $visitedFragmentNames[$fragName] = true; + /** @var FragmentDefinitionNode|null $fragment */ + $fragment = $exeContext->fragments[$fragName] ?? null; + if ($fragment === null || ! $this->doesFragmentConditionMatch($fragment, $runtimeType)) { + break; + } + $this->collectFields( + $runtimeType, + $fragment->selectionSet, + $fields, + $visitedFragmentNames + ); + break; + } + } + + return $fields; + } + + /** + * Determines if a field should be included based on the @include and @skip + * directives, where @skip has higher precedence than @include. + * + * @param FragmentSpreadNode|FieldNode|InlineFragmentNode $node + */ + protected function shouldIncludeNode(SelectionNode $node) : bool + { + $variableValues = $this->exeContext->variableValues; + $skipDirective = Directive::skipDirective(); + $skip = Values::getDirectiveValues( + $skipDirective, + $node, + $variableValues + ); + if (isset($skip['if']) && $skip['if'] === true) { + return false; + } + $includeDirective = Directive::includeDirective(); + $include = Values::getDirectiveValues( + $includeDirective, + $node, + $variableValues + ); + + return ! isset($include['if']) || $include['if'] !== false; + } + + /** + * Implements the logic to compute the key of a given fields entry + */ + protected static function getFieldEntryKey(FieldNode $node) : string + { + return $node->alias === null ? $node->name->value : $node->alias->value; + } + + /** + * Determines if a fragment is applicable to the given type. + * + * @param FragmentDefinitionNode|InlineFragmentNode $fragment + */ + protected function doesFragmentConditionMatch(Node $fragment, ObjectType $type) : bool + { + $typeConditionNode = $fragment->typeCondition; + if ($typeConditionNode === null) { + return true; + } + $conditionalType = TypeInfo::typeFromAST($this->exeContext->schema, $typeConditionNode); + if ($conditionalType === $type) { + return true; + } + if ($conditionalType instanceof AbstractType) { + return $this->exeContext->schema->isSubType($conditionalType, $type); + } + + return false; + } + + /** + * Implements the "Evaluating selection sets" section of the spec + * for "write" mode. + * + * @param mixed $rootValue + * @param array $path + * + * @return array|Promise|stdClass + */ + protected function executeFieldsSerially(ObjectType $parentType, $rootValue, array $path, ArrayObject $fields) + { + $result = $this->promiseReduce( + array_keys($fields->getArrayCopy()), + function ($results, $responseName) use ($path, $parentType, $rootValue, $fields) { + $fieldNodes = $fields[$responseName]; + $fieldPath = $path; + $fieldPath[] = $responseName; + $result = $this->resolveField($parentType, $rootValue, $fieldNodes, $fieldPath); + if ($result === static::$UNDEFINED) { + return $results; + } + $promise = $this->getPromise($result); + if ($promise !== null) { + return $promise->then(static function ($resolvedResult) use ($responseName, $results) { + $results[$responseName] = $resolvedResult; + + return $results; + }); + } + $results[$responseName] = $result; + + return $results; + }, + [] + ); + + if ($this->isPromise($result)) { + return $result->then(static function ($resolvedResults) { + return static::fixResultsIfEmptyArray($resolvedResults); + }); + } + + return static::fixResultsIfEmptyArray($result); + } + + /** + * Resolves the field on the given root value. + * + * In particular, this figures out the value that the field returns + * by calling its resolve function, then calls completeValue to complete promises, + * serialize scalars, or execute the sub-selection-set for objects. + * + * @param mixed $rootValue + * @param array $path + * + * @return array|Throwable|mixed|null + */ + protected function resolveField(ObjectType $parentType, $rootValue, ArrayObject $fieldNodes, array $path) + { + $exeContext = $this->exeContext; + $fieldNode = $fieldNodes[0]; + $fieldName = $fieldNode->name->value; + $fieldDef = $this->getFieldDef($exeContext->schema, $parentType, $fieldName); + if ($fieldDef === null) { + return static::$UNDEFINED; + } + $returnType = $fieldDef->getType(); + // The resolve function's optional 3rd argument is a context value that + // is provided to every resolve function within an execution. It is commonly + // used to represent an authenticated user, or request-specific caches. + // The resolve function's optional 4th argument is a collection of + // information about the current execution state. + $info = new ResolveInfo( + $fieldDef, + $fieldNodes, + $parentType, + $path, + $exeContext->schema, + $exeContext->fragments, + $exeContext->rootValue, + $exeContext->operation, + $exeContext->variableValues + ); + if ($fieldDef->resolveFn !== null) { + $resolveFn = $fieldDef->resolveFn; + } elseif ($parentType->resolveFieldFn !== null) { + $resolveFn = $parentType->resolveFieldFn; + } else { + $resolveFn = $this->exeContext->fieldResolver; + } + // Get the resolve function, regardless of if its result is normal + // or abrupt (error). + $result = $this->resolveFieldValueOrError( + $fieldDef, + $fieldNode, + $resolveFn, + $rootValue, + $info + ); + $result = $this->completeValueCatchingError( + $returnType, + $fieldNodes, + $info, + $path, + $result + ); + + return $result; + } + + /** + * This method looks up the field on the given type definition. + * + * It has special casing for the two introspection fields, __schema + * and __typename. __typename is special because it can always be + * queried as a field, even in situations where no other fields + * are allowed, like on a Union. __schema could get automatically + * added to the query type, but that would require mutating type + * definitions, which would cause issues. + */ + protected function getFieldDef(Schema $schema, ObjectType $parentType, string $fieldName) : ?FieldDefinition + { + static $schemaMetaFieldDef, $typeMetaFieldDef, $typeNameMetaFieldDef; + $schemaMetaFieldDef = $schemaMetaFieldDef ?? Introspection::schemaMetaFieldDef(); + $typeMetaFieldDef = $typeMetaFieldDef ?? Introspection::typeMetaFieldDef(); + $typeNameMetaFieldDef = $typeNameMetaFieldDef ?? Introspection::typeNameMetaFieldDef(); + if ($fieldName === $schemaMetaFieldDef->name && $schema->getQueryType() === $parentType) { + return $schemaMetaFieldDef; + } + + if ($fieldName === $typeMetaFieldDef->name && $schema->getQueryType() === $parentType) { + return $typeMetaFieldDef; + } + + if ($fieldName === $typeNameMetaFieldDef->name) { + return $typeNameMetaFieldDef; + } + + return $parentType->findField($fieldName); + } + + /** + * Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` function. + * Returns the result of resolveFn or the abrupt-return Error object. + * + * @param mixed $rootValue + * + * @return Throwable|Promise|mixed + */ + protected function resolveFieldValueOrError( + FieldDefinition $fieldDef, + FieldNode $fieldNode, + callable $resolveFn, + $rootValue, + ResolveInfo $info + ) { + try { + // Build a map of arguments from the field.arguments AST, using the + // variables scope to fulfill any variable references. + $args = Values::getArgumentValues( + $fieldDef, + $fieldNode, + $this->exeContext->variableValues + ); + $contextValue = $this->exeContext->contextValue; + + return $resolveFn($rootValue, $args, $contextValue, $info); + } catch (Throwable $error) { + return $error; + } + } + + /** + * This is a small wrapper around completeValue which detects and logs errors + * in the execution context. + * + * @param array $path + * @param mixed $result + * + * @return array|Promise|stdClass|null + */ + protected function completeValueCatchingError( + Type $returnType, + ArrayObject $fieldNodes, + ResolveInfo $info, + array $path, + $result + ) { + // Otherwise, error protection is applied, logging the error and resolving + // a null value for this field if one is encountered. + try { + $promise = $this->getPromise($result); + if ($promise !== null) { + $completed = $promise->then(function (&$resolved) use ($returnType, $fieldNodes, $info, $path) { + return $this->completeValue($returnType, $fieldNodes, $info, $path, $resolved); + }); + } else { + $completed = $this->completeValue($returnType, $fieldNodes, $info, $path, $result); + } + + $promise = $this->getPromise($completed); + if ($promise !== null) { + return $promise->then(null, function ($error) use ($fieldNodes, $path, $returnType) : void { + $this->handleFieldError($error, $fieldNodes, $path, $returnType); + }); + } + + return $completed; + } catch (Throwable $err) { + $this->handleFieldError($err, $fieldNodes, $path, $returnType); + + return null; + } + } + + /** + * @param mixed $rawError + * @param array $path + * + * @throws Error + */ + protected function handleFieldError($rawError, ArrayObject $fieldNodes, array $path, Type $returnType) : void + { + $error = Error::createLocatedError( + $rawError, + $fieldNodes, + $path + ); + + // If the field type is non-nullable, then it is resolved without any + // protection from errors, however it still properly locates the error. + if ($returnType instanceof NonNull) { + throw $error; + } + // Otherwise, error protection is applied, logging the error and resolving + // a null value for this field if one is encountered. + $this->exeContext->addError($error); + } + + /** + * Implements the instructions for completeValue as defined in the + * "Field entries" section of the spec. + * + * If the field type is Non-Null, then this recursively completes the value + * for the inner type. It throws a field error if that completion returns null, + * as per the "Nullability" section of the spec. + * + * If the field type is a List, then this recursively completes the value + * for the inner type on each item in the list. + * + * If the field type is a Scalar or Enum, ensures the completed value is a legal + * value of the type by calling the `serialize` method of GraphQL type + * definition. + * + * If the field is an abstract type, determine the runtime type of the value + * and then complete based on that type + * + * Otherwise, the field type expects a sub-selection set, and will complete the + * value by evaluating all sub-selections. + * + * @param array $path + * @param mixed $result + * + * @return array|mixed|Promise|null + * + * @throws Error + * @throws Throwable + */ + protected function completeValue( + Type $returnType, + ArrayObject $fieldNodes, + ResolveInfo $info, + array $path, + &$result + ) { + // If result is an Error, throw a located error. + if ($result instanceof Throwable) { + throw $result; + } + + // If field type is NonNull, complete for inner type, and throw field error + // if result is null. + if ($returnType instanceof NonNull) { + $completed = $this->completeValue( + $returnType->getWrappedType(), + $fieldNodes, + $info, + $path, + $result + ); + if ($completed === null) { + throw new InvariantViolation( + sprintf('Cannot return null for non-nullable field "%s.%s".', $info->parentType, $info->fieldName) + ); + } + + return $completed; + } + // If result is null-like, return null. + if ($result === null) { + return null; + } + // If field type is List, complete each item in the list with the inner type + if ($returnType instanceof ListOfType) { + return $this->completeListValue($returnType, $fieldNodes, $info, $path, $result); + } + // Account for invalid schema definition when typeLoader returns different + // instance than `resolveType` or $field->getType() or $arg->getType() + if ($returnType !== $this->exeContext->schema->getType($returnType->name)) { + $hint = ''; + if ($this->exeContext->schema->getConfig()->typeLoader !== null) { + $hint = sprintf( + 'Make sure that type loader returns the same instance as defined in %s.%s', + $info->parentType, + $info->fieldName + ); + } + throw new InvariantViolation( + sprintf( + 'Schema must contain unique named types but contains multiple types named "%s". %s ' . + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', + $returnType, + $hint + ) + ); + } + // If field type is Scalar or Enum, serialize to a valid value, returning + // null if serialization is not possible. + if ($returnType instanceof LeafType) { + return $this->completeLeafValue($returnType, $result); + } + if ($returnType instanceof AbstractType) { + return $this->completeAbstractValue($returnType, $fieldNodes, $info, $path, $result); + } + // Field type must be Object, Interface or Union and expect sub-selections. + if ($returnType instanceof ObjectType) { + return $this->completeObjectValue($returnType, $fieldNodes, $info, $path, $result); + } + throw new RuntimeException(sprintf('Cannot complete value of unexpected type "%s".', $returnType)); + } + + /** + * @param mixed $value + */ + protected function isPromise($value) : bool + { + return $value instanceof Promise || $this->exeContext->promiseAdapter->isThenable($value); + } + + /** + * Only returns the value if it acts like a Promise, i.e. has a "then" function, + * otherwise returns null. + * + * @param mixed $value + */ + protected function getPromise($value) : ?Promise + { + if ($value === null || $value instanceof Promise) { + return $value; + } + if ($this->exeContext->promiseAdapter->isThenable($value)) { + $promise = $this->exeContext->promiseAdapter->convertThenable($value); + if (! $promise instanceof Promise) { + throw new InvariantViolation(sprintf( + '%s::convertThenable is expected to return instance of GraphQL\Executor\Promise\Promise, got: %s', + get_class($this->exeContext->promiseAdapter), + Utils::printSafe($promise) + )); + } + + return $promise; + } + + return null; + } + + /** + * Similar to array_reduce(), however the reducing callback may return + * a Promise, in which case reduction will continue after each promise resolves. + * + * If the callback does not return a Promise, then this function will also not + * return a Promise. + * + * @param array $values + * @param Promise|mixed|null $initialValue + * + * @return Promise|mixed|null + */ + protected function promiseReduce(array $values, callable $callback, $initialValue) + { + return array_reduce( + $values, + function ($previous, $value) use ($callback) { + $promise = $this->getPromise($previous); + if ($promise !== null) { + return $promise->then(static function ($resolved) use ($callback, $value) { + return $callback($resolved, $value); + }); + } + + return $callback($previous, $value); + }, + $initialValue + ); + } + + /** + * Complete a list value by completing each item in the list with the inner type. + * + * @param array $path + * @param array|Traversable $results + * + * @return array|Promise|stdClass + * + * @throws Exception + */ + protected function completeListValue(ListOfType $returnType, ArrayObject $fieldNodes, ResolveInfo $info, array $path, &$results) + { + $itemType = $returnType->getWrappedType(); + Utils::invariant( + is_array($results) || $results instanceof Traversable, + 'User Error: expected iterable, but did not find one for field ' . $info->parentType . '.' . $info->fieldName . '.' + ); + $containsPromise = false; + $i = 0; + $completedItems = []; + foreach ($results as $item) { + $fieldPath = $path; + $fieldPath[] = $i++; + $info->path = $fieldPath; + $completedItem = $this->completeValueCatchingError($itemType, $fieldNodes, $info, $fieldPath, $item); + if (! $containsPromise && $this->getPromise($completedItem) !== null) { + $containsPromise = true; + } + $completedItems[] = $completedItem; + } + + return $containsPromise + ? $this->exeContext->promiseAdapter->all($completedItems) + : $completedItems; + } + + /** + * Complete a Scalar or Enum by serializing to a valid value, throwing if serialization is not possible. + * + * @param mixed $result + * + * @return mixed + * + * @throws Exception + */ + protected function completeLeafValue(LeafType $returnType, &$result) + { + try { + return $returnType->serialize($result); + } catch (Throwable $error) { + throw new InvariantViolation( + 'Expected a value of type "' . Utils::printSafe($returnType) . '" but received: ' . Utils::printSafe($result), + 0, + $error + ); + } + } + + /** + * Complete a value of an abstract type by determining the runtime object type + * of that value, then complete the value for that type. + * + * @param array $path + * @param array $result + * + * @return array|Promise|stdClass + * + * @throws Error + */ + protected function completeAbstractValue( + AbstractType $returnType, + ArrayObject $fieldNodes, + ResolveInfo $info, + array $path, + &$result + ) { + $exeContext = $this->exeContext; + $typeCandidate = $returnType->resolveType($result, $exeContext->contextValue, $info); + + if ($typeCandidate === null) { + $runtimeType = static::defaultTypeResolver($result, $exeContext->contextValue, $info, $returnType); + } elseif (is_callable($typeCandidate)) { + $runtimeType = Schema::resolveType($typeCandidate); + } else { + $runtimeType = $typeCandidate; + } + $promise = $this->getPromise($runtimeType); + if ($promise !== null) { + return $promise->then(function ($resolvedRuntimeType) use ( + $returnType, + $fieldNodes, + $info, + $path, + &$result + ) { + return $this->completeObjectValue( + $this->ensureValidRuntimeType( + $resolvedRuntimeType, + $returnType, + $info, + $result + ), + $fieldNodes, + $info, + $path, + $result + ); + }); + } + + return $this->completeObjectValue( + $this->ensureValidRuntimeType( + $runtimeType, + $returnType, + $info, + $result + ), + $fieldNodes, + $info, + $path, + $result + ); + } + + /** + * If a resolveType function is not given, then a default resolve behavior is + * used which attempts two strategies: + * + * First, See if the provided value has a `__typename` field defined, if so, use + * that value as name of the resolved type. + * + * Otherwise, test each possible type for the abstract type by calling + * isTypeOf for the object being coerced, returning the first type that matches. + * + * @param mixed|null $value + * @param mixed|null $contextValue + * @param InterfaceType|UnionType $abstractType + * + * @return Promise|Type|string|null + */ + protected function defaultTypeResolver($value, $contextValue, ResolveInfo $info, AbstractType $abstractType) + { + // First, look for `__typename`. + if ($value !== null && + (is_array($value) || $value instanceof ArrayAccess) && + isset($value['__typename']) && + is_string($value['__typename']) + ) { + return $value['__typename']; + } + + if ($abstractType instanceof InterfaceType && $info->schema->getConfig()->typeLoader !== null) { + Warning::warnOnce( + sprintf( + 'GraphQL Interface Type `%s` returned `null` from its `resolveType` function ' . + 'for value: %s. Switching to slow resolution method using `isTypeOf` ' . + 'of all possible implementations. It requires full schema scan and degrades query performance significantly. ' . + ' Make sure your `resolveType` always returns valid implementation or throws.', + $abstractType->name, + Utils::printSafe($value) + ), + Warning::WARNING_FULL_SCHEMA_SCAN + ); + } + // Otherwise, test each possible type. + $possibleTypes = $info->schema->getPossibleTypes($abstractType); + $promisedIsTypeOfResults = []; + foreach ($possibleTypes as $index => $type) { + $isTypeOfResult = $type->isTypeOf($value, $contextValue, $info); + if ($isTypeOfResult === null) { + continue; + } + $promise = $this->getPromise($isTypeOfResult); + if ($promise !== null) { + $promisedIsTypeOfResults[$index] = $promise; + } elseif ($isTypeOfResult) { + return $type; + } + } + if (count($promisedIsTypeOfResults) > 0) { + return $this->exeContext->promiseAdapter->all($promisedIsTypeOfResults) + ->then(static function ($isTypeOfResults) use ($possibleTypes) : ?ObjectType { + foreach ($isTypeOfResults as $index => $result) { + if ($result) { + return $possibleTypes[$index]; + } + } + + return null; + }); + } + + return null; + } + + /** + * Complete an Object value by executing all sub-selections. + * + * @param array $path + * @param mixed $result + * + * @return array|Promise|stdClass + * + * @throws Error + */ + protected function completeObjectValue( + ObjectType $returnType, + ArrayObject $fieldNodes, + ResolveInfo $info, + array $path, + &$result + ) { + // If there is an isTypeOf predicate function, call it with the + // current result. If isTypeOf returns false, then raise an error rather + // than continuing execution. + $isTypeOf = $returnType->isTypeOf($result, $this->exeContext->contextValue, $info); + if ($isTypeOf !== null) { + $promise = $this->getPromise($isTypeOf); + if ($promise !== null) { + return $promise->then(function ($isTypeOfResult) use ( + $returnType, + $fieldNodes, + $path, + &$result + ) { + if (! $isTypeOfResult) { + throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes); + } + + return $this->collectAndExecuteSubfields( + $returnType, + $fieldNodes, + $path, + $result + ); + }); + } + if (! $isTypeOf) { + throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes); + } + } + + return $this->collectAndExecuteSubfields( + $returnType, + $fieldNodes, + $path, + $result + ); + } + + /** + * @param array $result + * + * @return Error + */ + protected function invalidReturnTypeError( + ObjectType $returnType, + $result, + ArrayObject $fieldNodes + ) { + return new Error( + 'Expected value of type "' . $returnType->name . '" but got: ' . Utils::printSafe($result) . '.', + $fieldNodes + ); + } + + /** + * @param array $path + * @param mixed $result + * + * @return array|Promise|stdClass + * + * @throws Error + */ + protected function collectAndExecuteSubfields( + ObjectType $returnType, + ArrayObject $fieldNodes, + array $path, + &$result + ) { + $subFieldNodes = $this->collectSubFields($returnType, $fieldNodes); + + return $this->executeFields($returnType, $result, $path, $subFieldNodes); + } + + /** + * A memoized collection of relevant subfields with regard to the return + * type. Memoizing ensures the subfields are not repeatedly calculated, which + * saves overhead when resolving lists of values. + */ + protected function collectSubFields(ObjectType $returnType, ArrayObject $fieldNodes) : ArrayObject + { + if (! isset($this->subFieldCache[$returnType])) { + $this->subFieldCache[$returnType] = new SplObjectStorage(); + } + if (! isset($this->subFieldCache[$returnType][$fieldNodes])) { + // Collect sub-fields to execute to complete this value. + $subFieldNodes = new ArrayObject(); + $visitedFragmentNames = new ArrayObject(); + foreach ($fieldNodes as $fieldNode) { + if (! isset($fieldNode->selectionSet)) { + continue; + } + $subFieldNodes = $this->collectFields( + $returnType, + $fieldNode->selectionSet, + $subFieldNodes, + $visitedFragmentNames + ); + } + $this->subFieldCache[$returnType][$fieldNodes] = $subFieldNodes; + } + + return $this->subFieldCache[$returnType][$fieldNodes]; + } + + /** + * Implements the "Evaluating selection sets" section of the spec + * for "read" mode. + * + * @param mixed $rootValue + * @param array $path + * + * @return Promise|stdClass|array + */ + protected function executeFields(ObjectType $parentType, $rootValue, array $path, ArrayObject $fields) + { + $containsPromise = false; + $results = []; + foreach ($fields as $responseName => $fieldNodes) { + $fieldPath = $path; + $fieldPath[] = $responseName; + $result = $this->resolveField($parentType, $rootValue, $fieldNodes, $fieldPath); + if ($result === static::$UNDEFINED) { + continue; + } + if (! $containsPromise && $this->isPromise($result)) { + $containsPromise = true; + } + $results[$responseName] = $result; + } + // If there are no promises, we can just return the object + if (! $containsPromise) { + return static::fixResultsIfEmptyArray($results); + } + + // Otherwise, results is a map from field name to the result of resolving that + // field, which is possibly a promise. Return a promise that will return this + // same map, but with any promises replaced with the values they resolved to. + return $this->promiseForAssocArray($results); + } + + /** + * Differentiate empty objects from empty lists. + * + * @see https://github.com/webonyx/graphql-php/issues/59 + * + * @param array|mixed $results + * + * @return array|stdClass|mixed + */ + protected static function fixResultsIfEmptyArray($results) + { + if ($results === []) { + return new stdClass(); + } + + return $results; + } + + /** + * Transform an associative array with Promises to a Promise which resolves to an + * associative array where all Promises were resolved. + * + * @param array $assoc + */ + protected function promiseForAssocArray(array $assoc) : Promise + { + $keys = array_keys($assoc); + $valuesAndPromises = array_values($assoc); + $promise = $this->exeContext->promiseAdapter->all($valuesAndPromises); + + return $promise->then(static function ($values) use ($keys) { + $resolvedResults = []; + foreach ($values as $i => $value) { + $resolvedResults[$keys[$i]] = $value; + } + + return static::fixResultsIfEmptyArray($resolvedResults); + }); + } + + /** + * @param string|ObjectType|null $runtimeTypeOrName + * @param InterfaceType|UnionType $returnType + * @param mixed $result + */ + protected function ensureValidRuntimeType( + $runtimeTypeOrName, + AbstractType $returnType, + ResolveInfo $info, + &$result + ) : ObjectType { + $runtimeType = is_string($runtimeTypeOrName) + ? $this->exeContext->schema->getType($runtimeTypeOrName) + : $runtimeTypeOrName; + if (! $runtimeType instanceof ObjectType) { + throw new InvariantViolation( + sprintf( + 'Abstract type %s must resolve to an Object type at ' . + 'runtime for field %s.%s with value "%s", received "%s". ' . + 'Either the %s type should provide a "resolveType" ' . + 'function or each possible type should provide an "isTypeOf" function.', + $returnType, + $info->parentType, + $info->fieldName, + Utils::printSafe($result), + Utils::printSafe($runtimeType), + $returnType + ) + ); + } + if (! $this->exeContext->schema->isSubType($returnType, $runtimeType)) { + throw new InvariantViolation( + sprintf('Runtime Object type "%s" is not a possible type for "%s".', $runtimeType, $returnType) + ); + } + if ($runtimeType !== $this->exeContext->schema->getType($runtimeType->name)) { + throw new InvariantViolation( + sprintf( + 'Schema must contain unique named types but contains multiple types named "%s". ' . + 'Make sure that `resolveType` function of abstract type "%s" returns the same ' . + 'type instance as referenced anywhere else within the schema ' . + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', + $runtimeType, + $returnType + ) + ); + } + + return $runtimeType; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Values.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Values.php new file mode 100644 index 00000000..3e6168a5 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Values.php @@ -0,0 +1,334 @@ +variable->name->value; + /** @var InputType|Type $varType */ + $varType = TypeInfo::typeFromAST($schema, $varDefNode->type); + + if (! Type::isInputType($varType)) { + // Must use input types for variables. This should be caught during + // validation, however is checked again here for safety. + $errors[] = new Error( + sprintf( + 'Variable "$%s" expected value of type "%s" which cannot be used as an input type.', + $varName, + Printer::doPrint($varDefNode->type) + ), + [$varDefNode->type] + ); + } else { + $hasValue = array_key_exists($varName, $inputs); + $value = $hasValue ? $inputs[$varName] : Utils::undefined(); + + if (! $hasValue && ($varDefNode->defaultValue !== null)) { + // If no value was provided to a variable with a default value, + // use the default value. + $coercedValues[$varName] = AST::valueFromAST($varDefNode->defaultValue, $varType); + } elseif ((! $hasValue || $value === null) && ($varType instanceof NonNull)) { + // If no value or a nullish value was provided to a variable with a + // non-null type (required), produce an error. + $errors[] = new Error( + sprintf( + $hasValue + ? 'Variable "$%s" of non-null type "%s" must not be null.' + : 'Variable "$%s" of required type "%s" was not provided.', + $varName, + Utils::printSafe($varType) + ), + [$varDefNode] + ); + } elseif ($hasValue) { + if ($value === null) { + // If the explicit value `null` was provided, an entry in the coerced + // values must exist as the value `null`. + $coercedValues[$varName] = null; + } else { + // Otherwise, a non-null value was provided, coerce it to the expected + // type or report an error if coercion fails. + $coerced = Value::coerceValue($value, $varType, $varDefNode); + /** @var Error[] $coercionErrors */ + $coercionErrors = $coerced['errors']; + if (count($coercionErrors ?? []) > 0) { + $messagePrelude = sprintf( + 'Variable "$%s" got invalid value %s; ', + $varName, + Utils::printSafeJson($value) + ); + + foreach ($coercionErrors as $error) { + $errors[] = new Error( + $messagePrelude . $error->getMessage(), + $error->getNodes(), + $error->getSource(), + $error->getPositions(), + $error->getPath(), + $error->getPrevious(), + $error->getExtensions() + ); + } + } else { + $coercedValues[$varName] = $coerced['value']; + } + } + } + } + } + + if (count($errors) > 0) { + return [$errors, null]; + } + + return [null, $coercedValues]; + } + + /** + * Prepares an object map of argument values given a directive definition + * and a AST node which may contain directives. Optionally also accepts a map + * of variable values. + * + * If the directive does not exist on the node, returns undefined. + * + * @param FragmentSpreadNode|FieldNode|InlineFragmentNode|EnumValueDefinitionNode|FieldDefinitionNode $node + * @param mixed[]|null $variableValues + * + * @return mixed[]|null + */ + public static function getDirectiveValues(Directive $directiveDef, $node, $variableValues = null) + { + if (isset($node->directives) && $node->directives instanceof NodeList) { + $directiveNode = Utils::find( + $node->directives, + static function (DirectiveNode $directive) use ($directiveDef) : bool { + return $directive->name->value === $directiveDef->name; + } + ); + + if ($directiveNode !== null) { + return self::getArgumentValues($directiveDef, $directiveNode, $variableValues); + } + } + + return null; + } + + /** + * Prepares an object map of argument values given a list of argument + * definitions and list of argument AST nodes. + * + * @param FieldDefinition|Directive $def + * @param FieldNode|DirectiveNode $node + * @param mixed[] $variableValues + * + * @return mixed[] + * + * @throws Error + */ + public static function getArgumentValues($def, $node, $variableValues = null) + { + if (count($def->args) === 0) { + return []; + } + + $argumentNodes = $node->arguments ?? []; + $argumentValueMap = []; + foreach ($argumentNodes as $argumentNode) { + $argumentValueMap[$argumentNode->name->value] = $argumentNode->value; + } + + return static::getArgumentValuesForMap($def, $argumentValueMap, $variableValues, $node); + } + + /** + * @param FieldDefinition|Directive $fieldDefinition + * @param ArgumentNode[] $argumentValueMap + * @param mixed[] $variableValues + * @param Node|null $referenceNode + * + * @return mixed[] + * + * @throws Error + */ + public static function getArgumentValuesForMap($fieldDefinition, $argumentValueMap, $variableValues = null, $referenceNode = null) + { + $argumentDefinitions = $fieldDefinition->args; + $coercedValues = []; + + foreach ($argumentDefinitions as $argumentDefinition) { + $name = $argumentDefinition->name; + $argType = $argumentDefinition->getType(); + $argumentValueNode = $argumentValueMap[$name] ?? null; + + if ($argumentValueNode instanceof VariableNode) { + $variableName = $argumentValueNode->name->value; + $hasValue = array_key_exists($variableName, $variableValues ?? []); + $isNull = $hasValue ? $variableValues[$variableName] === null : false; + } else { + $hasValue = $argumentValueNode !== null; + $isNull = $argumentValueNode instanceof NullValueNode; + } + + if (! $hasValue && $argumentDefinition->defaultValueExists()) { + // If no argument was provided where the definition has a default value, + // use the default value. + $coercedValues[$name] = $argumentDefinition->defaultValue; + } elseif ((! $hasValue || $isNull) && ($argType instanceof NonNull)) { + // If no argument or a null value was provided to an argument with a + // non-null type (required), produce a field error. + if ($isNull) { + throw new Error( + 'Argument "' . $name . '" of non-null type ' . + '"' . Utils::printSafe($argType) . '" must not be null.', + $referenceNode + ); + } + + if ($argumentValueNode instanceof VariableNode) { + $variableName = $argumentValueNode->name->value; + throw new Error( + 'Argument "' . $name . '" of required type "' . Utils::printSafe($argType) . '" was ' . + 'provided the variable "$' . $variableName . '" which was not provided ' . + 'a runtime value.', + [$argumentValueNode] + ); + } + + throw new Error( + 'Argument "' . $name . '" of required type ' . + '"' . Utils::printSafe($argType) . '" was not provided.', + $referenceNode + ); + } elseif ($hasValue) { + if ($argumentValueNode instanceof NullValueNode) { + // If the explicit value `null` was provided, an entry in the coerced + // values must exist as the value `null`. + $coercedValues[$name] = null; + } elseif ($argumentValueNode instanceof VariableNode) { + $variableName = $argumentValueNode->name->value; + Utils::invariant($variableValues !== null, 'Must exist for hasValue to be true.'); + // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + $coercedValues[$name] = $variableValues[$variableName] ?? null; + } else { + $valueNode = $argumentValueNode; + $coercedValue = AST::valueFromAST($valueNode, $argType, $variableValues); + if (Utils::isInvalid($coercedValue)) { + // Note: ValuesOfCorrectType validation should catch this before + // execution. This is a runtime check to ensure execution does not + // continue with an invalid argument value. + throw new Error( + 'Argument "' . $name . '" has invalid value ' . Printer::doPrint($valueNode) . '.', + [$argumentValueNode] + ); + } + $coercedValues[$name] = $coercedValue; + } + } + } + + return $coercedValues; + } + + /** + * @deprecated as of 8.0 (Moved to \GraphQL\Utils\AST::valueFromAST) + * + * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $valueNode + * @param ScalarType|EnumType|InputObjectType|ListOfType|NonNull $type + * @param mixed[]|null $variables + * + * @return mixed[]|stdClass|null + * + * @codeCoverageIgnore + */ + public static function valueFromAST(ValueNode $valueNode, InputType $type, ?array $variables = null) + { + return AST::valueFromAST($valueNode, $type, $variables); + } + + /** + * @deprecated as of 0.12 (Use coerceValue() directly for richer information) + * + * @param mixed[] $value + * @param ScalarType|EnumType|InputObjectType|ListOfType|NonNull $type + * + * @return string[] + * + * @codeCoverageIgnore + */ + public static function isValidPHPValue($value, InputType $type) + { + $errors = Value::coerceValue($value, $type)['errors']; + + return $errors + ? array_map( + static function (Throwable $error) : string { + return $error->getMessage(); + }, + $errors + ) + : []; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Collector.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Collector.php new file mode 100644 index 00000000..dc1b49f7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Collector.php @@ -0,0 +1,282 @@ + */ + private $visitedFragments; + + public function __construct(Schema $schema, Runtime $runtime) + { + $this->schema = $schema; + $this->runtime = $runtime; + } + + public function initialize(DocumentNode $documentNode, ?string $operationName = null) + { + $hasMultipleAssumedOperations = false; + + foreach ($documentNode->definitions as $definitionNode) { + /** @var DefinitionNode|Node $definitionNode */ + + if ($definitionNode instanceof OperationDefinitionNode) { + if ($operationName === null && $this->operation !== null) { + $hasMultipleAssumedOperations = true; + } + if ($operationName === null || + (isset($definitionNode->name) && $definitionNode->name->value === $operationName) + ) { + $this->operation = $definitionNode; + } + } elseif ($definitionNode instanceof FragmentDefinitionNode) { + $this->fragments[$definitionNode->name->value] = $definitionNode; + } + } + + if ($this->operation === null) { + if ($operationName !== null) { + $this->runtime->addError(new Error(sprintf('Unknown operation named "%s".', $operationName))); + } else { + $this->runtime->addError(new Error('Must provide an operation.')); + } + + return; + } + + if ($hasMultipleAssumedOperations) { + $this->runtime->addError(new Error('Must provide operation name if query contains multiple operations.')); + + return; + } + + if ($this->operation->operation === 'query') { + $this->rootType = $this->schema->getQueryType(); + } elseif ($this->operation->operation === 'mutation') { + $this->rootType = $this->schema->getMutationType(); + } elseif ($this->operation->operation === 'subscription') { + $this->rootType = $this->schema->getSubscriptionType(); + } else { + $this->runtime->addError(new Error(sprintf('Cannot initialize collector with operation type "%s".', $this->operation->operation))); + } + } + + /** + * @return Generator + */ + public function collectFields(ObjectType $runtimeType, ?SelectionSetNode $selectionSet) + { + $this->fields = []; + $this->visitedFragments = []; + + $this->doCollectFields($runtimeType, $selectionSet); + + foreach ($this->fields as $resultName => $fieldNodes) { + $fieldNode = $fieldNodes[0]; + $fieldName = $fieldNode->name->value; + + $argumentValueMap = null; + if (count($fieldNode->arguments) > 0) { + foreach ($fieldNode->arguments as $argumentNode) { + $argumentValueMap = $argumentValueMap ?? []; + $argumentValueMap[$argumentNode->name->value] = $argumentNode->value; + } + } + + if ($fieldName !== Introspection::TYPE_NAME_FIELD_NAME && + ! ($runtimeType === $this->schema->getQueryType() && ($fieldName === Introspection::SCHEMA_FIELD_NAME || $fieldName === Introspection::TYPE_FIELD_NAME)) && + ! $runtimeType->hasField($fieldName) + ) { + // do not emit error + continue; + } + + yield new CoroutineContextShared($fieldNodes, $fieldName, $resultName, $argumentValueMap); + } + } + + private function doCollectFields(ObjectType $runtimeType, ?SelectionSetNode $selectionSet) + { + if ($selectionSet === null) { + return; + } + + foreach ($selectionSet->selections as $selection) { + /** @var FieldNode|FragmentSpreadNode|InlineFragmentNode $selection */ + if (count($selection->directives) > 0) { + foreach ($selection->directives as $directiveNode) { + if ($directiveNode->name->value === Directive::SKIP_NAME) { + /** @var VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode|null $condition */ + $condition = null; + foreach ($directiveNode->arguments as $argumentNode) { + if ($argumentNode->name->value === Directive::IF_ARGUMENT_NAME) { + $condition = $argumentNode->value; + break; + } + } + + if ($condition === null) { + $this->runtime->addError(new Error( + sprintf('@%s directive is missing "%s" argument.', Directive::SKIP_NAME, Directive::IF_ARGUMENT_NAME), + $selection + )); + } else { + if ($this->runtime->evaluate($condition, Type::boolean()) === true) { + continue 2; // !!! advances outer loop + } + } + } elseif ($directiveNode->name->value === Directive::INCLUDE_NAME) { + /** @var VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode|null $condition */ + $condition = null; + foreach ($directiveNode->arguments as $argumentNode) { + if ($argumentNode->name->value === Directive::IF_ARGUMENT_NAME) { + $condition = $argumentNode->value; + break; + } + } + + if ($condition === null) { + $this->runtime->addError(new Error( + sprintf('@%s directive is missing "%s" argument.', Directive::INCLUDE_NAME, Directive::IF_ARGUMENT_NAME), + $selection + )); + } else { + if ($this->runtime->evaluate($condition, Type::boolean()) !== true) { + continue 2; // !!! advances outer loop + } + } + } + } + } + + if ($selection instanceof FieldNode) { + $resultName = $selection->alias === null ? $selection->name->value : $selection->alias->value; + + if (! isset($this->fields[$resultName])) { + $this->fields[$resultName] = []; + } + + $this->fields[$resultName][] = $selection; + } elseif ($selection instanceof FragmentSpreadNode) { + $fragmentName = $selection->name->value; + + if (isset($this->visitedFragments[$fragmentName])) { + continue; + } + + if (! isset($this->fragments[$fragmentName])) { + $this->runtime->addError(new Error( + sprintf('Fragment "%s" does not exist.', $fragmentName), + $selection + )); + continue; + } + + $this->visitedFragments[$fragmentName] = true; + + $fragmentDefinition = $this->fragments[$fragmentName]; + $conditionTypeName = $fragmentDefinition->typeCondition->name->value; + + if (! $this->schema->hasType($conditionTypeName)) { + $this->runtime->addError(new Error( + sprintf('Cannot spread fragment "%s", type "%s" does not exist.', $fragmentName, $conditionTypeName), + $selection + )); + continue; + } + + $conditionType = $this->schema->getType($conditionTypeName); + + if ($conditionType instanceof ObjectType) { + if ($runtimeType->name !== $conditionType->name) { + continue; + } + } elseif ($conditionType instanceof AbstractType) { + if (! $this->schema->isSubType($conditionType, $runtimeType)) { + continue; + } + } + + $this->doCollectFields($runtimeType, $fragmentDefinition->selectionSet); + } elseif ($selection instanceof InlineFragmentNode) { + if ($selection->typeCondition !== null) { + $conditionTypeName = $selection->typeCondition->name->value; + + if (! $this->schema->hasType($conditionTypeName)) { + $this->runtime->addError(new Error( + sprintf('Cannot spread inline fragment, type "%s" does not exist.', $conditionTypeName), + $selection + )); + continue; + } + + $conditionType = $this->schema->getType($conditionTypeName); + + if ($conditionType instanceof ObjectType) { + if ($runtimeType->name !== $conditionType->name) { + continue; + } + } elseif ($conditionType instanceof AbstractType) { + if (! $this->schema->isSubType($conditionType, $runtimeType)) { + continue; + } + } + } + + $this->doCollectFields($runtimeType, $selection->selectionSet); + } + } + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php new file mode 100644 index 00000000..d22ec774 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php @@ -0,0 +1,57 @@ +shared = $shared; + $this->type = $type; + $this->value = $value; + $this->result = $result; + $this->path = $path; + $this->nullFence = $nullFence; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php new file mode 100644 index 00000000..bbc54886 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php @@ -0,0 +1,62 @@ +fieldNodes = $fieldNodes; + $this->fieldName = $fieldName; + $this->resultName = $resultName; + $this->argumentValueMap = $argumentValueMap; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php new file mode 100644 index 00000000..74981005 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php @@ -0,0 +1,970 @@ + */ + private $errors; + + /** @var SplQueue */ + private $queue; + + /** @var SplQueue */ + private $schedule; + + /** @var stdClass|null */ + private $rootResult; + + /** @var int|null */ + private $pending; + + /** @var callable */ + private $doResolve; + + public function __construct( + PromiseAdapter $promiseAdapter, + Schema $schema, + DocumentNode $documentNode, + $rootValue, + $contextValue, + $rawVariableValues, + ?string $operationName, + callable $fieldResolver + ) { + if (self::$undefined === null) { + self::$undefined = Utils::undefined(); + } + + $this->errors = []; + $this->queue = new SplQueue(); + $this->schedule = new SplQueue(); + $this->schema = $schema; + $this->fieldResolver = $fieldResolver; + $this->promiseAdapter = $promiseAdapter; + $this->rootValue = $rootValue; + $this->contextValue = $contextValue; + $this->rawVariableValues = $rawVariableValues; + $this->documentNode = $documentNode; + $this->operationName = $operationName; + } + + public static function create( + PromiseAdapter $promiseAdapter, + Schema $schema, + DocumentNode $documentNode, + $rootValue, + $contextValue, + $variableValues, + ?string $operationName, + callable $fieldResolver + ) { + return new static( + $promiseAdapter, + $schema, + $documentNode, + $rootValue, + $contextValue, + $variableValues, + $operationName, + $fieldResolver + ); + } + + private static function resultToArray($value, $emptyObjectAsStdClass = true) + { + if ($value instanceof stdClass) { + $array = (array) $value; + foreach ($array as $propertyName => $propertyValue) { + $array[$propertyName] = self::resultToArray($propertyValue); + } + + if ($emptyObjectAsStdClass && count($array) === 0) { + return new stdClass(); + } + + return $array; + } + + if (is_array($value)) { + $array = []; + foreach ($value as $key => $item) { + $array[$key] = self::resultToArray($item); + } + + return $array; + } + + return $value; + } + + public function doExecute() : Promise + { + $this->rootResult = new stdClass(); + $this->errors = []; + $this->queue = new SplQueue(); + $this->schedule = new SplQueue(); + $this->pending = 0; + + $this->collector = new Collector($this->schema, $this); + $this->collector->initialize($this->documentNode, $this->operationName); + + if (count($this->errors) > 0) { + return $this->promiseAdapter->createFulfilled($this->finishExecute(null, $this->errors)); + } + + [$errors, $coercedVariableValues] = Values::getVariableValues( + $this->schema, + $this->collector->operation->variableDefinitions ?? [], + $this->rawVariableValues ?? [] + ); + + if (count($errors ?? []) > 0) { + return $this->promiseAdapter->createFulfilled($this->finishExecute(null, $errors)); + } + + $this->variableValues = $coercedVariableValues; + + foreach ($this->collector->collectFields($this->collector->rootType, $this->collector->operation->selectionSet) as $shared) { + /** @var CoroutineContextShared $shared */ + + // !!! assign to keep object keys sorted + $this->rootResult->{$shared->resultName} = null; + + $ctx = new CoroutineContext( + $shared, + $this->collector->rootType, + $this->rootValue, + $this->rootResult, + [$shared->resultName] + ); + + $fieldDefinition = $this->findFieldDefinition($ctx); + if (! $fieldDefinition->getType() instanceof NonNull) { + $ctx->nullFence = [$shared->resultName]; + } + + if ($this->collector->operation->operation === 'mutation' && ! $this->queue->isEmpty()) { + $this->schedule->enqueue($ctx); + } else { + $this->queue->enqueue(new Strand($this->spawn($ctx))); + } + } + + $this->run(); + + if ($this->pending > 0) { + return $this->promiseAdapter->create(function (callable $resolve) : void { + $this->doResolve = $resolve; + }); + } + + return $this->promiseAdapter->createFulfilled($this->finishExecute($this->rootResult, $this->errors)); + } + + /** + * @param object|null $value + * @param Error[] $errors + */ + private function finishExecute($value, array $errors) : ExecutionResult + { + $this->rootResult = null; + $this->errors = []; + $this->queue = new SplQueue(); + $this->schedule = new SplQueue(); + $this->pending = null; + $this->collector = null; + $this->variableValues = null; + + if ($value !== null) { + $value = self::resultToArray($value, false); + } + + return new ExecutionResult($value, $errors); + } + + /** + * @internal + * + * @param ScalarType|EnumType|InputObjectType|ListOfType|NonNull $type + */ + public function evaluate(ValueNode $valueNode, InputType $type) + { + return AST::valueFromAST($valueNode, $type, $this->variableValues); + } + + /** + * @internal + */ + public function addError($error) + { + $this->errors[] = $error; + } + + private function run() + { + RUN: + while (! $this->queue->isEmpty()) { + /** @var Strand $strand */ + $strand = $this->queue->dequeue(); + + try { + if ($strand->success !== null) { + RESUME: + + if ($strand->success) { + $strand->current->send($strand->value); + } else { + $strand->current->throw($strand->value); + } + + $strand->success = null; + $strand->value = null; + } + + START: + if ($strand->current->valid()) { + $value = $strand->current->current(); + + if ($value instanceof Generator) { + $strand->stack[$strand->depth++] = $strand->current; + $strand->current = $value; + goto START; + } elseif ($this->isPromise($value)) { + // !!! increment pending before calling ->then() as it may invoke the callback right away + ++$this->pending; + + if (! $value instanceof Promise) { + $value = $this->promiseAdapter->convertThenable($value); + } + + $this->promiseAdapter + ->then( + $value, + function ($value) use ($strand) : void { + $strand->success = true; + $strand->value = $value; + $this->queue->enqueue($strand); + $this->done(); + }, + function (Throwable $throwable) use ($strand) : void { + $strand->success = false; + $strand->value = $throwable; + $this->queue->enqueue($strand); + $this->done(); + } + ); + continue; + } else { + $strand->success = true; + $strand->value = $value; + goto RESUME; + } + } + + $strand->success = true; + $strand->value = $strand->current->getReturn(); + } catch (Throwable $reason) { + $strand->success = false; + $strand->value = $reason; + } + + if ($strand->depth <= 0) { + continue; + } + + $current = &$strand->stack[--$strand->depth]; + $strand->current = $current; + $current = null; + goto RESUME; + } + + if ($this->pending > 0 || $this->schedule->isEmpty()) { + return; + } + + /** @var CoroutineContext $ctx */ + $ctx = $this->schedule->dequeue(); + $this->queue->enqueue(new Strand($this->spawn($ctx))); + goto RUN; + } + + private function done() + { + --$this->pending; + + $this->run(); + + if ($this->pending > 0) { + return; + } + + $doResolve = $this->doResolve; + $doResolve($this->finishExecute($this->rootResult, $this->errors)); + } + + private function spawn(CoroutineContext $ctx) + { + // short-circuit evaluation for __typename + if ($ctx->shared->fieldName === Introspection::TYPE_NAME_FIELD_NAME) { + $ctx->result->{$ctx->shared->resultName} = $ctx->type->name; + + return; + } + + try { + if ($ctx->shared->typeGuard1 === $ctx->type) { + $resolve = $ctx->shared->resolveIfType1; + $ctx->resolveInfo = clone $ctx->shared->resolveInfoIfType1; + $ctx->resolveInfo->path = $ctx->path; + $arguments = $ctx->shared->argumentsIfType1; + $returnType = $ctx->resolveInfo->returnType; + } else { + $fieldDefinition = $this->findFieldDefinition($ctx); + + if ($fieldDefinition->resolveFn !== null) { + $resolve = $fieldDefinition->resolveFn; + } elseif ($ctx->type->resolveFieldFn !== null) { + $resolve = $ctx->type->resolveFieldFn; + } else { + $resolve = $this->fieldResolver; + } + + $returnType = $fieldDefinition->getType(); + + $ctx->resolveInfo = new ResolveInfo( + $fieldDefinition, + $ctx->shared->fieldNodes, + $ctx->type, + $ctx->path, + $this->schema, + $this->collector->fragments, + $this->rootValue, + $this->collector->operation, + $this->variableValues + ); + + $arguments = Values::getArgumentValuesForMap( + $fieldDefinition, + $ctx->shared->argumentValueMap, + $this->variableValues + ); + + // !!! assign only in batch when no exception can be thrown in-between + $ctx->shared->typeGuard1 = $ctx->type; + $ctx->shared->resolveIfType1 = $resolve; + $ctx->shared->argumentsIfType1 = $arguments; + $ctx->shared->resolveInfoIfType1 = $ctx->resolveInfo; + } + + $value = $resolve($ctx->value, $arguments, $this->contextValue, $ctx->resolveInfo); + + if (! $this->completeValueFast($ctx, $returnType, $value, $ctx->path, $returnValue)) { + $returnValue = yield $this->completeValue( + $ctx, + $returnType, + $value, + $ctx->path, + $ctx->nullFence + ); + } + } catch (Throwable $reason) { + $this->addError(Error::createLocatedError( + $reason, + $ctx->shared->fieldNodes, + $ctx->path + )); + + $returnValue = self::$undefined; + } + + if ($returnValue !== self::$undefined) { + $ctx->result->{$ctx->shared->resultName} = $returnValue; + } elseif ($ctx->resolveInfo !== null && $ctx->resolveInfo->returnType instanceof NonNull) { // !!! $ctx->resolveInfo might not have been initialized yet + $result =& $this->rootResult; + foreach ($ctx->nullFence ?? [] as $key) { + if (is_string($key)) { + $result =& $result->{$key}; + } else { + $result =& $result[$key]; + } + } + $result = null; + } + } + + private function findFieldDefinition(CoroutineContext $ctx) + { + if ($ctx->shared->fieldName === Introspection::SCHEMA_FIELD_NAME && $ctx->type === $this->schema->getQueryType()) { + return Introspection::schemaMetaFieldDef(); + } + + if ($ctx->shared->fieldName === Introspection::TYPE_FIELD_NAME && $ctx->type === $this->schema->getQueryType()) { + return Introspection::typeMetaFieldDef(); + } + + if ($ctx->shared->fieldName === Introspection::TYPE_NAME_FIELD_NAME) { + return Introspection::typeNameMetaFieldDef(); + } + + return $ctx->type->getField($ctx->shared->fieldName); + } + + /** + * @param mixed $value + * @param string[] $path + * @param mixed $returnValue + */ + private function completeValueFast(CoroutineContext $ctx, Type $type, $value, array $path, &$returnValue) : bool + { + // special handling of Throwable inherited from JS reference implementation, but makes no sense in this PHP + if ($this->isPromise($value) || $value instanceof Throwable) { + return false; + } + + $nonNull = false; + if ($type instanceof NonNull) { + $nonNull = true; + $type = $type->getWrappedType(); + } + + if (! $type instanceof LeafType) { + return false; + } + + if ($type !== $this->schema->getType($type->name)) { + $hint = ''; + if ($this->schema->getConfig()->typeLoader !== null) { + $hint = sprintf( + 'Make sure that type loader returns the same instance as defined in %s.%s', + $ctx->type, + $ctx->shared->fieldName + ); + } + $this->addError(Error::createLocatedError( + new InvariantViolation( + sprintf( + 'Schema must contain unique named types but contains multiple types named "%s". %s ' . + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', + $type->name, + $hint + ) + ), + $ctx->shared->fieldNodes, + $path + )); + + $value = null; + } + + if ($value === null) { + $returnValue = null; + } else { + try { + $returnValue = $type->serialize($value); + } catch (Throwable $error) { + $this->addError(Error::createLocatedError( + new InvariantViolation( + 'Expected a value of type "' . Utils::printSafe($type) . '" but received: ' . Utils::printSafe($value), + 0, + $error + ), + $ctx->shared->fieldNodes, + $path + )); + $returnValue = null; + } + } + + if ($nonNull && $returnValue === null) { + $this->addError(Error::createLocatedError( + new InvariantViolation(sprintf( + 'Cannot return null for non-nullable field "%s.%s".', + $ctx->type->name, + $ctx->shared->fieldName + )), + $ctx->shared->fieldNodes, + $path + )); + + $returnValue = self::$undefined; + } + + return true; + } + + /** + * @param mixed $value + * @param string[] $path + * @param string[]|null $nullFence + * + * @return mixed + */ + private function completeValue(CoroutineContext $ctx, Type $type, $value, array $path, ?array $nullFence) + { + $nonNull = false; + $returnValue = null; + + if ($type instanceof NonNull) { + $nonNull = true; + $type = $type->getWrappedType(); + } else { + $nullFence = $path; + } + + // !!! $value might be promise, yield to resolve + try { + if ($this->isPromise($value)) { + $value = yield $value; + } + } catch (Throwable $reason) { + $this->addError(Error::createLocatedError( + $reason, + $ctx->shared->fieldNodes, + $path + )); + if ($nonNull) { + $returnValue = self::$undefined; + } else { + $returnValue = null; + } + goto CHECKED_RETURN; + } + + if ($value === null) { + $returnValue = $value; + goto CHECKED_RETURN; + } elseif ($value instanceof Throwable) { + // special handling of Throwable inherited from JS reference implementation, but makes no sense in this PHP + $this->addError(Error::createLocatedError( + $value, + $ctx->shared->fieldNodes, + $path + )); + if ($nonNull) { + $returnValue = self::$undefined; + } else { + $returnValue = null; + } + goto CHECKED_RETURN; + } + + if ($type instanceof ListOfType) { + $returnValue = []; + $index = -1; + $itemType = $type->getWrappedType(); + foreach ($value as $itemValue) { + ++$index; + + $itemPath = $path; + $itemPath[] = $index; // !!! use arrays COW semantics + $ctx->resolveInfo->path = $itemPath; + + try { + if (! $this->completeValueFast($ctx, $itemType, $itemValue, $itemPath, $itemReturnValue)) { + $itemReturnValue = yield $this->completeValue($ctx, $itemType, $itemValue, $itemPath, $nullFence); + } + } catch (Throwable $reason) { + $this->addError(Error::createLocatedError( + $reason, + $ctx->shared->fieldNodes, + $itemPath + )); + $itemReturnValue = null; + } + if ($itemReturnValue === self::$undefined) { + $returnValue = self::$undefined; + goto CHECKED_RETURN; + } + $returnValue[$index] = $itemReturnValue; + } + + goto CHECKED_RETURN; + } else { + if ($type !== $this->schema->getType($type->name)) { + $hint = ''; + if ($this->schema->getConfig()->typeLoader !== null) { + $hint = sprintf( + 'Make sure that type loader returns the same instance as defined in %s.%s', + $ctx->type, + $ctx->shared->fieldName + ); + } + $this->addError(Error::createLocatedError( + new InvariantViolation( + sprintf( + 'Schema must contain unique named types but contains multiple types named "%s". %s ' . + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', + $type->name, + $hint + ) + ), + $ctx->shared->fieldNodes, + $path + )); + + $returnValue = null; + goto CHECKED_RETURN; + } + + if ($type instanceof LeafType) { + try { + $returnValue = $type->serialize($value); + } catch (Throwable $error) { + $this->addError(Error::createLocatedError( + new InvariantViolation( + 'Expected a value of type "' . Utils::printSafe($type) . '" but received: ' . Utils::printSafe($value), + 0, + $error + ), + $ctx->shared->fieldNodes, + $path + )); + $returnValue = null; + } + goto CHECKED_RETURN; + } elseif ($type instanceof CompositeType) { + /** @var ObjectType|null $objectType */ + $objectType = null; + if ($type instanceof InterfaceType || $type instanceof UnionType) { + $objectType = $type->resolveType($value, $this->contextValue, $ctx->resolveInfo); + + if ($objectType === null) { + $objectType = yield $this->resolveTypeSlow($ctx, $value, $type); + } + + // !!! $objectType->resolveType() might return promise, yield to resolve + $objectType = yield $objectType; + if (is_string($objectType)) { + $objectType = $this->schema->getType($objectType); + } + + if ($objectType === null) { + $this->addError(Error::createLocatedError( + sprintf( + 'Composite type "%s" did not resolve concrete object type for value: %s.', + $type->name, + Utils::printSafe($value) + ), + $ctx->shared->fieldNodes, + $path + )); + + $returnValue = self::$undefined; + goto CHECKED_RETURN; + } elseif (! $objectType instanceof ObjectType) { + $this->addError(Error::createLocatedError( + new InvariantViolation(sprintf( + 'Abstract type %s must resolve to an Object type at ' . + 'runtime for field %s.%s with value "%s", received "%s". ' . + 'Either the %s type should provide a "resolveType" ' . + 'function or each possible type should provide an "isTypeOf" function.', + $type, + $ctx->resolveInfo->parentType, + $ctx->resolveInfo->fieldName, + Utils::printSafe($value), + Utils::printSafe($objectType), + $type + )), + $ctx->shared->fieldNodes, + $path + )); + + $returnValue = null; + goto CHECKED_RETURN; + } elseif (! $this->schema->isSubType($type, $objectType)) { + $this->addError(Error::createLocatedError( + new InvariantViolation(sprintf( + 'Runtime Object type "%s" is not a possible type for "%s".', + $objectType, + $type + )), + $ctx->shared->fieldNodes, + $path + )); + + $returnValue = null; + goto CHECKED_RETURN; + } elseif ($objectType !== $this->schema->getType($objectType->name)) { + $this->addError(Error::createLocatedError( + new InvariantViolation( + sprintf( + 'Schema must contain unique named types but contains multiple types named "%s". ' . + 'Make sure that `resolveType` function of abstract type "%s" returns the same ' . + 'type instance as referenced anywhere else within the schema ' . + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', + $objectType, + $type + ) + ), + $ctx->shared->fieldNodes, + $path + )); + + $returnValue = null; + goto CHECKED_RETURN; + } + } elseif ($type instanceof ObjectType) { + $objectType = $type; + } else { + $this->addError(Error::createLocatedError( + sprintf( + 'Unexpected field type "%s".', + Utils::printSafe($type) + ), + $ctx->shared->fieldNodes, + $path + )); + + $returnValue = self::$undefined; + goto CHECKED_RETURN; + } + + $typeCheck = $objectType->isTypeOf($value, $this->contextValue, $ctx->resolveInfo); + if ($typeCheck !== null) { + // !!! $objectType->isTypeOf() might return promise, yield to resolve + $typeCheck = yield $typeCheck; + if (! $typeCheck) { + $this->addError(Error::createLocatedError( + sprintf('Expected value of type "%s" but got: %s.', $type->name, Utils::printSafe($value)), + $ctx->shared->fieldNodes, + $path + )); + + $returnValue = null; + goto CHECKED_RETURN; + } + } + + $returnValue = new stdClass(); + + if ($ctx->shared->typeGuard2 === $objectType) { + foreach ($ctx->shared->childContextsIfType2 as $childCtx) { + $childCtx = clone $childCtx; + $childCtx->type = $objectType; + $childCtx->value = $value; + $childCtx->result = $returnValue; + $childCtx->path = $path; + $childCtx->path[] = $childCtx->shared->resultName; // !!! uses array COW semantics + $childCtx->nullFence = $nullFence; + $childCtx->resolveInfo = null; + + $this->queue->enqueue(new Strand($this->spawn($childCtx))); + + // !!! assign null to keep object keys sorted + $returnValue->{$childCtx->shared->resultName} = null; + } + } else { + $childContexts = []; + + $fields = []; + if ($this->collector !== null) { + $fields = $this->collector->collectFields( + $objectType, + $ctx->shared->mergedSelectionSet ?? $this->mergeSelectionSets($ctx) + ); + } + + /** @var CoroutineContextShared $childShared */ + foreach ($fields as $childShared) { + $childPath = $path; + $childPath[] = $childShared->resultName; // !!! uses array COW semantics + $childCtx = new CoroutineContext( + $childShared, + $objectType, + $value, + $returnValue, + $childPath, + $nullFence + ); + + $childContexts[] = $childCtx; + + $this->queue->enqueue(new Strand($this->spawn($childCtx))); + + // !!! assign null to keep object keys sorted + $returnValue->{$childShared->resultName} = null; + } + + $ctx->shared->typeGuard2 = $objectType; + $ctx->shared->childContextsIfType2 = $childContexts; + } + + goto CHECKED_RETURN; + } else { + $this->addError(Error::createLocatedError( + sprintf('Unhandled type "%s".', Utils::printSafe($type)), + $ctx->shared->fieldNodes, + $path + )); + + $returnValue = null; + goto CHECKED_RETURN; + } + } + + CHECKED_RETURN: + if ($nonNull && $returnValue === null) { + $this->addError(Error::createLocatedError( + new InvariantViolation(sprintf( + 'Cannot return null for non-nullable field "%s.%s".', + $ctx->type->name, + $ctx->shared->fieldName + )), + $ctx->shared->fieldNodes, + $path + )); + + return self::$undefined; + } + + return $returnValue; + } + + private function mergeSelectionSets(CoroutineContext $ctx) + { + $selections = []; + + foreach ($ctx->shared->fieldNodes as $fieldNode) { + if ($fieldNode->selectionSet === null) { + continue; + } + + foreach ($fieldNode->selectionSet->selections as $selection) { + $selections[] = $selection; + } + } + + return $ctx->shared->mergedSelectionSet = new SelectionSetNode(['selections' => $selections]); + } + + /** + * @param InterfaceType|UnionType $abstractType + * + * @return Generator|ObjectType|Type|null + */ + private function resolveTypeSlow(CoroutineContext $ctx, $value, AbstractType $abstractType) + { + if ($value !== null && + is_array($value) && + isset($value['__typename']) && + is_string($value['__typename']) + ) { + return $this->schema->getType($value['__typename']); + } + + if ($abstractType instanceof InterfaceType && $this->schema->getConfig()->typeLoader !== null) { + Warning::warnOnce( + sprintf( + 'GraphQL Interface Type `%s` returned `null` from its `resolveType` function ' . + 'for value: %s. Switching to slow resolution method using `isTypeOf` ' . + 'of all possible implementations. It requires full schema scan and degrades query performance significantly. ' . + ' Make sure your `resolveType` always returns valid implementation or throws.', + $abstractType->name, + Utils::printSafe($value) + ), + Warning::WARNING_FULL_SCHEMA_SCAN + ); + } + + $possibleTypes = $this->schema->getPossibleTypes($abstractType); + + // to be backward-compatible with old executor, ->isTypeOf() is called for all possible types, + // it cannot short-circuit when the match is found + + $selectedType = null; + foreach ($possibleTypes as $type) { + $typeCheck = yield $type->isTypeOf($value, $this->contextValue, $ctx->resolveInfo); + if ($selectedType !== null || ! $typeCheck) { + continue; + } + + $selectedType = $type; + } + + return $selectedType; + } + + /** + * @param mixed $value + * + * @return bool + */ + private function isPromise($value) + { + return $value instanceof Promise || $this->promiseAdapter->isThenable($value); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Runtime.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Runtime.php new file mode 100644 index 00000000..a5c8fa6d --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Runtime.php @@ -0,0 +1,26 @@ +current = $coroutine; + $this->stack = []; + $this->depth = 0; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/GraphQL.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/GraphQL.php new file mode 100644 index 00000000..8f5291c6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/GraphQL.php @@ -0,0 +1,365 @@ +wait($promise); + } + + /** + * Same as executeQuery(), but requires PromiseAdapter and always returns a Promise. + * Useful for Async PHP platforms. + * + * @param string|DocumentNode $source + * @param mixed $rootValue + * @param mixed $context + * @param mixed[]|null $variableValues + * @param ValidationRule[]|null $validationRules + * + * @api + */ + public static function promiseToExecute( + PromiseAdapter $promiseAdapter, + SchemaType $schema, + $source, + $rootValue = null, + $context = null, + $variableValues = null, + ?string $operationName = null, + ?callable $fieldResolver = null, + ?array $validationRules = null + ) : Promise { + try { + if ($source instanceof DocumentNode) { + $documentNode = $source; + } else { + $documentNode = Parser::parse(new Source($source ?? '', 'GraphQL')); + } + + // FIXME + if (count($validationRules ?? []) === 0) { + /** @var QueryComplexity $queryComplexity */ + $queryComplexity = DocumentValidator::getRule(QueryComplexity::class); + $queryComplexity->setRawVariableValues($variableValues); + } else { + foreach ($validationRules as $rule) { + if (! ($rule instanceof QueryComplexity)) { + continue; + } + + $rule->setRawVariableValues($variableValues); + } + } + + $validationErrors = DocumentValidator::validate($schema, $documentNode, $validationRules); + + if (count($validationErrors) > 0) { + return $promiseAdapter->createFulfilled( + new ExecutionResult(null, $validationErrors) + ); + } + + return Executor::promiseToExecute( + $promiseAdapter, + $schema, + $documentNode, + $rootValue, + $context, + $variableValues, + $operationName, + $fieldResolver + ); + } catch (Error $e) { + return $promiseAdapter->createFulfilled( + new ExecutionResult(null, [$e]) + ); + } + } + + /** + * @deprecated Use executeQuery()->toArray() instead + * + * @param string|DocumentNode $source + * @param mixed $rootValue + * @param mixed $contextValue + * @param mixed[]|null $variableValues + * + * @return Promise|mixed[] + * + * @codeCoverageIgnore + */ + public static function execute( + SchemaType $schema, + $source, + $rootValue = null, + $contextValue = null, + $variableValues = null, + ?string $operationName = null + ) { + trigger_error( + __METHOD__ . ' is deprecated, use GraphQL::executeQuery()->toArray() as a quick replacement', + E_USER_DEPRECATED + ); + + $promiseAdapter = Executor::getPromiseAdapter(); + $result = self::promiseToExecute( + $promiseAdapter, + $schema, + $source, + $rootValue, + $contextValue, + $variableValues, + $operationName + ); + + if ($promiseAdapter instanceof SyncPromiseAdapter) { + $result = $promiseAdapter->wait($result)->toArray(); + } else { + $result = $result->then(static function (ExecutionResult $r) : array { + return $r->toArray(); + }); + } + + return $result; + } + + /** + * @deprecated renamed to executeQuery() + * + * @param string|DocumentNode $source + * @param mixed $rootValue + * @param mixed $contextValue + * @param mixed[]|null $variableValues + * + * @return ExecutionResult|Promise + * + * @codeCoverageIgnore + */ + public static function executeAndReturnResult( + SchemaType $schema, + $source, + $rootValue = null, + $contextValue = null, + $variableValues = null, + ?string $operationName = null + ) { + trigger_error( + __METHOD__ . ' is deprecated, use GraphQL::executeQuery() as a quick replacement', + E_USER_DEPRECATED + ); + + $promiseAdapter = Executor::getPromiseAdapter(); + $result = self::promiseToExecute( + $promiseAdapter, + $schema, + $source, + $rootValue, + $contextValue, + $variableValues, + $operationName + ); + + if ($promiseAdapter instanceof SyncPromiseAdapter) { + $result = $promiseAdapter->wait($result); + } + + return $result; + } + + /** + * Returns directives defined in GraphQL spec + * + * @return Directive[] + * + * @api + */ + public static function getStandardDirectives() : array + { + return array_values(Directive::getInternalDirectives()); + } + + /** + * Returns types defined in GraphQL spec + * + * @return Type[] + * + * @api + */ + public static function getStandardTypes() : array + { + return array_values(Type::getStandardTypes()); + } + + /** + * Replaces standard types with types from this list (matching by name) + * Standard types not listed here remain untouched. + * + * @param array $types + * + * @api + */ + public static function overrideStandardTypes(array $types) + { + Type::overrideStandardTypes($types); + } + + /** + * Returns standard validation rules implementing GraphQL spec + * + * @return ValidationRule[] + * + * @api + */ + public static function getStandardValidationRules() : array + { + return array_values(DocumentValidator::defaultRules()); + } + + /** + * Set default resolver implementation + * + * @api + */ + public static function setDefaultFieldResolver(callable $fn) : void + { + Executor::setDefaultFieldResolver($fn); + } + + public static function setPromiseAdapter(?PromiseAdapter $promiseAdapter = null) : void + { + Executor::setPromiseAdapter($promiseAdapter); + } + + /** + * Experimental: Switch to the new executor + */ + public static function useExperimentalExecutor() + { + trigger_error( + 'Experimental Executor is deprecated and will be removed in the next major version', + E_USER_DEPRECATED + ); + Executor::setImplementationFactory([CoroutineExecutor::class, 'create']); + } + + /** + * Experimental: Switch back to the default executor + */ + public static function useReferenceExecutor() + { + Executor::setImplementationFactory([ReferenceExecutor::class, 'create']); + } + + /** + * Returns directives defined in GraphQL spec + * + * @deprecated Renamed to getStandardDirectives + * + * @return Directive[] + * + * @codeCoverageIgnore + */ + public static function getInternalDirectives() : array + { + return self::getStandardDirectives(); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php new file mode 100644 index 00000000..0abfb6fd --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php @@ -0,0 +1,17 @@ + */ + public $arguments; + + /** @var bool */ + public $repeatable; + + /** @var NodeList */ + public $locations; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveNode.php new file mode 100644 index 00000000..c75aafb2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveNode.php @@ -0,0 +1,17 @@ + */ + public $arguments; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DocumentNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DocumentNode.php new file mode 100644 index 00000000..986fb261 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DocumentNode.php @@ -0,0 +1,15 @@ + */ + public $definitions; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php new file mode 100644 index 00000000..5d8c208e --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php @@ -0,0 +1,23 @@ + */ + public $directives; + + /** @var NodeList */ + public $values; + + /** @var StringValueNode|null */ + public $description; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php new file mode 100644 index 00000000..2c90fef6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php @@ -0,0 +1,20 @@ + */ + public $directives; + + /** @var NodeList */ + public $values; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php new file mode 100644 index 00000000..0f9aa8d1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php @@ -0,0 +1,20 @@ + */ + public $directives; + + /** @var StringValueNode|null */ + public $description; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueNode.php new file mode 100644 index 00000000..1325bc4c --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueNode.php @@ -0,0 +1,14 @@ + */ + public $arguments; + + /** @var NamedTypeNode|ListTypeNode|NonNullTypeNode */ + public $type; + + /** @var NodeList */ + public $directives; + + /** @var StringValueNode|null */ + public $description; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldNode.php new file mode 100644 index 00000000..174dbd97 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldNode.php @@ -0,0 +1,26 @@ + */ + public $arguments; + + /** @var NodeList */ + public $directives; + + /** @var SelectionSetNode|null */ + public $selectionSet; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FloatValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FloatValueNode.php new file mode 100644 index 00000000..b02f5b45 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FloatValueNode.php @@ -0,0 +1,14 @@ + + */ + public $variableDefinitions; + + /** @var NamedTypeNode */ + public $typeCondition; + + /** @var NodeList */ + public $directives; + + /** @var SelectionSetNode */ + public $selectionSet; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php new file mode 100644 index 00000000..2dc693b2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php @@ -0,0 +1,17 @@ + */ + public $directives; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php new file mode 100644 index 00000000..a412cf7d --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php @@ -0,0 +1,15 @@ + */ + public $directives; + + /** @var SelectionSetNode */ + public $selectionSet; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php new file mode 100644 index 00000000..cc324545 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php @@ -0,0 +1,23 @@ + */ + public $directives; + + /** @var NodeList */ + public $fields; + + /** @var StringValueNode|null */ + public $description; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php new file mode 100644 index 00000000..e470958e --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php @@ -0,0 +1,20 @@ + */ + public $directives; + + /** @var NodeList */ + public $fields; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php new file mode 100644 index 00000000..3e5a4aa5 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php @@ -0,0 +1,26 @@ + */ + public $directives; + + /** @var StringValueNode|null */ + public $description; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php new file mode 100644 index 00000000..3441b7bc --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php @@ -0,0 +1,14 @@ + */ + public $directives; + + /** @var NodeList */ + public $interfaces; + + /** @var NodeList */ + public $fields; + + /** @var StringValueNode|null */ + public $description; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php new file mode 100644 index 00000000..4b30f3da --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php @@ -0,0 +1,23 @@ + */ + public $directives; + + /** @var NodeList */ + public $interfaces; + + /** @var NodeList */ + public $fields; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListTypeNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListTypeNode.php new file mode 100644 index 00000000..6bb3902b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListTypeNode.php @@ -0,0 +1,14 @@ + */ + public $values; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Location.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Location.php new file mode 100644 index 00000000..dfd70b68 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Location.php @@ -0,0 +1,79 @@ +start = $start; + $tmp->end = $end; + + return $tmp; + } + + public function __construct(?Token $startToken = null, ?Token $endToken = null, ?Source $source = null) + { + $this->startToken = $startToken; + $this->endToken = $endToken; + $this->source = $source; + + if ($startToken === null || $endToken === null) { + return; + } + + $this->start = $startToken->start; + $this->end = $endToken->end; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NameNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NameNode.php new file mode 100644 index 00000000..ad911967 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NameNode.php @@ -0,0 +1,14 @@ +cloneValue($this); + } + + /** + * @param string|NodeList|Location|Node|(Node|NodeList|Location)[] $value + * + * @return string|NodeList|Location|Node + */ + private function cloneValue($value) + { + if (is_array($value)) { + $cloned = []; + foreach ($value as $key => $arrValue) { + $cloned[$key] = $this->cloneValue($arrValue); + } + } elseif ($value instanceof self) { + $cloned = clone $value; + foreach (get_object_vars($cloned) as $prop => $propValue) { + $cloned->{$prop} = $this->cloneValue($propValue); + } + } else { + $cloned = $value; + } + + return $cloned; + } + + public function __toString() : string + { + $tmp = $this->toArray(true); + + return (string) json_encode($tmp); + } + + /** + * @return mixed[] + */ + public function toArray(bool $recursive = false) : array + { + if ($recursive) { + return $this->recursiveToArray($this); + } + + $tmp = (array) $this; + + if ($this->loc !== null) { + $tmp['loc'] = [ + 'start' => $this->loc->start, + 'end' => $this->loc->end, + ]; + } + + return $tmp; + } + + /** + * @return mixed[] + */ + private function recursiveToArray(Node $node) + { + $result = [ + 'kind' => $node->kind, + ]; + + if ($node->loc !== null) { + $result['loc'] = [ + 'start' => $node->loc->start, + 'end' => $node->loc->end, + ]; + } + + foreach (get_object_vars($node) as $prop => $propValue) { + if (isset($result[$prop])) { + continue; + } + + if ($propValue === null) { + continue; + } + + if (is_array($propValue) || $propValue instanceof NodeList) { + $tmp = []; + foreach ($propValue as $tmp1) { + $tmp[] = $tmp1 instanceof Node ? $this->recursiveToArray($tmp1) : (array) $tmp1; + } + } elseif ($propValue instanceof Node) { + $tmp = $this->recursiveToArray($propValue); + } elseif (is_scalar($propValue) || $propValue === null) { + $tmp = $propValue; + } else { + $tmp = null; + } + + $result[$prop] = $tmp; + } + + return $result; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeKind.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeKind.php new file mode 100644 index 00000000..7c0f300f --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeKind.php @@ -0,0 +1,138 @@ + NameNode::class, + + // Document + self::DOCUMENT => DocumentNode::class, + self::OPERATION_DEFINITION => OperationDefinitionNode::class, + self::VARIABLE_DEFINITION => VariableDefinitionNode::class, + self::VARIABLE => VariableNode::class, + self::SELECTION_SET => SelectionSetNode::class, + self::FIELD => FieldNode::class, + self::ARGUMENT => ArgumentNode::class, + + // Fragments + self::FRAGMENT_SPREAD => FragmentSpreadNode::class, + self::INLINE_FRAGMENT => InlineFragmentNode::class, + self::FRAGMENT_DEFINITION => FragmentDefinitionNode::class, + + // Values + self::INT => IntValueNode::class, + self::FLOAT => FloatValueNode::class, + self::STRING => StringValueNode::class, + self::BOOLEAN => BooleanValueNode::class, + self::ENUM => EnumValueNode::class, + self::NULL => NullValueNode::class, + self::LST => ListValueNode::class, + self::OBJECT => ObjectValueNode::class, + self::OBJECT_FIELD => ObjectFieldNode::class, + + // Directives + self::DIRECTIVE => DirectiveNode::class, + + // Types + self::NAMED_TYPE => NamedTypeNode::class, + self::LIST_TYPE => ListTypeNode::class, + self::NON_NULL_TYPE => NonNullTypeNode::class, + + // Type System Definitions + self::SCHEMA_DEFINITION => SchemaDefinitionNode::class, + self::OPERATION_TYPE_DEFINITION => OperationTypeDefinitionNode::class, + + // Type Definitions + self::SCALAR_TYPE_DEFINITION => ScalarTypeDefinitionNode::class, + self::OBJECT_TYPE_DEFINITION => ObjectTypeDefinitionNode::class, + self::FIELD_DEFINITION => FieldDefinitionNode::class, + self::INPUT_VALUE_DEFINITION => InputValueDefinitionNode::class, + self::INTERFACE_TYPE_DEFINITION => InterfaceTypeDefinitionNode::class, + self::UNION_TYPE_DEFINITION => UnionTypeDefinitionNode::class, + self::ENUM_TYPE_DEFINITION => EnumTypeDefinitionNode::class, + self::ENUM_VALUE_DEFINITION => EnumValueDefinitionNode::class, + self::INPUT_OBJECT_TYPE_DEFINITION => InputObjectTypeDefinitionNode::class, + + // Type Extensions + self::SCALAR_TYPE_EXTENSION => ScalarTypeExtensionNode::class, + self::OBJECT_TYPE_EXTENSION => ObjectTypeExtensionNode::class, + self::INTERFACE_TYPE_EXTENSION => InterfaceTypeExtensionNode::class, + self::UNION_TYPE_EXTENSION => UnionTypeExtensionNode::class, + self::ENUM_TYPE_EXTENSION => EnumTypeExtensionNode::class, + self::INPUT_OBJECT_TYPE_EXTENSION => InputObjectTypeExtensionNode::class, + + // Directive Definitions + self::DIRECTIVE_DEFINITION => DirectiveDefinitionNode::class, + ]; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeList.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeList.php new file mode 100644 index 00000000..9423791f --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeList.php @@ -0,0 +1,154 @@ + + * @phpstan-implements IteratorAggregate + */ +class NodeList implements ArrayAccess, IteratorAggregate, Countable +{ + /** + * @var Node[] + * @phpstan-var array + */ + private $nodes; + + /** + * @param Node[] $nodes + * + * @phpstan-param array $nodes + * @phpstan-return self + */ + public static function create(array $nodes) : self + { + return new static($nodes); + } + + /** + * @param Node[] $nodes + * + * @phpstan-param array $nodes + */ + public function __construct(array $nodes) + { + $this->nodes = $nodes; + } + + /** + * @param int|string $offset + */ + public function offsetExists($offset) : bool + { + return isset($this->nodes[$offset]); + } + + /** + * TODO enable strict typing by changing how the Visitor deals with NodeList. + * Ideally, this function should always return a Node instance. + * However, the Visitor currently allows mutation of the NodeList + * and puts arbitrary values in the NodeList, such as strings. + * We will have to switch to using an array or a less strict + * type instead so we can enable strict typing in this class. + * + * @param int|string $offset + * + * @phpstan-return T + */ + #[ReturnTypeWillChange] + public function offsetGet($offset)// : Node + { + $item = $this->nodes[$offset]; + + if (is_array($item) && isset($item['kind'])) { + /** @phpstan-var T $node */ + $node = AST::fromArray($item); + $this->nodes[$offset] = $node; + } + + return $this->nodes[$offset]; + } + + /** + * @param int|string|null $offset + * @param Node|mixed[] $value + * + * @phpstan-param T|mixed[] $value + */ + public function offsetSet($offset, $value) : void + { + if (is_array($value)) { + /** @phpstan-var T $value */ + $value = AST::fromArray($value); + } + + // Happens when a Node is pushed via []= + if ($offset === null) { + $this->nodes[] = $value; + + return; + } + + $this->nodes[$offset] = $value; + } + + /** + * @param int|string $offset + */ + public function offsetUnset($offset) : void + { + unset($this->nodes[$offset]); + } + + /** + * @param mixed $replacement + * + * @phpstan-return NodeList + */ + public function splice(int $offset, int $length, $replacement = null) : NodeList + { + return new NodeList(array_splice($this->nodes, $offset, $length, $replacement)); + } + + /** + * @param NodeList|Node[] $list + * + * @phpstan-param NodeList|array $list + * @phpstan-return NodeList + */ + public function merge($list) : NodeList + { + if ($list instanceof self) { + $list = $list->nodes; + } + + return new NodeList(array_merge($this->nodes, $list)); + } + + public function getIterator() : Traversable + { + foreach ($this->nodes as $key => $_) { + yield $this->offsetGet($key); + } + } + + public function count() : int + { + return count($this->nodes); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php new file mode 100644 index 00000000..18dc70e4 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php @@ -0,0 +1,14 @@ + */ + public $interfaces; + + /** @var NodeList */ + public $directives; + + /** @var NodeList */ + public $fields; + + /** @var StringValueNode|null */ + public $description; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php new file mode 100644 index 00000000..b1375238 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php @@ -0,0 +1,23 @@ + */ + public $interfaces; + + /** @var NodeList */ + public $directives; + + /** @var NodeList */ + public $fields; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php new file mode 100644 index 00000000..f83d74af --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php @@ -0,0 +1,14 @@ + */ + public $fields; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php new file mode 100644 index 00000000..189d606f --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php @@ -0,0 +1,27 @@ + */ + public $variableDefinitions; + + /** @var NodeList */ + public $directives; + + /** @var SelectionSetNode */ + public $selectionSet; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php new file mode 100644 index 00000000..9ad8d25c --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php @@ -0,0 +1,21 @@ + */ + public $directives; + + /** @var StringValueNode|null */ + public $description; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php new file mode 100644 index 00000000..ea7d16a6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php @@ -0,0 +1,17 @@ + */ + public $directives; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php new file mode 100644 index 00000000..f563ec74 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php @@ -0,0 +1,17 @@ + */ + public $directives; + + /** @var NodeList */ + public $operationTypes; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php new file mode 100644 index 00000000..c96bcdf6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php @@ -0,0 +1,17 @@ + */ + public $directives; + + /** @var NodeList */ + public $operationTypes; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionNode.php new file mode 100644 index 00000000..225e218b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionNode.php @@ -0,0 +1,12 @@ + */ + public $selections; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/StringValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/StringValueNode.php new file mode 100644 index 00000000..059a7e31 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/StringValueNode.php @@ -0,0 +1,17 @@ + */ + public $directives; + + /** @var NodeList */ + public $types; + + /** @var StringValueNode|null */ + public $description; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php new file mode 100644 index 00000000..b10eebd5 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php @@ -0,0 +1,20 @@ + */ + public $directives; + + /** @var NodeList */ + public $types; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ValueNode.php new file mode 100644 index 00000000..2b4e5766 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ValueNode.php @@ -0,0 +1,20 @@ + */ + public $directives; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableNode.php new file mode 100644 index 00000000..f8983b90 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableNode.php @@ -0,0 +1,14 @@ + self::QUERY, + self::MUTATION => self::MUTATION, + self::SUBSCRIPTION => self::SUBSCRIPTION, + self::FIELD => self::FIELD, + self::FRAGMENT_DEFINITION => self::FRAGMENT_DEFINITION, + self::FRAGMENT_SPREAD => self::FRAGMENT_SPREAD, + self::INLINE_FRAGMENT => self::INLINE_FRAGMENT, + self::SCHEMA => self::SCHEMA, + self::SCALAR => self::SCALAR, + self::OBJECT => self::OBJECT, + self::FIELD_DEFINITION => self::FIELD_DEFINITION, + self::ARGUMENT_DEFINITION => self::ARGUMENT_DEFINITION, + self::IFACE => self::IFACE, + self::UNION => self::UNION, + self::ENUM => self::ENUM, + self::ENUM_VALUE => self::ENUM_VALUE, + self::INPUT_OBJECT => self::INPUT_OBJECT, + self::INPUT_FIELD_DEFINITION => self::INPUT_FIELD_DEFINITION, + ]; + + public static function has(string $name) : bool + { + return isset(self::$locations[$name]); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Lexer.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Lexer.php new file mode 100644 index 00000000..15563bb2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Lexer.php @@ -0,0 +1,826 @@ +source = $source; + $this->options = $options; + $this->lastToken = $startOfFileToken; + $this->token = $startOfFileToken; + $this->line = 1; + $this->lineStart = 0; + $this->position = $this->byteStreamPosition = 0; + } + + /** + * @return Token + */ + public function advance() + { + $this->lastToken = $this->token; + + return $this->token = $this->lookahead(); + } + + public function lookahead() + { + $token = $this->token; + if ($token->kind !== Token::EOF) { + do { + $token = $token->next ?? ($token->next = $this->readToken($token)); + } while ($token->kind === Token::COMMENT); + } + + return $token; + } + + /** + * @return Token + * + * @throws SyntaxError + */ + private function readToken(Token $prev) + { + $bodyLength = $this->source->length; + + $this->positionAfterWhitespace(); + $position = $this->position; + + $line = $this->line; + $col = 1 + $position - $this->lineStart; + + if ($position >= $bodyLength) { + return new Token(Token::EOF, $bodyLength, $bodyLength, $line, $col, $prev); + } + + // Read next char and advance string cursor: + [, $code, $bytes] = $this->readChar(true); + + switch ($code) { + case self::TOKEN_BANG: + return new Token(Token::BANG, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_HASH: // # + $this->moveStringCursor(-1, -1 * $bytes); + + return $this->readComment($line, $col, $prev); + case self::TOKEN_DOLLAR: + return new Token(Token::DOLLAR, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_AMP: + return new Token(Token::AMP, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_PAREN_L: + return new Token(Token::PAREN_L, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_PAREN_R: + return new Token(Token::PAREN_R, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_DOT: // . + [, $charCode1] = $this->readChar(true); + [, $charCode2] = $this->readChar(true); + + if ($charCode1 === self::TOKEN_DOT && $charCode2 === self::TOKEN_DOT) { + return new Token(Token::SPREAD, $position, $position + 3, $line, $col, $prev); + } + break; + case self::TOKEN_COLON: + return new Token(Token::COLON, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_EQUALS: + return new Token(Token::EQUALS, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_AT: + return new Token(Token::AT, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_BRACKET_L: + return new Token(Token::BRACKET_L, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_BRACKET_R: + return new Token(Token::BRACKET_R, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_BRACE_L: + return new Token(Token::BRACE_L, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_PIPE: + return new Token(Token::PIPE, $position, $position + 1, $line, $col, $prev); + case self::TOKEN_BRACE_R: + return new Token(Token::BRACE_R, $position, $position + 1, $line, $col, $prev); + + // A-Z + case 65: + case 66: + case 67: + case 68: + case 69: + case 70: + case 71: + case 72: + case 73: + case 74: + case 75: + case 76: + case 77: + case 78: + case 79: + case 80: + case 81: + case 82: + case 83: + case 84: + case 85: + case 86: + case 87: + case 88: + case 89: + case 90: + // _ + case 95: + // a-z + case 97: + case 98: + case 99: + case 100: + case 101: + case 102: + case 103: + case 104: + case 105: + case 106: + case 107: + case 108: + case 109: + case 110: + case 111: + case 112: + case 113: + case 114: + case 115: + case 116: + case 117: + case 118: + case 119: + case 120: + case 121: + case 122: + return $this->moveStringCursor(-1, -1 * $bytes) + ->readName($line, $col, $prev); + + // - + case 45: + // 0-9 + case 48: + case 49: + case 50: + case 51: + case 52: + case 53: + case 54: + case 55: + case 56: + case 57: + return $this->moveStringCursor(-1, -1 * $bytes) + ->readNumber($line, $col, $prev); + + // " + case 34: + [, $nextCode] = $this->readChar(); + [, $nextNextCode] = $this->moveStringCursor(1, 1)->readChar(); + + if ($nextCode === 34 && $nextNextCode === 34) { + return $this->moveStringCursor(-2, (-1 * $bytes) - 1) + ->readBlockString($line, $col, $prev); + } + + return $this->moveStringCursor(-2, (-1 * $bytes) - 1) + ->readString($line, $col, $prev); + } + + throw new SyntaxError( + $this->source, + $position, + $this->unexpectedCharacterMessage($code) + ); + } + + private function unexpectedCharacterMessage($code) + { + // SourceCharacter + if ($code < 0x0020 && $code !== 0x0009 && $code !== 0x000A && $code !== 0x000D) { + return 'Cannot contain the invalid character ' . Utils::printCharCode($code); + } + + if ($code === 39) { + return "Unexpected single quote character ('), did you mean to use " . + 'a double quote (")?'; + } + + return 'Cannot parse the unexpected character ' . Utils::printCharCode($code) . '.'; + } + + /** + * Reads an alphanumeric + underscore name from the source. + * + * [_A-Za-z][_0-9A-Za-z]* + * + * @param int $line + * @param int $col + * + * @return Token + */ + private function readName($line, $col, Token $prev) + { + $value = ''; + $start = $this->position; + [$char, $code] = $this->readChar(); + + while ($code !== null && ( + $code === 95 || // _ + ($code >= 48 && $code <= 57) || // 0-9 + ($code >= 65 && $code <= 90) || // A-Z + ($code >= 97 && $code <= 122) // a-z + )) { + $value .= $char; + [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); + } + + return new Token( + Token::NAME, + $start, + $this->position, + $line, + $col, + $prev, + $value + ); + } + + /** + * Reads a number token from the source file, either a float + * or an int depending on whether a decimal point appears. + * + * Int: -?(0|[1-9][0-9]*) + * Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)? + * + * @param int $line + * @param int $col + * + * @return Token + * + * @throws SyntaxError + */ + private function readNumber($line, $col, Token $prev) + { + $value = ''; + $start = $this->position; + [$char, $code] = $this->readChar(); + + $isFloat = false; + + if ($code === 45) { // - + $value .= $char; + [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); + } + + // guard against leading zero's + if ($code === 48) { // 0 + $value .= $char; + [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); + + if ($code >= 48 && $code <= 57) { + throw new SyntaxError( + $this->source, + $this->position, + 'Invalid number, unexpected digit after 0: ' . Utils::printCharCode($code) + ); + } + } else { + $value .= $this->readDigits(); + [$char, $code] = $this->readChar(); + } + + if ($code === 46) { // . + $isFloat = true; + $this->moveStringCursor(1, 1); + + $value .= $char; + $value .= $this->readDigits(); + [$char, $code] = $this->readChar(); + } + + if ($code === 69 || $code === 101) { // E e + $isFloat = true; + $value .= $char; + [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); + + if ($code === 43 || $code === 45) { // + - + $value .= $char; + $this->moveStringCursor(1, 1); + } + $value .= $this->readDigits(); + } + + return new Token( + $isFloat ? Token::FLOAT : Token::INT, + $start, + $this->position, + $line, + $col, + $prev, + $value + ); + } + + /** + * Returns string with all digits + changes current string cursor position to point to the first char after digits + */ + private function readDigits() + { + [$char, $code] = $this->readChar(); + + if ($code >= 48 && $code <= 57) { // 0 - 9 + $value = ''; + + do { + $value .= $char; + [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); + } while ($code >= 48 && $code <= 57); // 0 - 9 + + return $value; + } + + if ($this->position > $this->source->length - 1) { + $code = null; + } + + throw new SyntaxError( + $this->source, + $this->position, + 'Invalid number, expected digit but got: ' . Utils::printCharCode($code) + ); + } + + /** + * @param int $line + * @param int $col + * + * @return Token + * + * @throws SyntaxError + */ + private function readString($line, $col, Token $prev) + { + $start = $this->position; + + // Skip leading quote and read first string char: + [$char, $code, $bytes] = $this->moveStringCursor(1, 1)->readChar(); + + $chunk = ''; + $value = ''; + + while ($code !== null && + // not LineTerminator + $code !== 10 && $code !== 13 + ) { + // Closing Quote (") + if ($code === 34) { + $value .= $chunk; + + // Skip quote + $this->moveStringCursor(1, 1); + + return new Token( + Token::STRING, + $start, + $this->position, + $line, + $col, + $prev, + $value + ); + } + + $this->assertValidStringCharacterCode($code, $this->position); + $this->moveStringCursor(1, $bytes); + + if ($code === 92) { // \ + $value .= $chunk; + [, $code] = $this->readChar(true); + + switch ($code) { + case 34: + $value .= '"'; + break; + case 47: + $value .= '/'; + break; + case 92: + $value .= '\\'; + break; + case 98: + $value .= chr(8); + break; // \b (backspace) + case 102: + $value .= "\f"; + break; + case 110: + $value .= "\n"; + break; + case 114: + $value .= "\r"; + break; + case 116: + $value .= "\t"; + break; + case 117: + $position = $this->position; + [$hex] = $this->readChars(4, true); + if (! preg_match('/[0-9a-fA-F]{4}/', $hex)) { + throw new SyntaxError( + $this->source, + $position - 1, + 'Invalid character escape sequence: \\u' . $hex + ); + } + + $code = hexdec($hex); + + // UTF-16 surrogate pair detection and handling. + $highOrderByte = $code >> 8; + if (0xD8 <= $highOrderByte && $highOrderByte <= 0xDF) { + [$utf16Continuation] = $this->readChars(6, true); + if (! preg_match('/^\\\u[0-9a-fA-F]{4}$/', $utf16Continuation)) { + throw new SyntaxError( + $this->source, + $this->position - 5, + 'Invalid UTF-16 trailing surrogate: ' . $utf16Continuation + ); + } + $surrogatePairHex = $hex . substr($utf16Continuation, 2, 4); + $value .= mb_convert_encoding(pack('H*', $surrogatePairHex), 'UTF-8', 'UTF-16'); + break; + } + + $this->assertValidStringCharacterCode($code, $position - 2); + + $value .= Utils::chr($code); + break; + default: + throw new SyntaxError( + $this->source, + $this->position - 1, + 'Invalid character escape sequence: \\' . Utils::chr($code) + ); + } + $chunk = ''; + } else { + $chunk .= $char; + } + + [$char, $code, $bytes] = $this->readChar(); + } + + throw new SyntaxError( + $this->source, + $this->position, + 'Unterminated string.' + ); + } + + /** + * Reads a block string token from the source file. + * + * """("?"?(\\"""|\\(?!=""")|[^"\\]))*""" + */ + private function readBlockString($line, $col, Token $prev) + { + $start = $this->position; + + // Skip leading quotes and read first string char: + [$char, $code, $bytes] = $this->moveStringCursor(3, 3)->readChar(); + + $chunk = ''; + $value = ''; + + while ($code !== null) { + // Closing Triple-Quote (""") + if ($code === 34) { + // Move 2 quotes + [, $nextCode] = $this->moveStringCursor(1, 1)->readChar(); + [, $nextNextCode] = $this->moveStringCursor(1, 1)->readChar(); + + if ($nextCode === 34 && $nextNextCode === 34) { + $value .= $chunk; + + $this->moveStringCursor(1, 1); + + return new Token( + Token::BLOCK_STRING, + $start, + $this->position, + $line, + $col, + $prev, + BlockString::value($value) + ); + } + + // move cursor back to before the first quote + $this->moveStringCursor(-2, -2); + } + + $this->assertValidBlockStringCharacterCode($code, $this->position); + $this->moveStringCursor(1, $bytes); + + [, $nextCode] = $this->readChar(); + [, $nextNextCode] = $this->moveStringCursor(1, 1)->readChar(); + [, $nextNextNextCode] = $this->moveStringCursor(1, 1)->readChar(); + + // Escape Triple-Quote (\""") + if ($code === 92 && + $nextCode === 34 && + $nextNextCode === 34 && + $nextNextNextCode === 34 + ) { + $this->moveStringCursor(1, 1); + $value .= $chunk . '"""'; + $chunk = ''; + } else { + $this->moveStringCursor(-2, -2); + $chunk .= $char; + } + + [$char, $code, $bytes] = $this->readChar(); + } + + throw new SyntaxError( + $this->source, + $this->position, + 'Unterminated string.' + ); + } + + private function assertValidStringCharacterCode($code, $position) + { + // SourceCharacter + if ($code < 0x0020 && $code !== 0x0009) { + throw new SyntaxError( + $this->source, + $position, + 'Invalid character within String: ' . Utils::printCharCode($code) + ); + } + } + + private function assertValidBlockStringCharacterCode($code, $position) + { + // SourceCharacter + if ($code < 0x0020 && $code !== 0x0009 && $code !== 0x000A && $code !== 0x000D) { + throw new SyntaxError( + $this->source, + $position, + 'Invalid character within String: ' . Utils::printCharCode($code) + ); + } + } + + /** + * Reads from body starting at startPosition until it finds a non-whitespace + * or commented character, then places cursor to the position of that character. + */ + private function positionAfterWhitespace() + { + while ($this->position < $this->source->length) { + [, $code, $bytes] = $this->readChar(); + + // Skip whitespace + // tab | space | comma | BOM + if ($code === 9 || $code === 32 || $code === 44 || $code === 0xFEFF) { + $this->moveStringCursor(1, $bytes); + } elseif ($code === 10) { // new line + $this->moveStringCursor(1, $bytes); + $this->line++; + $this->lineStart = $this->position; + } elseif ($code === 13) { // carriage return + [, $nextCode, $nextBytes] = $this->moveStringCursor(1, $bytes)->readChar(); + + if ($nextCode === 10) { // lf after cr + $this->moveStringCursor(1, $nextBytes); + } + $this->line++; + $this->lineStart = $this->position; + } else { + break; + } + } + } + + /** + * Reads a comment token from the source file. + * + * #[\u0009\u0020-\uFFFF]* + * + * @param int $line + * @param int $col + * + * @return Token + */ + private function readComment($line, $col, Token $prev) + { + $start = $this->position; + $value = ''; + $bytes = 1; + + do { + [$char, $code, $bytes] = $this->moveStringCursor(1, $bytes)->readChar(); + $value .= $char; + } while ($code !== null && + // SourceCharacter but not LineTerminator + ($code > 0x001F || $code === 0x0009) + ); + + return new Token( + Token::COMMENT, + $start, + $this->position, + $line, + $col, + $prev, + $value + ); + } + + /** + * Reads next UTF8Character from the byte stream, starting from $byteStreamPosition. + * + * @param bool $advance + * @param int $byteStreamPosition + * + * @return (string|int)[] + */ + private function readChar($advance = false, $byteStreamPosition = null) + { + if ($byteStreamPosition === null) { + $byteStreamPosition = $this->byteStreamPosition; + } + + $code = null; + $utf8char = ''; + $bytes = 0; + $positionOffset = 0; + + if (isset($this->source->body[$byteStreamPosition])) { + $ord = ord($this->source->body[$byteStreamPosition]); + + if ($ord < 128) { + $bytes = 1; + } elseif ($ord < 224) { + $bytes = 2; + } elseif ($ord < 240) { + $bytes = 3; + } else { + $bytes = 4; + } + + $utf8char = ''; + for ($pos = $byteStreamPosition; $pos < $byteStreamPosition + $bytes; $pos++) { + $utf8char .= $this->source->body[$pos]; + } + $positionOffset = 1; + $code = $bytes === 1 ? $ord : Utils::ord($utf8char); + } + + if ($advance) { + $this->moveStringCursor($positionOffset, $bytes); + } + + return [$utf8char, $code, $bytes]; + } + + /** + * Reads next $numberOfChars UTF8 characters from the byte stream, starting from $byteStreamPosition. + * + * @param int $charCount + * @param bool $advance + * @param null $byteStreamPosition + * + * @return (string|int)[] + */ + private function readChars($charCount, $advance = false, $byteStreamPosition = null) + { + $result = ''; + $totalBytes = 0; + $byteOffset = $byteStreamPosition ?? $this->byteStreamPosition; + + for ($i = 0; $i < $charCount; $i++) { + [$char, $code, $bytes] = $this->readChar(false, $byteOffset); + $totalBytes += $bytes; + $byteOffset += $bytes; + $result .= $char; + } + if ($advance) { + $this->moveStringCursor($charCount, $totalBytes); + } + + return [$result, $totalBytes]; + } + + /** + * Moves internal string cursor position + * + * @param int $positionOffset + * @param int $byteStreamOffset + * + * @return self + */ + private function moveStringCursor($positionOffset, $byteStreamOffset) + { + $this->position += $positionOffset; + $this->byteStreamPosition += $byteStreamOffset; + + return $this; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Parser.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Parser.php new file mode 100644 index 00000000..9c0f460b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Parser.php @@ -0,0 +1,1780 @@ + variableDefinitions(Source|string $source, bool[] $options = []) + * @method static VariableDefinitionNode variableDefinition(Source|string $source, bool[] $options = []) + * @method static VariableNode variable(Source|string $source, bool[] $options = []) + * @method static SelectionSetNode selectionSet(Source|string $source, bool[] $options = []) + * @method static mixed selection(Source|string $source, bool[] $options = []) + * @method static FieldNode field(Source|string $source, bool[] $options = []) + * @method static NodeList arguments(Source|string $source, bool[] $options = []) + * @method static NodeList constArguments(Source|string $source, bool[] $options = []) + * @method static ArgumentNode argument(Source|string $source, bool[] $options = []) + * @method static ArgumentNode constArgument(Source|string $source, bool[] $options = []) + * @method static FragmentSpreadNode|InlineFragmentNode fragment(Source|string $source, bool[] $options = []) + * @method static FragmentDefinitionNode fragmentDefinition(Source|string $source, bool[] $options = []) + * @method static NameNode fragmentName(Source|string $source, bool[] $options = []) + * @method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|NullValueNode|ObjectValueNode|StringValueNode|VariableNode valueLiteral(Source|string $source, bool[] $options = []) + * @method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|NullValueNode|ObjectValueNode|StringValueNode constValueLiteral(Source|string $source, bool[] $options = []) + * @method static StringValueNode stringLiteral(Source|string $source, bool[] $options = []) + * @method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|StringValueNode constValue(Source|string $source, bool[] $options = []) + * @method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode variableValue(Source|string $source, bool[] $options = []) + * @method static ListValueNode array(Source|string $source, bool[] $options = []) + * @method static ListValueNode constArray(Source|string $source, bool[] $options = []) + * @method static ObjectValueNode object(Source|string $source, bool[] $options = []) + * @method static ObjectValueNode constObject(Source|string $source, bool[] $options = []) + * @method static ObjectFieldNode objectField(Source|string $source, bool[] $options = []) + * @method static ObjectFieldNode constObjectField(Source|string $source, bool[] $options = []) + * @method static NodeList directives(Source|string $source, bool[] $options = []) + * @method static NodeList constDirectives(Source|string $source, bool[] $options = []) + * @method static DirectiveNode directive(Source|string $source, bool[] $options = []) + * @method static DirectiveNode constDirective(Source|string $source, bool[] $options = []) + * @method static ListTypeNode|NamedTypeNode|NonNullTypeNode typeReference(Source|string $source, bool[] $options = []) + * @method static NamedTypeNode namedType(Source|string $source, bool[] $options = []) + * @method static TypeSystemDefinitionNode typeSystemDefinition(Source|string $source, bool[] $options = []) + * @method static StringValueNode|null description(Source|string $source, bool[] $options = []) + * @method static SchemaDefinitionNode schemaDefinition(Source|string $source, bool[] $options = []) + * @method static OperationTypeDefinitionNode operationTypeDefinition(Source|string $source, bool[] $options = []) + * @method static ScalarTypeDefinitionNode scalarTypeDefinition(Source|string $source, bool[] $options = []) + * @method static ObjectTypeDefinitionNode objectTypeDefinition(Source|string $source, bool[] $options = []) + * @method static NodeList implementsInterfaces(Source|string $source, bool[] $options = []) + * @method static NodeList fieldsDefinition(Source|string $source, bool[] $options = []) + * @method static FieldDefinitionNode fieldDefinition(Source|string $source, bool[] $options = []) + * @method static NodeList argumentsDefinition(Source|string $source, bool[] $options = []) + * @method static InputValueDefinitionNode inputValueDefinition(Source|string $source, bool[] $options = []) + * @method static InterfaceTypeDefinitionNode interfaceTypeDefinition(Source|string $source, bool[] $options = []) + * @method static UnionTypeDefinitionNode unionTypeDefinition(Source|string $source, bool[] $options = []) + * @method static NodeList unionMemberTypes(Source|string $source, bool[] $options = []) + * @method static EnumTypeDefinitionNode enumTypeDefinition(Source|string $source, bool[] $options = []) + * @method static NodeList enumValuesDefinition(Source|string $source, bool[] $options = []) + * @method static EnumValueDefinitionNode enumValueDefinition(Source|string $source, bool[] $options = []) + * @method static InputObjectTypeDefinitionNode inputObjectTypeDefinition(Source|string $source, bool[] $options = []) + * @method static NodeList inputFieldsDefinition(Source|string $source, bool[] $options = []) + * @method static TypeExtensionNode typeExtension(Source|string $source, bool[] $options = []) + * @method static SchemaTypeExtensionNode schemaTypeExtension(Source|string $source, bool[] $options = []) + * @method static ScalarTypeExtensionNode scalarTypeExtension(Source|string $source, bool[] $options = []) + * @method static ObjectTypeExtensionNode objectTypeExtension(Source|string $source, bool[] $options = []) + * @method static InterfaceTypeExtensionNode interfaceTypeExtension(Source|string $source, bool[] $options = []) + * @method static UnionTypeExtensionNode unionTypeExtension(Source|string $source, bool[] $options = []) + * @method static EnumTypeExtensionNode enumTypeExtension(Source|string $source, bool[] $options = []) + * @method static InputObjectTypeExtensionNode inputObjectTypeExtension(Source|string $source, bool[] $options = []) + * @method static DirectiveDefinitionNode directiveDefinition(Source|string $source, bool[] $options = []) + * @method static NodeList directiveLocations(Source|string $source, bool[] $options = []) + * @method static NameNode directiveLocation(Source|string $source, bool[] $options = []) + */ +class Parser +{ + /** + * Given a GraphQL source, parses it into a `GraphQL\Language\AST\DocumentNode`. + * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. + * + * Available options: + * + * noLocation: boolean, + * (By default, the parser creates AST nodes that know the location + * in the source that they correspond to. This configuration flag + * disables that behavior for performance or testing.) + * + * allowLegacySDLEmptyFields: boolean + * If enabled, the parser will parse empty fields sets in the Schema + * Definition Language. Otherwise, the parser will follow the current + * specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in a future major release. + * + * allowLegacySDLImplementsInterfaces: boolean + * If enabled, the parser will parse implemented interfaces with no `&` + * character between each interface. Otherwise, the parser will follow the + * current specification. + * + * This option is provided to ease adoption of the final SDL specification + * and will be removed in a future major release. + * + * experimentalFragmentVariables: boolean, + * (If enabled, the parser will understand and parse variable definitions + * contained in a fragment definition. They'll be represented in the + * `variableDefinitions` field of the FragmentDefinitionNode. + * + * The syntax is identical to normal, query-defined variables. For example: + * + * fragment A($var: Boolean = false) on T { + * ... + * } + * + * Note: this feature is experimental and may change or be removed in the + * future.) + * + * @param Source|string $source + * @param bool[] $options + * + * @return DocumentNode + * + * @throws SyntaxError + * + * @api + */ + public static function parse($source, array $options = []) + { + $parser = new self($source, $options); + + return $parser->parseDocument(); + } + + /** + * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for + * that value. + * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Values directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: `GraphQL\Utils\AST::valueFromAST()`. + * + * @param Source|string $source + * @param bool[] $options + * + * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode + * + * @api + */ + public static function parseValue($source, array $options = []) + { + $parser = new Parser($source, $options); + $parser->expect(Token::SOF); + $value = $parser->parseValueLiteral(false); + $parser->expect(Token::EOF); + + return $value; + } + + /** + * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for + * that type. + * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. + * + * This is useful within tools that operate upon GraphQL Types directly and + * in isolation of complete GraphQL documents. + * + * Consider providing the results to the utility function: `GraphQL\Utils\AST::typeFromAST()`. + * + * @param Source|string $source + * @param bool[] $options + * + * @return ListTypeNode|NamedTypeNode|NonNullTypeNode + * + * @api + */ + public static function parseType($source, array $options = []) + { + $parser = new Parser($source, $options); + $parser->expect(Token::SOF); + $type = $parser->parseTypeReference(); + $parser->expect(Token::EOF); + + return $type; + } + + /** + * Parse partial source by delegating calls to the internal parseX methods. + * + * @param bool[] $arguments + * + * @throws SyntaxError + */ + public static function __callStatic(string $name, array $arguments) + { + $parser = new Parser(...$arguments); + $parser->expect(Token::SOF); + + switch ($name) { + case 'arguments': + case 'valueLiteral': + case 'array': + case 'object': + case 'objectField': + case 'directives': + case 'directive': + $type = $parser->{'parse' . $name}(false); + break; + case 'constArguments': + $type = $parser->parseArguments(true); + break; + case 'constValueLiteral': + $type = $parser->parseValueLiteral(true); + break; + case 'constArray': + $type = $parser->parseArray(true); + break; + case 'constObject': + $type = $parser->parseObject(true); + break; + case 'constObjectField': + $type = $parser->parseObjectField(true); + break; + case 'constDirectives': + $type = $parser->parseDirectives(true); + break; + case 'constDirective': + $type = $parser->parseDirective(true); + break; + default: + $type = $parser->{'parse' . $name}(); + } + + $parser->expect(Token::EOF); + + return $type; + } + + /** @var Lexer */ + private $lexer; + + /** + * @param Source|string $source + * @param bool[] $options + */ + public function __construct($source, array $options = []) + { + $sourceObj = $source instanceof Source ? $source : new Source($source); + $this->lexer = new Lexer($sourceObj, $options); + } + + /** + * Returns a location object, used to identify the place in + * the source that created a given parsed object. + */ + private function loc(Token $startToken) : ?Location + { + if (! ($this->lexer->options['noLocation'] ?? false)) { + return new Location($startToken, $this->lexer->lastToken, $this->lexer->source); + } + + return null; + } + + /** + * Determines if the next token is of a given kind + */ + private function peek(string $kind) : bool + { + return $this->lexer->token->kind === $kind; + } + + /** + * If the next token is of the given kind, return true after advancing + * the parser. Otherwise, do not change the parser state and return false. + */ + private function skip(string $kind) : bool + { + $match = $this->lexer->token->kind === $kind; + + if ($match) { + $this->lexer->advance(); + } + + return $match; + } + + /** + * If the next token is of the given kind, return that token after advancing + * the parser. Otherwise, do not change the parser state and return false. + * + * @throws SyntaxError + */ + private function expect(string $kind) : Token + { + $token = $this->lexer->token; + + if ($token->kind === $kind) { + $this->lexer->advance(); + + return $token; + } + + throw new SyntaxError( + $this->lexer->source, + $token->start, + sprintf('Expected %s, found %s', $kind, $token->getDescription()) + ); + } + + /** + * If the next token is a keyword with the given value, advance the lexer. + * Otherwise, throw an error. + * + * @throws SyntaxError + */ + private function expectKeyword(string $value) : void + { + $token = $this->lexer->token; + if ($token->kind !== Token::NAME || $token->value !== $value) { + throw new SyntaxError( + $this->lexer->source, + $token->start, + 'Expected "' . $value . '", found ' . $token->getDescription() + ); + } + + $this->lexer->advance(); + } + + /** + * If the next token is a given keyword, return "true" after advancing + * the lexer. Otherwise, do not change the parser state and return "false". + */ + private function expectOptionalKeyword(string $value) : bool + { + $token = $this->lexer->token; + if ($token->kind === Token::NAME && $token->value === $value) { + $this->lexer->advance(); + + return true; + } + + return false; + } + + private function unexpected(?Token $atToken = null) : SyntaxError + { + $token = $atToken ?? $this->lexer->token; + + return new SyntaxError($this->lexer->source, $token->start, 'Unexpected ' . $token->getDescription()); + } + + /** + * Returns a possibly empty list of parse nodes, determined by + * the parseFn. This list begins with a lex token of openKind + * and ends with a lex token of closeKind. Advances the parser + * to the next lex token after the closing token. + * + * @throws SyntaxError + */ + private function any(string $openKind, callable $parseFn, string $closeKind) : NodeList + { + $this->expect($openKind); + + $nodes = []; + while (! $this->skip($closeKind)) { + $nodes[] = $parseFn($this); + } + + return new NodeList($nodes); + } + + /** + * Returns a non-empty list of parse nodes, determined by + * the parseFn. This list begins with a lex token of openKind + * and ends with a lex token of closeKind. Advances the parser + * to the next lex token after the closing token. + * + * @throws SyntaxError + */ + private function many(string $openKind, callable $parseFn, string $closeKind) : NodeList + { + $this->expect($openKind); + + $nodes = [$parseFn($this)]; + while (! $this->skip($closeKind)) { + $nodes[] = $parseFn($this); + } + + return new NodeList($nodes); + } + + /** + * Converts a name lex token into a name parse node. + * + * @throws SyntaxError + */ + private function parseName() : NameNode + { + $token = $this->expect(Token::NAME); + + return new NameNode([ + 'value' => $token->value, + 'loc' => $this->loc($token), + ]); + } + + /** + * Implements the parsing rules in the Document section. + * + * @throws SyntaxError + */ + private function parseDocument() : DocumentNode + { + $start = $this->lexer->token; + + return new DocumentNode([ + 'definitions' => $this->many( + Token::SOF, + function () { + return $this->parseDefinition(); + }, + Token::EOF + ), + 'loc' => $this->loc($start), + ]); + } + + /** + * @return ExecutableDefinitionNode|TypeSystemDefinitionNode + * + * @throws SyntaxError + */ + private function parseDefinition() : DefinitionNode + { + if ($this->peek(Token::NAME)) { + switch ($this->lexer->token->value) { + case 'query': + case 'mutation': + case 'subscription': + case 'fragment': + return $this->parseExecutableDefinition(); + + // Note: The schema definition language is an experimental addition. + case 'schema': + case 'scalar': + case 'type': + case 'interface': + case 'union': + case 'enum': + case 'input': + case 'extend': + case 'directive': + // Note: The schema definition language is an experimental addition. + return $this->parseTypeSystemDefinition(); + } + } elseif ($this->peek(Token::BRACE_L)) { + return $this->parseExecutableDefinition(); + } elseif ($this->peekDescription()) { + // Note: The schema definition language is an experimental addition. + return $this->parseTypeSystemDefinition(); + } + + throw $this->unexpected(); + } + + /** + * @throws SyntaxError + */ + private function parseExecutableDefinition() : ExecutableDefinitionNode + { + if ($this->peek(Token::NAME)) { + switch ($this->lexer->token->value) { + case 'query': + case 'mutation': + case 'subscription': + return $this->parseOperationDefinition(); + case 'fragment': + return $this->parseFragmentDefinition(); + } + } elseif ($this->peek(Token::BRACE_L)) { + return $this->parseOperationDefinition(); + } + + throw $this->unexpected(); + } + + // Implements the parsing rules in the Operations section. + + /** + * @throws SyntaxError + */ + private function parseOperationDefinition() : OperationDefinitionNode + { + $start = $this->lexer->token; + if ($this->peek(Token::BRACE_L)) { + return new OperationDefinitionNode([ + 'operation' => 'query', + 'name' => null, + 'variableDefinitions' => new NodeList([]), + 'directives' => new NodeList([]), + 'selectionSet' => $this->parseSelectionSet(), + 'loc' => $this->loc($start), + ]); + } + + $operation = $this->parseOperationType(); + + $name = null; + if ($this->peek(Token::NAME)) { + $name = $this->parseName(); + } + + return new OperationDefinitionNode([ + 'operation' => $operation, + 'name' => $name, + 'variableDefinitions' => $this->parseVariableDefinitions(), + 'directives' => $this->parseDirectives(false), + 'selectionSet' => $this->parseSelectionSet(), + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseOperationType() : string + { + $operationToken = $this->expect(Token::NAME); + switch ($operationToken->value) { + case 'query': + return 'query'; + case 'mutation': + return 'mutation'; + case 'subscription': + return 'subscription'; + } + + throw $this->unexpected($operationToken); + } + + private function parseVariableDefinitions() : NodeList + { + return $this->peek(Token::PAREN_L) + ? $this->many( + Token::PAREN_L, + function () : VariableDefinitionNode { + return $this->parseVariableDefinition(); + }, + Token::PAREN_R + ) + : new NodeList([]); + } + + /** + * @throws SyntaxError + */ + private function parseVariableDefinition() : VariableDefinitionNode + { + $start = $this->lexer->token; + $var = $this->parseVariable(); + + $this->expect(Token::COLON); + $type = $this->parseTypeReference(); + + return new VariableDefinitionNode([ + 'variable' => $var, + 'type' => $type, + 'defaultValue' => $this->skip(Token::EQUALS) + ? $this->parseValueLiteral(true) + : null, + 'directives' => $this->parseDirectives(true), + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseVariable() : VariableNode + { + $start = $this->lexer->token; + $this->expect(Token::DOLLAR); + + return new VariableNode([ + 'name' => $this->parseName(), + 'loc' => $this->loc($start), + ]); + } + + private function parseSelectionSet() : SelectionSetNode + { + $start = $this->lexer->token; + + return new SelectionSetNode( + [ + 'selections' => $this->many( + Token::BRACE_L, + function () : SelectionNode { + return $this->parseSelection(); + }, + Token::BRACE_R + ), + 'loc' => $this->loc($start), + ] + ); + } + + /** + * Selection : + * - Field + * - FragmentSpread + * - InlineFragment + */ + private function parseSelection() : SelectionNode + { + return $this->peek(Token::SPREAD) + ? $this->parseFragment() + : $this->parseField(); + } + + /** + * @throws SyntaxError + */ + private function parseField() : FieldNode + { + $start = $this->lexer->token; + $nameOrAlias = $this->parseName(); + + if ($this->skip(Token::COLON)) { + $alias = $nameOrAlias; + $name = $this->parseName(); + } else { + $alias = null; + $name = $nameOrAlias; + } + + return new FieldNode([ + 'alias' => $alias, + 'name' => $name, + 'arguments' => $this->parseArguments(false), + 'directives' => $this->parseDirectives(false), + 'selectionSet' => $this->peek(Token::BRACE_L) ? $this->parseSelectionSet() : null, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseArguments(bool $isConst) : NodeList + { + $parseFn = $isConst + ? function () : ArgumentNode { + return $this->parseConstArgument(); + } + : function () : ArgumentNode { + return $this->parseArgument(); + }; + + return $this->peek(Token::PAREN_L) + ? $this->many(Token::PAREN_L, $parseFn, Token::PAREN_R) + : new NodeList([]); + } + + /** + * @throws SyntaxError + */ + private function parseArgument() : ArgumentNode + { + $start = $this->lexer->token; + $name = $this->parseName(); + + $this->expect(Token::COLON); + $value = $this->parseValueLiteral(false); + + return new ArgumentNode([ + 'name' => $name, + 'value' => $value, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseConstArgument() : ArgumentNode + { + $start = $this->lexer->token; + $name = $this->parseName(); + + $this->expect(Token::COLON); + $value = $this->parseConstValue(); + + return new ArgumentNode([ + 'name' => $name, + 'value' => $value, + 'loc' => $this->loc($start), + ]); + } + + // Implements the parsing rules in the Fragments section. + + /** + * @return FragmentSpreadNode|InlineFragmentNode + * + * @throws SyntaxError + */ + private function parseFragment() : SelectionNode + { + $start = $this->lexer->token; + $this->expect(Token::SPREAD); + + $hasTypeCondition = $this->expectOptionalKeyword('on'); + if (! $hasTypeCondition && $this->peek(Token::NAME)) { + return new FragmentSpreadNode([ + 'name' => $this->parseFragmentName(), + 'directives' => $this->parseDirectives(false), + 'loc' => $this->loc($start), + ]); + } + + return new InlineFragmentNode([ + 'typeCondition' => $hasTypeCondition ? $this->parseNamedType() : null, + 'directives' => $this->parseDirectives(false), + 'selectionSet' => $this->parseSelectionSet(), + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseFragmentDefinition() : FragmentDefinitionNode + { + $start = $this->lexer->token; + $this->expectKeyword('fragment'); + + $name = $this->parseFragmentName(); + + // Experimental support for defining variables within fragments changes + // the grammar of FragmentDefinition: + // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet + $variableDefinitions = null; + if (isset($this->lexer->options['experimentalFragmentVariables'])) { + $variableDefinitions = $this->parseVariableDefinitions(); + } + $this->expectKeyword('on'); + $typeCondition = $this->parseNamedType(); + + return new FragmentDefinitionNode([ + 'name' => $name, + 'variableDefinitions' => $variableDefinitions, + 'typeCondition' => $typeCondition, + 'directives' => $this->parseDirectives(false), + 'selectionSet' => $this->parseSelectionSet(), + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseFragmentName() : NameNode + { + if ($this->lexer->token->value === 'on') { + throw $this->unexpected(); + } + + return $this->parseName(); + } + + // Implements the parsing rules in the Values section. + + /** + * Value[Const] : + * - [~Const] Variable + * - IntValue + * - FloatValue + * - StringValue + * - BooleanValue + * - NullValue + * - EnumValue + * - ListValue[?Const] + * - ObjectValue[?Const] + * + * BooleanValue : one of `true` `false` + * + * NullValue : `null` + * + * EnumValue : Name but not `true`, `false` or `null` + * + * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|StringValueNode|VariableNode|ListValueNode|ObjectValueNode|NullValueNode + * + * @throws SyntaxError + */ + private function parseValueLiteral(bool $isConst) : ValueNode + { + $token = $this->lexer->token; + switch ($token->kind) { + case Token::BRACKET_L: + return $this->parseArray($isConst); + case Token::BRACE_L: + return $this->parseObject($isConst); + case Token::INT: + $this->lexer->advance(); + + return new IntValueNode([ + 'value' => $token->value, + 'loc' => $this->loc($token), + ]); + case Token::FLOAT: + $this->lexer->advance(); + + return new FloatValueNode([ + 'value' => $token->value, + 'loc' => $this->loc($token), + ]); + case Token::STRING: + case Token::BLOCK_STRING: + return $this->parseStringLiteral(); + case Token::NAME: + if ($token->value === 'true' || $token->value === 'false') { + $this->lexer->advance(); + + return new BooleanValueNode([ + 'value' => $token->value === 'true', + 'loc' => $this->loc($token), + ]); + } + + if ($token->value === 'null') { + $this->lexer->advance(); + + return new NullValueNode([ + 'loc' => $this->loc($token), + ]); + } else { + $this->lexer->advance(); + + return new EnumValueNode([ + 'value' => $token->value, + 'loc' => $this->loc($token), + ]); + } + break; + + case Token::DOLLAR: + if (! $isConst) { + return $this->parseVariable(); + } + break; + } + throw $this->unexpected(); + } + + private function parseStringLiteral() : StringValueNode + { + $token = $this->lexer->token; + $this->lexer->advance(); + + return new StringValueNode([ + 'value' => $token->value, + 'block' => $token->kind === Token::BLOCK_STRING, + 'loc' => $this->loc($token), + ]); + } + + /** + * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|StringValueNode|VariableNode + * + * @throws SyntaxError + */ + private function parseConstValue() : ValueNode + { + return $this->parseValueLiteral(true); + } + + /** + * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode + */ + private function parseVariableValue() : ValueNode + { + return $this->parseValueLiteral(false); + } + + private function parseArray(bool $isConst) : ListValueNode + { + $start = $this->lexer->token; + $parseFn = $isConst + ? function () { + return $this->parseConstValue(); + } + : function () { + return $this->parseVariableValue(); + }; + + return new ListValueNode( + [ + 'values' => $this->any(Token::BRACKET_L, $parseFn, Token::BRACKET_R), + 'loc' => $this->loc($start), + ] + ); + } + + private function parseObject(bool $isConst) : ObjectValueNode + { + $start = $this->lexer->token; + $this->expect(Token::BRACE_L); + $fields = []; + while (! $this->skip(Token::BRACE_R)) { + $fields[] = $this->parseObjectField($isConst); + } + + return new ObjectValueNode([ + 'fields' => new NodeList($fields), + 'loc' => $this->loc($start), + ]); + } + + private function parseObjectField(bool $isConst) : ObjectFieldNode + { + $start = $this->lexer->token; + $name = $this->parseName(); + + $this->expect(Token::COLON); + + return new ObjectFieldNode([ + 'name' => $name, + 'value' => $this->parseValueLiteral($isConst), + 'loc' => $this->loc($start), + ]); + } + + // Implements the parsing rules in the Directives section. + + /** + * @throws SyntaxError + */ + private function parseDirectives(bool $isConst) : NodeList + { + $directives = []; + while ($this->peek(Token::AT)) { + $directives[] = $this->parseDirective($isConst); + } + + return new NodeList($directives); + } + + /** + * @throws SyntaxError + */ + private function parseDirective(bool $isConst) : DirectiveNode + { + $start = $this->lexer->token; + $this->expect(Token::AT); + + return new DirectiveNode([ + 'name' => $this->parseName(), + 'arguments' => $this->parseArguments($isConst), + 'loc' => $this->loc($start), + ]); + } + + // Implements the parsing rules in the Types section. + + /** + * Handles the Type: TypeName, ListType, and NonNullType parsing rules. + * + * @return ListTypeNode|NamedTypeNode|NonNullTypeNode + * + * @throws SyntaxError + */ + private function parseTypeReference() : TypeNode + { + $start = $this->lexer->token; + + if ($this->skip(Token::BRACKET_L)) { + $type = $this->parseTypeReference(); + $this->expect(Token::BRACKET_R); + $type = new ListTypeNode([ + 'type' => $type, + 'loc' => $this->loc($start), + ]); + } else { + $type = $this->parseNamedType(); + } + if ($this->skip(Token::BANG)) { + return new NonNullTypeNode([ + 'type' => $type, + 'loc' => $this->loc($start), + ]); + } + + return $type; + } + + private function parseNamedType() : NamedTypeNode + { + $start = $this->lexer->token; + + return new NamedTypeNode([ + 'name' => $this->parseName(), + 'loc' => $this->loc($start), + ]); + } + + // Implements the parsing rules in the Type Definition section. + + /** + * TypeSystemDefinition : + * - SchemaDefinition + * - TypeDefinition + * - TypeExtension + * - DirectiveDefinition + * + * TypeDefinition : + * - ScalarTypeDefinition + * - ObjectTypeDefinition + * - InterfaceTypeDefinition + * - UnionTypeDefinition + * - EnumTypeDefinition + * - InputObjectTypeDefinition + * + * @throws SyntaxError + */ + private function parseTypeSystemDefinition() : TypeSystemDefinitionNode + { + // Many definitions begin with a description and require a lookahead. + $keywordToken = $this->peekDescription() + ? $this->lexer->lookahead() + : $this->lexer->token; + + if ($keywordToken->kind === Token::NAME) { + switch ($keywordToken->value) { + case 'schema': + return $this->parseSchemaDefinition(); + case 'scalar': + return $this->parseScalarTypeDefinition(); + case 'type': + return $this->parseObjectTypeDefinition(); + case 'interface': + return $this->parseInterfaceTypeDefinition(); + case 'union': + return $this->parseUnionTypeDefinition(); + case 'enum': + return $this->parseEnumTypeDefinition(); + case 'input': + return $this->parseInputObjectTypeDefinition(); + case 'extend': + return $this->parseTypeExtension(); + case 'directive': + return $this->parseDirectiveDefinition(); + } + } + + throw $this->unexpected($keywordToken); + } + + private function peekDescription() : bool + { + return $this->peek(Token::STRING) || $this->peek(Token::BLOCK_STRING); + } + + private function parseDescription() : ?StringValueNode + { + if ($this->peekDescription()) { + return $this->parseStringLiteral(); + } + + return null; + } + + /** + * @throws SyntaxError + */ + private function parseSchemaDefinition() : SchemaDefinitionNode + { + $start = $this->lexer->token; + $this->expectKeyword('schema'); + $directives = $this->parseDirectives(true); + + $operationTypes = $this->many( + Token::BRACE_L, + function () : OperationTypeDefinitionNode { + return $this->parseOperationTypeDefinition(); + }, + Token::BRACE_R + ); + + return new SchemaDefinitionNode([ + 'directives' => $directives, + 'operationTypes' => $operationTypes, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseOperationTypeDefinition() : OperationTypeDefinitionNode + { + $start = $this->lexer->token; + $operation = $this->parseOperationType(); + $this->expect(Token::COLON); + $type = $this->parseNamedType(); + + return new OperationTypeDefinitionNode([ + 'operation' => $operation, + 'type' => $type, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseScalarTypeDefinition() : ScalarTypeDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $this->expectKeyword('scalar'); + $name = $this->parseName(); + $directives = $this->parseDirectives(true); + + return new ScalarTypeDefinitionNode([ + 'name' => $name, + 'directives' => $directives, + 'loc' => $this->loc($start), + 'description' => $description, + ]); + } + + /** + * @throws SyntaxError + */ + private function parseObjectTypeDefinition() : ObjectTypeDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $this->expectKeyword('type'); + $name = $this->parseName(); + $interfaces = $this->parseImplementsInterfaces(); + $directives = $this->parseDirectives(true); + $fields = $this->parseFieldsDefinition(); + + return new ObjectTypeDefinitionNode([ + 'name' => $name, + 'interfaces' => $interfaces, + 'directives' => $directives, + 'fields' => $fields, + 'loc' => $this->loc($start), + 'description' => $description, + ]); + } + + /** + * ImplementsInterfaces : + * - implements `&`? NamedType + * - ImplementsInterfaces & NamedType + */ + private function parseImplementsInterfaces() : NodeList + { + $types = []; + if ($this->expectOptionalKeyword('implements')) { + // Optional leading ampersand + $this->skip(Token::AMP); + do { + $types[] = $this->parseNamedType(); + } while ($this->skip(Token::AMP) || + // Legacy support for the SDL? + (($this->lexer->options['allowLegacySDLImplementsInterfaces'] ?? false) && $this->peek(Token::NAME)) + ); + } + + return new NodeList($types); + } + + /** + * @throws SyntaxError + */ + private function parseFieldsDefinition() : NodeList + { + // Legacy support for the SDL? + if (($this->lexer->options['allowLegacySDLEmptyFields'] ?? false) + && $this->peek(Token::BRACE_L) + && $this->lexer->lookahead()->kind === Token::BRACE_R + ) { + $this->lexer->advance(); + $this->lexer->advance(); + + /** @phpstan-var NodeList $nodeList */ + $nodeList = new NodeList([]); + } else { + /** @phpstan-var NodeList $nodeList */ + $nodeList = $this->peek(Token::BRACE_L) + ? $this->many( + Token::BRACE_L, + function () : FieldDefinitionNode { + return $this->parseFieldDefinition(); + }, + Token::BRACE_R + ) + : new NodeList([]); + } + + return $nodeList; + } + + /** + * @throws SyntaxError + */ + private function parseFieldDefinition() : FieldDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $name = $this->parseName(); + $args = $this->parseArgumentsDefinition(); + $this->expect(Token::COLON); + $type = $this->parseTypeReference(); + $directives = $this->parseDirectives(true); + + return new FieldDefinitionNode([ + 'name' => $name, + 'arguments' => $args, + 'type' => $type, + 'directives' => $directives, + 'loc' => $this->loc($start), + 'description' => $description, + ]); + } + + /** + * @throws SyntaxError + */ + private function parseArgumentsDefinition() : NodeList + { + /** @var NodeList $nodeList */ + $nodeList = $this->peek(Token::PAREN_L) + ? $this->many( + Token::PAREN_L, + function () : InputValueDefinitionNode { + return $this->parseInputValueDefinition(); + }, + Token::PAREN_R + ) + : new NodeList([]); + + return $nodeList; + } + + /** + * @throws SyntaxError + */ + private function parseInputValueDefinition() : InputValueDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $name = $this->parseName(); + $this->expect(Token::COLON); + $type = $this->parseTypeReference(); + $defaultValue = null; + if ($this->skip(Token::EQUALS)) { + $defaultValue = $this->parseConstValue(); + } + $directives = $this->parseDirectives(true); + + return new InputValueDefinitionNode([ + 'name' => $name, + 'type' => $type, + 'defaultValue' => $defaultValue, + 'directives' => $directives, + 'loc' => $this->loc($start), + 'description' => $description, + ]); + } + + /** + * @throws SyntaxError + */ + private function parseInterfaceTypeDefinition() : InterfaceTypeDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $this->expectKeyword('interface'); + $name = $this->parseName(); + $interfaces = $this->parseImplementsInterfaces(); + $directives = $this->parseDirectives(true); + $fields = $this->parseFieldsDefinition(); + + return new InterfaceTypeDefinitionNode([ + 'name' => $name, + 'directives' => $directives, + 'interfaces' => $interfaces, + 'fields' => $fields, + 'loc' => $this->loc($start), + 'description' => $description, + ]); + } + + /** + * UnionTypeDefinition : + * - Description? union Name Directives[Const]? UnionMemberTypes? + * + * @throws SyntaxError + */ + private function parseUnionTypeDefinition() : UnionTypeDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $this->expectKeyword('union'); + $name = $this->parseName(); + $directives = $this->parseDirectives(true); + $types = $this->parseUnionMemberTypes(); + + return new UnionTypeDefinitionNode([ + 'name' => $name, + 'directives' => $directives, + 'types' => $types, + 'loc' => $this->loc($start), + 'description' => $description, + ]); + } + + /** + * UnionMemberTypes : + * - = `|`? NamedType + * - UnionMemberTypes | NamedType + */ + private function parseUnionMemberTypes() : NodeList + { + $types = []; + if ($this->skip(Token::EQUALS)) { + // Optional leading pipe + $this->skip(Token::PIPE); + do { + $types[] = $this->parseNamedType(); + } while ($this->skip(Token::PIPE)); + } + + return new NodeList($types); + } + + /** + * @throws SyntaxError + */ + private function parseEnumTypeDefinition() : EnumTypeDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $this->expectKeyword('enum'); + $name = $this->parseName(); + $directives = $this->parseDirectives(true); + $values = $this->parseEnumValuesDefinition(); + + return new EnumTypeDefinitionNode([ + 'name' => $name, + 'directives' => $directives, + 'values' => $values, + 'loc' => $this->loc($start), + 'description' => $description, + ]); + } + + /** + * @throws SyntaxError + */ + private function parseEnumValuesDefinition() : NodeList + { + /** @var NodeList $nodeList */ + $nodeList = $this->peek(Token::BRACE_L) + ? $this->many( + Token::BRACE_L, + function () : EnumValueDefinitionNode { + return $this->parseEnumValueDefinition(); + }, + Token::BRACE_R + ) + : new NodeList([]); + + return $nodeList; + } + + /** + * @throws SyntaxError + */ + private function parseEnumValueDefinition() : EnumValueDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $name = $this->parseName(); + $directives = $this->parseDirectives(true); + + return new EnumValueDefinitionNode([ + 'name' => $name, + 'directives' => $directives, + 'loc' => $this->loc($start), + 'description' => $description, + ]); + } + + /** + * @throws SyntaxError + */ + private function parseInputObjectTypeDefinition() : InputObjectTypeDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $this->expectKeyword('input'); + $name = $this->parseName(); + $directives = $this->parseDirectives(true); + $fields = $this->parseInputFieldsDefinition(); + + return new InputObjectTypeDefinitionNode([ + 'name' => $name, + 'directives' => $directives, + 'fields' => $fields, + 'loc' => $this->loc($start), + 'description' => $description, + ]); + } + + /** + * @throws SyntaxError + */ + private function parseInputFieldsDefinition() : NodeList + { + /** @var NodeList $nodeList */ + $nodeList = $this->peek(Token::BRACE_L) + ? $this->many( + Token::BRACE_L, + function () : InputValueDefinitionNode { + return $this->parseInputValueDefinition(); + }, + Token::BRACE_R + ) + : new NodeList([]); + + return $nodeList; + } + + /** + * TypeExtension : + * - ScalarTypeExtension + * - ObjectTypeExtension + * - InterfaceTypeExtension + * - UnionTypeExtension + * - EnumTypeExtension + * - InputObjectTypeDefinition + * + * @throws SyntaxError + */ + private function parseTypeExtension() : TypeExtensionNode + { + $keywordToken = $this->lexer->lookahead(); + + if ($keywordToken->kind === Token::NAME) { + switch ($keywordToken->value) { + case 'schema': + return $this->parseSchemaTypeExtension(); + case 'scalar': + return $this->parseScalarTypeExtension(); + case 'type': + return $this->parseObjectTypeExtension(); + case 'interface': + return $this->parseInterfaceTypeExtension(); + case 'union': + return $this->parseUnionTypeExtension(); + case 'enum': + return $this->parseEnumTypeExtension(); + case 'input': + return $this->parseInputObjectTypeExtension(); + } + } + + throw $this->unexpected($keywordToken); + } + + /** + * @throws SyntaxError + */ + private function parseSchemaTypeExtension() : SchemaTypeExtensionNode + { + $start = $this->lexer->token; + $this->expectKeyword('extend'); + $this->expectKeyword('schema'); + $directives = $this->parseDirectives(true); + $operationTypes = $this->peek(Token::BRACE_L) + ? $this->many( + Token::BRACE_L, + [$this, 'parseOperationTypeDefinition'], + Token::BRACE_R + ) + : new NodeList([]); + if (count($directives) === 0 && count($operationTypes) === 0) { + $this->unexpected(); + } + + return new SchemaTypeExtensionNode([ + 'directives' => $directives, + 'operationTypes' => $operationTypes, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseScalarTypeExtension() : ScalarTypeExtensionNode + { + $start = $this->lexer->token; + $this->expectKeyword('extend'); + $this->expectKeyword('scalar'); + $name = $this->parseName(); + $directives = $this->parseDirectives(true); + if (count($directives) === 0) { + throw $this->unexpected(); + } + + return new ScalarTypeExtensionNode([ + 'name' => $name, + 'directives' => $directives, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseObjectTypeExtension() : ObjectTypeExtensionNode + { + $start = $this->lexer->token; + $this->expectKeyword('extend'); + $this->expectKeyword('type'); + $name = $this->parseName(); + $interfaces = $this->parseImplementsInterfaces(); + $directives = $this->parseDirectives(true); + $fields = $this->parseFieldsDefinition(); + + if (count($interfaces) === 0 && + count($directives) === 0 && + count($fields) === 0 + ) { + throw $this->unexpected(); + } + + return new ObjectTypeExtensionNode([ + 'name' => $name, + 'interfaces' => $interfaces, + 'directives' => $directives, + 'fields' => $fields, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseInterfaceTypeExtension() : InterfaceTypeExtensionNode + { + $start = $this->lexer->token; + $this->expectKeyword('extend'); + $this->expectKeyword('interface'); + $name = $this->parseName(); + $interfaces = $this->parseImplementsInterfaces(); + $directives = $this->parseDirectives(true); + $fields = $this->parseFieldsDefinition(); + if (count($interfaces) === 0 + && count($directives) === 0 + && count($fields) === 0 + ) { + throw $this->unexpected(); + } + + return new InterfaceTypeExtensionNode([ + 'name' => $name, + 'directives' => $directives, + 'interfaces' => $interfaces, + 'fields' => $fields, + 'loc' => $this->loc($start), + ]); + } + + /** + * UnionTypeExtension : + * - extend union Name Directives[Const]? UnionMemberTypes + * - extend union Name Directives[Const] + * + * @throws SyntaxError + */ + private function parseUnionTypeExtension() : UnionTypeExtensionNode + { + $start = $this->lexer->token; + $this->expectKeyword('extend'); + $this->expectKeyword('union'); + $name = $this->parseName(); + $directives = $this->parseDirectives(true); + $types = $this->parseUnionMemberTypes(); + if (count($directives) === 0 && count($types) === 0) { + throw $this->unexpected(); + } + + return new UnionTypeExtensionNode([ + 'name' => $name, + 'directives' => $directives, + 'types' => $types, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseEnumTypeExtension() : EnumTypeExtensionNode + { + $start = $this->lexer->token; + $this->expectKeyword('extend'); + $this->expectKeyword('enum'); + $name = $this->parseName(); + $directives = $this->parseDirectives(true); + $values = $this->parseEnumValuesDefinition(); + if (count($directives) === 0 && + count($values) === 0 + ) { + throw $this->unexpected(); + } + + return new EnumTypeExtensionNode([ + 'name' => $name, + 'directives' => $directives, + 'values' => $values, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseInputObjectTypeExtension() : InputObjectTypeExtensionNode + { + $start = $this->lexer->token; + $this->expectKeyword('extend'); + $this->expectKeyword('input'); + $name = $this->parseName(); + $directives = $this->parseDirectives(true); + $fields = $this->parseInputFieldsDefinition(); + if (count($directives) === 0 && + count($fields) === 0 + ) { + throw $this->unexpected(); + } + + return new InputObjectTypeExtensionNode([ + 'name' => $name, + 'directives' => $directives, + 'fields' => $fields, + 'loc' => $this->loc($start), + ]); + } + + /** + * DirectiveDefinition : + * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations + * + * @throws SyntaxError + */ + private function parseDirectiveDefinition() : DirectiveDefinitionNode + { + $start = $this->lexer->token; + $description = $this->parseDescription(); + $this->expectKeyword('directive'); + $this->expect(Token::AT); + $name = $this->parseName(); + $args = $this->parseArgumentsDefinition(); + $repeatable = $this->expectOptionalKeyword('repeatable'); + $this->expectKeyword('on'); + $locations = $this->parseDirectiveLocations(); + + return new DirectiveDefinitionNode([ + 'name' => $name, + 'description' => $description, + 'arguments' => $args, + 'repeatable' => $repeatable, + 'locations' => $locations, + 'loc' => $this->loc($start), + ]); + } + + /** + * @throws SyntaxError + */ + private function parseDirectiveLocations() : NodeList + { + // Optional leading pipe + $this->skip(Token::PIPE); + $locations = []; + do { + $locations[] = $this->parseDirectiveLocation(); + } while ($this->skip(Token::PIPE)); + + return new NodeList($locations); + } + + /** + * @throws SyntaxError + */ + private function parseDirectiveLocation() : NameNode + { + $start = $this->lexer->token; + $name = $this->parseName(); + if (DirectiveLocation::has($name->value)) { + return $name; + } + + throw $this->unexpected($start); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Printer.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Printer.php new file mode 100644 index 00000000..0a95efc4 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Printer.php @@ -0,0 +1,539 @@ +printAST($ast); + } + + protected function __construct() + { + } + + /** + * Traverse an AST bottom-up, converting all nodes to strings. + * + * That means the AST is manipulated in such a way that it no longer + * resembles the well-formed result of parsing. + */ + public function printAST($ast) + { + return Visitor::visit( + $ast, + [ + 'leave' => [ + NodeKind::NAME => static function (NameNode $node) : string { + return $node->value; + }, + + NodeKind::VARIABLE => static function (VariableNode $node) : string { + return '$' . $node->name; + }, + + NodeKind::DOCUMENT => function (DocumentNode $node) : string { + return $this->join($node->definitions, "\n\n") . "\n"; + }, + + NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) : string { + $op = $node->operation; + $name = $node->name; + $varDefs = $this->wrap('(', $this->join($node->variableDefinitions, ', '), ')'); + $directives = $this->join($node->directives, ' '); + $selectionSet = $node->selectionSet; + + // Anonymous queries with no directives or variable definitions can use + // the query short form. + return $name === null && strlen($directives ?? '') === 0 && ! $varDefs && $op === 'query' + ? $selectionSet + : $this->join([$op, $this->join([$name, $varDefs]), $directives, $selectionSet], ' '); + }, + + NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $node) : string { + return $node->variable + . ': ' + . $node->type + . $this->wrap(' = ', $node->defaultValue) + . $this->wrap(' ', $this->join($node->directives, ' ')); + }, + + NodeKind::SELECTION_SET => function (SelectionSetNode $node) { + return $this->block($node->selections); + }, + + NodeKind::FIELD => function (FieldNode $node) : string { + return $this->join( + [ + $this->wrap('', $node->alias, ': ') . $node->name . $this->wrap( + '(', + $this->join($node->arguments, ', '), + ')' + ), + $this->join($node->directives, ' '), + $node->selectionSet, + ], + ' ' + ); + }, + + NodeKind::ARGUMENT => static function (ArgumentNode $node) : string { + return $node->name . ': ' . $node->value; + }, + + NodeKind::FRAGMENT_SPREAD => function (FragmentSpreadNode $node) : string { + return '...' + . $node->name + . $this->wrap(' ', $this->join($node->directives, ' ')); + }, + + NodeKind::INLINE_FRAGMENT => function (InlineFragmentNode $node) : string { + return $this->join( + [ + '...', + $this->wrap('on ', $node->typeCondition), + $this->join($node->directives, ' '), + $node->selectionSet, + ], + ' ' + ); + }, + + NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) : string { + // Note: fragment variable definitions are experimental and may be changed or removed in the future. + return sprintf('fragment %s', $node->name) + . $this->wrap('(', $this->join($node->variableDefinitions, ', '), ')') + . sprintf(' on %s ', $node->typeCondition) + . $this->wrap('', $this->join($node->directives, ' '), ' ') + . $node->selectionSet; + }, + + NodeKind::INT => static function (IntValueNode $node) : string { + return $node->value; + }, + + NodeKind::FLOAT => static function (FloatValueNode $node) : string { + return $node->value; + }, + + NodeKind::STRING => function (StringValueNode $node, $key) : string { + if ($node->block) { + return $this->printBlockString($node->value, $key === 'description'); + } + + return json_encode($node->value); + }, + + NodeKind::BOOLEAN => static function (BooleanValueNode $node) : string { + return $node->value ? 'true' : 'false'; + }, + + NodeKind::NULL => static function (NullValueNode $node) : string { + return 'null'; + }, + + NodeKind::ENUM => static function (EnumValueNode $node) : string { + return $node->value; + }, + + NodeKind::LST => function (ListValueNode $node) : string { + return '[' . $this->join($node->values, ', ') . ']'; + }, + + NodeKind::OBJECT => function (ObjectValueNode $node) : string { + return '{' . $this->join($node->fields, ', ') . '}'; + }, + + NodeKind::OBJECT_FIELD => static function (ObjectFieldNode $node) : string { + return $node->name . ': ' . $node->value; + }, + + NodeKind::DIRECTIVE => function (DirectiveNode $node) : string { + return '@' . $node->name . $this->wrap('(', $this->join($node->arguments, ', '), ')'); + }, + + NodeKind::NAMED_TYPE => static function (NamedTypeNode $node) : string { + // @phpstan-ignore-next-line the printer works bottom up, so this is already a string here + return $node->name; + }, + + NodeKind::LIST_TYPE => static function (ListTypeNode $node) : string { + return '[' . $node->type . ']'; + }, + + NodeKind::NON_NULL_TYPE => static function (NonNullTypeNode $node) : string { + return $node->type . '!'; + }, + + NodeKind::SCHEMA_DEFINITION => function (SchemaDefinitionNode $def) : string { + return $this->join( + [ + 'schema', + $this->join($def->directives, ' '), + $this->block($def->operationTypes), + ], + ' ' + ); + }, + + NodeKind::OPERATION_TYPE_DEFINITION => static function (OperationTypeDefinitionNode $def) : string { + return $def->operation . ': ' . $def->type; + }, + + NodeKind::SCALAR_TYPE_DEFINITION => $this->addDescription(function (ScalarTypeDefinitionNode $def) : string { + return $this->join(['scalar', $def->name, $this->join($def->directives, ' ')], ' '); + }), + + NodeKind::OBJECT_TYPE_DEFINITION => $this->addDescription(function (ObjectTypeDefinitionNode $def) : string { + return $this->join( + [ + 'type', + $def->name, + $this->wrap('implements ', $this->join($def->interfaces, ' & ')), + $this->join($def->directives, ' '), + $this->block($def->fields), + ], + ' ' + ); + }), + + NodeKind::FIELD_DEFINITION => $this->addDescription(function (FieldDefinitionNode $def) : string { + $noIndent = Utils::every($def->arguments, static function (string $arg) : bool { + return strpos($arg, "\n") === false; + }); + + return $def->name + . ($noIndent + ? $this->wrap('(', $this->join($def->arguments, ', '), ')') + : $this->wrap("(\n", $this->indent($this->join($def->arguments, "\n")), "\n)")) + . ': ' . $def->type + . $this->wrap(' ', $this->join($def->directives, ' ')); + }), + + NodeKind::INPUT_VALUE_DEFINITION => $this->addDescription(function (InputValueDefinitionNode $def) : string { + return $this->join( + [ + $def->name . ': ' . $def->type, + $this->wrap('= ', $def->defaultValue), + $this->join($def->directives, ' '), + ], + ' ' + ); + }), + + NodeKind::INTERFACE_TYPE_DEFINITION => $this->addDescription( + function (InterfaceTypeDefinitionNode $def) : string { + return $this->join( + [ + 'interface', + $def->name, + $this->wrap('implements ', $this->join($def->interfaces, ' & ')), + $this->join($def->directives, ' '), + $this->block($def->fields), + ], + ' ' + ); + } + ), + + NodeKind::UNION_TYPE_DEFINITION => $this->addDescription(function (UnionTypeDefinitionNode $def) : string { + return $this->join( + [ + 'union', + $def->name, + $this->join($def->directives, ' '), + count($def->types ?? []) > 0 + ? '= ' . $this->join($def->types, ' | ') + : '', + ], + ' ' + ); + }), + + NodeKind::ENUM_TYPE_DEFINITION => $this->addDescription(function (EnumTypeDefinitionNode $def) : string { + return $this->join( + [ + 'enum', + $def->name, + $this->join($def->directives, ' '), + $this->block($def->values), + ], + ' ' + ); + }), + + NodeKind::ENUM_VALUE_DEFINITION => $this->addDescription(function (EnumValueDefinitionNode $def) : string { + return $this->join([$def->name, $this->join($def->directives, ' ')], ' '); + }), + + NodeKind::INPUT_OBJECT_TYPE_DEFINITION => $this->addDescription(function ( + InputObjectTypeDefinitionNode $def + ) : string { + return $this->join( + [ + 'input', + $def->name, + $this->join($def->directives, ' '), + $this->block($def->fields), + ], + ' ' + ); + }), + + NodeKind::SCHEMA_EXTENSION => function (SchemaTypeExtensionNode $def) : string { + return $this->join( + [ + 'extend schema', + $this->join($def->directives, ' '), + $this->block($def->operationTypes), + ], + ' ' + ); + }, + + NodeKind::SCALAR_TYPE_EXTENSION => function (ScalarTypeExtensionNode $def) : string { + return $this->join( + [ + 'extend scalar', + $def->name, + $this->join($def->directives, ' '), + ], + ' ' + ); + }, + + NodeKind::OBJECT_TYPE_EXTENSION => function (ObjectTypeExtensionNode $def) : string { + return $this->join( + [ + 'extend type', + $def->name, + $this->wrap('implements ', $this->join($def->interfaces, ' & ')), + $this->join($def->directives, ' '), + $this->block($def->fields), + ], + ' ' + ); + }, + + NodeKind::INTERFACE_TYPE_EXTENSION => function (InterfaceTypeExtensionNode $def) : string { + return $this->join( + [ + 'extend interface', + $def->name, + $this->wrap('implements ', $this->join($def->interfaces, ' & ')), + $this->join($def->directives, ' '), + $this->block($def->fields), + ], + ' ' + ); + }, + + NodeKind::UNION_TYPE_EXTENSION => function (UnionTypeExtensionNode $def) : string { + return $this->join( + [ + 'extend union', + $def->name, + $this->join($def->directives, ' '), + count($def->types ?? []) > 0 + ? '= ' . $this->join($def->types, ' | ') + : '', + ], + ' ' + ); + }, + + NodeKind::ENUM_TYPE_EXTENSION => function (EnumTypeExtensionNode $def) : string { + return $this->join( + [ + 'extend enum', + $def->name, + $this->join($def->directives, ' '), + $this->block($def->values), + ], + ' ' + ); + }, + + NodeKind::INPUT_OBJECT_TYPE_EXTENSION => function (InputObjectTypeExtensionNode $def) : string { + return $this->join( + [ + 'extend input', + $def->name, + $this->join($def->directives, ' '), + $this->block($def->fields), + ], + ' ' + ); + }, + + NodeKind::DIRECTIVE_DEFINITION => $this->addDescription(function (DirectiveDefinitionNode $def) : string { + $noIndent = Utils::every($def->arguments, static function (string $arg) : bool { + return strpos($arg, "\n") === false; + }); + + return 'directive @' + . $def->name + . ($noIndent + ? $this->wrap('(', $this->join($def->arguments, ', '), ')') + : $this->wrap("(\n", $this->indent($this->join($def->arguments, "\n")), "\n")) + . ($def->repeatable ? ' repeatable' : '') + . ' on ' . $this->join($def->locations, ' | '); + }), + ], + ] + ); + } + + public function addDescription(callable $cb) + { + return function ($node) use ($cb) : string { + return $this->join([$node->description, $cb($node)], "\n"); + }; + } + + /** + * If maybeString is not null or empty, then wrap with start and end, otherwise + * print an empty string. + */ + public function wrap($start, $maybeString, $end = '') + { + return $maybeString ? ($start . $maybeString . $end) : ''; + } + + /** + * Given array, print each item on its own line, wrapped in an + * indented "{ }" block. + */ + public function block($array) + { + return $array && $this->length($array) + ? "{\n" . $this->indent($this->join($array, "\n")) . "\n}" + : ''; + } + + public function indent($maybeString) + { + return $maybeString ? ' ' . str_replace("\n", "\n ", $maybeString) : ''; + } + + public function manyList($start, $list, $separator, $end) + { + return $this->length($list) === 0 ? null : ($start . $this->join($list, $separator) . $end); + } + + public function length($maybeArray) + { + return $maybeArray ? count($maybeArray) : 0; + } + + public function join($maybeArray, $separator = '') : string + { + return $maybeArray + ? implode( + $separator, + Utils::filter( + $maybeArray, + static function ($x) : bool { + return (bool) $x; + } + ) + ) + : ''; + } + + /** + * Print a block string in the indented block form by adding a leading and + * trailing blank line. However, if a block string starts with whitespace and is + * a single-line, adding a leading blank line would strip that whitespace. + */ + private function printBlockString($value, $isDescription) + { + $escaped = str_replace('"""', '\\"""', $value); + + return ($value[0] === ' ' || $value[0] === "\t") && strpos($value, "\n") === false + ? ('"""' . preg_replace('/"$/', "\"\n", $escaped) . '"""') + : ('"""' . "\n" . ($isDescription ? $escaped : $this->indent($escaped)) . "\n" . '"""'); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Source.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Source.php new file mode 100644 index 00000000..bd879407 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Source.php @@ -0,0 +1,85 @@ +body = $body; + $this->length = mb_strlen($body, 'UTF-8'); + $this->name = $name === '' || $name === null ? 'GraphQL request' : $name; + $this->locationOffset = $location ?? new SourceLocation(1, 1); + + Utils::invariant( + $this->locationOffset->line > 0, + 'line in locationOffset is 1-indexed and must be positive' + ); + Utils::invariant( + $this->locationOffset->column > 0, + 'column in locationOffset is 1-indexed and must be positive' + ); + } + + /** + * @param int $position + * + * @return SourceLocation + */ + public function getLocation($position) + { + $line = 1; + $column = $position + 1; + + $utfChars = json_decode('"\u2028\u2029"'); + $lineRegexp = '/\r\n|[\n\r' . $utfChars . ']/su'; + $matches = []; + preg_match_all($lineRegexp, mb_substr($this->body, 0, $position, 'UTF-8'), $matches, PREG_OFFSET_CAPTURE); + + foreach ($matches[0] as $index => $match) { + $line += 1; + + $column = $position + 1 - ($match[1] + mb_strlen($match[0], 'UTF-8')); + } + + return new SourceLocation($line, $column); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/SourceLocation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/SourceLocation.php new file mode 100644 index 00000000..d0041831 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/SourceLocation.php @@ -0,0 +1,55 @@ +line = $line; + $this->column = $col; + } + + /** + * @return int[] + */ + public function toArray() + { + return [ + 'line' => $this->line, + 'column' => $this->column, + ]; + } + + /** + * @return int[] + */ + public function toSerializableArray() + { + return $this->toArray(); + } + + /** + * @return int[] + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->toSerializableArray(); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Token.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Token.php new file mode 100644 index 00000000..1618103d --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Token.php @@ -0,0 +1,119 @@ +'; + public const EOF = ''; + public const BANG = '!'; + public const DOLLAR = '$'; + public const AMP = '&'; + public const PAREN_L = '('; + public const PAREN_R = ')'; + public const SPREAD = '...'; + public const COLON = ':'; + public const EQUALS = '='; + public const AT = '@'; + public const BRACKET_L = '['; + public const BRACKET_R = ']'; + public const BRACE_L = '{'; + public const PIPE = '|'; + public const BRACE_R = '}'; + public const NAME = 'Name'; + public const INT = 'Int'; + public const FLOAT = 'Float'; + public const STRING = 'String'; + public const BLOCK_STRING = 'BlockString'; + public const COMMENT = 'Comment'; + + /** + * The kind of Token (see one of constants above). + * + * @var string + */ + public $kind; + + /** + * The character offset at which this Node begins. + * + * @var int + */ + public $start; + + /** + * The character offset at which this Node ends. + * + * @var int + */ + public $end; + + /** + * The 1-indexed line number on which this Token appears. + * + * @var int + */ + public $line; + + /** + * The 1-indexed column number at which this Token begins. + * + * @var int + */ + public $column; + + /** @var string|null */ + public $value; + + /** + * Tokens exist as nodes in a double-linked-list amongst all tokens + * including ignored tokens. is always the first node and + * the last. + * + * @var Token + */ + public $prev; + + /** @var Token|null */ + public $next; + + /** + * @param mixed $value + */ + public function __construct(string $kind, int $start, int $end, int $line, int $column, ?Token $previous = null, $value = null) + { + $this->kind = $kind; + $this->start = $start; + $this->end = $end; + $this->line = $line; + $this->column = $column; + $this->prev = $previous; + $this->next = null; + $this->value = $value; + } + + public function getDescription() : string + { + return $this->kind . ($this->value === null ? '' : ' "' . $this->value . '"'); + } + + /** + * @return (string|int|null)[] + */ + public function toArray() : array + { + return [ + 'kind' => $this->kind, + 'value' => $this->value, + 'line' => $this->line, + 'column' => $this->column, + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Visitor.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Visitor.php new file mode 100644 index 00000000..95031e8a --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Visitor.php @@ -0,0 +1,538 @@ + function ($node, $key, $parent, $path, $ancestors) { + * // return + * // null: no action + * // Visitor::skipNode(): skip visiting this node + * // Visitor::stop(): stop visiting altogether + * // Visitor::removeNode(): delete this node + * // any value: replace this node with the returned value + * }, + * 'leave' => function ($node, $key, $parent, $path, $ancestors) { + * // return + * // null: no action + * // Visitor::stop(): stop visiting altogether + * // Visitor::removeNode(): delete this node + * // any value: replace this node with the returned value + * } + * ]); + * + * Alternatively to providing enter() and leave() functions, a visitor can + * instead provide functions named the same as the [kinds of AST nodes](reference.md#graphqllanguageastnodekind), + * or enter/leave visitors at a named key, leading to four permutations of + * visitor API: + * + * 1) Named visitors triggered when entering a node a specific kind. + * + * Visitor::visit($ast, [ + * 'Kind' => function ($node) { + * // enter the "Kind" node + * } + * ]); + * + * 2) Named visitors that trigger upon entering and leaving a node of + * a specific kind. + * + * Visitor::visit($ast, [ + * 'Kind' => [ + * 'enter' => function ($node) { + * // enter the "Kind" node + * } + * 'leave' => function ($node) { + * // leave the "Kind" node + * } + * ] + * ]); + * + * 3) Generic visitors that trigger upon entering and leaving any node. + * + * Visitor::visit($ast, [ + * 'enter' => function ($node) { + * // enter any node + * }, + * 'leave' => function ($node) { + * // leave any node + * } + * ]); + * + * 4) Parallel visitors for entering and leaving nodes of a specific kind. + * + * Visitor::visit($ast, [ + * 'enter' => [ + * 'Kind' => function($node) { + * // enter the "Kind" node + * } + * }, + * 'leave' => [ + * 'Kind' => function ($node) { + * // leave the "Kind" node + * } + * ] + * ]); + */ +class Visitor +{ + /** @var string[][] */ + public static $visitorKeys = [ + NodeKind::NAME => [], + NodeKind::DOCUMENT => ['definitions'], + NodeKind::OPERATION_DEFINITION => ['name', 'variableDefinitions', 'directives', 'selectionSet'], + NodeKind::VARIABLE_DEFINITION => ['variable', 'type', 'defaultValue', 'directives'], + NodeKind::VARIABLE => ['name'], + NodeKind::SELECTION_SET => ['selections'], + NodeKind::FIELD => ['alias', 'name', 'arguments', 'directives', 'selectionSet'], + NodeKind::ARGUMENT => ['name', 'value'], + NodeKind::FRAGMENT_SPREAD => ['name', 'directives'], + NodeKind::INLINE_FRAGMENT => ['typeCondition', 'directives', 'selectionSet'], + NodeKind::FRAGMENT_DEFINITION => [ + 'name', + // Note: fragment variable definitions are experimental and may be changed + // or removed in the future. + 'variableDefinitions', + 'typeCondition', + 'directives', + 'selectionSet', + ], + + NodeKind::INT => [], + NodeKind::FLOAT => [], + NodeKind::STRING => [], + NodeKind::BOOLEAN => [], + NodeKind::NULL => [], + NodeKind::ENUM => [], + NodeKind::LST => ['values'], + NodeKind::OBJECT => ['fields'], + NodeKind::OBJECT_FIELD => ['name', 'value'], + NodeKind::DIRECTIVE => ['name', 'arguments'], + NodeKind::NAMED_TYPE => ['name'], + NodeKind::LIST_TYPE => ['type'], + NodeKind::NON_NULL_TYPE => ['type'], + + NodeKind::SCHEMA_DEFINITION => ['directives', 'operationTypes'], + NodeKind::OPERATION_TYPE_DEFINITION => ['type'], + NodeKind::SCALAR_TYPE_DEFINITION => ['description', 'name', 'directives'], + NodeKind::OBJECT_TYPE_DEFINITION => ['description', 'name', 'interfaces', 'directives', 'fields'], + NodeKind::FIELD_DEFINITION => ['description', 'name', 'arguments', 'type', 'directives'], + NodeKind::INPUT_VALUE_DEFINITION => ['description', 'name', 'type', 'defaultValue', 'directives'], + NodeKind::INTERFACE_TYPE_DEFINITION => ['description', 'name', 'interfaces', 'directives', 'fields'], + NodeKind::UNION_TYPE_DEFINITION => ['description', 'name', 'directives', 'types'], + NodeKind::ENUM_TYPE_DEFINITION => ['description', 'name', 'directives', 'values'], + NodeKind::ENUM_VALUE_DEFINITION => ['description', 'name', 'directives'], + NodeKind::INPUT_OBJECT_TYPE_DEFINITION => ['description', 'name', 'directives', 'fields'], + + NodeKind::SCALAR_TYPE_EXTENSION => ['name', 'directives'], + NodeKind::OBJECT_TYPE_EXTENSION => ['name', 'interfaces', 'directives', 'fields'], + NodeKind::INTERFACE_TYPE_EXTENSION => ['name', 'interfaces', 'directives', 'fields'], + NodeKind::UNION_TYPE_EXTENSION => ['name', 'directives', 'types'], + NodeKind::ENUM_TYPE_EXTENSION => ['name', 'directives', 'values'], + NodeKind::INPUT_OBJECT_TYPE_EXTENSION => ['name', 'directives', 'fields'], + + NodeKind::DIRECTIVE_DEFINITION => ['description', 'name', 'arguments', 'locations'], + + NodeKind::SCHEMA_EXTENSION => ['directives', 'operationTypes'], + ]; + + /** + * Visit the AST (see class description for details) + * + * @param Node|ArrayObject|stdClass $root + * @param callable[] $visitor + * @param mixed[]|null $keyMap + * + * @return Node|mixed + * + * @throws Exception + * + * @api + */ + public static function visit($root, $visitor, $keyMap = null) + { + $visitorKeys = $keyMap ?? self::$visitorKeys; + + $stack = null; + $inArray = $root instanceof NodeList || is_array($root); + $keys = [$root]; + $index = -1; + $edits = []; + $parent = null; + $path = []; + $ancestors = []; + $newRoot = $root; + + $UNDEFINED = null; + + do { + $index++; + $isLeaving = $index === count($keys); + $key = null; + $node = null; + $isEdited = $isLeaving && count($edits) > 0; + + if ($isLeaving) { + $key = ! $ancestors ? $UNDEFINED : $path[count($path) - 1]; + $node = $parent; + $parent = array_pop($ancestors); + + if ($isEdited) { + if ($inArray) { + // $node = $node; // arrays are value types in PHP + if ($node instanceof NodeList) { + $node = clone $node; + } + } else { + $node = clone $node; + } + $editOffset = 0; + for ($ii = 0; $ii < count($edits); $ii++) { + $editKey = $edits[$ii][0]; + $editValue = $edits[$ii][1]; + + if ($inArray) { + $editKey -= $editOffset; + } + if ($inArray && $editValue === null) { + $node->splice($editKey, 1); + $editOffset++; + } else { + if ($node instanceof NodeList || is_array($node)) { + $node[$editKey] = $editValue; + } else { + $node->{$editKey} = $editValue; + } + } + } + } + $index = $stack['index']; + $keys = $stack['keys']; + $edits = $stack['edits']; + $inArray = $stack['inArray']; + $stack = $stack['prev']; + } else { + $key = $parent !== null + ? ($inArray + ? $index + : $keys[$index] + ) + : $UNDEFINED; + $node = $parent !== null + ? ($parent instanceof NodeList || is_array($parent) + ? $parent[$key] + : $parent->{$key} + ) + : $newRoot; + if ($node === null || $node === $UNDEFINED) { + continue; + } + if ($parent !== null) { + $path[] = $key; + } + } + + $result = null; + if (! $node instanceof NodeList && ! is_array($node)) { + if (! ($node instanceof Node)) { + throw new Exception('Invalid AST Node: ' . json_encode($node)); + } + + $visitFn = self::getVisitFn($visitor, $node->kind, $isLeaving); + + if ($visitFn !== null) { + $result = $visitFn($node, $key, $parent, $path, $ancestors); + $editValue = null; + + if ($result !== null) { + if ($result instanceof VisitorOperation) { + if ($result->doBreak) { + break; + } + if (! $isLeaving && $result->doContinue) { + array_pop($path); + continue; + } + if ($result->removeNode) { + $editValue = null; + } + } else { + $editValue = $result; + } + + $edits[] = [$key, $editValue]; + if (! $isLeaving) { + if (! ($editValue instanceof Node)) { + array_pop($path); + continue; + } + + $node = $editValue; + } + } + } + } + + if ($result === null && $isEdited) { + $edits[] = [$key, $node]; + } + + if ($isLeaving) { + array_pop($path); + } else { + $stack = [ + 'inArray' => $inArray, + 'index' => $index, + 'keys' => $keys, + 'edits' => $edits, + 'prev' => $stack, + ]; + $inArray = $node instanceof NodeList || is_array($node); + + $keys = ($inArray ? $node : $visitorKeys[$node->kind]) ?? []; + $index = -1; + $edits = []; + if ($parent !== null) { + $ancestors[] = $parent; + } + $parent = $node; + } + } while ($stack); + + if (count($edits) > 0) { + $newRoot = $edits[0][1]; + } + + return $newRoot; + } + + /** + * Returns marker for visitor break + * + * @return VisitorOperation + * + * @api + */ + public static function stop() + { + $r = new VisitorOperation(); + $r->doBreak = true; + + return $r; + } + + /** + * Returns marker for skipping current node + * + * @return VisitorOperation + * + * @api + */ + public static function skipNode() + { + $r = new VisitorOperation(); + $r->doContinue = true; + + return $r; + } + + /** + * Returns marker for removing a node + * + * @return VisitorOperation + * + * @api + */ + public static function removeNode() + { + $r = new VisitorOperation(); + $r->removeNode = true; + + return $r; + } + + /** + * @param callable[][] $visitors + * + * @return array + */ + public static function visitInParallel($visitors) + { + $visitorsCount = count($visitors); + $skipping = new SplFixedArray($visitorsCount); + + return [ + 'enter' => static function (Node $node) use ($visitors, $skipping, $visitorsCount) { + for ($i = 0; $i < $visitorsCount; $i++) { + if ($skipping[$i] !== null) { + continue; + } + + $fn = self::getVisitFn( + $visitors[$i], + $node->kind, /* isLeaving */ + false + ); + + if (! $fn) { + continue; + } + + $result = $fn(...func_get_args()); + + if ($result instanceof VisitorOperation) { + if ($result->doContinue) { + $skipping[$i] = $node; + } elseif ($result->doBreak) { + $skipping[$i] = $result; + } elseif ($result->removeNode) { + return $result; + } + } elseif ($result !== null) { + return $result; + } + } + }, + 'leave' => static function (Node $node) use ($visitors, $skipping, $visitorsCount) { + for ($i = 0; $i < $visitorsCount; $i++) { + if ($skipping[$i] === null) { + $fn = self::getVisitFn( + $visitors[$i], + $node->kind, /* isLeaving */ + true + ); + + if (isset($fn)) { + $result = $fn(...func_get_args()); + if ($result instanceof VisitorOperation) { + if ($result->doBreak) { + $skipping[$i] = $result; + } elseif ($result->removeNode) { + return $result; + } + } elseif ($result !== null) { + return $result; + } + } + } elseif ($skipping[$i] === $node) { + $skipping[$i] = null; + } + } + }, + ]; + } + + /** + * Creates a new visitor instance which maintains a provided TypeInfo instance + * along with visiting visitor. + */ + public static function visitWithTypeInfo(TypeInfo $typeInfo, $visitor) + { + return [ + 'enter' => static function (Node $node) use ($typeInfo, $visitor) { + $typeInfo->enter($node); + $fn = self::getVisitFn($visitor, $node->kind, false); + + if (isset($fn)) { + $result = $fn(...func_get_args()); + if ($result !== null) { + $typeInfo->leave($node); + if ($result instanceof Node) { + $typeInfo->enter($result); + } + } + + return $result; + } + + return null; + }, + 'leave' => static function (Node $node) use ($typeInfo, $visitor) { + $fn = self::getVisitFn($visitor, $node->kind, true); + $result = $fn !== null + ? $fn(...func_get_args()) + : null; + + $typeInfo->leave($node); + + return $result; + }, + ]; + } + + /** + * @param callable[]|null $visitor + * @param string $kind + * @param bool $isLeaving + */ + public static function getVisitFn($visitor, $kind, $isLeaving) : ?callable + { + if ($visitor === null) { + return null; + } + + $kindVisitor = $visitor[$kind] ?? null; + + if (is_array($kindVisitor)) { + if ($isLeaving) { + $kindSpecificVisitor = $kindVisitor['leave'] ?? null; + } else { + $kindSpecificVisitor = $kindVisitor['enter'] ?? null; + } + + return $kindSpecificVisitor; + } + + if ($kindVisitor !== null && ! $isLeaving) { + return $kindVisitor; + } + + $visitor += ['leave' => null, 'enter' => null]; + + $specificVisitor = $isLeaving ? $visitor['leave'] : $visitor['enter']; + + if (isset($specificVisitor)) { + if (! is_array($specificVisitor)) { + // { enter() {}, leave() {} } + return $specificVisitor; + } + + return $specificVisitor[$kind] ?? null; + } + + return null; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/VisitorOperation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/VisitorOperation.php new file mode 100644 index 00000000..23162616 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/VisitorOperation.php @@ -0,0 +1,17 @@ +readRawBody(); + $bodyParams = ['query' => $rawBody ?? '']; + } elseif (stripos($contentType, 'application/json') !== false) { + $rawBody = $readRawBodyFn ? + $readRawBodyFn() + : $this->readRawBody(); + $bodyParams = json_decode($rawBody ?? '', true); + + if (json_last_error()) { + throw new RequestError('Could not parse JSON: ' . json_last_error_msg()); + } + + if (! is_array($bodyParams)) { + throw new RequestError( + 'GraphQL Server expects JSON object or array, but got ' . + Utils::printSafeJson($bodyParams) + ); + } + } elseif (stripos($contentType, 'application/x-www-form-urlencoded') !== false) { + $bodyParams = $_POST; + } elseif (stripos($contentType, 'multipart/form-data') !== false) { + $bodyParams = $_POST; + } else { + throw new RequestError('Unexpected content type: ' . Utils::printSafeJson($contentType)); + } + } + + return $this->parseRequestParams($method, $bodyParams, $urlParams); + } + + /** + * Parses normalized request params and returns instance of OperationParams + * or array of OperationParams in case of batch operation. + * + * Returned value is a suitable input for `executeOperation` or `executeBatch` (if array) + * + * @param string $method + * @param mixed[] $bodyParams + * @param mixed[] $queryParams + * + * @return OperationParams|OperationParams[] + * + * @throws RequestError + * + * @api + */ + public function parseRequestParams($method, array $bodyParams, array $queryParams) + { + if ($method === 'GET') { + $result = OperationParams::create($queryParams, true); + } elseif ($method === 'POST') { + if (isset($bodyParams[0])) { + $result = []; + foreach ($bodyParams as $index => $entry) { + $op = OperationParams::create($entry); + $result[] = $op; + } + } else { + $result = OperationParams::create($bodyParams); + } + } else { + throw new RequestError('HTTP Method "' . $method . '" is not supported'); + } + + return $result; + } + + /** + * Checks validity of OperationParams extracted from HTTP request and returns an array of errors + * if params are invalid (or empty array when params are valid) + * + * @return array + * + * @api + */ + public function validateOperationParams(OperationParams $params) + { + $errors = []; + if (! $params->query && ! $params->queryId) { + $errors[] = new RequestError('GraphQL Request must include at least one of those two parameters: "query" or "queryId"'); + } + + if ($params->query && $params->queryId) { + $errors[] = new RequestError('GraphQL Request parameters "query" and "queryId" are mutually exclusive'); + } + + if ($params->query !== null && ! is_string($params->query)) { + $errors[] = new RequestError( + 'GraphQL Request parameter "query" must be string, but got ' . + Utils::printSafeJson($params->query) + ); + } + + if ($params->queryId !== null && ! is_string($params->queryId)) { + $errors[] = new RequestError( + 'GraphQL Request parameter "queryId" must be string, but got ' . + Utils::printSafeJson($params->queryId) + ); + } + + if ($params->operation !== null && ! is_string($params->operation)) { + $errors[] = new RequestError( + 'GraphQL Request parameter "operation" must be string, but got ' . + Utils::printSafeJson($params->operation) + ); + } + + if ($params->variables !== null && (! is_array($params->variables) || isset($params->variables[0]))) { + $errors[] = new RequestError( + 'GraphQL Request parameter "variables" must be object or JSON string parsed to object, but got ' . + Utils::printSafeJson($params->getOriginalInput('variables')) + ); + } + + return $errors; + } + + /** + * Executes GraphQL operation with given server configuration and returns execution result + * (or promise when promise adapter is different from SyncPromiseAdapter) + * + * @return ExecutionResult|Promise + * + * @api + */ + public function executeOperation(ServerConfig $config, OperationParams $op) + { + $promiseAdapter = $config->getPromiseAdapter() ?? Executor::getPromiseAdapter(); + $result = $this->promiseToExecuteOperation($promiseAdapter, $config, $op); + + if ($promiseAdapter instanceof SyncPromiseAdapter) { + $result = $promiseAdapter->wait($result); + } + + return $result; + } + + /** + * Executes batched GraphQL operations with shared promise queue + * (thus, effectively batching deferreds|promises of all queries at once) + * + * @param OperationParams[] $operations + * + * @return ExecutionResult|ExecutionResult[]|Promise + * + * @api + */ + public function executeBatch(ServerConfig $config, array $operations) + { + $promiseAdapter = $config->getPromiseAdapter() ?? Executor::getPromiseAdapter(); + $result = []; + + foreach ($operations as $operation) { + $result[] = $this->promiseToExecuteOperation($promiseAdapter, $config, $operation, true); + } + + $result = $promiseAdapter->all($result); + + // Wait for promised results when using sync promises + if ($promiseAdapter instanceof SyncPromiseAdapter) { + $result = $promiseAdapter->wait($result); + } + + return $result; + } + + /** + * @param bool $isBatch + * + * @return Promise + */ + private function promiseToExecuteOperation( + PromiseAdapter $promiseAdapter, + ServerConfig $config, + OperationParams $op, + $isBatch = false + ) { + try { + if ($config->getSchema() === null) { + throw new InvariantViolation('Schema is required for the server'); + } + + if ($isBatch && ! $config->getQueryBatching()) { + throw new RequestError('Batched queries are not supported by this server'); + } + + $errors = $this->validateOperationParams($op); + + if (count($errors) > 0) { + $errors = Utils::map( + $errors, + static function (RequestError $err) : Error { + return Error::createLocatedError($err, null, null); + } + ); + + return $promiseAdapter->createFulfilled( + new ExecutionResult(null, $errors) + ); + } + + $doc = $op->queryId + ? $this->loadPersistedQuery($config, $op) + : $op->query; + + if (! $doc instanceof DocumentNode) { + $doc = Parser::parse($doc); + } + + $operationType = AST::getOperation($doc, $op->operation); + + if ($operationType === false) { + throw new RequestError('Failed to determine operation type'); + } + + if ($operationType !== 'query' && $op->isReadOnly()) { + throw new RequestError('GET supports only query operation'); + } + + $result = GraphQL::promiseToExecute( + $promiseAdapter, + $config->getSchema(), + $doc, + $this->resolveRootValue($config, $op, $doc, $operationType), + $this->resolveContextValue($config, $op, $doc, $operationType), + $op->variables, + $op->operation, + $config->getFieldResolver(), + $this->resolveValidationRules($config, $op, $doc, $operationType) + ); + } catch (RequestError $e) { + $result = $promiseAdapter->createFulfilled( + new ExecutionResult(null, [Error::createLocatedError($e)]) + ); + } catch (Error $e) { + $result = $promiseAdapter->createFulfilled( + new ExecutionResult(null, [$e]) + ); + } + + $applyErrorHandling = static function (ExecutionResult $result) use ($config) : ExecutionResult { + if ($config->getErrorsHandler()) { + $result->setErrorsHandler($config->getErrorsHandler()); + } + if ($config->getErrorFormatter() || $config->getDebugFlag() !== DebugFlag::NONE) { + $result->setErrorFormatter( + FormattedError::prepareFormatter( + $config->getErrorFormatter(), + $config->getDebugFlag() + ) + ); + } + + return $result; + }; + + return $result->then($applyErrorHandling); + } + + /** + * @return mixed + * + * @throws RequestError + */ + private function loadPersistedQuery(ServerConfig $config, OperationParams $operationParams) + { + // Load query if we got persisted query id: + $loader = $config->getPersistentQueryLoader(); + + if ($loader === null) { + throw new RequestError('Persisted queries are not supported by this server'); + } + + $source = $loader($operationParams->queryId, $operationParams); + + if (! is_string($source) && ! $source instanceof DocumentNode) { + throw new InvariantViolation(sprintf( + 'Persistent query loader must return query string or instance of %s but got: %s', + DocumentNode::class, + Utils::printSafe($source) + )); + } + + return $source; + } + + /** + * @param string $operationType + * + * @return mixed[]|null + */ + private function resolveValidationRules( + ServerConfig $config, + OperationParams $params, + DocumentNode $doc, + $operationType + ) { + // Allow customizing validation rules per operation: + $validationRules = $config->getValidationRules(); + + if (is_callable($validationRules)) { + $validationRules = $validationRules($params, $doc, $operationType); + + if (! is_array($validationRules)) { + throw new InvariantViolation(sprintf( + 'Expecting validation rules to be array or callable returning array, but got: %s', + Utils::printSafe($validationRules) + )); + } + } + + return $validationRules; + } + + /** + * @return mixed + */ + private function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $doc, string $operationType) + { + $rootValue = $config->getRootValue(); + + if (is_callable($rootValue)) { + $rootValue = $rootValue($params, $doc, $operationType); + } + + return $rootValue; + } + + /** + * @param string $operationType + * + * @return mixed + */ + private function resolveContextValue( + ServerConfig $config, + OperationParams $params, + DocumentNode $doc, + $operationType + ) { + $context = $config->getContext(); + + if (is_callable($context)) { + $context = $context($params, $doc, $operationType); + } + + return $context; + } + + /** + * Send response using standard PHP `header()` and `echo`. + * + * @param Promise|ExecutionResult|ExecutionResult[] $result + * @param bool $exitWhenDone + * + * @api + */ + public function sendResponse($result, $exitWhenDone = false) + { + if ($result instanceof Promise) { + $result->then(function ($actualResult) use ($exitWhenDone) : void { + $this->doSendResponse($actualResult, $exitWhenDone); + }); + } else { + $this->doSendResponse($result, $exitWhenDone); + } + } + + private function doSendResponse($result, $exitWhenDone) + { + $httpStatus = $this->resolveHttpStatus($result); + $this->emitResponse($result, $httpStatus, $exitWhenDone); + } + + /** + * @param mixed[]|JsonSerializable $jsonSerializable + * @param int $httpStatus + * @param bool $exitWhenDone + */ + public function emitResponse($jsonSerializable, $httpStatus, $exitWhenDone) + { + $body = json_encode($jsonSerializable); + header('Content-Type: application/json', true, $httpStatus); + echo $body; + + if ($exitWhenDone) { + exit; + } + } + + /** + * @return bool|string + */ + private function readRawBody() + { + return file_get_contents('php://input'); + } + + /** + * @param ExecutionResult|mixed[] $result + * + * @return int + */ + private function resolveHttpStatus($result) + { + if (is_array($result) && isset($result[0])) { + Utils::each( + $result, + static function ($executionResult, $index) : void { + if (! $executionResult instanceof ExecutionResult) { + throw new InvariantViolation(sprintf( + 'Expecting every entry of batched query result to be instance of %s but entry at position %d is %s', + ExecutionResult::class, + $index, + Utils::printSafe($executionResult) + )); + } + } + ); + $httpStatus = 200; + } else { + if (! $result instanceof ExecutionResult) { + throw new InvariantViolation(sprintf( + 'Expecting query result to be instance of %s but got %s', + ExecutionResult::class, + Utils::printSafe($result) + )); + } + if ($result->data === null && count($result->errors) > 0) { + $httpStatus = 400; + } else { + $httpStatus = 200; + } + } + + return $httpStatus; + } + + /** + * Converts PSR-7 request to OperationParams[] + * + * @return OperationParams[]|OperationParams + * + * @throws RequestError + * + * @api + */ + public function parsePsrRequest(RequestInterface $request) + { + if ($request->getMethod() === 'GET') { + $bodyParams = []; + } else { + $contentType = $request->getHeader('content-type'); + + if (! isset($contentType[0])) { + throw new RequestError('Missing "Content-Type" header'); + } + + if (stripos($contentType[0], 'application/graphql') !== false) { + $bodyParams = ['query' => (string) $request->getBody()]; + } elseif (stripos($contentType[0], 'application/json') !== false) { + $bodyParams = $request instanceof ServerRequestInterface + ? $request->getParsedBody() + : json_decode((string) $request->getBody(), true); + + if ($bodyParams === null) { + throw new InvariantViolation( + $request instanceof ServerRequestInterface + ? 'Expected to receive a parsed body for "application/json" PSR-7 request but got null' + : 'Expected to receive a JSON array in body for "application/json" PSR-7 request' + ); + } + + if (! is_array($bodyParams)) { + throw new RequestError( + 'GraphQL Server expects JSON object or array, but got ' . + Utils::printSafeJson($bodyParams) + ); + } + } else { + if ($request instanceof ServerRequestInterface) { + $bodyParams = $request->getParsedBody(); + } + + if (! isset($bodyParams)) { + $bodyParams = $this->decodeContent((string) $request->getBody(), $contentType[0]); + } + } + } + + parse_str(html_entity_decode($request->getUri()->getQuery()), $queryParams); + + return $this->parseRequestParams( + $request->getMethod(), + $bodyParams, + $queryParams + ); + } + + /** + * @return array + * + * @throws RequestError + */ + protected function decodeContent(string $rawBody, string $contentType) : array + { + parse_str($rawBody, $bodyParams); + + if (! is_array($bodyParams)) { + throw new RequestError('Unexpected content type: ' . Utils::printSafeJson($contentType)); + } + + return $bodyParams; + } + + /** + * Converts query execution result to PSR-7 response + * + * @param Promise|ExecutionResult|ExecutionResult[] $result + * + * @return Promise|ResponseInterface + * + * @api + */ + public function toPsrResponse($result, ResponseInterface $response, StreamInterface $writableBodyStream) + { + if ($result instanceof Promise) { + return $result->then(function ($actualResult) use ($response, $writableBodyStream) { + return $this->doConvertToPsrResponse($actualResult, $response, $writableBodyStream); + }); + } + + return $this->doConvertToPsrResponse($result, $response, $writableBodyStream); + } + + private function doConvertToPsrResponse($result, ResponseInterface $response, StreamInterface $writableBodyStream) + { + $httpStatus = $this->resolveHttpStatus($result); + + $result = json_encode($result); + $writableBodyStream->write($result); + + return $response + ->withStatus($httpStatus) + ->withHeader('Content-Type', 'application/json') + ->withBody($writableBodyStream); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/OperationParams.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/OperationParams.php new file mode 100644 index 00000000..5490ca41 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/OperationParams.php @@ -0,0 +1,144 @@ +originalInput = $params; + + $params += [ + 'query' => null, + 'queryid' => null, + 'documentid' => null, // alias to queryid + 'id' => null, // alias to queryid + 'operationname' => null, + 'variables' => null, + 'extensions' => null, + ]; + + if ($params['variables'] === '') { + $params['variables'] = null; + } + + // Some parameters could be provided as serialized JSON. + foreach (['extensions', 'variables'] as $param) { + if (! is_string($params[$param])) { + continue; + } + + $tmp = json_decode($params[$param], true); + if (json_last_error() !== JSON_ERROR_NONE) { + continue; + } + + $params[$param] = $tmp; + } + + $instance->query = $params['query']; + $instance->queryId = $params['queryid'] ?? $params['documentid'] ?? $params['id']; + $instance->operation = $params['operationname']; + $instance->variables = $params['variables']; + $instance->extensions = $params['extensions']; + $instance->readOnly = $readonly; + + // Apollo server/client compatibility: look for the queryid in extensions + if (isset($instance->extensions['persistedQuery']['sha256Hash']) && strlen($instance->query ?? '') === 0 && strlen($instance->queryId ?? '') === 0) { + $instance->queryId = $instance->extensions['persistedQuery']['sha256Hash']; + } + + return $instance; + } + + /** + * @param string $key + * + * @return mixed + * + * @api + */ + public function getOriginalInput($key) + { + return $this->originalInput[$key] ?? null; + } + + /** + * Indicates that operation is executed in read-only context + * (e.g. via HTTP GET request) + * + * @return bool + * + * @api + */ + public function isReadOnly() + { + return $this->readOnly; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/RequestError.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/RequestError.php new file mode 100644 index 00000000..320aad47 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/RequestError.php @@ -0,0 +1,33 @@ +setSchema($mySchema) + * ->setContext($myContext); + * + * $server = new GraphQL\Server\StandardServer($config); + */ +class ServerConfig +{ + /** + * Converts an array of options to instance of ServerConfig + * (or just returns empty config when array is not passed). + * + * @param mixed[] $config + * + * @return ServerConfig + * + * @api + */ + public static function create(array $config = []) + { + $instance = new static(); + foreach ($config as $key => $value) { + $method = 'set' . ucfirst($key); + if (! method_exists($instance, $method)) { + throw new InvariantViolation(sprintf('Unknown server config option "%s"', $key)); + } + $instance->$method($value); + } + + return $instance; + } + + /** @var Schema|null */ + private $schema; + + /** @var mixed|callable */ + private $context; + + /** @var mixed|callable */ + private $rootValue; + + /** @var callable|null */ + private $errorFormatter; + + /** @var callable|null */ + private $errorsHandler; + + /** @var int */ + private $debugFlag = DebugFlag::NONE; + + /** @var bool */ + private $queryBatching = false; + + /** @var ValidationRule[]|callable|null */ + private $validationRules; + + /** @var callable|null */ + private $fieldResolver; + + /** @var PromiseAdapter|null */ + private $promiseAdapter; + + /** @var callable|null */ + private $persistentQueryLoader; + + /** + * @return self + * + * @api + */ + public function setSchema(Schema $schema) + { + $this->schema = $schema; + + return $this; + } + + /** + * @param mixed|callable $context + * + * @return self + * + * @api + */ + public function setContext($context) + { + $this->context = $context; + + return $this; + } + + /** + * @param mixed|callable $rootValue + * + * @return self + * + * @api + */ + public function setRootValue($rootValue) + { + $this->rootValue = $rootValue; + + return $this; + } + + /** + * Expects function(Throwable $e) : array + * + * @return self + * + * @api + */ + public function setErrorFormatter(callable $errorFormatter) + { + $this->errorFormatter = $errorFormatter; + + return $this; + } + + /** + * Expects function(array $errors, callable $formatter) : array + * + * @return self + * + * @api + */ + public function setErrorsHandler(callable $handler) + { + $this->errorsHandler = $handler; + + return $this; + } + + /** + * Set validation rules for this server. + * + * @param ValidationRule[]|callable|null $validationRules + * + * @return self + * + * @api + */ + public function setValidationRules($validationRules) + { + if (! is_callable($validationRules) && ! is_array($validationRules) && $validationRules !== null) { + throw new InvariantViolation( + 'Server config expects array of validation rules or callable returning such array, but got ' . + Utils::printSafe($validationRules) + ); + } + + $this->validationRules = $validationRules; + + return $this; + } + + /** + * @return self + * + * @api + */ + public function setFieldResolver(callable $fieldResolver) + { + $this->fieldResolver = $fieldResolver; + + return $this; + } + + /** + * Expects function($queryId, OperationParams $params) : string|DocumentNode + * + * This function must return query string or valid DocumentNode. + * + * @return self + * + * @api + */ + public function setPersistentQueryLoader(callable $persistentQueryLoader) + { + $this->persistentQueryLoader = $persistentQueryLoader; + + return $this; + } + + /** + * Set response debug flags. @see \GraphQL\Error\DebugFlag class for a list of all available flags + * + * @api + */ + public function setDebugFlag(int $debugFlag = DebugFlag::INCLUDE_DEBUG_MESSAGE) : self + { + $this->debugFlag = $debugFlag; + + return $this; + } + + /** + * Allow batching queries (disabled by default) + * + * @api + */ + public function setQueryBatching(bool $enableBatching) : self + { + $this->queryBatching = $enableBatching; + + return $this; + } + + /** + * @return self + * + * @api + */ + public function setPromiseAdapter(PromiseAdapter $promiseAdapter) + { + $this->promiseAdapter = $promiseAdapter; + + return $this; + } + + /** + * @return mixed|callable + */ + public function getContext() + { + return $this->context; + } + + /** + * @return mixed|callable + */ + public function getRootValue() + { + return $this->rootValue; + } + + /** + * @return Schema|null + */ + public function getSchema() + { + return $this->schema; + } + + /** + * @return callable|null + */ + public function getErrorFormatter() + { + return $this->errorFormatter; + } + + /** + * @return callable|null + */ + public function getErrorsHandler() + { + return $this->errorsHandler; + } + + /** + * @return PromiseAdapter|null + */ + public function getPromiseAdapter() + { + return $this->promiseAdapter; + } + + /** + * @return ValidationRule[]|callable|null + */ + public function getValidationRules() + { + return $this->validationRules; + } + + /** + * @return callable|null + */ + public function getFieldResolver() + { + return $this->fieldResolver; + } + + /** + * @return callable|null + */ + public function getPersistentQueryLoader() + { + return $this->persistentQueryLoader; + } + + public function getDebugFlag() : int + { + return $this->debugFlag; + } + + /** + * @return bool + */ + public function getQueryBatching() + { + return $this->queryBatching; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/StandardServer.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/StandardServer.php new file mode 100644 index 00000000..bb128ea9 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/StandardServer.php @@ -0,0 +1,186 @@ + $mySchema + * ]); + * $server->handleRequest(); + * + * Or using [ServerConfig](reference.md#graphqlserverserverconfig) instance: + * + * $config = GraphQL\Server\ServerConfig::create() + * ->setSchema($mySchema) + * ->setContext($myContext); + * + * $server = new GraphQL\Server\StandardServer($config); + * $server->handleRequest(); + * + * See [dedicated section in docs](executing-queries.md#using-server) for details. + */ +class StandardServer +{ + /** @var ServerConfig */ + private $config; + + /** @var Helper */ + private $helper; + + /** + * Converts and exception to error and sends spec-compliant HTTP 500 error. + * Useful when an exception is thrown somewhere outside of server execution context + * (e.g. during schema instantiation). + * + * @param Throwable $error + * @param int $debug + * @param bool $exitWhenDone + * + * @api + */ + public static function send500Error($error, $debug = DebugFlag::NONE, $exitWhenDone = false) + { + $response = [ + 'errors' => [FormattedError::createFromException($error, $debug)], + ]; + $helper = new Helper(); + $helper->emitResponse($response, 500, $exitWhenDone); + } + + /** + * Creates new instance of a standard GraphQL HTTP server + * + * @param ServerConfig|mixed[] $config + * + * @api + */ + public function __construct($config) + { + if (is_array($config)) { + $config = ServerConfig::create($config); + } + if (! $config instanceof ServerConfig) { + throw new InvariantViolation('Expecting valid server config, but got ' . Utils::printSafe($config)); + } + $this->config = $config; + $this->helper = new Helper(); + } + + /** + * Parses HTTP request, executes and emits response (using standard PHP `header` function and `echo`) + * + * By default (when $parsedBody is not set) it uses PHP globals to parse a request. + * It is possible to implement request parsing elsewhere (e.g. using framework Request instance) + * and then pass it to the server. + * + * See `executeRequest()` if you prefer to emit response yourself + * (e.g. using Response object of some framework) + * + * @param OperationParams|OperationParams[] $parsedBody + * @param bool $exitWhenDone + * + * @api + */ + public function handleRequest($parsedBody = null, $exitWhenDone = false) + { + $result = $this->executeRequest($parsedBody); + $this->helper->sendResponse($result, $exitWhenDone); + } + + /** + * Executes GraphQL operation and returns execution result + * (or promise when promise adapter is different from SyncPromiseAdapter). + * + * By default (when $parsedBody is not set) it uses PHP globals to parse a request. + * It is possible to implement request parsing elsewhere (e.g. using framework Request instance) + * and then pass it to the server. + * + * PSR-7 compatible method executePsrRequest() does exactly this. + * + * @param OperationParams|OperationParams[] $parsedBody + * + * @return ExecutionResult|ExecutionResult[]|Promise + * + * @throws InvariantViolation + * + * @api + */ + public function executeRequest($parsedBody = null) + { + if ($parsedBody === null) { + $parsedBody = $this->helper->parseHttpRequest(); + } + + if (is_array($parsedBody)) { + return $this->helper->executeBatch($this->config, $parsedBody); + } + + return $this->helper->executeOperation($this->config, $parsedBody); + } + + /** + * Executes PSR-7 request and fulfills PSR-7 response. + * + * See `executePsrRequest()` if you prefer to create response yourself + * (e.g. using specific JsonResponse instance of some framework). + * + * @return ResponseInterface|Promise + * + * @api + */ + public function processPsrRequest( + RequestInterface $request, + ResponseInterface $response, + StreamInterface $writableBodyStream + ) { + $result = $this->executePsrRequest($request); + + return $this->helper->toPsrResponse($result, $response, $writableBodyStream); + } + + /** + * Executes GraphQL operation and returns execution result + * (or promise when promise adapter is different from SyncPromiseAdapter) + * + * @return ExecutionResult|ExecutionResult[]|Promise + * + * @api + */ + public function executePsrRequest(RequestInterface $request) + { + $parsedBody = $this->helper->parsePsrRequest($request); + + return $this->executeRequest($parsedBody); + } + + /** + * Returns an instance of Server helper, which contains most of the actual logic for + * parsing / validating / executing request (which could be re-used by other server implementations) + * + * @return Helper + * + * @api + */ + public function getHelper() + { + return $this->helper; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/AbstractType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/AbstractType.php new file mode 100644 index 00000000..e0257154 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/AbstractType.php @@ -0,0 +1,23 @@ +value; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php new file mode 100644 index 00000000..7223ebe1 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php @@ -0,0 +1,16 @@ +config['serialize']($value); + } + + /** + * @param mixed $value + * + * @return mixed + */ + public function parseValue($value) + { + if (isset($this->config['parseValue'])) { + return $this->config['parseValue']($value); + } + + return $value; + } + + /** + * @param mixed[]|null $variables + * + * @return mixed + * + * @throws Exception + */ + public function parseLiteral(Node $valueNode, ?array $variables = null) + { + if (isset($this->config['parseLiteral'])) { + return $this->config['parseLiteral']($valueNode, $variables); + } + + return AST::valueFromASTUntyped($valueNode, $variables); + } + + public function assertValid() + { + parent::assertValid(); + + Utils::invariant( + isset($this->config['serialize']) && is_callable($this->config['serialize']), + sprintf('%s must provide "serialize" function. If this custom Scalar ', $this->name) . + 'is also used as an input type, ensure "parseValue" and "parseLiteral" ' . + 'functions are also provided.' + ); + if (! isset($this->config['parseValue']) && ! isset($this->config['parseLiteral'])) { + return; + } + + Utils::invariant( + isset($this->config['parseValue']) && isset($this->config['parseLiteral']) && + is_callable($this->config['parseValue']) && is_callable($this->config['parseLiteral']), + sprintf('%s must provide both "parseValue" and "parseLiteral" functions.', $this->name) + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Directive.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Directive.php new file mode 100644 index 00000000..a04a0891 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Directive.php @@ -0,0 +1,185 @@ +name = $config['name']; + + $this->description = $config['description'] ?? null; + + if (isset($config['args'])) { + $args = []; + foreach ($config['args'] as $name => $arg) { + if (is_array($arg)) { + $args[] = new FieldArgument($arg + ['name' => $name]); + } else { + $args[] = $arg; + } + } + $this->args = $args; + } + + if (! isset($config['locations']) || ! is_array($config['locations'])) { + throw new InvariantViolation('Must provide locations for directive.'); + } + $this->locations = $config['locations']; + + $this->isRepeatable = $config['isRepeatable'] ?? false; + $this->astNode = $config['astNode'] ?? null; + + $this->config = $config; + } + + /** + * @return Directive + */ + public static function includeDirective() + { + $internal = self::getInternalDirectives(); + + return $internal['include']; + } + + /** + * @return Directive[] + */ + public static function getInternalDirectives() : array + { + if (self::$internalDirectives === null) { + self::$internalDirectives = [ + 'include' => new self([ + 'name' => self::INCLUDE_NAME, + 'description' => 'Directs the executor to include this field or fragment only when the `if` argument is true.', + 'locations' => [ + DirectiveLocation::FIELD, + DirectiveLocation::FRAGMENT_SPREAD, + DirectiveLocation::INLINE_FRAGMENT, + ], + 'args' => [ + new FieldArgument([ + 'name' => self::IF_ARGUMENT_NAME, + 'type' => Type::nonNull(Type::boolean()), + 'description' => 'Included when true.', + ]), + ], + ]), + 'skip' => new self([ + 'name' => self::SKIP_NAME, + 'description' => 'Directs the executor to skip this field or fragment when the `if` argument is true.', + 'locations' => [ + DirectiveLocation::FIELD, + DirectiveLocation::FRAGMENT_SPREAD, + DirectiveLocation::INLINE_FRAGMENT, + ], + 'args' => [ + new FieldArgument([ + 'name' => self::IF_ARGUMENT_NAME, + 'type' => Type::nonNull(Type::boolean()), + 'description' => 'Skipped when true.', + ]), + ], + ]), + 'deprecated' => new self([ + 'name' => self::DEPRECATED_NAME, + 'description' => 'Marks an element of a GraphQL schema as no longer supported.', + 'locations' => [ + DirectiveLocation::FIELD_DEFINITION, + DirectiveLocation::ENUM_VALUE, + ], + 'args' => [ + new FieldArgument([ + 'name' => self::REASON_ARGUMENT_NAME, + 'type' => Type::string(), + 'description' => + 'Explains why this element was deprecated, usually also including a ' . + 'suggestion for how to access supported similar data. Formatted using ' . + 'the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).', + 'defaultValue' => self::DEFAULT_DEPRECATION_REASON, + ]), + ], + ]), + ]; + } + + return self::$internalDirectives; + } + + /** + * @return Directive + */ + public static function skipDirective() + { + $internal = self::getInternalDirectives(); + + return $internal['skip']; + } + + /** + * @return Directive + */ + public static function deprecatedDirective() + { + $internal = self::getInternalDirectives(); + + return $internal['deprecated']; + } + + /** + * @return bool + */ + public static function isSpecifiedDirective(Directive $directive) + { + return array_key_exists($directive->name, self::getInternalDirectives()); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumType.php new file mode 100644 index 00000000..9451ec74 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumType.php @@ -0,0 +1,229 @@ +, PHPStan won't let us type it that way. + * + * @var MixedStore + */ + private $valueLookup; + + /** @var ArrayObject */ + private $nameLookup; + + /** @var EnumTypeExtensionNode[] */ + public $extensionASTNodes; + + public function __construct($config) + { + if (! isset($config['name'])) { + $config['name'] = $this->tryInferName(); + } + + Utils::invariant(is_string($config['name']), 'Must provide name.'); + + $this->name = $config['name']; + $this->description = $config['description'] ?? null; + $this->astNode = $config['astNode'] ?? null; + $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; + $this->config = $config; + } + + /** + * @param string|mixed[] $name + * + * @return EnumValueDefinition|null + */ + public function getValue($name) + { + $lookup = $this->getNameLookup(); + + if (! is_string($name)) { + return null; + } + + return $lookup[$name] ?? null; + } + + private function getNameLookup() : ArrayObject + { + if (! $this->nameLookup) { + /** @var ArrayObject $lookup */ + $lookup = new ArrayObject(); + foreach ($this->getValues() as $value) { + $lookup[$value->name] = $value; + } + $this->nameLookup = $lookup; + } + + return $this->nameLookup; + } + + /** + * @return EnumValueDefinition[] + */ + public function getValues() : array + { + if (! isset($this->values)) { + $this->values = []; + $config = $this->config; + + if (isset($config['values'])) { + if (! is_array($config['values'])) { + throw new InvariantViolation(sprintf('%s values must be an array', $this->name)); + } + foreach ($config['values'] as $name => $value) { + if (is_string($name)) { + if (is_array($value)) { + $value += ['name' => $name, 'value' => $name]; + } else { + $value = ['name' => $name, 'value' => $value]; + } + } elseif (is_int($name) && is_string($value)) { + $value = ['name' => $value, 'value' => $value]; + } else { + throw new InvariantViolation( + sprintf( + '%s values must be an array with value names as keys.', + $this->name + ) + ); + } + $this->values[] = new EnumValueDefinition($value); + } + } + } + + return $this->values; + } + + /** + * @param mixed $value + * + * @return mixed + * + * @throws Error + */ + public function serialize($value) + { + $lookup = $this->getValueLookup(); + if (isset($lookup[$value])) { + return $lookup[$value]->name; + } + + throw new Error('Cannot serialize value as enum: ' . Utils::printSafe($value)); + } + + /** + * Actually returns a MixedStore, PHPStan won't let us type it that way + */ + private function getValueLookup() : MixedStore + { + if (! isset($this->valueLookup)) { + $this->valueLookup = new MixedStore(); + + foreach ($this->getValues() as $valueName => $value) { + $this->valueLookup->offsetSet($value->value, $value); + } + } + + return $this->valueLookup; + } + + /** + * @param mixed $value + * + * @return mixed + * + * @throws Error + */ + public function parseValue($value) + { + $lookup = $this->getNameLookup(); + if (isset($lookup[$value])) { + return $lookup[$value]->value; + } + + throw new Error('Cannot represent value as enum: ' . Utils::printSafe($value)); + } + + /** + * @param mixed[]|null $variables + * + * @return null + * + * @throws Exception + */ + public function parseLiteral(Node $valueNode, ?array $variables = null) + { + if ($valueNode instanceof EnumValueNode) { + $lookup = $this->getNameLookup(); + if (isset($lookup[$valueNode->value])) { + $enumValue = $lookup[$valueNode->value]; + if ($enumValue !== null) { + return $enumValue->value; + } + } + } + + // Intentionally without message, as all information already in wrapped Exception + throw new Error(); + } + + /** + * @throws InvariantViolation + */ + public function assertValid() + { + parent::assertValid(); + + Utils::invariant( + isset($this->config['values']), + sprintf('%s values must be an array.', $this->name) + ); + + $values = $this->getValues(); + foreach ($values as $value) { + Utils::invariant( + ! isset($value->config['isDeprecated']), + sprintf( + '%s.%s should provide "deprecationReason" instead of "isDeprecated".', + $this->name, + $value->name + ) + ); + } + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php new file mode 100644 index 00000000..9454f358 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php @@ -0,0 +1,50 @@ +name = $config['name'] ?? null; + $this->value = $config['value'] ?? null; + $this->deprecationReason = $config['deprecationReason'] ?? null; + $this->description = $config['description'] ?? null; + $this->astNode = $config['astNode'] ?? null; + + $this->config = $config; + } + + /** + * @return bool + */ + public function isDeprecated() + { + return (bool) $this->deprecationReason; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldArgument.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldArgument.php new file mode 100644 index 00000000..f6a8f385 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldArgument.php @@ -0,0 +1,135 @@ + $value) { + switch ($key) { + case 'name': + $this->name = $value; + break; + case 'defaultValue': + $this->defaultValue = $value; + break; + case 'description': + $this->description = $value; + break; + case 'astNode': + $this->astNode = $value; + break; + } + } + $this->config = $def; + } + + /** + * @param mixed[] $config + * + * @return FieldArgument[] + */ + public static function createMap(array $config) : array + { + $map = []; + foreach ($config as $name => $argConfig) { + if (! is_array($argConfig)) { + $argConfig = ['type' => $argConfig]; + } + $map[] = new self($argConfig + ['name' => $name]); + } + + return $map; + } + + public function getType() : Type + { + if (! isset($this->type)) { + /** + * TODO: replace this phpstan cast with native assert + * + * @var Type&InputType + */ + $type = Schema::resolveType($this->config['type']); + $this->type = $type; + } + + return $this->type; + } + + public function defaultValueExists() : bool + { + return array_key_exists('defaultValue', $this->config); + } + + public function isRequired() : bool + { + return $this->getType() instanceof NonNull && ! $this->defaultValueExists(); + } + + public function assertValid(FieldDefinition $parentField, Type $parentType) + { + try { + Utils::assertValidName($this->name); + } catch (InvariantViolation $e) { + throw new InvariantViolation( + sprintf('%s.%s(%s:) %s', $parentType->name, $parentField->name, $this->name, $e->getMessage()) + ); + } + $type = $this->getType(); + if ($type instanceof WrappingType) { + $type = $type->getWrappedType(true); + } + Utils::invariant( + $type instanceof InputType, + sprintf( + '%s.%s(%s): argument type must be Input Type but got: %s', + $parentType->name, + $parentField->name, + $this->name, + Utils::printSafe($this->type) + ) + ); + Utils::invariant( + $this->description === null || is_string($this->description), + sprintf( + '%s.%s(%s): argument description type must be string but got: %s', + $parentType->name, + $parentField->name, + $this->name, + Utils::printSafe($this->description) + ) + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php new file mode 100644 index 00000000..ceb27b20 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php @@ -0,0 +1,331 @@ +name = $config['name']; + $this->resolveFn = $config['resolve'] ?? null; + $this->mapFn = $config['map'] ?? null; + $this->args = isset($config['args']) ? FieldArgument::createMap($config['args']) : []; + + $this->description = $config['description'] ?? null; + $this->deprecationReason = $config['deprecationReason'] ?? null; + $this->astNode = $config['astNode'] ?? null; + + $this->config = $config; + + $this->complexityFn = $config['complexity'] ?? self::DEFAULT_COMPLEXITY_FN; + } + + /** + * @param (callable():mixed[])|mixed[] $fields + * + * @return array + */ + public static function defineFieldMap(Type $type, $fields) : array + { + if (is_callable($fields)) { + $fields = $fields(); + } + if (! is_iterable($fields)) { + throw new InvariantViolation( + sprintf('%s fields must be an iterable or a callable which returns such an iterable.', $type->name) + ); + } + $map = []; + foreach ($fields as $name => $field) { + if (is_array($field)) { + if (! isset($field['name'])) { + if (! is_string($name)) { + throw new InvariantViolation( + sprintf( + '%s fields must be an associative array with field names as keys or a function which returns such an array.', + $type->name + ) + ); + } + + $field['name'] = $name; + } + if (isset($field['args']) && ! is_array($field['args'])) { + throw new InvariantViolation( + sprintf('%s.%s args must be an array.', $type->name, $name) + ); + } + $fieldDef = self::create($field); + } elseif ($field instanceof self) { + $fieldDef = $field; + } elseif (is_callable($field)) { + if (! is_string($name)) { + throw new InvariantViolation( + sprintf( + '%s lazy fields must be an associative array with field names as keys.', + $type->name + ) + ); + } + + $fieldDef = new UnresolvedFieldDefinition($type, $name, $field); + } else { + if (! is_string($name) || ! $field) { + throw new InvariantViolation( + sprintf( + '%s.%s field config must be an array, but got: %s', + $type->name, + $name, + Utils::printSafe($field) + ) + ); + } + + $fieldDef = self::create(['name' => $name, 'type' => $field]); + } + + $map[$fieldDef->getName()] = $fieldDef; + } + + return $map; + } + + /** + * @param mixed[] $field + * + * @return FieldDefinition + */ + public static function create($field) + { + return new self($field); + } + + /** + * @param int $childrenComplexity + * + * @return mixed + */ + public static function defaultComplexity($childrenComplexity) + { + return $childrenComplexity + 1; + } + + /** + * @param string $name + * + * @return FieldArgument|null + */ + public function getArg($name) + { + foreach ($this->args ?? [] as $arg) { + /** @var FieldArgument $arg */ + if ($arg->name === $name) { + return $arg; + } + } + + return null; + } + + public function getName() : string + { + return $this->name; + } + + public function getType() : Type + { + if (! isset($this->type)) { + /** + * TODO: replace this phpstan cast with native assert + * + * @var Type&OutputType + */ + $type = Schema::resolveType($this->config['type']); + $this->type = $type; + } + + return $this->type; + } + + public function __isset(string $name) : bool + { + switch ($name) { + case 'type': + Warning::warnOnce( + "The public getter for 'type' on FieldDefinition has been deprecated and will be removed" . + " in the next major version. Please update your code to use the 'getType' method.", + Warning::WARNING_CONFIG_DEPRECATION + ); + + return isset($this->type); + } + + return isset($this->$name); + } + + public function __get(string $name) + { + switch ($name) { + case 'type': + Warning::warnOnce( + "The public getter for 'type' on FieldDefinition has been deprecated and will be removed" . + " in the next major version. Please update your code to use the 'getType' method.", + Warning::WARNING_CONFIG_DEPRECATION + ); + + return $this->getType(); + default: + return $this->$name; + } + + return null; + } + + public function __set(string $name, $value) + { + switch ($name) { + case 'type': + Warning::warnOnce( + "The public setter for 'type' on FieldDefinition has been deprecated and will be removed" . + ' in the next major version.', + Warning::WARNING_CONFIG_DEPRECATION + ); + $this->type = $value; + break; + + default: + $this->$name = $value; + break; + } + } + + /** + * @return bool + */ + public function isDeprecated() + { + return (bool) $this->deprecationReason; + } + + /** + * @return callable|callable + */ + public function getComplexityFn() + { + return $this->complexityFn; + } + + /** + * @throws InvariantViolation + */ + public function assertValid(Type $parentType) + { + try { + Utils::assertValidName($this->name); + } catch (Error $e) { + throw new InvariantViolation(sprintf('%s.%s: %s', $parentType->name, $this->name, $e->getMessage())); + } + Utils::invariant( + ! isset($this->config['isDeprecated']), + sprintf( + '%s.%s should provide "deprecationReason" instead of "isDeprecated".', + $parentType->name, + $this->name + ) + ); + + $type = $this->getType(); + if ($type instanceof WrappingType) { + $type = $type->getWrappedType(true); + } + Utils::invariant( + $type instanceof OutputType, + sprintf( + '%s.%s field type must be Output Type but got: %s', + $parentType->name, + $this->name, + Utils::printSafe($this->type) + ) + ); + Utils::invariant( + $this->resolveFn === null || is_callable($this->resolveFn), + sprintf( + '%s.%s field resolver must be a function if provided, but got: %s', + $parentType->name, + $this->name, + Utils::printSafe($this->resolveFn) + ) + ); + + foreach ($this->args as $fieldArgument) { + $fieldArgument->assertValid($this, $type); + } + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php new file mode 100644 index 00000000..4ce723cf --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php @@ -0,0 +1,89 @@ +value; + } + + // Intentionally without message, as all information already in wrapped Exception + throw new Error(); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php new file mode 100644 index 00000000..d77e61ff --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php @@ -0,0 +1,33 @@ + + * + * @throws InvariantViolation + */ + public function getFields() : array; + + /** + * @return array + * + * @throws InvariantViolation + */ + public function getFieldNames() : array; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php new file mode 100644 index 00000000..d5a214d9 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php @@ -0,0 +1,80 @@ +value; + } + + // Intentionally without message, as all information already in wrapped Exception + throw new Error(); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ImplementingType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ImplementingType.php new file mode 100644 index 00000000..94bf7717 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ImplementingType.php @@ -0,0 +1,20 @@ + + */ + public function getInterfaces() : array; +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectField.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectField.php new file mode 100644 index 00000000..02a20ea3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectField.php @@ -0,0 +1,171 @@ + $v) { + switch ($k) { + case 'defaultValue': + $this->defaultValue = $v; + break; + case 'defaultValueExists': + break; + case 'type': + // do nothing; type is lazy loaded in getType + break; + default: + $this->{$k} = $v; + } + } + $this->config = $opts; + } + + public function __isset(string $name) : bool + { + switch ($name) { + case 'type': + Warning::warnOnce( + "The public getter for 'type' on InputObjectField has been deprecated and will be removed" . + " in the next major version. Please update your code to use the 'getType' method.", + Warning::WARNING_CONFIG_DEPRECATION + ); + + return isset($this->type); + } + + return isset($this->$name); + } + + public function __get(string $name) + { + switch ($name) { + case 'type': + Warning::warnOnce( + "The public getter for 'type' on InputObjectField has been deprecated and will be removed" . + " in the next major version. Please update your code to use the 'getType' method.", + Warning::WARNING_CONFIG_DEPRECATION + ); + + return $this->getType(); + default: + return $this->$name; + } + + return null; + } + + public function __set(string $name, $value) + { + switch ($name) { + case 'type': + Warning::warnOnce( + "The public setter for 'type' on InputObjectField has been deprecated and will be removed" . + ' in the next major version.', + Warning::WARNING_CONFIG_DEPRECATION + ); + $this->type = $value; + break; + + default: + $this->$name = $value; + break; + } + } + + /** + * @return Type&InputType + */ + public function getType() : Type + { + if (! isset($this->type)) { + /** + * TODO: replace this phpstan cast with native assert + * + * @var Type&InputType + */ + $type = Schema::resolveType($this->config['type']); + $this->type = $type; + } + + return $this->type; + } + + public function defaultValueExists() : bool + { + return array_key_exists('defaultValue', $this->config); + } + + public function isRequired() : bool + { + return $this->getType() instanceof NonNull && ! $this->defaultValueExists(); + } + + /** + * @throws InvariantViolation + */ + public function assertValid(Type $parentType) + { + try { + Utils::assertValidName($this->name); + } catch (Error $e) { + throw new InvariantViolation(sprintf('%s.%s: %s', $parentType->name, $this->name, $e->getMessage())); + } + $type = $this->getType(); + if ($type instanceof WrappingType) { + $type = $type->getWrappedType(true); + } + Utils::invariant( + $type instanceof InputType, + sprintf( + '%s.%s field type must be Input Type but got: %s', + $parentType->name, + $this->name, + Utils::printSafe($this->type) + ) + ); + Utils::invariant( + ! array_key_exists('resolve', $this->config), + sprintf( + '%s.%s field has a resolve property, but Input Types cannot define resolvers.', + $parentType->name, + $this->name + ) + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectType.php new file mode 100644 index 00000000..0d4b2706 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectType.php @@ -0,0 +1,121 @@ +tryInferName(); + } + + Utils::invariant(is_string($config['name']), 'Must provide name.'); + + $this->config = $config; + $this->name = $config['name']; + $this->astNode = $config['astNode'] ?? null; + $this->description = $config['description'] ?? null; + $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; + } + + /** + * @throws InvariantViolation + */ + public function getField(string $name) : InputObjectField + { + if (! isset($this->fields)) { + $this->initializeFields(); + } + Utils::invariant(isset($this->fields[$name]), "Field '%s' is not defined for type '%s'", $name, $this->name); + + return $this->fields[$name]; + } + + /** + * @return InputObjectField[] + */ + public function getFields() : array + { + if (! isset($this->fields)) { + $this->initializeFields(); + } + + return $this->fields; + } + + protected function initializeFields() : void + { + $this->fields = []; + $fields = $this->config['fields'] ?? []; + if (is_callable($fields)) { + $fields = $fields(); + } + + if (! is_iterable($fields)) { + throw new InvariantViolation( + sprintf('%s fields must be an iterable or a callable which returns such an iterable.', $this->name) + ); + } + + foreach ($fields as $name => $field) { + if ($field instanceof Type || is_callable($field)) { + $field = ['type' => $field]; + } + $field = new InputObjectField($field + ['name' => $name]); + $this->fields[$field->name] = $field; + } + } + + /** + * Validates type config and throws if one of type options is invalid. + * Note: this method is shallow, it won't validate object fields and their arguments. + * + * @throws InvariantViolation + */ + public function assertValid() : void + { + parent::assertValid(); + + Utils::invariant( + count($this->getFields()) > 0, + sprintf( + '%s fields must be an associative array with field names as keys or a callable which returns such an array.', + $this->name + ) + ); + + foreach ($this->getFields() as $field) { + $field->assertValid($this); + } + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputType.php new file mode 100644 index 00000000..d970bff3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputType.php @@ -0,0 +1,22 @@ + + | NonNull< + | ScalarType + | EnumType + | InputObjectType + | ListOfType, + >; + */ +interface InputType +{ +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IntType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IntType.php new file mode 100644 index 00000000..f3ae6cdc --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IntType.php @@ -0,0 +1,118 @@ += self::MIN_INT) { + return $value; + } + + $float = is_numeric($value) || is_bool($value) + ? (float) $value + : null; + + if ($float === null || floor($float) !== $float) { + throw new Error( + 'Int cannot represent non-integer value: ' . + Utils::printSafe($value) + ); + } + + if ($float > self::MAX_INT || $float < self::MIN_INT) { + throw new Error( + 'Int cannot represent non 32-bit signed integer value: ' . + Utils::printSafe($value) + ); + } + + return (int) $float; + } + + /** + * @param mixed $value + * + * @throws Error + */ + public function parseValue($value) : int + { + $isInt = is_int($value) || (is_float($value) && floor($value) === $value); + + if (! $isInt) { + throw new Error( + 'Int cannot represent non-integer value: ' . + Utils::printSafe($value) + ); + } + + if ($value > self::MAX_INT || $value < self::MIN_INT) { + throw new Error( + 'Int cannot represent non 32-bit signed integer value: ' . + Utils::printSafe($value) + ); + } + + return (int) $value; + } + + /** + * @param mixed[]|null $variables + * + * @return int + * + * @throws Exception + */ + public function parseLiteral(Node $valueNode, ?array $variables = null) + { + if ($valueNode instanceof IntValueNode) { + $val = (int) $valueNode->value; + if ($valueNode->value === (string) $val && self::MIN_INT <= $val && $val <= self::MAX_INT) { + return $val; + } + } + + // Intentionally without message, as all information already in wrapped Exception + throw new Error(); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InterfaceType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InterfaceType.php new file mode 100644 index 00000000..578580c8 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InterfaceType.php @@ -0,0 +1,154 @@ + */ + public $extensionASTNodes; + + /** + * Lazily initialized. + * + * @var array + */ + private $interfaces; + + /** + * Lazily initialized. + * + * @var array + */ + private $interfaceMap; + + /** + * @param mixed[] $config + */ + public function __construct(array $config) + { + if (! isset($config['name'])) { + $config['name'] = $this->tryInferName(); + } + + Utils::invariant(is_string($config['name']), 'Must provide name.'); + + $this->name = $config['name']; + $this->description = $config['description'] ?? null; + $this->astNode = $config['astNode'] ?? null; + $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; + $this->config = $config; + } + + /** + * @param mixed $type + * + * @return $this + * + * @throws InvariantViolation + */ + public static function assertInterfaceType($type) : self + { + Utils::invariant( + $type instanceof self, + 'Expected ' . Utils::printSafe($type) . ' to be a GraphQL Interface type.' + ); + + return $type; + } + + public function implementsInterface(InterfaceType $interfaceType) : bool + { + if (! isset($this->interfaceMap)) { + $this->interfaceMap = []; + foreach ($this->getInterfaces() as $interface) { + /** @var Type&InterfaceType $interface */ + $interface = Schema::resolveType($interface); + $this->interfaceMap[$interface->name] = $interface; + } + } + + return isset($this->interfaceMap[$interfaceType->name]); + } + + /** + * @return array + */ + public function getInterfaces() : array + { + if (! isset($this->interfaces)) { + $interfaces = $this->config['interfaces'] ?? []; + if (is_callable($interfaces)) { + $interfaces = $interfaces(); + } + + if ($interfaces !== null && ! is_array($interfaces)) { + throw new InvariantViolation( + sprintf('%s interfaces must be an Array or a callable which returns an Array.', $this->name) + ); + } + + /** @var array $interfaces */ + $interfaces = $interfaces === null + ? [] + : array_map([Schema::class, 'resolveType'], $interfaces); + + $this->interfaces = $interfaces; + } + + return $this->interfaces; + } + + /** + * Resolves concrete ObjectType for given object value + * + * @param object $objectValue + * @param mixed $context + * + * @return Type|null + */ + public function resolveType($objectValue, $context, ResolveInfo $info) + { + if (isset($this->config['resolveType'])) { + $fn = $this->config['resolveType']; + + return $fn($objectValue, $context, $info); + } + + return null; + } + + /** + * @throws InvariantViolation + */ + public function assertValid() : void + { + parent::assertValid(); + + $resolveType = $this->config['resolveType'] ?? null; + + Utils::invariant( + ! isset($resolveType) || is_callable($resolveType), + sprintf( + '%s must provide "resolveType" as a function, but got: %s', + $this->name, + Utils::printSafe($resolveType) + ) + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/LeafType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/LeafType.php new file mode 100644 index 00000000..b913823f --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/LeafType.php @@ -0,0 +1,61 @@ +ofType = is_callable($type) ? $type : Type::assertType($type); + } + + public function toString() : string + { + return '[' . $this->getOfType()->toString() . ']'; + } + + public function getOfType() + { + return Schema::resolveType($this->ofType); + } + + public function getWrappedType(bool $recurse = false) : Type + { + $type = $this->getOfType(); + + return $recurse && $type instanceof WrappingType + ? $type->getWrappedType($recurse) + : $type; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NamedType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NamedType.php new file mode 100644 index 00000000..d36dff5a --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NamedType.php @@ -0,0 +1,18 @@ +ofType = $type; + } + + public function toString() : string + { + return $this->getWrappedType()->toString() . '!'; + } + + public function getOfType() + { + return Schema::resolveType($this->ofType); + } + + /** + * @return (NullableType&Type) + */ + public function getWrappedType(bool $recurse = false) : Type + { + $type = $this->getOfType(); + + return $recurse && $type instanceof WrappingType + ? $type->getWrappedType($recurse) + : $type; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NullableType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NullableType.php new file mode 100644 index 00000000..7ff70b24 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NullableType.php @@ -0,0 +1,20 @@ +; + */ + +interface NullableType +{ +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ObjectType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ObjectType.php new file mode 100644 index 00000000..1a1cf793 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ObjectType.php @@ -0,0 +1,206 @@ + 'Address', + * 'fields' => [ + * 'street' => [ 'type' => GraphQL\Type\Definition\Type::string() ], + * 'number' => [ 'type' => GraphQL\Type\Definition\Type::int() ], + * 'formatted' => [ + * 'type' => GraphQL\Type\Definition\Type::string(), + * 'resolve' => function($obj) { + * return $obj->number . ' ' . $obj->street; + * } + * ] + * ] + * ]); + * + * When two types need to refer to each other, or a type needs to refer to + * itself in a field, you can use a function expression (aka a closure or a + * thunk) to supply the fields lazily. + * + * Example: + * + * $PersonType = null; + * $PersonType = new ObjectType([ + * 'name' => 'Person', + * 'fields' => function() use (&$PersonType) { + * return [ + * 'name' => ['type' => GraphQL\Type\Definition\Type::string() ], + * 'bestFriend' => [ 'type' => $PersonType ], + * ]; + * } + * ]); + */ +class ObjectType extends TypeWithFields implements OutputType, CompositeType, NullableType, NamedType, ImplementingType +{ + /** @var ObjectTypeDefinitionNode|null */ + public $astNode; + + /** @var ObjectTypeExtensionNode[] */ + public $extensionASTNodes; + + /** @var ?callable */ + public $resolveFieldFn; + + /** + * Lazily initialized. + * + * @var array + */ + private $interfaces; + + /** + * Lazily initialized. + * + * @var array + */ + private $interfaceMap; + + /** + * @param mixed[] $config + */ + public function __construct(array $config) + { + if (! isset($config['name'])) { + $config['name'] = $this->tryInferName(); + } + + Utils::invariant(is_string($config['name']), 'Must provide name.'); + + $this->name = $config['name']; + $this->description = $config['description'] ?? null; + $this->resolveFieldFn = $config['resolveField'] ?? null; + $this->astNode = $config['astNode'] ?? null; + $this->extensionASTNodes = $config['extensionASTNodes'] ?? []; + $this->config = $config; + } + + /** + * @param mixed $type + * + * @return $this + * + * @throws InvariantViolation + */ + public static function assertObjectType($type) : self + { + Utils::invariant( + $type instanceof self, + 'Expected ' . Utils::printSafe($type) . ' to be a GraphQL Object type.' + ); + + return $type; + } + + public function implementsInterface(InterfaceType $interfaceType) : bool + { + if (! isset($this->interfaceMap)) { + $this->interfaceMap = []; + foreach ($this->getInterfaces() as $interface) { + /** @var Type&InterfaceType $interface */ + $interface = Schema::resolveType($interface); + $this->interfaceMap[$interface->name] = $interface; + } + } + + return isset($this->interfaceMap[$interfaceType->name]); + } + + /** + * @return array + */ + public function getInterfaces() : array + { + if (! isset($this->interfaces)) { + $interfaces = $this->config['interfaces'] ?? []; + if (is_callable($interfaces)) { + $interfaces = $interfaces(); + } + + if ($interfaces !== null && ! is_array($interfaces)) { + throw new InvariantViolation( + sprintf('%s interfaces must be an Array or a callable which returns an Array.', $this->name) + ); + } + + /** @var InterfaceType[] $interfaces */ + $interfaces = array_map([Schema::class, 'resolveType'], $interfaces ?? []); + + $this->interfaces = $interfaces; + } + + return $this->interfaces; + } + + /** + * @param mixed $value + * @param mixed $context + * + * @return bool|Deferred|null + */ + public function isTypeOf($value, $context, ResolveInfo $info) + { + return isset($this->config['isTypeOf']) + ? $this->config['isTypeOf']( + $value, + $context, + $info + ) + : null; + } + + /** + * Validates type config and throws if one of type options is invalid. + * Note: this method is shallow, it won't validate object fields and their arguments. + * + * @throws InvariantViolation + */ + public function assertValid() : void + { + parent::assertValid(); + + Utils::invariant( + $this->description === null || is_string($this->description), + sprintf( + '%s description must be string if set, but it is: %s', + $this->name, + Utils::printSafe($this->description) + ) + ); + + $isTypeOf = $this->config['isTypeOf'] ?? null; + + Utils::invariant( + $isTypeOf === null || is_callable($isTypeOf), + sprintf('%s must provide "isTypeOf" as a function, but got: %s', $this->name, Utils::printSafe($isTypeOf)) + ); + + foreach ($this->getFields() as $field) { + $field->assertValid($this); + } + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php new file mode 100644 index 00000000..7565a254 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php @@ -0,0 +1,19 @@ + */ + private $queryPlan = []; + + /** @var mixed[] */ + private $variableValues; + + /** @var FragmentDefinitionNode[] */ + private $fragments; + + /** @var bool */ + private $groupImplementorFields; + + /** + * @param FieldNode[] $fieldNodes + * @param mixed[] $variableValues + * @param FragmentDefinitionNode[] $fragments + * @param mixed[] $options + */ + public function __construct(ObjectType $parentType, Schema $schema, iterable $fieldNodes, array $variableValues, array $fragments, array $options = []) + { + $this->schema = $schema; + $this->variableValues = $variableValues; + $this->fragments = $fragments; + $this->groupImplementorFields = in_array('group-implementor-fields', $options, true); + $this->analyzeQueryPlan($parentType, $fieldNodes); + } + + /** + * @return mixed[] + */ + public function queryPlan() : array + { + return $this->queryPlan; + } + + /** + * @return string[] + */ + public function getReferencedTypes() : array + { + return array_keys($this->types); + } + + public function hasType(string $type) : bool + { + return count(array_filter($this->getReferencedTypes(), static function (string $referencedType) use ($type) : bool { + return $type === $referencedType; + })) > 0; + } + + /** + * @return string[] + */ + public function getReferencedFields() : array + { + return array_values(array_unique(array_merge(...array_values($this->types)))); + } + + public function hasField(string $field) : bool + { + return count(array_filter($this->getReferencedFields(), static function (string $referencedField) use ($field) : bool { + return $field === $referencedField; + })) > 0; + } + + /** + * @return string[] + */ + public function subFields(string $typename) : array + { + if (! array_key_exists($typename, $this->types)) { + return []; + } + + return $this->types[$typename]; + } + + /** + * @param FieldNode[] $fieldNodes + */ + private function analyzeQueryPlan(ObjectType $parentType, iterable $fieldNodes) : void + { + $queryPlan = []; + $implementors = []; + /** @var FieldNode $fieldNode */ + foreach ($fieldNodes as $fieldNode) { + if (! $fieldNode->selectionSet) { + continue; + } + + $type = $parentType->getField($fieldNode->name->value)->getType(); + if ($type instanceof WrappingType) { + $type = $type->getWrappedType(true); + } + + $subfields = $this->analyzeSelectionSet($fieldNode->selectionSet, $type, $implementors); + + $this->types[$type->name] = array_unique(array_merge( + array_key_exists($type->name, $this->types) ? $this->types[$type->name] : [], + array_keys($subfields) + )); + + $queryPlan = array_merge_recursive( + $queryPlan, + $subfields + ); + } + + if ($this->groupImplementorFields) { + $this->queryPlan = ['fields' => $queryPlan]; + + if ($implementors) { + $this->queryPlan['implementors'] = $implementors; + } + } else { + $this->queryPlan = $queryPlan; + } + } + + /** + * @param InterfaceType|ObjectType $parentType + * @param mixed[] $implementors + * + * @return mixed[] + * + * @throws Error + */ + private function analyzeSelectionSet(SelectionSetNode $selectionSet, Type $parentType, array &$implementors) : array + { + $fields = []; + $implementors = []; + foreach ($selectionSet->selections as $selectionNode) { + if ($selectionNode instanceof FieldNode) { + $fieldName = $selectionNode->name->value; + + if ($fieldName === Introspection::TYPE_NAME_FIELD_NAME) { + continue; + } + + $type = $parentType->getField($fieldName); + $selectionType = $type->getType(); + + $subfields = []; + $subImplementors = []; + if ($selectionNode->selectionSet) { + $subfields = $this->analyzeSubFields($selectionType, $selectionNode->selectionSet, $subImplementors); + } + + $fields[$fieldName] = [ + 'type' => $selectionType, + 'fields' => $subfields ?? [], + 'args' => Values::getArgumentValues($type, $selectionNode, $this->variableValues), + ]; + if ($this->groupImplementorFields && $subImplementors) { + $fields[$fieldName]['implementors'] = $subImplementors; + } + } elseif ($selectionNode instanceof FragmentSpreadNode) { + $spreadName = $selectionNode->name->value; + if (isset($this->fragments[$spreadName])) { + $fragment = $this->fragments[$spreadName]; + $type = $this->schema->getType($fragment->typeCondition->name->value); + $subfields = $this->analyzeSubFields($type, $fragment->selectionSet); + $fields = $this->mergeFields($parentType, $type, $fields, $subfields, $implementors); + } + } elseif ($selectionNode instanceof InlineFragmentNode) { + $type = $this->schema->getType($selectionNode->typeCondition->name->value); + $subfields = $this->analyzeSubFields($type, $selectionNode->selectionSet); + $fields = $this->mergeFields($parentType, $type, $fields, $subfields, $implementors); + } + } + + return $fields; + } + + /** + * @param mixed[] $implementors + * + * @return mixed[] + */ + private function analyzeSubFields(Type $type, SelectionSetNode $selectionSet, array &$implementors = []) : array + { + if ($type instanceof WrappingType) { + $type = $type->getWrappedType(true); + } + + $subfields = []; + if ($type instanceof ObjectType || $type instanceof AbstractType) { + $subfields = $this->analyzeSelectionSet($selectionSet, $type, $implementors); + $this->types[$type->name] = array_unique(array_merge( + array_key_exists($type->name, $this->types) ? $this->types[$type->name] : [], + array_keys($subfields) + )); + } + + return $subfields; + } + + /** + * @param mixed[] $fields + * @param mixed[] $subfields + * @param mixed[] $implementors + * + * @return mixed[] + */ + private function mergeFields(Type $parentType, Type $type, array $fields, array $subfields, array &$implementors) : array + { + if ($this->groupImplementorFields && $parentType instanceof AbstractType && ! $type instanceof AbstractType) { + $implementors[$type->name] = [ + 'type' => $type, + 'fields' => $this->arrayMergeDeep( + $implementors[$type->name]['fields'] ?? [], + array_diff_key($subfields, $fields) + ), + ]; + + $fields = $this->arrayMergeDeep( + $fields, + array_intersect_key($subfields, $fields) + ); + } else { + $fields = $this->arrayMergeDeep( + $subfields, + $fields + ); + } + + return $fields; + } + + /** + * similar to array_merge_recursive this merges nested arrays, but handles non array values differently + * while array_merge_recursive tries to merge non array values, in this implementation they will be overwritten + * + * @see https://stackoverflow.com/a/25712428 + * + * @param mixed[] $array1 + * @param mixed[] $array2 + * + * @return mixed[] + */ + private function arrayMergeDeep(array $array1, array $array2) : array + { + $merged = $array1; + + foreach ($array2 as $key => & $value) { + if (is_numeric($key)) { + if (! in_array($value, $merged, true)) { + $merged[] = $value; + } + } elseif (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { + $merged[$key] = $this->arrayMergeDeep($merged[$key], $value); + } else { + $merged[$key] = $value; + } + } + + return $merged; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php new file mode 100644 index 00000000..6c118c23 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php @@ -0,0 +1,255 @@ +fieldDefinition = $fieldDefinition; + $this->fieldName = $fieldDefinition->name; + $this->returnType = $fieldDefinition->getType(); + $this->fieldNodes = $fieldNodes; + $this->parentType = $parentType; + $this->path = $path; + $this->schema = $schema; + $this->fragments = $fragments; + $this->rootValue = $rootValue; + $this->operation = $operation; + $this->variableValues = $variableValues; + } + + /** + * Helper method that returns names of all fields selected in query for + * $this->fieldName up to $depth levels. + * + * Example: + * query MyQuery{ + * { + * root { + * id, + * nested { + * nested1 + * nested2 { + * nested3 + * } + * } + * } + * } + * + * Given this ResolveInfo instance is a part of "root" field resolution, and $depth === 1, + * method will return: + * [ + * 'id' => true, + * 'nested' => [ + * nested1 => true, + * nested2 => true + * ] + * ] + * + * Warning: this method it is a naive implementation which does not take into account + * conditional typed fragments. So use it with care for fields of interface and union types. + * + * @param int $depth How many levels to include in output + * + * @return array + * + * @api + */ + public function getFieldSelection($depth = 0) + { + $fields = []; + + /** @var FieldNode $fieldNode */ + foreach ($this->fieldNodes as $fieldNode) { + if ($fieldNode->selectionSet === null) { + continue; + } + + $fields = array_merge_recursive( + $fields, + $this->foldSelectionSet($fieldNode->selectionSet, $depth) + ); + } + + return $fields; + } + + /** + * @param mixed[] $options + */ + public function lookAhead(array $options = []) : QueryPlan + { + if (! isset($this->queryPlan)) { + $this->queryPlan = new QueryPlan( + $this->parentType, + $this->schema, + $this->fieldNodes, + $this->variableValues, + $this->fragments, + $options + ); + } + + return $this->queryPlan; + } + + /** + * @return bool[] + */ + private function foldSelectionSet(SelectionSetNode $selectionSet, int $descend) : array + { + $fields = []; + foreach ($selectionSet->selections as $selectionNode) { + if ($selectionNode instanceof FieldNode) { + $fields[$selectionNode->name->value] = $descend > 0 && $selectionNode->selectionSet !== null + ? $this->foldSelectionSet($selectionNode->selectionSet, $descend - 1) + : true; + } elseif ($selectionNode instanceof FragmentSpreadNode) { + $spreadName = $selectionNode->name->value; + if (isset($this->fragments[$spreadName])) { + /** @var FragmentDefinitionNode $fragment */ + $fragment = $this->fragments[$spreadName]; + $fields = array_merge_recursive( + $this->foldSelectionSet($fragment->selectionSet, $descend), + $fields + ); + } + } elseif ($selectionNode instanceof InlineFragmentNode) { + $fields = array_merge_recursive( + $this->foldSelectionSet($selectionNode->selectionSet, $descend), + $fields + ); + } + } + + return $fields; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ScalarType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ScalarType.php new file mode 100644 index 00000000..17bf6e7f --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ScalarType.php @@ -0,0 +1,51 @@ +name = $config['name'] ?? $this->tryInferName(); + $this->description = $config['description'] ?? $this->description; + $this->astNode = $config['astNode'] ?? null; + $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; + $this->config = $config; + + Utils::invariant(is_string($this->name), 'Must provide name.'); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php new file mode 100644 index 00000000..4a26b785 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php @@ -0,0 +1,84 @@ +value; + } + + // Intentionally without message, as all information already in wrapped Exception + throw new Error(); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Type.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Type.php new file mode 100644 index 00000000..14d1f6a3 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Type.php @@ -0,0 +1,355 @@ + */ + protected static $standardTypes; + + /** @var Type[] */ + private static $builtInTypes; + + /** @var string */ + public $name; + + /** @var string|null */ + public $description; + + /** @var TypeDefinitionNode|null */ + public $astNode; + + /** @var mixed[] */ + public $config; + + /** @var TypeExtensionNode[] */ + public $extensionASTNodes; + + /** + * @api + */ + public static function id() : ScalarType + { + if (! isset(static::$standardTypes[self::ID])) { + static::$standardTypes[self::ID] = new IDType(); + } + + return static::$standardTypes[self::ID]; + } + + /** + * @api + */ + public static function string() : ScalarType + { + if (! isset(static::$standardTypes[self::STRING])) { + static::$standardTypes[self::STRING] = new StringType(); + } + + return static::$standardTypes[self::STRING]; + } + + /** + * @api + */ + public static function boolean() : ScalarType + { + if (! isset(static::$standardTypes[self::BOOLEAN])) { + static::$standardTypes[self::BOOLEAN] = new BooleanType(); + } + + return static::$standardTypes[self::BOOLEAN]; + } + + /** + * @api + */ + public static function int() : ScalarType + { + if (! isset(static::$standardTypes[self::INT])) { + static::$standardTypes[self::INT] = new IntType(); + } + + return static::$standardTypes[self::INT]; + } + + /** + * @api + */ + public static function float() : ScalarType + { + if (! isset(static::$standardTypes[self::FLOAT])) { + static::$standardTypes[self::FLOAT] = new FloatType(); + } + + return static::$standardTypes[self::FLOAT]; + } + + /** + * @api + */ + public static function listOf(Type $wrappedType) : ListOfType + { + return new ListOfType($wrappedType); + } + + /** + * @param callable|NullableType $wrappedType + * + * @api + */ + public static function nonNull($wrappedType) : NonNull + { + return new NonNull($wrappedType); + } + + /** + * Checks if the type is a builtin type + */ + public static function isBuiltInType(Type $type) : bool + { + return in_array($type->name, array_keys(self::getAllBuiltInTypes()), true); + } + + /** + * Returns all builtin in types including base scalar and + * introspection types + * + * @return Type[] + */ + public static function getAllBuiltInTypes() + { + if (self::$builtInTypes === null) { + self::$builtInTypes = array_merge( + Introspection::getTypes(), + self::getStandardTypes() + ); + } + + return self::$builtInTypes; + } + + /** + * Returns all builtin scalar types + * + * @return ScalarType[] + */ + public static function getStandardTypes() + { + return [ + self::ID => static::id(), + self::STRING => static::string(), + self::FLOAT => static::float(), + self::INT => static::int(), + self::BOOLEAN => static::boolean(), + ]; + } + + /** + * @deprecated Use method getStandardTypes() instead + * + * @return Type[] + * + * @codeCoverageIgnore + */ + public static function getInternalTypes() + { + trigger_error(__METHOD__ . ' is deprecated. Use Type::getStandardTypes() instead', E_USER_DEPRECATED); + + return self::getStandardTypes(); + } + + /** + * @param array $types + */ + public static function overrideStandardTypes(array $types) + { + $standardTypes = self::getStandardTypes(); + foreach ($types as $type) { + Utils::invariant( + $type instanceof Type, + 'Expecting instance of %s, got %s', + self::class, + Utils::printSafe($type) + ); + Utils::invariant( + isset($type->name, $standardTypes[$type->name]), + 'Expecting one of the following names for a standard type: %s, got %s', + implode(', ', array_keys($standardTypes)), + Utils::printSafe($type->name ?? null) + ); + static::$standardTypes[$type->name] = $type; + } + } + + /** + * @param Type $type + * + * @api + */ + public static function isInputType($type) : bool + { + return self::getNamedType($type) instanceof InputType; + } + + /** + * @param Type $type + * + * @api + */ + public static function getNamedType($type) : ?Type + { + if ($type === null) { + return null; + } + while ($type instanceof WrappingType) { + $type = $type->getWrappedType(); + } + + return $type; + } + + /** + * @param Type $type + * + * @api + */ + public static function isOutputType($type) : bool + { + return self::getNamedType($type) instanceof OutputType; + } + + /** + * @param Type $type + * + * @api + */ + public static function isLeafType($type) : bool + { + return $type instanceof LeafType; + } + + /** + * @param Type $type + * + * @api + */ + public static function isCompositeType($type) : bool + { + return $type instanceof CompositeType; + } + + /** + * @param Type $type + * + * @api + */ + public static function isAbstractType($type) : bool + { + return $type instanceof AbstractType; + } + + /** + * @param mixed $type + */ + public static function assertType($type) : Type + { + assert($type instanceof Type, new InvariantViolation('Expected ' . Utils::printSafe($type) . ' to be a GraphQL type.')); + + return $type; + } + + /** + * @api + */ + public static function getNullableType(Type $type) : Type + { + return $type instanceof NonNull + ? $type->getWrappedType() + : $type; + } + + /** + * @throws InvariantViolation + */ + public function assertValid() + { + Utils::assertValidName($this->name); + } + + /** + * @return string + */ + #[ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->toString(); + } + + /** + * @return string + */ + public function toString() + { + return $this->name; + } + + /** + * @return string + */ + public function __toString() + { + return $this->toString(); + } + + /** + * @return string|null + */ + protected function tryInferName() + { + if ($this->name) { + return $this->name; + } + + // If class is extended - infer name from className + // QueryType -> Type + // SomeOtherType -> SomeOther + $tmp = new ReflectionClass($this); + $name = $tmp->getShortName(); + + if ($tmp->getNamespaceName() !== __NAMESPACE__) { + return preg_replace('~Type$~', '', $name); + } + + return null; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php new file mode 100644 index 00000000..1d0cd927 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php @@ -0,0 +1,81 @@ + + */ + private $fields; + + private function initializeFields() : void + { + if (isset($this->fields)) { + return; + } + + $fields = $this->config['fields'] ?? []; + $this->fields = FieldDefinition::defineFieldMap($this, $fields); + } + + public function getField(string $name) : FieldDefinition + { + Utils::invariant($this->hasField($name), 'Field "%s" is not defined for type "%s"', $name, $this->name); + + return $this->findField($name); + } + + public function findField(string $name) : ?FieldDefinition + { + $this->initializeFields(); + + if (! isset($this->fields[$name])) { + return null; + } + + if ($this->fields[$name] instanceof UnresolvedFieldDefinition) { + $this->fields[$name] = $this->fields[$name]->resolve(); + } + + return $this->fields[$name]; + } + + public function hasField(string $name) : bool + { + $this->initializeFields(); + + return isset($this->fields[$name]); + } + + /** @inheritDoc */ + public function getFields() : array + { + $this->initializeFields(); + + foreach ($this->fields as $name => $field) { + if (! ($field instanceof UnresolvedFieldDefinition)) { + continue; + } + + $this->fields[$name] = $field->resolve(); + } + + return $this->fields; + } + + /** @inheritDoc */ + public function getFieldNames() : array + { + $this->initializeFields(); + + return array_keys($this->fields); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnionType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnionType.php new file mode 100644 index 00000000..6301e60a --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnionType.php @@ -0,0 +1,150 @@ + + */ + private $possibleTypeNames; + + /** @var UnionTypeExtensionNode[] */ + public $extensionASTNodes; + + /** + * @param mixed[] $config + */ + public function __construct(array $config) + { + if (! isset($config['name'])) { + $config['name'] = $this->tryInferName(); + } + + Utils::invariant(is_string($config['name']), 'Must provide name.'); + + /** + * Optionally provide a custom type resolver function. If one is not provided, + * the default implementation will call `isTypeOf` on each implementing + * Object type. + */ + $this->name = $config['name']; + $this->description = $config['description'] ?? null; + $this->astNode = $config['astNode'] ?? null; + $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; + $this->config = $config; + } + + public function isPossibleType(Type $type) : bool + { + if (! $type instanceof ObjectType) { + return false; + } + + if (! isset($this->possibleTypeNames)) { + $this->possibleTypeNames = []; + foreach ($this->getTypes() as $possibleType) { + $this->possibleTypeNames[$possibleType->name] = true; + } + } + + return isset($this->possibleTypeNames[$type->name]); + } + + /** + * @return ObjectType[] + * + * @throws InvariantViolation + */ + public function getTypes() : array + { + if (! isset($this->types)) { + $types = $this->config['types'] ?? null; + if (is_callable($types)) { + $types = $types(); + } + + if (! is_array($types)) { + throw new InvariantViolation( + sprintf( + 'Must provide Array of types or a callable which returns such an array for Union %s', + $this->name + ) + ); + } + + $rawTypes = $types; + foreach ($rawTypes as $i => $rawType) { + $rawTypes[$i] = Schema::resolveType($rawType); + } + + $this->types = $rawTypes; + } + + return $this->types; + } + + /** + * Resolves concrete ObjectType for given object value + * + * @param object $objectValue + * @param mixed $context + * + * @return callable|null + */ + public function resolveType($objectValue, $context, ResolveInfo $info) + { + if (isset($this->config['resolveType'])) { + $fn = $this->config['resolveType']; + + return $fn($objectValue, $context, $info); + } + + return null; + } + + /** + * @throws InvariantViolation + */ + public function assertValid() : void + { + parent::assertValid(); + + if (! isset($this->config['resolveType'])) { + return; + } + + Utils::invariant( + is_callable($this->config['resolveType']), + sprintf( + '%s must provide "resolveType" as a function, but got: %s', + $this->name, + Utils::printSafe($this->config['resolveType']) + ) + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php new file mode 100644 index 00000000..7a31c475 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php @@ -0,0 +1,19 @@ +|Type) $resolver */ + private $resolver; + + /** + * @param callable(): (FieldDefinition|array|Type) $resolver + */ + public function __construct(Type $type, string $name, callable $resolver) + { + $this->type = $type; + $this->name = $name; + $this->resolver = $resolver; + } + + public function getName() : string + { + return $this->name; + } + + public function resolve() : FieldDefinition + { + $field = ($this->resolver)(); + + if ($field instanceof FieldDefinition) { + if ($field->name !== $this->name) { + throw new InvariantViolation( + sprintf('%s.%s should not dynamically change its name when resolved lazily.', $this->type->name, $this->name) + ); + } + + return $field; + } + + if (! is_array($field)) { + return FieldDefinition::create(['name' => $this->name, 'type' => $field]); + } + + if (! isset($field['name'])) { + $field['name'] = $this->name; + } elseif ($field['name'] !== $this->name) { + throw new InvariantViolation( + sprintf('%s.%s should not dynamically change its name when resolved lazily.', $this->type->name, $this->name) + ); + } + + if (isset($field['args']) && ! is_array($field['args'])) { + throw new InvariantViolation( + sprintf('%s.%s args must be an array.', $this->type->name, $this->name) + ); + } + + return FieldDefinition::create($field); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/WrappingType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/WrappingType.php new file mode 100644 index 00000000..26fbe85d --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/WrappingType.php @@ -0,0 +1,10 @@ + */ + private static $map = []; + + /** + * @param array $options + * Available options: + * - descriptions + * Whether to include descriptions in the introspection result. + * Default: true + * - directiveIsRepeatable + * Whether to include `isRepeatable` flag on directives. + * Default: false + * + * @return string + * + * @api + */ + public static function getIntrospectionQuery(array $options = []) + { + $optionsWithDefaults = array_merge([ + 'descriptions' => true, + 'directiveIsRepeatable' => false, + ], $options); + + $descriptions = $optionsWithDefaults['descriptions'] ? 'description' : ''; + $directiveIsRepeatable = $optionsWithDefaults['directiveIsRepeatable'] ? 'isRepeatable' : ''; + + return <<name, self::getTypes()); + } + + public static function getTypes() + { + return [ + '__Schema' => self::_schema(), + '__Type' => self::_type(), + '__Directive' => self::_directive(), + '__Field' => self::_field(), + '__InputValue' => self::_inputValue(), + '__EnumValue' => self::_enumValue(), + '__TypeKind' => self::_typeKind(), + '__DirectiveLocation' => self::_directiveLocation(), + ]; + } + + /** + * Build an introspection query from a Schema + * + * Introspection is useful for utilities that care about type and field + * relationships, but do not need to traverse through those relationships. + * + * This is the inverse of BuildClientSchema::build(). The primary use case is outside + * of the server context, for instance when doing schema comparisons. + * + * @param array $options + * Available options: + * - descriptions + * Whether to include `isRepeatable` flag on directives. + * Default: true + * - directiveIsRepeatable + * Whether to include descriptions in the introspection result. + * Default: true + * + * @return array>|null + * + * @api + */ + public static function fromSchema(Schema $schema, array $options = []) : ?array + { + $optionsWithDefaults = array_merge(['directiveIsRepeatable' => true], $options); + + $result = GraphQL::executeQuery( + $schema, + self::getIntrospectionQuery($optionsWithDefaults) + ); + + return $result->data; + } + + public static function _schema() + { + if (! isset(self::$map['__Schema'])) { + self::$map['__Schema'] = new ObjectType([ + 'name' => '__Schema', + 'isIntrospection' => true, + 'description' => + 'A GraphQL Schema defines the capabilities of a GraphQL ' . + 'server. It exposes all available types and directives on ' . + 'the server, as well as the entry points for query, mutation, and ' . + 'subscription operations.', + 'fields' => [ + 'types' => [ + 'description' => 'A list of all types supported by this server.', + 'type' => new NonNull(new ListOfType(new NonNull(self::_type()))), + 'resolve' => static function (Schema $schema) : array { + return array_values($schema->getTypeMap()); + }, + ], + 'queryType' => [ + 'description' => 'The type that query operations will be rooted at.', + 'type' => new NonNull(self::_type()), + 'resolve' => static function (Schema $schema) : ?ObjectType { + return $schema->getQueryType(); + }, + ], + 'mutationType' => [ + 'description' => + 'If this server supports mutation, the type that ' . + 'mutation operations will be rooted at.', + 'type' => self::_type(), + 'resolve' => static function (Schema $schema) : ?ObjectType { + return $schema->getMutationType(); + }, + ], + 'subscriptionType' => [ + 'description' => 'If this server support subscription, the type that subscription operations will be rooted at.', + 'type' => self::_type(), + 'resolve' => static function (Schema $schema) : ?ObjectType { + return $schema->getSubscriptionType(); + }, + ], + 'directives' => [ + 'description' => 'A list of all directives supported by this server.', + 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_directive()))), + 'resolve' => static function (Schema $schema) : array { + return $schema->getDirectives(); + }, + ], + ], + ]); + } + + return self::$map['__Schema']; + } + + public static function _type() + { + if (! isset(self::$map['__Type'])) { + self::$map['__Type'] = new ObjectType([ + 'name' => '__Type', + 'isIntrospection' => true, + 'description' => + 'The fundamental unit of any GraphQL Schema is the type. There are ' . + 'many kinds of types in GraphQL as represented by the `__TypeKind` enum.' . + "\n\n" . + 'Depending on the kind of a type, certain fields describe ' . + 'information about that type. Scalar types provide no information ' . + 'beyond a name and description, while Enum types provide their values. ' . + 'Object and Interface types provide the fields they describe. Abstract ' . + 'types, Union and Interface, provide the Object types possible ' . + 'at runtime. List and NonNull types compose other types.', + 'fields' => static function () : array { + return [ + 'kind' => [ + 'type' => Type::nonNull(self::_typeKind()), + 'resolve' => static function (Type $type) { + switch (true) { + case $type instanceof ListOfType: + return TypeKind::LIST; + case $type instanceof NonNull: + return TypeKind::NON_NULL; + case $type instanceof ScalarType: + return TypeKind::SCALAR; + case $type instanceof ObjectType: + return TypeKind::OBJECT; + case $type instanceof EnumType: + return TypeKind::ENUM; + case $type instanceof InputObjectType: + return TypeKind::INPUT_OBJECT; + case $type instanceof InterfaceType: + return TypeKind::INTERFACE; + case $type instanceof UnionType: + return TypeKind::UNION; + default: + throw new Exception('Unknown kind of type: ' . Utils::printSafe($type)); + } + }, + ], + 'name' => [ + 'type' => Type::string(), + 'resolve' => static function ($obj) { + return $obj->name; + }, + ], + 'description' => [ + 'type' => Type::string(), + 'resolve' => static function ($obj) { + return $obj->description; + }, + ], + 'fields' => [ + 'type' => Type::listOf(Type::nonNull(self::_field())), + 'args' => [ + 'includeDeprecated' => ['type' => Type::boolean(), 'defaultValue' => false], + ], + 'resolve' => static function (Type $type, $args) : ?array { + if ($type instanceof ObjectType || $type instanceof InterfaceType) { + $fields = $type->getFields(); + + if (! ($args['includeDeprecated'] ?? false)) { + $fields = array_filter( + $fields, + static function (FieldDefinition $field) : bool { + return ! $field->deprecationReason; + } + ); + } + + return array_values($fields); + } + + return null; + }, + ], + 'interfaces' => [ + 'type' => Type::listOf(Type::nonNull(self::_type())), + 'resolve' => static function ($type) : ?array { + if ($type instanceof ObjectType || $type instanceof InterfaceType) { + return $type->getInterfaces(); + } + + return null; + }, + ], + 'possibleTypes' => [ + 'type' => Type::listOf(Type::nonNull(self::_type())), + 'resolve' => static function ($type, $args, $context, ResolveInfo $info) : ?array { + if ($type instanceof InterfaceType || $type instanceof UnionType) { + return $info->schema->getPossibleTypes($type); + } + + return null; + }, + ], + 'enumValues' => [ + 'type' => Type::listOf(Type::nonNull(self::_enumValue())), + 'args' => [ + 'includeDeprecated' => ['type' => Type::boolean(), 'defaultValue' => false], + ], + 'resolve' => static function ($type, $args) : ?array { + if ($type instanceof EnumType) { + $values = array_values($type->getValues()); + + if (! ($args['includeDeprecated'] ?? false)) { + $values = array_filter( + $values, + static function ($value) : bool { + return ! $value->deprecationReason; + } + ); + } + + return $values; + } + + return null; + }, + ], + 'inputFields' => [ + 'type' => Type::listOf(Type::nonNull(self::_inputValue())), + 'resolve' => static function ($type) : ?array { + if ($type instanceof InputObjectType) { + return array_values($type->getFields()); + } + + return null; + }, + ], + 'ofType' => [ + 'type' => self::_type(), + 'resolve' => static function ($type) : ?Type { + if ($type instanceof WrappingType) { + return $type->getWrappedType(); + } + + return null; + }, + ], + ]; + }, + ]); + } + + return self::$map['__Type']; + } + + public static function _typeKind() + { + if (! isset(self::$map['__TypeKind'])) { + self::$map['__TypeKind'] = new EnumType([ + 'name' => '__TypeKind', + 'isIntrospection' => true, + 'description' => 'An enum describing what kind of type a given `__Type` is.', + 'values' => [ + 'SCALAR' => [ + 'value' => TypeKind::SCALAR, + 'description' => 'Indicates this type is a scalar.', + ], + 'OBJECT' => [ + 'value' => TypeKind::OBJECT, + 'description' => 'Indicates this type is an object. `fields` and `interfaces` are valid fields.', + ], + 'INTERFACE' => [ + 'value' => TypeKind::INTERFACE, + 'description' => 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.', + ], + 'UNION' => [ + 'value' => TypeKind::UNION, + 'description' => 'Indicates this type is a union. `possibleTypes` is a valid field.', + ], + 'ENUM' => [ + 'value' => TypeKind::ENUM, + 'description' => 'Indicates this type is an enum. `enumValues` is a valid field.', + ], + 'INPUT_OBJECT' => [ + 'value' => TypeKind::INPUT_OBJECT, + 'description' => 'Indicates this type is an input object. `inputFields` is a valid field.', + ], + 'LIST' => [ + 'value' => TypeKind::LIST, + 'description' => 'Indicates this type is a list. `ofType` is a valid field.', + ], + 'NON_NULL' => [ + 'value' => TypeKind::NON_NULL, + 'description' => 'Indicates this type is a non-null. `ofType` is a valid field.', + ], + ], + ]); + } + + return self::$map['__TypeKind']; + } + + public static function _field() + { + if (! isset(self::$map['__Field'])) { + self::$map['__Field'] = new ObjectType([ + 'name' => '__Field', + 'isIntrospection' => true, + 'description' => + 'Object and Interface types are described by a list of Fields, each of ' . + 'which has a name, potentially a list of arguments, and a return type.', + 'fields' => static function () : array { + return [ + 'name' => [ + 'type' => Type::nonNull(Type::string()), + 'resolve' => static function (FieldDefinition $field) : string { + return $field->name; + }, + ], + 'description' => [ + 'type' => Type::string(), + 'resolve' => static function (FieldDefinition $field) : ?string { + return $field->description; + }, + ], + 'args' => [ + 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_inputValue()))), + 'resolve' => static function (FieldDefinition $field) : array { + return $field->args ?? []; + }, + ], + 'type' => [ + 'type' => Type::nonNull(self::_type()), + 'resolve' => static function (FieldDefinition $field) : Type { + return $field->getType(); + }, + ], + 'isDeprecated' => [ + 'type' => Type::nonNull(Type::boolean()), + 'resolve' => static function (FieldDefinition $field) : bool { + return (bool) $field->deprecationReason; + }, + ], + 'deprecationReason' => [ + 'type' => Type::string(), + 'resolve' => static function (FieldDefinition $field) : ?string { + return $field->deprecationReason; + }, + ], + ]; + }, + ]); + } + + return self::$map['__Field']; + } + + public static function _inputValue() + { + if (! isset(self::$map['__InputValue'])) { + self::$map['__InputValue'] = new ObjectType([ + 'name' => '__InputValue', + 'isIntrospection' => true, + 'description' => + 'Arguments provided to Fields or Directives and the input fields of an ' . + 'InputObject are represented as Input Values which describe their type ' . + 'and optionally a default value.', + 'fields' => static function () : array { + return [ + 'name' => [ + 'type' => Type::nonNull(Type::string()), + 'resolve' => static function ($inputValue) : string { + /** @var FieldArgument|InputObjectField $inputValue */ + $inputValue = $inputValue; + + return $inputValue->name; + }, + ], + 'description' => [ + 'type' => Type::string(), + 'resolve' => static function ($inputValue) : ?string { + /** @var FieldArgument|InputObjectField $inputValue */ + $inputValue = $inputValue; + + return $inputValue->description; + }, + ], + 'type' => [ + 'type' => Type::nonNull(self::_type()), + 'resolve' => static function ($value) { + return method_exists($value, 'getType') + ? $value->getType() + : $value->type; + }, + ], + 'defaultValue' => [ + 'type' => Type::string(), + 'description' => + 'A GraphQL-formatted string representing the default value for this input value.', + 'resolve' => static function ($inputValue) : ?string { + /** @var FieldArgument|InputObjectField $inputValue */ + $inputValue = $inputValue; + + return ! $inputValue->defaultValueExists() + ? null + : Printer::doPrint(AST::astFromValue( + $inputValue->defaultValue, + $inputValue->getType() + )); + }, + ], + ]; + }, + ]); + } + + return self::$map['__InputValue']; + } + + public static function _enumValue() + { + if (! isset(self::$map['__EnumValue'])) { + self::$map['__EnumValue'] = new ObjectType([ + 'name' => '__EnumValue', + 'isIntrospection' => true, + 'description' => + 'One possible value for a given Enum. Enum values are unique values, not ' . + 'a placeholder for a string or numeric value. However an Enum value is ' . + 'returned in a JSON response as a string.', + 'fields' => [ + 'name' => [ + 'type' => Type::nonNull(Type::string()), + 'resolve' => static function ($enumValue) { + return $enumValue->name; + }, + ], + 'description' => [ + 'type' => Type::string(), + 'resolve' => static function ($enumValue) { + return $enumValue->description; + }, + ], + 'isDeprecated' => [ + 'type' => Type::nonNull(Type::boolean()), + 'resolve' => static function ($enumValue) : bool { + return (bool) $enumValue->deprecationReason; + }, + ], + 'deprecationReason' => [ + 'type' => Type::string(), + 'resolve' => static function ($enumValue) { + return $enumValue->deprecationReason; + }, + ], + ], + ]); + } + + return self::$map['__EnumValue']; + } + + public static function _directive() + { + if (! isset(self::$map['__Directive'])) { + self::$map['__Directive'] = new ObjectType([ + 'name' => '__Directive', + 'isIntrospection' => true, + 'description' => 'A Directive provides a way to describe alternate runtime execution and ' . + 'type validation behavior in a GraphQL document.' . + "\n\nIn some cases, you need to provide options to alter GraphQL's " . + 'execution behavior in ways field arguments will not suffice, such as ' . + 'conditionally including or skipping a field. Directives provide this by ' . + 'describing additional information to the executor.', + 'fields' => [ + 'name' => [ + 'type' => Type::nonNull(Type::string()), + 'resolve' => static function ($obj) { + return $obj->name; + }, + ], + 'description' => [ + 'type' => Type::string(), + 'resolve' => static function ($obj) { + return $obj->description; + }, + ], + 'args' => [ + 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_inputValue()))), + 'resolve' => static function (Directive $directive) : array { + return $directive->args ?? []; + }, + ], + 'isRepeatable' => [ + 'type' => Type::nonNull(Type::boolean()), + 'resolve' => static function (Directive $directive) : bool { + return $directive->isRepeatable; + }, + ], + 'locations' => [ + 'type' => Type::nonNull(Type::listOf(Type::nonNull( + self::_directiveLocation() + ))), + 'resolve' => static function ($obj) { + return $obj->locations; + }, + ], + ], + ]); + } + + return self::$map['__Directive']; + } + + public static function _directiveLocation() + { + if (! isset(self::$map['__DirectiveLocation'])) { + self::$map['__DirectiveLocation'] = new EnumType([ + 'name' => '__DirectiveLocation', + 'isIntrospection' => true, + 'description' => + 'A Directive can be adjacent to many parts of the GraphQL language, a ' . + '__DirectiveLocation describes one such possible adjacencies.', + 'values' => [ + 'QUERY' => [ + 'value' => DirectiveLocation::QUERY, + 'description' => 'Location adjacent to a query operation.', + ], + 'MUTATION' => [ + 'value' => DirectiveLocation::MUTATION, + 'description' => 'Location adjacent to a mutation operation.', + ], + 'SUBSCRIPTION' => [ + 'value' => DirectiveLocation::SUBSCRIPTION, + 'description' => 'Location adjacent to a subscription operation.', + ], + 'FIELD' => [ + 'value' => DirectiveLocation::FIELD, + 'description' => 'Location adjacent to a field.', + ], + 'FRAGMENT_DEFINITION' => [ + 'value' => DirectiveLocation::FRAGMENT_DEFINITION, + 'description' => 'Location adjacent to a fragment definition.', + ], + 'FRAGMENT_SPREAD' => [ + 'value' => DirectiveLocation::FRAGMENT_SPREAD, + 'description' => 'Location adjacent to a fragment spread.', + ], + 'INLINE_FRAGMENT' => [ + 'value' => DirectiveLocation::INLINE_FRAGMENT, + 'description' => 'Location adjacent to an inline fragment.', + ], + 'VARIABLE_DEFINITION' => [ + 'value' => DirectiveLocation::VARIABLE_DEFINITION, + 'description' => 'Location adjacent to a variable definition.', + ], + 'SCHEMA' => [ + 'value' => DirectiveLocation::SCHEMA, + 'description' => 'Location adjacent to a schema definition.', + ], + 'SCALAR' => [ + 'value' => DirectiveLocation::SCALAR, + 'description' => 'Location adjacent to a scalar definition.', + ], + 'OBJECT' => [ + 'value' => DirectiveLocation::OBJECT, + 'description' => 'Location adjacent to an object type definition.', + ], + 'FIELD_DEFINITION' => [ + 'value' => DirectiveLocation::FIELD_DEFINITION, + 'description' => 'Location adjacent to a field definition.', + ], + 'ARGUMENT_DEFINITION' => [ + 'value' => DirectiveLocation::ARGUMENT_DEFINITION, + 'description' => 'Location adjacent to an argument definition.', + ], + 'INTERFACE' => [ + 'value' => DirectiveLocation::IFACE, + 'description' => 'Location adjacent to an interface definition.', + ], + 'UNION' => [ + 'value' => DirectiveLocation::UNION, + 'description' => 'Location adjacent to a union definition.', + ], + 'ENUM' => [ + 'value' => DirectiveLocation::ENUM, + 'description' => 'Location adjacent to an enum definition.', + ], + 'ENUM_VALUE' => [ + 'value' => DirectiveLocation::ENUM_VALUE, + 'description' => 'Location adjacent to an enum value definition.', + ], + 'INPUT_OBJECT' => [ + 'value' => DirectiveLocation::INPUT_OBJECT, + 'description' => 'Location adjacent to an input object type definition.', + ], + 'INPUT_FIELD_DEFINITION' => [ + 'value' => DirectiveLocation::INPUT_FIELD_DEFINITION, + 'description' => 'Location adjacent to an input object field definition.', + ], + + ], + ]); + } + + return self::$map['__DirectiveLocation']; + } + + public static function schemaMetaFieldDef() : FieldDefinition + { + if (! isset(self::$map[self::SCHEMA_FIELD_NAME])) { + self::$map[self::SCHEMA_FIELD_NAME] = FieldDefinition::create([ + 'name' => self::SCHEMA_FIELD_NAME, + 'type' => Type::nonNull(self::_schema()), + 'description' => 'Access the current type schema of this server.', + 'args' => [], + 'resolve' => static function ( + $source, + $args, + $context, + ResolveInfo $info + ) : Schema { + return $info->schema; + }, + ]); + } + + return self::$map[self::SCHEMA_FIELD_NAME]; + } + + public static function typeMetaFieldDef() : FieldDefinition + { + if (! isset(self::$map[self::TYPE_FIELD_NAME])) { + self::$map[self::TYPE_FIELD_NAME] = FieldDefinition::create([ + 'name' => self::TYPE_FIELD_NAME, + 'type' => self::_type(), + 'description' => 'Request the type information of a single type.', + 'args' => [ + ['name' => 'name', 'type' => Type::nonNull(Type::string())], + ], + 'resolve' => static function ($source, $args, $context, ResolveInfo $info) : Type { + return $info->schema->getType($args['name']); + }, + ]); + } + + return self::$map[self::TYPE_FIELD_NAME]; + } + + public static function typeNameMetaFieldDef() : FieldDefinition + { + if (! isset(self::$map[self::TYPE_NAME_FIELD_NAME])) { + self::$map[self::TYPE_NAME_FIELD_NAME] = FieldDefinition::create([ + 'name' => self::TYPE_NAME_FIELD_NAME, + 'type' => Type::nonNull(Type::string()), + 'description' => 'The name of the current Object type at runtime.', + 'args' => [], + 'resolve' => static function ( + $source, + $args, + $context, + ResolveInfo $info + ) : string { + return $info->parentType->name; + }, + ]); + } + + return self::$map[self::TYPE_NAME_FIELD_NAME]; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Schema.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Schema.php new file mode 100644 index 00000000..c2cf0d58 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Schema.php @@ -0,0 +1,603 @@ + $MyAppQueryRootType, + * 'mutation' => $MyAppMutationRootType, + * ]); + * + * Or using Schema Config instance: + * + * $config = GraphQL\Type\SchemaConfig::create() + * ->setQuery($MyAppQueryRootType) + * ->setMutation($MyAppMutationRootType); + * + * $schema = new GraphQL\Type\Schema($config); + */ +class Schema +{ + /** @var SchemaConfig */ + private $config; + + /** + * Contains currently resolved schema types + * + * @var Type[] + */ + private $resolvedTypes = []; + + /** + * Lazily initialised. + * + * @var array + */ + private $implementationsMap; + + /** + * True when $resolvedTypes contain all possible schema types + * + * @var bool + */ + private $fullyLoaded = false; + + /** @var Error[] */ + private $validationErrors; + + /** @var SchemaTypeExtensionNode[] */ + public $extensionASTNodes = []; + + /** + * @param mixed[]|SchemaConfig $config + * + * @api + */ + public function __construct($config) + { + if (is_array($config)) { + $config = SchemaConfig::create($config); + } + + // If this schema was built from a source known to be valid, then it may be + // marked with assumeValid to avoid an additional type system validation. + if ($config->getAssumeValid()) { + $this->validationErrors = []; + } else { + // Otherwise check for common mistakes during construction to produce + // clear and early error messages. + Utils::invariant( + $config instanceof SchemaConfig, + 'Schema constructor expects instance of GraphQL\Type\SchemaConfig or an array with keys: %s; but got: %s', + implode( + ', ', + [ + 'query', + 'mutation', + 'subscription', + 'types', + 'directives', + 'typeLoader', + ] + ), + Utils::getVariableType($config) + ); + Utils::invariant( + ! $config->types || is_array($config->types) || is_callable($config->types), + '"types" must be array or callable if provided but got: ' . Utils::getVariableType($config->types) + ); + Utils::invariant( + $config->directives === null || is_array($config->directives), + '"directives" must be Array if provided but got: ' . Utils::getVariableType($config->directives) + ); + } + + $this->config = $config; + $this->extensionASTNodes = $config->extensionASTNodes; + + if ($config->query !== null) { + $this->resolvedTypes[$config->query->name] = $config->query; + } + if ($config->mutation !== null) { + $this->resolvedTypes[$config->mutation->name] = $config->mutation; + } + if ($config->subscription !== null) { + $this->resolvedTypes[$config->subscription->name] = $config->subscription; + } + if (is_array($this->config->types)) { + foreach ($this->resolveAdditionalTypes() as $type) { + if (isset($this->resolvedTypes[$type->name])) { + Utils::invariant( + $type === $this->resolvedTypes[$type->name], + sprintf( + 'Schema must contain unique named types but contains multiple types named "%s" (see http://webonyx.github.io/graphql-php/type-system/#type-registry).', + $type + ) + ); + } + $this->resolvedTypes[$type->name] = $type; + } + } + $this->resolvedTypes += Type::getStandardTypes() + Introspection::getTypes(); + + if ($this->config->typeLoader) { + return; + } + + // Perform full scan of the schema + $this->getTypeMap(); + } + + /** + * @return Generator + */ + private function resolveAdditionalTypes() + { + $types = $this->config->types ?? []; + + if (is_callable($types)) { + $types = $types(); + } + + if (! is_array($types) && ! $types instanceof Traversable) { + throw new InvariantViolation(sprintf( + 'Schema types callable must return array or instance of Traversable but got: %s', + Utils::getVariableType($types) + )); + } + + foreach ($types as $index => $type) { + $type = self::resolveType($type); + if (! $type instanceof Type) { + throw new InvariantViolation(sprintf( + 'Each entry of schema types must be instance of GraphQL\Type\Definition\Type but entry at %s is %s', + $index, + Utils::printSafe($type) + )); + } + yield $type; + } + } + + /** + * Returns array of all types in this schema. Keys of this array represent type names, values are instances + * of corresponding type definitions + * + * This operation requires full schema scan. Do not use in production environment. + * + * @return array + * + * @api + */ + public function getTypeMap() : array + { + if (! $this->fullyLoaded) { + $this->resolvedTypes = $this->collectAllTypes(); + $this->fullyLoaded = true; + } + + return $this->resolvedTypes; + } + + /** + * @return Type[] + */ + private function collectAllTypes() + { + $typeMap = []; + foreach ($this->resolvedTypes as $type) { + $typeMap = TypeInfo::extractTypes($type, $typeMap); + } + foreach ($this->getDirectives() as $directive) { + if (! ($directive instanceof Directive)) { + continue; + } + + $typeMap = TypeInfo::extractTypesFromDirectives($directive, $typeMap); + } + // When types are set as array they are resolved in constructor + if (is_callable($this->config->types)) { + foreach ($this->resolveAdditionalTypes() as $type) { + $typeMap = TypeInfo::extractTypes($type, $typeMap); + } + } + + return $typeMap; + } + + /** + * Returns a list of directives supported by this schema + * + * @return Directive[] + * + * @api + */ + public function getDirectives() + { + return $this->config->directives ?? GraphQL::getStandardDirectives(); + } + + /** + * @param string $operation + * + * @return ObjectType|null + */ + public function getOperationType($operation) + { + switch ($operation) { + case 'query': + return $this->getQueryType(); + case 'mutation': + return $this->getMutationType(); + case 'subscription': + return $this->getSubscriptionType(); + default: + return null; + } + } + + /** + * Returns schema query type + * + * @return ObjectType + * + * @api + */ + public function getQueryType() : ?Type + { + return $this->config->query; + } + + /** + * Returns schema mutation type + * + * @return ObjectType|null + * + * @api + */ + public function getMutationType() : ?Type + { + return $this->config->mutation; + } + + /** + * Returns schema subscription + * + * @return ObjectType|null + * + * @api + */ + public function getSubscriptionType() : ?Type + { + return $this->config->subscription; + } + + /** + * @return SchemaConfig + * + * @api + */ + public function getConfig() + { + return $this->config; + } + + /** + * Returns type by its name + * + * @api + */ + public function getType(string $name) : ?Type + { + if (! isset($this->resolvedTypes[$name])) { + $type = $this->loadType($name); + + if (! $type) { + return null; + } + $this->resolvedTypes[$name] = self::resolveType($type); + } + + return $this->resolvedTypes[$name]; + } + + public function hasType(string $name) : bool + { + return $this->getType($name) !== null; + } + + private function loadType(string $typeName) : ?Type + { + $typeLoader = $this->config->typeLoader; + + if (! isset($typeLoader)) { + return $this->defaultTypeLoader($typeName); + } + + $type = $typeLoader($typeName); + + if (! $type instanceof Type) { + // Unless you know what you're doing, kindly resist the temptation to refactor or simplify this block. The + // twisty logic here is tuned for performance, and meant to prioritize the "happy path" (the result returned + // from the type loader is already a Type), and only checks for callable if that fails. If the result is + // neither a Type nor a callable, then we throw an exception. + + if (is_callable($type)) { + $type = $type(); + + if (! $type instanceof Type) { + $this->throwNotAType($type, $typeName); + } + } else { + $this->throwNotAType($type, $typeName); + } + } + + if ($type->name !== $typeName) { + throw new InvariantViolation( + sprintf('Type loader is expected to return type "%s", but it returned "%s"', $typeName, $type->name) + ); + } + + return $type; + } + + protected function throwNotAType($type, string $typeName) + { + throw new InvariantViolation( + sprintf( + 'Type loader is expected to return a callable or valid type "%s", but it returned %s', + $typeName, + Utils::printSafe($type) + ) + ); + } + + private function defaultTypeLoader(string $typeName) : ?Type + { + // Default type loader simply falls back to collecting all types + $typeMap = $this->getTypeMap(); + + return $typeMap[$typeName] ?? null; + } + + /** + * @param Type|callable():Type $type + */ + public static function resolveType($type) : Type + { + if ($type instanceof Type) { + return $type; + } + + return $type(); + } + + /** + * Returns all possible concrete types for given abstract type + * (implementations for interfaces and members of union type for unions) + * + * This operation requires full schema scan. Do not use in production environment. + * + * @param InterfaceType|UnionType $abstractType + * + * @return array + * + * @api + */ + public function getPossibleTypes(Type $abstractType) : array + { + return $abstractType instanceof UnionType + ? $abstractType->getTypes() + : $this->getImplementations($abstractType)->objects(); + } + + /** + * Returns all types that implement a given interface type. + * + * This operations requires full schema scan. Do not use in production environment. + * + * @api + */ + public function getImplementations(InterfaceType $abstractType) : InterfaceImplementations + { + return $this->collectImplementations()[$abstractType->name]; + } + + /** + * @return array + */ + private function collectImplementations() : array + { + if (! isset($this->implementationsMap)) { + /** @var array> $foundImplementations */ + $foundImplementations = []; + foreach ($this->getTypeMap() as $type) { + if ($type instanceof InterfaceType) { + if (! isset($foundImplementations[$type->name])) { + $foundImplementations[$type->name] = ['objects' => [], 'interfaces' => []]; + } + + foreach ($type->getInterfaces() as $iface) { + if (! isset($foundImplementations[$iface->name])) { + $foundImplementations[$iface->name] = ['objects' => [], 'interfaces' => []]; + } + $foundImplementations[$iface->name]['interfaces'][] = $type; + } + } elseif ($type instanceof ObjectType) { + foreach ($type->getInterfaces() as $iface) { + if (! isset($foundImplementations[$iface->name])) { + $foundImplementations[$iface->name] = ['objects' => [], 'interfaces' => []]; + } + $foundImplementations[$iface->name]['objects'][] = $type; + } + } + } + $this->implementationsMap = array_map( + static function (array $implementations) : InterfaceImplementations { + return new InterfaceImplementations($implementations['objects'], $implementations['interfaces']); + }, + $foundImplementations + ); + } + + return $this->implementationsMap; + } + + /** + * @deprecated as of 14.4.0 use isSubType instead, will be removed in 15.0.0. + * + * Returns true if object type is concrete type of given abstract type + * (implementation for interfaces and members of union type for unions) + * + * @api + * @codeCoverageIgnore + */ + public function isPossibleType(AbstractType $abstractType, ObjectType $possibleType) : bool + { + return $this->isSubType($abstractType, $possibleType); + } + + /** + * Returns true if the given type is a sub type of the given abstract type. + * + * @param UnionType|InterfaceType $abstractType + * @param ObjectType|InterfaceType $maybeSubType + * + * @api + */ + public function isSubType(AbstractType $abstractType, ImplementingType $maybeSubType) : bool + { + if ($abstractType instanceof InterfaceType) { + return $maybeSubType->implementsInterface($abstractType); + } + + if ($abstractType instanceof UnionType) { + return $abstractType->isPossibleType($maybeSubType); + } + + throw new InvalidArgumentException(sprintf('$abstractType must be of type UnionType|InterfaceType got: %s.', get_class($abstractType))); + } + + /** + * Returns instance of directive by name + * + * @api + */ + public function getDirective(string $name) : ?Directive + { + foreach ($this->getDirectives() as $directive) { + if ($directive->name === $name) { + return $directive; + } + } + + return null; + } + + public function getAstNode() : ?SchemaDefinitionNode + { + return $this->config->getAstNode(); + } + + /** + * Validates schema. + * + * This operation requires full schema scan. Do not use in production environment. + * + * @throws InvariantViolation + * + * @api + */ + public function assertValid() + { + $errors = $this->validate(); + + if ($errors) { + throw new InvariantViolation(implode("\n\n", $this->validationErrors)); + } + + $internalTypes = Type::getStandardTypes() + Introspection::getTypes(); + foreach ($this->getTypeMap() as $name => $type) { + if (isset($internalTypes[$name])) { + continue; + } + + $type->assertValid(); + + // Make sure type loader returns the same instance as registered in other places of schema + if (! $this->config->typeLoader) { + continue; + } + + Utils::invariant( + $this->loadType($name) === $type, + sprintf( + 'Type loader returns different instance for %s than field/argument definitions. Make sure you always return the same instance for the same type name.', + $name + ) + ); + } + } + + /** + * Validates schema. + * + * This operation requires full schema scan. Do not use in production environment. + * + * @return InvariantViolation[]|Error[] + * + * @api + */ + public function validate() + { + // If this Schema has already been validated, return the previous results. + if ($this->validationErrors !== null) { + return $this->validationErrors; + } + // Validate the schema, producing a list of errors. + $context = new SchemaValidationContext($this); + $context->validateRootTypes(); + $context->validateDirectives(); + $context->validateTypes(); + + // Persist the results of validation before returning to ensure validation + // does not run multiple times for this schema. + $this->validationErrors = $context->getErrors(); + + return $this->validationErrors; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaConfig.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaConfig.php new file mode 100644 index 00000000..f3511d78 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaConfig.php @@ -0,0 +1,313 @@ +setQuery($myQueryType) + * ->setTypeLoader($myTypeLoader); + * + * $schema = new Schema($config); + */ +class SchemaConfig +{ + /** @var ObjectType|null */ + public $query; + + /** @var ObjectType|null */ + public $mutation; + + /** @var ObjectType|null */ + public $subscription; + + /** @var Type[]|callable */ + public $types = []; + + /** @var Directive[]|null */ + public $directives; + + /** @var callable|null */ + public $typeLoader; + + /** @var SchemaDefinitionNode|null */ + public $astNode; + + /** @var bool */ + public $assumeValid = false; + + /** @var SchemaTypeExtensionNode[] */ + public $extensionASTNodes = []; + + /** + * Converts an array of options to instance of SchemaConfig + * (or just returns empty config when array is not passed). + * + * @param mixed[] $options + * + * @return SchemaConfig + * + * @api + */ + public static function create(array $options = []) + { + $config = new static(); + + if (count($options) > 0) { + if (isset($options['query'])) { + $config->setQuery($options['query']); + } + + if (isset($options['mutation'])) { + $config->setMutation($options['mutation']); + } + + if (isset($options['subscription'])) { + $config->setSubscription($options['subscription']); + } + + if (isset($options['types'])) { + $config->setTypes($options['types']); + } + + if (isset($options['directives'])) { + $config->setDirectives($options['directives']); + } + + if (isset($options['typeLoader'])) { + Utils::invariant( + is_callable($options['typeLoader']), + 'Schema type loader must be callable if provided but got: %s', + Utils::printSafe($options['typeLoader']) + ); + $config->setTypeLoader($options['typeLoader']); + } + + if (isset($options['astNode'])) { + $config->setAstNode($options['astNode']); + } + + if (isset($options['assumeValid'])) { + $config->setAssumeValid((bool) $options['assumeValid']); + } + + if (isset($options['extensionASTNodes'])) { + $config->setExtensionASTNodes($options['extensionASTNodes']); + } + } + + return $config; + } + + /** + * @return SchemaDefinitionNode|null + */ + public function getAstNode() + { + return $this->astNode; + } + + /** + * @return SchemaConfig + */ + public function setAstNode(SchemaDefinitionNode $astNode) + { + $this->astNode = $astNode; + + return $this; + } + + /** + * @return ObjectType|null + * + * @api + */ + public function getQuery() + { + return $this->query; + } + + /** + * @param ObjectType|null $query + * + * @return SchemaConfig + * + * @api + */ + public function setQuery($query) + { + $this->query = $query; + + return $this; + } + + /** + * @return ObjectType|null + * + * @api + */ + public function getMutation() + { + return $this->mutation; + } + + /** + * @param ObjectType|null $mutation + * + * @return SchemaConfig + * + * @api + */ + public function setMutation($mutation) + { + $this->mutation = $mutation; + + return $this; + } + + /** + * @return ObjectType|null + * + * @api + */ + public function getSubscription() + { + return $this->subscription; + } + + /** + * @param ObjectType|null $subscription + * + * @return SchemaConfig + * + * @api + */ + public function setSubscription($subscription) + { + $this->subscription = $subscription; + + return $this; + } + + /** + * @return Type[]|callable + * + * @api + */ + public function getTypes() + { + return $this->types; + } + + /** + * @param Type[]|callable $types + * + * @return SchemaConfig + * + * @api + */ + public function setTypes($types) + { + $this->types = $types; + + return $this; + } + + /** + * @return Directive[]|null + * + * @api + */ + public function getDirectives() + { + return $this->directives; + } + + /** + * @param Directive[] $directives + * + * @return SchemaConfig + * + * @api + */ + public function setDirectives(array $directives) + { + $this->directives = $directives; + + return $this; + } + + /** + * @return callable|null + * + * @api + */ + public function getTypeLoader() + { + return $this->typeLoader; + } + + /** + * @return SchemaConfig + * + * @api + */ + public function setTypeLoader(callable $typeLoader) + { + $this->typeLoader = $typeLoader; + + return $this; + } + + /** + * @return bool + */ + public function getAssumeValid() + { + return $this->assumeValid; + } + + /** + * @param bool $assumeValid + * + * @return SchemaConfig + */ + public function setAssumeValid($assumeValid) + { + $this->assumeValid = $assumeValid; + + return $this; + } + + /** + * @return SchemaTypeExtensionNode[] + */ + public function getExtensionASTNodes() + { + return $this->extensionASTNodes; + } + + /** + * @param SchemaTypeExtensionNode[] $extensionASTNodes + */ + public function setExtensionASTNodes(array $extensionASTNodes) + { + $this->extensionASTNodes = $extensionASTNodes; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaValidationContext.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaValidationContext.php new file mode 100644 index 00000000..fb64bd5d --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaValidationContext.php @@ -0,0 +1,1084 @@ +schema = $schema; + $this->inputObjectCircularRefs = new InputObjectCircularRefs($this); + } + + /** + * @return Error[] + */ + public function getErrors() + { + return $this->errors; + } + + public function validateRootTypes() : void + { + $queryType = $this->schema->getQueryType(); + if (! $queryType) { + $this->reportError( + 'Query root type must be provided.', + $this->schema->getAstNode() + ); + } elseif (! $queryType instanceof ObjectType) { + $this->reportError( + 'Query root type must be Object type, it cannot be ' . Utils::printSafe($queryType) . '.', + $this->getOperationTypeNode($queryType, 'query') + ); + } + + $mutationType = $this->schema->getMutationType(); + if ($mutationType && ! $mutationType instanceof ObjectType) { + $this->reportError( + 'Mutation root type must be Object type if provided, it cannot be ' . Utils::printSafe($mutationType) . '.', + $this->getOperationTypeNode($mutationType, 'mutation') + ); + } + + $subscriptionType = $this->schema->getSubscriptionType(); + if ($subscriptionType === null || $subscriptionType instanceof ObjectType) { + return; + } + + $this->reportError( + 'Subscription root type must be Object type if provided, it cannot be ' . Utils::printSafe($subscriptionType) . '.', + $this->getOperationTypeNode($subscriptionType, 'subscription') + ); + } + + /** + * @param string $message + * @param Node[]|Node|TypeNode|TypeDefinitionNode|null $nodes + */ + public function reportError($message, $nodes = null) + { + $nodes = array_filter($nodes && is_array($nodes) ? $nodes : [$nodes]); + $this->addError(new Error($message, $nodes)); + } + + /** + * @param Error $error + */ + private function addError($error) + { + $this->errors[] = $error; + } + + /** + * @param Type $type + * @param string $operation + * + * @return NamedTypeNode|ListTypeNode|NonNullTypeNode|TypeDefinitionNode + */ + private function getOperationTypeNode($type, $operation) + { + $astNode = $this->schema->getAstNode(); + + $operationTypeNode = null; + if ($astNode instanceof SchemaDefinitionNode) { + $operationTypeNode = null; + + foreach ($astNode->operationTypes as $operationType) { + if ($operationType->operation === $operation) { + $operationTypeNode = $operationType; + break; + } + } + } + + return $operationTypeNode ? $operationTypeNode->type : ($type ? $type->astNode : null); + } + + public function validateDirectives() + { + $this->validateDirectiveDefinitions(); + + // Validate directives that are used on the schema + $this->validateDirectivesAtLocation( + $this->getDirectives($this->schema), + DirectiveLocation::SCHEMA + ); + } + + public function validateDirectiveDefinitions() + { + $directiveDefinitions = []; + + $directives = $this->schema->getDirectives(); + foreach ($directives as $directive) { + // Ensure all directives are in fact GraphQL directives. + if (! $directive instanceof Directive) { + $nodes = is_object($directive) + ? $directive->astNode + : null; + + $this->reportError( + 'Expected directive but got: ' . Utils::printSafe($directive) . '.', + $nodes + ); + continue; + } + $existingDefinitions = $directiveDefinitions[$directive->name] ?? []; + $existingDefinitions[] = $directive; + $directiveDefinitions[$directive->name] = $existingDefinitions; + + // Ensure they are named correctly. + $this->validateName($directive); + + // TODO: Ensure proper locations. + + $argNames = []; + foreach ($directive->args as $arg) { + $argName = $arg->name; + + // Ensure they are named correctly. + $this->validateName($directive); + + if (isset($argNames[$argName])) { + $this->reportError( + sprintf('Argument @%s(%s:) can only be defined once.', $directive->name, $argName), + $this->getAllDirectiveArgNodes($directive, $argName) + ); + continue; + } + + $argNames[$argName] = true; + + // Ensure the type is an input type. + if (Type::isInputType($arg->getType())) { + continue; + } + + $this->reportError( + sprintf( + 'The type of @%s(%s:) must be Input Type but got: %s.', + $directive->name, + $argName, + Utils::printSafe($arg->getType()) + ), + $this->getDirectiveArgTypeNode($directive, $argName) + ); + } + } + foreach ($directiveDefinitions as $directiveName => $directiveList) { + if (count($directiveList) <= 1) { + continue; + } + + $nodes = Utils::map( + $directiveList, + static function (Directive $directive) : ?DirectiveDefinitionNode { + return $directive->astNode; + } + ); + $this->reportError( + sprintf('Directive @%s defined multiple times.', $directiveName), + array_filter($nodes) + ); + } + } + + /** + * @param Type|Directive|FieldDefinition|EnumValueDefinition|InputObjectField $node + */ + private function validateName($node) + { + // Ensure names are valid, however introspection types opt out. + $error = Utils::isValidNameError($node->name, $node->astNode); + if (! $error || Introspection::isIntrospectionType($node)) { + return; + } + + $this->addError($error); + } + + /** + * @param string $argName + * + * @return InputValueDefinitionNode[] + */ + private function getAllDirectiveArgNodes(Directive $directive, $argName) + { + $subNodes = $this->getAllSubNodes( + $directive, + static function ($directiveNode) { + return $directiveNode->arguments; + } + ); + + return Utils::filter( + $subNodes, + static function ($argNode) use ($argName) : bool { + return $argNode->name->value === $argName; + } + ); + } + + /** + * @param string $argName + * + * @return NamedTypeNode|ListTypeNode|NonNullTypeNode|null + */ + private function getDirectiveArgTypeNode(Directive $directive, $argName) : ?TypeNode + { + $argNode = $this->getAllDirectiveArgNodes($directive, $argName)[0]; + + return $argNode ? $argNode->type : null; + } + + public function validateTypes() : void + { + $typeMap = $this->schema->getTypeMap(); + foreach ($typeMap as $typeName => $type) { + // Ensure all provided types are in fact GraphQL type. + if (! $type instanceof NamedType) { + $this->reportError( + 'Expected GraphQL named type but got: ' . Utils::printSafe($type) . '.', + $type instanceof Type ? $type->astNode : null + ); + continue; + } + + $this->validateName($type); + + if ($type instanceof ObjectType) { + // Ensure fields are valid + $this->validateFields($type); + + // Ensure objects implement the interfaces they claim to. + $this->validateInterfaces($type); + + // Ensure directives are valid + $this->validateDirectivesAtLocation( + $this->getDirectives($type), + DirectiveLocation::OBJECT + ); + } elseif ($type instanceof InterfaceType) { + // Ensure fields are valid. + $this->validateFields($type); + + // Ensure interfaces implement the interfaces they claim to. + $this->validateInterfaces($type); + + // Ensure directives are valid + $this->validateDirectivesAtLocation( + $this->getDirectives($type), + DirectiveLocation::IFACE + ); + } elseif ($type instanceof UnionType) { + // Ensure Unions include valid member types. + $this->validateUnionMembers($type); + + // Ensure directives are valid + $this->validateDirectivesAtLocation( + $this->getDirectives($type), + DirectiveLocation::UNION + ); + } elseif ($type instanceof EnumType) { + // Ensure Enums have valid values. + $this->validateEnumValues($type); + + // Ensure directives are valid + $this->validateDirectivesAtLocation( + $this->getDirectives($type), + DirectiveLocation::ENUM + ); + } elseif ($type instanceof InputObjectType) { + // Ensure Input Object fields are valid. + $this->validateInputFields($type); + + // Ensure directives are valid + $this->validateDirectivesAtLocation( + $this->getDirectives($type), + DirectiveLocation::INPUT_OBJECT + ); + + // Ensure Input Objects do not contain non-nullable circular references + $this->inputObjectCircularRefs->validate($type); + } elseif ($type instanceof ScalarType) { + // Ensure directives are valid + $this->validateDirectivesAtLocation( + $this->getDirectives($type), + DirectiveLocation::SCALAR + ); + } + } + } + + /** + * @param NodeList $directives + */ + private function validateDirectivesAtLocation($directives, string $location) + { + /** @var array> $potentiallyDuplicateDirectives */ + $potentiallyDuplicateDirectives = []; + $schema = $this->schema; + foreach ($directives as $directive) { + $directiveName = $directive->name->value; + + // Ensure directive used is also defined + $schemaDirective = $schema->getDirective($directiveName); + if ($schemaDirective === null) { + $this->reportError( + sprintf('No directive @%s defined.', $directiveName), + $directive + ); + continue; + } + + $includes = Utils::some( + $schemaDirective->locations, + static function ($schemaLocation) use ($location) : bool { + return $schemaLocation === $location; + } + ); + if (! $includes) { + $errorNodes = $schemaDirective->astNode + ? [$directive, $schemaDirective->astNode] + : [$directive]; + $this->reportError( + sprintf('Directive @%s not allowed at %s location.', $directiveName, $location), + $errorNodes + ); + } + + if ($schemaDirective->isRepeatable) { + continue; + } + + $existingNodes = $potentiallyDuplicateDirectives[$directiveName] ?? []; + $existingNodes[] = $directive; + $potentiallyDuplicateDirectives[$directiveName] = $existingNodes; + } + + foreach ($potentiallyDuplicateDirectives as $directiveName => $directiveList) { + if (count($directiveList) <= 1) { + continue; + } + + $this->reportError( + sprintf('Non-repeatable directive @%s used more than once at the same location.', $directiveName), + $directiveList + ); + } + } + + /** + * @param ObjectType|InterfaceType $type + */ + private function validateFields($type) + { + $fieldMap = $type->getFields(); + + // Objects and Interfaces both must define one or more fields. + if ($fieldMap === []) { + $this->reportError( + sprintf('Type %s must define one or more fields.', $type->name), + $this->getAllNodes($type) + ); + } + + foreach ($fieldMap as $fieldName => $field) { + // Ensure they are named correctly. + $this->validateName($field); + + // Ensure they were defined at most once. + $fieldNodes = $this->getAllFieldNodes($type, $fieldName); + if ($fieldNodes && count($fieldNodes) > 1) { + $this->reportError( + sprintf('Field %s.%s can only be defined once.', $type->name, $fieldName), + $fieldNodes + ); + continue; + } + + // Ensure the type is an output type + if (! Type::isOutputType($field->getType())) { + $this->reportError( + sprintf( + 'The type of %s.%s must be Output Type but got: %s.', + $type->name, + $fieldName, + Utils::printSafe($field->getType()) + ), + $this->getFieldTypeNode($type, $fieldName) + ); + } + + // Ensure the arguments are valid + $argNames = []; + foreach ($field->args as $arg) { + $argName = $arg->name; + + // Ensure they are named correctly. + $this->validateName($arg); + + if (isset($argNames[$argName])) { + $this->reportError( + sprintf( + 'Field argument %s.%s(%s:) can only be defined once.', + $type->name, + $fieldName, + $argName + ), + $this->getAllFieldArgNodes($type, $fieldName, $argName) + ); + } + $argNames[$argName] = true; + + // Ensure the type is an input type + if (! Type::isInputType($arg->getType())) { + $this->reportError( + sprintf( + 'The type of %s.%s(%s:) must be Input Type but got: %s.', + $type->name, + $fieldName, + $argName, + Utils::printSafe($arg->getType()) + ), + $this->getFieldArgTypeNode($type, $fieldName, $argName) + ); + } + + // Ensure argument definition directives are valid + if (! isset($arg->astNode, $arg->astNode->directives)) { + continue; + } + + $this->validateDirectivesAtLocation( + $arg->astNode->directives, + DirectiveLocation::ARGUMENT_DEFINITION + ); + } + + // Ensure any directives are valid + if (! isset($field->astNode, $field->astNode->directives)) { + continue; + } + + $this->validateDirectivesAtLocation( + $field->astNode->directives, + DirectiveLocation::FIELD_DEFINITION + ); + } + } + + /** + * @param Schema|ObjectType|InterfaceType|UnionType|EnumType|InputObjectType|Directive $obj + * + * @return ObjectTypeDefinitionNode[]|ObjectTypeExtensionNode[]|InterfaceTypeDefinitionNode[]|InterfaceTypeExtensionNode[] + */ + private function getAllNodes($obj) + { + if ($obj instanceof Schema) { + $astNode = $obj->getAstNode(); + $extensionNodes = $obj->extensionASTNodes; + } else { + $astNode = $obj->astNode; + $extensionNodes = $obj->extensionASTNodes; + } + + return $astNode + ? ($extensionNodes + ? array_merge([$astNode], $extensionNodes) + : [$astNode]) + : ($extensionNodes ?? []); + } + + /** + * @param Schema|ObjectType|InterfaceType|UnionType|EnumType|Directive $obj + */ + private function getAllSubNodes($obj, callable $getter) : NodeList + { + $result = new NodeList([]); + foreach ($this->getAllNodes($obj) as $astNode) { + if (! $astNode) { + continue; + } + + $subNodes = $getter($astNode); + if (! $subNodes) { + continue; + } + + $result = $result->merge($subNodes); + } + + return $result; + } + + /** + * @param ObjectType|InterfaceType $type + * @param string $fieldName + * + * @return FieldDefinitionNode[] + */ + private function getAllFieldNodes($type, $fieldName) + { + $subNodes = $this->getAllSubNodes($type, static function ($typeNode) { + return $typeNode->fields; + }); + + return Utils::filter($subNodes, static function ($fieldNode) use ($fieldName) : bool { + return $fieldNode->name->value === $fieldName; + }); + } + + /** + * @param ObjectType|InterfaceType $type + * @param string $fieldName + * + * @return NamedTypeNode|ListTypeNode|NonNullTypeNode|null + */ + private function getFieldTypeNode($type, $fieldName) : ?TypeNode + { + $fieldNode = $this->getFieldNode($type, $fieldName); + + return $fieldNode ? $fieldNode->type : null; + } + + /** + * @param ObjectType|InterfaceType $type + * @param string $fieldName + * + * @return FieldDefinitionNode|null + */ + private function getFieldNode($type, $fieldName) + { + $nodes = $this->getAllFieldNodes($type, $fieldName); + + return $nodes[0] ?? null; + } + + /** + * @param ObjectType|InterfaceType $type + * @param string $fieldName + * @param string $argName + * + * @return InputValueDefinitionNode[] + */ + private function getAllFieldArgNodes($type, $fieldName, $argName) + { + $argNodes = []; + $fieldNode = $this->getFieldNode($type, $fieldName); + if ($fieldNode && $fieldNode->arguments) { + foreach ($fieldNode->arguments as $node) { + if ($node->name->value !== $argName) { + continue; + } + + $argNodes[] = $node; + } + } + + return $argNodes; + } + + /** + * @param ObjectType|InterfaceType $type + * @param string $fieldName + * @param string $argName + * + * @return NamedTypeNode|ListTypeNode|NonNullTypeNode|null + */ + private function getFieldArgTypeNode($type, $fieldName, $argName) : ?TypeNode + { + $fieldArgNode = $this->getFieldArgNode($type, $fieldName, $argName); + + return $fieldArgNode ? $fieldArgNode->type : null; + } + + /** + * @param ObjectType|InterfaceType $type + * @param string $fieldName + * @param string $argName + * + * @return InputValueDefinitionNode|null + */ + private function getFieldArgNode($type, $fieldName, $argName) + { + $nodes = $this->getAllFieldArgNodes($type, $fieldName, $argName); + + return $nodes[0] ?? null; + } + + /** + * @param ObjectType|InterfaceType $type + */ + private function validateInterfaces(ImplementingType $type) : void + { + $ifaceTypeNames = []; + foreach ($type->getInterfaces() as $iface) { + if (! $iface instanceof InterfaceType) { + $this->reportError( + sprintf( + 'Type %s must only implement Interface types, it cannot implement %s.', + $type->name, + Utils::printSafe($iface) + ), + $this->getImplementsInterfaceNode($type, $iface) + ); + continue; + } + + if ($type === $iface) { + $this->reportError( + sprintf( + 'Type %s cannot implement itself because it would create a circular reference.', + $type->name + ), + $this->getImplementsInterfaceNode($type, $iface) + ); + continue; + } + + if (isset($ifaceTypeNames[$iface->name])) { + $this->reportError( + sprintf('Type %s can only implement %s once.', $type->name, $iface->name), + $this->getAllImplementsInterfaceNodes($type, $iface) + ); + continue; + } + $ifaceTypeNames[$iface->name] = true; + + $this->validateTypeImplementsAncestors($type, $iface); + $this->validateTypeImplementsInterface($type, $iface); + } + } + + /** + * @param Schema|Type $object + * + * @return NodeList + */ + private function getDirectives($object) + { + return $this->getAllSubNodes($object, static function ($node) { + return $node->directives; + }); + } + + /** + * @param ObjectType|InterfaceType $type + */ + private function getImplementsInterfaceNode(ImplementingType $type, Type $shouldBeInterface) : ?NamedTypeNode + { + $nodes = $this->getAllImplementsInterfaceNodes($type, $shouldBeInterface); + + return $nodes[0] ?? null; + } + + /** + * @param ObjectType|InterfaceType $type + * + * @return array + */ + private function getAllImplementsInterfaceNodes(ImplementingType $type, Type $shouldBeInterface) : array + { + $subNodes = $this->getAllSubNodes($type, static function (Node $typeNode) : NodeList { + /** @var ObjectTypeDefinitionNode|ObjectTypeExtensionNode|InterfaceTypeDefinitionNode|InterfaceTypeExtensionNode $typeNode */ + return $typeNode->interfaces; + }); + + return Utils::filter($subNodes, static function (NamedTypeNode $ifaceNode) use ($shouldBeInterface) : bool { + return $ifaceNode->name->value === $shouldBeInterface->name; + }); + } + + /** + * @param ObjectType|InterfaceType $type + */ + private function validateTypeImplementsInterface(ImplementingType $type, InterfaceType $iface) + { + $typeFieldMap = $type->getFields(); + $ifaceFieldMap = $iface->getFields(); + + // Assert each interface field is implemented. + foreach ($ifaceFieldMap as $fieldName => $ifaceField) { + $typeField = array_key_exists($fieldName, $typeFieldMap) + ? $typeFieldMap[$fieldName] + : null; + + // Assert interface field exists on type. + if (! $typeField) { + $this->reportError( + sprintf( + 'Interface field %s.%s expected but %s does not provide it.', + $iface->name, + $fieldName, + $type->name + ), + array_merge( + [$this->getFieldNode($iface, $fieldName)], + $this->getAllNodes($type) + ) + ); + continue; + } + + // Assert interface field type is satisfied by type field type, by being + // a valid subtype. (covariant) + if (! TypeComparators::isTypeSubTypeOf( + $this->schema, + $typeField->getType(), + $ifaceField->getType() + ) + ) { + $this->reportError( + sprintf( + 'Interface field %s.%s expects type %s but %s.%s is type %s.', + $iface->name, + $fieldName, + $ifaceField->getType(), + $type->name, + $fieldName, + Utils::printSafe($typeField->getType()) + ), + [ + $this->getFieldTypeNode($iface, $fieldName), + $this->getFieldTypeNode($type, $fieldName), + ] + ); + } + + // Assert each interface field arg is implemented. + foreach ($ifaceField->args as $ifaceArg) { + $argName = $ifaceArg->name; + $typeArg = null; + + foreach ($typeField->args as $arg) { + if ($arg->name === $argName) { + $typeArg = $arg; + break; + } + } + + // Assert interface field arg exists on type field. + if (! $typeArg) { + $this->reportError( + sprintf( + 'Interface field argument %s.%s(%s:) expected but %s.%s does not provide it.', + $iface->name, + $fieldName, + $argName, + $type->name, + $fieldName + ), + [ + $this->getFieldArgNode($iface, $fieldName, $argName), + $this->getFieldNode($type, $fieldName), + ] + ); + continue; + } + + // Assert interface field arg type matches type field arg type. + // (invariant) + // TODO: change to contravariant? + if (! TypeComparators::isEqualType($ifaceArg->getType(), $typeArg->getType())) { + $this->reportError( + sprintf( + 'Interface field argument %s.%s(%s:) expects type %s but %s.%s(%s:) is type %s.', + $iface->name, + $fieldName, + $argName, + Utils::printSafe($ifaceArg->getType()), + $type->name, + $fieldName, + $argName, + Utils::printSafe($typeArg->getType()) + ), + [ + $this->getFieldArgTypeNode($iface, $fieldName, $argName), + $this->getFieldArgTypeNode($type, $fieldName, $argName), + ] + ); + } + // TODO: validate default values? + } + + // Assert additional arguments must not be required. + foreach ($typeField->args as $typeArg) { + $argName = $typeArg->name; + $ifaceArg = null; + + foreach ($ifaceField->args as $arg) { + if ($arg->name === $argName) { + $ifaceArg = $arg; + break; + } + } + + if ($ifaceArg || ! $typeArg->isRequired()) { + continue; + } + + $this->reportError( + sprintf( + 'Object field %s.%s includes required argument %s that is missing from the Interface field %s.%s.', + $type->name, + $fieldName, + $argName, + $iface->name, + $fieldName + ), + [ + $this->getFieldArgNode($type, $fieldName, $argName), + $this->getFieldNode($iface, $fieldName), + ] + ); + } + } + } + + /** + * @param ObjectType|InterfaceType $type + */ + private function validateTypeImplementsAncestors(ImplementingType $type, InterfaceType $iface) : void + { + $typeInterfaces = $type->getInterfaces(); + foreach ($iface->getInterfaces() as $transitive) { + if (in_array($transitive, $typeInterfaces, true)) { + continue; + } + + $error = $transitive === $type ? + sprintf( + 'Type %s cannot implement %s because it would create a circular reference.', + $type->name, + $iface->name + ) : + sprintf( + 'Type %s must implement %s because it is implemented by %s.', + $type->name, + $transitive->name, + $iface->name + ); + $this->reportError( + $error, + array_merge( + $this->getAllImplementsInterfaceNodes($iface, $transitive), + $this->getAllImplementsInterfaceNodes($type, $iface) + ) + ); + } + } + + private function validateUnionMembers(UnionType $union) + { + $memberTypes = $union->getTypes(); + + if (! $memberTypes) { + $this->reportError( + sprintf('Union type %s must define one or more member types.', $union->name), + $this->getAllNodes($union) + ); + } + + $includedTypeNames = []; + + foreach ($memberTypes as $memberType) { + if (isset($includedTypeNames[$memberType->name])) { + $this->reportError( + sprintf('Union type %s can only include type %s once.', $union->name, $memberType->name), + $this->getUnionMemberTypeNodes($union, $memberType->name) + ); + continue; + } + $includedTypeNames[$memberType->name] = true; + if ($memberType instanceof ObjectType) { + continue; + } + + $this->reportError( + sprintf( + 'Union type %s can only include Object types, it cannot include %s.', + $union->name, + Utils::printSafe($memberType) + ), + $this->getUnionMemberTypeNodes($union, Utils::printSafe($memberType)) + ); + } + } + + /** + * @param string $typeName + * + * @return NamedTypeNode[] + */ + private function getUnionMemberTypeNodes(UnionType $union, $typeName) + { + $subNodes = $this->getAllSubNodes($union, static function ($unionNode) { + return $unionNode->types; + }); + + return Utils::filter($subNodes, static function ($typeNode) use ($typeName) : bool { + return $typeNode->name->value === $typeName; + }); + } + + private function validateEnumValues(EnumType $enumType) + { + $enumValues = $enumType->getValues(); + + if (! $enumValues) { + $this->reportError( + sprintf('Enum type %s must define one or more values.', $enumType->name), + $this->getAllNodes($enumType) + ); + } + + foreach ($enumValues as $enumValue) { + $valueName = $enumValue->name; + + // Ensure no duplicates + $allNodes = $this->getEnumValueNodes($enumType, $valueName); + if ($allNodes && count($allNodes) > 1) { + $this->reportError( + sprintf('Enum type %s can include value %s only once.', $enumType->name, $valueName), + $allNodes + ); + } + + // Ensure valid name. + $this->validateName($enumValue); + if ($valueName === 'true' || $valueName === 'false' || $valueName === 'null') { + $this->reportError( + sprintf('Enum type %s cannot include value: %s.', $enumType->name, $valueName), + $enumValue->astNode + ); + } + + // Ensure valid directives + if (! isset($enumValue->astNode, $enumValue->astNode->directives)) { + continue; + } + + $this->validateDirectivesAtLocation( + $enumValue->astNode->directives, + DirectiveLocation::ENUM_VALUE + ); + } + } + + /** + * @param string $valueName + * + * @return EnumValueDefinitionNode[] + */ + private function getEnumValueNodes(EnumType $enum, $valueName) + { + $subNodes = $this->getAllSubNodes($enum, static function ($enumNode) { + return $enumNode->values; + }); + + return Utils::filter($subNodes, static function ($valueNode) use ($valueName) : bool { + return $valueNode->name->value === $valueName; + }); + } + + private function validateInputFields(InputObjectType $inputObj) + { + $fieldMap = $inputObj->getFields(); + + if (! $fieldMap) { + $this->reportError( + sprintf('Input Object type %s must define one or more fields.', $inputObj->name), + $this->getAllNodes($inputObj) + ); + } + + // Ensure the arguments are valid + foreach ($fieldMap as $fieldName => $field) { + // Ensure they are named correctly. + $this->validateName($field); + + // TODO: Ensure they are unique per field. + + // Ensure the type is an input type + if (! Type::isInputType($field->getType())) { + $this->reportError( + sprintf( + 'The type of %s.%s must be Input Type but got: %s.', + $inputObj->name, + $fieldName, + Utils::printSafe($field->getType()) + ), + $field->astNode ? $field->astNode->type : null + ); + } + + // Ensure valid directives + if (! isset($field->astNode, $field->astNode->directives)) { + continue; + } + + $this->validateDirectivesAtLocation( + $field->astNode->directives, + DirectiveLocation::INPUT_FIELD_DEFINITION + ); + } + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/TypeKind.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/TypeKind.php new file mode 100644 index 00000000..69cdf2e2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/TypeKind.php @@ -0,0 +1,17 @@ + + */ + private $visitedTypes = []; + + /** @var InputObjectField[] */ + private $fieldPath = []; + + /** + * Position in the type path. + * + * [string $typeName => int $index] + * + * @var int[] + */ + private $fieldPathIndexByTypeName = []; + + public function __construct(SchemaValidationContext $schemaValidationContext) + { + $this->schemaValidationContext = $schemaValidationContext; + } + + /** + * This does a straight-forward DFS to find cycles. + * It does not terminate when a cycle was found but continues to explore + * the graph to find all possible cycles. + */ + public function validate(InputObjectType $inputObj) : void + { + if (isset($this->visitedTypes[$inputObj->name])) { + return; + } + + $this->visitedTypes[$inputObj->name] = true; + $this->fieldPathIndexByTypeName[$inputObj->name] = count($this->fieldPath); + + $fieldMap = $inputObj->getFields(); + foreach ($fieldMap as $fieldName => $field) { + $type = $field->getType(); + + if ($type instanceof NonNull) { + $fieldType = $type->getWrappedType(); + + // If the type of the field is anything else then a non-nullable input object, + // there is no chance of an unbreakable cycle + if ($fieldType instanceof InputObjectType) { + $this->fieldPath[] = $field; + + if (! isset($this->fieldPathIndexByTypeName[$fieldType->name])) { + $this->validate($fieldType); + } else { + $cycleIndex = $this->fieldPathIndexByTypeName[$fieldType->name]; + $cyclePath = array_slice($this->fieldPath, $cycleIndex); + $fieldNames = array_map( + static function (InputObjectField $field) : string { + return $field->name; + }, + $cyclePath + ); + + $this->schemaValidationContext->reportError( + 'Cannot reference Input Object "' . $fieldType->name . '" within itself ' + . 'through a series of non-null fields: "' . implode('.', $fieldNames) . '".', + array_map( + static function (InputObjectField $field) : ?InputValueDefinitionNode { + return $field->astNode; + }, + $cyclePath + ) + ); + } + } + } + + array_pop($this->fieldPath); + } + + unset($this->fieldPathIndexByTypeName[$inputObj->name]); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/AST.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/AST.php new file mode 100644 index 00000000..234d1063 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/AST.php @@ -0,0 +1,641 @@ + 'ListValue', + * 'values' => [ + * ['kind' => 'StringValue', 'value' => 'my str'], + * ['kind' => 'StringValue', 'value' => 'my other str'] + * ], + * 'loc' => ['start' => 21, 'end' => 25] + * ]); + * ``` + * + * Will produce instance of `ListValueNode` where `values` prop is a lazily-evaluated `NodeList` + * returning instances of `StringValueNode` on access. + * + * This is a reverse operation for AST::toArray($node) + * + * @param mixed[] $node + * + * @api + */ + public static function fromArray(array $node) : Node + { + if (! isset($node['kind']) || ! isset(NodeKind::$classMap[$node['kind']])) { + throw new InvariantViolation('Unexpected node structure: ' . Utils::printSafeJson($node)); + } + + $kind = $node['kind'] ?? null; + $class = NodeKind::$classMap[$kind]; + $instance = new $class([]); + + if (isset($node['loc'], $node['loc']['start'], $node['loc']['end'])) { + $instance->loc = Location::create($node['loc']['start'], $node['loc']['end']); + } + + foreach ($node as $key => $value) { + if ($key === 'loc' || $key === 'kind') { + continue; + } + if (is_array($value)) { + if (isset($value[0]) || count($value) === 0) { + $value = new NodeList($value); + } else { + $value = self::fromArray($value); + } + } + $instance->{$key} = $value; + } + + return $instance; + } + + /** + * Convert AST node to serializable array + * + * @return mixed[] + * + * @api + */ + public static function toArray(Node $node) : array + { + return $node->toArray(true); + } + + /** + * Produces a GraphQL Value AST given a PHP value. + * + * Optionally, a GraphQL type may be provided, which will be used to + * disambiguate between value primitives. + * + * | PHP Value | GraphQL Value | + * | ------------- | -------------------- | + * | Object | Input Object | + * | Assoc Array | Input Object | + * | Array | List | + * | Boolean | Boolean | + * | String | String / Enum Value | + * | Int | Int | + * | Float | Int / Float | + * | Mixed | Enum Value | + * | null | NullValue | + * + * @param Type|mixed|null $value + * + * @return ObjectValueNode|ListValueNode|BooleanValueNode|IntValueNode|FloatValueNode|EnumValueNode|StringValueNode|NullValueNode|null + * + * @api + */ + public static function astFromValue($value, InputType $type) + { + if ($type instanceof NonNull) { + $astValue = self::astFromValue($value, $type->getWrappedType()); + if ($astValue instanceof NullValueNode) { + return null; + } + + return $astValue; + } + + if ($value === null) { + return new NullValueNode([]); + } + + // Convert PHP array to GraphQL list. If the GraphQLType is a list, but + // the value is not an array, convert the value using the list's item type. + if ($type instanceof ListOfType) { + $itemType = $type->getWrappedType(); + if (is_array($value) || ($value instanceof Traversable)) { + $valuesNodes = []; + foreach ($value as $item) { + $itemNode = self::astFromValue($item, $itemType); + if (! $itemNode) { + continue; + } + + $valuesNodes[] = $itemNode; + } + + return new ListValueNode(['values' => new NodeList($valuesNodes)]); + } + + return self::astFromValue($value, $itemType); + } + + // Populate the fields of the input object by creating ASTs from each value + // in the PHP object according to the fields in the input type. + if ($type instanceof InputObjectType) { + $isArray = is_array($value); + $isArrayLike = $isArray || $value instanceof ArrayAccess; + if ($value === null || (! $isArrayLike && ! is_object($value))) { + return null; + } + $fields = $type->getFields(); + $fieldNodes = []; + foreach ($fields as $fieldName => $field) { + if ($isArrayLike) { + $fieldValue = $value[$fieldName] ?? null; + } else { + $fieldValue = $value->{$fieldName} ?? null; + } + + // Have to check additionally if key exists, since we differentiate between + // "no key" and "value is null": + if ($fieldValue !== null) { + $fieldExists = true; + } elseif ($isArray) { + $fieldExists = array_key_exists($fieldName, $value); + } elseif ($isArrayLike) { + $fieldExists = $value->offsetExists($fieldName); + } else { + $fieldExists = property_exists($value, $fieldName); + } + + if (! $fieldExists) { + continue; + } + + $fieldNode = self::astFromValue($fieldValue, $field->getType()); + + if (! $fieldNode) { + continue; + } + + $fieldNodes[] = new ObjectFieldNode([ + 'name' => new NameNode(['value' => $fieldName]), + 'value' => $fieldNode, + ]); + } + + return new ObjectValueNode(['fields' => new NodeList($fieldNodes)]); + } + + if ($type instanceof ScalarType || $type instanceof EnumType) { + // Since value is an internally represented value, it must be serialized + // to an externally represented value before converting into an AST. + try { + $serialized = $type->serialize($value); + } catch (Throwable $error) { + if ($error instanceof Error && $type instanceof EnumType) { + return null; + } + throw $error; + } + + // Others serialize based on their corresponding PHP scalar types. + if (is_bool($serialized)) { + return new BooleanValueNode(['value' => $serialized]); + } + if (is_int($serialized)) { + return new IntValueNode(['value' => (string) $serialized]); + } + if (is_float($serialized)) { + // int cast with == used for performance reasons + if ((int) $serialized == $serialized) { + return new IntValueNode(['value' => (string) $serialized]); + } + + return new FloatValueNode(['value' => (string) $serialized]); + } + if (is_string($serialized)) { + // Enum types use Enum literals. + if ($type instanceof EnumType) { + return new EnumValueNode(['value' => $serialized]); + } + + // ID types can use Int literals. + $asInt = (int) $serialized; + if ($type instanceof IDType && (string) $asInt === $serialized) { + return new IntValueNode(['value' => $serialized]); + } + + // Use json_encode, which uses the same string encoding as GraphQL, + // then remove the quotes. + return new StringValueNode(['value' => $serialized]); + } + + throw new InvariantViolation('Cannot convert value to AST: ' . Utils::printSafe($serialized)); + } + + throw new Error('Unknown type: ' . Utils::printSafe($type) . '.'); + } + + /** + * Produces a PHP value given a GraphQL Value AST. + * + * A GraphQL type must be provided, which will be used to interpret different + * GraphQL Value literals. + * + * Returns `null` when the value could not be validly coerced according to + * the provided type. + * + * | GraphQL Value | PHP Value | + * | -------------------- | ------------- | + * | Input Object | Assoc Array | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Int / Float | + * | Enum Value | Mixed | + * | Null Value | null | + * + * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode|null $valueNode + * @param mixed[]|null $variables + * + * @return mixed[]|stdClass|null + * + * @throws Exception + * + * @api + */ + public static function valueFromAST(?ValueNode $valueNode, Type $type, ?array $variables = null) + { + $undefined = Utils::undefined(); + + if ($valueNode === null) { + // When there is no AST, then there is also no value. + // Importantly, this is different from returning the GraphQL null value. + return $undefined; + } + + if ($type instanceof NonNull) { + if ($valueNode instanceof NullValueNode) { + // Invalid: intentionally return no value. + return $undefined; + } + + return self::valueFromAST($valueNode, $type->getWrappedType(), $variables); + } + + if ($valueNode instanceof NullValueNode) { + // This is explicitly returning the value null. + return null; + } + + if ($valueNode instanceof VariableNode) { + $variableName = $valueNode->name->value; + + if (! $variables || ! array_key_exists($variableName, $variables)) { + // No valid return value. + return $undefined; + } + + $variableValue = $variables[$variableName] ?? null; + if ($variableValue === null && $type instanceof NonNull) { + return $undefined; // Invalid: intentionally return no value. + } + + // Note: This does no further checking that this variable is correct. + // This assumes that this query has been validated and the variable + // usage here is of the correct type. + return $variables[$variableName]; + } + + if ($type instanceof ListOfType) { + $itemType = $type->getWrappedType(); + + if ($valueNode instanceof ListValueNode) { + $coercedValues = []; + $itemNodes = $valueNode->values; + foreach ($itemNodes as $itemNode) { + if (self::isMissingVariable($itemNode, $variables)) { + // If an array contains a missing variable, it is either coerced to + // null or if the item type is non-null, it considered invalid. + if ($itemType instanceof NonNull) { + // Invalid: intentionally return no value. + return $undefined; + } + $coercedValues[] = null; + } else { + $itemValue = self::valueFromAST($itemNode, $itemType, $variables); + if ($undefined === $itemValue) { + // Invalid: intentionally return no value. + return $undefined; + } + $coercedValues[] = $itemValue; + } + } + + return $coercedValues; + } + $coercedValue = self::valueFromAST($valueNode, $itemType, $variables); + if ($undefined === $coercedValue) { + // Invalid: intentionally return no value. + return $undefined; + } + + return [$coercedValue]; + } + + if ($type instanceof InputObjectType) { + if (! $valueNode instanceof ObjectValueNode) { + // Invalid: intentionally return no value. + return $undefined; + } + + $coercedObj = []; + $fields = $type->getFields(); + $fieldNodes = Utils::keyMap( + $valueNode->fields, + static function ($field) { + return $field->name->value; + } + ); + foreach ($fields as $field) { + $fieldName = $field->name; + /** @var VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $fieldNode */ + $fieldNode = $fieldNodes[$fieldName] ?? null; + + if ($fieldNode === null || self::isMissingVariable($fieldNode->value, $variables)) { + if ($field->defaultValueExists()) { + $coercedObj[$fieldName] = $field->defaultValue; + } elseif ($field->getType() instanceof NonNull) { + // Invalid: intentionally return no value. + return $undefined; + } + continue; + } + + $fieldValue = self::valueFromAST( + $fieldNode !== null ? $fieldNode->value : null, + $field->getType(), + $variables + ); + + if ($undefined === $fieldValue) { + // Invalid: intentionally return no value. + return $undefined; + } + $coercedObj[$fieldName] = $fieldValue; + } + + return $coercedObj; + } + + if ($type instanceof EnumType) { + if (! $valueNode instanceof EnumValueNode) { + return $undefined; + } + $enumValue = $type->getValue($valueNode->value); + if (! $enumValue) { + return $undefined; + } + + return $enumValue->value; + } + + if ($type instanceof ScalarType) { + // Scalars fulfill parsing a literal value via parseLiteral(). + // Invalid values represent a failure to parse correctly, in which case + // no value is returned. + try { + return $type->parseLiteral($valueNode, $variables); + } catch (Throwable $error) { + return $undefined; + } + } + + throw new Error('Unknown type: ' . Utils::printSafe($type) . '.'); + } + + /** + * Returns true if the provided valueNode is a variable which is not defined + * in the set of variables. + * + * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $valueNode + * @param mixed[] $variables + * + * @return bool + */ + private static function isMissingVariable(ValueNode $valueNode, $variables) + { + return $valueNode instanceof VariableNode && + (count($variables) === 0 || ! array_key_exists($valueNode->name->value, $variables)); + } + + /** + * Produces a PHP value given a GraphQL Value AST. + * + * Unlike `valueFromAST()`, no type is provided. The resulting PHP value + * will reflect the provided GraphQL value AST. + * + * | GraphQL Value | PHP Value | + * | -------------------- | ------------- | + * | Input Object | Assoc Array | + * | List | Array | + * | Boolean | Boolean | + * | String | String | + * | Int / Float | Int / Float | + * | Enum | Mixed | + * | Null | null | + * + * @param Node $valueNode + * @param mixed[]|null $variables + * + * @return mixed + * + * @throws Exception + * + * @api + */ + public static function valueFromASTUntyped($valueNode, ?array $variables = null) + { + switch (true) { + case $valueNode instanceof NullValueNode: + return null; + case $valueNode instanceof IntValueNode: + return (int) $valueNode->value; + case $valueNode instanceof FloatValueNode: + return (float) $valueNode->value; + case $valueNode instanceof StringValueNode: + case $valueNode instanceof EnumValueNode: + case $valueNode instanceof BooleanValueNode: + return $valueNode->value; + case $valueNode instanceof ListValueNode: + return array_map( + static function ($node) use ($variables) { + return self::valueFromASTUntyped($node, $variables); + }, + iterator_to_array($valueNode->values) + ); + case $valueNode instanceof ObjectValueNode: + return array_combine( + array_map( + static function ($field) : string { + return $field->name->value; + }, + iterator_to_array($valueNode->fields) + ), + array_map( + static function ($field) use ($variables) { + return self::valueFromASTUntyped($field->value, $variables); + }, + iterator_to_array($valueNode->fields) + ) + ); + case $valueNode instanceof VariableNode: + $variableName = $valueNode->name->value; + + return $variables && isset($variables[$variableName]) + ? $variables[$variableName] + : null; + } + + throw new Error('Unexpected value kind: ' . $valueNode->kind . '.'); + } + + /** + * Returns type definition for given AST Type node + * + * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode + * + * @return Type|null + * + * @throws Exception + * + * @api + */ + public static function typeFromAST(Schema $schema, $inputTypeNode) + { + if ($inputTypeNode instanceof ListTypeNode) { + $innerType = self::typeFromAST($schema, $inputTypeNode->type); + + return $innerType ? new ListOfType($innerType) : null; + } + if ($inputTypeNode instanceof NonNullTypeNode) { + $innerType = self::typeFromAST($schema, $inputTypeNode->type); + + return $innerType ? new NonNull($innerType) : null; + } + if ($inputTypeNode instanceof NamedTypeNode) { + return $schema->getType($inputTypeNode->name->value); + } + + throw new Error('Unexpected type kind: ' . $inputTypeNode->kind . '.'); + } + + /** + * @deprecated use getOperationAST instead. + * + * Returns operation type ("query", "mutation" or "subscription") given a document and operation name + * + * @param string $operationName + * + * @return bool|string + * + * @api + */ + public static function getOperation(DocumentNode $document, $operationName = null) + { + if ($document->definitions) { + foreach ($document->definitions as $def) { + if (! ($def instanceof OperationDefinitionNode)) { + continue; + } + + if (! $operationName || (isset($def->name->value) && $def->name->value === $operationName)) { + return $def->operation; + } + } + } + + return false; + } + + /** + * Returns the operation within a document by name. + * + * If a name is not provided, an operation is only returned if the document has exactly one. + * + * @api + */ + public static function getOperationAST(DocumentNode $document, ?string $operationName = null) : ?OperationDefinitionNode + { + $operation = null; + foreach ($document->definitions->getIterator() as $node) { + if (! $node instanceof OperationDefinitionNode) { + continue; + } + + if ($operationName === null) { + // We found a second operation, so we bail instead of returning an ambiguous result. + if ($operation !== null) { + return null; + } + $operation = $node; + } elseif ($node->name instanceof NameNode && $node->name->value === $operationName) { + return $node; + } + } + + return $operation; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php new file mode 100644 index 00000000..c9d4a56f --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php @@ -0,0 +1,493 @@ + */ + private $typeDefinitionsMap; + + /** @var callable */ + private $typeConfigDecorator; + + /** @var array */ + private $options; + + /** @var callable */ + private $resolveType; + + /** @var array */ + private $cache; + + /** + * code sniffer doesn't understand this syntax. Pr with a fix here: waiting on https://github.com/squizlabs/PHP_CodeSniffer/pull/2919 + * @param array $typeDefinitionsMap + * @param array $options + */ + public function __construct( + array $typeDefinitionsMap, + array $options, + callable $resolveType, + ?callable $typeConfigDecorator = null + ) { + $this->typeDefinitionsMap = $typeDefinitionsMap; + $this->typeConfigDecorator = $typeConfigDecorator; + $this->options = $options; + $this->resolveType = $resolveType; + + $this->cache = Type::getAllBuiltInTypes(); + } + + public function buildDirective(DirectiveDefinitionNode $directiveNode) : Directive + { + return new Directive([ + 'name' => $directiveNode->name->value, + 'description' => $this->getDescription($directiveNode), + 'args' => FieldArgument::createMap($this->makeInputValues($directiveNode->arguments)), + 'isRepeatable' => $directiveNode->repeatable, + 'locations' => Utils::map( + $directiveNode->locations, + static function (NameNode $node) : string { + return $node->value; + } + ), + 'astNode' => $directiveNode, + ]); + } + + /** + * Given an ast node, returns its string description. + */ + private function getDescription(Node $node) : ?string + { + if (isset($node->description)) { + return $node->description->value; + } + + if (isset($this->options['commentDescriptions'])) { + $rawValue = $this->getLeadingCommentBlock($node); + if ($rawValue !== null) { + return BlockString::value("\n" . $rawValue); + } + } + + return null; + } + + private function getLeadingCommentBlock(Node $node) : ?string + { + $loc = $node->loc; + if ($loc === null || $loc->startToken === null) { + return null; + } + + $comments = []; + $token = $loc->startToken->prev; + while ($token !== null + && $token->kind === Token::COMMENT + && $token->next !== null + && $token->prev !== null + && $token->line + 1 === $token->next->line + && $token->line !== $token->prev->line + ) { + $value = $token->value; + $comments[] = $value; + $token = $token->prev; + } + + return implode("\n", array_reverse($comments)); + } + + /** + * @return array> + */ + private function makeInputValues(NodeList $values) : array + { + return Utils::keyValMap( + $values, + static function (InputValueDefinitionNode $value) : string { + return $value->name->value; + }, + function (InputValueDefinitionNode $value) : array { + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + $type = $this->buildWrappedType($value->type); + + $config = [ + 'name' => $value->name->value, + 'type' => $type, + 'description' => $this->getDescription($value), + 'astNode' => $value, + ]; + if (isset($value->defaultValue)) { + $config['defaultValue'] = AST::valueFromAST($value->defaultValue, $type); + } + + return $config; + } + ); + } + + private function buildWrappedType(TypeNode $typeNode) : Type + { + if ($typeNode instanceof ListTypeNode) { + return Type::listOf($this->buildWrappedType($typeNode->type)); + } + + if ($typeNode instanceof NonNullTypeNode) { + return Type::nonNull($this->buildWrappedType($typeNode->type)); + } + + return $this->buildType($typeNode); + } + + /** + * @param string|(Node &NamedTypeNode)|(Node&TypeDefinitionNode) $ref + */ + public function buildType($ref) : Type + { + if (is_string($ref)) { + return $this->internalBuildType($ref); + } + + return $this->internalBuildType($ref->name->value, $ref); + } + + /** + * @param (Node &NamedTypeNode)|(Node&TypeDefinitionNode)|null $typeNode + * + * @throws Error + */ + private function internalBuildType(string $typeName, ?Node $typeNode = null) : Type + { + if (! isset($this->cache[$typeName])) { + if (isset($this->typeDefinitionsMap[$typeName])) { + $type = $this->makeSchemaDef($this->typeDefinitionsMap[$typeName]); + if ($this->typeConfigDecorator) { + $fn = $this->typeConfigDecorator; + try { + $config = $fn($type->config, $this->typeDefinitionsMap[$typeName], $this->typeDefinitionsMap); + } catch (Throwable $e) { + throw new Error( + sprintf('Type config decorator passed to %s threw an error ', static::class) . + sprintf('when building %s type: %s', $typeName, $e->getMessage()), + null, + null, + [], + null, + $e + ); + } + if (! is_array($config) || isset($config[0])) { + throw new Error( + sprintf( + 'Type config decorator passed to %s is expected to return an array, but got %s', + static::class, + Utils::getVariableType($config) + ) + ); + } + $type = $this->makeSchemaDefFromConfig($this->typeDefinitionsMap[$typeName], $config); + } + $this->cache[$typeName] = $type; + } else { + $fn = $this->resolveType; + $this->cache[$typeName] = $fn($typeName, $typeNode); + } + } + + return $this->cache[$typeName]; + } + + /** + * @param ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|EnumTypeDefinitionNode|ScalarTypeDefinitionNode|InputObjectTypeDefinitionNode|UnionTypeDefinitionNode $def + * + * @return CustomScalarType|EnumType|InputObjectType|InterfaceType|ObjectType|UnionType + * + * @throws Error + */ + private function makeSchemaDef(Node $def) : Type + { + switch (true) { + case $def instanceof ObjectTypeDefinitionNode: + return $this->makeTypeDef($def); + case $def instanceof InterfaceTypeDefinitionNode: + return $this->makeInterfaceDef($def); + case $def instanceof EnumTypeDefinitionNode: + return $this->makeEnumDef($def); + case $def instanceof UnionTypeDefinitionNode: + return $this->makeUnionDef($def); + case $def instanceof ScalarTypeDefinitionNode: + return $this->makeScalarDef($def); + case $def instanceof InputObjectTypeDefinitionNode: + return $this->makeInputObjectDef($def); + default: + throw new Error(sprintf('Type kind of %s not supported.', $def->kind)); + } + } + + private function makeTypeDef(ObjectTypeDefinitionNode $def) : ObjectType + { + return new ObjectType([ + 'name' => $def->name->value, + 'description' => $this->getDescription($def), + 'fields' => function () use ($def) : array { + return $this->makeFieldDefMap($def); + }, + 'interfaces' => function () use ($def) : array { + return $this->makeImplementedInterfaces($def); + }, + 'astNode' => $def, + ]); + } + + /** + * @param ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode $def + * + * @return array> + */ + private function makeFieldDefMap(Node $def) : array + { + return Utils::keyValMap( + $def->fields, + static function (FieldDefinitionNode $field) : string { + return $field->name->value; + }, + function (FieldDefinitionNode $field) : array { + return $this->buildField($field); + } + ); + } + + /** + * @return array + */ + public function buildField(FieldDefinitionNode $field) : array + { + return [ + // Note: While this could make assertions to get the correctly typed + // value, that would throw immediately while type system validation + // with validateSchema() will produce more actionable results. + 'type' => $this->buildWrappedType($field->type), + 'description' => $this->getDescription($field), + 'args' => $this->makeInputValues($field->arguments), + 'deprecationReason' => $this->getDeprecationReason($field), + 'astNode' => $field, + ]; + } + + /** + * Given a collection of directives, returns the string value for the + * deprecation reason. + * + * @param EnumValueDefinitionNode|FieldDefinitionNode $node + */ + private function getDeprecationReason(Node $node) : ?string + { + $deprecated = Values::getDirectiveValues( + Directive::deprecatedDirective(), + $node + ); + + return $deprecated['reason'] ?? null; + } + + /** + * @param ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode $def + * + * @return array + */ + private function makeImplementedInterfaces($def) : array + { + // Note: While this could make early assertions to get the correctly + // typed values, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + return Utils::map( + $def->interfaces, + function (NamedTypeNode $iface) : Type { + return $this->buildType($iface); + } + ); + } + + private function makeInterfaceDef(InterfaceTypeDefinitionNode $def) : InterfaceType + { + return new InterfaceType([ + 'name' => $def->name->value, + 'description' => $this->getDescription($def), + 'fields' => function () use ($def) : array { + return $this->makeFieldDefMap($def); + }, + 'interfaces' => function () use ($def) : array { + return $this->makeImplementedInterfaces($def); + }, + 'astNode' => $def, + ]); + } + + private function makeEnumDef(EnumTypeDefinitionNode $def) : EnumType + { + return new EnumType([ + 'name' => $def->name->value, + 'description' => $this->getDescription($def), + 'values' => Utils::keyValMap( + $def->values, + static function ($enumValue) { + return $enumValue->name->value; + }, + function ($enumValue) : array { + return [ + 'description' => $this->getDescription($enumValue), + 'deprecationReason' => $this->getDeprecationReason($enumValue), + 'astNode' => $enumValue, + ]; + } + ), + 'astNode' => $def, + ]); + } + + private function makeUnionDef(UnionTypeDefinitionNode $def) : UnionType + { + return new UnionType([ + 'name' => $def->name->value, + 'description' => $this->getDescription($def), + // Note: While this could make assertions to get the correctly typed + // values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + 'types' => function () use ($def) : array { + return Utils::map( + $def->types, + function ($typeNode) : Type { + return $this->buildType($typeNode); + } + ); + }, + 'astNode' => $def, + ]); + } + + private function makeScalarDef(ScalarTypeDefinitionNode $def) : CustomScalarType + { + return new CustomScalarType([ + 'name' => $def->name->value, + 'description' => $this->getDescription($def), + 'astNode' => $def, + 'serialize' => static function ($value) { + return $value; + }, + ]); + } + + private function makeInputObjectDef(InputObjectTypeDefinitionNode $def) : InputObjectType + { + return new InputObjectType([ + 'name' => $def->name->value, + 'description' => $this->getDescription($def), + 'fields' => function () use ($def) : array { + return $this->makeInputValues($def->fields); + }, + 'astNode' => $def, + ]); + } + + /** + * @param array $config + * + * @return CustomScalarType|EnumType|InputObjectType|InterfaceType|ObjectType|UnionType + * + * @throws Error + */ + private function makeSchemaDefFromConfig(Node $def, array $config) : Type + { + switch (true) { + case $def instanceof ObjectTypeDefinitionNode: + return new ObjectType($config); + case $def instanceof InterfaceTypeDefinitionNode: + return new InterfaceType($config); + case $def instanceof EnumTypeDefinitionNode: + return new EnumType($config); + case $def instanceof UnionTypeDefinitionNode: + return new UnionType($config); + case $def instanceof ScalarTypeDefinitionNode: + return new CustomScalarType($config); + case $def instanceof InputObjectTypeDefinitionNode: + return new InputObjectType($config); + default: + throw new Error(sprintf('Type kind of %s not supported.', $def->kind)); + } + } + + /** + * @return array + */ + public function buildInputField(InputValueDefinitionNode $value) : array + { + $type = $this->buildWrappedType($value->type); + + $config = [ + 'name' => $value->name->value, + 'type' => $type, + 'description' => $this->getDescription($value), + 'astNode' => $value, + ]; + + if ($value->defaultValue !== null) { + $config['defaultValue'] = $value->defaultValue; + } + + return $config; + } + + /** + * @return array + */ + public function buildEnumValue(EnumValueDefinitionNode $value) : array + { + return [ + 'description' => $this->getDescription($value), + 'deprecationReason' => $this->getDeprecationReason($value), + 'astNode' => $value, + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BlockString.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BlockString.php new file mode 100644 index 00000000..a81760c2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BlockString.php @@ -0,0 +1,77 @@ += mb_strlen($line) || + ($commonIndent !== null && $indent >= $commonIndent) + ) { + continue; + } + + $commonIndent = $indent; + if ($commonIndent === 0) { + break; + } + } + + if ($commonIndent) { + for ($i = 1; $i < $linesLength; $i++) { + $line = $lines[$i]; + $lines[$i] = mb_substr($line, $commonIndent); + } + } + + // Remove leading and trailing blank lines. + while (count($lines) > 0 && trim($lines[0], " \t") === '') { + array_shift($lines); + } + while (count($lines) > 0 && trim($lines[count($lines) - 1], " \t") === '') { + array_pop($lines); + } + + // Return a string of the lines joined with U+000A. + return implode("\n", $lines); + } + + private static function leadingWhitespace($str) + { + $i = 0; + while ($i < mb_strlen($str) && ($str[$i] === ' ' || $str[$i] === '\t')) { + $i++; + } + + return $i; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php new file mode 100644 index 00000000..81a44956 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php @@ -0,0 +1,938 @@ +getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + + $breakingChanges = []; + foreach (array_keys($oldTypeMap) as $typeName) { + if (isset($newTypeMap[$typeName])) { + continue; + } + + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_TYPE_REMOVED, + 'description' => $typeName . ' was removed.', + ]; + } + + return $breakingChanges; + } + + /** + * Given two schemas, returns an Array containing descriptions of any breaking + * changes in the newSchema related to changing the type of a type. + * + * @return string[][] + */ + public static function findTypesThatChangedKind( + Schema $schemaA, + Schema $schemaB + ) : iterable { + $schemaATypeMap = $schemaA->getTypeMap(); + $schemaBTypeMap = $schemaB->getTypeMap(); + + $breakingChanges = []; + foreach ($schemaATypeMap as $typeName => $schemaAType) { + if (! isset($schemaBTypeMap[$typeName])) { + continue; + } + $schemaBType = $schemaBTypeMap[$typeName]; + if ($schemaAType instanceof $schemaBType) { + continue; + } + + if ($schemaBType instanceof $schemaAType) { + continue; + } + + $schemaATypeKindName = self::typeKindName($schemaAType); + $schemaBTypeKindName = self::typeKindName($schemaBType); + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_TYPE_CHANGED_KIND, + 'description' => $typeName . ' changed from ' . $schemaATypeKindName . ' to ' . $schemaBTypeKindName . '.', + ]; + } + + return $breakingChanges; + } + + /** + * @return string + * + * @throws TypeError + */ + private static function typeKindName(Type $type) + { + if ($type instanceof ScalarType) { + return 'a Scalar type'; + } + + if ($type instanceof ObjectType) { + return 'an Object type'; + } + + if ($type instanceof InterfaceType) { + return 'an Interface type'; + } + + if ($type instanceof UnionType) { + return 'a Union type'; + } + + if ($type instanceof EnumType) { + return 'an Enum type'; + } + + if ($type instanceof InputObjectType) { + return 'an Input type'; + } + + throw new TypeError('unknown type ' . $type->name); + } + + /** + * @return string[][] + */ + public static function findFieldsThatChangedTypeOnObjectOrInterfaceTypes( + Schema $oldSchema, + Schema $newSchema + ) { + $oldTypeMap = $oldSchema->getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + + $breakingChanges = []; + foreach ($oldTypeMap as $typeName => $oldType) { + $newType = $newTypeMap[$typeName] ?? null; + if (! ($oldType instanceof ObjectType || $oldType instanceof InterfaceType) || + ! ($newType instanceof ObjectType || $newType instanceof InterfaceType) || + ! ($newType instanceof $oldType) + ) { + continue; + } + + $oldTypeFieldsDef = $oldType->getFields(); + $newTypeFieldsDef = $newType->getFields(); + foreach ($oldTypeFieldsDef as $fieldName => $fieldDefinition) { + // Check if the field is missing on the type in the new schema. + if (! isset($newTypeFieldsDef[$fieldName])) { + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_FIELD_REMOVED, + 'description' => $typeName . '.' . $fieldName . ' was removed.', + ]; + } else { + $oldFieldType = $oldTypeFieldsDef[$fieldName]->getType(); + $newFieldType = $newTypeFieldsDef[$fieldName]->getType(); + $isSafe = self::isChangeSafeForObjectOrInterfaceField( + $oldFieldType, + $newFieldType + ); + if (! $isSafe) { + $oldFieldTypeString = $oldFieldType instanceof NamedType && $oldFieldType instanceof Type + ? $oldFieldType->name + : $oldFieldType; + $newFieldTypeString = $newFieldType instanceof NamedType && $newFieldType instanceof Type + ? $newFieldType->name + : $newFieldType; + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_FIELD_CHANGED_KIND, + 'description' => $typeName . '.' . $fieldName . ' changed type from ' . $oldFieldTypeString . ' to ' . $newFieldTypeString . '.', + ]; + } + } + } + } + + return $breakingChanges; + } + + /** + * @return bool + */ + private static function isChangeSafeForObjectOrInterfaceField( + Type $oldType, + Type $newType + ) { + if ($oldType instanceof NamedType) { + return // if they're both named types, see if their names are equivalent + ($newType instanceof NamedType && $oldType->name === $newType->name) || + // moving from nullable to non-null of the same underlying type is safe + ($newType instanceof NonNull && + self::isChangeSafeForObjectOrInterfaceField($oldType, $newType->getWrappedType()) + ); + } + + if ($oldType instanceof ListOfType) { + return // if they're both lists, make sure the underlying types are compatible + ($newType instanceof ListOfType && + self::isChangeSafeForObjectOrInterfaceField( + $oldType->getWrappedType(), + $newType->getWrappedType() + )) || + // moving from nullable to non-null of the same underlying type is safe + ($newType instanceof NonNull && + self::isChangeSafeForObjectOrInterfaceField($oldType, $newType->getWrappedType())); + } + + if ($oldType instanceof NonNull) { + // if they're both non-null, make sure the underlying types are compatible + return $newType instanceof NonNull && + self::isChangeSafeForObjectOrInterfaceField($oldType->getWrappedType(), $newType->getWrappedType()); + } + + return false; + } + + /** + * @return array>> + */ + public static function findFieldsThatChangedTypeOnInputObjectTypes( + Schema $oldSchema, + Schema $newSchema + ) { + $oldTypeMap = $oldSchema->getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + + $breakingChanges = []; + $dangerousChanges = []; + foreach ($oldTypeMap as $typeName => $oldType) { + $newType = $newTypeMap[$typeName] ?? null; + if (! ($oldType instanceof InputObjectType) || ! ($newType instanceof InputObjectType)) { + continue; + } + + $oldTypeFieldsDef = $oldType->getFields(); + $newTypeFieldsDef = $newType->getFields(); + foreach (array_keys($oldTypeFieldsDef) as $fieldName) { + if (! isset($newTypeFieldsDef[$fieldName])) { + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_FIELD_REMOVED, + 'description' => $typeName . '.' . $fieldName . ' was removed.', + ]; + } else { + $oldFieldType = $oldTypeFieldsDef[$fieldName]->getType(); + $newFieldType = $newTypeFieldsDef[$fieldName]->getType(); + + $isSafe = self::isChangeSafeForInputObjectFieldOrFieldArg( + $oldFieldType, + $newFieldType + ); + if (! $isSafe) { + if ($oldFieldType instanceof NamedType) { + $oldFieldTypeString = $oldFieldType->name; + } else { + $oldFieldTypeString = $oldFieldType; + } + if ($newFieldType instanceof NamedType) { + $newFieldTypeString = $newFieldType->name; + } else { + $newFieldTypeString = $newFieldType; + } + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_FIELD_CHANGED_KIND, + 'description' => $typeName . '.' . $fieldName . ' changed type from ' . $oldFieldTypeString . ' to ' . $newFieldTypeString . '.', + ]; + } + } + } + // Check if a field was added to the input object type + foreach ($newTypeFieldsDef as $fieldName => $fieldDef) { + if (isset($oldTypeFieldsDef[$fieldName])) { + continue; + } + + $newTypeName = $newType->name; + if ($fieldDef->isRequired()) { + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_REQUIRED_INPUT_FIELD_ADDED, + 'description' => 'A required field ' . $fieldName . ' on input type ' . $newTypeName . ' was added.', + ]; + } else { + $dangerousChanges[] = [ + 'type' => self::DANGEROUS_CHANGE_OPTIONAL_INPUT_FIELD_ADDED, + 'description' => 'An optional field ' . $fieldName . ' on input type ' . $newTypeName . ' was added.', + ]; + } + } + } + + return [ + 'breakingChanges' => $breakingChanges, + 'dangerousChanges' => $dangerousChanges, + ]; + } + + /** + * @return bool + */ + private static function isChangeSafeForInputObjectFieldOrFieldArg( + Type $oldType, + Type $newType + ) { + if ($oldType instanceof NamedType) { + if (! $newType instanceof NamedType) { + return false; + } + + // if they're both named types, see if their names are equivalent + return $oldType->name === $newType->name; + } + + if ($oldType instanceof ListOfType) { + // if they're both lists, make sure the underlying types are compatible + return $newType instanceof ListOfType && + self::isChangeSafeForInputObjectFieldOrFieldArg( + $oldType->getWrappedType(), + $newType->getWrappedType() + ); + } + + if ($oldType instanceof NonNull) { + return // if they're both non-null, make sure the underlying types are + // compatible + ($newType instanceof NonNull && + self::isChangeSafeForInputObjectFieldOrFieldArg( + $oldType->getWrappedType(), + $newType->getWrappedType() + )) || + // moving from non-null to nullable of the same underlying type is safe + ! ($newType instanceof NonNull) && + self::isChangeSafeForInputObjectFieldOrFieldArg($oldType->getWrappedType(), $newType); + } + + return false; + } + + /** + * Given two schemas, returns an Array containing descriptions of any breaking + * changes in the newSchema related to removing types from a union type. + * + * @return string[][] + */ + public static function findTypesRemovedFromUnions( + Schema $oldSchema, + Schema $newSchema + ) { + $oldTypeMap = $oldSchema->getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + + $typesRemovedFromUnion = []; + foreach ($oldTypeMap as $typeName => $oldType) { + $newType = $newTypeMap[$typeName] ?? null; + if (! ($oldType instanceof UnionType) || ! ($newType instanceof UnionType)) { + continue; + } + $typeNamesInNewUnion = []; + foreach ($newType->getTypes() as $type) { + $typeNamesInNewUnion[$type->name] = true; + } + foreach ($oldType->getTypes() as $type) { + if (isset($typeNamesInNewUnion[$type->name])) { + continue; + } + + $typesRemovedFromUnion[] = [ + 'type' => self::BREAKING_CHANGE_TYPE_REMOVED_FROM_UNION, + 'description' => sprintf('%s was removed from union type %s.', $type->name, $typeName), + ]; + } + } + + return $typesRemovedFromUnion; + } + + /** + * Given two schemas, returns an Array containing descriptions of any breaking + * changes in the newSchema related to removing values from an enum type. + * + * @return string[][] + */ + public static function findValuesRemovedFromEnums( + Schema $oldSchema, + Schema $newSchema + ) { + $oldTypeMap = $oldSchema->getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + + $valuesRemovedFromEnums = []; + foreach ($oldTypeMap as $typeName => $oldType) { + $newType = $newTypeMap[$typeName] ?? null; + if (! ($oldType instanceof EnumType) || ! ($newType instanceof EnumType)) { + continue; + } + $valuesInNewEnum = []; + foreach ($newType->getValues() as $value) { + $valuesInNewEnum[$value->name] = true; + } + foreach ($oldType->getValues() as $value) { + if (isset($valuesInNewEnum[$value->name])) { + continue; + } + + $valuesRemovedFromEnums[] = [ + 'type' => self::BREAKING_CHANGE_VALUE_REMOVED_FROM_ENUM, + 'description' => sprintf('%s was removed from enum type %s.', $value->name, $typeName), + ]; + } + } + + return $valuesRemovedFromEnums; + } + + /** + * Given two schemas, returns an Array containing descriptions of any + * breaking or dangerous changes in the newSchema related to arguments + * (such as removal or change of type of an argument, or a change in an + * argument's default value). + * + * @return array>> + */ + public static function findArgChanges( + Schema $oldSchema, + Schema $newSchema + ) { + $oldTypeMap = $oldSchema->getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + + $breakingChanges = []; + $dangerousChanges = []; + + foreach ($oldTypeMap as $typeName => $oldType) { + $newType = $newTypeMap[$typeName] ?? null; + if (! ($oldType instanceof ObjectType || $oldType instanceof InterfaceType) || + ! ($newType instanceof ObjectType || $newType instanceof InterfaceType) || + ! ($newType instanceof $oldType) + ) { + continue; + } + + $oldTypeFields = $oldType->getFields(); + $newTypeFields = $newType->getFields(); + + foreach ($oldTypeFields as $fieldName => $oldField) { + if (! isset($newTypeFields[$fieldName])) { + continue; + } + + foreach ($oldField->args as $oldArgDef) { + $newArgs = $newTypeFields[$fieldName]->args; + $newArgDef = Utils::find( + $newArgs, + static function ($arg) use ($oldArgDef) : bool { + return $arg->name === $oldArgDef->name; + } + ); + if ($newArgDef !== null) { + $isSafe = self::isChangeSafeForInputObjectFieldOrFieldArg( + $oldArgDef->getType(), + $newArgDef->getType() + ); + /** @var ScalarType|EnumType|InputObjectType|ListOfType|NonNull $oldArgType */ + $oldArgType = $oldArgDef->getType(); + $oldArgName = $oldArgDef->name; + if (! $isSafe) { + $newArgType = $newArgDef->getType(); + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_ARG_CHANGED_KIND, + 'description' => $typeName . '.' . $fieldName . ' arg ' . $oldArgName . ' has changed type from ' . $oldArgType . ' to ' . $newArgType, + ]; + } elseif ($oldArgDef->defaultValueExists() && $oldArgDef->defaultValue !== $newArgDef->defaultValue) { + $dangerousChanges[] = [ + 'type' => self::DANGEROUS_CHANGE_ARG_DEFAULT_VALUE_CHANGED, + 'description' => $typeName . '.' . $fieldName . ' arg ' . $oldArgName . ' has changed defaultValue', + ]; + } + } else { + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_ARG_REMOVED, + 'description' => sprintf( + '%s.%s arg %s was removed', + $typeName, + $fieldName, + $oldArgDef->name + ), + ]; + } + // Check if arg was added to the field + foreach ($newTypeFields[$fieldName]->args as $newTypeFieldArgDef) { + $oldArgs = $oldTypeFields[$fieldName]->args; + $oldArgDef = Utils::find( + $oldArgs, + static function ($arg) use ($newTypeFieldArgDef) : bool { + return $arg->name === $newTypeFieldArgDef->name; + } + ); + + if ($oldArgDef !== null) { + continue; + } + + $newTypeName = $newType->name; + $newArgName = $newTypeFieldArgDef->name; + if ($newTypeFieldArgDef->isRequired()) { + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_REQUIRED_ARG_ADDED, + 'description' => 'A required arg ' . $newArgName . ' on ' . $newTypeName . '.' . $fieldName . ' was added', + ]; + } else { + $dangerousChanges[] = [ + 'type' => self::DANGEROUS_CHANGE_OPTIONAL_ARG_ADDED, + 'description' => 'An optional arg ' . $newArgName . ' on ' . $newTypeName . '.' . $fieldName . ' was added', + ]; + } + } + } + } + } + + return [ + 'breakingChanges' => $breakingChanges, + 'dangerousChanges' => $dangerousChanges, + ]; + } + + /** + * @return string[][] + */ + public static function findInterfacesRemovedFromObjectTypes( + Schema $oldSchema, + Schema $newSchema + ) { + $oldTypeMap = $oldSchema->getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + $breakingChanges = []; + + foreach ($oldTypeMap as $typeName => $oldType) { + $newType = $newTypeMap[$typeName] ?? null; + if (! ($oldType instanceof ImplementingType) || ! ($newType instanceof ImplementingType)) { + continue; + } + + $oldInterfaces = $oldType->getInterfaces(); + $newInterfaces = $newType->getInterfaces(); + foreach ($oldInterfaces as $oldInterface) { + $interface = Utils::find( + $newInterfaces, + static function (InterfaceType $interface) use ($oldInterface) : bool { + return $interface->name === $oldInterface->name; + } + ); + if ($interface !== null) { + continue; + } + + $breakingChanges[] = [ + 'type' => self::BREAKING_CHANGE_IMPLEMENTED_INTERFACE_REMOVED, + 'description' => sprintf('%s no longer implements interface %s.', $typeName, $oldInterface->name), + ]; + } + } + + return $breakingChanges; + } + + /** + * @return string[][] + */ + public static function findRemovedDirectives(Schema $oldSchema, Schema $newSchema) + { + $removedDirectives = []; + + $newSchemaDirectiveMap = self::getDirectiveMapForSchema($newSchema); + foreach ($oldSchema->getDirectives() as $directive) { + if (isset($newSchemaDirectiveMap[$directive->name])) { + continue; + } + + $removedDirectives[] = [ + 'type' => self::BREAKING_CHANGE_DIRECTIVE_REMOVED, + 'description' => sprintf('%s was removed', $directive->name), + ]; + } + + return $removedDirectives; + } + + private static function getDirectiveMapForSchema(Schema $schema) + { + return Utils::keyMap( + $schema->getDirectives(), + static function ($dir) { + return $dir->name; + } + ); + } + + public static function findRemovedDirectiveArgs(Schema $oldSchema, Schema $newSchema) + { + $removedDirectiveArgs = []; + $oldSchemaDirectiveMap = self::getDirectiveMapForSchema($oldSchema); + + foreach ($newSchema->getDirectives() as $newDirective) { + if (! isset($oldSchemaDirectiveMap[$newDirective->name])) { + continue; + } + + foreach (self::findRemovedArgsForDirectives( + $oldSchemaDirectiveMap[$newDirective->name], + $newDirective + ) as $arg) { + $removedDirectiveArgs[] = [ + 'type' => self::BREAKING_CHANGE_DIRECTIVE_ARG_REMOVED, + 'description' => sprintf('%s was removed from %s', $arg->name, $newDirective->name), + ]; + } + } + + return $removedDirectiveArgs; + } + + public static function findRemovedArgsForDirectives(Directive $oldDirective, Directive $newDirective) + { + $removedArgs = []; + $newArgMap = self::getArgumentMapForDirective($newDirective); + foreach ($oldDirective->args as $arg) { + if (isset($newArgMap[$arg->name])) { + continue; + } + + $removedArgs[] = $arg; + } + + return $removedArgs; + } + + private static function getArgumentMapForDirective(Directive $directive) + { + return Utils::keyMap( + $directive->args ?? [], + static function ($arg) { + return $arg->name; + } + ); + } + + public static function findAddedNonNullDirectiveArgs(Schema $oldSchema, Schema $newSchema) + { + $addedNonNullableArgs = []; + $oldSchemaDirectiveMap = self::getDirectiveMapForSchema($oldSchema); + + foreach ($newSchema->getDirectives() as $newDirective) { + if (! isset($oldSchemaDirectiveMap[$newDirective->name])) { + continue; + } + + foreach (self::findAddedArgsForDirective( + $oldSchemaDirectiveMap[$newDirective->name], + $newDirective + ) as $arg) { + if (! $arg->isRequired()) { + continue; + } + $addedNonNullableArgs[] = [ + 'type' => self::BREAKING_CHANGE_REQUIRED_DIRECTIVE_ARG_ADDED, + 'description' => sprintf( + 'A required arg %s on directive %s was added', + $arg->name, + $newDirective->name + ), + ]; + } + } + + return $addedNonNullableArgs; + } + + /** + * @return FieldArgument[] + */ + public static function findAddedArgsForDirective(Directive $oldDirective, Directive $newDirective) + { + $addedArgs = []; + $oldArgMap = self::getArgumentMapForDirective($oldDirective); + foreach ($newDirective->args as $arg) { + if (isset($oldArgMap[$arg->name])) { + continue; + } + + $addedArgs[] = $arg; + } + + return $addedArgs; + } + + /** + * @return string[][] + */ + public static function findRemovedDirectiveLocations(Schema $oldSchema, Schema $newSchema) + { + $removedLocations = []; + $oldSchemaDirectiveMap = self::getDirectiveMapForSchema($oldSchema); + + foreach ($newSchema->getDirectives() as $newDirective) { + if (! isset($oldSchemaDirectiveMap[$newDirective->name])) { + continue; + } + + foreach (self::findRemovedLocationsForDirective( + $oldSchemaDirectiveMap[$newDirective->name], + $newDirective + ) as $location) { + $removedLocations[] = [ + 'type' => self::BREAKING_CHANGE_DIRECTIVE_LOCATION_REMOVED, + 'description' => sprintf('%s was removed from %s', $location, $newDirective->name), + ]; + } + } + + return $removedLocations; + } + + public static function findRemovedLocationsForDirective(Directive $oldDirective, Directive $newDirective) + { + $removedLocations = []; + $newLocationSet = array_flip($newDirective->locations); + foreach ($oldDirective->locations as $oldLocation) { + if (array_key_exists($oldLocation, $newLocationSet)) { + continue; + } + + $removedLocations[] = $oldLocation; + } + + return $removedLocations; + } + + /** + * Given two schemas, returns an Array containing descriptions of all the types + * of potentially dangerous changes covered by the other functions down below. + * + * @return string[][] + */ + public static function findDangerousChanges(Schema $oldSchema, Schema $newSchema) + { + return array_merge( + self::findArgChanges($oldSchema, $newSchema)['dangerousChanges'], + self::findValuesAddedToEnums($oldSchema, $newSchema), + self::findInterfacesAddedToObjectTypes($oldSchema, $newSchema), + self::findTypesAddedToUnions($oldSchema, $newSchema), + self::findFieldsThatChangedTypeOnInputObjectTypes($oldSchema, $newSchema)['dangerousChanges'] + ); + } + + /** + * Given two schemas, returns an Array containing descriptions of any dangerous + * changes in the newSchema related to adding values to an enum type. + * + * @return string[][] + */ + public static function findValuesAddedToEnums( + Schema $oldSchema, + Schema $newSchema + ) { + $oldTypeMap = $oldSchema->getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + + $valuesAddedToEnums = []; + foreach ($oldTypeMap as $typeName => $oldType) { + $newType = $newTypeMap[$typeName] ?? null; + if (! ($oldType instanceof EnumType) || ! ($newType instanceof EnumType)) { + continue; + } + $valuesInOldEnum = []; + foreach ($oldType->getValues() as $value) { + $valuesInOldEnum[$value->name] = true; + } + foreach ($newType->getValues() as $value) { + if (isset($valuesInOldEnum[$value->name])) { + continue; + } + + $valuesAddedToEnums[] = [ + 'type' => self::DANGEROUS_CHANGE_VALUE_ADDED_TO_ENUM, + 'description' => sprintf('%s was added to enum type %s.', $value->name, $typeName), + ]; + } + } + + return $valuesAddedToEnums; + } + + /** + * @return string[][] + */ + public static function findInterfacesAddedToObjectTypes( + Schema $oldSchema, + Schema $newSchema + ) { + $oldTypeMap = $oldSchema->getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + $interfacesAddedToObjectTypes = []; + + foreach ($newTypeMap as $typeName => $newType) { + $oldType = $oldTypeMap[$typeName] ?? null; + if (! ($oldType instanceof ObjectType || $oldType instanceof InterfaceType) + || ! ($newType instanceof ObjectType || $newType instanceof InterfaceType)) { + continue; + } + + $oldInterfaces = $oldType->getInterfaces(); + $newInterfaces = $newType->getInterfaces(); + foreach ($newInterfaces as $newInterface) { + $interface = Utils::find( + $oldInterfaces, + static function (InterfaceType $interface) use ($newInterface) : bool { + return $interface->name === $newInterface->name; + } + ); + + if ($interface !== null) { + continue; + } + + $interfacesAddedToObjectTypes[] = [ + 'type' => self::DANGEROUS_CHANGE_IMPLEMENTED_INTERFACE_ADDED, + 'description' => sprintf( + '%s added to interfaces implemented by %s.', + $newInterface->name, + $typeName + ), + ]; + } + } + + return $interfacesAddedToObjectTypes; + } + + /** + * Given two schemas, returns an Array containing descriptions of any dangerous + * changes in the newSchema related to adding types to a union type. + * + * @return string[][] + */ + public static function findTypesAddedToUnions( + Schema $oldSchema, + Schema $newSchema + ) { + $oldTypeMap = $oldSchema->getTypeMap(); + $newTypeMap = $newSchema->getTypeMap(); + + $typesAddedToUnion = []; + foreach ($newTypeMap as $typeName => $newType) { + $oldType = $oldTypeMap[$typeName] ?? null; + if (! ($oldType instanceof UnionType) || ! ($newType instanceof UnionType)) { + continue; + } + + $typeNamesInOldUnion = []; + foreach ($oldType->getTypes() as $type) { + $typeNamesInOldUnion[$type->name] = true; + } + foreach ($newType->getTypes() as $type) { + if (isset($typeNamesInOldUnion[$type->name])) { + continue; + } + + $typesAddedToUnion[] = [ + 'type' => self::DANGEROUS_CHANGE_TYPE_ADDED_TO_UNION, + 'description' => sprintf('%s was added to union type %s.', $type->name, $typeName), + ]; + } + } + + return $typesAddedToUnion; + } +} + +class_alias(BreakingChangesFinder::class, 'GraphQL\Utils\FindBreakingChanges'); diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildClientSchema.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildClientSchema.php new file mode 100644 index 00000000..d8f739ff --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildClientSchema.php @@ -0,0 +1,496 @@ + */ + private $introspection; + + /** @var array */ + private $options; + + /** @var array */ + private $typeMap; + + /** + * @param array $introspectionQuery + * @param array $options + */ + public function __construct(array $introspectionQuery, array $options = []) + { + $this->introspection = $introspectionQuery; + $this->options = $options; + } + + /** + * Build a schema for use by client tools. + * + * Given the result of a client running the introspection query, creates and + * returns a \GraphQL\Type\Schema instance which can be then used with all graphql-php + * tools, but cannot be used to execute a query, as introspection does not + * represent the "resolver", "parse" or "serialize" functions or any other + * server-internal mechanisms. + * + * This function expects a complete introspection result. Don't forget to check + * the "errors" field of a server response before calling this function. + * + * Accepts options as a third argument: + * + * - assumeValid: + * When building a schema from a GraphQL service's introspection result, it + * might be safe to assume the schema is valid. Set to true to assume the + * produced schema is valid. + * + * Default: false + * + * @param array $introspectionQuery + * @param array $options + * + * @api + */ + public static function build(array $introspectionQuery, array $options = []) : Schema + { + $builder = new self($introspectionQuery, $options); + + return $builder->buildSchema(); + } + + public function buildSchema() : Schema + { + if (! array_key_exists('__schema', $this->introspection)) { + throw new InvariantViolation('Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ' . json_encode($this->introspection) . '.'); + } + + $schemaIntrospection = $this->introspection['__schema']; + + $this->typeMap = Utils::keyValMap( + $schemaIntrospection['types'], + static function (array $typeIntrospection) { + return $typeIntrospection['name']; + }, + function (array $typeIntrospection) : NamedType { + return $this->buildType($typeIntrospection); + } + ); + + $builtInTypes = array_merge( + Type::getStandardTypes(), + Introspection::getTypes() + ); + foreach ($builtInTypes as $name => $type) { + if (! isset($this->typeMap[$name])) { + continue; + } + + $this->typeMap[$name] = $type; + } + + $queryType = isset($schemaIntrospection['queryType']) + ? $this->getObjectType($schemaIntrospection['queryType']) + : null; + + $mutationType = isset($schemaIntrospection['mutationType']) + ? $this->getObjectType($schemaIntrospection['mutationType']) + : null; + + $subscriptionType = isset($schemaIntrospection['subscriptionType']) + ? $this->getObjectType($schemaIntrospection['subscriptionType']) + : null; + + $directives = isset($schemaIntrospection['directives']) + ? array_map( + [$this, 'buildDirective'], + $schemaIntrospection['directives'] + ) + : []; + + $schemaConfig = new SchemaConfig(); + $schemaConfig->setQuery($queryType) + ->setMutation($mutationType) + ->setSubscription($subscriptionType) + ->setTypes($this->typeMap) + ->setDirectives($directives) + ->setAssumeValid( + isset($this->options) + && isset($this->options['assumeValid']) + && $this->options['assumeValid'] + ); + + return new Schema($schemaConfig); + } + + /** + * @param array $typeRef + */ + private function getType(array $typeRef) : Type + { + if (isset($typeRef['kind'])) { + if ($typeRef['kind'] === TypeKind::LIST) { + if (! isset($typeRef['ofType'])) { + throw new InvariantViolation('Decorated type deeper than introspection query.'); + } + + return new ListOfType($this->getType($typeRef['ofType'])); + } + + if ($typeRef['kind'] === TypeKind::NON_NULL) { + if (! isset($typeRef['ofType'])) { + throw new InvariantViolation('Decorated type deeper than introspection query.'); + } + /** @var NullableType $nullableType */ + $nullableType = $this->getType($typeRef['ofType']); + + return new NonNull($nullableType); + } + } + + if (! isset($typeRef['name'])) { + throw new InvariantViolation('Unknown type reference: ' . json_encode($typeRef) . '.'); + } + + return $this->getNamedType($typeRef['name']); + } + + /** + * @return NamedType&Type + */ + private function getNamedType(string $typeName) : NamedType + { + if (! isset($this->typeMap[$typeName])) { + throw new InvariantViolation( + 'Invalid or incomplete schema, unknown type: ' . $typeName . '. Ensure that a full introspection query is used in order to build a client schema.' + ); + } + + return $this->typeMap[$typeName]; + } + + /** + * @param array $typeRef + */ + private function getInputType(array $typeRef) : InputType + { + $type = $this->getType($typeRef); + + if ($type instanceof InputType) { + return $type; + } + + throw new InvariantViolation('Introspection must provide input type for arguments, but received: ' . json_encode($type) . '.'); + } + + /** + * @param array $typeRef + */ + private function getOutputType(array $typeRef) : OutputType + { + $type = $this->getType($typeRef); + + if ($type instanceof OutputType) { + return $type; + } + + throw new InvariantViolation('Introspection must provide output type for fields, but received: ' . json_encode($type) . '.'); + } + + /** + * @param array $typeRef + */ + private function getObjectType(array $typeRef) : ObjectType + { + $type = $this->getType($typeRef); + + return ObjectType::assertObjectType($type); + } + + /** + * @param array $typeRef + */ + public function getInterfaceType(array $typeRef) : InterfaceType + { + $type = $this->getType($typeRef); + + return InterfaceType::assertInterfaceType($type); + } + + /** + * @param array $type + */ + private function buildType(array $type) : NamedType + { + if (array_key_exists('name', $type) && array_key_exists('kind', $type)) { + switch ($type['kind']) { + case TypeKind::SCALAR: + return $this->buildScalarDef($type); + case TypeKind::OBJECT: + return $this->buildObjectDef($type); + case TypeKind::INTERFACE: + return $this->buildInterfaceDef($type); + case TypeKind::UNION: + return $this->buildUnionDef($type); + case TypeKind::ENUM: + return $this->buildEnumDef($type); + case TypeKind::INPUT_OBJECT: + return $this->buildInputObjectDef($type); + } + } + + throw new InvariantViolation( + 'Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ' . json_encode($type) . '.' + ); + } + + /** + * @param array $scalar + */ + private function buildScalarDef(array $scalar) : ScalarType + { + return new CustomScalarType([ + 'name' => $scalar['name'], + 'description' => $scalar['description'], + 'serialize' => static function ($value) : string { + return (string) $value; + }, + ]); + } + + /** + * @param array $implementingIntrospection + * + * @return array + */ + private function buildImplementationsList(array $implementingIntrospection) : array + { + // TODO: Temporary workaround until GraphQL ecosystem will fully support 'interfaces' on interface types. + if (array_key_exists('interfaces', $implementingIntrospection) && + $implementingIntrospection['interfaces'] === null && + $implementingIntrospection['kind'] === TypeKind::INTERFACE) { + return []; + } + + if (! array_key_exists('interfaces', $implementingIntrospection)) { + throw new InvariantViolation('Introspection result missing interfaces: ' . json_encode($implementingIntrospection) . '.'); + } + + return array_map([$this, 'getInterfaceType'], $implementingIntrospection['interfaces']); + } + + /** + * @param array $object + */ + private function buildObjectDef(array $object) : ObjectType + { + return new ObjectType([ + 'name' => $object['name'], + 'description' => $object['description'], + 'interfaces' => function () use ($object) : array { + return $this->buildImplementationsList($object); + }, + 'fields' => function () use ($object) { + return $this->buildFieldDefMap($object); + }, + ]); + } + + /** + * @param array $interface + */ + private function buildInterfaceDef(array $interface) : InterfaceType + { + return new InterfaceType([ + 'name' => $interface['name'], + 'description' => $interface['description'], + 'fields' => function () use ($interface) { + return $this->buildFieldDefMap($interface); + }, + 'interfaces' => function () use ($interface) : array { + return $this->buildImplementationsList($interface); + }, + ]); + } + + /** + * @param array> $union + */ + private function buildUnionDef(array $union) : UnionType + { + if (! array_key_exists('possibleTypes', $union)) { + throw new InvariantViolation('Introspection result missing possibleTypes: ' . json_encode($union) . '.'); + } + + return new UnionType([ + 'name' => $union['name'], + 'description' => $union['description'], + 'types' => function () use ($union) : array { + return array_map( + [$this, 'getObjectType'], + $union['possibleTypes'] + ); + }, + ]); + } + + /** + * @param array> $enum + */ + private function buildEnumDef(array $enum) : EnumType + { + if (! array_key_exists('enumValues', $enum)) { + throw new InvariantViolation('Introspection result missing enumValues: ' . json_encode($enum) . '.'); + } + + return new EnumType([ + 'name' => $enum['name'], + 'description' => $enum['description'], + 'values' => Utils::keyValMap( + $enum['enumValues'], + static function (array $enumValue) : string { + return $enumValue['name']; + }, + static function (array $enumValue) : array { + return [ + 'description' => $enumValue['description'], + 'deprecationReason' => $enumValue['deprecationReason'], + ]; + } + ), + ]); + } + + /** + * @param array $inputObject + */ + private function buildInputObjectDef(array $inputObject) : InputObjectType + { + if (! array_key_exists('inputFields', $inputObject)) { + throw new InvariantViolation('Introspection result missing inputFields: ' . json_encode($inputObject) . '.'); + } + + return new InputObjectType([ + 'name' => $inputObject['name'], + 'description' => $inputObject['description'], + 'fields' => function () use ($inputObject) : array { + return $this->buildInputValueDefMap($inputObject['inputFields']); + }, + ]); + } + + /** + * @param array $typeIntrospection + */ + private function buildFieldDefMap(array $typeIntrospection) + { + if (! array_key_exists('fields', $typeIntrospection)) { + throw new InvariantViolation('Introspection result missing fields: ' . json_encode($typeIntrospection) . '.'); + } + + return Utils::keyValMap( + $typeIntrospection['fields'], + static function (array $fieldIntrospection) : string { + return $fieldIntrospection['name']; + }, + function (array $fieldIntrospection) : array { + if (! array_key_exists('args', $fieldIntrospection)) { + throw new InvariantViolation('Introspection result missing field args: ' . json_encode($fieldIntrospection) . '.'); + } + + return [ + 'description' => $fieldIntrospection['description'], + 'deprecationReason' => $fieldIntrospection['deprecationReason'], + 'type' => $this->getOutputType($fieldIntrospection['type']), + 'args' => $this->buildInputValueDefMap($fieldIntrospection['args']), + ]; + } + ); + } + + /** + * @param array> $inputValueIntrospections + * + * @return array> + */ + private function buildInputValueDefMap(array $inputValueIntrospections) : array + { + return Utils::keyValMap( + $inputValueIntrospections, + static function (array $inputValue) : string { + return $inputValue['name']; + }, + [$this, 'buildInputValue'] + ); + } + + /** + * @param array $inputValueIntrospection + * + * @return array + */ + public function buildInputValue(array $inputValueIntrospection) : array + { + $type = $this->getInputType($inputValueIntrospection['type']); + + $inputValue = [ + 'description' => $inputValueIntrospection['description'], + 'type' => $type, + ]; + + if (isset($inputValueIntrospection['defaultValue'])) { + $inputValue['defaultValue'] = AST::valueFromAST( + Parser::parseValue($inputValueIntrospection['defaultValue']), + $type + ); + } + + return $inputValue; + } + + /** + * @param array $directive + */ + public function buildDirective(array $directive) : Directive + { + if (! array_key_exists('args', $directive)) { + throw new InvariantViolation('Introspection result missing directive args: ' . json_encode($directive) . '.'); + } + if (! array_key_exists('locations', $directive)) { + throw new InvariantViolation('Introspection result missing directive locations: ' . json_encode($directive) . '.'); + } + + return new Directive([ + 'name' => $directive['name'], + 'description' => $directive['description'], + 'args' => $this->buildInputValueDefMap($directive['args']), + 'isRepeatable' => $directive['isRepeatable'] ?? false, + 'locations' => $directive['locations'], + ]); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildSchema.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildSchema.php new file mode 100644 index 00000000..3e057754 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildSchema.php @@ -0,0 +1,237 @@ + */ + private $nodeMap; + + /** @var callable|null */ + private $typeConfigDecorator; + + /** @var array */ + private $options; + + /** + * @param array $options + */ + public function __construct(DocumentNode $ast, ?callable $typeConfigDecorator = null, array $options = []) + { + $this->ast = $ast; + $this->typeConfigDecorator = $typeConfigDecorator; + $this->options = $options; + } + + /** + * A helper function to build a GraphQLSchema directly from a source + * document. + * + * @param DocumentNode|Source|string $source + * @param array $options + * + * @return Schema + * + * @api + */ + public static function build($source, ?callable $typeConfigDecorator = null, array $options = []) + { + $doc = $source instanceof DocumentNode + ? $source + : Parser::parse($source); + + return self::buildAST($doc, $typeConfigDecorator, $options); + } + + /** + * This takes the ast of a schema document produced by the parse function in + * GraphQL\Language\Parser. + * + * If no schema definition is provided, then it will look for types named Query + * and Mutation. + * + * Given that AST it constructs a GraphQL\Type\Schema. The resulting schema + * has no resolve methods, so execution will use default resolvers. + * + * Accepts options as a third argument: + * + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * This option is provided to ease adoption and will be removed in v16. + * + * @param array $options + * + * @return Schema + * + * @throws Error + * + * @api + */ + public static function buildAST(DocumentNode $ast, ?callable $typeConfigDecorator = null, array $options = []) + { + $builder = new self($ast, $typeConfigDecorator, $options); + + return $builder->buildSchema(); + } + + public function buildSchema() + { + $options = $this->options; + if (! ($options['assumeValid'] ?? false) && ! ($options['assumeValidSDL'] ?? false)) { + DocumentValidator::assertValidSDL($this->ast); + } + + $schemaDef = null; + $typeDefs = []; + $this->nodeMap = []; + /** @var array $directiveDefs */ + $directiveDefs = []; + foreach ($this->ast->definitions as $definition) { + switch (true) { + case $definition instanceof SchemaDefinitionNode: + $schemaDef = $definition; + break; + case $definition instanceof TypeDefinitionNode: + $typeName = $definition->name->value; + if (isset($this->nodeMap[$typeName])) { + throw new Error(sprintf('Type "%s" was defined more than once.', $typeName)); + } + $typeDefs[] = $definition; + $this->nodeMap[$typeName] = $definition; + break; + case $definition instanceof DirectiveDefinitionNode: + $directiveDefs[] = $definition; + break; + } + } + + $operationTypes = $schemaDef !== null + ? $this->getOperationTypes($schemaDef) + : [ + 'query' => isset($this->nodeMap['Query']) ? 'Query' : null, + 'mutation' => isset($this->nodeMap['Mutation']) ? 'Mutation' : null, + 'subscription' => isset($this->nodeMap['Subscription']) ? 'Subscription' : null, + ]; + + $DefinitionBuilder = new ASTDefinitionBuilder( + $this->nodeMap, + $this->options, + static function ($typeName) : void { + throw new Error('Type "' . $typeName . '" not found in document.'); + }, + $this->typeConfigDecorator + ); + + $directives = array_map( + static function (DirectiveDefinitionNode $def) use ($DefinitionBuilder) : Directive { + return $DefinitionBuilder->buildDirective($def); + }, + $directiveDefs + ); + + // If specified directives were not explicitly declared, add them. + $directivesByName = Utils::groupBy( + $directives, + static function (Directive $directive) : string { + return $directive->name; + } + ); + if (! isset($directivesByName['skip'])) { + $directives[] = Directive::skipDirective(); + } + if (! isset($directivesByName['include'])) { + $directives[] = Directive::includeDirective(); + } + if (! isset($directivesByName['deprecated'])) { + $directives[] = Directive::deprecatedDirective(); + } + + // Note: While this could make early assertions to get the correctly + // typed values below, that would throw immediately while type system + // validation with validateSchema() will produce more actionable results. + + return new Schema([ + 'query' => isset($operationTypes['query']) + ? $DefinitionBuilder->buildType($operationTypes['query']) + : null, + 'mutation' => isset($operationTypes['mutation']) + ? $DefinitionBuilder->buildType($operationTypes['mutation']) + : null, + 'subscription' => isset($operationTypes['subscription']) + ? $DefinitionBuilder->buildType($operationTypes['subscription']) + : null, + 'typeLoader' => static function ($name) use ($DefinitionBuilder) : Type { + return $DefinitionBuilder->buildType($name); + }, + 'directives' => $directives, + 'astNode' => $schemaDef, + 'types' => function () use ($DefinitionBuilder) : array { + $types = []; + /** @var ScalarTypeDefinitionNode|ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|UnionTypeDefinitionNode|EnumTypeDefinitionNode|InputObjectTypeDefinitionNode $def */ + foreach ($this->nodeMap as $name => $def) { + $types[] = $DefinitionBuilder->buildType($def->name->value); + } + + return $types; + }, + ]); + } + + /** + * @param SchemaDefinitionNode $schemaDef + * + * @return string[] + * + * @throws Error + */ + private function getOperationTypes($schemaDef) + { + $opTypes = []; + + foreach ($schemaDef->operationTypes as $operationType) { + $typeName = $operationType->type->name->value; + $operation = $operationType->operation; + + if (isset($opTypes[$operation])) { + throw new Error(sprintf('Must provide only one %s type in schema.', $operation)); + } + + if (! isset($this->nodeMap[$typeName])) { + throw new Error(sprintf('Specified %s type "%s" not found in document.', $operation, $typeName)); + } + + $opTypes[$operation] = $typeName; + } + + return $opTypes; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/InterfaceImplementations.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/InterfaceImplementations.php new file mode 100644 index 00000000..eca7fd26 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/InterfaceImplementations.php @@ -0,0 +1,48 @@ + */ + private $objects; + + /** @var array */ + private $interfaces; + + /** + * @param array $objects + * @param array $interfaces + */ + public function __construct(array $objects, array $interfaces) + { + $this->objects = $objects; + $this->interfaces = $interfaces; + } + + /** + * @return array + */ + public function objects() : array + { + return $this->objects; + } + + /** + * @return array + */ + public function interfaces() : array + { + return $this->interfaces; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/MixedStore.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/MixedStore.php new file mode 100644 index 00000000..c6183674 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/MixedStore.php @@ -0,0 +1,247 @@ +standardStore = []; + $this->floatStore = []; + $this->objectStore = new SplObjectStorage(); + $this->arrayKeys = []; + $this->arrayValues = []; + $this->nullValueIsSet = false; + $this->trueValueIsSet = false; + $this->falseValueIsSet = false; + } + + /** + * Whether a offset exists + * + * @link http://php.net/manual/en/arrayaccess.offsetexists.php + * + * @param mixed $offset

+ * An offset to check for. + *

+ * + * @return bool true on success or false on failure. + *

+ *

+ * The return value will be casted to boolean if non-boolean was returned. + */ + public function offsetExists($offset) : bool + { + if ($offset === false) { + return $this->falseValueIsSet; + } + if ($offset === true) { + return $this->trueValueIsSet; + } + if (is_int($offset) || is_string($offset)) { + return array_key_exists($offset, $this->standardStore); + } + if (is_float($offset)) { + return array_key_exists((string) $offset, $this->floatStore); + } + if (is_object($offset)) { + return $this->objectStore->offsetExists($offset); + } + if (is_array($offset)) { + foreach ($this->arrayKeys as $index => $entry) { + if ($entry === $offset) { + $this->lastArrayKey = $offset; + $this->lastArrayValue = $this->arrayValues[$index]; + + return true; + } + } + } + if ($offset === null) { + return $this->nullValueIsSet; + } + + return false; + } + + /** + * Offset to retrieve + * + * @link http://php.net/manual/en/arrayaccess.offsetget.php + * + * @param mixed $offset

+ * The offset to retrieve. + *

+ * + * @return mixed Can return all value types. + */ + #[ReturnTypeWillChange] + public function offsetGet($offset) + { + if ($offset === true) { + return $this->trueValue; + } + if ($offset === false) { + return $this->falseValue; + } + if (is_int($offset) || is_string($offset)) { + return $this->standardStore[$offset]; + } + if (is_float($offset)) { + return $this->floatStore[(string) $offset]; + } + if (is_object($offset)) { + return $this->objectStore->offsetGet($offset); + } + if (is_array($offset)) { + // offsetGet is often called directly after offsetExists, so optimize to avoid second loop: + if ($this->lastArrayKey === $offset) { + return $this->lastArrayValue; + } + foreach ($this->arrayKeys as $index => $entry) { + if ($entry === $offset) { + return $this->arrayValues[$index]; + } + } + } + if ($offset === null) { + return $this->nullValue; + } + + return null; + } + + /** + * Offset to set + * + * @link http://php.net/manual/en/arrayaccess.offsetset.php + * + * @param mixed $offset

+ * The offset to assign the value to. + *

+ * @param mixed $value

+ * The value to set. + *

+ */ + public function offsetSet($offset, $value) : void + { + if ($offset === false) { + $this->falseValue = $value; + $this->falseValueIsSet = true; + } elseif ($offset === true) { + $this->trueValue = $value; + $this->trueValueIsSet = true; + } elseif (is_int($offset) || is_string($offset)) { + $this->standardStore[$offset] = $value; + } elseif (is_float($offset)) { + $this->floatStore[(string) $offset] = $value; + } elseif (is_object($offset)) { + $this->objectStore[$offset] = $value; + } elseif (is_array($offset)) { + $this->arrayKeys[] = $offset; + $this->arrayValues[] = $value; + } elseif ($offset === null) { + $this->nullValue = $value; + $this->nullValueIsSet = true; + } else { + throw new InvalidArgumentException('Unexpected offset type: ' . Utils::printSafe($offset)); + } + } + + /** + * Offset to unset + * + * @link http://php.net/manual/en/arrayaccess.offsetunset.php + * + * @param mixed $offset

+ * The offset to unset. + *

+ */ + public function offsetUnset($offset) : void + { + if ($offset === true) { + $this->trueValue = null; + $this->trueValueIsSet = false; + } elseif ($offset === false) { + $this->falseValue = null; + $this->falseValueIsSet = false; + } elseif (is_int($offset) || is_string($offset)) { + unset($this->standardStore[$offset]); + } elseif (is_float($offset)) { + unset($this->floatStore[(string) $offset]); + } elseif (is_object($offset)) { + $this->objectStore->offsetUnset($offset); + } elseif (is_array($offset)) { + $index = array_search($offset, $this->arrayKeys, true); + + if ($index !== false) { + array_splice($this->arrayKeys, $index, 1); + array_splice($this->arrayValues, $index, 1); + } + } elseif ($offset === null) { + $this->nullValue = null; + $this->nullValueIsSet = false; + } + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/PairSet.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/PairSet.php new file mode 100644 index 00000000..fe3a514c --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/PairSet.php @@ -0,0 +1,66 @@ +data = []; + } + + /** + * @param string $a + * @param string $b + * @param bool $areMutuallyExclusive + * + * @return bool + */ + public function has($a, $b, $areMutuallyExclusive) + { + $first = $this->data[$a] ?? null; + $result = $first && isset($first[$b]) ? $first[$b] : null; + if ($result === null) { + return false; + } + // areMutuallyExclusive being false is a superset of being true, + // hence if we want to know if this PairSet "has" these two with no + // exclusivity, we have to ensure it was added as such. + if ($areMutuallyExclusive === false) { + return $result === false; + } + + return true; + } + + /** + * @param string $a + * @param string $b + * @param bool $areMutuallyExclusive + */ + public function add($a, $b, $areMutuallyExclusive) + { + $this->pairSetAdd($a, $b, $areMutuallyExclusive); + $this->pairSetAdd($b, $a, $areMutuallyExclusive); + } + + /** + * @param string $a + * @param string $b + * @param bool $areMutuallyExclusive + */ + private function pairSetAdd($a, $b, $areMutuallyExclusive) + { + $this->data[$a] = $this->data[$a] ?? []; + $this->data[$a][$b] = $areMutuallyExclusive; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaExtender.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaExtender.php new file mode 100644 index 00000000..b71625fa --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaExtender.php @@ -0,0 +1,650 @@ +name; + if ($type->extensionASTNodes !== null) { + if (isset(static::$typeExtensionsMap[$name])) { + return array_merge($type->extensionASTNodes, static::$typeExtensionsMap[$name]); + } + + return $type->extensionASTNodes; + } + + return static::$typeExtensionsMap[$name] ?? null; + } + + /** + * @throws Error + */ + protected static function checkExtensionNode(Type $type, Node $node) : void + { + switch (true) { + case $node instanceof ObjectTypeExtensionNode: + if (! ($type instanceof ObjectType)) { + throw new Error( + 'Cannot extend non-object type "' . $type->name . '".', + [$node] + ); + } + break; + case $node instanceof InterfaceTypeExtensionNode: + if (! ($type instanceof InterfaceType)) { + throw new Error( + 'Cannot extend non-interface type "' . $type->name . '".', + [$node] + ); + } + break; + case $node instanceof EnumTypeExtensionNode: + if (! ($type instanceof EnumType)) { + throw new Error( + 'Cannot extend non-enum type "' . $type->name . '".', + [$node] + ); + } + break; + case $node instanceof UnionTypeExtensionNode: + if (! ($type instanceof UnionType)) { + throw new Error( + 'Cannot extend non-union type "' . $type->name . '".', + [$node] + ); + } + break; + case $node instanceof InputObjectTypeExtensionNode: + if (! ($type instanceof InputObjectType)) { + throw new Error( + 'Cannot extend non-input object type "' . $type->name . '".', + [$node] + ); + } + break; + } + } + + protected static function extendScalarType(ScalarType $type) : CustomScalarType + { + return new CustomScalarType([ + 'name' => $type->name, + 'description' => $type->description, + 'astNode' => $type->astNode, + 'serialize' => $type->config['serialize'] ?? null, + 'parseValue' => $type->config['parseValue'] ?? null, + 'parseLiteral' => $type->config['parseLiteral'] ?? null, + 'extensionASTNodes' => static::getExtensionASTNodes($type), + ]); + } + + protected static function extendUnionType(UnionType $type) : UnionType + { + return new UnionType([ + 'name' => $type->name, + 'description' => $type->description, + 'types' => static function () use ($type) : array { + return static::extendPossibleTypes($type); + }, + 'astNode' => $type->astNode, + 'resolveType' => $type->config['resolveType'] ?? null, + 'extensionASTNodes' => static::getExtensionASTNodes($type), + ]); + } + + protected static function extendEnumType(EnumType $type) : EnumType + { + return new EnumType([ + 'name' => $type->name, + 'description' => $type->description, + 'values' => static::extendValueMap($type), + 'astNode' => $type->astNode, + 'extensionASTNodes' => static::getExtensionASTNodes($type), + ]); + } + + protected static function extendInputObjectType(InputObjectType $type) : InputObjectType + { + return new InputObjectType([ + 'name' => $type->name, + 'description' => $type->description, + 'fields' => static function () use ($type) : array { + return static::extendInputFieldMap($type); + }, + 'astNode' => $type->astNode, + 'extensionASTNodes' => static::getExtensionASTNodes($type), + ]); + } + + /** + * @return mixed[] + */ + protected static function extendInputFieldMap(InputObjectType $type) : array + { + $newFieldMap = []; + $oldFieldMap = $type->getFields(); + foreach ($oldFieldMap as $fieldName => $field) { + $newFieldMap[$fieldName] = [ + 'description' => $field->description, + 'type' => static::extendType($field->getType()), + 'astNode' => $field->astNode, + ]; + + if (! $field->defaultValueExists()) { + continue; + } + + $newFieldMap[$fieldName]['defaultValue'] = $field->defaultValue; + } + + $extensions = static::$typeExtensionsMap[$type->name] ?? null; + if ($extensions !== null) { + foreach ($extensions as $extension) { + foreach ($extension->fields as $field) { + $fieldName = $field->name->value; + if (isset($oldFieldMap[$fieldName])) { + throw new Error('Field "' . $type->name . '.' . $fieldName . '" already exists in the schema. It cannot also be defined in this type extension.', [$field]); + } + + $newFieldMap[$fieldName] = static::$astBuilder->buildInputField($field); + } + } + } + + return $newFieldMap; + } + + /** + * @return mixed[] + */ + protected static function extendValueMap(EnumType $type) : array + { + $newValueMap = []; + /** @var EnumValueDefinition[] $oldValueMap */ + $oldValueMap = []; + foreach ($type->getValues() as $value) { + $oldValueMap[$value->name] = $value; + } + + foreach ($oldValueMap as $key => $value) { + $newValueMap[$key] = [ + 'name' => $value->name, + 'description' => $value->description, + 'value' => $value->value, + 'deprecationReason' => $value->deprecationReason, + 'astNode' => $value->astNode, + ]; + } + + $extensions = static::$typeExtensionsMap[$type->name] ?? null; + if ($extensions !== null) { + foreach ($extensions as $extension) { + foreach ($extension->values as $value) { + $valueName = $value->name->value; + if (isset($oldValueMap[$valueName])) { + throw new Error('Enum value "' . $type->name . '.' . $valueName . '" already exists in the schema. It cannot also be defined in this type extension.', [$value]); + } + $newValueMap[$valueName] = static::$astBuilder->buildEnumValue($value); + } + } + } + + return $newValueMap; + } + + /** + * @return ObjectType[] + */ + protected static function extendPossibleTypes(UnionType $type) : array + { + $possibleTypes = array_map(static function ($type) { + return static::extendNamedType($type); + }, $type->getTypes()); + + $extensions = static::$typeExtensionsMap[$type->name] ?? null; + if ($extensions !== null) { + foreach ($extensions as $extension) { + foreach ($extension->types as $namedType) { + $possibleTypes[] = static::$astBuilder->buildType($namedType); + } + } + } + + return $possibleTypes; + } + + /** + * @param ObjectType|InterfaceType $type + * + * @return array + */ + protected static function extendImplementedInterfaces(ImplementingType $type) : array + { + $interfaces = array_map(static function (InterfaceType $interfaceType) { + return static::extendNamedType($interfaceType); + }, $type->getInterfaces()); + + $extensions = static::$typeExtensionsMap[$type->name] ?? null; + if ($extensions !== null) { + /** @var ObjectTypeExtensionNode|InterfaceTypeExtensionNode $extension */ + foreach ($extensions as $extension) { + foreach ($extension->interfaces as $namedType) { + $interfaces[] = static::$astBuilder->buildType($namedType); + } + } + } + + return $interfaces; + } + + protected static function extendType($typeDef) + { + if ($typeDef instanceof ListOfType) { + return Type::listOf(static::extendType($typeDef->getOfType())); + } + + if ($typeDef instanceof NonNull) { + return Type::nonNull(static::extendType($typeDef->getWrappedType())); + } + + return static::extendNamedType($typeDef); + } + + /** + * @param FieldArgument[] $args + * + * @return mixed[] + */ + protected static function extendArgs(array $args) : array + { + return Utils::keyValMap( + $args, + static function (FieldArgument $arg) : string { + return $arg->name; + }, + static function (FieldArgument $arg) : array { + $def = [ + 'type' => static::extendType($arg->getType()), + 'description' => $arg->description, + 'astNode' => $arg->astNode, + ]; + + if ($arg->defaultValueExists()) { + $def['defaultValue'] = $arg->defaultValue; + } + + return $def; + } + ); + } + + /** + * @param InterfaceType|ObjectType $type + * + * @return mixed[] + * + * @throws Error + */ + protected static function extendFieldMap($type) : array + { + $newFieldMap = []; + $oldFieldMap = $type->getFields(); + + foreach (array_keys($oldFieldMap) as $fieldName) { + $field = $oldFieldMap[$fieldName]; + + $newFieldMap[$fieldName] = [ + 'name' => $fieldName, + 'description' => $field->description, + 'deprecationReason' => $field->deprecationReason, + 'type' => static::extendType($field->getType()), + 'args' => static::extendArgs($field->args), + 'astNode' => $field->astNode, + 'resolve' => $field->resolveFn, + ]; + } + + $extensions = static::$typeExtensionsMap[$type->name] ?? null; + if ($extensions !== null) { + foreach ($extensions as $extension) { + foreach ($extension->fields as $field) { + $fieldName = $field->name->value; + if (isset($oldFieldMap[$fieldName])) { + throw new Error('Field "' . $type->name . '.' . $fieldName . '" already exists in the schema. It cannot also be defined in this type extension.', [$field]); + } + + $newFieldMap[$fieldName] = static::$astBuilder->buildField($field); + } + } + } + + return $newFieldMap; + } + + protected static function extendObjectType(ObjectType $type) : ObjectType + { + return new ObjectType([ + 'name' => $type->name, + 'description' => $type->description, + 'interfaces' => static function () use ($type) : array { + return static::extendImplementedInterfaces($type); + }, + 'fields' => static function () use ($type) : array { + return static::extendFieldMap($type); + }, + 'astNode' => $type->astNode, + 'extensionASTNodes' => static::getExtensionASTNodes($type), + 'isTypeOf' => $type->config['isTypeOf'] ?? null, + 'resolveField' => $type->resolveFieldFn ?? null, + ]); + } + + protected static function extendInterfaceType(InterfaceType $type) : InterfaceType + { + return new InterfaceType([ + 'name' => $type->name, + 'description' => $type->description, + 'interfaces' => static function () use ($type) : array { + return static::extendImplementedInterfaces($type); + }, + 'fields' => static function () use ($type) : array { + return static::extendFieldMap($type); + }, + 'astNode' => $type->astNode, + 'extensionASTNodes' => static::getExtensionASTNodes($type), + 'resolveType' => $type->config['resolveType'] ?? null, + ]); + } + + protected static function isSpecifiedScalarType(Type $type) : bool + { + return $type instanceof NamedType && + ( + $type->name === Type::STRING || + $type->name === Type::INT || + $type->name === Type::FLOAT || + $type->name === Type::BOOLEAN || + $type->name === Type::ID + ); + } + + protected static function extendNamedType(Type $type) + { + if (Introspection::isIntrospectionType($type) || static::isSpecifiedScalarType($type)) { + return $type; + } + + $name = $type->name; + if (! isset(static::$extendTypeCache[$name])) { + if ($type instanceof ScalarType) { + static::$extendTypeCache[$name] = static::extendScalarType($type); + } elseif ($type instanceof ObjectType) { + static::$extendTypeCache[$name] = static::extendObjectType($type); + } elseif ($type instanceof InterfaceType) { + static::$extendTypeCache[$name] = static::extendInterfaceType($type); + } elseif ($type instanceof UnionType) { + static::$extendTypeCache[$name] = static::extendUnionType($type); + } elseif ($type instanceof EnumType) { + static::$extendTypeCache[$name] = static::extendEnumType($type); + } elseif ($type instanceof InputObjectType) { + static::$extendTypeCache[$name] = static::extendInputObjectType($type); + } + } + + return static::$extendTypeCache[$name]; + } + + /** + * @return mixed|null + */ + protected static function extendMaybeNamedType(?NamedType $type = null) + { + if ($type !== null) { + return static::extendNamedType($type); + } + + return null; + } + + /** + * @param DirectiveDefinitionNode[] $directiveDefinitions + * + * @return Directive[] + */ + protected static function getMergedDirectives(Schema $schema, array $directiveDefinitions) : array + { + $existingDirectives = array_map(static function (Directive $directive) : Directive { + return static::extendDirective($directive); + }, $schema->getDirectives()); + + Utils::invariant(count($existingDirectives) > 0, 'schema must have default directives'); + + return array_merge( + $existingDirectives, + array_map(static function (DirectiveDefinitionNode $directive) : Directive { + return static::$astBuilder->buildDirective($directive); + }, $directiveDefinitions) + ); + } + + protected static function extendDirective(Directive $directive) : Directive + { + return new Directive([ + 'name' => $directive->name, + 'description' => $directive->description, + 'locations' => $directive->locations, + 'args' => static::extendArgs($directive->args), + 'astNode' => $directive->astNode, + 'isRepeatable' => $directive->isRepeatable, + ]); + } + + /** + * @param array $options + */ + public static function extend( + Schema $schema, + DocumentNode $documentAST, + array $options = [], + ?callable $typeConfigDecorator = null + ) : Schema { + if (! (isset($options['assumeValid']) || isset($options['assumeValidSDL']))) { + DocumentValidator::assertValidSDLExtension($documentAST, $schema); + } + + /** @var array $typeDefinitionMap */ + $typeDefinitionMap = []; + static::$typeExtensionsMap = []; + $directiveDefinitions = []; + /** @var SchemaDefinitionNode|null $schemaDef */ + $schemaDef = null; + /** @var array $schemaExtensions */ + $schemaExtensions = []; + + $definitionsCount = count($documentAST->definitions); + for ($i = 0; $i < $definitionsCount; $i++) { + + /** @var Node $def */ + $def = $documentAST->definitions[$i]; + + if ($def instanceof SchemaDefinitionNode) { + $schemaDef = $def; + } elseif ($def instanceof SchemaTypeExtensionNode) { + $schemaExtensions[] = $def; + } elseif ($def instanceof TypeDefinitionNode) { + $typeName = isset($def->name) ? $def->name->value : null; + + try { + $type = $schema->getType($typeName); + } catch (Error $error) { + $type = null; + } + + if ($type) { + throw new Error('Type "' . $typeName . '" already exists in the schema. It cannot also be defined in this type definition.', [$def]); + } + $typeDefinitionMap[$typeName] = $def; + } elseif ($def instanceof TypeExtensionNode) { + $extendedTypeName = isset($def->name) ? $def->name->value : null; + $existingType = $schema->getType($extendedTypeName); + if ($existingType === null) { + throw new Error('Cannot extend type "' . $extendedTypeName . '" because it does not exist in the existing schema.', [$def]); + } + + static::checkExtensionNode($existingType, $def); + + $existingTypeExtensions = static::$typeExtensionsMap[$extendedTypeName] ?? null; + static::$typeExtensionsMap[$extendedTypeName] = $existingTypeExtensions !== null ? array_merge($existingTypeExtensions, [$def]) : [$def]; + } elseif ($def instanceof DirectiveDefinitionNode) { + $directiveName = $def->name->value; + $existingDirective = $schema->getDirective($directiveName); + if ($existingDirective !== null) { + throw new Error('Directive "' . $directiveName . '" already exists in the schema. It cannot be redefined.', [$def]); + } + $directiveDefinitions[] = $def; + } + } + + if (count(static::$typeExtensionsMap) === 0 + && count($typeDefinitionMap) === 0 + && count($directiveDefinitions) === 0 + && count($schemaExtensions) === 0 + && $schemaDef === null + ) { + return $schema; + } + + static::$astBuilder = new ASTDefinitionBuilder( + $typeDefinitionMap, + $options, + static function (string $typeName) use ($schema) { + /** @var ScalarType|ObjectType|InterfaceType|UnionType|EnumType|InputObjectType $existingType */ + $existingType = $schema->getType($typeName); + if ($existingType !== null) { + return static::extendNamedType($existingType); + } + + throw new Error('Unknown type: "' . $typeName . '". Ensure that this type exists either in the original schema, or is added in a type definition.', [$typeName]); + }, + $typeConfigDecorator + ); + + static::$extendTypeCache = []; + + $operationTypes = [ + 'query' => static::extendMaybeNamedType($schema->getQueryType()), + 'mutation' => static::extendMaybeNamedType($schema->getMutationType()), + 'subscription' => static::extendMaybeNamedType($schema->getSubscriptionType()), + ]; + + if ($schemaDef) { + foreach ($schemaDef->operationTypes as $operationType) { + $operation = $operationType->operation; + $type = $operationType->type; + + if (isset($operationTypes[$operation])) { + throw new Error('Must provide only one ' . $operation . ' type in schema.'); + } + + $operationTypes[$operation] = static::$astBuilder->buildType($type); + } + } + + foreach ($schemaExtensions as $schemaExtension) { + if ($schemaExtension->operationTypes === null) { + continue; + } + + foreach ($schemaExtension->operationTypes as $operationType) { + $operation = $operationType->operation; + if (isset($operationTypes[$operation])) { + throw new Error('Must provide only one ' . $operation . ' type in schema.'); + } + $operationTypes[$operation] = static::$astBuilder->buildType($operationType->type); + } + } + + $schemaExtensionASTNodes = array_merge($schema->extensionASTNodes, $schemaExtensions); + + $types = array_merge( + // Iterate through all types, getting the type definition for each, ensuring + // that any type not directly referenced by a field will get created. + array_map(static function (Type $type) : Type { + return static::extendNamedType($type); + }, $schema->getTypeMap()), + // Do the same with new types. + array_map(static function (TypeDefinitionNode $type) : Type { + return static::$astBuilder->buildType($type); + }, $typeDefinitionMap) + ); + + return new Schema([ + 'query' => $operationTypes['query'], + 'mutation' => $operationTypes['mutation'], + 'subscription' => $operationTypes['subscription'], + 'types' => $types, + 'directives' => static::getMergedDirectives($schema, $directiveDefinitions), + 'astNode' => $schema->getAstNode(), + 'extensionASTNodes' => $schemaExtensionASTNodes, + ]); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaPrinter.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaPrinter.php new file mode 100644 index 00000000..cf78f52c --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaPrinter.php @@ -0,0 +1,508 @@ + $options + * Available options: + * - commentDescriptions: + * Provide true to use preceding comments as the description. + * This option is provided to ease adoption and will be removed in v16. + * + * @api + */ + public static function doPrint(Schema $schema, array $options = []) : string + { + return static::printFilteredSchema( + $schema, + static function ($type) : bool { + return ! Directive::isSpecifiedDirective($type); + }, + static function ($type) : bool { + return ! Type::isBuiltInType($type); + }, + $options + ); + } + + /** + * @param array $options + */ + protected static function printFilteredSchema(Schema $schema, callable $directiveFilter, callable $typeFilter, array $options) : string + { + $directives = array_filter($schema->getDirectives(), $directiveFilter); + + $types = $schema->getTypeMap(); + ksort($types); + $types = array_filter($types, $typeFilter); + + return sprintf( + "%s\n", + implode( + "\n\n", + array_filter( + array_merge( + [static::printSchemaDefinition($schema)], + array_map( + static function (Directive $directive) use ($options) : string { + return static::printDirective($directive, $options); + }, + $directives + ), + array_map( + static function ($type) use ($options) : string { + return static::printType($type, $options); + }, + $types + ) + ) + ) + ) + ); + } + + protected static function printSchemaDefinition(Schema $schema) : string + { + if (static::isSchemaOfCommonNames($schema)) { + return ''; + } + + $operationTypes = []; + + $queryType = $schema->getQueryType(); + if ($queryType !== null) { + $operationTypes[] = sprintf(' query: %s', $queryType->name); + } + + $mutationType = $schema->getMutationType(); + if ($mutationType !== null) { + $operationTypes[] = sprintf(' mutation: %s', $mutationType->name); + } + + $subscriptionType = $schema->getSubscriptionType(); + if ($subscriptionType !== null) { + $operationTypes[] = sprintf(' subscription: %s', $subscriptionType->name); + } + + return sprintf("schema {\n%s\n}", implode("\n", $operationTypes)); + } + + /** + * GraphQL schema define root types for each type of operation. These types are + * the same as any other type and can be named in any manner, however there is + * a common naming convention: + * + * schema { + * query: Query + * mutation: Mutation + * } + * + * When using this naming convention, the schema description can be omitted. + */ + protected static function isSchemaOfCommonNames(Schema $schema) : bool + { + $queryType = $schema->getQueryType(); + if ($queryType !== null && $queryType->name !== 'Query') { + return false; + } + + $mutationType = $schema->getMutationType(); + if ($mutationType !== null && $mutationType->name !== 'Mutation') { + return false; + } + + $subscriptionType = $schema->getSubscriptionType(); + + return $subscriptionType === null || $subscriptionType->name === 'Subscription'; + } + + /** + * @param array $options + */ + protected static function printDirective(Directive $directive, array $options) : string + { + return static::printDescription($options, $directive) + . 'directive @' . $directive->name + . static::printArgs($options, $directive->args) + . ($directive->isRepeatable ? ' repeatable' : '') + . ' on ' . implode(' | ', $directive->locations); + } + + /** + * @param array $options + */ + protected static function printDescription(array $options, $def, $indentation = '', $firstInBlock = true) : string + { + if (! $def->description) { + return ''; + } + $lines = static::descriptionLines($def->description, 120 - strlen($indentation)); + if (isset($options['commentDescriptions'])) { + return static::printDescriptionWithComments($lines, $indentation, $firstInBlock); + } + + $description = $indentation && ! $firstInBlock + ? "\n" . $indentation . '"""' + : $indentation . '"""'; + + // In some circumstances, a single line can be used for the description. + if (count($lines) === 1 && + mb_strlen($lines[0]) < 70 && + substr($lines[0], -1) !== '"' + ) { + return $description . static::escapeQuote($lines[0]) . "\"\"\"\n"; + } + + // Format a multi-line block quote to account for leading space. + $hasLeadingSpace = isset($lines[0]) && + ( + substr($lines[0], 0, 1) === ' ' || + substr($lines[0], 0, 1) === '\t' + ); + if (! $hasLeadingSpace) { + $description .= "\n"; + } + + $lineLength = count($lines); + for ($i = 0; $i < $lineLength; $i++) { + if ($i !== 0 || ! $hasLeadingSpace) { + $description .= $indentation; + } + $description .= static::escapeQuote($lines[$i]) . "\n"; + } + $description .= $indentation . "\"\"\"\n"; + + return $description; + } + + /** + * @return string[] + */ + protected static function descriptionLines(string $description, int $maxLen) : array + { + $lines = []; + $rawLines = explode("\n", $description); + foreach ($rawLines as $line) { + if ($line === '') { + $lines[] = $line; + } else { + // For > 120 character long lines, cut at space boundaries into sublines + // of ~80 chars. + $sublines = static::breakLine($line, $maxLen); + foreach ($sublines as $subline) { + $lines[] = $subline; + } + } + } + + return $lines; + } + + /** + * @return string[] + */ + protected static function breakLine(string $line, int $maxLen) : array + { + if (strlen($line) < $maxLen + 5) { + return [$line]; + } + preg_match_all('/((?: |^).{15,' . ($maxLen - 40) . '}(?= |$))/', $line, $parts); + $parts = $parts[0]; + + return array_map('trim', $parts); + } + + protected static function printDescriptionWithComments($lines, $indentation, $firstInBlock) : string + { + $description = $indentation && ! $firstInBlock ? "\n" : ''; + foreach ($lines as $line) { + if ($line === '') { + $description .= $indentation . "#\n"; + } else { + $description .= $indentation . '# ' . $line . "\n"; + } + } + + return $description; + } + + protected static function escapeQuote($line) : string + { + return str_replace('"""', '\\"""', $line); + } + + /** + * @param array $options + */ + protected static function printArgs(array $options, $args, $indentation = '') : string + { + if (! $args) { + return ''; + } + + // If every arg does not have a description, print them on one line. + if (Utils::every( + $args, + static function ($arg) : bool { + return strlen($arg->description ?? '') === 0; + } + )) { + return '(' . implode(', ', array_map([static::class, 'printInputValue'], $args)) . ')'; + } + + return sprintf( + "(\n%s\n%s)", + implode( + "\n", + array_map( + static function ($arg, $i) use ($indentation, $options) : string { + return static::printDescription($options, $arg, ' ' . $indentation, ! $i) . ' ' . $indentation . + static::printInputValue($arg); + }, + $args, + array_keys($args) + ) + ), + $indentation + ); + } + + protected static function printInputValue($arg) : string + { + $argDecl = $arg->name . ': ' . (string) $arg->getType(); + if ($arg->defaultValueExists()) { + $argDecl .= ' = ' . Printer::doPrint(AST::astFromValue($arg->defaultValue, $arg->getType())); + } + + return $argDecl; + } + + /** + * @param array $options + */ + public static function printType(Type $type, array $options = []) : string + { + if ($type instanceof ScalarType) { + return static::printScalar($type, $options); + } + + if ($type instanceof ObjectType) { + return static::printObject($type, $options); + } + + if ($type instanceof InterfaceType) { + return static::printInterface($type, $options); + } + + if ($type instanceof UnionType) { + return static::printUnion($type, $options); + } + + if ($type instanceof EnumType) { + return static::printEnum($type, $options); + } + + if ($type instanceof InputObjectType) { + return static::printInputObject($type, $options); + } + + throw new Error(sprintf('Unknown type: %s.', Utils::printSafe($type))); + } + + /** + * @param array $options + */ + protected static function printScalar(ScalarType $type, array $options) : string + { + return sprintf('%sscalar %s', static::printDescription($options, $type), $type->name); + } + + /** + * @param array $options + */ + protected static function printObject(ObjectType $type, array $options) : string + { + $interfaces = $type->getInterfaces(); + $implementedInterfaces = count($interfaces) > 0 + ? ' implements ' . implode( + ' & ', + array_map( + static function (InterfaceType $interface) : string { + return $interface->name; + }, + $interfaces + ) + ) + : ''; + + return static::printDescription($options, $type) . + sprintf("type %s%s {\n%s\n}", $type->name, $implementedInterfaces, static::printFields($options, $type)); + } + + /** + * @param array $options + */ + protected static function printFields(array $options, $type) : string + { + $fields = array_values($type->getFields()); + + return implode( + "\n", + array_map( + static function ($f, $i) use ($options) : string { + return static::printDescription($options, $f, ' ', ! $i) . ' ' . + $f->name . static::printArgs($options, $f->args, ' ') . ': ' . + (string) $f->getType() . static::printDeprecated($f); + }, + $fields, + array_keys($fields) + ) + ); + } + + protected static function printDeprecated($fieldOrEnumVal) : string + { + $reason = $fieldOrEnumVal->deprecationReason; + if ($reason === null) { + return ''; + } + if ($reason === '' || $reason === Directive::DEFAULT_DEPRECATION_REASON) { + return ' @deprecated'; + } + + return ' @deprecated(reason: ' . + Printer::doPrint(AST::astFromValue($reason, Type::string())) . ')'; + } + + /** + * @param array $options + */ + protected static function printInterface(InterfaceType $type, array $options) : string + { + $interfaces = $type->getInterfaces(); + $implementedInterfaces = count($interfaces) > 0 + ? ' implements ' . implode( + ' & ', + array_map( + static function (InterfaceType $interface) : string { + return $interface->name; + }, + $interfaces + ) + ) + : ''; + + return static::printDescription($options, $type) . + sprintf("interface %s%s {\n%s\n}", $type->name, $implementedInterfaces, static::printFields($options, $type)); + } + + /** + * @param array $options + */ + protected static function printUnion(UnionType $type, array $options) : string + { + return static::printDescription($options, $type) . + sprintf('union %s = %s', $type->name, implode(' | ', $type->getTypes())); + } + + /** + * @param array $options + */ + protected static function printEnum(EnumType $type, array $options) : string + { + return static::printDescription($options, $type) . + sprintf("enum %s {\n%s\n}", $type->name, static::printEnumValues($type->getValues(), $options)); + } + + /** + * @param array $options + */ + protected static function printEnumValues($values, array $options) : string + { + return implode( + "\n", + array_map( + static function ($value, $i) use ($options) : string { + return static::printDescription($options, $value, ' ', ! $i) . ' ' . + $value->name . static::printDeprecated($value); + }, + $values, + array_keys($values) + ) + ); + } + + /** + * @param array $options + */ + protected static function printInputObject(InputObjectType $type, array $options) : string + { + $fields = array_values($type->getFields()); + + return static::printDescription($options, $type) . + sprintf( + "input %s {\n%s\n}", + $type->name, + implode( + "\n", + array_map( + static function ($f, $i) use ($options) : string { + return static::printDescription($options, $f, ' ', ! $i) . ' ' . static::printInputValue($f); + }, + $fields, + array_keys($fields) + ) + ) + ); + } + + /** + * @param array $options + * + * @api + */ + public static function printIntrospectionSchema(Schema $schema, array $options = []) : string + { + return static::printFilteredSchema( + $schema, + [Directive::class, 'isSpecifiedDirective'], + [Introspection::class, 'isIntrospectionType'], + $options + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeComparators.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeComparators.php new file mode 100644 index 00000000..7033eee7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeComparators.php @@ -0,0 +1,138 @@ +getWrappedType(), $typeB->getWrappedType()); + } + + // If either type is a list, the other must also be a list. + if ($typeA instanceof ListOfType && $typeB instanceof ListOfType) { + return self::isEqualType($typeA->getWrappedType(), $typeB->getWrappedType()); + } + + // Otherwise the types are not equal. + return false; + } + + /** + * Provided a type and a super type, return true if the first type is either + * equal or a subset of the second super type (covariant). + * + * @return bool + */ + public static function isTypeSubTypeOf(Schema $schema, Type $maybeSubType, Type $superType) + { + // Equivalent type is a valid subtype + if ($maybeSubType === $superType) { + return true; + } + + // If superType is non-null, maybeSubType must also be nullable. + if ($superType instanceof NonNull) { + if ($maybeSubType instanceof NonNull) { + return self::isTypeSubTypeOf($schema, $maybeSubType->getWrappedType(), $superType->getWrappedType()); + } + + return false; + } + + if ($maybeSubType instanceof NonNull) { + // If superType is nullable, maybeSubType may be non-null. + return self::isTypeSubTypeOf($schema, $maybeSubType->getWrappedType(), $superType); + } + + // If superType type is a list, maybeSubType type must also be a list. + if ($superType instanceof ListOfType) { + if ($maybeSubType instanceof ListOfType) { + return self::isTypeSubTypeOf($schema, $maybeSubType->getWrappedType(), $superType->getWrappedType()); + } + + return false; + } + + if ($maybeSubType instanceof ListOfType) { + // If superType is not a list, maybeSubType must also be not a list. + return false; + } + + // If superType type is an abstract type, maybeSubType type may be a currently + // possible object or interface type. + return Type::isAbstractType($superType) && + $maybeSubType instanceof ImplementingType && + $schema->isSubType( + $superType, + $maybeSubType + ); + } + + /** + * Provided two composite types, determine if they "overlap". Two composite + * types overlap when the Sets of possible concrete types for each intersect. + * + * This is often used to determine if a fragment of a given type could possibly + * be visited in a context of another type. + * + * This function is commutative. + * + * @return bool + */ + public static function doTypesOverlap(Schema $schema, CompositeType $typeA, CompositeType $typeB) + { + // Equivalent types overlap + if ($typeA === $typeB) { + return true; + } + + if ($typeA instanceof AbstractType) { + if ($typeB instanceof AbstractType) { + // If both types are abstract, then determine if there is any intersection + // between possible concrete types of each. + foreach ($schema->getPossibleTypes($typeA) as $type) { + if ($schema->isSubType($typeB, $type)) { + return true; + } + } + + return false; + } + + // Determine if the latter type is a possible concrete type of the former. + return $schema->isSubType($typeA, $typeB); + } + + if ($typeB instanceof AbstractType) { + // Determine if the former type is a possible concrete type of the latter. + return $schema->isSubType($typeB, $typeA); + } + + // Otherwise the types do not overlap. + return false; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php new file mode 100644 index 00000000..58d17fbd --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php @@ -0,0 +1,504 @@ + */ + private $typeStack; + + /** @var array<(CompositeType&Type)|null> */ + private $parentTypeStack; + + /** @var array<(InputType&Type)|null> */ + private $inputTypeStack; + + /** @var array */ + private $fieldDefStack; + + /** @var array */ + private $defaultValueStack; + + /** @var Directive|null */ + private $directive; + + /** @var FieldArgument|null */ + private $argument; + + /** @var mixed */ + private $enumValue; + + /** + * @param Type|null $initialType + */ + public function __construct(Schema $schema, $initialType = null) + { + $this->schema = $schema; + $this->typeStack = []; + $this->parentTypeStack = []; + $this->inputTypeStack = []; + $this->fieldDefStack = []; + $this->defaultValueStack = []; + + if ($initialType === null) { + return; + } + + if (Type::isInputType($initialType)) { + $this->inputTypeStack[] = $initialType; + } + if (Type::isCompositeType($initialType)) { + $this->parentTypeStack[] = $initialType; + } + if (! Type::isOutputType($initialType)) { + return; + } + + $this->typeStack[] = $initialType; + } + + /** + * @deprecated moved to GraphQL\Utils\TypeComparators + * + * @codeCoverageIgnore + */ + public static function isEqualType(Type $typeA, Type $typeB) : bool + { + return TypeComparators::isEqualType($typeA, $typeB); + } + + /** + * @deprecated moved to GraphQL\Utils\TypeComparators + * + * @codeCoverageIgnore + */ + public static function isTypeSubTypeOf(Schema $schema, Type $maybeSubType, Type $superType) + { + return TypeComparators::isTypeSubTypeOf($schema, $maybeSubType, $superType); + } + + /** + * @deprecated moved to GraphQL\Utils\TypeComparators + * + * @codeCoverageIgnore + */ + public static function doTypesOverlap(Schema $schema, CompositeType $typeA, CompositeType $typeB) + { + return TypeComparators::doTypesOverlap($schema, $typeA, $typeB); + } + + /** + * Given root type scans through all fields to find nested types. Returns array where keys are for type name + * and value contains corresponding type instance. + * + * Example output: + * [ + * 'String' => $instanceOfStringType, + * 'MyType' => $instanceOfMyType, + * ... + * ] + * + * @param Type|null $type + * @param Type[]|null $typeMap + * + * @return Type[]|null + */ + public static function extractTypes($type, ?array $typeMap = null) + { + if (! $typeMap) { + $typeMap = []; + } + if (! $type) { + return $typeMap; + } + + if ($type instanceof WrappingType) { + return self::extractTypes($type->getWrappedType(true), $typeMap); + } + + if (! $type instanceof Type) { + // Preserve these invalid types in map (at numeric index) to make them + // detectable during $schema->validate() + $i = 0; + $alreadyInMap = false; + while (isset($typeMap[$i])) { + $alreadyInMap = $alreadyInMap || $typeMap[$i] === $type; + $i++; + } + if (! $alreadyInMap) { + $typeMap[$i] = $type; + } + + return $typeMap; + } + + if (isset($typeMap[$type->name])) { + Utils::invariant( + $typeMap[$type->name] === $type, + sprintf('Schema must contain unique named types but contains multiple types named "%s" ', $type) . + '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).' + ); + + return $typeMap; + } + $typeMap[$type->name] = $type; + + $nestedTypes = []; + + if ($type instanceof UnionType) { + $nestedTypes = $type->getTypes(); + } + if ($type instanceof ImplementingType) { + $nestedTypes = array_merge($nestedTypes, $type->getInterfaces()); + } + + if ($type instanceof HasFieldsType) { + foreach ($type->getFields() as $field) { + if (count($field->args) > 0) { + $fieldArgTypes = array_map( + static function (FieldArgument $arg) : Type { + return $arg->getType(); + }, + $field->args + ); + + $nestedTypes = array_merge($nestedTypes, $fieldArgTypes); + } + $nestedTypes[] = $field->getType(); + } + } + if ($type instanceof InputObjectType) { + foreach ($type->getFields() as $field) { + $nestedTypes[] = $field->getType(); + } + } + foreach ($nestedTypes as $nestedType) { + $typeMap = self::extractTypes($nestedType, $typeMap); + } + + return $typeMap; + } + + /** + * @param Type[] $typeMap + * + * @return Type[] + */ + public static function extractTypesFromDirectives(Directive $directive, array $typeMap = []) + { + if (is_array($directive->args)) { + foreach ($directive->args as $arg) { + $typeMap = self::extractTypes($arg->getType(), $typeMap); + } + } + + return $typeMap; + } + + /** + * @return (Type&InputType)|null + */ + public function getParentInputType() : ?InputType + { + return $this->inputTypeStack[count($this->inputTypeStack) - 2] ?? null; + } + + public function getArgument() : ?FieldArgument + { + return $this->argument; + } + + /** + * @return mixed + */ + public function getEnumValue() + { + return $this->enumValue; + } + + public function enter(Node $node) + { + $schema = $this->schema; + + // Note: many of the types below are explicitly typed as "mixed" to drop + // any assumptions of a valid schema to ensure runtime types are properly + // checked before continuing since TypeInfo is used as part of validation + // which occurs before guarantees of schema and document validity. + switch (true) { + case $node instanceof SelectionSetNode: + $namedType = Type::getNamedType($this->getType()); + $this->parentTypeStack[] = Type::isCompositeType($namedType) ? $namedType : null; + break; + + case $node instanceof FieldNode: + $parentType = $this->getParentType(); + $fieldDef = null; + if ($parentType) { + $fieldDef = self::getFieldDefinition($schema, $parentType, $node); + } + $fieldType = null; + if ($fieldDef) { + $fieldType = $fieldDef->getType(); + } + $this->fieldDefStack[] = $fieldDef; + $this->typeStack[] = Type::isOutputType($fieldType) ? $fieldType : null; + break; + + case $node instanceof DirectiveNode: + $this->directive = $schema->getDirective($node->name->value); + break; + + case $node instanceof OperationDefinitionNode: + $type = null; + if ($node->operation === 'query') { + $type = $schema->getQueryType(); + } elseif ($node->operation === 'mutation') { + $type = $schema->getMutationType(); + } elseif ($node->operation === 'subscription') { + $type = $schema->getSubscriptionType(); + } + $this->typeStack[] = Type::isOutputType($type) ? $type : null; + break; + + case $node instanceof InlineFragmentNode: + case $node instanceof FragmentDefinitionNode: + $typeConditionNode = $node->typeCondition; + $outputType = $typeConditionNode + ? self::typeFromAST( + $schema, + $typeConditionNode + ) + : Type::getNamedType($this->getType()); + $this->typeStack[] = Type::isOutputType($outputType) ? $outputType : null; + break; + + case $node instanceof VariableDefinitionNode: + $inputType = self::typeFromAST($schema, $node->type); + $this->inputTypeStack[] = Type::isInputType($inputType) ? $inputType : null; // push + break; + + case $node instanceof ArgumentNode: + $fieldOrDirective = $this->getDirective() ?? $this->getFieldDef(); + $argDef = $argType = null; + if ($fieldOrDirective) { + /** @var FieldArgument $argDef */ + $argDef = Utils::find( + $fieldOrDirective->args, + static function ($arg) use ($node) : bool { + return $arg->name === $node->name->value; + } + ); + if ($argDef !== null) { + $argType = $argDef->getType(); + } + } + $this->argument = $argDef; + $this->defaultValueStack[] = $argDef && $argDef->defaultValueExists() ? $argDef->defaultValue : Utils::undefined(); + $this->inputTypeStack[] = Type::isInputType($argType) ? $argType : null; + break; + + case $node instanceof ListValueNode: + $type = $this->getInputType(); + $listType = $type === null ? null : Type::getNullableType($type); + $itemType = $listType instanceof ListOfType + ? $listType->getWrappedType() + : $listType; + // List positions never have a default value. + $this->defaultValueStack[] = Utils::undefined(); + $this->inputTypeStack[] = Type::isInputType($itemType) ? $itemType : null; + break; + + case $node instanceof ObjectFieldNode: + $objectType = Type::getNamedType($this->getInputType()); + $fieldType = null; + $inputField = null; + $inputFieldType = null; + if ($objectType instanceof InputObjectType) { + $tmp = $objectType->getFields(); + $inputField = $tmp[$node->name->value] ?? null; + $inputFieldType = $inputField ? $inputField->getType() : null; + } + $this->defaultValueStack[] = $inputField && $inputField->defaultValueExists() ? $inputField->defaultValue : Utils::undefined(); + $this->inputTypeStack[] = Type::isInputType($inputFieldType) ? $inputFieldType : null; + break; + + case $node instanceof EnumValueNode: + $enumType = Type::getNamedType($this->getInputType()); + $enumValue = null; + if ($enumType instanceof EnumType) { + $this->enumValue = $enumType->getValue($node->value); + } + $this->enumValue = $enumValue; + break; + } + } + + /** + * @return (Type & OutputType) | null + */ + public function getType() : ?OutputType + { + return $this->typeStack[count($this->typeStack) - 1] ?? null; + } + + /** + * @return (CompositeType & Type) | null + */ + public function getParentType() : ?CompositeType + { + return $this->parentTypeStack[count($this->parentTypeStack) - 1] ?? null; + } + + /** + * Not exactly the same as the executor's definition of getFieldDef, in this + * statically evaluated environment we do not always have an Object type, + * and need to handle Interface and Union types. + */ + private static function getFieldDefinition(Schema $schema, Type $parentType, FieldNode $fieldNode) : ?FieldDefinition + { + $name = $fieldNode->name->value; + $schemaMeta = Introspection::schemaMetaFieldDef(); + if ($name === $schemaMeta->name && $schema->getQueryType() === $parentType) { + return $schemaMeta; + } + + $typeMeta = Introspection::typeMetaFieldDef(); + if ($name === $typeMeta->name && $schema->getQueryType() === $parentType) { + return $typeMeta; + } + $typeNameMeta = Introspection::typeNameMetaFieldDef(); + if ($name === $typeNameMeta->name && $parentType instanceof CompositeType) { + return $typeNameMeta; + } + + if ($parentType instanceof ObjectType || + $parentType instanceof InterfaceType + ) { + return $parentType->findField($name); + } + + return null; + } + + /** + * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode + * + * @throws InvariantViolation + */ + public static function typeFromAST(Schema $schema, $inputTypeNode) : ?Type + { + return AST::typeFromAST($schema, $inputTypeNode); + } + + public function getDirective() : ?Directive + { + return $this->directive; + } + + public function getFieldDef() : ?FieldDefinition + { + return $this->fieldDefStack[count($this->fieldDefStack) - 1] ?? null; + } + + /** + * @return mixed|null + */ + public function getDefaultValue() + { + return $this->defaultValueStack[count($this->defaultValueStack) - 1] ?? null; + } + + /** + * @return (Type & InputType) | null + */ + public function getInputType() : ?InputType + { + return $this->inputTypeStack[count($this->inputTypeStack) - 1] ?? null; + } + + public function leave(Node $node) + { + switch (true) { + case $node instanceof SelectionSetNode: + array_pop($this->parentTypeStack); + break; + + case $node instanceof FieldNode: + array_pop($this->fieldDefStack); + array_pop($this->typeStack); + break; + + case $node instanceof DirectiveNode: + $this->directive = null; + break; + + case $node instanceof OperationDefinitionNode: + case $node instanceof InlineFragmentNode: + case $node instanceof FragmentDefinitionNode: + array_pop($this->typeStack); + break; + case $node instanceof VariableDefinitionNode: + array_pop($this->inputTypeStack); + break; + case $node instanceof ArgumentNode: + $this->argument = null; + array_pop($this->defaultValueStack); + array_pop($this->inputTypeStack); + break; + case $node instanceof ListValueNode: + case $node instanceof ObjectFieldNode: + array_pop($this->defaultValueStack); + array_pop($this->inputTypeStack); + break; + case $node instanceof EnumValueNode: + $this->enumValue = null; + break; + } + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Utils.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Utils.php new file mode 100644 index 00000000..5811ac0a --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Utils.php @@ -0,0 +1,658 @@ + $value) { + if (! property_exists($obj, $key)) { + $cls = get_class($obj); + Warning::warn( + sprintf("Trying to set non-existing property '%s' on class '%s'", $key, $cls), + Warning::WARNING_ASSIGN + ); + } + $obj->{$key} = $value; + } + + return $obj; + } + + /** + * @param iterable $iterable + * + * @return mixed|null + */ + public static function find($iterable, callable $predicate) + { + self::invariant( + is_array($iterable) || $iterable instanceof Traversable, + __METHOD__ . ' expects array or Traversable' + ); + + foreach ($iterable as $key => $value) { + if ($predicate($value, $key)) { + return $value; + } + } + + return null; + } + + /** + * @param iterable $iterable + * + * @return array + * + * @throws Exception + */ + public static function filter($iterable, callable $predicate) : array + { + self::invariant( + is_array($iterable) || $iterable instanceof Traversable, + __METHOD__ . ' expects array or Traversable' + ); + + $result = []; + $assoc = false; + foreach ($iterable as $key => $value) { + if (! $assoc && ! is_int($key)) { + $assoc = true; + } + if (! $predicate($value, $key)) { + continue; + } + + $result[$key] = $value; + } + + return $assoc ? $result : array_values($result); + } + + /** + * @param iterable $iterable + * + * @return array + * + * @throws Exception + */ + public static function map($iterable, callable $fn) : array + { + self::invariant( + is_array($iterable) || $iterable instanceof Traversable, + __METHOD__ . ' expects array or Traversable' + ); + + $map = []; + foreach ($iterable as $key => $value) { + $map[$key] = $fn($value, $key); + } + + return $map; + } + + /** + * @param iterable $iterable + * + * @return array + * + * @throws Exception + */ + public static function mapKeyValue($iterable, callable $fn) : array + { + self::invariant( + is_array($iterable) || $iterable instanceof Traversable, + __METHOD__ . ' expects array or Traversable' + ); + + $map = []; + foreach ($iterable as $key => $value) { + [$newKey, $newValue] = $fn($value, $key); + $map[$newKey] = $newValue; + } + + return $map; + } + + /** + * @param iterable $iterable + * + * @return array + * + * @throws Exception + */ + public static function keyMap($iterable, callable $keyFn) : array + { + self::invariant( + is_array($iterable) || $iterable instanceof Traversable, + __METHOD__ . ' expects array or Traversable' + ); + + $map = []; + foreach ($iterable as $key => $value) { + $newKey = $keyFn($value, $key); + if (! is_scalar($newKey)) { + continue; + } + + $map[$newKey] = $value; + } + + return $map; + } + + /** + * @param iterable $iterable + */ + public static function each($iterable, callable $fn) : void + { + self::invariant( + is_array($iterable) || $iterable instanceof Traversable, + __METHOD__ . ' expects array or Traversable' + ); + + foreach ($iterable as $key => $item) { + $fn($item, $key); + } + } + + /** + * Splits original iterable to several arrays with keys equal to $keyFn return + * + * E.g. Utils::groupBy([1, 2, 3, 4, 5], function($value) {return $value % 3}) will output: + * [ + * 1 => [1, 4], + * 2 => [2, 5], + * 0 => [3], + * ] + * + * $keyFn is also allowed to return array of keys. Then value will be added to all arrays with given keys + * + * @param iterable $iterable + * + * @return array> + */ + public static function groupBy($iterable, callable $keyFn) : array + { + self::invariant( + is_array($iterable) || $iterable instanceof Traversable, + __METHOD__ . ' expects array or Traversable' + ); + + $grouped = []; + foreach ($iterable as $key => $value) { + $newKeys = (array) $keyFn($value, $key); + foreach ($newKeys as $newKey) { + $grouped[$newKey][] = $value; + } + } + + return $grouped; + } + + /** + * @param iterable $iterable + * + * @return array + */ + public static function keyValMap($iterable, callable $keyFn, callable $valFn) : array + { + $map = []; + foreach ($iterable as $item) { + $map[$keyFn($item)] = $valFn($item); + } + + return $map; + } + + /** + * @param iterable $iterable + */ + public static function every($iterable, callable $predicate) : bool + { + foreach ($iterable as $key => $value) { + if (! $predicate($value, $key)) { + return false; + } + } + + return true; + } + + /** + * @param iterable $iterable + */ + public static function some($iterable, callable $predicate) : bool + { + foreach ($iterable as $key => $value) { + if ($predicate($value, $key)) { + return true; + } + } + + return false; + } + + /** + * @param bool $test + * @param string $message + */ + public static function invariant($test, $message = '') + { + if (! $test) { + if (func_num_args() > 2) { + $args = func_get_args(); + array_shift($args); + $message = sprintf(...$args); + } + // TODO switch to Error here + throw new InvariantViolation($message); + } + } + + /** + * @param Type|mixed $var + * + * @return string + */ + public static function getVariableType($var) + { + if ($var instanceof Type) { + // FIXME: Replace with schema printer call + if ($var instanceof WrappingType) { + $var = $var->getWrappedType(true); + } + + return $var->name; + } + + return is_object($var) ? get_class($var) : gettype($var); + } + + /** + * @param mixed $var + * + * @return string + */ + public static function printSafeJson($var) + { + if ($var instanceof stdClass) { + $var = (array) $var; + } + if (is_array($var)) { + return json_encode($var); + } + if ($var === '') { + return '(empty string)'; + } + if ($var === null) { + return 'null'; + } + if ($var === false) { + return 'false'; + } + if ($var === true) { + return 'true'; + } + if (is_string($var)) { + return sprintf('"%s"', $var); + } + if (is_scalar($var)) { + return (string) $var; + } + + return gettype($var); + } + + /** + * @param Type|mixed $var + * + * @return string + */ + public static function printSafe($var) + { + if ($var instanceof Type) { + return $var->toString(); + } + if (is_object($var)) { + if (method_exists($var, '__toString')) { + return (string) $var; + } + + return 'instance of ' . get_class($var); + } + if (is_array($var)) { + return json_encode($var); + } + if ($var === '') { + return '(empty string)'; + } + if ($var === null) { + return 'null'; + } + if ($var === false) { + return 'false'; + } + if ($var === true) { + return 'true'; + } + if (is_string($var)) { + return $var; + } + if (is_scalar($var)) { + return (string) $var; + } + + return gettype($var); + } + + /** + * UTF-8 compatible chr() + * + * @param string $ord + * @param string $encoding + * + * @return string + */ + public static function chr($ord, $encoding = 'UTF-8') + { + if ($encoding === 'UCS-4BE') { + return pack('N', $ord); + } + + return mb_convert_encoding(self::chr($ord, 'UCS-4BE'), $encoding, 'UCS-4BE'); + } + + /** + * UTF-8 compatible ord() + * + * @param string $char + * @param string $encoding + * + * @return mixed + */ + public static function ord($char, $encoding = 'UTF-8') + { + if (! $char && $char !== '0') { + return 0; + } + if (! isset($char[1])) { + return ord($char); + } + if ($encoding !== 'UCS-4BE') { + $char = mb_convert_encoding($char, 'UCS-4BE', $encoding); + } + + return unpack('N', $char)[1]; + } + + /** + * Returns UTF-8 char code at given $positing of the $string + * + * @param string $string + * @param int $position + * + * @return mixed + */ + public static function charCodeAt($string, $position) + { + $char = mb_substr($string, $position, 1, 'UTF-8'); + + return self::ord($char); + } + + /** + * @param int|null $code + * + * @return string + */ + public static function printCharCode($code) + { + if ($code === null) { + return ''; + } + + return $code < 0x007F + // Trust JSON for ASCII. + ? json_encode(self::chr($code)) + // Otherwise print the escaped form. + : '"\\u' . dechex($code) . '"'; + } + + /** + * Upholds the spec rules about naming. + * + * @param string $name + * + * @throws Error + */ + public static function assertValidName($name) + { + $error = self::isValidNameError($name); + if ($error) { + throw $error; + } + } + + /** + * Returns an Error if a name is invalid. + * + * @param string $name + * @param Node|null $node + * + * @return Error|null + */ + public static function isValidNameError($name, $node = null) + { + self::invariant(is_string($name), 'Expected string'); + + if (isset($name[1]) && $name[0] === '_' && $name[1] === '_') { + return new Error( + sprintf('Name "%s" must not begin with "__", which is reserved by ', $name) . + 'GraphQL introspection.', + $node + ); + } + + if (! preg_match('/^[_a-zA-Z][_a-zA-Z0-9]*$/', $name)) { + return new Error( + sprintf('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "%s" does not.', $name), + $node + ); + } + + return null; + } + + /** + * Wraps original callable with PHP error handling (using set_error_handler). + * Resulting callable will collect all PHP errors that occur during the call in $errors array. + * + * @param ErrorException[] $errors + * + * @return callable + */ + public static function withErrorHandling(callable $fn, array &$errors) + { + return static function () use ($fn, &$errors) { + // Catch custom errors (to report them in query results) + set_error_handler(static function ($severity, $message, $file, $line) use (&$errors) : void { + $errors[] = new ErrorException($message, 0, $severity, $file, $line); + }); + + try { + return $fn(); + } finally { + restore_error_handler(); + } + }; + } + + /** + * @param string[] $items + * + * @return string + */ + public static function quotedOrList(array $items) + { + $items = array_map( + static function ($item) : string { + return sprintf('"%s"', $item); + }, + $items + ); + + return self::orList($items); + } + + /** + * @param string[] $items + * + * @return string + */ + public static function orList(array $items) + { + if (count($items) === 0) { + throw new LogicException('items must not need to be empty.'); + } + $selected = array_slice($items, 0, 5); + $selectedLength = count($selected); + $firstSelected = $selected[0]; + + if ($selectedLength === 1) { + return $firstSelected; + } + + return array_reduce( + range(1, $selectedLength - 1), + static function ($list, $index) use ($selected, $selectedLength) : string { + return $list . + ($selectedLength > 2 ? ', ' : ' ') . + ($index === $selectedLength - 1 ? 'or ' : '') . + $selected[$index]; + }, + $firstSelected + ); + } + + /** + * Given an invalid input string and a list of valid options, returns a filtered + * list of valid options sorted based on their similarity with the input. + * + * Includes a custom alteration from Damerau-Levenshtein to treat case changes + * as a single edit which helps identify mis-cased values with an edit distance + * of 1 + * + * @param string $input + * @param string[] $options + * + * @return string[] + */ + public static function suggestionList($input, array $options) + { + $optionsByDistance = []; + $threshold = mb_strlen($input) * 0.4 + 1; + foreach ($options as $option) { + if ($input === $option) { + $distance = 0; + } else { + $distance = (strtolower($input) === strtolower($option) + ? 1 + : levenshtein($input, $option)); + } + if ($distance > $threshold) { + continue; + } + + $optionsByDistance[$option] = $distance; + } + + asort($optionsByDistance); + + return array_keys($optionsByDistance); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Value.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Value.php new file mode 100644 index 00000000..636abe22 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Value.php @@ -0,0 +1,311 @@ +getWrappedType(), $blameNode, $path); + } + + if ($value === null) { + // Explicitly return the value null. + return self::ofValue(null); + } + + if ($type instanceof ScalarType) { + // Scalars determine if a value is valid via parseValue(), which can + // throw to indicate failure. If it throws, maintain a reference to + // the original error. + try { + return self::ofValue($type->parseValue($value)); + } catch (Throwable $error) { + return self::ofErrors([ + self::coercionError( + sprintf('Expected type %s', $type->name), + $blameNode, + $path, + $error->getMessage(), + $error + ), + ]); + } + } + + if ($type instanceof EnumType) { + if (is_string($value)) { + $enumValue = $type->getValue($value); + if ($enumValue) { + return self::ofValue($enumValue->value); + } + } + + $suggestions = Utils::suggestionList( + Utils::printSafe($value), + array_map( + static function ($enumValue) : string { + return $enumValue->name; + }, + $type->getValues() + ) + ); + + $didYouMean = $suggestions + ? 'did you mean ' . Utils::orList($suggestions) . '?' + : null; + + return self::ofErrors([ + self::coercionError( + sprintf('Expected type %s', $type->name), + $blameNode, + $path, + $didYouMean + ), + ]); + } + + if ($type instanceof ListOfType) { + $itemType = $type->getWrappedType(); + if (is_array($value) || $value instanceof Traversable) { + $errors = []; + $coercedValue = []; + foreach ($value as $index => $itemValue) { + $coercedItem = self::coerceValue( + $itemValue, + $itemType, + $blameNode, + self::atPath($path, $index) + ); + if ($coercedItem['errors']) { + $errors = self::add($errors, $coercedItem['errors']); + } else { + $coercedValue[] = $coercedItem['value']; + } + } + + return $errors ? self::ofErrors($errors) : self::ofValue($coercedValue); + } + // Lists accept a non-list value as a list of one. + $coercedItem = self::coerceValue($value, $itemType, $blameNode); + + return $coercedItem['errors'] ? $coercedItem : self::ofValue([$coercedItem['value']]); + } + + if ($type instanceof InputObjectType) { + if (! is_object($value) && ! is_array($value) && ! $value instanceof Traversable) { + return self::ofErrors([ + self::coercionError( + sprintf('Expected type %s to be an object', $type->name), + $blameNode, + $path + ), + ]); + } + + // Cast \stdClass to associative array before checking the fields. Note that the coerced value will be an array. + if ($value instanceof stdClass) { + $value = (array) $value; + } + + $errors = []; + $coercedValue = []; + $fields = $type->getFields(); + foreach ($fields as $fieldName => $field) { + if (array_key_exists($fieldName, $value)) { + $fieldValue = $value[$fieldName]; + $coercedField = self::coerceValue( + $fieldValue, + $field->getType(), + $blameNode, + self::atPath($path, $fieldName) + ); + if ($coercedField['errors']) { + $errors = self::add($errors, $coercedField['errors']); + } else { + $coercedValue[$fieldName] = $coercedField['value']; + } + } elseif ($field->defaultValueExists()) { + $coercedValue[$fieldName] = $field->defaultValue; + } elseif ($field->getType() instanceof NonNull) { + $fieldPath = self::printPath(self::atPath($path, $fieldName)); + $errors = self::add( + $errors, + self::coercionError( + sprintf( + 'Field %s of required type %s was not provided', + $fieldPath, + $field->getType()->toString() + ), + $blameNode + ) + ); + } + } + + // Ensure every provided field is defined. + foreach ($value as $fieldName => $field) { + if (array_key_exists($fieldName, $fields)) { + continue; + } + + $suggestions = Utils::suggestionList( + (string) $fieldName, + array_keys($fields) + ); + $didYouMean = $suggestions + ? 'did you mean ' . Utils::orList($suggestions) . '?' + : null; + $errors = self::add( + $errors, + self::coercionError( + sprintf('Field "%s" is not defined by type %s', $fieldName, $type->name), + $blameNode, + $path, + $didYouMean + ) + ); + } + + return $errors ? self::ofErrors($errors) : self::ofValue($coercedValue); + } + + throw new Error(sprintf('Unexpected type %s', $type->name)); + } + + private static function ofErrors($errors) + { + return ['errors' => $errors, 'value' => Utils::undefined()]; + } + + /** + * @param string $message + * @param Node $blameNode + * @param mixed[]|null $path + * @param string $subMessage + * @param Exception|Throwable|null $originalError + * + * @return Error + */ + private static function coercionError( + $message, + $blameNode, + ?array $path = null, + $subMessage = null, + $originalError = null + ) { + $pathStr = self::printPath($path); + + // Return a GraphQLError instance + return new Error( + $message . + ($pathStr ? ' at ' . $pathStr : '') . + ($subMessage ? '; ' . $subMessage : '.'), + $blameNode, + null, + [], + null, + $originalError + ); + } + + /** + * Build a string describing the path into the value where the error was found + * + * @param mixed[]|null $path + * + * @return string + */ + private static function printPath(?array $path = null) + { + $pathStr = ''; + $currentPath = $path; + while ($currentPath) { + $pathStr = + (is_string($currentPath['key']) + ? '.' . $currentPath['key'] + : '[' . $currentPath['key'] . ']') . $pathStr; + $currentPath = $currentPath['prev']; + } + + return $pathStr ? 'value' . $pathStr : ''; + } + + /** + * @param mixed $value + * + * @return (mixed|null)[] + */ + private static function ofValue($value) + { + return ['errors' => null, 'value' => $value]; + } + + /** + * @param mixed|null $prev + * @param mixed|null $key + * + * @return (mixed|null)[] + */ + private static function atPath($prev, $key) + { + return ['prev' => $prev, 'key' => $key]; + } + + /** + * @param Error[] $errors + * @param Error|Error[] $moreErrors + * + * @return Error[] + */ + private static function add($errors, $moreErrors) + { + return array_merge($errors, is_array($moreErrors) ? $moreErrors : [$moreErrors]); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ASTValidationContext.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ASTValidationContext.php new file mode 100644 index 00000000..0b1f1bc7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ASTValidationContext.php @@ -0,0 +1,54 @@ +ast = $ast; + $this->schema = $schema; + $this->errors = []; + } + + public function reportError(Error $error) + { + $this->errors[] = $error; + } + + /** + * @return Error[] + */ + public function getErrors() + { + return $this->errors; + } + + /** + * @return DocumentNode + */ + public function getDocument() + { + return $this->ast; + } + + public function getSchema() : ?Schema + { + return $this->schema; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php new file mode 100644 index 00000000..98a5871c --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php @@ -0,0 +1,361 @@ + new ExecutableDefinitions(), + UniqueOperationNames::class => new UniqueOperationNames(), + LoneAnonymousOperation::class => new LoneAnonymousOperation(), + SingleFieldSubscription::class => new SingleFieldSubscription(), + KnownTypeNames::class => new KnownTypeNames(), + FragmentsOnCompositeTypes::class => new FragmentsOnCompositeTypes(), + VariablesAreInputTypes::class => new VariablesAreInputTypes(), + ScalarLeafs::class => new ScalarLeafs(), + FieldsOnCorrectType::class => new FieldsOnCorrectType(), + UniqueFragmentNames::class => new UniqueFragmentNames(), + KnownFragmentNames::class => new KnownFragmentNames(), + NoUnusedFragments::class => new NoUnusedFragments(), + PossibleFragmentSpreads::class => new PossibleFragmentSpreads(), + NoFragmentCycles::class => new NoFragmentCycles(), + UniqueVariableNames::class => new UniqueVariableNames(), + NoUndefinedVariables::class => new NoUndefinedVariables(), + NoUnusedVariables::class => new NoUnusedVariables(), + KnownDirectives::class => new KnownDirectives(), + UniqueDirectivesPerLocation::class => new UniqueDirectivesPerLocation(), + KnownArgumentNames::class => new KnownArgumentNames(), + UniqueArgumentNames::class => new UniqueArgumentNames(), + ValuesOfCorrectType::class => new ValuesOfCorrectType(), + ProvidedRequiredArguments::class => new ProvidedRequiredArguments(), + VariablesInAllowedPosition::class => new VariablesInAllowedPosition(), + OverlappingFieldsCanBeMerged::class => new OverlappingFieldsCanBeMerged(), + UniqueInputFieldNames::class => new UniqueInputFieldNames(), + ]; + } + + return self::$defaultRules; + } + + /** + * @return QuerySecurityRule[] + */ + public static function securityRules() + { + // This way of defining rules is deprecated + // When custom security rule is required - it should be just added via DocumentValidator::addRule(); + // TODO: deprecate this + + if (self::$securityRules === null) { + self::$securityRules = [ + DisableIntrospection::class => new DisableIntrospection(DisableIntrospection::DISABLED), // DEFAULT DISABLED + QueryDepth::class => new QueryDepth(QueryDepth::DISABLED), // default disabled + QueryComplexity::class => new QueryComplexity(QueryComplexity::DISABLED), // default disabled + ]; + } + + return self::$securityRules; + } + + public static function sdlRules() + { + if (self::$sdlRules === null) { + self::$sdlRules = [ + LoneSchemaDefinition::class => new LoneSchemaDefinition(), + KnownDirectives::class => new KnownDirectives(), + KnownArgumentNamesOnDirectives::class => new KnownArgumentNamesOnDirectives(), + UniqueDirectivesPerLocation::class => new UniqueDirectivesPerLocation(), + UniqueArgumentNames::class => new UniqueArgumentNames(), + UniqueInputFieldNames::class => new UniqueInputFieldNames(), + ProvidedRequiredArgumentsOnDirectives::class => new ProvidedRequiredArgumentsOnDirectives(), + ]; + } + + return self::$sdlRules; + } + + /** + * This uses a specialized visitor which runs multiple visitors in parallel, + * while maintaining the visitor skip and break API. + * + * @param ValidationRule[] $rules + * + * @return Error[] + */ + public static function visitUsingRules(Schema $schema, TypeInfo $typeInfo, DocumentNode $documentNode, array $rules) + { + $context = new ValidationContext($schema, $documentNode, $typeInfo); + $visitors = []; + foreach ($rules as $rule) { + $visitors[] = $rule->getVisitor($context); + } + Visitor::visit($documentNode, Visitor::visitWithTypeInfo($typeInfo, Visitor::visitInParallel($visitors))); + + return $context->getErrors(); + } + + /** + * Returns global validation rule by name. Standard rules are named by class name, so + * example usage for such rules: + * + * $rule = DocumentValidator::getRule(GraphQL\Validator\Rules\QueryComplexity::class); + * + * @param string $name + * + * @return ValidationRule + * + * @api + */ + public static function getRule($name) + { + $rules = static::allRules(); + + if (isset($rules[$name])) { + return $rules[$name]; + } + + $name = sprintf('GraphQL\\Validator\\Rules\\%s', $name); + + return $rules[$name] ?? null; + } + + /** + * Add rule to list of global validation rules + * + * @api + */ + public static function addRule(ValidationRule $rule) + { + self::$rules[$rule->getName()] = $rule; + } + + public static function isError($value) + { + return is_array($value) + ? count(array_filter( + $value, + static function ($item) : bool { + return $item instanceof Throwable; + } + )) === count($value) + : $value instanceof Throwable; + } + + public static function append(&$arr, $items) + { + if (is_array($items)) { + $arr = array_merge($arr, $items); + } else { + $arr[] = $items; + } + + return $arr; + } + + /** + * Utility which determines if a value literal node is valid for an input type. + * + * Deprecated. Rely on validation for documents co + * ntaining literal values. + * + * @deprecated + * + * @return Error[] + */ + public static function isValidLiteralValue(Type $type, $valueNode) + { + $emptySchema = new Schema([]); + $emptyDoc = new DocumentNode(['definitions' => []]); + $typeInfo = new TypeInfo($emptySchema, $type); + $context = new ValidationContext($emptySchema, $emptyDoc, $typeInfo); + $validator = new ValuesOfCorrectType(); + $visitor = $validator->getVisitor($context); + Visitor::visit($valueNode, Visitor::visitWithTypeInfo($typeInfo, $visitor)); + + return $context->getErrors(); + } + + /** + * @param ValidationRule[]|null $rules + * + * @return Error[] + * + * @throws Exception + */ + public static function validateSDL( + DocumentNode $documentAST, + ?Schema $schemaToExtend = null, + ?array $rules = null + ) { + $usedRules = $rules ?? self::sdlRules(); + $context = new SDLValidationContext($documentAST, $schemaToExtend); + $visitors = []; + foreach ($usedRules as $rule) { + $visitors[] = $rule->getSDLVisitor($context); + } + Visitor::visit($documentAST, Visitor::visitInParallel($visitors)); + + return $context->getErrors(); + } + + public static function assertValidSDL(DocumentNode $documentAST) + { + $errors = self::validateSDL($documentAST); + if (count($errors) > 0) { + throw new Error(self::combineErrorMessages($errors)); + } + } + + public static function assertValidSDLExtension(DocumentNode $documentAST, Schema $schema) + { + $errors = self::validateSDL($documentAST, $schema); + if (count($errors) > 0) { + throw new Error(self::combineErrorMessages($errors)); + } + } + + /** + * @param Error[] $errors + */ + private static function combineErrorMessages(array $errors) : string + { + $str = ''; + foreach ($errors as $error) { + $str .= ($error->getMessage() . "\n\n"); + } + + return $str; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php new file mode 100644 index 00000000..83101a1d --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php @@ -0,0 +1,30 @@ +name = $name; + $this->visitorFn = $visitorFn; + } + + /** + * @return Error[] + */ + public function getVisitor(ValidationContext $context) + { + $fn = $this->visitorFn; + + return $fn($context); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php new file mode 100644 index 00000000..01a93183 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php @@ -0,0 +1,57 @@ +setEnabled($enabled); + } + + public function setEnabled($enabled) + { + $this->isEnabled = $enabled; + } + + public function getVisitor(ValidationContext $context) + { + return $this->invokeIfNeeded( + $context, + [ + NodeKind::FIELD => static function (FieldNode $node) use ($context) : void { + if ($node->name->value !== '__type' && $node->name->value !== '__schema') { + return; + } + + $context->reportError(new Error( + static::introspectionDisabledMessage(), + [$node] + )); + }, + ] + ); + } + + public static function introspectionDisabledMessage() + { + return 'GraphQL introspection is not allowed, but the query contained __schema or __type'; + } + + protected function isEnabled() + { + return $this->isEnabled !== self::DISABLED; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php new file mode 100644 index 00000000..5966df7e --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php @@ -0,0 +1,50 @@ + static function (DocumentNode $node) use ($context) : VisitorOperation { + /** @var ExecutableDefinitionNode|TypeSystemDefinitionNode $definition */ + foreach ($node->definitions as $definition) { + if ($definition instanceof ExecutableDefinitionNode) { + continue; + } + + $context->reportError(new Error( + self::nonExecutableDefinitionMessage($definition->name->value), + [$definition->name] + )); + } + + return Visitor::skipNode(); + }, + ]; + } + + public static function nonExecutableDefinitionMessage($defName) + { + return sprintf('The "%s" definition is not executable.', $defName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php new file mode 100644 index 00000000..3d7013c8 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php @@ -0,0 +1,166 @@ + function (FieldNode $node) use ($context) : void { + $type = $context->getParentType(); + if (! $type) { + return; + } + + $fieldDef = $context->getFieldDef(); + if ($fieldDef) { + return; + } + + // This isn't valid. Let's find suggestions, if any. + $schema = $context->getSchema(); + $fieldName = $node->name->value; + // First determine if there are any suggested types to condition on. + $suggestedTypeNames = $this->getSuggestedTypeNames( + $schema, + $type, + $fieldName + ); + // If there are no suggested types, then perhaps this was a typo? + $suggestedFieldNames = $suggestedTypeNames + ? [] + : $this->getSuggestedFieldNames( + $schema, + $type, + $fieldName + ); + + // Report an error, including helpful suggestions. + $context->reportError(new Error( + static::undefinedFieldMessage( + $node->name->value, + $type->name, + $suggestedTypeNames, + $suggestedFieldNames + ), + [$node] + )); + }, + ]; + } + + /** + * Go through all of the implementations of type, as well as the interfaces + * that they implement. If any of those types include the provided field, + * suggest them, sorted by how often the type is referenced, starting + * with Interfaces. + * + * @param ObjectType|InterfaceType $type + * @param string $fieldName + * + * @return string[] + */ + private function getSuggestedTypeNames(Schema $schema, $type, $fieldName) + { + if (Type::isAbstractType($type)) { + $suggestedObjectTypes = []; + $interfaceUsageCount = []; + + foreach ($schema->getPossibleTypes($type) as $possibleType) { + if (! $possibleType->hasField($fieldName)) { + continue; + } + // This object type defines this field. + $suggestedObjectTypes[] = $possibleType->name; + foreach ($possibleType->getInterfaces() as $possibleInterface) { + if (! $possibleInterface->hasField($fieldName)) { + continue; + } + // This interface type defines this field. + $interfaceUsageCount[$possibleInterface->name] = + ! isset($interfaceUsageCount[$possibleInterface->name]) + ? 0 + : $interfaceUsageCount[$possibleInterface->name] + 1; + } + } + + // Suggest interface types based on how common they are. + arsort($interfaceUsageCount); + $suggestedInterfaceTypes = array_keys($interfaceUsageCount); + + // Suggest both interface and object types. + return array_merge($suggestedInterfaceTypes, $suggestedObjectTypes); + } + + // Otherwise, must be an Object type, which does not have possible fields. + return []; + } + + /** + * For the field name provided, determine if there are any similar field names + * that may be the result of a typo. + * + * @param ObjectType|InterfaceType $type + * @param string $fieldName + * + * @return array|string[] + */ + private function getSuggestedFieldNames(Schema $schema, $type, $fieldName) + { + if ($type instanceof ObjectType || $type instanceof InterfaceType) { + $possibleFieldNames = $type->getFieldNames(); + + return Utils::suggestionList($fieldName, $possibleFieldNames); + } + + // Otherwise, must be a Union type, which does not define fields. + return []; + } + + /** + * @param string $fieldName + * @param string $type + * @param string[] $suggestedTypeNames + * @param string[] $suggestedFieldNames + * + * @return string + */ + public static function undefinedFieldMessage( + $fieldName, + $type, + array $suggestedTypeNames, + array $suggestedFieldNames + ) { + $message = sprintf('Cannot query field "%s" on type "%s".', $fieldName, $type); + + if ($suggestedTypeNames) { + $suggestions = Utils::quotedOrList($suggestedTypeNames); + + $message .= sprintf(' Did you mean to use an inline fragment on %s?', $suggestions); + } elseif (count($suggestedFieldNames) > 0) { + $suggestions = Utils::quotedOrList($suggestedFieldNames); + + $message .= sprintf(' Did you mean %s?', $suggestions); + } + + return $message; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php new file mode 100644 index 00000000..db72a057 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php @@ -0,0 +1,64 @@ + static function (InlineFragmentNode $node) use ($context) : void { + if (! $node->typeCondition) { + return; + } + + $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); + if (! $type || Type::isCompositeType($type)) { + return; + } + + $context->reportError(new Error( + static::inlineFragmentOnNonCompositeErrorMessage($type), + [$node->typeCondition] + )); + }, + NodeKind::FRAGMENT_DEFINITION => static function (FragmentDefinitionNode $node) use ($context) : void { + $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); + + if (! $type || Type::isCompositeType($type)) { + return; + } + + $context->reportError(new Error( + static::fragmentOnNonCompositeErrorMessage( + $node->name->value, + Printer::doPrint($node->typeCondition) + ), + [$node->typeCondition] + )); + }, + ]; + } + + public static function inlineFragmentOnNonCompositeErrorMessage($type) + { + return sprintf('Fragment cannot condition on non composite type "%s".', $type); + } + + public static function fragmentOnNonCompositeErrorMessage($fragName, $type) + { + return sprintf('Fragment "%s" cannot condition on non composite type "%s".', $fragName, $type); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php new file mode 100644 index 00000000..d3013797 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php @@ -0,0 +1,80 @@ +getVisitor($context) + [ + NodeKind::ARGUMENT => static function (ArgumentNode $node) use ($context) : void { + $argDef = $context->getArgument(); + if ($argDef !== null) { + return; + } + + $fieldDef = $context->getFieldDef(); + $parentType = $context->getParentType(); + if ($fieldDef === null || ! ($parentType instanceof Type)) { + return; + } + + $context->reportError(new Error( + self::unknownArgMessage( + $node->name->value, + $fieldDef->name, + $parentType->name, + Utils::suggestionList( + $node->name->value, + array_map( + static function ($arg) : string { + return $arg->name; + }, + $fieldDef->args + ) + ) + ), + [$node] + )); + + return; + }, + ]; + } + + /** + * @param string[] $suggestedArgs + */ + public static function unknownArgMessage($argName, $fieldName, $typeName, array $suggestedArgs) + { + $message = sprintf('Unknown argument "%s" on field "%s" of type "%s".', $argName, $fieldName, $typeName); + if (isset($suggestedArgs[0])) { + $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs)); + } + + return $message; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php new file mode 100644 index 00000000..bdde5d36 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php @@ -0,0 +1,115 @@ +getASTVisitor($context); + } + + public function getVisitor(ValidationContext $context) + { + return $this->getASTVisitor($context); + } + + public function getASTVisitor(ASTValidationContext $context) + { + $directiveArgs = []; + $schema = $context->getSchema(); + $definedDirectives = $schema !== null ? $schema->getDirectives() : Directive::getInternalDirectives(); + + foreach ($definedDirectives as $directive) { + $directiveArgs[$directive->name] = array_map( + static function (FieldArgument $arg) : string { + return $arg->name; + }, + $directive->args + ); + } + + $astDefinitions = $context->getDocument()->definitions; + foreach ($astDefinitions as $def) { + if (! ($def instanceof DirectiveDefinitionNode)) { + continue; + } + + $name = $def->name->value; + if ($def->arguments !== null) { + $directiveArgs[$name] = Utils::map( + $def->arguments ?? [], + static function (InputValueDefinitionNode $arg) : string { + return $arg->name->value; + } + ); + } else { + $directiveArgs[$name] = []; + } + } + + return [ + NodeKind::DIRECTIVE => static function (DirectiveNode $directiveNode) use ($directiveArgs, $context) : VisitorOperation { + $directiveName = $directiveNode->name->value; + $knownArgs = $directiveArgs[$directiveName] ?? null; + + if ($directiveNode->arguments === null || $knownArgs === null) { + return Visitor::skipNode(); + } + + foreach ($directiveNode->arguments as $argNode) { + $argName = $argNode->name->value; + if (in_array($argName, $knownArgs, true)) { + continue; + } + + $suggestions = Utils::suggestionList($argName, $knownArgs); + $context->reportError(new Error( + self::unknownDirectiveArgMessage($argName, $directiveName, $suggestions), + [$argNode] + )); + } + + return Visitor::skipNode(); + }, + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php new file mode 100644 index 00000000..758e8611 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php @@ -0,0 +1,200 @@ +getASTVisitor($context); + } + + public function getSDLVisitor(SDLValidationContext $context) + { + return $this->getASTVisitor($context); + } + + public function getASTVisitor(ASTValidationContext $context) + { + $locationsMap = []; + $schema = $context->getSchema(); + $definedDirectives = $schema + ? $schema->getDirectives() + : Directive::getInternalDirectives(); + + foreach ($definedDirectives as $directive) { + $locationsMap[$directive->name] = $directive->locations; + } + + $astDefinition = $context->getDocument()->definitions; + + foreach ($astDefinition as $def) { + if (! ($def instanceof DirectiveDefinitionNode)) { + continue; + } + + $locationsMap[$def->name->value] = Utils::map( + $def->locations, + static function ($name) : string { + return $name->value; + } + ); + } + + return [ + NodeKind::DIRECTIVE => function ( + DirectiveNode $node, + $key, + $parent, + $path, + $ancestors + ) use ( + $context, + $locationsMap + ) : void { + $name = $node->name->value; + $locations = $locationsMap[$name] ?? null; + + if (! $locations) { + $context->reportError(new Error( + self::unknownDirectiveMessage($name), + [$node] + )); + + return; + } + + $candidateLocation = $this->getDirectiveLocationForASTPath($ancestors); + + if (! $candidateLocation || in_array($candidateLocation, $locations, true)) { + return; + } + $context->reportError( + new Error( + self::misplacedDirectiveMessage($name, $candidateLocation), + [$node] + ) + ); + }, + ]; + } + + public static function unknownDirectiveMessage($directiveName) + { + return sprintf('Unknown directive "%s".', $directiveName); + } + + /** + * @param Node[]|NodeList[] $ancestors The type is actually (Node|NodeList)[] but this PSR-5 syntax is so far not supported by most of the tools + * + * @return string + */ + private function getDirectiveLocationForASTPath(array $ancestors) + { + $appliedTo = $ancestors[count($ancestors) - 1]; + switch (true) { + case $appliedTo instanceof OperationDefinitionNode: + switch ($appliedTo->operation) { + case 'query': + return DirectiveLocation::QUERY; + case 'mutation': + return DirectiveLocation::MUTATION; + case 'subscription': + return DirectiveLocation::SUBSCRIPTION; + } + break; + case $appliedTo instanceof FieldNode: + return DirectiveLocation::FIELD; + case $appliedTo instanceof FragmentSpreadNode: + return DirectiveLocation::FRAGMENT_SPREAD; + case $appliedTo instanceof InlineFragmentNode: + return DirectiveLocation::INLINE_FRAGMENT; + case $appliedTo instanceof FragmentDefinitionNode: + return DirectiveLocation::FRAGMENT_DEFINITION; + case $appliedTo instanceof VariableDefinitionNode: + return DirectiveLocation::VARIABLE_DEFINITION; + case $appliedTo instanceof SchemaDefinitionNode: + case $appliedTo instanceof SchemaTypeExtensionNode: + return DirectiveLocation::SCHEMA; + case $appliedTo instanceof ScalarTypeDefinitionNode: + case $appliedTo instanceof ScalarTypeExtensionNode: + return DirectiveLocation::SCALAR; + case $appliedTo instanceof ObjectTypeDefinitionNode: + case $appliedTo instanceof ObjectTypeExtensionNode: + return DirectiveLocation::OBJECT; + case $appliedTo instanceof FieldDefinitionNode: + return DirectiveLocation::FIELD_DEFINITION; + case $appliedTo instanceof InterfaceTypeDefinitionNode: + case $appliedTo instanceof InterfaceTypeExtensionNode: + return DirectiveLocation::IFACE; + case $appliedTo instanceof UnionTypeDefinitionNode: + case $appliedTo instanceof UnionTypeExtensionNode: + return DirectiveLocation::UNION; + case $appliedTo instanceof EnumTypeDefinitionNode: + case $appliedTo instanceof EnumTypeExtensionNode: + return DirectiveLocation::ENUM; + case $appliedTo instanceof EnumValueDefinitionNode: + return DirectiveLocation::ENUM_VALUE; + case $appliedTo instanceof InputObjectTypeDefinitionNode: + case $appliedTo instanceof InputObjectTypeExtensionNode: + return DirectiveLocation::INPUT_OBJECT; + case $appliedTo instanceof InputValueDefinitionNode: + $parentNode = $ancestors[count($ancestors) - 3]; + + return $parentNode instanceof InputObjectTypeDefinitionNode + ? DirectiveLocation::INPUT_FIELD_DEFINITION + : DirectiveLocation::ARGUMENT_DEFINITION; + } + + throw new Exception('Unknown directive location: ' . get_class($appliedTo)); + } + + public static function misplacedDirectiveMessage($directiveName, $location) + { + return sprintf('Directive "%s" may not be used on "%s".', $directiveName, $location); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php new file mode 100644 index 00000000..052686f2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php @@ -0,0 +1,40 @@ + static function (FragmentSpreadNode $node) use ($context) : void { + $fragmentName = $node->name->value; + $fragment = $context->getFragment($fragmentName); + if ($fragment) { + return; + } + + $context->reportError(new Error( + self::unknownFragmentMessage($fragmentName), + [$node->name] + )); + }, + ]; + } + + /** + * @param string $fragName + */ + public static function unknownFragmentMessage($fragName) + { + return sprintf('Unknown fragment "%s".', $fragName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php new file mode 100644 index 00000000..b852f523 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php @@ -0,0 +1,74 @@ + $skip, + NodeKind::INTERFACE_TYPE_DEFINITION => $skip, + NodeKind::UNION_TYPE_DEFINITION => $skip, + NodeKind::INPUT_OBJECT_TYPE_DEFINITION => $skip, + NodeKind::NAMED_TYPE => static function (NamedTypeNode $node) use ($context) : void { + $schema = $context->getSchema(); + $typeName = $node->name->value; + $type = $schema->getType($typeName); + if ($type !== null) { + return; + } + + $context->reportError(new Error( + self::unknownTypeMessage( + $typeName, + Utils::suggestionList($typeName, array_keys($schema->getTypeMap())) + ), + [$node] + )); + }, + ]; + } + + /** + * @param string $type + * @param string[] $suggestedTypes + */ + public static function unknownTypeMessage($type, array $suggestedTypes) + { + $message = sprintf('Unknown type "%s".', $type); + if (count($suggestedTypes) > 0) { + $suggestions = Utils::quotedOrList($suggestedTypes); + + $message .= sprintf(' Did you mean %s?', $suggestions); + } + + return $message; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php new file mode 100644 index 00000000..facc895a --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php @@ -0,0 +1,58 @@ + static function (DocumentNode $node) use (&$operationCount) : void { + $tmp = Utils::filter( + $node->definitions, + static function (Node $definition) : bool { + return $definition instanceof OperationDefinitionNode; + } + ); + + $operationCount = count($tmp); + }, + NodeKind::OPERATION_DEFINITION => static function (OperationDefinitionNode $node) use ( + &$operationCount, + $context + ) : void { + if ($node->name !== null || $operationCount <= 1) { + return; + } + + $context->reportError( + new Error(self::anonOperationNotAloneMessage(), [$node]) + ); + }, + ]; + } + + public static function anonOperationNotAloneMessage() + { + return 'This anonymous operation must be the only defined operation.'; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php new file mode 100644 index 00000000..4ece976b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php @@ -0,0 +1,59 @@ +getSchema(); + $alreadyDefined = $oldSchema !== null + ? ( + $oldSchema->getAstNode() !== null || + $oldSchema->getQueryType() !== null || + $oldSchema->getMutationType() !== null || + $oldSchema->getSubscriptionType() !== null + ) + : false; + + $schemaDefinitionsCount = 0; + + return [ + NodeKind::SCHEMA_DEFINITION => static function (SchemaDefinitionNode $node) use ($alreadyDefined, $context, &$schemaDefinitionsCount) : void { + if ($alreadyDefined !== false) { + $context->reportError(new Error(self::canNotDefineSchemaWithinExtensionMessage(), $node)); + + return; + } + + if ($schemaDefinitionsCount > 0) { + $context->reportError(new Error(self::schemaDefinitionNotAloneMessage(), $node)); + } + + ++$schemaDefinitionsCount; + }, + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php new file mode 100644 index 00000000..eec546de --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php @@ -0,0 +1,112 @@ +visitedFrags = []; + + // Array of AST nodes used to produce meaningful errors + $this->spreadPath = []; + + // Position in the spread path + $this->spreadPathIndexByName = []; + + return [ + NodeKind::OPERATION_DEFINITION => static function () : VisitorOperation { + return Visitor::skipNode(); + }, + NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) : VisitorOperation { + $this->detectCycleRecursive($node, $context); + + return Visitor::skipNode(); + }, + ]; + } + + private function detectCycleRecursive(FragmentDefinitionNode $fragment, ValidationContext $context) + { + if (isset($this->visitedFrags[$fragment->name->value])) { + return; + } + + $fragmentName = $fragment->name->value; + $this->visitedFrags[$fragmentName] = true; + + $spreadNodes = $context->getFragmentSpreads($fragment); + + if (count($spreadNodes) === 0) { + return; + } + + $this->spreadPathIndexByName[$fragmentName] = count($this->spreadPath); + + for ($i = 0; $i < count($spreadNodes); $i++) { + $spreadNode = $spreadNodes[$i]; + $spreadName = $spreadNode->name->value; + $cycleIndex = $this->spreadPathIndexByName[$spreadName] ?? null; + + $this->spreadPath[] = $spreadNode; + if ($cycleIndex === null) { + $spreadFragment = $context->getFragment($spreadName); + if ($spreadFragment) { + $this->detectCycleRecursive($spreadFragment, $context); + } + } else { + $cyclePath = array_slice($this->spreadPath, $cycleIndex); + $fragmentNames = Utils::map(array_slice($cyclePath, 0, -1), static function ($s) { + return $s->name->value; + }); + + $context->reportError(new Error( + self::cycleErrorMessage($spreadName, $fragmentNames), + $cyclePath + )); + } + array_pop($this->spreadPath); + } + + $this->spreadPathIndexByName[$fragmentName] = null; + } + + /** + * @param string[] $spreadNames + */ + public static function cycleErrorMessage($fragName, array $spreadNames = []) + { + return sprintf( + 'Cannot spread fragment "%s" within itself%s.', + $fragName, + count($spreadNames) > 0 ? ' via ' . implode(', ', $spreadNames) : '' + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php new file mode 100644 index 00000000..078990c7 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php @@ -0,0 +1,64 @@ + [ + 'enter' => static function () use (&$variableNameDefined) : void { + $variableNameDefined = []; + }, + 'leave' => static function (OperationDefinitionNode $operation) use (&$variableNameDefined, $context) : void { + $usages = $context->getRecursiveVariableUsages($operation); + + foreach ($usages as $usage) { + $node = $usage['node']; + $varName = $node->name->value; + + if ($variableNameDefined[$varName] ?? false) { + continue; + } + + $context->reportError(new Error( + self::undefinedVarMessage( + $varName, + $operation->name !== null + ? $operation->name->value + : null + ), + [$node, $operation] + )); + } + }, + ], + NodeKind::VARIABLE_DEFINITION => static function (VariableDefinitionNode $def) use (&$variableNameDefined) : void { + $variableNameDefined[$def->variable->name->value] = true; + }, + ]; + } + + public static function undefinedVarMessage($varName, $opName = null) + { + return $opName + ? sprintf('Variable "$%s" is not defined by operation "%s".', $varName, $opName) + : sprintf('Variable "$%s" is not defined.', $varName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php new file mode 100644 index 00000000..4315c547 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php @@ -0,0 +1,70 @@ +operationDefs = []; + $this->fragmentDefs = []; + + return [ + NodeKind::OPERATION_DEFINITION => function ($node) : VisitorOperation { + $this->operationDefs[] = $node; + + return Visitor::skipNode(); + }, + NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $def) : VisitorOperation { + $this->fragmentDefs[] = $def; + + return Visitor::skipNode(); + }, + NodeKind::DOCUMENT => [ + 'leave' => function () use ($context) : void { + $fragmentNameUsed = []; + + foreach ($this->operationDefs as $operation) { + foreach ($context->getRecursivelyReferencedFragments($operation) as $fragment) { + $fragmentNameUsed[$fragment->name->value] = true; + } + } + + foreach ($this->fragmentDefs as $fragmentDef) { + $fragName = $fragmentDef->name->value; + if ($fragmentNameUsed[$fragName] ?? false) { + continue; + } + + $context->reportError(new Error( + self::unusedFragMessage($fragName), + [$fragmentDef] + )); + } + }, + ], + ]; + } + + public static function unusedFragMessage($fragName) + { + return sprintf('Fragment "%s" is never used.', $fragName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php new file mode 100644 index 00000000..343a969b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php @@ -0,0 +1,66 @@ +variableDefs = []; + + return [ + NodeKind::OPERATION_DEFINITION => [ + 'enter' => function () : void { + $this->variableDefs = []; + }, + 'leave' => function (OperationDefinitionNode $operation) use ($context) : void { + $variableNameUsed = []; + $usages = $context->getRecursiveVariableUsages($operation); + $opName = $operation->name !== null + ? $operation->name->value + : null; + + foreach ($usages as $usage) { + $node = $usage['node']; + $variableNameUsed[$node->name->value] = true; + } + + foreach ($this->variableDefs as $variableDef) { + $variableName = $variableDef->variable->name->value; + + if ($variableNameUsed[$variableName] ?? false) { + continue; + } + + $context->reportError(new Error( + self::unusedVariableMessage($variableName, $opName), + [$variableDef] + )); + } + }, + ], + NodeKind::VARIABLE_DEFINITION => function ($def) : void { + $this->variableDefs[] = $def; + }, + ]; + } + + public static function unusedVariableMessage($varName, $opName = null) + { + return $opName + ? sprintf('Variable "$%s" is never used in operation "%s".', $varName, $opName) + : sprintf('Variable "$%s" is never used.', $varName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php new file mode 100644 index 00000000..63073139 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php @@ -0,0 +1,897 @@ +comparedFragmentPairs = new PairSet(); + $this->cachedFieldsAndFragmentNames = new SplObjectStorage(); + + return [ + NodeKind::SELECTION_SET => function (SelectionSetNode $selectionSet) use ($context) : void { + $conflicts = $this->findConflictsWithinSelectionSet( + $context, + $context->getParentType(), + $selectionSet + ); + + foreach ($conflicts as $conflict) { + [[$responseName, $reason], $fields1, $fields2] = $conflict; + + $context->reportError(new Error( + self::fieldsConflictMessage($responseName, $reason), + array_merge($fields1, $fields2) + )); + } + }, + ]; + } + + /** + * Find all conflicts found "within" a selection set, including those found + * via spreading in fragments. Called when visiting each SelectionSet in the + * GraphQL Document. + * + * @param CompositeType $parentType + * + * @return mixed[] + */ + private function findConflictsWithinSelectionSet( + ValidationContext $context, + $parentType, + SelectionSetNode $selectionSet + ) { + [$fieldMap, $fragmentNames] = $this->getFieldsAndFragmentNames( + $context, + $parentType, + $selectionSet + ); + + $conflicts = []; + + // (A) Find find all conflicts "within" the fields of this selection set. + // Note: this is the *only place* `collectConflictsWithin` is called. + $this->collectConflictsWithin( + $context, + $conflicts, + $fieldMap + ); + + $fragmentNamesLength = count($fragmentNames); + if ($fragmentNamesLength !== 0) { + // (B) Then collect conflicts between these fields and those represented by + // each spread fragment name found. + $comparedFragments = []; + for ($i = 0; $i < $fragmentNamesLength; $i++) { + $this->collectConflictsBetweenFieldsAndFragment( + $context, + $conflicts, + $comparedFragments, + false, + $fieldMap, + $fragmentNames[$i] + ); + // (C) Then compare this fragment with all other fragments found in this + // selection set to collect conflicts between fragments spread together. + // This compares each item in the list of fragment names to every other item + // in that same list (except for itself). + for ($j = $i + 1; $j < $fragmentNamesLength; $j++) { + $this->collectConflictsBetweenFragments( + $context, + $conflicts, + false, + $fragmentNames[$i], + $fragmentNames[$j] + ); + } + } + } + + return $conflicts; + } + + /** + * Given a selection set, return the collection of fields (a mapping of response + * name to field ASTs and definitions) as well as a list of fragment names + * referenced via fragment spreads. + * + * @param CompositeType $parentType + * + * @return mixed[]|SplObjectStorage + */ + private function getFieldsAndFragmentNames( + ValidationContext $context, + $parentType, + SelectionSetNode $selectionSet + ) { + if (isset($this->cachedFieldsAndFragmentNames[$selectionSet])) { + $cached = $this->cachedFieldsAndFragmentNames[$selectionSet]; + } else { + $astAndDefs = []; + $fragmentNames = []; + + $this->internalCollectFieldsAndFragmentNames( + $context, + $parentType, + $selectionSet, + $astAndDefs, + $fragmentNames + ); + $cached = [$astAndDefs, array_keys($fragmentNames)]; + $this->cachedFieldsAndFragmentNames[$selectionSet] = $cached; + } + + return $cached; + } + + /** + * Algorithm: + * + * Conflicts occur when two fields exist in a query which will produce the same + * response name, but represent differing values, thus creating a conflict. + * The algorithm below finds all conflicts via making a series of comparisons + * between fields. In order to compare as few fields as possible, this makes + * a series of comparisons "within" sets of fields and "between" sets of fields. + * + * Given any selection set, a collection produces both a set of fields by + * also including all inline fragments, as well as a list of fragments + * referenced by fragment spreads. + * + * A) Each selection set represented in the document first compares "within" its + * collected set of fields, finding any conflicts between every pair of + * overlapping fields. + * Note: This is the *only time* that a the fields "within" a set are compared + * to each other. After this only fields "between" sets are compared. + * + * B) Also, if any fragment is referenced in a selection set, then a + * comparison is made "between" the original set of fields and the + * referenced fragment. + * + * C) Also, if multiple fragments are referenced, then comparisons + * are made "between" each referenced fragment. + * + * D) When comparing "between" a set of fields and a referenced fragment, first + * a comparison is made between each field in the original set of fields and + * each field in the the referenced set of fields. + * + * E) Also, if any fragment is referenced in the referenced selection set, + * then a comparison is made "between" the original set of fields and the + * referenced fragment (recursively referring to step D). + * + * F) When comparing "between" two fragments, first a comparison is made between + * each field in the first referenced set of fields and each field in the the + * second referenced set of fields. + * + * G) Also, any fragments referenced by the first must be compared to the + * second, and any fragments referenced by the second must be compared to the + * first (recursively referring to step F). + * + * H) When comparing two fields, if both have selection sets, then a comparison + * is made "between" both selection sets, first comparing the set of fields in + * the first selection set with the set of fields in the second. + * + * I) Also, if any fragment is referenced in either selection set, then a + * comparison is made "between" the other set of fields and the + * referenced fragment. + * + * J) Also, if two fragments are referenced in both selection sets, then a + * comparison is made "between" the two fragments. + */ + + /** + * Given a reference to a fragment, return the represented collection of fields + * as well as a list of nested fragment names referenced via fragment spreads. + * + * @param CompositeType $parentType + * @param mixed[][][] $astAndDefs + * @param bool[] $fragmentNames + */ + private function internalCollectFieldsAndFragmentNames( + ValidationContext $context, + $parentType, + SelectionSetNode $selectionSet, + array &$astAndDefs, + array &$fragmentNames + ) { + foreach ($selectionSet->selections as $selection) { + switch (true) { + case $selection instanceof FieldNode: + $fieldName = $selection->name->value; + $fieldDef = null; + if ($parentType instanceof ObjectType || + $parentType instanceof InterfaceType + ) { + if ($parentType->hasField($fieldName)) { + $fieldDef = $parentType->getField($fieldName); + } + } + $responseName = $selection->alias ? $selection->alias->value : $fieldName; + + if (! isset($astAndDefs[$responseName])) { + $astAndDefs[$responseName] = []; + } + $astAndDefs[$responseName][] = [$parentType, $selection, $fieldDef]; + break; + case $selection instanceof FragmentSpreadNode: + $fragmentNames[$selection->name->value] = true; + break; + case $selection instanceof InlineFragmentNode: + $typeCondition = $selection->typeCondition; + $inlineFragmentType = $typeCondition + ? TypeInfo::typeFromAST($context->getSchema(), $typeCondition) + : $parentType; + + $this->internalCollectFieldsAndFragmentNames( + $context, + $inlineFragmentType, + $selection->selectionSet, + $astAndDefs, + $fragmentNames + ); + break; + } + } + } + + /** + * Collect all Conflicts "within" one collection of fields. + * + * @param mixed[][] $conflicts + * @param mixed[][] $fieldMap + */ + private function collectConflictsWithin( + ValidationContext $context, + array &$conflicts, + array $fieldMap + ) { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For every response name, if there are multiple fields, they + // must be compared to find a potential conflict. + foreach ($fieldMap as $responseName => $fields) { + // This compares every field in the list to every other field in this list + // (except to itself). If the list only has one item, nothing needs to + // be compared. + $fieldsLength = count($fields); + if ($fieldsLength <= 1) { + continue; + } + + for ($i = 0; $i < $fieldsLength; $i++) { + for ($j = $i + 1; $j < $fieldsLength; $j++) { + $conflict = $this->findConflict( + $context, + false, // within one collection is never mutually exclusive + $responseName, + $fields[$i], + $fields[$j] + ); + if (! $conflict) { + continue; + } + + $conflicts[] = $conflict; + } + } + } + } + + /** + * Determines if there is a conflict between two particular fields, including + * comparing their sub-fields. + * + * @param bool $parentFieldsAreMutuallyExclusive + * @param string $responseName + * @param mixed[] $field1 + * @param mixed[] $field2 + * + * @return mixed[]|null + */ + private function findConflict( + ValidationContext $context, + $parentFieldsAreMutuallyExclusive, + $responseName, + array $field1, + array $field2 + ) { + [$parentType1, $ast1, $def1] = $field1; + [$parentType2, $ast2, $def2] = $field2; + + // If it is known that two fields could not possibly apply at the same + // time, due to the parent types, then it is safe to permit them to diverge + // in aliased field or arguments used as they will not present any ambiguity + // by differing. + // It is known that two parent types could never overlap if they are + // different Object types. Interface or Union types might overlap - if not + // in the current state of the schema, then perhaps in some future version, + // thus may not safely diverge. + $areMutuallyExclusive = + $parentFieldsAreMutuallyExclusive || + ( + $parentType1 !== $parentType2 && + $parentType1 instanceof ObjectType && + $parentType2 instanceof ObjectType + ); + + // The return type for each field. + $type1 = $def1 === null ? null : $def1->getType(); + $type2 = $def2 === null ? null : $def2->getType(); + + if (! $areMutuallyExclusive) { + // Two aliases must refer to the same field. + $name1 = $ast1->name->value; + $name2 = $ast2->name->value; + if ($name1 !== $name2) { + return [ + [$responseName, sprintf('%s and %s are different fields', $name1, $name2)], + [$ast1], + [$ast2], + ]; + } + + if (! $this->sameArguments($ast1->arguments ?? [], $ast2->arguments ?? [])) { + return [ + [$responseName, 'they have differing arguments'], + [$ast1], + [$ast2], + ]; + } + } + + if ($type1 && $type2 && $this->doTypesConflict($type1, $type2)) { + return [ + [$responseName, sprintf('they return conflicting types %s and %s', $type1, $type2)], + [$ast1], + [$ast2], + ]; + } + + // Collect and compare sub-fields. Use the same "visited fragment names" list + // for both collections so fields in a fragment reference are never + // compared to themselves. + $selectionSet1 = $ast1->selectionSet; + $selectionSet2 = $ast2->selectionSet; + if ($selectionSet1 && $selectionSet2) { + $conflicts = $this->findConflictsBetweenSubSelectionSets( + $context, + $areMutuallyExclusive, + Type::getNamedType($type1), + $selectionSet1, + Type::getNamedType($type2), + $selectionSet2 + ); + + return $this->subfieldConflicts( + $conflicts, + $responseName, + $ast1, + $ast2 + ); + } + + return null; + } + + /** + * @param ArgumentNode[] $arguments1 + * @param ArgumentNode[] $arguments2 + * + * @return bool + */ + private function sameArguments($arguments1, $arguments2) + { + if (count($arguments1) !== count($arguments2)) { + return false; + } + foreach ($arguments1 as $argument1) { + $argument2 = null; + foreach ($arguments2 as $argument) { + if ($argument->name->value === $argument1->name->value) { + $argument2 = $argument; + break; + } + } + if (! $argument2) { + return false; + } + + if (! $this->sameValue($argument1->value, $argument2->value)) { + return false; + } + } + + return true; + } + + /** + * @return bool + */ + private function sameValue(Node $value1, Node $value2) + { + return (! $value1 && ! $value2) || (Printer::doPrint($value1) === Printer::doPrint($value2)); + } + + /** + * Two types conflict if both types could not apply to a value simultaneously. + * Composite types are ignored as their individual field types will be compared + * later recursively. However List and Non-Null types must match. + */ + private function doTypesConflict(Type $type1, Type $type2) : bool + { + if ($type1 instanceof ListOfType) { + return $type2 instanceof ListOfType + ? $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) + : true; + } + if ($type2 instanceof ListOfType) { + return $type1 instanceof ListOfType + ? $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) + : true; + } + if ($type1 instanceof NonNull) { + return $type2 instanceof NonNull + ? $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) + : true; + } + if ($type2 instanceof NonNull) { + return $type1 instanceof NonNull + ? $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) + : true; + } + if (Type::isLeafType($type1) || Type::isLeafType($type2)) { + return $type1 !== $type2; + } + + return false; + } + + /** + * Find all conflicts found between two selection sets, including those found + * via spreading in fragments. Called when determining if conflicts exist + * between the sub-fields of two overlapping fields. + * + * @param bool $areMutuallyExclusive + * @param CompositeType $parentType1 + * @param CompositeType $parentType2 + * + * @return mixed[][] + */ + private function findConflictsBetweenSubSelectionSets( + ValidationContext $context, + $areMutuallyExclusive, + $parentType1, + SelectionSetNode $selectionSet1, + $parentType2, + SelectionSetNode $selectionSet2 + ) { + $conflicts = []; + + [$fieldMap1, $fragmentNames1] = $this->getFieldsAndFragmentNames( + $context, + $parentType1, + $selectionSet1 + ); + [$fieldMap2, $fragmentNames2] = $this->getFieldsAndFragmentNames( + $context, + $parentType2, + $selectionSet2 + ); + + // (H) First, collect all conflicts between these two collections of field. + $this->collectConflictsBetween( + $context, + $conflicts, + $areMutuallyExclusive, + $fieldMap1, + $fieldMap2 + ); + + // (I) Then collect conflicts between the first collection of fields and + // those referenced by each fragment name associated with the second. + $fragmentNames2Length = count($fragmentNames2); + if ($fragmentNames2Length !== 0) { + $comparedFragments = []; + for ($j = 0; $j < $fragmentNames2Length; $j++) { + $this->collectConflictsBetweenFieldsAndFragment( + $context, + $conflicts, + $comparedFragments, + $areMutuallyExclusive, + $fieldMap1, + $fragmentNames2[$j] + ); + } + } + + // (I) Then collect conflicts between the second collection of fields and + // those referenced by each fragment name associated with the first. + $fragmentNames1Length = count($fragmentNames1); + if ($fragmentNames1Length !== 0) { + $comparedFragments = []; + for ($i = 0; $i < $fragmentNames1Length; $i++) { + $this->collectConflictsBetweenFieldsAndFragment( + $context, + $conflicts, + $comparedFragments, + $areMutuallyExclusive, + $fieldMap2, + $fragmentNames1[$i] + ); + } + } + + // (J) Also collect conflicts between any fragment names by the first and + // fragment names by the second. This compares each item in the first set of + // names to each item in the second set of names. + for ($i = 0; $i < $fragmentNames1Length; $i++) { + for ($j = 0; $j < $fragmentNames2Length; $j++) { + $this->collectConflictsBetweenFragments( + $context, + $conflicts, + $areMutuallyExclusive, + $fragmentNames1[$i], + $fragmentNames2[$j] + ); + } + } + + return $conflicts; + } + + /** + * Collect all Conflicts between two collections of fields. This is similar to, + * but different from the `collectConflictsWithin` function above. This check + * assumes that `collectConflictsWithin` has already been called on each + * provided collection of fields. This is true because this validator traverses + * each individual selection set. + * + * @param mixed[][] $conflicts + * @param bool $parentFieldsAreMutuallyExclusive + * @param mixed[] $fieldMap1 + * @param mixed[] $fieldMap2 + */ + private function collectConflictsBetween( + ValidationContext $context, + array &$conflicts, + $parentFieldsAreMutuallyExclusive, + array $fieldMap1, + array $fieldMap2 + ) { + // A field map is a keyed collection, where each key represents a response + // name and the value at that key is a list of all fields which provide that + // response name. For any response name which appears in both provided field + // maps, each field from the first field map must be compared to every field + // in the second field map to find potential conflicts. + foreach ($fieldMap1 as $responseName => $fields1) { + if (! isset($fieldMap2[$responseName])) { + continue; + } + + $fields2 = $fieldMap2[$responseName]; + $fields1Length = count($fields1); + $fields2Length = count($fields2); + for ($i = 0; $i < $fields1Length; $i++) { + for ($j = 0; $j < $fields2Length; $j++) { + $conflict = $this->findConflict( + $context, + $parentFieldsAreMutuallyExclusive, + $responseName, + $fields1[$i], + $fields2[$j] + ); + if (! $conflict) { + continue; + } + + $conflicts[] = $conflict; + } + } + } + } + + /** + * Collect all conflicts found between a set of fields and a fragment reference + * including via spreading in any nested fragments. + * + * @param mixed[][] $conflicts + * @param bool[] $comparedFragments + * @param bool $areMutuallyExclusive + * @param mixed[][] $fieldMap + * @param string $fragmentName + */ + private function collectConflictsBetweenFieldsAndFragment( + ValidationContext $context, + array &$conflicts, + array &$comparedFragments, + $areMutuallyExclusive, + array $fieldMap, + $fragmentName + ) { + if (isset($comparedFragments[$fragmentName])) { + return; + } + $comparedFragments[$fragmentName] = true; + + $fragment = $context->getFragment($fragmentName); + if (! $fragment) { + return; + } + + [$fieldMap2, $fragmentNames2] = $this->getReferencedFieldsAndFragmentNames( + $context, + $fragment + ); + + if ($fieldMap === $fieldMap2) { + return; + } + + // (D) First collect any conflicts between the provided collection of fields + // and the collection of fields represented by the given fragment. + $this->collectConflictsBetween( + $context, + $conflicts, + $areMutuallyExclusive, + $fieldMap, + $fieldMap2 + ); + + // (E) Then collect any conflicts between the provided collection of fields + // and any fragment names found in the given fragment. + $fragmentNames2Length = count($fragmentNames2); + for ($i = 0; $i < $fragmentNames2Length; $i++) { + $this->collectConflictsBetweenFieldsAndFragment( + $context, + $conflicts, + $comparedFragments, + $areMutuallyExclusive, + $fieldMap, + $fragmentNames2[$i] + ); + } + } + + /** + * Given a reference to a fragment, return the represented collection of fields + * as well as a list of nested fragment names referenced via fragment spreads. + * + * @return mixed[]|SplObjectStorage + */ + private function getReferencedFieldsAndFragmentNames( + ValidationContext $context, + FragmentDefinitionNode $fragment + ) { + // Short-circuit building a type from the AST if possible. + if (isset($this->cachedFieldsAndFragmentNames[$fragment->selectionSet])) { + return $this->cachedFieldsAndFragmentNames[$fragment->selectionSet]; + } + + $fragmentType = TypeInfo::typeFromAST($context->getSchema(), $fragment->typeCondition); + + return $this->getFieldsAndFragmentNames( + $context, + $fragmentType, + $fragment->selectionSet + ); + } + + /** + * Collect all conflicts found between two fragments, including via spreading in + * any nested fragments. + * + * @param mixed[][] $conflicts + * @param bool $areMutuallyExclusive + * @param string $fragmentName1 + * @param string $fragmentName2 + */ + private function collectConflictsBetweenFragments( + ValidationContext $context, + array &$conflicts, + $areMutuallyExclusive, + $fragmentName1, + $fragmentName2 + ) { + // No need to compare a fragment to itself. + if ($fragmentName1 === $fragmentName2) { + return; + } + + // Memoize so two fragments are not compared for conflicts more than once. + if ($this->comparedFragmentPairs->has( + $fragmentName1, + $fragmentName2, + $areMutuallyExclusive + ) + ) { + return; + } + $this->comparedFragmentPairs->add( + $fragmentName1, + $fragmentName2, + $areMutuallyExclusive + ); + + $fragment1 = $context->getFragment($fragmentName1); + $fragment2 = $context->getFragment($fragmentName2); + if (! $fragment1 || ! $fragment2) { + return; + } + + [$fieldMap1, $fragmentNames1] = $this->getReferencedFieldsAndFragmentNames( + $context, + $fragment1 + ); + [$fieldMap2, $fragmentNames2] = $this->getReferencedFieldsAndFragmentNames( + $context, + $fragment2 + ); + + // (F) First, collect all conflicts between these two collections of fields + // (not including any nested fragments). + $this->collectConflictsBetween( + $context, + $conflicts, + $areMutuallyExclusive, + $fieldMap1, + $fieldMap2 + ); + + // (G) Then collect conflicts between the first fragment and any nested + // fragments spread in the second fragment. + $fragmentNames2Length = count($fragmentNames2); + for ($j = 0; $j < $fragmentNames2Length; $j++) { + $this->collectConflictsBetweenFragments( + $context, + $conflicts, + $areMutuallyExclusive, + $fragmentName1, + $fragmentNames2[$j] + ); + } + + // (G) Then collect conflicts between the second fragment and any nested + // fragments spread in the first fragment. + $fragmentNames1Length = count($fragmentNames1); + for ($i = 0; $i < $fragmentNames1Length; $i++) { + $this->collectConflictsBetweenFragments( + $context, + $conflicts, + $areMutuallyExclusive, + $fragmentNames1[$i], + $fragmentName2 + ); + } + } + + /** + * Given a series of Conflicts which occurred between two sub-fields, generate + * a single Conflict. + * + * @param mixed[][] $conflicts + * @param string $responseName + * + * @return mixed[]|null + */ + private function subfieldConflicts( + array $conflicts, + $responseName, + FieldNode $ast1, + FieldNode $ast2 + ) { + if (count($conflicts) === 0) { + return null; + } + + return [ + [ + $responseName, + array_map( + static function ($conflict) { + return $conflict[0]; + }, + $conflicts + ), + ], + array_reduce( + $conflicts, + static function ($allFields, $conflict) : array { + return array_merge($allFields, $conflict[1]); + }, + [$ast1] + ), + array_reduce( + $conflicts, + static function ($allFields, $conflict) : array { + return array_merge($allFields, $conflict[2]); + }, + [$ast2] + ), + ]; + } + + /** + * @param string $responseName + * @param string $reason + */ + public static function fieldsConflictMessage($responseName, $reason) + { + $reasonMessage = self::reasonMessage($reason); + + return sprintf( + 'Fields "%s" conflict because %s. Use different aliases on the fields to fetch both if this was intentional.', + $responseName, + $reasonMessage + ); + } + + public static function reasonMessage($reason) + { + if (is_array($reason)) { + $tmp = array_map( + static function ($tmp) : string { + [$responseName, $subReason] = $tmp; + + $reasonMessage = self::reasonMessage($subReason); + + return sprintf('subfields "%s" conflict because %s', $responseName, $reasonMessage); + }, + $reason + ); + + return implode(' and ', $tmp); + } + + return $reason; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php new file mode 100644 index 00000000..4251400b --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php @@ -0,0 +1,160 @@ + function (InlineFragmentNode $node) use ($context) : void { + $fragType = $context->getType(); + $parentType = $context->getParentType(); + + if (! ($fragType instanceof CompositeType) || + ! ($parentType instanceof CompositeType) || + $this->doTypesOverlap($context->getSchema(), $fragType, $parentType)) { + return; + } + + $context->reportError(new Error( + self::typeIncompatibleAnonSpreadMessage($parentType, $fragType), + [$node] + )); + }, + NodeKind::FRAGMENT_SPREAD => function (FragmentSpreadNode $node) use ($context) : void { + $fragName = $node->name->value; + $fragType = $this->getFragmentType($context, $fragName); + $parentType = $context->getParentType(); + + if (! $fragType || + ! $parentType || + $this->doTypesOverlap($context->getSchema(), $fragType, $parentType) + ) { + return; + } + + $context->reportError(new Error( + self::typeIncompatibleSpreadMessage($fragName, $parentType, $fragType), + [$node] + )); + }, + ]; + } + + private function doTypesOverlap(Schema $schema, CompositeType $fragType, CompositeType $parentType) + { + // Checking in the order of the most frequently used scenarios: + // Parent type === fragment type + if ($parentType === $fragType) { + return true; + } + + // Parent type is interface or union, fragment type is object type + if ($parentType instanceof AbstractType && $fragType instanceof ObjectType) { + return $schema->isSubType($parentType, $fragType); + } + + // Parent type is object type, fragment type is interface (or rather rare - union) + if ($parentType instanceof ObjectType && $fragType instanceof AbstractType) { + return $schema->isSubType($fragType, $parentType); + } + + // Both are object types: + if ($parentType instanceof ObjectType && $fragType instanceof ObjectType) { + return $parentType === $fragType; + } + + // Both are interfaces + // This case may be assumed valid only when implementations of two interfaces intersect + // But we don't have information about all implementations at runtime + // (getting this information via $schema->getPossibleTypes() requires scanning through whole schema + // which is very costly to do at each request due to PHP "shared nothing" architecture) + // + // So in this case we just make it pass - invalid fragment spreads will be simply ignored during execution + // See also https://github.com/webonyx/graphql-php/issues/69#issuecomment-283954602 + if ($parentType instanceof InterfaceType && $fragType instanceof InterfaceType) { + return true; + + // Note that there is one case when we do have information about all implementations: + // When schema descriptor is defined ($schema->hasDescriptor()) + // BUT we must avoid situation when some query that worked in development had suddenly stopped + // working in production. So staying consistent and always validate. + } + + // Interface within union + if ($parentType instanceof UnionType && $fragType instanceof InterfaceType) { + foreach ($parentType->getTypes() as $type) { + if ($type->implementsInterface($fragType)) { + return true; + } + } + } + + if ($parentType instanceof InterfaceType && $fragType instanceof UnionType) { + foreach ($fragType->getTypes() as $type) { + if ($type->implementsInterface($parentType)) { + return true; + } + } + } + + if ($parentType instanceof UnionType && $fragType instanceof UnionType) { + foreach ($fragType->getTypes() as $type) { + if ($parentType->isPossibleType($type)) { + return true; + } + } + } + + return false; + } + + public static function typeIncompatibleAnonSpreadMessage($parentType, $fragType) + { + return sprintf( + 'Fragment cannot be spread here as objects of type "%s" can never be of type "%s".', + $parentType, + $fragType + ); + } + + private function getFragmentType(ValidationContext $context, $name) + { + $frag = $context->getFragment($name); + if ($frag) { + $type = TypeInfo::typeFromAST($context->getSchema(), $frag->typeCondition); + if ($type instanceof CompositeType) { + return $type; + } + } + + return null; + } + + public static function typeIncompatibleSpreadMessage($fragName, $parentType, $fragType) + { + return sprintf( + 'Fragment "%s" cannot be spread here as objects of type "%s" can never be of type "%s".', + $fragName, + $parentType, + $fragType + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php new file mode 100644 index 00000000..77a4aa5a --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php @@ -0,0 +1,62 @@ +getVisitor($context) + [ + NodeKind::FIELD => [ + 'leave' => static function (FieldNode $fieldNode) use ($context) : ?VisitorOperation { + $fieldDef = $context->getFieldDef(); + + if (! $fieldDef) { + return Visitor::skipNode(); + } + $argNodes = $fieldNode->arguments ?? []; + + $argNodeMap = []; + foreach ($argNodes as $argNode) { + $argNodeMap[$argNode->name->value] = $argNode; + } + foreach ($fieldDef->args as $argDef) { + $argNode = $argNodeMap[$argDef->name] ?? null; + if ($argNode || ! $argDef->isRequired()) { + continue; + } + + $context->reportError(new Error( + self::missingFieldArgMessage($fieldNode->name->value, $argDef->name, $argDef->getType()), + [$fieldNode] + )); + } + + return null; + }, + ], + ]; + } + + public static function missingFieldArgMessage($fieldName, $argName, $type) + { + return sprintf( + 'Field "%s" argument "%s" of type "%s" is required but not provided.', + $fieldName, + $argName, + $type + ); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php new file mode 100644 index 00000000..f8b34c71 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php @@ -0,0 +1,128 @@ +getASTVisitor($context); + } + + public function getVisitor(ValidationContext $context) + { + return $this->getASTVisitor($context); + } + + public function getASTVisitor(ASTValidationContext $context) + { + $requiredArgsMap = []; + $schema = $context->getSchema(); + $definedDirectives = $schema + ? $schema->getDirectives() + : Directive::getInternalDirectives(); + + foreach ($definedDirectives as $directive) { + $requiredArgsMap[$directive->name] = Utils::keyMap( + array_filter($directive->args, static function (FieldArgument $arg) : bool { + return $arg->isRequired(); + }), + static function (FieldArgument $arg) : string { + return $arg->name; + } + ); + } + + $astDefinition = $context->getDocument()->definitions; + foreach ($astDefinition as $def) { + if (! ($def instanceof DirectiveDefinitionNode)) { + continue; + } + $arguments = $def->arguments ?? []; + + $requiredArgsMap[$def->name->value] = Utils::keyMap( + Utils::filter($arguments, static function (InputValueDefinitionNode $argument) : bool { + return $argument->type instanceof NonNullTypeNode && + ( + ! isset($argument->defaultValue) || + $argument->defaultValue === null + ); + }), + static function (InputValueDefinitionNode $argument) : string { + return $argument->name->value; + } + ); + } + + return [ + NodeKind::DIRECTIVE => [ + // Validate on leave to allow for deeper errors to appear first. + 'leave' => static function (DirectiveNode $directiveNode) use ($requiredArgsMap, $context) : ?string { + $directiveName = $directiveNode->name->value; + $requiredArgs = $requiredArgsMap[$directiveName] ?? null; + if (! $requiredArgs) { + return null; + } + + $argNodes = $directiveNode->arguments ?? []; + $argNodeMap = Utils::keyMap( + $argNodes, + static function (ArgumentNode $arg) : string { + return $arg->name->value; + } + ); + + foreach ($requiredArgs as $argName => $arg) { + if (isset($argNodeMap[$argName])) { + continue; + } + + if ($arg instanceof FieldArgument) { + $argType = (string) $arg->getType(); + } elseif ($arg instanceof InputValueDefinitionNode) { + $argType = Printer::doPrint($arg->type); + } else { + $argType = ''; + } + + $context->reportError( + new Error(static::missingDirectiveArgMessage($directiveName, $argName, $argType), [$directiveNode]) + ); + } + + return null; + }, + ], + ]; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php new file mode 100644 index 00000000..1a1eb4bd --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php @@ -0,0 +1,300 @@ +setMaxQueryComplexity($maxQueryComplexity); + } + + public function getVisitor(ValidationContext $context) + { + $this->context = $context; + + $this->variableDefs = new ArrayObject(); + $this->fieldNodeAndDefs = new ArrayObject(); + $this->complexity = 0; + + return $this->invokeIfNeeded( + $context, + [ + NodeKind::SELECTION_SET => function (SelectionSetNode $selectionSet) use ($context) : void { + $this->fieldNodeAndDefs = $this->collectFieldASTsAndDefs( + $context, + $context->getParentType(), + $selectionSet, + null, + $this->fieldNodeAndDefs + ); + }, + NodeKind::VARIABLE_DEFINITION => function ($def) : VisitorOperation { + $this->variableDefs[] = $def; + + return Visitor::skipNode(); + }, + NodeKind::OPERATION_DEFINITION => [ + 'leave' => function (OperationDefinitionNode $operationDefinition) use ($context, &$complexity) : void { + $errors = $context->getErrors(); + + if (count($errors) > 0) { + return; + } + + $this->complexity = $this->fieldComplexity($operationDefinition, $complexity); + + if ($this->getQueryComplexity() <= $this->getMaxQueryComplexity()) { + return; + } + + $context->reportError( + new Error(self::maxQueryComplexityErrorMessage( + $this->getMaxQueryComplexity(), + $this->getQueryComplexity() + )) + ); + }, + ], + ] + ); + } + + private function fieldComplexity($node, $complexity = 0) + { + if (isset($node->selectionSet) && $node->selectionSet instanceof SelectionSetNode) { + foreach ($node->selectionSet->selections as $childNode) { + $complexity = $this->nodeComplexity($childNode, $complexity); + } + } + + return $complexity; + } + + private function nodeComplexity(Node $node, $complexity = 0) + { + switch (true) { + case $node instanceof FieldNode: + // default values + $args = []; + $complexityFn = FieldDefinition::DEFAULT_COMPLEXITY_FN; + + // calculate children complexity if needed + $childrenComplexity = 0; + + // node has children? + if (isset($node->selectionSet)) { + $childrenComplexity = $this->fieldComplexity($node); + } + + $astFieldInfo = $this->astFieldInfo($node); + $fieldDef = $astFieldInfo[1]; + + if ($fieldDef instanceof FieldDefinition) { + if ($this->directiveExcludesField($node)) { + break; + } + + $args = $this->buildFieldArguments($node); + //get complexity fn using fieldDef complexity + if (method_exists($fieldDef, 'getComplexityFn')) { + $complexityFn = $fieldDef->getComplexityFn(); + } + } + + $complexity += $complexityFn($childrenComplexity, $args); + break; + + case $node instanceof InlineFragmentNode: + // node has children? + if (isset($node->selectionSet)) { + $complexity = $this->fieldComplexity($node, $complexity); + } + break; + + case $node instanceof FragmentSpreadNode: + $fragment = $this->getFragment($node); + + if ($fragment !== null) { + $complexity = $this->fieldComplexity($fragment, $complexity); + } + break; + } + + return $complexity; + } + + private function astFieldInfo(FieldNode $field) + { + $fieldName = $this->getFieldName($field); + $astFieldInfo = [null, null]; + if (isset($this->fieldNodeAndDefs[$fieldName])) { + foreach ($this->fieldNodeAndDefs[$fieldName] as $astAndDef) { + if ($astAndDef[0] === $field) { + $astFieldInfo = $astAndDef; + break; + } + } + } + + return $astFieldInfo; + } + + private function directiveExcludesField(FieldNode $node) + { + foreach ($node->directives as $directiveNode) { + if ($directiveNode->name->value === 'deprecated') { + return false; + } + [$errors, $variableValues] = Values::getVariableValues( + $this->context->getSchema(), + $this->variableDefs, + $this->getRawVariableValues() + ); + if (count($errors ?? []) > 0) { + throw new Error(implode( + "\n\n", + array_map( + static function ($error) { + return $error->getMessage(); + }, + $errors + ) + )); + } + if ($directiveNode->name->value === 'include') { + $directive = Directive::includeDirective(); + /** @var bool $directiveArgsIf */ + $directiveArgsIf = Values::getArgumentValues($directive, $directiveNode, $variableValues)['if']; + + return ! $directiveArgsIf; + } + if ($directiveNode->name->value === Directive::SKIP_NAME) { + $directive = Directive::skipDirective(); + /** @var bool $directiveArgsIf */ + $directiveArgsIf = Values::getArgumentValues($directive, $directiveNode, $variableValues)['if']; + + return $directiveArgsIf; + } + } + + return false; + } + + public function getRawVariableValues() + { + return $this->rawVariableValues; + } + + /** + * @param mixed[]|null $rawVariableValues + */ + public function setRawVariableValues(?array $rawVariableValues = null) + { + $this->rawVariableValues = $rawVariableValues ?? []; + } + + private function buildFieldArguments(FieldNode $node) + { + $rawVariableValues = $this->getRawVariableValues(); + $astFieldInfo = $this->astFieldInfo($node); + $fieldDef = $astFieldInfo[1]; + + $args = []; + + if ($fieldDef instanceof FieldDefinition) { + [$errors, $variableValues] = Values::getVariableValues( + $this->context->getSchema(), + $this->variableDefs, + $rawVariableValues + ); + + if (count($errors ?? []) > 0) { + throw new Error(implode( + "\n\n", + array_map( + static function ($error) { + return $error->getMessage(); + }, + $errors + ) + )); + } + + $args = Values::getArgumentValues($fieldDef, $node, $variableValues); + } + + return $args; + } + + public function getQueryComplexity() + { + return $this->complexity; + } + + public function getMaxQueryComplexity() + { + return $this->maxQueryComplexity; + } + + /** + * Set max query complexity. If equal to 0 no check is done. Must be greater or equal to 0. + */ + public function setMaxQueryComplexity($maxQueryComplexity) + { + $this->checkIfGreaterOrEqualToZero('maxQueryComplexity', $maxQueryComplexity); + + $this->maxQueryComplexity = (int) $maxQueryComplexity; + } + + public static function maxQueryComplexityErrorMessage($max, $count) + { + return sprintf('Max query complexity should be %d but got %d.', $max, $count); + } + + protected function isEnabled() + { + return $this->getMaxQueryComplexity() !== self::DISABLED; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php new file mode 100644 index 00000000..9b83d061 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php @@ -0,0 +1,118 @@ +setMaxQueryDepth($maxQueryDepth); + } + + public function getVisitor(ValidationContext $context) + { + return $this->invokeIfNeeded( + $context, + [ + NodeKind::OPERATION_DEFINITION => [ + 'leave' => function (OperationDefinitionNode $operationDefinition) use ($context) : void { + $maxDepth = $this->fieldDepth($operationDefinition); + + if ($maxDepth <= $this->getMaxQueryDepth()) { + return; + } + + $context->reportError( + new Error(self::maxQueryDepthErrorMessage($this->getMaxQueryDepth(), $maxDepth)) + ); + }, + ], + ] + ); + } + + private function fieldDepth($node, $depth = 0, $maxDepth = 0) + { + if (isset($node->selectionSet) && $node->selectionSet instanceof SelectionSetNode) { + foreach ($node->selectionSet->selections as $childNode) { + $maxDepth = $this->nodeDepth($childNode, $depth, $maxDepth); + } + } + + return $maxDepth; + } + + private function nodeDepth(Node $node, $depth = 0, $maxDepth = 0) + { + switch (true) { + case $node instanceof FieldNode: + // node has children? + if ($node->selectionSet !== null) { + // update maxDepth if needed + if ($depth > $maxDepth) { + $maxDepth = $depth; + } + $maxDepth = $this->fieldDepth($node, $depth + 1, $maxDepth); + } + break; + + case $node instanceof InlineFragmentNode: + // node has children? + if ($node->selectionSet !== null) { + $maxDepth = $this->fieldDepth($node, $depth, $maxDepth); + } + break; + + case $node instanceof FragmentSpreadNode: + $fragment = $this->getFragment($node); + + if ($fragment !== null) { + $maxDepth = $this->fieldDepth($fragment, $depth, $maxDepth); + } + break; + } + + return $maxDepth; + } + + public function getMaxQueryDepth() + { + return $this->maxQueryDepth; + } + + /** + * Set max query depth. If equal to 0 no check is done. Must be greater or equal to 0. + */ + public function setMaxQueryDepth($maxQueryDepth) + { + $this->checkIfGreaterOrEqualToZero('maxQueryDepth', $maxQueryDepth); + + $this->maxQueryDepth = (int) $maxQueryDepth; + } + + public static function maxQueryDepthErrorMessage($max, $count) + { + return sprintf('Max query depth should be %d but got %d.', $max, $count); + } + + protected function isEnabled() + { + return $this->getMaxQueryDepth() !== self::DISABLED; + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php new file mode 100644 index 00000000..dcb76e99 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php @@ -0,0 +1,184 @@ +name->value; + $fragments = $this->getFragments(); + + return $fragments[$spreadName] ?? null; + } + + /** + * @return FragmentDefinitionNode[] + */ + protected function getFragments() + { + return $this->fragments; + } + + /** + * @param callable[] $validators + * + * @return callable[] + */ + protected function invokeIfNeeded(ValidationContext $context, array $validators) + { + // is disabled? + if (! $this->isEnabled()) { + return []; + } + + $this->gatherFragmentDefinition($context); + + return $validators; + } + + abstract protected function isEnabled(); + + protected function gatherFragmentDefinition(ValidationContext $context) + { + // Gather all the fragment definition. + // Importantly this does not include inline fragments. + $definitions = $context->getDocument()->definitions; + foreach ($definitions as $node) { + if (! ($node instanceof FragmentDefinitionNode)) { + continue; + } + + $this->fragments[$node->name->value] = $node; + } + } + + /** + * Given a selectionSet, adds all of the fields in that selection to + * the passed in map of fields, and returns it at the end. + * + * Note: This is not the same as execution's collectFields because at static + * time we do not know what object type will be used, so we unconditionally + * spread in all fragments. + * + * @see \GraphQL\Validator\Rules\OverlappingFieldsCanBeMerged + * + * @param Type|null $parentType + * + * @return ArrayObject + */ + protected function collectFieldASTsAndDefs( + ValidationContext $context, + $parentType, + SelectionSetNode $selectionSet, + ?ArrayObject $visitedFragmentNames = null, + ?ArrayObject $astAndDefs = null + ) { + $_visitedFragmentNames = $visitedFragmentNames ?? new ArrayObject(); + $_astAndDefs = $astAndDefs ?? new ArrayObject(); + + foreach ($selectionSet->selections as $selection) { + switch (true) { + case $selection instanceof FieldNode: + $fieldName = $selection->name->value; + $fieldDef = null; + if ($parentType instanceof HasFieldsType || $parentType instanceof InputObjectType) { + $schemaMetaFieldDef = Introspection::schemaMetaFieldDef(); + $typeMetaFieldDef = Introspection::typeMetaFieldDef(); + $typeNameMetaFieldDef = Introspection::typeNameMetaFieldDef(); + + if ($fieldName === $schemaMetaFieldDef->name && $context->getSchema()->getQueryType() === $parentType) { + $fieldDef = $schemaMetaFieldDef; + } elseif ($fieldName === $typeMetaFieldDef->name && $context->getSchema()->getQueryType() === $parentType) { + $fieldDef = $typeMetaFieldDef; + } elseif ($fieldName === $typeNameMetaFieldDef->name) { + $fieldDef = $typeNameMetaFieldDef; + } elseif ($parentType->hasField($fieldName)) { + $fieldDef = $parentType->getField($fieldName); + } + } + $responseName = $this->getFieldName($selection); + if (! isset($_astAndDefs[$responseName])) { + $_astAndDefs[$responseName] = new ArrayObject(); + } + // create field context + $_astAndDefs[$responseName][] = [$selection, $fieldDef]; + break; + case $selection instanceof InlineFragmentNode: + $_astAndDefs = $this->collectFieldASTsAndDefs( + $context, + TypeInfo::typeFromAST($context->getSchema(), $selection->typeCondition), + $selection->selectionSet, + $_visitedFragmentNames, + $_astAndDefs + ); + break; + case $selection instanceof FragmentSpreadNode: + $fragName = $selection->name->value; + + if (! ($_visitedFragmentNames[$fragName] ?? false)) { + $_visitedFragmentNames[$fragName] = true; + $fragment = $context->getFragment($fragName); + + if ($fragment) { + $_astAndDefs = $this->collectFieldASTsAndDefs( + $context, + TypeInfo::typeFromAST($context->getSchema(), $fragment->typeCondition), + $fragment->selectionSet, + $_visitedFragmentNames, + $_astAndDefs + ); + } + } + break; + } + } + + return $_astAndDefs; + } + + protected function getFieldName(FieldNode $node) + { + $fieldName = $node->name->value; + + return $node->alias ? $node->alias->value : $fieldName; + } +} + +class_alias(QuerySecurityRule::class, 'GraphQL\Validator\Rules\AbstractQuerySecurity'); diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php new file mode 100644 index 00000000..f1714239 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php @@ -0,0 +1,51 @@ + static function (FieldNode $node) use ($context) : void { + $type = $context->getType(); + if (! $type) { + return; + } + + if (Type::isLeafType(Type::getNamedType($type))) { + if ($node->selectionSet) { + $context->reportError(new Error( + self::noSubselectionAllowedMessage($node->name->value, $type), + [$node->selectionSet] + )); + } + } elseif (! $node->selectionSet) { + $context->reportError(new Error( + self::requiredSubselectionMessage($node->name->value, $type), + [$node] + )); + } + }, + ]; + } + + public static function noSubselectionAllowedMessage($field, $type) + { + return sprintf('Field "%s" of type "%s" must not have a sub selection.', $field, $type); + } + + public static function requiredSubselectionMessage($field, $type) + { + return sprintf('Field "%s" of type "%s" must have a sub selection.', $field, $type); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php new file mode 100644 index 00000000..b98ee95e --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php @@ -0,0 +1,57 @@ + + */ + public function getVisitor(ValidationContext $context) : array + { + return [ + NodeKind::OPERATION_DEFINITION => static function (OperationDefinitionNode $node) use ($context) : VisitorOperation { + if ($node->operation === 'subscription') { + $selections = $node->selectionSet->selections; + + if (count($selections) !== 1) { + if ($selections instanceof NodeList) { + $offendingSelections = $selections->splice(1, count($selections)); + } else { + $offendingSelections = array_splice($selections, 1); + } + + $context->reportError(new Error( + self::multipleFieldsInOperation($node->name->value ?? null), + $offendingSelections + )); + } + } + + return Visitor::skipNode(); + }, + ]; + } + + public static function multipleFieldsInOperation(?string $operationName) : string + { + if ($operationName === null) { + return sprintf('Anonymous Subscription must select only one top level field.'); + } + + return sprintf('Subscription "%s" must select only one top level field.', $operationName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php new file mode 100644 index 00000000..58daecf6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php @@ -0,0 +1,64 @@ +getASTVisitor($context); + } + + public function getVisitor(ValidationContext $context) + { + return $this->getASTVisitor($context); + } + + public function getASTVisitor(ASTValidationContext $context) + { + $this->knownArgNames = []; + + return [ + NodeKind::FIELD => function () : void { + $this->knownArgNames = []; + }, + NodeKind::DIRECTIVE => function () : void { + $this->knownArgNames = []; + }, + NodeKind::ARGUMENT => function (ArgumentNode $node) use ($context) : VisitorOperation { + $argName = $node->name->value; + if ($this->knownArgNames[$argName] ?? false) { + $context->reportError(new Error( + self::duplicateArgMessage($argName), + [$this->knownArgNames[$argName], $node->name] + )); + } else { + $this->knownArgNames[$argName] = $node->name; + } + + return Visitor::skipNode(); + }, + ]; + } + + public static function duplicateArgMessage($argName) + { + return sprintf('There can be only one argument named "%s".', $argName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php new file mode 100644 index 00000000..cbada229 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php @@ -0,0 +1,96 @@ +getASTVisitor($context); + } + + public function getSDLVisitor(SDLValidationContext $context) + { + return $this->getASTVisitor($context); + } + + public function getASTVisitor(ASTValidationContext $context) + { + /** @var array $uniqueDirectiveMap */ + $uniqueDirectiveMap = []; + + $schema = $context->getSchema(); + $definedDirectives = $schema !== null + ? $schema->getDirectives() + : Directive::getInternalDirectives(); + foreach ($definedDirectives as $directive) { + if ($directive->isRepeatable) { + continue; + } + + $uniqueDirectiveMap[$directive->name] = true; + } + + $astDefinitions = $context->getDocument()->definitions; + foreach ($astDefinitions as $definition) { + if (! ($definition instanceof DirectiveDefinitionNode) + || $definition->repeatable + ) { + continue; + } + + $uniqueDirectiveMap[$definition->name->value] = true; + } + + return [ + 'enter' => static function (Node $node) use ($uniqueDirectiveMap, $context) : void { + if (! isset($node->directives)) { + return; + } + + $knownDirectives = []; + + /** @var DirectiveNode $directive */ + foreach ($node->directives as $directive) { + $directiveName = $directive->name->value; + + if (! isset($uniqueDirectiveMap[$directiveName])) { + continue; + } + + if (isset($knownDirectives[$directiveName])) { + $context->reportError(new Error( + self::duplicateDirectiveMessage($directiveName), + [$knownDirectives[$directiveName], $directive] + )); + } else { + $knownDirectives[$directiveName] = $directive; + } + } + }, + ]; + } + + public static function duplicateDirectiveMessage($directiveName) + { + return sprintf('The directive "%s" can only be used once at this location.', $directiveName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php new file mode 100644 index 00000000..e9dba8a9 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php @@ -0,0 +1,49 @@ +knownFragmentNames = []; + + return [ + NodeKind::OPERATION_DEFINITION => static function () : VisitorOperation { + return Visitor::skipNode(); + }, + NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) : VisitorOperation { + $fragmentName = $node->name->value; + if (! isset($this->knownFragmentNames[$fragmentName])) { + $this->knownFragmentNames[$fragmentName] = $node->name; + } else { + $context->reportError(new Error( + self::duplicateFragmentNameMessage($fragmentName), + [$this->knownFragmentNames[$fragmentName], $node->name] + )); + } + + return Visitor::skipNode(); + }, + ]; + } + + public static function duplicateFragmentNameMessage($fragName) + { + return sprintf('There can be only one fragment named "%s".', $fragName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php new file mode 100644 index 00000000..541a3729 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php @@ -0,0 +1,73 @@ + */ + public $knownNames; + + /** @var array> */ + public $knownNameStack; + + public function getVisitor(ValidationContext $context) + { + return $this->getASTVisitor($context); + } + + public function getSDLVisitor(SDLValidationContext $context) + { + return $this->getASTVisitor($context); + } + + public function getASTVisitor(ASTValidationContext $context) + { + $this->knownNames = []; + $this->knownNameStack = []; + + return [ + NodeKind::OBJECT => [ + 'enter' => function () : void { + $this->knownNameStack[] = $this->knownNames; + $this->knownNames = []; + }, + 'leave' => function () : void { + $this->knownNames = array_pop($this->knownNameStack); + }, + ], + NodeKind::OBJECT_FIELD => function (ObjectFieldNode $node) use ($context) : VisitorOperation { + $fieldName = $node->name->value; + + if (isset($this->knownNames[$fieldName])) { + $context->reportError(new Error( + self::duplicateInputFieldMessage($fieldName), + [$this->knownNames[$fieldName], $node->name] + )); + } else { + $this->knownNames[$fieldName] = $node->name; + } + + return Visitor::skipNode(); + }, + ]; + } + + public static function duplicateInputFieldMessage($fieldName) + { + return sprintf('There can be only one input field named "%s".', $fieldName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php new file mode 100644 index 00000000..c4a0777f --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php @@ -0,0 +1,52 @@ +knownOperationNames = []; + + return [ + NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) use ($context) : VisitorOperation { + $operationName = $node->name; + + if ($operationName !== null) { + if (! isset($this->knownOperationNames[$operationName->value])) { + $this->knownOperationNames[$operationName->value] = $operationName; + } else { + $context->reportError(new Error( + self::duplicateOperationNameMessage($operationName->value), + [$this->knownOperationNames[$operationName->value], $operationName] + )); + } + } + + return Visitor::skipNode(); + }, + NodeKind::FRAGMENT_DEFINITION => static function () : VisitorOperation { + return Visitor::skipNode(); + }, + ]; + } + + public static function duplicateOperationNameMessage($operationName) + { + return sprintf('There can be only one operation named "%s".', $operationName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php new file mode 100644 index 00000000..f6db14e6 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php @@ -0,0 +1,45 @@ +knownVariableNames = []; + + return [ + NodeKind::OPERATION_DEFINITION => function () : void { + $this->knownVariableNames = []; + }, + NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $node) use ($context) : void { + $variableName = $node->variable->name->value; + if (! isset($this->knownVariableNames[$variableName])) { + $this->knownVariableNames[$variableName] = $node->variable->name; + } else { + $context->reportError(new Error( + self::duplicateVariableMessage($variableName), + [$this->knownVariableNames[$variableName], $node->variable->name] + )); + } + }, + ]; + } + + public static function duplicateVariableMessage($variableName) + { + return sprintf('There can be only one variable named "%s".', $variableName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php new file mode 100644 index 00000000..461aafee --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php @@ -0,0 +1,51 @@ +name === '' || $this->name === null ? static::class : $this->name; + } + + public function __invoke(ValidationContext $context) + { + return $this->getVisitor($context); + } + + /** + * Returns structure suitable for GraphQL\Language\Visitor + * + * @see \GraphQL\Language\Visitor + * + * @return mixed[] + */ + public function getVisitor(ValidationContext $context) + { + return []; + } + + /** + * Returns structure suitable for GraphQL\Language\Visitor + * + * @see \GraphQL\Language\Visitor + * + * @return mixed[] + */ + public function getSDLVisitor(SDLValidationContext $context) + { + return []; + } +} + +class_alias(ValidationRule::class, 'GraphQL\Validator\Rules\AbstractValidationRule'); diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php new file mode 100644 index 00000000..6f977d52 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php @@ -0,0 +1,290 @@ + [ + 'enter' => static function (FieldNode $node) use (&$fieldName) : void { + $fieldName = $node->name->value; + }, + ], + NodeKind::NULL => static function (NullValueNode $node) use ($context, &$fieldName) : void { + $type = $context->getInputType(); + if (! ($type instanceof NonNull)) { + return; + } + + $context->reportError( + new Error( + self::getBadValueMessage((string) $type, Printer::doPrint($node), null, $context, $fieldName), + $node + ) + ); + }, + NodeKind::LST => function (ListValueNode $node) use ($context, &$fieldName) : ?VisitorOperation { + // Note: TypeInfo will traverse into a list's item type, so look to the + // parent input type to check if it is a list. + $type = Type::getNullableType($context->getParentInputType()); + if (! $type instanceof ListOfType) { + $this->isValidScalar($context, $node, $fieldName); + + return Visitor::skipNode(); + } + + return null; + }, + NodeKind::OBJECT => function (ObjectValueNode $node) use ($context, &$fieldName) : ?VisitorOperation { + // Note: TypeInfo will traverse into a list's item type, so look to the + // parent input type to check if it is a list. + $type = Type::getNamedType($context->getInputType()); + if (! $type instanceof InputObjectType) { + $this->isValidScalar($context, $node, $fieldName); + + return Visitor::skipNode(); + } + unset($fieldName); + // Ensure every required field exists. + $inputFields = $type->getFields(); + $nodeFields = iterator_to_array($node->fields); + $fieldNodeMap = array_combine( + array_map( + static function ($field) : string { + return $field->name->value; + }, + $nodeFields + ), + array_values($nodeFields) + ); + foreach ($inputFields as $fieldName => $fieldDef) { + $fieldType = $fieldDef->getType(); + if (isset($fieldNodeMap[$fieldName]) || ! $fieldDef->isRequired()) { + continue; + } + + $context->reportError( + new Error( + self::requiredFieldMessage($type->name, $fieldName, (string) $fieldType), + $node + ) + ); + } + + return null; + }, + NodeKind::OBJECT_FIELD => static function (ObjectFieldNode $node) use ($context) : void { + $parentType = Type::getNamedType($context->getParentInputType()); + /** @var ScalarType|EnumType|InputObjectType|ListOfType|NonNull $fieldType */ + $fieldType = $context->getInputType(); + if ($fieldType || ! ($parentType instanceof InputObjectType)) { + return; + } + + $suggestions = Utils::suggestionList( + $node->name->value, + array_keys($parentType->getFields()) + ); + $didYouMean = $suggestions + ? 'Did you mean ' . Utils::orList($suggestions) . '?' + : null; + + $context->reportError( + new Error( + self::unknownFieldMessage($parentType->name, $node->name->value, $didYouMean), + $node + ) + ); + }, + NodeKind::ENUM => function (EnumValueNode $node) use ($context, &$fieldName) : void { + $type = Type::getNamedType($context->getInputType()); + if (! $type instanceof EnumType) { + $this->isValidScalar($context, $node, $fieldName); + } elseif (! $type->getValue($node->value)) { + $context->reportError( + new Error( + self::getBadValueMessage( + $type->name, + Printer::doPrint($node), + $this->enumTypeSuggestion($type, $node), + $context, + $fieldName + ), + $node + ) + ); + } + }, + NodeKind::INT => function (IntValueNode $node) use ($context, &$fieldName) : void { + $this->isValidScalar($context, $node, $fieldName); + }, + NodeKind::FLOAT => function (FloatValueNode $node) use ($context, &$fieldName) : void { + $this->isValidScalar($context, $node, $fieldName); + }, + NodeKind::STRING => function (StringValueNode $node) use ($context, &$fieldName) : void { + $this->isValidScalar($context, $node, $fieldName); + }, + NodeKind::BOOLEAN => function (BooleanValueNode $node) use ($context, &$fieldName) : void { + $this->isValidScalar($context, $node, $fieldName); + }, + ]; + } + + public static function badValueMessage($typeName, $valueName, $message = null) + { + return sprintf('Expected type %s, found %s', $typeName, $valueName) . + ($message ? "; {$message}" : '.'); + } + + /** + * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $node + */ + private function isValidScalar(ValidationContext $context, ValueNode $node, $fieldName) + { + // Report any error at the full type expected by the location. + /** @var ScalarType|EnumType|InputObjectType|ListOfType|NonNull $locationType */ + $locationType = $context->getInputType(); + + if (! $locationType) { + return; + } + + $type = Type::getNamedType($locationType); + + if (! $type instanceof ScalarType) { + $context->reportError( + new Error( + self::getBadValueMessage( + (string) $locationType, + Printer::doPrint($node), + $this->enumTypeSuggestion($type, $node), + $context, + $fieldName + ), + $node + ) + ); + + return; + } + + // Scalars determine if a literal value is valid via parseLiteral() which + // may throw to indicate failure. + try { + $type->parseLiteral($node); + } catch (Throwable $error) { + // Ensure a reference to the original error is maintained. + $context->reportError( + new Error( + self::getBadValueMessage( + (string) $locationType, + Printer::doPrint($node), + $error->getMessage(), + $context, + $fieldName + ), + $node, + null, + [], + null, + $error + ) + ); + } + } + + /** + * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $node + */ + private function enumTypeSuggestion($type, ValueNode $node) + { + if ($type instanceof EnumType) { + $suggestions = Utils::suggestionList( + Printer::doPrint($node), + array_map( + static function (EnumValueDefinition $value) : string { + return $value->name; + }, + $type->getValues() + ) + ); + + return $suggestions ? 'Did you mean the enum value ' . Utils::orList($suggestions) . '?' : null; + } + } + + public static function badArgumentValueMessage($typeName, $valueName, $fieldName, $argName, $message = null) + { + return sprintf('Field "%s" argument "%s" requires type %s, found %s', $fieldName, $argName, $typeName, $valueName) . + ($message ? sprintf('; %s', $message) : '.'); + } + + public static function requiredFieldMessage($typeName, $fieldName, $fieldTypeName) + { + return sprintf('Field %s.%s of required type %s was not provided.', $typeName, $fieldName, $fieldTypeName); + } + + public static function unknownFieldMessage($typeName, $fieldName, $message = null) + { + return sprintf('Field "%s" is not defined by type %s', $fieldName, $typeName) . + ($message ? sprintf('; %s', $message) : '.'); + } + + private static function getBadValueMessage($typeName, $valueName, $message = null, $context = null, $fieldName = null) + { + if ($context) { + $arg = $context->getArgument(); + if ($arg) { + return self::badArgumentValueMessage($typeName, $valueName, $fieldName, $arg->name, $message); + } + } + + return self::badValueMessage($typeName, $valueName, $message); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php new file mode 100644 index 00000000..a1daafff --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php @@ -0,0 +1,42 @@ + static function (VariableDefinitionNode $node) use ($context) : void { + $type = TypeInfo::typeFromAST($context->getSchema(), $node->type); + + // If the variable type is not an input type, return an error. + if (! $type || Type::isInputType($type)) { + return; + } + + $variableName = $node->variable->name->value; + $context->reportError(new Error( + self::nonInputTypeOnVarMessage($variableName, Printer::doPrint($node->type)), + [$node->type] + )); + }, + ]; + } + + public static function nonInputTypeOnVarMessage($variableName, $typeName) + { + return sprintf('Variable "$%s" cannot be non-input type "%s".', $variableName, $typeName); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php new file mode 100644 index 00000000..717bd656 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php @@ -0,0 +1,116 @@ + [ + 'enter' => function () : void { + $this->varDefMap = []; + }, + 'leave' => function (OperationDefinitionNode $operation) use ($context) : void { + $usages = $context->getRecursiveVariableUsages($operation); + + foreach ($usages as $usage) { + $node = $usage['node']; + $type = $usage['type']; + $defaultValue = $usage['defaultValue']; + $varName = $node->name->value; + $varDef = $this->varDefMap[$varName] ?? null; + + if ($varDef === null || $type === null) { + continue; + } + + // A var type is allowed if it is the same or more strict (e.g. is + // a subtype of) than the expected type. It can be more strict if + // the variable type is non-null when the expected type is nullable. + // If both are list types, the variable item type can be more strict + // than the expected item type (contravariant). + $schema = $context->getSchema(); + $varType = TypeInfo::typeFromAST($schema, $varDef->type); + + if (! $varType || $this->allowedVariableUsage($schema, $varType, $varDef->defaultValue, $type, $defaultValue)) { + continue; + } + + $context->reportError(new Error( + self::badVarPosMessage($varName, $varType, $type), + [$varDef, $node] + )); + } + }, + ], + NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $varDefNode) : void { + $this->varDefMap[$varDefNode->variable->name->value] = $varDefNode; + }, + ]; + } + + /** + * A var type is allowed if it is the same or more strict than the expected + * type. It can be more strict if the variable type is non-null when the + * expected type is nullable. If both are list types, the variable item type can + * be more strict than the expected item type. + */ + public static function badVarPosMessage($varName, $varType, $expectedType) + { + return sprintf( + 'Variable "$%s" of type "%s" used in position expecting type "%s".', + $varName, + $varType, + $expectedType + ); + } + + /** + * Returns true if the variable is allowed in the location it was found, + * which includes considering if default values exist for either the variable + * or the location at which it is located. + * + * @param ValueNode|null $varDefaultValue + * @param mixed $locationDefaultValue + */ + private function allowedVariableUsage(Schema $schema, Type $varType, $varDefaultValue, Type $locationType, $locationDefaultValue) : bool + { + if ($locationType instanceof NonNull && ! $varType instanceof NonNull) { + $hasNonNullVariableDefaultValue = $varDefaultValue && ! $varDefaultValue instanceof NullValueNode; + $hasLocationDefaultValue = ! Utils::isInvalid($locationDefaultValue); + if (! $hasNonNullVariableDefaultValue && ! $hasLocationDefaultValue) { + return false; + } + $nullableLocationType = $locationType->getWrappedType(); + + return TypeComparators::isTypeSubTypeOf($schema, $varType, $nullableLocationType); + } + + return TypeComparators::isTypeSubTypeOf($schema, $varType, $locationType); + } +} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/SDLValidationContext.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/SDLValidationContext.php new file mode 100644 index 00000000..379515e2 --- /dev/null +++ b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/SDLValidationContext.php @@ -0,0 +1,9 @@ +typeInfo = $typeInfo; + $this->fragmentSpreads = new SplObjectStorage(); + $this->recursivelyReferencedFragments = new SplObjectStorage(); + $this->variableUsages = new SplObjectStorage(); + $this->recursiveVariableUsages = new SplObjectStorage(); + } + + /** + * @return mixed[][] List of ['node' => VariableNode, 'type' => ?InputObjectType] + */ + public function getRecursiveVariableUsages(OperationDefinitionNode $operation) + { + $usages = $this->recursiveVariableUsages[$operation] ?? null; + + if ($usages === null) { + $usages = $this->getVariableUsages($operation); + $fragments = $this->getRecursivelyReferencedFragments($operation); + + $allUsages = [$usages]; + foreach ($fragments as $fragment) { + $allUsages[] = $this->getVariableUsages($fragment); + } + $usages = array_merge(...$allUsages); + $this->recursiveVariableUsages[$operation] = $usages; + } + + return $usages; + } + + /** + * @return mixed[][] List of ['node' => VariableNode, 'type' => ?InputObjectType] + */ + private function getVariableUsages(HasSelectionSet $node) + { + $usages = $this->variableUsages[$node] ?? null; + + if ($usages === null) { + $newUsages = []; + $typeInfo = new TypeInfo($this->schema); + Visitor::visit( + $node, + Visitor::visitWithTypeInfo( + $typeInfo, + [ + NodeKind::VARIABLE_DEFINITION => static function () : bool { + return false; + }, + NodeKind::VARIABLE => static function (VariableNode $variable) use ( + &$newUsages, + $typeInfo + ) : void { + $newUsages[] = [ + 'node' => $variable, + 'type' => $typeInfo->getInputType(), + 'defaultValue' => $typeInfo->getDefaultValue(), + ]; + }, + ] + ) + ); + $usages = $newUsages; + $this->variableUsages[$node] = $usages; + } + + return $usages; + } + + /** + * @return FragmentDefinitionNode[] + */ + public function getRecursivelyReferencedFragments(OperationDefinitionNode $operation) + { + $fragments = $this->recursivelyReferencedFragments[$operation] ?? null; + + if ($fragments === null) { + $fragments = []; + $collectedNames = []; + $nodesToVisit = [$operation]; + while (count($nodesToVisit) > 0) { + $node = array_pop($nodesToVisit); + $spreads = $this->getFragmentSpreads($node); + foreach ($spreads as $spread) { + $fragName = $spread->name->value; + + if ($collectedNames[$fragName] ?? false) { + continue; + } + + $collectedNames[$fragName] = true; + $fragment = $this->getFragment($fragName); + if (! $fragment) { + continue; + } + + $fragments[] = $fragment; + $nodesToVisit[] = $fragment; + } + } + $this->recursivelyReferencedFragments[$operation] = $fragments; + } + + return $fragments; + } + + /** + * @param OperationDefinitionNode|FragmentDefinitionNode $node + * + * @return FragmentSpreadNode[] + */ + public function getFragmentSpreads(HasSelectionSet $node) : array + { + $spreads = $this->fragmentSpreads[$node] ?? null; + if ($spreads === null) { + $spreads = []; + /** @var SelectionSetNode[] $setsToVisit */ + $setsToVisit = [$node->selectionSet]; + while (count($setsToVisit) > 0) { + $set = array_pop($setsToVisit); + + foreach ($set->selections as $selection) { + if ($selection instanceof FragmentSpreadNode) { + $spreads[] = $selection; + } else { + assert($selection instanceof FieldNode || $selection instanceof InlineFragmentNode); + $selectionSet = $selection->selectionSet; + if ($selectionSet !== null) { + $setsToVisit[] = $selectionSet; + } + } + } + } + $this->fragmentSpreads[$node] = $spreads; + } + + return $spreads; + } + + /** + * @param string $name + * + * @return FragmentDefinitionNode|null + */ + public function getFragment($name) + { + $fragments = $this->fragments; + if (! $fragments) { + $fragments = []; + foreach ($this->getDocument()->definitions as $statement) { + if (! ($statement instanceof FragmentDefinitionNode)) { + continue; + } + + $fragments[$statement->name->value] = $statement; + } + $this->fragments = $fragments; + } + + return $fragments[$name] ?? null; + } + + public function getType() : ?OutputType + { + return $this->typeInfo->getType(); + } + + /** + * @return (CompositeType & Type) | null + */ + public function getParentType() : ?CompositeType + { + return $this->typeInfo->getParentType(); + } + + /** + * @return (Type & InputType) | null + */ + public function getInputType() : ?InputType + { + return $this->typeInfo->getInputType(); + } + + /** + * @return (Type&InputType)|null + */ + public function getParentInputType() : ?InputType + { + return $this->typeInfo->getParentInputType(); + } + + /** + * @return FieldDefinition + */ + public function getFieldDef() + { + return $this->typeInfo->getFieldDef(); + } + + public function getDirective() + { + return $this->typeInfo->getDirective(); + } + + public function getArgument() + { + return $this->typeInfo->getArgument(); + } +} diff --git a/lib/wp-graphql-1.17.0/webpack.config.js b/lib/wp-graphql-1.17.0/webpack.config.js new file mode 100644 index 00000000..55738900 --- /dev/null +++ b/lib/wp-graphql-1.17.0/webpack.config.js @@ -0,0 +1,32 @@ +const defaults = require("@wordpress/scripts/config/webpack.config"); +const path = require("path"); + + +module.exports = { + ...defaults, + entry: { + index: path.resolve(process.cwd(), "packages/wpgraphiql", "index.js"), + app: path.resolve(process.cwd(), "packages/wpgraphiql", "app.js"), + graphiqlQueryComposer: path.resolve( + process.cwd(), + "packages/graphiql-query-composer", + "index.js" + ), + graphiqlAuthSwitch: path.resolve( + process.cwd(), + "packages/graphiql-auth-switch", + "index.js" + ), + graphiqlFullscreenToggle: path.resolve( + process.cwd(), + "packages/graphiql-fullscreen-toggle", + "index.js" + ), + }, + externals: { + react: "React", + "react-dom": "ReactDOM", + wpGraphiQL: "wpGraphiQL", + graphql: "wpGraphiQL.GraphQL", + }, +}; diff --git a/lib/wp-graphql-1.17.0/wp-graphql.php b/lib/wp-graphql-1.17.0/wp-graphql.php new file mode 100644 index 00000000..bfaeb173 --- /dev/null +++ b/lib/wp-graphql-1.17.0/wp-graphql.php @@ -0,0 +1,190 @@ +' . + '

%s

' . + '', + esc_html__( 'WPGraphQL appears to have been installed without it\'s dependencies. It will not work properly until dependencies are installed. This likely means you have cloned WPGraphQL from Github and need to run the command `composer install`.', 'wp-graphql' ) + ); +} + +if ( defined( 'WP_CLI' ) && WP_CLI ) { + require_once plugin_dir_path( __FILE__ ) . 'cli/wp-cli.php'; +} + +/** + * Initialize the plugin tracker + * + * @return void + */ +function graphql_init_appsero_telemetry() { + // If the class doesn't exist, or code is being scanned by PHPSTAN, move on. + if ( ! class_exists( 'Appsero\Client' ) || defined( 'PHPSTAN' ) ) { + return; + } + + $client = new Appsero\Client( 'cd0d1172-95a0-4460-a36a-2c303807c9ef', 'WPGraphQL', __FILE__ ); + $insights = $client->insights(); + + // If the Appsero client has the add_plugin_data method, use it + if ( method_exists( $insights, 'add_plugin_data' ) ) { + // @phpstan-ignore-next-line + $insights->add_plugin_data(); + } + + // @phpstan-ignore-next-line + $insights->init(); +} + +graphql_init_appsero_telemetry(); diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php new file mode 100644 index 00000000..13663aca --- /dev/null +++ b/src/graphql/graphql-api.php @@ -0,0 +1,33 @@ + Date: Tue, 31 Oct 2023 15:32:44 +1100 Subject: [PATCH 02/45] Add the skeleton layout of the graphQL endpoint --- src/graphql/graphql-api.php | 112 +++++++++++++++++++++++++++++++++++- 1 file changed, 111 insertions(+), 1 deletion(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 13663aca..a45f19eb 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -12,7 +12,7 @@ /** * GraphQL API to offer an alternative to the REST API. */ -class GraphQLAPI { +class GraphQLApi { /** * Initiatilize the graphQL API, if its allowed * @@ -23,11 +23,121 @@ public static function init() { add_action( 'graphql_register_types', [ __CLASS__, 'register_types' ] ); } + /** + * Extract the blocks data for a post, and return back in the format expected by the graphQL API. + * + * @param WPGraphQL\Model\Post $post_model Post model for post. + * @return array + */ + public static function get_blocks_data( $post_model ) { + $post_id = $post_model->ID; + $post = get_post( $post_id ); + + $content_parser = new ContentParser(); + + // ToDo: Modify the parser to give a flattened array for the innerBlocks, if the right filter_option is provided. + $parser_results = $content_parser->parse( $post->post_content, $post_id ); + + // ToDo: Verify if this is better, or is returning it another way in graphQL is better. + if ( is_wp_error( $parser_results ) ) { + // Return API-safe error with extra data (e.g. stack trace) removed. + return new WP_Error( $parser_results->get_error_message() ); + } + + // ToDo: Transform the attributes into a tuple where the name is one field and the value is another. GraphQL requires an expected format. Might be worth turning this into a filter within the parser. + + // ToDo: Provide a filter to modify the output. Not sure if the individual block, or the entire thing should be allowed to be modified. + + return [ + 'blocks' => $parser_results, + ]; + } + /** * Register types and fields graphql integration. * * @return void */ public static function register_types() { + // Register the type corresponding to the attributes of each individual block. + register_graphql_object_type( + 'BlockDataAttribute', + [ + 'description' => 'Block data attribute', + 'fields' => [ + 'name' => [ + 'type' => 'String', + 'description' => 'Block data attribute name', + ], + 'value' => [ + 'type' => 'String', + 'description' => 'Block data attribute value', + ], + ], + ], + ); + + // Register the type corresponding to the individual block, with the above attribute. + register_graphql_type( + 'BlockData', + [ + 'description' => 'Block data', + 'fields' => [ + 'id' => [ + 'type' => 'String', + 'description' => 'ID of the block', + ], + 'parentID' => [ + 'type' => 'String', + 'description' => 'ID of the parent for this inner block, if it is an inner block. This will match the ID of the block', + ], + 'index' => [ + 'type' => 'String', + 'description' => 'For an inner block, this will identify the position of the block under the parent block.', + ], + 'name' => [ + 'type' => 'String', + 'description' => 'Block name', + ], + 'attributes' => [ + 'type' => [ + 'list_of' => 'BlockDataAttribute', + ], + 'description' => 'Block data attributes', + ], + 'innerBlocks' => [ + 'type' => [ 'list_of' => 'BlockData' ], + 'description' => 'Flattened list of inner blocks of this block', + ], + ], + ], + ); + + // Register the type corresponding to the list of individual blocks, with each item being the above type. + register_graphql_type( + 'BlocksData', + [ + 'description' => 'Data for all the blocks', + 'fields' => [ + 'blocks' => [ + 'type' => [ 'list_of' => 'BlockData' ], + 'description' => 'List of blocks data', + ], + ], + ], + ); + + // Register the field on every post type that supports 'editor'. + register_graphql_field( + 'NodeWithContentEditor', + 'BlocksData', + [ + 'type' => 'BlocksData', + 'description' => 'A block representation of post content', + 'resolve' => [ __CLASS__, 'get_blocks_data' ], + ] + ); } } + +GraphQLApi::init(); From a3869500108c39ac08fc6fd02826b2b02cdd031c Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 31 Oct 2023 16:39:54 +1100 Subject: [PATCH 03/45] Add the parent_id and id to each block --- src/graphql/graphql-api.php | 6 +++++- src/parser/content-parser.php | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index a45f19eb..e2525861 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -119,10 +119,14 @@ public static function register_types() { [ 'description' => 'Data for all the blocks', 'fields' => [ - 'blocks' => [ + 'blocks' => [ 'type' => [ 'list_of' => 'BlockData' ], 'description' => 'List of blocks data', ], + 'warnings' => [ + 'type' => [ 'list_of' => 'String' ], + 'description' => 'List of warnings related to processing the blocks data', + ], ], ], ); diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index 0b3cbf21..1ee25cbd 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -233,10 +233,17 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { $sourced_block = [ 'name' => $block_name, 'attributes' => $block_attributes, + 'id' => wp_unique_id(), ]; + // ToDo: If a parent id is present in the filter_options, set that on the block. Otherwise, if inner blocks are present then pass the id of the block in as a parent id. + if ( isset( $filter_options['parentId'] ) ) { + $sourced_block['parentId'] = $filter_options['parentId']; + } + if ( isset( $block['innerBlocks'] ) ) { - $inner_blocks = array_map( function ( $block ) use ( $registered_blocks, $filter_options ) { + $filter_options['parentId'] = $sourced_block['id']; + $inner_blocks = array_map( function ( $block ) use ( $registered_blocks, $filter_options ) { return $this->source_block( $block, $registered_blocks, $filter_options ); }, $block['innerBlocks'] ); From bf73c1c5fbece8eee9dadb49d7849915148ca1e1 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Wed, 1 Nov 2023 13:12:44 +1100 Subject: [PATCH 04/45] Transform the block attributes, and add an extra param to the sourcedBlock filter for this --- src/graphql/graphql-api.php | 47 +++++++++++++++++++++++++++++------ src/parser/content-parser.php | 3 ++- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index e2525861..c044f485 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -19,8 +19,15 @@ class GraphQLApi { * @access private */ public static function init() { - // ToDo: Add a filter to allow the graphQL API to be disabled. + $is_graphql_to_be_enabled = apply_filters( 'vip_block_data_api__is_graphql_enabled', true ); + + if ( ! $is_graphql_to_be_enabled ) { + return; + } + add_action( 'graphql_register_types', [ __CLASS__, 'register_types' ] ); + + add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'transform_block_attributes' ], 10, 5 ); } /** @@ -30,13 +37,14 @@ public static function init() { * @return array */ public static function get_blocks_data( $post_model ) { - $post_id = $post_model->ID; - $post = get_post( $post_id ); + $post_id = $post_model->ID; + $post = get_post( $post_id ); + $filter_options = [ 'graphQL' => true ]; $content_parser = new ContentParser(); // ToDo: Modify the parser to give a flattened array for the innerBlocks, if the right filter_option is provided. - $parser_results = $content_parser->parse( $post->post_content, $post_id ); + $parser_results = $content_parser->parse( $post->post_content, $post_id, $filter_options ); // ToDo: Verify if this is better, or is returning it another way in graphQL is better. if ( is_wp_error( $parser_results ) ) { @@ -53,6 +61,33 @@ public static function get_blocks_data( $post_model ) { ]; } + /** + * Transform the block attribute's format to the format expected by the graphQL API. + * + * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. + * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. + * @param int $post_id Post ID associated with the parsed block. + * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. + * @param array $filter_options Options to filter using, if any. + * + * @return array + */ + public static function transform_block_attributes( $sourced_block, $block_name, $post_id, $block, $filter_options ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed + if ( isset( $filter_options['graphQL'] ) && $filter_options['graphQL'] && isset( $sourced_block['attributes'] ) ) { + $sourced_block['attributes'] = array_map( + function ( $name, $value ) { + return [ + 'name' => $name, + 'value' => $value, + ]; + }, + array_keys( $sourced_block['attributes'] ), + array_values( $sourced_block['attributes'] ) + ); + } + return $sourced_block; + } + /** * Register types and fields graphql integration. * @@ -91,10 +126,6 @@ public static function register_types() { 'type' => 'String', 'description' => 'ID of the parent for this inner block, if it is an inner block. This will match the ID of the block', ], - 'index' => [ - 'type' => 'String', - 'description' => 'For an inner block, this will identify the position of the block under the parent block.', - ], 'name' => [ 'type' => 'String', 'description' => 'Block name', diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index 1ee25cbd..733c587c 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -267,8 +267,9 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. * @param int $post_id Post ID associated with the parsed block. * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. + * @param array $filter_options Options to filter using, if any. */ - $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block ); + $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block, $filter_options ); // If attributes are empty, explicitly use an object to avoid encoding an empty array in JSON. if ( empty( $sourced_block['attributes'] ) ) { From 83bfd74e9adaebc566b45c717d9d290a6de5cfec Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Wed, 1 Nov 2023 15:04:15 +1100 Subject: [PATCH 05/45] Require the new graphQL api file --- vip-block-data-api.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vip-block-data-api.php b/vip-block-data-api.php index 9c9c6caf..db3d96e4 100644 --- a/vip-block-data-api.php +++ b/vip-block-data-api.php @@ -34,6 +34,9 @@ // WPGraphQL 1.17.0. require_once __DIR__ . '/lib/wp-graphql-1.17.0/wp-graphql.php'; + // GraphQL API. + require_once __DIR__ . '/src/graphql/graphql-api.php'; + // /wp-json/ API. require_once __DIR__ . '/src/rest/rest-api.php'; From 7e42577a3ec1ca0967e871ff88834b63be2c98ca Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Wed, 1 Nov 2023 15:50:53 +1100 Subject: [PATCH 06/45] Set the minimum version of the plugin to be 8.0 --- composer.lock | 16 ++++++++-------- phpcs.xml.dist | 1 + src/graphql/graphql-api.php | 10 ++++------ vendor/autoload.php | 2 +- vendor/composer/autoload_real.php | 10 +++++----- vendor/composer/autoload_static.php | 8 ++++---- vendor/composer/installed.json | 18 +++++++++--------- vendor/composer/installed.php | 10 +++++----- vendor/composer/platform_check.php | 4 ++-- .../deprecation-contracts/composer.json | 4 ++-- .../symfony/deprecation-contracts/function.php | 2 +- vip-block-data-api.php | 10 +++++----- 12 files changed, 47 insertions(+), 48 deletions(-) diff --git a/composer.lock b/composer.lock index fb0b25f2..de0c5601 100644 --- a/composer.lock +++ b/composer.lock @@ -141,25 +141,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -188,7 +188,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" }, "funding": [ { @@ -204,7 +204,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/dom-crawler", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 01119deb..b3f32bd8 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -19,6 +19,7 @@ \.git/* /vendor/* + /lib/* diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index c044f485..cea3dbf8 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -24,10 +24,10 @@ public static function init() { if ( ! $is_graphql_to_be_enabled ) { return; } - - add_action( 'graphql_register_types', [ __CLASS__, 'register_types' ] ); add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'transform_block_attributes' ], 10, 5 ); + + add_action( 'graphql_register_types', [ __CLASS__, 'register_types' ] ); } /** @@ -56,9 +56,7 @@ public static function get_blocks_data( $post_model ) { // ToDo: Provide a filter to modify the output. Not sure if the individual block, or the entire thing should be allowed to be modified. - return [ - 'blocks' => $parser_results, - ]; + return $parser_results; } /** @@ -122,7 +120,7 @@ public static function register_types() { 'type' => 'String', 'description' => 'ID of the block', ], - 'parentID' => [ + 'parentId' => [ 'type' => 'String', 'description' => 'ID of the parent for this inner block, if it is an inner block. This will match the ID of the block', ], diff --git a/vendor/autoload.php b/vendor/autoload.php index 14c7b319..debeea13 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -22,4 +22,4 @@ require_once __DIR__ . '/composer/autoload_real.php'; -return ComposerAutoloaderInit5a91735b735b03b013d5e95913d80f8f::getLoader(); +return ComposerAutoloaderInit0e98fdf7ca952c8f4cb3c82e525d431a::getLoader(); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 6d3d3223..8f757434 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit5a91735b735b03b013d5e95913d80f8f +class ComposerAutoloaderInit0e98fdf7ca952c8f4cb3c82e525d431a { private static $loader; @@ -24,16 +24,16 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; - spl_autoload_register(array('ComposerAutoloaderInit5a91735b735b03b013d5e95913d80f8f', 'loadClassLoader'), true, true); + spl_autoload_register(array('ComposerAutoloaderInit0e98fdf7ca952c8f4cb3c82e525d431a', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); - spl_autoload_unregister(array('ComposerAutoloaderInit5a91735b735b03b013d5e95913d80f8f', 'loadClassLoader')); + spl_autoload_unregister(array('ComposerAutoloaderInit0e98fdf7ca952c8f4cb3c82e525d431a', 'loadClassLoader')); require __DIR__ . '/autoload_static.php'; - call_user_func(\Composer\Autoload\ComposerStaticInit5a91735b735b03b013d5e95913d80f8f::getInitializer($loader)); + call_user_func(\Composer\Autoload\ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a::getInitializer($loader)); $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInit5a91735b735b03b013d5e95913d80f8f::$files; + $filesToLoad = \Composer\Autoload\ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a::$files; $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 480f01b3..f66e5e9d 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -4,7 +4,7 @@ namespace Composer\Autoload; -class ComposerStaticInit5a91735b735b03b013d5e95913d80f8f +class ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a { public static $files = array ( 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', @@ -67,9 +67,9 @@ class ComposerStaticInit5a91735b735b03b013d5e95913d80f8f public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit5a91735b735b03b013d5e95913d80f8f::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit5a91735b735b03b013d5e95913d80f8f::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit5a91735b735b03b013d5e95913d80f8f::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit0e98fdf7ca952c8f4cb3c82e525d431a::$classMap; }, null, ClassLoader::class); } diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f9fcf365..9d39994d 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -141,27 +141,27 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", - "version_normalized": "2.5.2.0", + "version": "v3.0.2", + "version_normalized": "3.0.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=8.0.2" }, - "time": "2022-01-02T09:53:40+00:00", + "time": "2022-01-02T09:55:41+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -191,7 +191,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index a5c18f11..77eb1f91 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'automattic/vip-block-data-api', 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '3b1bb5bd0dc9edf8960335e8d0e06ba83930868d', + 'reference' => '83bfd74e9adaebc566b45c717d9d290a6de5cfec', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'automattic/vip-block-data-api' => array( 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '3b1bb5bd0dc9edf8960335e8d0e06ba83930868d', + 'reference' => '83bfd74e9adaebc566b45c717d9d290a6de5cfec', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -38,9 +38,9 @@ 'dev_requirement' => false, ), 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v2.5.2', - 'version' => '2.5.2.0', - 'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66', + 'pretty_version' => 'v3.0.2', + 'version' => '3.0.2.0', + 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index a8b98d5c..b168ddd5 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70205)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 80002)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json index cc7cc123..1c1b4ba0 100644 --- a/vendor/symfony/deprecation-contracts/composer.json +++ b/vendor/symfony/deprecation-contracts/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=7.1" + "php": ">=8.0.2" }, "autoload": { "files": [ @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "2.5-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php index d4371504..2d56512b 100644 --- a/vendor/symfony/deprecation-contracts/function.php +++ b/vendor/symfony/deprecation-contracts/function.php @@ -20,7 +20,7 @@ * * @author Nicolas Grekas */ - function trigger_deprecation(string $package, string $version, string $message, ...$args): void + function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void { @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); } diff --git a/vip-block-data-api.php b/vip-block-data-api.php index db3d96e4..b312774e 100644 --- a/vip-block-data-api.php +++ b/vip-block-data-api.php @@ -5,10 +5,10 @@ * Description: Access Gutenberg block data in JSON via the REST API. * Author: WordPress VIP * Text Domain: vip-block-data-api - * Version: 1.0.3 - * Requires at least: 5.6.0 - * Tested up to: 6.3.0 - * Requires PHP: 7.4 + * Version: 1.1.0 + * Requires at least: 5.9 + * Tested up to: 6.3 + * Requires PHP: 8.0 * License: GPL-3 * License URI: https://www.gnu.org/licenses/gpl-3.0.html * @@ -20,7 +20,7 @@ if ( ! defined( 'VIP_BLOCK_DATA_API_LOADED' ) ) { define( 'VIP_BLOCK_DATA_API_LOADED', true ); - define( 'WPCOMVIP__BLOCK_DATA_API__PLUGIN_VERSION', '1.0.3' ); + define( 'WPCOMVIP__BLOCK_DATA_API__PLUGIN_VERSION', '1.1.0' ); define( 'WPCOMVIP__BLOCK_DATA_API__REST_ROUTE', 'vip-block-data-api/v1' ); // Analytics related configs. From cf0286dbc153f685cf84a7ec39aaa16348f870ec Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Wed, 8 Nov 2023 14:55:15 +0000 Subject: [PATCH 07/45] Remove the graphQL plugin from the plugin itself. --- lib/wp-graphql-1.17.0/.codeclimate.yml | 5 - lib/wp-graphql-1.17.0/.nvmrc | 1 - lib/wp-graphql-1.17.0/.prettierignore | 3 - lib/wp-graphql-1.17.0/.prettierrc.json | 1 - lib/wp-graphql-1.17.0/.remarkrc | 21 - lib/wp-graphql-1.17.0/LICENSE | 674 ----- lib/wp-graphql-1.17.0/access-functions.php | 920 ------- lib/wp-graphql-1.17.0/activation.php | 17 - lib/wp-graphql-1.17.0/babel.config.js | 8 - lib/wp-graphql-1.17.0/build/app.asset.php | 1 - lib/wp-graphql-1.17.0/build/app.css | 1800 ------------- lib/wp-graphql-1.17.0/build/app.js | 38 - .../build/graphiqlAuthSwitch.asset.php | 1 - .../build/graphiqlAuthSwitch.js | 5 - .../build/graphiqlFullscreenToggle.asset.php | 1 - .../build/graphiqlFullscreenToggle.css | 1 - .../build/graphiqlFullscreenToggle.js | 1 - .../build/graphiqlQueryComposer.asset.php | 1 - .../build/graphiqlQueryComposer.css | 1 - .../build/graphiqlQueryComposer.js | 14 - lib/wp-graphql-1.17.0/build/index.asset.php | 1 - lib/wp-graphql-1.17.0/build/index.js | 1 - lib/wp-graphql-1.17.0/build/style-app.css | 1 - lib/wp-graphql-1.17.0/cli/wp-cli.php | 64 - lib/wp-graphql-1.17.0/constants.php | 38 - lib/wp-graphql-1.17.0/deactivation.php | 60 - lib/wp-graphql-1.17.0/phpcs.xml.dist | 165 -- lib/wp-graphql-1.17.0/readme.txt | 1557 ----------- lib/wp-graphql-1.17.0/src/Admin/Admin.php | 70 - .../src/Admin/GraphiQL/GraphiQL.php | 249 -- .../src/Admin/Settings/Settings.php | 281 -- .../src/Admin/Settings/SettingsRegistry.php | 789 ------ lib/wp-graphql-1.17.0/src/AppContext.php | 212 -- .../src/Connection/Comments.php | 38 - .../src/Connection/MenuItems.php | 28 - .../src/Connection/PostObjects.php | 38 - .../src/Connection/Taxonomies.php | 18 - .../src/Connection/TermObjects.php | 38 - .../src/Connection/Users.php | 28 - .../src/Data/CommentMutation.php | 161 -- lib/wp-graphql-1.17.0/src/Data/Config.php | 477 ---- .../Connection/AbstractConnectionResolver.php | 1030 -------- .../Connection/CommentConnectionResolver.php | 338 --- .../ContentTypeConnectionResolver.php | 90 - .../EnqueuedScriptsConnectionResolver.php | 120 - .../EnqueuedStylesheetConnectionResolver.php | 128 - .../Connection/MenuConnectionResolver.php | 50 - .../Connection/MenuItemConnectionResolver.php | 125 - .../Connection/PluginConnectionResolver.php | 261 -- .../PostObjectConnectionResolver.php | 622 ----- .../Connection/TaxonomyConnectionResolver.php | 90 - .../TermObjectConnectionResolver.php | 324 --- .../Connection/ThemeConnectionResolver.php | 88 - .../Connection/UserConnectionResolver.php | 299 --- .../Connection/UserRoleConnectionResolver.php | 97 - .../src/Data/Cursor/AbstractCursor.php | 329 --- .../src/Data/Cursor/CommentObjectCursor.php | 148 -- .../src/Data/Cursor/CursorBuilder.php | 176 -- .../src/Data/Cursor/PostObjectCursor.php | 293 --- .../src/Data/Cursor/TermObjectCursor.php | 227 -- .../src/Data/Cursor/UserCursor.php | 255 -- lib/wp-graphql-1.17.0/src/Data/DataSource.php | 727 ----- .../src/Data/Loader/AbstractDataLoader.php | 509 ---- .../src/Data/Loader/CommentAuthorLoader.php | 58 - .../src/Data/Loader/CommentLoader.php | 75 - .../src/Data/Loader/EnqueuedScriptLoader.php | 35 - .../Data/Loader/EnqueuedStylesheetLoader.php | 33 - .../src/Data/Loader/PluginLoader.php | 60 - .../src/Data/Loader/PostObjectLoader.php | 136 - .../src/Data/Loader/PostTypeLoader.php | 46 - .../src/Data/Loader/TaxonomyLoader.php | 46 - .../src/Data/Loader/TermObjectLoader.php | 106 - .../src/Data/Loader/ThemeLoader.php | 52 - .../src/Data/Loader/UserLoader.php | 179 -- .../src/Data/Loader/UserRoleLoader.php | 52 - .../src/Data/MediaItemMutation.php | 144 - .../src/Data/NodeResolver.php | 622 ----- .../src/Data/PostObjectMutation.php | 496 ---- .../src/Data/TermObjectMutation.php | 87 - .../src/Data/UserMutation.php | 314 --- lib/wp-graphql-1.17.0/src/Model/Avatar.php | 83 - lib/wp-graphql-1.17.0/src/Model/Comment.php | 194 -- .../src/Model/CommentAuthor.php | 66 - lib/wp-graphql-1.17.0/src/Model/Menu.php | 114 - lib/wp-graphql-1.17.0/src/Model/MenuItem.php | 206 -- lib/wp-graphql-1.17.0/src/Model/Model.php | 552 ---- lib/wp-graphql-1.17.0/src/Model/Plugin.php | 96 - lib/wp-graphql-1.17.0/src/Model/Post.php | 852 ------ lib/wp-graphql-1.17.0/src/Model/PostType.php | 218 -- lib/wp-graphql-1.17.0/src/Model/Taxonomy.php | 160 -- lib/wp-graphql-1.17.0/src/Model/Term.php | 211 -- lib/wp-graphql-1.17.0/src/Model/Theme.php | 110 - lib/wp-graphql-1.17.0/src/Model/User.php | 271 -- lib/wp-graphql-1.17.0/src/Model/UserRole.php | 86 - .../src/Mutation/CommentCreate.php | 203 -- .../src/Mutation/CommentDelete.php | 136 - .../src/Mutation/CommentRestore.php | 106 - .../src/Mutation/CommentUpdate.php | 144 - .../src/Mutation/MediaItemCreate.php | 328 --- .../src/Mutation/MediaItemDelete.php | 146 -- .../src/Mutation/MediaItemUpdate.php | 171 -- .../src/Mutation/PostObjectCreate.php | 379 --- .../src/Mutation/PostObjectDelete.php | 167 -- .../src/Mutation/PostObjectUpdate.php | 222 -- .../src/Mutation/ResetUserPassword.php | 114 - .../src/Mutation/SendPasswordResetEmail.php | 258 -- .../src/Mutation/TermObjectCreate.php | 197 -- .../src/Mutation/TermObjectDelete.php | 153 -- .../src/Mutation/TermObjectUpdate.php | 182 -- .../src/Mutation/UpdateSettings.php | 221 -- .../src/Mutation/UserCreate.php | 187 -- .../src/Mutation/UserDelete.php | 168 -- .../src/Mutation/UserRegister.php | 171 -- .../src/Mutation/UserUpdate.php | 129 - .../src/Registry/SchemaRegistry.php | 59 - .../src/Registry/TypeRegistry.php | 1363 ---------- .../src/Registry/Utils/PostObject.php | 589 ----- .../src/Registry/Utils/TermObject.php | 339 --- lib/wp-graphql-1.17.0/src/Request.php | 798 ------ lib/wp-graphql-1.17.0/src/Router.php | 564 ---- .../ValidationRules/DisableIntrospection.php | 24 - .../src/Server/ValidationRules/QueryDepth.php | 173 -- .../ValidationRules/RequireAuthentication.php | 106 - lib/wp-graphql-1.17.0/src/Server/WPHelper.php | 99 - .../src/Type/Connection/Comments.php | 263 -- .../src/Type/Connection/MenuItems.php | 128 - .../src/Type/Connection/PostObjects.php | 599 ----- .../src/Type/Connection/Taxonomies.php | 44 - .../src/Type/Connection/TermObjects.php | 220 -- .../src/Type/Connection/Users.php | 207 -- .../src/Type/Enum/AvatarRatingEnum.php | 37 - .../src/Type/Enum/CommentNodeIdTypeEnum.php | 36 - .../src/Type/Enum/CommentStatusEnum.php | 38 - .../Enum/CommentsConnectionOrderbyEnum.php | 85 - .../src/Type/Enum/ContentNodeIdTypeEnum.php | 81 - .../src/Type/Enum/ContentTypeEnum.php | 84 - .../src/Type/Enum/ContentTypeIdTypeEnum.php | 32 - .../src/Type/Enum/MediaItemSizeEnum.php | 51 - .../src/Type/Enum/MediaItemStatusEnum.php | 46 - .../src/Type/Enum/MenuItemNodeIdTypeEnum.php | 36 - .../src/Type/Enum/MenuLocationEnum.php | 47 - .../src/Type/Enum/MenuNodeIdTypeEnum.php | 51 - .../src/Type/Enum/MimeTypeEnum.php | 46 - .../src/Type/Enum/OrderEnum.php | 31 - .../src/Type/Enum/PluginStatusEnum.php | 75 - .../Type/Enum/PostObjectFieldFormatEnum.php | 32 - .../PostObjectsConnectionDateColumnEnum.php | 30 - .../Enum/PostObjectsConnectionOrderbyEnum.php | 62 - .../src/Type/Enum/PostStatusEnum.php | 54 - .../src/Type/Enum/RelationEnum.php | 32 - .../src/Type/Enum/TaxonomyEnum.php | 46 - .../src/Type/Enum/TaxonomyIdTypeEnum.php | 32 - .../src/Type/Enum/TermNodeIdTypeEnum.php | 74 - .../Enum/TermObjectsConnectionOrderbyEnum.php | 49 - .../src/Type/Enum/TimezoneEnum.php | 194 -- .../src/Type/Enum/UserNodeIdTypeEnum.php | 60 - .../src/Type/Enum/UserRoleEnum.php | 40 - .../Type/Enum/UsersConnectionOrderbyEnum.php | 54 - .../Enum/UsersConnectionSearchColumnEnum.php | 42 - .../src/Type/Input/DateInput.php | 33 - .../src/Type/Input/DateQueryInput.php | 74 - .../PostObjectsConnectionOrderbyInput.php | 34 - .../Input/UsersConnectionOrderbyInput.php | 32 - .../src/Type/InterfaceType/Commenter.php | 74 - .../src/Type/InterfaceType/Connection.php | 38 - .../src/Type/InterfaceType/ContentNode.php | 174 -- .../Type/InterfaceType/ContentTemplate.php | 86 - .../Type/InterfaceType/DatabaseIdentifier.php | 31 - .../src/Type/InterfaceType/Edge.php | 34 - .../src/Type/InterfaceType/EnqueuedAsset.php | 83 - .../InterfaceType/HierarchicalContentNode.php | 45 - .../Type/InterfaceType/HierarchicalNode.php | 44 - .../InterfaceType/HierarchicalTermNode.php | 45 - .../Type/InterfaceType/MenuItemLinkable.php | 47 - .../src/Type/InterfaceType/Node.php | 30 - .../src/Type/InterfaceType/NodeWithAuthor.php | 33 - .../Type/InterfaceType/NodeWithComments.php | 33 - .../InterfaceType/NodeWithContentEditor.php | 44 - .../Type/InterfaceType/NodeWithExcerpt.php | 45 - .../InterfaceType/NodeWithFeaturedImage.php | 55 - .../InterfaceType/NodeWithPageAttributes.php | 30 - .../Type/InterfaceType/NodeWithRevisions.php | 30 - .../Type/InterfaceType/NodeWithTemplate.php | 30 - .../src/Type/InterfaceType/NodeWithTitle.php | 45 - .../Type/InterfaceType/NodeWithTrackbacks.php | 38 - .../Type/InterfaceType/OneToOneConnection.php | 31 - .../src/Type/InterfaceType/PageInfo.php | 64 - .../src/Type/InterfaceType/Previewable.php | 51 - .../src/Type/InterfaceType/TermNode.php | 112 - .../UniformResourceIdentifiable.php | 76 - .../src/Type/ObjectType/Avatar.php | 69 - .../src/Type/ObjectType/Comment.php | 131 - .../src/Type/ObjectType/CommentAuthor.php | 104 - .../src/Type/ObjectType/ContentType.php | 136 - .../src/Type/ObjectType/EnqueuedScript.php | 50 - .../Type/ObjectType/EnqueuedStylesheet.php | 50 - .../src/Type/ObjectType/MediaDetails.php | 83 - .../src/Type/ObjectType/MediaItemMeta.php | 86 - .../src/Type/ObjectType/MediaSize.php | 77 - .../src/Type/ObjectType/Menu.php | 56 - .../src/Type/ObjectType/MenuItem.php | 198 -- .../src/Type/ObjectType/Plugin.php | 66 - .../src/Type/ObjectType/PostObject.php | 48 - .../Type/ObjectType/PostTypeLabelDetails.php | 193 -- .../src/Type/ObjectType/RootMutation.php | 35 - .../src/Type/ObjectType/RootQuery.php | 963 ------- .../src/Type/ObjectType/SettingGroup.php | 125 - .../src/Type/ObjectType/Settings.php | 128 - .../src/Type/ObjectType/Taxonomy.php | 130 - .../src/Type/ObjectType/TermObject.php | 29 - .../src/Type/ObjectType/Theme.php | 77 - .../src/Type/ObjectType/User.php | 207 -- .../src/Type/ObjectType/UserRole.php | 47 - .../src/Type/Union/MenuItemObjectUnion.php | 93 - .../src/Type/Union/PostObjectUnion.php | 65 - .../src/Type/Union/TermObjectUnion.php | 66 - .../src/Type/WPConnectionType.php | 674 ----- lib/wp-graphql-1.17.0/src/Type/WPEnumType.php | 100 - .../src/Type/WPInputObjectType.php | 115 - .../src/Type/WPInterfaceTrait.php | 106 - .../src/Type/WPInterfaceType.php | 174 -- .../src/Type/WPMutationType.php | 355 --- .../src/Type/WPObjectType.php | 226 -- lib/wp-graphql-1.17.0/src/Type/WPScalar.php | 27 - .../src/Type/WPUnionType.php | 107 - lib/wp-graphql-1.17.0/src/Types.php | 40 - lib/wp-graphql-1.17.0/src/Utils/DebugLog.php | 131 - .../src/Utils/InstrumentSchema.php | 273 -- lib/wp-graphql-1.17.0/src/Utils/Preview.php | 58 - .../src/Utils/QueryAnalyzer.php | 800 ------ lib/wp-graphql-1.17.0/src/Utils/QueryLog.php | 171 -- lib/wp-graphql-1.17.0/src/Utils/Tracing.php | 360 --- lib/wp-graphql-1.17.0/src/Utils/Utils.php | 367 --- lib/wp-graphql-1.17.0/src/WPGraphQL.php | 823 ------ lib/wp-graphql-1.17.0/src/WPSchema.php | 54 - .../vendor/appsero/client/readme.md | 266 -- .../vendor/appsero/client/src/Client.php | 280 -- .../vendor/appsero/client/src/Insights.php | 1184 --------- .../vendor/appsero/client/src/License.php | 809 ------ .../vendor/appsero/client/src/Updater.php | 258 -- lib/wp-graphql-1.17.0/vendor/autoload.php | 25 - .../vendor/composer/ClassLoader.php | 579 ---- .../vendor/composer/InstalledVersions.php | 359 --- lib/wp-graphql-1.17.0/vendor/composer/LICENSE | 21 - .../vendor/composer/autoload_classmap.php | 420 --- .../vendor/composer/autoload_namespaces.php | 9 - .../vendor/composer/autoload_psr4.php | 12 - .../vendor/composer/autoload_real.php | 38 - .../vendor/composer/autoload_static.php | 462 ---- .../vendor/composer/installed.json | 171 -- .../vendor/composer/installed.php | 50 - .../vendor/composer/platform_check.php | 26 - .../ivome/graphql-relay-php/.travis.yml | 19 - .../vendor/ivome/graphql-relay-php/LICENSE | 29 - .../ivome/graphql-relay-php/contributors.txt | 1 - .../ivome/graphql-relay-php/phpunit.xml | 12 - .../src/Connection/ArrayConnection.php | 178 -- .../src/Connection/Connection.php | 195 -- .../src/Mutation/Mutation.php | 120 - .../ivome/graphql-relay-php/src/Node/Node.php | 117 - .../graphql-relay-php/src/Node/Plural.php | 69 - .../ivome/graphql-relay-php/src/Relay.php | 219 -- .../tests/Connection/ArrayConnectionTest.php | 991 ------- .../tests/Connection/ConnectionTest.php | 278 -- .../Connection/SeparateConnectionTest.php | 284 -- .../tests/Mutation/MutationTest.php | 565 ---- .../graphql-relay-php/tests/Node/NodeTest.php | 411 --- .../tests/Node/PluralTest.php | 186 -- .../graphql-relay-php/tests/RelayTest.php | 73 - .../tests/StarWarsConnectionTest.php | 291 -- .../graphql-relay-php/tests/StarWarsData.php | 139 - .../tests/StarWarsMutationTest.php | 60 - .../StarWarsObjectIdentificationTest.php | 131 - .../tests/StarWarsSchema.php | 379 --- .../webonyx/graphql-php/.github/FUNDING.yml | 2 - .../.github/workflows/validate.yml | 69 - .../vendor/webonyx/graphql-php/LICENSE | 21 - .../vendor/webonyx/graphql-php/UPGRADE.md | 731 ------ .../graphql-php/docs/best-practices.md | 9 - .../graphql-php/docs/complementary-tools.md | 28 - .../webonyx/graphql-php/docs/concepts.md | 139 - .../webonyx/graphql-php/docs/data-fetching.md | 274 -- .../graphql-php/docs/error-handling.md | 199 -- .../graphql-php/docs/executing-queries.md | 208 -- .../graphql-php/docs/getting-started.md | 125 - .../webonyx/graphql-php/docs/how-it-works.md | 35 - .../vendor/webonyx/graphql-php/docs/index.md | 55 - .../webonyx/graphql-php/docs/reference.md | 2332 ----------------- .../webonyx/graphql-php/docs/security.md | 94 - .../docs/type-system/directives.md | 61 - .../docs/type-system/enum-types.md | 182 -- .../graphql-php/docs/type-system/index.md | 127 - .../docs/type-system/input-types.md | 172 -- .../docs/type-system/interfaces.md | 174 -- .../docs/type-system/lists-and-nonnulls.md | 62 - .../docs/type-system/object-types.md | 210 -- .../docs/type-system/scalar-types.md | 130 - .../graphql-php/docs/type-system/schema.md | 194 -- .../docs/type-system/type-language.md | 91 - .../graphql-php/docs/type-system/unions.md | 39 - .../webonyx/graphql-php/phpstan-baseline.neon | 647 ----- .../webonyx/graphql-php/src/Deferred.php | 26 - .../graphql-php/src/Error/ClientAware.php | 36 - .../graphql-php/src/Error/DebugFlag.php | 17 - .../webonyx/graphql-php/src/Error/Error.php | 384 --- .../graphql-php/src/Error/FormattedError.php | 418 --- .../src/Error/InvariantViolation.php | 20 - .../graphql-php/src/Error/SyntaxError.php | 25 - .../graphql-php/src/Error/UserError.php | 29 - .../webonyx/graphql-php/src/Error/Warning.php | 121 - .../src/Exception/InvalidArgument.php | 20 - .../src/Executor/ExecutionContext.php | 78 - .../src/Executor/ExecutionResult.php | 166 -- .../graphql-php/src/Executor/Executor.php | 190 -- .../src/Executor/ExecutorImplementation.php | 15 - .../Promise/Adapter/AmpPromiseAdapter.php | 147 -- .../Promise/Adapter/ReactPromiseAdapter.php | 100 - .../Executor/Promise/Adapter/SyncPromise.php | 202 -- .../Promise/Adapter/SyncPromiseAdapter.php | 180 -- .../src/Executor/Promise/Promise.php | 40 - .../src/Executor/Promise/PromiseAdapter.php | 92 - .../src/Executor/ReferenceExecutor.php | 1305 --------- .../graphql-php/src/Executor/Values.php | 334 --- .../src/Experimental/Executor/Collector.php | 282 -- .../Executor/CoroutineContext.php | 57 - .../Executor/CoroutineContextShared.php | 62 - .../Executor/CoroutineExecutor.php | 970 ------- .../src/Experimental/Executor/Runtime.php | 26 - .../src/Experimental/Executor/Strand.php | 35 - .../webonyx/graphql-php/src/GraphQL.php | 365 --- .../src/Language/AST/ArgumentNode.php | 17 - .../src/Language/AST/BooleanValueNode.php | 14 - .../src/Language/AST/DefinitionNode.php | 14 - .../Language/AST/DirectiveDefinitionNode.php | 26 - .../src/Language/AST/DirectiveNode.php | 17 - .../src/Language/AST/DocumentNode.php | 15 - .../Language/AST/EnumTypeDefinitionNode.php | 23 - .../Language/AST/EnumTypeExtensionNode.php | 20 - .../Language/AST/EnumValueDefinitionNode.php | 20 - .../src/Language/AST/EnumValueNode.php | 14 - .../Language/AST/ExecutableDefinitionNode.php | 14 - .../src/Language/AST/FieldDefinitionNode.php | 26 - .../src/Language/AST/FieldNode.php | 26 - .../src/Language/AST/FloatValueNode.php | 14 - .../Language/AST/FragmentDefinitionNode.php | 31 - .../src/Language/AST/FragmentSpreadNode.php | 17 - .../src/Language/AST/HasSelectionSet.php | 15 - .../src/Language/AST/InlineFragmentNode.php | 20 - .../AST/InputObjectTypeDefinitionNode.php | 23 - .../AST/InputObjectTypeExtensionNode.php | 20 - .../Language/AST/InputValueDefinitionNode.php | 26 - .../src/Language/AST/IntValueNode.php | 14 - .../AST/InterfaceTypeDefinitionNode.php | 26 - .../AST/InterfaceTypeExtensionNode.php | 23 - .../src/Language/AST/ListTypeNode.php | 14 - .../src/Language/AST/ListValueNode.php | 14 - .../graphql-php/src/Language/AST/Location.php | 79 - .../graphql-php/src/Language/AST/NameNode.php | 14 - .../src/Language/AST/NamedTypeNode.php | 14 - .../graphql-php/src/Language/AST/Node.php | 161 -- .../graphql-php/src/Language/AST/NodeKind.php | 138 - .../graphql-php/src/Language/AST/NodeList.php | 154 -- .../src/Language/AST/NonNullTypeNode.php | 14 - .../src/Language/AST/NullValueNode.php | 11 - .../src/Language/AST/ObjectFieldNode.php | 17 - .../Language/AST/ObjectTypeDefinitionNode.php | 26 - .../Language/AST/ObjectTypeExtensionNode.php | 23 - .../src/Language/AST/ObjectValueNode.php | 14 - .../Language/AST/OperationDefinitionNode.php | 27 - .../AST/OperationTypeDefinitionNode.php | 21 - .../Language/AST/ScalarTypeDefinitionNode.php | 20 - .../Language/AST/ScalarTypeExtensionNode.php | 17 - .../src/Language/AST/SchemaDefinitionNode.php | 17 - .../Language/AST/SchemaTypeExtensionNode.php | 17 - .../src/Language/AST/SelectionNode.php | 12 - .../src/Language/AST/SelectionSetNode.php | 14 - .../src/Language/AST/StringValueNode.php | 17 - .../src/Language/AST/TypeDefinitionNode.php | 17 - .../src/Language/AST/TypeExtensionNode.php | 18 - .../graphql-php/src/Language/AST/TypeNode.php | 14 - .../Language/AST/TypeSystemDefinitionNode.php | 18 - .../Language/AST/UnionTypeDefinitionNode.php | 23 - .../Language/AST/UnionTypeExtensionNode.php | 20 - .../src/Language/AST/ValueNode.php | 20 - .../Language/AST/VariableDefinitionNode.php | 23 - .../src/Language/AST/VariableNode.php | 14 - .../src/Language/DirectiveLocation.php | 61 - .../graphql-php/src/Language/Lexer.php | 826 ------ .../graphql-php/src/Language/Parser.php | 1780 ------------- .../graphql-php/src/Language/Printer.php | 539 ---- .../graphql-php/src/Language/Source.php | 85 - .../src/Language/SourceLocation.php | 55 - .../graphql-php/src/Language/Token.php | 119 - .../graphql-php/src/Language/Visitor.php | 538 ---- .../src/Language/VisitorOperation.php | 17 - .../webonyx/graphql-php/src/Server/Helper.php | 629 ----- .../src/Server/OperationParams.php | 144 - .../graphql-php/src/Server/RequestError.php | 33 - .../graphql-php/src/Server/ServerConfig.php | 330 --- .../graphql-php/src/Server/StandardServer.php | 186 -- .../src/Type/Definition/AbstractType.php | 23 - .../src/Type/Definition/BooleanType.php | 65 - .../src/Type/Definition/CompositeType.php | 16 - .../src/Type/Definition/CustomScalarType.php | 76 - .../src/Type/Definition/Directive.php | 185 -- .../src/Type/Definition/EnumType.php | 229 -- .../Type/Definition/EnumValueDefinition.php | 50 - .../src/Type/Definition/FieldArgument.php | 135 - .../src/Type/Definition/FieldDefinition.php | 331 --- .../src/Type/Definition/FloatType.php | 89 - .../src/Type/Definition/HasFieldsType.php | 33 - .../src/Type/Definition/IDType.php | 80 - .../src/Type/Definition/ImplementingType.php | 20 - .../src/Type/Definition/InputObjectField.php | 171 -- .../src/Type/Definition/InputObjectType.php | 121 - .../src/Type/Definition/InputType.php | 22 - .../src/Type/Definition/IntType.php | 118 - .../src/Type/Definition/InterfaceType.php | 154 -- .../src/Type/Definition/LeafType.php | 61 - .../src/Type/Definition/ListOfType.php | 41 - .../src/Type/Definition/NamedType.php | 18 - .../src/Type/Definition/NonNull.php | 44 - .../src/Type/Definition/NullableType.php | 20 - .../src/Type/Definition/ObjectType.php | 206 -- .../src/Type/Definition/OutputType.php | 19 - .../src/Type/Definition/QueryPlan.php | 296 --- .../src/Type/Definition/ResolveInfo.php | 255 -- .../src/Type/Definition/ScalarType.php | 51 - .../src/Type/Definition/StringType.php | 84 - .../graphql-php/src/Type/Definition/Type.php | 355 --- .../src/Type/Definition/TypeWithFields.php | 81 - .../src/Type/Definition/UnionType.php | 150 -- .../src/Type/Definition/UnmodifiedType.php | 19 - .../Definition/UnresolvedFieldDefinition.php | 71 - .../src/Type/Definition/WrappingType.php | 10 - .../graphql-php/src/Type/Introspection.php | 845 ------ .../webonyx/graphql-php/src/Type/Schema.php | 603 ----- .../graphql-php/src/Type/SchemaConfig.php | 313 --- .../src/Type/SchemaValidationContext.php | 1084 -------- .../webonyx/graphql-php/src/Type/TypeKind.php | 17 - .../Validation/InputObjectCircularRefs.php | 105 - .../webonyx/graphql-php/src/Utils/AST.php | 641 ----- .../src/Utils/ASTDefinitionBuilder.php | 493 ---- .../graphql-php/src/Utils/BlockString.php | 77 - .../src/Utils/BreakingChangesFinder.php | 938 ------- .../src/Utils/BuildClientSchema.php | 496 ---- .../graphql-php/src/Utils/BuildSchema.php | 237 -- .../src/Utils/InterfaceImplementations.php | 48 - .../graphql-php/src/Utils/MixedStore.php | 247 -- .../webonyx/graphql-php/src/Utils/PairSet.php | 66 - .../graphql-php/src/Utils/SchemaExtender.php | 650 ----- .../graphql-php/src/Utils/SchemaPrinter.php | 508 ---- .../graphql-php/src/Utils/TypeComparators.php | 138 - .../graphql-php/src/Utils/TypeInfo.php | 504 ---- .../webonyx/graphql-php/src/Utils/Utils.php | 658 ----- .../webonyx/graphql-php/src/Utils/Value.php | 311 --- .../src/Validator/ASTValidationContext.php | 54 - .../src/Validator/DocumentValidator.php | 361 --- .../Validator/Rules/CustomValidationRule.php | 30 - .../Validator/Rules/DisableIntrospection.php | 57 - .../Validator/Rules/ExecutableDefinitions.php | 50 - .../Validator/Rules/FieldsOnCorrectType.php | 166 -- .../Rules/FragmentsOnCompositeTypes.php | 64 - .../Validator/Rules/KnownArgumentNames.php | 80 - .../Rules/KnownArgumentNamesOnDirectives.php | 115 - .../src/Validator/Rules/KnownDirectives.php | 200 -- .../Validator/Rules/KnownFragmentNames.php | 40 - .../src/Validator/Rules/KnownTypeNames.php | 74 - .../Rules/LoneAnonymousOperation.php | 58 - .../Validator/Rules/LoneSchemaDefinition.php | 59 - .../src/Validator/Rules/NoFragmentCycles.php | 112 - .../Validator/Rules/NoUndefinedVariables.php | 64 - .../src/Validator/Rules/NoUnusedFragments.php | 70 - .../src/Validator/Rules/NoUnusedVariables.php | 66 - .../Rules/OverlappingFieldsCanBeMerged.php | 897 ------- .../Rules/PossibleFragmentSpreads.php | 160 -- .../Rules/ProvidedRequiredArguments.php | 62 - .../ProvidedRequiredArgumentsOnDirectives.php | 128 - .../src/Validator/Rules/QueryComplexity.php | 300 --- .../src/Validator/Rules/QueryDepth.php | 118 - .../src/Validator/Rules/QuerySecurityRule.php | 184 -- .../src/Validator/Rules/ScalarLeafs.php | 51 - .../Rules/SingleFieldSubscription.php | 57 - .../Validator/Rules/UniqueArgumentNames.php | 64 - .../Rules/UniqueDirectivesPerLocation.php | 96 - .../Validator/Rules/UniqueFragmentNames.php | 49 - .../Validator/Rules/UniqueInputFieldNames.php | 73 - .../Validator/Rules/UniqueOperationNames.php | 52 - .../Validator/Rules/UniqueVariableNames.php | 45 - .../src/Validator/Rules/ValidationRule.php | 51 - .../Validator/Rules/ValuesOfCorrectType.php | 290 -- .../Rules/VariablesAreInputTypes.php | 42 - .../Rules/VariablesInAllowedPosition.php | 116 - .../src/Validator/SDLValidationContext.php | 9 - .../src/Validator/ValidationContext.php | 271 -- lib/wp-graphql-1.17.0/webpack.config.js | 32 - lib/wp-graphql-1.17.0/wp-graphql.php | 190 -- vip-block-data-api.php | 3 - 498 files changed, 87187 deletions(-) delete mode 100644 lib/wp-graphql-1.17.0/.codeclimate.yml delete mode 100644 lib/wp-graphql-1.17.0/.nvmrc delete mode 100644 lib/wp-graphql-1.17.0/.prettierignore delete mode 100644 lib/wp-graphql-1.17.0/.prettierrc.json delete mode 100644 lib/wp-graphql-1.17.0/.remarkrc delete mode 100644 lib/wp-graphql-1.17.0/LICENSE delete mode 100644 lib/wp-graphql-1.17.0/access-functions.php delete mode 100644 lib/wp-graphql-1.17.0/activation.php delete mode 100644 lib/wp-graphql-1.17.0/babel.config.js delete mode 100644 lib/wp-graphql-1.17.0/build/app.asset.php delete mode 100644 lib/wp-graphql-1.17.0/build/app.css delete mode 100644 lib/wp-graphql-1.17.0/build/app.js delete mode 100644 lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.asset.php delete mode 100644 lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.js delete mode 100644 lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.asset.php delete mode 100644 lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.css delete mode 100644 lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.js delete mode 100644 lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.asset.php delete mode 100644 lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.css delete mode 100644 lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.js delete mode 100644 lib/wp-graphql-1.17.0/build/index.asset.php delete mode 100644 lib/wp-graphql-1.17.0/build/index.js delete mode 100644 lib/wp-graphql-1.17.0/build/style-app.css delete mode 100644 lib/wp-graphql-1.17.0/cli/wp-cli.php delete mode 100644 lib/wp-graphql-1.17.0/constants.php delete mode 100644 lib/wp-graphql-1.17.0/deactivation.php delete mode 100644 lib/wp-graphql-1.17.0/phpcs.xml.dist delete mode 100644 lib/wp-graphql-1.17.0/readme.txt delete mode 100644 lib/wp-graphql-1.17.0/src/Admin/Admin.php delete mode 100644 lib/wp-graphql-1.17.0/src/Admin/GraphiQL/GraphiQL.php delete mode 100644 lib/wp-graphql-1.17.0/src/Admin/Settings/Settings.php delete mode 100644 lib/wp-graphql-1.17.0/src/Admin/Settings/SettingsRegistry.php delete mode 100644 lib/wp-graphql-1.17.0/src/AppContext.php delete mode 100644 lib/wp-graphql-1.17.0/src/Connection/Comments.php delete mode 100644 lib/wp-graphql-1.17.0/src/Connection/MenuItems.php delete mode 100644 lib/wp-graphql-1.17.0/src/Connection/PostObjects.php delete mode 100644 lib/wp-graphql-1.17.0/src/Connection/Taxonomies.php delete mode 100644 lib/wp-graphql-1.17.0/src/Connection/TermObjects.php delete mode 100644 lib/wp-graphql-1.17.0/src/Connection/Users.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/CommentMutation.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Config.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/AbstractConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/CommentConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/ContentTypeConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedScriptsConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/MenuConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/MenuItemConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/PluginConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/PostObjectConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/TaxonomyConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/TermObjectConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/ThemeConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/UserConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Connection/UserRoleConnectionResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/AbstractCursor.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/CommentObjectCursor.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/CursorBuilder.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/PostObjectCursor.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/TermObjectCursor.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Cursor/UserCursor.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/DataSource.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/AbstractDataLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/CommentAuthorLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/CommentLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedScriptLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedStylesheetLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/PluginLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/PostObjectLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/PostTypeLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/TaxonomyLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/TermObjectLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/ThemeLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/UserLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/Loader/UserRoleLoader.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/MediaItemMutation.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/NodeResolver.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/PostObjectMutation.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/TermObjectMutation.php delete mode 100644 lib/wp-graphql-1.17.0/src/Data/UserMutation.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/Avatar.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/Comment.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/CommentAuthor.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/Menu.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/MenuItem.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/Model.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/Plugin.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/Post.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/PostType.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/Taxonomy.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/Term.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/Theme.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/User.php delete mode 100644 lib/wp-graphql-1.17.0/src/Model/UserRole.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/CommentCreate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/CommentDelete.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/CommentRestore.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/CommentUpdate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/MediaItemCreate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/MediaItemDelete.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/MediaItemUpdate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/PostObjectCreate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/PostObjectDelete.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/PostObjectUpdate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/ResetUserPassword.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/SendPasswordResetEmail.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/TermObjectCreate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/TermObjectDelete.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/TermObjectUpdate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UpdateSettings.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UserCreate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UserDelete.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UserRegister.php delete mode 100644 lib/wp-graphql-1.17.0/src/Mutation/UserUpdate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Registry/SchemaRegistry.php delete mode 100644 lib/wp-graphql-1.17.0/src/Registry/TypeRegistry.php delete mode 100644 lib/wp-graphql-1.17.0/src/Registry/Utils/PostObject.php delete mode 100644 lib/wp-graphql-1.17.0/src/Registry/Utils/TermObject.php delete mode 100644 lib/wp-graphql-1.17.0/src/Request.php delete mode 100644 lib/wp-graphql-1.17.0/src/Router.php delete mode 100644 lib/wp-graphql-1.17.0/src/Server/ValidationRules/DisableIntrospection.php delete mode 100644 lib/wp-graphql-1.17.0/src/Server/ValidationRules/QueryDepth.php delete mode 100644 lib/wp-graphql-1.17.0/src/Server/ValidationRules/RequireAuthentication.php delete mode 100644 lib/wp-graphql-1.17.0/src/Server/WPHelper.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/Comments.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/MenuItems.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/PostObjects.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/Taxonomies.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/TermObjects.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Connection/Users.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/AvatarRatingEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/CommentNodeIdTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/CommentStatusEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/CommentsConnectionOrderbyEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/ContentNodeIdTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeIdTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemSizeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemStatusEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MenuItemNodeIdTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MenuLocationEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MenuNodeIdTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/MimeTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/OrderEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PluginStatusEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectFieldFormatEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/PostStatusEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/RelationEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyIdTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TermNodeIdTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/TimezoneEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/UserNodeIdTypeEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/UserRoleEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionOrderbyEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionSearchColumnEnum.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Input/DateInput.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Input/DateQueryInput.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Input/PostObjectsConnectionOrderbyInput.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Input/UsersConnectionOrderbyInput.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Commenter.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Connection.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentNode.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentTemplate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/DatabaseIdentifier.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Edge.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/EnqueuedAsset.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalContentNode.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalNode.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalTermNode.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/MenuItemLinkable.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Node.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithAuthor.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithComments.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithContentEditor.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithExcerpt.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithFeaturedImage.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithPageAttributes.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithRevisions.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTemplate.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTitle.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTrackbacks.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/OneToOneConnection.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/PageInfo.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/Previewable.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/TermNode.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/InterfaceType/UniformResourceIdentifiable.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Avatar.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Comment.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/CommentAuthor.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/ContentType.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedScript.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedStylesheet.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaDetails.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaItemMeta.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaSize.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Menu.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/MenuItem.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Plugin.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/PostObject.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/PostTypeLabelDetails.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/RootMutation.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/RootQuery.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/SettingGroup.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Settings.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Taxonomy.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/TermObject.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/Theme.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/User.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/ObjectType/UserRole.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Union/MenuItemObjectUnion.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Union/PostObjectUnion.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/Union/TermObjectUnion.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/WPConnectionType.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/WPEnumType.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/WPInputObjectType.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/WPInterfaceTrait.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/WPInterfaceType.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/WPMutationType.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/WPObjectType.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/WPScalar.php delete mode 100644 lib/wp-graphql-1.17.0/src/Type/WPUnionType.php delete mode 100644 lib/wp-graphql-1.17.0/src/Types.php delete mode 100644 lib/wp-graphql-1.17.0/src/Utils/DebugLog.php delete mode 100644 lib/wp-graphql-1.17.0/src/Utils/InstrumentSchema.php delete mode 100644 lib/wp-graphql-1.17.0/src/Utils/Preview.php delete mode 100644 lib/wp-graphql-1.17.0/src/Utils/QueryAnalyzer.php delete mode 100644 lib/wp-graphql-1.17.0/src/Utils/QueryLog.php delete mode 100644 lib/wp-graphql-1.17.0/src/Utils/Tracing.php delete mode 100644 lib/wp-graphql-1.17.0/src/Utils/Utils.php delete mode 100644 lib/wp-graphql-1.17.0/src/WPGraphQL.php delete mode 100644 lib/wp-graphql-1.17.0/src/WPSchema.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/readme.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/src/Client.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/src/Insights.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/src/License.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/appsero/client/src/Updater.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/autoload.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/ClassLoader.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/InstalledVersions.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/LICENSE delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_classmap.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_namespaces.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_psr4.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_real.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/autoload_static.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/installed.json delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/installed.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/composer/platform_check.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/.travis.yml delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/LICENSE delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/contributors.txt delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/phpunit.xml delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/ArrayConnection.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/Connection.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Mutation/Mutation.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Node.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Plural.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Relay.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ArrayConnectionTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ConnectionTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/SeparateConnectionTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Mutation/MutationTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/NodeTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/PluralTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/RelayTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsConnectionTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsData.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsMutationTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsObjectIdentificationTest.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsSchema.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/FUNDING.yml delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/workflows/validate.yml delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/LICENSE delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/UPGRADE.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/best-practices.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/complementary-tools.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/concepts.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/data-fetching.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/error-handling.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/executing-queries.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/getting-started.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/how-it-works.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/index.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/reference.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/security.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/directives.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/enum-types.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/index.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/input-types.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/interfaces.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/lists-and-nonnulls.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/object-types.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/scalar-types.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/schema.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/type-language.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/unions.md delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/phpstan-baseline.neon delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Deferred.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/ClientAware.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/DebugFlag.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/Error.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/FormattedError.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/InvariantViolation.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/SyntaxError.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/UserError.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/Warning.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Exception/InvalidArgument.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionContext.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Executor.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutorImplementation.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/AmpPromiseAdapter.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Promise.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ReferenceExecutor.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Values.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Collector.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Runtime.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Strand.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/GraphQL.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/BooleanValueNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DocumentNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ExecutableDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FloatValueNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InlineFragmentNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListTypeNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListValueNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Location.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NameNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NamedTypeNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Node.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeKind.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeList.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NullValueNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectFieldNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionSetNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/StringValueNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/TypeDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/TypeExtensionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/TypeNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/TypeSystemDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ValueNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableDefinitionNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableNode.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/DirectiveLocation.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Lexer.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Parser.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Printer.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Source.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/SourceLocation.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Token.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Visitor.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/VisitorOperation.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/Helper.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/OperationParams.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/RequestError.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/ServerConfig.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/StandardServer.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/AbstractType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/BooleanType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CustomScalarType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Directive.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldArgument.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ImplementingType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectField.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IntType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InterfaceType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/LeafType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ListOfType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NamedType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NonNull.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NullableType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ObjectType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/QueryPlan.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ScalarType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Type.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnionType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnresolvedFieldDefinition.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/WrappingType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Introspection.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Schema.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaConfig.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaValidationContext.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/TypeKind.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Validation/InputObjectCircularRefs.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/AST.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BlockString.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildClientSchema.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildSchema.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/InterfaceImplementations.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/MixedStore.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/PairSet.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaExtender.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaPrinter.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeComparators.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Utils.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Value.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ASTValidationContext.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/SDLValidationContext.php delete mode 100644 lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ValidationContext.php delete mode 100644 lib/wp-graphql-1.17.0/webpack.config.js delete mode 100644 lib/wp-graphql-1.17.0/wp-graphql.php diff --git a/lib/wp-graphql-1.17.0/.codeclimate.yml b/lib/wp-graphql-1.17.0/.codeclimate.yml deleted file mode 100644 index fc0f42bf..00000000 --- a/lib/wp-graphql-1.17.0/.codeclimate.yml +++ /dev/null @@ -1,5 +0,0 @@ -version: "2" -checks: - method-lines: - config: - threshold: 40 diff --git a/lib/wp-graphql-1.17.0/.nvmrc b/lib/wp-graphql-1.17.0/.nvmrc deleted file mode 100644 index 7b16f790..00000000 --- a/lib/wp-graphql-1.17.0/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -v14.19.0 diff --git a/lib/wp-graphql-1.17.0/.prettierignore b/lib/wp-graphql-1.17.0/.prettierignore deleted file mode 100644 index d9cd20ef..00000000 --- a/lib/wp-graphql-1.17.0/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -# Ignore artifacts: -build -node_modules diff --git a/lib/wp-graphql-1.17.0/.prettierrc.json b/lib/wp-graphql-1.17.0/.prettierrc.json deleted file mode 100644 index 0967ef42..00000000 --- a/lib/wp-graphql-1.17.0/.prettierrc.json +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/lib/wp-graphql-1.17.0/.remarkrc b/lib/wp-graphql-1.17.0/.remarkrc deleted file mode 100644 index 1227c64b..00000000 --- a/lib/wp-graphql-1.17.0/.remarkrc +++ /dev/null @@ -1,21 +0,0 @@ -{ - "settings": { - "bullet": "-", - "listItemIndent": "mixed", - "fences": true, - "incrementListMarker": false - }, - "plugins": [ - "remark-frontmatter", - "remark-preset-lint-consistent", - "remark-preset-lint-markdown-style-guide", - [ - "remark-lint-maximum-line-length", - false - ], - [ - "remark-lint-no-duplicate-headings", - false - ] - ] -} diff --git a/lib/wp-graphql-1.17.0/LICENSE b/lib/wp-graphql-1.17.0/LICENSE deleted file mode 100644 index 9cecc1d4..00000000 --- a/lib/wp-graphql-1.17.0/LICENSE +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - {one line to give the program's name and a brief idea of what it does.} - Copyright (C) {year} {name of author} - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - {project} Copyright (C) {year} {fullname} - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/lib/wp-graphql-1.17.0/access-functions.php b/lib/wp-graphql-1.17.0/access-functions.php deleted file mode 100644 index b591e8a2..00000000 --- a/lib/wp-graphql-1.17.0/access-functions.php +++ /dev/null @@ -1,920 +0,0 @@ -execute(); -} - -/** - * Previous access function for running GraphQL queries directly. This function will - * eventually be deprecated in favor of `graphql`. - * - * @param string $query The GraphQL query to run - * @param string $operation_name The name of the operation - * @param array $variables Variables to be passed to your GraphQL request - * @param bool $return_request If true, return the Request object, else return the results of the request execution - * - * @return array|\WPGraphQL\Request - * @throws \Exception - * @since 0.0.2 - */ -function do_graphql_request( $query, $operation_name = '', $variables = [], $return_request = false ) { - return graphql( - [ - 'query' => $query, - 'variables' => $variables, - 'operation_name' => $operation_name, - ], - $return_request - ); -} - -/** - * Determine when to register types - * - * @return string - */ -function get_graphql_register_action() { - $action = 'graphql_register_types_late'; - if ( ! did_action( 'graphql_register_initial_types' ) ) { - $action = 'graphql_register_initial_types'; - } elseif ( ! did_action( 'graphql_register_types' ) ) { - $action = 'graphql_register_types'; - } - - return $action; -} - -/** - * Given a type name and interface name, this applies the interface to the Type. - * - * Should be used at the `graphql_register_types` hook. - * - * @param mixed|string|array $interface_names Array of one or more names of the GraphQL - * Interfaces to apply to the GraphQL Types - * @param mixed|string|array $type_names Array of one or more names of the GraphQL - * Types to apply the interfaces to - * - * example: - * The following would register the "MyNewInterface" interface to the Post and Page type in the - * Schema. - * - * register_graphql_interfaces_to_types( [ 'MyNewInterface' ], [ 'Post', 'Page' ] ); - * - * @return void - */ -function register_graphql_interfaces_to_types( $interface_names, $type_names ) { - if ( is_string( $type_names ) ) { - $type_names = [ $type_names ]; - } - - if ( is_string( $interface_names ) ) { - $interface_names = [ $interface_names ]; - } - - if ( ! empty( $type_names ) && is_array( $type_names ) && ! empty( $interface_names ) && is_array( $interface_names ) ) { - foreach ( $type_names as $type_name ) { - - // Filter the GraphQL Object Type Interface to apply the interface - add_filter( - 'graphql_type_interfaces', - static function ( $interfaces, $config ) use ( $type_name, $interface_names ) { - $interfaces = is_array( $interfaces ) ? $interfaces : []; - - if ( strtolower( $type_name ) === strtolower( $config['name'] ) ) { - $interfaces = array_unique( array_merge( $interfaces, $interface_names ) ); - } - - return $interfaces; - }, - 10, - 2 - ); - } - } -} - -/** - * Given a Type Name and a $config array, this adds a Type to the TypeRegistry - * - * @param string $type_name The name of the Type to register - * @param array $config The Type config - * - * @throws \Exception - * @return void - */ -function register_graphql_type( string $type_name, array $config ) { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $type_name, $config ) { - $type_registry->register_type( $type_name, $config ); - }, - 10 - ); -} - -/** - * Given a Type Name and a $config array, this adds an Interface Type to the TypeRegistry - * - * @param string $type_name The name of the Type to register - * @param mixed|array|\GraphQL\Type\Definition\Type $config The Type config - * - * @throws \Exception - * @return void - */ -function register_graphql_interface_type( string $type_name, $config ) { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $type_name, $config ) { - $type_registry->register_interface_type( $type_name, $config ); - }, - 10 - ); -} - -/** - * Given a Type Name and a $config array, this adds an ObjectType to the TypeRegistry - * - * @param string $type_name The name of the Type to register - * @param array $config The Type config - * - * @return void - */ -function register_graphql_object_type( string $type_name, array $config ) { - $config['kind'] = 'object'; - register_graphql_type( $type_name, $config ); -} - -/** - * Given a Type Name and a $config array, this adds an InputType to the TypeRegistry - * - * @param string $type_name The name of the Type to register - * @param array $config The Type config - * - * @return void - */ -function register_graphql_input_type( string $type_name, array $config ) { - $config['kind'] = 'input'; - register_graphql_type( $type_name, $config ); -} - -/** - * Given a Type Name and a $config array, this adds an UnionType to the TypeRegistry - * - * @param string $type_name The name of the Type to register - * @param array $config The Type config - * - * @throws \Exception - * - * @return void - */ -function register_graphql_union_type( string $type_name, array $config ) { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $type_name, $config ) { - $config['kind'] = 'union'; - $type_registry->register_type( $type_name, $config ); - }, - 10 - ); -} - -/** - * Given a Type Name and a $config array, this adds an EnumType to the TypeRegistry - * - * @param string $type_name The name of the Type to register - * @param array $config The Type config - * - * @return void - */ -function register_graphql_enum_type( string $type_name, array $config ) { - $config['kind'] = 'enum'; - register_graphql_type( $type_name, $config ); -} - -/** - * Given a Type Name, Field Name, and a $config array, this adds a Field to a registered Type in - * the TypeRegistry - * - * @param string $type_name The name of the Type to add the field to - * @param string $field_name The name of the Field to add to the Type - * @param array $config The Type config - * - * @return void - * @throws \Exception - * @since 0.1.0 - */ -function register_graphql_field( string $type_name, string $field_name, array $config ) { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $type_name, $field_name, $config ) { - $type_registry->register_field( $type_name, $field_name, $config ); - }, - 10 - ); -} - -/** - * Given a Type Name and an array of field configs, this adds the fields to the registered type in - * the TypeRegistry - * - * @param string $type_name The name of the Type to add the fields to - * @param array $fields An array of field configs - * - * @return void - * @throws \Exception - * @since 0.1.0 - */ -function register_graphql_fields( string $type_name, array $fields ) { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $type_name, $fields ) { - $type_registry->register_fields( $type_name, $fields ); - }, - 10 - ); -} - -/** - * Adds a field to the Connection Edge between the provided 'From' Type Name and 'To' Type Name. - * - * @param string $from_type The name of the Type the connection is coming from. - * @param string $to_type The name of the Type or Alias (the connection config's `FromFieldName`) the connection is going to. - * @param string $field_name The name of the field to add to the connection edge. - * @param array $config The field config. - * - * @since 1.13.0 - */ -function register_graphql_edge_field( string $from_type, string $to_type, string $field_name, array $config ): void { - $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'ConnectionEdge'; - - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $connection_name, $field_name, $config ) { - $type_registry->register_field( $connection_name, $field_name, $config ); - }, - 10 - ); -} - -/** - * Adds several fields to the Connection Edge between the provided 'From' Type Name and 'To' Type Name. - * - * @param string $from_type The name of the Type the connection is coming from. - * @param string $to_type The name of the Type or Alias (the connection config's `FromFieldName`) the connection is going to. - * @param array $fields An array of field configs. - * - * @since 1.13.0 - */ -function register_graphql_edge_fields( string $from_type, string $to_type, array $fields ): void { - $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'ConnectionEdge'; - - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $connection_name, $fields ) { - $type_registry->register_fields( $connection_name, $fields ); - }, - 10 - ); -} - -/** - * Adds an input field to the Connection Where Args between the provided 'From' Type Name and 'To' Type Name. - * - * @param string $from_type The name of the Type the connection is coming from. - * @param string $to_type The name of the Type or Alias (the connection config's `FromFieldName`) the connection is going to. - * @param string $field_name The name of the field to add to the connection edge. - * @param array $config The field config. - * - * @since 1.13.0 - */ -function register_graphql_connection_where_arg( string $from_type, string $to_type, string $field_name, array $config ): void { - $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'ConnectionWhereArgs'; - - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $connection_name, $field_name, $config ) { - $type_registry->register_field( $connection_name, $field_name, $config ); - }, - 10 - ); -} - -/** - * Adds several input fields to the Connection Where Args between the provided 'From' Type Name and 'To' Type Name. - * - * @param string $from_type The name of the Type the connection is coming from. - * @param string $to_type The name of the Type or Alias (the connection config's `FromFieldName`) the connection is going to. - * @param array $fields An array of field configs. - * - * @since 1.13.0 - */ -function register_graphql_connection_where_args( string $from_type, string $to_type, array $fields ): void { - $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'ConnectionWhereArgs'; - - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $connection_name, $fields ) { - $type_registry->register_fields( $connection_name, $fields ); - }, - 10 - ); -} - -/** - * Renames a GraphQL field. - * - * @param string $type_name Name of the Type to rename a field on. - * @param string $field_name Field name to be renamed. - * @param string $new_field_name New field name. - * - * @return void - * @since 1.3.4 - */ -function rename_graphql_field( string $type_name, string $field_name, string $new_field_name ) { - // Rename fields on the type. - add_filter( - "graphql_{$type_name}_fields", - static function ( $fields ) use ( $field_name, $new_field_name ) { - // Bail if the field doesn't exist. - if ( ! isset( $fields[ $field_name ] ) ) { - return $fields; - } - - $fields[ $new_field_name ] = $fields[ $field_name ]; - unset( $fields[ $field_name ] ); - - return $fields; - } - ); - - // Rename fields registered to the type by connections. - add_filter( - "graphql_wp_connection_{$type_name}_from_field_name", - static function ( $old_field_name ) use ( $field_name, $new_field_name ) { - // Bail if the field name doesn't match. - if ( $old_field_name !== $field_name ) { - return $old_field_name; - } - - return $new_field_name; - } - ); -} - -/** - * Renames a GraphQL Type in the Schema. - * - * @param string $type_name The name of the Type in the Schema to rename. - * @param string $new_type_name The new name to give the Type. - * - * @return void - * @throws \Exception - * - * @since 1.3.4 - */ -function rename_graphql_type( string $type_name, string $new_type_name ) { - add_filter( - 'graphql_type_name', - static function ( $name ) use ( $type_name, $new_type_name ) { - if ( $name === $type_name ) { - return $new_type_name; - } - return $name; - } - ); - - // Add the new type to the registry referencing the original Type instance. - // This allows for both the new type name and the old type name to be - // referenced as the type when registering fields. - add_action( - 'graphql_register_types_late', - static function ( TypeRegistry $type_registry ) use ( $type_name, $new_type_name ) { - $type = $type_registry->get_type( $type_name ); - if ( ! $type instanceof Type ) { - return; - } - $type_registry->register_type( $new_type_name, $type ); - } - ); -} - -/** - * Given a config array for a connection, this registers a connection by creating all appropriate - * fields and types for the connection - * - * @param array $config Array to configure the connection - * - * @throws \Exception - * @return void - * - * @since 0.1.0 - */ -function register_graphql_connection( array $config ) { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $config ) { - $type_registry->register_connection( $config ); - }, - 20 - ); -} - -/** - * Given a Mutation Name and Config array, this adds a Mutation to the Schema - * - * @param string $mutation_name The name of the Mutation to register - * @param array $config The config for the mutation - * - * @throws \Exception - * - * @return void - * @since 0.1.0 - */ -function register_graphql_mutation( string $mutation_name, array $config ) { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $mutation_name, $config ) { - $type_registry->register_mutation( $mutation_name, $config ); - }, - 10 - ); -} - -/** - * Given a config array for a custom Scalar, this registers a Scalar for use in the Schema - * - * @param string $type_name The name of the Type to register - * @param array $config The config for the scalar type to register - * - * @throws \Exception - * @return void - * - * @since 0.8.4 - */ -function register_graphql_scalar( string $type_name, array $config ) { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $type_name, $config ) { - $type_registry->register_scalar( $type_name, $config ); - }, - 10 - ); -} - -/** - * Given a Type Name, this removes the type from the entire schema - * - * @param string $type_name The name of the Type to remove. - * - * @since 1.13.0 - */ -function deregister_graphql_type( string $type_name ): void { - // Prevent the type from being registered to the scheme directly. - add_filter( - 'graphql_excluded_types', - static function ( $excluded_types ) use ( $type_name ): array { - // Normalize the types to prevent case sensitivity issues. - $type_name = strtolower( $type_name ); - // If the type isn't already excluded, add it to the array. - if ( ! in_array( $type_name, $excluded_types, true ) ) { - $excluded_types[] = $type_name; - } - - return $excluded_types; - }, - 10 - ); - - // Prevent the type from being inherited as an interface. - add_filter( - 'graphql_type_interfaces', - static function ( $interfaces ) use ( $type_name ): array { - // Normalize the needle and haystack to prevent case sensitivity issues. - $key = array_search( - strtolower( $type_name ), - array_map( 'strtolower', $interfaces ), - true - ); - // If the type is found, unset it. - if ( false !== $key ) { - unset( $interfaces[ $key ] ); - } - - return $interfaces; - }, - 10 - ); -} - -/** - * Given a Type Name and Field Name, this removes the field from the TypeRegistry - * - * @param string $type_name The name of the Type to remove the field from - * @param string $field_name The name of the field to remove - * - * @return void - * - * @since 0.1.0 - */ -function deregister_graphql_field( string $type_name, string $field_name ) { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $type_name, $field_name ) { - $type_registry->deregister_field( $type_name, $field_name ); - }, - 10 - ); -} - - -/** - * Given a Connection Name, this removes the connection from the Schema - * - * @param string $connection_name The name of the Connection to remove - * - * @since 1.14.0 - */ -function deregister_graphql_connection( string $connection_name ): void { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $connection_name ) { - $type_registry->deregister_connection( $connection_name ); - }, - 10 - ); -} - -/** - * Given a Mutation Name, this removes the mutation from the Schema - * - * @param string $mutation_name The name of the Mutation to remove - * - * @since 1.14.0 - */ -function deregister_graphql_mutation( string $mutation_name ): void { - add_action( - get_graphql_register_action(), - static function ( TypeRegistry $type_registry ) use ( $mutation_name ) { - $type_registry->deregister_mutation( $mutation_name ); - }, - 10 - ); -} - -/** - * Whether a GraphQL request is in action or not. This is determined by the WPGraphQL Request - * class being initiated. True while a request is in action, false after a request completes. - * - * This should be used when a condition needs to be checked for ALL GraphQL requests, such - * as filtering WP_Query for GraphQL requests, for example. - * - * Default false. - * - * @return bool - * @since 0.4.1 - */ -function is_graphql_request() { - return WPGraphQL::is_graphql_request(); -} - -/** - * Whether a GraphQL HTTP request is in action or not. This is determined by - * checking if the request is occurring on the route defined for the GraphQL endpoint. - * - * This conditional should only be used for features that apply to HTTP requests. If you are going - * to apply filters to underlying WordPress core functionality that should affect _all_ GraphQL - * requests, you should use "is_graphql_request" but if you need to apply filters only if the - * GraphQL request is an HTTP request, use this conditional. - * - * Default false. - * - * @return bool - * @since 0.4.1 - */ -function is_graphql_http_request() { - return Router::is_graphql_http_request(); -} - -/** - * Registers a GraphQL Settings Section - * - * @param string $slug The slug of the group being registered - * @param array $config Array configuring the section. Should include: title - * - * @return void - * @since 0.13.0 - */ -function register_graphql_settings_section( string $slug, array $config ) { - add_action( - 'graphql_init_settings', - static function ( \WPGraphQL\Admin\Settings\SettingsRegistry $registry ) use ( $slug, $config ) { - $registry->register_section( $slug, $config ); - } - ); -} - -/** - * Registers a GraphQL Settings Field - * - * @param string $group The name of the group to register a setting field to - * @param array $config The config for the settings field being registered - * - * @return void - * @since 0.13.0 - */ -function register_graphql_settings_field( string $group, array $config ) { - add_action( - 'graphql_init_settings', - static function ( \WPGraphQL\Admin\Settings\SettingsRegistry $registry ) use ( $group, $config ) { - $registry->register_field( $group, $config ); - } - ); -} - -/** - * Given a message and an optional config array - * - * @param mixed|string|array $message The debug message - * @param array $config The debug config. Should be an associative array of keys and - * values. - * $config['type'] will set the "type" of the log, default type - * is GRAPHQL_DEBUG. Other fields added to $config will be - * merged into the debug entry. - * - * @return void - * @since 0.14.0 - */ -function graphql_debug( $message, $config = [] ) { - $debug_backtrace = debug_backtrace(); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace - $config['backtrace'] = ! empty( $debug_backtrace ) - ? - array_values( - array_map( - static function ( $trace ) { - $line = isset( $trace['line'] ) ? absint( $trace['line'] ) : 0; - return sprintf( '%s:%d', $trace['file'], $line ); - }, - array_filter( // Filter out steps without files - $debug_backtrace, - static function ( $step ) { - return ! empty( $step['file'] ); - } - ) - ) - ) - : - []; - - add_action( - 'graphql_get_debug_log', - static function ( \WPGraphQL\Utils\DebugLog $debug_log ) use ( $message, $config ) { - $debug_log->add_log_entry( $message, $config ); - } - ); -} - -/** - * Check if the name is valid for use in GraphQL - * - * @param string $type_name The name of the type to validate - * - * @return bool - * @since 0.14.0 - */ -function is_valid_graphql_name( string $type_name ) { - if ( preg_match( '/^\d/', $type_name ) ) { - return false; - } - - return true; -} - -/** - * Registers a series of GraphQL Settings Fields - * - * @param string $group The name of the settings group to register fields to - * @param array $fields Array of field configs to register to the group - * - * @return void - * @since 0.13.0 - */ -function register_graphql_settings_fields( string $group, array $fields ) { - add_action( - 'graphql_init_settings', - static function ( \WPGraphQL\Admin\Settings\SettingsRegistry $registry ) use ( $group, $fields ) { - $registry->register_fields( $group, $fields ); - } - ); -} - -/** - * Get an option value from GraphQL settings - * - * @param string $option_name The key of the option to return - * @param mixed $default_value The default value the setting should return if no value is set - * @param string $section_name The settings group section that the option belongs to - * - * @return mixed|string|int|boolean - * @since 0.13.0 - */ -function get_graphql_setting( string $option_name, $default_value = '', $section_name = 'graphql_general_settings' ) { - $section_fields = get_option( $section_name ); - - /** - * Filter the section fields - * - * @param array $section_fields The values of the fields stored for the section - * @param string $section_name The name of the section - * @param mixed $default_value The default value for the option being retrieved - */ - $section_fields = apply_filters( 'graphql_get_setting_section_fields', $section_fields, $section_name, $default_value ); - - /** - * Get the value from the stored data, or return the default - */ - $value = isset( $section_fields[ $option_name ] ) ? $section_fields[ $option_name ] : $default_value; - - /** - * Filter the value before returning it - * - * @param mixed $value The value of the field - * @param mixed $default_value The default value if there is no value set - * @param string $option_name The name of the option - * @param array $section_fields The setting values within the section - * @param string $section_name The name of the section the setting belongs to - */ - return apply_filters( 'graphql_get_setting_section_field_value', $value, $default_value, $option_name, $section_fields, $section_name ); -} - -/** - * Get the endpoint route for the WPGraphQL API - * - * @return string - * @since 1.12.0 - */ -function graphql_get_endpoint() { - - // get the endpoint from the settings. default to 'graphql' - $endpoint = get_graphql_setting( 'graphql_endpoint', 'graphql' ); - - /** - * @param string $endpoint The relative endpoint that graphql can be accessed at - */ - $filtered_endpoint = apply_filters( 'graphql_endpoint', $endpoint ); - - // If the filtered endpoint has a value (not filtered to a falsy value), use it. else return the default endpoint - return ! empty( $filtered_endpoint ) ? $filtered_endpoint : $endpoint; -} - -/** - * Return the full url for the GraphQL Endpoint. - * - * @return string - * @since 1.12.0 - */ -function graphql_get_endpoint_url() { - return site_url( graphql_get_endpoint() ); -} - -/** - * Polyfill for PHP versions below 7.3 - * - * @return int|string|null - * - * @since 0.10.0 - */ -if ( ! function_exists( 'array_key_first' ) ) { - - /** - * @param array $arr - * - * @return int|string|null - */ - function array_key_first( array $arr ) { - foreach ( $arr as $key => $value ) { - return $key; - } - return null; - } -} - -/** - * Polyfill for PHP versions below 7.3 - * - * @return mixed|string|int - * - * @since 0.10.0 - */ -if ( ! function_exists( 'array_key_last' ) ) { - - /** - * @param array $arr - * - * @return int|string|null - */ - function array_key_last( array $arr ) { - end( $arr ); - - return key( $arr ); - } -} diff --git a/lib/wp-graphql-1.17.0/activation.php b/lib/wp-graphql-1.17.0/activation.php deleted file mode 100644 index 25531ac7..00000000 --- a/lib/wp-graphql-1.17.0/activation.php +++ /dev/null @@ -1,17 +0,0 @@ - { - api.cache(true); - - return { - presets: ["@wordpress/babel-preset-default"], - plugins: ["babel-plugin-inline-json-import"], - }; -}; diff --git a/lib/wp-graphql-1.17.0/build/app.asset.php b/lib/wp-graphql-1.17.0/build/app.asset.php deleted file mode 100644 index a1fa4dc8..00000000 --- a/lib/wp-graphql-1.17.0/build/app.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'react-dom', 'wp-element', 'wp-hooks'), 'version' => 'b46a34de121156c88432'); diff --git a/lib/wp-graphql-1.17.0/build/app.css b/lib/wp-graphql-1.17.0/build/app.css deleted file mode 100644 index b62c15b9..00000000 --- a/lib/wp-graphql-1.17.0/build/app.css +++ /dev/null @@ -1,1800 +0,0 @@ -.graphiql-container, -.graphiql-container button, -.graphiql-container input { - color: #141823; - font-family: system, -apple-system, 'San Francisco', '.SFNSDisplay-Regular', - 'Segoe UI', Segoe, 'Segoe WP', 'Helvetica Neue', helvetica, 'Lucida Grande', - arial, sans-serif; - font-size: 14px; -} - -.graphiql-container { - display: flex; - flex-direction: row; - height: 100%; - margin: 0; - overflow: hidden; - width: 100%; -} - -.graphiql-container .editorWrap { - display: flex; - flex-direction: column; - flex: 1; - overflow-x: hidden; -} - -.graphiql-container .title { - font-size: 18px; -} - -.graphiql-container .title em { - font-family: georgia; - font-size: 19px; -} - -.graphiql-container .topBarWrap { - display: flex; - flex-direction: row; -} - -.graphiql-container .topBar { - align-items: center; - background: linear-gradient(#f7f7f7, #e2e2e2); - border-bottom: 1px solid #d0d0d0; - cursor: default; - display: flex; - flex-direction: row; - flex: 1; - height: 34px; - overflow-y: visible; - padding: 7px 14px 6px; - user-select: none; -} - -.graphiql-container .toolbar { - overflow-x: visible; - display: flex; -} - -.graphiql-container .docExplorerShow, -.graphiql-container .historyShow { - background: linear-gradient(#f7f7f7, #e2e2e2); - border-radius: 0; - border-bottom: 1px solid #d0d0d0; - border-right: none; - border-top: none; - color: #3b5998; - cursor: pointer; - font-size: 14px; - margin: 0; - padding: 2px 20px 0 18px; -} - -.graphiql-container .docExplorerShow { - border-left: 1px solid rgba(0, 0, 0, 0.2); -} - -.graphiql-container .historyShow { - border-right: 1px solid rgba(0, 0, 0, 0.2); - border-left: 0; -} - -.graphiql-container .docExplorerShow:before { - border-left: 2px solid #3b5998; - border-top: 2px solid #3b5998; - content: ''; - display: inline-block; - height: 9px; - margin: 0 3px -1px 0; - position: relative; - transform: rotate(-45deg); - width: 9px; -} - -.graphiql-container .editorBar { - display: flex; - flex-direction: row; - flex: 1; - max-height: 100%; -} - -.graphiql-container .queryWrap { - display: flex; - flex-direction: column; - flex: 1; -} - -.graphiql-container .resultWrap { - border-left: solid 1px #e0e0e0; - display: flex; - flex-direction: column; - flex: 1; - flex-basis: 1em; - position: relative; -} - -.graphiql-container .docExplorerWrap, -.graphiql-container .historyPaneWrap { - background: white; - box-shadow: 0 0 8px rgba(0, 0, 0, 0.15); - position: relative; - z-index: 3; -} - -.graphiql-container .historyPaneWrap { - min-width: 230px; - z-index: 5; -} - -.graphiql-container .docExplorerResizer { - cursor: col-resize; - height: 100%; - left: -5px; - position: absolute; - top: 0; - width: 10px; - z-index: 10; -} - -.graphiql-container .docExplorerHide { - cursor: pointer; - font-size: 18px; - margin: -7px -8px -6px 0; - padding: 18px 16px 15px 12px; - background: 0; - border: 0; - line-height: 14px; -} - -.graphiql-container div .query-editor { - flex: 1; - position: relative; -} - -.graphiql-container .secondary-editor { - display: flex; - flex-direction: column; - height: 30px; - position: relative; -} - -.graphiql-container .secondary-editor-title { - background: #eeeeee; - border-bottom: 1px solid #d6d6d6; - border-top: 1px solid #e0e0e0; - color: #777; - font-variant: small-caps; - font-weight: bold; - letter-spacing: 1px; - line-height: 14px; - padding: 6px 0 8px 43px; - text-transform: lowercase; - user-select: none; -} - -.graphiql-container .codemirrorWrap { - flex: 1; - height: 100%; - position: relative; -} - -.graphiql-container .result-window { - flex: 1; - height: 100%; - position: relative; -} - -.graphiql-container .footer { - background: #f6f7f8; - border-left: 1px solid #e0e0e0; - border-top: 1px solid #e0e0e0; - margin-left: 12px; - position: relative; -} - -.graphiql-container .footer:before { - background: #eeeeee; - bottom: 0; - content: ' '; - left: -13px; - position: absolute; - top: -1px; - width: 12px; -} - -/* No `.graphiql-container` here so themes can overwrite */ - -.result-window .CodeMirror.cm-s-graphiql { - background: #f6f7f8; -} - -.graphiql-container .result-window .CodeMirror-gutters { - background-color: #eeeeee; - border-color: #e0e0e0; - cursor: col-resize; -} - -.graphiql-container .result-window .CodeMirror-foldgutter, -.graphiql-container .result-window .CodeMirror-foldgutter-open:after, -.graphiql-container .result-window .CodeMirror-foldgutter-folded:after { - padding-left: 3px; -} - -.graphiql-container .toolbar-button { - background: #fdfdfd; - background: linear-gradient(#f9f9f9, #ececec); - border: 0; - border-radius: 3px; - box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2), - 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 1px #fff; - color: #555; - cursor: pointer; - display: inline-block; - margin: 0 5px; - padding: 3px 11px 5px; - text-decoration: none; - text-overflow: ellipsis; - white-space: nowrap; - max-width: 150px; -} - -.graphiql-container .toolbar-button:active { - background: linear-gradient(#ececec, #d5d5d5); - box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7), - inset 0 0 0 1px rgba(0, 0, 0, 0.1), inset 0 1px 1px 1px rgba(0, 0, 0, 0.12), - inset 0 0 5px rgba(0, 0, 0, 0.1); -} - -.graphiql-container .toolbar-button.error { - background: linear-gradient(#fdf3f3, #e6d6d7); - color: #b00; -} - -.graphiql-container .toolbar-button-group { - margin: 0 5px; - white-space: nowrap; -} - -.graphiql-container .toolbar-button-group > * { - margin: 0; -} - -.graphiql-container .toolbar-button-group > *:not(:last-child) { - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} - -.graphiql-container .toolbar-button-group > *:not(:first-child) { - border-top-left-radius: 0; - border-bottom-left-radius: 0; - margin-left: -1px; -} - -.graphiql-container .execute-button-wrap { - height: 34px; - margin: 0 14px 0 28px; - position: relative; -} - -.graphiql-container .execute-button { - background: linear-gradient(#fdfdfd, #d2d3d6); - border-radius: 17px; - border: 1px solid rgba(0, 0, 0, 0.25); - box-shadow: 0 1px 0 #fff; - cursor: pointer; - fill: #444; - height: 34px; - margin: 0; - padding: 0; - width: 34px; -} - -.graphiql-container .execute-button svg { - pointer-events: none; -} - -.graphiql-container .execute-button:active { - background: linear-gradient(#e6e6e6, #c3c3c3); - box-shadow: 0 1px 0 #fff, inset 0 0 2px rgba(0, 0, 0, 0.2), - inset 0 0 6px rgba(0, 0, 0, 0.1); -} - -.graphiql-container .toolbar-menu, -.graphiql-container .toolbar-select { - position: relative; -} - -.graphiql-container .execute-options, -.graphiql-container .toolbar-menu-items, -.graphiql-container .toolbar-select-options { - background: #fff; - box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.25); - margin: 0; - padding: 6px 0; - position: absolute; - z-index: 100; -} - -.graphiql-container .execute-options { - min-width: 100px; - top: 37px; - left: -1px; -} - -.graphiql-container .toolbar-menu-items { - left: 1px; - margin-top: -1px; - min-width: 110%; - top: 100%; - visibility: hidden; -} - -.graphiql-container .toolbar-menu-items.open { - visibility: visible; -} - -.graphiql-container .toolbar-select-options { - left: 0; - min-width: 100%; - top: -5px; - visibility: hidden; -} - -.graphiql-container .toolbar-select-options.open { - visibility: visible; -} - -.graphiql-container .execute-options > li, -.graphiql-container .toolbar-menu-items > li, -.graphiql-container .toolbar-select-options > li { - cursor: pointer; - display: block; - margin: none; - max-width: 300px; - overflow: hidden; - padding: 2px 20px 4px 11px; - white-space: nowrap; -} - -.graphiql-container .execute-options > li.selected, -.graphiql-container .toolbar-menu-items > li.hover, -.graphiql-container .toolbar-menu-items > li:active, -.graphiql-container .toolbar-menu-items > li:hover, -.graphiql-container .toolbar-select-options > li.hover, -.graphiql-container .toolbar-select-options > li:active, -.graphiql-container .toolbar-select-options > li:hover, -.graphiql-container .history-contents > li:hover, -.graphiql-container .history-contents > li:active { - background: #e10098; - color: #fff; -} - -.graphiql-container .toolbar-select-options > li > svg { - display: inline; - fill: #666; - margin: 0 -6px 0 6px; - pointer-events: none; - vertical-align: middle; -} - -.graphiql-container .toolbar-select-options > li.hover > svg, -.graphiql-container .toolbar-select-options > li:active > svg, -.graphiql-container .toolbar-select-options > li:hover > svg { - fill: #fff; -} - -.graphiql-container .CodeMirror-scroll { - overflow-scrolling: touch; -} - -.graphiql-container .CodeMirror { - color: #141823; - font-family: 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace; - font-size: 13px; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} - -.graphiql-container .CodeMirror-lines { - padding: 20px 0; -} - -.CodeMirror-hint-information .content { - box-orient: vertical; - color: #141823; - display: flex; - font-family: system, -apple-system, 'San Francisco', '.SFNSDisplay-Regular', - 'Segoe UI', Segoe, 'Segoe WP', 'Helvetica Neue', helvetica, 'Lucida Grande', - arial, sans-serif; - font-size: 13px; - line-clamp: 3; - line-height: 16px; - max-height: 48px; - overflow: hidden; - text-overflow: -o-ellipsis-lastline; -} - -.CodeMirror-hint-information .content p:first-child { - margin-top: 0; -} - -.CodeMirror-hint-information .content p:last-child { - margin-bottom: 0; -} - -.CodeMirror-hint-information .infoType { - color: #ca9800; - cursor: pointer; - display: inline; - margin-right: 0.5em; -} - -.autoInsertedLeaf.cm-property { - animation-duration: 6s; - animation-name: insertionFade; - border-bottom: 2px solid rgba(255, 255, 255, 0); - border-radius: 2px; - margin: -2px -4px -1px; - padding: 2px 4px 1px; -} - -@keyframes insertionFade { - from, - to { - background: rgba(255, 255, 255, 0); - border-color: rgba(255, 255, 255, 0); - } - - 15%, - 85% { - background: #fbffc9; - border-color: #f0f3c0; - } -} - -div.CodeMirror-lint-tooltip { - background-color: white; - border-radius: 2px; - border: 0; - color: #141823; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); - font-size: 13px; - line-height: 16px; - max-width: 430px; - opacity: 0; - padding: 8px 10px; - transition: opacity 0.15s; - white-space: pre-wrap; -} - -div.CodeMirror-lint-tooltip > * { - padding-left: 23px; -} - -div.CodeMirror-lint-tooltip > * + * { - margin-top: 12px; -} - -.graphiql-container .variable-editor-title-text { - cursor: pointer; - display: inline-block; - color: gray; -} - -.graphiql-container .variable-editor-title-text.active { - color: #000; -} - -/* COLORS */ - -.graphiql-container .CodeMirror-foldmarker { - border-radius: 4px; - background: #08f; - background: linear-gradient(#43a8ff, #0f83e8); - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2), inset 0 0 0 1px rgba(0, 0, 0, 0.1); - color: white; - font-family: arial; - font-size: 12px; - line-height: 0; - margin: 0 3px; - padding: 0px 4px 1px; - text-shadow: 0 -1px rgba(0, 0, 0, 0.1); -} - -.graphiql-container div.CodeMirror span.CodeMirror-matchingbracket { - color: #555; - text-decoration: underline; -} - -.graphiql-container div.CodeMirror span.CodeMirror-nonmatchingbracket { - color: #f00; -} - -/* Comment */ - -.cm-comment { - color: #666; -} - -/* Punctuation */ - -.cm-punctuation { - color: #555; -} - -/* Keyword */ - -.cm-keyword { - color: #b11a04; -} - -/* OperationName, FragmentName */ - -.cm-def { - color: #d2054e; -} - -/* FieldName */ - -.cm-property { - color: #1f61a0; -} - -/* FieldAlias */ - -.cm-qualifier { - color: #1c92a9; -} - -/* ArgumentName and ObjectFieldName */ - -.cm-attribute { - color: #8b2bb9; -} - -/* Number */ - -.cm-number { - color: #2882f9; -} - -/* String */ - -.cm-string { - color: #d64292; -} - -/* Boolean */ - -.cm-builtin { - color: #d47509; -} - -/* EnumValue */ - -.cm-string-2 { - color: #0b7fc7; -} - -/* Variable */ - -.cm-variable { - color: #397d13; -} - -/* Directive */ - -.cm-meta { - color: #b33086; -} - -/* Type */ - -.cm-atom { - color: #ca9800; -} - -/* BASICS */ - -.CodeMirror { - /* Set height, width, borders, and global font properties here */ - color: black; - font-family: monospace; - height: 300px; -} - -/* PADDING */ - -.CodeMirror-lines { - padding: 4px 0; /* Vertical padding around content */ -} - -.CodeMirror pre { - padding: 0 4px; /* Horizontal padding of content */ -} - -.CodeMirror-scrollbar-filler, -.CodeMirror-gutter-filler { - background-color: white; /* The little square between H and V scrollbars */ -} - -/* GUTTER */ - -.CodeMirror-gutters { - border-right: 1px solid #ddd; - background-color: #f7f7f7; - white-space: nowrap; -} - -.CodeMirror-linenumbers { -} - -.CodeMirror-linenumber { - color: #666; - min-width: 20px; - padding: 0 3px 0 5px; - text-align: right; - white-space: nowrap; -} - -.CodeMirror-guttermarker { - color: black; -} - -.CodeMirror-guttermarker-subtle { - color: #666; -} - -/* CURSOR */ - -.CodeMirror .CodeMirror-cursor { - border-left: 1px solid black; -} - -/* Shown when moving in bi-directional text */ - -.CodeMirror div.CodeMirror-secondarycursor { - border-left: 1px solid silver; -} - -.CodeMirror.cm-fat-cursor div.CodeMirror-cursor { - background: #7e7; - border: 0; - width: auto; -} - -.CodeMirror.cm-fat-cursor div.CodeMirror-cursors { - z-index: 1; -} - -.cm-animate-fat-cursor { - animation: blink 1.06s steps(1) infinite; - border: 0; - width: auto; -} - -@keyframes blink { - 0% { - background: #7e7; - } - 50% { - background: none; - } - 100% { - background: #7e7; - } -} - -/* Can style cursor different in overwrite (non-insert) mode */ - -div.CodeMirror-overwrite div.CodeMirror-cursor { -} - -.cm-tab { - display: inline-block; - text-decoration: inherit; -} - -.CodeMirror-ruler { - border-left: 1px solid #ccc; - position: absolute; -} - -/* DEFAULT THEME */ - -.cm-s-default .cm-keyword { - color: #708; -} - -.cm-s-default .cm-atom { - color: #219; -} - -.cm-s-default .cm-number { - color: #164; -} - -.cm-s-default .cm-def { - color: #00f; -} - -.cm-s-default .cm-variable, -.cm-s-default .cm-punctuation, -.cm-s-default .cm-property, -.cm-s-default .cm-operator { -} - -.cm-s-default .cm-variable-2 { - color: #05a; -} - -.cm-s-default .cm-variable-3 { - color: #085; -} - -.cm-s-default .cm-comment { - color: #a50; -} - -.cm-s-default .cm-string { - color: #a11; -} - -.cm-s-default .cm-string-2 { - color: #f50; -} - -.cm-s-default .cm-meta { - color: #555; -} - -.cm-s-default .cm-qualifier { - color: #555; -} - -.cm-s-default .cm-builtin { - color: #30a; -} - -.cm-s-default .cm-bracket { - color: #666; -} - -.cm-s-default .cm-tag { - color: #170; -} - -.cm-s-default .cm-attribute { - color: #00c; -} - -.cm-s-default .cm-header { - color: blue; -} - -.cm-s-default .cm-quote { - color: #090; -} - -.cm-s-default .cm-hr { - color: #666; -} - -.cm-s-default .cm-link { - color: #00c; -} - -.cm-negative { - color: #d44; -} - -.cm-positive { - color: #292; -} - -.cm-header, -.cm-strong { - font-weight: bold; -} - -.cm-em { - font-style: italic; -} - -.cm-link { - text-decoration: underline; -} - -.cm-strikethrough { - text-decoration: line-through; -} - -.cm-s-default .cm-error { - color: #f00; -} - -.cm-invalidchar { - color: #f00; -} - -.CodeMirror-composing { - border-bottom: 2px solid; -} - -/* Default styles for common addons */ - -div.CodeMirror span.CodeMirror-matchingbracket { - color: #0f0; -} - -div.CodeMirror span.CodeMirror-nonmatchingbracket { - color: #f22; -} - -.CodeMirror-matchingtag { - background: rgba(255, 150, 0, 0.3); -} - -.CodeMirror-activeline-background { - background: #e8f2ff; -} - -/* STOP */ - -/* The rest of this file contains styles related to the mechanics of - the editor. You probably shouldn't touch them. */ - -.CodeMirror { - background: white; - overflow: hidden; - position: relative; -} - -.CodeMirror-scroll { - height: 100%; - /* 30px is the magic margin used to hide the element's real scrollbars */ - /* See overflow: hidden in .CodeMirror */ - margin-bottom: -30px; - margin-right: -30px; - outline: none; /* Prevent dragging from highlighting the element */ - overflow: scroll !important; /* Things will break if this is overridden */ - padding-bottom: 30px; - position: relative; -} - -.CodeMirror-sizer { - border-right: 30px solid transparent; - position: relative; -} - -/* The fake, visible scrollbars. Used to force redraw during scrolling - before actual scrolling happens, thus preventing shaking and - flickering artifacts. */ - -.CodeMirror-vscrollbar, -.CodeMirror-hscrollbar, -.CodeMirror-scrollbar-filler, -.CodeMirror-gutter-filler { - display: none; - position: absolute; - z-index: 6; -} - -.CodeMirror-vscrollbar { - overflow-x: hidden; - overflow-y: scroll; - right: 0; - top: 0; -} - -.CodeMirror-hscrollbar { - bottom: 0; - left: 0; - overflow-x: scroll; - overflow-y: hidden; -} - -.CodeMirror-scrollbar-filler { - right: 0; - bottom: 0; -} - -.CodeMirror-gutter-filler { - left: 0; - bottom: 0; -} - -.CodeMirror-gutters { - min-height: 100%; - position: absolute; - left: 0; - top: 0; - z-index: 3; -} - -.CodeMirror-gutter { - display: inline-block; - height: 100%; - margin-bottom: -30px; - vertical-align: top; - white-space: normal; -} - -.CodeMirror-gutter-wrapper { - background: none !important; - border: none !important; - position: absolute; - z-index: 4; -} - -.CodeMirror-gutter-background { - position: absolute; - top: 0; - bottom: 0; - z-index: 4; -} - -.CodeMirror-gutter-elt { - cursor: default; - position: absolute; - z-index: 4; -} - -.CodeMirror-gutter-wrapper { - user-select: none; -} - -.CodeMirror-lines { - cursor: text; - min-height: 1px; /* prevents collapsing before first draw */ -} - -.CodeMirror pre { - -webkit-tap-highlight-color: transparent; - /* Reset some styles that the rest of the page might have set */ - background: transparent; - border-radius: 0; - border-width: 0; - color: inherit; - font-family: inherit; - font-size: inherit; - font-variant-ligatures: none; - line-height: inherit; - margin: 0; - overflow: visible; - position: relative; - white-space: pre; - word-wrap: normal; - z-index: 2; -} - -.CodeMirror-wrap pre { - word-wrap: break-word; - white-space: pre-wrap; - word-break: normal; -} - -.CodeMirror-linebackground { - position: absolute; - left: 0; - right: 0; - top: 0; - bottom: 0; - z-index: 0; -} - -.CodeMirror-linewidget { - overflow: auto; - position: relative; - z-index: 2; -} - -.CodeMirror-widget { -} - -.CodeMirror-code { - outline: none; -} - -/* Force content-box sizing for the elements where we expect it */ - -.CodeMirror-scroll, -.CodeMirror-sizer, -.CodeMirror-gutter, -.CodeMirror-gutters, -.CodeMirror-linenumber { - box-sizing: content-box; -} - -.CodeMirror-measure { - height: 0; - overflow: hidden; - position: absolute; - visibility: hidden; - width: 100%; -} - -.CodeMirror-cursor { - position: absolute; -} - -.CodeMirror-measure pre { - position: static; -} - -div.CodeMirror-cursors { - position: relative; - visibility: hidden; - z-index: 3; -} - -div.CodeMirror-dragcursors { - visibility: visible; -} - -.CodeMirror-focused div.CodeMirror-cursors { - visibility: visible; -} - -.CodeMirror-selected { - background: #d9d9d9; -} - -.CodeMirror-focused .CodeMirror-selected { - background: #d7d4f0; -} - -.CodeMirror-crosshair { - cursor: crosshair; -} - -.CodeMirror-line::selection, -.CodeMirror-line > span::selection, -.CodeMirror-line > span > span::selection { - background: #d7d4f0; -} - -.CodeMirror-line::-moz-selection, -.CodeMirror-line > span::-moz-selection, -.CodeMirror-line > span > span::-moz-selection { - background: #d7d4f0; -} - -.cm-searching { - background: #ffa; - background: rgba(255, 255, 0, 0.4); -} - -/* Used to force a border model for a node */ - -.cm-force-border { - padding-right: 0.1px; -} - -@media print { - /* Hide the cursor when printing */ - .CodeMirror div.CodeMirror-cursors { - visibility: hidden; - } -} - -/* See issue #2901 */ - -.cm-tab-wrap-hack:after { - content: ''; -} - -/* Help users use markselection to safely style text background */ - -span.CodeMirror-selectedtext { - background: none; -} - -.CodeMirror-dialog { - background: inherit; - color: inherit; - left: 0; - right: 0; - overflow: hidden; - padding: 0.1em 0.8em; - position: absolute; - z-index: 15; -} - -.CodeMirror-dialog-top { - border-bottom: 1px solid #eee; - top: 0; -} - -.CodeMirror-dialog-bottom { - border-top: 1px solid #eee; - bottom: 0; -} - -.CodeMirror-dialog input { - background: transparent; - border: 1px solid #d3d6db; - color: inherit; - font-family: monospace; - outline: none; - width: 20em; -} - -.CodeMirror-dialog button { - font-size: 70%; -} - -.CodeMirror-foldmarker { - color: blue; - cursor: pointer; - font-family: arial; - line-height: 0.3; - text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, - #b9f -1px 1px 2px; -} -.CodeMirror-foldgutter { - width: 0.7em; -} -.CodeMirror-foldgutter-open, -.CodeMirror-foldgutter-folded { - cursor: pointer; -} -.CodeMirror-foldgutter-open:after { - content: '\25BE'; -} -.CodeMirror-foldgutter-folded:after { - content: '\25B8'; -} - -.CodeMirror-info { - background: white; - border-radius: 2px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); - box-sizing: border-box; - color: #555; - font-family: system, -apple-system, 'San Francisco', '.SFNSDisplay-Regular', - 'Segoe UI', Segoe, 'Segoe WP', 'Helvetica Neue', helvetica, 'Lucida Grande', - arial, sans-serif; - font-size: 13px; - line-height: 16px; - margin: 8px -8px; - max-width: 400px; - opacity: 0; - overflow: hidden; - padding: 8px 8px; - position: fixed; - transition: opacity 0.15s; - z-index: 50; -} - -.CodeMirror-info :first-child { - margin-top: 0; -} - -.CodeMirror-info :last-child { - margin-bottom: 0; -} - -.CodeMirror-info p { - margin: 1em 0; -} - -.CodeMirror-info .info-description { - color: #777; - line-height: 16px; - margin-top: 1em; - max-height: 80px; - overflow: hidden; -} - -.CodeMirror-info .info-deprecation { - background: #fffae8; - box-shadow: inset 0 1px 1px -1px #bfb063; - color: #867f70; - line-height: 16px; - margin: -8px; - margin-top: 8px; - max-height: 80px; - overflow: hidden; - padding: 8px; -} - -.CodeMirror-info .info-deprecation-label { - color: #c79b2e; - cursor: default; - display: block; - font-size: 9px; - font-weight: bold; - letter-spacing: 1px; - line-height: 1; - padding-bottom: 5px; - text-transform: uppercase; - user-select: none; -} - -.CodeMirror-info .info-deprecation-label + * { - margin-top: 0; -} - -.CodeMirror-info a { - text-decoration: none; -} - -.CodeMirror-info a:hover { - text-decoration: underline; -} - -.CodeMirror-info .type-name { - color: #ca9800; -} - -.CodeMirror-info .field-name { - color: #1f61a0; -} - -.CodeMirror-info .enum-value { - color: #0b7fc7; -} - -.CodeMirror-info .arg-name { - color: #8b2bb9; -} - -.CodeMirror-info .directive-name { - color: #b33086; -} - -.CodeMirror-jump-token { - text-decoration: underline; - cursor: pointer; -} - -/* The lint marker gutter */ -.CodeMirror-lint-markers { - width: 16px; -} -.CodeMirror-lint-tooltip { - background-color: infobackground; - border-radius: 4px 4px 4px 4px; - border: 1px solid black; - color: infotext; - font-family: monospace; - font-size: 10pt; - max-width: 600px; - opacity: 0; - overflow: hidden; - padding: 2px 5px; - position: fixed; - transition: opacity 0.4s; - white-space: pre-wrap; - z-index: 100; -} -.CodeMirror-lint-mark-error, -.CodeMirror-lint-mark-warning { - background-position: left bottom; - background-repeat: repeat-x; -} -.CodeMirror-lint-mark-error { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==); -} -.CodeMirror-lint-mark-warning { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=); -} -.CodeMirror-lint-marker-error, -.CodeMirror-lint-marker-warning { - background-position: center center; - background-repeat: no-repeat; - cursor: pointer; - display: inline-block; - height: 16px; - position: relative; - vertical-align: middle; - width: 16px; -} -.CodeMirror-lint-message-error, -.CodeMirror-lint-message-warning { - background-position: top left; - background-repeat: no-repeat; - padding-left: 18px; -} -.CodeMirror-lint-marker-error, -.CodeMirror-lint-message-error { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=); -} -.CodeMirror-lint-marker-warning, -.CodeMirror-lint-message-warning { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=); -} -.CodeMirror-lint-marker-multiple { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC); - background-position: right bottom; - background-repeat: no-repeat; - width: 100%; - height: 100%; -} - -.graphiql-container .spinner-container { - height: 36px; - left: 50%; - position: absolute; - top: 50%; - transform: translate(-50%, -50%); - width: 36px; - z-index: 10; -} - -.graphiql-container .spinner { - animation: rotation 0.6s infinite linear; - border-bottom: 6px solid rgba(150, 150, 150, 0.15); - border-left: 6px solid rgba(150, 150, 150, 0.15); - border-radius: 100%; - border-right: 6px solid rgba(150, 150, 150, 0.15); - border-top: 6px solid rgba(150, 150, 150, 0.8); - display: inline-block; - height: 24px; - position: absolute; - vertical-align: middle; - width: 24px; -} - -@keyframes rotation { - from { - transform: rotate(0deg); - } - to { - transform: rotate(359deg); - } -} - -.CodeMirror-hints { - background: white; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45); - font-family: 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace; - font-size: 13px; - list-style: none; - margin-left: -6px; - margin: 0; - max-height: 14.5em; - overflow: hidden; - overflow-y: auto; - padding: 0; - position: absolute; - z-index: 10; -} - -.CodeMirror-hint { - border-top: solid 1px #f7f7f7; - color: #141823; - cursor: pointer; - margin: 0; - max-width: 300px; - overflow: hidden; - padding: 2px 6px; - white-space: pre; -} - -li.CodeMirror-hint-active { - background-color: #08f; - border-top-color: white; - color: white; -} - -.CodeMirror-hint-information { - border-top: solid 1px #c0c0c0; - max-width: 300px; - padding: 4px 6px; - position: relative; - z-index: 1; -} - -.CodeMirror-hint-information:first-child { - border-bottom: solid 1px #c0c0c0; - border-top: none; - margin-bottom: -1px; -} - -.CodeMirror-hint-deprecation { - background: #fffae8; - box-shadow: inset 0 1px 1px -1px #bfb063; - color: #867f70; - font-family: system, -apple-system, 'San Francisco', '.SFNSDisplay-Regular', - 'Segoe UI', Segoe, 'Segoe WP', 'Helvetica Neue', helvetica, 'Lucida Grande', - arial, sans-serif; - font-size: 13px; - line-height: 16px; - margin-top: 4px; - max-height: 80px; - overflow: hidden; - padding: 6px; -} - -.CodeMirror-hint-deprecation .deprecation-label { - color: #c79b2e; - cursor: default; - display: block; - font-size: 9px; - font-weight: bold; - letter-spacing: 1px; - line-height: 1; - padding-bottom: 5px; - text-transform: uppercase; - user-select: none; -} - -.CodeMirror-hint-deprecation .deprecation-label + * { - margin-top: 0; -} - -.CodeMirror-hint-deprecation :last-child { - margin-bottom: 0; -} - -.graphiql-container .doc-explorer { - background: white; -} - -.graphiql-container .doc-explorer-title-bar, -.graphiql-container .history-title-bar { - cursor: default; - display: flex; - height: 34px; - line-height: 14px; - padding: 8px 8px 5px; - position: relative; - user-select: none; -} - -.graphiql-container .doc-explorer-title, -.graphiql-container .history-title { - flex: 1; - font-weight: bold; - overflow-x: hidden; - padding: 10px 0 10px 10px; - text-align: center; - text-overflow: ellipsis; - user-select: text; - white-space: nowrap; -} - -.graphiql-container .doc-explorer-back { - color: #3b5998; - cursor: pointer; - margin: -7px 0 -6px -8px; - overflow-x: hidden; - padding: 17px 12px 16px 16px; - text-overflow: ellipsis; - white-space: nowrap; - background: 0; - border: 0; - line-height: 14px; -} - -.doc-explorer-narrow .doc-explorer-back { - width: 0; -} - -.graphiql-container .doc-explorer-back:before { - border-left: 2px solid #3b5998; - border-top: 2px solid #3b5998; - content: ''; - display: inline-block; - height: 9px; - margin: 0 3px -1px 0; - position: relative; - transform: rotate(-45deg); - width: 9px; -} - -.graphiql-container .doc-explorer-rhs { - position: relative; -} - -.graphiql-container .doc-explorer-contents, -.graphiql-container .history-contents { - background-color: #ffffff; - border-top: 1px solid #d6d6d6; - bottom: 0; - left: 0; - overflow-y: auto; - padding: 20px 15px; - position: absolute; - right: 0; - top: 47px; -} - -.graphiql-container .doc-explorer-contents { - min-width: 300px; -} - -.graphiql-container .doc-type-description p:first-child, -.graphiql-container .doc-type-description blockquote:first-child { - margin-top: 0; -} - -.graphiql-container .doc-explorer-contents a { - cursor: pointer; - text-decoration: none; -} - -.graphiql-container .doc-explorer-contents a:hover { - text-decoration: underline; -} - -.graphiql-container .doc-value-description > :first-child { - margin-top: 4px; -} - -.graphiql-container .doc-value-description > :last-child { - margin-bottom: 4px; -} - -.graphiql-container .doc-type-description code, -.graphiql-container .doc-type-description pre, -.graphiql-container .doc-category code, -.graphiql-container .doc-category pre { - --saf-0: rgba(var(--sk_foreground_low, 29, 28, 29), 0.13); - font-size: 12px; - line-height: 1.50001; - font-variant-ligatures: none; - white-space: pre; - white-space: pre-wrap; - word-wrap: break-word; - word-break: normal; - -webkit-tab-size: 4; - -moz-tab-size: 4; - tab-size: 4; -} - -.graphiql-container .doc-type-description code, -.graphiql-container .doc-category code { - padding: 2px 3px 1px; - border: 1px solid var(--saf-0); - border-radius: 3px; - background-color: rgba(var(--sk_foreground_min, 29, 28, 29), 0.04); - color: #e01e5a; - background-color: white; -} - -.graphiql-container .doc-category { - margin: 20px 0; -} - -.graphiql-container .doc-category-title { - border-bottom: 1px solid #e0e0e0; - color: #777; - cursor: default; - font-size: 14px; - font-variant: small-caps; - font-weight: bold; - letter-spacing: 1px; - margin: 0 -15px 10px 0; - padding: 10px 0; - user-select: none; -} - -.graphiql-container .doc-category-item { - margin: 12px 0; - color: #555; -} - -.graphiql-container .keyword { - color: #b11a04; -} - -.graphiql-container .type-name { - color: #ca9800; -} - -.graphiql-container .field-name { - color: #1f61a0; -} - -.graphiql-container .field-short-description { - color: #666; - margin-left: 5px; - overflow: hidden; - text-overflow: ellipsis; -} - -.graphiql-container .enum-value { - color: #0b7fc7; -} - -.graphiql-container .arg-name { - color: #8b2bb9; -} - -.graphiql-container .arg { - display: block; - margin-left: 1em; -} - -.graphiql-container .arg:first-child:last-child, -.graphiql-container .arg:first-child:nth-last-child(2), -.graphiql-container .arg:first-child:nth-last-child(2) ~ .arg { - display: inherit; - margin: inherit; -} - -.graphiql-container .arg:first-child:nth-last-child(2):after { - content: ', '; -} - -.graphiql-container .arg-default-value { - color: #43a047; -} - -.graphiql-container .doc-deprecation { - background: #fffae8; - box-shadow: inset 0 0 1px #bfb063; - color: #867f70; - line-height: 16px; - margin: 8px -8px; - max-height: 80px; - overflow: hidden; - padding: 8px; - border-radius: 3px; -} - -.graphiql-container .doc-deprecation:before { - content: 'Deprecated:'; - color: #c79b2e; - cursor: default; - display: block; - font-size: 9px; - font-weight: bold; - letter-spacing: 1px; - line-height: 1; - padding-bottom: 5px; - text-transform: uppercase; - user-select: none; -} - -.graphiql-container .doc-deprecation > :first-child { - margin-top: 0; -} - -.graphiql-container .doc-deprecation > :last-child { - margin-bottom: 0; -} - -.graphiql-container .show-btn { - -webkit-appearance: initial; - display: block; - border-radius: 3px; - border: solid 1px #ccc; - text-align: center; - padding: 8px 12px 10px; - width: 100%; - box-sizing: border-box; - background: #fbfcfc; - color: #555; - cursor: pointer; -} - -.graphiql-container .search-box { - border-bottom: 1px solid #d3d6db; - display: flex; - align-items: center; - font-size: 14px; - margin: -15px -15px 12px 0; - position: relative; -} - -.graphiql-container .search-box-icon { - cursor: pointer; - display: block; - font-size: 24px; - transform: rotate(-45deg); - user-select: none; -} - -.graphiql-container .search-box .search-box-clear { - background-color: #d0d0d0; - border-radius: 12px; - color: #fff; - cursor: pointer; - font-size: 11px; - padding: 1px 5px 2px; - position: absolute; - right: 3px; - user-select: none; - border: 0; -} - -.graphiql-container .search-box .search-box-clear:hover { - background-color: #b9b9b9; -} - -.graphiql-container .search-box > input { - border: none; - box-sizing: border-box; - font-size: 14px; - outline: none; - padding: 6px 24px 8px 20px; - width: 100%; -} - -.graphiql-container .error-container { - font-weight: bold; - left: 0; - letter-spacing: 1px; - opacity: 0.5; - position: absolute; - right: 0; - text-align: center; - text-transform: uppercase; - top: 50%; - transform: translate(0, -50%); -} - -.graphiql-container .history-contents { - font-family: 'Consolas', 'Inconsolata', 'Droid Sans Mono', 'Monaco', monospace; -} - -.graphiql-container .history-contents { - margin: 0; - padding: 0; -} - -.graphiql-container .history-contents li { - align-items: center; - display: flex; - font-size: 12px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - margin: 0; - padding: 8px; - border-bottom: 1px solid #e0e0e0; -} - -.graphiql-container .history-contents li button:not(.history-label) { - display: none; - margin-left: 10px; -} - -.graphiql-container .history-contents li:hover button:not(.history-label), -.graphiql-container - .history-contents - li:focus-within - button:not(.history-label) { - display: inline-block; -} - -.graphiql-container .history-contents input, -.graphiql-container .history-contents button { - padding: 0; - background: 0; - border: 0; - font-size: inherit; - font-family: inherit; - line-height: 14px; - color: inherit; -} - -.graphiql-container .history-contents input { - flex-grow: 1; -} - -.graphiql-container .history-contents input::placeholder { - color: inherit; -} - -.graphiql-container .history-contents button { - cursor: pointer; - text-align: left; -} - -.graphiql-container .history-contents .history-label { - flex-grow: 1; - overflow: hidden; - text-overflow: ellipsis; -} - - -[class*=ant-] input::-ms-clear,[class*=ant-] input::-ms-reveal,[class*=ant-]::-ms-clear,[class^=ant-] input::-ms-clear,[class^=ant-] input::-ms-reveal,[class^=ant-]::-ms-clear{display:none}body,html{height:100%;width:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{box-sizing:border-box}html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:sans-serif;line-height:1.15}@-ms-viewport{width:device-width}body{font-feature-settings:"tnum";background-color:#fff;color:rgba(0,0,0,.85);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:14px;font-variant:tabular-nums;line-height:1.5715;margin:0}[tabindex="-1"]:focus{outline:none!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{color:rgba(0,0,0,.85);font-weight:500;margin-bottom:.5em;margin-top:0}p{margin-bottom:1em;margin-top:0}abbr[data-original-title],abbr[title]{border-bottom:0;cursor:help;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}address{font-style:normal;line-height:inherit;margin-bottom:1em}input[type=number],input[type=password],input[type=text],textarea{-webkit-appearance:none}dl,ol,ul{margin-bottom:1em;margin-top:0}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{-webkit-text-decoration-skip:objects;background-color:transparent;color:#1890ff;cursor:pointer;outline:none;text-decoration:none;transition:color .3s}a:hover{color:#40a9ff}a:active{color:#096dd9}a:active,a:focus,a:hover{outline:0;text-decoration:none}a[disabled]{color:rgba(0,0,0,.25);cursor:not-allowed}code,kbd,pre,samp{font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:1em}pre{margin-bottom:1em;margin-top:0;overflow:auto}figure{margin:0 0 1em}img{border-style:none;vertical-align:middle}[role=button],a,area,button,input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{caption-side:bottom;color:rgba(0,0,0,.45);padding-bottom:.3em;padding-top:.75em;text-align:left}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{border:0;margin:0;min-width:0;padding:0}legend{color:inherit;display:block;font-size:1.5em;line-height:inherit;margin-bottom:.5em;max-width:100%;padding:0;white-space:normal;width:100%}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:none;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{background-color:#feffe6;padding:.2em}::-moz-selection{background:#1890ff;color:#fff}::selection{background:#1890ff;color:#fff}.clearfix:after,.clearfix:before{content:"";display:table}.clearfix:after{clear:both}.anticon{text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:inherit;display:inline-block;font-style:normal;line-height:0;text-align:center;text-transform:none;vertical-align:-.125em}.anticon>*{line-height:1}.anticon svg{display:inline-block}.anticon:before{display:none}.anticon .anticon-icon{display:block}.anticon>.anticon{line-height:0;vertical-align:0}.anticon[tabindex]{cursor:pointer}.anticon-spin,.anticon-spin:before{-webkit-animation:loadingCircle 1s linear infinite;animation:loadingCircle 1s linear infinite;display:inline-block}.ant-fade-appear,.ant-fade-enter,.ant-fade-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-fade-appear.ant-fade-appear-active,.ant-fade-enter.ant-fade-enter-active{-webkit-animation-name:antFadeIn;animation-name:antFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-fade-leave.ant-fade-leave-active{-webkit-animation-name:antFadeOut;animation-name:antFadeOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-fade-appear,.ant-fade-enter{opacity:0}.ant-fade-appear,.ant-fade-enter,.ant-fade-leave{-webkit-animation-timing-function:linear;animation-timing-function:linear}@-webkit-keyframes antFadeIn{0%{opacity:0}to{opacity:1}}@keyframes antFadeIn{0%{opacity:0}to{opacity:1}}@-webkit-keyframes antFadeOut{0%{opacity:1}to{opacity:0}}@keyframes antFadeOut{0%{opacity:1}to{opacity:0}}.ant-move-up-appear,.ant-move-up-enter,.ant-move-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-move-up-appear.ant-move-up-appear-active,.ant-move-up-enter.ant-move-up-enter-active{-webkit-animation-name:antMoveUpIn;animation-name:antMoveUpIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-move-up-leave.ant-move-up-leave-active{-webkit-animation-name:antMoveUpOut;animation-name:antMoveUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-move-up-appear,.ant-move-up-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0}.ant-move-up-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.ant-move-down-appear,.ant-move-down-enter,.ant-move-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-move-down-appear.ant-move-down-appear-active,.ant-move-down-enter.ant-move-down-enter-active{-webkit-animation-name:antMoveDownIn;animation-name:antMoveDownIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-move-down-leave.ant-move-down-leave-active{-webkit-animation-name:antMoveDownOut;animation-name:antMoveDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-move-down-appear,.ant-move-down-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0}.ant-move-down-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.ant-move-left-appear,.ant-move-left-enter,.ant-move-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-move-left-appear.ant-move-left-appear-active,.ant-move-left-enter.ant-move-left-enter-active{-webkit-animation-name:antMoveLeftIn;animation-name:antMoveLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-move-left-leave.ant-move-left-leave-active{-webkit-animation-name:antMoveLeftOut;animation-name:antMoveLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-move-left-appear,.ant-move-left-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0}.ant-move-left-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}.ant-move-right-appear,.ant-move-right-enter,.ant-move-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-move-right-appear.ant-move-right-appear-active,.ant-move-right-enter.ant-move-right-enter-active{-webkit-animation-name:antMoveRightIn;animation-name:antMoveRightIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-move-right-leave.ant-move-right-leave-active{-webkit-animation-name:antMoveRightOut;animation-name:antMoveRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-move-right-appear,.ant-move-right-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0}.ant-move-right-leave{-webkit-animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-timing-function:cubic-bezier(.6,.04,.98,.34)}@-webkit-keyframes antMoveDownIn{0%{opacity:0;transform:translateY(100%);transform-origin:0 0}to{opacity:1;transform:translateY(0);transform-origin:0 0}}@keyframes antMoveDownIn{0%{opacity:0;transform:translateY(100%);transform-origin:0 0}to{opacity:1;transform:translateY(0);transform-origin:0 0}}@-webkit-keyframes antMoveDownOut{0%{opacity:1;transform:translateY(0);transform-origin:0 0}to{opacity:0;transform:translateY(100%);transform-origin:0 0}}@keyframes antMoveDownOut{0%{opacity:1;transform:translateY(0);transform-origin:0 0}to{opacity:0;transform:translateY(100%);transform-origin:0 0}}@-webkit-keyframes antMoveLeftIn{0%{opacity:0;transform:translateX(-100%);transform-origin:0 0}to{opacity:1;transform:translateX(0);transform-origin:0 0}}@keyframes antMoveLeftIn{0%{opacity:0;transform:translateX(-100%);transform-origin:0 0}to{opacity:1;transform:translateX(0);transform-origin:0 0}}@-webkit-keyframes antMoveLeftOut{0%{opacity:1;transform:translateX(0);transform-origin:0 0}to{opacity:0;transform:translateX(-100%);transform-origin:0 0}}@keyframes antMoveLeftOut{0%{opacity:1;transform:translateX(0);transform-origin:0 0}to{opacity:0;transform:translateX(-100%);transform-origin:0 0}}@-webkit-keyframes antMoveRightIn{0%{opacity:0;transform:translateX(100%);transform-origin:0 0}to{opacity:1;transform:translateX(0);transform-origin:0 0}}@keyframes antMoveRightIn{0%{opacity:0;transform:translateX(100%);transform-origin:0 0}to{opacity:1;transform:translateX(0);transform-origin:0 0}}@-webkit-keyframes antMoveRightOut{0%{opacity:1;transform:translateX(0);transform-origin:0 0}to{opacity:0;transform:translateX(100%);transform-origin:0 0}}@keyframes antMoveRightOut{0%{opacity:1;transform:translateX(0);transform-origin:0 0}to{opacity:0;transform:translateX(100%);transform-origin:0 0}}@-webkit-keyframes antMoveUpIn{0%{opacity:0;transform:translateY(-100%);transform-origin:0 0}to{opacity:1;transform:translateY(0);transform-origin:0 0}}@keyframes antMoveUpIn{0%{opacity:0;transform:translateY(-100%);transform-origin:0 0}to{opacity:1;transform:translateY(0);transform-origin:0 0}}@-webkit-keyframes antMoveUpOut{0%{opacity:1;transform:translateY(0);transform-origin:0 0}to{opacity:0;transform:translateY(-100%);transform-origin:0 0}}@keyframes antMoveUpOut{0%{opacity:1;transform:translateY(0);transform-origin:0 0}to{opacity:0;transform:translateY(-100%);transform-origin:0 0}}@-webkit-keyframes loadingCircle{to{transform:rotate(1turn)}}@keyframes loadingCircle{to{transform:rotate(1turn)}}[ant-click-animating-without-extra-node=true],[ant-click-animating=true]{position:relative}html{--antd-wave-shadow-color:#1890ff;--scroll-bar:0}.ant-click-animating-node,[ant-click-animating-without-extra-node=true]:after{-webkit-animation:fadeEffect 2s cubic-bezier(.08,.82,.17,1),waveEffect .4s cubic-bezier(.08,.82,.17,1);animation:fadeEffect 2s cubic-bezier(.08,.82,.17,1),waveEffect .4s cubic-bezier(.08,.82,.17,1);-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;border-radius:inherit;bottom:0;box-shadow:0 0 0 0 #1890ff;box-shadow:0 0 0 0 var(--antd-wave-shadow-color);content:"";display:block;left:0;opacity:.2;pointer-events:none;position:absolute;right:0;top:0}@-webkit-keyframes waveEffect{to{box-shadow:0 0 0 #1890ff;box-shadow:0 0 0 6px var(--antd-wave-shadow-color)}}@keyframes waveEffect{to{box-shadow:0 0 0 #1890ff;box-shadow:0 0 0 6px var(--antd-wave-shadow-color)}}@-webkit-keyframes fadeEffect{to{opacity:0}}@keyframes fadeEffect{to{opacity:0}}.ant-slide-up-appear,.ant-slide-up-enter,.ant-slide-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-slide-up-appear.ant-slide-up-appear-active,.ant-slide-up-enter.ant-slide-up-enter-active{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-slide-up-leave.ant-slide-up-leave-active{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-slide-up-appear,.ant-slide-up-enter{-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1);opacity:0}.ant-slide-up-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.ant-slide-down-appear,.ant-slide-down-enter,.ant-slide-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-slide-down-appear.ant-slide-down-appear-active,.ant-slide-down-enter.ant-slide-down-enter-active{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-slide-down-leave.ant-slide-down-leave-active{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-slide-down-appear,.ant-slide-down-enter{-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1);opacity:0}.ant-slide-down-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.ant-slide-left-appear,.ant-slide-left-enter,.ant-slide-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-slide-left-appear.ant-slide-left-appear-active,.ant-slide-left-enter.ant-slide-left-enter-active{-webkit-animation-name:antSlideLeftIn;animation-name:antSlideLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-slide-left-leave.ant-slide-left-leave-active{-webkit-animation-name:antSlideLeftOut;animation-name:antSlideLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-slide-left-appear,.ant-slide-left-enter{-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1);opacity:0}.ant-slide-left-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}.ant-slide-right-appear,.ant-slide-right-enter,.ant-slide-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-slide-right-appear.ant-slide-right-appear-active,.ant-slide-right-enter.ant-slide-right-enter-active{-webkit-animation-name:antSlideRightIn;animation-name:antSlideRightIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-slide-right-leave.ant-slide-right-leave-active{-webkit-animation-name:antSlideRightOut;animation-name:antSlideRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-slide-right-appear,.ant-slide-right-enter{-webkit-animation-timing-function:cubic-bezier(.23,1,.32,1);animation-timing-function:cubic-bezier(.23,1,.32,1);opacity:0}.ant-slide-right-leave{-webkit-animation-timing-function:cubic-bezier(.755,.05,.855,.06);animation-timing-function:cubic-bezier(.755,.05,.855,.06)}@-webkit-keyframes antSlideUpIn{0%{opacity:0;transform:scaleY(.8);transform-origin:0 0}to{opacity:1;transform:scaleY(1);transform-origin:0 0}}@keyframes antSlideUpIn{0%{opacity:0;transform:scaleY(.8);transform-origin:0 0}to{opacity:1;transform:scaleY(1);transform-origin:0 0}}@-webkit-keyframes antSlideUpOut{0%{opacity:1;transform:scaleY(1);transform-origin:0 0}to{opacity:0;transform:scaleY(.8);transform-origin:0 0}}@keyframes antSlideUpOut{0%{opacity:1;transform:scaleY(1);transform-origin:0 0}to{opacity:0;transform:scaleY(.8);transform-origin:0 0}}@-webkit-keyframes antSlideDownIn{0%{opacity:0;transform:scaleY(.8);transform-origin:100% 100%}to{opacity:1;transform:scaleY(1);transform-origin:100% 100%}}@keyframes antSlideDownIn{0%{opacity:0;transform:scaleY(.8);transform-origin:100% 100%}to{opacity:1;transform:scaleY(1);transform-origin:100% 100%}}@-webkit-keyframes antSlideDownOut{0%{opacity:1;transform:scaleY(1);transform-origin:100% 100%}to{opacity:0;transform:scaleY(.8);transform-origin:100% 100%}}@keyframes antSlideDownOut{0%{opacity:1;transform:scaleY(1);transform-origin:100% 100%}to{opacity:0;transform:scaleY(.8);transform-origin:100% 100%}}@-webkit-keyframes antSlideLeftIn{0%{opacity:0;transform:scaleX(.8);transform-origin:0 0}to{opacity:1;transform:scaleX(1);transform-origin:0 0}}@keyframes antSlideLeftIn{0%{opacity:0;transform:scaleX(.8);transform-origin:0 0}to{opacity:1;transform:scaleX(1);transform-origin:0 0}}@-webkit-keyframes antSlideLeftOut{0%{opacity:1;transform:scaleX(1);transform-origin:0 0}to{opacity:0;transform:scaleX(.8);transform-origin:0 0}}@keyframes antSlideLeftOut{0%{opacity:1;transform:scaleX(1);transform-origin:0 0}to{opacity:0;transform:scaleX(.8);transform-origin:0 0}}@-webkit-keyframes antSlideRightIn{0%{opacity:0;transform:scaleX(.8);transform-origin:100% 0}to{opacity:1;transform:scaleX(1);transform-origin:100% 0}}@keyframes antSlideRightIn{0%{opacity:0;transform:scaleX(.8);transform-origin:100% 0}to{opacity:1;transform:scaleX(1);transform-origin:100% 0}}@-webkit-keyframes antSlideRightOut{0%{opacity:1;transform:scaleX(1);transform-origin:100% 0}to{opacity:0;transform:scaleX(.8);transform-origin:100% 0}}@keyframes antSlideRightOut{0%{opacity:1;transform:scaleX(1);transform-origin:100% 0}to{opacity:0;transform:scaleX(.8);transform-origin:100% 0}}.ant-zoom-appear,.ant-zoom-enter,.ant-zoom-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-appear.ant-zoom-appear-active,.ant-zoom-enter.ant-zoom-enter-active{-webkit-animation-name:antZoomIn;animation-name:antZoomIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-leave.ant-zoom-leave-active{-webkit-animation-name:antZoomOut;animation-name:antZoomOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-appear,.ant-zoom-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-appear-prepare,.ant-zoom-enter-prepare{transform:none}.ant-zoom-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-big-appear,.ant-zoom-big-enter,.ant-zoom-big-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-big-appear.ant-zoom-big-appear-active,.ant-zoom-big-enter.ant-zoom-big-enter-active{-webkit-animation-name:antZoomBigIn;animation-name:antZoomBigIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-big-leave.ant-zoom-big-leave-active{-webkit-animation-name:antZoomBigOut;animation-name:antZoomBigOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-big-appear,.ant-zoom-big-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-big-appear-prepare,.ant-zoom-big-enter-prepare{transform:none}.ant-zoom-big-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-big-fast-appear,.ant-zoom-big-fast-enter,.ant-zoom-big-fast-leave{-webkit-animation-duration:.1s;animation-duration:.1s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-big-fast-appear.ant-zoom-big-fast-appear-active,.ant-zoom-big-fast-enter.ant-zoom-big-fast-enter-active{-webkit-animation-name:antZoomBigIn;animation-name:antZoomBigIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-big-fast-leave.ant-zoom-big-fast-leave-active{-webkit-animation-name:antZoomBigOut;animation-name:antZoomBigOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-big-fast-appear,.ant-zoom-big-fast-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-big-fast-appear-prepare,.ant-zoom-big-fast-enter-prepare{transform:none}.ant-zoom-big-fast-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-up-appear,.ant-zoom-up-enter,.ant-zoom-up-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-up-appear.ant-zoom-up-appear-active,.ant-zoom-up-enter.ant-zoom-up-enter-active{-webkit-animation-name:antZoomUpIn;animation-name:antZoomUpIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-up-leave.ant-zoom-up-leave-active{-webkit-animation-name:antZoomUpOut;animation-name:antZoomUpOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-up-appear,.ant-zoom-up-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-up-appear-prepare,.ant-zoom-up-enter-prepare{transform:none}.ant-zoom-up-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-down-appear,.ant-zoom-down-enter,.ant-zoom-down-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-down-appear.ant-zoom-down-appear-active,.ant-zoom-down-enter.ant-zoom-down-enter-active{-webkit-animation-name:antZoomDownIn;animation-name:antZoomDownIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-down-leave.ant-zoom-down-leave-active{-webkit-animation-name:antZoomDownOut;animation-name:antZoomDownOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-down-appear,.ant-zoom-down-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-down-appear-prepare,.ant-zoom-down-enter-prepare{transform:none}.ant-zoom-down-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-left-appear,.ant-zoom-left-enter,.ant-zoom-left-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-left-appear.ant-zoom-left-appear-active,.ant-zoom-left-enter.ant-zoom-left-enter-active{-webkit-animation-name:antZoomLeftIn;animation-name:antZoomLeftIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-left-leave.ant-zoom-left-leave-active{-webkit-animation-name:antZoomLeftOut;animation-name:antZoomLeftOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-left-appear,.ant-zoom-left-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-left-appear-prepare,.ant-zoom-left-enter-prepare{transform:none}.ant-zoom-left-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-zoom-right-appear,.ant-zoom-right-enter,.ant-zoom-right-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-zoom-right-appear.ant-zoom-right-appear-active,.ant-zoom-right-enter.ant-zoom-right-enter-active{-webkit-animation-name:antZoomRightIn;animation-name:antZoomRightIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-zoom-right-leave.ant-zoom-right-leave-active{-webkit-animation-name:antZoomRightOut;animation-name:antZoomRightOut;-webkit-animation-play-state:running;animation-play-state:running;pointer-events:none}.ant-zoom-right-appear,.ant-zoom-right-enter{-webkit-animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-timing-function:cubic-bezier(.08,.82,.17,1);opacity:0;transform:scale(0)}.ant-zoom-right-appear-prepare,.ant-zoom-right-enter-prepare{transform:none}.ant-zoom-right-leave{-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}@-webkit-keyframes antZoomIn{0%{opacity:0;transform:scale(.2)}to{opacity:1;transform:scale(1)}}@keyframes antZoomIn{0%{opacity:0;transform:scale(.2)}to{opacity:1;transform:scale(1)}}@-webkit-keyframes antZoomOut{0%{transform:scale(1)}to{opacity:0;transform:scale(.2)}}@keyframes antZoomOut{0%{transform:scale(1)}to{opacity:0;transform:scale(.2)}}@-webkit-keyframes antZoomBigIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes antZoomBigIn{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@-webkit-keyframes antZoomBigOut{0%{transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes antZoomBigOut{0%{transform:scale(1)}to{opacity:0;transform:scale(.8)}}@-webkit-keyframes antZoomUpIn{0%{opacity:0;transform:scale(.8);transform-origin:50% 0}to{transform:scale(1);transform-origin:50% 0}}@keyframes antZoomUpIn{0%{opacity:0;transform:scale(.8);transform-origin:50% 0}to{transform:scale(1);transform-origin:50% 0}}@-webkit-keyframes antZoomUpOut{0%{transform:scale(1);transform-origin:50% 0}to{opacity:0;transform:scale(.8);transform-origin:50% 0}}@keyframes antZoomUpOut{0%{transform:scale(1);transform-origin:50% 0}to{opacity:0;transform:scale(.8);transform-origin:50% 0}}@-webkit-keyframes antZoomLeftIn{0%{opacity:0;transform:scale(.8);transform-origin:0 50%}to{transform:scale(1);transform-origin:0 50%}}@keyframes antZoomLeftIn{0%{opacity:0;transform:scale(.8);transform-origin:0 50%}to{transform:scale(1);transform-origin:0 50%}}@-webkit-keyframes antZoomLeftOut{0%{transform:scale(1);transform-origin:0 50%}to{opacity:0;transform:scale(.8);transform-origin:0 50%}}@keyframes antZoomLeftOut{0%{transform:scale(1);transform-origin:0 50%}to{opacity:0;transform:scale(.8);transform-origin:0 50%}}@-webkit-keyframes antZoomRightIn{0%{opacity:0;transform:scale(.8);transform-origin:100% 50%}to{transform:scale(1);transform-origin:100% 50%}}@keyframes antZoomRightIn{0%{opacity:0;transform:scale(.8);transform-origin:100% 50%}to{transform:scale(1);transform-origin:100% 50%}}@-webkit-keyframes antZoomRightOut{0%{transform:scale(1);transform-origin:100% 50%}to{opacity:0;transform:scale(.8);transform-origin:100% 50%}}@keyframes antZoomRightOut{0%{transform:scale(1);transform-origin:100% 50%}to{opacity:0;transform:scale(.8);transform-origin:100% 50%}}@-webkit-keyframes antZoomDownIn{0%{opacity:0;transform:scale(.8);transform-origin:50% 100%}to{transform:scale(1);transform-origin:50% 100%}}@keyframes antZoomDownIn{0%{opacity:0;transform:scale(.8);transform-origin:50% 100%}to{transform:scale(1);transform-origin:50% 100%}}@-webkit-keyframes antZoomDownOut{0%{transform:scale(1);transform-origin:50% 100%}to{opacity:0;transform:scale(.8);transform-origin:50% 100%}}@keyframes antZoomDownOut{0%{transform:scale(1);transform-origin:50% 100%}to{opacity:0;transform:scale(.8);transform-origin:50% 100%}}.ant-motion-collapse-legacy{overflow:hidden}.ant-motion-collapse,.ant-motion-collapse-legacy-active{transition:height .2s cubic-bezier(.645,.045,.355,1),opacity .2s cubic-bezier(.645,.045,.355,1)!important}.ant-motion-collapse{overflow:hidden}.ant-affix{position:fixed;z-index:10}.ant-alert{font-feature-settings:"tnum";word-wrap:break-word;align-items:center;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:8px 15px;position:relative}.ant-alert-content{flex:1;min-width:0}.ant-alert-icon{margin-right:8px}.ant-alert-description{display:none;font-size:14px;line-height:22px}.ant-alert-success{background-color:#f6ffed;border:1px solid #b7eb8f}.ant-alert-success .ant-alert-icon{color:#52c41a}.ant-alert-info{background-color:#e6f7ff;border:1px solid #91d5ff}.ant-alert-info .ant-alert-icon{color:#1890ff}.ant-alert-warning{background-color:#fffbe6;border:1px solid #ffe58f}.ant-alert-warning .ant-alert-icon{color:#faad14}.ant-alert-error{background-color:#fff2f0;border:1px solid #ffccc7}.ant-alert-error .ant-alert-icon{color:#ff4d4f}.ant-alert-error .ant-alert-description>pre{margin:0;padding:0}.ant-alert-action{margin-left:8px}.ant-alert-close-icon{background-color:transparent;border:none;cursor:pointer;font-size:12px;line-height:12px;margin-left:8px;outline:none;overflow:hidden;padding:0}.ant-alert-close-icon .anticon-close{color:rgba(0,0,0,.45);transition:color .3s}.ant-alert-close-icon .anticon-close:hover{color:rgba(0,0,0,.75)}.ant-alert-close-text{color:rgba(0,0,0,.45);transition:color .3s}.ant-alert-close-text:hover{color:rgba(0,0,0,.75)}.ant-alert-with-description{align-items:flex-start;padding:15px 15px 15px 24px}.ant-alert-with-description.ant-alert-no-icon{padding:15px}.ant-alert-with-description .ant-alert-icon{font-size:24px;margin-right:15px}.ant-alert-with-description .ant-alert-message{color:rgba(0,0,0,.85);display:block;font-size:16px;margin-bottom:4px}.ant-alert-message{color:rgba(0,0,0,.85)}.ant-alert-with-description .ant-alert-description{display:block}.ant-alert.ant-alert-motion-leave{opacity:1;overflow:hidden;transition:max-height .3s cubic-bezier(.78,.14,.15,.86),opacity .3s cubic-bezier(.78,.14,.15,.86),padding-top .3s cubic-bezier(.78,.14,.15,.86),padding-bottom .3s cubic-bezier(.78,.14,.15,.86),margin-bottom .3s cubic-bezier(.78,.14,.15,.86)}.ant-alert.ant-alert-motion-leave-active{margin-bottom:0!important;max-height:0;opacity:0;padding-bottom:0;padding-top:0}.ant-alert-banner{border:0;border-radius:0;margin-bottom:0}.ant-alert.ant-alert-rtl{direction:rtl}.ant-alert-rtl .ant-alert-icon{margin-left:8px;margin-right:auto}.ant-alert-rtl .ant-alert-action,.ant-alert-rtl .ant-alert-close-icon{margin-left:auto;margin-right:8px}.ant-alert-rtl.ant-alert-with-description{padding-left:15px;padding-right:24px}.ant-alert-rtl.ant-alert-with-description .ant-alert-icon{margin-left:15px;margin-right:auto}.ant-anchor{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0 0 0 2px;position:relative}.ant-anchor-wrapper{background-color:transparent;margin-left:-4px;overflow:auto;padding-left:4px}.ant-anchor-ink{height:100%;left:0;position:absolute;top:0}.ant-anchor-ink:before{background-color:#f0f0f0;content:" ";display:block;height:100%;margin:0 auto;position:relative;width:2px}.ant-anchor-ink-ball{background-color:#fff;border:2px solid #1890ff;border-radius:8px;display:none;height:8px;left:50%;position:absolute;transform:translateX(-50%);transition:top .3s ease-in-out;width:8px}.ant-anchor-ink-ball.visible{display:inline-block}.ant-anchor-fixed .ant-anchor-ink .ant-anchor-ink-ball{display:none}.ant-anchor-link{padding:4px 0 4px 16px}.ant-anchor-link-title{color:rgba(0,0,0,.85);display:block;margin-bottom:3px;overflow:hidden;position:relative;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-anchor-link-title:only-child{margin-bottom:0}.ant-anchor-link-active>.ant-anchor-link-title{color:#1890ff}.ant-anchor-link .ant-anchor-link{padding-bottom:2px;padding-top:2px}.ant-anchor-rtl{direction:rtl}.ant-anchor-rtl.ant-anchor-wrapper{margin-left:0;margin-right:-4px;padding-left:0;padding-right:4px}.ant-anchor-rtl .ant-anchor-ink{left:auto;right:0}.ant-anchor-rtl .ant-anchor-ink-ball{left:0;right:50%;transform:translateX(50%)}.ant-anchor-rtl .ant-anchor-link{padding:4px 16px 4px 0}.ant-select-auto-complete{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-select-auto-complete .ant-select-clear{right:13px}.ant-avatar{font-feature-settings:"tnum";background:#ccc;border-radius:50%;box-sizing:border-box;color:rgba(0,0,0,.85);color:#fff;display:inline-block;font-size:14px;font-variant:tabular-nums;height:32px;line-height:1.5715;line-height:32px;list-style:none;margin:0;overflow:hidden;padding:0;position:relative;text-align:center;vertical-align:middle;white-space:nowrap;width:32px}.ant-avatar-image{background:transparent}.ant-avatar .ant-image-img{display:block}.ant-avatar-string{left:50%;position:absolute;transform-origin:0 center}.ant-avatar.ant-avatar-icon{font-size:18px}.ant-avatar.ant-avatar-icon>.anticon{margin:0}.ant-avatar-lg{border-radius:50%;height:40px;line-height:40px;width:40px}.ant-avatar-lg-string{left:50%;position:absolute;transform-origin:0 center}.ant-avatar-lg.ant-avatar-icon{font-size:24px}.ant-avatar-lg.ant-avatar-icon>.anticon{margin:0}.ant-avatar-sm{border-radius:50%;height:24px;line-height:24px;width:24px}.ant-avatar-sm-string{left:50%;position:absolute;transform-origin:0 center}.ant-avatar-sm.ant-avatar-icon{font-size:14px}.ant-avatar-sm.ant-avatar-icon>.anticon{margin:0}.ant-avatar-square{border-radius:2px}.ant-avatar>img{display:block;height:100%;-o-object-fit:cover;object-fit:cover;width:100%}.ant-avatar-group{display:inline-flex}.ant-avatar-group .ant-avatar{border:1px solid #fff}.ant-avatar-group .ant-avatar:not(:first-child){margin-left:-8px}.ant-avatar-group-popover .ant-avatar+.ant-avatar{margin-left:3px}.ant-avatar-group-rtl .ant-avatar:not(:first-child){margin-left:0;margin-right:-8px}.ant-avatar-group-popover.ant-popover-rtl .ant-avatar+.ant-avatar{margin-left:0;margin-right:3px}.ant-back-top{font-feature-settings:"tnum";bottom:50px;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;height:40px;line-height:1.5715;list-style:none;margin:0;padding:0;position:fixed;right:100px;width:40px;z-index:10}.ant-back-top:empty{display:none}.ant-back-top-rtl{direction:rtl;left:100px;right:auto}.ant-back-top-content{background-color:rgba(0,0,0,.45);border-radius:20px;color:#fff;height:40px;overflow:hidden;text-align:center;transition:all .3s;width:40px}.ant-back-top-content:hover{background-color:rgba(0,0,0,.85);transition:all .3s}.ant-back-top-icon{font-size:24px;line-height:40px}@media screen and (max-width:768px){.ant-back-top{right:60px}.ant-back-top-rtl{left:60px;right:auto}}@media screen and (max-width:480px){.ant-back-top{right:20px}.ant-back-top-rtl{left:20px;right:auto}}.ant-badge{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;padding:0;position:relative}.ant-badge-count{background:#ff4d4f;border-radius:10px;box-shadow:0 0 0 1px #fff;color:#fff;font-size:12px;font-weight:400;height:20px;line-height:20px;min-width:20px;padding:0 6px;text-align:center;white-space:nowrap;z-index:auto}.ant-badge-count a,.ant-badge-count a:hover{color:#fff}.ant-badge-count-sm{border-radius:7px;font-size:12px;height:14px;line-height:14px;min-width:14px;padding:0}.ant-badge-multiple-words{padding:0 8px}.ant-badge-dot{background:#ff4d4f;border-radius:100%;box-shadow:0 0 0 1px #fff;height:6px;min-width:6px;width:6px;z-index:auto}.ant-badge-dot.ant-scroll-number{transition:background 1.5s}.ant-badge .ant-scroll-number-custom-component,.ant-badge-count,.ant-badge-dot{position:absolute;right:0;top:0;transform:translate(50%,-50%);transform-origin:100% 0}.ant-badge .ant-scroll-number-custom-component.anticon-spin,.ant-badge-count.anticon-spin,.ant-badge-dot.anticon-spin{-webkit-animation:antBadgeLoadingCircle 1s linear infinite;animation:antBadgeLoadingCircle 1s linear infinite}.ant-badge-status{line-height:inherit;vertical-align:baseline}.ant-badge-status-dot{border-radius:50%;display:inline-block;height:6px;position:relative;top:-1px;vertical-align:middle;width:6px}.ant-badge-status-success{background-color:#52c41a}.ant-badge-status-processing{background-color:#1890ff;position:relative}.ant-badge-status-processing:after{-webkit-animation:antStatusProcessing 1.2s ease-in-out infinite;animation:antStatusProcessing 1.2s ease-in-out infinite;border:1px solid #1890ff;border-radius:50%;content:"";height:100%;left:0;position:absolute;top:0;width:100%}.ant-badge-status-default{background-color:#d9d9d9}.ant-badge-status-error{background-color:#ff4d4f}.ant-badge-status-warning{background-color:#faad14}.ant-badge-status-magenta,.ant-badge-status-pink{background:#eb2f96}.ant-badge-status-red{background:#f5222d}.ant-badge-status-volcano{background:#fa541c}.ant-badge-status-orange{background:#fa8c16}.ant-badge-status-yellow{background:#fadb14}.ant-badge-status-gold{background:#faad14}.ant-badge-status-cyan{background:#13c2c2}.ant-badge-status-lime{background:#a0d911}.ant-badge-status-green{background:#52c41a}.ant-badge-status-blue{background:#1890ff}.ant-badge-status-geekblue{background:#2f54eb}.ant-badge-status-purple{background:#722ed1}.ant-badge-status-text{color:rgba(0,0,0,.85);font-size:14px;margin-left:8px}.ant-badge-zoom-appear,.ant-badge-zoom-enter{-webkit-animation:antZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);animation:antZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-badge-zoom-leave{-webkit-animation:antZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);animation:antZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);-webkit-animation-fill-mode:both;animation-fill-mode:both}.ant-badge-not-a-wrapper .ant-badge-zoom-appear,.ant-badge-not-a-wrapper .ant-badge-zoom-enter{-webkit-animation:antNoWrapperZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46);animation:antNoWrapperZoomBadgeIn .3s cubic-bezier(.12,.4,.29,1.46)}.ant-badge-not-a-wrapper .ant-badge-zoom-leave{-webkit-animation:antNoWrapperZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6);animation:antNoWrapperZoomBadgeOut .3s cubic-bezier(.71,-.46,.88,.6)}.ant-badge-not-a-wrapper:not(.ant-badge-status){vertical-align:middle}.ant-badge-not-a-wrapper .ant-badge-count,.ant-badge-not-a-wrapper .ant-scroll-number-custom-component{transform:none}.ant-badge-not-a-wrapper .ant-scroll-number,.ant-badge-not-a-wrapper .ant-scroll-number-custom-component{display:block;position:relative;top:auto;transform-origin:50% 50%}@-webkit-keyframes antStatusProcessing{0%{opacity:.5;transform:scale(.8)}to{opacity:0;transform:scale(2.4)}}@keyframes antStatusProcessing{0%{opacity:.5;transform:scale(.8)}to{opacity:0;transform:scale(2.4)}}.ant-scroll-number{direction:ltr;overflow:hidden}.ant-scroll-number-only{display:inline-block;position:relative;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-scroll-number-only,.ant-scroll-number-only>p.ant-scroll-number-only-unit{-webkit-backface-visibility:hidden;height:20px;-webkit-transform-style:preserve-3d}.ant-scroll-number-only>p.ant-scroll-number-only-unit{margin:0}.ant-scroll-number-symbol{vertical-align:top}@-webkit-keyframes antZoomBadgeIn{0%{opacity:0;transform:scale(0) translate(50%,-50%)}to{transform:scale(1) translate(50%,-50%)}}@keyframes antZoomBadgeIn{0%{opacity:0;transform:scale(0) translate(50%,-50%)}to{transform:scale(1) translate(50%,-50%)}}@-webkit-keyframes antZoomBadgeOut{0%{transform:scale(1) translate(50%,-50%)}to{opacity:0;transform:scale(0) translate(50%,-50%)}}@keyframes antZoomBadgeOut{0%{transform:scale(1) translate(50%,-50%)}to{opacity:0;transform:scale(0) translate(50%,-50%)}}@-webkit-keyframes antNoWrapperZoomBadgeIn{0%{opacity:0;transform:scale(0)}to{transform:scale(1)}}@keyframes antNoWrapperZoomBadgeIn{0%{opacity:0;transform:scale(0)}to{transform:scale(1)}}@-webkit-keyframes antNoWrapperZoomBadgeOut{0%{transform:scale(1)}to{opacity:0;transform:scale(0)}}@keyframes antNoWrapperZoomBadgeOut{0%{transform:scale(1)}to{opacity:0;transform:scale(0)}}@-webkit-keyframes antBadgeLoadingCircle{0%{transform-origin:50%}to{transform:translate(50%,-50%) rotate(1turn);transform-origin:50%}}@keyframes antBadgeLoadingCircle{0%{transform-origin:50%}to{transform:translate(50%,-50%) rotate(1turn);transform-origin:50%}}.ant-ribbon-wrapper{position:relative}.ant-ribbon{font-feature-settings:"tnum";background-color:#1890ff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);color:#fff;font-size:14px;font-variant:tabular-nums;height:22px;line-height:1.5715;line-height:22px;list-style:none;margin:0;padding:0 8px;position:absolute;top:8px;white-space:nowrap}.ant-ribbon-text{color:#fff}.ant-ribbon-corner{border:4px solid;color:currentcolor;height:8px;position:absolute;top:100%;transform:scaleY(.75);transform-origin:top;width:8px}.ant-ribbon-corner:after{border:inherit;color:rgba(0,0,0,.25);content:"";height:inherit;left:-4px;position:absolute;top:-4px;width:inherit}.ant-ribbon-color-magenta,.ant-ribbon-color-pink{background:#eb2f96;color:#eb2f96}.ant-ribbon-color-red{background:#f5222d;color:#f5222d}.ant-ribbon-color-volcano{background:#fa541c;color:#fa541c}.ant-ribbon-color-orange{background:#fa8c16;color:#fa8c16}.ant-ribbon-color-yellow{background:#fadb14;color:#fadb14}.ant-ribbon-color-gold{background:#faad14;color:#faad14}.ant-ribbon-color-cyan{background:#13c2c2;color:#13c2c2}.ant-ribbon-color-lime{background:#a0d911;color:#a0d911}.ant-ribbon-color-green{background:#52c41a;color:#52c41a}.ant-ribbon-color-blue{background:#1890ff;color:#1890ff}.ant-ribbon-color-geekblue{background:#2f54eb;color:#2f54eb}.ant-ribbon-color-purple{background:#722ed1;color:#722ed1}.ant-ribbon.ant-ribbon-placement-end{border-bottom-right-radius:0;right:-8px}.ant-ribbon.ant-ribbon-placement-end .ant-ribbon-corner{border-color:currentcolor transparent transparent currentcolor;right:0}.ant-ribbon.ant-ribbon-placement-start{border-bottom-left-radius:0;left:-8px}.ant-ribbon.ant-ribbon-placement-start .ant-ribbon-corner{border-color:currentcolor currentcolor transparent transparent;left:0}.ant-badge-rtl{direction:rtl}.ant-badge-rtl.ant-badge:not(.ant-badge-not-a-wrapper) .ant-badge-count,.ant-badge-rtl.ant-badge:not(.ant-badge-not-a-wrapper) .ant-badge-dot,.ant-badge-rtl.ant-badge:not(.ant-badge-not-a-wrapper) .ant-scroll-number-custom-component{direction:ltr;left:0;right:auto;transform:translate(-50%,-50%);transform-origin:0 0}.ant-badge-rtl.ant-badge:not(.ant-badge-not-a-wrapper) .ant-scroll-number-custom-component{left:0;right:auto;transform:translate(-50%,-50%);transform-origin:0 0}.ant-badge-rtl .ant-badge-status-text{margin-left:0;margin-right:8px}.ant-badge:not(.ant-badge-not-a-wrapper).ant-badge-rtl .ant-badge-zoom-appear,.ant-badge:not(.ant-badge-not-a-wrapper).ant-badge-rtl .ant-badge-zoom-enter{-webkit-animation-name:antZoomBadgeInRtl;animation-name:antZoomBadgeInRtl}.ant-badge:not(.ant-badge-not-a-wrapper).ant-badge-rtl .ant-badge-zoom-leave{-webkit-animation-name:antZoomBadgeOutRtl;animation-name:antZoomBadgeOutRtl}.ant-ribbon-rtl{direction:rtl}.ant-ribbon-rtl.ant-ribbon-placement-end{border-bottom-left-radius:0;border-bottom-right-radius:2px;left:-8px;right:unset}.ant-ribbon-rtl.ant-ribbon-placement-end .ant-ribbon-corner{left:0;right:unset}.ant-ribbon-rtl.ant-ribbon-placement-end .ant-ribbon-corner,.ant-ribbon-rtl.ant-ribbon-placement-end .ant-ribbon-corner:after{border-color:currentcolor currentcolor transparent transparent}.ant-ribbon-rtl.ant-ribbon-placement-start{border-bottom-left-radius:2px;border-bottom-right-radius:0;left:unset;right:-8px}.ant-ribbon-rtl.ant-ribbon-placement-start .ant-ribbon-corner{left:unset;right:0}.ant-ribbon-rtl.ant-ribbon-placement-start .ant-ribbon-corner,.ant-ribbon-rtl.ant-ribbon-placement-start .ant-ribbon-corner:after{border-color:currentcolor transparent transparent currentcolor}@-webkit-keyframes antZoomBadgeInRtl{0%{opacity:0;transform:scale(0) translate(-50%,-50%)}to{transform:scale(1) translate(-50%,-50%)}}@keyframes antZoomBadgeInRtl{0%{opacity:0;transform:scale(0) translate(-50%,-50%)}to{transform:scale(1) translate(-50%,-50%)}}@-webkit-keyframes antZoomBadgeOutRtl{0%{transform:scale(1) translate(-50%,-50%)}to{opacity:0;transform:scale(0) translate(-50%,-50%)}}@keyframes antZoomBadgeOutRtl{0%{transform:scale(1) translate(-50%,-50%)}to{opacity:0;transform:scale(0) translate(-50%,-50%)}}.ant-breadcrumb{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);color:rgba(0,0,0,.45);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-breadcrumb .anticon{font-size:14px}.ant-breadcrumb ol{display:flex;flex-wrap:wrap;list-style:none;margin:0;padding:0}.ant-breadcrumb a{color:rgba(0,0,0,.45);transition:color .3s}.ant-breadcrumb a:hover,.ant-breadcrumb li:last-child,.ant-breadcrumb li:last-child a{color:rgba(0,0,0,.85)}li:last-child>.ant-breadcrumb-separator{display:none}.ant-breadcrumb-separator{color:rgba(0,0,0,.45);margin:0 8px}.ant-breadcrumb-link>.anticon+a,.ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-overlay-link>.anticon{margin-left:4px}.ant-breadcrumb-rtl{direction:rtl}.ant-breadcrumb-rtl:before{content:"";display:table}.ant-breadcrumb-rtl:after{clear:both;content:"";display:table}.ant-breadcrumb-rtl>span{float:right}.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+a,.ant-breadcrumb-rtl .ant-breadcrumb-link>.anticon+span,.ant-breadcrumb-rtl .ant-breadcrumb-overlay-link>.anticon{margin-left:0;margin-right:4px}.ant-btn{background-image:none;background:#fff;border:1px solid #d9d9d9;border-radius:2px;box-shadow:0 2px 0 rgba(0,0,0,.015);color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;font-weight:400;height:32px;line-height:1.5715;padding:4px 15px;position:relative;text-align:center;touch-action:manipulation;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.ant-btn>.anticon{line-height:1}.ant-btn,.ant-btn:active,.ant-btn:focus{outline:0}.ant-btn:not([disabled]):hover{text-decoration:none}.ant-btn:not([disabled]):active{box-shadow:none;outline:0}.ant-btn[disabled]{cursor:not-allowed}.ant-btn[disabled]>*{pointer-events:none}.ant-btn-lg{border-radius:2px;font-size:16px;height:40px;padding:6.4px 15px}.ant-btn-sm{border-radius:2px;font-size:14px;height:24px;padding:0 7px}.ant-btn>a:only-child{color:currentcolor}.ant-btn>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn:focus,.ant-btn:hover{background:#fff;border-color:#40a9ff;color:#40a9ff}.ant-btn:focus>a:only-child,.ant-btn:hover>a:only-child{color:currentcolor}.ant-btn:focus>a:only-child:after,.ant-btn:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn:active{background:#fff;border-color:#096dd9;color:#096dd9}.ant-btn:active>a:only-child{color:currentcolor}.ant-btn:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn[disabled],.ant-btn[disabled]:active,.ant-btn[disabled]:focus,.ant-btn[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn[disabled]:active>a:only-child,.ant-btn[disabled]:focus>a:only-child,.ant-btn[disabled]:hover>a:only-child,.ant-btn[disabled]>a:only-child{color:currentcolor}.ant-btn[disabled]:active>a:only-child:after,.ant-btn[disabled]:focus>a:only-child:after,.ant-btn[disabled]:hover>a:only-child:after,.ant-btn[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn:active,.ant-btn:focus,.ant-btn:hover{background:#fff;text-decoration:none}.ant-btn>span{display:inline-block}.ant-btn-primary{background:#1890ff;border-color:#1890ff;box-shadow:0 2px 0 rgba(0,0,0,.045);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.12)}.ant-btn-primary>a:only-child{color:currentcolor}.ant-btn-primary>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-primary:focus,.ant-btn-primary:hover{background:#40a9ff;border-color:#40a9ff;color:#fff}.ant-btn-primary:focus>a:only-child,.ant-btn-primary:hover>a:only-child{color:currentcolor}.ant-btn-primary:focus>a:only-child:after,.ant-btn-primary:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-primary:active{background:#096dd9;border-color:#096dd9;color:#fff}.ant-btn-primary:active>a:only-child{color:currentcolor}.ant-btn-primary:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-primary[disabled],.ant-btn-primary[disabled]:active,.ant-btn-primary[disabled]:focus,.ant-btn-primary[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-primary[disabled]>a:only-child{color:currentcolor}.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-primary[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child){border-left-color:#40a9ff;border-right-color:#40a9ff}.ant-btn-group .ant-btn-primary:not(:first-child):not(:last-child):disabled{border-color:#d9d9d9}.ant-btn-group .ant-btn-primary:first-child:not(:last-child){border-right-color:#40a9ff}.ant-btn-group .ant-btn-primary:first-child:not(:last-child)[disabled]{border-right-color:#d9d9d9}.ant-btn-group .ant-btn-primary+.ant-btn-primary,.ant-btn-group .ant-btn-primary:last-child:not(:first-child){border-left-color:#40a9ff}.ant-btn-group .ant-btn-primary+.ant-btn-primary[disabled],.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#d9d9d9}.ant-btn-ghost{background:transparent;border-color:#d9d9d9;color:rgba(0,0,0,.85)}.ant-btn-ghost>a:only-child{color:currentcolor}.ant-btn-ghost>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-ghost:focus,.ant-btn-ghost:hover{background:transparent;border-color:#40a9ff;color:#40a9ff}.ant-btn-ghost:focus>a:only-child,.ant-btn-ghost:hover>a:only-child{color:currentcolor}.ant-btn-ghost:focus>a:only-child:after,.ant-btn-ghost:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-ghost:active{background:transparent;border-color:#096dd9;color:#096dd9}.ant-btn-ghost:active>a:only-child{color:currentcolor}.ant-btn-ghost:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-ghost[disabled],.ant-btn-ghost[disabled]:active,.ant-btn-ghost[disabled]:focus,.ant-btn-ghost[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-ghost[disabled]:active>a:only-child,.ant-btn-ghost[disabled]:focus>a:only-child,.ant-btn-ghost[disabled]:hover>a:only-child,.ant-btn-ghost[disabled]>a:only-child{color:currentcolor}.ant-btn-ghost[disabled]:active>a:only-child:after,.ant-btn-ghost[disabled]:focus>a:only-child:after,.ant-btn-ghost[disabled]:hover>a:only-child:after,.ant-btn-ghost[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dashed{background:#fff;border-color:#d9d9d9;border-style:dashed;color:rgba(0,0,0,.85)}.ant-btn-dashed>a:only-child{color:currentcolor}.ant-btn-dashed>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dashed:focus,.ant-btn-dashed:hover{background:#fff;border-color:#40a9ff;color:#40a9ff}.ant-btn-dashed:focus>a:only-child,.ant-btn-dashed:hover>a:only-child{color:currentcolor}.ant-btn-dashed:focus>a:only-child:after,.ant-btn-dashed:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dashed:active{background:#fff;border-color:#096dd9;color:#096dd9}.ant-btn-dashed:active>a:only-child{color:currentcolor}.ant-btn-dashed:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dashed[disabled],.ant-btn-dashed[disabled]:active,.ant-btn-dashed[disabled]:focus,.ant-btn-dashed[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dashed[disabled]:active>a:only-child,.ant-btn-dashed[disabled]:focus>a:only-child,.ant-btn-dashed[disabled]:hover>a:only-child,.ant-btn-dashed[disabled]>a:only-child{color:currentcolor}.ant-btn-dashed[disabled]:active>a:only-child:after,.ant-btn-dashed[disabled]:focus>a:only-child:after,.ant-btn-dashed[disabled]:hover>a:only-child:after,.ant-btn-dashed[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-danger{background:#ff4d4f;border-color:#ff4d4f;box-shadow:0 2px 0 rgba(0,0,0,.045);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.12)}.ant-btn-danger>a:only-child{color:currentcolor}.ant-btn-danger>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-danger:focus,.ant-btn-danger:hover{background:#ff7875;border-color:#ff7875;color:#fff}.ant-btn-danger:focus>a:only-child,.ant-btn-danger:hover>a:only-child{color:currentcolor}.ant-btn-danger:focus>a:only-child:after,.ant-btn-danger:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-danger:active{background:#d9363e;border-color:#d9363e;color:#fff}.ant-btn-danger:active>a:only-child{color:currentcolor}.ant-btn-danger:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-danger[disabled],.ant-btn-danger[disabled]:active,.ant-btn-danger[disabled]:focus,.ant-btn-danger[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-danger[disabled]>a:only-child{color:currentcolor}.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-danger[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-link{background:transparent;border-color:transparent;box-shadow:none;color:#1890ff}.ant-btn-link>a:only-child{color:currentcolor}.ant-btn-link>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-link:focus,.ant-btn-link:hover{background:transparent;border-color:#40a9ff;color:#40a9ff}.ant-btn-link:focus>a:only-child,.ant-btn-link:hover>a:only-child{color:currentcolor}.ant-btn-link:focus>a:only-child:after,.ant-btn-link:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-link:active{background:transparent;border-color:#096dd9;color:#096dd9}.ant-btn-link:active>a:only-child{color:currentcolor}.ant-btn-link:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-link[disabled],.ant-btn-link[disabled]:active,.ant-btn-link[disabled]:focus,.ant-btn-link[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9}.ant-btn-link:hover{background:transparent}.ant-btn-link:active,.ant-btn-link:focus,.ant-btn-link:hover{border-color:transparent}.ant-btn-link[disabled],.ant-btn-link[disabled]:active,.ant-btn-link[disabled]:focus,.ant-btn-link[disabled]:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-link[disabled]:active>a:only-child,.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-link[disabled]>a:only-child{color:currentcolor}.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-link[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-text{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.85)}.ant-btn-text>a:only-child{color:currentcolor}.ant-btn-text>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-text:focus,.ant-btn-text:hover{background:transparent;border-color:#40a9ff;color:#40a9ff}.ant-btn-text:focus>a:only-child,.ant-btn-text:hover>a:only-child{color:currentcolor}.ant-btn-text:focus>a:only-child:after,.ant-btn-text:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-text:active{background:transparent;border-color:#096dd9;color:#096dd9}.ant-btn-text:active>a:only-child{color:currentcolor}.ant-btn-text:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-text[disabled],.ant-btn-text[disabled]:active,.ant-btn-text[disabled]:focus,.ant-btn-text[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9}.ant-btn-text:focus,.ant-btn-text:hover{background:rgba(0,0,0,.018);border-color:transparent;color:rgba(0,0,0,.85)}.ant-btn-text:active{background:rgba(0,0,0,.028);border-color:transparent;color:rgba(0,0,0,.85)}.ant-btn-text[disabled],.ant-btn-text[disabled]:active,.ant-btn-text[disabled]:focus,.ant-btn-text[disabled]:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-text[disabled]:active>a:only-child,.ant-btn-text[disabled]:focus>a:only-child,.ant-btn-text[disabled]:hover>a:only-child,.ant-btn-text[disabled]>a:only-child{color:currentcolor}.ant-btn-text[disabled]:active>a:only-child:after,.ant-btn-text[disabled]:focus>a:only-child:after,.ant-btn-text[disabled]:hover>a:only-child:after,.ant-btn-text[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous{background:#fff;border-color:#ff4d4f;color:#ff4d4f}.ant-btn-dangerous>a:only-child{color:currentcolor}.ant-btn-dangerous>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous:focus,.ant-btn-dangerous:hover{background:#fff;border-color:#ff7875;color:#ff7875}.ant-btn-dangerous:focus>a:only-child,.ant-btn-dangerous:hover>a:only-child{color:currentcolor}.ant-btn-dangerous:focus>a:only-child:after,.ant-btn-dangerous:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous:active{background:#fff;border-color:#d9363e;color:#d9363e}.ant-btn-dangerous:active>a:only-child{color:currentcolor}.ant-btn-dangerous:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous[disabled],.ant-btn-dangerous[disabled]:active,.ant-btn-dangerous[disabled]:focus,.ant-btn-dangerous[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dangerous[disabled]:active>a:only-child,.ant-btn-dangerous[disabled]:focus>a:only-child,.ant-btn-dangerous[disabled]:hover>a:only-child,.ant-btn-dangerous[disabled]>a:only-child{color:currentcolor}.ant-btn-dangerous[disabled]:active>a:only-child:after,.ant-btn-dangerous[disabled]:focus>a:only-child:after,.ant-btn-dangerous[disabled]:hover>a:only-child:after,.ant-btn-dangerous[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-primary{background:#ff4d4f;border-color:#ff4d4f;box-shadow:0 2px 0 rgba(0,0,0,.045);color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,.12)}.ant-btn-dangerous.ant-btn-primary>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-primary>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-primary:focus,.ant-btn-dangerous.ant-btn-primary:hover{background:#ff7875;border-color:#ff7875;color:#fff}.ant-btn-dangerous.ant-btn-primary:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary:hover>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-primary:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-primary:active{background:#d9363e;border-color:#d9363e;color:#fff}.ant-btn-dangerous.ant-btn-primary:active>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-primary:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-primary[disabled],.ant-btn-dangerous.ant-btn-primary[disabled]:active,.ant-btn-dangerous.ant-btn-primary[disabled]:focus,.ant-btn-dangerous.ant-btn-primary[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dangerous.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-primary[disabled]>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-primary[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-link{background:transparent;border-color:transparent;box-shadow:none;color:#ff4d4f}.ant-btn-dangerous.ant-btn-link>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-link>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-dangerous.ant-btn-link:hover{border-color:#40a9ff;color:#40a9ff}.ant-btn-dangerous.ant-btn-link:active{border-color:#096dd9;color:#096dd9}.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-dangerous.ant-btn-link[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9}.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-dangerous.ant-btn-link:hover{background:transparent;border-color:transparent;color:#ff7875}.ant-btn-dangerous.ant-btn-link:focus>a:only-child,.ant-btn-dangerous.ant-btn-link:hover>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-link:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-link:active{background:transparent;border-color:transparent;color:#d9363e}.ant-btn-dangerous.ant-btn-link:active>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-link:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-dangerous.ant-btn-link[disabled]:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-text{background:transparent;border-color:transparent;box-shadow:none;color:#ff4d4f}.ant-btn-dangerous.ant-btn-text>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-text>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-text:focus,.ant-btn-dangerous.ant-btn-text:hover{background:transparent;border-color:#40a9ff;color:#40a9ff}.ant-btn-dangerous.ant-btn-text:active{background:transparent;border-color:#096dd9;color:#096dd9}.ant-btn-dangerous.ant-btn-text[disabled],.ant-btn-dangerous.ant-btn-text[disabled]:active,.ant-btn-dangerous.ant-btn-text[disabled]:focus,.ant-btn-dangerous.ant-btn-text[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9}.ant-btn-dangerous.ant-btn-text:focus,.ant-btn-dangerous.ant-btn-text:hover{background:rgba(0,0,0,.018);border-color:transparent;color:#ff7875}.ant-btn-dangerous.ant-btn-text:focus>a:only-child,.ant-btn-dangerous.ant-btn-text:hover>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-text:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-text:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-text:active{background:rgba(0,0,0,.028);border-color:transparent;color:#d9363e}.ant-btn-dangerous.ant-btn-text:active>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-text:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-dangerous.ant-btn-text[disabled],.ant-btn-dangerous.ant-btn-text[disabled]:active,.ant-btn-dangerous.ant-btn-text[disabled]:focus,.ant-btn-dangerous.ant-btn-text[disabled]:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-dangerous.ant-btn-text[disabled]:active>a:only-child,.ant-btn-dangerous.ant-btn-text[disabled]:focus>a:only-child,.ant-btn-dangerous.ant-btn-text[disabled]:hover>a:only-child,.ant-btn-dangerous.ant-btn-text[disabled]>a:only-child{color:currentcolor}.ant-btn-dangerous.ant-btn-text[disabled]:active>a:only-child:after,.ant-btn-dangerous.ant-btn-text[disabled]:focus>a:only-child:after,.ant-btn-dangerous.ant-btn-text[disabled]:hover>a:only-child:after,.ant-btn-dangerous.ant-btn-text[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-icon-only{border-radius:2px;font-size:16px;height:32px;padding:2.4px 0;vertical-align:-3px;width:32px}.ant-btn-icon-only>*{font-size:16px}.ant-btn-icon-only.ant-btn-lg{border-radius:2px;font-size:18px;height:40px;padding:4.9px 0;width:40px}.ant-btn-icon-only.ant-btn-lg>*{font-size:18px}.ant-btn-icon-only.ant-btn-sm{border-radius:2px;font-size:14px;height:24px;padding:0;width:24px}.ant-btn-icon-only.ant-btn-sm>*{font-size:14px}.ant-btn-icon-only>.anticon{display:flex;justify-content:center}.ant-btn-icon-only .anticon-loading{padding:0!important}a.ant-btn-icon-only{vertical-align:-1px}a.ant-btn-icon-only>.anticon{display:inline}.ant-btn-round{border-radius:32px;font-size:14px;height:32px;padding:4px 16px}.ant-btn-round.ant-btn-lg{border-radius:40px;font-size:16px;height:40px;padding:6.4px 20px}.ant-btn-round.ant-btn-sm{border-radius:24px;font-size:14px;height:24px;padding:0 12px}.ant-btn-round.ant-btn-icon-only{width:auto}.ant-btn-circle{border-radius:50%;min-width:32px;padding-left:0;padding-right:0;text-align:center}.ant-btn-circle.ant-btn-lg{border-radius:50%;min-width:40px}.ant-btn-circle.ant-btn-sm{border-radius:50%;min-width:24px}.ant-btn:before{background:#fff;border-radius:inherit;bottom:-1px;content:"";display:none;left:-1px;opacity:.35;pointer-events:none;position:absolute;right:-1px;top:-1px;transition:opacity .2s;z-index:1}.ant-btn .anticon{transition:margin-left .3s cubic-bezier(.645,.045,.355,1)}.ant-btn .anticon.anticon-minus>svg,.ant-btn .anticon.anticon-plus>svg{shape-rendering:optimizespeed}.ant-btn.ant-btn-loading{cursor:default;position:relative}.ant-btn.ant-btn-loading:before{display:block}.ant-btn>.ant-btn-loading-icon{transition:width .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1)}.ant-btn>.ant-btn-loading-icon .anticon{-webkit-animation:none;animation:none;padding-right:8px}.ant-btn>.ant-btn-loading-icon .anticon svg{-webkit-animation:loadingCircle 1s linear infinite;animation:loadingCircle 1s linear infinite}.ant-btn-group{display:inline-flex}.ant-btn-group,.ant-btn-group>.ant-btn,.ant-btn-group>span>.ant-btn{position:relative}.ant-btn-group>.ant-btn:active,.ant-btn-group>.ant-btn:focus,.ant-btn-group>.ant-btn:hover,.ant-btn-group>span>.ant-btn:active,.ant-btn-group>span>.ant-btn:focus,.ant-btn-group>span>.ant-btn:hover{z-index:2}.ant-btn-group>.ant-btn[disabled],.ant-btn-group>span>.ant-btn[disabled]{z-index:0}.ant-btn-group .ant-btn-icon-only{font-size:14px}.ant-btn+.ant-btn-group,.ant-btn-group .ant-btn+.ant-btn,.ant-btn-group .ant-btn+span,.ant-btn-group span+.ant-btn,.ant-btn-group+.ant-btn,.ant-btn-group+.ant-btn-group,.ant-btn-group>span+span{margin-left:-1px}.ant-btn-group .ant-btn-primary+.ant-btn:not(.ant-btn-primary):not([disabled]){border-left-color:transparent}.ant-btn-group .ant-btn{border-radius:0}.ant-btn-group>.ant-btn:first-child,.ant-btn-group>span:first-child>.ant-btn{margin-left:0}.ant-btn-group>.ant-btn:only-child,.ant-btn-group>span:only-child>.ant-btn{border-radius:2px}.ant-btn-group>.ant-btn:first-child:not(:last-child),.ant-btn-group>span:first-child:not(:last-child)>.ant-btn{border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-btn-group>.ant-btn:last-child:not(:first-child),.ant-btn-group>span:last-child:not(:first-child)>.ant-btn{border-bottom-right-radius:2px;border-top-right-radius:2px}.ant-btn-group-sm>.ant-btn:only-child,.ant-btn-group-sm>span:only-child>.ant-btn{border-radius:2px}.ant-btn-group-sm>.ant-btn:first-child:not(:last-child),.ant-btn-group-sm>span:first-child:not(:last-child)>.ant-btn{border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-btn-group-sm>.ant-btn:last-child:not(:first-child),.ant-btn-group-sm>span:last-child:not(:first-child)>.ant-btn{border-bottom-right-radius:2px;border-top-right-radius:2px}.ant-btn-group>.ant-btn-group{float:left}.ant-btn-group>.ant-btn-group:not(:first-child):not(:last-child)>.ant-btn{border-radius:0}.ant-btn-group>.ant-btn-group:first-child:not(:last-child)>.ant-btn:last-child{border-bottom-right-radius:0;border-top-right-radius:0;padding-right:8px}.ant-btn-group>.ant-btn-group:last-child:not(:first-child)>.ant-btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0;padding-left:8px}.ant-btn-group-rtl.ant-btn+.ant-btn-group,.ant-btn-group-rtl.ant-btn-group .ant-btn+.ant-btn,.ant-btn-group-rtl.ant-btn-group .ant-btn+span,.ant-btn-group-rtl.ant-btn-group span+.ant-btn,.ant-btn-group-rtl.ant-btn-group+.ant-btn,.ant-btn-group-rtl.ant-btn-group+.ant-btn-group,.ant-btn-group-rtl.ant-btn-group>span+span,.ant-btn-rtl.ant-btn+.ant-btn-group,.ant-btn-rtl.ant-btn-group .ant-btn+.ant-btn,.ant-btn-rtl.ant-btn-group .ant-btn+span,.ant-btn-rtl.ant-btn-group span+.ant-btn,.ant-btn-rtl.ant-btn-group+.ant-btn,.ant-btn-rtl.ant-btn-group+.ant-btn-group,.ant-btn-rtl.ant-btn-group>span+span{margin-left:auto;margin-right:-1px}.ant-btn-group.ant-btn-group-rtl{direction:rtl}.ant-btn-group-rtl.ant-btn-group>.ant-btn:first-child:not(:last-child),.ant-btn-group-rtl.ant-btn-group>span:first-child:not(:last-child)>.ant-btn{border-radius:0 2px 2px 0}.ant-btn-group-rtl.ant-btn-group>.ant-btn:last-child:not(:first-child),.ant-btn-group-rtl.ant-btn-group>span:last-child:not(:first-child)>.ant-btn{border-radius:2px 0 0 2px}.ant-btn-group-rtl.ant-btn-group-sm>.ant-btn:first-child:not(:last-child),.ant-btn-group-rtl.ant-btn-group-sm>span:first-child:not(:last-child)>.ant-btn{border-radius:0 2px 2px 0}.ant-btn-group-rtl.ant-btn-group-sm>.ant-btn:last-child:not(:first-child),.ant-btn-group-rtl.ant-btn-group-sm>span:last-child:not(:first-child)>.ant-btn{border-radius:2px 0 0 2px}.ant-btn:active>span,.ant-btn:focus>span{position:relative}.ant-btn>.anticon+span,.ant-btn>span+.anticon{margin-left:8px}.ant-btn.ant-btn-background-ghost{border-color:#fff;color:#fff}.ant-btn.ant-btn-background-ghost,.ant-btn.ant-btn-background-ghost:active,.ant-btn.ant-btn-background-ghost:focus,.ant-btn.ant-btn-background-ghost:hover{background:transparent}.ant-btn.ant-btn-background-ghost:focus,.ant-btn.ant-btn-background-ghost:hover{border-color:#40a9ff;color:#40a9ff}.ant-btn.ant-btn-background-ghost:active{border-color:#096dd9;color:#096dd9}.ant-btn.ant-btn-background-ghost[disabled]{background:transparent;border-color:#d9d9d9;color:rgba(0,0,0,.25)}.ant-btn-background-ghost.ant-btn-primary{border-color:#1890ff;color:#1890ff;text-shadow:none}.ant-btn-background-ghost.ant-btn-primary>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-primary>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-primary:focus,.ant-btn-background-ghost.ant-btn-primary:hover{border-color:#40a9ff;color:#40a9ff}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-primary:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-primary:active{border-color:#096dd9;color:#096dd9}.ant-btn-background-ghost.ant-btn-primary:active>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-primary:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-primary[disabled],.ant-btn-background-ghost.ant-btn-primary[disabled]:active,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-primary[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-primary[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-danger{border-color:#ff4d4f;color:#ff4d4f;text-shadow:none}.ant-btn-background-ghost.ant-btn-danger>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-danger>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-danger:focus,.ant-btn-background-ghost.ant-btn-danger:hover{border-color:#ff7875;color:#ff7875}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-danger:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-danger:active{border-color:#d9363e;color:#d9363e}.ant-btn-background-ghost.ant-btn-danger:active>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-danger:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-danger[disabled],.ant-btn-background-ghost.ant-btn-danger[disabled]:active,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-danger[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-danger[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous{border-color:#ff4d4f;color:#ff4d4f;text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous:focus,.ant-btn-background-ghost.ant-btn-dangerous:hover{border-color:#ff7875;color:#ff7875}.ant-btn-background-ghost.ant-btn-dangerous:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous:hover>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous:active{border-color:#d9363e;color:#d9363e}.ant-btn-background-ghost.ant-btn-dangerous:active>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous[disabled],.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous[disabled]>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link{border-color:transparent;color:#ff4d4f;text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover{border-color:transparent;color:#ff7875}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:hover>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active{border-color:transparent;color:#d9363e}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link:active>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled],.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover{background:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child{color:currentcolor}.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:active>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:focus>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]:hover>a:only-child:after,.ant-btn-background-ghost.ant-btn-dangerous.ant-btn-link[disabled]>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-btn-two-chinese-chars:first-letter{letter-spacing:.34em}.ant-btn-two-chinese-chars>:not(.anticon){letter-spacing:.34em;margin-right:-.34em}.ant-btn.ant-btn-block{width:100%}.ant-btn:empty{content:" ";display:inline-block;visibility:hidden;width:0}a.ant-btn{line-height:30px;padding-top:.01px!important}a.ant-btn-disabled{cursor:not-allowed}a.ant-btn-disabled>*{pointer-events:none}a.ant-btn-disabled,a.ant-btn-disabled:active,a.ant-btn-disabled:focus,a.ant-btn-disabled:hover{background:transparent;border-color:transparent;box-shadow:none;color:rgba(0,0,0,.25);text-shadow:none}a.ant-btn-disabled:active>a:only-child,a.ant-btn-disabled:focus>a:only-child,a.ant-btn-disabled:hover>a:only-child,a.ant-btn-disabled>a:only-child{color:currentcolor}a.ant-btn-disabled:active>a:only-child:after,a.ant-btn-disabled:focus>a:only-child:after,a.ant-btn-disabled:hover>a:only-child:after,a.ant-btn-disabled>a:only-child:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}a.ant-btn-lg{line-height:38px}a.ant-btn-sm{line-height:22px}.ant-btn-rtl{direction:rtl}.ant-btn-group-rtl.ant-btn-group .ant-btn-primary+.ant-btn-primary,.ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child){border-left-color:#d9d9d9;border-right-color:#40a9ff}.ant-btn-group-rtl.ant-btn-group .ant-btn-primary+.ant-btn-primary[disabled],.ant-btn-group-rtl.ant-btn-group .ant-btn-primary:last-child:not(:first-child)[disabled]{border-left-color:#40a9ff;border-right-color:#d9d9d9}.ant-btn-rtl.ant-btn>.ant-btn-loading-icon .anticon{padding-left:8px;padding-right:0}.ant-btn-rtl.ant-btn>.anticon+span,.ant-btn-rtl.ant-btn>span+.anticon{margin-left:0;margin-right:8px}.ant-picker-calendar{font-feature-settings:"tnum";background:#fff;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-picker-calendar-header{display:flex;justify-content:flex-end;padding:12px 0}.ant-picker-calendar-header .ant-picker-calendar-year-select{min-width:80px}.ant-picker-calendar-header .ant-picker-calendar-month-select{margin-left:8px;min-width:70px}.ant-picker-calendar-header .ant-picker-calendar-mode-switch{margin-left:8px}.ant-picker-calendar .ant-picker-panel{background:#fff;border:0;border-radius:0;border-top:1px solid #f0f0f0}.ant-picker-calendar .ant-picker-panel .ant-picker-date-panel,.ant-picker-calendar .ant-picker-panel .ant-picker-month-panel{width:auto}.ant-picker-calendar .ant-picker-panel .ant-picker-body{padding:8px 0}.ant-picker-calendar .ant-picker-panel .ant-picker-content{width:100%}.ant-picker-calendar-mini{border-radius:2px}.ant-picker-calendar-mini .ant-picker-calendar-header{padding-left:8px;padding-right:8px}.ant-picker-calendar-mini .ant-picker-panel{border-radius:0 0 2px 2px}.ant-picker-calendar-mini .ant-picker-content{height:256px}.ant-picker-calendar-mini .ant-picker-content th{height:auto;line-height:18px;padding:0}.ant-picker-calendar-mini .ant-picker-cell:before{pointer-events:none}.ant-picker-calendar-full .ant-picker-panel{background:#fff;border:0;display:block;text-align:right;width:100%}.ant-picker-calendar-full .ant-picker-panel .ant-picker-body td,.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{padding:0}.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{height:auto;line-height:18px;padding:0 12px 5px 0}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell:before{display:none}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell:hover .ant-picker-calendar-date{background:#f5f5f5}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell .ant-picker-calendar-date-today:before{display:none}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date-today,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date-today{background:#e6f7ff}.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected .ant-picker-calendar-date-today .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date .ant-picker-calendar-date-value,.ant-picker-calendar-full .ant-picker-panel .ant-picker-cell-selected:hover .ant-picker-calendar-date-today .ant-picker-calendar-date-value{color:#1890ff}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date{border:0;border-radius:0;border-top:2px solid #f0f0f0;display:block;height:auto;margin:0 4px;padding:4px 8px 0;transition:background .3s;width:auto}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-value{line-height:24px;transition:color .3s}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-content{color:rgba(0,0,0,.85);height:86px;line-height:1.5715;overflow-y:auto;position:static;text-align:left;width:auto}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-today{border-color:#1890ff}.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-today .ant-picker-calendar-date-value{color:rgba(0,0,0,.85)}@media only screen and (max-width:480px){.ant-picker-calendar-header{display:block}.ant-picker-calendar-header .ant-picker-calendar-year-select{width:50%}.ant-picker-calendar-header .ant-picker-calendar-month-select{width:calc(50% - 8px)}.ant-picker-calendar-header .ant-picker-calendar-mode-switch{margin-left:0;margin-top:8px;width:100%}.ant-picker-calendar-header .ant-picker-calendar-mode-switch>label{text-align:center;width:50%}}.ant-picker-calendar-rtl{direction:rtl}.ant-picker-calendar-rtl .ant-picker-calendar-header .ant-picker-calendar-mode-switch,.ant-picker-calendar-rtl .ant-picker-calendar-header .ant-picker-calendar-month-select{margin-left:0;margin-right:8px}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel{text-align:left}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel .ant-picker-body th{padding:0 0 5px 12px}.ant-picker-calendar-rtl.ant-picker-calendar-full .ant-picker-panel .ant-picker-calendar-date-content{text-align:right}.ant-card{font-feature-settings:"tnum";background:#fff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-card-rtl{direction:rtl}.ant-card-hoverable{cursor:pointer;transition:box-shadow .3s,border-color .3s}.ant-card-hoverable:hover{border-color:transparent;box-shadow:0 1px 2px -2px rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.12),0 5px 12px 4px rgba(0,0,0,.09)}.ant-card-bordered{border:1px solid #f0f0f0}.ant-card-head{background:transparent;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0;color:rgba(0,0,0,.85);font-size:16px;font-weight:500;margin-bottom:-1px;min-height:48px;padding:0 24px}.ant-card-head:after,.ant-card-head:before{content:"";display:table}.ant-card-head:after{clear:both}.ant-card-head-wrapper{align-items:center;display:flex}.ant-card-head-title{display:inline-block;flex:1;overflow:hidden;padding:16px 0;text-overflow:ellipsis;white-space:nowrap}.ant-card-head-title>.ant-typography,.ant-card-head-title>.ant-typography-edit-content{left:0;margin-bottom:0;margin-top:0}.ant-card-head .ant-tabs-top{clear:both;color:rgba(0,0,0,.85);font-size:14px;font-weight:400;margin-bottom:-17px}.ant-card-head .ant-tabs-top-bar{border-bottom:1px solid #f0f0f0}.ant-card-extra{color:rgba(0,0,0,.85);font-size:14px;font-weight:400;margin-left:auto;padding:16px 0}.ant-card-rtl .ant-card-extra{margin-left:0;margin-right:auto}.ant-card-body{padding:24px}.ant-card-body:after,.ant-card-body:before{content:"";display:table}.ant-card-body:after{clear:both}.ant-card-contain-grid .ant-card-body{display:flex;flex-wrap:wrap}.ant-card-contain-grid:not(.ant-card-loading) .ant-card-body{margin:-1px 0 0 -1px;padding:0}.ant-card-grid{border:0;border-radius:0;box-shadow:1px 0 0 0 #f0f0f0,0 1px 0 0 #f0f0f0,1px 1px 0 0 #f0f0f0,inset 1px 0 0 0 #f0f0f0,inset 0 1px 0 0 #f0f0f0;padding:24px;transition:all .3s;width:33.33%}.ant-card-grid-hoverable:hover{box-shadow:0 1px 2px -2px rgba(0,0,0,.16),0 3px 6px 0 rgba(0,0,0,.12),0 5px 12px 4px rgba(0,0,0,.09);position:relative;z-index:1}.ant-card-contain-tabs>.ant-card-head .ant-card-head-title{min-height:32px;padding-bottom:0}.ant-card-contain-tabs>.ant-card-head .ant-card-extra{padding-bottom:0}.ant-card-bordered .ant-card-cover{margin-left:-1px;margin-right:-1px;margin-top:-1px}.ant-card-cover>*{display:block;width:100%}.ant-card-cover img{border-radius:2px 2px 0 0}.ant-card-actions{background:#fff;border-top:1px solid #f0f0f0;display:flex;list-style:none;margin:0;padding:0}.ant-card-actions:after,.ant-card-actions:before{content:"";display:table}.ant-card-actions:after{clear:both}.ant-card-actions>li{color:rgba(0,0,0,.45);margin:12px 0;text-align:center}.ant-card-actions>li>span{cursor:pointer;display:block;font-size:14px;line-height:1.5715;min-width:32px;position:relative}.ant-card-actions>li>span:hover{color:#1890ff;transition:color .3s}.ant-card-actions>li>span a:not(.ant-btn),.ant-card-actions>li>span>.anticon{color:rgba(0,0,0,.45);display:inline-block;line-height:22px;transition:color .3s;width:100%}.ant-card-actions>li>span a:not(.ant-btn):hover,.ant-card-actions>li>span>.anticon:hover{color:#1890ff}.ant-card-actions>li>span>.anticon{font-size:16px;line-height:22px}.ant-card-actions>li:not(:last-child){border-right:1px solid #f0f0f0}.ant-card-rtl .ant-card-actions>li:not(:last-child){border-left:1px solid #f0f0f0;border-right:none}.ant-card-type-inner .ant-card-head{background:#fafafa;padding:0 24px}.ant-card-type-inner .ant-card-head-title{font-size:14px;padding:12px 0}.ant-card-type-inner .ant-card-body{padding:16px 24px}.ant-card-type-inner .ant-card-extra{padding:13.5px 0}.ant-card-meta{display:flex;margin:-4px 0}.ant-card-meta:after,.ant-card-meta:before{content:"";display:table}.ant-card-meta:after{clear:both}.ant-card-meta-avatar{padding-right:16px}.ant-card-rtl .ant-card-meta-avatar{padding-left:16px;padding-right:0}.ant-card-meta-detail{overflow:hidden}.ant-card-meta-detail>div:not(:last-child){margin-bottom:8px}.ant-card-meta-title{color:rgba(0,0,0,.85);font-size:16px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-card-meta-description{color:rgba(0,0,0,.45)}.ant-card-loading{overflow:hidden}.ant-card-loading .ant-card-body{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-card-small>.ant-card-head{font-size:14px;min-height:36px;padding:0 12px}.ant-card-small>.ant-card-head>.ant-card-head-wrapper>.ant-card-head-title{padding:8px 0}.ant-card-small>.ant-card-head>.ant-card-head-wrapper>.ant-card-extra{font-size:14px;padding:8px 0}.ant-card-small>.ant-card-body{padding:12px}.ant-carousel{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-carousel .slick-slider{-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent;box-sizing:border-box;display:block;position:relative;touch-action:pan-y}.ant-carousel .slick-list{display:block;margin:0;overflow:hidden;padding:0;position:relative}.ant-carousel .slick-list:focus{outline:none}.ant-carousel .slick-list.dragging{cursor:pointer}.ant-carousel .slick-list .slick-slide{pointer-events:none}.ant-carousel .slick-list .slick-slide input.ant-checkbox-input,.ant-carousel .slick-list .slick-slide input.ant-radio-input{visibility:hidden}.ant-carousel .slick-list .slick-slide.slick-active{pointer-events:auto}.ant-carousel .slick-list .slick-slide.slick-active input.ant-checkbox-input,.ant-carousel .slick-list .slick-slide.slick-active input.ant-radio-input{visibility:visible}.ant-carousel .slick-list .slick-slide>div>div{vertical-align:bottom}.ant-carousel .slick-slider .slick-list,.ant-carousel .slick-slider .slick-track{touch-action:pan-y;transform:translateZ(0)}.ant-carousel .slick-track{display:block;left:0;position:relative;top:0}.ant-carousel .slick-track:after,.ant-carousel .slick-track:before{content:"";display:table}.ant-carousel .slick-track:after{clear:both}.slick-loading .ant-carousel .slick-track{visibility:hidden}.ant-carousel .slick-slide{display:none;float:left;height:100%;min-height:1px}.ant-carousel .slick-slide img{display:block}.ant-carousel .slick-slide.slick-loading img{display:none}.ant-carousel .slick-slide.dragging img{pointer-events:none}.ant-carousel .slick-initialized .slick-slide{display:block}.ant-carousel .slick-loading .slick-slide{visibility:hidden}.ant-carousel .slick-vertical .slick-slide{display:block;height:auto}.ant-carousel .slick-arrow.slick-hidden{display:none}.ant-carousel .slick-next,.ant-carousel .slick-prev{border:0;cursor:pointer;display:block;font-size:0;height:20px;line-height:0;margin-top:-10px;padding:0;position:absolute;top:50%;width:20px}.ant-carousel .slick-next,.ant-carousel .slick-next:focus,.ant-carousel .slick-next:hover,.ant-carousel .slick-prev,.ant-carousel .slick-prev:focus,.ant-carousel .slick-prev:hover{background:transparent;color:transparent;outline:none}.ant-carousel .slick-next:focus:before,.ant-carousel .slick-next:hover:before,.ant-carousel .slick-prev:focus:before,.ant-carousel .slick-prev:hover:before{opacity:1}.ant-carousel .slick-next.slick-disabled:before,.ant-carousel .slick-prev.slick-disabled:before{opacity:.25}.ant-carousel .slick-prev{left:-25px}.ant-carousel .slick-prev:before{content:"←"}.ant-carousel .slick-next{right:-25px}.ant-carousel .slick-next:before{content:"→"}.ant-carousel .slick-dots{bottom:0;display:flex!important;justify-content:center;left:0;list-style:none;margin-left:15%;margin-right:15%;padding-left:0;position:absolute;right:0;z-index:15}.ant-carousel .slick-dots-bottom{bottom:12px}.ant-carousel .slick-dots-top{bottom:auto;top:12px}.ant-carousel .slick-dots li{box-sizing:content-box;display:inline-block;flex:0 1 auto;height:3px;margin:0 3px;padding:0;position:relative;text-align:center;text-indent:-999px;transition:all .5s;vertical-align:top;width:16px}.ant-carousel .slick-dots li button{background:#fff;border:0;border-radius:1px;color:transparent;cursor:pointer;display:block;font-size:0;height:3px;opacity:.3;outline:none;padding:0;transition:all .5s;width:100%}.ant-carousel .slick-dots li button:focus,.ant-carousel .slick-dots li button:hover{opacity:.75}.ant-carousel .slick-dots li.slick-active{width:24px}.ant-carousel .slick-dots li.slick-active button{background:#fff;opacity:1}.ant-carousel .slick-dots li.slick-active:focus,.ant-carousel .slick-dots li.slick-active:hover{opacity:1}.ant-carousel-vertical .slick-dots{bottom:auto;flex-direction:column;height:auto;margin:0;top:50%;transform:translateY(-50%);width:3px}.ant-carousel-vertical .slick-dots-left{left:12px;right:auto}.ant-carousel-vertical .slick-dots-right{left:auto;right:12px}.ant-carousel-vertical .slick-dots li{height:16px;margin:4px 2px;vertical-align:baseline;width:3px}.ant-carousel-vertical .slick-dots li button{height:16px;width:3px}.ant-carousel-vertical .slick-dots li.slick-active,.ant-carousel-vertical .slick-dots li.slick-active button{height:24px;width:3px}.ant-carousel-rtl{direction:rtl}.ant-carousel-rtl .ant-carousel .slick-track{left:auto;right:0}.ant-carousel-rtl .ant-carousel .slick-prev{left:auto;right:-25px}.ant-carousel-rtl .ant-carousel .slick-prev:before{content:"→"}.ant-carousel-rtl .ant-carousel .slick-next{left:-25px;right:auto}.ant-carousel-rtl .ant-carousel .slick-next:before{content:"←"}.ant-carousel-rtl.ant-carousel .slick-dots{flex-direction:row-reverse}.ant-carousel-rtl.ant-carousel-vertical .slick-dots{flex-direction:column}.ant-cascader-checkbox{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em;white-space:nowrap}.ant-cascader-checkbox-input:focus+.ant-cascader-checkbox-inner,.ant-cascader-checkbox-wrapper:hover .ant-cascader-checkbox-inner,.ant-cascader-checkbox:hover .ant-cascader-checkbox-inner{border-color:#1890ff}.ant-cascader-checkbox-checked:after{-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;border:1px solid #1890ff;border-radius:2px;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-cascader-checkbox-wrapper:hover .ant-cascader-checkbox:after,.ant-cascader-checkbox:hover:after{visibility:visible}.ant-cascader-checkbox-inner{background-color:#fff;border:1px solid #d9d9d9;border-collapse:separate;border-radius:2px;direction:ltr;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-cascader-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;height:9.14285714px;left:21.5%;opacity:0;position:absolute;top:50%;transform:rotate(45deg) scale(0) translate(-50%,-50%);transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;width:5.71428571px}.ant-cascader-checkbox-input{bottom:0;cursor:pointer;height:100%;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-cascader-checkbox-checked .ant-cascader-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;transform:rotate(45deg) scale(1) translate(-50%,-50%);transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.ant-cascader-checkbox-checked .ant-cascader-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-cascader-checkbox-disabled{cursor:not-allowed}.ant-cascader-checkbox-disabled.ant-cascader-checkbox-checked .ant-cascader-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.ant-cascader-checkbox-disabled .ant-cascader-checkbox-input{cursor:not-allowed;pointer-events:none}.ant-cascader-checkbox-disabled .ant-cascader-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-cascader-checkbox-disabled .ant-cascader-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-collapse:separate;border-color:#f5f5f5}.ant-cascader-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-cascader-checkbox-disabled:hover:after,.ant-cascader-checkbox-wrapper:hover .ant-cascader-checkbox-disabled:after{visibility:hidden}.ant-cascader-checkbox-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.ant-cascader-checkbox-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-cascader-checkbox-wrapper.ant-cascader-checkbox-wrapper-disabled{cursor:not-allowed}.ant-cascader-checkbox-wrapper+.ant-cascader-checkbox-wrapper{margin-left:8px}.ant-cascader-checkbox-wrapper.ant-cascader-checkbox-wrapper-in-form-item input[type=checkbox]{height:14px;width:14px}.ant-cascader-checkbox+span{padding-left:8px;padding-right:8px}.ant-cascader-checkbox-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-cascader-checkbox-group-item{margin-right:8px}.ant-cascader-checkbox-group-item:last-child{margin-right:0}.ant-cascader-checkbox-group-item+.ant-cascader-checkbox-group-item{margin-left:0}.ant-cascader-checkbox-indeterminate .ant-cascader-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-cascader-checkbox-indeterminate .ant-cascader-checkbox-inner:after{background-color:#1890ff;border:0;content:" ";height:8px;left:50%;opacity:1;top:50%;transform:translate(-50%,-50%) scale(1);width:8px}.ant-cascader-checkbox-indeterminate.ant-cascader-checkbox-disabled .ant-cascader-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-cascader{width:184px}.ant-cascader-checkbox{margin-right:8px;top:0}.ant-cascader-menus{align-items:flex-start;display:flex;flex-wrap:nowrap}.ant-cascader-menus.ant-cascader-menu-empty .ant-cascader-menu{height:auto;width:100%}.ant-cascader-menu{-ms-overflow-style:-ms-autohiding-scrollbar;border-right:1px solid #f0f0f0;flex-grow:1;height:180px;list-style:none;margin:-4px 0;min-width:111px;overflow:auto;padding:4px 0;vertical-align:top}.ant-cascader-menu-item{align-items:center;cursor:pointer;display:flex;flex-wrap:nowrap;line-height:22px;overflow:hidden;padding:5px 12px;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-cascader-menu-item:hover{background:#f5f5f5}.ant-cascader-menu-item-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-cascader-menu-item-disabled:hover{background:transparent}.ant-cascader-menu-empty .ant-cascader-menu-item{color:rgba(0,0,0,.25);cursor:default;pointer-events:none}.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled),.ant-cascader-menu-item-active:not(.ant-cascader-menu-item-disabled):hover{background-color:#e6f7ff;font-weight:600}.ant-cascader-menu-item-content{flex:auto}.ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon,.ant-cascader-menu-item-loading-icon{color:rgba(0,0,0,.45);font-size:10px;margin-left:4px}.ant-cascader-menu-item-disabled.ant-cascader-menu-item-expand .ant-cascader-menu-item-expand-icon,.ant-cascader-menu-item-disabled.ant-cascader-menu-item-loading-icon{color:rgba(0,0,0,.25)}.ant-cascader-menu-item-keyword{color:#ff4d4f}.ant-cascader-rtl .ant-cascader-menu-item-expand-icon,.ant-cascader-rtl .ant-cascader-menu-item-loading-icon{margin-left:0;margin-right:4px}.ant-cascader-rtl .ant-cascader-checkbox{margin-left:8px;margin-right:0;top:0}.ant-checkbox{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em;white-space:nowrap}.ant-checkbox-input:focus+.ant-checkbox-inner,.ant-checkbox-wrapper:hover .ant-checkbox-inner,.ant-checkbox:hover .ant-checkbox-inner{border-color:#1890ff}.ant-checkbox-checked:after{-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;border:1px solid #1890ff;border-radius:2px;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-checkbox-wrapper:hover .ant-checkbox:after,.ant-checkbox:hover:after{visibility:visible}.ant-checkbox-inner{background-color:#fff;border:1px solid #d9d9d9;border-collapse:separate;border-radius:2px;direction:ltr;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;height:9.14285714px;left:21.5%;opacity:0;position:absolute;top:50%;transform:rotate(45deg) scale(0) translate(-50%,-50%);transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;width:5.71428571px}.ant-checkbox-input{bottom:0;cursor:pointer;height:100%;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-checkbox-checked .ant-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;transform:rotate(45deg) scale(1) translate(-50%,-50%);transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.ant-checkbox-checked .ant-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-checkbox-disabled{cursor:not-allowed}.ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.ant-checkbox-disabled .ant-checkbox-input{cursor:not-allowed;pointer-events:none}.ant-checkbox-disabled .ant-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-checkbox-disabled .ant-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-collapse:separate;border-color:#f5f5f5}.ant-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-checkbox-disabled:hover:after,.ant-checkbox-wrapper:hover .ant-checkbox-disabled:after{visibility:hidden}.ant-checkbox-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.ant-checkbox-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-checkbox-wrapper.ant-checkbox-wrapper-disabled{cursor:not-allowed}.ant-checkbox-wrapper+.ant-checkbox-wrapper{margin-left:8px}.ant-checkbox-wrapper.ant-checkbox-wrapper-in-form-item input[type=checkbox]{height:14px;width:14px}.ant-checkbox+span{padding-left:8px;padding-right:8px}.ant-checkbox-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-checkbox-group-item{margin-right:8px}.ant-checkbox-group-item:last-child{margin-right:0}.ant-checkbox-group-item+.ant-checkbox-group-item{margin-left:0}.ant-checkbox-indeterminate .ant-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-checkbox-indeterminate .ant-checkbox-inner:after{background-color:#1890ff;border:0;content:" ";height:8px;left:50%;opacity:1;top:50%;transform:translate(-50%,-50%) scale(1);width:8px}.ant-checkbox-indeterminate.ant-checkbox-disabled .ant-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-checkbox-rtl{direction:rtl}.ant-checkbox-group-rtl .ant-checkbox-group-item{margin-left:8px;margin-right:0}.ant-checkbox-group-rtl .ant-checkbox-group-item:last-child{margin-left:0!important}.ant-checkbox-group-rtl .ant-checkbox-group-item+.ant-checkbox-group-item{margin-left:8px}.ant-collapse{font-feature-settings:"tnum";background-color:#fafafa;border:1px solid #d9d9d9;border-bottom:0;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-collapse>.ant-collapse-item{border-bottom:1px solid #d9d9d9}.ant-collapse>.ant-collapse-item:last-child,.ant-collapse>.ant-collapse-item:last-child>.ant-collapse-header{border-radius:0 0 2px 2px}.ant-collapse>.ant-collapse-item>.ant-collapse-header{align-items:flex-start;color:rgba(0,0,0,.85);cursor:pointer;display:flex;flex-wrap:nowrap;line-height:1.5715;padding:12px 16px;position:relative;transition:all .3s,visibility 0s}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{display:inline-block;font-size:12px;margin-right:12px;vertical-align:-1px}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{transition:transform .24s}.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{margin-left:auto}.ant-collapse>.ant-collapse-item>.ant-collapse-header:focus{outline:none}.ant-collapse>.ant-collapse-item .ant-collapse-header-collapsible-only{cursor:default}.ant-collapse>.ant-collapse-item .ant-collapse-header-collapsible-only .ant-collapse-header-text{cursor:pointer}.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-left:12px}.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header{padding:12px 40px 12px 16px;position:relative}.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{left:auto;margin:0;position:absolute;right:16px;top:50%;transform:translateY(-50%)}.ant-collapse-content{background-color:#fff;border-top:1px solid #d9d9d9;color:rgba(0,0,0,.85)}.ant-collapse-content>.ant-collapse-content-box{padding:16px}.ant-collapse-content-hidden{display:none}.ant-collapse-item:last-child>.ant-collapse-content{border-radius:0 0 2px 2px}.ant-collapse-borderless{background-color:#fafafa;border:0}.ant-collapse-borderless>.ant-collapse-item{border-bottom:1px solid #d9d9d9}.ant-collapse-borderless>.ant-collapse-item:last-child,.ant-collapse-borderless>.ant-collapse-item:last-child .ant-collapse-header{border-radius:0}.ant-collapse-borderless>.ant-collapse-item:last-child{border-bottom:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content{background-color:transparent;border-top:0}.ant-collapse-borderless>.ant-collapse-item>.ant-collapse-content>.ant-collapse-content-box{padding-top:4px}.ant-collapse-ghost{background-color:transparent;border:0}.ant-collapse-ghost>.ant-collapse-item{border-bottom:0}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-content{background-color:transparent;border-top:0}.ant-collapse-ghost>.ant-collapse-item>.ant-collapse-content>.ant-collapse-content-box{padding-bottom:12px;padding-top:12px}.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header,.ant-collapse .ant-collapse-item-disabled>.ant-collapse-header>.arrow{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-collapse-rtl{direction:rtl}.ant-collapse-rtl.ant-collapse.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header{padding:12px 16px 12px 40px;position:relative}.ant-collapse-rtl.ant-collapse.ant-collapse-icon-position-end>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{left:16px;margin:0;position:absolute;right:auto;top:50%;transform:translateY(-50%)}.ant-collapse-rtl .ant-collapse>.ant-collapse-item>.ant-collapse-header{padding:12px 40px 12px 16px}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow{margin-left:12px;margin-right:0}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-arrow svg{transform:rotate(180deg)}.ant-collapse-rtl.ant-collapse>.ant-collapse-item>.ant-collapse-header .ant-collapse-extra{margin-left:0;margin-right:auto}.ant-collapse-rtl.ant-collapse>.ant-collapse-item.ant-collapse-no-arrow>.ant-collapse-header{padding-left:0;padding-right:12px}.ant-comment{background-color:inherit;position:relative}.ant-comment-inner{display:flex;padding:16px 0}.ant-comment-avatar{cursor:pointer;flex-shrink:0;margin-right:12px;position:relative}.ant-comment-avatar img{border-radius:50%;height:32px;width:32px}.ant-comment-content{word-wrap:break-word;flex:1 1 auto;font-size:14px;min-width:1px;position:relative}.ant-comment-content-author{display:flex;flex-wrap:wrap;font-size:14px;justify-content:flex-start;margin-bottom:4px}.ant-comment-content-author>a,.ant-comment-content-author>span{font-size:12px;line-height:18px;padding-right:8px}.ant-comment-content-author-name{color:rgba(0,0,0,.45);font-size:14px;transition:color .3s}.ant-comment-content-author-name>*,.ant-comment-content-author-name>:hover{color:rgba(0,0,0,.45)}.ant-comment-content-author-time{color:#ccc;cursor:auto;white-space:nowrap}.ant-comment-content-detail p{margin-bottom:inherit;white-space:pre-wrap}.ant-comment-actions{margin-bottom:inherit;margin-top:12px;padding-left:0}.ant-comment-actions>li{color:rgba(0,0,0,.45);display:inline-block}.ant-comment-actions>li>span{color:rgba(0,0,0,.45);cursor:pointer;font-size:12px;margin-right:10px;transition:color .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-comment-actions>li>span:hover{color:#595959}.ant-comment-nested{margin-left:44px}.ant-comment-rtl{direction:rtl}.ant-comment-rtl .ant-comment-avatar{margin-left:12px;margin-right:0}.ant-comment-rtl .ant-comment-content-author>a,.ant-comment-rtl .ant-comment-content-author>span{padding-left:8px;padding-right:0}.ant-comment-rtl .ant-comment-actions{padding-right:0}.ant-comment-rtl .ant-comment-actions>li>span{margin-left:10px;margin-right:0}.ant-comment-rtl .ant-comment-nested{margin-left:0;margin-right:44px}.ant-picker-status-error.ant-picker,.ant-picker-status-error.ant-picker:not([disabled]):hover{background-color:#fff;border-color:#ff4d4f}.ant-picker-status-error.ant-picker-focused,.ant-picker-status-error.ant-picker:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-picker-status-error.ant-picker .ant-picker-active-bar{background:#ff7875}.ant-picker-status-warning.ant-picker,.ant-picker-status-warning.ant-picker:not([disabled]):hover{background-color:#fff;border-color:#faad14}.ant-picker-status-warning.ant-picker-focused,.ant-picker-status-warning.ant-picker:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-picker-status-warning.ant-picker .ant-picker-active-bar{background:#ffc53d}.ant-picker{font-feature-settings:"tnum";align-items:center;background:#fff;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:4px 11px;position:relative;transition:border .3s,box-shadow .3s}.ant-picker-focused,.ant-picker:hover{border-color:#40a9ff;border-right-width:1px}.ant-picker-focused{box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-picker.ant-picker-disabled{background:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.ant-picker.ant-picker-disabled .ant-picker-suffix{color:rgba(0,0,0,.25)}.ant-picker.ant-picker-borderless{background-color:transparent!important;border-color:transparent!important;box-shadow:none!important}.ant-picker-input{align-items:center;display:inline-flex;position:relative;width:100%}.ant-picker-input>input{background-color:#fff;background-image:none;background:transparent;border:0;border-radius:2px;color:rgba(0,0,0,.85);display:inline-block;flex:auto;font-size:14px;height:auto;line-height:1.5715;min-width:0;min-width:1px;padding:0;position:relative;transition:all .3s;width:100%}.ant-picker-input>input::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-picker-input>input:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-picker-input>input::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-picker-input>input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-picker-input>input:-ms-input-placeholder{text-overflow:ellipsis}.ant-picker-input>input:placeholder-shown{text-overflow:ellipsis}.ant-picker-input>input:hover{border-color:#40a9ff;border-right-width:1px}.ant-picker-input>input-focused,.ant-picker-input>input:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-picker-input>input-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-picker-input>input-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-picker-input>input[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-picker-input>input[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-picker-input>input-borderless,.ant-picker-input>input-borderless-disabled,.ant-picker-input>input-borderless-focused,.ant-picker-input>input-borderless:focus,.ant-picker-input>input-borderless:hover,.ant-picker-input>input-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-picker-input>input{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-picker-input>input-lg{font-size:16px;padding:6.5px 11px}.ant-picker-input>input-sm{padding:0 7px}.ant-picker-input>input:focus{box-shadow:none}.ant-picker-input>input[disabled]{background:transparent}.ant-picker-input:hover .ant-picker-clear{opacity:1}.ant-picker-input-placeholder>input{color:#bfbfbf}.ant-picker-large{padding:6.5px 11px}.ant-picker-large .ant-picker-input>input{font-size:16px}.ant-picker-small{padding:0 7px}.ant-picker-suffix{-ms-grid-row-align:center;align-self:center;color:rgba(0,0,0,.25);display:flex;flex:none;line-height:1;margin-left:4px;pointer-events:none}.ant-picker-suffix>*{vertical-align:top}.ant-picker-suffix>:not(:last-child){margin-right:8px}.ant-picker-clear{background:#fff;color:rgba(0,0,0,.25);cursor:pointer;line-height:1;opacity:0;position:absolute;right:0;top:50%;transform:translateY(-50%);transition:opacity .3s,color .3s}.ant-picker-clear>*{vertical-align:top}.ant-picker-clear:hover{color:rgba(0,0,0,.45)}.ant-picker-separator{color:rgba(0,0,0,.25);cursor:default;display:inline-block;font-size:16px;height:16px;position:relative;vertical-align:top;width:1em}.ant-picker-focused .ant-picker-separator{color:rgba(0,0,0,.45)}.ant-picker-disabled .ant-picker-range-separator .ant-picker-separator{cursor:not-allowed}.ant-picker-range{display:inline-flex;position:relative}.ant-picker-range .ant-picker-clear{right:11px}.ant-picker-range:hover .ant-picker-clear{opacity:1}.ant-picker-range .ant-picker-active-bar{background:#1890ff;bottom:-1px;height:2px;margin-left:11px;opacity:0;pointer-events:none;transition:all .3s ease-out}.ant-picker-range.ant-picker-focused .ant-picker-active-bar{opacity:1}.ant-picker-range-separator{align-items:center;line-height:1;padding:0 8px}.ant-picker-range.ant-picker-small .ant-picker-clear{right:7px}.ant-picker-range.ant-picker-small .ant-picker-active-bar{margin-left:7px}.ant-picker-dropdown{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;left:-9999px;line-height:1.5715;list-style:none;margin:0;padding:0;position:absolute;top:-9999px;z-index:1050}.ant-picker-dropdown-hidden{display:none}.ant-picker-dropdown-placement-bottomLeft .ant-picker-range-arrow{display:block;top:2.58561808px;transform:rotate(-135deg) translateY(1px)}.ant-picker-dropdown-placement-topLeft .ant-picker-range-arrow{bottom:2.58561808px;display:block;transform:rotate(45deg)}.ant-picker-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-picker-dropdown-placement-topLeft,.ant-picker-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-picker-dropdown-placement-topRight,.ant-picker-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-picker-dropdown-placement-topLeft,.ant-picker-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-picker-dropdown-placement-topRight{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn}.ant-picker-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-picker-dropdown-placement-bottomLeft,.ant-picker-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-picker-dropdown-placement-bottomRight,.ant-picker-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-picker-dropdown-placement-bottomLeft,.ant-picker-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-picker-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn}.ant-picker-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-picker-dropdown-placement-topLeft,.ant-picker-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-picker-dropdown-placement-topRight{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut}.ant-picker-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-picker-dropdown-placement-bottomLeft,.ant-picker-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-picker-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut}.ant-picker-dropdown-range{padding:7.54247233px 0}.ant-picker-dropdown-range-hidden{display:none}.ant-picker-dropdown .ant-picker-panel>.ant-picker-time-panel{padding-top:4px}.ant-picker-ranges{line-height:34px;list-style:none;margin-bottom:0;overflow:hidden;padding:4px 12px;text-align:left}.ant-picker-ranges>li{display:inline-block}.ant-picker-ranges .ant-picker-preset>.ant-tag-blue{background:#e6f7ff;border-color:#91d5ff;color:#1890ff;cursor:pointer}.ant-picker-ranges .ant-picker-ok{float:right;margin-left:8px}.ant-picker-range-wrapper{display:flex}.ant-picker-range-arrow{border-radius:0 0 2px;box-shadow:2px 2px 6px -2px rgba(0,0,0,.1);display:none;height:11.3137085px;margin-left:16.5px;pointer-events:none;position:absolute;transition:left .3s ease-out;width:11.3137085px;z-index:1}.ant-picker-range-arrow:before{background:#fff;background-position:-10px -10px;background-repeat:no-repeat;-webkit-clip-path:inset(33% 33%);clip-path:inset(33% 33%);-webkit-clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");content:"";height:33.9411255px;left:-11.3137085px;position:absolute;top:-11.3137085px;width:33.9411255px}.ant-picker-panel-container{background:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);overflow:hidden;transition:margin .3s;vertical-align:top}.ant-picker-panel-container .ant-picker-panels{direction:ltr;display:inline-flex;flex-wrap:nowrap}.ant-picker-panel-container .ant-picker-panel{background:transparent;border-radius:0;border-width:0 0 1px;vertical-align:top}.ant-picker-panel-container .ant-picker-panel .ant-picker-content,.ant-picker-panel-container .ant-picker-panel table{text-align:center}.ant-picker-panel-container .ant-picker-panel-focused{border-color:#f0f0f0}.ant-picker-panel{background:#fff;border:1px solid #f0f0f0;border-radius:2px;display:inline-flex;flex-direction:column;outline:none;text-align:center}.ant-picker-panel-focused{border-color:#1890ff}.ant-picker-date-panel,.ant-picker-decade-panel,.ant-picker-month-panel,.ant-picker-quarter-panel,.ant-picker-time-panel,.ant-picker-week-panel,.ant-picker-year-panel{display:flex;flex-direction:column;width:280px}.ant-picker-header{border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.85);display:flex;padding:0 8px}.ant-picker-header>*{flex:none}.ant-picker-header button{background:transparent;border:0;color:rgba(0,0,0,.25);cursor:pointer;line-height:40px;padding:0;transition:color .3s}.ant-picker-header>button{font-size:14px;min-width:1.6em}.ant-picker-header>button:hover{color:rgba(0,0,0,.85)}.ant-picker-header-view{flex:auto;font-weight:500;line-height:40px}.ant-picker-header-view button{color:inherit;font-weight:inherit}.ant-picker-header-view button:not(:first-child){margin-left:8px}.ant-picker-header-view button:hover{color:#1890ff}.ant-picker-next-icon,.ant-picker-prev-icon,.ant-picker-super-next-icon,.ant-picker-super-prev-icon{display:inline-block;height:7px;position:relative;width:7px}.ant-picker-next-icon:before,.ant-picker-prev-icon:before,.ant-picker-super-next-icon:before,.ant-picker-super-prev-icon:before{border:0 solid;border-width:1.5px 0 0 1.5px;content:"";display:inline-block;height:7px;left:0;position:absolute;top:0;width:7px}.ant-picker-super-next-icon:after,.ant-picker-super-prev-icon:after{border:0 solid;border-width:1.5px 0 0 1.5px;content:"";display:inline-block;height:7px;left:4px;position:absolute;top:4px;width:7px}.ant-picker-prev-icon,.ant-picker-super-prev-icon{transform:rotate(-45deg)}.ant-picker-next-icon,.ant-picker-super-next-icon{transform:rotate(135deg)}.ant-picker-content{border-collapse:collapse;table-layout:fixed;width:100%}.ant-picker-content td,.ant-picker-content th{font-weight:400;min-width:24px;position:relative}.ant-picker-content th{color:rgba(0,0,0,.85);height:30px;line-height:30px}.ant-picker-cell{color:rgba(0,0,0,.25);cursor:pointer;padding:3px 0}.ant-picker-cell-in-view{color:rgba(0,0,0,.85)}.ant-picker-cell:before{content:"";height:24px;left:0;position:absolute;right:0;top:50%;transform:translateY(-50%);transition:all .3s;z-index:1}.ant-picker-cell:hover:not(.ant-picker-cell-in-view) .ant-picker-cell-inner,.ant-picker-cell:hover:not(.ant-picker-cell-selected):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):not(.ant-picker-cell-range-hover-start):not(.ant-picker-cell-range-hover-end) .ant-picker-cell-inner{background:#f5f5f5}.ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner:before{border:1px solid #1890ff;border-radius:2px;bottom:0;content:"";left:0;position:absolute;right:0;top:0;z-index:1}.ant-picker-cell-in-view.ant-picker-cell-in-range{position:relative}.ant-picker-cell-in-view.ant-picker-cell-in-range:before{background:#e6f7ff}.ant-picker-cell-in-view.ant-picker-cell-range-end .ant-picker-cell-inner,.ant-picker-cell-in-view.ant-picker-cell-range-start .ant-picker-cell-inner,.ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner{background:#1890ff;color:#fff}.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):before,.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):before{background:#e6f7ff}.ant-picker-cell-in-view.ant-picker-cell-range-start:before{left:50%}.ant-picker-cell-in-view.ant-picker-cell-range-end:before{right:50%}.ant-picker-cell-in-view.ant-picker-cell-range-hover-end.ant-picker-cell-range-end-single:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end.ant-picker-cell-range-start.ant-picker-cell-range-end.ant-picker-cell-range-start-near-hover:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:not(.ant-picker-cell-in-range):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start.ant-picker-cell-range-start-single:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start.ant-picker-cell-range-start.ant-picker-cell-range-end.ant-picker-cell-range-end-near-hover:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:not(.ant-picker-cell-in-range):not(.ant-picker-cell-range-start):not(.ant-picker-cell-range-end):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-in-range):after{border-bottom:1px dashed #7ec1ff;border-top:1px dashed #7ec1ff;content:"";height:24px;position:absolute;top:50%;transform:translateY(-50%);transition:all .3s;z-index:0}.ant-picker-cell-range-hover-end:after,.ant-picker-cell-range-hover-start:after,.ant-picker-cell-range-hover:after{left:2px;right:0}.ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-end.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single).ant-picker-cell-range-hover-end:before,.ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-hover:before,.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single).ant-picker-cell-range-hover-start:before,.ant-picker-panel>:not(.ant-picker-date-panel) .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end:before,.ant-picker-panel>:not(.ant-picker-date-panel) .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start:before{background:#cbe6ff}.ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(.ant-picker-cell-range-end) .ant-picker-cell-inner{border-radius:2px 0 0 2px}.ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(.ant-picker-cell-range-start) .ant-picker-cell-inner{border-radius:0 2px 2px 0}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after,.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{background:#cbe6ff;bottom:0;content:"";position:absolute;top:0;transition:all .3s;z-index:-1}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{left:0;right:-6px}.ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after{left:-6px;right:0}.ant-picker-cell-range-hover.ant-picker-cell-range-start:after{right:50%}.ant-picker-cell-range-hover.ant-picker-cell-range-end:after{left:50%}.ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover-edge-start-near-range):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:after,.ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-edge-start.ant-picker-cell-range-hover-edge-start-near-range:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:first-child:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:first-child:after{border-bottom-left-radius:2px;border-left:1px dashed #7ec1ff;border-top-left-radius:2px;left:6px}.ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover-edge-end.ant-picker-cell-range-hover-edge-end-near-range:after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover-edge-end-near-range):after,.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child:after,tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:last-child:after{border-bottom-right-radius:2px;border-right:1px dashed #7ec1ff;border-top-right-radius:2px;right:6px}.ant-picker-cell-disabled{color:rgba(0,0,0,.25);pointer-events:none}.ant-picker-cell-disabled .ant-picker-cell-inner{background:transparent}.ant-picker-cell-disabled:before{background:rgba(0,0,0,.04)}.ant-picker-cell-disabled.ant-picker-cell-today .ant-picker-cell-inner:before{border-color:rgba(0,0,0,.25)}.ant-picker-decade-panel .ant-picker-content,.ant-picker-month-panel .ant-picker-content,.ant-picker-quarter-panel .ant-picker-content,.ant-picker-year-panel .ant-picker-content{height:264px}.ant-picker-decade-panel .ant-picker-cell-inner,.ant-picker-month-panel .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-inner{padding:0 8px}.ant-picker-quarter-panel .ant-picker-content{height:56px}.ant-picker-footer{border-bottom:1px solid transparent;line-height:38px;min-width:100%;text-align:center;width:-webkit-min-content;width:-moz-min-content;width:min-content}.ant-picker-panel .ant-picker-footer{border-top:1px solid #f0f0f0}.ant-picker-footer-extra{line-height:38px;padding:0 12px;text-align:left}.ant-picker-footer-extra:not(:last-child){border-bottom:1px solid #f0f0f0}.ant-picker-now{text-align:left}.ant-picker-today-btn{color:#1890ff}.ant-picker-today-btn:hover{color:#40a9ff}.ant-picker-today-btn:active{color:#096dd9}.ant-picker-today-btn.ant-picker-today-btn-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-picker-decade-panel .ant-picker-cell-inner{padding:0 4px}.ant-picker-decade-panel .ant-picker-cell:before{display:none}.ant-picker-month-panel .ant-picker-body,.ant-picker-quarter-panel .ant-picker-body,.ant-picker-year-panel .ant-picker-body{padding:0 8px}.ant-picker-month-panel .ant-picker-cell-inner,.ant-picker-quarter-panel .ant-picker-cell-inner,.ant-picker-year-panel .ant-picker-cell-inner{width:60px}.ant-picker-month-panel .ant-picker-cell-range-hover-start:after,.ant-picker-quarter-panel .ant-picker-cell-range-hover-start:after,.ant-picker-year-panel .ant-picker-cell-range-hover-start:after{border-left:1px dashed #7ec1ff;border-radius:2px 0 0 2px;left:14px}.ant-picker-month-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-month-panel .ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-quarter-panel .ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-year-panel .ant-picker-cell-range-hover-start:after,.ant-picker-quarter-panel .ant-picker-cell-range-hover-end:after,.ant-picker-year-panel .ant-picker-cell-range-hover-end:after{border-radius:0 2px 2px 0;border-right:1px dashed #7ec1ff;right:14px}.ant-picker-panel-rtl .ant-picker-month-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-quarter-panel .ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl .ant-picker-year-panel .ant-picker-cell-range-hover-end:after{border-left:1px dashed #7ec1ff;border-radius:2px 0 0 2px;left:14px}.ant-picker-week-panel .ant-picker-body{padding:8px 12px}.ant-picker-week-panel .ant-picker-cell .ant-picker-cell-inner,.ant-picker-week-panel .ant-picker-cell-selected .ant-picker-cell-inner,.ant-picker-week-panel .ant-picker-cell:hover .ant-picker-cell-inner{background:transparent!important}.ant-picker-week-panel-row td{transition:background .3s}.ant-picker-week-panel-row:hover td{background:#f5f5f5}.ant-picker-week-panel-row-selected td,.ant-picker-week-panel-row-selected:hover td{background:#1890ff}.ant-picker-week-panel-row-selected td.ant-picker-cell-week,.ant-picker-week-panel-row-selected:hover td.ant-picker-cell-week{color:hsla(0,0%,100%,.5)}.ant-picker-week-panel-row-selected td.ant-picker-cell-today .ant-picker-cell-inner:before,.ant-picker-week-panel-row-selected:hover td.ant-picker-cell-today .ant-picker-cell-inner:before{border-color:#fff}.ant-picker-week-panel-row-selected td .ant-picker-cell-inner,.ant-picker-week-panel-row-selected:hover td .ant-picker-cell-inner{color:#fff}.ant-picker-date-panel .ant-picker-body{padding:8px 12px}.ant-picker-date-panel .ant-picker-content{width:252px}.ant-picker-date-panel .ant-picker-content th{width:36px}.ant-picker-datetime-panel{display:flex}.ant-picker-datetime-panel .ant-picker-time-panel{border-left:1px solid #f0f0f0}.ant-picker-datetime-panel .ant-picker-date-panel,.ant-picker-datetime-panel .ant-picker-time-panel{transition:opacity .3s}.ant-picker-datetime-panel-active .ant-picker-date-panel,.ant-picker-datetime-panel-active .ant-picker-time-panel{opacity:.3}.ant-picker-datetime-panel-active .ant-picker-date-panel-active,.ant-picker-datetime-panel-active .ant-picker-time-panel-active{opacity:1}.ant-picker-time-panel{min-width:auto;width:auto}.ant-picker-time-panel .ant-picker-content{display:flex;flex:auto;height:224px}.ant-picker-time-panel-column{flex:1 0 auto;list-style:none;margin:0;overflow-y:hidden;padding:0;text-align:left;transition:background .3s;width:56px}.ant-picker-time-panel-column:after{content:"";display:block;height:196px}.ant-picker-datetime-panel .ant-picker-time-panel-column:after{height:198px}.ant-picker-time-panel-column:not(:first-child){border-left:1px solid #f0f0f0}.ant-picker-time-panel-column-active{background:rgba(230,247,255,.2)}.ant-picker-time-panel-column:hover{overflow-y:auto}.ant-picker-time-panel-column>li{margin:0;padding:0}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell .ant-picker-time-panel-cell-inner{border-radius:0;color:rgba(0,0,0,.85);cursor:pointer;display:block;height:28px;line-height:28px;margin:0;padding:0 0 0 14px;transition:background .3s;width:100%}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell .ant-picker-time-panel-cell-inner:hover{background:#f5f5f5}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell-selected .ant-picker-time-panel-cell-inner{background:#e6f7ff}.ant-picker-time-panel-column>li.ant-picker-time-panel-cell-disabled .ant-picker-time-panel-cell-inner{background:transparent;color:rgba(0,0,0,.25);cursor:not-allowed}:root .ant-picker-range-wrapper .ant-picker-month-panel .ant-picker-cell,:root .ant-picker-range-wrapper .ant-picker-year-panel .ant-picker-cell,_:-ms-fullscreen .ant-picker-range-wrapper .ant-picker-month-panel .ant-picker-cell,_:-ms-fullscreen .ant-picker-range-wrapper .ant-picker-year-panel .ant-picker-cell{padding:21px 0}.ant-picker-rtl{direction:rtl}.ant-picker-rtl .ant-picker-suffix{margin-left:0;margin-right:4px}.ant-picker-rtl .ant-picker-clear{left:0;right:auto}.ant-picker-rtl .ant-picker-separator{transform:rotate(180deg)}.ant-picker-panel-rtl .ant-picker-header-view button:not(:first-child){margin-left:0;margin-right:8px}.ant-picker-rtl.ant-picker-range .ant-picker-clear{left:11px;right:auto}.ant-picker-rtl.ant-picker-range .ant-picker-active-bar{margin-left:0;margin-right:11px}.ant-picker-rtl.ant-picker-range.ant-picker-small .ant-picker-active-bar{margin-right:7px}.ant-picker-dropdown-rtl .ant-picker-ranges{text-align:right}.ant-picker-dropdown-rtl .ant-picker-ranges .ant-picker-ok{float:left;margin-left:0;margin-right:8px}.ant-picker-panel-rtl{direction:rtl}.ant-picker-panel-rtl .ant-picker-prev-icon,.ant-picker-panel-rtl .ant-picker-super-prev-icon{transform:rotate(135deg)}.ant-picker-panel-rtl .ant-picker-next-icon,.ant-picker-panel-rtl .ant-picker-super-next-icon{transform:rotate(-45deg)}.ant-picker-cell .ant-picker-cell-inner{border-radius:2px;display:inline-block;height:24px;line-height:24px;min-width:24px;position:relative;transition:background .3s,border .3s;z-index:2}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start:before{left:0;right:50%}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-end:before{left:50%;right:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start.ant-picker-cell-range-end:before{left:50%;right:50%}.ant-picker-panel-rtl .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-start .ant-picker-cell-inner:after{left:-6px;right:0}.ant-picker-panel-rtl .ant-picker-date-panel .ant-picker-cell-in-view.ant-picker-cell-in-range.ant-picker-cell-range-hover-end .ant-picker-cell-inner:after{left:0;right:-6px}.ant-picker-panel-rtl .ant-picker-cell-range-hover.ant-picker-cell-range-start:after{left:50%;right:0}.ant-picker-panel-rtl .ant-picker-cell-range-hover.ant-picker-cell-range-end:after{left:0;right:50%}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-start:not(.ant-picker-cell-range-start-single):not(.ant-picker-cell-range-end) .ant-picker-cell-inner{border-radius:0 2px 2px 0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-end:not(.ant-picker-cell-range-end-single):not(.ant-picker-cell-range-start) .ant-picker-cell-inner{border-radius:2px 0 0 2px}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover-edge-start-near-range):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-start:after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-edge-start.ant-picker-cell-range-hover-edge-start-near-range:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-selected):first-child:after{border-left:none;border-radius:0 2px 2px 0;border-right:1px dashed #7ec1ff;left:0;right:6px}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover-edge-end.ant-picker-cell-range-hover-edge-end-near-range:after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover-edge-end-near-range):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-range-hover-end:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover:not(.ant-picker-cell-selected):last-child:after{border-left:1px dashed #7ec1ff;border-radius:2px 0 0 2px;border-right:none;left:6px;right:0}.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover-start.ant-picker-cell-range-hover-edge-end:not(.ant-picker-cell-range-hover):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover):after,.ant-picker-panel-rtl .ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover-end.ant-picker-cell-range-hover-edge-start:not(.ant-picker-cell-range-hover):after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-end.ant-picker-cell-range-hover.ant-picker-cell-range-hover-edge-end:first-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-end:first-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-range-hover-start:last-child:after,.ant-picker-panel-rtl tr>.ant-picker-cell-in-view.ant-picker-cell-start.ant-picker-cell-range-hover.ant-picker-cell-range-hover-edge-start:last-child:after{border-left:1px dashed #7ec1ff;border-radius:2px;border-right:1px dashed #7ec1ff;left:6px;right:6px}.ant-picker-dropdown-rtl .ant-picker-footer-extra{direction:rtl;text-align:right}.ant-picker-panel-rtl .ant-picker-time-panel{direction:ltr}.ant-descriptions-header{align-items:center;display:flex;margin-bottom:20px}.ant-descriptions-title{color:rgba(0,0,0,.85);flex:auto;font-size:16px;font-weight:700;line-height:1.5715;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-descriptions-extra{color:rgba(0,0,0,.85);font-size:14px;margin-left:auto}.ant-descriptions-view{border-radius:2px;width:100%}.ant-descriptions-view table{table-layout:fixed;width:100%}.ant-descriptions-row>td,.ant-descriptions-row>th{padding-bottom:16px}.ant-descriptions-row:last-child{border-bottom:none}.ant-descriptions-item-label{color:rgba(0,0,0,.85);font-size:14px;font-weight:400;line-height:1.5715;text-align:start}.ant-descriptions-item-label:after{content:":";margin:0 8px 0 2px;position:relative;top:-.5px}.ant-descriptions-item-label.ant-descriptions-item-no-colon:after{content:" "}.ant-descriptions-item-no-label:after{content:"";margin:0}.ant-descriptions-item-content{color:rgba(0,0,0,.85);display:table-cell;flex:1;font-size:14px;line-height:1.5715;overflow-wrap:break-word;word-break:break-word}.ant-descriptions-item{padding-bottom:0;vertical-align:top}.ant-descriptions-item-container{display:flex}.ant-descriptions-item-container .ant-descriptions-item-content,.ant-descriptions-item-container .ant-descriptions-item-label{align-items:baseline;display:inline-flex}.ant-descriptions-middle .ant-descriptions-row>td,.ant-descriptions-middle .ant-descriptions-row>th{padding-bottom:12px}.ant-descriptions-small .ant-descriptions-row>td,.ant-descriptions-small .ant-descriptions-row>th{padding-bottom:8px}.ant-descriptions-bordered .ant-descriptions-view{border:1px solid #f0f0f0}.ant-descriptions-bordered .ant-descriptions-view>table{border-collapse:collapse;table-layout:auto}.ant-descriptions-bordered .ant-descriptions-item-content,.ant-descriptions-bordered .ant-descriptions-item-label{border-right:1px solid #f0f0f0;padding:16px 24px}.ant-descriptions-bordered .ant-descriptions-item-content:last-child,.ant-descriptions-bordered .ant-descriptions-item-label:last-child{border-right:none}.ant-descriptions-bordered .ant-descriptions-item-label{background-color:#fafafa}.ant-descriptions-bordered .ant-descriptions-item-label:after{display:none}.ant-descriptions-bordered .ant-descriptions-row{border-bottom:1px solid #f0f0f0}.ant-descriptions-bordered .ant-descriptions-row:last-child{border-bottom:none}.ant-descriptions-bordered.ant-descriptions-middle .ant-descriptions-item-content,.ant-descriptions-bordered.ant-descriptions-middle .ant-descriptions-item-label{padding:12px 24px}.ant-descriptions-bordered.ant-descriptions-small .ant-descriptions-item-content,.ant-descriptions-bordered.ant-descriptions-small .ant-descriptions-item-label{padding:8px 16px}.ant-descriptions-rtl{direction:rtl}.ant-descriptions-rtl .ant-descriptions-item-label:after{margin:0 2px 0 8px}.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-content,.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-label{border-left:1px solid #f0f0f0;border-right:none}.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-content:last-child,.ant-descriptions-rtl.ant-descriptions-bordered .ant-descriptions-item-label:last-child{border-left:none}.ant-divider{font-feature-settings:"tnum";border-top:1px solid rgba(0,0,0,.06);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-divider-vertical{border-left:1px solid rgba(0,0,0,.06);border-top:0;display:inline-block;height:.9em;margin:0 8px;position:relative;top:-.06em;vertical-align:middle}.ant-divider-horizontal{clear:both;display:flex;margin:24px 0;min-width:100%;width:100%}.ant-divider-horizontal.ant-divider-with-text{border-top:0;border-top-color:rgba(0,0,0,.06);color:rgba(0,0,0,.85);display:flex;font-size:16px;font-weight:500;margin:16px 0;text-align:center;white-space:nowrap}.ant-divider-horizontal.ant-divider-with-text:after,.ant-divider-horizontal.ant-divider-with-text:before{border-bottom:0;border-top:1px solid transparent;border-top-color:inherit;content:"";position:relative;top:50%;transform:translateY(50%);width:50%}.ant-divider-horizontal.ant-divider-with-text-left:before{top:50%;width:5%}.ant-divider-horizontal.ant-divider-with-text-left:after,.ant-divider-horizontal.ant-divider-with-text-right:before{top:50%;width:95%}.ant-divider-horizontal.ant-divider-with-text-right:after{top:50%;width:5%}.ant-divider-inner-text{display:inline-block;padding:0 1em}.ant-divider-dashed{background:none;border:dashed rgba(0,0,0,.06);border-width:1px 0 0}.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:after,.ant-divider-horizontal.ant-divider-with-text.ant-divider-dashed:before{border-style:dashed none none}.ant-divider-vertical.ant-divider-dashed{border-width:0 0 0 1px}.ant-divider-plain.ant-divider-with-text{color:rgba(0,0,0,.85);font-size:14px;font-weight:400}.ant-divider-horizontal.ant-divider-with-text-left.ant-divider-no-default-orientation-margin-left:before{width:0}.ant-divider-horizontal.ant-divider-with-text-left.ant-divider-no-default-orientation-margin-left:after{width:100%}.ant-divider-horizontal.ant-divider-with-text-left.ant-divider-no-default-orientation-margin-left .ant-divider-inner-text{padding-left:0}.ant-divider-horizontal.ant-divider-with-text-right.ant-divider-no-default-orientation-margin-right:before{width:100%}.ant-divider-horizontal.ant-divider-with-text-right.ant-divider-no-default-orientation-margin-right:after{width:0}.ant-divider-horizontal.ant-divider-with-text-right.ant-divider-no-default-orientation-margin-right .ant-divider-inner-text{padding-right:0}.ant-divider-rtl{direction:rtl}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-left:before{width:95%}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-left:after,.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-right:before{width:5%}.ant-divider-rtl.ant-divider-horizontal.ant-divider-with-text-right:after{width:95%}.ant-drawer{height:100%;position:fixed;transition:width 0s ease .3s,height 0s ease .3s;width:0;z-index:1000}.ant-drawer-content-wrapper{height:100%;position:absolute;transition:transform .3s cubic-bezier(.23,1,.32,1),box-shadow .3s cubic-bezier(.23,1,.32,1);width:100%}.ant-drawer .ant-drawer-content{height:100%;width:100%}.ant-drawer-left,.ant-drawer-right{height:100%;top:0;width:0}.ant-drawer-left .ant-drawer-content-wrapper,.ant-drawer-right .ant-drawer-content-wrapper{height:100%}.ant-drawer-left.ant-drawer-open,.ant-drawer-right.ant-drawer-open{transition:transform .3s cubic-bezier(.23,1,.32,1);width:100%}.ant-drawer-left,.ant-drawer-left .ant-drawer-content-wrapper{left:0}.ant-drawer-left.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:6px 0 16px -8px rgba(0,0,0,.08),9px 0 28px 0 rgba(0,0,0,.05),12px 0 48px 16px rgba(0,0,0,.03)}.ant-drawer-right,.ant-drawer-right .ant-drawer-content-wrapper{right:0}.ant-drawer-right.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:-6px 0 16px -8px rgba(0,0,0,.08),-9px 0 28px 0 rgba(0,0,0,.05),-12px 0 48px 16px rgba(0,0,0,.03)}.ant-drawer-right.ant-drawer-open.no-mask{right:1px;transform:translateX(1px)}.ant-drawer-bottom,.ant-drawer-top{height:0%;left:0;width:100%}.ant-drawer-bottom .ant-drawer-content-wrapper,.ant-drawer-top .ant-drawer-content-wrapper{width:100%}.ant-drawer-bottom.ant-drawer-open,.ant-drawer-top.ant-drawer-open{height:100%;transition:transform .3s cubic-bezier(.23,1,.32,1)}.ant-drawer-top{top:0}.ant-drawer-top.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:0 6px 16px -8px rgba(0,0,0,.08),0 9px 28px 0 rgba(0,0,0,.05),0 12px 48px 16px rgba(0,0,0,.03)}.ant-drawer-bottom,.ant-drawer-bottom .ant-drawer-content-wrapper{bottom:0}.ant-drawer-bottom.ant-drawer-open .ant-drawer-content-wrapper{box-shadow:0 -6px 16px -8px rgba(0,0,0,.08),0 -9px 28px 0 rgba(0,0,0,.05),0 -12px 48px 16px rgba(0,0,0,.03)}.ant-drawer-bottom.ant-drawer-open.no-mask{bottom:1px;transform:translateY(1px)}.ant-drawer.ant-drawer-open .ant-drawer-mask{-webkit-animation:antdDrawerFadeIn .3s cubic-bezier(.23,1,.32,1);animation:antdDrawerFadeIn .3s cubic-bezier(.23,1,.32,1);height:100%;opacity:1;pointer-events:auto;transition:none}.ant-drawer-title{color:rgba(0,0,0,.85);flex:1;font-size:16px;font-weight:500;line-height:22px;margin:0}.ant-drawer-content{background-clip:padding-box;background-color:#fff;border:0;overflow:auto;position:relative;z-index:1}.ant-drawer-close{text-rendering:auto;background:transparent;border:0;color:rgba(0,0,0,.45);cursor:pointer;display:inline-block;font-size:16px;font-style:normal;font-weight:700;line-height:1;margin-right:12px;outline:0;text-align:center;text-decoration:none;text-transform:none;transition:color .3s}.ant-drawer-close:focus,.ant-drawer-close:hover{color:rgba(0,0,0,.75);text-decoration:none}.ant-drawer-header{background:#fff;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0;color:rgba(0,0,0,.85);padding:16px 24px;position:relative}.ant-drawer-header,.ant-drawer-header-title{align-items:center;display:flex;justify-content:space-between}.ant-drawer-header-title{flex:1}.ant-drawer-header-close-only{border:none;padding-bottom:0}.ant-drawer-wrapper-body{display:flex;flex-flow:column nowrap;height:100%;width:100%}.ant-drawer-body{word-wrap:break-word;flex-grow:1;font-size:14px;line-height:1.5715;overflow:auto;padding:24px}.ant-drawer-footer{border-top:1px solid #f0f0f0;flex-shrink:0;padding:10px 16px}.ant-drawer-mask{background-color:rgba(0,0,0,.45);height:0;left:0;opacity:0;pointer-events:none;position:absolute;top:0;transition:opacity .3s linear,height 0s ease .3s;width:100%}.ant-drawer .ant-picker-clear{background:#fff}@-webkit-keyframes antdDrawerFadeIn{0%{opacity:0}to{opacity:1}}@keyframes antdDrawerFadeIn{0%{opacity:0}to{opacity:1}}.ant-drawer-rtl{direction:rtl}.ant-drawer-rtl .ant-drawer-close{margin-left:12px;margin-right:0}.ant-dropdown-menu-item.ant-dropdown-menu-item-danger{color:#ff4d4f}.ant-dropdown-menu-item.ant-dropdown-menu-item-danger:hover{background-color:#ff4d4f;color:#fff}.ant-dropdown{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:block;font-size:14px;font-variant:tabular-nums;left:-9999px;line-height:1.5715;list-style:none;margin:0;padding:0;position:absolute;top:-9999px;z-index:1050}.ant-dropdown:before{bottom:-4px;content:" ";left:-7px;opacity:.0001;position:absolute;right:0;top:-4px;z-index:-9999}.ant-dropdown-wrap{position:relative}.ant-dropdown-wrap .ant-btn>.anticon-down{font-size:10px}.ant-dropdown-wrap .anticon-down:before{transition:transform .2s}.ant-dropdown-wrap-open .anticon-down:before{transform:rotate(180deg)}.ant-dropdown-hidden,.ant-dropdown-menu-hidden,.ant-dropdown-menu-submenu-hidden{display:none}.ant-dropdown-show-arrow.ant-dropdown-placement-top,.ant-dropdown-show-arrow.ant-dropdown-placement-topLeft,.ant-dropdown-show-arrow.ant-dropdown-placement-topRight{padding-bottom:15.3137085px}.ant-dropdown-show-arrow.ant-dropdown-placement-bottom,.ant-dropdown-show-arrow.ant-dropdown-placement-bottomLeft,.ant-dropdown-show-arrow.ant-dropdown-placement-bottomRight{padding-top:15.3137085px}.ant-dropdown-arrow{border-radius:0 0 2px;display:block;height:11.3137085px;pointer-events:none;position:absolute;width:11.3137085px;z-index:1}.ant-dropdown-arrow:before{background:#fff;background-position:-10px -10px;background-repeat:no-repeat;-webkit-clip-path:inset(33% 33%);clip-path:inset(33% 33%);-webkit-clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");content:"";height:33.9411255px;left:-11.3137085px;position:absolute;top:-11.3137085px;width:33.9411255px}.ant-dropdown-placement-top>.ant-dropdown-arrow,.ant-dropdown-placement-topLeft>.ant-dropdown-arrow,.ant-dropdown-placement-topRight>.ant-dropdown-arrow{bottom:10px;box-shadow:3px 3px 7px -3px rgba(0,0,0,.1);transform:rotate(45deg)}.ant-dropdown-placement-top>.ant-dropdown-arrow{left:50%;transform:translateX(-50%) rotate(45deg)}.ant-dropdown-placement-topLeft>.ant-dropdown-arrow{left:16px}.ant-dropdown-placement-topRight>.ant-dropdown-arrow{right:16px}.ant-dropdown-placement-bottom>.ant-dropdown-arrow,.ant-dropdown-placement-bottomLeft>.ant-dropdown-arrow,.ant-dropdown-placement-bottomRight>.ant-dropdown-arrow{box-shadow:2px 2px 5px -2px rgba(0,0,0,.1);top:9.41421356px;transform:rotate(-135deg) translateY(-.5px)}.ant-dropdown-placement-bottom>.ant-dropdown-arrow{left:50%;transform:translateX(-50%) rotate(-135deg) translateY(-.5px)}.ant-dropdown-placement-bottomLeft>.ant-dropdown-arrow{left:16px}.ant-dropdown-placement-bottomRight>.ant-dropdown-arrow{right:16px}.ant-dropdown-menu{background-clip:padding-box;background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);list-style-type:none;margin:0;outline:none;padding:4px 0;position:relative;text-align:left}.ant-dropdown-menu-item-group-title{color:rgba(0,0,0,.45);padding:5px 12px;transition:all .3s}.ant-dropdown-menu-submenu-popup{background:transparent;box-shadow:none;position:absolute;transform-origin:0 0;z-index:1050}.ant-dropdown-menu-submenu-popup li,.ant-dropdown-menu-submenu-popup ul{list-style:none}.ant-dropdown-menu-submenu-popup ul{margin-left:.3em;margin-right:.3em}.ant-dropdown-menu-item{align-items:center;display:flex;position:relative}.ant-dropdown-menu-item-icon{font-size:12px;margin-right:8px;min-width:12px}.ant-dropdown-menu-title-content{flex:auto}.ant-dropdown-menu-title-content>a{color:inherit;transition:all .3s}.ant-dropdown-menu-title-content>a:hover{color:inherit}.ant-dropdown-menu-title-content>a:after{bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-dropdown-menu-item,.ant-dropdown-menu-submenu-title{clear:both;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-weight:400;line-height:22px;margin:0;padding:5px 12px;transition:all .3s}.ant-dropdown-menu-item-selected,.ant-dropdown-menu-submenu-title-selected{background-color:#e6f7ff;color:#1890ff}.ant-dropdown-menu-item.ant-dropdown-menu-item-active,.ant-dropdown-menu-item.ant-dropdown-menu-submenu-title-active,.ant-dropdown-menu-item:hover,.ant-dropdown-menu-submenu-title.ant-dropdown-menu-item-active,.ant-dropdown-menu-submenu-title.ant-dropdown-menu-submenu-title-active,.ant-dropdown-menu-submenu-title:hover{background-color:#f5f5f5}.ant-dropdown-menu-item-disabled,.ant-dropdown-menu-submenu-title-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-dropdown-menu-item-disabled:hover,.ant-dropdown-menu-submenu-title-disabled:hover{background-color:#fff;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-dropdown-menu-item-disabled a,.ant-dropdown-menu-submenu-title-disabled a{pointer-events:none}.ant-dropdown-menu-item-divider,.ant-dropdown-menu-submenu-title-divider{background-color:#f0f0f0;height:1px;line-height:0;margin:4px 0;overflow:hidden}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon{position:absolute;right:8px}.ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon,.ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon{color:rgba(0,0,0,.45);font-size:10px;font-style:normal;margin-right:0!important}.ant-dropdown-menu-item-group-list{list-style:none;margin:0 8px;padding:0}.ant-dropdown-menu-submenu-title{padding-right:24px}.ant-dropdown-menu-submenu-vertical{position:relative}.ant-dropdown-menu-submenu-vertical>.ant-dropdown-menu{left:100%;margin-left:4px;min-width:100%;position:absolute;top:0;transform-origin:0 0}.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title,.ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-disabled .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow-icon{background-color:#fff;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-dropdown-menu-submenu-selected .ant-dropdown-menu-submenu-title{color:#1890ff}.ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottom,.ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.ant-slide-down-appear.ant-slide-down-appear-active.ant-dropdown-placement-bottomRight,.ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottom,.ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.ant-slide-down-enter.ant-slide-down-enter-active.ant-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn}.ant-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-dropdown-placement-top,.ant-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-dropdown-placement-topLeft,.ant-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-dropdown-placement-topRight,.ant-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-dropdown-placement-top,.ant-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-dropdown-placement-topLeft,.ant-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-dropdown-placement-topRight{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn}.ant-dropdown.ant-slide-down-leave.ant-slide-down-leave-active.ant-dropdown-placement-bottom,.ant-dropdown.ant-slide-down-leave.ant-slide-down-leave-active.ant-dropdown-placement-bottomLeft,.ant-dropdown.ant-slide-down-leave.ant-slide-down-leave-active.ant-dropdown-placement-bottomRight{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut}.ant-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-dropdown-placement-top,.ant-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-dropdown-placement-topLeft,.ant-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-dropdown-placement-topRight{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut}.ant-dropdown-button>.anticon.anticon-down,.ant-dropdown-link>.anticon.anticon-down,.ant-dropdown-trigger>.anticon.anticon-down{font-size:10px;vertical-align:baseline}.ant-dropdown-button{white-space:nowrap}.ant-dropdown-button.ant-btn-group>.ant-btn-loading,.ant-dropdown-button.ant-btn-group>.ant-btn-loading+.ant-btn{cursor:default;pointer-events:none}.ant-dropdown-button.ant-btn-group>.ant-btn-loading+.ant-btn:before{display:block}.ant-dropdown-button.ant-btn-group>.ant-btn:last-child:not(:first-child):not(.ant-btn-icon-only){padding-left:8px;padding-right:8px}.ant-dropdown-menu-dark,.ant-dropdown-menu-dark .ant-dropdown-menu{background:#001529}.ant-dropdown-menu-dark .ant-dropdown-menu-item,.ant-dropdown-menu-dark .ant-dropdown-menu-item .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-item>.anticon+span>a,.ant-dropdown-menu-dark .ant-dropdown-menu-item>.anticon+span>a .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a .ant-dropdown-menu-submenu-arrow:after,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-arrow:after{color:hsla(0,0%,100%,.65)}.ant-dropdown-menu-dark .ant-dropdown-menu-item:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item>.anticon+span>a:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item>a:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-submenu-title:hover{background:transparent;color:#fff}.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected,.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected:hover,.ant-dropdown-menu-dark .ant-dropdown-menu-item-selected>a{background:#1890ff;color:#fff}.ant-dropdown-rtl{direction:rtl}.ant-dropdown-rtl.ant-dropdown:before{left:0;right:-7px}.ant-dropdown-menu-submenu-rtl .ant-dropdown-menu-item-group-title,.ant-dropdown-menu.ant-dropdown-menu-rtl,.ant-dropdown-rtl .ant-dropdown-menu-item-group-title{direction:rtl;text-align:right}.ant-dropdown-menu-submenu-popup.ant-dropdown-menu-submenu-rtl{transform-origin:100% 0}.ant-dropdown-rtl .ant-dropdown-menu-item,.ant-dropdown-rtl .ant-dropdown-menu-submenu-popup li,.ant-dropdown-rtl .ant-dropdown-menu-submenu-popup ul,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title{text-align:right}.ant-dropdown-rtl .ant-dropdown-menu-item>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-item>span>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title>.anticon:first-child,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title>span>.anticon:first-child{margin-left:8px;margin-right:0}.ant-dropdown-rtl .ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon{left:8px;right:auto}.ant-dropdown-rtl .ant-dropdown-menu-item .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon,.ant-dropdown-rtl .ant-dropdown-menu-submenu-title .ant-dropdown-menu-submenu-expand-icon .ant-dropdown-menu-submenu-arrow-icon{margin-left:0!important;transform:scaleX(-1)}.ant-dropdown-rtl .ant-dropdown-menu-submenu-title{padding-left:24px;padding-right:12px}.ant-dropdown-rtl .ant-dropdown-menu-submenu-vertical>.ant-dropdown-menu{left:0;margin-left:0;margin-right:4px;right:100%}.ant-empty{font-size:14px;line-height:1.5715;margin:0 8px;text-align:center}.ant-empty-image{height:100px;margin-bottom:8px}.ant-empty-image img{height:100%}.ant-empty-image svg{height:100%;margin:auto}.ant-empty-footer{margin-top:16px}.ant-empty-normal{color:rgba(0,0,0,.25);margin:32px 0}.ant-empty-normal .ant-empty-image{height:40px}.ant-empty-small{color:rgba(0,0,0,.25);margin:8px 0}.ant-empty-small .ant-empty-image{height:35px}.ant-empty-img-default-ellipse{fill:#f5f5f5;fill-opacity:.8}.ant-empty-img-default-path-1{fill:#aeb8c2}.ant-empty-img-default-path-2{fill:url(#linearGradient-1)}.ant-empty-img-default-path-3{fill:#f5f5f7}.ant-empty-img-default-path-4,.ant-empty-img-default-path-5{fill:#dce0e6}.ant-empty-img-default-g{fill:#fff}.ant-empty-img-simple-ellipse{fill:#f5f5f5}.ant-empty-img-simple-g{stroke:#d9d9d9}.ant-empty-img-simple-path{fill:#fafafa}.ant-empty-rtl{direction:rtl}.ant-form-item .ant-input-number+.ant-form-text{margin-left:8px}.ant-form-inline{display:flex;flex-wrap:wrap}.ant-form-inline .ant-form-item{flex:none;flex-wrap:nowrap;margin-bottom:0;margin-right:16px}.ant-form-inline .ant-form-item-with-help{margin-bottom:24px}.ant-form-inline .ant-form-item>.ant-form-item-control,.ant-form-inline .ant-form-item>.ant-form-item-label{display:inline-block;vertical-align:top}.ant-form-inline .ant-form-item>.ant-form-item-label{flex:none}.ant-form-inline .ant-form-item .ant-form-item-has-feedback,.ant-form-inline .ant-form-item .ant-form-text{display:inline-block}.ant-form-horizontal .ant-form-item-label{flex-grow:0}.ant-form-horizontal .ant-form-item-control{flex:1 1 0;min-width:0}.ant-form-horizontal .ant-form-item-label[class$="-24"]+.ant-form-item-control,.ant-form-horizontal .ant-form-item-label[class*="-24 "]+.ant-form-item-control{min-width:unset}.ant-form-vertical .ant-form-item{flex-direction:column}.ant-form-vertical .ant-form-item-label>label{height:auto}.ant-col-24.ant-form-item-label,.ant-col-xl-24.ant-form-item-label,.ant-form-vertical .ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-24.ant-form-item-label>label,.ant-col-xl-24.ant-form-item-label>label,.ant-form-vertical .ant-form-item-label>label{margin:0}.ant-col-24.ant-form-item-label>label:after,.ant-col-xl-24.ant-form-item-label>label:after,.ant-form-vertical .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-24.ant-form-item-label,.ant-form-rtl.ant-col-xl-24.ant-form-item-label,.ant-form-rtl.ant-form-vertical .ant-form-item-label{text-align:right}@media(max-width:575px){.ant-form-item .ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-form-item .ant-form-item-label>label{margin:0}.ant-form-item .ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-form-item .ant-form-item-label{text-align:right}.ant-form .ant-form-item{flex-wrap:wrap}.ant-form .ant-form-item .ant-form-item-control,.ant-form .ant-form-item .ant-form-item-label{flex:0 0 100%;max-width:100%}.ant-col-xs-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-xs-24.ant-form-item-label>label{margin:0}.ant-col-xs-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xs-24.ant-form-item-label{text-align:right}}@media(max-width:767px){.ant-col-sm-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-sm-24.ant-form-item-label>label{margin:0}.ant-col-sm-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-sm-24.ant-form-item-label{text-align:right}}@media(max-width:991px){.ant-col-md-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-md-24.ant-form-item-label>label{margin:0}.ant-col-md-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-md-24.ant-form-item-label{text-align:right}}@media(max-width:1199px){.ant-col-lg-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-lg-24.ant-form-item-label>label{margin:0}.ant-col-lg-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-lg-24.ant-form-item-label{text-align:right}}@media(max-width:1599px){.ant-col-xl-24.ant-form-item-label{line-height:1.5715;padding:0 0 8px;text-align:left;white-space:normal}.ant-col-xl-24.ant-form-item-label>label{margin:0}.ant-col-xl-24.ant-form-item-label>label:after{display:none}.ant-form-rtl.ant-col-xl-24.ant-form-item-label{text-align:right}}.ant-form-item-explain-error{color:#ff4d4f}.ant-form-item-explain-warning{color:#faad14}.ant-form-item-has-feedback .ant-switch{margin:2px 0 4px}.ant-form-item-has-warning .ant-form-item-split{color:#faad14}.ant-form-item-has-error .ant-form-item-split{color:#ff4d4f}.ant-form{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-form legend{border:0;border-bottom:1px solid #d9d9d9;color:rgba(0,0,0,.45);display:block;font-size:16px;line-height:inherit;margin-bottom:20px;padding:0;width:100%}.ant-form label{font-size:14px}.ant-form input[type=search]{box-sizing:border-box}.ant-form input[type=checkbox],.ant-form input[type=radio]{line-height:normal}.ant-form input[type=file]{display:block}.ant-form input[type=range]{display:block;width:100%}.ant-form select[multiple],.ant-form select[size]{height:auto}.ant-form input[type=checkbox]:focus,.ant-form input[type=file]:focus,.ant-form input[type=radio]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.ant-form output{color:rgba(0,0,0,.85);display:block;font-size:14px;line-height:1.5715;padding-top:15px}.ant-form .ant-form-text{display:inline-block;padding-right:8px}.ant-form-small .ant-form-item-label>label{height:24px}.ant-form-small .ant-form-item-control-input{min-height:24px}.ant-form-large .ant-form-item-label>label{height:40px}.ant-form-large .ant-form-item-control-input{min-height:40px}.ant-form-item{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 0 24px;padding:0;transition:margin-bottom .3s linear 17ms;vertical-align:top}.ant-form-item-with-help{margin-bottom:0;transition:none}.ant-form-item-hidden,.ant-form-item-hidden.ant-row{display:none}.ant-form-item-label{display:inline-block;flex-grow:0;overflow:hidden;text-align:right;vertical-align:middle;white-space:nowrap}.ant-form-item-label-left{text-align:left}.ant-form-item-label-wrap{line-height:1.3215em;overflow:unset;white-space:unset}.ant-form-item-label>label{align-items:center;color:rgba(0,0,0,.85);display:inline-flex;font-size:14px;height:32px;max-width:100%;position:relative}.ant-form-item-label>label>.anticon{font-size:14px;vertical-align:top}.ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{color:#ff4d4f;content:"*";display:inline-block;font-family:SimSun,sans-serif;font-size:14px;line-height:1;margin-right:4px}.ant-form-hide-required-mark .ant-form-item-label>label.ant-form-item-required:not(.ant-form-item-required-mark-optional):before{display:none}.ant-form-item-label>label .ant-form-item-optional{color:rgba(0,0,0,.45);display:inline-block;margin-left:4px}.ant-form-hide-required-mark .ant-form-item-label>label .ant-form-item-optional{display:none}.ant-form-item-label>label .ant-form-item-tooltip{-webkit-margin-start:4px;color:rgba(0,0,0,.45);cursor:help;margin-inline-start:4px;-ms-writing-mode:lr-tb;writing-mode:horizontal-tb}.ant-form-item-label>label:after{content:":";margin:0 8px 0 2px;position:relative;top:-.5px}.ant-form-item-label>label.ant-form-item-no-colon:after{content:" "}.ant-form-item-control{display:flex;flex-direction:column;flex-grow:1}.ant-form-item-control:first-child:not([class^=ant-col-]):not([class*=" ant-col-"]){width:100%}.ant-form-item-control-input{align-items:center;display:flex;min-height:32px;position:relative}.ant-form-item-control-input-content{flex:auto;max-width:100%}.ant-form-item-explain,.ant-form-item-extra{clear:both;color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715;transition:color .3s cubic-bezier(.215,.61,.355,1)}.ant-form-item-explain-connected{height:0;min-height:0;opacity:0}.ant-form-item-extra{min-height:24px}.ant-form-item-with-help .ant-form-item-explain{height:auto;min-height:24px;opacity:1}.ant-form-item-feedback-icon{-webkit-animation:zoomIn .3s cubic-bezier(.12,.4,.29,1.46);animation:zoomIn .3s cubic-bezier(.12,.4,.29,1.46);font-size:14px;pointer-events:none;text-align:center;visibility:visible}.ant-form-item-feedback-icon-success{color:#52c41a}.ant-form-item-feedback-icon-error{color:#ff4d4f}.ant-form-item-feedback-icon-warning{color:#faad14}.ant-form-item-feedback-icon-validating{color:#1890ff}.ant-show-help{transition:height .3s linear,min-height .3s linear,margin-bottom .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1)}.ant-show-help-leave{min-height:24px}.ant-show-help-leave-active{min-height:0}.ant-show-help-item{overflow:hidden;transition:height .3s cubic-bezier(.645,.045,.355,1),opacity .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1)!important}.ant-show-help-item-appear,.ant-show-help-item-enter{opacity:0;transform:translateY(-5px)}.ant-show-help-item-appear-active,.ant-show-help-item-enter-active{opacity:1;transform:translateY(0)}.ant-show-help-item-leave-active{transform:translateY(-5px)}@-webkit-keyframes diffZoomIn1{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn1{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@-webkit-keyframes diffZoomIn2{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn2{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@-webkit-keyframes diffZoomIn3{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}@keyframes diffZoomIn3{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}.ant-form-rtl{direction:rtl}.ant-form-rtl .ant-form-item-label{text-align:left}.ant-form-rtl .ant-form-item-label>label.ant-form-item-required:before{margin-left:4px;margin-right:0}.ant-form-rtl .ant-form-item-label>label:after{margin:0 2px 0 8px}.ant-form-rtl .ant-form-item-label>label .ant-form-item-optional{margin-left:0;margin-right:4px}.ant-col-rtl .ant-form-item-control:first-child{width:100%}.ant-form-rtl .ant-form-item-has-feedback .ant-input{padding-left:24px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input-suffix{padding-left:18px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-input-affix-wrapper .ant-input,.ant-form-rtl .ant-form-item-has-feedback .ant-input-number-affix-wrapper .ant-input-number{padding:0}.ant-form-rtl .ant-form-item-has-feedback .ant-input-search:not(.ant-input-search-enter-button) .ant-input-suffix{left:28px;right:auto}.ant-form-rtl .ant-form-item-has-feedback .ant-input-number{padding-left:18px}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-clear,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-clear,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-arrow,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-clear{left:32px;right:auto}.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback :not(.ant-input-number-group-addon)>.ant-select .ant-select-selection-selected-value,.ant-form-rtl .ant-form-item-has-feedback>.ant-select .ant-select-selection-selected-value{padding-left:42px;padding-right:0}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-arrow{margin-left:19px;margin-right:0}.ant-form-rtl .ant-form-item-has-feedback .ant-cascader-picker-clear{left:32px;right:auto}.ant-form-rtl .ant-form-item-has-feedback .ant-picker,.ant-form-rtl .ant-form-item-has-feedback .ant-picker-large{padding-left:29.2px;padding-right:11px}.ant-form-rtl .ant-form-item-has-feedback .ant-picker-small{padding-left:25.2px;padding-right:7px}.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-error .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-success .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-has-warning .ant-form-item-children-icon,.ant-form-rtl .ant-form-item-has-feedback.ant-form-item-is-validating .ant-form-item-children-icon{left:0;right:auto}.ant-form-rtl.ant-form-inline .ant-form-item{margin-left:16px;margin-right:0}.ant-row{flex-flow:row wrap}.ant-row,.ant-row:after,.ant-row:before{display:flex}.ant-row-no-wrap{flex-wrap:nowrap}.ant-row-start{justify-content:flex-start}.ant-row-center{justify-content:center}.ant-row-end{justify-content:flex-end}.ant-row-space-between{justify-content:space-between}.ant-row-space-around{justify-content:space-around}.ant-row-space-evenly{justify-content:space-evenly}.ant-row-top{align-items:flex-start}.ant-row-middle{align-items:center}.ant-row-bottom{align-items:flex-end}.ant-col{max-width:100%;min-height:1px;position:relative}.ant-col-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-push-24{left:100%}.ant-col-pull-24{right:100%}.ant-col-offset-24{margin-left:100%}.ant-col-order-24{order:24}.ant-col-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-push-23{left:95.83333333%}.ant-col-pull-23{right:95.83333333%}.ant-col-offset-23{margin-left:95.83333333%}.ant-col-order-23{order:23}.ant-col-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-push-22{left:91.66666667%}.ant-col-pull-22{right:91.66666667%}.ant-col-offset-22{margin-left:91.66666667%}.ant-col-order-22{order:22}.ant-col-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-push-21{left:87.5%}.ant-col-pull-21{right:87.5%}.ant-col-offset-21{margin-left:87.5%}.ant-col-order-21{order:21}.ant-col-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-push-20{left:83.33333333%}.ant-col-pull-20{right:83.33333333%}.ant-col-offset-20{margin-left:83.33333333%}.ant-col-order-20{order:20}.ant-col-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-push-19{left:79.16666667%}.ant-col-pull-19{right:79.16666667%}.ant-col-offset-19{margin-left:79.16666667%}.ant-col-order-19{order:19}.ant-col-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-push-18{left:75%}.ant-col-pull-18{right:75%}.ant-col-offset-18{margin-left:75%}.ant-col-order-18{order:18}.ant-col-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-push-17{left:70.83333333%}.ant-col-pull-17{right:70.83333333%}.ant-col-offset-17{margin-left:70.83333333%}.ant-col-order-17{order:17}.ant-col-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-push-16{left:66.66666667%}.ant-col-pull-16{right:66.66666667%}.ant-col-offset-16{margin-left:66.66666667%}.ant-col-order-16{order:16}.ant-col-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-push-15{left:62.5%}.ant-col-pull-15{right:62.5%}.ant-col-offset-15{margin-left:62.5%}.ant-col-order-15{order:15}.ant-col-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-push-14{left:58.33333333%}.ant-col-pull-14{right:58.33333333%}.ant-col-offset-14{margin-left:58.33333333%}.ant-col-order-14{order:14}.ant-col-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-push-13{left:54.16666667%}.ant-col-pull-13{right:54.16666667%}.ant-col-offset-13{margin-left:54.16666667%}.ant-col-order-13{order:13}.ant-col-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-push-12{left:50%}.ant-col-pull-12{right:50%}.ant-col-offset-12{margin-left:50%}.ant-col-order-12{order:12}.ant-col-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-push-11{left:45.83333333%}.ant-col-pull-11{right:45.83333333%}.ant-col-offset-11{margin-left:45.83333333%}.ant-col-order-11{order:11}.ant-col-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-push-10{left:41.66666667%}.ant-col-pull-10{right:41.66666667%}.ant-col-offset-10{margin-left:41.66666667%}.ant-col-order-10{order:10}.ant-col-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-push-9{left:37.5%}.ant-col-pull-9{right:37.5%}.ant-col-offset-9{margin-left:37.5%}.ant-col-order-9{order:9}.ant-col-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-push-8{left:33.33333333%}.ant-col-pull-8{right:33.33333333%}.ant-col-offset-8{margin-left:33.33333333%}.ant-col-order-8{order:8}.ant-col-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-push-7{left:29.16666667%}.ant-col-pull-7{right:29.16666667%}.ant-col-offset-7{margin-left:29.16666667%}.ant-col-order-7{order:7}.ant-col-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-push-6{left:25%}.ant-col-pull-6{right:25%}.ant-col-offset-6{margin-left:25%}.ant-col-order-6{order:6}.ant-col-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-push-5{left:20.83333333%}.ant-col-pull-5{right:20.83333333%}.ant-col-offset-5{margin-left:20.83333333%}.ant-col-order-5{order:5}.ant-col-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-push-4{left:16.66666667%}.ant-col-pull-4{right:16.66666667%}.ant-col-offset-4{margin-left:16.66666667%}.ant-col-order-4{order:4}.ant-col-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-push-3{left:12.5%}.ant-col-pull-3{right:12.5%}.ant-col-offset-3{margin-left:12.5%}.ant-col-order-3{order:3}.ant-col-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-push-2{left:8.33333333%}.ant-col-pull-2{right:8.33333333%}.ant-col-offset-2{margin-left:8.33333333%}.ant-col-order-2{order:2}.ant-col-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-push-1{left:4.16666667%}.ant-col-pull-1{right:4.16666667%}.ant-col-offset-1{margin-left:4.16666667%}.ant-col-order-1{order:1}.ant-col-0{display:none}.ant-col-offset-0{margin-left:0}.ant-col-order-0{order:0}.ant-col-offset-0.ant-col-rtl{margin-right:0}.ant-col-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}.ant-col-xs-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-xs-push-24{left:100%}.ant-col-xs-pull-24{right:100%}.ant-col-xs-offset-24{margin-left:100%}.ant-col-xs-order-24{order:24}.ant-col-xs-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xs-push-23{left:95.83333333%}.ant-col-xs-pull-23{right:95.83333333%}.ant-col-xs-offset-23{margin-left:95.83333333%}.ant-col-xs-order-23{order:23}.ant-col-xs-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xs-push-22{left:91.66666667%}.ant-col-xs-pull-22{right:91.66666667%}.ant-col-xs-offset-22{margin-left:91.66666667%}.ant-col-xs-order-22{order:22}.ant-col-xs-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-xs-push-21{left:87.5%}.ant-col-xs-pull-21{right:87.5%}.ant-col-xs-offset-21{margin-left:87.5%}.ant-col-xs-order-21{order:21}.ant-col-xs-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xs-push-20{left:83.33333333%}.ant-col-xs-pull-20{right:83.33333333%}.ant-col-xs-offset-20{margin-left:83.33333333%}.ant-col-xs-order-20{order:20}.ant-col-xs-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xs-push-19{left:79.16666667%}.ant-col-xs-pull-19{right:79.16666667%}.ant-col-xs-offset-19{margin-left:79.16666667%}.ant-col-xs-order-19{order:19}.ant-col-xs-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-xs-push-18{left:75%}.ant-col-xs-pull-18{right:75%}.ant-col-xs-offset-18{margin-left:75%}.ant-col-xs-order-18{order:18}.ant-col-xs-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xs-push-17{left:70.83333333%}.ant-col-xs-pull-17{right:70.83333333%}.ant-col-xs-offset-17{margin-left:70.83333333%}.ant-col-xs-order-17{order:17}.ant-col-xs-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xs-push-16{left:66.66666667%}.ant-col-xs-pull-16{right:66.66666667%}.ant-col-xs-offset-16{margin-left:66.66666667%}.ant-col-xs-order-16{order:16}.ant-col-xs-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-xs-push-15{left:62.5%}.ant-col-xs-pull-15{right:62.5%}.ant-col-xs-offset-15{margin-left:62.5%}.ant-col-xs-order-15{order:15}.ant-col-xs-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xs-push-14{left:58.33333333%}.ant-col-xs-pull-14{right:58.33333333%}.ant-col-xs-offset-14{margin-left:58.33333333%}.ant-col-xs-order-14{order:14}.ant-col-xs-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xs-push-13{left:54.16666667%}.ant-col-xs-pull-13{right:54.16666667%}.ant-col-xs-offset-13{margin-left:54.16666667%}.ant-col-xs-order-13{order:13}.ant-col-xs-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-xs-push-12{left:50%}.ant-col-xs-pull-12{right:50%}.ant-col-xs-offset-12{margin-left:50%}.ant-col-xs-order-12{order:12}.ant-col-xs-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xs-push-11{left:45.83333333%}.ant-col-xs-pull-11{right:45.83333333%}.ant-col-xs-offset-11{margin-left:45.83333333%}.ant-col-xs-order-11{order:11}.ant-col-xs-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xs-push-10{left:41.66666667%}.ant-col-xs-pull-10{right:41.66666667%}.ant-col-xs-offset-10{margin-left:41.66666667%}.ant-col-xs-order-10{order:10}.ant-col-xs-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-xs-push-9{left:37.5%}.ant-col-xs-pull-9{right:37.5%}.ant-col-xs-offset-9{margin-left:37.5%}.ant-col-xs-order-9{order:9}.ant-col-xs-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xs-push-8{left:33.33333333%}.ant-col-xs-pull-8{right:33.33333333%}.ant-col-xs-offset-8{margin-left:33.33333333%}.ant-col-xs-order-8{order:8}.ant-col-xs-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xs-push-7{left:29.16666667%}.ant-col-xs-pull-7{right:29.16666667%}.ant-col-xs-offset-7{margin-left:29.16666667%}.ant-col-xs-order-7{order:7}.ant-col-xs-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-xs-push-6{left:25%}.ant-col-xs-pull-6{right:25%}.ant-col-xs-offset-6{margin-left:25%}.ant-col-xs-order-6{order:6}.ant-col-xs-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xs-push-5{left:20.83333333%}.ant-col-xs-pull-5{right:20.83333333%}.ant-col-xs-offset-5{margin-left:20.83333333%}.ant-col-xs-order-5{order:5}.ant-col-xs-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xs-push-4{left:16.66666667%}.ant-col-xs-pull-4{right:16.66666667%}.ant-col-xs-offset-4{margin-left:16.66666667%}.ant-col-xs-order-4{order:4}.ant-col-xs-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-xs-push-3{left:12.5%}.ant-col-xs-pull-3{right:12.5%}.ant-col-xs-offset-3{margin-left:12.5%}.ant-col-xs-order-3{order:3}.ant-col-xs-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xs-push-2{left:8.33333333%}.ant-col-xs-pull-2{right:8.33333333%}.ant-col-xs-offset-2{margin-left:8.33333333%}.ant-col-xs-order-2{order:2}.ant-col-xs-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xs-push-1{left:4.16666667%}.ant-col-xs-pull-1{right:4.16666667%}.ant-col-xs-offset-1{margin-left:4.16666667%}.ant-col-xs-order-1{order:1}.ant-col-xs-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xs-push-0{left:auto}.ant-col-xs-pull-0{right:auto}.ant-col-xs-offset-0{margin-left:0}.ant-col-xs-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xs-push-0.ant-col-rtl{right:auto}.ant-col-xs-pull-0.ant-col-rtl{left:auto}.ant-col-xs-offset-0.ant-col-rtl{margin-right:0}.ant-col-xs-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-xs-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-xs-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-xs-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-xs-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-xs-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-xs-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-xs-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-xs-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-xs-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-xs-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-xs-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-xs-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-xs-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-xs-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-xs-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-xs-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-xs-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-xs-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-xs-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-xs-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-xs-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-xs-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-xs-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-xs-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-xs-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-xs-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-xs-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-xs-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-xs-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-xs-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-xs-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-xs-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-xs-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-xs-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-xs-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-xs-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-xs-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-xs-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-xs-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-xs-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-xs-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-xs-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-xs-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-xs-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-xs-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-xs-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-xs-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-xs-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-xs-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-xs-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-xs-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-xs-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-xs-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-xs-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-xs-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-xs-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-xs-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-xs-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-xs-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-xs-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-xs-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-xs-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-xs-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-xs-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-xs-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-xs-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-xs-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-xs-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-xs-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-xs-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-xs-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}@media(min-width:576px){.ant-col-sm-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-sm-push-24{left:100%}.ant-col-sm-pull-24{right:100%}.ant-col-sm-offset-24{margin-left:100%}.ant-col-sm-order-24{order:24}.ant-col-sm-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-sm-push-23{left:95.83333333%}.ant-col-sm-pull-23{right:95.83333333%}.ant-col-sm-offset-23{margin-left:95.83333333%}.ant-col-sm-order-23{order:23}.ant-col-sm-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-sm-push-22{left:91.66666667%}.ant-col-sm-pull-22{right:91.66666667%}.ant-col-sm-offset-22{margin-left:91.66666667%}.ant-col-sm-order-22{order:22}.ant-col-sm-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-sm-push-21{left:87.5%}.ant-col-sm-pull-21{right:87.5%}.ant-col-sm-offset-21{margin-left:87.5%}.ant-col-sm-order-21{order:21}.ant-col-sm-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-sm-push-20{left:83.33333333%}.ant-col-sm-pull-20{right:83.33333333%}.ant-col-sm-offset-20{margin-left:83.33333333%}.ant-col-sm-order-20{order:20}.ant-col-sm-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-sm-push-19{left:79.16666667%}.ant-col-sm-pull-19{right:79.16666667%}.ant-col-sm-offset-19{margin-left:79.16666667%}.ant-col-sm-order-19{order:19}.ant-col-sm-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-sm-push-18{left:75%}.ant-col-sm-pull-18{right:75%}.ant-col-sm-offset-18{margin-left:75%}.ant-col-sm-order-18{order:18}.ant-col-sm-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-sm-push-17{left:70.83333333%}.ant-col-sm-pull-17{right:70.83333333%}.ant-col-sm-offset-17{margin-left:70.83333333%}.ant-col-sm-order-17{order:17}.ant-col-sm-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-sm-push-16{left:66.66666667%}.ant-col-sm-pull-16{right:66.66666667%}.ant-col-sm-offset-16{margin-left:66.66666667%}.ant-col-sm-order-16{order:16}.ant-col-sm-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-sm-push-15{left:62.5%}.ant-col-sm-pull-15{right:62.5%}.ant-col-sm-offset-15{margin-left:62.5%}.ant-col-sm-order-15{order:15}.ant-col-sm-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-sm-push-14{left:58.33333333%}.ant-col-sm-pull-14{right:58.33333333%}.ant-col-sm-offset-14{margin-left:58.33333333%}.ant-col-sm-order-14{order:14}.ant-col-sm-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-sm-push-13{left:54.16666667%}.ant-col-sm-pull-13{right:54.16666667%}.ant-col-sm-offset-13{margin-left:54.16666667%}.ant-col-sm-order-13{order:13}.ant-col-sm-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-sm-push-12{left:50%}.ant-col-sm-pull-12{right:50%}.ant-col-sm-offset-12{margin-left:50%}.ant-col-sm-order-12{order:12}.ant-col-sm-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-sm-push-11{left:45.83333333%}.ant-col-sm-pull-11{right:45.83333333%}.ant-col-sm-offset-11{margin-left:45.83333333%}.ant-col-sm-order-11{order:11}.ant-col-sm-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-sm-push-10{left:41.66666667%}.ant-col-sm-pull-10{right:41.66666667%}.ant-col-sm-offset-10{margin-left:41.66666667%}.ant-col-sm-order-10{order:10}.ant-col-sm-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-sm-push-9{left:37.5%}.ant-col-sm-pull-9{right:37.5%}.ant-col-sm-offset-9{margin-left:37.5%}.ant-col-sm-order-9{order:9}.ant-col-sm-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-sm-push-8{left:33.33333333%}.ant-col-sm-pull-8{right:33.33333333%}.ant-col-sm-offset-8{margin-left:33.33333333%}.ant-col-sm-order-8{order:8}.ant-col-sm-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-sm-push-7{left:29.16666667%}.ant-col-sm-pull-7{right:29.16666667%}.ant-col-sm-offset-7{margin-left:29.16666667%}.ant-col-sm-order-7{order:7}.ant-col-sm-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-sm-push-6{left:25%}.ant-col-sm-pull-6{right:25%}.ant-col-sm-offset-6{margin-left:25%}.ant-col-sm-order-6{order:6}.ant-col-sm-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-sm-push-5{left:20.83333333%}.ant-col-sm-pull-5{right:20.83333333%}.ant-col-sm-offset-5{margin-left:20.83333333%}.ant-col-sm-order-5{order:5}.ant-col-sm-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-sm-push-4{left:16.66666667%}.ant-col-sm-pull-4{right:16.66666667%}.ant-col-sm-offset-4{margin-left:16.66666667%}.ant-col-sm-order-4{order:4}.ant-col-sm-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-sm-push-3{left:12.5%}.ant-col-sm-pull-3{right:12.5%}.ant-col-sm-offset-3{margin-left:12.5%}.ant-col-sm-order-3{order:3}.ant-col-sm-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-sm-push-2{left:8.33333333%}.ant-col-sm-pull-2{right:8.33333333%}.ant-col-sm-offset-2{margin-left:8.33333333%}.ant-col-sm-order-2{order:2}.ant-col-sm-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-sm-push-1{left:4.16666667%}.ant-col-sm-pull-1{right:4.16666667%}.ant-col-sm-offset-1{margin-left:4.16666667%}.ant-col-sm-order-1{order:1}.ant-col-sm-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-sm-push-0{left:auto}.ant-col-sm-pull-0{right:auto}.ant-col-sm-offset-0{margin-left:0}.ant-col-sm-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-sm-push-0.ant-col-rtl{right:auto}.ant-col-sm-pull-0.ant-col-rtl{left:auto}.ant-col-sm-offset-0.ant-col-rtl{margin-right:0}.ant-col-sm-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-sm-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-sm-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-sm-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-sm-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-sm-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-sm-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-sm-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-sm-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-sm-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-sm-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-sm-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-sm-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-sm-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-sm-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-sm-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-sm-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-sm-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-sm-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-sm-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-sm-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-sm-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-sm-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-sm-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-sm-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-sm-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-sm-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-sm-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-sm-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-sm-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-sm-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-sm-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-sm-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-sm-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-sm-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-sm-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-sm-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-sm-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-sm-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-sm-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-sm-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-sm-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-sm-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-sm-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-sm-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-sm-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-sm-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-sm-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-sm-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-sm-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-sm-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-sm-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-sm-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-sm-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-sm-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-sm-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-sm-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-sm-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-sm-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-sm-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-sm-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-sm-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-sm-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-sm-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-sm-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-sm-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-sm-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-sm-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-sm-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-sm-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-sm-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-sm-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}@media(min-width:768px){.ant-col-md-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-md-push-24{left:100%}.ant-col-md-pull-24{right:100%}.ant-col-md-offset-24{margin-left:100%}.ant-col-md-order-24{order:24}.ant-col-md-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-md-push-23{left:95.83333333%}.ant-col-md-pull-23{right:95.83333333%}.ant-col-md-offset-23{margin-left:95.83333333%}.ant-col-md-order-23{order:23}.ant-col-md-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-md-push-22{left:91.66666667%}.ant-col-md-pull-22{right:91.66666667%}.ant-col-md-offset-22{margin-left:91.66666667%}.ant-col-md-order-22{order:22}.ant-col-md-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-md-push-21{left:87.5%}.ant-col-md-pull-21{right:87.5%}.ant-col-md-offset-21{margin-left:87.5%}.ant-col-md-order-21{order:21}.ant-col-md-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-md-push-20{left:83.33333333%}.ant-col-md-pull-20{right:83.33333333%}.ant-col-md-offset-20{margin-left:83.33333333%}.ant-col-md-order-20{order:20}.ant-col-md-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-md-push-19{left:79.16666667%}.ant-col-md-pull-19{right:79.16666667%}.ant-col-md-offset-19{margin-left:79.16666667%}.ant-col-md-order-19{order:19}.ant-col-md-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-md-push-18{left:75%}.ant-col-md-pull-18{right:75%}.ant-col-md-offset-18{margin-left:75%}.ant-col-md-order-18{order:18}.ant-col-md-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-md-push-17{left:70.83333333%}.ant-col-md-pull-17{right:70.83333333%}.ant-col-md-offset-17{margin-left:70.83333333%}.ant-col-md-order-17{order:17}.ant-col-md-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-md-push-16{left:66.66666667%}.ant-col-md-pull-16{right:66.66666667%}.ant-col-md-offset-16{margin-left:66.66666667%}.ant-col-md-order-16{order:16}.ant-col-md-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-md-push-15{left:62.5%}.ant-col-md-pull-15{right:62.5%}.ant-col-md-offset-15{margin-left:62.5%}.ant-col-md-order-15{order:15}.ant-col-md-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-md-push-14{left:58.33333333%}.ant-col-md-pull-14{right:58.33333333%}.ant-col-md-offset-14{margin-left:58.33333333%}.ant-col-md-order-14{order:14}.ant-col-md-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-md-push-13{left:54.16666667%}.ant-col-md-pull-13{right:54.16666667%}.ant-col-md-offset-13{margin-left:54.16666667%}.ant-col-md-order-13{order:13}.ant-col-md-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-md-push-12{left:50%}.ant-col-md-pull-12{right:50%}.ant-col-md-offset-12{margin-left:50%}.ant-col-md-order-12{order:12}.ant-col-md-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-md-push-11{left:45.83333333%}.ant-col-md-pull-11{right:45.83333333%}.ant-col-md-offset-11{margin-left:45.83333333%}.ant-col-md-order-11{order:11}.ant-col-md-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-md-push-10{left:41.66666667%}.ant-col-md-pull-10{right:41.66666667%}.ant-col-md-offset-10{margin-left:41.66666667%}.ant-col-md-order-10{order:10}.ant-col-md-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-md-push-9{left:37.5%}.ant-col-md-pull-9{right:37.5%}.ant-col-md-offset-9{margin-left:37.5%}.ant-col-md-order-9{order:9}.ant-col-md-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-md-push-8{left:33.33333333%}.ant-col-md-pull-8{right:33.33333333%}.ant-col-md-offset-8{margin-left:33.33333333%}.ant-col-md-order-8{order:8}.ant-col-md-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-md-push-7{left:29.16666667%}.ant-col-md-pull-7{right:29.16666667%}.ant-col-md-offset-7{margin-left:29.16666667%}.ant-col-md-order-7{order:7}.ant-col-md-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-md-push-6{left:25%}.ant-col-md-pull-6{right:25%}.ant-col-md-offset-6{margin-left:25%}.ant-col-md-order-6{order:6}.ant-col-md-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-md-push-5{left:20.83333333%}.ant-col-md-pull-5{right:20.83333333%}.ant-col-md-offset-5{margin-left:20.83333333%}.ant-col-md-order-5{order:5}.ant-col-md-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-md-push-4{left:16.66666667%}.ant-col-md-pull-4{right:16.66666667%}.ant-col-md-offset-4{margin-left:16.66666667%}.ant-col-md-order-4{order:4}.ant-col-md-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-md-push-3{left:12.5%}.ant-col-md-pull-3{right:12.5%}.ant-col-md-offset-3{margin-left:12.5%}.ant-col-md-order-3{order:3}.ant-col-md-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-md-push-2{left:8.33333333%}.ant-col-md-pull-2{right:8.33333333%}.ant-col-md-offset-2{margin-left:8.33333333%}.ant-col-md-order-2{order:2}.ant-col-md-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-md-push-1{left:4.16666667%}.ant-col-md-pull-1{right:4.16666667%}.ant-col-md-offset-1{margin-left:4.16666667%}.ant-col-md-order-1{order:1}.ant-col-md-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-md-push-0{left:auto}.ant-col-md-pull-0{right:auto}.ant-col-md-offset-0{margin-left:0}.ant-col-md-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-md-push-0.ant-col-rtl{right:auto}.ant-col-md-pull-0.ant-col-rtl{left:auto}.ant-col-md-offset-0.ant-col-rtl{margin-right:0}.ant-col-md-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-md-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-md-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-md-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-md-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-md-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-md-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-md-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-md-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-md-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-md-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-md-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-md-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-md-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-md-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-md-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-md-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-md-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-md-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-md-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-md-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-md-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-md-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-md-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-md-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-md-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-md-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-md-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-md-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-md-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-md-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-md-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-md-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-md-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-md-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-md-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-md-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-md-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-md-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-md-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-md-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-md-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-md-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-md-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-md-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-md-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-md-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-md-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-md-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-md-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-md-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-md-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-md-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-md-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-md-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-md-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-md-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-md-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-md-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-md-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-md-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-md-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-md-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-md-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-md-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-md-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-md-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-md-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-md-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-md-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-md-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-md-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}@media(min-width:992px){.ant-col-lg-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-lg-push-24{left:100%}.ant-col-lg-pull-24{right:100%}.ant-col-lg-offset-24{margin-left:100%}.ant-col-lg-order-24{order:24}.ant-col-lg-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-lg-push-23{left:95.83333333%}.ant-col-lg-pull-23{right:95.83333333%}.ant-col-lg-offset-23{margin-left:95.83333333%}.ant-col-lg-order-23{order:23}.ant-col-lg-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-lg-push-22{left:91.66666667%}.ant-col-lg-pull-22{right:91.66666667%}.ant-col-lg-offset-22{margin-left:91.66666667%}.ant-col-lg-order-22{order:22}.ant-col-lg-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-lg-push-21{left:87.5%}.ant-col-lg-pull-21{right:87.5%}.ant-col-lg-offset-21{margin-left:87.5%}.ant-col-lg-order-21{order:21}.ant-col-lg-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-lg-push-20{left:83.33333333%}.ant-col-lg-pull-20{right:83.33333333%}.ant-col-lg-offset-20{margin-left:83.33333333%}.ant-col-lg-order-20{order:20}.ant-col-lg-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-lg-push-19{left:79.16666667%}.ant-col-lg-pull-19{right:79.16666667%}.ant-col-lg-offset-19{margin-left:79.16666667%}.ant-col-lg-order-19{order:19}.ant-col-lg-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-lg-push-18{left:75%}.ant-col-lg-pull-18{right:75%}.ant-col-lg-offset-18{margin-left:75%}.ant-col-lg-order-18{order:18}.ant-col-lg-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-lg-push-17{left:70.83333333%}.ant-col-lg-pull-17{right:70.83333333%}.ant-col-lg-offset-17{margin-left:70.83333333%}.ant-col-lg-order-17{order:17}.ant-col-lg-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-lg-push-16{left:66.66666667%}.ant-col-lg-pull-16{right:66.66666667%}.ant-col-lg-offset-16{margin-left:66.66666667%}.ant-col-lg-order-16{order:16}.ant-col-lg-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-lg-push-15{left:62.5%}.ant-col-lg-pull-15{right:62.5%}.ant-col-lg-offset-15{margin-left:62.5%}.ant-col-lg-order-15{order:15}.ant-col-lg-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-lg-push-14{left:58.33333333%}.ant-col-lg-pull-14{right:58.33333333%}.ant-col-lg-offset-14{margin-left:58.33333333%}.ant-col-lg-order-14{order:14}.ant-col-lg-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-lg-push-13{left:54.16666667%}.ant-col-lg-pull-13{right:54.16666667%}.ant-col-lg-offset-13{margin-left:54.16666667%}.ant-col-lg-order-13{order:13}.ant-col-lg-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-lg-push-12{left:50%}.ant-col-lg-pull-12{right:50%}.ant-col-lg-offset-12{margin-left:50%}.ant-col-lg-order-12{order:12}.ant-col-lg-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-lg-push-11{left:45.83333333%}.ant-col-lg-pull-11{right:45.83333333%}.ant-col-lg-offset-11{margin-left:45.83333333%}.ant-col-lg-order-11{order:11}.ant-col-lg-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-lg-push-10{left:41.66666667%}.ant-col-lg-pull-10{right:41.66666667%}.ant-col-lg-offset-10{margin-left:41.66666667%}.ant-col-lg-order-10{order:10}.ant-col-lg-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-lg-push-9{left:37.5%}.ant-col-lg-pull-9{right:37.5%}.ant-col-lg-offset-9{margin-left:37.5%}.ant-col-lg-order-9{order:9}.ant-col-lg-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-lg-push-8{left:33.33333333%}.ant-col-lg-pull-8{right:33.33333333%}.ant-col-lg-offset-8{margin-left:33.33333333%}.ant-col-lg-order-8{order:8}.ant-col-lg-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-lg-push-7{left:29.16666667%}.ant-col-lg-pull-7{right:29.16666667%}.ant-col-lg-offset-7{margin-left:29.16666667%}.ant-col-lg-order-7{order:7}.ant-col-lg-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-lg-push-6{left:25%}.ant-col-lg-pull-6{right:25%}.ant-col-lg-offset-6{margin-left:25%}.ant-col-lg-order-6{order:6}.ant-col-lg-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-lg-push-5{left:20.83333333%}.ant-col-lg-pull-5{right:20.83333333%}.ant-col-lg-offset-5{margin-left:20.83333333%}.ant-col-lg-order-5{order:5}.ant-col-lg-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-lg-push-4{left:16.66666667%}.ant-col-lg-pull-4{right:16.66666667%}.ant-col-lg-offset-4{margin-left:16.66666667%}.ant-col-lg-order-4{order:4}.ant-col-lg-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-lg-push-3{left:12.5%}.ant-col-lg-pull-3{right:12.5%}.ant-col-lg-offset-3{margin-left:12.5%}.ant-col-lg-order-3{order:3}.ant-col-lg-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-lg-push-2{left:8.33333333%}.ant-col-lg-pull-2{right:8.33333333%}.ant-col-lg-offset-2{margin-left:8.33333333%}.ant-col-lg-order-2{order:2}.ant-col-lg-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-lg-push-1{left:4.16666667%}.ant-col-lg-pull-1{right:4.16666667%}.ant-col-lg-offset-1{margin-left:4.16666667%}.ant-col-lg-order-1{order:1}.ant-col-lg-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-lg-push-0{left:auto}.ant-col-lg-pull-0{right:auto}.ant-col-lg-offset-0{margin-left:0}.ant-col-lg-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-lg-push-0.ant-col-rtl{right:auto}.ant-col-lg-pull-0.ant-col-rtl{left:auto}.ant-col-lg-offset-0.ant-col-rtl{margin-right:0}.ant-col-lg-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-lg-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-lg-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-lg-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-lg-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-lg-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-lg-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-lg-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-lg-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-lg-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-lg-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-lg-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-lg-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-lg-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-lg-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-lg-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-lg-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-lg-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-lg-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-lg-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-lg-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-lg-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-lg-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-lg-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-lg-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-lg-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-lg-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-lg-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-lg-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-lg-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-lg-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-lg-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-lg-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-lg-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-lg-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-lg-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-lg-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-lg-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-lg-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-lg-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-lg-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-lg-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-lg-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-lg-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-lg-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-lg-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-lg-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-lg-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-lg-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-lg-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-lg-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-lg-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-lg-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-lg-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-lg-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-lg-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-lg-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-lg-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-lg-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-lg-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-lg-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-lg-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-lg-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-lg-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-lg-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-lg-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-lg-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-lg-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-lg-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-lg-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-lg-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-lg-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}@media(min-width:1200px){.ant-col-xl-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-xl-push-24{left:100%}.ant-col-xl-pull-24{right:100%}.ant-col-xl-offset-24{margin-left:100%}.ant-col-xl-order-24{order:24}.ant-col-xl-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xl-push-23{left:95.83333333%}.ant-col-xl-pull-23{right:95.83333333%}.ant-col-xl-offset-23{margin-left:95.83333333%}.ant-col-xl-order-23{order:23}.ant-col-xl-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xl-push-22{left:91.66666667%}.ant-col-xl-pull-22{right:91.66666667%}.ant-col-xl-offset-22{margin-left:91.66666667%}.ant-col-xl-order-22{order:22}.ant-col-xl-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-xl-push-21{left:87.5%}.ant-col-xl-pull-21{right:87.5%}.ant-col-xl-offset-21{margin-left:87.5%}.ant-col-xl-order-21{order:21}.ant-col-xl-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xl-push-20{left:83.33333333%}.ant-col-xl-pull-20{right:83.33333333%}.ant-col-xl-offset-20{margin-left:83.33333333%}.ant-col-xl-order-20{order:20}.ant-col-xl-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xl-push-19{left:79.16666667%}.ant-col-xl-pull-19{right:79.16666667%}.ant-col-xl-offset-19{margin-left:79.16666667%}.ant-col-xl-order-19{order:19}.ant-col-xl-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-xl-push-18{left:75%}.ant-col-xl-pull-18{right:75%}.ant-col-xl-offset-18{margin-left:75%}.ant-col-xl-order-18{order:18}.ant-col-xl-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xl-push-17{left:70.83333333%}.ant-col-xl-pull-17{right:70.83333333%}.ant-col-xl-offset-17{margin-left:70.83333333%}.ant-col-xl-order-17{order:17}.ant-col-xl-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xl-push-16{left:66.66666667%}.ant-col-xl-pull-16{right:66.66666667%}.ant-col-xl-offset-16{margin-left:66.66666667%}.ant-col-xl-order-16{order:16}.ant-col-xl-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-xl-push-15{left:62.5%}.ant-col-xl-pull-15{right:62.5%}.ant-col-xl-offset-15{margin-left:62.5%}.ant-col-xl-order-15{order:15}.ant-col-xl-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xl-push-14{left:58.33333333%}.ant-col-xl-pull-14{right:58.33333333%}.ant-col-xl-offset-14{margin-left:58.33333333%}.ant-col-xl-order-14{order:14}.ant-col-xl-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xl-push-13{left:54.16666667%}.ant-col-xl-pull-13{right:54.16666667%}.ant-col-xl-offset-13{margin-left:54.16666667%}.ant-col-xl-order-13{order:13}.ant-col-xl-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-xl-push-12{left:50%}.ant-col-xl-pull-12{right:50%}.ant-col-xl-offset-12{margin-left:50%}.ant-col-xl-order-12{order:12}.ant-col-xl-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xl-push-11{left:45.83333333%}.ant-col-xl-pull-11{right:45.83333333%}.ant-col-xl-offset-11{margin-left:45.83333333%}.ant-col-xl-order-11{order:11}.ant-col-xl-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xl-push-10{left:41.66666667%}.ant-col-xl-pull-10{right:41.66666667%}.ant-col-xl-offset-10{margin-left:41.66666667%}.ant-col-xl-order-10{order:10}.ant-col-xl-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-xl-push-9{left:37.5%}.ant-col-xl-pull-9{right:37.5%}.ant-col-xl-offset-9{margin-left:37.5%}.ant-col-xl-order-9{order:9}.ant-col-xl-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xl-push-8{left:33.33333333%}.ant-col-xl-pull-8{right:33.33333333%}.ant-col-xl-offset-8{margin-left:33.33333333%}.ant-col-xl-order-8{order:8}.ant-col-xl-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xl-push-7{left:29.16666667%}.ant-col-xl-pull-7{right:29.16666667%}.ant-col-xl-offset-7{margin-left:29.16666667%}.ant-col-xl-order-7{order:7}.ant-col-xl-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-xl-push-6{left:25%}.ant-col-xl-pull-6{right:25%}.ant-col-xl-offset-6{margin-left:25%}.ant-col-xl-order-6{order:6}.ant-col-xl-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xl-push-5{left:20.83333333%}.ant-col-xl-pull-5{right:20.83333333%}.ant-col-xl-offset-5{margin-left:20.83333333%}.ant-col-xl-order-5{order:5}.ant-col-xl-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xl-push-4{left:16.66666667%}.ant-col-xl-pull-4{right:16.66666667%}.ant-col-xl-offset-4{margin-left:16.66666667%}.ant-col-xl-order-4{order:4}.ant-col-xl-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-xl-push-3{left:12.5%}.ant-col-xl-pull-3{right:12.5%}.ant-col-xl-offset-3{margin-left:12.5%}.ant-col-xl-order-3{order:3}.ant-col-xl-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xl-push-2{left:8.33333333%}.ant-col-xl-pull-2{right:8.33333333%}.ant-col-xl-offset-2{margin-left:8.33333333%}.ant-col-xl-order-2{order:2}.ant-col-xl-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xl-push-1{left:4.16666667%}.ant-col-xl-pull-1{right:4.16666667%}.ant-col-xl-offset-1{margin-left:4.16666667%}.ant-col-xl-order-1{order:1}.ant-col-xl-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xl-push-0{left:auto}.ant-col-xl-pull-0{right:auto}.ant-col-xl-offset-0{margin-left:0}.ant-col-xl-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xl-push-0.ant-col-rtl{right:auto}.ant-col-xl-pull-0.ant-col-rtl{left:auto}.ant-col-xl-offset-0.ant-col-rtl{margin-right:0}.ant-col-xl-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-xl-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-xl-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-xl-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-xl-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-xl-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-xl-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-xl-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-xl-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-xl-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-xl-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-xl-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-xl-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-xl-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-xl-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-xl-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-xl-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-xl-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-xl-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-xl-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-xl-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-xl-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-xl-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-xl-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-xl-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-xl-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-xl-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-xl-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-xl-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-xl-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-xl-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-xl-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-xl-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-xl-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-xl-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-xl-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-xl-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-xl-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-xl-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-xl-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-xl-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-xl-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-xl-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-xl-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-xl-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-xl-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-xl-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-xl-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-xl-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-xl-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-xl-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-xl-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-xl-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-xl-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-xl-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-xl-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-xl-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-xl-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-xl-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-xl-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-xl-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-xl-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-xl-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-xl-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-xl-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-xl-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-xl-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-xl-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-xl-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-xl-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-xl-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-xl-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}@media(min-width:1600px){.ant-col-xxl-24{display:block;flex:0 0 100%;max-width:100%}.ant-col-xxl-push-24{left:100%}.ant-col-xxl-pull-24{right:100%}.ant-col-xxl-offset-24{margin-left:100%}.ant-col-xxl-order-24{order:24}.ant-col-xxl-23{display:block;flex:0 0 95.83333333%;max-width:95.83333333%}.ant-col-xxl-push-23{left:95.83333333%}.ant-col-xxl-pull-23{right:95.83333333%}.ant-col-xxl-offset-23{margin-left:95.83333333%}.ant-col-xxl-order-23{order:23}.ant-col-xxl-22{display:block;flex:0 0 91.66666667%;max-width:91.66666667%}.ant-col-xxl-push-22{left:91.66666667%}.ant-col-xxl-pull-22{right:91.66666667%}.ant-col-xxl-offset-22{margin-left:91.66666667%}.ant-col-xxl-order-22{order:22}.ant-col-xxl-21{display:block;flex:0 0 87.5%;max-width:87.5%}.ant-col-xxl-push-21{left:87.5%}.ant-col-xxl-pull-21{right:87.5%}.ant-col-xxl-offset-21{margin-left:87.5%}.ant-col-xxl-order-21{order:21}.ant-col-xxl-20{display:block;flex:0 0 83.33333333%;max-width:83.33333333%}.ant-col-xxl-push-20{left:83.33333333%}.ant-col-xxl-pull-20{right:83.33333333%}.ant-col-xxl-offset-20{margin-left:83.33333333%}.ant-col-xxl-order-20{order:20}.ant-col-xxl-19{display:block;flex:0 0 79.16666667%;max-width:79.16666667%}.ant-col-xxl-push-19{left:79.16666667%}.ant-col-xxl-pull-19{right:79.16666667%}.ant-col-xxl-offset-19{margin-left:79.16666667%}.ant-col-xxl-order-19{order:19}.ant-col-xxl-18{display:block;flex:0 0 75%;max-width:75%}.ant-col-xxl-push-18{left:75%}.ant-col-xxl-pull-18{right:75%}.ant-col-xxl-offset-18{margin-left:75%}.ant-col-xxl-order-18{order:18}.ant-col-xxl-17{display:block;flex:0 0 70.83333333%;max-width:70.83333333%}.ant-col-xxl-push-17{left:70.83333333%}.ant-col-xxl-pull-17{right:70.83333333%}.ant-col-xxl-offset-17{margin-left:70.83333333%}.ant-col-xxl-order-17{order:17}.ant-col-xxl-16{display:block;flex:0 0 66.66666667%;max-width:66.66666667%}.ant-col-xxl-push-16{left:66.66666667%}.ant-col-xxl-pull-16{right:66.66666667%}.ant-col-xxl-offset-16{margin-left:66.66666667%}.ant-col-xxl-order-16{order:16}.ant-col-xxl-15{display:block;flex:0 0 62.5%;max-width:62.5%}.ant-col-xxl-push-15{left:62.5%}.ant-col-xxl-pull-15{right:62.5%}.ant-col-xxl-offset-15{margin-left:62.5%}.ant-col-xxl-order-15{order:15}.ant-col-xxl-14{display:block;flex:0 0 58.33333333%;max-width:58.33333333%}.ant-col-xxl-push-14{left:58.33333333%}.ant-col-xxl-pull-14{right:58.33333333%}.ant-col-xxl-offset-14{margin-left:58.33333333%}.ant-col-xxl-order-14{order:14}.ant-col-xxl-13{display:block;flex:0 0 54.16666667%;max-width:54.16666667%}.ant-col-xxl-push-13{left:54.16666667%}.ant-col-xxl-pull-13{right:54.16666667%}.ant-col-xxl-offset-13{margin-left:54.16666667%}.ant-col-xxl-order-13{order:13}.ant-col-xxl-12{display:block;flex:0 0 50%;max-width:50%}.ant-col-xxl-push-12{left:50%}.ant-col-xxl-pull-12{right:50%}.ant-col-xxl-offset-12{margin-left:50%}.ant-col-xxl-order-12{order:12}.ant-col-xxl-11{display:block;flex:0 0 45.83333333%;max-width:45.83333333%}.ant-col-xxl-push-11{left:45.83333333%}.ant-col-xxl-pull-11{right:45.83333333%}.ant-col-xxl-offset-11{margin-left:45.83333333%}.ant-col-xxl-order-11{order:11}.ant-col-xxl-10{display:block;flex:0 0 41.66666667%;max-width:41.66666667%}.ant-col-xxl-push-10{left:41.66666667%}.ant-col-xxl-pull-10{right:41.66666667%}.ant-col-xxl-offset-10{margin-left:41.66666667%}.ant-col-xxl-order-10{order:10}.ant-col-xxl-9{display:block;flex:0 0 37.5%;max-width:37.5%}.ant-col-xxl-push-9{left:37.5%}.ant-col-xxl-pull-9{right:37.5%}.ant-col-xxl-offset-9{margin-left:37.5%}.ant-col-xxl-order-9{order:9}.ant-col-xxl-8{display:block;flex:0 0 33.33333333%;max-width:33.33333333%}.ant-col-xxl-push-8{left:33.33333333%}.ant-col-xxl-pull-8{right:33.33333333%}.ant-col-xxl-offset-8{margin-left:33.33333333%}.ant-col-xxl-order-8{order:8}.ant-col-xxl-7{display:block;flex:0 0 29.16666667%;max-width:29.16666667%}.ant-col-xxl-push-7{left:29.16666667%}.ant-col-xxl-pull-7{right:29.16666667%}.ant-col-xxl-offset-7{margin-left:29.16666667%}.ant-col-xxl-order-7{order:7}.ant-col-xxl-6{display:block;flex:0 0 25%;max-width:25%}.ant-col-xxl-push-6{left:25%}.ant-col-xxl-pull-6{right:25%}.ant-col-xxl-offset-6{margin-left:25%}.ant-col-xxl-order-6{order:6}.ant-col-xxl-5{display:block;flex:0 0 20.83333333%;max-width:20.83333333%}.ant-col-xxl-push-5{left:20.83333333%}.ant-col-xxl-pull-5{right:20.83333333%}.ant-col-xxl-offset-5{margin-left:20.83333333%}.ant-col-xxl-order-5{order:5}.ant-col-xxl-4{display:block;flex:0 0 16.66666667%;max-width:16.66666667%}.ant-col-xxl-push-4{left:16.66666667%}.ant-col-xxl-pull-4{right:16.66666667%}.ant-col-xxl-offset-4{margin-left:16.66666667%}.ant-col-xxl-order-4{order:4}.ant-col-xxl-3{display:block;flex:0 0 12.5%;max-width:12.5%}.ant-col-xxl-push-3{left:12.5%}.ant-col-xxl-pull-3{right:12.5%}.ant-col-xxl-offset-3{margin-left:12.5%}.ant-col-xxl-order-3{order:3}.ant-col-xxl-2{display:block;flex:0 0 8.33333333%;max-width:8.33333333%}.ant-col-xxl-push-2{left:8.33333333%}.ant-col-xxl-pull-2{right:8.33333333%}.ant-col-xxl-offset-2{margin-left:8.33333333%}.ant-col-xxl-order-2{order:2}.ant-col-xxl-1{display:block;flex:0 0 4.16666667%;max-width:4.16666667%}.ant-col-xxl-push-1{left:4.16666667%}.ant-col-xxl-pull-1{right:4.16666667%}.ant-col-xxl-offset-1{margin-left:4.16666667%}.ant-col-xxl-order-1{order:1}.ant-col-xxl-0{display:none}.ant-col-push-0{left:auto}.ant-col-pull-0{right:auto}.ant-col-xxl-push-0{left:auto}.ant-col-xxl-pull-0{right:auto}.ant-col-xxl-offset-0{margin-left:0}.ant-col-xxl-order-0{order:0}.ant-col-push-0.ant-col-rtl{right:auto}.ant-col-pull-0.ant-col-rtl{left:auto}.ant-col-xxl-push-0.ant-col-rtl{right:auto}.ant-col-xxl-pull-0.ant-col-rtl{left:auto}.ant-col-xxl-offset-0.ant-col-rtl{margin-right:0}.ant-col-xxl-push-1.ant-col-rtl{left:auto;right:4.16666667%}.ant-col-xxl-pull-1.ant-col-rtl{left:4.16666667%;right:auto}.ant-col-xxl-offset-1.ant-col-rtl{margin-left:0;margin-right:4.16666667%}.ant-col-xxl-push-2.ant-col-rtl{left:auto;right:8.33333333%}.ant-col-xxl-pull-2.ant-col-rtl{left:8.33333333%;right:auto}.ant-col-xxl-offset-2.ant-col-rtl{margin-left:0;margin-right:8.33333333%}.ant-col-xxl-push-3.ant-col-rtl{left:auto;right:12.5%}.ant-col-xxl-pull-3.ant-col-rtl{left:12.5%;right:auto}.ant-col-xxl-offset-3.ant-col-rtl{margin-left:0;margin-right:12.5%}.ant-col-xxl-push-4.ant-col-rtl{left:auto;right:16.66666667%}.ant-col-xxl-pull-4.ant-col-rtl{left:16.66666667%;right:auto}.ant-col-xxl-offset-4.ant-col-rtl{margin-left:0;margin-right:16.66666667%}.ant-col-xxl-push-5.ant-col-rtl{left:auto;right:20.83333333%}.ant-col-xxl-pull-5.ant-col-rtl{left:20.83333333%;right:auto}.ant-col-xxl-offset-5.ant-col-rtl{margin-left:0;margin-right:20.83333333%}.ant-col-xxl-push-6.ant-col-rtl{left:auto;right:25%}.ant-col-xxl-pull-6.ant-col-rtl{left:25%;right:auto}.ant-col-xxl-offset-6.ant-col-rtl{margin-left:0;margin-right:25%}.ant-col-xxl-push-7.ant-col-rtl{left:auto;right:29.16666667%}.ant-col-xxl-pull-7.ant-col-rtl{left:29.16666667%;right:auto}.ant-col-xxl-offset-7.ant-col-rtl{margin-left:0;margin-right:29.16666667%}.ant-col-xxl-push-8.ant-col-rtl{left:auto;right:33.33333333%}.ant-col-xxl-pull-8.ant-col-rtl{left:33.33333333%;right:auto}.ant-col-xxl-offset-8.ant-col-rtl{margin-left:0;margin-right:33.33333333%}.ant-col-xxl-push-9.ant-col-rtl{left:auto;right:37.5%}.ant-col-xxl-pull-9.ant-col-rtl{left:37.5%;right:auto}.ant-col-xxl-offset-9.ant-col-rtl{margin-left:0;margin-right:37.5%}.ant-col-xxl-push-10.ant-col-rtl{left:auto;right:41.66666667%}.ant-col-xxl-pull-10.ant-col-rtl{left:41.66666667%;right:auto}.ant-col-xxl-offset-10.ant-col-rtl{margin-left:0;margin-right:41.66666667%}.ant-col-xxl-push-11.ant-col-rtl{left:auto;right:45.83333333%}.ant-col-xxl-pull-11.ant-col-rtl{left:45.83333333%;right:auto}.ant-col-xxl-offset-11.ant-col-rtl{margin-left:0;margin-right:45.83333333%}.ant-col-xxl-push-12.ant-col-rtl{left:auto;right:50%}.ant-col-xxl-pull-12.ant-col-rtl{left:50%;right:auto}.ant-col-xxl-offset-12.ant-col-rtl{margin-left:0;margin-right:50%}.ant-col-xxl-push-13.ant-col-rtl{left:auto;right:54.16666667%}.ant-col-xxl-pull-13.ant-col-rtl{left:54.16666667%;right:auto}.ant-col-xxl-offset-13.ant-col-rtl{margin-left:0;margin-right:54.16666667%}.ant-col-xxl-push-14.ant-col-rtl{left:auto;right:58.33333333%}.ant-col-xxl-pull-14.ant-col-rtl{left:58.33333333%;right:auto}.ant-col-xxl-offset-14.ant-col-rtl{margin-left:0;margin-right:58.33333333%}.ant-col-xxl-push-15.ant-col-rtl{left:auto;right:62.5%}.ant-col-xxl-pull-15.ant-col-rtl{left:62.5%;right:auto}.ant-col-xxl-offset-15.ant-col-rtl{margin-left:0;margin-right:62.5%}.ant-col-xxl-push-16.ant-col-rtl{left:auto;right:66.66666667%}.ant-col-xxl-pull-16.ant-col-rtl{left:66.66666667%;right:auto}.ant-col-xxl-offset-16.ant-col-rtl{margin-left:0;margin-right:66.66666667%}.ant-col-xxl-push-17.ant-col-rtl{left:auto;right:70.83333333%}.ant-col-xxl-pull-17.ant-col-rtl{left:70.83333333%;right:auto}.ant-col-xxl-offset-17.ant-col-rtl{margin-left:0;margin-right:70.83333333%}.ant-col-xxl-push-18.ant-col-rtl{left:auto;right:75%}.ant-col-xxl-pull-18.ant-col-rtl{left:75%;right:auto}.ant-col-xxl-offset-18.ant-col-rtl{margin-left:0;margin-right:75%}.ant-col-xxl-push-19.ant-col-rtl{left:auto;right:79.16666667%}.ant-col-xxl-pull-19.ant-col-rtl{left:79.16666667%;right:auto}.ant-col-xxl-offset-19.ant-col-rtl{margin-left:0;margin-right:79.16666667%}.ant-col-xxl-push-20.ant-col-rtl{left:auto;right:83.33333333%}.ant-col-xxl-pull-20.ant-col-rtl{left:83.33333333%;right:auto}.ant-col-xxl-offset-20.ant-col-rtl{margin-left:0;margin-right:83.33333333%}.ant-col-xxl-push-21.ant-col-rtl{left:auto;right:87.5%}.ant-col-xxl-pull-21.ant-col-rtl{left:87.5%;right:auto}.ant-col-xxl-offset-21.ant-col-rtl{margin-left:0;margin-right:87.5%}.ant-col-xxl-push-22.ant-col-rtl{left:auto;right:91.66666667%}.ant-col-xxl-pull-22.ant-col-rtl{left:91.66666667%;right:auto}.ant-col-xxl-offset-22.ant-col-rtl{margin-left:0;margin-right:91.66666667%}.ant-col-xxl-push-23.ant-col-rtl{left:auto;right:95.83333333%}.ant-col-xxl-pull-23.ant-col-rtl{left:95.83333333%;right:auto}.ant-col-xxl-offset-23.ant-col-rtl{margin-left:0;margin-right:95.83333333%}.ant-col-xxl-push-24.ant-col-rtl{left:auto;right:100%}.ant-col-xxl-pull-24.ant-col-rtl{left:100%;right:auto}.ant-col-xxl-offset-24.ant-col-rtl{margin-left:0;margin-right:100%}}.ant-row-rtl{direction:rtl}.ant-image{display:inline-block;position:relative}.ant-image-img{height:auto;vertical-align:middle;width:100%}.ant-image-img-placeholder{background-color:#f5f5f5;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjUgMi41aC0xM0EuNS41IDAgMCAwIDEgM3YxMGEuNS41IDAgMCAwIC41LjVoMTNhLjUuNSAwIDAgMCAuNS0uNVYzYS41LjUgMCAwIDAtLjUtLjV6TTUuMjgxIDQuNzVhMSAxIDAgMCAxIDAgMiAxIDEgMCAwIDEgMC0yem04LjAzIDYuODNhLjEyNy4xMjcgMCAwIDEtLjA4MS4wM0gyLjc2OWEuMTI1LjEyNSAwIDAgMS0uMDk2LS4yMDdsMi42NjEtMy4xNTZhLjEyNi4xMjYgMCAwIDEgLjE3Ny0uMDE2bC4wMTYuMDE2TDcuMDggMTAuMDlsMi40Ny0yLjkzYS4xMjYuMTI2IDAgMCAxIC4xNzctLjAxNmwuMDE1LjAxNiAzLjU4OCA0LjI0NGEuMTI3LjEyNyAwIDAgMS0uMDIuMTc1eiIgZmlsbD0iIzhDOEM4QyIvPjwvc3ZnPg==);background-position:50%;background-repeat:no-repeat;background-size:30%}.ant-image-mask{align-items:center;background:rgba(0,0,0,.5);bottom:0;color:#fff;cursor:pointer;display:flex;justify-content:center;left:0;opacity:0;position:absolute;right:0;top:0;transition:opacity .3s}.ant-image-mask-info{overflow:hidden;padding:0 4px;text-overflow:ellipsis;white-space:nowrap}.ant-image-mask-info .anticon{-webkit-margin-end:4px;margin-inline-end:4px}.ant-image-mask:hover{opacity:1}.ant-image-placeholder{bottom:0;left:0;position:absolute;right:0;top:0}.ant-image-preview{height:100%;pointer-events:none;text-align:center}.ant-image-preview.ant-zoom-appear,.ant-image-preview.ant-zoom-enter{-webkit-animation-duration:.3s;animation-duration:.3s;opacity:0;transform:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-image-preview-mask{background-color:rgba(0,0,0,.45);bottom:0;height:100%;left:0;position:fixed;right:0;top:0;z-index:1000}.ant-image-preview-mask-hidden{display:none}.ant-image-preview-wrap{bottom:0;left:0;outline:0;overflow:auto;position:fixed;right:0;top:0}.ant-image-preview-body{bottom:0;left:0;overflow:hidden;position:absolute;right:0;top:0}.ant-image-preview-img{cursor:-webkit-grab;cursor:grab;max-height:100%;max-width:100%;pointer-events:auto;transform:scaleX(1);-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle}.ant-image-preview-img,.ant-image-preview-img-wrapper{transition:transform .3s cubic-bezier(.215,.61,.355,1) 0s}.ant-image-preview-img-wrapper{bottom:0;left:0;position:absolute;right:0;top:0}.ant-image-preview-img-wrapper:before{content:"";display:inline-block;height:50%;margin-right:-1px;width:1px}.ant-image-preview-moving .ant-image-preview-img{cursor:-webkit-grabbing;cursor:grabbing}.ant-image-preview-moving .ant-image-preview-img-wrapper{transition-duration:0s}.ant-image-preview-wrap{z-index:1080}.ant-image-preview-operations{font-feature-settings:"tnum";align-items:center;background:rgba(0,0,0,.1);box-sizing:border-box;color:rgba(0,0,0,.85);color:hsla(0,0%,100%,.85);display:flex;flex-direction:row-reverse;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;pointer-events:auto;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-image-preview-operations-operation{cursor:pointer;margin-left:12px;padding:12px}.ant-image-preview-operations-operation-disabled{color:hsla(0,0%,100%,.25);pointer-events:none}.ant-image-preview-operations-operation:last-of-type{margin-left:0}.ant-image-preview-operations-progress{left:50%;position:absolute;transform:translateX(-50%)}.ant-image-preview-operations-icon{font-size:18px}.ant-image-preview-switch-left,.ant-image-preview-switch-right{align-items:center;background:rgba(0,0,0,.1);border-radius:50%;color:hsla(0,0%,100%,.85);cursor:pointer;display:flex;height:44px;justify-content:center;margin-top:-22px;pointer-events:auto;position:absolute;right:10px;top:50%;width:44px;z-index:1}.ant-image-preview-switch-left-disabled,.ant-image-preview-switch-right-disabled{color:hsla(0,0%,100%,.25);cursor:not-allowed}.ant-image-preview-switch-left-disabled>.anticon,.ant-image-preview-switch-right-disabled>.anticon{cursor:not-allowed}.ant-image-preview-switch-left>.anticon,.ant-image-preview-switch-right>.anticon{font-size:18px}.ant-image-preview-switch-left{left:10px}.ant-image-preview-switch-right{right:10px}.ant-input-number-affix-wrapper{-webkit-padding-start:11px;background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);display:inline-block;display:inline-flex;font-size:14px;line-height:1.5715;min-width:0;padding:0;padding-inline-start:11px;position:relative;transition:all .3s;width:100%;width:90px}.ant-input-number-affix-wrapper::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input-number-affix-wrapper:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input-number-affix-wrapper::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input-number-affix-wrapper:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-number-affix-wrapper:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number-affix-wrapper:placeholder-shown{text-overflow:ellipsis}.ant-input-number-affix-wrapper:hover{border-color:#40a9ff;border-right-width:1px}.ant-input-number-affix-wrapper-focused,.ant-input-number-affix-wrapper:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-number-affix-wrapper-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-number-affix-wrapper-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-number-affix-wrapper[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-number-affix-wrapper[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-number-affix-wrapper-borderless,.ant-input-number-affix-wrapper-borderless-disabled,.ant-input-number-affix-wrapper-borderless-focused,.ant-input-number-affix-wrapper-borderless:focus,.ant-input-number-affix-wrapper-borderless:hover,.ant-input-number-affix-wrapper-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input-number-affix-wrapper{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-input-number-affix-wrapper-lg{font-size:16px;padding:6.5px 11px}.ant-input-number-affix-wrapper-sm{padding:0 7px}.ant-input-number-affix-wrapper:not(.ant-input-number-affix-wrapper-disabled):hover{border-color:#40a9ff;border-right-width:1px;z-index:1}.ant-input-number-affix-wrapper-focused,.ant-input-number-affix-wrapper:focus{z-index:1}.ant-input-number-affix-wrapper-disabled .ant-input-number[disabled]{background:transparent}.ant-input-number-affix-wrapper>div.ant-input-number{border:none;outline:none;width:100%}.ant-input-number-affix-wrapper>div.ant-input-number.ant-input-number-focused{box-shadow:none!important}.ant-input-number-affix-wrapper input.ant-input-number-input{padding:0}.ant-input-number-affix-wrapper:before{content:" ";visibility:hidden;width:0}.ant-input-number-affix-wrapper .ant-input-number-handler-wrap{z-index:2}.ant-input-number-prefix,.ant-input-number-suffix{align-items:center;display:flex;flex:none;pointer-events:none}.ant-input-number-prefix{-webkit-margin-end:4px;margin-inline-end:4px}.ant-input-number-suffix{height:100%;margin-left:4px;margin-right:11px;position:absolute;right:0;top:0;z-index:1}.ant-input-number-group-wrapper .ant-input-number-affix-wrapper{width:100%}.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number,.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:hover{background:#fff;border-color:#ff4d4f}.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number-focused,.ant-input-number-status-error:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-input-number-status-error .ant-input-number-prefix{color:#ff4d4f}.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number,.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:hover{background:#fff;border-color:#faad14}.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number-focused,.ant-input-number-status-warning:not(.ant-input-number-disabled):not(.ant-input-number-borderless).ant-input-number:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-input-number-status-warning .ant-input-number-prefix{color:#faad14}.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper,.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:hover{background:#fff;border-color:#ff4d4f}.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper-focused,.ant-input-number-affix-wrapper-status-error:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-input-number-affix-wrapper-status-error .ant-input-number-prefix{color:#ff4d4f}.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper,.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:hover{background:#fff;border-color:#faad14}.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper-focused,.ant-input-number-affix-wrapper-status-warning:not(.ant-input-number-affix-wrapper-disabled):not(.ant-input-number-affix-wrapper-borderless).ant-input-number-affix-wrapper:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-input-number-affix-wrapper-status-warning .ant-input-number-prefix{color:#faad14}.ant-input-number-group-wrapper-status-error .ant-input-number-group-addon{border-color:#ff4d4f;color:#ff4d4f}.ant-input-number-group-wrapper-status-warning .ant-input-number-group-addon{border-color:#faad14;color:#faad14}.ant-input-number{font-feature-settings:"tnum";background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;min-width:0;padding:0;position:relative;transition:all .3s;width:100%;width:90px}.ant-input-number::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input-number:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input-number::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input-number:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-number:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number:placeholder-shown{text-overflow:ellipsis}.ant-input-number-focused,.ant-input-number:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-number[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-number[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-number-borderless,.ant-input-number-borderless-disabled,.ant-input-number-borderless-focused,.ant-input-number-borderless:focus,.ant-input-number-borderless:hover,.ant-input-number-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input-number{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-input-number-lg{padding:6.5px 11px}.ant-input-number-sm{padding:0 7px}.ant-input-number-group{font-feature-settings:"tnum";border-collapse:separate;border-spacing:0;box-sizing:border-box;color:rgba(0,0,0,.85);display:table;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative;width:100%}.ant-input-number-group[class*=col-]{float:none;padding-left:0;padding-right:0}.ant-input-number-group>[class*=col-]{padding-right:8px}.ant-input-number-group>[class*=col-]:last-child{padding-right:0}.ant-input-number-group-addon,.ant-input-number-group-wrap,.ant-input-number-group>.ant-input-number{display:table-cell}.ant-input-number-group-addon:not(:first-child):not(:last-child),.ant-input-number-group-wrap:not(:first-child):not(:last-child),.ant-input-number-group>.ant-input-number:not(:first-child):not(:last-child){border-radius:0}.ant-input-number-group-addon,.ant-input-number-group-wrap{vertical-align:middle;white-space:nowrap;width:1px}.ant-input-number-group-wrap>*{display:block!important}.ant-input-number-group .ant-input-number{float:left;margin-bottom:0;text-align:inherit;width:100%}.ant-input-number-group .ant-input-number:focus,.ant-input-number-group .ant-input-number:hover{border-right-width:1px;z-index:1}.ant-input-search-with-button .ant-input-number-group .ant-input-number:hover{z-index:0}.ant-input-number-group-addon{background-color:#fafafa;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);font-size:14px;font-weight:400;padding:0 11px;position:relative;text-align:center;transition:all .3s}.ant-input-number-group-addon .ant-select{margin:-5px -11px}.ant-input-number-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{background-color:inherit;border:1px solid transparent;box-shadow:none}.ant-input-number-group-addon .ant-select-focused .ant-select-selector,.ant-input-number-group-addon .ant-select-open .ant-select-selector{color:#1890ff}.ant-input-number-group-addon .ant-cascader-picker{background-color:transparent;margin:-9px -12px}.ant-input-number-group-addon .ant-cascader-picker .ant-cascader-input{border:0;box-shadow:none;text-align:left}.ant-input-number-group-addon:first-child,.ant-input-number-group-addon:first-child .ant-select .ant-select-selector,.ant-input-number-group>.ant-input-number:first-child,.ant-input-number-group>.ant-input-number:first-child .ant-select .ant-select-selector{border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-number-group>.ant-input-number-affix-wrapper:not(:first-child) .ant-input-number{border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-number-group>.ant-input-number-affix-wrapper:not(:last-child) .ant-input-number{border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-number-group-addon:first-child{border-right:0}.ant-input-number-group-addon:last-child{border-left:0}.ant-input-number-group-addon:last-child,.ant-input-number-group-addon:last-child .ant-select .ant-select-selector,.ant-input-number-group>.ant-input-number:last-child,.ant-input-number-group>.ant-input-number:last-child .ant-select .ant-select-selector{border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-number-group-lg .ant-input-number,.ant-input-number-group-lg>.ant-input-number-group-addon{font-size:16px;padding:6.5px 11px}.ant-input-number-group-sm .ant-input-number,.ant-input-number-group-sm>.ant-input-number-group-addon{padding:0 7px}.ant-input-number-group-lg .ant-select-single .ant-select-selector{height:40px}.ant-input-number-group-sm .ant-select-single .ant-select-selector{height:24px}.ant-input-number-group .ant-input-number-affix-wrapper:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-search .ant-input-number-group .ant-input-number-affix-wrapper:not(:last-child){border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-input-number-group .ant-input-number-affix-wrapper:not(:first-child),.ant-input-search .ant-input-number-group .ant-input-number-affix-wrapper:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-number-group.ant-input-number-group-compact{display:block}.ant-input-number-group.ant-input-number-group-compact:before{content:"";display:table}.ant-input-number-group.ant-input-number-group-compact:after{clear:both;content:"";display:table}.ant-input-number-group.ant-input-number-group-compact-addon:not(:first-child):not(:last-child),.ant-input-number-group.ant-input-number-group-compact-wrap:not(:first-child):not(:last-child),.ant-input-number-group.ant-input-number-group-compact>.ant-input-number:not(:first-child):not(:last-child){border-right-width:1px}.ant-input-number-group.ant-input-number-group-compact-addon:not(:first-child):not(:last-child):focus,.ant-input-number-group.ant-input-number-group-compact-addon:not(:first-child):not(:last-child):hover,.ant-input-number-group.ant-input-number-group-compact-wrap:not(:first-child):not(:last-child):focus,.ant-input-number-group.ant-input-number-group-compact-wrap:not(:first-child):not(:last-child):hover,.ant-input-number-group.ant-input-number-group-compact>.ant-input-number:not(:first-child):not(:last-child):focus,.ant-input-number-group.ant-input-number-group-compact>.ant-input-number:not(:first-child):not(:last-child):hover{z-index:1}.ant-input-number-group.ant-input-number-group-compact>*{border-radius:0;display:inline-block;float:none;vertical-align:top}.ant-input-number-group.ant-input-number-group-compact>.ant-input-number-affix-wrapper,.ant-input-number-group.ant-input-number-group-compact>.ant-picker-range{display:inline-flex}.ant-input-number-group.ant-input-number-group-compact>:not(:last-child){border-right-width:1px;margin-right:-1px}.ant-input-number-group.ant-input-number-group-compact .ant-input-number{float:none}.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-input-group-wrapper .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select>.ant-select-selector{border-radius:0;border-right-width:1px}.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker .ant-input:focus,.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker .ant-input:hover,.ant-input-number-group.ant-input-number-group-compact>.ant-input-group-wrapper .ant-input:focus,.ant-input-number-group.ant-input-number-group-compact>.ant-input-group-wrapper .ant-input:hover,.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete .ant-input:focus,.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete .ant-input:hover,.ant-input-number-group.ant-input-number-group-compact>.ant-select-focused,.ant-input-number-group.ant-input-number-group-compact>.ant-select>.ant-select-arrow,.ant-input-number-group.ant-input-number-group-compact>.ant-select>.ant-select-selector:focus,.ant-input-number-group.ant-input-number-group-compact>.ant-select>.ant-select-selector:hover{z-index:1}.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-number-group.ant-input-number-group-compact>:first-child{border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-number-group.ant-input-number-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-number-group.ant-input-number-group-compact>:last-child{border-bottom-right-radius:2px;border-right-width:1px;border-top-right-radius:2px}.ant-input-number-group.ant-input-number-group-compact>.ant-select-auto-complete .ant-input{vertical-align:top}.ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper{margin-left:-1px}.ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper .ant-input-affix-wrapper,.ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input-group-addon>.ant-input-search-button{border-radius:0}.ant-input-number-group.ant-input-number-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input{border-radius:2px 0 0 2px}.ant-input-number-group>.ant-input-number-rtl:first-child{border-radius:0 2px 2px 0}.ant-input-number-group>.ant-input-number-rtl:last-child{border-radius:2px 0 0 2px}.ant-input-number-group-rtl .ant-input-number-group-addon:first-child{border-left:0;border-radius:0 2px 2px 0;border-right:1px solid #d9d9d9}.ant-input-number-group-rtl .ant-input-number-group-addon:last-child{border-left:1px solid #d9d9d9;border-radius:2px 0 0 2px;border-right:0}.ant-input-number-group-wrapper{display:inline-block;text-align:start;vertical-align:top}.ant-input-number-handler{border-left:1px solid #d9d9d9;color:rgba(0,0,0,.45);display:block;font-weight:700;height:50%;line-height:0;overflow:hidden;position:relative;text-align:center;transition:all .1s linear;width:100%}.ant-input-number-handler:active{background:#f4f4f4}.ant-input-number-handler:hover .ant-input-number-handler-down-inner,.ant-input-number-handler:hover .ant-input-number-handler-up-inner{color:#40a9ff}.ant-input-number-handler-down-inner,.ant-input-number-handler-up-inner{text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:inherit;color:rgba(0,0,0,.45);display:inline-block;font-style:normal;height:12px;line-height:0;line-height:12px;position:absolute;right:4px;text-align:center;text-transform:none;transition:all .1s linear;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:-.125em;width:12px}.ant-input-number-handler-down-inner>*,.ant-input-number-handler-up-inner>*{line-height:1}.ant-input-number-handler-down-inner svg,.ant-input-number-handler-up-inner svg{display:inline-block}.ant-input-number-handler-down-inner:before,.ant-input-number-handler-up-inner:before{display:none}.ant-input-number-handler-down-inner .ant-input-number-handler-down-inner-icon,.ant-input-number-handler-down-inner .ant-input-number-handler-up-inner-icon,.ant-input-number-handler-up-inner .ant-input-number-handler-down-inner-icon,.ant-input-number-handler-up-inner .ant-input-number-handler-up-inner-icon{display:block}.ant-input-number:hover{border-color:#40a9ff;border-right-width:1px}.ant-input-number:hover+.ant-form-item-children-icon{opacity:0;transition:opacity .24s linear .24s}.ant-input-number-focused{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-number-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-number-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-number-disabled .ant-input-number-input{cursor:not-allowed}.ant-input-number-disabled .ant-input-number-handler-wrap,.ant-input-number-readonly .ant-input-number-handler-wrap{display:none}.ant-input-number-input{-webkit-appearance:textfield!important;-moz-appearance:textfield!important;appearance:textfield!important;background-color:transparent;border:0;border-radius:2px;height:30px;outline:0;padding:0 11px;text-align:left;transition:all .3s linear;width:100%}.ant-input-number-input::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input-number-input:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input-number-input::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input-number-input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-number-input:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-number-input:placeholder-shown{text-overflow:ellipsis}.ant-input-number-input[type=number]::-webkit-inner-spin-button,.ant-input-number-input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;appearance:none;margin:0}.ant-input-number-lg{font-size:16px;padding:0}.ant-input-number-lg input{height:38px}.ant-input-number-sm{padding:0}.ant-input-number-sm input{height:22px;padding:0 7px}.ant-input-number-handler-wrap{background:#fff;border-radius:0 2px 2px 0;height:100%;opacity:0;position:absolute;right:0;top:0;transition:opacity .24s linear .1s;width:22px}.ant-input-number-handler-wrap .ant-input-number-handler .ant-input-number-handler-down-inner,.ant-input-number-handler-wrap .ant-input-number-handler .ant-input-number-handler-up-inner{align-items:center;display:flex;font-size:7px;justify-content:center;margin-right:0;min-width:auto}.ant-input-number-borderless .ant-input-number-handler-wrap{border-left-width:0}.ant-input-number-handler-wrap:hover .ant-input-number-handler{height:40%}.ant-input-number-focused .ant-input-number-handler-wrap,.ant-input-number:hover .ant-input-number-handler-wrap{opacity:1}.ant-input-number-handler-up{border-top-right-radius:2px;cursor:pointer}.ant-input-number-handler-up-inner{margin-top:-5px;text-align:center;top:50%}.ant-input-number-handler-up:hover{height:60%!important}.ant-input-number-handler-down{border-bottom-right-radius:2px;border-top:1px solid #d9d9d9;cursor:pointer;top:0}.ant-input-number-handler-down-inner{text-align:center;top:50%;transform:translateY(-50%)}.ant-input-number-handler-down:hover{height:60%!important}.ant-input-number-borderless .ant-input-number-handler-down{border-top-width:0}.ant-input-number-handler-down-disabled,.ant-input-number-handler-up-disabled{cursor:not-allowed}.ant-input-number-handler-down-disabled:hover .ant-input-number-handler-down-inner,.ant-input-number-handler-up-disabled:hover .ant-input-number-handler-up-inner{color:rgba(0,0,0,.25)}.ant-input-number-borderless{box-shadow:none}.ant-input-number-out-of-range input{color:#ff4d4f}.ant-input-number-rtl{direction:rtl}.ant-input-number-rtl .ant-input-number-handler{border-left:0;border-right:1px solid #d9d9d9}.ant-input-number-rtl .ant-input-number-handler-wrap{left:0;right:auto}.ant-input-number-rtl.ant-input-number-borderless .ant-input-number-handler-wrap{border-right-width:0}.ant-input-number-rtl .ant-input-number-handler-up{border-top-right-radius:0}.ant-input-number-rtl .ant-input-number-handler-down{border-bottom-right-radius:0}.ant-input-number-rtl .ant-input-number-input{direction:ltr;text-align:right}.ant-input-affix-wrapper{background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);display:inline-block;display:inline-flex;font-size:14px;line-height:1.5715;min-width:0;padding:4px 11px;position:relative;transition:all .3s;width:100%}.ant-input-affix-wrapper::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input-affix-wrapper:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input-affix-wrapper::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input-affix-wrapper:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input-affix-wrapper:-ms-input-placeholder{text-overflow:ellipsis}.ant-input-affix-wrapper:placeholder-shown{text-overflow:ellipsis}.ant-input-affix-wrapper:hover{border-color:#40a9ff;border-right-width:1px}.ant-input-rtl .ant-input-affix-wrapper:hover{border-left-width:1px!important;border-right-width:0}.ant-input-affix-wrapper-focused,.ant-input-affix-wrapper:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-rtl .ant-input-affix-wrapper-focused,.ant-input-rtl .ant-input-affix-wrapper:focus{border-left-width:1px!important;border-right-width:0}.ant-input-affix-wrapper-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-affix-wrapper-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-affix-wrapper[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-affix-wrapper[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-affix-wrapper-borderless,.ant-input-affix-wrapper-borderless-disabled,.ant-input-affix-wrapper-borderless-focused,.ant-input-affix-wrapper-borderless:focus,.ant-input-affix-wrapper-borderless:hover,.ant-input-affix-wrapper-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input-affix-wrapper{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-input-affix-wrapper-lg{font-size:16px;padding:6.5px 11px}.ant-input-affix-wrapper-sm{padding:0 7px}.ant-input-affix-wrapper-rtl{direction:rtl}.ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover{border-color:#40a9ff;border-right-width:1px;z-index:1}.ant-input-rtl .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover{border-left-width:1px!important;border-right-width:0}.ant-input-search-with-button .ant-input-affix-wrapper:not(.ant-input-affix-wrapper-disabled):hover{z-index:0}.ant-input-affix-wrapper-focused,.ant-input-affix-wrapper:focus{z-index:1}.ant-input-affix-wrapper-disabled .ant-input[disabled]{background:transparent}.ant-input-affix-wrapper>input.ant-input{border:none;outline:none;padding:0}.ant-input-affix-wrapper>input.ant-input:focus{box-shadow:none!important}.ant-input-affix-wrapper:before{content:" ";visibility:hidden;width:0}.ant-input-prefix,.ant-input-suffix{align-items:center;display:flex;flex:none}.ant-input-prefix>:not(:last-child),.ant-input-suffix>:not(:last-child){margin-right:8px}.ant-input-show-count-suffix{color:rgba(0,0,0,.45)}.ant-input-show-count-has-suffix{margin-right:2px}.ant-input-prefix{margin-right:4px}.ant-input-suffix{margin-left:4px}.ant-input-clear-icon,.anticon.ant-input-clear-icon{color:rgba(0,0,0,.25);cursor:pointer;font-size:12px;margin:0;transition:color .3s;vertical-align:-1px}.ant-input-clear-icon:hover,.anticon.ant-input-clear-icon:hover{color:rgba(0,0,0,.45)}.ant-input-clear-icon:active,.anticon.ant-input-clear-icon:active{color:rgba(0,0,0,.85)}.ant-input-clear-icon-hidden,.anticon.ant-input-clear-icon-hidden{visibility:hidden}.ant-input-clear-icon-has-suffix,.anticon.ant-input-clear-icon-has-suffix{margin:0 4px}.ant-input-affix-wrapper-textarea-with-clear-btn{border:0!important;padding:0!important}.ant-input-affix-wrapper-textarea-with-clear-btn .ant-input-clear-icon{position:absolute;right:8px;top:8px;z-index:1}.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input,.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:hover{background:#fff;border-color:#ff4d4f}.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input-focused,.ant-input-status-error:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-input-status-error .ant-input-prefix{color:#ff4d4f}.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input,.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:hover{background:#fff;border-color:#faad14}.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input-focused,.ant-input-status-warning:not(.ant-input-disabled):not(.ant-input-borderless).ant-input:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-input-status-warning .ant-input-prefix{color:#faad14}.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper,.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:hover{background:#fff;border-color:#ff4d4f}.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper-focused,.ant-input-affix-wrapper-status-error:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-input-affix-wrapper-status-error .ant-input-prefix{color:#ff4d4f}.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper,.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:hover{background:#fff;border-color:#faad14}.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper-focused,.ant-input-affix-wrapper-status-warning:not(.ant-input-affix-wrapper-disabled):not(.ant-input-affix-wrapper-borderless).ant-input-affix-wrapper:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-input-affix-wrapper-status-warning .ant-input-prefix{color:#faad14}.ant-input-textarea-status-error.ant-input-textarea-has-feedback .ant-input,.ant-input-textarea-status-success.ant-input-textarea-has-feedback .ant-input,.ant-input-textarea-status-validating.ant-input-textarea-has-feedback .ant-input,.ant-input-textarea-status-warning.ant-input-textarea-has-feedback .ant-input{padding-right:24px}.ant-input-group-wrapper-status-error .ant-input-group-addon{border-color:#ff4d4f;color:#ff4d4f}.ant-input-group-wrapper-status-warning .ant-input-group-addon{border-color:#faad14;color:#faad14}.ant-input{font-feature-settings:"tnum";background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;min-width:0;padding:4px 11px;position:relative;transition:all .3s;width:100%}.ant-input::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-input:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-input::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-input:-ms-input-placeholder{text-overflow:ellipsis}.ant-input:placeholder-shown{text-overflow:ellipsis}.ant-input:hover{border-color:#40a9ff;border-right-width:1px}.ant-input-rtl .ant-input:hover{border-left-width:1px!important;border-right-width:0}.ant-input-focused,.ant-input:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-input-rtl .ant-input-focused,.ant-input-rtl .ant-input:focus{border-left-width:1px!important;border-right-width:0}.ant-input-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-input[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-input-borderless,.ant-input-borderless-disabled,.ant-input-borderless-focused,.ant-input-borderless:focus,.ant-input-borderless:hover,.ant-input-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-input{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-input-lg{font-size:16px;padding:6.5px 11px}.ant-input-sm{padding:0 7px}.ant-input-rtl{direction:rtl}.ant-input-group{font-feature-settings:"tnum";border-collapse:separate;border-spacing:0;box-sizing:border-box;color:rgba(0,0,0,.85);display:table;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative;width:100%}.ant-input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.ant-input-group>[class*=col-]{padding-right:8px}.ant-input-group>[class*=col-]:last-child{padding-right:0}.ant-input-group-addon,.ant-input-group-wrap,.ant-input-group>.ant-input{display:table-cell}.ant-input-group-addon:not(:first-child):not(:last-child),.ant-input-group-wrap:not(:first-child):not(:last-child),.ant-input-group>.ant-input:not(:first-child):not(:last-child){border-radius:0}.ant-input-group-addon,.ant-input-group-wrap{vertical-align:middle;white-space:nowrap;width:1px}.ant-input-group-wrap>*{display:block!important}.ant-input-group .ant-input{float:left;margin-bottom:0;text-align:inherit;width:100%}.ant-input-group .ant-input:focus,.ant-input-group .ant-input:hover{border-right-width:1px;z-index:1}.ant-input-search-with-button .ant-input-group .ant-input:hover{z-index:0}.ant-input-group-addon{background-color:#fafafa;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);font-size:14px;font-weight:400;padding:0 11px;position:relative;text-align:center;transition:all .3s}.ant-input-group-addon .ant-select{margin:-5px -11px}.ant-input-group-addon .ant-select.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{background-color:inherit;border:1px solid transparent;box-shadow:none}.ant-input-group-addon .ant-select-focused .ant-select-selector,.ant-input-group-addon .ant-select-open .ant-select-selector{color:#1890ff}.ant-input-group-addon .ant-cascader-picker{background-color:transparent;margin:-9px -12px}.ant-input-group-addon .ant-cascader-picker .ant-cascader-input{border:0;box-shadow:none;text-align:left}.ant-input-group-addon:first-child,.ant-input-group-addon:first-child .ant-select .ant-select-selector,.ant-input-group>.ant-input:first-child,.ant-input-group>.ant-input:first-child .ant-select .ant-select-selector{border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-group>.ant-input-affix-wrapper:not(:first-child) .ant-input{border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-group>.ant-input-affix-wrapper:not(:last-child) .ant-input{border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-group-addon:first-child{border-right:0}.ant-input-group-addon:last-child{border-left:0}.ant-input-group-addon:last-child,.ant-input-group-addon:last-child .ant-select .ant-select-selector,.ant-input-group>.ant-input:last-child,.ant-input-group>.ant-input:last-child .ant-select .ant-select-selector{border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-group-lg .ant-input,.ant-input-group-lg>.ant-input-group-addon{font-size:16px;padding:6.5px 11px}.ant-input-group-sm .ant-input,.ant-input-group-sm>.ant-input-group-addon{padding:0 7px}.ant-input-group-lg .ant-select-single .ant-select-selector{height:40px}.ant-input-group-sm .ant-select-single .ant-select-selector{height:24px}.ant-input-group .ant-input-affix-wrapper:not(:last-child){border-bottom-right-radius:0;border-top-right-radius:0}.ant-input-search .ant-input-group .ant-input-affix-wrapper:not(:last-child){border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-input-group .ant-input-affix-wrapper:not(:first-child),.ant-input-search .ant-input-group .ant-input-affix-wrapper:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.ant-input-group.ant-input-group-compact{display:block}.ant-input-group.ant-input-group-compact:before{content:"";display:table}.ant-input-group.ant-input-group-compact:after{clear:both;content:"";display:table}.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child),.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child),.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child){border-right-width:1px}.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact-addon:not(:first-child):not(:last-child):hover,.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact-wrap:not(:first-child):not(:last-child):hover,.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child):focus,.ant-input-group.ant-input-group-compact>.ant-input:not(:first-child):not(:last-child):hover{z-index:1}.ant-input-group.ant-input-group-compact>*{border-radius:0;display:inline-block;float:none;vertical-align:top}.ant-input-group.ant-input-group-compact>.ant-input-affix-wrapper,.ant-input-group.ant-input-group-compact>.ant-picker-range{display:inline-flex}.ant-input-group.ant-input-group-compact>:not(:last-child){border-right-width:1px;margin-right:-1px}.ant-input-group.ant-input-group-compact .ant-input{float:none}.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector{border-radius:0;border-right-width:1px}.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-cascader-picker .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-input-group-wrapper .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input:focus,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input:hover,.ant-input-group.ant-input-group-compact>.ant-select-focused,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-arrow,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector:focus,.ant-input-group.ant-input-group-compact>.ant-select>.ant-select-selector:hover{z-index:1}.ant-input-group.ant-input-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-group.ant-input-group-compact>:first-child{border-bottom-left-radius:2px;border-top-left-radius:2px}.ant-input-group.ant-input-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-group.ant-input-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-group.ant-input-group-compact>:last-child{border-bottom-right-radius:2px;border-right-width:1px;border-top-right-radius:2px}.ant-input-group.ant-input-group-compact>.ant-select-auto-complete .ant-input{vertical-align:top}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper{margin-left:-1px}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper+.ant-input-group-wrapper .ant-input-affix-wrapper,.ant-input-group.ant-input-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input-group-addon>.ant-input-search-button{border-radius:0}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper:not(:last-child).ant-input-search>.ant-input-group>.ant-input{border-radius:2px 0 0 2px}.ant-input-group-rtl .ant-input-group-addon:first-child,.ant-input-group>.ant-input-rtl:first-child{border-radius:0 2px 2px 0}.ant-input-group-rtl .ant-input-group-addon:first-child{border-left:0;border-right:1px solid #d9d9d9}.ant-input-group-rtl .ant-input-group-addon:last-child{border-left:1px solid #d9d9d9;border-radius:2px 0 0 2px;border-right:0}.ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:first-child),.ant-input-group-rtl.ant-input-group-addon:last-child,.ant-input-group-rtl.ant-input-group>.ant-input:last-child{border-radius:2px 0 0 2px}.ant-input-group-rtl.ant-input-group .ant-input-affix-wrapper:not(:last-child){border-radius:0 2px 2px 0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:not(:last-child){border-left-width:1px;margin-left:-1px;margin-right:0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker:first-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:first-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select:first-child>.ant-select-selector,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:first-child{border-radius:0 2px 2px 0}.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker-focused:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-cascader-picker:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select-auto-complete:last-child .ant-input,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>.ant-select:last-child>.ant-select-selector,.ant-input-group-rtl.ant-input-group.ant-input-group-compact>:last-child{border-left-width:1px;border-radius:2px 0 0 2px}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper-rtl+.ant-input-group-wrapper-rtl{margin-left:0;margin-right:-1px}.ant-input-group.ant-input-group-compact .ant-input-group-wrapper-rtl:not(:last-child).ant-input-search>.ant-input-group>.ant-input{border-radius:0 2px 2px 0}.ant-input-group-wrapper{display:inline-block;text-align:start;vertical-align:top;width:100%}.ant-input-password-icon.anticon{color:rgba(0,0,0,.45);cursor:pointer;transition:all .3s}.ant-input-password-icon.anticon:hover{color:rgba(0,0,0,.85)}.ant-input[type=color]{height:32px}.ant-input[type=color].ant-input-lg{height:40px}.ant-input[type=color].ant-input-sm{height:24px;padding-bottom:3px;padding-top:3px}.ant-input-textarea-show-count>.ant-input{height:100%}.ant-input-textarea-show-count:after{color:rgba(0,0,0,.45);content:attr(data-count);float:right;pointer-events:none;white-space:nowrap}.ant-input-textarea-show-count.ant-input-textarea-in-form-item:after{margin-bottom:-22px}.ant-input-textarea-suffix{align-items:center;bottom:0;display:inline-flex;margin:auto;position:absolute;right:11px;top:0;z-index:1}.ant-input-search .ant-input:focus,.ant-input-search .ant-input:hover{border-color:#40a9ff}.ant-input-search .ant-input:focus+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary),.ant-input-search .ant-input:hover+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary){border-left-color:#40a9ff}.ant-input-search .ant-input-affix-wrapper{border-radius:0}.ant-input-search .ant-input-lg{line-height:1.5713}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child{border:0;left:-1px;padding:0}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child .ant-input-search-button{border-radius:0 2px 2px 0;padding-bottom:0;padding-top:0}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child .ant-input-search-button:not(.ant-btn-primary){color:rgba(0,0,0,.45)}.ant-input-search>.ant-input-group>.ant-input-group-addon:last-child .ant-input-search-button:not(.ant-btn-primary).ant-btn-loading:before{bottom:0;left:0;right:0;top:0}.ant-input-search-button{height:32px}.ant-input-search-button:focus,.ant-input-search-button:hover{z-index:1}.ant-input-search-large .ant-input-search-button{height:40px}.ant-input-search-small .ant-input-search-button{height:24px}.ant-input-group-rtl,.ant-input-group-wrapper-rtl{direction:rtl}.ant-input-affix-wrapper.ant-input-affix-wrapper-rtl>input.ant-input{border:none;outline:none}.ant-input-affix-wrapper-rtl .ant-input-prefix{margin:0 0 0 4px}.ant-input-affix-wrapper-rtl .ant-input-suffix{margin:0 4px 0 0}.ant-input-textarea-rtl{direction:rtl}.ant-input-textarea-rtl.ant-input-textarea-show-count:after{text-align:left}.ant-input-affix-wrapper-rtl .ant-input-clear-icon-has-suffix{margin-left:4px;margin-right:0}.ant-input-affix-wrapper-rtl .ant-input-clear-icon{left:8px;right:auto}.ant-input-search-rtl{direction:rtl}.ant-input-search-rtl .ant-input:focus+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary),.ant-input-search-rtl .ant-input:hover+.ant-input-group-addon .ant-input-search-button:not(.ant-btn-primary){border-left-color:#d9d9d9;border-right-color:#40a9ff}.ant-input-search-rtl>.ant-input-group>.ant-input-affix-wrapper-focused,.ant-input-search-rtl>.ant-input-group>.ant-input-affix-wrapper:hover{border-right-color:#40a9ff}.ant-input-search-rtl>.ant-input-group>.ant-input-group-addon{left:auto;right:-1px}.ant-input-search-rtl>.ant-input-group>.ant-input-group-addon .ant-input-search-button{border-radius:2px 0 0 2px}@media(-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ant-input{height:32px}.ant-input-lg{height:40px}.ant-input-sm{height:24px}.ant-input-affix-wrapper>input.ant-input{height:auto}}.ant-layout{background:#f0f2f5;display:flex;flex:auto;flex-direction:column;min-height:0}.ant-layout,.ant-layout *{box-sizing:border-box}.ant-layout.ant-layout-has-sider{flex-direction:row}.ant-layout.ant-layout-has-sider>.ant-layout,.ant-layout.ant-layout-has-sider>.ant-layout-content{width:0}.ant-layout-footer,.ant-layout-header{flex:0 0 auto}.ant-layout-header{background:#001529;color:rgba(0,0,0,.85);height:64px;line-height:64px;padding:0 50px}.ant-layout-footer{background:#f0f2f5;color:rgba(0,0,0,.85);font-size:14px;padding:24px 50px}.ant-layout-content{flex:auto;min-height:0}.ant-layout-sider{background:#001529;min-width:0;position:relative;transition:all .2s}.ant-layout-sider-children{height:100%;margin-top:-.1px;padding-top:.1px}.ant-layout-sider-children .ant-menu.ant-menu-inline-collapsed{width:auto}.ant-layout-sider-has-trigger{padding-bottom:48px}.ant-layout-sider-right{order:1}.ant-layout-sider-trigger{background:#002140;bottom:0;color:#fff;cursor:pointer;height:48px;line-height:48px;position:fixed;text-align:center;transition:all .2s;z-index:1}.ant-layout-sider-zero-width>*{overflow:hidden}.ant-layout-sider-zero-width-trigger{background:#001529;border-radius:0 2px 2px 0;color:#fff;cursor:pointer;font-size:18px;height:42px;line-height:42px;position:absolute;right:-36px;text-align:center;top:64px;transition:background .3s ease;width:36px;z-index:1}.ant-layout-sider-zero-width-trigger:after{background:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0;transition:all .3s}.ant-layout-sider-zero-width-trigger:hover:after{background:hsla(0,0%,100%,.1)}.ant-layout-sider-zero-width-trigger-right{border-radius:2px 0 0 2px;left:-36px}.ant-layout-sider-light{background:#fff}.ant-layout-sider-light .ant-layout-sider-trigger,.ant-layout-sider-light .ant-layout-sider-zero-width-trigger{background:#fff;color:rgba(0,0,0,.85)}.ant-layout-rtl{direction:rtl}.ant-list{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-list *{outline:none}.ant-list-pagination{margin-top:24px;text-align:right}.ant-list-pagination .ant-pagination-options{text-align:left}.ant-list-more{margin-top:12px;text-align:center}.ant-list-more button{padding-left:32px;padding-right:32px}.ant-list-spin{min-height:40px;text-align:center}.ant-list-empty-text{color:rgba(0,0,0,.25);font-size:14px;padding:16px;text-align:center}.ant-list-items{list-style:none;margin:0;padding:0}.ant-list-item{align-items:center;color:rgba(0,0,0,.85);display:flex;justify-content:space-between;padding:12px 0}.ant-list-item-meta{align-items:flex-start;display:flex;flex:1;max-width:100%}.ant-list-item-meta-avatar{margin-right:16px}.ant-list-item-meta-content{color:rgba(0,0,0,.85);flex:1 0;width:0}.ant-list-item-meta-title{color:rgba(0,0,0,.85);font-size:14px;line-height:1.5715;margin-bottom:4px}.ant-list-item-meta-title>a{color:rgba(0,0,0,.85);transition:all .3s}.ant-list-item-meta-title>a:hover{color:#1890ff}.ant-list-item-meta-description{color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715}.ant-list-item-action{flex:0 0 auto;font-size:0;list-style:none;margin-left:48px;padding:0}.ant-list-item-action>li{color:rgba(0,0,0,.45);display:inline-block;font-size:14px;line-height:1.5715;padding:0 8px;position:relative;text-align:center}.ant-list-item-action>li:first-child{padding-left:0}.ant-list-item-action-split{background-color:#f0f0f0;height:14px;margin-top:-7px;position:absolute;right:0;top:50%;width:1px}.ant-list-footer,.ant-list-header{background:transparent;padding-bottom:12px;padding-top:12px}.ant-list-empty{color:rgba(0,0,0,.45);font-size:12px;padding:16px 0;text-align:center}.ant-list-split .ant-list-item{border-bottom:1px solid #f0f0f0}.ant-list-split .ant-list-item:last-child{border-bottom:none}.ant-list-split .ant-list-header{border-bottom:1px solid #f0f0f0}.ant-list-split.ant-list-empty .ant-list-footer{border-top:1px solid #f0f0f0}.ant-list-loading .ant-list-spin-nested-loading{min-height:32px}.ant-list-split.ant-list-something-after-last-item .ant-spin-container>.ant-list-items>.ant-list-item:last-child{border-bottom:1px solid #f0f0f0}.ant-list-lg .ant-list-item{padding:16px 24px}.ant-list-sm .ant-list-item{padding:8px 16px}.ant-list-vertical .ant-list-item{align-items:normal}.ant-list-vertical .ant-list-item-main{display:block;flex:1}.ant-list-vertical .ant-list-item-extra{margin-left:40px}.ant-list-vertical .ant-list-item-meta{margin-bottom:16px}.ant-list-vertical .ant-list-item-meta-title{color:rgba(0,0,0,.85);font-size:16px;line-height:24px;margin-bottom:12px}.ant-list-vertical .ant-list-item-action{margin-left:auto;margin-top:16px}.ant-list-vertical .ant-list-item-action>li{padding:0 16px}.ant-list-vertical .ant-list-item-action>li:first-child{padding-left:0}.ant-list-grid .ant-col>.ant-list-item{border-bottom:none;display:block;margin-bottom:16px;max-width:100%;padding-bottom:0;padding-top:0}.ant-list-item-no-flex{display:block}.ant-list:not(.ant-list-vertical) .ant-list-item-no-flex .ant-list-item-action{float:right}.ant-list-bordered{border:1px solid #d9d9d9;border-radius:2px}.ant-list-bordered .ant-list-footer,.ant-list-bordered .ant-list-header,.ant-list-bordered .ant-list-item{padding-left:24px;padding-right:24px}.ant-list-bordered .ant-list-pagination{margin:16px 24px}.ant-list-bordered.ant-list-sm .ant-list-footer,.ant-list-bordered.ant-list-sm .ant-list-header,.ant-list-bordered.ant-list-sm .ant-list-item{padding:8px 16px}.ant-list-bordered.ant-list-lg .ant-list-footer,.ant-list-bordered.ant-list-lg .ant-list-header,.ant-list-bordered.ant-list-lg .ant-list-item{padding:16px 24px}@media screen and (max-width:768px){.ant-list-item-action,.ant-list-vertical .ant-list-item-extra{margin-left:24px}}@media screen and (max-width:576px){.ant-list-item{flex-wrap:wrap}.ant-list-item-action{margin-left:12px}.ant-list-vertical .ant-list-item{flex-wrap:wrap-reverse}.ant-list-vertical .ant-list-item-main{min-width:220px}.ant-list-vertical .ant-list-item-extra{margin:auto auto 16px}}.ant-list-rtl{direction:rtl;text-align:right}.ant-list-rtl .ReactVirtualized__List .ant-list-item{direction:rtl}.ant-list-rtl .ant-list-pagination{text-align:left}.ant-list-rtl .ant-list-item-meta-avatar{margin-left:16px;margin-right:0}.ant-list-rtl .ant-list-item-action{margin-left:0;margin-right:48px}.ant-list.ant-list-rtl .ant-list-item-action>li:first-child{padding-left:16px;padding-right:0}.ant-list-rtl .ant-list-item-action-split{left:0;right:auto}.ant-list-rtl.ant-list-vertical .ant-list-item-extra{margin-left:0;margin-right:40px}.ant-list-rtl.ant-list-vertical .ant-list-item-action{margin-right:auto}.ant-list-rtl .ant-list-vertical .ant-list-item-action>li:first-child{padding-left:16px;padding-right:0}.ant-list-rtl .ant-list:not(.ant-list-vertical) .ant-list-item-no-flex .ant-list-item-action{float:left}@media screen and (max-width:768px){.ant-list-rtl .ant-list-item-action,.ant-list-rtl .ant-list-vertical .ant-list-item-extra{margin-left:0;margin-right:24px}}@media screen and (max-width:576px){.ant-list-rtl .ant-list-item-action{margin-left:0;margin-right:22px}.ant-list-rtl.ant-list-vertical .ant-list-item-extra{margin:auto auto 16px}}.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions,.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:hover{background:#fff;border-color:#ff4d4f}.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions-focused,.ant-mentions-status-error:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:focus{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-mentions-status-error .ant-input-prefix{color:#ff4d4f}.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions,.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:hover{background:#fff;border-color:#faad14}.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions-focused,.ant-mentions-status-warning:not(.ant-mentions-disabled):not(.ant-mentions-borderless).ant-mentions:focus{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-mentions-status-warning .ant-input-prefix{color:#faad14}.ant-mentions{font-feature-settings:"tnum";background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;height:auto;line-height:1.5715;list-style:none;margin:0;min-width:0;overflow:hidden;padding:0;position:relative;transition:all .3s;vertical-align:bottom;white-space:pre-wrap;width:100%}.ant-mentions::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-mentions:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-mentions::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-mentions:-moz-placeholder-shown{text-overflow:ellipsis}.ant-mentions:-ms-input-placeholder{text-overflow:ellipsis}.ant-mentions:placeholder-shown{text-overflow:ellipsis}.ant-mentions-focused,.ant-mentions:focus,.ant-mentions:hover{border-color:#40a9ff;border-right-width:1px}.ant-mentions-focused,.ant-mentions:focus{box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-mentions-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-mentions-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-mentions[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-mentions[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-mentions-borderless,.ant-mentions-borderless-disabled,.ant-mentions-borderless-focused,.ant-mentions-borderless:focus,.ant-mentions-borderless:hover,.ant-mentions-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-mentions{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-mentions-lg{font-size:16px;padding:6.5px 11px}.ant-mentions-sm{padding:0 7px}.ant-mentions-disabled>textarea{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-mentions-disabled>textarea:hover{border-color:#d9d9d9;border-right-width:1px}.ant-mentions-focused{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-mentions-measure,.ant-mentions>textarea{word-wrap:break-word;direction:inherit;font-family:inherit;font-size:inherit;font-size-adjust:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;min-height:30px;overflow:inherit;overflow-x:hidden;overflow-y:auto;padding:4px 11px;-moz-tab-size:inherit;-o-tab-size:inherit;tab-size:inherit;text-align:inherit;vertical-align:top;white-space:inherit;word-break:inherit}.ant-mentions>textarea{border:none;outline:none;resize:none;width:100%}.ant-mentions>textarea::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-mentions>textarea:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-mentions>textarea::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-mentions>textarea:-moz-placeholder-shown{text-overflow:ellipsis}.ant-mentions>textarea:-ms-input-placeholder{text-overflow:ellipsis}.ant-mentions>textarea:placeholder-shown{text-overflow:ellipsis}.ant-mentions-measure{bottom:0;color:transparent;left:0;pointer-events:none;position:absolute;right:0;top:0;z-index:-1}.ant-mentions-measure>span{display:inline-block;min-height:1em}.ant-mentions-dropdown{font-feature-settings:"tnum";background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;font-variant:normal;left:-9999px;line-height:1.5715;list-style:none;margin:0;outline:none;padding:0;position:absolute;top:-9999px;z-index:1050}.ant-mentions-dropdown-hidden{display:none}.ant-mentions-dropdown-menu{list-style:none;margin-bottom:0;max-height:250px;outline:none;overflow:auto;padding-left:0}.ant-mentions-dropdown-menu-item{color:rgba(0,0,0,.85);cursor:pointer;display:block;font-weight:400;line-height:1.5715;min-width:100px;overflow:hidden;padding:5px 12px;position:relative;text-overflow:ellipsis;transition:background .3s ease;white-space:nowrap}.ant-mentions-dropdown-menu-item:hover{background-color:#f5f5f5}.ant-mentions-dropdown-menu-item:first-child{border-radius:2px 2px 0 0}.ant-mentions-dropdown-menu-item:last-child{border-radius:0 0 2px 2px}.ant-mentions-dropdown-menu-item-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-mentions-dropdown-menu-item-disabled:hover{background-color:#fff;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-mentions-dropdown-menu-item-selected{background-color:#fafafa;color:rgba(0,0,0,.85);font-weight:600}.ant-mentions-dropdown-menu-item-active{background-color:#f5f5f5}.ant-mentions-suffix{align-items:center;bottom:0;display:inline-flex;margin:auto;position:absolute;right:11px;top:0;z-index:1}.ant-mentions-rtl{direction:rtl}.ant-menu-item-danger.ant-menu-item,.ant-menu-item-danger.ant-menu-item-active,.ant-menu-item-danger.ant-menu-item:hover{color:#ff4d4f}.ant-menu-item-danger.ant-menu-item:active{background:#fff1f0}.ant-menu-item-danger.ant-menu-item-selected,.ant-menu-item-danger.ant-menu-item-selected>a,.ant-menu-item-danger.ant-menu-item-selected>a:hover{color:#ff4d4f}.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected{background-color:#fff1f0}.ant-menu-inline .ant-menu-item-danger.ant-menu-item:after{border-right-color:#ff4d4f}.ant-menu-dark .ant-menu-item-danger.ant-menu-item,.ant-menu-dark .ant-menu-item-danger.ant-menu-item:hover,.ant-menu-dark .ant-menu-item-danger.ant-menu-item>a{color:#ff4d4f}.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-danger.ant-menu-item-selected{background-color:#ff4d4f;color:#fff}.ant-menu{font-feature-settings:"tnum";background:#fff;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:0;list-style:none;margin:0;outline:none;padding:0;text-align:left;transition:background .3s,width .3s cubic-bezier(.2,0,0,1) 0s}.ant-menu:after,.ant-menu:before{content:"";display:table}.ant-menu:after{clear:both}.ant-menu.ant-menu-root:focus-visible{box-shadow:0 0 0 2px #bae7ff}.ant-menu ol,.ant-menu ul{list-style:none;margin:0;padding:0}.ant-menu-overflow{display:flex}.ant-menu-overflow-item{flex:none}.ant-menu-hidden,.ant-menu-submenu-hidden{display:none}.ant-menu-item-group-title{color:rgba(0,0,0,.45);font-size:14px;height:1.5715;line-height:1.5715;padding:8px 16px;transition:all .3s}.ant-menu-horizontal .ant-menu-submenu{transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu,.ant-menu-submenu-inline{transition:border-color .3s cubic-bezier(.645,.045,.355,1),background .3s cubic-bezier(.645,.045,.355,1),padding .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-selected{color:#1890ff}.ant-menu-item:active,.ant-menu-submenu-title:active{background:#e6f7ff}.ant-menu-submenu .ant-menu-sub{cursor:auto;transition:background .3s cubic-bezier(.645,.045,.355,1),padding .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-title-content{transition:color .3s}.ant-menu-item a{color:rgba(0,0,0,.85)}.ant-menu-item a:hover{color:#1890ff}.ant-menu-item a:before{background-color:transparent;bottom:0;content:"";left:0;position:absolute;right:0;top:0}.ant-menu-item>.ant-badge a{color:rgba(0,0,0,.85)}.ant-menu-item>.ant-badge a:hover{color:#1890ff}.ant-menu-item-divider{border:solid #f0f0f0;border-width:1px 0 0;line-height:0;overflow:hidden}.ant-menu-item-divider-dashed{border-style:dashed}.ant-menu-horizontal .ant-menu-item,.ant-menu-horizontal .ant-menu-submenu{margin-top:-1px}.ant-menu-horizontal>.ant-menu-item-active,.ant-menu-horizontal>.ant-menu-item:hover,.ant-menu-horizontal>.ant-menu-submenu .ant-menu-submenu-title:hover{background-color:transparent}.ant-menu-item-selected,.ant-menu-item-selected a,.ant-menu-item-selected a:hover{color:#1890ff}.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#e6f7ff}.ant-menu-inline,.ant-menu-vertical,.ant-menu-vertical-left{border-right:1px solid #f0f0f0}.ant-menu-vertical-right{border-left:1px solid #f0f0f0}.ant-menu-vertical-left.ant-menu-sub,.ant-menu-vertical-right.ant-menu-sub,.ant-menu-vertical.ant-menu-sub{border-right:0;max-height:calc(100vh - 100px);min-width:160px;overflow:hidden;padding:0}.ant-menu-vertical-left.ant-menu-sub:not([class*=-active]),.ant-menu-vertical-right.ant-menu-sub:not([class*=-active]),.ant-menu-vertical.ant-menu-sub:not([class*=-active]){overflow-x:hidden;overflow-y:auto}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item,.ant-menu-vertical.ant-menu-sub .ant-menu-item{border-right:0;left:0;margin-left:0}.ant-menu-vertical-left.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical-right.ant-menu-sub .ant-menu-item:after,.ant-menu-vertical.ant-menu-sub .ant-menu-item:after{border-right:0}.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{transform-origin:0 0}.ant-menu-horizontal.ant-menu-sub{min-width:114px}.ant-menu-horizontal .ant-menu-item,.ant-menu-horizontal .ant-menu-submenu-title{transition:border-color .3s,background .3s}.ant-menu-item,.ant-menu-submenu-title{cursor:pointer;display:block;margin:0;padding:0 20px;position:relative;transition:border-color .3s,background .3s,padding .3s cubic-bezier(.645,.045,.355,1);white-space:nowrap}.ant-menu-item .ant-menu-item-icon,.ant-menu-item .anticon,.ant-menu-submenu-title .ant-menu-item-icon,.ant-menu-submenu-title .anticon{font-size:14px;min-width:14px;transition:font-size .15s cubic-bezier(.215,.61,.355,1),margin .3s cubic-bezier(.645,.045,.355,1),color .3s}.ant-menu-item .ant-menu-item-icon+span,.ant-menu-item .anticon+span,.ant-menu-submenu-title .ant-menu-item-icon+span,.ant-menu-submenu-title .anticon+span{margin-left:10px;opacity:1;transition:opacity .3s cubic-bezier(.645,.045,.355,1),margin .3s,color .3s}.ant-menu-item .ant-menu-item-icon.svg,.ant-menu-submenu-title .ant-menu-item-icon.svg{vertical-align:-.125em}.ant-menu-item.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-item.ant-menu-item-only-child>.anticon,.ant-menu-submenu-title.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-submenu-title.ant-menu-item-only-child>.anticon{margin-right:0}.ant-menu-item:focus-visible,.ant-menu-submenu-title:focus-visible{box-shadow:0 0 0 2px #bae7ff}.ant-menu>.ant-menu-item-divider{margin:1px 0;padding:0}.ant-menu-submenu-popup{background:transparent;border-radius:2px;box-shadow:none;position:absolute;transform-origin:0 0;z-index:1050}.ant-menu-submenu-popup:before{bottom:0;content:" ";height:100%;left:0;opacity:.0001;position:absolute;right:0;top:-7px;width:100%;z-index:-1}.ant-menu-submenu-placement-rightTop:before{left:-7px;top:0}.ant-menu-submenu>.ant-menu{background-color:#fff;border-radius:2px}.ant-menu-submenu>.ant-menu-submenu-title:after{transition:transform .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-submenu-popup>.ant-menu{background-color:#fff}.ant-menu-submenu-arrow,.ant-menu-submenu-expand-icon{color:rgba(0,0,0,.85);position:absolute;right:16px;top:50%;transform:translateY(-50%);transition:transform .3s cubic-bezier(.645,.045,.355,1);width:10px}.ant-menu-submenu-arrow:after,.ant-menu-submenu-arrow:before{background-color:currentcolor;border-radius:2px;content:"";height:1.5px;position:absolute;transition:background .3s cubic-bezier(.645,.045,.355,1),transform .3s cubic-bezier(.645,.045,.355,1),top .3s cubic-bezier(.645,.045,.355,1),color .3s cubic-bezier(.645,.045,.355,1);width:6px}.ant-menu-submenu-arrow:before{transform:rotate(45deg) translateY(-2.5px)}.ant-menu-submenu-arrow:after{transform:rotate(-45deg) translateY(2.5px)}.ant-menu-submenu:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-submenu:hover>.ant-menu-submenu-title>.ant-menu-submenu-expand-icon{color:#1890ff}.ant-menu-inline-collapsed .ant-menu-submenu-arrow:before,.ant-menu-submenu-inline .ant-menu-submenu-arrow:before{transform:rotate(-45deg) translateX(2.5px)}.ant-menu-inline-collapsed .ant-menu-submenu-arrow:after,.ant-menu-submenu-inline .ant-menu-submenu-arrow:after{transform:rotate(45deg) translateX(-2.5px)}.ant-menu-submenu-horizontal .ant-menu-submenu-arrow{display:none}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title>.ant-menu-submenu-arrow{transform:translateY(-2px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after{transform:rotate(-45deg) translateX(-2.5px)}.ant-menu-submenu-open.ant-menu-submenu-inline>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{transform:rotate(45deg) translateX(2.5px)}.ant-menu-vertical .ant-menu-submenu-selected,.ant-menu-vertical-left .ant-menu-submenu-selected,.ant-menu-vertical-right .ant-menu-submenu-selected{color:#1890ff}.ant-menu-horizontal{border:0;border-bottom:1px solid #f0f0f0;box-shadow:none;line-height:46px}.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu{margin-bottom:0;margin-top:-1px;padding:0 20px}.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-active,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-open,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-selected,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item:hover,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-active,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-open,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-selected,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu:hover{color:#1890ff}.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-active:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-open:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item-selected:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-item:hover:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-active:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-open:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu-selected:after,.ant-menu-horizontal:not(.ant-menu-dark)>.ant-menu-submenu:hover:after{border-bottom:2px solid #1890ff}.ant-menu-horizontal>.ant-menu-item,.ant-menu-horizontal>.ant-menu-submenu{display:inline-block;position:relative;top:1px;vertical-align:bottom}.ant-menu-horizontal>.ant-menu-item:after,.ant-menu-horizontal>.ant-menu-submenu:after{border-bottom:2px solid transparent;bottom:0;content:"";left:20px;position:absolute;right:20px;transition:border-color .3s cubic-bezier(.645,.045,.355,1)}.ant-menu-horizontal>.ant-menu-submenu>.ant-menu-submenu-title{padding:0}.ant-menu-horizontal>.ant-menu-item a{color:rgba(0,0,0,.85)}.ant-menu-horizontal>.ant-menu-item a:hover{color:#1890ff}.ant-menu-horizontal>.ant-menu-item a:before{bottom:-2px}.ant-menu-horizontal>.ant-menu-item-selected a{color:#1890ff}.ant-menu-horizontal:after{clear:both;content:" ";display:block;height:0}.ant-menu-inline .ant-menu-item,.ant-menu-vertical .ant-menu-item,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-right .ant-menu-item{position:relative}.ant-menu-inline .ant-menu-item:after,.ant-menu-vertical .ant-menu-item:after,.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-vertical-right .ant-menu-item:after{border-right:3px solid #1890ff;bottom:0;content:"";opacity:0;position:absolute;right:0;top:0;transform:scaleY(.0001);transition:transform .15s cubic-bezier(.215,.61,.355,1),opacity .15s cubic-bezier(.215,.61,.355,1)}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title,.ant-menu-vertical .ant-menu-item,.ant-menu-vertical .ant-menu-submenu-title,.ant-menu-vertical-left .ant-menu-item,.ant-menu-vertical-left .ant-menu-submenu-title,.ant-menu-vertical-right .ant-menu-item,.ant-menu-vertical-right .ant-menu-submenu-title{height:40px;line-height:40px;margin-bottom:4px;margin-top:4px;overflow:hidden;padding:0 16px;text-overflow:ellipsis}.ant-menu-inline .ant-menu-submenu,.ant-menu-vertical .ant-menu-submenu,.ant-menu-vertical-left .ant-menu-submenu,.ant-menu-vertical-right .ant-menu-submenu{padding-bottom:.02px}.ant-menu-inline .ant-menu-item:not(:last-child),.ant-menu-vertical .ant-menu-item:not(:last-child),.ant-menu-vertical-left .ant-menu-item:not(:last-child),.ant-menu-vertical-right .ant-menu-item:not(:last-child){margin-bottom:8px}.ant-menu-inline>.ant-menu-item,.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-left>.ant-menu-item,.ant-menu-vertical-left>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical-right>.ant-menu-item,.ant-menu-vertical-right>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu-vertical>.ant-menu-item,.ant-menu-vertical>.ant-menu-submenu>.ant-menu-submenu-title{height:40px;line-height:40px}.ant-menu-vertical .ant-menu-item-group-list .ant-menu-submenu-title,.ant-menu-vertical .ant-menu-submenu-title{padding-right:34px}.ant-menu-inline{width:100%}.ant-menu-inline .ant-menu-item-selected:after,.ant-menu-inline .ant-menu-selected:after{opacity:1;transform:scaleY(1);transition:transform .15s cubic-bezier(.645,.045,.355,1),opacity .15s cubic-bezier(.645,.045,.355,1)}.ant-menu-inline .ant-menu-item,.ant-menu-inline .ant-menu-submenu-title{width:calc(100% + 1px)}.ant-menu-inline .ant-menu-item-group-list .ant-menu-submenu-title,.ant-menu-inline .ant-menu-submenu-title{padding-right:34px}.ant-menu-inline.ant-menu-root .ant-menu-item,.ant-menu-inline.ant-menu-root .ant-menu-submenu-title{align-items:center;display:flex;transition:border-color .3s,background .3s,padding .1s cubic-bezier(.215,.61,.355,1)}.ant-menu-inline.ant-menu-root .ant-menu-item>.ant-menu-title-content,.ant-menu-inline.ant-menu-root .ant-menu-submenu-title>.ant-menu-title-content{flex:auto;min-width:0;overflow:hidden;text-overflow:ellipsis}.ant-menu-inline.ant-menu-root .ant-menu-item>*,.ant-menu-inline.ant-menu-root .ant-menu-submenu-title>*{flex:none}.ant-menu.ant-menu-inline-collapsed{width:80px}.ant-menu.ant-menu-inline-collapsed>.ant-menu-item,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title{left:0;padding:0 calc(50% - 8px);text-overflow:clip}.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-submenu-arrow,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow{opacity:0}.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .anticon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon{font-size:16px;line-height:40px;margin:0}.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .ant-menu-item-icon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item .anticon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .ant-menu-item-icon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-item .anticon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-item-group>.ant-menu-item-group-list>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-item-icon+span,.ant-menu.ant-menu-inline-collapsed>.ant-menu-submenu>.ant-menu-submenu-title .anticon+span{display:inline-block;opacity:0}.ant-menu.ant-menu-inline-collapsed .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed .anticon{display:inline-block}.ant-menu.ant-menu-inline-collapsed-tooltip{pointer-events:none}.ant-menu.ant-menu-inline-collapsed-tooltip .ant-menu-item-icon,.ant-menu.ant-menu-inline-collapsed-tooltip .anticon{display:none}.ant-menu.ant-menu-inline-collapsed-tooltip a{color:hsla(0,0%,100%,.85)}.ant-menu.ant-menu-inline-collapsed .ant-menu-item-group-title{overflow:hidden;padding-left:4px;padding-right:4px;text-overflow:ellipsis;white-space:nowrap}.ant-menu-item-group-list{margin:0;padding:0}.ant-menu-item-group-list .ant-menu-item,.ant-menu-item-group-list .ant-menu-submenu-title{padding:0 16px 0 28px}.ant-menu-root.ant-menu-inline,.ant-menu-root.ant-menu-vertical,.ant-menu-root.ant-menu-vertical-left,.ant-menu-root.ant-menu-vertical-right{box-shadow:none}.ant-menu-root.ant-menu-inline-collapsed .ant-menu-item>.ant-menu-inline-collapsed-noicon,.ant-menu-root.ant-menu-inline-collapsed .ant-menu-submenu .ant-menu-submenu-title>.ant-menu-inline-collapsed-noicon{font-size:16px;text-align:center}.ant-menu-sub.ant-menu-inline{background:#fafafa;border-radius:0;box-shadow:none;padding:0}.ant-menu-sub.ant-menu-inline>.ant-menu-item,.ant-menu-sub.ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title{height:40px;line-height:40px;list-style-position:inside;list-style-type:disc}.ant-menu-sub.ant-menu-inline .ant-menu-item-group-title{padding-left:32px}.ant-menu-item-disabled,.ant-menu-submenu-disabled{background:none;color:rgba(0,0,0,.25)!important;cursor:not-allowed}.ant-menu-item-disabled:after,.ant-menu-submenu-disabled:after{border-color:transparent!important}.ant-menu-item-disabled a,.ant-menu-submenu-disabled a{color:rgba(0,0,0,.25)!important;pointer-events:none}.ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-submenu-disabled>.ant-menu-submenu-title{color:rgba(0,0,0,.25)!important;cursor:not-allowed}.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:rgba(0,0,0,.25)!important}.ant-layout-header .ant-menu{line-height:inherit}.ant-menu-inline-collapsed-tooltip a,.ant-menu-inline-collapsed-tooltip a:hover{color:#fff}.ant-menu-light .ant-menu-item-active,.ant-menu-light .ant-menu-item:hover,.ant-menu-light .ant-menu-submenu-active,.ant-menu-light .ant-menu-submenu-title:hover,.ant-menu-light .ant-menu:not(.ant-menu-inline) .ant-menu-submenu-open{color:#1890ff}.ant-menu-dark .ant-menu-item:focus-visible,.ant-menu-dark .ant-menu-submenu-title:focus-visible,.ant-menu.ant-menu-root:focus-visible{box-shadow:0 0 0 2px #096dd9}.ant-menu-dark .ant-menu-sub,.ant-menu.ant-menu-dark,.ant-menu.ant-menu-dark .ant-menu-sub{background:#001529;color:hsla(0,0%,100%,.65)}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow{opacity:.45;transition:all .3s}.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu.ant-menu-dark .ant-menu-sub .ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu.ant-menu-dark .ant-menu-submenu-title .ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark.ant-menu-submenu-popup{background:transparent}.ant-menu-dark .ant-menu-inline.ant-menu-sub{background:#000c17}.ant-menu-dark.ant-menu-horizontal{border-bottom:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item,.ant-menu-dark.ant-menu-horizontal>.ant-menu-submenu{border-color:#001529;border-bottom:0;margin-top:0;padding:0 20px;top:0}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item:hover{background-color:#1890ff}.ant-menu-dark.ant-menu-horizontal>.ant-menu-item>a:before{bottom:0}.ant-menu-dark .ant-menu-item,.ant-menu-dark .ant-menu-item-group-title,.ant-menu-dark .ant-menu-item>a,.ant-menu-dark .ant-menu-item>span>a{color:hsla(0,0%,100%,.65)}.ant-menu-dark.ant-menu-inline,.ant-menu-dark.ant-menu-vertical,.ant-menu-dark.ant-menu-vertical-left,.ant-menu-dark.ant-menu-vertical-right{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-vertical .ant-menu-item,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item{border-right:0;left:0;margin-left:0}.ant-menu-dark.ant-menu-inline .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-dark.ant-menu-vertical-right .ant-menu-item:after{border-right:0}.ant-menu-dark.ant-menu-inline .ant-menu-item,.ant-menu-dark.ant-menu-inline .ant-menu-submenu-title{width:100%}.ant-menu-dark .ant-menu-item-active,.ant-menu-dark .ant-menu-item:hover,.ant-menu-dark .ant-menu-submenu-active,.ant-menu-dark .ant-menu-submenu-open,.ant-menu-dark .ant-menu-submenu-selected,.ant-menu-dark .ant-menu-submenu-title:hover{background-color:transparent;color:#fff}.ant-menu-dark .ant-menu-item-active>a,.ant-menu-dark .ant-menu-item-active>span>a,.ant-menu-dark .ant-menu-item:hover>a,.ant-menu-dark .ant-menu-item:hover>span>a,.ant-menu-dark .ant-menu-submenu-active>a,.ant-menu-dark .ant-menu-submenu-active>span>a,.ant-menu-dark .ant-menu-submenu-open>a,.ant-menu-dark .ant-menu-submenu-open>span>a,.ant-menu-dark .ant-menu-submenu-selected>a,.ant-menu-dark .ant-menu-submenu-selected>span>a,.ant-menu-dark .ant-menu-submenu-title:hover>a,.ant-menu-dark .ant-menu-submenu-title:hover>span>a{color:#fff}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow{opacity:1}.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-active>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-open>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-selected>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-title:hover>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:#fff}.ant-menu-dark .ant-menu-item:hover{background-color:transparent}.ant-menu-dark.ant-menu-dark:not(.ant-menu-horizontal) .ant-menu-item-selected{background-color:#1890ff}.ant-menu-dark .ant-menu-item-selected{border-right:0;color:#fff}.ant-menu-dark .ant-menu-item-selected:after{border-right:0}.ant-menu-dark .ant-menu-item-selected .ant-menu-item-icon,.ant-menu-dark .ant-menu-item-selected .ant-menu-item-icon+span,.ant-menu-dark .ant-menu-item-selected .anticon,.ant-menu-dark .ant-menu-item-selected .anticon+span,.ant-menu-dark .ant-menu-item-selected>a,.ant-menu-dark .ant-menu-item-selected>a:hover,.ant-menu-dark .ant-menu-item-selected>span>a,.ant-menu-dark .ant-menu-item-selected>span>a:hover{color:#fff}.ant-menu-submenu-popup.ant-menu-dark .ant-menu-item-selected,.ant-menu.ant-menu-dark .ant-menu-item-selected{background-color:#1890ff}.ant-menu-dark .ant-menu-item-disabled,.ant-menu-dark .ant-menu-item-disabled>a,.ant-menu-dark .ant-menu-item-disabled>span>a,.ant-menu-dark .ant-menu-submenu-disabled,.ant-menu-dark .ant-menu-submenu-disabled>a,.ant-menu-dark .ant-menu-submenu-disabled>span>a{color:hsla(0,0%,100%,.35)!important;opacity:.8}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title{color:hsla(0,0%,100%,.35)!important}.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-item-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:after,.ant-menu-dark .ant-menu-submenu-disabled>.ant-menu-submenu-title>.ant-menu-submenu-arrow:before{background:hsla(0,0%,100%,.35)!important}.ant-menu.ant-menu-rtl{direction:rtl;text-align:right}.ant-menu-rtl .ant-menu-item-group-title{text-align:right}.ant-menu-rtl.ant-menu-inline,.ant-menu-rtl.ant-menu-vertical{border-left:1px solid #f0f0f0;border-right:none}.ant-menu-rtl.ant-menu-dark.ant-menu-inline,.ant-menu-rtl.ant-menu-dark.ant-menu-vertical{border-left:none}.ant-menu-rtl.ant-menu-vertical-left.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical-left.ant-menu-sub>.ant-menu-submenu,.ant-menu-rtl.ant-menu-vertical-right.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical-right.ant-menu-sub>.ant-menu-submenu,.ant-menu-rtl.ant-menu-vertical.ant-menu-sub>.ant-menu-item,.ant-menu-rtl.ant-menu-vertical.ant-menu-sub>.ant-menu-submenu{transform-origin:top right}.ant-menu-rtl .ant-menu-item .ant-menu-item-icon,.ant-menu-rtl .ant-menu-item .anticon,.ant-menu-rtl .ant-menu-submenu-title .ant-menu-item-icon,.ant-menu-rtl .ant-menu-submenu-title .anticon{margin-left:10px;margin-right:auto}.ant-menu-rtl .ant-menu-item.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-rtl .ant-menu-item.ant-menu-item-only-child>.anticon,.ant-menu-rtl .ant-menu-submenu-title.ant-menu-item-only-child>.ant-menu-item-icon,.ant-menu-rtl .ant-menu-submenu-title.ant-menu-item-only-child>.anticon{margin-left:0}.ant-menu-submenu-rtl.ant-menu-submenu-popup{transform-origin:100% 0}.ant-menu-rtl .ant-menu-submenu-inline>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow{left:16px;right:auto}.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:before,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:before{transform:rotate(-45deg) translateY(-2px)}.ant-menu-rtl .ant-menu-submenu-vertical-left>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-rtl .ant-menu-submenu-vertical-right>.ant-menu-submenu-title .ant-menu-submenu-arrow:after,.ant-menu-rtl .ant-menu-submenu-vertical>.ant-menu-submenu-title .ant-menu-submenu-arrow:after{transform:rotate(45deg) translateY(2px)}.ant-menu-rtl.ant-menu-inline .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-item:after,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-item:after{left:0;right:auto}.ant-menu-rtl.ant-menu-inline .ant-menu-item,.ant-menu-rtl.ant-menu-inline .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical .ant-menu-item,.ant-menu-rtl.ant-menu-vertical .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-item,.ant-menu-rtl.ant-menu-vertical-left .ant-menu-submenu-title,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-item,.ant-menu-rtl.ant-menu-vertical-right .ant-menu-submenu-title{text-align:right}.ant-menu-rtl.ant-menu-inline .ant-menu-submenu-title{padding-left:34px;padding-right:0}.ant-menu-rtl.ant-menu-vertical .ant-menu-submenu-title{padding-left:34px;padding-right:16px}.ant-menu-rtl.ant-menu-inline-collapsed.ant-menu-vertical .ant-menu-submenu-title{padding:0 calc(50% - 8px)}.ant-menu-rtl .ant-menu-item-group-list .ant-menu-item,.ant-menu-rtl .ant-menu-item-group-list .ant-menu-submenu-title{padding:0 28px 0 16px}.ant-menu-sub.ant-menu-inline{border:0}.ant-menu-rtl.ant-menu-sub.ant-menu-inline .ant-menu-item-group-title{padding-left:0;padding-right:32px}.ant-message{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;left:0;line-height:1.5715;list-style:none;margin:0;padding:0;pointer-events:none;position:fixed;top:8px;width:100%;z-index:1010}.ant-message-notice{padding:8px;text-align:center}.ant-message-notice-content{background:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);display:inline-block;padding:10px 16px;pointer-events:all}.ant-message-success .anticon{color:#52c41a}.ant-message-error .anticon{color:#ff4d4f}.ant-message-warning .anticon{color:#faad14}.ant-message-info .anticon,.ant-message-loading .anticon{color:#1890ff}.ant-message .anticon{font-size:16px;margin-right:8px;position:relative;top:1px}.ant-message-notice.ant-move-up-leave.ant-move-up-leave-active{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-name:MessageMoveOut;animation-name:MessageMoveOut}@-webkit-keyframes MessageMoveOut{0%{max-height:150px;opacity:1;padding:8px}to{max-height:0;opacity:0;padding:0}}@keyframes MessageMoveOut{0%{max-height:150px;opacity:1;padding:8px}to{max-height:0;opacity:0;padding:0}}.ant-message-rtl,.ant-message-rtl span{direction:rtl}.ant-message-rtl .anticon{margin-left:8px;margin-right:0}.ant-modal{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 auto;max-width:calc(100vw - 32px);padding:0 0 24px;pointer-events:none;position:relative;top:100px;width:auto}.ant-modal.ant-zoom-appear,.ant-modal.ant-zoom-enter{-webkit-animation-duration:.3s;animation-duration:.3s;opacity:0;transform:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-modal-mask{background-color:rgba(0,0,0,.45);bottom:0;height:100%;left:0;position:fixed;right:0;top:0;z-index:1000}.ant-modal-mask-hidden{display:none}.ant-modal-wrap{bottom:0;left:0;outline:0;overflow:auto;position:fixed;right:0;top:0;z-index:1000}.ant-modal-title{word-wrap:break-word;color:rgba(0,0,0,.85);font-size:16px;font-weight:500;line-height:22px;margin:0}.ant-modal-content{background-clip:padding-box;background-color:#fff;border:0;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);pointer-events:auto;position:relative}.ant-modal-close{background:transparent;border:0;color:rgba(0,0,0,.45);cursor:pointer;font-weight:700;line-height:1;outline:0;padding:0;position:absolute;right:0;text-decoration:none;top:0;transition:color .3s;z-index:10}.ant-modal-close-x{text-rendering:auto;display:block;font-size:16px;font-style:normal;height:54px;line-height:54px;text-align:center;text-transform:none;width:54px}.ant-modal-close:focus,.ant-modal-close:hover{color:rgba(0,0,0,.75);text-decoration:none}.ant-modal-header{background:#fff;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0;color:rgba(0,0,0,.85);padding:16px 24px}.ant-modal-body{word-wrap:break-word;font-size:14px;line-height:1.5715;padding:24px}.ant-modal-footer{background:transparent;border-radius:0 0 2px 2px;border-top:1px solid #f0f0f0;padding:10px 16px;text-align:right}.ant-modal-footer .ant-btn+.ant-btn:not(.ant-dropdown-trigger){margin-bottom:0;margin-left:8px}.ant-modal-open{overflow:hidden}.ant-modal-centered{text-align:center}.ant-modal-centered:before{content:"";display:inline-block;height:100%;vertical-align:middle;width:0}.ant-modal-centered .ant-modal{display:inline-block;padding-bottom:0;text-align:left;top:0;vertical-align:middle}@media(max-width:767px){.ant-modal{margin:8px auto;max-width:calc(100vw - 16px)}.ant-modal-centered .ant-modal{flex:1}}.ant-modal-confirm .ant-modal-header{display:none}.ant-modal-confirm .ant-modal-body{padding:32px 32px 24px}.ant-modal-confirm-body-wrapper:before{content:"";display:table}.ant-modal-confirm-body-wrapper:after{clear:both;content:"";display:table}.ant-modal-confirm-body .ant-modal-confirm-title{color:rgba(0,0,0,.85);display:block;font-size:16px;font-weight:500;line-height:1.4;overflow:hidden}.ant-modal-confirm-body .ant-modal-confirm-content{color:rgba(0,0,0,.85);font-size:14px;margin-top:8px}.ant-modal-confirm-body>.anticon{float:left;font-size:22px;margin-right:16px}.ant-modal-confirm-body>.anticon+.ant-modal-confirm-title+.ant-modal-confirm-content{margin-left:38px}.ant-modal-confirm .ant-modal-confirm-btns{margin-top:24px;text-align:right}.ant-modal-confirm .ant-modal-confirm-btns .ant-btn+.ant-btn{margin-bottom:0;margin-left:8px}.ant-modal-confirm-error .ant-modal-confirm-body>.anticon{color:#ff4d4f}.ant-modal-confirm-confirm .ant-modal-confirm-body>.anticon,.ant-modal-confirm-warning .ant-modal-confirm-body>.anticon{color:#faad14}.ant-modal-confirm-info .ant-modal-confirm-body>.anticon{color:#1890ff}.ant-modal-confirm-success .ant-modal-confirm-body>.anticon{color:#52c41a}.ant-modal-wrap-rtl{direction:rtl}.ant-modal-wrap-rtl .ant-modal-close{left:0;right:auto}.ant-modal-wrap-rtl .ant-modal-footer{text-align:left}.ant-modal-wrap-rtl .ant-modal-footer .ant-btn+.ant-btn{margin-left:0;margin-right:8px}.ant-modal-wrap-rtl .ant-modal-confirm-body{direction:rtl}.ant-modal-wrap-rtl .ant-modal-confirm-body>.anticon{float:right;margin-left:16px;margin-right:0}.ant-modal-wrap-rtl .ant-modal-confirm-body>.anticon+.ant-modal-confirm-title+.ant-modal-confirm-content{margin-left:0;margin-right:38px}.ant-modal-wrap-rtl .ant-modal-confirm-btns{text-align:left}.ant-modal-wrap-rtl .ant-modal-confirm-btns .ant-btn+.ant-btn{margin-left:0;margin-right:8px}.ant-modal-wrap-rtl.ant-modal-centered .ant-modal{text-align:right}.ant-notification{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 24px 0 0;padding:0;position:fixed;z-index:1010}.ant-notification-close-icon{cursor:pointer;font-size:14px}.ant-notification-hook-holder{position:relative}.ant-notification-notice{word-wrap:break-word;background:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);line-height:1.5715;margin-bottom:16px;margin-left:auto;max-width:calc(100vw - 48px);overflow:hidden;padding:16px 24px;position:relative;width:384px}.ant-notification-bottom .ant-notification-notice,.ant-notification-top .ant-notification-notice{margin-left:auto;margin-right:auto}.ant-notification-bottomLeft .ant-notification-notice,.ant-notification-topLeft .ant-notification-notice{margin-left:0;margin-right:auto}.ant-notification-notice-message{color:rgba(0,0,0,.85);font-size:16px;line-height:24px;margin-bottom:8px}.ant-notification-notice-message-single-line-auto-margin{background-color:transparent;display:block;max-width:4px;pointer-events:none;width:calc(264px - 100%)}.ant-notification-notice-message-single-line-auto-margin:before{content:"";display:block}.ant-notification-notice-description{font-size:14px}.ant-notification-notice-closable .ant-notification-notice-message{padding-right:24px}.ant-notification-notice-with-icon .ant-notification-notice-message{font-size:16px;margin-bottom:4px;margin-left:48px}.ant-notification-notice-with-icon .ant-notification-notice-description{font-size:14px;margin-left:48px}.ant-notification-notice-icon{font-size:24px;line-height:24px;margin-left:4px;position:absolute}.anticon.ant-notification-notice-icon-success{color:#52c41a}.anticon.ant-notification-notice-icon-info{color:#1890ff}.anticon.ant-notification-notice-icon-warning{color:#faad14}.anticon.ant-notification-notice-icon-error{color:#ff4d4f}.ant-notification-notice-close{color:rgba(0,0,0,.45);outline:none;position:absolute;right:22px;top:16px}.ant-notification-notice-close:hover{color:rgba(0,0,0,.67)}.ant-notification-notice-btn{float:right;margin-top:16px}.ant-notification .notification-fade-effect{-webkit-animation-duration:.24s;animation-duration:.24s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-timing-function:cubic-bezier(.645,.045,.355,1)}.ant-notification-fade-appear,.ant-notification-fade-enter{-webkit-animation-play-state:paused;animation-play-state:paused;opacity:0}.ant-notification-fade-appear,.ant-notification-fade-enter,.ant-notification-fade-leave{-webkit-animation-duration:.24s;animation-duration:.24s;-webkit-animation-fill-mode:both;animation-fill-mode:both;-webkit-animation-timing-function:cubic-bezier(.645,.045,.355,1);animation-timing-function:cubic-bezier(.645,.045,.355,1)}.ant-notification-fade-leave{-webkit-animation-duration:.2s;animation-duration:.2s;-webkit-animation-play-state:paused;animation-play-state:paused}.ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationFadeIn;animation-name:NotificationFadeIn;-webkit-animation-play-state:running;animation-play-state:running}.ant-notification-fade-leave.ant-notification-fade-leave-active{-webkit-animation-name:NotificationFadeOut;animation-name:NotificationFadeOut;-webkit-animation-play-state:running;animation-play-state:running}@-webkit-keyframes NotificationFadeIn{0%{left:384px;opacity:0}to{left:0;opacity:1}}@keyframes NotificationFadeIn{0%{left:384px;opacity:0}to{left:0;opacity:1}}@-webkit-keyframes NotificationFadeOut{0%{margin-bottom:16px;max-height:150px;opacity:1}to{margin-bottom:0;max-height:0;opacity:0;padding-bottom:0;padding-top:0}}@keyframes NotificationFadeOut{0%{margin-bottom:16px;max-height:150px;opacity:1}to{margin-bottom:0;max-height:0;opacity:0;padding-bottom:0;padding-top:0}}.ant-notification-rtl{direction:rtl}.ant-notification-rtl .ant-notification-notice-closable .ant-notification-notice-message{padding-left:24px;padding-right:0}.ant-notification-rtl .ant-notification-notice-with-icon .ant-notification-notice-description,.ant-notification-rtl .ant-notification-notice-with-icon .ant-notification-notice-message{margin-left:0;margin-right:48px}.ant-notification-rtl .ant-notification-notice-icon{margin-left:0;margin-right:4px}.ant-notification-rtl .ant-notification-notice-close{left:22px;right:auto}.ant-notification-rtl .ant-notification-notice-btn{float:left}.ant-notification-bottom,.ant-notification-top{margin-left:0;margin-right:0}.ant-notification-top .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-top .ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationTopFadeIn;animation-name:NotificationTopFadeIn}.ant-notification-bottom .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-bottom .ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationBottomFadeIn;animation-name:NotificationBottomFadeIn}.ant-notification-bottomLeft,.ant-notification-topLeft{margin-left:24px;margin-right:0}.ant-notification-bottomLeft .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-bottomLeft .ant-notification-fade-enter.ant-notification-fade-enter-active,.ant-notification-topLeft .ant-notification-fade-appear.ant-notification-fade-appear-active,.ant-notification-topLeft .ant-notification-fade-enter.ant-notification-fade-enter-active{-webkit-animation-name:NotificationLeftFadeIn;animation-name:NotificationLeftFadeIn}@-webkit-keyframes NotificationTopFadeIn{0%{margin-top:-100%;opacity:0}to{margin-top:0;opacity:1}}@keyframes NotificationTopFadeIn{0%{margin-top:-100%;opacity:0}to{margin-top:0;opacity:1}}@-webkit-keyframes NotificationBottomFadeIn{0%{margin-bottom:-100%;opacity:0}to{margin-bottom:0;opacity:1}}@keyframes NotificationBottomFadeIn{0%{margin-bottom:-100%;opacity:0}to{margin-bottom:0;opacity:1}}@-webkit-keyframes NotificationLeftFadeIn{0%{opacity:0;right:384px}to{opacity:1;right:0}}@keyframes NotificationLeftFadeIn{0%{opacity:0;right:384px}to{opacity:1;right:0}}.ant-page-header{font-feature-settings:"tnum";background-color:#fff;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:16px 24px;position:relative}.ant-page-header-ghost{background-color:inherit}.ant-page-header.has-breadcrumb{padding-top:12px}.ant-page-header.has-footer{padding-bottom:0}.ant-page-header-back{font-size:16px;line-height:1;margin-right:16px}.ant-page-header-back-button{color:#1890ff;color:#000;cursor:pointer;outline:none;text-decoration:none;transition:color .3s}.ant-page-header-back-button:focus,.ant-page-header-back-button:hover{color:#40a9ff}.ant-page-header-back-button:active{color:#096dd9}.ant-page-header .ant-divider-vertical{height:14px;margin:0 12px;vertical-align:middle}.ant-breadcrumb+.ant-page-header-heading{margin-top:8px}.ant-page-header-heading{display:flex;justify-content:space-between}.ant-page-header-heading-left{align-items:center;display:flex;margin:4px 0;overflow:hidden}.ant-page-header-heading-title{color:rgba(0,0,0,.85);font-size:20px;font-weight:600;line-height:32px;margin-bottom:0;margin-right:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-page-header-heading .ant-avatar{margin-right:12px}.ant-page-header-heading-sub-title{color:rgba(0,0,0,.45);font-size:14px;line-height:1.5715;margin-right:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-page-header-heading-extra{margin:4px 0;white-space:nowrap}.ant-page-header-heading-extra>*{white-space:unset}.ant-page-header-content{padding-top:12px}.ant-page-header-footer{margin-top:16px}.ant-page-header-footer .ant-tabs>.ant-tabs-nav{margin:0}.ant-page-header-footer .ant-tabs>.ant-tabs-nav:before{border:none}.ant-page-header-footer .ant-tabs .ant-tabs-tab{font-size:16px;padding-bottom:8px;padding-top:8px}.ant-page-header-compact .ant-page-header-heading{flex-wrap:wrap}.ant-page-header-rtl{direction:rtl}.ant-page-header-rtl .ant-page-header-back{float:right;margin-left:16px;margin-right:0}.ant-page-header-rtl .ant-page-header-heading .ant-avatar,.ant-page-header-rtl .ant-page-header-heading-title{margin-left:12px;margin-right:0}.ant-page-header-rtl .ant-page-header-heading-sub-title{float:right;margin-left:12px;margin-right:0}.ant-page-header-rtl .ant-page-header-heading-tags{float:right}.ant-page-header-rtl .ant-page-header-heading-extra{float:left}.ant-page-header-rtl .ant-page-header-heading-extra>*{margin-left:0;margin-right:12px}.ant-page-header-rtl .ant-page-header-heading-extra>:first-child{margin-right:0}.ant-page-header-rtl .ant-page-header-footer .ant-tabs-bar .ant-tabs-nav{float:right}.ant-pagination{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715}.ant-pagination,.ant-pagination ol,.ant-pagination ul{list-style:none;margin:0;padding:0}.ant-pagination:after{clear:both;content:" ";display:block;height:0;overflow:hidden;visibility:hidden}.ant-pagination-item,.ant-pagination-total-text{display:inline-block;height:32px;line-height:30px;margin-right:8px;vertical-align:middle}.ant-pagination-item{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;cursor:pointer;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;list-style:none;min-width:32px;outline:0;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-item a{color:rgba(0,0,0,.85);display:block;padding:0 6px;transition:none}.ant-pagination-item a:hover{text-decoration:none}.ant-pagination-item:hover{border-color:#1890ff;transition:all .3s}.ant-pagination-item:hover a{color:#1890ff}.ant-pagination-item:focus-visible{border-color:#1890ff;transition:all .3s}.ant-pagination-item:focus-visible a{color:#1890ff}.ant-pagination-item-active{background:#fff;border-color:#1890ff;font-weight:500}.ant-pagination-item-active a{color:#1890ff}.ant-pagination-item-active:focus-visible,.ant-pagination-item-active:hover{border-color:#40a9ff}.ant-pagination-item-active:focus-visible a,.ant-pagination-item-active:hover a{color:#40a9ff}.ant-pagination-jump-next,.ant-pagination-jump-prev{outline:0}.ant-pagination-jump-next .ant-pagination-item-container,.ant-pagination-jump-prev .ant-pagination-item-container{position:relative}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon{color:#1890ff;font-size:12px;letter-spacing:-1px;opacity:0;transition:all .2s}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-link-icon-svg,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-link-icon-svg{bottom:0;left:0;margin:auto;right:0;top:0}.ant-pagination-jump-next .ant-pagination-item-container .ant-pagination-item-ellipsis,.ant-pagination-jump-prev .ant-pagination-item-container .ant-pagination-item-ellipsis{bottom:0;color:rgba(0,0,0,.25);display:block;font-family:Arial,Helvetica,sans-serif;left:0;letter-spacing:2px;margin:auto;opacity:1;position:absolute;right:0;text-align:center;text-indent:.13em;top:0;transition:all .2s}.ant-pagination-jump-next:hover .ant-pagination-item-link-icon,.ant-pagination-jump-prev:hover .ant-pagination-item-link-icon{opacity:1}.ant-pagination-jump-next:hover .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:hover .ant-pagination-item-ellipsis{opacity:0}.ant-pagination-jump-next:focus-visible .ant-pagination-item-link-icon,.ant-pagination-jump-prev:focus-visible .ant-pagination-item-link-icon{opacity:1}.ant-pagination-jump-next:focus-visible .ant-pagination-item-ellipsis,.ant-pagination-jump-prev:focus-visible .ant-pagination-item-ellipsis{opacity:0}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-prev{margin-right:8px}.ant-pagination-jump-next,.ant-pagination-jump-prev,.ant-pagination-next,.ant-pagination-prev{border-radius:2px;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;height:32px;line-height:32px;list-style:none;min-width:32px;text-align:center;transition:all .3s;vertical-align:middle}.ant-pagination-next,.ant-pagination-prev{font-family:Arial,Helvetica,sans-serif;outline:0}.ant-pagination-next button,.ant-pagination-prev button{color:rgba(0,0,0,.85);cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-next:hover button,.ant-pagination-prev:hover button{border-color:#40a9ff}.ant-pagination-next .ant-pagination-item-link,.ant-pagination-prev .ant-pagination-item-link{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;display:block;font-size:12px;height:100%;outline:none;padding:0;text-align:center;transition:all .3s;width:100%}.ant-pagination-next:focus-visible .ant-pagination-item-link,.ant-pagination-next:hover .ant-pagination-item-link,.ant-pagination-prev:focus-visible .ant-pagination-item-link,.ant-pagination-prev:hover .ant-pagination-item-link{border-color:#1890ff;color:#1890ff}.ant-pagination-disabled,.ant-pagination-disabled:hover{cursor:not-allowed}.ant-pagination-disabled .ant-pagination-item-link,.ant-pagination-disabled:hover .ant-pagination-item-link{border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination-disabled:focus-visible{cursor:not-allowed}.ant-pagination-disabled:focus-visible .ant-pagination-item-link{border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination-slash{margin:0 10px 0 5px}.ant-pagination-options{display:inline-block;margin-left:16px;vertical-align:middle}@media(-ms-high-contrast:none){.ant-pagination-options,.ant-pagination-options ::-ms-backdrop{vertical-align:top}}.ant-pagination-options-size-changer.ant-select{display:inline-block;width:auto}.ant-pagination-options-quick-jumper{display:inline-block;height:32px;line-height:32px;margin-left:8px;vertical-align:top}.ant-pagination-options-quick-jumper input{background-color:#fff;background-image:none;border:1px solid #d9d9d9;border-radius:2px;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;height:32px;line-height:1.5715;margin:0 8px;min-width:0;padding:4px 11px;position:relative;transition:all .3s;width:100%;width:50px}.ant-pagination-options-quick-jumper input::-moz-placeholder{color:#bfbfbf;-moz-user-select:none;user-select:none}.ant-pagination-options-quick-jumper input:-ms-input-placeholder{color:#bfbfbf;-ms-user-select:none;user-select:none}.ant-pagination-options-quick-jumper input::placeholder{color:#bfbfbf;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-pagination-options-quick-jumper input:-moz-placeholder-shown{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:-ms-input-placeholder{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:placeholder-shown{text-overflow:ellipsis}.ant-pagination-options-quick-jumper input:hover{border-color:#40a9ff;border-right-width:1px}.ant-pagination-options-quick-jumper input-focused,.ant-pagination-options-quick-jumper input:focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-pagination-options-quick-jumper input-disabled{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-pagination-options-quick-jumper input-disabled:hover{border-color:#d9d9d9;border-right-width:1px}.ant-pagination-options-quick-jumper input[disabled]{background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25);cursor:not-allowed;opacity:1}.ant-pagination-options-quick-jumper input[disabled]:hover{border-color:#d9d9d9;border-right-width:1px}.ant-pagination-options-quick-jumper input-borderless,.ant-pagination-options-quick-jumper input-borderless-disabled,.ant-pagination-options-quick-jumper input-borderless-focused,.ant-pagination-options-quick-jumper input-borderless:focus,.ant-pagination-options-quick-jumper input-borderless:hover,.ant-pagination-options-quick-jumper input-borderless[disabled]{background-color:transparent;border:none;box-shadow:none}textarea.ant-pagination-options-quick-jumper input{height:auto;line-height:1.5715;max-width:100%;min-height:32px;transition:all .3s,height 0s;vertical-align:bottom}.ant-pagination-options-quick-jumper input-lg{font-size:16px;padding:6.5px 11px}.ant-pagination-options-quick-jumper input-sm{padding:0 7px}.ant-pagination-simple .ant-pagination-next,.ant-pagination-simple .ant-pagination-prev{height:24px;line-height:24px;vertical-align:top}.ant-pagination-simple .ant-pagination-next .ant-pagination-item-link,.ant-pagination-simple .ant-pagination-prev .ant-pagination-item-link{background-color:transparent;border:0;height:24px}.ant-pagination-simple .ant-pagination-next .ant-pagination-item-link:after,.ant-pagination-simple .ant-pagination-prev .ant-pagination-item-link:after{height:24px;line-height:24px}.ant-pagination-simple .ant-pagination-simple-pager{display:inline-block;height:24px;margin-right:8px}.ant-pagination-simple .ant-pagination-simple-pager input{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;height:100%;margin-right:8px;outline:none;padding:0 6px;text-align:center;transition:border-color .3s}.ant-pagination-simple .ant-pagination-simple-pager input:hover{border-color:#1890ff}.ant-pagination-simple .ant-pagination-simple-pager input:focus{border-color:#40a9ff;box-shadow:0 0 0 2px rgba(24,144,255,.2)}.ant-pagination-simple .ant-pagination-simple-pager input[disabled]{background:#f5f5f5;border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination.ant-pagination-mini .ant-pagination-simple-pager,.ant-pagination.ant-pagination-mini .ant-pagination-total-text{height:24px;line-height:24px}.ant-pagination.ant-pagination-mini .ant-pagination-item{height:24px;line-height:22px;margin:0;min-width:24px}.ant-pagination.ant-pagination-mini .ant-pagination-item:not(.ant-pagination-item-active){background:transparent;border-color:transparent}.ant-pagination.ant-pagination-mini .ant-pagination-next,.ant-pagination.ant-pagination-mini .ant-pagination-prev{height:24px;line-height:24px;margin:0;min-width:24px}.ant-pagination.ant-pagination-mini .ant-pagination-next .ant-pagination-item-link,.ant-pagination.ant-pagination-mini .ant-pagination-prev .ant-pagination-item-link{background:transparent;border-color:transparent}.ant-pagination.ant-pagination-mini .ant-pagination-next .ant-pagination-item-link:after,.ant-pagination.ant-pagination-mini .ant-pagination-prev .ant-pagination-item-link:after{height:24px;line-height:24px}.ant-pagination.ant-pagination-mini .ant-pagination-jump-next,.ant-pagination.ant-pagination-mini .ant-pagination-jump-prev{height:24px;line-height:24px;margin-right:0}.ant-pagination.ant-pagination-mini .ant-pagination-options{margin-left:2px}.ant-pagination.ant-pagination-mini .ant-pagination-options-size-changer{top:0}.ant-pagination.ant-pagination-mini .ant-pagination-options-quick-jumper{height:24px;line-height:24px}.ant-pagination.ant-pagination-mini .ant-pagination-options-quick-jumper input{height:24px;padding:0 7px;width:44px}.ant-pagination.ant-pagination-disabled{cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item{background:#f5f5f5;border-color:#d9d9d9;cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item a{background:transparent;border:none;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination.ant-pagination-disabled .ant-pagination-item-active{background:#e6e6e6}.ant-pagination.ant-pagination-disabled .ant-pagination-item-active a{color:rgba(0,0,0,.25)}.ant-pagination.ant-pagination-disabled .ant-pagination-item-link{background:#f5f5f5;border-color:#d9d9d9;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-pagination-simple.ant-pagination.ant-pagination-disabled .ant-pagination-item-link{background:transparent}.ant-pagination.ant-pagination-disabled .ant-pagination-item-link-icon{opacity:0}.ant-pagination.ant-pagination-disabled .ant-pagination-item-ellipsis{opacity:1}.ant-pagination.ant-pagination-disabled .ant-pagination-simple-pager{color:rgba(0,0,0,.25)}@media only screen and (max-width:992px){.ant-pagination-item-after-jump-prev,.ant-pagination-item-before-jump-next{display:none}}@media only screen and (max-width:576px){.ant-pagination-options{display:none}}.ant-pagination-rtl .ant-pagination-item,.ant-pagination-rtl .ant-pagination-jump-next,.ant-pagination-rtl .ant-pagination-jump-prev,.ant-pagination-rtl .ant-pagination-prev,.ant-pagination-rtl .ant-pagination-total-text{margin-left:8px;margin-right:0}.ant-pagination-rtl .ant-pagination-slash{margin:0 5px 0 10px}.ant-pagination-rtl .ant-pagination-options{margin-left:0;margin-right:16px}.ant-pagination-rtl .ant-pagination-options .ant-pagination-options-size-changer.ant-select{margin-left:8px;margin-right:0}.ant-pagination-rtl .ant-pagination-options .ant-pagination-options-quick-jumper{margin-left:0}.ant-pagination-rtl.ant-pagination-simple .ant-pagination-simple-pager,.ant-pagination-rtl.ant-pagination-simple .ant-pagination-simple-pager input{margin-left:8px;margin-right:0}.ant-pagination-rtl.ant-pagination.mini .ant-pagination-options{margin-left:0;margin-right:2px}.ant-popconfirm{z-index:1060}.ant-popover{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:auto;font-size:14px;font-variant:tabular-nums;font-weight:400;left:0;line-height:1.5715;list-style:none;margin:0;padding:0;position:absolute;text-align:left;top:0;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;white-space:normal;z-index:1030}.ant-popover-content{position:relative}.ant-popover:after{background:hsla(0,0%,100%,.01);content:"";position:absolute}.ant-popover-hidden{display:none}.ant-popover-placement-top,.ant-popover-placement-topLeft,.ant-popover-placement-topRight{padding-bottom:15.3137085px}.ant-popover-placement-right,.ant-popover-placement-rightBottom,.ant-popover-placement-rightTop{padding-left:15.3137085px}.ant-popover-placement-bottom,.ant-popover-placement-bottomLeft,.ant-popover-placement-bottomRight{padding-top:15.3137085px}.ant-popover-placement-left,.ant-popover-placement-leftBottom,.ant-popover-placement-leftTop{padding-right:15.3137085px}.ant-popover-inner{background-clip:padding-box;background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-shadow:0 0 8px rgba(0,0,0,.15)\9}@media(-ms-high-contrast:none),screen and (-ms-high-contrast:active){.ant-popover-inner{box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05)}}.ant-popover-title{border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.85);font-weight:500;margin:0;min-height:32px;min-width:177px;padding:5px 16px 4px}.ant-popover-inner-content{color:rgba(0,0,0,.85);padding:12px 16px}.ant-popover-message{color:rgba(0,0,0,.85);font-size:14px;padding:4px 0 12px;position:relative}.ant-popover-message>.anticon{color:#faad14;font-size:14px;position:absolute;top:8.0005px}.ant-popover-message-title{padding-left:22px}.ant-popover-buttons{margin-bottom:4px;text-align:right}.ant-popover-buttons button{margin-left:8px}.ant-popover-arrow{background:transparent;display:block;height:22px;overflow:hidden;pointer-events:none;position:absolute;width:22px}.ant-popover-arrow-content{--antd-arrow-background-color:#fff;border-radius:0 0 2px;bottom:0;content:"";display:block;height:11.3137085px;left:0;margin:auto;pointer-events:auto;pointer-events:none;position:absolute;right:0;top:0;width:11.3137085px}.ant-popover-arrow-content:before{background:var(--antd-arrow-background-color);background-position:-10px -10px;background-repeat:no-repeat;-webkit-clip-path:inset(33% 33%);clip-path:inset(33% 33%);-webkit-clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");content:"";height:33.9411255px;left:-11.3137085px;position:absolute;top:-11.3137085px;width:33.9411255px}.ant-popover-placement-top .ant-popover-arrow,.ant-popover-placement-topLeft .ant-popover-arrow,.ant-popover-placement-topRight .ant-popover-arrow{bottom:0;transform:translateY(100%)}.ant-popover-placement-top .ant-popover-arrow-content,.ant-popover-placement-topLeft .ant-popover-arrow-content,.ant-popover-placement-topRight .ant-popover-arrow-content{box-shadow:3px 3px 7px rgba(0,0,0,.07);transform:translateY(-11px) rotate(45deg)}.ant-popover-placement-top .ant-popover-arrow{left:50%;transform:translateY(100%) translateX(-50%)}.ant-popover-placement-topLeft .ant-popover-arrow{left:16px}.ant-popover-placement-topRight .ant-popover-arrow{right:16px}.ant-popover-placement-right .ant-popover-arrow,.ant-popover-placement-rightBottom .ant-popover-arrow,.ant-popover-placement-rightTop .ant-popover-arrow{left:0;transform:translateX(-100%)}.ant-popover-placement-right .ant-popover-arrow-content,.ant-popover-placement-rightBottom .ant-popover-arrow-content,.ant-popover-placement-rightTop .ant-popover-arrow-content{box-shadow:3px 3px 7px rgba(0,0,0,.07);transform:translateX(11px) rotate(135deg)}.ant-popover-placement-right .ant-popover-arrow{top:50%;transform:translateX(-100%) translateY(-50%)}.ant-popover-placement-rightTop .ant-popover-arrow{top:12px}.ant-popover-placement-rightBottom .ant-popover-arrow{bottom:12px}.ant-popover-placement-bottom .ant-popover-arrow,.ant-popover-placement-bottomLeft .ant-popover-arrow,.ant-popover-placement-bottomRight .ant-popover-arrow{top:0;transform:translateY(-100%)}.ant-popover-placement-bottom .ant-popover-arrow-content,.ant-popover-placement-bottomLeft .ant-popover-arrow-content,.ant-popover-placement-bottomRight .ant-popover-arrow-content{box-shadow:2px 2px 5px rgba(0,0,0,.06);transform:translateY(11px) rotate(-135deg)}.ant-popover-placement-bottom .ant-popover-arrow{left:50%;transform:translateY(-100%) translateX(-50%)}.ant-popover-placement-bottomLeft .ant-popover-arrow{left:16px}.ant-popover-placement-bottomRight .ant-popover-arrow{right:16px}.ant-popover-placement-left .ant-popover-arrow,.ant-popover-placement-leftBottom .ant-popover-arrow,.ant-popover-placement-leftTop .ant-popover-arrow{right:0;transform:translateX(100%)}.ant-popover-placement-left .ant-popover-arrow-content,.ant-popover-placement-leftBottom .ant-popover-arrow-content,.ant-popover-placement-leftTop .ant-popover-arrow-content{box-shadow:3px 3px 7px rgba(0,0,0,.07);transform:translateX(-11px) rotate(-45deg)}.ant-popover-placement-left .ant-popover-arrow{top:50%;transform:translateX(100%) translateY(-50%)}.ant-popover-placement-leftTop .ant-popover-arrow{top:12px}.ant-popover-placement-leftBottom .ant-popover-arrow{bottom:12px}.ant-popover-magenta .ant-popover-arrow-content,.ant-popover-magenta .ant-popover-inner,.ant-popover-pink .ant-popover-arrow-content,.ant-popover-pink .ant-popover-inner{background-color:#eb2f96}.ant-popover-red .ant-popover-arrow-content,.ant-popover-red .ant-popover-inner{background-color:#f5222d}.ant-popover-volcano .ant-popover-arrow-content,.ant-popover-volcano .ant-popover-inner{background-color:#fa541c}.ant-popover-orange .ant-popover-arrow-content,.ant-popover-orange .ant-popover-inner{background-color:#fa8c16}.ant-popover-yellow .ant-popover-arrow-content,.ant-popover-yellow .ant-popover-inner{background-color:#fadb14}.ant-popover-gold .ant-popover-arrow-content,.ant-popover-gold .ant-popover-inner{background-color:#faad14}.ant-popover-cyan .ant-popover-arrow-content,.ant-popover-cyan .ant-popover-inner{background-color:#13c2c2}.ant-popover-lime .ant-popover-arrow-content,.ant-popover-lime .ant-popover-inner{background-color:#a0d911}.ant-popover-green .ant-popover-arrow-content,.ant-popover-green .ant-popover-inner{background-color:#52c41a}.ant-popover-blue .ant-popover-arrow-content,.ant-popover-blue .ant-popover-inner{background-color:#1890ff}.ant-popover-geekblue .ant-popover-arrow-content,.ant-popover-geekblue .ant-popover-inner{background-color:#2f54eb}.ant-popover-purple .ant-popover-arrow-content,.ant-popover-purple .ant-popover-inner{background-color:#722ed1}.ant-popover-rtl{direction:rtl;text-align:right}.ant-popover-rtl .ant-popover-message-title{padding-left:16px;padding-right:22px}.ant-popover-rtl .ant-popover-buttons{text-align:left}.ant-popover-rtl .ant-popover-buttons button{margin-left:0;margin-right:8px}.ant-progress{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-progress-line{font-size:14px;position:relative;width:100%}.ant-progress-steps{display:inline-block}.ant-progress-steps-outer{align-items:center;display:flex;flex-direction:row}.ant-progress-steps-item{background:#f3f3f3;flex-shrink:0;margin-right:2px;min-width:2px;transition:all .3s}.ant-progress-steps-item-active{background:#1890ff}.ant-progress-small.ant-progress-line,.ant-progress-small.ant-progress-line .ant-progress-text .anticon{font-size:12px}.ant-progress-outer{display:inline-block;margin-right:0;padding-right:0;width:100%}.ant-progress-show-info .ant-progress-outer{margin-right:calc(-2em - 8px);padding-right:calc(2em + 8px)}.ant-progress-inner{background-color:#f5f5f5;border-radius:100px;display:inline-block;overflow:hidden;position:relative;vertical-align:middle;width:100%}.ant-progress-circle-trail{stroke:#f5f5f5}.ant-progress-circle-path{-webkit-animation:ant-progress-appear .3s;animation:ant-progress-appear .3s}.ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#1890ff}.ant-progress-bg,.ant-progress-success-bg{background-color:#1890ff;border-radius:100px;position:relative;transition:all .4s cubic-bezier(.08,.82,.17,1) 0s}.ant-progress-success-bg{background-color:#52c41a;left:0;position:absolute;top:0}.ant-progress-text{color:rgba(0,0,0,.85);display:inline-block;font-size:1em;line-height:1;margin-left:8px;text-align:left;vertical-align:middle;white-space:nowrap;width:2em;word-break:normal}.ant-progress-text .anticon{font-size:14px}.ant-progress-status-active .ant-progress-bg:before{-webkit-animation:ant-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;animation:ant-progress-active 2.4s cubic-bezier(.23,1,.32,1) infinite;background:#fff;border-radius:10px;bottom:0;content:"";left:0;opacity:0;position:absolute;right:0;top:0}.ant-progress-status-exception .ant-progress-bg{background-color:#ff4d4f}.ant-progress-status-exception .ant-progress-text{color:#ff4d4f}.ant-progress-status-exception .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#ff4d4f}.ant-progress-status-success .ant-progress-bg{background-color:#52c41a}.ant-progress-status-success .ant-progress-text{color:#52c41a}.ant-progress-status-success .ant-progress-inner:not(.ant-progress-circle-gradient) .ant-progress-circle-path{stroke:#52c41a}.ant-progress-circle .ant-progress-inner{background-color:transparent;line-height:1;position:relative}.ant-progress-circle .ant-progress-text{color:rgba(0,0,0,.85);font-size:1em;left:50%;line-height:1;margin:0;padding:0;position:absolute;text-align:center;top:50%;transform:translate(-50%,-50%);white-space:normal;width:100%}.ant-progress-circle .ant-progress-text .anticon{font-size:1.16666667em}.ant-progress-circle.ant-progress-status-exception .ant-progress-text{color:#ff4d4f}.ant-progress-circle.ant-progress-status-success .ant-progress-text{color:#52c41a}@-webkit-keyframes ant-progress-active{0%{opacity:.1;transform:translateX(-100%) scaleX(0)}20%{opacity:.5;transform:translateX(-100%) scaleX(0)}to{opacity:0;transform:translateX(0) scaleX(1)}}@keyframes ant-progress-active{0%{opacity:.1;transform:translateX(-100%) scaleX(0)}20%{opacity:.5;transform:translateX(-100%) scaleX(0)}to{opacity:0;transform:translateX(0) scaleX(1)}}.ant-progress-rtl{direction:rtl}.ant-progress-rtl.ant-progress-show-info .ant-progress-outer{margin-left:calc(-2em - 8px);margin-right:0;padding-left:calc(2em + 8px);padding-right:0}.ant-progress-rtl .ant-progress-success-bg{left:auto;right:0}.ant-progress-rtl.ant-progress-line .ant-progress-text,.ant-progress-rtl.ant-progress-steps .ant-progress-text{margin-left:0;margin-right:8px;text-align:right}.ant-radio-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-size:0;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-radio-group .ant-badge-count{z-index:1}.ant-radio-group>.ant-badge:not(:first-child)>.ant-radio-button-wrapper{border-left:none}.ant-radio-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0 8px 0 0;padding:0;position:relative}.ant-radio-wrapper-disabled{cursor:not-allowed}.ant-radio-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-radio-wrapper.ant-radio-wrapper-in-form-item input[type=radio]{height:14px;width:14px}.ant-radio{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em}.ant-radio-input:focus+.ant-radio-inner,.ant-radio-wrapper:hover .ant-radio,.ant-radio:hover .ant-radio-inner{border-color:#1890ff}.ant-radio-input:focus+.ant-radio-inner{box-shadow:0 0 0 3px rgba(24,144,255,.12)}.ant-radio-checked:after{-webkit-animation:antRadioEffect .36s ease-in-out;animation:antRadioEffect .36s ease-in-out;-webkit-animation-fill-mode:both;animation-fill-mode:both;border:1px solid #1890ff;border-radius:50%;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-radio-wrapper:hover .ant-radio:after,.ant-radio:hover:after{visibility:visible}.ant-radio-inner{background-color:#fff;border:1px solid #d9d9d9;border-radius:50%;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-radio-inner:after{background-color:#1890ff;border-left:0;border-radius:16px;border-top:0;content:" ";display:block;height:16px;left:50%;margin-left:-8px;margin-top:-8px;opacity:0;position:absolute;top:50%;transform:scale(0);transition:all .3s cubic-bezier(.78,.14,.15,.86);width:16px}.ant-radio-input{bottom:0;cursor:pointer;left:0;opacity:0;position:absolute;right:0;top:0;z-index:1}.ant-radio.ant-radio-disabled .ant-radio-inner{border-color:#d9d9d9}.ant-radio-checked .ant-radio-inner{border-color:#1890ff}.ant-radio-checked .ant-radio-inner:after{opacity:1;transform:scale(.5);transition:all .3s cubic-bezier(.78,.14,.15,.86)}.ant-radio-disabled{cursor:not-allowed}.ant-radio-disabled .ant-radio-inner{background-color:#f5f5f5;cursor:not-allowed}.ant-radio-disabled .ant-radio-inner:after{background-color:rgba(0,0,0,.2)}.ant-radio-disabled .ant-radio-input{cursor:not-allowed}.ant-radio-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}span.ant-radio+*{padding-left:8px;padding-right:8px}.ant-radio-button-wrapper{background:#fff;border-color:#d9d9d9;border-style:solid;border-width:1.02px 1px 1px 0;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;height:32px;line-height:30px;margin:0;padding:0 15px;position:relative;transition:color .3s,background .3s,border-color .3s,box-shadow .3s}.ant-radio-button-wrapper a{color:rgba(0,0,0,.85)}.ant-radio-button-wrapper>.ant-radio-button{height:100%;left:0;position:absolute;top:0;width:100%;z-index:-1}.ant-radio-group-large .ant-radio-button-wrapper{font-size:16px;height:40px;line-height:38px}.ant-radio-group-small .ant-radio-button-wrapper{height:24px;line-height:22px;padding:0 7px}.ant-radio-button-wrapper:not(:first-child):before{background-color:#d9d9d9;box-sizing:content-box;content:"";display:block;height:100%;left:-1px;padding:1px 0;position:absolute;top:-1px;transition:background-color .3s;width:1px}.ant-radio-button-wrapper:first-child{border-left:1px solid #d9d9d9;border-radius:2px 0 0 2px}.ant-radio-button-wrapper:last-child{border-radius:0 2px 2px 0}.ant-radio-button-wrapper:first-child:last-child{border-radius:2px}.ant-radio-button-wrapper:hover{color:#1890ff;position:relative}.ant-radio-button-wrapper:focus-within{box-shadow:0 0 0 3px rgba(24,144,255,.12)}.ant-radio-button-wrapper .ant-radio-inner,.ant-radio-button-wrapper input[type=checkbox],.ant-radio-button-wrapper input[type=radio]{height:0;opacity:0;pointer-events:none;width:0}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){background:#fff;border-color:#1890ff;color:#1890ff;z-index:1}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):before{background-color:#1890ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):first-child{border-color:#1890ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover{border-color:#40a9ff;color:#40a9ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover:before{background-color:#40a9ff}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active{border-color:#096dd9;color:#096dd9}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active:before{background-color:#096dd9}.ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within{box-shadow:0 0 0 3px rgba(24,144,255,.12)}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled){background:#1890ff;border-color:#1890ff;color:#fff}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):hover{background:#40a9ff;border-color:#40a9ff;color:#fff}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):active{background:#096dd9;border-color:#096dd9;color:#fff}.ant-radio-group-solid .ant-radio-button-wrapper-checked:not(.ant-radio-button-wrapper-disabled):focus-within{box-shadow:0 0 0 3px rgba(24,144,255,.12)}.ant-radio-button-wrapper-disabled{cursor:not-allowed}.ant-radio-button-wrapper-disabled,.ant-radio-button-wrapper-disabled:first-child,.ant-radio-button-wrapper-disabled:hover{background-color:#f5f5f5;border-color:#d9d9d9;color:rgba(0,0,0,.25)}.ant-radio-button-wrapper-disabled:first-child{border-left-color:#d9d9d9}.ant-radio-button-wrapper-disabled.ant-radio-button-wrapper-checked{background-color:#e6e6e6;border-color:#d9d9d9;box-shadow:none;color:rgba(0,0,0,.25)}@-webkit-keyframes antRadioEffect{0%{opacity:.5;transform:scale(1)}to{opacity:0;transform:scale(1.6)}}@keyframes antRadioEffect{0%{opacity:.5;transform:scale(1)}to{opacity:0;transform:scale(1.6)}}.ant-radio-group.ant-radio-group-rtl{direction:rtl}.ant-radio-wrapper.ant-radio-wrapper-rtl{direction:rtl;margin-left:8px;margin-right:0}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl{border-left-width:1px;border-right-width:0}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:not(:first-child):before{left:0;right:-1px}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:first-child{border-radius:0 2px 2px 0;border-right:1px solid #d9d9d9}.ant-radio-button-wrapper-checked:not([class*=" ant-radio-button-wrapper-disabled"]).ant-radio-button-wrapper:first-child{border-right-color:#40a9ff}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper:last-child{border-radius:2px 0 0 2px}.ant-radio-button-wrapper.ant-radio-button-wrapper-rtl.ant-radio-button-wrapper-disabled:first-child{border-right-color:#d9d9d9}.ant-rate{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);color:#fadb14;display:inline-block;font-size:14px;font-size:20px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;outline:none;padding:0}.ant-rate-disabled .ant-rate-star{cursor:default}.ant-rate-disabled .ant-rate-star>div:hover{transform:scale(1)}.ant-rate-star{color:inherit;cursor:pointer;display:inline-block;position:relative}.ant-rate-star:not(:last-child){margin-right:8px}.ant-rate-star>div{transition:all .3s,outline 0s}.ant-rate-star>div:hover{transform:scale(1.1)}.ant-rate-star>div:focus{outline:0}.ant-rate-star>div:focus-visible{outline:1px dashed #fadb14;transform:scale(1.1)}.ant-rate-star-first,.ant-rate-star-second{color:#f0f0f0;transition:all .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-rate-star-first .anticon,.ant-rate-star-second .anticon{vertical-align:middle}.ant-rate-star-first{height:100%;left:0;opacity:0;overflow:hidden;position:absolute;top:0;width:50%}.ant-rate-star-half .ant-rate-star-first,.ant-rate-star-half .ant-rate-star-second{opacity:1}.ant-rate-star-full .ant-rate-star-second,.ant-rate-star-half .ant-rate-star-first{color:inherit}.ant-rate-text{display:inline-block;font-size:14px;margin:0 8px}.ant-rate-rtl{direction:rtl}.ant-rate-rtl .ant-rate-star:not(:last-child){margin-left:8px;margin-right:0}.ant-rate-rtl .ant-rate-star-first{left:auto;right:0}.ant-result{padding:48px 32px}.ant-result-success .ant-result-icon>.anticon{color:#52c41a}.ant-result-error .ant-result-icon>.anticon{color:#ff4d4f}.ant-result-info .ant-result-icon>.anticon{color:#1890ff}.ant-result-warning .ant-result-icon>.anticon{color:#faad14}.ant-result-image{height:295px;margin:auto;width:250px}.ant-result-icon{margin-bottom:24px;text-align:center}.ant-result-icon>.anticon{font-size:72px}.ant-result-title{color:rgba(0,0,0,.85);font-size:24px;line-height:1.8;text-align:center}.ant-result-subtitle{color:rgba(0,0,0,.45);font-size:14px;line-height:1.6;text-align:center}.ant-result-extra{margin:24px 0 0;text-align:center}.ant-result-extra>*{margin-right:8px}.ant-result-extra>:last-child{margin-right:0}.ant-result-content{background-color:#fafafa;margin-top:24px;padding:24px 40px}.ant-result-rtl{direction:rtl}.ant-result-rtl .ant-result-extra>*{margin-left:8px;margin-right:0}.ant-result-rtl .ant-result-extra>:last-child{margin-left:0}.segmented-disabled-item,.segmented-disabled-item:focus,.segmented-disabled-item:hover{color:rgba(0,0,0,.25);cursor:not-allowed}.segmented-item-selected{background-color:#fff;border-radius:2px;box-shadow:0 2px 8px -2px rgba(0,0,0,.05),0 1px 4px -1px rgba(0,0,0,.07),0 0 1px 0 rgba(0,0,0,.08)}.segmented-text-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all}.ant-segmented{font-feature-settings:"tnum";background-color:rgba(0,0,0,.04);border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);color:rgba(0,0,0,.65);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:2px;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-segmented-group{align-items:stretch;display:flex;justify-items:flex-start;position:relative;width:100%}.ant-segmented.ant-segmented-block{display:flex}.ant-segmented.ant-segmented-block .ant-segmented-item{flex:1;min-width:0}.ant-segmented:not(.ant-segmented-disabled):focus,.ant-segmented:not(.ant-segmented-disabled):hover{background-color:rgba(0,0,0,.06)}.ant-segmented-item{cursor:pointer;position:relative;text-align:center;transition:color .3s cubic-bezier(.645,.045,.355,1)}.ant-segmented-item-selected{background-color:#fff;border-radius:2px;box-shadow:0 2px 8px -2px rgba(0,0,0,.05),0 1px 4px -1px rgba(0,0,0,.07),0 0 1px 0 rgba(0,0,0,.08);color:#262626}.ant-segmented-item:focus,.ant-segmented-item:hover{color:#262626}.ant-segmented-item-label{line-height:28px;min-height:28px;overflow:hidden;padding:0 11px;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all}.ant-segmented-item-icon+*{margin-left:6px}.ant-segmented-item-input{height:0;left:0;opacity:0;pointer-events:none;position:absolute;top:0;width:0}.ant-segmented.ant-segmented-lg .ant-segmented-item-label{font-size:16px;line-height:36px;min-height:36px;padding:0 11px}.ant-segmented.ant-segmented-sm .ant-segmented-item-label{line-height:20px;min-height:20px;padding:0 7px}.ant-segmented-item-disabled,.ant-segmented-item-disabled:focus,.ant-segmented-item-disabled:hover{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-segmented-thumb{background-color:#fff;border-radius:2px;box-shadow:0 2px 8px -2px rgba(0,0,0,.05),0 1px 4px -1px rgba(0,0,0,.07),0 0 1px 0 rgba(0,0,0,.08);height:100%;left:0;padding:4px 0;position:absolute;top:0;width:0}.ant-segmented-thumb-motion-appear-active{transition:transform .3s cubic-bezier(.645,.045,.355,1),width .3s cubic-bezier(.645,.045,.355,1);will-change:transform,width}.ant-segmented.ant-segmented-rtl{direction:rtl}.ant-segmented.ant-segmented-rtl .ant-segmented-item-icon{margin-left:6px;margin-right:0}.ant-select-single .ant-select-selector{display:flex}.ant-select-single .ant-select-selector .ant-select-selection-search{bottom:0;left:11px;position:absolute;right:11px;top:0}.ant-select-single .ant-select-selector .ant-select-selection-search-input{width:100%}.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-single .ant-select-selector .ant-select-selection-placeholder{line-height:30px;padding:0;transition:all .3s}.ant-select-single .ant-select-selector .ant-select-selection-item{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-single .ant-select-selector .ant-select-selection-placeholder{pointer-events:none;transition:none}.ant-select-single .ant-select-selector .ant-select-selection-item:after,.ant-select-single .ant-select-selector .ant-select-selection-placeholder:after,.ant-select-single .ant-select-selector:after{content:" ";display:inline-block;visibility:hidden;width:0}.ant-select-single.ant-select-show-arrow .ant-select-selection-search{right:25px}.ant-select-single.ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{padding-right:18px}.ant-select-single.ant-select-open .ant-select-selection-item{color:#bfbfbf}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector{height:32px;padding:0 11px;width:100%}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{height:30px}.ant-select-single:not(.ant-select-customize-input) .ant-select-selector:after{line-height:30px}.ant-select-single.ant-select-customize-input .ant-select-selector:after{display:none}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-search{position:static;width:100%}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder{left:0;padding:0 11px;position:absolute;right:0}.ant-select-single.ant-select-customize-input .ant-select-selector .ant-select-selection-placeholder:after{display:none}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{height:40px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-placeholder,.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector:after{line-height:38px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input):not(.ant-select-customize-input) .ant-select-selection-search-input{height:38px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{height:24px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-item,.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-placeholder,.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector:after{line-height:22px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input):not(.ant-select-customize-input) .ant-select-selection-search-input{height:22px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selection-search{left:7px;right:7px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input) .ant-select-selector{padding:0 7px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-search{right:28px}.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item,.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder{padding-right:21px}.ant-select-single.ant-select-lg:not(.ant-select-customize-input) .ant-select-selector{padding:0 11px}.ant-select-selection-overflow{display:flex;flex:auto;flex-wrap:wrap;max-width:100%;position:relative}.ant-select-selection-overflow-item{-ms-grid-row-align:center;align-self:center;flex:none;max-width:100%}.ant-select-multiple .ant-select-selector{align-items:center;display:flex;flex-wrap:wrap;padding:1px 4px}.ant-select-show-search.ant-select-multiple .ant-select-selector{cursor:text}.ant-select-disabled.ant-select-multiple .ant-select-selector{background:#f5f5f5;cursor:not-allowed}.ant-select-multiple .ant-select-selector:after{content:" ";display:inline-block;line-height:24px;margin:2px 0;width:0}.ant-select-multiple.ant-select-allow-clear .ant-select-selector,.ant-select-multiple.ant-select-show-arrow .ant-select-selector{padding-right:24px}.ant-select-multiple .ant-select-selection-item{-webkit-margin-end:4px;-webkit-padding-start:8px;-webkit-padding-end:4px;background:#f5f5f5;border:1px solid #f0f0f0;border-radius:2px;box-sizing:border-box;cursor:default;display:flex;flex:none;height:24px;line-height:22px;margin-bottom:2px;margin-inline-end:4px;margin-top:2px;max-width:100%;padding-inline-end:4px;padding-inline-start:8px;position:relative;transition:font-size .3s,line-height .3s,height .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-disabled.ant-select-multiple .ant-select-selection-item{border-color:#d9d9d9;color:#bfbfbf;cursor:not-allowed}.ant-select-multiple .ant-select-selection-item-content{display:inline-block;margin-right:4px;overflow:hidden;text-overflow:ellipsis;white-space:pre}.ant-select-multiple .ant-select-selection-item-remove{text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:inherit;color:rgba(0,0,0,.45);cursor:pointer;display:inline-block;font-size:10px;font-style:normal;font-weight:700;line-height:0;line-height:inherit;text-align:center;text-transform:none;vertical-align:-.125em}.ant-select-multiple .ant-select-selection-item-remove>*{line-height:1}.ant-select-multiple .ant-select-selection-item-remove svg{display:inline-block}.ant-select-multiple .ant-select-selection-item-remove:before{display:none}.ant-select-multiple .ant-select-selection-item-remove .ant-select-multiple .ant-select-selection-item-remove-icon{display:block}.ant-select-multiple .ant-select-selection-item-remove>.anticon{vertical-align:middle}.ant-select-multiple .ant-select-selection-item-remove:hover{color:rgba(0,0,0,.75)}.ant-select-multiple .ant-select-selection-overflow-item+.ant-select-selection-overflow-item .ant-select-selection-search{-webkit-margin-start:0;margin-inline-start:0}.ant-select-multiple .ant-select-selection-search{-webkit-margin-start:7px;margin-inline-start:7px;max-width:100%;position:relative}.ant-select-multiple .ant-select-selection-search-input,.ant-select-multiple .ant-select-selection-search-mirror{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;height:24px;line-height:24px;transition:all .3s}.ant-select-multiple .ant-select-selection-search-input{min-width:4.1px;width:100%}.ant-select-multiple .ant-select-selection-search-mirror{left:0;position:absolute;top:0;visibility:hidden;white-space:pre;z-index:999}.ant-select-multiple .ant-select-selection-placeholder{left:11px;position:absolute;right:11px;top:50%;transform:translateY(-50%);transition:all .3s}.ant-select-multiple.ant-select-lg .ant-select-selector:after{line-height:32px}.ant-select-multiple.ant-select-lg .ant-select-selection-item{line-height:30px}.ant-select-multiple.ant-select-lg .ant-select-selection-search{height:32px;line-height:32px}.ant-select-multiple.ant-select-lg .ant-select-selection-search-input,.ant-select-multiple.ant-select-lg .ant-select-selection-search-mirror{height:32px;line-height:30px}.ant-select-multiple.ant-select-sm .ant-select-selector:after{line-height:16px}.ant-select-multiple.ant-select-sm .ant-select-selection-item{height:16px;line-height:14px}.ant-select-multiple.ant-select-sm .ant-select-selection-search{height:16px;line-height:16px}.ant-select-multiple.ant-select-sm .ant-select-selection-search-input,.ant-select-multiple.ant-select-sm .ant-select-selection-search-mirror{height:16px;line-height:14px}.ant-select-multiple.ant-select-sm .ant-select-selection-placeholder{left:7px}.ant-select-multiple.ant-select-sm .ant-select-selection-search{-webkit-margin-start:3px;margin-inline-start:3px}.ant-select-multiple.ant-select-lg .ant-select-selection-item{height:32px;line-height:32px}.ant-select-disabled .ant-select-selection-item-remove{display:none}.ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input) .ant-select-selector{background-color:#fff;border-color:#ff4d4f!important}.ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-focused .ant-select-selector,.ant-select-status-error.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-open .ant-select-selector{border-color:#ff7875;border-right-width:1px;box-shadow:0 0 0 2px rgba(255,77,79,.2);outline:0}.ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input) .ant-select-selector{background-color:#fff;border-color:#faad14!important}.ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-focused .ant-select-selector,.ant-select-status-warning.ant-select:not(.ant-select-disabled):not(.ant-select-customize-input).ant-select-open .ant-select-selector{border-color:#ffc53d;border-right-width:1px;box-shadow:0 0 0 2px rgba(250,173,20,.2);outline:0}.ant-select-status-error.ant-select-has-feedback .ant-select-clear,.ant-select-status-success.ant-select-has-feedback .ant-select-clear,.ant-select-status-validating.ant-select-has-feedback .ant-select-clear,.ant-select-status-warning.ant-select-has-feedback .ant-select-clear{right:32px}.ant-select-status-error.ant-select-has-feedback .ant-select-selection-selected-value,.ant-select-status-success.ant-select-has-feedback .ant-select-selection-selected-value,.ant-select-status-validating.ant-select-has-feedback .ant-select-selection-selected-value,.ant-select-status-warning.ant-select-has-feedback .ant-select-selection-selected-value{padding-right:42px}.ant-select{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-select:not(.ant-select-customize-input) .ant-select-selector{background-color:#fff;border:1px solid #d9d9d9;border-radius:2px;position:relative;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:pointer}.ant-select-show-search.ant-select:not(.ant-select-customize-input) .ant-select-selector{cursor:text}.ant-select-show-search.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:auto}.ant-select-focused:not(.ant-select-disabled).ant-select:not(.ant-select-customize-input) .ant-select-selector{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{background:#f5f5f5;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-multiple.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector{background:#f5f5f5}.ant-select-disabled.ant-select:not(.ant-select-customize-input) .ant-select-selector input{cursor:not-allowed}.ant-select:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:none;margin:0;outline:none;padding:0}.ant-select:not(.ant-select-customize-input) .ant-select-selector .ant-select-selection-search-input::-webkit-search-cancel-button{-webkit-appearance:none;display:none}.ant-select:not(.ant-select-disabled):hover .ant-select-selector{border-color:#40a9ff;border-right-width:1px}.ant-select-selection-item{flex:1;font-weight:400;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}@media(-ms-high-contrast:none){.ant-select-selection-item,.ant-select-selection-item ::-ms-backdrop{flex:auto}}.ant-select-selection-placeholder{color:#bfbfbf;flex:1;overflow:hidden;pointer-events:none;text-overflow:ellipsis;white-space:nowrap}@media(-ms-high-contrast:none){.ant-select-selection-placeholder,.ant-select-selection-placeholder ::-ms-backdrop{flex:auto}}.ant-select-arrow{text-rendering:optimizelegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;align-items:center;color:inherit;color:rgba(0,0,0,.25);display:inline-block;display:flex;font-size:12px;font-style:normal;height:12px;line-height:0;line-height:1;margin-top:-6px;pointer-events:none;position:absolute;right:11px;text-align:center;text-transform:none;top:50%;vertical-align:-.125em}.ant-select-arrow>*{line-height:1}.ant-select-arrow svg{display:inline-block}.ant-select-arrow:before{display:none}.ant-select-arrow .ant-select-arrow-icon{display:block}.ant-select-arrow .anticon{transition:transform .3s;vertical-align:top}.ant-select-arrow .anticon>svg{vertical-align:top}.ant-select-arrow .anticon:not(.ant-select-suffix){pointer-events:auto}.ant-select-disabled .ant-select-arrow{cursor:not-allowed}.ant-select-arrow>:not(:last-child){-webkit-margin-end:8px;margin-inline-end:8px}.ant-select-clear{text-rendering:auto;background:#fff;color:rgba(0,0,0,.25);cursor:pointer;display:inline-block;font-size:12px;font-style:normal;height:12px;line-height:1;margin-top:-6px;opacity:0;position:absolute;right:11px;text-align:center;text-transform:none;top:50%;transition:color .3s ease,opacity .15s ease;width:12px;z-index:1}.ant-select-clear:before{display:block}.ant-select-clear:hover{color:rgba(0,0,0,.45)}.ant-select:hover .ant-select-clear{opacity:1}.ant-select-dropdown{font-feature-settings:"tnum";background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;font-variant:normal;left:-9999px;line-height:1.5715;list-style:none;margin:0;outline:none;overflow:hidden;padding:4px 0;position:absolute;top:-9999px;z-index:1050}.ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-bottomLeft,.ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-bottomLeft{-webkit-animation-name:antSlideUpIn;animation-name:antSlideUpIn}.ant-select-dropdown.ant-slide-up-appear.ant-slide-up-appear-active.ant-select-dropdown-placement-topLeft,.ant-select-dropdown.ant-slide-up-enter.ant-slide-up-enter-active.ant-select-dropdown-placement-topLeft{-webkit-animation-name:antSlideDownIn;animation-name:antSlideDownIn}.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-bottomLeft{-webkit-animation-name:antSlideUpOut;animation-name:antSlideUpOut}.ant-select-dropdown.ant-slide-up-leave.ant-slide-up-leave-active.ant-select-dropdown-placement-topLeft{-webkit-animation-name:antSlideDownOut;animation-name:antSlideDownOut}.ant-select-dropdown-hidden{display:none}.ant-select-dropdown-empty{color:rgba(0,0,0,.25)}.ant-select-item-empty{color:rgba(0,0,0,.85);color:rgba(0,0,0,.25)}.ant-select-item,.ant-select-item-empty{display:block;font-size:14px;font-weight:400;line-height:22px;min-height:32px;padding:5px 12px;position:relative}.ant-select-item{color:rgba(0,0,0,.85);cursor:pointer;transition:background .3s ease}.ant-select-item-group{color:rgba(0,0,0,.45);cursor:default;font-size:12px}.ant-select-item-option{display:flex}.ant-select-item-option-content{flex:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-select-item-option-state{flex:none}.ant-select-item-option-active:not(.ant-select-item-option-disabled){background-color:#f5f5f5}.ant-select-item-option-selected:not(.ant-select-item-option-disabled){background-color:#e6f7ff;color:rgba(0,0,0,.85);font-weight:600}.ant-select-item-option-selected:not(.ant-select-item-option-disabled) .ant-select-item-option-state{color:#1890ff}.ant-select-item-option-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-item-option-disabled.ant-select-item-option-selected{background-color:#f5f5f5}.ant-select-item-option-grouped{padding-left:24px}.ant-select-lg{font-size:16px}.ant-select-borderless .ant-select-selector{background-color:transparent!important;border-color:transparent!important;box-shadow:none!important}.ant-select.ant-select-in-form-item{width:100%}.ant-select-rtl{direction:rtl}.ant-select-rtl .ant-select-arrow,.ant-select-rtl .ant-select-clear{left:11px;right:auto}.ant-select-dropdown-rtl{direction:rtl}.ant-select-dropdown-rtl .ant-select-item-option-grouped{padding-left:12px;padding-right:24px}.ant-select-rtl.ant-select-multiple.ant-select-allow-clear .ant-select-selector,.ant-select-rtl.ant-select-multiple.ant-select-show-arrow .ant-select-selector{padding-left:24px;padding-right:4px}.ant-select-rtl.ant-select-multiple .ant-select-selection-item{text-align:right}.ant-select-rtl.ant-select-multiple .ant-select-selection-item-content{margin-left:4px;margin-right:0;text-align:right}.ant-select-rtl.ant-select-multiple .ant-select-selection-search-mirror{left:auto;right:0}.ant-select-rtl.ant-select-multiple .ant-select-selection-placeholder{left:auto;right:11px}.ant-select-rtl.ant-select-multiple.ant-select-sm .ant-select-selection-placeholder{right:7px}.ant-select-rtl.ant-select-single .ant-select-selector .ant-select-selection-item,.ant-select-rtl.ant-select-single .ant-select-selector .ant-select-selection-placeholder{left:9px;right:0;text-align:right}.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-search{left:25px;right:11px}.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-item,.ant-select-rtl.ant-select-single.ant-select-show-arrow .ant-select-selection-placeholder{padding-left:18px;padding-right:0}.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-search{right:6px}.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-item,.ant-select-rtl.ant-select-single.ant-select-sm:not(.ant-select-customize-input).ant-select-show-arrow .ant-select-selection-placeholder{padding-left:21px;padding-right:0}.ant-skeleton{display:table;width:100%}.ant-skeleton-header{display:table-cell;padding-right:16px;vertical-align:top}.ant-skeleton-header .ant-skeleton-avatar{background:hsla(0,0%,75%,.2);display:inline-block;height:32px;line-height:32px;vertical-align:top;width:32px}.ant-skeleton-header .ant-skeleton-avatar.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-lg{height:40px;line-height:40px;width:40px}.ant-skeleton-header .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-header .ant-skeleton-avatar-sm{height:24px;line-height:24px;width:24px}.ant-skeleton-header .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-content{display:table-cell;vertical-align:top;width:100%}.ant-skeleton-content .ant-skeleton-title{background:hsla(0,0%,75%,.2);border-radius:2px;height:16px;width:100%}.ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:24px}.ant-skeleton-content .ant-skeleton-paragraph{padding:0}.ant-skeleton-content .ant-skeleton-paragraph>li{background:hsla(0,0%,75%,.2);border-radius:2px;height:16px;list-style:none;width:100%}.ant-skeleton-content .ant-skeleton-paragraph>li:last-child:not(:first-child):not(:nth-child(2)){width:61%}.ant-skeleton-content .ant-skeleton-paragraph>li+li{margin-top:16px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title{margin-top:12px}.ant-skeleton-with-avatar .ant-skeleton-content .ant-skeleton-title+.ant-skeleton-paragraph{margin-top:28px}.ant-skeleton-round .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton-round .ant-skeleton-content .ant-skeleton-title{border-radius:100px}.ant-skeleton-active .ant-skeleton-avatar,.ant-skeleton-active .ant-skeleton-button,.ant-skeleton-active .ant-skeleton-image,.ant-skeleton-active .ant-skeleton-input,.ant-skeleton-active .ant-skeleton-paragraph>li,.ant-skeleton-active .ant-skeleton-title{background:transparent;overflow:hidden;position:relative;z-index:0}.ant-skeleton-active .ant-skeleton-avatar:after,.ant-skeleton-active .ant-skeleton-button:after,.ant-skeleton-active .ant-skeleton-image:after,.ant-skeleton-active .ant-skeleton-input:after,.ant-skeleton-active .ant-skeleton-paragraph>li:after,.ant-skeleton-active .ant-skeleton-title:after{-webkit-animation:ant-skeleton-loading 1.4s ease infinite;animation:ant-skeleton-loading 1.4s ease infinite;background:linear-gradient(90deg,hsla(0,0%,75%,.2) 25%,hsla(0,0%,51%,.24) 37%,hsla(0,0%,75%,.2) 63%);bottom:0;content:"";left:-150%;position:absolute;right:-150%;top:0}.ant-skeleton.ant-skeleton-block,.ant-skeleton.ant-skeleton-block .ant-skeleton-button,.ant-skeleton.ant-skeleton-block .ant-skeleton-input{width:100%}.ant-skeleton-element{display:inline-block;width:auto}.ant-skeleton-element .ant-skeleton-button{background:hsla(0,0%,75%,.2);border-radius:2px;display:inline-block;height:32px;line-height:32px;min-width:64px;vertical-align:top;width:64px}.ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-circle{border-radius:50%;min-width:32px;width:32px}.ant-skeleton-element .ant-skeleton-button.ant-skeleton-button-round{border-radius:32px}.ant-skeleton-element .ant-skeleton-button-lg{height:40px;line-height:40px;min-width:80px;width:80px}.ant-skeleton-element .ant-skeleton-button-lg.ant-skeleton-button-circle{border-radius:50%;min-width:40px;width:40px}.ant-skeleton-element .ant-skeleton-button-lg.ant-skeleton-button-round{border-radius:40px}.ant-skeleton-element .ant-skeleton-button-sm{height:24px;line-height:24px;min-width:48px;width:48px}.ant-skeleton-element .ant-skeleton-button-sm.ant-skeleton-button-circle{border-radius:50%;min-width:24px;width:24px}.ant-skeleton-element .ant-skeleton-button-sm.ant-skeleton-button-round{border-radius:24px}.ant-skeleton-element .ant-skeleton-avatar{background:hsla(0,0%,75%,.2);display:inline-block;height:32px;line-height:32px;vertical-align:top;width:32px}.ant-skeleton-element .ant-skeleton-avatar.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-avatar-lg{height:40px;line-height:40px;width:40px}.ant-skeleton-element .ant-skeleton-avatar-lg.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-avatar-sm{height:24px;line-height:24px;width:24px}.ant-skeleton-element .ant-skeleton-avatar-sm.ant-skeleton-avatar-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-input{background:hsla(0,0%,75%,.2);display:inline-block;height:32px;line-height:32px;min-width:160px;vertical-align:top;width:160px}.ant-skeleton-element .ant-skeleton-input-lg{height:40px;line-height:40px;min-width:200px;width:200px}.ant-skeleton-element .ant-skeleton-input-sm{height:24px;line-height:24px;min-width:120px;width:120px}.ant-skeleton-element .ant-skeleton-image{align-items:center;background:hsla(0,0%,75%,.2);display:flex;height:96px;justify-content:center;line-height:96px;vertical-align:top;width:96px}.ant-skeleton-element .ant-skeleton-image.ant-skeleton-image-circle{border-radius:50%}.ant-skeleton-element .ant-skeleton-image-path{fill:#bfbfbf}.ant-skeleton-element .ant-skeleton-image-svg{height:48px;line-height:48px;max-height:192px;max-width:192px;width:48px}.ant-skeleton-element .ant-skeleton-image-svg.ant-skeleton-image-circle{border-radius:50%}@-webkit-keyframes ant-skeleton-loading{0%{transform:translateX(-37.5%)}to{transform:translateX(37.5%)}}@keyframes ant-skeleton-loading{0%{transform:translateX(-37.5%)}to{transform:translateX(37.5%)}}.ant-skeleton-rtl{direction:rtl}.ant-skeleton-rtl .ant-skeleton-header{padding-left:16px;padding-right:0}.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-avatar,.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-paragraph>li,.ant-skeleton-rtl.ant-skeleton.ant-skeleton-active .ant-skeleton-content .ant-skeleton-title{-webkit-animation-name:ant-skeleton-loading-rtl;animation-name:ant-skeleton-loading-rtl}@-webkit-keyframes ant-skeleton-loading-rtl{0%{background-position:0 50%}to{background-position:100% 50%}}@keyframes ant-skeleton-loading-rtl{0%{background-position:0 50%}to{background-position:100% 50%}}.ant-slider{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;height:12px;line-height:1.5715;list-style:none;margin:10px 6px;padding:4px 0;position:relative;touch-action:none}.ant-slider-vertical{height:100%;margin:6px 10px;padding:0 4px;width:12px}.ant-slider-vertical .ant-slider-rail{height:100%;width:4px}.ant-slider-vertical .ant-slider-track{width:4px}.ant-slider-vertical .ant-slider-handle{margin-left:-5px;margin-top:-6px}.ant-slider-vertical .ant-slider-mark{height:100%;left:12px;top:0;width:18px}.ant-slider-vertical .ant-slider-mark-text{left:4px;white-space:nowrap}.ant-slider-vertical .ant-slider-step{height:100%;width:4px}.ant-slider-vertical .ant-slider-dot{margin-left:-2px;top:auto}.ant-slider-tooltip .ant-tooltip-inner{min-width:unset}.ant-slider-rtl.ant-slider-vertical .ant-slider-handle{margin-left:0;margin-right:-5px}.ant-slider-rtl.ant-slider-vertical .ant-slider-mark{left:auto;right:12px}.ant-slider-rtl.ant-slider-vertical .ant-slider-mark-text{left:auto;right:4px}.ant-slider-rtl.ant-slider-vertical .ant-slider-dot{left:auto;right:2px}.ant-slider-with-marks{margin-bottom:28px}.ant-slider-rail{background-color:#f5f5f5;width:100%}.ant-slider-rail,.ant-slider-track{border-radius:2px;height:4px;position:absolute;transition:background-color .3s}.ant-slider-track{background-color:#91d5ff}.ant-slider-handle{background-color:#fff;border:2px solid #91d5ff;border-radius:50%;box-shadow:0;cursor:pointer;height:14px;margin-top:-5px;position:absolute;transition:border-color .3s,box-shadow .6s,transform .3s cubic-bezier(.18,.89,.32,1.28);width:14px}.ant-slider-handle-dragging{z-index:1}.ant-slider-handle:focus{border-color:#46a6ff;box-shadow:0 0 0 5px rgba(24,144,255,.12);outline:none}.ant-slider-handle.ant-tooltip-open{border-color:#1890ff}.ant-slider-handle:after{bottom:-6px;content:"";left:-6px;position:absolute;right:-6px;top:-6px}.ant-slider:hover .ant-slider-rail{background-color:#e1e1e1}.ant-slider:hover .ant-slider-track{background-color:#69c0ff}.ant-slider:hover .ant-slider-handle:not(.ant-tooltip-open){border-color:#69c0ff}.ant-slider-mark{font-size:14px;left:0;position:absolute;top:14px;width:100%}.ant-slider-mark-text{color:rgba(0,0,0,.45);cursor:pointer;display:inline-block;position:absolute;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;word-break:keep-all}.ant-slider-mark-text-active{color:rgba(0,0,0,.85)}.ant-slider-step{background:transparent;height:4px;pointer-events:none;position:absolute;width:100%}.ant-slider-dot{background-color:#fff;border:2px solid #f0f0f0;border-radius:50%;cursor:pointer;height:8px;position:absolute;top:-2px;width:8px}.ant-slider-dot-active{border-color:#8cc8ff}.ant-slider-disabled{cursor:not-allowed}.ant-slider-disabled .ant-slider-rail{background-color:#f5f5f5!important}.ant-slider-disabled .ant-slider-track{background-color:rgba(0,0,0,.25)!important}.ant-slider-disabled .ant-slider-dot,.ant-slider-disabled .ant-slider-handle{background-color:#fff;border-color:rgba(0,0,0,.25)!important;box-shadow:none;cursor:not-allowed}.ant-slider-disabled .ant-slider-dot,.ant-slider-disabled .ant-slider-mark-text{cursor:not-allowed!important}.ant-slider-rtl{direction:rtl}.ant-slider-rtl .ant-slider-mark{left:auto;right:0}.ant-space{display:inline-flex}.ant-space-vertical{flex-direction:column}.ant-space-align-center{align-items:center}.ant-space-align-start{align-items:flex-start}.ant-space-align-end{align-items:flex-end}.ant-space-align-baseline{align-items:baseline}.ant-space-item:empty{display:none}.ant-space-rtl{direction:rtl}.ant-spin{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);color:#1890ff;display:none;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;opacity:0;padding:0;position:absolute;text-align:center;transition:transform .3s cubic-bezier(.78,.14,.15,.86);vertical-align:middle}.ant-spin-spinning{display:inline-block;opacity:1;position:static}.ant-spin-nested-loading{position:relative}.ant-spin-nested-loading>div>.ant-spin{display:block;height:100%;left:0;max-height:400px;position:absolute;top:0;width:100%;z-index:4}.ant-spin-nested-loading>div>.ant-spin .ant-spin-dot{left:50%;margin:-10px;position:absolute;top:50%}.ant-spin-nested-loading>div>.ant-spin .ant-spin-text{padding-top:5px;position:absolute;text-shadow:0 1px 2px #fff;top:50%;width:100%}.ant-spin-nested-loading>div>.ant-spin.ant-spin-show-text .ant-spin-dot{margin-top:-20px}.ant-spin-nested-loading>div>.ant-spin-sm .ant-spin-dot{margin:-7px}.ant-spin-nested-loading>div>.ant-spin-sm .ant-spin-text{padding-top:2px}.ant-spin-nested-loading>div>.ant-spin-sm.ant-spin-show-text .ant-spin-dot{margin-top:-17px}.ant-spin-nested-loading>div>.ant-spin-lg .ant-spin-dot{margin:-16px}.ant-spin-nested-loading>div>.ant-spin-lg .ant-spin-text{padding-top:11px}.ant-spin-nested-loading>div>.ant-spin-lg.ant-spin-show-text .ant-spin-dot{margin-top:-26px}.ant-spin-container{position:relative;transition:opacity .3s}.ant-spin-container:after{background:#fff;bottom:0;content:"";display:none\9;height:100%;left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0;transition:all .3s;width:100%;z-index:10}.ant-spin-blur{clear:both;opacity:.5;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-spin-blur:after{opacity:.4;pointer-events:auto}.ant-spin-tip{color:rgba(0,0,0,.45)}.ant-spin-dot{display:inline-block;font-size:20px;height:1em;position:relative;width:1em}.ant-spin-dot-item{-webkit-animation:antSpinMove 1s linear infinite alternate;animation:antSpinMove 1s linear infinite alternate;background-color:#1890ff;border-radius:100%;display:block;height:9px;opacity:.3;position:absolute;transform:scale(.75);transform-origin:50% 50%;width:9px}.ant-spin-dot-item:first-child{left:0;top:0}.ant-spin-dot-item:nth-child(2){-webkit-animation-delay:.4s;animation-delay:.4s;right:0;top:0}.ant-spin-dot-item:nth-child(3){-webkit-animation-delay:.8s;animation-delay:.8s;bottom:0;right:0}.ant-spin-dot-item:nth-child(4){-webkit-animation-delay:1.2s;animation-delay:1.2s;bottom:0;left:0}.ant-spin-dot-spin{-webkit-animation:antRotate 1.2s linear infinite;animation:antRotate 1.2s linear infinite;transform:rotate(0deg)}.ant-spin-sm .ant-spin-dot{font-size:14px}.ant-spin-sm .ant-spin-dot i{height:6px;width:6px}.ant-spin-lg .ant-spin-dot{font-size:32px}.ant-spin-lg .ant-spin-dot i{height:14px;width:14px}.ant-spin.ant-spin-show-text .ant-spin-text{display:block}@media(-ms-high-contrast:active),(-ms-high-contrast:none){.ant-spin-blur{background:#fff;opacity:.5}}@-webkit-keyframes antSpinMove{to{opacity:1}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antRotate{to{transform:rotate(1turn)}}@keyframes antRotate{to{transform:rotate(1turn)}}.ant-spin-rtl{direction:rtl}.ant-spin-rtl .ant-spin-dot-spin{-webkit-animation-name:antRotateRtl;animation-name:antRotateRtl;transform:rotate(-45deg)}@-webkit-keyframes antRotateRtl{to{transform:rotate(-405deg)}}@keyframes antRotateRtl{to{transform:rotate(-405deg)}}.ant-statistic{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-statistic-title{color:rgba(0,0,0,.45);font-size:14px;margin-bottom:4px}.ant-statistic-skeleton{padding-top:16px}.ant-statistic-content{color:rgba(0,0,0,.85);font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:24px}.ant-statistic-content-value{direction:ltr;display:inline-block}.ant-statistic-content-prefix,.ant-statistic-content-suffix{display:inline-block}.ant-statistic-content-prefix{margin-right:4px}.ant-statistic-content-suffix{margin-left:4px}.ant-statistic-rtl{direction:rtl}.ant-statistic-rtl .ant-statistic-content-prefix{margin-left:4px;margin-right:0}.ant-statistic-rtl .ant-statistic-content-suffix{margin-left:0;margin-right:4px}.ant-steps{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:flex;font-size:14px;font-size:0;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;text-align:initial;width:100%}.ant-steps-item{display:inline-block;flex:1;overflow:hidden;position:relative;vertical-align:top}.ant-steps-item-container{outline:none}.ant-steps-item:last-child{flex:none}.ant-steps-item:last-child>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after,.ant-steps-item:last-child>.ant-steps-item-container>.ant-steps-item-tail{display:none}.ant-steps-item-content,.ant-steps-item-icon{display:inline-block;vertical-align:top}.ant-steps-item-icon{border:1px solid rgba(0,0,0,.25);border-radius:32px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-size:16px;height:32px;line-height:32px;margin:0 8px 0 0;text-align:center;transition:background-color .3s,border-color .3s;width:32px}.ant-steps-item-icon .ant-steps-icon{color:#1890ff;line-height:1;position:relative;top:-.5px}.ant-steps-item-tail{left:0;padding:0 10px;position:absolute;top:12px;width:100%}.ant-steps-item-tail:after{background:#f0f0f0;border-radius:1px;content:"";display:inline-block;height:1px;transition:background .3s;width:100%}.ant-steps-item-title{color:rgba(0,0,0,.85);display:inline-block;font-size:16px;line-height:32px;padding-right:16px;position:relative}.ant-steps-item-title:after{background:#f0f0f0;content:"";display:block;height:1px;left:100%;position:absolute;top:16px;width:9999px}.ant-steps-item-subtitle{display:inline;font-weight:400;margin-left:8px}.ant-steps-item-description,.ant-steps-item-subtitle{color:rgba(0,0,0,.45);font-size:14px}.ant-steps-item-wait .ant-steps-item-icon{background-color:#fff;border-color:rgba(0,0,0,.25)}.ant-steps-item-wait .ant-steps-item-icon>.ant-steps-icon{color:rgba(0,0,0,.25)}.ant-steps-item-wait .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:rgba(0,0,0,.25)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:rgba(0,0,0,.45)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#f0f0f0}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:rgba(0,0,0,.45)}.ant-steps-item-wait>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#f0f0f0}.ant-steps-item-process .ant-steps-item-icon{background-color:#fff;border-color:#1890ff}.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon{color:#1890ff}.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#1890ff}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:rgba(0,0,0,.85)}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#f0f0f0}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:rgba(0,0,0,.85)}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#f0f0f0}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-icon{background:#1890ff}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-icon .ant-steps-icon{color:#fff}.ant-steps-item-process>.ant-steps-item-container>.ant-steps-item-title{font-weight:500}.ant-steps-item-finish .ant-steps-item-icon{background-color:#fff;border-color:#1890ff}.ant-steps-item-finish .ant-steps-item-icon>.ant-steps-icon{color:#1890ff}.ant-steps-item-finish .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#1890ff}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:rgba(0,0,0,.85)}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#1890ff}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:rgba(0,0,0,.45)}.ant-steps-item-finish>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#1890ff}.ant-steps-item-error .ant-steps-item-icon{background-color:#fff;border-color:#ff4d4f}.ant-steps-item-error .ant-steps-item-icon>.ant-steps-icon{color:#ff4d4f}.ant-steps-item-error .ant-steps-item-icon>.ant-steps-icon .ant-steps-icon-dot{background:#ff4d4f}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title{color:#ff4d4f}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{background-color:#f0f0f0}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-description{color:#ff4d4f}.ant-steps-item-error>.ant-steps-item-container>.ant-steps-item-tail:after{background-color:#f0f0f0}.ant-steps-item.ant-steps-next-error .ant-steps-item-title:after{background:#ff4d4f}.ant-steps-item-disabled{cursor:not-allowed}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]{cursor:pointer}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-description,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-icon .ant-steps-icon,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-subtitle,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button] .ant-steps-item-title{transition:color .3s}.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-description,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-subtitle,.ant-steps .ant-steps-item:not(.ant-steps-item-active)>.ant-steps-item-container[role=button]:hover .ant-steps-item-title{color:#1890ff}.ant-steps .ant-steps-item:not(.ant-steps-item-active):not(.ant-steps-item-process)>.ant-steps-item-container[role=button]:hover .ant-steps-item-icon{border-color:#1890ff}.ant-steps .ant-steps-item:not(.ant-steps-item-active):not(.ant-steps-item-process)>.ant-steps-item-container[role=button]:hover .ant-steps-item-icon .ant-steps-icon{color:#1890ff}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:16px;white-space:nowrap}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-left:0}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child .ant-steps-item-title{padding-right:0}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item-tail{display:none}.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item-description{max-width:140px;white-space:normal}.ant-steps-item-custom>.ant-steps-item-container>.ant-steps-item-icon{background:none;border:0;height:auto}.ant-steps-item-custom>.ant-steps-item-container>.ant-steps-item-icon>.ant-steps-icon{font-size:24px;height:32px;left:.5px;line-height:32px;top:0;width:32px}.ant-steps-item-custom.ant-steps-item-process .ant-steps-item-icon>.ant-steps-icon{color:#1890ff}.ant-steps:not(.ant-steps-vertical) .ant-steps-item-custom .ant-steps-item-icon{background:none;width:auto}.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:12px}.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-left:0}.ant-steps-small .ant-steps-item-icon{border-radius:24px;font-size:12px;height:24px;line-height:24px;margin:0 8px 0 0;text-align:center;width:24px}.ant-steps-small .ant-steps-item-title{font-size:14px;line-height:24px;padding-right:12px}.ant-steps-small .ant-steps-item-title:after{top:12px}.ant-steps-small .ant-steps-item-description{color:rgba(0,0,0,.45);font-size:14px}.ant-steps-small .ant-steps-item-tail{top:8px}.ant-steps-small .ant-steps-item-custom .ant-steps-item-icon{background:none;border:0;border-radius:0;height:inherit;line-height:inherit;width:inherit}.ant-steps-small .ant-steps-item-custom .ant-steps-item-icon>.ant-steps-icon{font-size:24px;line-height:24px;transform:none}.ant-steps-vertical{display:flex;flex-direction:column}.ant-steps-vertical>.ant-steps-item{display:block;flex:1 0 auto;overflow:visible;padding-left:0}.ant-steps-vertical>.ant-steps-item .ant-steps-item-icon{float:left;margin-right:16px}.ant-steps-vertical>.ant-steps-item .ant-steps-item-content{display:block;min-height:48px;overflow:hidden}.ant-steps-vertical>.ant-steps-item .ant-steps-item-title{line-height:32px}.ant-steps-vertical>.ant-steps-item .ant-steps-item-description{padding-bottom:12px}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{height:100%;left:16px;padding:38px 0 6px;position:absolute;top:0;width:1px}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail:after{height:100%;width:1px}.ant-steps-vertical>.ant-steps-item:not(:last-child)>.ant-steps-item-container>.ant-steps-item-tail{display:block}.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-content>.ant-steps-item-title:after{display:none}.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{left:12px;padding:30px 0 6px;position:absolute;top:0}.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-title{line-height:24px}.ant-steps-label-vertical .ant-steps-item{overflow:visible}.ant-steps-label-vertical .ant-steps-item-tail{margin-left:58px;padding:3.5px 24px}.ant-steps-label-vertical .ant-steps-item-content{display:block;margin-top:8px;text-align:center;width:116px}.ant-steps-label-vertical .ant-steps-item-icon{display:inline-block;margin-left:42px}.ant-steps-label-vertical .ant-steps-item-title{padding-left:0;padding-right:0}.ant-steps-label-vertical .ant-steps-item-title:after{display:none}.ant-steps-label-vertical .ant-steps-item-subtitle{display:block;line-height:1.5715;margin-bottom:4px;margin-left:0}.ant-steps-label-vertical.ant-steps-small:not(.ant-steps-dot) .ant-steps-item-icon{margin-left:46px}.ant-steps-dot .ant-steps-item-title,.ant-steps-dot.ant-steps-small .ant-steps-item-title{line-height:1.5715}.ant-steps-dot .ant-steps-item-tail,.ant-steps-dot.ant-steps-small .ant-steps-item-tail{margin:0 0 0 70px;padding:0;top:2px;width:100%}.ant-steps-dot .ant-steps-item-tail:after,.ant-steps-dot.ant-steps-small .ant-steps-item-tail:after{height:3px;margin-left:12px;width:calc(100% - 20px)}.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item:first-child .ant-steps-icon-dot{left:2px}.ant-steps-dot .ant-steps-item-icon,.ant-steps-dot.ant-steps-small .ant-steps-item-icon{background:transparent;border:0;height:8px;line-height:8px;margin-left:67px;padding-right:0;width:8px}.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot{border-radius:100px;float:left;height:100%;position:relative;transition:all .3s;width:100%}.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot:after,.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot:after{background:rgba(0,0,0,.001);content:"";height:32px;left:-26px;position:absolute;top:-12px;width:60px}.ant-steps-dot .ant-steps-item-content,.ant-steps-dot.ant-steps-small .ant-steps-item-content{width:140px}.ant-steps-dot .ant-steps-item-process .ant-steps-item-icon,.ant-steps-dot.ant-steps-small .ant-steps-item-process .ant-steps-item-icon{background:none;height:10px;line-height:10px;position:relative;top:-1px;width:10px}.ant-steps-dot .ant-steps-item-process .ant-steps-icon:first-child .ant-steps-icon-dot,.ant-steps-dot.ant-steps-small .ant-steps-item-process .ant-steps-icon:first-child .ant-steps-icon-dot{left:0}.ant-steps-vertical.ant-steps-dot .ant-steps-item-icon{background:none;margin-left:0;margin-top:13px}.ant-steps-vertical.ant-steps-dot .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{left:-9px;margin:0;padding:22px 0 4px;top:6.5px}.ant-steps-vertical.ant-steps-dot.ant-steps-small .ant-steps-item-icon{margin-top:10px}.ant-steps-vertical.ant-steps-dot.ant-steps-small .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{top:3.5px}.ant-steps-vertical.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot{left:0}.ant-steps-vertical.ant-steps-dot .ant-steps-item-content{width:inherit}.ant-steps-vertical.ant-steps-dot .ant-steps-item-process .ant-steps-item-container .ant-steps-item-icon .ant-steps-icon-dot{left:-1px;top:-1px}.ant-steps-navigation{padding-top:12px}.ant-steps-navigation.ant-steps-small .ant-steps-item-container{margin-left:-12px}.ant-steps-navigation .ant-steps-item{overflow:visible;text-align:center}.ant-steps-navigation .ant-steps-item-container{display:inline-block;height:100%;margin-left:-16px;padding-bottom:12px;text-align:left;transition:opacity .3s}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-content{max-width:auto}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title{max-width:100%;overflow:hidden;padding-right:0;text-overflow:ellipsis;white-space:nowrap}.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title:after{display:none}.ant-steps-navigation .ant-steps-item:not(.ant-steps-item-active) .ant-steps-item-container[role=button]{cursor:pointer}.ant-steps-navigation .ant-steps-item:not(.ant-steps-item-active) .ant-steps-item-container[role=button]:hover{opacity:.85}.ant-steps-navigation .ant-steps-item:last-child{flex:1}.ant-steps-navigation .ant-steps-item:last-child:after{display:none}.ant-steps-navigation .ant-steps-item:after{border:1px solid rgba(0,0,0,.25);border-bottom:none;border-left:none;content:"";display:inline-block;height:12px;left:100%;margin-left:-2px;margin-top:-14px;position:absolute;top:50%;transform:rotate(45deg);width:12px}.ant-steps-navigation .ant-steps-item:before{background-color:#1890ff;bottom:0;content:"";display:inline-block;height:2px;left:50%;position:absolute;transition:width .3s,left .3s;transition-timing-function:ease-out;width:0}.ant-steps-navigation .ant-steps-item.ant-steps-item-active:before{left:0;width:100%}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item{margin-right:0!important}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item:before{display:none}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item.ant-steps-item-active:before{display:block;height:calc(100% - 24px);left:unset;right:0;top:0;width:3px}.ant-steps-navigation.ant-steps-vertical>.ant-steps-item:after{display:block;height:8px;left:50%;margin-bottom:8px;position:relative;text-align:center;top:-2px;transform:rotate(135deg);width:8px}.ant-steps-navigation.ant-steps-horizontal>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail,.ant-steps-navigation.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{visibility:hidden}.ant-steps-rtl{direction:rtl}.ant-steps.ant-steps-rtl .ant-steps-item-icon{margin-left:8px;margin-right:0}.ant-steps-rtl .ant-steps-item-tail{left:auto;right:0}.ant-steps-rtl .ant-steps-item-title{padding-left:16px;padding-right:0}.ant-steps-rtl .ant-steps-item-title .ant-steps-item-subtitle{float:left;margin-left:0;margin-right:8px}.ant-steps-rtl .ant-steps-item-title:after{left:auto;right:100%}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:0;padding-right:16px}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-right:0}.ant-steps-rtl.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:last-child .ant-steps-item-title{padding-left:0}.ant-steps-rtl .ant-steps-item-custom .ant-steps-item-icon>.ant-steps-icon{left:auto;right:.5px}.ant-steps-rtl.ant-steps-navigation.ant-steps-small .ant-steps-item-container{margin-left:0;margin-right:-12px}.ant-steps-rtl.ant-steps-navigation .ant-steps-item-container{margin-left:0;margin-right:-16px;text-align:right}.ant-steps-rtl.ant-steps-navigation .ant-steps-item-container .ant-steps-item-title{padding-left:0}.ant-steps-rtl.ant-steps-navigation .ant-steps-item:after{left:auto;margin-left:0;margin-right:-2px;right:100%;transform:rotate(225deg)}.ant-steps-rtl.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item{padding-left:0;padding-right:12px}.ant-steps-rtl.ant-steps-small.ant-steps-horizontal:not(.ant-steps-label-vertical) .ant-steps-item:first-child{padding-right:0}.ant-steps-rtl.ant-steps-small .ant-steps-item-title{padding-left:12px;padding-right:0}.ant-steps-rtl.ant-steps-vertical>.ant-steps-item .ant-steps-item-icon{float:right;margin-left:16px;margin-right:0}.ant-steps-rtl.ant-steps-vertical>.ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{left:auto;right:16px}.ant-steps-rtl.ant-steps-vertical.ant-steps-small .ant-steps-item-container .ant-steps-item-tail{left:auto;right:12px}.ant-steps-rtl.ant-steps-label-vertical .ant-steps-item-title{padding-left:0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-tail,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-tail{margin:0 70px 0 0}.ant-steps-rtl.ant-steps-dot .ant-steps-item-tail:after,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-tail:after{margin-left:0;margin-right:12px}.ant-steps-rtl.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item:first-child .ant-steps-icon-dot{left:auto;right:2px}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon{margin-left:0;margin-right:67px}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot{float:right}.ant-steps-rtl.ant-steps-dot .ant-steps-item-icon .ant-steps-icon-dot:after,.ant-steps-rtl.ant-steps-dot.ant-steps-small .ant-steps-item-icon .ant-steps-icon-dot:after{left:auto;right:-26px}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item-icon{margin-left:16px;margin-right:0}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item>.ant-steps-item-container>.ant-steps-item-tail{left:auto;right:-9px}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item:first-child .ant-steps-icon-dot{left:auto;right:0}.ant-steps-rtl.ant-steps-vertical.ant-steps-dot .ant-steps-item-process .ant-steps-icon-dot{left:auto;right:-2px}.ant-steps-rtl.ant-steps-with-progress.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item:first-child{padding-left:0;padding-right:4px}.ant-steps-rtl.ant-steps-with-progress.ant-steps-horizontal.ant-steps-label-horizontal .ant-steps-item:first-child.ant-steps-item-active{padding-right:4px}.ant-steps-with-progress .ant-steps-item{padding-top:4px}.ant-steps-with-progress .ant-steps-item .ant-steps-item-tail{top:4px!important}.ant-steps-with-progress.ant-steps-horizontal .ant-steps-item:first-child{padding-bottom:4px;padding-left:4px}.ant-steps-with-progress .ant-steps-item-icon{position:relative}.ant-steps-with-progress .ant-steps-item-icon .ant-progress{bottom:-5px;left:-5px;position:absolute;right:-5px;top:-5px}.ant-switch{font-feature-settings:"tnum";background-image:linear-gradient(90deg,rgba(0,0,0,.25),rgba(0,0,0,.25)),linear-gradient(90deg,#fff,#fff);border:0;border-radius:100px;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-block;font-size:14px;font-variant:tabular-nums;height:22px;line-height:1.5715;line-height:22px;list-style:none;margin:0;min-width:44px;padding:0;position:relative;transition:all .2s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle}.ant-switch:focus{box-shadow:0 0 0 2px rgba(0,0,0,.1);outline:0}.ant-switch-checked:focus{box-shadow:0 0 0 2px #e6f7ff}.ant-switch:focus:hover{box-shadow:none}.ant-switch-checked{background:#1890ff}.ant-switch-disabled,.ant-switch-loading{cursor:not-allowed;opacity:.4}.ant-switch-disabled *,.ant-switch-loading *{box-shadow:none;cursor:not-allowed}.ant-switch-inner{color:#fff;display:block;font-size:12px;margin:0 7px 0 25px;transition:margin .2s}.ant-switch-checked .ant-switch-inner{margin:0 25px 0 7px}.ant-switch-handle{height:18px;left:2px;top:2px;width:18px}.ant-switch-handle,.ant-switch-handle:before{position:absolute;transition:all .2s ease-in-out}.ant-switch-handle:before{background-color:#fff;border-radius:9px;bottom:0;box-shadow:0 2px 4px 0 rgba(0,35,11,.2);content:"";left:0;right:0;top:0}.ant-switch-checked .ant-switch-handle{left:calc(100% - 20px)}.ant-switch:not(.ant-switch-disabled):active .ant-switch-handle:before{left:0;right:-30%}.ant-switch:not(.ant-switch-disabled):active.ant-switch-checked .ant-switch-handle:before{left:-30%;right:0}.ant-switch-loading-icon.anticon{color:rgba(0,0,0,.65);position:relative;top:2px;vertical-align:top}.ant-switch-checked .ant-switch-loading-icon{color:#1890ff}.ant-switch-small{height:16px;line-height:16px;min-width:28px}.ant-switch-small .ant-switch-inner{font-size:12px;margin:0 5px 0 18px}.ant-switch-small .ant-switch-handle{height:12px;width:12px}.ant-switch-small .ant-switch-loading-icon{font-size:9px;top:1.5px}.ant-switch-small.ant-switch-checked .ant-switch-inner{margin:0 18px 0 5px}.ant-switch-small.ant-switch-checked .ant-switch-handle{left:calc(100% - 14px)}.ant-switch-rtl{direction:rtl}.ant-switch-rtl .ant-switch-inner{margin:0 25px 0 7px}.ant-switch-rtl .ant-switch-handle{left:auto;right:2px}.ant-switch-rtl:not(.ant-switch-rtl-disabled):active .ant-switch-handle:before{left:-30%;right:0}.ant-switch-rtl:not(.ant-switch-rtl-disabled):active.ant-switch-checked .ant-switch-handle:before{left:0;right:-30%}.ant-switch-rtl.ant-switch-checked .ant-switch-inner{margin:0 7px 0 25px}.ant-switch-rtl.ant-switch-checked .ant-switch-handle{right:calc(100% - 20px)}.ant-switch-rtl.ant-switch-small.ant-switch-checked .ant-switch-handle{right:calc(100% - 14px)}.ant-table.ant-table-middle{font-size:14px}.ant-table.ant-table-middle .ant-table-footer,.ant-table.ant-table-middle .ant-table-tbody>tr>td,.ant-table.ant-table-middle .ant-table-thead>tr>th,.ant-table.ant-table-middle .ant-table-title,.ant-table.ant-table-middle tfoot>tr>td,.ant-table.ant-table-middle tfoot>tr>th{padding:12px 8px}.ant-table.ant-table-middle .ant-table-filter-trigger{margin-right:-4px}.ant-table.ant-table-middle .ant-table-expanded-row-fixed{margin:-12px -8px}.ant-table.ant-table-middle .ant-table-tbody .ant-table-wrapper:only-child .ant-table{margin:-12px -8px -12px 40px}.ant-table.ant-table-middle .ant-table-selection-column{-webkit-padding-start:2px;padding-inline-start:2px}.ant-table.ant-table-small{font-size:14px}.ant-table.ant-table-small .ant-table-footer,.ant-table.ant-table-small .ant-table-tbody>tr>td,.ant-table.ant-table-small .ant-table-thead>tr>th,.ant-table.ant-table-small .ant-table-title,.ant-table.ant-table-small tfoot>tr>td,.ant-table.ant-table-small tfoot>tr>th{padding:8px}.ant-table.ant-table-small .ant-table-filter-trigger{margin-right:-4px}.ant-table.ant-table-small .ant-table-expanded-row-fixed{margin:-8px}.ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table{margin:-8px -8px -8px 40px}.ant-table.ant-table-small .ant-table-selection-column{-webkit-padding-start:2px;padding-inline-start:2px}.ant-table.ant-table-bordered>.ant-table-title{border:1px solid #f0f0f0;border-bottom:0}.ant-table.ant-table-bordered>.ant-table-container{border-left:1px solid #f0f0f0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tbody>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tfoot>tr>td,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tfoot>tr>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>thead>tr>th{border-right:1px solid #f0f0f0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr:not(:last-child)>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr:not(:last-child)>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr:not(:last-child)>th,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>thead>tr:not(:last-child)>th{border-bottom:1px solid #f0f0f0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr>th:before,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>th:before,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr>th:before,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>thead>tr>th:before{background-color:transparent!important}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>thead>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>thead>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>thead>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tbody>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tfoot>tr>.ant-table-cell-fix-right-first:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>thead>tr>.ant-table-cell-fix-right-first:after{border-right:1px solid #f0f0f0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tbody>tr>td>.ant-table-expanded-row-fixed{margin:-16px -17px}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table>tbody>tr>td>.ant-table-expanded-row-fixed:after,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-summary>table>tbody>tr>td>.ant-table-expanded-row-fixed:after{border-right:1px solid #f0f0f0;bottom:0;content:"";position:absolute;right:1px;top:0}.ant-table.ant-table-bordered>.ant-table-container>.ant-table-content>table,.ant-table.ant-table-bordered>.ant-table-container>.ant-table-header>table{border-top:1px solid #f0f0f0}.ant-table.ant-table-bordered.ant-table-scroll-horizontal>.ant-table-container>.ant-table-body>table>tbody>tr.ant-table-expanded-row>td,.ant-table.ant-table-bordered.ant-table-scroll-horizontal>.ant-table-container>.ant-table-body>table>tbody>tr.ant-table-placeholder>td{border-right:0}.ant-table.ant-table-bordered.ant-table-middle>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered.ant-table-middle>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed{margin:-12px -9px}.ant-table.ant-table-bordered.ant-table-small>.ant-table-container>.ant-table-body>table>tbody>tr>td>.ant-table-expanded-row-fixed,.ant-table.ant-table-bordered.ant-table-small>.ant-table-container>.ant-table-content>table>tbody>tr>td>.ant-table-expanded-row-fixed{margin:-8px -9px}.ant-table.ant-table-bordered>.ant-table-footer{border:1px solid #f0f0f0;border-top:0}.ant-table-cell .ant-table-container:first-child{border-top:0}.ant-table-cell-scrollbar:not([rowspan]){box-shadow:0 1px 0 1px #fafafa}.ant-table-wrapper{clear:both;max-width:100%}.ant-table-wrapper:before{content:"";display:table}.ant-table-wrapper:after{clear:both;content:"";display:table}.ant-table{font-feature-settings:"tnum";background:#fff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-table table{border-collapse:separate;border-radius:2px 2px 0 0;border-spacing:0;text-align:left;width:100%}.ant-table tfoot>tr>td,.ant-table tfoot>tr>th,.ant-table-tbody>tr>td,.ant-table-thead>tr>th{overflow-wrap:break-word;padding:16px;position:relative}.ant-table-cell-ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all}.ant-table-cell-ellipsis.ant-table-cell-fix-left-last,.ant-table-cell-ellipsis.ant-table-cell-fix-right-first{overflow:visible}.ant-table-cell-ellipsis.ant-table-cell-fix-left-last .ant-table-cell-content,.ant-table-cell-ellipsis.ant-table-cell-fix-right-first .ant-table-cell-content{display:block;overflow:hidden;text-overflow:ellipsis}.ant-table-cell-ellipsis .ant-table-column-title{overflow:hidden;text-overflow:ellipsis;word-break:keep-all}.ant-table-title{padding:16px}.ant-table-footer{background:#fafafa;color:rgba(0,0,0,.85);padding:16px}.ant-table-thead>tr>th{background:#fafafa;border-bottom:1px solid #f0f0f0;color:rgba(0,0,0,.85);font-weight:500;position:relative;text-align:left;transition:background .3s ease}.ant-table-thead>tr>th[colspan]:not([colspan="1"]){text-align:center}.ant-table-thead>tr>th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]):before{background-color:rgba(0,0,0,.06);content:"";height:1.6em;position:absolute;right:0;top:50%;transform:translateY(-50%);transition:background-color .3s;width:1px}.ant-table-thead>tr:not(:last-child)>th[colspan]{border-bottom:0}.ant-table-tbody>tr>td{border-bottom:1px solid #f0f0f0;transition:background .3s}.ant-table-tbody>tr>td>.ant-table-expanded-row-fixed>.ant-table-wrapper:only-child .ant-table,.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table{margin:-16px -16px -16px 32px}.ant-table-tbody>tr>td>.ant-table-expanded-row-fixed>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td,.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td{border-bottom:0}.ant-table-tbody>tr>td>.ant-table-expanded-row-fixed>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:first-child,.ant-table-tbody>tr>td>.ant-table-expanded-row-fixed>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:last-child,.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:first-child,.ant-table-tbody>tr>td>.ant-table-wrapper:only-child .ant-table-tbody>tr:last-child>td:last-child{border-radius:0}.ant-table-tbody>tr.ant-table-row:hover>td,.ant-table-tbody>tr>td.ant-table-cell-row-hover{background:#fafafa}.ant-table-tbody>tr.ant-table-row-selected>td{background:#e6f7ff;border-color:rgba(0,0,0,.03)}.ant-table-tbody>tr.ant-table-row-selected:hover>td{background:#dcf4ff}.ant-table-summary{background:#fff;position:relative;z-index:2}div.ant-table-summary{box-shadow:0 -1px 0 #f0f0f0}.ant-table-summary>tr>td,.ant-table-summary>tr>th{border-bottom:1px solid #f0f0f0}.ant-table-pagination.ant-pagination{margin:16px 0}.ant-table-pagination{display:flex;flex-wrap:wrap;row-gap:8px}.ant-table-pagination>*{flex:none}.ant-table-pagination-left{justify-content:flex-start}.ant-table-pagination-center{justify-content:center}.ant-table-pagination-right{justify-content:flex-end}.ant-table-thead th.ant-table-column-has-sorters{cursor:pointer;outline:none;transition:all .3s}.ant-table-thead th.ant-table-column-has-sorters:hover{background:rgba(0,0,0,.04)}.ant-table-thead th.ant-table-column-has-sorters:hover:before{background-color:transparent!important}.ant-table-thead th.ant-table-column-has-sorters:focus-visible{color:#1890ff}.ant-table-thead th.ant-table-column-has-sorters.ant-table-cell-fix-left:hover,.ant-table-thead th.ant-table-column-has-sorters.ant-table-cell-fix-right:hover,.ant-table-thead th.ant-table-column-sort{background:#f5f5f5}.ant-table-thead th.ant-table-column-sort:before{background-color:transparent!important}td.ant-table-column-sort{background:#fafafa}.ant-table-column-title{flex:1;position:relative;z-index:1}.ant-table-column-sorters{align-items:center;display:flex;flex:auto;justify-content:space-between}.ant-table-column-sorters:after{bottom:0;content:"";height:100%;left:0;position:absolute;right:0;top:0;width:100%}.ant-table-column-sorter{color:#bfbfbf;font-size:0;margin-left:4px;transition:color .3s}.ant-table-column-sorter-inner{align-items:center;display:inline-flex;flex-direction:column}.ant-table-column-sorter-down,.ant-table-column-sorter-up{font-size:11px}.ant-table-column-sorter-down.active,.ant-table-column-sorter-up.active{color:#1890ff}.ant-table-column-sorter-up+.ant-table-column-sorter-down{margin-top:-.3em}.ant-table-column-sorters:hover .ant-table-column-sorter{color:#a6a6a6}.ant-table-filter-column{display:flex;justify-content:space-between}.ant-table-filter-trigger{align-items:center;border-radius:2px;color:#bfbfbf;cursor:pointer;display:flex;font-size:12px;margin:-4px -8px -4px 4px;padding:0 4px;position:relative;transition:all .3s}.ant-table-filter-trigger:hover{background:rgba(0,0,0,.04);color:rgba(0,0,0,.45)}.ant-table-filter-trigger.active{color:#1890ff}.ant-table-filter-dropdown{font-feature-settings:"tnum";background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;min-width:120px;padding:0}.ant-table-filter-dropdown .ant-dropdown-menu{border:0;box-shadow:none;max-height:264px;overflow-x:hidden}.ant-table-filter-dropdown .ant-dropdown-menu:empty:after{color:rgba(0,0,0,.25);content:"Not Found";display:block;font-size:12px;padding:8px 0;text-align:center}.ant-table-filter-dropdown-tree{padding:8px 8px 0}.ant-table-filter-dropdown-tree .ant-tree-treenode .ant-tree-node-content-wrapper:hover{background-color:#f5f5f5}.ant-table-filter-dropdown-tree .ant-tree-treenode-checkbox-checked .ant-tree-node-content-wrapper,.ant-table-filter-dropdown-tree .ant-tree-treenode-checkbox-checked .ant-tree-node-content-wrapper:hover{background-color:#bae7ff}.ant-table-filter-dropdown-search{border-bottom:1px solid #f0f0f0;padding:8px}.ant-table-filter-dropdown-search-input input{min-width:140px}.ant-table-filter-dropdown-search-input .anticon{color:rgba(0,0,0,.25)}.ant-table-filter-dropdown-checkall{margin-bottom:4px;margin-left:4px;width:100%}.ant-table-filter-dropdown-submenu>ul{max-height:calc(100vh - 130px);overflow-x:hidden;overflow-y:auto}.ant-table-filter-dropdown .ant-checkbox-wrapper+span,.ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span{padding-left:8px}.ant-table-filter-dropdown-btns{background-color:inherit;border-top:1px solid #f0f0f0;display:flex;justify-content:space-between;overflow:hidden;padding:7px 8px}.ant-table-selection-col{width:32px}.ant-table-bordered .ant-table-selection-col{width:50px}table tr td.ant-table-selection-column,table tr th.ant-table-selection-column{padding-left:8px;padding-right:8px;text-align:center}table tr td.ant-table-selection-column .ant-radio-wrapper,table tr th.ant-table-selection-column .ant-radio-wrapper{margin-right:0}table tr th.ant-table-selection-column.ant-table-cell-fix-left{z-index:3}table tr th.ant-table-selection-column:after{background-color:transparent!important}.ant-table-selection{display:inline-flex;flex-direction:column;position:relative}.ant-table-selection-extra{-webkit-margin-start:100%;-webkit-padding-start:4px;cursor:pointer;margin-inline-start:100%;padding-inline-start:4px;position:absolute;top:0;transition:all .3s;z-index:1}.ant-table-selection-extra .anticon{color:#bfbfbf;font-size:10px}.ant-table-selection-extra .anticon:hover{color:#a6a6a6}.ant-table-expand-icon-col{width:48px}.ant-table-row-expand-icon-cell{text-align:center}.ant-table-row-indent{float:left;height:1px}.ant-table-row-expand-icon{background:#fff;border:1px solid #f0f0f0;border-radius:2px;box-sizing:border-box;color:#1890ff;color:inherit;cursor:pointer;display:inline-flex;height:17px;line-height:17px;outline:none;padding:0;position:relative;text-decoration:none;transform:scale(.94117647);transition:color .3s;transition:all .3s;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:-3px;width:17px}.ant-table-row-expand-icon:focus,.ant-table-row-expand-icon:hover{color:#40a9ff}.ant-table-row-expand-icon:active{color:#096dd9}.ant-table-row-expand-icon:active,.ant-table-row-expand-icon:focus,.ant-table-row-expand-icon:hover{border-color:currentcolor}.ant-table-row-expand-icon:after,.ant-table-row-expand-icon:before{background:currentcolor;content:"";position:absolute;transition:transform .3s ease-out}.ant-table-row-expand-icon:before{height:1px;left:3px;right:3px;top:7px}.ant-table-row-expand-icon:after{bottom:3px;left:7px;top:3px;transform:rotate(90deg);width:1px}.ant-table-row-expand-icon-collapsed:before{transform:rotate(-180deg)}.ant-table-row-expand-icon-collapsed:after{transform:rotate(0deg)}.ant-table-row-expand-icon-spaced{background:transparent;border:0;visibility:hidden}.ant-table-row-expand-icon-spaced:after,.ant-table-row-expand-icon-spaced:before{content:none;display:none}.ant-table-row-indent+.ant-table-row-expand-icon{margin-right:8px;margin-top:2.5005px}tr.ant-table-expanded-row:hover>td,tr.ant-table-expanded-row>td{background:#fbfbfb}tr.ant-table-expanded-row .ant-descriptions-view{display:flex}tr.ant-table-expanded-row .ant-descriptions-view table{flex:auto;width:auto}.ant-table .ant-table-expanded-row-fixed{margin:-16px;padding:16px;position:relative}.ant-table-tbody>tr.ant-table-placeholder{text-align:center}.ant-table-empty .ant-table-tbody>tr.ant-table-placeholder{color:rgba(0,0,0,.25)}.ant-table-tbody>tr.ant-table-placeholder:hover>td{background:#fff}.ant-table-cell-fix-left,.ant-table-cell-fix-right{background:#fff;position:-webkit-sticky!important;position:sticky!important;z-index:2}.ant-table-cell-fix-left-first:after,.ant-table-cell-fix-left-last:after{bottom:-1px;content:"";pointer-events:none;position:absolute;right:0;top:0;transform:translateX(100%);transition:box-shadow .3s;width:30px}.ant-table-cell-fix-right-first:after,.ant-table-cell-fix-right-last:after{bottom:-1px;content:"";left:0;pointer-events:none;position:absolute;top:0;transform:translateX(-100%);transition:box-shadow .3s;width:30px}.ant-table .ant-table-container:after,.ant-table .ant-table-container:before{bottom:0;content:"";pointer-events:none;position:absolute;top:0;transition:box-shadow .3s;width:30px;z-index:2}.ant-table .ant-table-container:before{left:0}.ant-table .ant-table-container:after{right:0}.ant-table-ping-left:not(.ant-table-has-fix-left)>.ant-table-container{position:relative}.ant-table-ping-left .ant-table-cell-fix-left-first:after,.ant-table-ping-left .ant-table-cell-fix-left-last:after,.ant-table-ping-left:not(.ant-table-has-fix-left)>.ant-table-container:before{box-shadow:inset 10px 0 8px -8px rgba(0,0,0,.15)}.ant-table-ping-left .ant-table-cell-fix-left-last:before{background-color:transparent!important}.ant-table-ping-right:not(.ant-table-has-fix-right)>.ant-table-container{position:relative}.ant-table-ping-right .ant-table-cell-fix-right-first:after,.ant-table-ping-right .ant-table-cell-fix-right-last:after,.ant-table-ping-right:not(.ant-table-has-fix-right)>.ant-table-container:after{box-shadow:inset -10px 0 8px -8px rgba(0,0,0,.15)}.ant-table-sticky-holder,.ant-table-sticky-scroll{background:#fff;position:-webkit-sticky;position:sticky;z-index:3}.ant-table-sticky-scroll{align-items:center;border-top:1px solid #f0f0f0;bottom:0;display:flex;opacity:.6}.ant-table-sticky-scroll:hover{transform-origin:center bottom}.ant-table-sticky-scroll-bar{background-color:rgba(0,0,0,.35);border-radius:4px;height:8px}.ant-table-sticky-scroll-bar-active,.ant-table-sticky-scroll-bar:hover{background-color:rgba(0,0,0,.8)}@media(-ms-high-contrast:none){.ant-table-ping-left .ant-table-cell-fix-left-last:after,.ant-table-ping-right .ant-table-cell-fix-right-first:after{box-shadow:none!important}}.ant-table-title{border-radius:2px 2px 0 0}.ant-table-title+.ant-table-container{border-top-left-radius:0;border-top-right-radius:0}.ant-table-title+.ant-table-container table,.ant-table-title+.ant-table-container table>thead>tr:first-child th:first-child,.ant-table-title+.ant-table-container table>thead>tr:first-child th:last-child{border-radius:0}.ant-table-container{border-top-right-radius:2px}.ant-table-container,.ant-table-container table>thead>tr:first-child th:first-child{border-top-left-radius:2px}.ant-table-container table>thead>tr:first-child th:last-child{border-top-right-radius:2px}.ant-table-footer{border-radius:0 0 2px 2px}.ant-table-rtl,.ant-table-wrapper-rtl{direction:rtl}.ant-table-wrapper-rtl .ant-table table{text-align:right}.ant-table-wrapper-rtl .ant-table-thead>tr>th[colspan]:not([colspan="1"]){text-align:center}.ant-table-wrapper-rtl .ant-table-thead>tr>th:not(:last-child):not(.ant-table-selection-column):not(.ant-table-row-expand-icon-cell):not([colspan]):before{left:0;right:auto}.ant-table-wrapper-rtl .ant-table-thead>tr>th{text-align:right}.ant-table-tbody>tr .ant-table-wrapper:only-child .ant-table.ant-table-rtl{margin:-16px 33px -16px -16px}.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination-left{justify-content:flex-end}.ant-table-wrapper.ant-table-wrapper-rtl .ant-table-pagination-right{justify-content:flex-start}.ant-table-wrapper-rtl .ant-table-column-sorter{margin-left:0;margin-right:4px}.ant-table-wrapper-rtl .ant-table-filter-column-title{padding:16px 16px 16px 2.3em}.ant-table-rtl .ant-table-thead tr th.ant-table-column-has-sorters .ant-table-filter-column-title{padding:0 0 0 2.3em}.ant-table-wrapper-rtl .ant-table-filter-trigger{margin:-4px 4px -4px -8px}.ant-dropdown-menu-submenu-rtl.ant-table-filter-dropdown .ant-checkbox-wrapper+span,.ant-dropdown-menu-submenu-rtl.ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span,.ant-dropdown-rtl .ant-table-filter-dropdown .ant-checkbox-wrapper+span,.ant-dropdown-rtl .ant-table-filter-dropdown-submenu .ant-checkbox-wrapper+span{padding-left:0;padding-right:8px}.ant-table-wrapper-rtl .ant-table-selection{text-align:center}.ant-table-wrapper-rtl .ant-table-row-expand-icon,.ant-table-wrapper-rtl .ant-table-row-indent{float:right}.ant-table-wrapper-rtl .ant-table-row-indent+.ant-table-row-expand-icon{margin-left:8px;margin-right:0}.ant-table-wrapper-rtl .ant-table-row-expand-icon:after{transform:rotate(-90deg)}.ant-table-wrapper-rtl .ant-table-row-expand-icon-collapsed:before{transform:rotate(180deg)}.ant-table-wrapper-rtl .ant-table-row-expand-icon-collapsed:after{transform:rotate(0deg)}.ant-tabs-small>.ant-tabs-nav .ant-tabs-tab{font-size:14px;padding:8px 0}.ant-tabs-large>.ant-tabs-nav .ant-tabs-tab{font-size:16px;padding:16px 0}.ant-tabs-card.ant-tabs-small>.ant-tabs-nav .ant-tabs-tab{padding:6px 16px}.ant-tabs-card.ant-tabs-large>.ant-tabs-nav .ant-tabs-tab{padding:7px 16px 6px}.ant-tabs-rtl{direction:rtl}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab{margin:0 0 0 32px}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab:last-of-type{margin-left:0}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .anticon{margin-left:12px;margin-right:0}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove{margin-left:-4px;margin-right:8px}.ant-tabs-rtl .ant-tabs-nav .ant-tabs-tab .ant-tabs-tab-remove .anticon{margin:0}.ant-tabs-rtl.ant-tabs-left>.ant-tabs-nav{order:1}.ant-tabs-rtl.ant-tabs-left>.ant-tabs-content-holder,.ant-tabs-rtl.ant-tabs-right>.ant-tabs-nav{order:0}.ant-tabs-rtl.ant-tabs-right>.ant-tabs-content-holder{order:1}.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs-rtl.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs-rtl.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-left:0;margin-right:2px}.ant-tabs-dropdown-rtl{direction:rtl}.ant-tabs-dropdown-rtl .ant-tabs-dropdown-menu-item{text-align:right}.ant-tabs-bottom,.ant-tabs-top{flex-direction:column}.ant-tabs-bottom>.ant-tabs-nav,.ant-tabs-bottom>div>.ant-tabs-nav,.ant-tabs-top>.ant-tabs-nav,.ant-tabs-top>div>.ant-tabs-nav{margin:0 0 16px}.ant-tabs-bottom>.ant-tabs-nav:before,.ant-tabs-bottom>div>.ant-tabs-nav:before,.ant-tabs-top>.ant-tabs-nav:before,.ant-tabs-top>div>.ant-tabs-nav:before{border-bottom:1px solid #f0f0f0;content:"";left:0;position:absolute;right:0}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-ink-bar{height:2px}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-top>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-ink-bar-animated{transition:width .3s,left .3s,right .3s}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{bottom:0;top:0;width:30px}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{box-shadow:inset 10px 0 8px -8px rgba(0,0,0,.08);left:0}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap:after{box-shadow:inset -10px 0 8px -8px rgba(0,0,0,.08);right:0}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-top>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-left:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-right:after{opacity:1}.ant-tabs-top>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>.ant-tabs-nav:before,.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-top>div>.ant-tabs-nav:before{bottom:0}.ant-tabs-bottom>.ant-tabs-nav,.ant-tabs-bottom>div>.ant-tabs-nav{margin-bottom:0;margin-top:16px;order:1}.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-bottom>.ant-tabs-nav:before,.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-bottom>div>.ant-tabs-nav:before{top:0}.ant-tabs-bottom>.ant-tabs-content-holder,.ant-tabs-bottom>div>.ant-tabs-content-holder{order:0}.ant-tabs-left>.ant-tabs-nav,.ant-tabs-left>div>.ant-tabs-nav,.ant-tabs-right>.ant-tabs-nav,.ant-tabs-right>div>.ant-tabs-nav{flex-direction:column;min-width:50px}.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab{padding:8px 24px;text-align:center}.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin:16px 0 0}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap{flex-direction:column}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{height:30px;left:0;right:0}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{box-shadow:inset 0 10px 8px -8px rgba(0,0,0,.08);top:0}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap:after{bottom:0;box-shadow:inset 0 -10px 8px -8px rgba(0,0,0,.08)}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-bottom:after,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-wrap.ant-tabs-nav-wrap-ping-top:before{opacity:1}.ant-tabs-left>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-right>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-ink-bar{width:2px}.ant-tabs-left>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-right>.ant-tabs-nav .ant-tabs-ink-bar-animated,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-ink-bar-animated{transition:height .3s,top .3s}.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-left>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-right>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-nav-operations{flex:1 0 auto;flex-direction:column}.ant-tabs-left>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-ink-bar{right:0}.ant-tabs-left>.ant-tabs-content-holder,.ant-tabs-left>div>.ant-tabs-content-holder{border-left:1px solid #f0f0f0;margin-left:-1px}.ant-tabs-left>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane,.ant-tabs-left>div>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane{padding-left:24px}.ant-tabs-right>.ant-tabs-nav,.ant-tabs-right>div>.ant-tabs-nav{order:1}.ant-tabs-right>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-ink-bar{left:0}.ant-tabs-right>.ant-tabs-content-holder,.ant-tabs-right>div>.ant-tabs-content-holder{border-right:1px solid #f0f0f0;margin-right:-1px;order:0}.ant-tabs-right>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane,.ant-tabs-right>div>.ant-tabs-content-holder>.ant-tabs-content>.ant-tabs-tabpane{padding-right:24px}.ant-tabs-dropdown{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:block;font-size:14px;font-variant:tabular-nums;left:-9999px;line-height:1.5715;list-style:none;margin:0;padding:0;position:absolute;top:-9999px;z-index:1050}.ant-tabs-dropdown-hidden{display:none}.ant-tabs-dropdown-menu{background-clip:padding-box;background-color:#fff;border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);list-style-type:none;margin:0;max-height:200px;outline:none;overflow-x:hidden;overflow-y:auto;padding:4px 0;text-align:left}.ant-tabs-dropdown-menu-item{align-items:center;color:rgba(0,0,0,.85);cursor:pointer;display:flex;font-size:14px;font-weight:400;line-height:22px;margin:0;min-width:120px;overflow:hidden;padding:5px 12px;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-tabs-dropdown-menu-item>span{flex:1;white-space:nowrap}.ant-tabs-dropdown-menu-item-remove{background:transparent;border:0;color:rgba(0,0,0,.45);cursor:pointer;flex:none;font-size:12px;margin-left:12px}.ant-tabs-dropdown-menu-item-remove:hover{color:#40a9ff}.ant-tabs-dropdown-menu-item:hover{background:#f5f5f5}.ant-tabs-dropdown-menu-item-disabled,.ant-tabs-dropdown-menu-item-disabled:hover{background:transparent;color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tabs-card>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card>div>.ant-tabs-nav .ant-tabs-tab{background:#fafafa;border:1px solid #f0f0f0;margin:0;padding:8px 16px;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs-card>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card>div>.ant-tabs-nav .ant-tabs-tab-active{background:#fff;color:#1890ff}.ant-tabs-card>.ant-tabs-nav .ant-tabs-ink-bar,.ant-tabs-card>div>.ant-tabs-nav .ant-tabs-ink-bar{visibility:hidden}.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-left:2px}.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab{border-radius:2px 2px 0 0}.ant-tabs-card.ant-tabs-top>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-top>div>.ant-tabs-nav .ant-tabs-tab-active{border-bottom-color:#fff}.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab{border-radius:0 0 2px 2px}.ant-tabs-card.ant-tabs-bottom>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-bottom>div>.ant-tabs-nav .ant-tabs-tab-active{border-top-color:#fff}.ant-tabs-card.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab,.ant-tabs-card.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab+.ant-tabs-tab{margin-top:2px}.ant-tabs-card.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab{border-radius:2px 0 0 2px}.ant-tabs-card.ant-tabs-left>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-left>div>.ant-tabs-nav .ant-tabs-tab-active{border-right-color:#fff}.ant-tabs-card.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab,.ant-tabs-card.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab{border-radius:0 2px 2px 0}.ant-tabs-card.ant-tabs-right>.ant-tabs-nav .ant-tabs-tab-active,.ant-tabs-card.ant-tabs-right>div>.ant-tabs-nav .ant-tabs-tab-active{border-left-color:#fff}.ant-tabs{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-tabs>.ant-tabs-nav,.ant-tabs>div>.ant-tabs-nav{align-items:center;display:flex;flex:none;position:relative}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-wrap,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-wrap{-ms-grid-row-align:stretch;align-self:stretch;display:inline-block;display:flex;flex:auto;overflow:hidden;position:relative;transform:translate(0);white-space:nowrap}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs>.ant-tabs-nav .ant-tabs-nav-wrap:before,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-wrap:after,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-wrap:before{content:"";opacity:0;pointer-events:none;position:absolute;transition:opacity .3s;z-index:1}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-list,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-list{display:flex;position:relative;transition:transform .3s}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-operations,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-operations{-ms-grid-row-align:stretch;align-self:stretch;display:flex}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-operations-hidden,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-operations-hidden{pointer-events:none;position:absolute;visibility:hidden}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-more,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-more{background:transparent;border:0;padding:8px 16px;position:relative}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-more:after,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-more:after{bottom:0;content:"";height:5px;left:0;position:absolute;right:0;transform:translateY(100%)}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add{background:#fafafa;border:1px solid #f0f0f0;border-radius:2px 2px 0 0;cursor:pointer;margin-left:2px;min-width:40px;outline:none;padding:0 8px;transition:all .3s cubic-bezier(.645,.045,.355,1)}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add:hover,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add:hover{color:#40a9ff}.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add:active,.ant-tabs>.ant-tabs-nav .ant-tabs-nav-add:focus,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add:active,.ant-tabs>div>.ant-tabs-nav .ant-tabs-nav-add:focus{color:#096dd9}.ant-tabs-extra-content{flex:none}.ant-tabs-centered>.ant-tabs-nav .ant-tabs-nav-wrap:not([class*=ant-tabs-nav-wrap-ping]),.ant-tabs-centered>div>.ant-tabs-nav .ant-tabs-nav-wrap:not([class*=ant-tabs-nav-wrap-ping]){justify-content:center}.ant-tabs-ink-bar{background:#1890ff;pointer-events:none;position:absolute}.ant-tabs-tab{align-items:center;background:transparent;border:0;cursor:pointer;display:inline-flex;font-size:14px;outline:none;padding:12px 0;position:relative}.ant-tabs-tab-btn:active,.ant-tabs-tab-btn:focus,.ant-tabs-tab-remove:active,.ant-tabs-tab-remove:focus{color:#096dd9}.ant-tabs-tab-btn,.ant-tabs-tab-remove{outline:none;transition:all .3s}.ant-tabs-tab-remove{background:transparent;border:none;color:rgba(0,0,0,.45);cursor:pointer;flex:none;font-size:12px;margin-left:8px;margin-right:-4px}.ant-tabs-tab-remove:hover{color:rgba(0,0,0,.85)}.ant-tabs-tab:hover{color:#40a9ff}.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn{color:#1890ff;text-shadow:0 0 .25px currentcolor}.ant-tabs-tab.ant-tabs-tab-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-btn:active,.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-btn:focus,.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-remove:active,.ant-tabs-tab.ant-tabs-tab-disabled .ant-tabs-tab-remove:focus{color:rgba(0,0,0,.25)}.ant-tabs-tab .ant-tabs-tab-remove .anticon{margin:0}.ant-tabs-tab .anticon{margin-right:12px}.ant-tabs-tab+.ant-tabs-tab{margin:0 0 0 32px}.ant-tabs-content{display:flex;width:100%}.ant-tabs-content-holder{flex:auto;min-height:0;min-width:0}.ant-tabs-content-animated{transition:margin .3s}.ant-tabs-tabpane{flex:none;outline:none;width:100%}.ant-tag{font-feature-settings:"tnum";background:#fafafa;border:1px solid #d9d9d9;border-radius:2px;box-sizing:border-box;display:inline-block;font-size:14px;font-size:12px;font-variant:tabular-nums;height:auto;line-height:1.5715;line-height:20px;list-style:none;margin:0 8px 0 0;opacity:1;padding:0 7px;transition:all .3s;white-space:nowrap}.ant-tag,.ant-tag a,.ant-tag a:hover{color:rgba(0,0,0,.85)}.ant-tag>a:first-child:last-child{display:inline-block;margin:0 -8px;padding:0 8px}.ant-tag-close-icon{color:rgba(0,0,0,.45);cursor:pointer;font-size:10px;margin-left:3px;transition:all .3s}.ant-tag-close-icon:hover{color:rgba(0,0,0,.85)}.ant-tag-has-color{border-color:transparent}.ant-tag-has-color,.ant-tag-has-color .anticon-close,.ant-tag-has-color .anticon-close:hover,.ant-tag-has-color a,.ant-tag-has-color a:hover{color:#fff}.ant-tag-checkable{background-color:transparent;border-color:transparent;cursor:pointer}.ant-tag-checkable:not(.ant-tag-checkable-checked):hover{color:#1890ff}.ant-tag-checkable-checked,.ant-tag-checkable:active{color:#fff}.ant-tag-checkable-checked{background-color:#1890ff}.ant-tag-checkable:active{background-color:#096dd9}.ant-tag-hidden{display:none}.ant-tag-pink{background:#fff0f6;border-color:#ffadd2;color:#c41d7f}.ant-tag-pink-inverse{background:#eb2f96;border-color:#eb2f96;color:#fff}.ant-tag-magenta{background:#fff0f6;border-color:#ffadd2;color:#c41d7f}.ant-tag-magenta-inverse{background:#eb2f96;border-color:#eb2f96;color:#fff}.ant-tag-red{background:#fff1f0;border-color:#ffa39e;color:#cf1322}.ant-tag-red-inverse{background:#f5222d;border-color:#f5222d;color:#fff}.ant-tag-volcano{background:#fff2e8;border-color:#ffbb96;color:#d4380d}.ant-tag-volcano-inverse{background:#fa541c;border-color:#fa541c;color:#fff}.ant-tag-orange{background:#fff7e6;border-color:#ffd591;color:#d46b08}.ant-tag-orange-inverse{background:#fa8c16;border-color:#fa8c16;color:#fff}.ant-tag-yellow{background:#feffe6;border-color:#fffb8f;color:#d4b106}.ant-tag-yellow-inverse{background:#fadb14;border-color:#fadb14;color:#fff}.ant-tag-gold{background:#fffbe6;border-color:#ffe58f;color:#d48806}.ant-tag-gold-inverse{background:#faad14;border-color:#faad14;color:#fff}.ant-tag-cyan{background:#e6fffb;border-color:#87e8de;color:#08979c}.ant-tag-cyan-inverse{background:#13c2c2;border-color:#13c2c2;color:#fff}.ant-tag-lime{background:#fcffe6;border-color:#eaff8f;color:#7cb305}.ant-tag-lime-inverse{background:#a0d911;border-color:#a0d911;color:#fff}.ant-tag-green{background:#f6ffed;border-color:#b7eb8f;color:#389e0d}.ant-tag-green-inverse{background:#52c41a;border-color:#52c41a;color:#fff}.ant-tag-blue{background:#e6f7ff;border-color:#91d5ff;color:#096dd9}.ant-tag-blue-inverse{background:#1890ff;border-color:#1890ff;color:#fff}.ant-tag-geekblue{background:#f0f5ff;border-color:#adc6ff;color:#1d39c4}.ant-tag-geekblue-inverse{background:#2f54eb;border-color:#2f54eb;color:#fff}.ant-tag-purple{background:#f9f0ff;border-color:#d3adf7;color:#531dab}.ant-tag-purple-inverse{background:#722ed1;border-color:#722ed1;color:#fff}.ant-tag-success{background:#f6ffed;border-color:#b7eb8f;color:#52c41a}.ant-tag-processing{background:#e6f7ff;border-color:#91d5ff;color:#1890ff}.ant-tag-error{background:#fff2f0;border-color:#ffccc7;color:#ff4d4f}.ant-tag-warning{background:#fffbe6;border-color:#ffe58f;color:#faad14}.ant-tag>.anticon+span,.ant-tag>span+.anticon{margin-left:7px}.ant-tag.ant-tag-rtl{direction:rtl;margin-left:8px;margin-right:0;text-align:right}.ant-tag-rtl .ant-tag-close-icon{margin-left:0;margin-right:3px}.ant-tag-rtl.ant-tag>.anticon+span,.ant-tag-rtl.ant-tag>span+.anticon{margin-left:0;margin-right:7px}.ant-timeline{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-timeline-item{font-size:14px;list-style:none;margin:0;padding-bottom:20px;position:relative}.ant-timeline-item-tail{border-left:2px solid #f0f0f0;height:calc(100% - 10px);left:4px;position:absolute;top:10px}.ant-timeline-item-pending .ant-timeline-item-head{background-color:transparent;font-size:12px}.ant-timeline-item-pending .ant-timeline-item-tail{display:none}.ant-timeline-item-head{background-color:#fff;border:2px solid transparent;border-radius:100px;height:10px;position:absolute;width:10px}.ant-timeline-item-head-blue{border-color:#1890ff;color:#1890ff}.ant-timeline-item-head-red{border-color:#ff4d4f;color:#ff4d4f}.ant-timeline-item-head-green{border-color:#52c41a;color:#52c41a}.ant-timeline-item-head-gray{border-color:rgba(0,0,0,.25);color:rgba(0,0,0,.25)}.ant-timeline-item-head-custom{border:0;border-radius:0;height:auto;left:5px;line-height:1;margin-top:0;padding:3px 1px;position:absolute;text-align:center;top:5.5px;transform:translate(-50%,-50%);width:auto}.ant-timeline-item-content{margin:0 0 0 26px;position:relative;top:-7.001px;word-break:break-word}.ant-timeline-item-last>.ant-timeline-item-tail{display:none}.ant-timeline-item-last>.ant-timeline-item-content{min-height:48px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-alternate .ant-timeline-item-tail,.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-label .ant-timeline-item-tail,.ant-timeline.ant-timeline-right .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-tail{left:50%}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-head{margin-left:-4px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom{margin-left:1px}.ant-timeline.ant-timeline-alternate .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline.ant-timeline-label .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline.ant-timeline-right .ant-timeline-item-left .ant-timeline-item-content{left:calc(50% - 4px);text-align:left;width:calc(50% - 14px)}.ant-timeline.ant-timeline-alternate .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{margin:0;text-align:right;width:calc(50% - 12px)}.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head-custom,.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-tail{left:calc(100% - 6px)}.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{width:calc(100% - 18px)}.ant-timeline.ant-timeline-pending .ant-timeline-item-last .ant-timeline-item-tail{border-left:2px dotted #f0f0f0;display:block;height:calc(100% - 14px)}.ant-timeline.ant-timeline-reverse .ant-timeline-item-last .ant-timeline-item-tail{display:none}.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-tail{border-left:2px dotted #f0f0f0;display:block;height:calc(100% - 15px);top:15px}.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-content{min-height:48px}.ant-timeline.ant-timeline-label .ant-timeline-item-label{position:absolute;text-align:right;top:-7.001px;width:calc(50% - 12px)}.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-label{left:calc(50% + 14px);text-align:left;width:calc(50% - 14px)}.ant-timeline-rtl{direction:rtl}.ant-timeline-rtl .ant-timeline-item-tail{border-left:none;border-right:2px solid #f0f0f0;left:auto;right:4px}.ant-timeline-rtl .ant-timeline-item-head-custom{left:auto;right:5px;transform:translate(50%,-50%)}.ant-timeline-rtl .ant-timeline-item-content{margin:0 18px 0 0}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-tail{left:auto;right:50%}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head{margin-left:0;margin-right:-4px}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-head-custom{margin-left:0;margin-right:1px}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-left .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-left .ant-timeline-item-content{left:auto;right:calc(50% - 4px);text-align:right}.ant-timeline-rtl.ant-timeline.ant-timeline-alternate .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-content,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{text-align:left}.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-head-custom,.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-tail{left:auto;right:0}.ant-timeline-rtl.ant-timeline.ant-timeline-right .ant-timeline-item-right .ant-timeline-item-content{margin-right:18px;text-align:right;width:100%}.ant-timeline-rtl.ant-timeline.ant-timeline-pending .ant-timeline-item-last .ant-timeline-item-tail,.ant-timeline-rtl.ant-timeline.ant-timeline-reverse .ant-timeline-item-pending .ant-timeline-item-tail{border-left:none;border-right:2px dotted #f0f0f0}.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-label{text-align:left}.ant-timeline-rtl.ant-timeline.ant-timeline-label .ant-timeline-item-right .ant-timeline-item-label{right:calc(50% + 14px);text-align:right}.ant-tooltip{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;max-width:250px;padding:0;position:absolute;visibility:visible;width:-webkit-max-content;width:-moz-max-content;width:max-content;width:intrinsic;z-index:1070}.ant-tooltip-content{position:relative}.ant-tooltip-hidden{display:none}.ant-tooltip-placement-top,.ant-tooltip-placement-topLeft,.ant-tooltip-placement-topRight{padding-bottom:14.3137085px}.ant-tooltip-placement-right,.ant-tooltip-placement-rightBottom,.ant-tooltip-placement-rightTop{padding-left:14.3137085px}.ant-tooltip-placement-bottom,.ant-tooltip-placement-bottomLeft,.ant-tooltip-placement-bottomRight{padding-top:14.3137085px}.ant-tooltip-placement-left,.ant-tooltip-placement-leftBottom,.ant-tooltip-placement-leftTop{padding-right:14.3137085px}.ant-tooltip-inner{word-wrap:break-word;background-color:rgba(0,0,0,.75);border-radius:2px;box-shadow:0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);color:#fff;min-height:32px;min-width:30px;padding:6px 8px;text-align:left;text-decoration:none}.ant-tooltip-arrow{background:transparent;display:block;height:22px;overflow:hidden;pointer-events:none;position:absolute;width:22px;z-index:2}.ant-tooltip-arrow-content{--antd-arrow-background-color:linear-gradient(to right bottom,rgba(0,0,0,.65),rgba(0,0,0,.75));border-radius:0 0 2px;bottom:0;content:"";display:block;height:11.3137085px;left:0;margin:auto;pointer-events:auto;pointer-events:none;position:absolute;right:0;top:0;width:11.3137085px}.ant-tooltip-arrow-content:before{background:var(--antd-arrow-background-color);background-position:-10px -10px;background-repeat:no-repeat;-webkit-clip-path:inset(33% 33%);clip-path:inset(33% 33%);-webkit-clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");clip-path:path("M 9.849242404917499 24.091883092036785 A 5 5 0 0 1 13.384776310850237 22.627416997969522 L 20.627416997969522 22.627416997969522 A 2 2 0 0 0 22.627416997969522 20.627416997969522 L 22.627416997969522 13.384776310850237 A 5 5 0 0 1 24.091883092036785 9.849242404917499 L 23.091883092036785 9.849242404917499 L 9.849242404917499 23.091883092036785 Z");content:"";height:33.9411255px;left:-11.3137085px;position:absolute;top:-11.3137085px;width:33.9411255px}.ant-tooltip-placement-top .ant-tooltip-arrow,.ant-tooltip-placement-topLeft .ant-tooltip-arrow,.ant-tooltip-placement-topRight .ant-tooltip-arrow{bottom:0;transform:translateY(100%)}.ant-tooltip-placement-top .ant-tooltip-arrow-content,.ant-tooltip-placement-topLeft .ant-tooltip-arrow-content,.ant-tooltip-placement-topRight .ant-tooltip-arrow-content{box-shadow:3px 3px 7px rgba(0,0,0,.07);transform:translateY(-11px) rotate(45deg)}.ant-tooltip-placement-top .ant-tooltip-arrow{left:50%;transform:translateY(100%) translateX(-50%)}.ant-tooltip-placement-topLeft .ant-tooltip-arrow{left:13px}.ant-tooltip-placement-topRight .ant-tooltip-arrow{right:13px}.ant-tooltip-placement-right .ant-tooltip-arrow,.ant-tooltip-placement-rightBottom .ant-tooltip-arrow,.ant-tooltip-placement-rightTop .ant-tooltip-arrow{left:0;transform:translateX(-100%)}.ant-tooltip-placement-right .ant-tooltip-arrow-content,.ant-tooltip-placement-rightBottom .ant-tooltip-arrow-content,.ant-tooltip-placement-rightTop .ant-tooltip-arrow-content{box-shadow:-3px 3px 7px rgba(0,0,0,.07);transform:translateX(11px) rotate(135deg)}.ant-tooltip-placement-right .ant-tooltip-arrow{top:50%;transform:translateX(-100%) translateY(-50%)}.ant-tooltip-placement-rightTop .ant-tooltip-arrow{top:5px}.ant-tooltip-placement-rightBottom .ant-tooltip-arrow{bottom:5px}.ant-tooltip-placement-left .ant-tooltip-arrow,.ant-tooltip-placement-leftBottom .ant-tooltip-arrow,.ant-tooltip-placement-leftTop .ant-tooltip-arrow{right:0;transform:translateX(100%)}.ant-tooltip-placement-left .ant-tooltip-arrow-content,.ant-tooltip-placement-leftBottom .ant-tooltip-arrow-content,.ant-tooltip-placement-leftTop .ant-tooltip-arrow-content{box-shadow:3px -3px 7px rgba(0,0,0,.07);transform:translateX(-11px) rotate(315deg)}.ant-tooltip-placement-left .ant-tooltip-arrow{top:50%;transform:translateX(100%) translateY(-50%)}.ant-tooltip-placement-leftTop .ant-tooltip-arrow{top:5px}.ant-tooltip-placement-leftBottom .ant-tooltip-arrow{bottom:5px}.ant-tooltip-placement-bottom .ant-tooltip-arrow,.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow,.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{top:0;transform:translateY(-100%)}.ant-tooltip-placement-bottom .ant-tooltip-arrow-content,.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow-content,.ant-tooltip-placement-bottomRight .ant-tooltip-arrow-content{box-shadow:-3px -3px 7px rgba(0,0,0,.07);transform:translateY(11px) rotate(225deg)}.ant-tooltip-placement-bottom .ant-tooltip-arrow{left:50%;transform:translateY(-100%) translateX(-50%)}.ant-tooltip-placement-bottomLeft .ant-tooltip-arrow{left:13px}.ant-tooltip-placement-bottomRight .ant-tooltip-arrow{right:13px}.ant-tooltip-pink .ant-tooltip-inner{background-color:#eb2f96}.ant-tooltip-pink .ant-tooltip-arrow-content:before{background:#eb2f96}.ant-tooltip-magenta .ant-tooltip-inner{background-color:#eb2f96}.ant-tooltip-magenta .ant-tooltip-arrow-content:before{background:#eb2f96}.ant-tooltip-red .ant-tooltip-inner{background-color:#f5222d}.ant-tooltip-red .ant-tooltip-arrow-content:before{background:#f5222d}.ant-tooltip-volcano .ant-tooltip-inner{background-color:#fa541c}.ant-tooltip-volcano .ant-tooltip-arrow-content:before{background:#fa541c}.ant-tooltip-orange .ant-tooltip-inner{background-color:#fa8c16}.ant-tooltip-orange .ant-tooltip-arrow-content:before{background:#fa8c16}.ant-tooltip-yellow .ant-tooltip-inner{background-color:#fadb14}.ant-tooltip-yellow .ant-tooltip-arrow-content:before{background:#fadb14}.ant-tooltip-gold .ant-tooltip-inner{background-color:#faad14}.ant-tooltip-gold .ant-tooltip-arrow-content:before{background:#faad14}.ant-tooltip-cyan .ant-tooltip-inner{background-color:#13c2c2}.ant-tooltip-cyan .ant-tooltip-arrow-content:before{background:#13c2c2}.ant-tooltip-lime .ant-tooltip-inner{background-color:#a0d911}.ant-tooltip-lime .ant-tooltip-arrow-content:before{background:#a0d911}.ant-tooltip-green .ant-tooltip-inner{background-color:#52c41a}.ant-tooltip-green .ant-tooltip-arrow-content:before{background:#52c41a}.ant-tooltip-blue .ant-tooltip-inner{background-color:#1890ff}.ant-tooltip-blue .ant-tooltip-arrow-content:before{background:#1890ff}.ant-tooltip-geekblue .ant-tooltip-inner{background-color:#2f54eb}.ant-tooltip-geekblue .ant-tooltip-arrow-content:before{background:#2f54eb}.ant-tooltip-purple .ant-tooltip-inner{background-color:#722ed1}.ant-tooltip-purple .ant-tooltip-arrow-content:before{background:#722ed1}.ant-tooltip-rtl{direction:rtl}.ant-tooltip-rtl .ant-tooltip-inner{text-align:right}.ant-transfer-customize-list .ant-transfer-list{flex:1 1 50%;height:auto;min-height:200px;width:auto}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small{border:0;border-radius:0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small .ant-table-selection-column{min-width:40px;width:40px}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small>.ant-table-content>.ant-table-body>table>.ant-table-thead>tr>th{background:#fafafa}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small>.ant-table-content .ant-table-row:last-child td{border-bottom:1px solid #f0f0f0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-small .ant-table-body{margin:0}.ant-transfer-customize-list .ant-table-wrapper .ant-table-pagination.ant-pagination{margin:16px 0 4px}.ant-transfer-customize-list .ant-input[disabled]{background-color:transparent}.ant-transfer-status-error .ant-transfer-list{border-color:#ff4d4f}.ant-transfer-status-error .ant-transfer-list-search:not([disabled]){border-color:#d9d9d9}.ant-transfer-status-error .ant-transfer-list-search:not([disabled]):hover{border-color:#40a9ff;border-right-width:1px}.ant-transfer-status-error .ant-transfer-list-search:not([disabled]):focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-transfer-status-warning .ant-transfer-list{border-color:#faad14}.ant-transfer-status-warning .ant-transfer-list-search:not([disabled]){border-color:#d9d9d9}.ant-transfer-status-warning .ant-transfer-list-search:not([disabled]):hover{border-color:#40a9ff;border-right-width:1px}.ant-transfer-status-warning .ant-transfer-list-search:not([disabled]):focus{border-color:#40a9ff;border-right-width:1px;box-shadow:0 0 0 2px rgba(24,144,255,.2);outline:0}.ant-transfer{font-feature-settings:"tnum";align-items:stretch;box-sizing:border-box;color:rgba(0,0,0,.85);display:flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;position:relative}.ant-transfer-disabled .ant-transfer-list{background:#f5f5f5}.ant-transfer-list{border:1px solid #d9d9d9;border-radius:2px;display:flex;flex-direction:column;height:200px;width:180px}.ant-transfer-list-with-pagination{height:auto;width:250px}.ant-transfer-list-search .anticon-search{color:rgba(0,0,0,.25)}.ant-transfer-list-header{align-items:center;background:#fff;border-bottom:1px solid #f0f0f0;border-radius:2px 2px 0 0;color:rgba(0,0,0,.85);display:flex;flex:none;height:40px;padding:8px 12px 9px}.ant-transfer-list-header>:not(:last-child){margin-right:4px}.ant-transfer-list-header>*{flex:none}.ant-transfer-list-header-title{flex:auto;overflow:hidden;text-align:right;text-overflow:ellipsis;white-space:nowrap}.ant-transfer-list-header-dropdown{cursor:pointer;font-size:10px;transform:translateY(10%)}.ant-transfer-list-header-dropdown[disabled]{cursor:not-allowed}.ant-transfer-list-body{display:flex;flex:auto;flex-direction:column;font-size:14px;overflow:hidden}.ant-transfer-list-body-search-wrapper{flex:none;padding:12px;position:relative}.ant-transfer-list-content{flex:auto;list-style:none;margin:0;overflow:auto;padding:0}.ant-transfer-list-content-item{align-items:center;display:flex;line-height:20px;min-height:32px;padding:6px 12px;transition:all .3s}.ant-transfer-list-content-item>:not(:last-child){margin-right:8px}.ant-transfer-list-content-item>*{flex:none}.ant-transfer-list-content-item-text{flex:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ant-transfer-list-content-item-remove{color:#1890ff;color:#d9d9d9;cursor:pointer;outline:none;position:relative;text-decoration:none;transition:color .3s}.ant-transfer-list-content-item-remove:focus,.ant-transfer-list-content-item-remove:hover{color:#40a9ff}.ant-transfer-list-content-item-remove:active{color:#096dd9}.ant-transfer-list-content-item-remove:after{bottom:-6px;content:"";left:-50%;position:absolute;right:-50%;top:-6px}.ant-transfer-list-content-item-remove:hover{color:#40a9ff}.ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background-color:#f5f5f5;cursor:pointer}.ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled).ant-transfer-list-content-item-checked:hover{background-color:#dcf4ff}.ant-transfer-list-content-show-remove .ant-transfer-list-content-item:not(.ant-transfer-list-content-item-disabled):hover{background:transparent;cursor:default}.ant-transfer-list-content-item-checked{background-color:#e6f7ff}.ant-transfer-list-content-item-disabled{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-transfer-list-pagination{border-top:1px solid #f0f0f0;padding:8px 0;text-align:right}.ant-transfer-list-body-not-found{color:rgba(0,0,0,.25);flex:none;margin:auto 0;text-align:center;width:100%}.ant-transfer-list-footer{border-top:1px solid #f0f0f0}.ant-transfer-operation{-ms-grid-row-align:center;align-self:center;display:flex;flex:none;flex-direction:column;margin:0 8px;vertical-align:middle}.ant-transfer-operation .ant-btn{display:block}.ant-transfer-operation .ant-btn:first-child{margin-bottom:4px}.ant-transfer-operation .ant-btn .anticon{font-size:12px}.ant-transfer .ant-empty-image{max-height:-2px}.ant-transfer-rtl{direction:rtl}.ant-transfer-rtl .ant-transfer-list-search{padding-left:24px;padding-right:8px}.ant-transfer-rtl .ant-transfer-list-search-action{left:12px;right:auto}.ant-transfer-rtl .ant-transfer-list-header>:not(:last-child){margin-left:4px;margin-right:0}.ant-transfer-rtl .ant-transfer-list-header{left:auto;right:0}.ant-transfer-rtl .ant-transfer-list-header-title{text-align:left}.ant-transfer-rtl .ant-transfer-list-content-item>:not(:last-child){margin-left:8px;margin-right:0}.ant-transfer-rtl .ant-transfer-list-pagination{text-align:left}.ant-transfer-rtl .ant-transfer-list-footer{left:auto;right:0}.ant-select-tree-checkbox{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em;white-space:nowrap}.ant-select-tree-checkbox-input:focus+.ant-select-tree-checkbox-inner,.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox-inner,.ant-select-tree-checkbox:hover .ant-select-tree-checkbox-inner{border-color:#1890ff}.ant-select-tree-checkbox-checked:after{-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;border:1px solid #1890ff;border-radius:2px;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox:after,.ant-select-tree-checkbox:hover:after{visibility:visible}.ant-select-tree-checkbox-inner{background-color:#fff;border:1px solid #d9d9d9;border-collapse:separate;border-radius:2px;direction:ltr;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-select-tree-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;height:9.14285714px;left:21.5%;opacity:0;position:absolute;top:50%;transform:rotate(45deg) scale(0) translate(-50%,-50%);transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;width:5.71428571px}.ant-select-tree-checkbox-input{bottom:0;cursor:pointer;height:100%;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;transform:rotate(45deg) scale(1) translate(-50%,-50%);transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-select-tree-checkbox-disabled{cursor:not-allowed}.ant-select-tree-checkbox-disabled.ant-select-tree-checkbox-checked .ant-select-tree-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-input{cursor:not-allowed;pointer-events:none}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-collapse:separate;border-color:#f5f5f5}.ant-select-tree-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-tree-checkbox-disabled:hover:after,.ant-select-tree-checkbox-wrapper:hover .ant-select-tree-checkbox-disabled:after{visibility:hidden}.ant-select-tree-checkbox-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.ant-select-tree-checkbox-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-select-tree-checkbox-wrapper.ant-select-tree-checkbox-wrapper-disabled{cursor:not-allowed}.ant-select-tree-checkbox-wrapper+.ant-select-tree-checkbox-wrapper{margin-left:8px}.ant-select-tree-checkbox-wrapper.ant-select-tree-checkbox-wrapper-in-form-item input[type=checkbox]{height:14px;width:14px}.ant-select-tree-checkbox+span{padding-left:8px;padding-right:8px}.ant-select-tree-checkbox-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-select-tree-checkbox-group-item{margin-right:8px}.ant-select-tree-checkbox-group-item:last-child{margin-right:0}.ant-select-tree-checkbox-group-item+.ant-select-tree-checkbox-group-item{margin-left:0}.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-select-tree-checkbox-indeterminate .ant-select-tree-checkbox-inner:after{background-color:#1890ff;border:0;content:" ";height:8px;left:50%;opacity:1;top:50%;transform:translate(-50%,-50%) scale(1);width:8px}.ant-select-tree-checkbox-indeterminate.ant-select-tree-checkbox-disabled .ant-select-tree-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-tree-select-dropdown{padding:8px 4px}.ant-tree-select-dropdown-rtl{direction:rtl}.ant-tree-select-dropdown .ant-select-tree{border-radius:0}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner{align-items:stretch}.ant-tree-select-dropdown .ant-select-tree-list-holder-inner .ant-select-tree-treenode .ant-select-tree-node-content-wrapper{flex:auto}.ant-select-tree{font-feature-settings:"tnum";background:#fff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;transition:background-color .3s}.ant-select-tree-focused:not(:hover):not(.ant-select-tree-active-focused){background:#e6f7ff}.ant-select-tree-list-holder-inner{align-items:flex-start}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner{align-items:stretch}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner .ant-select-tree-node-content-wrapper{flex:auto}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner .ant-select-tree-treenode.dragging{position:relative}.ant-select-tree.ant-select-tree-block-node .ant-select-tree-list-holder-inner .ant-select-tree-treenode.dragging:after{-webkit-animation:ant-tree-node-fx-do-not-use .3s;animation:ant-tree-node-fx-do-not-use .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-play-state:running;animation-play-state:running;border:1px solid #1890ff;bottom:4px;content:"";left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0}.ant-select-tree .ant-select-tree-treenode{align-items:flex-start;display:flex;outline:none;padding:0 0 4px}.ant-select-tree .ant-select-tree-treenode-disabled .ant-select-tree-node-content-wrapper{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-select-tree .ant-select-tree-treenode-disabled .ant-select-tree-node-content-wrapper:hover{background:transparent}.ant-select-tree .ant-select-tree-treenode-active .ant-select-tree-node-content-wrapper{background:#f5f5f5}.ant-select-tree .ant-select-tree-treenode:not(.ant-select-tree .ant-select-tree-treenode-disabled).filter-node .ant-select-tree-title{color:inherit;font-weight:500}.ant-select-tree-indent{-ms-grid-row-align:stretch;align-self:stretch;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.ant-select-tree-indent-unit{display:inline-block;width:24px}.ant-select-tree-draggable-icon{line-height:24px;opacity:.2;text-align:center;transition:opacity .3s;width:24px}.ant-select-tree-treenode:hover .ant-select-tree-draggable-icon{opacity:.45}.ant-select-tree-switcher{-ms-grid-row-align:stretch;align-self:stretch;cursor:pointer;flex:none;line-height:24px;margin:0;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:24px}.ant-select-tree-switcher .ant-select-tree-switcher-icon,.ant-select-tree-switcher .ant-tree-switcher-icon{display:inline-block;font-size:10px;vertical-align:baseline}.ant-select-tree-switcher .ant-select-tree-switcher-icon svg,.ant-select-tree-switcher .ant-tree-switcher-icon svg{transition:transform .3s}.ant-select-tree-switcher-noop{cursor:default}.ant-select-tree-switcher_close .ant-select-tree-switcher-icon svg{transform:rotate(-90deg)}.ant-select-tree-switcher-loading-icon{color:#1890ff}.ant-select-tree-switcher-leaf-line{display:inline-block;height:100%;position:relative;width:100%;z-index:1}.ant-select-tree-switcher-leaf-line:before{border-right:1px solid #d9d9d9;bottom:-4px;content:" ";margin-left:-1px;position:absolute;right:12px;top:0}.ant-select-tree-switcher-leaf-line:after{border-bottom:1px solid #d9d9d9;content:" ";height:14px;position:absolute;width:10px}.ant-select-tree-checkbox{margin:4px 8px 0 0;top:auto}.ant-select-tree .ant-select-tree-node-content-wrapper{background:transparent;border-radius:2px;color:inherit;cursor:pointer;line-height:24px;margin:0;min-height:24px;padding:0 4px;position:relative;transition:all .3s,border 0s,line-height 0s,box-shadow 0s;z-index:auto}.ant-select-tree .ant-select-tree-node-content-wrapper:hover{background-color:#f5f5f5}.ant-select-tree .ant-select-tree-node-content-wrapper.ant-select-tree-node-selected{background-color:#bae7ff}.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-iconEle{display:inline-block;height:24px;line-height:24px;text-align:center;vertical-align:top;width:24px}.ant-select-tree .ant-select-tree-node-content-wrapper .ant-select-tree-iconEle:empty{display:none}.ant-select-tree-unselectable .ant-select-tree-node-content-wrapper:hover{background-color:transparent}.ant-select-tree-node-content-wrapper{line-height:24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-tree-node-content-wrapper .ant-tree-drop-indicator{background-color:#1890ff;border-radius:1px;height:2px;pointer-events:none;position:absolute;z-index:1}.ant-select-tree-node-content-wrapper .ant-tree-drop-indicator:after{background-color:transparent;border:2px solid #1890ff;border-radius:50%;content:"";height:8px;left:-6px;position:absolute;top:-3px;width:8px}.ant-select-tree .ant-select-tree-treenode.drop-container>[draggable]{box-shadow:0 0 0 2px #1890ff}.ant-select-tree-show-line .ant-select-tree-indent-unit{height:100%;position:relative}.ant-select-tree-show-line .ant-select-tree-indent-unit:before{border-right:1px solid #d9d9d9;bottom:-4px;content:"";position:absolute;right:12px;top:0}.ant-select-tree-show-line .ant-select-tree-indent-unit-end:before{display:none}.ant-select-tree-show-line .ant-select-tree-switcher{background:#fff}.ant-select-tree-show-line .ant-select-tree-switcher-line-icon{vertical-align:-.15em}.ant-select-tree .ant-select-tree-treenode-leaf-last .ant-select-tree-switcher-leaf-line:before{bottom:auto!important;height:14px!important;top:auto!important}.ant-tree-select-dropdown-rtl .ant-select-tree .ant-select-tree-switcher_close .ant-select-tree-switcher-icon svg{transform:rotate(90deg)}.ant-tree-select-dropdown-rtl .ant-select-tree .ant-select-tree-switcher-loading-icon{transform:scaleY(-1)}@-webkit-keyframes antCheckboxEffect{0%{opacity:.5;transform:scale(1)}to{opacity:0;transform:scale(1.6)}}@keyframes antCheckboxEffect{0%{opacity:.5;transform:scale(1)}to{opacity:0;transform:scale(1.6)}}@-webkit-keyframes ant-tree-node-fx-do-not-use{0%{opacity:0}to{opacity:1}}@keyframes ant-tree-node-fx-do-not-use{0%{opacity:0}to{opacity:1}}.ant-tree.ant-tree-directory .ant-tree-treenode{position:relative}.ant-tree.ant-tree-directory .ant-tree-treenode:before{bottom:4px;content:"";left:0;pointer-events:none;position:absolute;right:0;top:0;transition:background-color .3s}.ant-tree.ant-tree-directory .ant-tree-treenode:hover:before{background:#f5f5f5}.ant-tree.ant-tree-directory .ant-tree-treenode>*{z-index:1}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-switcher{transition:color .3s}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper{border-radius:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper:hover{background:transparent}.ant-tree.ant-tree-directory .ant-tree-treenode .ant-tree-node-content-wrapper.ant-tree-node-selected{background:transparent;color:#fff}.ant-tree.ant-tree-directory .ant-tree-treenode-selected:before,.ant-tree.ant-tree-directory .ant-tree-treenode-selected:hover:before{background:#1890ff}.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-switcher{color:#fff}.ant-tree.ant-tree-directory .ant-tree-treenode-selected .ant-tree-node-content-wrapper{background:transparent;color:#fff}.ant-tree-checkbox{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:1;list-style:none;margin:0;outline:none;padding:0;position:relative;top:.2em;white-space:nowrap}.ant-tree-checkbox-input:focus+.ant-tree-checkbox-inner,.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-inner,.ant-tree-checkbox:hover .ant-tree-checkbox-inner{border-color:#1890ff}.ant-tree-checkbox-checked:after{-webkit-animation:antCheckboxEffect .36s ease-in-out;animation:antCheckboxEffect .36s ease-in-out;-webkit-animation-fill-mode:backwards;animation-fill-mode:backwards;border:1px solid #1890ff;border-radius:2px;content:"";height:100%;left:0;position:absolute;top:0;visibility:hidden;width:100%}.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox:after,.ant-tree-checkbox:hover:after{visibility:visible}.ant-tree-checkbox-inner{background-color:#fff;border:1px solid #d9d9d9;border-collapse:separate;border-radius:2px;direction:ltr;display:block;height:16px;left:0;position:relative;top:0;transition:all .3s;width:16px}.ant-tree-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;height:9.14285714px;left:21.5%;opacity:0;position:absolute;top:50%;transform:rotate(45deg) scale(0) translate(-50%,-50%);transition:all .1s cubic-bezier(.71,-.46,.88,.6),opacity .1s;width:5.71428571px}.ant-tree-checkbox-input{bottom:0;cursor:pointer;height:100%;left:0;opacity:0;position:absolute;right:0;top:0;width:100%;z-index:1}.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after{border:2px solid #fff;border-left:0;border-top:0;content:" ";display:table;opacity:1;position:absolute;transform:rotate(45deg) scale(1) translate(-50%,-50%);transition:all .2s cubic-bezier(.12,.4,.29,1.46) .1s}.ant-tree-checkbox-checked .ant-tree-checkbox-inner{background-color:#1890ff;border-color:#1890ff}.ant-tree-checkbox-disabled{cursor:not-allowed}.ant-tree-checkbox-disabled.ant-tree-checkbox-checked .ant-tree-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-color:rgba(0,0,0,.25)}.ant-tree-checkbox-disabled .ant-tree-checkbox-input{cursor:not-allowed;pointer-events:none}.ant-tree-checkbox-disabled .ant-tree-checkbox-inner{background-color:#f5f5f5;border-color:#d9d9d9!important}.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after{-webkit-animation-name:none;animation-name:none;border-collapse:separate;border-color:#f5f5f5}.ant-tree-checkbox-disabled+span{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tree-checkbox-disabled:hover:after,.ant-tree-checkbox-wrapper:hover .ant-tree-checkbox-disabled:after{visibility:hidden}.ant-tree-checkbox-wrapper{font-feature-settings:"tnum";align-items:baseline;box-sizing:border-box;color:rgba(0,0,0,.85);cursor:pointer;display:inline-flex;font-size:14px;font-variant:tabular-nums;line-height:1.5715;line-height:unset;list-style:none;margin:0;padding:0}.ant-tree-checkbox-wrapper:after{content:" ";display:inline-block;overflow:hidden;width:0}.ant-tree-checkbox-wrapper.ant-tree-checkbox-wrapper-disabled{cursor:not-allowed}.ant-tree-checkbox-wrapper+.ant-tree-checkbox-wrapper{margin-left:8px}.ant-tree-checkbox-wrapper.ant-tree-checkbox-wrapper-in-form-item input[type=checkbox]{height:14px;width:14px}.ant-tree-checkbox+span{padding-left:8px;padding-right:8px}.ant-tree-checkbox-group{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);display:inline-block;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-tree-checkbox-group-item{margin-right:8px}.ant-tree-checkbox-group-item:last-child{margin-right:0}.ant-tree-checkbox-group-item+.ant-tree-checkbox-group-item{margin-left:0}.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner{background-color:#fff;border-color:#d9d9d9}.ant-tree-checkbox-indeterminate .ant-tree-checkbox-inner:after{background-color:#1890ff;border:0;content:" ";height:8px;left:50%;opacity:1;top:50%;transform:translate(-50%,-50%) scale(1);width:8px}.ant-tree-checkbox-indeterminate.ant-tree-checkbox-disabled .ant-tree-checkbox-inner:after{background-color:rgba(0,0,0,.25);border-color:rgba(0,0,0,.25)}.ant-tree{font-feature-settings:"tnum";background:#fff;border-radius:2px;box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0;transition:background-color .3s}.ant-tree-focused:not(:hover):not(.ant-tree-active-focused){background:#e6f7ff}.ant-tree-list-holder-inner{align-items:flex-start}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner{align-items:stretch}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-node-content-wrapper{flex:auto}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-treenode.dragging{position:relative}.ant-tree.ant-tree-block-node .ant-tree-list-holder-inner .ant-tree-treenode.dragging:after{-webkit-animation:ant-tree-node-fx-do-not-use .3s;animation:ant-tree-node-fx-do-not-use .3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-play-state:running;animation-play-state:running;border:1px solid #1890ff;bottom:4px;content:"";left:0;opacity:0;pointer-events:none;position:absolute;right:0;top:0}.ant-tree .ant-tree-treenode{align-items:flex-start;display:flex;outline:none;padding:0 0 4px}.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-tree .ant-tree-treenode-disabled .ant-tree-node-content-wrapper:hover{background:transparent}.ant-tree .ant-tree-treenode-active .ant-tree-node-content-wrapper{background:#f5f5f5}.ant-tree .ant-tree-treenode:not(.ant-tree .ant-tree-treenode-disabled).filter-node .ant-tree-title{color:inherit;font-weight:500}.ant-tree-indent{-ms-grid-row-align:stretch;align-self:stretch;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap}.ant-tree-indent-unit{display:inline-block;width:24px}.ant-tree-draggable-icon{line-height:24px;opacity:.2;text-align:center;transition:opacity .3s;width:24px}.ant-tree-treenode:hover .ant-tree-draggable-icon{opacity:.45}.ant-tree-switcher{-ms-grid-row-align:stretch;align-self:stretch;cursor:pointer;flex:none;line-height:24px;margin:0;position:relative;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:24px}.ant-tree-switcher .ant-select-tree-switcher-icon,.ant-tree-switcher .ant-tree-switcher-icon{display:inline-block;font-size:10px;vertical-align:baseline}.ant-tree-switcher .ant-select-tree-switcher-icon svg,.ant-tree-switcher .ant-tree-switcher-icon svg{transition:transform .3s}.ant-tree-switcher-noop{cursor:default}.ant-tree-switcher_close .ant-tree-switcher-icon svg{transform:rotate(-90deg)}.ant-tree-switcher-loading-icon{color:#1890ff}.ant-tree-switcher-leaf-line{display:inline-block;height:100%;position:relative;width:100%;z-index:1}.ant-tree-switcher-leaf-line:before{border-right:1px solid #d9d9d9;bottom:-4px;content:" ";margin-left:-1px;position:absolute;right:12px;top:0}.ant-tree-switcher-leaf-line:after{border-bottom:1px solid #d9d9d9;content:" ";height:14px;position:absolute;width:10px}.ant-tree-checkbox{margin:4px 8px 0 0;top:auto}.ant-tree .ant-tree-node-content-wrapper{background:transparent;border-radius:2px;color:inherit;cursor:pointer;line-height:24px;margin:0;min-height:24px;padding:0 4px;position:relative;transition:all .3s,border 0s,line-height 0s,box-shadow 0s;z-index:auto}.ant-tree .ant-tree-node-content-wrapper:hover{background-color:#f5f5f5}.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected{background-color:#bae7ff}.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle{display:inline-block;height:24px;line-height:24px;text-align:center;vertical-align:top;width:24px}.ant-tree .ant-tree-node-content-wrapper .ant-tree-iconEle:empty{display:none}.ant-tree-unselectable .ant-tree-node-content-wrapper:hover{background-color:transparent}.ant-tree-node-content-wrapper{line-height:24px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-tree-node-content-wrapper .ant-tree-drop-indicator{background-color:#1890ff;border-radius:1px;height:2px;pointer-events:none;position:absolute;z-index:1}.ant-tree-node-content-wrapper .ant-tree-drop-indicator:after{background-color:transparent;border:2px solid #1890ff;border-radius:50%;content:"";height:8px;left:-6px;position:absolute;top:-3px;width:8px}.ant-tree .ant-tree-treenode.drop-container>[draggable]{box-shadow:0 0 0 2px #1890ff}.ant-tree-show-line .ant-tree-indent-unit{height:100%;position:relative}.ant-tree-show-line .ant-tree-indent-unit:before{border-right:1px solid #d9d9d9;bottom:-4px;content:"";position:absolute;right:12px;top:0}.ant-tree-show-line .ant-tree-indent-unit-end:before{display:none}.ant-tree-show-line .ant-tree-switcher{background:#fff}.ant-tree-show-line .ant-tree-switcher-line-icon{vertical-align:-.15em}.ant-tree .ant-tree-treenode-leaf-last .ant-tree-switcher-leaf-line:before{bottom:auto!important;height:14px!important;top:auto!important}.ant-tree-rtl{direction:rtl}.ant-tree-rtl .ant-tree-node-content-wrapper[draggable=true] .ant-tree-drop-indicator:after{left:unset;right:-6px}.ant-tree .ant-tree-treenode-rtl{direction:rtl}.ant-tree-rtl .ant-tree-switcher_close .ant-tree-switcher-icon svg{transform:rotate(90deg)}.ant-tree-rtl.ant-tree-show-line .ant-tree-indent-unit:before{border-left:1px solid #d9d9d9;border-right:none;left:-13px;right:auto}.ant-tree-rtl .ant-tree-checkbox,.ant-tree-select-dropdown-rtl .ant-select-tree-checkbox{margin:4px 0 0 8px}.ant-typography{color:rgba(0,0,0,.85);overflow-wrap:break-word}.ant-typography.ant-typography-secondary{color:rgba(0,0,0,.45)}.ant-typography.ant-typography-success{color:#52c41a}.ant-typography.ant-typography-warning{color:#faad14}.ant-typography.ant-typography-danger{color:#ff4d4f}a.ant-typography.ant-typography-danger:active,a.ant-typography.ant-typography-danger:focus{color:#d9363e}a.ant-typography.ant-typography-danger:hover{color:#ff7875}.ant-typography.ant-typography-disabled{color:rgba(0,0,0,.25);cursor:not-allowed;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-typography p,div.ant-typography{margin-bottom:1em}.ant-typography h1,div.ant-typography-h1,div.ant-typography-h1>textarea,h1.ant-typography{color:rgba(0,0,0,.85);font-size:38px;font-weight:600;line-height:1.23;margin-bottom:.5em}.ant-typography h2,div.ant-typography-h2,div.ant-typography-h2>textarea,h2.ant-typography{color:rgba(0,0,0,.85);font-size:30px;font-weight:600;line-height:1.35;margin-bottom:.5em}.ant-typography h3,div.ant-typography-h3,div.ant-typography-h3>textarea,h3.ant-typography{color:rgba(0,0,0,.85);font-size:24px;font-weight:600;line-height:1.35;margin-bottom:.5em}.ant-typography h4,div.ant-typography-h4,div.ant-typography-h4>textarea,h4.ant-typography{color:rgba(0,0,0,.85);font-size:20px;font-weight:600;line-height:1.4;margin-bottom:.5em}.ant-typography h5,div.ant-typography-h5,div.ant-typography-h5>textarea,h5.ant-typography{color:rgba(0,0,0,.85);font-size:16px;font-weight:600;line-height:1.5;margin-bottom:.5em}.ant-typography div+h1,.ant-typography div+h2,.ant-typography div+h3,.ant-typography div+h4,.ant-typography div+h5,.ant-typography h1+h1,.ant-typography h1+h2,.ant-typography h1+h3,.ant-typography h1+h4,.ant-typography h1+h5,.ant-typography h2+h1,.ant-typography h2+h2,.ant-typography h2+h3,.ant-typography h2+h4,.ant-typography h2+h5,.ant-typography h3+h1,.ant-typography h3+h2,.ant-typography h3+h3,.ant-typography h3+h4,.ant-typography h3+h5,.ant-typography h4+h1,.ant-typography h4+h2,.ant-typography h4+h3,.ant-typography h4+h4,.ant-typography h4+h5,.ant-typography h5+h1,.ant-typography h5+h2,.ant-typography h5+h3,.ant-typography h5+h4,.ant-typography h5+h5,.ant-typography li+h1,.ant-typography li+h2,.ant-typography li+h3,.ant-typography li+h4,.ant-typography li+h5,.ant-typography p+h1,.ant-typography p+h2,.ant-typography p+h3,.ant-typography p+h4,.ant-typography p+h5,.ant-typography ul+h1,.ant-typography ul+h2,.ant-typography ul+h3,.ant-typography ul+h4,.ant-typography ul+h5,.ant-typography+h1.ant-typography,.ant-typography+h2.ant-typography,.ant-typography+h3.ant-typography,.ant-typography+h4.ant-typography,.ant-typography+h5.ant-typography{margin-top:1.2em}a.ant-typography-ellipsis,span.ant-typography-ellipsis{display:inline-block;max-width:100%}.ant-typography a,a.ant-typography{color:#1890ff;cursor:pointer;outline:none;text-decoration:none;transition:color .3s}.ant-typography a:focus,.ant-typography a:hover,a.ant-typography:focus,a.ant-typography:hover{color:#40a9ff}.ant-typography a:active,a.ant-typography:active{color:#096dd9}.ant-typography a:active,.ant-typography a:hover,a.ant-typography:active,a.ant-typography:hover{text-decoration:none}.ant-typography a.ant-typography-disabled,.ant-typography a[disabled],a.ant-typography.ant-typography-disabled,a.ant-typography[disabled]{color:rgba(0,0,0,.25);cursor:not-allowed}.ant-typography a.ant-typography-disabled:active,.ant-typography a.ant-typography-disabled:hover,.ant-typography a[disabled]:active,.ant-typography a[disabled]:hover,a.ant-typography.ant-typography-disabled:active,a.ant-typography.ant-typography-disabled:hover,a.ant-typography[disabled]:active,a.ant-typography[disabled]:hover{color:rgba(0,0,0,.25)}.ant-typography a.ant-typography-disabled:active,.ant-typography a[disabled]:active,a.ant-typography.ant-typography-disabled:active,a.ant-typography[disabled]:active{pointer-events:none}.ant-typography code{background:hsla(0,0%,59%,.1);border:1px solid hsla(0,0%,39%,.2);border-radius:3px;font-size:85%;margin:0 .2em;padding:.2em .4em .1em}.ant-typography kbd{background:hsla(0,0%,59%,.06);border:solid hsla(0,0%,39%,.2);border-radius:3px;border-width:1px 1px 2px;font-size:90%;margin:0 .2em;padding:.15em .4em .1em}.ant-typography mark{background-color:#ffe58f;padding:0}.ant-typography ins,.ant-typography u{-webkit-text-decoration-skip:ink;text-decoration:underline;text-decoration-skip-ink:auto}.ant-typography del,.ant-typography s{text-decoration:line-through}.ant-typography strong{font-weight:600}.ant-typography-copy,.ant-typography-edit,.ant-typography-expand{color:#1890ff;cursor:pointer;margin-left:4px;outline:none;text-decoration:none;transition:color .3s}.ant-typography-copy:focus,.ant-typography-copy:hover,.ant-typography-edit:focus,.ant-typography-edit:hover,.ant-typography-expand:focus,.ant-typography-expand:hover{color:#40a9ff}.ant-typography-copy:active,.ant-typography-edit:active,.ant-typography-expand:active{color:#096dd9}.ant-typography-copy-success,.ant-typography-copy-success:focus,.ant-typography-copy-success:hover{color:#52c41a}.ant-typography-edit-content{position:relative}div.ant-typography-edit-content{left:-12px;margin-bottom:calc(1em - 5px);margin-top:-5px}.ant-typography-edit-content-confirm{bottom:8px;color:rgba(0,0,0,.45);font-size:14px;font-style:normal;font-weight:400;pointer-events:none;position:absolute;right:10px}.ant-typography-edit-content textarea{height:1em;margin:0!important;-moz-transition:none}.ant-typography ol,.ant-typography ul{margin:0 0 1em;padding:0}.ant-typography ol li,.ant-typography ul li{margin:0 0 0 20px;padding:0 0 0 4px}.ant-typography ul{list-style-type:circle}.ant-typography ul ul{list-style-type:disc}.ant-typography ol{list-style-type:decimal}.ant-typography blockquote,.ant-typography pre{margin:1em 0}.ant-typography pre{word-wrap:break-word;background:hsla(0,0%,59%,.1);border:1px solid hsla(0,0%,39%,.2);border-radius:3px;padding:.4em .6em;white-space:pre-wrap}.ant-typography pre code{background:transparent;border:0;display:inline;font-family:inherit;font-size:inherit;margin:0;padding:0}.ant-typography blockquote{border-left:4px solid hsla(0,0%,39%,.2);opacity:.85;padding:0 0 0 .6em}.ant-typography-single-line{white-space:nowrap}.ant-typography-ellipsis-single-line{overflow:hidden;text-overflow:ellipsis}a.ant-typography-ellipsis-single-line,span.ant-typography-ellipsis-single-line{vertical-align:bottom}.ant-typography-ellipsis-multiple-line{-webkit-line-clamp:3;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.ant-typography-rtl{direction:rtl}.ant-typography-rtl .ant-typography-copy,.ant-typography-rtl .ant-typography-edit,.ant-typography-rtl .ant-typography-expand{margin-left:0;margin-right:4px}.ant-typography-rtl .ant-typography-expand{float:left}div.ant-typography-edit-content.ant-typography-rtl{left:auto;right:-12px}.ant-typography-rtl .ant-typography-edit-content-confirm{left:10px;right:auto}.ant-typography-rtl.ant-typography ol li,.ant-typography-rtl.ant-typography ul li{margin:0 20px 0 0;padding:0 4px 0 0}.ant-upload{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;outline:0;padding:0}.ant-upload p{margin:0}.ant-upload-btn{display:block;outline:none;width:100%}.ant-upload input[type=file]{cursor:pointer}.ant-upload.ant-upload-select{display:inline-block}.ant-upload.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-select-picture-card{background-color:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;height:104px;margin-bottom:8px;margin-right:8px;text-align:center;transition:border-color .3s;vertical-align:top;width:104px}.ant-upload.ant-upload-select-picture-card>.ant-upload{align-items:center;display:flex;height:100%;justify-content:center;text-align:center}.ant-upload.ant-upload-select-picture-card:hover{border-color:#1890ff}.ant-upload-disabled.ant-upload.ant-upload-select-picture-card:hover{border-color:#d9d9d9}.ant-upload.ant-upload-drag{background:#fafafa;border:1px dashed #d9d9d9;border-radius:2px;cursor:pointer;height:100%;position:relative;text-align:center;transition:border-color .3s;width:100%}.ant-upload.ant-upload-drag .ant-upload{padding:16px 0}.ant-upload.ant-upload-drag.ant-upload-drag-hover:not(.ant-upload-disabled){border-color:#096dd9}.ant-upload.ant-upload-drag.ant-upload-disabled{cursor:not-allowed}.ant-upload.ant-upload-drag .ant-upload-btn{display:table;height:100%}.ant-upload.ant-upload-drag .ant-upload-drag-container{display:table-cell;vertical-align:middle}.ant-upload.ant-upload-drag:not(.ant-upload-disabled):hover{border-color:#40a9ff}.ant-upload.ant-upload-drag p.ant-upload-drag-icon{margin-bottom:20px}.ant-upload.ant-upload-drag p.ant-upload-drag-icon .anticon{color:#40a9ff;font-size:48px}.ant-upload.ant-upload-drag p.ant-upload-text{color:rgba(0,0,0,.85);font-size:16px;margin:0 0 4px}.ant-upload.ant-upload-drag p.ant-upload-hint{color:rgba(0,0,0,.45);font-size:14px}.ant-upload.ant-upload-drag .anticon-plus{color:rgba(0,0,0,.25);font-size:30px;transition:all .3s}.ant-upload.ant-upload-drag .anticon-plus:hover,.ant-upload.ant-upload-drag:hover .anticon-plus{color:rgba(0,0,0,.45)}.ant-upload-picture-card-wrapper{display:inline-block;width:100%}.ant-upload-picture-card-wrapper:before{content:"";display:table}.ant-upload-picture-card-wrapper:after{clear:both;content:"";display:table}.ant-upload-list{font-feature-settings:"tnum";box-sizing:border-box;color:rgba(0,0,0,.85);font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;margin:0;padding:0}.ant-upload-list:after,.ant-upload-list:before{content:"";display:table}.ant-upload-list:after{clear:both}.ant-upload-list-item{font-size:14px;height:22.001px;margin-top:8px;position:relative}.ant-upload-list-item-name{display:inline-block;line-height:1.5715;overflow:hidden;padding-left:22px;text-overflow:ellipsis;white-space:nowrap;width:100%}.ant-upload-list-item-card-actions{position:absolute;right:0}.ant-upload-list-item-card-actions-btn{opacity:0}.ant-upload-list-item-card-actions-btn.ant-btn-sm{height:22.001px;line-height:1;vertical-align:top}.ant-upload-list-item-card-actions.picture{line-height:0;top:22px}.ant-upload-list-item-card-actions-btn:focus,.ant-upload-list-item-card-actions.picture .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-card-actions .anticon{color:rgba(0,0,0,.45);transition:all .3s}.ant-upload-list-item-card-actions:hover .anticon{color:rgba(0,0,0,.85)}.ant-upload-list-item-info{height:100%;transition:background-color .3s}.ant-upload-list-item-info>span{display:block;height:100%;width:100%}.ant-upload-list-item-info .ant-upload-text-icon .anticon,.ant-upload-list-item-info .anticon-loading .anticon{color:rgba(0,0,0,.45);font-size:14px;position:absolute;top:5px}.ant-upload-list-item:hover .ant-upload-list-item-info{background-color:#f5f5f5}.ant-upload-list-item:hover .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-error,.ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon,.ant-upload-list-item-error .ant-upload-list-item-name,.ant-upload-list-item-error .ant-upload-text-icon>.anticon{color:#ff4d4f}.ant-upload-list-item-error .ant-upload-list-item-card-actions-btn{opacity:1}.ant-upload-list-item-progress{bottom:-12px;font-size:14px;line-height:0;padding-left:26px;position:absolute;width:100%}.ant-upload-list-picture .ant-upload-list-item,.ant-upload-list-picture-card .ant-upload-list-item{border:1px solid #d9d9d9;border-radius:2px;height:66px;padding:8px;position:relative}.ant-upload-list-picture .ant-upload-list-item:hover,.ant-upload-list-picture-card .ant-upload-list-item:hover{background:transparent}.ant-upload-list-picture .ant-upload-list-item-error,.ant-upload-list-picture-card .ant-upload-list-item-error{border-color:#ff4d4f}.ant-upload-list-picture .ant-upload-list-item:hover .ant-upload-list-item-info,.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info{background:transparent}.ant-upload-list-picture .ant-upload-list-item-uploading,.ant-upload-list-picture-card .ant-upload-list-item-uploading{border-style:dashed}.ant-upload-list-picture .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail{height:48px;line-height:60px;opacity:.8;text-align:center;width:48px}.ant-upload-list-picture .ant-upload-list-item-thumbnail .anticon,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail .anticon{font-size:26px}.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"],.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#e6f7ff"]{fill:#fff2f0}.ant-upload-list-picture .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"],.ant-upload-list-picture-card .ant-upload-list-item-error .ant-upload-list-item-thumbnail .anticon svg path[fill="#1890ff"]{fill:#ff4d4f}.ant-upload-list-picture .ant-upload-list-item-icon,.ant-upload-list-picture-card .ant-upload-list-item-icon{font-size:26px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.ant-upload-list-picture .ant-upload-list-item-icon .anticon,.ant-upload-list-picture-card .ant-upload-list-item-icon .anticon{font-size:26px}.ant-upload-list-picture .ant-upload-list-item-image,.ant-upload-list-picture-card .ant-upload-list-item-image{max-width:100%}.ant-upload-list-picture .ant-upload-list-item-thumbnail img,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{display:block;height:48px;overflow:hidden;width:48px}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-picture-card .ant-upload-list-item-name{box-sizing:border-box;display:inline-block;line-height:44px;margin:0 0 0 8px;max-width:100%;overflow:hidden;padding-left:48px;padding-right:8px;text-overflow:ellipsis;transition:all .3s;white-space:nowrap}.ant-upload-list-picture .ant-upload-list-item-uploading .ant-upload-list-item-name,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-name{margin-bottom:12px}.ant-upload-list-picture .ant-upload-list-item-progress,.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:14px;margin-top:0;padding-left:56px;width:calc(100% - 24px)}.ant-upload-list-picture-card-container{display:inline-block;height:104px;margin:0 8px 8px 0;vertical-align:top;width:104px}.ant-upload-list-picture-card .ant-upload-list-item{height:100%;margin:0}.ant-upload-list-picture-card .ant-upload-list-item-info{height:100%;overflow:hidden;position:relative}.ant-upload-list-picture-card .ant-upload-list-item-info:before{background-color:rgba(0,0,0,.5);content:" ";height:100%;opacity:0;position:absolute;transition:all .3s;width:100%;z-index:1}.ant-upload-list-picture-card .ant-upload-list-item:hover .ant-upload-list-item-info:before{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-actions{left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);transition:all .3s;white-space:nowrap;z-index:10}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye{color:hsla(0,0%,100%,.85);cursor:pointer;font-size:16px;margin:0 4px;transition:all .3s;width:16px;z-index:10}.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-delete:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-download:hover,.ant-upload-list-picture-card .ant-upload-list-item-actions .anticon-eye:hover{color:#fff}.ant-upload-list-picture-card .ant-upload-list-item-actions:hover,.ant-upload-list-picture-card .ant-upload-list-item-info:hover+.ant-upload-list-item-actions{opacity:1}.ant-upload-list-picture-card .ant-upload-list-item-thumbnail,.ant-upload-list-picture-card .ant-upload-list-item-thumbnail img{display:block;height:100%;-o-object-fit:contain;object-fit:contain;position:static;width:100%}.ant-upload-list-picture-card .ant-upload-list-item-name{display:none;line-height:1.5715;margin:8px 0 0;padding:0;text-align:center}.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{bottom:10px;display:block;position:absolute}.ant-upload-list-picture-card .ant-upload-list-item-uploading.ant-upload-list-item{background-color:#fafafa}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info{height:auto}.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-delete,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info .anticon-eye,.ant-upload-list-picture-card .ant-upload-list-item-uploading .ant-upload-list-item-info:before{display:none}.ant-upload-list-picture-card .ant-upload-list-item-progress{bottom:32px;padding-left:0;width:calc(100% - 14px)}.ant-upload-list-picture-container,.ant-upload-list-text-container{transition:opacity .3s,height .3s}.ant-upload-list-picture-container:before,.ant-upload-list-text-container:before{content:"";display:table;height:0;width:0}.ant-upload-list-picture-container .ant-upload-span,.ant-upload-list-text-container .ant-upload-span{display:block;flex:auto}.ant-upload-list-picture .ant-upload-span,.ant-upload-list-text .ant-upload-span{align-items:center;display:flex}.ant-upload-list-picture .ant-upload-span>*,.ant-upload-list-text .ant-upload-span>*{flex:none}.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-text .ant-upload-list-item-name{flex:auto;margin:0;padding:0 8px}.ant-upload-list-picture .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-list-item-card-actions,.ant-upload-list-text .ant-upload-text-icon .anticon{position:static}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter,.ant-upload-list .ant-upload-animate-inline-leave{-webkit-animation-duration:.3s;animation-duration:.3s;-webkit-animation-timing-function:cubic-bezier(.78,.14,.15,.86);animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ant-upload-list .ant-upload-animate-inline-appear,.ant-upload-list .ant-upload-animate-inline-enter{-webkit-animation-name:uploadAnimateInlineIn;animation-name:uploadAnimateInlineIn}.ant-upload-list .ant-upload-animate-inline-leave{-webkit-animation-name:uploadAnimateInlineOut;animation-name:uploadAnimateInlineOut}@-webkit-keyframes uploadAnimateInlineIn{0%{height:0;margin:0;opacity:0;padding:0;width:0}}@keyframes uploadAnimateInlineIn{0%{height:0;margin:0;opacity:0;padding:0;width:0}}@-webkit-keyframes uploadAnimateInlineOut{to{height:0;margin:0;opacity:0;padding:0;width:0}}@keyframes uploadAnimateInlineOut{to{height:0;margin:0;opacity:0;padding:0;width:0}}.ant-upload-rtl{direction:rtl}.ant-upload-rtl.ant-upload.ant-upload-select-picture-card{margin-left:8px;margin-right:auto}.ant-upload-list-rtl{direction:rtl}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-1{padding-left:14px;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-list-type-text:hover .ant-upload-list-item-name-icon-count-2{padding-left:28px;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-name{padding-left:0;padding-right:22px}.ant-upload-list-rtl .ant-upload-list-item-name-icon-count-1{padding-left:14px}.ant-upload-list-rtl .ant-upload-list-item-card-actions{left:0;right:auto}.ant-upload-list-rtl .ant-upload-list-item-card-actions .anticon{padding-left:5px;padding-right:0}.ant-upload-list-rtl .ant-upload-list-item-info{padding:0 4px 0 12px}.ant-upload-list-rtl .ant-upload-list-item-error .ant-upload-list-item-card-actions .anticon{padding-left:5px;padding-right:0}.ant-upload-list-rtl .ant-upload-list-item-progress{padding-left:0;padding-right:26px}.ant-upload-list-picture .ant-upload-list-item-info,.ant-upload-list-picture-card .ant-upload-list-item-info{padding:0}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-thumbnail,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-thumbnail{left:auto;right:8px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-icon,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-icon{left:auto;right:50%;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name{margin:0 8px 0 0;padding-left:8px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-1,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-1{padding-left:18px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-name-icon-count-2,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-name-icon-count-2{padding-left:36px;padding-right:48px}.ant-upload-list-rtl.ant-upload-list-picture .ant-upload-list-item-progress,.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-progress{padding-left:0;padding-right:0}.ant-upload-list-rtl .ant-upload-list-picture-card-container{margin:0 0 8px 8px}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-actions{left:auto;right:50%;transform:translate(50%,-50%)}.ant-upload-list-rtl.ant-upload-list-picture-card .ant-upload-list-item-file+.ant-upload-list-item-name{margin:8px 0 0;padding:0}#wpcontent{padding-left:0}#wpbody-content{padding-bottom:0}#wpbody-content .wrap{margin:0}#wpfooter{display:none}body:not(.graphiql-fullscreen) #wpbody-content{margin-bottom:-32px;position:-webkit-sticky;position:sticky;top:32px}#wpbody-content>:not(.wrap){display:none} diff --git a/lib/wp-graphql-1.17.0/build/app.js b/lib/wp-graphql-1.17.0/build/app.js deleted file mode 100644 index f3b01d7e..00000000 --- a/lib/wp-graphql-1.17.0/build/app.js +++ /dev/null @@ -1,38 +0,0 @@ -!function(){var e,t={8870:function(e,t,n){"use strict";var r=n(9307);function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function a(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}var h=n(4184),m=n.n(h),v=(0,s.createContext)({});function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function g(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function b(e){return e<=1?100*Number(e)+"%":e}function E(e){return 1===e.length?"0"+e:String(e)}function w(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function T(e){return _(e)/255}function _(e){return parseInt(e,16)}var k={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function O(e){var t={r:0,g:0,b:0},n=1,r=null,i=null,o=null,a=!1,s=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(k[e])e=k[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=N.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=N.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=N.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=N.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=N.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=N.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=N.hex8.exec(e))?{r:_(n[1]),g:_(n[2]),b:_(n[3]),a:T(n[4]),format:t?"name":"hex8"}:(n=N.hex6.exec(e))?{r:_(n[1]),g:_(n[2]),b:_(n[3]),format:t?"name":"hex"}:(n=N.hex4.exec(e))?{r:_(n[1]+n[1]),g:_(n[2]+n[2]),b:_(n[3]+n[3]),a:T(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=N.hex3.exec(e))&&{r:_(n[1]+n[1]),g:_(n[2]+n[2]),b:_(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(A(e.r)&&A(e.g)&&A(e.b)?(t=function(e,t,n){return{r:255*g(e,255),g:255*g(t,255),b:255*g(n,255)}}(e.r,e.g,e.b),a=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):A(e.h)&&A(e.s)&&A(e.v)?(r=b(e.s),i=b(e.v),t=function(e,t,n){e=6*g(e,360),t=g(t,100),n=g(n,100);var r=Math.floor(e),i=e-r,o=n*(1-t),a=n*(1-i*t),s=n*(1-(1-i)*t),c=r%6;return{r:255*[n,a,o,o,s,n][c],g:255*[s,n,n,a,o,o][c],b:255*[o,o,s,n,n,a][c]}}(e.h,r,i),a=!0,s="hsv"):A(e.h)&&A(e.s)&&A(e.l)&&(r=b(e.s),o=b(e.l),t=function(e,t,n){var r,i,o;if(e=g(e,360),t=g(t,100),n=g(n,100),0===t)i=n,o=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,s=2*n-a;r=w(s,a,e+1/3),i=w(s,a,e),o=w(s,a,e-1/3)}return{r:255*r,g:255*i,b:255*o}}(e.h,r,o),a=!0,s="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(n),{ok:a,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var S="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",x="[\\s|\\(]+("+S+")[,|\\s]+("+S+")[,|\\s]+("+S+")\\s*\\)?",C="[\\s|\\(]+("+S+")[,|\\s]+("+S+")[,|\\s]+("+S+")[,|\\s]+("+S+")\\s*\\)?",N={CSS_UNIT:new RegExp(S),rgb:new RegExp("rgb"+x),rgba:new RegExp("rgba"+C),hsl:new RegExp("hsl"+x),hsla:new RegExp("hsla"+C),hsv:new RegExp("hsv"+x),hsva:new RegExp("hsva"+C),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function A(e){return Boolean(N.CSS_UNIT.exec(String(e)))}var L=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function D(e){var t=function(e,t,n){e=g(e,255),t=g(t,255),n=g(n,255);var r=Math.max(e,t,n),i=Math.min(e,t,n),o=0,a=r,s=r-i,c=0===r?0:s/r;if(r===i)o=0;else{switch(r){case e:o=(t-n)/s+(t=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function M(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function j(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function F(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=O(e),i=5;i>0;i-=1){var o=D(r),a=I(O({h:R(o,i,!0),s:M(o,i,!0),v:j(o,i,!0)}));n.push(a)}n.push(I(r));for(var s=1;s<=4;s+=1){var c=D(r),l=I(O({h:R(c,s),s:M(c,s),v:j(c,s)}));n.push(l)}return"dark"===t.theme?L.map((function(e){var r=e.index,i=e.opacity;return I(P(O(t.backgroundColor||"#141414"),O(n[r]),100*i))})):n}var V={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},Q={},q={};Object.keys(V).forEach((function(e){Q[e]=F(V[e]),Q[e].primary=Q[e][5],q[e]=F(V[e],{theme:"dark",backgroundColor:"#141414"}),q[e].primary=q[e][5]})),Q.red,Q.volcano,Q.gold,Q.orange,Q.yellow,Q.lime,Q.green,Q.cyan,Q.blue,Q.geekblue,Q.purple,Q.magenta,Q.grey;var U={};function G(e,t){}var B=function(e,t){!function(e,t,n){t||U[n]||(e(!1,n),U[n]=!0)}(G,e,t)};function K(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}var z="rc-util-key";function $(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):z}function H(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function W(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!K())return null;var r,i=document.createElement("style");(null===(t=n.csp)||void 0===t?void 0:t.nonce)&&(i.nonce=null===(r=n.csp)||void 0===r?void 0:r.nonce),i.innerHTML=e;var o=H(n),a=o.firstChild;return n.prepend&&o.prepend?o.prepend(i):n.prepend&&a?o.insertBefore(i,a):o.appendChild(i),i}var Y=new Map;function J(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=H(t);return Array.from(Y.get(n).children).find((function(n){return"STYLE"===n.tagName&&n.getAttribute($(t))===e}))}function X(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=H(n);if(!Y.has(r)){var i=W("",n),o=i.parentNode;Y.set(r,o),o.removeChild(i)}var a,s,c,l=J(t,n);if(l)return(null===(a=n.csp)||void 0===a?void 0:a.nonce)&&l.nonce!==(null===(s=n.csp)||void 0===s?void 0:s.nonce)&&(l.nonce=null===(c=n.csp)||void 0===c?void 0:c.nonce),l.innerHTML!==e&&(l.innerHTML=e),l;var u=W(e,n);return u.setAttribute($(n),t),u}function Z(e){return"object"===y(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===y(e.icon)||"function"==typeof e.icon)}function ee(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){var r=e[n];return"class"===n?(t.className=r,delete t.class):t[n]=r,t}),{})}function te(e,t,n){return n?c().createElement(e.tag,a(a({key:t},ee(e.attrs)),n),(e.children||[]).map((function(n,r){return te(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))):c().createElement(e.tag,a({key:t},ee(e.attrs)),(e.children||[]).map((function(n,r){return te(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})))}function ne(e){return F(e)[0]}function re(e){return e?Array.isArray(e)?e:[e]:[]}var ie="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",oe=["icon","className","onClick","style","primaryColor","secondaryColor"],ae={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},se=function(e){var t,n,r=e.icon,i=e.className,o=e.onClick,c=e.style,l=e.primaryColor,u=e.secondaryColor,p=d(e,oe),f=ae;if(l&&(f={primaryColor:l,secondaryColor:u||ne(l)}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie,t=(0,s.useContext)(v).csp;(0,s.useEffect)((function(){X(e,"@ant-design-icons",{prepend:!0,csp:t})}),[])}(),t=Z(r),n="icon should be icon definiton, but got ".concat(r),B(t,"[@ant-design/icons] ".concat(n)),!Z(r))return null;var h=r;return h&&"function"==typeof h.icon&&(h=a(a({},h),{},{icon:h.icon(f.primaryColor,f.secondaryColor)})),te(h.icon,"svg-".concat(h.name),a({className:i,onClick:o,style:c,"data-icon":h.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},p))};se.displayName="IconReact",se.getTwoToneColors=function(){return a({},ae)},se.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;ae.primaryColor=t,ae.secondaryColor=n||ne(t),ae.calculated=!!n};var ce=se;function le(e){var t=f(re(e),2),n=t[0],r=t[1];return ce.setTwoToneColors({primaryColor:n,secondaryColor:r})}var ue=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];le("#1890ff");var pe=s.forwardRef((function(e,t){var n,r=e.className,o=e.icon,c=e.spin,l=e.rotate,u=e.tabIndex,p=e.onClick,h=e.twoToneColor,y=d(e,ue),g=s.useContext(v).prefixCls,b=void 0===g?"anticon":g,E=m()(b,(i(n={},"".concat(b,"-").concat(o.name),!!o.name),i(n,"".concat(b,"-spin"),!!c||"loading"===o.name),n),r),w=u;void 0===w&&p&&(w=-1);var T=l?{msTransform:"rotate(".concat(l,"deg)"),transform:"rotate(".concat(l,"deg)")}:void 0,_=f(re(h),2),k=_[0],O=_[1];return s.createElement("span",a(a({role:"img","aria-label":o.name},y),{},{ref:t,tabIndex:w,onClick:p,className:E}),s.createElement(ce,{icon:o,primaryColor:k,secondaryColor:O,style:T}))}));pe.displayName="AntdIcon",pe.getTwoToneColor=function(){var e=ce.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},pe.setTwoToneColor=le;var fe=pe,de=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:l}))};de.displayName="CodeOutlined";var he=s.forwardRef(de),me={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},ve=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:me}))};ve.displayName="QuestionCircleOutlined";var ye=s.forwardRef(ve),ge={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},be=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:ge}))};be.displayName="RightOutlined";var Ee=s.forwardRef(be),we={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},Te=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:we}))};Te.displayName="LeftOutlined";var _e=s.forwardRef(Te);function ke(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||p(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t0),i(n,"".concat(l,"-rtl"),"rtl"===r),n),u),g=s.useMemo((function(){return{siderHook:{addSider:function(e){c((function(t){return[].concat(ke(t),[e])}))},removeSider:function(e){c((function(t){return t.filter((function(t){return t!==e}))}))}}}}),[]);return s.createElement(Ne.Provider,{value:g},s.createElement(h,Oe({ref:t,className:y},v),p))})),Ie=Ae({suffixCls:"layout",tagName:"section",displayName:"Layout"})(De),Pe=Ae({suffixCls:"layout-header",tagName:"header",displayName:"Header"})(Le),Re=Ae({suffixCls:"layout-footer",tagName:"footer",displayName:"Footer"})(Le),Me=Ae({suffixCls:"layout-content",tagName:"main",displayName:"Content"})(Le),je=Ie,Fe={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M912 192H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 284H328c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h584c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM104 228a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0zm0 284a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"bars",theme:"outlined"},Ve=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:Fe}))};Ve.displayName="BarsOutlined";var Qe=s.forwardRef(Ve);function qe(e,t){var n=a({},e);return Array.isArray(t)&&t.forEach((function(e){delete n[e]})),n}var Ue,Ge={xs:"479.98px",sm:"575.98px",md:"767.98px",lg:"991.98px",xl:"1199.98px",xxl:"1599.98px"},Be=s.createContext({}),Ke=(Ue=0,function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Ue+=1,"".concat(e).concat(Ue)}),ze=s.forwardRef((function(e,t){var n=e.prefixCls,r=e.className,o=e.trigger,a=e.children,c=e.defaultCollapsed,l=void 0!==c&&c,u=e.theme,p=void 0===u?"dark":u,d=e.style,h=void 0===d?{}:d,v=e.collapsible,y=void 0!==v&&v,g=e.reverseArrow,b=void 0!==g&&g,E=e.width,w=void 0===E?200:E,T=e.collapsedWidth,_=void 0===T?80:T,k=e.zeroWidthTriggerStyle,O=e.breakpoint,S=e.onCollapse,x=e.onBreakpoint,C=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i1&&void 0!==arguments[1]?arguments[1]:{},n=[];return c().Children.forEach(e,(function(e){(null!=e||t.keepEmpty)&&(Array.isArray(e)?n=n.concat(yt(e)):(0,vt.isFragment)(e)&&e.props?n=n.concat(yt(e.props.children,t)):n.push(e))})),n}function gt(e,t){"function"==typeof e?e(t):"object"===y(e)&&e&&"current"in e&&(e.current=t)}function bt(){for(var e=arguments.length,t=new Array(e),n=0;n0},e.prototype.connect_=function(){Ot&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Nt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Ot&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;Ct.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Lt=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),Ut="undefined"!=typeof WeakMap?new WeakMap:new kt,Gt=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=At.getInstance(),r=new qt(t,n,this);Ut.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Gt.prototype[e]=function(){var t;return(t=Ut.get(this))[e].apply(t,arguments)}}));var Bt=void 0!==St.ResizeObserver?St.ResizeObserver:Gt,Kt=new Map,zt=new Bt((function(e){e.forEach((function(e){var t,n=e.target;null===(t=Kt.get(n))||void 0===t||t.forEach((function(e){return e(n)}))}))})),$t=function(e){et(n,e);var t=it(n);function n(){return Ye(this,n),t.apply(this,arguments)}return Xe(n,[{key:"render",value:function(){return this.props.children}}]),n}(s.Component),Ht=s.createContext(null);function Wt(e){var t=e.children,n=e.disabled,r=s.useRef(null),i=s.useRef(null),o=s.useContext(Ht),c="function"==typeof t,l=c?t(r):t,u=s.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),p=!c&&s.isValidElement(l)&&Et(l),f=p?l.ref:null,d=s.useMemo((function(){return bt(f,r)}),[f,r]),h=s.useRef(e);h.current=e;var m=s.useCallback((function(e){var t=h.current,n=t.onResize,r=t.data,i=e.getBoundingClientRect(),s=i.width,c=i.height,l=e.offsetWidth,p=e.offsetHeight,f=Math.floor(s),d=Math.floor(c);if(u.current.width!==f||u.current.height!==d||u.current.offsetWidth!==l||u.current.offsetHeight!==p){var m={width:f,height:d,offsetWidth:l,offsetHeight:p};u.current=m;var v=l===Math.round(s)?s:l,y=p===Math.round(c)?c:p,g=a(a({},m),{},{offsetWidth:v,offsetHeight:y});null==o||o(g,e,r),n&&Promise.resolve().then((function(){n(g,e)}))}}),[]);return s.useEffect((function(){var e,t,o=_t(r.current)||_t(i.current);return o&&!n&&(e=o,t=m,Kt.has(e)||(Kt.set(e,new Set),zt.observe(e)),Kt.get(e).add(t)),function(){return function(e,t){Kt.has(e)&&(Kt.get(e).delete(t),Kt.get(e).size||(zt.unobserve(e),Kt.delete(e)))}(o,m)}}),[r.current,n]),s.createElement($t,{ref:i},p?s.cloneElement(l,{ref:d}):l)}function Yt(e){var t=e.children;return("function"==typeof t?[t]:yt(t)).map((function(t,n){var r=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(n);return s.createElement(Wt,Oe({},e,{key:r}),t)}))}Yt.Collection=function(e){var t=e.children,n=e.onBatchResize,r=s.useRef(0),i=s.useRef([]),o=s.useContext(Ht),a=s.useCallback((function(e,t,a){r.current+=1;var s=r.current;i.current.push({size:e,element:t,data:a}),Promise.resolve().then((function(){s===r.current&&(null==n||n(i.current),i.current=[])})),null==o||o(e,t,a)}),[n,o]);return s.createElement(Ht.Provider,{value:a},t)};var Jt=Yt,Xt=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Zt=void 0;function en(e,t){var n=e.prefixCls,r=e.invalidate,i=e.item,o=e.renderItem,c=e.responsive,l=e.responsiveDisabled,u=e.registerSize,p=e.itemKey,f=e.className,h=e.style,v=e.children,y=e.display,g=e.order,b=e.component,E=void 0===b?"div":b,w=d(e,Xt),T=c&&!y;function _(e){u(p,e)}s.useEffect((function(){return function(){_(null)}}),[]);var k,O=o&&i!==Zt?o(i):v;r||(k={opacity:T?0:1,height:T?0:Zt,overflowY:T?"hidden":Zt,order:c?g:Zt,pointerEvents:T?"none":Zt,position:T?"absolute":Zt});var S={};T&&(S["aria-hidden"]=!0);var x=s.createElement(E,Oe({className:m()(!r&&n,f),style:a(a({},k),h)},S,w,{ref:t}),O);return c&&(x=s.createElement(Jt,{onResize:function(e){_(e.offsetWidth)},disabled:l},x)),x}var tn=s.forwardRef(en);tn.displayName="Item";var nn=tn,rn=function(e){return+setTimeout(e,16)},on=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(rn=function(e){return window.requestAnimationFrame(e)},on=function(e){return window.cancelAnimationFrame(e)});var an=0,sn=new Map;function cn(e){sn.delete(e)}function ln(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=an+=1;function r(t){if(0===t)cn(n),e();else{var i=rn((function(){r(t-1)}));sn.set(n,i)}}return r(t),n}ln.cancel=function(e){var t=sn.get(e);return cn(t),on(t)};var un=["component"],pn=["className"],fn=["className"],dn=function(e,t){var n=s.useContext(yn);if(!n){var r=e.component,i=void 0===r?"div":r,o=d(e,un);return s.createElement(i,Oe({},o,{ref:t}))}var a=n.className,c=d(n,pn),l=e.className,u=d(e,fn);return s.createElement(yn.Provider,{value:null},s.createElement(nn,Oe({ref:t,className:m()(a,l)},c,u)))},hn=s.forwardRef(dn);hn.displayName="RawItem";var mn=hn,vn=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],yn=s.createContext(null),gn="responsive",bn="invalidate";function En(e){return"+ ".concat(e.length," ...")}function wn(e,t){var n,r,i,o,c=e.prefixCls,l=void 0===c?"rc-overflow":c,u=e.data,p=void 0===u?[]:u,h=e.renderItem,v=e.renderRawItem,y=e.itemKey,g=e.itemWidth,b=void 0===g?10:g,E=e.ssr,w=e.style,T=e.className,_=e.maxCount,k=e.renderRest,O=e.renderRawRest,S=e.suffix,x=e.component,C=void 0===x?"div":x,N=e.itemComponent,A=e.onVisibleChange,L=d(e,vn),D=(n=f(dt({}),2)[1],r=(0,s.useRef)([]),i=0,o=0,function(e){var t=i;return i+=1,r.current.length_,fe=(0,s.useMemo)((function(){var e=p;return le?e=null===R&&I?p:p.slice(0,Math.min(p.length,j/b)):"number"==typeof _&&(e=p.slice(0,_)),e}),[p,b,R,_,le]),de=(0,s.useMemo)((function(){return le?p.slice(ne+1):p.slice(fe.length)}),[p,fe,le,ne]),he=(0,s.useCallback)((function(e,t){var n;return"function"==typeof y?y(e):null!==(n=y&&(null==e?void 0:e[y]))&&void 0!==n?n:t}),[y]),me=(0,s.useCallback)(h||function(e){return e},[h]);function ve(e,t){te(e),t||(oe(ej){ve(r-1),X(e-i-H+K);break}}S&&ge(0)+H>j&&X(null)}}),[j,V,K,H,he,fe]);var be=ie&&!!de.length,Ee={};null!==J&&le&&(Ee={position:"absolute",left:J,top:0});var we,Te={prefixCls:ae,responsive:le,component:N,invalidate:ue},_e=v?function(e,t){var n=he(e,t);return s.createElement(yn.Provider,{key:n,value:a(a({},Te),{},{order:t,item:e,itemKey:n,registerSize:ye,display:t<=ne})},v(e,t))}:function(e,t){var n=he(e,t);return s.createElement(nn,Oe({},Te,{order:t,key:n,item:e,renderItem:me,itemKey:n,registerSize:ye,display:t<=ne}))},ke={order:be?ne:Number.MAX_SAFE_INTEGER,className:"".concat(ae,"-rest"),registerSize:function(e,t){z(t),G(K)},display:be};if(O)O&&(we=s.createElement(yn.Provider,{value:a(a({},Te),ke)},O(de)));else{var Se=k||En;we=s.createElement(nn,Oe({},Te,ke),"function"==typeof Se?Se(de):Se)}var xe=s.createElement(C,Oe({className:m()(!ue&&l,T),style:w,ref:t},L),fe.map(_e),pe?we:null,S&&s.createElement(nn,Oe({},Te,{responsive:ce,responsiveDisabled:!le,order:ne,className:"".concat(ae,"-suffix"),registerSize:function(e,t){W(t)},display:!0,style:Ee}),S));return ce&&(xe=s.createElement(Jt,{onResize:function(e,t){M(t.clientWidth)},disabled:!le},xe)),xe}var Tn=s.forwardRef(wn);Tn.displayName="Overflow",Tn.Item=mn,Tn.RESPONSIVE=gn,Tn.INVALIDATE=bn;var kn=Tn,On={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=On.F1&&t<=On.F12)return!1;switch(t){case On.ALT:case On.CAPS_LOCK:case On.CONTEXT_MENU:case On.CTRL:case On.DOWN:case On.END:case On.ESC:case On.HOME:case On.INSERT:case On.LEFT:case On.MAC_FF_META:case On.META:case On.NUMLOCK:case On.NUM_CENTER:case On.PAGE_DOWN:case On.PAGE_UP:case On.PAUSE:case On.PRINT_SCREEN:case On.RIGHT:case On.SHIFT:case On.UP:case On.WIN_KEY:case On.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=On.ZERO&&e<=On.NINE)return!0;if(e>=On.NUM_ZERO&&e<=On.NUM_MULTIPLY)return!0;if(e>=On.A&&e<=On.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case On.SPACE:case On.QUESTION_MARK:case On.NUM_PLUS:case On.NUM_MINUS:case On.NUM_PERIOD:case On.NUM_DIVISION:case On.SEMICOLON:case On.DASH:case On.EQUALS:case On.COMMA:case On.PERIOD:case On.SLASH:case On.APOSTROPHE:case On.SINGLE_QUOTE:case On.OPEN_SQUARE_BRACKET:case On.BACKSLASH:case On.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},Sn=On,xn=["children","locked"],Cn=s.createContext(null);function Nn(e){var t,n,r,i,o,c,l=e.children,u=e.locked,p=d(e,xn),f=s.useContext(Cn),h=(t=[f,p],"value"in(c=s.useRef({})).current&&(i=c.current.condition,o=t,!!(u||i[0]===o[0]&<()(i[1],o[1])))||(c.current.value=(n=p,r=a({},f),Object.keys(n).forEach((function(e){var t=n[e];void 0!==t&&(r[e]=t)})),r),c.current.condition=t),c.current.value);return s.createElement(Cn.Provider,{value:h},l)}function An(e,t,n,r){var i=s.useContext(Cn),o=i.activeKey,a=i.onActive,c=i.onInactive,l={active:o===e};return t||(l.onMouseEnter=function(t){null==n||n({key:e,domEvent:t}),a(e)},l.onMouseLeave=function(t){null==r||r({key:e,domEvent:t}),c(e)}),l}var Ln=["item"];function Dn(e){var t=e.item,n=d(e,Ln);return Object.defineProperty(n,"item",{get:function(){return B(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),n}function In(e){var t=e.icon,n=e.props,r=e.children;return("function"==typeof t?s.createElement(t,a({},n)):t)||r||null}function Pn(e){var t=s.useContext(Cn),n=t.mode,r=t.rtl,i=t.inlineIndent;return"inline"!==n?null:r?{paddingRight:e*i}:{paddingLeft:e*i}}var Rn=[],Mn=s.createContext(null);function jn(){return s.useContext(Mn)}var Fn=s.createContext(Rn);function Vn(e){var t=s.useContext(Fn);return s.useMemo((function(){return void 0!==e?[].concat(ke(t),[e]):t}),[t,e])}var Qn=s.createContext(null),qn=s.createContext(null);function Un(e,t){return void 0===e?null:"".concat(e,"-").concat(t)}function Gn(e){return Un(s.useContext(qn),e)}var Bn=s.createContext({}),Kn=["title","attribute","elementRef"],zn=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],$n=["active"],Hn=function(e){et(n,e);var t=it(n);function n(){return Ye(this,n),t.apply(this,arguments)}return Xe(n,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.attribute,r=e.elementRef,i=qe(d(e,Kn),["eventKey"]);return B(!n,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),s.createElement(kn.Item,Oe({},n,{title:"string"==typeof t?t:void 0},i,{ref:r}))}}]),n}(s.Component),Wn=function(e){var t,n=e.style,r=e.className,o=e.eventKey,c=(e.warnKey,e.disabled),l=e.itemIcon,u=e.children,p=e.role,f=e.onMouseEnter,h=e.onMouseLeave,v=e.onClick,y=e.onKeyDown,g=e.onFocus,b=d(e,zn),E=Gn(o),w=s.useContext(Cn),T=w.prefixCls,_=w.onItemClick,k=w.disabled,O=w.overflowDisabled,S=w.itemIcon,x=w.selectedKeys,C=w.onActive,N=s.useContext(Bn)._internalRenderMenuItem,A="".concat(T,"-item"),L=s.useRef(),D=s.useRef(),I=k||c,P=Vn(o),R=function(e){return{key:o,keyPath:ke(P).reverse(),item:L.current,domEvent:e}},M=l||S,j=An(o,I,f,h),F=j.active,V=d(j,$n),Q=x.includes(o),q=Pn(P.length),U={};"option"===e.role&&(U["aria-selected"]=Q);var G=s.createElement(Hn,Oe({ref:L,elementRef:D,role:null===p?"none":p||"menuitem",tabIndex:c?null:-1,"data-menu-id":O&&E?null:E},b,V,U,{component:"li","aria-disabled":c,style:a(a({},q),n),className:m()(A,(t={},i(t,"".concat(A,"-active"),F),i(t,"".concat(A,"-selected"),Q),i(t,"".concat(A,"-disabled"),I),t),r),onClick:function(e){if(!I){var t=R(e);null==v||v(Dn(t)),_(t)}},onKeyDown:function(e){if(null==y||y(e),e.which===Sn.ENTER){var t=R(e);null==v||v(Dn(t)),_(t)}},onFocus:function(e){C(o),null==g||g(e)}}),u,s.createElement(In,{props:a(a({},e),{},{isSelected:Q}),icon:M}));return N&&(G=N(G,e,{selected:Q})),G},Yn=function(e){var t=e.eventKey,n=jn(),r=Vn(t);return s.useEffect((function(){if(n)return n.registerPath(t,r),function(){n.unregisterPath(t,r)}}),[r]),n?null:s.createElement(Wn,e)},Jn=["label","children","key","type"];function Xn(e,t){return yt(e).map((function(e,n){if(s.isValidElement(e)){var r,i,o=e.key,a=null!==(r=null===(i=e.props)||void 0===i?void 0:i.eventKey)&&void 0!==r?r:o;null==a&&(a="tmp_key-".concat([].concat(ke(t),[n]).join("-")));var c={key:a,eventKey:a};return s.cloneElement(e,c)}return e}))}function Zn(e){return(e||[]).map((function(e,t){if(e&&"object"===y(e)){var n=e.label,r=e.children,i=e.key,o=e.type,a=d(e,Jn),c=null!=i?i:"tmp-".concat(t);return r||"group"===o?"group"===o?s.createElement(la,Oe({key:c},a,{title:n}),Zn(r)):s.createElement(Fo,Oe({key:c},a,{title:n}),Zn(r)):"divider"===o?s.createElement(ua,Oe({key:c},a)):s.createElement(Yn,Oe({key:c},a),n)}return null})).filter((function(e){return e}))}function er(e,t,n){var r=e;return t&&(r=Zn(t)),Xn(r,n)}function tr(e){var t=s.useRef(e);t.current=e;var n=s.useCallback((function(){for(var e,n=arguments.length,r=new Array(n),i=0;i1&&void 0!==arguments[1]?arguments[1]:2;t();var o=ln((function(){i<=1?r({isCanceled:function(){return o!==e.current}}):n(r,i-1)}));e.current=o},t]}(),a=f(o,2),c=a[0],l=a[1];return Mr((function(){if(r!==Lr&&r!==Rr){var e=jr.indexOf(r),n=jr[e+1],o=t(r);!1===o?i(n,!0):c((function(e){function t(){e.isCanceled()||i(n,!0)}!0===o?t():Promise.resolve(o).then(t)}))}}),[e,r]),s.useEffect((function(){return function(){l()}}),[]),[function(){i(Dr,!0)},r]}(I,(function(e){if(e===Dr){var t=K.prepare;return!!t&&t(Q())}var n;return H in K&&j((null===(n=K[H])||void 0===n?void 0:n.call(K,Q(),null))||null),H===Pr&&(B(Q()),h>0&&(clearTimeout(V.current),V.current=setTimeout((function(){U({deadline:!0})}),h))),!0})),2),$=z[0],H=z[1],W=Fr(H);q.current=W,Mr((function(){L(t);var n,r=F.current;F.current=!0,e&&(!r&&t&&u&&(n=Cr),r&&t&&c&&(n=Nr),(r&&!t&&d||!r&&m&&!t&&d)&&(n=Ar),n&&(P(n),$()))}),[t]),(0,s.useEffect)((function(){(I===Cr&&!u||I===Nr&&!c||I===Ar&&!d)&&P(xr)}),[u,c,d]),(0,s.useEffect)((function(){return function(){F.current=!1,clearTimeout(V.current)}}),[]),(0,s.useEffect)((function(){void 0!==A&&I===xr&&(null==C||C(A))}),[A,I]);var Y=M;return K.prepare&&H===Ir&&(Y=a({transition:"none"},Y)),[I,H,Y,null!=A?A:t]}var Qr=function(e){et(n,e);var t=it(n);function n(){return Ye(this,n),t.apply(this,arguments)}return Xe(n,[{key:"render",value:function(){return this.props.children}}]),n}(s.Component),qr=Qr,Ur=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===y(e)&&(t=e.transitionSupport);var r=s.forwardRef((function(e,t){var r=e.visible,o=void 0===r||r,c=e.removeOnLeave,l=void 0===c||c,u=e.forceRender,p=e.children,d=e.motionName,h=e.leavedClassName,v=e.eventProps,y=n(e),g=(0,s.useRef)(),b=(0,s.useRef)(),E=f(Vr(y,o,(function(){try{return g.current instanceof HTMLElement?g.current:_t(b.current)}catch(e){return null}}),e),4),w=E[0],T=E[1],_=E[2],k=E[3],O=s.useRef(k);k&&(O.current=!0);var S,x=s.useCallback((function(e){g.current=e,gt(t,e)}),[t]),C=a(a({},v),{},{visible:o});if(p)if(w!==xr&&n(e)){var N,A;T===Dr?A="prepare":Fr(T)?A="active":T===Ir&&(A="start"),S=p(a(a({},C),{},{className:m()(Sr(d,w),(N={},i(N,Sr(d,"".concat(w,"-").concat(A)),A),i(N,d,"string"==typeof d),N)),style:_}),x)}else S=k?p(a({},C),x):!l&&O.current?p(a(a({},C),{},{className:h}),x):u?p(a(a({},C),{},{style:{display:"none"}}),x):null;else S=null;return s.isValidElement(S)&&Et(S)&&(S.ref||(S=s.cloneElement(S,{ref:x}))),s.createElement(qr,{ref:b},S)}));return r.displayName="CSSMotion",r}(_r),Gr="add",Br="keep",Kr="remove",zr="removed";function $r(e){var t;return a(a({},t=e&&"object"===y(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Hr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map($r)}function Wr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,i=t.length,o=Hr(e),s=Hr(t);o.forEach((function(e){for(var t=!1,o=r;o1}));return l.forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==Kr}))).forEach((function(t){t.key===e&&(t.status=Br)}))})),n}var Yr=["component","children","onVisibleChanged","onAllRemoved"],Jr=["status"],Xr=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ur,n=function(e){et(r,e);var n=it(r);function r(){var e;Ye(this,r);for(var t=arguments.length,i=new Array(t),o=0;o=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Ki(e){var t,n,r;if(Qi.isWindow(e)||9===e.nodeType){var i=Qi.getWindow(e);t={left:Qi.getWindowScrollLeft(i),top:Qi.getWindowScrollTop(i)},n=Qi.viewportWidth(i),r=Qi.viewportHeight(i)}else t=Qi.offset(e),n=Qi.outerWidth(e),r=Qi.outerHeight(e);return t.width=n,t.height=r,t}function zi(e,t){var n=t.charAt(0),r=t.charAt(1),i=e.width,o=e.height,a=e.left,s=e.top;return"c"===n?s+=o/2:"b"===n&&(s+=o),"c"===r?a+=i/2:"r"===r&&(a+=i),{left:a,top:s}}function $i(e,t,n,r,i){var o=zi(t,n[1]),a=zi(e,n[0]),s=[a.left-o.left,a.top-o.top];return{left:Math.round(e.left-s[0]+r[0]-i[0]),top:Math.round(e.top-s[1]+r[1]-i[1])}}function Hi(e,t,n){return e.leftn.right}function Wi(e,t,n){return e.topn.bottom}function Yi(e,t,n){var r=[];return Qi.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function Ji(e,t){return e[t]=-e[t],e}function Xi(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Zi(e,t){e[0]=Xi(e[0],t.width),e[1]=Xi(e[1],t.height)}function eo(e,t,n,r){var i=n.points,o=n.offset||[0,0],a=n.targetOffset||[0,0],s=n.overflow,c=n.source||e;o=[].concat(o),a=[].concat(a);var l={},u=0,p=Bi(c,!(!(s=s||{})||!s.alwaysByViewport)),f=Ki(c);Zi(o,f),Zi(a,t);var d=$i(f,t,i,o,a),h=Qi.merge(f,d);if(p&&(s.adjustX||s.adjustY)&&r){if(s.adjustX&&Hi(d,f,p)){var m=Yi(i,/[lr]/gi,{l:"r",r:"l"}),v=Ji(o,0),y=Ji(a,0);(function(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.left&&i.left+o.width>n.right&&(o.width-=i.left+o.width-n.right),r.adjustX&&i.left+o.width>n.right&&(i.left=Math.max(n.right-o.width,n.left)),r.adjustY&&i.top=n.top&&i.top+o.height>n.bottom&&(o.height-=i.top+o.height-n.bottom),r.adjustY&&i.top+o.height>n.bottom&&(i.top=Math.max(n.bottom-o.height,n.top)),Qi.mix(i,o)}(d,f,p,l))}return h.width!==f.width&&Qi.css(c,"width",Qi.width(c)+h.width-f.width),h.height!==f.height&&Qi.css(c,"height",Qi.height(c)+h.height-f.height),Qi.offset(c,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:i,offset:o,targetOffset:a,overflow:l}}function to(e,t,n){var r=n.target||t,i=Ki(r),o=!function(e,t){var n=Bi(e,t),r=Ki(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return eo(e,i,n,o)}to.__getOffsetParent=Ui,to.__getVisibleRectForElement=Bi;var no=n(8446),ro=n.n(no);function io(e,t){var n=null,r=null,i=new Bt((function(e){var i=f(e,1)[0].target;if(document.documentElement.contains(i)){var o=i.getBoundingClientRect(),a=o.width,s=o.height,c=Math.floor(a),l=Math.floor(s);n===c&&r===l||Promise.resolve().then((function(){t({width:c,height:l})})),n=c,r=l}}));return e&&i.observe(e),function(){i.disconnect()}}function oo(e){return"function"!=typeof e?null:e()}function ao(e){return"object"===y(e)&&e?e:null}var so=function(e,t){var n=e.children,r=e.disabled,i=e.target,o=e.align,a=e.onAlign,s=e.monitorWindowResize,l=e.monitorBufferTime,u=void 0===l?0:l,p=c().useRef({}),d=c().useRef(),h=c().Children.only(n),m=c().useRef({});m.current.disabled=r,m.current.target=i,m.current.align=o,m.current.onAlign=a;var v=function(e,t){var n=c().useRef(!1),r=c().useRef(null);function i(){window.clearTimeout(r.current)}return[function e(o){if(i(),n.current&&!0!==o)r.current=window.setTimeout((function(){n.current=!1,e()}),t);else{if(!1===function(){var e=m.current,t=e.disabled,n=e.target,r=e.align,i=e.onAlign;if(!t&&n){var o,a=d.current,s=oo(n),c=ao(n);p.current.element=s,p.current.point=c,p.current.align=r;var l=document.activeElement;return s&&ri(s)?o=to(a,s,r):c&&(o=function(e,t,n){var r,i,o=Qi.getDocument(e),a=o.defaultView||o.parentWindow,s=Qi.getWindowScrollLeft(a),c=Qi.getWindowScrollTop(a),l=Qi.viewportWidth(a),u=Qi.viewportHeight(a),p={left:r="pageX"in t?t.pageX:s+t.clientX,top:i="pageY"in t?t.pageY:c+t.clientY,width:0,height:0},f=r>=0&&r<=s+l&&i>=0&&i<=c+u,d=[n.points[0],"cc"];return eo(e,p,oi(oi({},n),{},{points:d}),f)}(a,c,r)),function(e,t){e!==document.activeElement&&ar(t,e)&&"function"==typeof e.focus&&e.focus()}(l,a),i&&o&&i(a,o),!0}return!1}())return;n.current=!0,r.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,i()}]}(0,u),y=f(v,2),g=y[0],b=y[1],E=c().useRef({cancel:function(){}}),w=c().useRef({cancel:function(){}});c().useEffect((function(){var e,t,n=oo(i),r=ao(i);d.current!==w.current.element&&(w.current.cancel(),w.current.element=d.current,w.current.cancel=io(d.current,g)),p.current.element===n&&((e=p.current.point)===(t=r)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&ro()(p.current.align,o)||(g(),E.current.element!==n&&(E.current.cancel(),E.current.element=n,E.current.cancel=io(n,g)))})),c().useEffect((function(){r?b():g()}),[r]);var T=c().useRef(null);return c().useEffect((function(){s?T.current||(T.current=sr(window,"resize",g)):T.current&&(T.current.remove(),T.current=null)}),[s]),c().useEffect((function(){return function(){E.current.cancel(),w.current.cancel(),T.current&&T.current.remove(),b()}}),[]),c().useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),c().isValidElement(h)&&(h=c().cloneElement(h,{ref:bt(h.ref,d)})),h},co=c().forwardRef(so);co.displayName="Align";var lo=co;function uo(){uo=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),a=new k(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return{value:void 0,done:!0}}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function p(){}function f(){}function d(){}var h={};s(h,i,(function(){return this}));var m=Object.getPrototypeOf,v=m&&m(m(O([])));v&&v!==t&&n.call(v,i)&&(h=v);var g=d.prototype=p.prototype=Object.create(h);function b(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(i,o,a,s){var c=l(e[i],e,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==y(p)&&n.call(p,"__await")?t.resolve(p.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(p).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function O(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),_(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:O(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function po(e,t,n,r,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void n(e)}s.done?t(c):Promise.resolve(c).then(r,i)}function fo(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){po(o,r,i,a,s,"next",e)}function s(e){po(o,r,i,a,s,"throw",e)}a(void 0)}))}}var ho=["measure","alignPre","align",null,"motion"],mo=s.forwardRef((function(e,t){var n=e.visible,r=e.prefixCls,i=e.className,o=e.style,c=e.children,l=e.zIndex,u=e.stretch,p=e.destroyPopupOnHide,d=e.forceRender,h=e.align,v=e.point,y=e.getRootDomNode,g=e.getClassNameFromAlign,b=e.onAlign,E=e.onMouseEnter,w=e.onMouseLeave,T=e.onMouseDown,_=e.onTouchStart,k=e.onClick,O=(0,s.useRef)(),S=(0,s.useRef)(),x=f((0,s.useState)(),2),C=x[0],N=x[1],A=function(e){var t=f(s.useState({width:0,height:0}),2),n=t[0],r=t[1];return[s.useMemo((function(){var t={};if(e){var r=n.width,i=n.height;-1!==e.indexOf("height")&&i?t.height=i:-1!==e.indexOf("minHeight")&&i&&(t.minHeight=i),-1!==e.indexOf("width")&&r?t.width=r:-1!==e.indexOf("minWidth")&&r&&(t.minWidth=r)}return t}),[e,n]),function(e){r({width:e.offsetWidth,height:e.offsetHeight})}]}(u),L=f(A,2),D=L[0],I=L[1],P=function(e,t){var n=f(dt(null),2),r=n[0],i=n[1],o=(0,s.useRef)();function a(e){i(e,!0)}function c(){ln.cancel(o.current)}return(0,s.useEffect)((function(){a("measure")}),[e]),(0,s.useEffect)((function(){"measure"===r&&(u&&I(y())),r&&(o.current=ln(fo(uo().mark((function e(){var t,n;return uo().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=ho.indexOf(r),(n=ho[t+1])&&-1!==t&&a(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),(0,s.useEffect)((function(){return function(){c()}}),[]),[r,function(e){c(),o.current=ln((function(){a((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(n),R=f(P,2),M=R[0],j=R[1],F=f((0,s.useState)(0),2),V=F[0],Q=F[1],q=(0,s.useRef)();function U(){var e;null===(e=O.current)||void 0===e||e.forceAlign()}function G(e,t){var n=g(t);C!==n&&N(n),Q((function(e){return e+1})),"align"===M&&(null==b||b(e,t))}ft((function(){"alignPre"===M&&Q(0)}),[M]),ft((function(){"align"===M&&(V<2?U():j((function(){var e;null===(e=q.current)||void 0===e||e.call(q)})))}),[V]);var B=a({},ei(e));function K(){return new Promise((function(e){q.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=B[e];B[e]=function(e,n){return j(),null==t?void 0:t(e,n)}})),s.useEffect((function(){B.motionName||"motion"!==M||j()}),[B.motionName,M]),s.useImperativeHandle(t,(function(){return{forceAlign:U,getElement:function(){return S.current}}}));var z=a(a({},D),{},{zIndex:l,opacity:"motion"!==M&&"stable"!==M&&n?0:void 0,pointerEvents:n||"stable"===M?void 0:"none"},o),$=!0;!(null==h?void 0:h.points)||"align"!==M&&"stable"!==M||($=!1);var H=c;return s.Children.count(c)>1&&(H=s.createElement("div",{className:"".concat(r,"-content")},c)),s.createElement(Zr,Oe({visible:n,ref:S,leavedClassName:"".concat(r,"-hidden")},B,{onAppearPrepare:K,onEnterPrepare:K,removeOnLeave:p,forceRender:d}),(function(e,t){var n=e.className,o=e.style,c=m()(r,i,C,n);return s.createElement(lo,{target:v||y,key:"popup",ref:O,monitorWindowResize:!0,disabled:$,align:h,onAlign:G},s.createElement("div",{ref:t,className:c,onMouseEnter:E,onMouseLeave:w,onMouseDownCapture:T,onTouchStartCapture:_,onClick:k,style:a(a({},o),z)},H))}))}));mo.displayName="PopupInner";var vo=mo,yo=s.forwardRef((function(e,t){var n=e.prefixCls,r=e.visible,i=e.zIndex,o=e.children,c=e.mobile,l=(c=void 0===c?{}:c).popupClassName,u=c.popupStyle,p=c.popupMotion,f=void 0===p?{}:p,d=c.popupRender,h=e.onClick,v=s.useRef();s.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return v.current}}}));var y=a({zIndex:i},u),g=o;return s.Children.count(o)>1&&(g=s.createElement("div",{className:"".concat(n,"-content")},o)),d&&(g=d(g)),s.createElement(Zr,Oe({visible:r,ref:v,removeOnLeave:!0},f),(function(e,t){var r=e.className,i=e.style,o=m()(n,l,r);return s.createElement("div",{ref:t,className:o,onClick:h,style:a(a({},i),y)},g)}))}));yo.displayName="MobilePopupInner";var go=yo,bo=["visible","mobile"],Eo=s.forwardRef((function(e,t){var n=e.visible,r=e.mobile,i=d(e,bo),o=f((0,s.useState)(n),2),c=o[0],l=o[1],u=f((0,s.useState)(!1),2),p=u[0],h=u[1],m=a(a({},i),{},{visible:c});(0,s.useEffect)((function(){l(n),n&&r&&h(pr())}),[n,r]);var v=p?s.createElement(go,Oe({},m,{mobile:r,ref:t})):s.createElement(vo,Oe({},m,{ref:t}));return s.createElement("div",null,s.createElement(ti,m),v)}));Eo.displayName="Popup";var wo=Eo,To=s.createContext(null);function _o(){}var ko,Oo,So=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"],xo=(ko=lr,Oo=function(e){et(n,e);var t=it(n);function n(e){var r,i;return Ye(this,n),(r=t.call(this,e)).popupRef=s.createRef(),r.triggerRef=s.createRef(),r.portalContainer=void 0,r.attachId=void 0,r.clickOutsideHandler=void 0,r.touchOutsideHandler=void 0,r.contextMenuOutsideHandler1=void 0,r.contextMenuOutsideHandler2=void 0,r.mouseDownTimeout=void 0,r.focusTime=void 0,r.preClickTime=void 0,r.preTouchTime=void 0,r.delayTimer=void 0,r.hasPopupMouseDown=void 0,r.onMouseEnter=function(e){var t=r.props.mouseEnterDelay;r.fireEvents("onMouseEnter",e),r.delaySetPopupVisible(!0,t,t?null:e)},r.onMouseMove=function(e){r.fireEvents("onMouseMove",e),r.setPoint(e)},r.onMouseLeave=function(e){r.fireEvents("onMouseLeave",e),r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)},r.onPopupMouseEnter=function(){r.clearDelayTimer()},r.onPopupMouseLeave=function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&ar(null===(t=r.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)},r.onFocus=function(e){r.fireEvents("onFocus",e),r.clearDelayTimer(),r.isFocusToShow()&&(r.focusTime=Date.now(),r.delaySetPopupVisible(!0,r.props.focusDelay))},r.onMouseDown=function(e){r.fireEvents("onMouseDown",e),r.preClickTime=Date.now()},r.onTouchStart=function(e){r.fireEvents("onTouchStart",e),r.preTouchTime=Date.now()},r.onBlur=function(e){r.fireEvents("onBlur",e),r.clearDelayTimer(),r.isBlurToHide()&&r.delaySetPopupVisible(!1,r.props.blurDelay)},r.onContextMenu=function(e){e.preventDefault(),r.fireEvents("onContextMenu",e),r.setPopupVisible(!0,e)},r.onContextMenuClose=function(){r.isContextMenuToShow()&&r.close()},r.onClick=function(e){if(r.fireEvents("onClick",e),r.focusTime){var t;if(r.preClickTime&&r.preTouchTime?t=Math.min(r.preClickTime,r.preTouchTime):r.preClickTime?t=r.preClickTime:r.preTouchTime&&(t=r.preTouchTime),Math.abs(t-r.focusTime)<20)return;r.focusTime=0}r.preClickTime=0,r.preTouchTime=0,r.isClickToShow()&&(r.isClickToHide()||r.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!r.state.popupVisible;(r.isClickToHide()&&!n||n&&r.isClickToShow())&&r.setPopupVisible(!r.state.popupVisible,e)},r.onPopupMouseDown=function(){var e;r.hasPopupMouseDown=!0,clearTimeout(r.mouseDownTimeout),r.mouseDownTimeout=window.setTimeout((function(){r.hasPopupMouseDown=!1}),0),r.context&&(e=r.context).onPopupMouseDown.apply(e,arguments)},r.onDocumentClick=function(e){if(!r.props.mask||r.props.maskClosable){var t=e.target,n=r.getRootDomNode(),i=r.getPopupDomNode();ar(n,t)&&!r.isContextMenuOnly()||ar(i,t)||r.hasPopupMouseDown||r.close()}},r.getRootDomNode=function(){var e=r.props.getTriggerDOMNode;if(e)return e(r.triggerRef.current);try{var t=_t(r.triggerRef.current);if(t)return t}catch(e){}return Tt().findDOMNode(nt(r))},r.getPopupClassNameFromAlign=function(e){var t=[],n=r.props,i=n.popupPlacement,o=n.builtinPlacements,a=n.prefixCls,s=n.alignPoint,c=n.getPopupClassNameFromAlign;return i&&o&&t.push(function(e,t,n,r){for(var i=n.points,o=Object.keys(e),a=0;a1&&(E.motionAppear=!1);var w=E.onVisibleChanged;return E.onVisibleChanged=function(e){return m.current||e||g(!0),null==w?void 0:w(e)},y?null:s.createElement(Nn,{mode:o,locked:!m.current},s.createElement(Zr,Oe({visible:b},E,{forceRender:u,removeOnLeave:!1,leavedClassName:"".concat(l,"-hidden")}),(function(e){var n=e.className,r=e.style;return s.createElement(or,{id:t,className:n,style:r},i)})))}var Ro=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],Mo=["active"],jo=function(e){var t,n=e.style,r=e.className,o=e.title,c=e.eventKey,l=(e.warnKey,e.disabled),u=e.internalPopupClose,p=e.children,h=e.itemIcon,v=e.expandIcon,y=e.popupClassName,g=e.popupOffset,b=e.onClick,E=e.onMouseEnter,w=e.onMouseLeave,T=e.onTitleClick,_=e.onTitleMouseEnter,k=e.onTitleMouseLeave,O=d(e,Ro),S=Gn(c),x=s.useContext(Cn),C=x.prefixCls,N=x.mode,A=x.openKeys,L=x.disabled,D=x.overflowDisabled,I=x.activeKey,P=x.selectedKeys,R=x.itemIcon,M=x.expandIcon,j=x.onItemClick,F=x.onOpenChange,V=x.onActive,Q=s.useContext(Bn)._internalRenderSubMenuItem,q=s.useContext(Qn).isSubPathKey,U=Vn(),G="".concat(C,"-submenu"),B=L||l,K=s.useRef(),z=s.useRef(),$=h||R,H=v||M,W=A.includes(c),Y=!D&&W,J=q(P,c),X=An(c,B,_,k),Z=X.active,ee=d(X,Mo),te=f(s.useState(!1),2),ne=te[0],re=te[1],ie=function(e){B||re(e)},oe=s.useMemo((function(){return Z||"inline"!==N&&(ne||q([I],c))}),[N,Z,I,ne,c,q]),ae=Pn(U.length),se=tr((function(e){null==b||b(Dn(e)),j(e)})),ce=S&&"".concat(S,"-popup"),le=s.createElement("div",Oe({role:"menuitem",style:ae,className:"".concat(G,"-title"),tabIndex:B?null:-1,ref:K,title:"string"==typeof o?o:null,"data-menu-id":D&&S?null:S,"aria-expanded":Y,"aria-haspopup":!0,"aria-controls":ce,"aria-disabled":B,onClick:function(e){B||(null==T||T({key:c,domEvent:e}),"inline"===N&&F(c,!W))},onFocus:function(){V(c)}},ee),o,s.createElement(In,{icon:"horizontal"!==N?H:null,props:a(a({},e),{},{isOpen:Y,isSubMenu:!0})},s.createElement("i",{className:"".concat(G,"-arrow")}))),ue=s.useRef(N);if("inline"!==N&&(ue.current=U.length>1?"vertical":N),!D){var pe=ue.current;le=s.createElement(Io,{mode:pe,prefixCls:G,visible:!u&&Y&&"inline"!==N,popupClassName:y,popupOffset:g,popup:s.createElement(Nn,{mode:"horizontal"===pe?"vertical":pe},s.createElement(or,{id:ce,ref:z},p)),disabled:B,onVisibleChange:function(e){"inline"!==N&&F(c,e)}},le)}var fe=s.createElement(kn.Item,Oe({role:"none"},O,{component:"li",style:n,className:m()(G,"".concat(G,"-").concat(N),r,(t={},i(t,"".concat(G,"-open"),Y),i(t,"".concat(G,"-active"),oe),i(t,"".concat(G,"-selected"),J),i(t,"".concat(G,"-disabled"),B),t)),onMouseEnter:function(e){ie(!0),null==E||E({key:c,domEvent:e})},onMouseLeave:function(e){ie(!1),null==w||w({key:c,domEvent:e})}}),le,!D&&s.createElement(Po,{id:ce,open:Y,keyPath:U},p));return Q&&(fe=Q(fe,e,{selected:J,active:oe,open:Y,disabled:B})),s.createElement(Nn,{onItemClick:se,mode:"horizontal"===N?"vertical":N,itemIcon:$,expandIcon:H},fe)};function Fo(e){var t,n=e.eventKey,r=e.children,i=Vn(n),o=Xn(r,i),a=jn();return s.useEffect((function(){if(a)return a.registerPath(n,i),function(){a.unregisterPath(n,i)}}),[i]),t=a?o:s.createElement(jo,e,o),s.createElement(Fn.Provider,{value:i},t)}function Vo(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(ri(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||"a"===n&&!!e.getAttribute("href"),i=e.getAttribute("tabindex"),o=Number(i),a=null;return i&&!Number.isNaN(o)?a=o:r&&null===a&&(a=0),r&&e.disabled&&(a=null),null!==a&&(a>=0||t&&a<0)}return!1}function Qo(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=ke(e.querySelectorAll("*")).filter((function(e){return Vo(e,t)}));return Vo(e,t)&&n.unshift(e),n}var qo=Sn.LEFT,Uo=Sn.RIGHT,Go=Sn.UP,Bo=Sn.DOWN,Ko=Sn.ENTER,zo=Sn.ESC,$o=Sn.HOME,Ho=Sn.END,Wo=[Go,Bo,qo,Uo];function Yo(e,t){return Qo(e,!0).filter((function(e){return t.has(e)}))}function Jo(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var i=Yo(e,t),o=i.length,a=i.findIndex((function(e){return n===e}));return r<0?-1===a?a=o-1:a-=1:r>0&&(a+=1),i[a=(a+o)%o]}var Xo=Math.random().toFixed(5).toString().slice(2),Zo=0,ea="__RC_UTIL_PATH_SPLIT__",ta=function(e){return e.join(ea)},na="rc-menu-more";var ra=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],ia=[],oa=s.forwardRef((function(e,t){var n,r,o=e.prefixCls,c=void 0===o?"rc-menu":o,l=e.rootClassName,u=e.style,p=e.className,h=e.tabIndex,v=void 0===h?0:h,y=e.items,g=e.children,b=e.direction,E=e.id,w=e.mode,T=void 0===w?"vertical":w,_=e.inlineCollapsed,k=e.disabled,O=e.disabledOverflow,S=e.subMenuOpenDelay,x=void 0===S?.1:S,C=e.subMenuCloseDelay,N=void 0===C?.1:C,A=e.forceSubMenuRender,L=e.defaultOpenKeys,D=e.openKeys,I=e.activeKey,P=e.defaultActiveFirst,R=e.selectable,M=void 0===R||R,j=e.multiple,F=void 0!==j&&j,V=e.defaultSelectedKeys,Q=e.selectedKeys,q=e.onSelect,U=e.onDeselect,G=e.inlineIndent,B=void 0===G?24:G,K=e.motion,z=e.defaultMotions,$=e.triggerSubMenuAction,H=void 0===$?"hover":$,W=e.builtinPlacements,Y=e.itemIcon,J=e.expandIcon,X=e.overflowedIndicator,Z=void 0===X?"...":X,ee=e.overflowedIndicatorPopupClassName,te=e.getPopupContainer,ne=e.onClick,re=e.onOpenChange,ie=e.onKeyDown,oe=(e.openAnimation,e.openTransitionName,e._internalRenderMenuItem),ae=e._internalRenderSubMenuItem,se=d(e,ra),ce=s.useMemo((function(){return er(g,y,ia)}),[g,y]),le=f(s.useState(!1),2),ue=le[0],pe=le[1],fe=s.useRef(),de=function(e){var t=f(mt(e,{value:e}),2),n=t[0],r=t[1];return s.useEffect((function(){Zo+=1;var e="".concat(Xo,"-").concat(Zo);r("rc-menu-uuid-".concat(e))}),[]),n}(E),he="rtl"===b,me=f(s.useMemo((function(){return"inline"!==T&&"vertical"!==T||!_?[T,!1]:["vertical",_]}),[T,_]),2),ve=me[0],ye=me[1],ge=f(s.useState(0),2),be=ge[0],Ee=ge[1],we=be>=ce.length-1||"horizontal"!==ve||O,Te=f(mt(L,{value:D,postState:function(e){return e||ia}}),2),_e=Te[0],Se=Te[1],xe=function(e){Se(e),null==re||re(e)},Ce=f(s.useState(_e),2),Ne=Ce[0],Ae=Ce[1],Le="inline"===ve,De=s.useRef(!1);s.useEffect((function(){Le&&Ae(_e)}),[_e]),s.useEffect((function(){De.current?Le?Se(Ne):xe(ia):De.current=!0}),[Le]);var Ie=function(){var e=f(s.useState({}),2)[1],t=(0,s.useRef)(new Map),n=(0,s.useRef)(new Map),r=f(s.useState([]),2),i=r[0],o=r[1],a=(0,s.useRef)(0),c=(0,s.useRef)(!1),l=(0,s.useCallback)((function(r,i){var o=ta(i);n.current.set(o,r),t.current.set(r,o),a.current+=1;var s,l=a.current;s=function(){l===a.current&&(c.current||e({}))},Promise.resolve().then(s)}),[]),u=(0,s.useCallback)((function(e,r){var i=ta(r);n.current.delete(i),t.current.delete(e)}),[]),p=(0,s.useCallback)((function(e){o(e)}),[]),d=(0,s.useCallback)((function(e,n){var r=(t.current.get(e)||"").split(ea);return n&&i.includes(r[0])&&r.unshift(na),r}),[i]),h=(0,s.useCallback)((function(e,t){return e.some((function(e){return d(e,!0).includes(t)}))}),[d]),m=(0,s.useCallback)((function(e){var r="".concat(t.current.get(e)).concat(ea),i=new Set;return ke(n.current.keys()).forEach((function(e){e.startsWith(r)&&i.add(n.current.get(e))})),i}),[]);return s.useEffect((function(){return function(){c.current=!0}}),[]),{registerPath:l,unregisterPath:u,refreshOverflowKeys:p,isSubPathKey:h,getKeyPath:d,getKeys:function(){var e=ke(t.current.keys());return i.length&&e.push(na),e},getSubPathKeys:m}}(),Pe=Ie.registerPath,Re=Ie.unregisterPath,Me=Ie.refreshOverflowKeys,je=Ie.isSubPathKey,Fe=Ie.getKeyPath,Ve=Ie.getKeys,Qe=Ie.getSubPathKeys,qe=s.useMemo((function(){return{registerPath:Pe,unregisterPath:Re}}),[Pe,Re]),Ue=s.useMemo((function(){return{isSubPathKey:je}}),[je]);s.useEffect((function(){Me(we?ia:ce.slice(be+1).map((function(e){return e.key})))}),[be,we]);var Ge=f(mt(I||P&&(null===(n=ce[0])||void 0===n?void 0:n.key),{value:I}),2),Be=Ge[0],Ke=Ge[1],ze=tr((function(e){Ke(e)})),$e=tr((function(){Ke(void 0)}));(0,s.useImperativeHandle)(t,(function(){return{list:fe.current,focus:function(e){var t,n,r,i,o=null!=Be?Be:null===(t=ce.find((function(e){return!e.props.disabled})))||void 0===t?void 0:t.key;o&&(null===(n=fe.current)||void 0===n||null===(r=n.querySelector("li[data-menu-id='".concat(Un(de,o),"']")))||void 0===r||null===(i=r.focus)||void 0===i||i.call(r,e))}}}));var He=f(mt(V||[],{value:Q,postState:function(e){return Array.isArray(e)?e:null==e?ia:[e]}}),2),We=He[0],Ye=He[1],Je=tr((function(e){null==ne||ne(Dn(e)),function(e){if(M){var t,n=e.key,r=We.includes(n);t=F?r?We.filter((function(e){return e!==n})):[].concat(ke(We),[n]):[n],Ye(t);var i=a(a({},e),{},{selectedKeys:t});r?null==U||U(i):null==q||q(i)}!F&&_e.length&&"inline"!==ve&&xe(ia)}(e)})),Xe=tr((function(e,t){var n=_e.filter((function(t){return t!==e}));if(t)n.push(e);else if("inline"!==ve){var r=Qe(e);n=n.filter((function(e){return!r.has(e)}))}lt()(_e,n)||xe(n)})),Ze=tr(te),et=function(e,t,n,r,o,a,c,l,u,p){var f=s.useRef(),d=s.useRef();d.current=t;var h=function(){ln.cancel(f.current)};return s.useEffect((function(){return function(){h()}}),[]),function(s){var m=s.which;if([].concat(Wo,[Ko,zo,$o,Ho]).includes(m)){var v,y,g,b=function(){return v=new Set,y=new Map,g=new Map,a().forEach((function(e){var t=document.querySelector("[data-menu-id='".concat(Un(r,e),"']"));t&&(v.add(t),g.set(t,e),y.set(e,t))})),v};b();var E=function(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}(y.get(t),v),w=g.get(E),T=function(e,t,n,r){var o,a,s,c,l="prev",u="next",p="children",f="parent";if("inline"===e&&r===Ko)return{inlineTrigger:!0};var d=(i(o={},Go,l),i(o,Bo,u),o),h=(i(a={},qo,n?u:l),i(a,Uo,n?l:u),i(a,Bo,p),i(a,Ko,p),a),m=(i(s={},Go,l),i(s,Bo,u),i(s,Ko,p),i(s,zo,f),i(s,qo,n?p:f),i(s,Uo,n?f:p),s);switch(null===(c={inline:d,horizontal:h,vertical:m,inlineSub:d,horizontalSub:m,verticalSub:m}["".concat(e).concat(t?"":"Sub")])||void 0===c?void 0:c[r]){case l:return{offset:-1,sibling:!0};case u:return{offset:1,sibling:!0};case f:return{offset:-1,sibling:!1};case p:return{offset:1,sibling:!1};default:return null}}(e,1===c(w,!0).length,n,m);if(!T&&m!==$o&&m!==Ho)return;(Wo.includes(m)||[$o,Ho].includes(m))&&s.preventDefault();var _=function(e){if(e){var t=e,n=e.querySelector("a");(null==n?void 0:n.getAttribute("href"))&&(t=n);var r=g.get(e);l(r),h(),f.current=ln((function(){d.current===r&&t.focus()}))}};if([$o,Ho].includes(m)||T.sibling||!E){var k,O,S=Yo(k=E&&"inline"!==e?function(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}(E):o.current,v);O=m===$o?S[0]:m===Ho?S[S.length-1]:Jo(k,v,E,T.offset),_(O)}else if(T.inlineTrigger)u(w);else if(T.offset>0)u(w,!0),h(),f.current=ln((function(){b();var e=E.getAttribute("aria-controls"),t=Jo(document.getElementById(e),v);_(t)}),5);else if(T.offset<0){var x=c(w,!0),C=x[x.length-2],N=y.get(C);u(C,!1),_(N)}}null==p||p(s)}}(ve,Be,he,de,fe,Ve,Fe,Ke,(function(e,t){var n=null!=t?t:!_e.includes(e);Xe(e,n)}),ie);s.useEffect((function(){pe(!0)}),[]);var tt=s.useMemo((function(){return{_internalRenderMenuItem:oe,_internalRenderSubMenuItem:ae}}),[oe,ae]),nt="horizontal"!==ve||O?ce:ce.map((function(e,t){return s.createElement(Nn,{key:e.key,overflowDisabled:t>be},e)})),rt=s.createElement(kn,Oe({id:E,ref:fe,prefixCls:"".concat(c,"-overflow"),component:"ul",itemComponent:Yn,className:m()(c,"".concat(c,"-root"),"".concat(c,"-").concat(ve),p,(r={},i(r,"".concat(c,"-inline-collapsed"),ye),i(r,"".concat(c,"-rtl"),he),r),l),dir:b,style:u,role:"menu",tabIndex:v,data:nt,renderRawItem:function(e){return e},renderRawRest:function(e){var t=e.length,n=t?ce.slice(-t):null;return s.createElement(Fo,{eventKey:na,title:Z,disabled:we,internalPopupClose:0===t,popupClassName:ee},n)},maxCount:"horizontal"!==ve||O?kn.INVALIDATE:kn.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){Ee(e)},onKeyDown:et},se));return s.createElement(Bn.Provider,{value:tt},s.createElement(qn.Provider,{value:de},s.createElement(Nn,{prefixCls:c,rootClassName:l,mode:ve,openKeys:_e,rtl:he,disabled:k,motion:ue?K:null,defaultMotions:ue?z:null,activeKey:Be,onActive:ze,onInactive:$e,selectedKeys:We,inlineIndent:B,subMenuOpenDelay:x,subMenuCloseDelay:N,forceSubMenuRender:A,builtinPlacements:W,triggerSubMenuAction:H,getPopupContainer:Ze,itemIcon:Y,expandIcon:J,onItemClick:Je,onOpenChange:Xe},s.createElement(Qn.Provider,{value:Ue},rt),s.createElement("div",{style:{display:"none"},"aria-hidden":!0},s.createElement(Mn.Provider,{value:qe},ce)))))})),aa=["className","title","eventKey","children"],sa=["children"],ca=function(e){var t=e.className,n=e.title,r=(e.eventKey,e.children),i=d(e,aa),o=s.useContext(Cn).prefixCls,a="".concat(o,"-item-group");return s.createElement("li",Oe({},i,{onClick:function(e){return e.stopPropagation()},className:m()(a,t)}),s.createElement("div",{className:"".concat(a,"-title"),title:"string"==typeof n?n:void 0},n),s.createElement("ul",{className:"".concat(a,"-list")},r))};function la(e){var t=e.children,n=d(e,sa),r=Xn(t,Vn(n.eventKey));return jn()?r:s.createElement(ca,qe(n,["warnKey"]),r)}function ua(e){var t=e.className,n=e.style,r=s.useContext(Cn).prefixCls;return jn()?null:s.createElement("li",{className:m()("".concat(r,"-item-divider"),t),style:n})}var pa=Vn,fa=oa;fa.Item=Yn,fa.SubMenu=Fo,fa.ItemGroup=la,fa.Divider=ua;var da=fa,ha=function(){for(var e=arguments.length,t=new Array(e),n=0;n=0||r.indexOf("Bottom")>=0?o.top="".concat(i.height-t.offset[1],"px"):(r.indexOf("Top")>=0||r.indexOf("bottom")>=0)&&(o.top="".concat(-t.offset[1],"px")),r.indexOf("left")>=0||r.indexOf("Right")>=0?o.left="".concat(i.width-t.offset[0],"px"):(r.indexOf("right")>=0||r.indexOf("Left")>=0)&&(o.left="".concat(-t.offset[0],"px")),e.style.transformOrigin="".concat(o.left," ").concat(o.top)}},overlayInnerStyle:R,arrowContent:s.createElement("span",{className:"".concat(O,"-arrow-content"),style:C}),motion:{motionName:ba(S,"zoom-big-fast",e.transitionName),motionDeadline:1e3}}),x?Ta(L,{className:I}):L)}));Ma.defaultProps={placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0};var ja=Ma,Fa=(0,s.createContext)({prefixCls:"",firstLevel:!0,inlineCollapsed:!1}),Va=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);id)&&(V=(U=U.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(v,"$1"+e.trim());case 58:return e.trim()+t.replace(v,"$1"+e.trim());default:if(0<1*n&&0c.charCodeAt(8))break;case 115:a=a.replace(c,"-webkit-"+c)+";"+a;break;case 207:case 102:a=a.replace(c,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var fs=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,i=r;e>=i;)(i<<=1)<0&&ps(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var o=r;o=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),i=r+n,o=r;o=ms&&(ms=t+1),ds.set(e,t),hs.set(t,e)},bs="style["+cs+'][data-styled-version="5.3.5"]',Es=new RegExp("^"+cs+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),ws=function(e,t,n){for(var r,i=n.split(","),o=0,a=i.length;o=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(cs))return r}}(n),o=void 0!==i?i.nextSibling:null;r.setAttribute(cs,"active"),r.setAttribute("data-styled-version","5.3.5");var a=_s();return a&&r.setAttribute("nonce",a),n.insertBefore(r,o),r},Os=function(){function e(e){var t=this.element=ks(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(l+=e+",")})),r+=""+s+c+'{content:"'+l+'"}/*!sc*/\n'}}}return r}(this)},e}(),Ls=/(a)(d)/gi,Ds=function(e){return String.fromCharCode(e+(e>25?39:97))};function Is(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=Ds(t%52)+n;return(Ds(t%52)+n).replace(Ls,"$1-$2")}var Ps=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Rs=function(e){return Ps(5381,e)};function Ms(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var s=n(o,"."+a,void 0,r);t.insertRules(r,a,s)}i.push(a),this.staticRulesId=a}else{for(var c=this.rules.length,l=Ps(this.baseHash,n.hash),u="",p=0;p>>0);if(!t.hasNameForId(r,m)){var v=n(u,"."+m,void 0,r);t.insertRules(r,m,v)}i.push(m)}}return i.join(" ")},e}(),Vs=/^\s*\/\/.*$/gm,Qs=[":","[",".","#"];function qs(e){var t,n,r,i,o=void 0===e?is:e,a=o.options,s=void 0===a?is:a,c=o.plugins,l=void 0===c?rs:c,u=new Ha(s),p=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,i,o,a,s,c,l,u,p){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===l)return r+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(i[0]+r),"";default:return r+(0===p?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){p.push(e)})),d=function(e,r,o){return 0===r&&-1!==Qs.indexOf(o[n.length])||o.match(i)?e:"."+t};function h(e,o,a,s){void 0===s&&(s="&");var c=e.replace(Vs,""),l=o&&a?a+" "+o+" { "+c+" }":c;return t=s,n=o,r=new RegExp("\\"+n+"\\b","g"),i=new RegExp("(\\"+n+"\\b){2,}"),u(a||!o?"":o,l)}return u.use([].concat(l,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(n)>0&&(i[0]=i[0].replace(r,d))},f,function(e){if(-2===e){var t=p;return p=[],t}}])),h.hash=l.length?l.reduce((function(e,t){return t.name||ps(15),Ps(e,t.name)}),5381).toString():"",h}var Us=c().createContext(),Gs=(Us.Consumer,c().createContext()),Bs=(Gs.Consumer,new As),Ks=qs();function zs(){return(0,s.useContext)(Us)||Bs}function $s(e){var t=(0,s.useState)(e.stylisPlugins),n=t[0],r=t[1],i=zs(),o=(0,s.useMemo)((function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),a=(0,s.useMemo)((function(){return qs({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,s.useEffect)((function(){lt()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),c().createElement(Us.Provider,{value:o},c().createElement(Gs.Provider,{value:a},e.children))}var Hs=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ks);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return ps(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Ks),this.name+e.hash},e}(),Ws=/([A-Z])/,Ys=/([A-Z])/g,Js=/^ms-/,Xs=function(e){return"-"+e.toLowerCase()};function Zs(e){return Ws.test(e)?e.replace(Ys,Xs).replace(Js,"-ms-"):e}var ec=function(e){return null==e||!1===e||""===e};function tc(e,t,n,r){if(Array.isArray(e)){for(var i,o=[],a=0,s=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,oc=/(^-|-$)/g;function ac(e){return e.replace(ic,"-").replace(oc,"")}function sc(e){return"string"==typeof e&&!0}var cc=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},lc=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function uc(e,t,n){var r=e[n];cc(t)&&cc(r)?pc(r,t):e[n]=t}function pc(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r>>0)}("5.3.5"+n+dc[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):l,p=t.displayName,f=void 0===p?function(e){return sc(e)?"styled."+e:"Styled("+as(e)+")"}(e):p,d=t.displayName&&t.componentId?ac(t.displayName)+"-"+t.componentId:t.componentId||u,h=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,m=t.shouldForwardProp;r&&e.shouldForwardProp&&(m=t.shouldForwardProp?function(n,r,i){return e.shouldForwardProp(n,r,i)&&t.shouldForwardProp(n,r,i)}:e.shouldForwardProp);var v,y=new Fs(n,d,r?e.componentStyle:void 0),g=y.isStatic&&0===a.length,b=function(e,t){return function(e,t,n,r){var i=e.attrs,o=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,l=e.shouldForwardProp,u=e.styledComponentId,p=e.target,f=function(e,t,n){void 0===e&&(e=is);var r=es({},t,{theme:e}),i={};return n.forEach((function(e){var t,n,o,a=e;for(t in os(a)&&(a=a(r)),a)r[t]=i[t]="className"===t?(n=i[t],o=a[t],n&&o?n+" "+o:n||o):a[t]})),[r,i]}(function(e,t,n){return void 0===n&&(n=is),e.theme!==n.theme&&e.theme||t||n.theme}(t,(0,s.useContext)(fc),a)||is,t,i),d=f[0],h=f[1],m=function(e,t,n,r){var i=zs(),o=(0,s.useContext)(Gs)||Ks;return t?e.generateAndInjectStyles(is,i,o):e.generateAndInjectStyles(n,i,o)}(o,r,d),v=n,y=h.$as||t.$as||h.as||t.as||p,g=sc(y),b=h!==t?es({},t,{},h):t,E={};for(var w in b)"$"!==w[0]&&"as"!==w&&("forwardedAs"===w?E.as=b[w]:(l?l(w,Ja,y):!g||Ja(w))&&(E[w]=b[w]));return t.style&&h.style!==t.style&&(E.style=es({},t.style,{},h.style)),E.className=Array.prototype.concat(c,u,m!==u?m:null,t.className,h.className).filter(Boolean).join(" "),E.ref=v,(0,s.createElement)(y,E)}(v,e,t,g)};return b.displayName=f,(v=c().forwardRef(b)).attrs=h,v.componentStyle=y,v.displayName=f,v.shouldForwardProp=m,v.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):rs,v.styledComponentId=d,v.target=r?e.target:e,v.withComponent=function(e){var r=t.componentId,i=function(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(t,["componentId"]),o=r&&r+"-"+(sc(e)?e:ac(as(e)));return hc(e,es({},i,{attrs:h,componentId:o}),n)},Object.defineProperty(v,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?pc({},e.defaultProps,t):t}}),v.toString=function(){return"."+v.styledComponentId},i&&Za()(v,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),v}var mc,vc=function(e){return function e(t,n,r){if(void 0===r&&(r=is),!(0,$a.isValidElementType)(n))return ps(1,String(n));var i=function(){return t(n,r,rc.apply(void 0,arguments))};return i.withConfig=function(i){return e(t,n,es({},r,{},i))},i.attrs=function(i){return e(t,n,es({},r,{attrs:Array.prototype.concat(r.attrs,i).filter(Boolean)}))},i}(hc,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){vc[e]=vc(e)})),mc=function(e,t){this.rules=e,this.componentId=t,this.isStatic=Ms(e),As.registerId(this.componentId+1)}.prototype,mc.createStyles=function(e,t,n,r){var i=r(tc(this.rules,t,n,r).join(""),""),o=this.componentId+e;n.insertRules(o,o,i)},mc.removeStyles=function(e,t){t.clearRules(this.componentId+e)},mc.renderStyles=function(e,t,n,r){e>2&&As.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=_s();return""},this.getStyleTags=function(){return e.sealed?ps(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return ps(2);var n=((t={})[cs]="",t["data-styled-version"]="5.3.5",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=_s();return r&&(n.nonce=r),[c().createElement("style",es({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new As({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?ps(2):c().createElement($s,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return ps(3)}}();var yc,gc=vc,bc=n(6428),Ec=function(e){var t,n=s.useContext(Se),r=n.getPrefixCls,o=n.direction,a=e.prefixCls,c=e.type,l=void 0===c?"horizontal":c,u=e.orientation,p=void 0===u?"center":u,f=e.orientationMargin,d=e.className,h=e.children,v=e.dashed,y=e.plain,g=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0?"-".concat(p):p,w=!!h,T="left"===p&&null!=f,_="right"===p&&null!=f,k=m()(b,"".concat(b,"-").concat(l),(i(t={},"".concat(b,"-with-text"),w),i(t,"".concat(b,"-with-text").concat(E),w),i(t,"".concat(b,"-dashed"),!!v),i(t,"".concat(b,"-plain"),!!y),i(t,"".concat(b,"-rtl"),"rtl"===o),i(t,"".concat(b,"-no-default-orientation-margin-left"),T),i(t,"".concat(b,"-no-default-orientation-margin-right"),_),t),d),O=Oe(Oe({},T&&{marginLeft:f}),_&&{marginRight:f});return s.createElement("div",Oe({className:k},g,{role:"separator"}),h&&s.createElement("span",{className:"".concat(b,"-inner-text"),style:O},h))},wc=["xxl","xl","lg","md","sm","xs"],Tc={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},_c=new Map,kc=-1,Oc={},Sc={matchHandlers:{},dispatch:function(e){return Oc=e,_c.forEach((function(e){return e(Oc)})),_c.size>=1},subscribe:function(e){return _c.size||this.register(),kc+=1,_c.set(kc,e),e(Oc),kc},unsubscribe:function(e){_c.delete(e),_c.size||this.unregister()},unregister:function(){var e=this;Object.keys(Tc).forEach((function(t){var n=Tc[t],r=e.matchHandlers[n];null==r||r.mql.removeListener(null==r?void 0:r.listener)})),_c.clear()},register:function(){var e=this;Object.keys(Tc).forEach((function(t){var n=Tc[t],r=function(n){var r=n.matches;e.dispatch(Oe(Oe({},Oc),i({},t,r)))},o=window.matchMedia(n);o.addListener(r),e.matchHandlers[n]={mql:o,listener:r},r(o)}))}},xc=(0,s.createContext)({}),Cc=(ha("top","middle","bottom","stretch"),ha("start","end","center","space-around","space-between","space-evenly"),s.forwardRef((function(e,t){var n,r=e.prefixCls,o=e.justify,a=e.align,c=e.className,l=e.style,u=e.children,p=e.gutter,d=void 0===p?0:p,h=e.wrap,v=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0?C[0]/-2:void 0,D=null!=C[1]&&C[1]>0?C[1]/-2:void 0;if(L&&(A.marginLeft=L,A.marginRight=L),k){var I=f(C,2);A.rowGap=I[1]}else D&&(A.marginTop=D,A.marginBottom=D);var P=f(C,2),R=P[0],M=P[1],j=s.useMemo((function(){return{gutter:[R,M],wrap:h,supportFlexGap:k}}),[R,M,h,k]);return s.createElement(xc.Provider,{value:j},s.createElement("div",Oe({},v,{className:N,style:Oe(Oe({},A),l),ref:t}),u))}))),Nc=Cc,Ac=["xs","sm","md","lg","xl","xxl"],Lc=s.forwardRef((function(e,t){var n,r=s.useContext(Se),o=r.getPrefixCls,a=r.direction,c=s.useContext(xc),l=c.gutter,u=c.wrap,p=c.supportFlexGap,f=e.prefixCls,d=e.span,h=e.order,v=e.offset,g=e.push,b=e.pull,E=e.className,w=e.children,T=e.flex,_=e.style,k=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i0){var N=l[0]/2;C.paddingLeft=N,C.paddingRight=N}if(l&&l[1]>0&&!p){var A=l[1]/2;C.paddingTop=A,C.paddingBottom=A}return T&&(C.flex=function(e){return"number"==typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(T),!1!==u||C.minWidth||(C.minWidth=0)),s.createElement("div",Oe({},k,{style:Oe(Oe({},C),_),className:x,ref:t}),w)})),Dc=Lc,Ic=s.createContext(void 0),Pc=function(e){var t,n,r=e.prefixCls,o=e.className,a=e.style,c=e.size,l=e.shape,u=m()((i(t={},"".concat(r,"-lg"),"large"===c),i(t,"".concat(r,"-sm"),"small"===c),t)),p=m()((i(n={},"".concat(r,"-circle"),"circle"===l),i(n,"".concat(r,"-square"),"square"===l),i(n,"".concat(r,"-round"),"round"===l),n)),f="number"==typeof c?{width:c,height:c,lineHeight:"".concat(c,"px")}:{};return s.createElement("span",{className:m()(r,u,p,o),style:Oe(Oe({},f),a)})},Rc=function(e){var t=e.prefixCls,n=e.className,r=e.active,o=(0,s.useContext(Se).getPrefixCls)("skeleton",t),a=qe(e,["prefixCls","className"]),c=m()(o,"".concat(o,"-element"),i({},"".concat(o,"-active"),r),n);return s.createElement("div",{className:c},s.createElement(Pc,Oe({prefixCls:"".concat(o,"-avatar")},a)))};Rc.defaultProps={size:"default",shape:"circle"};var Mc=Rc,jc=function(e){var t,n=e.prefixCls,r=e.className,o=e.active,a=e.block,c=void 0!==a&&a,l=(0,s.useContext(Se).getPrefixCls)("skeleton",n),u=qe(e,["prefixCls"]),p=m()(l,"".concat(l,"-element"),(i(t={},"".concat(l,"-active"),o),i(t,"".concat(l,"-block"),c),t),r);return s.createElement("div",{className:p},s.createElement(Pc,Oe({prefixCls:"".concat(l,"-button")},u)))};jc.defaultProps={size:"default"};var Fc=jc,Vc=function(e){var t,n=e.prefixCls,r=e.className,o=e.active,a=e.block,c=(0,s.useContext(Se).getPrefixCls)("skeleton",n),l=qe(e,["prefixCls"]),u=m()(c,"".concat(c,"-element"),(i(t={},"".concat(c,"-active"),o),i(t,"".concat(c,"-block"),a),t),r);return s.createElement("div",{className:u},s.createElement(Pc,Oe({prefixCls:"".concat(c,"-input")},l)))};Vc.defaultProps={size:"default"};var Qc=Vc,qc=function(e){var t=function(t){var n=e.width,r=e.rows,i=void 0===r?2:r;return Array.isArray(n)?n[t]:i-1===t?n:void 0},n=e.prefixCls,r=e.className,i=e.style,o=e.rows,a=ke(Array(o)).map((function(e,n){return s.createElement("li",{key:n,style:{width:t(n)}})}));return s.createElement("ul",{className:m()(n,r),style:i},a)},Uc=function(e){var t=e.prefixCls,n=e.className,r=e.width,i=e.style;return s.createElement("h3",{className:m()(t,n),style:Oe({width:r},i)})};function Gc(e){return e&&"object"===y(e)?e:{}}var Bc=function(e){var t=e.prefixCls,n=e.loading,r=e.className,o=e.style,a=e.children,c=e.avatar,l=e.title,u=e.paragraph,p=e.active,f=e.round,d=s.useContext(Se),h=d.getPrefixCls,v=d.direction,y=h("skeleton",t);if(n||!("loading"in e)){var g,b,E,w=!!c,T=!!l,_=!!u;if(w){var k=Oe(Oe({prefixCls:"".concat(y,"-avatar")},function(e,t){return e&&!t?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}(T,_)),Gc(c));b=s.createElement("div",{className:"".concat(y,"-header")},s.createElement(Pc,Oe({},k)))}if(T||_){var O,S;if(T){var x=Oe(Oe({prefixCls:"".concat(y,"-title")},function(e,t){return!e&&t?{width:"38%"}:e&&t?{width:"50%"}:{}}(w,_)),Gc(l));O=s.createElement(Uc,Oe({},x))}if(_){var C=Oe(Oe({prefixCls:"".concat(y,"-paragraph")},function(e,t){var n={};return e&&t||(n.width="61%"),n.rows=!e&&t?3:2,n}(w,T)),Gc(u));S=s.createElement(qc,Oe({},C))}E=s.createElement("div",{className:"".concat(y,"-content")},O,S)}var N=m()(y,(i(g={},"".concat(y,"-with-avatar"),w),i(g,"".concat(y,"-active"),p),i(g,"".concat(y,"-rtl"),"rtl"===v),i(g,"".concat(y,"-round"),f),g),r);return s.createElement("div",{className:N,style:o},b,E)}return void 0!==a?a:null};Bc.defaultProps={avatar:!1,title:!0,paragraph:!0},Bc.Button=Fc,Bc.Avatar=Mc,Bc.Input=Qc,Bc.Image=function(e){var t=e.prefixCls,n=e.className,r=e.style,i=(0,s.useContext(Se).getPrefixCls)("skeleton",t),o=m()(i,"".concat(i,"-element"),n);return s.createElement("div",{className:o},s.createElement("div",{className:m()("".concat(i,"-image"),n),style:r},s.createElement("svg",{viewBox:"0 0 1098 1024",xmlns:"http://www.w3.org/2000/svg",className:"".concat(i,"-image-svg")},s.createElement("path",{d:"M365.714286 329.142857q0 45.714286-32.036571 77.677714t-77.677714 32.036571-77.677714-32.036571-32.036571-77.677714 32.036571-77.677714 77.677714-32.036571 77.677714 32.036571 32.036571 77.677714zM950.857143 548.571429l0 256-804.571429 0 0-109.714286 182.857143-182.857143 91.428571 91.428571 292.571429-292.571429zM1005.714286 146.285714l-914.285714 0q-7.460571 0-12.873143 5.412571t-5.412571 12.873143l0 694.857143q0 7.460571 5.412571 12.873143t12.873143 5.412571l914.285714 0q7.460571 0 12.873143-5.412571t5.412571-12.873143l0-694.857143q0-7.460571-5.412571-12.873143t-12.873143-5.412571zM1097.142857 164.571429l0 694.857143q0 37.741714-26.843429 64.585143t-64.585143 26.843429l-914.285714 0q-37.741714 0-64.585143-26.843429t-26.843429-64.585143l0-694.857143q0-37.741714 26.843429-64.585143t64.585143-26.843429l914.285714 0q37.741714 0 64.585143 26.843429t26.843429 64.585143z",className:"".concat(i,"-image-path")}))))};var Kc=Bc,zc={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"}}]},name:"close",theme:"outlined"},$c=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:zc}))};$c.displayName="CloseOutlined";var Hc=s.forwardRef($c),Wc={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"defs",attrs:{},children:[{tag:"style",attrs:{}}]},{tag:"path",attrs:{d:"M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"}},{tag:"path",attrs:{d:"M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"}}]},name:"plus",theme:"outlined"},Yc=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:Wc}))};Yc.displayName="PlusOutlined";var Jc=s.forwardRef(Yc);function Xc(e){var t=(0,s.useRef)(),n=(0,s.useRef)(!1);return(0,s.useEffect)((function(){return n.current=!1,function(){n.current=!0,ln.cancel(t.current)}}),[]),function(){for(var r=arguments.length,i=new Array(r),o=0;ot?"left":"right"})})),2),Q=V[0],q=V[1],U=f(yl(0,(function(e,t){!F&&A&&A({direction:e>t?"top":"bottom"})})),2),G=U[0],B=U[1],K=f((0,s.useState)(0),2),z=K[0],$=K[1],H=f((0,s.useState)(0),2),W=H[0],Y=H[1],J=f((0,s.useState)(null),2),X=J[0],Z=J[1],ee=f((0,s.useState)(null),2),te=ee[0],ne=ee[1],re=f((0,s.useState)(0),2),ie=re[0],oe=re[1],ae=f((0,s.useState)(0),2),se=ae[0],ce=ae[1],le=(o=new Map,c=(0,s.useRef)([]),l=f((0,s.useState)({}),2)[1],u=(0,s.useRef)("function"==typeof o?o():o),p=Xc((function(){var e=u.current;c.current.forEach((function(t){e=t(e)})),c.current=[],u.current=e,l({})})),[u.current,function(e){c.current.push(e),p()}]),ue=f(le,2),pe=ue[0],fe=ue[1],de=function(e,t,n){return(0,s.useMemo)((function(){for(var n,r=new Map,i=t.get(null===(n=e[0])||void 0===n?void 0:n.key)||tl,o=i.left+i.width,s=0;sve?ve:e}F?T?(me=0,ve=Math.max(0,z-X)):(me=Math.min(0,X-z),ve=0):(me=Math.min(0,te-W),ve=0);var ge=(0,s.useRef)(),be=f((0,s.useState)(),2),Ee=be[0],we=be[1];function Te(){we(Date.now())}function _e(){window.clearTimeout(ge.current)}function Se(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:w,t=de.get(e)||{width:0,height:0,left:0,right:0,top:0};if(F){var n=Q;T?t.rightQ+X&&(n=t.right+t.width-X):t.left<-Q?n=-t.left:t.left+t.width>-Q+X&&(n=-(t.left+t.width-X)),B(0),q(ye(n))}else{var r=G;t.top<-G?r=-t.top:t.top+t.height>-G+te&&(r=-(t.top+t.height-te)),q(0),B(ye(r))}}!function(e,t){var n=f((0,s.useState)(),2),r=n[0],i=n[1],o=f((0,s.useState)(0),2),a=o[0],c=o[1],l=f((0,s.useState)(0),2),u=l[0],p=l[1],d=f((0,s.useState)(),2),h=d[0],m=d[1],v=(0,s.useRef)(),y=(0,s.useRef)(),g=(0,s.useRef)(null);g.current={onTouchStart:function(e){var t=e.touches[0],n=t.screenX,r=t.screenY;i({x:n,y:r}),window.clearInterval(v.current)},onTouchMove:function(e){if(r){e.preventDefault();var n=e.touches[0],o=n.screenX,s=n.screenY;i({x:o,y:s});var l=o-r.x,u=s-r.y;t(l,u);var f=Date.now();c(f),p(f-a),m({x:l,y:u})}},onTouchEnd:function(){if(r&&(i(null),m(null),h)){var e=h.x/u,n=h.y/u,o=Math.abs(e),a=Math.abs(n);if(Math.max(o,a)<.1)return;var s=e,c=n;v.current=window.setInterval((function(){Math.abs(s)<.01&&Math.abs(c)<.01?window.clearInterval(v.current):t(20*(s*=vl),20*(c*=vl))}),20)}},onWheel:function(e){var n=e.deltaX,r=e.deltaY,i=0,o=Math.abs(n),a=Math.abs(r);o===a?i="x"===y.current?n:r:o>a?(i=n,y.current="x"):(i=r,y.current="y"),t(-i,-i)&&e.preventDefault()}},s.useEffect((function(){function t(e){g.current.onTouchMove(e)}function n(e){g.current.onTouchEnd(e)}return document.addEventListener("touchmove",t,{passive:!1}),document.addEventListener("touchend",n,{passive:!1}),e.current.addEventListener("touchstart",(function(e){g.current.onTouchStart(e)}),{passive:!1}),e.current.addEventListener("wheel",(function(e){g.current.onWheel(e)})),function(){document.removeEventListener("touchmove",t),document.removeEventListener("touchend",n)}}),[])}(L,(function(e,t){function n(e,t){e((function(e){return ye(e+t)}))}if(F){if(X>=z)return!1;n(q,e)}else{if(te>=W)return!1;n(B,t)}return _e(),Te(),!0})),(0,s.useEffect)((function(){return _e(),Ee&&(ge.current=window.setTimeout((function(){we(0)}),100)),_e}),[Ee]);var xe=function(e,t,n,r,i){var o,a,c,l=i.tabs,u=i.tabPosition,p=i.rtl;["top","bottom"].includes(u)?(o="width",a=p?"right":"left",c=Math.abs(t.left)):(o="height",a="top",c=-t.top);var f=t[o],d=n[o],h=r[o],m=f;return d+h>f&&dc+m){n=r-1;break}}for(var s=0,u=t-1;u>=0;u-=1)if((e.get(l[u].key)||nl)[a]0,Ge=Q+X1&&void 0!==arguments[1]?arguments[1]:1,n=Ml++,r=t;function i(){(r-=1)<=0?(e(),delete jl[n]):jl[n]=ln(i)}return jl[n]=ln(i),n}function Vl(e){return!e||null===e.offsetParent||e.hidden}function Ql(e){var t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return!(t&&t[1]&&t[2]&&t[3]&&t[1]===t[2]&&t[2]===t[3])}Fl.cancel=function(e){void 0!==e&&(ln.cancel(jl[e]),delete jl[e])},Fl.ids=jl;var ql=function(e){et(n,e);var t=it(n);function n(){var e;return Ye(this,n),(e=t.apply(this,arguments)).containerRef=s.createRef(),e.animationStart=!1,e.destroyed=!1,e.onClick=function(t,n){var r,i,o=e.props,a=o.insertExtraNode;if(!(o.disabled||!t||Vl(t)||t.className.indexOf("-leave")>=0)){e.extraNode=document.createElement("div");var s=nt(e).extraNode,c=e.context.getPrefixCls;s.className="".concat(c(""),"-click-animating-node");var l=e.getAttributeName();if(t.setAttribute(l,"true"),n&&"#ffffff"!==n&&"rgb(255, 255, 255)"!==n&&Ql(n)&&!/rgba\((?:\d*, ){3}0\)/.test(n)&&"transparent"!==n){s.style.borderColor=n;var u=(null===(r=t.getRootNode)||void 0===r?void 0:r.call(t))||t.ownerDocument,p=u instanceof Document?u.body:null!==(i=u.firstChild)&&void 0!==i?i:u;Il=X("\n [".concat(c(""),"-click-animating-without-extra-node='true']::after, .").concat(c(""),"-click-animating-node {\n --antd-wave-shadow-color: ").concat(n,";\n }"),"antd-wave",{csp:e.csp,attachTo:p})}a&&t.appendChild(s),["transition","animation"].forEach((function(n){t.addEventListener("".concat(n,"start"),e.onTransitionStart),t.addEventListener("".concat(n,"end"),e.onTransitionEnd)}))}},e.onTransitionStart=function(t){if(!e.destroyed){var n=e.containerRef.current;t&&t.target===n&&!e.animationStart&&e.resetEffect(n)}},e.onTransitionEnd=function(t){t&&"fadeEffect"===t.animationName&&e.resetEffect(t.target)},e.bindAnimationEvent=function(t){if(t&&t.getAttribute&&!t.getAttribute("disabled")&&!(t.className.indexOf("disabled")>=0)){var n=function(n){if("INPUT"!==n.target.tagName&&!Vl(n.target)){e.resetEffect(t);var r=getComputedStyle(t).getPropertyValue("border-top-color")||getComputedStyle(t).getPropertyValue("border-color")||getComputedStyle(t).getPropertyValue("background-color");e.clickWaveTimeoutId=window.setTimeout((function(){return e.onClick(t,r)}),0),Fl.cancel(e.animationStartId),e.animationStart=!0,e.animationStartId=Fl((function(){e.animationStart=!1}),10)}};return t.addEventListener("click",n,!0),{cancel:function(){t.removeEventListener("click",n,!0)}}}},e.renderWave=function(t){var n=t.csp,r=e.props.children;if(e.csp=n,!s.isValidElement(r))return r;var i=e.containerRef;return Et(r)&&(i=bt(r.ref,e.containerRef)),Ta(r,{ref:i})},e}return Xe(n,[{key:"componentDidMount",value:function(){this.destroyed=!1;var e=this.containerRef.current;e&&1===e.nodeType&&(this.instance=this.bindAnimationEvent(e))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var e=this.context.getPrefixCls,t=this.props.insertExtraNode;return"".concat(e(""),t?"-click-animating":"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(e){var t=this;if(e&&e!==this.extraNode&&e instanceof Element){var n=this.props.insertExtraNode,r=this.getAttributeName();e.setAttribute(r,"false"),Il&&(Il.innerHTML=""),n&&this.extraNode&&e.contains(this.extraNode)&&e.removeChild(this.extraNode),["transition","animation"].forEach((function(n){e.removeEventListener("".concat(n,"start"),t.onTransitionStart),e.removeEventListener("".concat(n,"end"),t.onTransitionEnd)}))}}},{key:"render",value:function(){return s.createElement(xe,null,this.renderWave)}}]),n}(s.Component);ql.contextType=Se;var Ul=(0,s.forwardRef)((function(e,t){return s.createElement(ql,Oe({ref:t},e))})),Gl=s.createContext(void 0),Bl={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},Kl=function(e,t){return s.createElement(fe,a(a({},e),{},{ref:t,icon:Bl}))};Kl.displayName="LoadingOutlined";var zl=s.forwardRef(Kl),$l=function(){return{width:0,opacity:0,transform:"scale(0)"}},Hl=function(e){return{width:e.scrollWidth,opacity:1,transform:"scale(1)"}},Wl=function(e){var t=e.prefixCls,n=!!e.loading;return e.existIcon?c().createElement("span",{className:"".concat(t,"-loading-icon")},c().createElement(zl,null)):c().createElement(Zr,{visible:n,motionName:"".concat(t,"-loading-icon-motion"),removeOnLeave:!0,onAppearStart:$l,onAppearActive:Hl,onEnterStart:$l,onEnterActive:Hl,onLeaveStart:Hl,onLeaveActive:$l},(function(e,n){var r=e.className,i=e.style;return c().createElement("span",{className:"".concat(t,"-loading-icon"),style:i,ref:n},c().createElement(zl,{className:r}))}))},Yl=/^[\u4e00-\u9fa5]{2}$/,Jl=Yl.test.bind(Yl);function Xl(e){return"text"===e||"link"===e}ha("default","primary","ghost","dashed","link","text"),ha("default","circle","round"),ha("submit","button","reset");var Zl=function(e,t){var n,r=e.loading,o=void 0!==r&&r,a=e.prefixCls,c=e.type,l=void 0===c?"default":c,u=e.danger,p=e.shape,d=void 0===p?"default":p,h=e.size,v=e.disabled,g=e.className,b=e.children,E=e.icon,w=e.ghost,T=void 0!==w&&w,_=e.block,k=void 0!==_&&_,O=e.htmlType,S=void 0===O?"button":O,x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i(0,r.createElement)(nu,null,(0,r.createElement)("h2",null,"Help"),(0,r.createElement)("p",null,"On this page you will find resources to help you understand WPGraphQL, how to use GraphQL with WordPress, how to customize it and make it work for you, and how to get plugged into the community."),(0,r.createElement)(Ec,null),(0,r.createElement)("h3",null,"Documentation"),(0,r.createElement)("p",null,"Below are helpful links to the official WPGraphQL documentation."),(0,r.createElement)(Nc,{gutter:[16,16]},(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Getting Started",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/docs/introduction/",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Get Started with WPGraphQL"))]},(0,r.createElement)("p",null,"In the Getting Started are resources to learn about GraphQL, WordPress, how they work together, and more."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Beginner Guides",actions:[(0,r.createElement)("a",{target:"_blank",href:"https://www.wpgraphql.com/docs/intro-to-graphql/"},(0,r.createElement)(tu,{type:"primary"},"Beginner Guides"))]},(0,r.createElement)("p",null,"The Beginner guides go over specific topics such as GraphQL, WordPress, tools and techniques to interact with GraphQL APIs and more."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Using WPGraphQL",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/docs/posts-and-pages/",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Using WPGraphQL"))]},(0,r.createElement)("p",null,"This section covers how WPGraphQL exposes WordPress data to the Graph, and shows how you can interact with this data using GraphQL."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Advanced Concepts",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/docs/wpgraphql-concepts/",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Advanced Concepts"))]},(0,r.createElement)("p",null,'Learn about concepts such as "connections", "edges", "nodes", "what is an application data graph?" and more'," ")))),(0,r.createElement)(Ec,null),(0,r.createElement)("h3",null,"Developer Reference"),(0,r.createElement)("p",null,"Below are helpful links to the WPGraphQL developer reference. These links will be most helpful to developers looking to customize WPGraphQL"," "),(0,r.createElement)(Nc,{gutter:[16,16]},(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Recipes",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/recipes",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Recipes"))]},(0,r.createElement)("p",null,"Here you will find snippets of code you can use to customize WPGraphQL. Most snippets are PHP and intended to be included in your theme or plugin."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Actions",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/actions",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Actions"))]},(0,r.createElement)("p",null,'Here you will find an index of the WordPress "actions" that are used in the WPGraphQL codebase. Actions can be used to customize behaviors.'))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Filters",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/filters",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Filters"))]},(0,r.createElement)("p",null,'Here you will find an index of the WordPress "filters" that are used in the WPGraphQL codebase. Filters are used to customize the Schema and more.'))),(0,r.createElement)(Dc,{xs:24,sm:24,md:12,lg:12,xl:6},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Functions",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/functions",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Functions"))]},(0,r.createElement)("p",null,'Here you will find functions that can be used to customize the WPGraphQL Schema. Learn how to register GraphQL "fields", "types", and more.')))),(0,r.createElement)(Ec,null),(0,r.createElement)("h3",null,"Community"),(0,r.createElement)(Nc,{gutter:[16,16]},(0,r.createElement)(Dc,{xs:24,sm:24,md:24,lg:8,xl:8},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Blog",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/Blog",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Read the Blog"))]},(0,r.createElement)("p",null,"Keep up to date with the latest news and updates from the WPGraphQL team."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:24,lg:8,xl:8},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Extensions",actions:[(0,r.createElement)("a",{href:"https://www.wpgraphql.com/Extensions",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"View Extensions"))]},(0,r.createElement)("p",null,"Browse the list of extensions that are available to extend WPGraphQL to work with other popular WordPress plugins."))),(0,r.createElement)(Dc,{xs:24,sm:24,md:24,lg:8,xl:8},(0,r.createElement)(Pl,{style:{height:"100%"},title:"Join us in Slack",actions:[(0,r.createElement)("a",{href:"https://join.slack.com/t/wp-graphql/shared_invite/zt-3vloo60z-PpJV2PFIwEathWDOxCTTLA",target:"_blank"},(0,r.createElement)(tu,{type:"primary"},"Join us in Slack"))]},(0,r.createElement)("p",null,"There are more than 2,000 people in the WPGraphQL Slack community asking questions and helping each other. Join us today!"))))),iu=function(){return iu=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1,o=null;if(i&&r){var a=this.state.highlight;o=c().createElement("ul",{className:"execute-options"},n.map((function(e,n){var r=e.name?e.name.value:"";return c().createElement("li",{key:r+"-"+n,className:e===a?"selected":void 0,onMouseOver:function(){return t.setState({highlight:e})},onMouseOut:function(){return t.setState({highlight:null})},onMouseUp:function(){return t._onOptionSelected(e)}},r)})))}!this.props.isRunning&&i||(e=this._onClick);var s=function(){};this.props.isRunning||!i||r||(s=this._onOptionsOpen);var l=this.props.isRunning?c().createElement("path",{d:"M 10 10 L 23 10 L 23 23 L 10 23 z"}):c().createElement("path",{d:"M 11 9 L 24 16 L 11 23 z"});return c().createElement("div",{className:"execute-button-wrap"},c().createElement("button",{type:"button",className:"execute-button",onMouseDown:s,onClick:e,title:"Execute Query (Ctrl-Enter)"},c().createElement("svg",{width:"34",height:"34"},l)),o)},t}(c().Component),Vu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}();function Qu(e){if("string"===e.type){var t=e.string.slice(1).slice(0,-1).trim();try{var n=window.location;return new URL(t,n.protocol+"//"+n.host)}catch(e){return}}}var qu=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._node=null,t.state={width:null,height:null,src:null,mime:null},t}return Vu(t,e),t.shouldRender=function(e){var t=Qu(e);return!!t&&function(e){return/(bmp|gif|jpeg|jpg|png|svg)$/.test(e.pathname)}(t)},t.prototype.componentDidMount=function(){this._updateMetadata()},t.prototype.componentDidUpdate=function(){this._updateMetadata()},t.prototype.render=function(){var e,t=this,n=null;if(null!==this.state.width&&null!==this.state.height){var r=this.state.width+"x"+this.state.height;null!==this.state.mime&&(r+=" "+this.state.mime),n=c().createElement("div",null,r)}return c().createElement("div",null,c().createElement("img",{onLoad:function(){return t._updateMetadata()},ref:function(e){t._node=e},src:null===(e=Qu(this.props.token))||void 0===e?void 0:e.href}),n)},t.prototype._updateMetadata=function(){var e=this;if(this._node){var t=this._node.naturalWidth,n=this._node.naturalHeight,r=this._node.src;r!==this.state.src&&(this.setState({src:r}),fetch(r,{method:"HEAD"}).then((function(t){e.setState({mime:t.headers.get("Content-Type")})}))),t===this.state.width&&n===this.state.height||this.setState({height:n,width:t})}},t}(c().Component),Uu=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Gu=function(e){function t(t){var n=e.call(this,t)||this;return n.handleClick=function(){try{n.props.onClick(),n.setState({error:null})}catch(e){n.setState({error:e})}},n.state={error:null},n}return Uu(t,e),t.prototype.render=function(){var e=this.state.error;return c().createElement("button",{className:"toolbar-button"+(e?" error":""),onClick:this.handleClick,title:e?e.message:this.props.title,"aria-invalid":e?"true":"false"},this.props.label)},t}(c().Component);function Bu(e){var t=e.children;return c().createElement("div",{className:"toolbar-button-group"},t)}var Ku=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),zu=function(e){function t(t){var n=e.call(this,t)||this;return n._node=null,n._listener=null,n.handleOpen=function(e){Hu(e),n.setState({visible:!0}),n._subscribe()},n.state={visible:!1},n}return Ku(t,e),t.prototype.componentWillUnmount=function(){this._release()},t.prototype.render=function(){var e=this,t=this.state.visible;return c().createElement("a",{className:"toolbar-menu toolbar-button",onClick:this.handleOpen.bind(this),onMouseDown:Hu,ref:function(t){t&&(e._node=t)},title:this.props.title},this.props.label,c().createElement("svg",{width:"14",height:"8"},c().createElement("path",{fill:"#666",d:"M 5 1.5 L 14 1.5 L 9.5 7 z"})),c().createElement("ul",{className:"toolbar-menu-items"+(t?" open":"")},this.props.children))},t.prototype._subscribe=function(){this._listener||(this._listener=this.handleClick.bind(this),document.addEventListener("click",this._listener))},t.prototype._release=function(){this._listener&&(document.removeEventListener("click",this._listener),this._listener=null)},t.prototype.handleClick=function(e){this._node!==e.target&&(e.preventDefault(),this.setState({visible:!1}),this._release())},t}(c().Component),$u=function(e){var t=e.onSelect,n=e.title,r=e.label;return c().createElement("li",{onMouseOver:function(e){e.currentTarget.className="hover"},onMouseOut:function(e){e.currentTarget.className=""},onMouseDown:Hu,onMouseUp:t,title:n},r)};function Hu(e){e.preventDefault()}var Wu=n(9980),Yu=n.n(Wu),Ju=Array.from({length:11},(function(e,t){return String.fromCharCode(8192+t)})).concat(["\u2028","\u2029"," "," "]),Xu=new RegExp("["+Ju.join("")+"]","g");function Zu(e){return e.replace(Xu," ")}var ep,tp=n(5573),np=n.n(tp),rp=new(Yu());function ip(e,t,r){var i,o;n(4631).on(t,"select",(function(e,t){if(!i){var n,a=t.parentNode;(i=document.createElement("div")).className="CodeMirror-hint-information",a.appendChild(i),(o=document.createElement("div")).className="CodeMirror-hint-deprecation",a.appendChild(o),a.addEventListener("DOMNodeRemoved",n=function(e){e.target===a&&(a.removeEventListener("DOMNodeRemoved",n),i=null,o=null,n=null)})}var s=e.description?rp.render(e.description):"Self descriptive.",c=e.type?''+op(e.type)+"":"";if(i.innerHTML='
'+("

"===s.slice(0,3)?"

"+c+s.slice(3):c+s)+"

",e&&o&&e.deprecationReason){var l=e.deprecationReason?rp.render(e.deprecationReason):"";o.innerHTML='Deprecated'+l,o.style.display="block"}else o&&(o.style.display="none");r&&r(i)}))}function op(e){return e instanceof Iu.GraphQLNonNull?op(e.ofType)+"!":e instanceof Iu.GraphQLList?"["+op(e.ofType)+"]":''+np()(e.name)+""}var ap=!1;"object"==typeof window&&(ap="MacIntel"===window.navigator.platform);var sp=((ep={})[ap?"Cmd-F":"Ctrl-F"]="findPersistent",ep["Cmd-G"]="findPersistent",ep["Ctrl-G"]="findPersistent",ep["Ctrl-Left"]="goSubwordLeft",ep["Ctrl-Right"]="goSubwordRight",ep["Alt-Left"]="goGroupLeft",ep["Alt-Right"]="goGroupRight",ep),cp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),lp=function(){return lp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=65&&r<=90||!t.shiftKey&&r>=48&&r<=57||t.shiftKey&&189===r||t.shiftKey&&222===r)&&n.editor.execCommand("autocomplete")},n._onEdit=function(){n.editor&&(n.ignoreChangeEvent||(n.cachedValue=n.editor.getValue(),n.props.onEdit&&n.props.onEdit(n.cachedValue)))},n._onHasCompletion=function(e,t){ip(0,t,n.props.onHintInformationRender)},n.cachedValue=t.value||"",n}return dp(t,e),t.prototype.componentDidMount=function(){var e=this;this.CodeMirror=n(4631),n(1707),n(4328),n(2801),n(5688),n(9700),n(3256),n(2095),n(4568),n(5292),n(3412),n(6094),n(373),n(9677);var t=this.editor=this.CodeMirror(this._node,{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:"graphql-variables",theme:this.props.editorTheme||"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!this.props.readOnly&&"nocursor",foldGutter:{minFoldSize:4},lint:{variableToType:this.props.variableToType},hintOptions:{variableToType:this.props.variableToType,closeOnUnfocus:!1,completeSingle:!1,container:this._node},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:hp({"Cmd-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Alt-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Shift-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Cmd-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Ctrl-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Shift-Ctrl-P":function(){e.props.onPrettifyQuery&&e.props.onPrettifyQuery()},"Shift-Ctrl-M":function(){e.props.onMergeQuery&&e.props.onMergeQuery()}},sp)});t.on("change",this._onEdit),t.on("keyup",this._onKeyUp),t.on("hasCompletion",this._onHasCompletion)},t.prototype.componentDidUpdate=function(e){if(this.CodeMirror=n(4631),this.editor){if(this.ignoreChangeEvent=!0,this.props.variableToType!==e.variableToType&&(this.editor.options.lint.variableToType=this.props.variableToType,this.editor.options.hintOptions.variableToType=this.props.variableToType,this.CodeMirror.signal(this.editor,"change",this.editor)),this.props.value!==e.value&&this.props.value!==this.cachedValue){var t=this.props.value||"";this.cachedValue=t,this.editor.setValue(t)}this.ignoreChangeEvent=!1}},t.prototype.componentWillUnmount=function(){this.editor&&(this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null)},t.prototype.render=function(){var e=this;return c().createElement("div",{className:"codemirrorWrap",style:{position:this.props.active?"relative":"absolute",visibility:this.props.active?"visible":"hidden"},ref:function(t){e._node=t}})},t.prototype.getCodeMirror=function(){return this.editor},t.prototype.getClientHeight=function(){return this._node&&this._node.clientHeight},t}(c().Component),vp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),yp=function(){return yp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=65&&r<=90||!t.shiftKey&&r>=48&&r<=57||t.shiftKey&&189===r||t.shiftKey&&222===r)&&n.editor.execCommand("autocomplete")},n._onEdit=function(){n.editor&&(n.ignoreChangeEvent||(n.cachedValue=n.editor.getValue(),n.props.onEdit&&n.props.onEdit(n.cachedValue)))},n._onHasCompletion=function(e,t){ip(0,t,n.props.onHintInformationRender)},n.cachedValue=t.value||"",n}return vp(t,e),t.prototype.componentDidMount=function(){var e=this;this.CodeMirror=n(4631),n(1707),n(4328),n(2801),n(5688),n(9700),n(3256),n(2095),n(4568),n(5292),n(6876),n(3412);var t=this.editor=this.CodeMirror(this._node,{value:this.props.value||"",lineNumbers:!0,tabSize:2,mode:{name:"javascript",json:!0},theme:this.props.editorTheme||"graphiql",keyMap:"sublime",autoCloseBrackets:!0,matchBrackets:!0,showCursorWhenSelecting:!0,readOnly:!!this.props.readOnly&&"nocursor",foldGutter:{minFoldSize:4},gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],extraKeys:yp({"Cmd-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Ctrl-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Alt-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Shift-Space":function(){return e.editor.showHint({completeSingle:!1,container:e._node})},"Cmd-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Ctrl-Enter":function(){e.props.onRunQuery&&e.props.onRunQuery()},"Shift-Ctrl-P":function(){e.props.onPrettifyQuery&&e.props.onPrettifyQuery()},"Shift-Ctrl-M":function(){e.props.onMergeQuery&&e.props.onMergeQuery()}},sp)});t.on("change",this._onEdit),t.on("keyup",this._onKeyUp),t.on("hasCompletion",this._onHasCompletion)},t.prototype.componentDidUpdate=function(e){if(this.CodeMirror=n(4631),this.editor){if(this.ignoreChangeEvent=!0,this.props.value!==e.value&&this.props.value!==this.cachedValue){var t=this.props.value||"";this.cachedValue=t,this.editor.setValue(t)}this.ignoreChangeEvent=!1}},t.prototype.componentWillUnmount=function(){this.editor&&(this.editor.off("change",this._onEdit),this.editor.off("keyup",this._onKeyUp),this.editor.off("hasCompletion",this._onHasCompletion),this.editor=null)},t.prototype.render=function(){var e=this;return c().createElement("div",{className:"codemirrorWrap",style:{position:this.props.active?"relative":"absolute",visibility:this.props.active?"visible":"hidden"},ref:function(t){e._node=t}})},t.prototype.getCodeMirror=function(){return this.editor},t.prototype.getClientHeight=function(){return this._node&&this._node.clientHeight},t}(c().Component),bp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Ep=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.viewer=null,t._node=null,t}return bp(t,e),t.prototype.componentDidMount=function(){var e=n(4631);n(9700),n(5688),n(5292),n(1699),n(2095),n(4568),n(3412),n(6276);var t=this.props.ResultsTooltip,r=this.props.ImagePreview;if(t||r){n(9965);var i=document.createElement("div");e.registerHelper("info","graphql-results",(function(e,n,o,a){var s=[];return t&&s.push(c().createElement(t,{pos:a})),r&&"function"==typeof r.shouldRender&&r.shouldRender(e)&&s.push(c().createElement(r,{token:e})),s.length?(Tt().render(c().createElement("div",null,s),i),i):(Tt().unmountComponentAtNode(i),null)}))}this.viewer=e(this._node,{lineWrapping:!0,value:this.props.value||"",readOnly:!0,theme:this.props.editorTheme||"graphiql",mode:"graphql-results",keyMap:"sublime",foldGutter:{minFoldSize:4},gutters:["CodeMirror-foldgutter"],info:Boolean(this.props.ResultsTooltip||this.props.ImagePreview),extraKeys:sp})},t.prototype.shouldComponentUpdate=function(e){return this.props.value!==e.value},t.prototype.componentDidUpdate=function(){this.viewer&&this.viewer.setValue(this.props.value||"")},t.prototype.componentWillUnmount=function(){this.viewer=null},t.prototype.render=function(){var e=this;return c().createElement("section",{className:"result-window","aria-label":"Result Window","aria-live":"polite","aria-atomic":"true",ref:function(t){t&&(e.props.registerRef(t),e._node=t)}})},t.prototype.getCodeMirror=function(){return this.viewer},t.prototype.getClientHeight=function(){return this._node&&this._node.clientHeight},t}(c().Component);function wp(e){var t=e.onClick?e.onClick:function(){return null};return Tp(e.type,t)}function Tp(e,t){return e instanceof Iu.GraphQLNonNull?c().createElement("span",null,Tp(e.ofType,t),"!"):e instanceof Iu.GraphQLList?c().createElement("span",null,"[",Tp(e.ofType,t),"]"):c().createElement("a",{className:"type-name",onClick:function(n){n.preventDefault(),t(e,n)},href:"#"},null==e?void 0:e.name)}function _p(e){var t,n=e.field;return"defaultValue"in n&&void 0!==n.defaultValue?c().createElement("span",null," = ",c().createElement("span",{className:"arg-default-value"},(t=(0,Iu.astFromValue)(n.defaultValue,n.type))?(0,Iu.print)(t):"")):null}function kp(e){var t=e.arg,n=e.onClickType,r=e.showDefaultValue;return c().createElement("span",{className:"arg"},c().createElement("span",{className:"arg-name"},t.name),": ",c().createElement(wp,{type:t.type,onClick:n}),!1!==r&&c().createElement(_p,{field:t}))}function Op(e){var t=e.directive;return c().createElement("span",{className:"doc-category-item",id:t.name.value},"@",t.name.value)}var Sp=new(Yu())({breaks:!0,linkify:!0});function xp(e){var t=e.markdown,n=e.className;return t?c().createElement("div",{className:n,dangerouslySetInnerHTML:{__html:Sp.render(t)}}):c().createElement("div",null)}function Cp(e){var t,n,r,i=e.field,o=e.onClickType,a=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}(c().useState(!1),2),s=a[0],l=a[1];if(i&&"args"in i&&i.args.length>0){t=c().createElement("div",{id:"doc-args",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"arguments"),i.args.filter((function(e){return!e.deprecationReason})).map((function(e){return c().createElement("div",{key:e.name,className:"doc-category-item"},c().createElement("div",null,c().createElement(kp,{arg:e,onClickType:o})),c().createElement(xp,{className:"doc-value-description",markdown:e.description}),e&&"deprecationReason"in e&&c().createElement(xp,{className:"doc-deprecation",markdown:null==e?void 0:e.deprecationReason}))})));var u=i.args.filter((function(e){return Boolean(e.deprecationReason)}));u.length>0&&(n=c().createElement("div",{id:"doc-deprecated-args",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"deprecated arguments"),s?u.map((function(e,t){return c().createElement("div",{key:t},c().createElement("div",null,c().createElement(kp,{arg:e,onClickType:o})),c().createElement(xp,{className:"doc-value-description",markdown:e.description}),e&&"deprecationReason"in e&&c().createElement(xp,{className:"doc-deprecation",markdown:null==e?void 0:e.deprecationReason}))})):c().createElement("button",{className:"show-btn",onClick:function(){return l(!s)}},"Show deprecated arguments...")))}return i&&i.astNode&&i.astNode.directives&&i.astNode.directives.length>0&&(r=c().createElement("div",{id:"doc-directives",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"directives"),i.astNode.directives.map((function(e){return c().createElement("div",{key:e.name.value,className:"doc-category-item"},c().createElement("div",null,c().createElement(Op,{directive:e})))})))),c().createElement("div",null,c().createElement(xp,{className:"doc-type-description",markdown:(null==i?void 0:i.description)||"No Description"}),i&&"deprecationReason"in i&&c().createElement(xp,{className:"doc-deprecation",markdown:null==i?void 0:i.deprecationReason}),c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"type"),c().createElement(wp,{type:null==i?void 0:i.type,onClick:o})),t,r,n)}function Np(e){var t=e.schema,n=e.onClickType,r=t.getQueryType(),i=t.getMutationType&&t.getMutationType(),o=t.getSubscriptionType&&t.getSubscriptionType();return c().createElement("div",null,c().createElement(xp,{className:"doc-type-description",markdown:t.description||"A GraphQL schema provides a root type for each kind of operation."}),c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"root types"),c().createElement("div",{className:"doc-category-item"},c().createElement("span",{className:"keyword"},"query"),": ",c().createElement(wp,{type:r,onClick:n})),i&&c().createElement("div",{className:"doc-category-item"},c().createElement("span",{className:"keyword"},"mutation"),": ",c().createElement(wp,{type:i,onClick:n})),o&&c().createElement("div",{className:"doc-category-item"},c().createElement("span",{className:"keyword"},"subscription"),": ",c().createElement(wp,{type:o,onClick:n}))))}function Ap(e,t){var n;return function(){for(var r=this,i=[],o=0;o=100)return"break";var t=p[e];if(r!==t&&Mp(e,n)&&l.push(c().createElement("div",{className:"doc-category-item",key:e},c().createElement(wp,{type:t,onClick:o}))),t&&"getFields"in t){var i=t.getFields();Object.keys(i).forEach((function(l){var p,f=i[l];if(!Mp(l,n)){if(!("args"in f)||!f.args.length)return;if(0===(p=f.args.filter((function(e){return Mp(e.name,n)}))).length)return}var d=c().createElement("div",{className:"doc-category-item",key:e+"."+l},r!==t&&[c().createElement(wp,{key:"type",type:t,onClick:o}),"."],c().createElement("a",{className:"field-name",onClick:function(e){return a(f,t,e)}},f.name),p&&["(",c().createElement("span",{key:"args"},p.map((function(e){return c().createElement(kp,{key:e.name,arg:e,onClickType:o,showDefaultValue:!1})}))),")"]);r===t?s.push(d):u.push(d)}))}};try{for(var h=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(f),m=h.next();!m.done&&"break"!==d(m.value);m=h.next());}catch(t){e={error:t}}finally{try{m&&!m.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}return s.length+l.length+u.length===0?c().createElement("span",{className:"doc-alert-text"},"No results found."):r&&l.length+u.length>0?c().createElement("div",null,s,c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"other results"),l,u)):c().createElement("div",{className:"doc-search-items"},s,l,u)},t}(c().Component),Rp=Pp;function Mp(e,t){try{var n=t.replace(/[^_0-9A-Za-z]/g,(function(e){return"\\"+e}));return-1!==e.search(new RegExp(n,"i"))}catch(n){return-1!==e.toLowerCase().indexOf(t.toLowerCase())}}var jp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Fp=function(e){function t(t){var n=e.call(this,t)||this;return n.handleShowDeprecated=function(){return n.setState({showDeprecated:!0})},n.state={showDeprecated:!1},n}return jp(t,e),t.prototype.shouldComponentUpdate=function(e,t){return this.props.type!==e.type||this.props.schema!==e.schema||this.state.showDeprecated!==t.showDeprecated},t.prototype.render=function(){var e,t,n,r,i,o=this.props.schema,a=this.props.type,s=this.props.onClickType,l=this.props.onClickField,u=null,p=[];if(a instanceof Iu.GraphQLUnionType?(u="possible types",p=o.getPossibleTypes(a)):a instanceof Iu.GraphQLInterfaceType?(u="implementations",p=o.getPossibleTypes(a)):a instanceof Iu.GraphQLObjectType&&(u="implements",p=a.getInterfaces()),p&&p.length>0&&(e=c().createElement("div",{id:"doc-types",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},u),p.map((function(e){return c().createElement("div",{key:e.name,className:"doc-category-item"},c().createElement(wp,{type:e,onClick:s}))})))),a&&"getFields"in a){var f=a.getFields(),d=Object.keys(f).map((function(e){return f[e]}));t=c().createElement("div",{id:"doc-fields",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"fields"),d.filter((function(e){return!e.deprecationReason})).map((function(e){return c().createElement(Vp,{key:e.name,type:a,field:e,onClickType:s,onClickField:l})})));var h=d.filter((function(e){return Boolean(e.deprecationReason)}));h.length>0&&(n=c().createElement("div",{id:"doc-deprecated-fields",className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"deprecated fields"),this.state.showDeprecated?h.map((function(e){return c().createElement(Vp,{key:e.name,type:a,field:e,onClickType:s,onClickField:l})})):c().createElement("button",{className:"show-btn",onClick:this.handleShowDeprecated},"Show deprecated fields...")))}if(a instanceof Iu.GraphQLEnumType){var m=a.getValues();r=c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"values"),m.filter((function(e){return Boolean(!e.deprecationReason)})).map((function(e){return c().createElement(Qp,{key:e.name,value:e})})));var v=m.filter((function(e){return Boolean(e.deprecationReason)}));v.length>0&&(i=c().createElement("div",{className:"doc-category"},c().createElement("div",{className:"doc-category-title"},"deprecated values"),this.state.showDeprecated?v.map((function(e){return c().createElement(Qp,{key:e.name,value:e})})):c().createElement("button",{className:"show-btn",onClick:this.handleShowDeprecated},"Show deprecated values...")))}return c().createElement("div",null,c().createElement(xp,{className:"doc-type-description",markdown:"description"in a&&a.description||"No Description"}),a instanceof Iu.GraphQLObjectType&&e,t,n,r,i,!(a instanceof Iu.GraphQLObjectType)&&e)},t}(c().Component);function Vp(e){var t=e.type,n=e.field,r=e.onClickType,i=e.onClickField;return c().createElement("div",{className:"doc-category-item"},c().createElement("a",{className:"field-name",onClick:function(e){return i(n,t,e)}},n.name),"args"in n&&n.args&&n.args.length>0&&["(",c().createElement("span",{key:"args"},n.args.filter((function(e){return!e.deprecationReason})).map((function(e){return c().createElement(kp,{key:e.name,arg:e,onClickType:r})}))),")"],": ",c().createElement(wp,{type:n.type,onClick:r}),c().createElement(_p,{field:n}),n.description&&c().createElement(xp,{className:"field-short-description",markdown:n.description}),"deprecationReason"in n&&n.deprecationReason&&c().createElement(xp,{className:"doc-deprecation",markdown:n.deprecationReason}))}function Qp(e){var t=e.value;return c().createElement("div",{className:"doc-category-item"},c().createElement("div",{className:"enum-value"},t.name),c().createElement(xp,{className:"doc-value-description",markdown:t.description}),t.deprecationReason&&c().createElement(xp,{className:"doc-deprecation",markdown:t.deprecationReason}))}var qp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Up=function(){return Up=Object.assign||function(e){for(var t,n=1,r=arguments.length;n1&&n.setState({navStack:n.state.navStack.slice(0,-1)})},n.handleClickType=function(e){n.showDoc(e)},n.handleClickField=function(e){n.showDoc(e)},n.handleSearch=function(e){n.showSearch(e)},n.state={navStack:[Gp]},n}return qp(t,e),t.prototype.shouldComponentUpdate=function(e,t){return this.props.schema!==e.schema||this.state.navStack!==t.navStack||this.props.schemaErrors!==e.schemaErrors},t.prototype.render=function(){var e,t=this.props,n=t.schema,r=t.schemaErrors,i=this.state.navStack,o=i[i.length-1];e=r?c().createElement("div",{className:"error-container"},"Error fetching schema"):void 0===n?c().createElement("div",{className:"spinner-container"},c().createElement("div",{className:"spinner"})):n?o.search?c().createElement(Rp,{searchValue:o.search,withinType:o.def,schema:n,onClickType:this.handleClickType,onClickField:this.handleClickField}):1===i.length?c().createElement(Np,{schema:n,onClickType:this.handleClickType}):(0,Iu.isType)(o.def)?c().createElement(Fp,{schema:n,type:o.def,onClickType:this.handleClickType,onClickField:this.handleClickField}):c().createElement(Cp,{field:o.def,onClickType:this.handleClickType}):c().createElement("div",{className:"error-container"},"No Schema Available");var a,s=1===i.length||(0,Iu.isType)(o.def)&&"getFields"in o.def;return i.length>1&&(a=i[i.length-2].name),c().createElement("section",{className:"doc-explorer",key:o.name,"aria-label":"Documentation Explorer"},c().createElement("div",{className:"doc-explorer-title-bar"},a&&c().createElement("button",{className:"doc-explorer-back",onClick:this.handleNavBackClick,"aria-label":"Go back to "+a},a),c().createElement("div",{className:"doc-explorer-title"},o.title||o.name),c().createElement("div",{className:"doc-explorer-rhs"},this.props.children)),c().createElement("div",{className:"doc-explorer-contents"},s&&c().createElement(Dp,{value:o.search,placeholder:"Search "+o.name+"...",onSearch:this.handleSearch}),e))},t.prototype.showDoc=function(e){var t=this.state.navStack;t[t.length-1].def!==e&&this.setState({navStack:t.concat([{name:e.name,def:e}])})},t.prototype.showDocForReference=function(e){e&&"Type"===e.kind?this.showDoc(e.type):"Field"===e.kind||"Argument"===e.kind&&e.field?this.showDoc(e.field):"EnumValue"===e.kind&&e.type&&this.showDoc(e.type)},t.prototype.showSearch=function(e){var t=this.state.navStack.slice(),n=t[t.length-1];t[t.length-1]=Up(Up({},n),{search:e}),this.setState({navStack:t})},t.prototype.reset=function(){this.setState({navStack:[Gp]})},t}(c().Component),Kp=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),zp=function(e){function t(t){var n=e.call(this,t)||this;return n.state={editable:!1},n.editField=null,n}return Kp(t,e),t.prototype.render=function(){var e,t=this,n=this.props.label||this.props.operationName||(null===(e=this.props.query)||void 0===e?void 0:e.split("\n").filter((function(e){return 0!==e.indexOf("#")})).join("")),r=this.props.favorite?"★":"☆";return c().createElement("li",{className:this.state.editable?"editable":void 0},this.state.editable?c().createElement("input",{type:"text",defaultValue:this.props.label,ref:function(e){t.editField=e},onBlur:this.handleFieldBlur.bind(this),onKeyDown:this.handleFieldKeyDown.bind(this),placeholder:"Type a label"}):c().createElement("button",{className:"history-label",onClick:this.handleClick.bind(this)},n),c().createElement("button",{onClick:this.handleEditClick.bind(this),"aria-label":"Edit label"},"✎"),c().createElement("button",{className:this.props.favorite?"favorited":void 0,onClick:this.handleStarClick.bind(this),"aria-label":this.props.favorite?"Remove favorite":"Add favorite"},r))},t.prototype.handleClick=function(){this.props.onSelect(this.props.query,this.props.variables,this.props.headers,this.props.operationName,this.props.label)},t.prototype.handleStarClick=function(e){e.stopPropagation(),this.props.handleToggleFavorite(this.props.query,this.props.variables,this.props.headers,this.props.operationName,this.props.label,this.props.favorite)},t.prototype.handleFieldBlur=function(e){e.stopPropagation(),this.setState({editable:!1}),this.props.handleEditLabel(this.props.query,this.props.variables,this.props.headers,this.props.operationName,e.target.value,this.props.favorite)},t.prototype.handleFieldKeyDown=function(e){13===e.keyCode&&(e.stopPropagation(),this.setState({editable:!1}),this.props.handleEditLabel(this.props.query,this.props.variables,this.props.headers,this.props.operationName,e.currentTarget.value,this.props.favorite))},t.prototype.handleEditClick=function(e){var t=this;e.stopPropagation(),this.setState({editable:!0},(function(){t.editField&&t.editField.focus()}))},t}(c().Component),$p=zp,Hp=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Wp=function(){function e(e,t,n){void 0===n&&(n=null),this.key=e,this.storage=t,this.maxSize=n,this.items=this.fetchAll()}return Object.defineProperty(e.prototype,"length",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),e.prototype.contains=function(e){return this.items.some((function(t){return t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName}))},e.prototype.edit=function(e){var t=this.items.findIndex((function(t){return t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName}));-1!==t&&(this.items.splice(t,1,e),this.save())},e.prototype.delete=function(e){var t=this.items.findIndex((function(t){return t.query===e.query&&t.variables===e.variables&&t.headers===e.headers&&t.operationName===e.operationName}));-1!==t&&(this.items.splice(t,1),this.save())},e.prototype.fetchRecent=function(){return this.items[this.items.length-1]},e.prototype.fetchAll=function(){var e=this.storage.get(this.key);return e?JSON.parse(e)[this.key]:[]},e.prototype.push=function(e){var t,n=function(){for(var e=[],t=0;tthis.maxSize&&n.shift();for(var r=0;r<5;r++){var i=this.storage.set(this.key,JSON.stringify(((t={})[this.key]=n,t)));if(i&&i.error){if(!i.isQuotaError||!this.maxSize)return;n.shift()}else this.items=n}},e.prototype.save=function(){var e;this.storage.set(this.key,JSON.stringify(((e={})[this.key]=this.items,e)))},e}(),Yp=Wp,Jp=function(){return Jp=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Zp=function(){for(var e=[],t=0;t1e5)return!1;if(!r)return!0;if(JSON.stringify(e)===JSON.stringify(r.query)){if(JSON.stringify(t)===JSON.stringify(r.variables)){if(JSON.stringify(n)===JSON.stringify(r.headers))return!1;if(n&&!r.headers)return!1}if(t&&!r.variables)return!1}return!0},this.fetchAllQueries=function(){var e=n.history.fetchAll(),t=n.favorite.fetchAll();return e.concat(t)},this.updateHistory=function(e,t,r,i){if(n.shouldSaveQuery(e,t,r,n.history.fetchRecent())){n.history.push({query:e,variables:t,headers:r,operationName:i});var o=n.history.items,a=n.favorite.items;n.queries=o.concat(a)}},this.toggleFavorite=function(e,t,r,i,o,a){var s={query:e,variables:t,headers:r,operationName:i,label:o};n.favorite.contains(s)?a&&(s.favorite=!1,n.favorite.delete(s)):(s.favorite=!0,n.favorite.push(s)),n.queries=Zp(n.history.items,n.favorite.items)},this.editLabel=function(e,t,r,i,o,a){var s={query:e,variables:t,headers:r,operationName:i,label:o};a?n.favorite.edit(Jp(Jp({},s),{favorite:a})):n.history.edit(s),n.queries=Zp(n.history.items,n.favorite.items)},this.history=new Yp("queries",this.storage,this.maxHistoryLength),this.favorite=new Yp("favorites",this.storage,null),this.queries=this.fetchAllQueries()},tf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),nf=function(){return nf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},yf=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},gf=function(){for(var e=[],t=0;t=0)continue;c.push(f)}var d=e[p.name.value];if(d){var h=d.typeCondition,m=d.directives,v=d.selectionSet;p={kind:Iu.Kind.INLINE_FRAGMENT,typeCondition:h,directives:m,selectionSet:v}}}if(p.kind===Iu.Kind.INLINE_FRAGMENT&&(!p.directives||0===(null===(o=p.directives)||void 0===o?void 0:o.length))){var y=p.typeCondition?p.typeCondition.name.value:null;if(!y||y===a){s.push.apply(s,gf(bf(e,p.selectionSet.selections,n)));continue}}s.push(p)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=l.return)&&i.call(l)}finally{if(r)throw r.error}}return s}function Ef(e,t){var n,r,i=t?new Iu.TypeInfo(t):null,o=Object.create(null);try{for(var a=vf(e.definitions),s=a.next();!s.done;s=a.next()){var c=s.value;c.kind===Iu.Kind.FRAGMENT_DEFINITION&&(o[c.name.value]=c)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}var l={SelectionSet:function(e){var t=i?i.getParentType():null,n=e.selections;return n=function(e,t){var n,r,i,o=new Map,a=[];try{for(var s=vf(e),c=s.next();!c.done;c=s.next()){var l=c.value;if("Field"===l.kind){var u=(i=l).alias?i.alias.value:i.name.value,p=o.get(u);if(l.directives&&l.directives.length){var f=mf({},l);a.push(f)}else p&&p.selectionSet&&l.selectionSet?p.selectionSet.selections=gf(p.selectionSet.selections,l.selectionSet.selections):p||(f=mf({},l),o.set(u,f),a.push(f))}else a.push(l)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return a}(n=bf(o,n,t)),mf(mf({},e),{selections:n})},FragmentDefinition:function(){return null}};return(0,Iu.visit)(e,i?(0,Iu.visitWithTypeInfo)(i,l):l)}function wf(e,t,n){if("object"==typeof e&&"object"==typeof t){if(Array.isArray(e)&&Array.isArray(t))for(n=0;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},Nf=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};if(parseInt(c().version.slice(0,2),10)<16)throw Error(["GraphiQL 0.18.0 and after is not compatible with React 15 or below.","If you are using a CDN source (jsdelivr, unpkg, etc), follow this example:","https://github.com/graphql/graphiql/blob/master/examples/graphiql-cdn/index.html#L49"].join("\n"));var Af=function(e){return JSON.stringify(e,null,2)},Lf=function(e){return e instanceof Iu.GraphQLError?e.toString():e instanceof Error?function(e){return kf(kf({},e),{message:e.message,stack:e.stack})}(e):e},Df=function(e){function t(n){var r,i,o,a,s,c,l=e.call(this,n)||this;if(l._editorQueryID=0,l.safeSetState=function(e,t){l.componentIsMounted&&l.setState(e,t)},l.handleClickReference=function(e){l.setState({docExplorerOpen:!0},(function(){l.docExplorerComponent&&l.docExplorerComponent.showDocForReference(e)})),l._storage.set("docExplorerOpen",JSON.stringify(l.state.docExplorerOpen))},l.handleRunQuery=function(e){return Of(l,void 0,void 0,(function(){var n,r,i,o,a,s,c,l,u,p=this;return Sf(this,(function(f){switch(f.label){case 0:this._editorQueryID++,n=this._editorQueryID,r=this.autoCompleteLeafs()||this.state.query,i=this.state.variables,o=this.state.headers,a=this.state.shouldPersistHeaders,s=this.state.operationName,e&&e!==s&&(s=e,this.handleEditOperationName(s)),f.label=1;case 1:return f.trys.push([1,3,,4]),this.setState({isWaitingForResponse:!0,response:void 0,operationName:s}),this._storage.set("operationName",s),this._queryHistory?this._queryHistory.onUpdateHistory(r,i,o,s):this._historyStore&&this._historyStore.updateHistory(r,i,o,s),c={data:{}},[4,this._fetchQuery(r,i,o,s,a,(function(e){var r,i;if(n===p._editorQueryID){var o=!!Array.isArray(e)&&e;if(!o&&"string"!=typeof e&&null!==e&&"hasNext"in e&&(o=[e]),o){var a={data:c.data},s=function(){for(var e=[],t=0;t0&&(w=t.formatError(_),E=void 0,T=_)}return l._introspectionQuery=(0,Iu.getIntrospectionQuery)({schemaDescription:null!==(a=n.schemaDescription)&&void 0!==a?a:void 0,inputValueDeprecation:null!==(s=n.inputValueDeprecation)&&void 0!==s?s:void 0}),l._introspectionQueryName=null!==(c=n.introspectionQueryName)&&void 0!==c?c:"IntrospectionQuery",l._introspectionQuerySansSubscriptions=l._introspectionQuery.replace("subscriptionType { name }",""),l.state=kf({schema:E,query:f,variables:h,headers:m,operationName:v,docExplorerOpen:y,schemaErrors:T,response:w,editorFlex:Number(l._storage.get("editorFlex"))||1,secondaryEditorOpen:p,secondaryEditorHeight:Number(l._storage.get("secondaryEditorHeight"))||200,variableEditorActive:"true"!==l._storage.get("variableEditorActive")&&!n.headerEditorEnabled||"true"!==l._storage.get("headerEditorActive"),headerEditorActive:"true"===l._storage.get("headerEditorActive"),headerEditorEnabled:g,shouldPersistHeaders:b,historyPaneOpen:"true"===l._storage.get("historyPaneOpen")||!1,docExplorerWidth:Number(l._storage.get("docExplorerWidth"))||350,isWaitingForResponse:!1,subscription:null,maxHistoryLength:u},d),l}return _f(t,e),t.formatResult=function(e){return JSON.stringify(e,null,2)},t.prototype.componentDidMount=function(){this.componentIsMounted=!0,void 0===this.state.schema&&this.fetchSchema(),this.codeMirrorSizer=new of,void 0!==n.g&&(n.g.g=this)},t.prototype.UNSAFE_componentWillMount=function(){this.componentIsMounted=!1},t.prototype.UNSAFE_componentWillReceiveProps=function(e){var t=this,n=this.state.schema,r=this.state.query,i=this.state.variables,o=this.state.headers,a=this.state.operationName,s=this.state.response;if(void 0!==e.schema&&(n=e.schema),void 0!==e.query&&this.props.query!==e.query&&(r=e.query),void 0!==e.variables&&this.props.variables!==e.variables&&(i=e.variables),void 0!==e.headers&&this.props.headers!==e.headers&&(o=e.headers),void 0!==e.operationName&&(a=e.operationName),void 0!==e.response&&(s=e.response),r&&n&&(n!==this.state.schema||r!==this.state.query||a!==this.state.operationName)){if(!this.props.dangerouslyAssumeSchemaIsValid){var c=(0,Iu.validateSchema)(n);c&&c.length>0&&(this.handleSchemaErrors(c),n=void 0)}var l=this._updateQueryFacts(r,a,this.state.operations,n);void 0!==l&&(a=l.operationName,this.setState(l))}void 0===e.schema&&e.fetcher!==this.props.fetcher&&(n=void 0),this._storage.set("operationName",a),this.setState({schema:n,query:r,variables:i,headers:o,operationName:a,response:s},(function(){void 0===t.state.schema&&(t.docExplorerComponent&&t.docExplorerComponent.reset(),t.fetchSchema())}))},t.prototype.componentDidUpdate=function(){this.codeMirrorSizer.updateSizes([this.queryEditorComponent,this.variableEditorComponent,this.headerEditorComponent,this.resultComponent])},t.prototype.render=function(){var e,n=this,r=c().Children.toArray(this.props.children),i=cf(r,(function(e){return qf(e,t.Logo)}))||c().createElement(t.Logo,null),o=cf(r,(function(e){return qf(e,t.Toolbar)}))||c().createElement(t.Toolbar,null,c().createElement(Gu,{onClick:this.handlePrettifyQuery,title:"Prettify Query (Shift-Ctrl-P)",label:"Prettify"}),c().createElement(Gu,{onClick:this.handleMergeQuery,title:"Merge Query (Shift-Ctrl-M)",label:"Merge"}),c().createElement(Gu,{onClick:this.handleCopyQuery,title:"Copy Query (Shift-Ctrl-C)",label:"Copy"}),c().createElement(Gu,{onClick:this.handleToggleHistory,title:"Show History",label:"History"}),(null===(e=this.props.toolbar)||void 0===e?void 0:e.additionalContent)?this.props.toolbar.additionalContent:null),a=cf(r,(function(e){return qf(e,t.Footer)})),s={WebkitFlex:this.state.editorFlex,flex:this.state.editorFlex},l={display:"block",width:this.state.docExplorerWidth},u="docExplorerWrap"+(this.state.docExplorerWidth<200?" doc-explorer-narrow":""),p={display:this.state.historyPaneOpen?"block":"none",width:"230px",zIndex:7},f=this.state.secondaryEditorOpen,d={height:f?this.state.secondaryEditorHeight:void 0};return c().createElement("div",{ref:function(e){n.graphiqlContainer=e},className:"graphiql-container"},this.state.historyPaneOpen&&c().createElement("div",{className:"historyPaneWrap",style:p},c().createElement(rf,{ref:function(e){n._queryHistory=e},operationName:this.state.operationName,query:this.state.query,variables:this.state.variables,onSelectQuery:this.handleSelectHistoryQuery,storage:this._storage,maxHistoryLength:this.state.maxHistoryLength,queryID:this._editorQueryID},c().createElement("button",{className:"docExplorerHide",onClick:this.handleToggleHistory,"aria-label":"Close History"},"✕"))),c().createElement("div",{className:"editorWrap"},c().createElement("div",{className:"topBarWrap"},this.props.beforeTopBarContent,c().createElement("div",{className:"topBar"},i,c().createElement(Fu,{isRunning:Boolean(this.state.subscription),onRun:this.handleRunQuery,onStop:this.handleStopQuery,operations:this.state.operations}),o),!this.state.docExplorerOpen&&c().createElement("button",{className:"docExplorerShow",onClick:this.handleToggleDocs,"aria-label":"Open Documentation Explorer"},"Docs")),c().createElement("div",{ref:function(e){n.editorBarComponent=e},className:"editorBar",onDoubleClick:this.handleResetResize,onMouseDown:this.handleResizeStart},c().createElement("div",{className:"queryWrap",style:s},c().createElement(fp,{ref:function(e){n.queryEditorComponent=e},schema:this.state.schema,validationRules:this.props.validationRules,value:this.state.query,onEdit:this.handleEditQuery,onHintInformationRender:this.handleHintInformationRender,onClickReference:this.handleClickReference,onCopyQuery:this.handleCopyQuery,onPrettifyQuery:this.handlePrettifyQuery,onMergeQuery:this.handleMergeQuery,onRunQuery:this.handleEditorRunQuery,editorTheme:this.props.editorTheme,readOnly:this.props.readOnly,externalFragments:this.props.externalFragments}),c().createElement("section",{className:"variable-editor secondary-editor",style:d,"aria-label":this.state.variableEditorActive?"Query Variables":"Request Headers"},c().createElement("div",{className:"secondary-editor-title variable-editor-title",id:"secondary-editor-title",style:{cursor:f?"row-resize":"n-resize"},onMouseDown:this.handleSecondaryEditorResizeStart},c().createElement("div",{className:"variable-editor-title-text"+(this.state.variableEditorActive?" active":""),onClick:this.handleOpenVariableEditorTab,onMouseDown:this.handleTabClickPropogation},"Query Variables"),this.state.headerEditorEnabled&&c().createElement("div",{style:{marginLeft:"20px"},className:"variable-editor-title-text"+(this.state.headerEditorActive?" active":""),onClick:this.handleOpenHeaderEditorTab,onMouseDown:this.handleTabClickPropogation},"Request Headers")),c().createElement(mp,{ref:function(e){n.variableEditorComponent=e},value:this.state.variables,variableToType:this.state.variableToType,onEdit:this.handleEditVariables,onHintInformationRender:this.handleHintInformationRender,onPrettifyQuery:this.handlePrettifyQuery,onMergeQuery:this.handleMergeQuery,onRunQuery:this.handleEditorRunQuery,editorTheme:this.props.editorTheme,readOnly:this.props.readOnly,active:this.state.variableEditorActive}),this.state.headerEditorEnabled&&c().createElement(gp,{ref:function(e){n.headerEditorComponent=e},value:this.state.headers,onEdit:this.handleEditHeaders,onHintInformationRender:this.handleHintInformationRender,onPrettifyQuery:this.handlePrettifyQuery,onMergeQuery:this.handleMergeQuery,onRunQuery:this.handleEditorRunQuery,editorTheme:this.props.editorTheme,readOnly:this.props.readOnly,active:this.state.headerEditorActive}))),c().createElement("div",{className:"resultWrap"},this.state.isWaitingForResponse&&c().createElement("div",{className:"spinner-container"},c().createElement("div",{className:"spinner"})),c().createElement(Ep,{registerRef:function(e){n.resultViewerElement=e},ref:function(e){n.resultComponent=e},value:this.state.response,editorTheme:this.props.editorTheme,ResultsTooltip:this.props.ResultsTooltip,ImagePreview:qu}),a))),this.state.docExplorerOpen&&c().createElement("div",{className:u,style:l},c().createElement("div",{className:"docExplorerResizer",onDoubleClick:this.handleDocsResetResize,onMouseDown:this.handleDocsResizeStart}),c().createElement(Bp,{ref:function(e){n.docExplorerComponent=e},schemaErrors:this.state.schemaErrors,schema:this.state.schema},c().createElement("button",{className:"docExplorerHide",onClick:this.handleToggleDocs,"aria-label":"Close Documentation Explorer"},"✕"))))},t.prototype.getQueryEditor=function(){if(this.queryEditorComponent)return this.queryEditorComponent.getCodeMirror()},t.prototype.getVariableEditor=function(){return this.variableEditorComponent?this.variableEditorComponent.getCodeMirror():null},t.prototype.getHeaderEditor=function(){return this.headerEditorComponent?this.headerEditorComponent.getCodeMirror():null},t.prototype.refresh=function(){this.queryEditorComponent&&this.queryEditorComponent.getCodeMirror().refresh(),this.variableEditorComponent&&this.variableEditorComponent.getCodeMirror().refresh(),this.headerEditorComponent&&this.headerEditorComponent.getCodeMirror().refresh(),this.resultComponent&&this.resultComponent.getCodeMirror().refresh()},t.prototype.autoCompleteLeafs=function(){var e=lf(this.state.schema,this.state.query,this.props.getDefaultFieldNames),t=e.insertions,n=e.result;if(t&&t.length>0){var r=this.getQueryEditor();r&&r.operation((function(){var e=r.getCursor(),i=r.indexFromPos(e);r.setValue(n||"");var o=0,a=t.map((function(e){var t=e.index,n=e.string;return r.markText(r.posFromIndex(t+o),r.posFromIndex(t+(o+=n.length)),{className:"autoInsertedLeaf",clearOnEnter:!0,title:"Automatically added leaf fields"})}));setTimeout((function(){return a.forEach((function(e){return e.clear()}))}),7e3);var s=i;t.forEach((function(e){var t=e.index,n=e.string;t2?r.headers=JSON.parse(this.state.headers):this.props.headers&&(r.headers=JSON.parse(this.props.headers));var i=Qf(n({query:this._introspectionQuery,operationName:this._introspectionQueryName},r));jf(i)?i.then((function(t){if("string"!=typeof t&&"data"in t)return t;var o=Qf(n({query:e._introspectionQuerySansSubscriptions,operationName:e._introspectionQueryName},r));if(!jf(i))throw new Error("Fetcher did not return a Promise for introspection.");return o})).then((function(n){var r,i;if(void 0===e.state.schema)if(n&&n.data&&"__schema"in(null==n?void 0:n.data)){var o=(0,Iu.buildClientSchema)(n.data);if(!e.props.dangerouslyAssumeSchemaIsValid){var a=(0,Iu.validateSchema)(o);a&&a.length>0&&(o=void 0,e.handleSchemaErrors(a))}if(o){var s=(0,Mu.getOperationFacts)(o,e.state.query);e.safeSetState(kf(kf({schema:o},s),{schemaErrors:void 0})),null===(i=(r=e.props).onSchemaChange)||void 0===i||i.call(r,o)}}else{var c="string"==typeof n?n:t.formatResult(n);e.handleSchemaErrors([c])}})).catch((function(t){e.handleSchemaErrors([t])})):this.setState({response:"Fetcher did not return a Promise for introspection."})},t.prototype.handleSchemaErrors=function(e){this.safeSetState({response:e?t.formatError(e):void 0,schema:void 0,schemaErrors:e})},t.prototype._fetchQuery=function(e,n,r,i,o,a){return Of(this,void 0,void 0,(function(){var s,c,l,u,p,f,d=this;return Sf(this,(function(h){s=this.props.fetcher,c=null,l=null;try{c=n&&""!==n.trim()?JSON.parse(n):null}catch(e){throw new Error("Variables are invalid JSON: "+e.message+".")}if("object"!=typeof c)throw new Error("Variables are not a JSON object.");try{l=r&&""!==r.trim()?JSON.parse(r):null}catch(e){throw new Error("Headers are invalid JSON: "+e.message+".")}if("object"!=typeof l)throw new Error("Headers are not a JSON object.");return this.props.externalFragments&&(u=new Map,Array.isArray(this.props.externalFragments)?this.props.externalFragments.forEach((function(e){u.set(e.name.value,e)})):(0,Iu.visit)((0,Iu.parse)(this.props.externalFragments,{}),{FragmentDefinition:function(e){u.set(e.name.value,e)}}),(p=(0,Mu.getFragmentDependenciesForAST)(this.state.documentAST,u)).length>0&&(e+="\n"+p.map((function(e){return(0,Iu.print)(e)})).join("\n"))),f=s({query:e,variables:c,operationName:i},{headers:l,shouldPersistHeaders:o,documentAST:this.state.documentAST}),[2,Promise.resolve(f).then((function(e){return Ff(e)?e.subscribe({next:a,error:function(e){d.safeSetState({isWaitingForResponse:!1,response:e?t.formatError(e):void 0,subscription:null})},complete:function(){d.safeSetState({isWaitingForResponse:!1,subscription:null})}}):Vf(e)?(Of(d,void 0,void 0,(function(){var n,r,i,o,s,c,l;return Sf(this,(function(u){switch(u.label){case 0:u.trys.push([0,13,,14]),u.label=1;case 1:u.trys.push([1,6,7,12]),n=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof Nf?Nf(e):e[Symbol.iterator](),t={},r("next"),r("throw"),r("return"),t[Symbol.asyncIterator]=function(){return this},t);function r(n){t[n]=e[n]&&function(t){return new Promise((function(r,i){!function(e,t,n,r){Promise.resolve(r).then((function(t){e({value:t,done:n})}),t)}(r,i,(t=e[n](t)).done,t.value)}))}}}(e),u.label=2;case 2:return[4,n.next()];case 3:if((r=u.sent()).done)return[3,5];i=r.value,a(i),u.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return o=u.sent(),c={error:o},[3,12];case 7:return u.trys.push([7,,10,11]),r&&!r.done&&(l=n.return)?[4,l.call(n)]:[3,9];case 8:u.sent(),u.label=9;case 9:return[3,11];case 10:if(c)throw c.error;return[7];case 11:return[7];case 12:return this.safeSetState({isWaitingForResponse:!1,subscription:null}),[3,14];case 13:return s=u.sent(),this.safeSetState({isWaitingForResponse:!1,response:s?t.formatError(s):void 0,subscription:null}),[3,14];case 14:return[2]}}))})),{unsubscribe:function(){var t,n;return null===(n=(t=e[Symbol.asyncIterator]()).return)||void 0===n?void 0:n.call(t)}}):(a(e),null)})).catch((function(e){return d.safeSetState({isWaitingForResponse:!1,response:e?t.formatError(e):void 0}),null}))]}))}))},t.prototype._runQueryAtCursor=function(){if(this.state.subscription)this.handleStopQuery();else{var e,t=this.state.operations;if(t){var n=this.getQueryEditor();if(n&&n.hasFocus())for(var r=n.getCursor(),i=n.indexFromPos(r),o=0;o=i){e=a.name&&a.name.value;break}}}this.handleRunQuery(e)}},t.prototype._didClickDragBar=function(e){if(0!==e.button||e.ctrlKey)return!1;var t=e.target;if(0!==t.className.indexOf("CodeMirror-gutter"))return!1;for(var n=this.resultViewerElement;t;){if(t===n)return!0;t=t.parentNode}return!1},t.formatError=function(e){return Array.isArray(e)?Af({errors:e.map((function(e){return Lf(e)}))}):Af({errors:Lf(e)})},t.Logo=If,t.Toolbar=Pf,t.Footer=Rf,t.QueryEditor=fp,t.VariableEditor=mp,t.HeaderEditor=gp,t.ResultViewer=Ep,t.Button=Gu,t.ToolbarButton=Gu,t.Group=Bu,t.Menu=zu,t.MenuItem=$u,t}(c().Component);function If(e){return c().createElement("div",{className:"title"},e.children||c().createElement("span",null,"Graph",c().createElement("em",null,"i"),"QL"))}function Pf(e){return c().createElement("div",{className:"toolbar",role:"toolbar","aria-label":"Editor Commands"},e.children)}function Rf(e){return c().createElement("div",{className:"footer"},e.children)}If.displayName="GraphiQLLogo",Pf.displayName="GraphiQLToolbar",Rf.displayName="GraphiQLFooter";var Mf='# Welcome to GraphiQL\n#\n# GraphiQL is an in-browser tool for writing, validating, and\n# testing GraphQL queries.\n#\n# Type queries into this side of the screen, and you will see intelligent\n# typeaheads aware of the current GraphQL type schema and live syntax and\n# validation errors highlighted within the text.\n#\n# GraphQL queries typically start with a "{" character. Lines that start\n# with a # are ignored.\n#\n# An example GraphQL query might look like:\n#\n# {\n# field(arg: "value") {\n# subField\n# }\n# }\n#\n# Keyboard shortcuts:\n#\n# Prettify Query: Shift-Ctrl-P (or press the prettify button above)\n#\n# Merge Query: Shift-Ctrl-M (or press the merge button above)\n#\n# Run Query: Ctrl-Enter (or press the play button above)\n#\n# Auto Complete: Ctrl-Space (or just start typing)\n#\n\n';function jf(e){return"object"==typeof e&&"function"==typeof e.then}function Ff(e){return"object"==typeof e&&"subscribe"in e&&"function"==typeof e.subscribe}function Vf(e){return"object"==typeof e&&null!==e&&("AsyncGenerator"===e[Symbol.toStringTag]||Symbol.asyncIterator in e)}function Qf(e){return Promise.resolve(e).then((function(e){return Vf(e)?(n=e,new Promise((function(e,t){var r,i=null===(r=("return"in n?n:n[Symbol.asyncIterator]()).return)||void 0===r?void 0:r.bind(n);("next"in n?n:n[Symbol.asyncIterator]()).next.bind(n)().then((function(t){e(t.value),null==i||i()})).catch((function(e){t(e)}))}))):Ff(e)?(t=e,new Promise((function(e,n){var r=t.subscribe({next:function(t){e(t),r.unsubscribe()},error:n,complete:function(){n(new Error("no value resolved"))}})}))):e;var t,n}))}function qf(e,t){var n;return!(!(null===(n=null==e?void 0:e.type)||void 0===n?void 0:n.displayName)||e.type.displayName!==t.displayName)||e.type===t}var Uf=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){function __(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(__.prototype=n.prototype,new __)}}(),Gf=function(){return Gf=Object.assign||function(e){for(var t,n=1,r=arguments.length;n(0,r.useContext)(od),sd=e=>{var t,n,i;let{children:o}=e;const{queryParams:a,setQueryParams:s}=id(),c=null!==(t=window&&(null===(n=window)||void 0===n||null===(i=n.localStorage)||void 0===i?void 0:i.getItem("graphiql:variables")))&&void 0!==t?t:null,[l,u]=(0,r.useState)((()=>{var e;let t="",n=null!==(e=a.query)&&void 0!==e?e:null;n&&(t=ed().decompressFromEncodedURIComponent(n),null===t&&(t=n));try{t=(0,nd.print)((0,nd.parse)(t))}catch(e){var r,i,o;t=null!==(r=null===(i=window)||void 0===i||null===(o=i.localStorage)||void 0===o?void 0:o.getItem("graphiql:query"))&&void 0!==r?r:null}return t})()),[p,f]=(0,r.useState)(c),[d,h]=(0,r.useState)((()=>{var e,t;const n=null!==(e=null===(t=wpGraphiQLSettings)||void 0===t?void 0:t.externalFragments)&&void 0!==e?e:null;if(!n)return[];const r=[];return n.map((e=>{let t,n;try{var i,o;t=td(e),n=null!==(i=null===(o=t)||void 0===o?void 0:o.definitions[0])&&void 0!==i?i:null}catch(e){}n&&r.push(n)})),r})()),m=rd.applyFilters("graphiql_context_default_value",{query:l,setQuery:async e=>{const t=l;rd.doAction("graphiql_update_query",{currentQuery:t,newQuery:e});let n,r,i=!1;if(null!==e&&e===l)return;if(null===e||""===e)i=!0;else{r=ed().decompressFromEncodedURIComponent(e),n=null===r?ed().compressToEncodedURIComponent(e):e;try{(0,nd.parse)(e),i=!0}catch(t){return void console.warn({error:{e:t,newQuery:e}})}}if(!i)return;var o;window&&window.localStorage&&""!==e&&null!==e&&(null===(o=window)||void 0===o||o.localStorage.setItem("graphiql:query",e));const c={...a,query:n};JSON.stringify(c!==JSON.stringify(a))&&s(c),t!==e&&await u(e)},variables:p,setVariables:e=>{window&&window.localStorage&&window.localStorage.setItem("graphiql:variables",e),f(e)},externalFragments:d,setExternalFragments:h});return(0,r.createElement)(od.Provider,{value:m},o)},{hooks:cd}=wpGraphiQL;var ld=e=>{const{graphiql:t}=e;const n=ad(),i={...e,GraphiQL:Df,graphiqlContext:n},o=cd.applyFilters("graphiql_toolbar_buttons",[{label:"Prettify",title:"Prettify Query (Shift-Ctrl-P)",onClick:e=>{e().handlePrettifyQuery()}},{label:"History",title:"Show History",onClick:e=>{e().handleToggleHistory()}}],i),a=cd.applyFilters("graphiql_toolbar_before_buttons",[],i),s=cd.applyFilters("graphiql_toolbar_after_buttons",[],i);return(0,r.createElement)("div",{"data-testid":"graphiql-toolbar",style:{display:"flex"}},a.length>0?a:null,o&&o.length&&o.map(((e,n)=>{const{label:i,title:o,onClick:a}=e;return(0,r.createElement)(Df.Button,{"data-testid":i,key:n,onClick:()=>{a(t)},label:i,title:o})})),s.length>0?s:null)};const{hooks:ud,useAppContext:pd,GraphQL:fd}=wpGraphiQL,{parse:dd,specifiedRules:hd}=fd,md=gc.div` - display: flex; - .topBar { - height: 50px; - } - .doc-explorer-title, - .history-title { - padding-top: 5px; - overflow: hidden; - } - .doc-explorer-back { - overflow: hidden; - } - height: 100%; - display: flex; - flex-direction: row; - margin: 0; - overflow: hidden; - width: 100%; - .graphiql-container { - border: 1px solid #ccc; - } - .graphiql-container .execute-button-wrap { - margin: 0 14px; - } - padding: 20px; -`,vd=e=>{try{return JSON.parse(e)&&!!e}catch(e){return!1}},yd=()=>{let e=(0,r.useRef)(null);const t=pd(),n=ad(),{query:i,setQuery:o,externalFragments:a,variables:s,setVariables:c}=n,{endpoint:l,nonce:u,schema:p,setSchema:f}=t;let d=((e,t)=>{const{nonce:n}=t;return t=>{const r={method:"POST",headers:{Accept:"application/json","content-type":"application/json","X-WP-Nonce":n},body:JSON.stringify(t),credentials:"include"};return fetch(e,r).then((e=>e.json()))}})(l,{nonce:u});d=ud.applyFilters("graphiql_fetcher",d,t);const h=ud.applyFilters("graphiql_before_graphiql",[],{...t,...n}),m=ud.applyFilters("graphiql_after_graphiql",[],{...t,...n});return(0,r.createElement)(md,{"data-testid":"wp-graphiql-wrapper",id:"wp-graphiql-wrapper"},h.length>0?h:null,(0,r.createElement)(zf,{ref:t=>{e=t},fetcher:e=>d(e),schema:p,query:i,onEditQuery:e=>{let t=!1;if(e!==i){if(null===e||""===e)t=!0;else try{dd(e),t=!0}catch(e){return}t&&o(e)}},onEditVariables:e=>{vd(e)&&c(e)},variables:vd(s)?s:null,validationRules:hd,readOnly:!1,externalFragments:a,headerEditorEnabled:!1,onSchemaChange:e=>{p!==e&&f(e)}},(0,r.createElement)(zf.Toolbar,null,(0,r.createElement)(ld,{graphiql:()=>e})),(0,r.createElement)(zf.Logo,null,(0,r.createElement)(r.Fragment,null))),m.length>0?m:null)};var gd=()=>{const e=pd(),{schema:t}=e;return t?(0,r.createElement)(sd,{appContext:e},(0,r.createElement)(yd,null)):(0,r.createElement)(Xf,{style:{margin:"50px"}})},bd=function(e,t){return bd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},bd(e,t)};function Ed(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}bd(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var wd=function(){return wd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]=Dd){var t=console[e]||console.log;return t.apply(console,arguments)}}}function Pd(e){try{return e()}catch(e){}}!function(e){e.debug=Id("debug"),e.log=Id("log"),e.warn=Id("warn"),e.error=Id("error")}(Ad||(Ad={}));var Rd=Pd((function(){return globalThis}))||Pd((function(){return window}))||Pd((function(){return self}))||Pd((function(){return global}))||Pd((function(){return Pd.constructor("return this")()})),__="__",Md=[__,__].join("DEV"),jd=function(){try{return Boolean(__DEV__)}catch(e){return Object.defineProperty(Rd,Md,{value:"production"!==Pd((function(){return"production"})),enumerable:!1,configurable:!0,writable:!0}),Rd[Md]}}();function Fd(e){try{return e()}catch(e){}}var Vd=Fd((function(){return globalThis}))||Fd((function(){return window}))||Fd((function(){return self}))||Fd((function(){return global}))||Fd((function(){return Fd.constructor("return this")()})),Qd=!1;function qd(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n1,i=!1,o=arguments[1],a=o;return new n((function(n){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||r)try{a=e(a,t)}catch(e){return n.error(e)}else a=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(a),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[Hd]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=Yd(t,Hd);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Xd(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(Kd("iterator")&&(r=Yd(t,$d)))return new n((function(e){eh((function(){if(!e.closed){for(var n,i=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return qd(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?qd(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){eh((function(){if(!e.closed){for(var n=0;n0){var r=n.connection.filter?n.connection.filter:[];r.sort();var i={};return r.forEach((function(e){i[e]=t[e]})),"".concat(n.connection.key,"(").concat(yh(i),")")}return n.connection.key}var o=e;if(t){var a=yh(t);o+="(".concat(a,")")}return n&&Object.keys(n).forEach((function(e){-1===mh.indexOf(e)&&(n[e]&&Object.keys(n[e]).length?o+="@".concat(e,"(").concat(yh(n[e]),")"):o+="@".concat(e))})),o}),{setStringify:function(e){var t=yh;return yh=e,t}}),yh=function(e){return JSON.stringify(e,gh)};function gh(e,t){return ch(t)&&!Array.isArray(t)&&(t=Object.keys(t).sort().reduce((function(e,n){return e[n]=t[n],e}),{})),t}function bh(e,t){if(e.arguments&&e.arguments.length){var n={};return e.arguments.forEach((function(e){var r=e.name,i=e.value;return hh(n,r,i,t)})),n}return null}function Eh(e){return e.alias?e.alias.value:e.name.value}function wh(e,t,n){if("string"==typeof e.__typename)return e.__typename;for(var r=0,i=t.selections;r=300&&Fh(e,t,"Response not successful: Received status code ".concat(e.status)),Array.isArray(t)||Vh.call(t,"data")||Vh.call(t,"errors")||Fh(e,t,"Server response was missing for query '".concat(Array.isArray(i)?i.map((function(e){return e.operationName})):i.operationName,"'.")),t}))})).then((function(e){return n.next(e),n.complete(),e})).catch((function(e){"AbortError"!==e.name&&(e.result&&e.result.errors&&e.result.data&&n.next(e.result),n.error(e))})),function(){d&&d.abort()}}))}))},zh=function(e){function t(t){void 0===t&&(t={});var n=e.call(this,Kh(t).request)||this;return n.options=t,n}return Ed(t,e),t}(Rh),$h=Object.prototype,Hh=$h.toString,Wh=$h.hasOwnProperty,Yh=Function.prototype.toString,Jh=new Map;function Xh(e,t){try{return Zh(e,t)}finally{Jh.clear()}}function Zh(e,t){if(e===t)return!0;var n,r,i,o=Hh.call(e);if(o!==Hh.call(t))return!1;switch(o){case"[object Array]":if(e.length!==t.length)return!1;case"[object Object]":if(rm(e,t))return!0;var a=em(e),s=em(t),c=a.length;if(c!==s.length)return!1;for(var l=0;l=0&&n.indexOf(r,i)===i))}return!1}function em(e){return Object.keys(e).filter(tm,e)}function tm(e){return void 0!==this[e]}var nm="{ [native code] }";function rm(e,t){var n=Jh.get(e);if(n){if(n.has(t))return!0}else Jh.set(e,n=new Set);return n.add(t),!1}var im=function(){return Object.create(null)},om=Array.prototype,am=om.forEach,sm=om.slice,cm=function(){function e(e,t){void 0===e&&(e=!0),void 0===t&&(t=im),this.weakness=e,this.makeData=t}return e.prototype.lookup=function(){for(var e=[],t=0;t-1}))}function mm(e){return e&&hm(["client"],e)&&hm(["export"],e)}Pd((function(){return window.document.createElement})),Pd((function(){return navigator.userAgent.indexOf("jsdom")>=0}));var vm=Object.prototype.hasOwnProperty;function ym(){for(var e=[],t=0;t1)for(var r=new Em,i=1;i0||!1}function jm(e,t,n){var r=0;return e.forEach((function(n,i){t.call(this,n,i,e)&&(e[r++]=n)}),n),e.length=r,e}var Fm={kind:"Field",name:{kind:"Name",value:"__typename"}};function Vm(e,t){return e.selectionSet.selections.every((function(e){return"FragmentSpread"===e.kind&&Vm(t[e.name.value],t)}))}function Qm(e){return Vm(Oh(e)||function(e){__DEV__?Ad("Document"===e.kind,'Expecting a parsed GraphQL document. Perhaps you need to wrap the query string in a "gql" tag? http://docs.apollostack.com/apollo-client/core.html#gql'):Ad("Document"===e.kind,48),__DEV__?Ad(e.definitions.length<=1,"Fragment must have exactly one definition."):Ad(e.definitions.length<=1,49);var t=e.definitions[0];return __DEV__?Ad("FragmentDefinition"===t.kind,"Must be a fragment definition."):Ad("FragmentDefinition"===t.kind,50),t}(e),uh(xh(e)))?null:e}function qm(e){return function(t){return e.some((function(e){return e.name&&e.name===t.name.value||e.test&&e.test(t)}))}}function Um(e,t){var n=Object.create(null),r=[],i=Object.create(null),o=[],a=Qm((0,Iu.visit)(t,{Variable:{enter:function(e,t,r){"VariableDefinition"!==r.kind&&(n[e.name.value]=!0)}},Field:{enter:function(t){if(e&&t.directives&&e.some((function(e){return e.remove}))&&t.directives&&t.directives.some(qm(e)))return t.arguments&&t.arguments.forEach((function(e){"Variable"===e.value.kind&&r.push({name:e.value.name.value})})),t.selectionSet&&Km(t.selectionSet).forEach((function(e){o.push({name:e.name.value})})),null}},FragmentSpread:{enter:function(e){i[e.name.value]=!0}},Directive:{enter:function(t){if(qm(e)(t))return null}}}));return a&&jm(r,(function(e){return!!e.name&&!n[e.name]})).length&&(a=function(e,t){var n=function(e){return function(t){return e.some((function(e){return t.value&&"Variable"===t.value.kind&&t.value.name&&(e.name===t.value.name.value||e.test&&e.test(t))}))}}(e);return Qm((0,Iu.visit)(t,{OperationDefinition:{enter:function(t){return wd(wd({},t),{variableDefinitions:t.variableDefinitions?t.variableDefinitions.filter((function(t){return!e.some((function(e){return e.name===t.variable.name.value}))})):[]})}},Field:{enter:function(t){if(e.some((function(e){return e.remove}))){var r=0;if(t.arguments&&t.arguments.forEach((function(e){n(e)&&(r+=1)})),1===r)return null}}},Argument:{enter:function(e){if(n(e))return null}}}))}(r,a)),a&&jm(o,(function(e){return!!e.name&&!i[e.name]})).length&&(a=function(e,t){function n(t){if(e.some((function(e){return e.name===t.name.value})))return null}return Qm((0,Iu.visit)(t,{FragmentSpread:{enter:n},FragmentDefinition:{enter:n}}))}(o,a)),a}var Gm=Object.assign((function(e){return(0,Iu.visit)(e,{SelectionSet:{enter:function(e,t,n){if(!n||"OperationDefinition"!==n.kind){var r=e.selections;if(r&&!r.some((function(e){return Th(e)&&("__typename"===e.name.value||0===e.name.value.lastIndexOf("__",0))}))){var i=n;if(!(Th(i)&&i.directives&&i.directives.some((function(e){return"export"===e.name.value}))))return wd(wd({},e),{selections:Od(Od([],r,!0),[Fm],!1)})}}}}})}),{added:function(e){return e===Fm}}),Bm={test:function(e){var t="connection"===e.name.value;return t&&(e.arguments&&e.arguments.some((function(e){return"key"===e.name.value}))||__DEV__&&Ad.warn("Removing an @connection directive even though it does not have a key. You may want to use the key parameter to specify a store key.")),t}};function Km(e){var t=[];return e.selections.forEach((function(e){(Th(e)||_h(e))&&e.selectionSet?Km(e.selectionSet).forEach((function(e){return t.push(e)})):"FragmentSpread"===e.kind&&t.push(e)})),t}function zm(e){return"query"===Nh(e).operation?e:(0,Iu.visit)(e,{OperationDefinition:{enter:function(e){return wd(wd({},e),{operation:"query"})}}})}var $m=new Map;function Hm(e){var t=$m.get(e)||1;return $m.set(e,t+1),"".concat(e,":").concat(t,":").concat(Math.random().toString(36).slice(2))}function Wm(e,t,n){var r=[];e.forEach((function(e){return e[t]&&r.push(e)})),r.forEach((function(e){return e[t](n)}))}function Ym(e){function t(t){Object.defineProperty(e,t,{value:sh})}return pm&&Symbol.species&&t(Symbol.species),t("@@species"),e}function Jm(e){return e&&"function"==typeof e.then}var Xm=function(e){function t(t){var n=e.call(this,(function(e){return n.addObserver(e),function(){return n.removeObserver(e)}}))||this;return n.observers=new Set,n.addCount=0,n.promise=new Promise((function(e,t){n.resolve=e,n.reject=t})),n.handlers={next:function(e){null!==n.sub&&(n.latest=["next",e],Wm(n.observers,"next",e))},error:function(e){var t=n.sub;null!==t&&(t&&setTimeout((function(){return t.unsubscribe()})),n.sub=null,n.latest=["error",e],n.reject(e),Wm(n.observers,"error",e))},complete:function(){var e=n.sub;if(null!==e){var t=n.sources.shift();t?Jm(t)?t.then((function(e){return n.sub=e.subscribe(n.handlers)})):n.sub=t.subscribe(n.handlers):(e&&setTimeout((function(){return e.unsubscribe()})),n.sub=null,n.latest&&"next"===n.latest[0]?n.resolve(n.latest[1]):n.resolve(),Wm(n.observers,"complete"))}}},n.cancel=function(e){n.reject(e),n.sources=[],n.handlers.complete()},n.promise.catch((function(e){})),"function"==typeof t&&(t=[new sh(t)]),Jm(t)?t.then((function(e){return n.start(e)}),n.handlers.error):n.start(t),n}return Ed(t,e),t.prototype.start=function(e){void 0===this.sub&&(this.sources=Array.from(e),this.handlers.complete())},t.prototype.deliverLastMessage=function(e){if(this.latest){var t=this.latest[0],n=e[t];n&&n.call(e,this.latest[1]),null===this.sub&&"next"===t&&e.complete&&e.complete()}},t.prototype.addObserver=function(e){this.observers.has(e)||(this.deliverLastMessage(e),this.observers.add(e),++this.addCount)},t.prototype.removeObserver=function(e,t){this.observers.delete(e)&&--this.addCount<1&&!t&&this.handlers.complete()},t.prototype.cleanup=function(e){var t=this,n=!1,r=function(){n||(n=!0,t.observers.delete(i),e())},i={next:r,error:r,complete:r},o=this.addCount;this.addObserver(i),this.addCount=o},t}(sh);function Zm(e){return Array.isArray(e)&&e.length>0}Ym(Xm);var ev,tv=function(e){function t(n){var r,i,o=n.graphQLErrors,a=n.clientErrors,s=n.networkError,c=n.errorMessage,l=n.extraInfo,u=e.call(this,c)||this;return u.graphQLErrors=o||[],u.clientErrors=a||[],u.networkError=s||null,u.message=c||(i="",(Zm((r=u).graphQLErrors)||Zm(r.clientErrors))&&(r.graphQLErrors||[]).concat(r.clientErrors||[]).forEach((function(e){var t=e?e.message:"Error message not found.";i+="".concat(t,"\n")})),r.networkError&&(i+="".concat(r.networkError.message,"\n")),i=i.replace(/\n$/,"")),u.extraInfo=l,u.__proto__=t.prototype,u}return Ed(t,e),t}(Error);function nv(e){return!!e&&e<7}!function(e){e[e.loading=1]="loading",e[e.setVariables=2]="setVariables",e[e.fetchMore=3]="fetchMore",e[e.refetch=4]="refetch",e[e.poll=6]="poll",e[e.ready=7]="ready",e[e.error=8]="error"}(ev||(ev={}));var rv=Object.prototype.toString;function iv(e){return ov(e)}function ov(e,t){switch(rv.call(e)){case"[object Array]":if((t=t||new Map).has(e))return t.get(e);var n=e.slice(0);return t.set(e,n),n.forEach((function(e,r){n[r]=ov(e,t)})),n;case"[object Object]":if((t=t||new Map).has(e))return t.get(e);var r=Object.create(Object.getPrototypeOf(e));return t.set(e,r),Object.keys(e).forEach((function(n){r[n]=ov(e[n],t)})),r;default:return e}}var av=Object.assign,sv=Object.hasOwnProperty,cv=function(e){function t(t){var n=t.queryManager,r=t.queryInfo,i=t.options,o=e.call(this,(function(e){try{var t=e._subscription._observer;t&&!t.error&&(t.error=uv)}catch(e){}var n=!o.observers.size;o.observers.add(e);var r=o.last;return r&&r.error?e.error&&e.error(r.error):r&&r.result&&e.next&&e.next(r.result),n&&o.reobserve().catch((function(){})),function(){o.observers.delete(e)&&!o.observers.size&&o.tearDownQuery()}}))||this;o.observers=new Set,o.subscriptions=new Set,o.queryInfo=r,o.queryManager=n,o.isTornDown=!1;var a=n.defaultOptions.watchQuery,s=(void 0===a?{}:a).fetchPolicy,c=void 0===s?"cache-first":s,l=i.fetchPolicy,u=void 0===l?c:l,p=i.initialFetchPolicy,f=void 0===p?"standby"===u?c:u:p;o.options=wd(wd({},i),{initialFetchPolicy:f,fetchPolicy:u}),o.queryId=r.queryId||n.generateQueryId();var d=Oh(o.query);return o.queryName=d&&d.name&&d.name.value,o}return Ed(t,e),Object.defineProperty(t.prototype,"query",{get:function(){return this.queryManager.transform(this.options.query).document},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"variables",{get:function(){return this.options.variables},enumerable:!1,configurable:!0}),t.prototype.result=function(){var e=this;return new Promise((function(t,n){var r={next:function(n){t(n),e.observers.delete(r),e.observers.size||e.queryManager.removeQuery(e.queryId),setTimeout((function(){i.unsubscribe()}),0)},error:n},i=e.subscribe(r)}))},t.prototype.getCurrentResult=function(e){void 0===e&&(e=!0);var t=this.getLastResult(!0),n=this.queryInfo.networkStatus||t&&t.networkStatus||ev.ready,r=wd(wd({},t),{loading:nv(n),networkStatus:n}),i=this.options.fetchPolicy,o=void 0===i?"cache-first":i;if("network-only"===o||"no-cache"===o||"standby"===o||this.queryManager.transform(this.options.query).hasForcedResolvers);else{var a=this.queryInfo.getDiff();(a.complete||this.options.returnPartialData)&&(r.data=a.result),Xh(r.data,{})&&(r.data=void 0),a.complete?(delete r.partial,!a.complete||r.networkStatus!==ev.loading||"cache-first"!==o&&"cache-only"!==o||(r.networkStatus=ev.ready,r.loading=!1)):r.partial=!0,!__DEV__||a.complete||this.options.partialRefetch||r.loading||r.data||r.error||pv(a.missing)}return e&&this.updateLastResult(r),r},t.prototype.isDifferentFromLastResult=function(e){return!this.last||!Xh(this.last.result,e)},t.prototype.getLast=function(e,t){var n=this.last;if(n&&n[e]&&(!t||Xh(n.variables,this.variables)))return n[e]},t.prototype.getLastResult=function(e){return this.getLast("result",e)},t.prototype.getLastError=function(e){return this.getLast("error",e)},t.prototype.resetLastResults=function(){delete this.last,this.isTornDown=!1},t.prototype.resetQueryStoreErrors=function(){this.queryManager.resetErrors(this.queryId)},t.prototype.refetch=function(e){var t,n={pollInterval:0},r=this.options.fetchPolicy;if(n.fetchPolicy="cache-and-network"===r?r:"no-cache"===r?"no-cache":"network-only",__DEV__&&e&&sv.call(e,"variables")){var i=Ch(this.query),o=i.variableDefinitions;o&&o.some((function(e){return"variables"===e.variable.name.value}))||__DEV__&&Ad.warn("Called refetch(".concat(JSON.stringify(e),") for query ").concat((null===(t=i.name)||void 0===t?void 0:t.value)||JSON.stringify(i),", which does not declare a $variables variable.\nDid you mean to call refetch(variables) instead of refetch({ variables })?"))}return e&&!Xh(this.options.variables,e)&&(n.variables=this.options.variables=wd(wd({},this.options.variables),e)),this.queryInfo.resetLastWrite(),this.reobserve(n,ev.refetch)},t.prototype.fetchMore=function(e){var t=this,n=wd(wd({},e.query?e:wd(wd(wd(wd({},this.options),{query:this.query}),e),{variables:wd(wd({},this.options.variables),e.variables)})),{fetchPolicy:"no-cache"}),r=this.queryManager.generateQueryId(),i=this.queryInfo,o=i.networkStatus;i.networkStatus=ev.fetchMore,n.notifyOnNetworkStatusChange&&this.observe();var a=new Set;return this.queryManager.fetchQuery(r,n,ev.fetchMore).then((function(s){return t.queryManager.removeQuery(r),i.networkStatus===ev.fetchMore&&(i.networkStatus=o),t.queryManager.cache.batch({update:function(r){var i=e.updateQuery;i?r.updateQuery({query:t.query,variables:t.variables,returnPartialData:!0,optimistic:!1},(function(e){return i(e,{fetchMoreResult:s.data,variables:n.variables})})):r.writeQuery({query:n.query,variables:n.variables,data:s.data})},onWatchUpdated:function(e){a.add(e.query)}}),s})).finally((function(){a.has(t.query)||lv(t)}))},t.prototype.subscribeToMore=function(e){var t=this,n=this.queryManager.startGraphQLSubscription({query:e.document,variables:e.variables,context:e.context}).subscribe({next:function(n){var r=e.updateQuery;r&&t.updateQuery((function(e,t){var i=t.variables;return r(e,{subscriptionData:n,variables:i})}))},error:function(t){e.onError?e.onError(t):__DEV__&&Ad.error("Unhandled GraphQL subscription error",t)}});return this.subscriptions.add(n),function(){t.subscriptions.delete(n)&&n.unsubscribe()}},t.prototype.setOptions=function(e){return this.reobserve(e)},t.prototype.setVariables=function(e){return Xh(this.variables,e)?this.observers.size?this.result():Promise.resolve():(this.options.variables=e,this.observers.size?this.reobserve({fetchPolicy:this.options.initialFetchPolicy,variables:e},ev.setVariables):Promise.resolve())},t.prototype.updateQuery=function(e){var t=this.queryManager,n=e(t.cache.diff({query:this.options.query,variables:this.variables,returnPartialData:!0,optimistic:!1}).result,{variables:this.variables});n&&(t.cache.writeQuery({query:this.options.query,data:n,variables:this.variables}),t.broadcastQueries())},t.prototype.startPolling=function(e){this.options.pollInterval=e,this.updatePolling()},t.prototype.stopPolling=function(){this.options.pollInterval=0,this.updatePolling()},t.prototype.applyNextFetchPolicy=function(e,t){if(t.nextFetchPolicy){var n=t.fetchPolicy,r=void 0===n?"cache-first":n,i=t.initialFetchPolicy,o=void 0===i?r:i;"standby"===r||("function"==typeof t.nextFetchPolicy?t.fetchPolicy=t.nextFetchPolicy(r,{reason:e,options:t,observable:this,initialFetchPolicy:o}):t.fetchPolicy="variables-changed"===e?o:t.nextFetchPolicy)}return t.fetchPolicy},t.prototype.fetch=function(e,t){return this.queryManager.setObservableQuery(this),this.queryManager.fetchQueryObservable(this.queryId,e,t)},t.prototype.updatePolling=function(){var e=this;if(!this.queryManager.ssrMode){var t=this.pollingInfo,n=this.options.pollInterval;if(n){if(!t||t.interval!==n){__DEV__?Ad(n,"Attempted to start a polling query without a polling interval."):Ad(n,10),(t||(this.pollingInfo={})).interval=n;var r=function(){e.pollingInfo&&(nv(e.queryInfo.networkStatus)?i():e.reobserve({fetchPolicy:"network-only"},ev.poll).then(i,i))},i=function(){var t=e.pollingInfo;t&&(clearTimeout(t.timeout),t.timeout=setTimeout(r,t.interval))};i()}}else t&&(clearTimeout(t.timeout),delete this.pollingInfo)}},t.prototype.updateLastResult=function(e,t){return void 0===t&&(t=this.variables),this.last=wd(wd({},this.last),{result:this.queryManager.assumeImmutableResults?e:iv(e),variables:t}),Zm(e.errors)||delete this.last.error,this.last},t.prototype.reobserve=function(e,t){var n=this;this.isTornDown=!1;var r=t===ev.refetch||t===ev.fetchMore||t===ev.poll,i=this.options.variables,o=this.options.fetchPolicy,a=fm(this.options,e||{}),s=r?a:av(this.options,a);r||(this.updatePolling(),e&&e.variables&&!Xh(e.variables,i)&&"standby"!==s.fetchPolicy&&s.fetchPolicy===o&&(this.applyNextFetchPolicy("variables-changed",s),void 0===t&&(t=ev.setVariables)));var c=s.variables&&wd({},s.variables),l=this.fetch(s,t),u={next:function(e){n.reportResult(e,c)},error:function(e){n.reportError(e,c)}};return r||(this.concast&&this.observer&&this.concast.removeObserver(this.observer),this.concast=l,this.observer=u),l.addObserver(u),l.promise},t.prototype.observe=function(){this.reportResult(this.getCurrentResult(!1),this.variables)},t.prototype.reportResult=function(e,t){var n=this.getLastError();(n||this.isDifferentFromLastResult(e))&&((n||!e.partial||this.options.returnPartialData)&&this.updateLastResult(e,t),Wm(this.observers,"next",e))},t.prototype.reportError=function(e,t){var n=wd(wd({},this.getLastResult()),{error:e,errors:e.graphQLErrors,networkStatus:ev.error,loading:!1});this.updateLastResult(n,t),Wm(this.observers,"error",this.last.error=e)},t.prototype.hasObservers=function(){return this.observers.size>0},t.prototype.tearDownQuery=function(){this.isTornDown||(this.concast&&this.observer&&(this.concast.removeObserver(this.observer),delete this.concast,delete this.observer),this.stopPolling(),this.subscriptions.forEach((function(e){return e.unsubscribe()})),this.subscriptions.clear(),this.queryManager.stopQuery(this.queryId),this.observers.clear(),this.isTornDown=!0)},t}(sh);function lv(e){var t=e.options,n=t.fetchPolicy,r=t.nextFetchPolicy;return"cache-and-network"===n||"network-only"===n?e.reobserve({fetchPolicy:"cache-first",nextFetchPolicy:function(){return this.nextFetchPolicy=r,"function"==typeof r?r.apply(this,arguments):n}}):e.reobserve()}function uv(e){__DEV__&&Ad.error("Unhandled error",e.message,e.stack)}function pv(e){__DEV__&&e&&__DEV__&&Ad.debug("Missing cache result fields: ".concat(JSON.stringify(e)),e)}Ym(cv);var fv=null,dv={},hv=1,mv="@wry/context:Slot",vv=Array,yv=vv[mv]||function(){var e=function(){function e(){this.id=["slot",hv++,Date.now(),Math.random().toString(36).slice(2)].join(":")}return e.prototype.hasValue=function(){for(var e=fv;e;e=e.parent)if(this.id in e.slots){var t=e.slots[this.id];if(t===dv)break;return e!==fv&&(fv.slots[this.id]=t),!0}return fv&&(fv.slots[this.id]=dv),!1},e.prototype.getValue=function(){if(this.hasValue())return fv.slots[this.id]},e.prototype.withValue=function(e,t,n,r){var i,o=((i={__proto__:null})[this.id]=e,i),a=fv;fv={parent:a,slots:o};try{return t.apply(r,n)}finally{fv=a}},e.bind=function(e){var t=fv;return function(){var n=fv;try{return fv=t,e.apply(this,arguments)}finally{fv=n}}},e.noContext=function(e,t,n){if(!fv)return e.apply(n,t);var r=fv;try{return fv=null,e.apply(n,t)}finally{fv=r}},e}();try{Object.defineProperty(vv,mv,{value:vv[mv]=e,enumerable:!1,writable:!1,configurable:!1})}finally{return e}}();function gv(){}yv.bind,yv.noContext;var bv,Ev=function(){function e(e,t){void 0===e&&(e=1/0),void 0===t&&(t=gv),this.max=e,this.dispose=t,this.map=new Map,this.newest=null,this.oldest=null}return e.prototype.has=function(e){return this.map.has(e)},e.prototype.get=function(e){var t=this.getNode(e);return t&&t.value},e.prototype.getNode=function(e){var t=this.map.get(e);if(t&&t!==this.newest){var n=t.older,r=t.newer;r&&(r.older=n),n&&(n.newer=r),t.older=this.newest,t.older.newer=t,t.newer=null,this.newest=t,t===this.oldest&&(this.oldest=r)}return t},e.prototype.set=function(e,t){var n=this.getNode(e);return n?n.value=t:(n={key:e,value:t,newer:null,older:this.newest},this.newest&&(this.newest.newer=n),this.newest=n,this.oldest=this.oldest||n,this.map.set(e,n),n.value)},e.prototype.clean=function(){for(;this.oldest&&this.map.size>this.max;)this.delete(this.oldest.key)},e.prototype.delete=function(e){var t=this.map.get(e);return!!t&&(t===this.newest&&(this.newest=t.older),t===this.oldest&&(this.oldest=t.newer),t.newer&&(t.newer.older=t.older),t.older&&(t.older.newer=t.newer),this.map.delete(e),this.dispose(t.value,e),!0)},e}(),wv=new yv,Tv=Object.prototype.hasOwnProperty,_v=void 0===(bv=Array.from)?function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t}:bv;function kv(e){var t=e.unsubscribe;"function"==typeof t&&(e.unsubscribe=void 0,t())}var Ov=[];function Sv(e,t){if(!e)throw new Error(t||"assertion failure")}function xv(e){switch(e.length){case 0:throw new Error("unknown value");case 1:return e[0];case 2:throw e[1]}}var Cv=function(){function e(t){this.fn=t,this.parents=new Set,this.childValues=new Map,this.dirtyChildren=null,this.dirty=!0,this.recomputing=!1,this.value=[],this.deps=null,++e.count}return e.prototype.peek=function(){if(1===this.value.length&&!Lv(this))return Nv(this),this.value[0]},e.prototype.recompute=function(e){return Sv(!this.recomputing,"already recomputing"),Nv(this),Lv(this)?function(e,t){return Fv(e),wv.withValue(e,Av,[e,t]),function(e,t){if("function"==typeof e.subscribe)try{kv(e),e.unsubscribe=e.subscribe.apply(null,t)}catch(t){return e.setDirty(),!1}return!0}(e,t)&&function(e){e.dirty=!1,Lv(e)||Iv(e)}(e),xv(e.value)}(this,e):xv(this.value)},e.prototype.setDirty=function(){this.dirty||(this.dirty=!0,this.value.length=0,Dv(this),kv(this))},e.prototype.dispose=function(){var e=this;this.setDirty(),Fv(this),Pv(this,(function(t,n){t.setDirty(),Vv(t,e)}))},e.prototype.forget=function(){this.dispose()},e.prototype.dependOn=function(e){e.add(this),this.deps||(this.deps=Ov.pop()||new Set),this.deps.add(e)},e.prototype.forgetDeps=function(){var e=this;this.deps&&(_v(this.deps).forEach((function(t){return t.delete(e)})),this.deps.clear(),Ov.push(this.deps),this.deps=null)},e.count=0,e}();function Nv(e){var t=wv.getValue();if(t)return e.parents.add(t),t.childValues.has(e)||t.childValues.set(e,[]),Lv(e)?Rv(t,e):Mv(t,e),t}function Av(e,t){e.recomputing=!0,e.value.length=0;try{e.value[0]=e.fn.apply(null,t)}catch(t){e.value[1]=t}e.recomputing=!1}function Lv(e){return e.dirty||!(!e.dirtyChildren||!e.dirtyChildren.size)}function Dv(e){Pv(e,Rv)}function Iv(e){Pv(e,Mv)}function Pv(e,t){var n=e.parents.size;if(n)for(var r=_v(e.parents),i=0;i0&&n===t.length&&e[n-1]===t[n-1]}(n,t.value)||e.setDirty(),jv(e,t),Lv(e)||Iv(e)}function jv(e,t){var n=e.dirtyChildren;n&&(n.delete(t),0===n.size&&(Ov.length<100&&Ov.push(n),e.dirtyChildren=null))}function Fv(e){e.childValues.size>0&&e.childValues.forEach((function(t,n){Vv(e,n)})),e.forgetDeps(),Sv(null===e.dirtyChildren)}function Vv(e,t){t.parents.delete(e),e.childValues.delete(t),jv(e,t)}var Qv={setDirty:!0,dispose:!0,forget:!0};function qv(e){var t=new Map,n=e&&e.subscribe;function r(e){var r=wv.getValue();if(r){var i=t.get(e);i||t.set(e,i=new Set),r.dependOn(i),"function"==typeof n&&(kv(i),i.unsubscribe=n(e))}}return r.dirty=function(e,n){var r=t.get(e);if(r){var i=n&&Tv.call(Qv,n)?n:"setDirty";_v(r).forEach((function(e){return e[i]()})),t.delete(e),kv(r)}},r}function Uv(){var e=new cm("function"==typeof WeakMap);return function(){return e.lookupArray(arguments)}}Uv();var Gv=new Set;function Bv(e,t){void 0===t&&(t=Object.create(null));var n=new Ev(t.max||Math.pow(2,16),(function(e){return e.dispose()})),r=t.keyArgs,i=t.makeCacheKey||Uv(),o=function(){var o=i.apply(null,r?r.apply(null,arguments):arguments);if(void 0===o)return e.apply(null,arguments);var a=n.get(o);a||(n.set(o,a=new Cv(e)),a.subscribe=t.subscribe,a.forget=function(){return n.delete(o)});var s=a.recompute(Array.prototype.slice.call(arguments));return n.set(o,a),Gv.add(n),wv.hasValue()||(Gv.forEach((function(e){return e.clean()})),Gv.clear()),s};function a(e){var t=n.get(e);t&&t.setDirty()}function s(e){var t=n.get(e);if(t)return t.peek()}function c(e){return n.delete(e)}return Object.defineProperty(o,"size",{get:function(){return n.map.size},configurable:!1,enumerable:!1}),o.dirtyKey=a,o.dirty=function(){a(i.apply(null,arguments))},o.peekKey=s,o.peek=function(){return s(i.apply(null,arguments))},o.forgetKey=c,o.forget=function(){return c(i.apply(null,arguments))},o.makeCacheKey=i,o.getKey=r?function(){return i.apply(null,r.apply(null,arguments))}:i,Object.freeze(o)}var Kv=new yv,zv=new WeakMap;function $v(e){var t=zv.get(e);return t||zv.set(e,t={vars:new Set,dep:qv()}),t}function Hv(e){$v(e).vars.forEach((function(t){return t.forgetCache(e)}))}function Wv(e){var t=new Set,n=new Set,r=function(o){if(arguments.length>0){if(e!==o){e=o,t.forEach((function(e){$v(e).dep.dirty(r),Yv(e)}));var a=Array.from(n);n.clear(),a.forEach((function(t){return t(e)}))}}else{var s=Kv.getValue();s&&(i(s),$v(s).dep(r))}return e};r.onNextChange=function(e){return n.add(e),function(){n.delete(e)}};var i=r.attachCache=function(e){return t.add(e),$v(e).vars.add(r),r};return r.forgetCache=function(e){return t.delete(e)},r}function Yv(e){e.broadcastWatches&&e.broadcastWatches()}var Jv=function(){function e(e){var t=e.cache,n=e.client,r=e.resolvers,i=e.fragmentMatcher;this.cache=t,n&&(this.client=n),r&&this.addResolvers(r),i&&this.setFragmentMatcher(i)}return e.prototype.addResolvers=function(e){var t=this;this.resolvers=this.resolvers||{},Array.isArray(e)?e.forEach((function(e){t.resolvers=ym(t.resolvers,e)})):this.resolvers=ym(this.resolvers,e)},e.prototype.setResolvers=function(e){this.resolvers={},this.addResolvers(e)},e.prototype.getResolvers=function(){return this.resolvers||{}},e.prototype.runResolvers=function(e){var t=e.document,n=e.remoteResult,r=e.context,i=e.variables,o=e.onlyRunForcedResolvers,a=void 0!==o&&o;return _d(this,void 0,void 0,(function(){return kd(this,(function(e){return t?[2,this.resolveDocument(t,n.data,r,i,this.fragmentMatcher,a).then((function(e){return wd(wd({},n),{data:e.result})}))]:[2,n]}))}))},e.prototype.setFragmentMatcher=function(e){this.fragmentMatcher=e},e.prototype.getFragmentMatcher=function(){return this.fragmentMatcher},e.prototype.clientQuery=function(e){return hm(["client"],e)&&this.resolvers?e:null},e.prototype.serverQuery=function(e){return function(e){kh(e);var t=Um([{test:function(e){return"client"===e.name.value},remove:!0}],e);return t&&(t=(0,Iu.visit)(t,{FragmentDefinition:{enter:function(e){if(e.selectionSet&&e.selectionSet.selections.every((function(e){return Th(e)&&"__typename"===e.name.value})))return null}}})),t}(e)},e.prototype.prepareContext=function(e){var t=this.cache;return wd(wd({},e),{cache:t,getCacheKey:function(e){return t.identify(e)}})},e.prototype.addExportedVariables=function(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={}),_d(this,void 0,void 0,(function(){return kd(this,(function(r){return e?[2,this.resolveDocument(e,this.buildRootValueFromCache(e,t)||{},this.prepareContext(n),t).then((function(e){return wd(wd({},t),e.exportedVariables)}))]:[2,wd({},t)]}))}))},e.prototype.shouldForceResolvers=function(e){var t=!1;return(0,Iu.visit)(e,{Directive:{enter:function(e){if("client"===e.name.value&&e.arguments&&(t=e.arguments.some((function(e){return"always"===e.name.value&&"BooleanValue"===e.value.kind&&!0===e.value.value}))))return Iu.BREAK}}}),t},e.prototype.buildRootValueFromCache=function(e,t){return this.cache.diff({query:zm(e),variables:t,returnPartialData:!0,optimistic:!1}).result},e.prototype.resolveDocument=function(e,t,n,r,i,o){return void 0===n&&(n={}),void 0===r&&(r={}),void 0===i&&(i=function(){return!0}),void 0===o&&(o=!1),_d(this,void 0,void 0,(function(){var a,s,c,l,u,p,f,d,h;return kd(this,(function(m){return a=Nh(e),s=xh(e),c=uh(s),l=a.operation,u=l?l.charAt(0).toUpperCase()+l.slice(1):"Query",f=(p=this).cache,d=p.client,h={fragmentMap:c,context:wd(wd({},n),{cache:f,client:d}),variables:r,fragmentMatcher:i,defaultOperationType:u,exportedVariables:{},onlyRunForcedResolvers:o},[2,this.resolveSelectionSet(a.selectionSet,t,h).then((function(e){return{result:e,exportedVariables:h.exportedVariables}}))]}))}))},e.prototype.resolveSelectionSet=function(e,t,n){return _d(this,void 0,void 0,(function(){var r,i,o,a,s,c=this;return kd(this,(function(l){return r=n.fragmentMap,i=n.context,o=n.variables,a=[t],s=function(e){return _d(c,void 0,void 0,(function(){var s,c;return kd(this,(function(l){return dm(e,o)?Th(e)?[2,this.resolveField(e,t,n).then((function(t){var n;void 0!==t&&a.push(((n={})[Eh(e)]=t,n))}))]:(_h(e)?s=e:(s=r[e.name.value],__DEV__?Ad(s,"No fragment named ".concat(e.name.value)):Ad(s,9)),s&&s.typeCondition&&(c=s.typeCondition.name.value,n.fragmentMatcher(t,c,i))?[2,this.resolveSelectionSet(s.selectionSet,t,n).then((function(e){a.push(e)}))]:[2]):[2]}))}))},[2,Promise.all(e.selections.map(s)).then((function(){return gm(a)}))]}))}))},e.prototype.resolveField=function(e,t,n){return _d(this,void 0,void 0,(function(){var r,i,o,a,s,c,l,u,p,f=this;return kd(this,(function(d){return r=n.variables,i=e.name.value,o=Eh(e),a=i!==o,s=t[o]||t[i],c=Promise.resolve(s),n.onlyRunForcedResolvers&&!this.shouldForceResolvers(e)||(l=t.__typename||n.defaultOperationType,(u=this.resolvers&&this.resolvers[l])&&(p=u[a?i:o])&&(c=Promise.resolve(Kv.withValue(this.cache,p,[t,bh(e,r),n.context,{field:e,fragmentMap:n.fragmentMap}])))),[2,c.then((function(t){return void 0===t&&(t=s),e.directives&&e.directives.forEach((function(e){"export"===e.name.value&&e.arguments&&e.arguments.forEach((function(e){"as"===e.name.value&&"StringValue"===e.value.kind&&(n.exportedVariables[e.value.value]=t)}))})),e.selectionSet?null==t?t:Array.isArray(t)?f.resolveSubSelectedArray(e,t,n):e.selectionSet?f.resolveSelectionSet(e.selectionSet,t,n):void 0:t}))]}))}))},e.prototype.resolveSubSelectedArray=function(e,t,n){var r=this;return Promise.all(t.map((function(t){return null===t?null:Array.isArray(t)?r.resolveSubSelectedArray(e,t,n):e.selectionSet?r.resolveSelectionSet(e.selectionSet,t,n):void 0})))},e}(),Xv=new(lm?WeakMap:Map);function Zv(e,t){var n=e[t];"function"==typeof n&&(e[t]=function(){return Xv.set(e,(Xv.get(e)+1)%1e15),n.apply(this,arguments)})}function ey(e){e.notifyTimeout&&(clearTimeout(e.notifyTimeout),e.notifyTimeout=void 0)}var ty=function(){function e(e,t){void 0===t&&(t=e.generateQueryId()),this.queryId=t,this.listeners=new Set,this.document=null,this.lastRequestId=1,this.subscriptions=new Set,this.stopped=!1,this.dirty=!1,this.observableQuery=null;var n=this.cache=e.cache;Xv.has(n)||(Xv.set(n,0),Zv(n,"evict"),Zv(n,"modify"),Zv(n,"reset"))}return e.prototype.init=function(e){var t=e.networkStatus||ev.loading;return this.variables&&this.networkStatus!==ev.loading&&!Xh(this.variables,e.variables)&&(t=ev.setVariables),Xh(e.variables,this.variables)||(this.lastDiff=void 0),Object.assign(this,{document:e.document,variables:e.variables,networkError:null,graphQLErrors:this.graphQLErrors||[],networkStatus:t}),e.observableQuery&&this.setObservableQuery(e.observableQuery),e.lastRequestId&&(this.lastRequestId=e.lastRequestId),this},e.prototype.reset=function(){ey(this),this.lastDiff=void 0,this.dirty=!1},e.prototype.getDiff=function(e){void 0===e&&(e=this.variables);var t=this.getDiffOptions(e);if(this.lastDiff&&Xh(t,this.lastDiff.options))return this.lastDiff.diff;this.updateWatch(this.variables=e);var n=this.observableQuery;if(n&&"no-cache"===n.options.fetchPolicy)return{complete:!1};var r=this.cache.diff(t);return this.updateLastDiff(r,t),r},e.prototype.updateLastDiff=function(e,t){this.lastDiff=e?{diff:e,options:t||this.getDiffOptions()}:void 0},e.prototype.getDiffOptions=function(e){var t;return void 0===e&&(e=this.variables),{query:this.document,variables:e,returnPartialData:!0,optimistic:!0,canonizeResults:null===(t=this.observableQuery)||void 0===t?void 0:t.options.canonizeResults}},e.prototype.setDiff=function(e){var t=this,n=this.lastDiff&&this.lastDiff.diff;this.updateLastDiff(e),this.dirty||Xh(n&&n.result,e&&e.result)||(this.dirty=!0,this.notifyTimeout||(this.notifyTimeout=setTimeout((function(){return t.notify()}),0)))},e.prototype.setObservableQuery=function(e){var t=this;e!==this.observableQuery&&(this.oqListener&&this.listeners.delete(this.oqListener),this.observableQuery=e,e?(e.queryInfo=this,this.listeners.add(this.oqListener=function(){t.getDiff().fromOptimisticTransaction?e.observe():lv(e)})):delete this.oqListener)},e.prototype.notify=function(){var e=this;ey(this),this.shouldNotify()&&this.listeners.forEach((function(t){return t(e)})),this.dirty=!1},e.prototype.shouldNotify=function(){if(!this.dirty||!this.listeners.size)return!1;if(nv(this.networkStatus)&&this.observableQuery){var e=this.observableQuery.options.fetchPolicy;if("cache-only"!==e&&"cache-and-network"!==e)return!1}return!0},e.prototype.stop=function(){if(!this.stopped){this.stopped=!0,this.reset(),this.cancel(),this.cancel=e.prototype.cancel,this.subscriptions.forEach((function(e){return e.unsubscribe()}));var t=this.observableQuery;t&&t.stopPolling()}},e.prototype.cancel=function(){},e.prototype.updateWatch=function(e){var t=this;void 0===e&&(e=this.variables);var n=this.observableQuery;if(!n||"no-cache"!==n.options.fetchPolicy){var r=wd(wd({},this.getDiffOptions(e)),{watcher:this,callback:function(e){return t.setDiff(e)}});this.lastWatch&&Xh(r,this.lastWatch)||(this.cancel(),this.cancel=this.cache.watch(this.lastWatch=r))}},e.prototype.resetLastWrite=function(){this.lastWrite=void 0},e.prototype.shouldWrite=function(e,t){var n=this.lastWrite;return!(n&&n.dmCount===Xv.get(this.cache)&&Xh(t,n.variables)&&Xh(e.data,n.result.data))},e.prototype.markResult=function(e,t,n){var r=this;this.graphQLErrors=Zm(e.errors)?e.errors:[],this.reset(),"no-cache"===t.fetchPolicy?this.updateLastDiff({result:e.data,complete:!0},this.getDiffOptions(t.variables)):0!==n&&(ny(e,t.errorPolicy)?this.cache.performTransaction((function(i){if(r.shouldWrite(e,t.variables))i.writeQuery({query:r.document,data:e.data,variables:t.variables,overwrite:1===n}),r.lastWrite={result:e,variables:t.variables,dmCount:Xv.get(r.cache)};else if(r.lastDiff&&r.lastDiff.diff.complete)return void(e.data=r.lastDiff.diff.result);var o=r.getDiffOptions(t.variables),a=i.diff(o);r.stopped||r.updateWatch(t.variables),r.updateLastDiff(a,o),a.complete&&(e.data=a.result)})):this.lastWrite=void 0)},e.prototype.markReady=function(){return this.networkError=null,this.networkStatus=ev.ready},e.prototype.markError=function(e){return this.networkStatus=ev.error,this.lastWrite=void 0,this.reset(),e.graphQLErrors&&(this.graphQLErrors=e.graphQLErrors),e.networkError&&(this.networkError=e.networkError),e},e}();function ny(e,t){void 0===t&&(t="none");var n="ignore"===t||"all"===t,r=!Mm(e);return!r&&n&&e.data&&(r=!0),r}var ry=Object.prototype.hasOwnProperty,iy=function(){function e(e){var t=e.cache,n=e.link,r=e.defaultOptions,i=e.queryDeduplication,o=void 0!==i&&i,a=e.onBroadcast,s=e.ssrMode,c=void 0!==s&&s,l=e.clientAwareness,u=void 0===l?{}:l,p=e.localState,f=e.assumeImmutableResults;this.clientAwareness={},this.queries=new Map,this.fetchCancelFns=new Map,this.transformCache=new(lm?WeakMap:Map),this.queryIdCounter=1,this.requestIdCounter=1,this.mutationIdCounter=1,this.inFlightLinkObservables=new Map,this.cache=t,this.link=n,this.defaultOptions=r||Object.create(null),this.queryDeduplication=o,this.clientAwareness=u,this.localState=p||new Jv({cache:t}),this.ssrMode=c,this.assumeImmutableResults=!!f,(this.onBroadcast=a)&&(this.mutationStore=Object.create(null))}return e.prototype.stop=function(){var e=this;this.queries.forEach((function(t,n){e.stopQueryNoBroadcast(n)})),this.cancelPendingFetches(__DEV__?new Nd("QueryManager stopped while query was in flight"):new Nd(11))},e.prototype.cancelPendingFetches=function(e){this.fetchCancelFns.forEach((function(t){return t(e)})),this.fetchCancelFns.clear()},e.prototype.mutate=function(e){var t,n,r=e.mutation,i=e.variables,o=e.optimisticResponse,a=e.updateQueries,s=e.refetchQueries,c=void 0===s?[]:s,l=e.awaitRefetchQueries,u=void 0!==l&&l,p=e.update,f=e.onQueryUpdated,d=e.fetchPolicy,h=void 0===d?(null===(t=this.defaultOptions.mutate)||void 0===t?void 0:t.fetchPolicy)||"network-only":d,m=e.errorPolicy,v=void 0===m?(null===(n=this.defaultOptions.mutate)||void 0===n?void 0:n.errorPolicy)||"none":m,y=e.keepRootFields,g=e.context;return _d(this,void 0,void 0,(function(){var e,t,n;return kd(this,(function(s){switch(s.label){case 0:return __DEV__?Ad(r,"mutation option is required. You must specify your GraphQL document in the mutation option."):Ad(r,12),__DEV__?Ad("network-only"===h||"no-cache"===h,"Mutations support only 'network-only' or 'no-cache' fetchPolicy strings. The default `network-only` behavior automatically writes mutation results to the cache. Passing `no-cache` skips the cache write."):Ad("network-only"===h||"no-cache"===h,13),e=this.generateMutationId(),r=this.transform(r).document,i=this.getVariables(r,i),this.transform(r).hasClientExports?[4,this.localState.addExportedVariables(r,i,g)]:[3,2];case 1:i=s.sent(),s.label=2;case 2:return t=this.mutationStore&&(this.mutationStore[e]={mutation:r,variables:i,loading:!0,error:null}),o&&this.markMutationOptimistic(o,{mutationId:e,document:r,variables:i,fetchPolicy:h,errorPolicy:v,context:g,updateQueries:a,update:p,keepRootFields:y}),this.broadcastQueries(),n=this,[2,new Promise((function(s,l){return Rm(n.getObservableFromLink(r,wd(wd({},g),{optimisticResponse:o}),i,!1),(function(s){if(Mm(s)&&"none"===v)throw new tv({graphQLErrors:s.errors});t&&(t.loading=!1,t.error=null);var l=wd({},s);return"function"==typeof c&&(c=c(l)),"ignore"===v&&Mm(l)&&delete l.errors,n.markMutationResult({mutationId:e,result:l,document:r,variables:i,fetchPolicy:h,errorPolicy:v,context:g,update:p,updateQueries:a,awaitRefetchQueries:u,refetchQueries:c,removeOptimistic:o?e:void 0,onQueryUpdated:f,keepRootFields:y})})).subscribe({next:function(e){n.broadcastQueries(),s(e)},error:function(r){t&&(t.loading=!1,t.error=r),o&&n.cache.removeOptimistic(e),n.broadcastQueries(),l(r instanceof tv?r:new tv({networkError:r}))}})}))]}}))}))},e.prototype.markMutationResult=function(e,t){var n=this;void 0===t&&(t=this.cache);var r=e.result,i=[],o="no-cache"===e.fetchPolicy;if(!o&&ny(r,e.errorPolicy)){i.push({result:r.data,dataId:"ROOT_MUTATION",query:e.document,variables:e.variables});var a=e.updateQueries;a&&this.queries.forEach((function(e,o){var s=e.observableQuery,c=s&&s.queryName;if(c&&ry.call(a,c)){var l=a[c],u=n.queries.get(o),p=u.document,f=u.variables,d=t.diff({query:p,variables:f,returnPartialData:!0,optimistic:!1}),h=d.result;if(d.complete&&h){var m=l(h,{mutationResult:r,queryName:p&&Sh(p)||void 0,queryVariables:f});m&&i.push({result:m,dataId:"ROOT_QUERY",query:p,variables:f})}}}))}if(i.length>0||e.refetchQueries||e.update||e.onQueryUpdated||e.removeOptimistic){var s=[];if(this.refetchQueries({updateCache:function(t){o||i.forEach((function(e){return t.write(e)}));var a=e.update;if(a){if(!o){var s=t.diff({id:"ROOT_MUTATION",query:n.transform(e.document).asQuery,variables:e.variables,optimistic:!1,returnPartialData:!0});s.complete&&(r=wd(wd({},r),{data:s.result}))}a(t,r,{context:e.context,variables:e.variables})}o||e.keepRootFields||t.modify({id:"ROOT_MUTATION",fields:function(e,t){var n=t.fieldName,r=t.DELETE;return"__typename"===n?e:r}})},include:e.refetchQueries,optimistic:!1,removeOptimistic:e.removeOptimistic,onQueryUpdated:e.onQueryUpdated||null}).forEach((function(e){return s.push(e)})),e.awaitRefetchQueries||e.onQueryUpdated)return Promise.all(s).then((function(){return r}))}return Promise.resolve(r)},e.prototype.markMutationOptimistic=function(e,t){var n=this,r="function"==typeof e?e(t.variables):e;return this.cache.recordOptimisticTransaction((function(e){try{n.markMutationResult(wd(wd({},t),{result:{data:r}}),e)}catch(e){__DEV__&&Ad.error(e)}}),t.mutationId)},e.prototype.fetchQuery=function(e,t,n){return this.fetchQueryObservable(e,t,n).promise},e.prototype.getQueryStore=function(){var e=Object.create(null);return this.queries.forEach((function(t,n){e[n]={variables:t.variables,networkStatus:t.networkStatus,networkError:t.networkError,graphQLErrors:t.graphQLErrors}})),e},e.prototype.resetErrors=function(e){var t=this.queries.get(e);t&&(t.networkError=void 0,t.graphQLErrors=[])},e.prototype.transform=function(e){var t,n=this.transformCache;if(!n.has(e)){var r=this.cache.transformDocument(e),i=(t=this.cache.transformForLink(r),Um([Bm],kh(t))),o=this.localState.clientQuery(r),a=i&&this.localState.serverQuery(i),s={document:r,hasClientExports:mm(r),hasForcedResolvers:this.localState.shouldForceResolvers(r),clientQuery:o,serverQuery:a,defaultVars:Ah(Oh(r)),asQuery:wd(wd({},r),{definitions:r.definitions.map((function(e){return"OperationDefinition"===e.kind&&"query"!==e.operation?wd(wd({},e),{operation:"query"}):e}))})},c=function(e){e&&!n.has(e)&&n.set(e,s)};c(e),c(r),c(o),c(a)}return n.get(e)},e.prototype.getVariables=function(e,t){return wd(wd({},this.transform(e).defaultVars),t)},e.prototype.watchQuery=function(e){void 0===(e=wd(wd({},e),{variables:this.getVariables(e.query,e.variables)})).notifyOnNetworkStatusChange&&(e.notifyOnNetworkStatusChange=!1);var t=new ty(this),n=new cv({queryManager:this,queryInfo:t,options:e});return this.queries.set(n.queryId,t),t.init({document:n.query,observableQuery:n,variables:n.variables}),n},e.prototype.query=function(e,t){var n=this;return void 0===t&&(t=this.generateQueryId()),__DEV__?Ad(e.query,"query option is required. You must specify your GraphQL document in the query option."):Ad(e.query,14),__DEV__?Ad("Document"===e.query.kind,'You must wrap the query string in a "gql" tag.'):Ad("Document"===e.query.kind,15),__DEV__?Ad(!e.returnPartialData,"returnPartialData option only supported on watchQuery."):Ad(!e.returnPartialData,16),__DEV__?Ad(!e.pollInterval,"pollInterval option only supported on watchQuery."):Ad(!e.pollInterval,17),this.fetchQuery(t,e).finally((function(){return n.stopQuery(t)}))},e.prototype.generateQueryId=function(){return String(this.queryIdCounter++)},e.prototype.generateRequestId=function(){return this.requestIdCounter++},e.prototype.generateMutationId=function(){return String(this.mutationIdCounter++)},e.prototype.stopQueryInStore=function(e){this.stopQueryInStoreNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryInStoreNoBroadcast=function(e){var t=this.queries.get(e);t&&t.stop()},e.prototype.clearStore=function(e){return void 0===e&&(e={discardWatches:!0}),this.cancelPendingFetches(__DEV__?new Nd("Store reset while query was in flight (not completed in link chain)"):new Nd(18)),this.queries.forEach((function(e){e.observableQuery?e.networkStatus=ev.loading:e.stop()})),this.mutationStore&&(this.mutationStore=Object.create(null)),this.cache.reset(e)},e.prototype.getObservableQueries=function(e){var t=this;void 0===e&&(e="active");var n=new Map,r=new Map,i=new Set;return Array.isArray(e)&&e.forEach((function(e){var n;"string"==typeof e?r.set(e,!1):ch(n=e)&&"Document"===n.kind&&Array.isArray(n.definitions)?r.set(t.transform(e).document,!1):ch(e)&&e.query&&i.add(e)})),this.queries.forEach((function(t,i){var o=t.observableQuery,a=t.document;if(o){if("all"===e)return void n.set(i,o);var s=o.queryName;if("standby"===o.options.fetchPolicy||"active"===e&&!o.hasObservers())return;("active"===e||s&&r.has(s)||a&&r.has(a))&&(n.set(i,o),s&&r.set(s,!0),a&&r.set(a,!0))}})),i.size&&i.forEach((function(e){var r=Hm("legacyOneTimeQuery"),i=t.getQuery(r).init({document:e.query,variables:e.variables}),o=new cv({queryManager:t,queryInfo:i,options:wd(wd({},e),{fetchPolicy:"network-only"})});Ad(o.queryId===r),i.setObservableQuery(o),n.set(r,o)})),__DEV__&&r.size&&r.forEach((function(e,t){e||__DEV__&&Ad.warn("Unknown query ".concat("string"==typeof t?"named ":"").concat(JSON.stringify(t,null,2)," requested in refetchQueries options.include array"))})),n},e.prototype.reFetchObservableQueries=function(e){var t=this;void 0===e&&(e=!1);var n=[];return this.getObservableQueries(e?"all":"active").forEach((function(r,i){var o=r.options.fetchPolicy;r.resetLastResults(),(e||"standby"!==o&&"cache-only"!==o)&&n.push(r.refetch()),t.getQuery(i).setDiff(null)})),this.broadcastQueries(),Promise.all(n)},e.prototype.setObservableQuery=function(e){this.getQuery(e.queryId).setObservableQuery(e)},e.prototype.startGraphQLSubscription=function(e){var t=this,n=e.query,r=e.fetchPolicy,i=e.errorPolicy,o=e.variables,a=e.context,s=void 0===a?{}:a;n=this.transform(n).document,o=this.getVariables(n,o);var c=function(e){return t.getObservableFromLink(n,s,e).map((function(o){if("no-cache"!==r&&(ny(o,i)&&t.cache.write({query:n,result:o.data,dataId:"ROOT_SUBSCRIPTION",variables:e}),t.broadcastQueries()),Mm(o))throw new tv({graphQLErrors:o.errors});return o}))};if(this.transform(n).hasClientExports){var l=this.localState.addExportedVariables(n,o,s).then(c);return new sh((function(e){var t=null;return l.then((function(n){return t=n.subscribe(e)}),e.error),function(){return t&&t.unsubscribe()}}))}return c(o)},e.prototype.stopQuery=function(e){this.stopQueryNoBroadcast(e),this.broadcastQueries()},e.prototype.stopQueryNoBroadcast=function(e){this.stopQueryInStoreNoBroadcast(e),this.removeQuery(e)},e.prototype.removeQuery=function(e){this.fetchCancelFns.delete(e),this.queries.has(e)&&(this.getQuery(e).stop(),this.queries.delete(e))},e.prototype.broadcastQueries=function(){this.onBroadcast&&this.onBroadcast(),this.queries.forEach((function(e){return e.notify()}))},e.prototype.getLocalState=function(){return this.localState},e.prototype.getObservableFromLink=function(e,t,n,r){var i,o,a=this;void 0===r&&(r=null!==(i=null==t?void 0:t.queryDeduplication)&&void 0!==i?i:this.queryDeduplication);var s=this.transform(e).serverQuery;if(s){var c=this.inFlightLinkObservables,l=this.link,u={query:s,variables:n,operationName:Sh(s)||void 0,context:this.prepareContext(wd(wd({},t),{forceFetch:!r}))};if(t=u.context,r){var p=c.get(s)||new Map;c.set(s,p);var f=Im(n);if(!(o=p.get(f))){var d=new Xm([Mh(l,u)]);p.set(f,o=d),d.cleanup((function(){p.delete(f)&&p.size<1&&c.delete(s)}))}}else o=new Xm([Mh(l,u)])}else o=new Xm([sh.of({data:{}})]),t=this.prepareContext(t);var h=this.transform(e).clientQuery;return h&&(o=Rm(o,(function(e){return a.localState.runResolvers({document:h,remoteResult:e,context:t,variables:n})}))),o},e.prototype.getResultsFromLink=function(e,t,n){var r=e.lastRequestId=this.generateRequestId();return Rm(this.getObservableFromLink(e.document,n.context,n.variables),(function(i){var o=Zm(i.errors);if(r>=e.lastRequestId){if(o&&"none"===n.errorPolicy)throw e.markError(new tv({graphQLErrors:i.errors}));e.markResult(i,n,t),e.markReady()}var a={data:i.data,loading:!1,networkStatus:ev.ready};return o&&"ignore"!==n.errorPolicy&&(a.errors=i.errors,a.networkStatus=ev.error),a}),(function(t){var n=t.hasOwnProperty("graphQLErrors")?t:new tv({networkError:t});throw r>=e.lastRequestId&&e.markError(n),n}))},e.prototype.fetchQueryObservable=function(e,t,n){var r=this;void 0===n&&(n=ev.loading);var i=this.transform(t.query).document,o=this.getVariables(i,t.variables),a=this.getQuery(e),s=this.defaultOptions.watchQuery,c=t.fetchPolicy,l=void 0===c?s&&s.fetchPolicy||"cache-first":c,u=t.errorPolicy,p=void 0===u?s&&s.errorPolicy||"none":u,f=t.returnPartialData,d=void 0!==f&&f,h=t.notifyOnNetworkStatusChange,m=void 0!==h&&h,v=t.context,y=void 0===v?{}:v,g=Object.assign({},t,{query:i,variables:o,fetchPolicy:l,errorPolicy:p,returnPartialData:d,notifyOnNetworkStatusChange:m,context:y}),b=function(e){g.variables=e;var i=r.fetchQueryByPolicy(a,g,n);return"standby"!==g.fetchPolicy&&i.length>0&&a.observableQuery&&a.observableQuery.applyNextFetchPolicy("after-fetch",t),i},E=function(){return r.fetchCancelFns.delete(e)};this.fetchCancelFns.set(e,(function(e){E(),setTimeout((function(){return w.cancel(e)}))}));var w=new Xm(this.transform(g.query).hasClientExports?this.localState.addExportedVariables(g.query,g.variables,g.context).then(b):b(g.variables));return w.promise.then(E,E),w},e.prototype.refetchQueries=function(e){var t=this,n=e.updateCache,r=e.include,i=e.optimistic,o=void 0!==i&&i,a=e.removeOptimistic,s=void 0===a?o?Hm("refetchQueries"):void 0:a,c=e.onQueryUpdated,l=new Map;r&&this.getObservableQueries(r).forEach((function(e,n){l.set(n,{oq:e,lastDiff:t.getQuery(n).getDiff()})}));var u=new Map;return n&&this.cache.batch({update:n,optimistic:o&&s||!1,removeOptimistic:s,onWatchUpdated:function(e,t,n){var r=e.watcher instanceof ty&&e.watcher.observableQuery;if(r){if(c){l.delete(r.queryId);var i=c(r,t,n);return!0===i&&(i=r.refetch()),!1!==i&&u.set(r,i),i}null!==c&&l.set(r.queryId,{oq:r,lastDiff:n,diff:t})}}}),l.size&&l.forEach((function(e,n){var r,i=e.oq,o=e.lastDiff,a=e.diff;if(c){if(!a){var s=i.queryInfo;s.reset(),a=s.getDiff()}r=c(i,a,o)}c&&!0!==r||(r=i.refetch()),!1!==r&&u.set(i,r),n.indexOf("legacyOneTimeQuery")>=0&&t.stopQueryNoBroadcast(n)})),s&&this.cache.removeOptimistic(s),u},e.prototype.fetchQueryByPolicy=function(e,t,n){var r=this,i=t.query,o=t.variables,a=t.fetchPolicy,s=t.refetchWritePolicy,c=t.errorPolicy,l=t.returnPartialData,u=t.context,p=t.notifyOnNetworkStatusChange,f=e.networkStatus;e.init({document:this.transform(i).document,variables:o,networkStatus:n});var d=function(){return e.getDiff(o)},h=function(t,n){void 0===n&&(n=e.networkStatus||ev.loading);var a=t.result;!__DEV__||l||Xh(a,{})||pv(t.missing);var s=function(e){return sh.of(wd({data:e,loading:nv(n),networkStatus:n},t.complete?null:{partial:!0}))};return a&&r.transform(i).hasForcedResolvers?r.localState.runResolvers({document:i,remoteResult:{data:a},context:u,variables:o,onlyRunForcedResolvers:!0}).then((function(e){return s(e.data||void 0)})):s(a)},m="no-cache"===a?0:n===ev.refetch&&"merge"!==s?1:2,v=function(){return r.getResultsFromLink(e,m,{variables:o,context:u,fetchPolicy:a,errorPolicy:c})},y=p&&"number"==typeof f&&f!==n&&nv(n);switch(a){default:case"cache-first":return(g=d()).complete?[h(g,e.markReady())]:l||y?[h(g),v()]:[v()];case"cache-and-network":var g;return(g=d()).complete||l||y?[h(g),v()]:[v()];case"cache-only":return[h(d(),e.markReady())];case"network-only":return y?[h(d()),v()]:[v()];case"no-cache":return y?[h(e.getDiff()),v()]:[v()];case"standby":return[]}},e.prototype.getQuery=function(e){return e&&!this.queries.has(e)&&this.queries.set(e,new ty(this,e)),this.queries.get(e)},e.prototype.prepareContext=function(e){void 0===e&&(e={});var t=this.localState.prepareContext(e);return wd(wd({},t),{clientAwareness:this.clientAwareness})},e}();function oy(e,t){return fm(e,t,t.variables&&{variables:wd(wd({},e&&e.variables),t.variables)})}var ay=!1,sy=function(){function e(e){var t=this;this.resetStoreCallbacks=[],this.clearStoreCallbacks=[];var n=e.uri,r=e.credentials,i=e.headers,o=e.cache,a=e.ssrMode,s=void 0!==a&&a,c=e.ssrForceFetchDelay,l=void 0===c?0:c,u=e.connectToDevTools,p=void 0===u?"object"==typeof window&&!window.__APOLLO_CLIENT__&&__DEV__:u,f=e.queryDeduplication,d=void 0===f||f,h=e.defaultOptions,m=e.assumeImmutableResults,v=void 0!==m&&m,y=e.resolvers,g=e.typeDefs,b=e.fragmentMatcher,E=e.name,w=e.version,T=e.link;if(T||(T=n?new zh({uri:n,credentials:r,headers:i}):Rh.empty()),!o)throw __DEV__?new Nd("To initialize Apollo Client, you must specify a 'cache' property in the options object. \nFor more information, please visit: https://go.apollo.dev/c/docs"):new Nd(7);if(this.link=T,this.cache=o,this.disableNetworkFetches=s||l>0,this.queryDeduplication=d,this.defaultOptions=h||Object.create(null),this.typeDefs=g,l&&setTimeout((function(){return t.disableNetworkFetches=!1}),l),this.watchQuery=this.watchQuery.bind(this),this.query=this.query.bind(this),this.mutate=this.mutate.bind(this),this.resetStore=this.resetStore.bind(this),this.reFetchObservableQueries=this.reFetchObservableQueries.bind(this),p&&"object"==typeof window&&(window.__APOLLO_CLIENT__=this),!ay&&__DEV__&&(ay=!0,"undefined"!=typeof window&&window.document&&window.top===window.self&&!window.__APOLLO_DEVTOOLS_GLOBAL_HOOK__)){var _=window.navigator,k=_&&_.userAgent,O=void 0;"string"==typeof k&&(k.indexOf("Chrome/")>-1?O="https://chrome.google.com/webstore/detail/apollo-client-developer-t/jdkknkkbebbapilgoeccciglkfbmbnfm":k.indexOf("Firefox/")>-1&&(O="https://addons.mozilla.org/en-US/firefox/addon/apollo-developer-tools/")),O&&__DEV__&&Ad.log("Download the Apollo DevTools for a better development experience: "+O)}this.version="3.6.9",this.localState=new Jv({cache:o,client:this,resolvers:y,fragmentMatcher:b}),this.queryManager=new iy({cache:this.cache,link:this.link,defaultOptions:this.defaultOptions,queryDeduplication:d,ssrMode:s,clientAwareness:{name:E,version:w},localState:this.localState,assumeImmutableResults:v,onBroadcast:p?function(){t.devToolsHookCb&&t.devToolsHookCb({action:{},state:{queries:t.queryManager.getQueryStore(),mutations:t.queryManager.mutationStore||{}},dataWithOptimisticResults:t.cache.extract(!0)})}:void 0})}return e.prototype.stop=function(){this.queryManager.stop()},e.prototype.watchQuery=function(e){return this.defaultOptions.watchQuery&&(e=oy(this.defaultOptions.watchQuery,e)),!this.disableNetworkFetches||"network-only"!==e.fetchPolicy&&"cache-and-network"!==e.fetchPolicy||(e=wd(wd({},e),{fetchPolicy:"cache-first"})),this.queryManager.watchQuery(e)},e.prototype.query=function(e){return this.defaultOptions.query&&(e=oy(this.defaultOptions.query,e)),__DEV__?Ad("cache-and-network"!==e.fetchPolicy,"The cache-and-network fetchPolicy does not work with client.query, because client.query can only return a single result. Please use client.watchQuery to receive multiple results from the cache and the network, or consider using a different fetchPolicy, such as cache-first or network-only."):Ad("cache-and-network"!==e.fetchPolicy,8),this.disableNetworkFetches&&"network-only"===e.fetchPolicy&&(e=wd(wd({},e),{fetchPolicy:"cache-first"})),this.queryManager.query(e)},e.prototype.mutate=function(e){return this.defaultOptions.mutate&&(e=oy(this.defaultOptions.mutate,e)),this.queryManager.mutate(e)},e.prototype.subscribe=function(e){return this.queryManager.startGraphQLSubscription(e)},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!1),this.cache.readQuery(e,t)},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!1),this.cache.readFragment(e,t)},e.prototype.writeQuery=function(e){this.cache.writeQuery(e),this.queryManager.broadcastQueries()},e.prototype.writeFragment=function(e){this.cache.writeFragment(e),this.queryManager.broadcastQueries()},e.prototype.__actionHookForDevTools=function(e){this.devToolsHookCb=e},e.prototype.__requestRaw=function(e){return Mh(this.link,e)},e.prototype.resetStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!1})})).then((function(){return Promise.all(e.resetStoreCallbacks.map((function(e){return e()})))})).then((function(){return e.reFetchObservableQueries()}))},e.prototype.clearStore=function(){var e=this;return Promise.resolve().then((function(){return e.queryManager.clearStore({discardWatches:!0})})).then((function(){return Promise.all(e.clearStoreCallbacks.map((function(e){return e()})))}))},e.prototype.onResetStore=function(e){var t=this;return this.resetStoreCallbacks.push(e),function(){t.resetStoreCallbacks=t.resetStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.onClearStore=function(e){var t=this;return this.clearStoreCallbacks.push(e),function(){t.clearStoreCallbacks=t.clearStoreCallbacks.filter((function(t){return t!==e}))}},e.prototype.reFetchObservableQueries=function(e){return this.queryManager.reFetchObservableQueries(e)},e.prototype.refetchQueries=function(e){var t=this.queryManager.refetchQueries(e),n=[],r=[];t.forEach((function(e,t){n.push(t),r.push(e)}));var i=Promise.all(r);return i.queries=n,i.results=r,i.catch((function(e){__DEV__&&Ad.debug("In client.refetchQueries, Promise.all promise rejected with error ".concat(e))})),i},e.prototype.getObservableQueries=function(e){return void 0===e&&(e="active"),this.queryManager.getObservableQueries(e)},e.prototype.extract=function(e){return this.cache.extract(e)},e.prototype.restore=function(e){return this.cache.restore(e)},e.prototype.addResolvers=function(e){this.localState.addResolvers(e)},e.prototype.setResolvers=function(e){this.localState.setResolvers(e)},e.prototype.getResolvers=function(){return this.localState.getResolvers()},e.prototype.setLocalStateFragmentMatcher=function(e){this.localState.setFragmentMatcher(e)},e.prototype.setLink=function(e){this.link=this.queryManager.link=e},e}(),cy=function(){function e(){this.getFragmentDoc=Bv(lh)}return e.prototype.batch=function(e){var t,n=this,r="string"==typeof e.optimistic?e.optimistic:!1===e.optimistic?null:void 0;return this.performTransaction((function(){return t=e.update(n)}),r),t},e.prototype.recordOptimisticTransaction=function(e,t){this.performTransaction(e,t)},e.prototype.transformDocument=function(e){return e},e.prototype.identify=function(e){},e.prototype.gc=function(){return[]},e.prototype.modify=function(e){return!1},e.prototype.transformForLink=function(e){return e},e.prototype.readQuery=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(wd(wd({},e),{rootId:e.id||"ROOT_QUERY",optimistic:t}))},e.prototype.readFragment=function(e,t){return void 0===t&&(t=!!e.optimistic),this.read(wd(wd({},e),{query:this.getFragmentDoc(e.fragment,e.fragmentName),rootId:e.id,optimistic:t}))},e.prototype.writeQuery=function(e){var t=e.id,n=e.data,r=Td(e,["id","data"]);return this.write(Object.assign(r,{dataId:t||"ROOT_QUERY",result:n}))},e.prototype.writeFragment=function(e){var t=e.id,n=e.data,r=e.fragment,i=e.fragmentName,o=Td(e,["id","data","fragment","fragmentName"]);return this.write(Object.assign(o,{query:this.getFragmentDoc(r,i),dataId:t,result:n}))},e.prototype.updateQuery=function(e,t){return this.batch({update:function(n){var r=n.readQuery(e),i=t(r);return null==i?r:(n.writeQuery(wd(wd({},e),{data:i})),i)}})},e.prototype.updateFragment=function(e,t){return this.batch({update:function(n){var r=n.readFragment(e),i=t(r);return null==i?r:(n.writeFragment(wd(wd({},e),{data:i})),i)}})},e}(),ly=function(e,t,n,r){this.message=e,this.path=t,this.query=n,this.variables=r};function uy(e){return __DEV__&&(t=e,(n=new Set([t])).forEach((function(e){ch(e)&&function(e){if(__DEV__&&!Object.isFrozen(e))try{Object.freeze(e)}catch(e){if(e instanceof TypeError)return null;throw e}return e}(e)===e&&Object.getOwnPropertyNames(e).forEach((function(t){ch(e[t])&&n.add(e[t])}))}))),e;var t,n}var py=Object.create(null),fy=function(){return py},dy=Object.create(null),hy=function(){function e(e,t){var n=this;this.policies=e,this.group=t,this.data=Object.create(null),this.rootIds=Object.create(null),this.refs=Object.create(null),this.getFieldValue=function(e,t){return uy(dh(e)?n.get(e.__ref,t):e&&e[t])},this.canRead=function(e){return dh(e)?n.has(e.__ref):"object"==typeof e},this.toReference=function(e,t){if("string"==typeof e)return fh(e);if(dh(e))return e;var r=n.policies.identify(e)[0];if(r){var i=fh(r);return t&&n.merge(r,e),i}}}return e.prototype.toObject=function(){return wd({},this.data)},e.prototype.has=function(e){return void 0!==this.lookup(e,!0)},e.prototype.get=function(e,t){if(this.group.depend(e,t),wm.call(this.data,e)){var n=this.data[e];if(n&&wm.call(n,t))return n[t]}return"__typename"===t&&wm.call(this.policies.rootTypenamesById,e)?this.policies.rootTypenamesById[e]:this instanceof gy?this.parent.get(e,t):void 0},e.prototype.lookup=function(e,t){return t&&this.group.depend(e,"__exists"),wm.call(this.data,e)?this.data[e]:this instanceof gy?this.parent.lookup(e,t):this.policies.rootTypenamesById[e]?Object.create(null):void 0},e.prototype.merge=function(e,t){var n,r=this;dh(e)&&(e=e.__ref),dh(t)&&(t=t.__ref);var i="string"==typeof e?this.lookup(n=e):e,o="string"==typeof t?this.lookup(n=t):t;if(o){__DEV__?Ad("string"==typeof n,"store.merge expects a string ID"):Ad("string"==typeof n,1);var a=new Em(Ey).merge(i,o);if(this.data[n]=a,a!==i&&(delete this.refs[n],this.group.caching)){var s=Object.create(null);i||(s.__exists=1),Object.keys(o).forEach((function(e){if(!i||i[e]!==a[e]){s[e]=1;var t=Sm(e);t===e||r.policies.hasKeyArgs(a.__typename,t)||(s[t]=1),void 0!==a[e]||r instanceof gy||delete a[e]}})),!s.__typename||i&&i.__typename||this.policies.rootTypenamesById[n]!==a.__typename||delete s.__typename,Object.keys(s).forEach((function(e){return r.group.dirty(n,e)}))}}},e.prototype.modify=function(e,t){var n=this,r=this.lookup(e);if(r){var i=Object.create(null),o=!1,a=!0,s={DELETE:py,INVALIDATE:dy,isReference:dh,toReference:this.toReference,canRead:this.canRead,readField:function(t,r){return n.policies.readField("string"==typeof t?{fieldName:t,from:r||fh(e)}:t,{store:n})}};if(Object.keys(r).forEach((function(c){var l=Sm(c),u=r[c];if(void 0!==u){var p="function"==typeof t?t:t[c]||t[l];if(p){var f=p===fy?py:p(uy(u),wd(wd({},s),{fieldName:l,storeFieldName:c,storage:n.getStorage(e,c)}));f===dy?n.group.dirty(e,c):(f===py&&(f=void 0),f!==u&&(i[c]=f,o=!0,u=f))}void 0!==u&&(a=!1)}})),o)return this.merge(e,i),a&&(this instanceof gy?this.data[e]=void 0:delete this.data[e],this.group.dirty(e,"__exists")),!0}return!1},e.prototype.delete=function(e,t,n){var r,i=this.lookup(e);if(i){var o=this.getFieldValue(i,"__typename"),a=t&&n?this.policies.getStoreFieldName({typename:o,fieldName:t,args:n}):t;return this.modify(e,a?((r={})[a]=fy,r):fy)}return!1},e.prototype.evict=function(e,t){var n=!1;return e.id&&(wm.call(this.data,e.id)&&(n=this.delete(e.id,e.fieldName,e.args)),this instanceof gy&&this!==t&&(n=this.parent.evict(e,t)||n),(e.fieldName||n)&&this.group.dirty(e.id,e.fieldName||"__exists")),n},e.prototype.clear=function(){this.replace(null)},e.prototype.extract=function(){var e=this,t=this.toObject(),n=[];return this.getRootIdSet().forEach((function(t){wm.call(e.policies.rootTypenamesById,t)||n.push(t)})),n.length&&(t.__META={extraRootIds:n.sort()}),t},e.prototype.replace=function(e){var t=this;if(Object.keys(this.data).forEach((function(n){e&&wm.call(e,n)||t.delete(n)})),e){var n=e.__META,r=Td(e,["__META"]);Object.keys(r).forEach((function(e){t.merge(e,r[e])})),n&&n.extraRootIds.forEach(this.retain,this)}},e.prototype.retain=function(e){return this.rootIds[e]=(this.rootIds[e]||0)+1},e.prototype.release=function(e){if(this.rootIds[e]>0){var t=--this.rootIds[e];return t||delete this.rootIds[e],t}return 0},e.prototype.getRootIdSet=function(e){return void 0===e&&(e=new Set),Object.keys(this.rootIds).forEach(e.add,e),this instanceof gy?this.parent.getRootIdSet(e):Object.keys(this.policies.rootTypenamesById).forEach(e.add,e),e},e.prototype.gc=function(){var e=this,t=this.getRootIdSet(),n=this.toObject();t.forEach((function(r){wm.call(n,r)&&(Object.keys(e.findChildRefIds(r)).forEach(t.add,t),delete n[r])}));var r=Object.keys(n);if(r.length){for(var i=this;i instanceof gy;)i=i.parent;r.forEach((function(e){return i.delete(e)}))}return r},e.prototype.findChildRefIds=function(e){if(!wm.call(this.refs,e)){var t=this.refs[e]=Object.create(null),n=this.data[e];if(!n)return t;var r=new Set([n]);r.forEach((function(e){dh(e)&&(t[e.__ref]=!0),ch(e)&&Object.keys(e).forEach((function(t){var n=e[t];ch(n)&&r.add(n)}))}))}return this.refs[e]},e.prototype.makeCacheKey=function(){return this.group.keyMaker.lookupArray(arguments)},e}(),my=function(){function e(e,t){void 0===t&&(t=null),this.caching=e,this.parent=t,this.d=null,this.resetCaching()}return e.prototype.resetCaching=function(){this.d=this.caching?qv():null,this.keyMaker=new cm(lm)},e.prototype.depend=function(e,t){if(this.d){this.d(vy(e,t));var n=Sm(t);n!==t&&this.d(vy(e,n)),this.parent&&this.parent.depend(e,t)}},e.prototype.dirty=function(e,t){this.d&&this.d.dirty(vy(e,t),"__exists"===t?"forget":"setDirty")},e}();function vy(e,t){return t+"#"+e}function yy(e,t){wy(e)&&e.group.depend(t,"__exists")}!function(e){var t=function(e){function t(t){var n=t.policies,r=t.resultCaching,i=void 0===r||r,o=t.seed,a=e.call(this,n,new my(i))||this;return a.stump=new by(a),a.storageTrie=new cm(lm),o&&a.replace(o),a}return Ed(t,e),t.prototype.addLayer=function(e,t){return this.stump.addLayer(e,t)},t.prototype.removeLayer=function(){return this},t.prototype.getStorage=function(){return this.storageTrie.lookupArray(arguments)},t}(e);e.Root=t}(hy||(hy={}));var gy=function(e){function t(t,n,r,i){var o=e.call(this,n.policies,i)||this;return o.id=t,o.parent=n,o.replay=r,o.group=i,r(o),o}return Ed(t,e),t.prototype.addLayer=function(e,n){return new t(e,this,n,this.group)},t.prototype.removeLayer=function(e){var t=this,n=this.parent.removeLayer(e);return e===this.id?(this.group.caching&&Object.keys(this.data).forEach((function(e){var r=t.data[e],i=n.lookup(e);i?r?r!==i&&Object.keys(r).forEach((function(n){Xh(r[n],i[n])||t.group.dirty(e,n)})):(t.group.dirty(e,"__exists"),Object.keys(i).forEach((function(n){t.group.dirty(e,n)}))):t.delete(e)})),n):n===this.parent?this:n.addLayer(this.id,this.replay)},t.prototype.toObject=function(){return wd(wd({},this.parent.toObject()),this.data)},t.prototype.findChildRefIds=function(t){var n=this.parent.findChildRefIds(t);return wm.call(this.data,t)?wd(wd({},n),e.prototype.findChildRefIds.call(this,t)):n},t.prototype.getStorage=function(){for(var e=this.parent;e.parent;)e=e.parent;return e.getStorage.apply(e,arguments)},t}(hy),by=function(e){function t(t){return e.call(this,"EntityStore.Stump",t,(function(){}),new my(t.group.caching,t.group))||this}return Ed(t,e),t.prototype.removeLayer=function(){return this},t.prototype.merge=function(){return this.parent.merge.apply(this.parent,arguments)},t}(gy);function Ey(e,t,n){var r=e[n],i=t[n];return Xh(r,i)?r:i}function wy(e){return!!(e instanceof hy&&e.group.caching)}function Ty(e){return[e.selectionSet,e.objectOrReference,e.context,e.context.canonizeResults]}var _y=function(){function e(e){var t=this;this.knownResults=new(lm?WeakMap:Map),this.config=fm(e,{addTypename:!1!==e.addTypename,canonizeResults:km(e)}),this.canon=e.canon||new Dm,this.executeSelectionSet=Bv((function(e){var n,r=e.context.canonizeResults,i=Ty(e);i[3]=!r;var o=(n=t.executeSelectionSet).peek.apply(n,i);return o?r?wd(wd({},o),{result:t.canon.admit(o.result)}):o:(yy(e.context.store,e.enclosingRef.__ref),t.execSelectionSetImpl(e))}),{max:this.config.resultCacheMaxSize,keyArgs:Ty,makeCacheKey:function(e,t,n,r){if(wy(n.store))return n.store.makeCacheKey(e,dh(t)?t.__ref:t,n.varString,r)}}),this.executeSubSelectedArray=Bv((function(e){return yy(e.context.store,e.enclosingRef.__ref),t.execSubSelectedArrayImpl(e)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var t=e.field,n=e.array,r=e.context;if(wy(r.store))return r.store.makeCacheKey(t,n,r.varString)}})}return e.prototype.resetCanon=function(){this.canon=new Dm},e.prototype.diffQueryAgainstStore=function(e){var t=e.store,n=e.query,r=e.rootId,i=void 0===r?"ROOT_QUERY":r,o=e.variables,a=e.returnPartialData,s=void 0===a||a,c=e.canonizeResults,l=void 0===c?this.config.canonizeResults:c,u=this.config.cache.policies;o=wd(wd({},Ah(Ch(n))),o);var p,f=fh(i),d=this.executeSelectionSet({selectionSet:Nh(n).selectionSet,objectOrReference:f,enclosingRef:f,context:{store:t,query:n,policies:u,variables:o,varString:Im(o),canonizeResults:l,fragmentMap:uh(xh(n))}});if(d.missing&&(p=[new ly(ky(d.missing),d.missing,n,o)],!s))throw p[0];return{result:d.result,complete:!p,missing:p}},e.prototype.isFresh=function(e,t,n,r){if(wy(r.store)&&this.knownResults.get(e)===n){var i=this.executeSelectionSet.peek(n,t,r,this.canon.isKnown(e));if(i&&e===i.result)return!0}return!1},e.prototype.execSelectionSetImpl=function(e){var t=this,n=e.selectionSet,r=e.objectOrReference,i=e.enclosingRef,o=e.context;if(dh(r)&&!o.policies.rootTypenamesById[r.__ref]&&!o.store.has(r.__ref))return{result:this.canon.empty,missing:"Dangling reference to missing ".concat(r.__ref," object")};var a,s=o.variables,c=o.policies,l=o.store.getFieldValue(r,"__typename"),u=[],p=new Em;function f(e,t){var n;return e.missing&&(a=p.merge(a,((n={})[t]=e.missing,n))),e.result}this.config.addTypename&&"string"==typeof l&&!c.rootIdsByTypename[l]&&u.push({__typename:l});var d=new Set(n.selections);d.forEach((function(e){var n,h;if(dm(e,s))if(Th(e)){var m=c.readField({fieldName:e.name.value,field:e,variables:o.variables,from:r},o),v=Eh(e);void 0===m?Gm.added(e)||(a=p.merge(a,((n={})[v]="Can't find field '".concat(e.name.value,"' on ").concat(dh(r)?r.__ref+" object":"object "+JSON.stringify(r,null,2)),n))):Lm(m)?m=f(t.executeSubSelectedArray({field:e,array:m,enclosingRef:i,context:o}),v):e.selectionSet?null!=m&&(m=f(t.executeSelectionSet({selectionSet:e.selectionSet,objectOrReference:m,enclosingRef:dh(m)?m:i,context:o}),v)):o.canonizeResults&&(m=t.canon.pass(m)),void 0!==m&&u.push(((h={})[v]=m,h))}else{var y=ph(e,o.fragmentMap);y&&c.fragmentMatches(y,l)&&y.selectionSet.selections.forEach(d.add,d)}}));var h={result:gm(u),missing:a},m=o.canonizeResults?this.canon.admit(h):uy(h);return m.result&&this.knownResults.set(m.result,n),m},e.prototype.execSubSelectedArrayImpl=function(e){var t,n=this,r=e.field,i=e.array,o=e.enclosingRef,a=e.context,s=new Em;function c(e,n){var r;return e.missing&&(t=s.merge(t,((r={})[n]=e.missing,r))),e.result}return r.selectionSet&&(i=i.filter(a.store.canRead)),i=i.map((function(e,t){return null===e?null:Lm(e)?c(n.executeSubSelectedArray({field:r,array:e,enclosingRef:o,context:a}),t):r.selectionSet?c(n.executeSelectionSet({selectionSet:r.selectionSet,objectOrReference:e,enclosingRef:dh(e)?e:o,context:a}),t):(__DEV__&&function(e,t,n){if(!t.selectionSet){var r=new Set([n]);r.forEach((function(n){ch(n)&&(__DEV__?Ad(!dh(n),"Missing selection set for object of type ".concat(function(e,t){return dh(t)?e.get(t.__ref,"__typename"):t&&t.__typename}(e,n)," returned for query field ").concat(t.name.value)):Ad(!dh(n),5),Object.values(n).forEach(r.add,r))}))}}(a.store,r,e),e)})),{result:a.canonizeResults?this.canon.admit(i):i,missing:t}},e}();function ky(e){try{JSON.stringify(e,(function(e,t){if("string"==typeof t)throw t;return t}))}catch(e){return e}}var Oy=Object.create(null);function Sy(e){var t=JSON.stringify(e);return Oy[t]||(Oy[t]=Object.create(null))}function xy(e){var t=Sy(e);return t.keyFieldsFn||(t.keyFieldsFn=function(t,n){var r=function(e,t){return n.readField(t,e)},i=n.keyObject=Ny(e,(function(e){var i=Dy(n.storeObject,e,r);return void 0===i&&t!==n.storeObject&&wm.call(t,e[0])&&(i=Dy(t,e,Ly)),__DEV__?Ad(void 0!==i,"Missing field '".concat(e.join("."),"' while extracting keyFields from ").concat(JSON.stringify(t))):Ad(void 0!==i,2),i}));return"".concat(n.typename,":").concat(JSON.stringify(i))})}function Cy(e){var t=Sy(e);return t.keyArgsFn||(t.keyArgsFn=function(t,n){var r=n.field,i=n.variables,o=n.fieldName,a=Ny(e,(function(e){var n=e[0],o=n.charAt(0);if("@"!==o)if("$"!==o){if(t)return Dy(t,e)}else{var a=n.slice(1);if(i&&wm.call(i,a)){var s=e.slice(0);return s[0]=a,Dy(i,s)}}else if(r&&Zm(r.directives)){var c=n.slice(1),l=r.directives.find((function(e){return e.name.value===c})),u=l&&bh(l,i);return u&&Dy(u,e.slice(1))}})),s=JSON.stringify(a);return(t||"{}"!==s)&&(o+=":"+s),o})}function Ny(e,t){var n=new Em;return Ay(e).reduce((function(e,r){var i,o=t(r);if(void 0!==o){for(var a=r.length-1;a>=0;--a)(i={})[r[a]]=o,o=i;e=n.merge(e,o)}return e}),Object.create(null))}function Ay(e){var t=Sy(e);if(!t.paths){var n=t.paths=[],r=[];e.forEach((function(t,i){Lm(t)?(Ay(t).forEach((function(e){return n.push(r.concat(e))})),r.length=0):(r.push(t),Lm(e[i+1])||(n.push(r.slice(0)),r.length=0))}))}return t.paths}function Ly(e,t){return e[t]}function Dy(e,t,n){return n=n||Ly,Iy(t.reduce((function e(t,r){return Lm(t)?t.map((function(t){return e(t,r)})):t&&n(t,r)}),e))}function Iy(e){return ch(e)?Lm(e)?e.map(Iy):Ny(Object.keys(e).sort(),(function(t){return Dy(e,t)})):e}function Py(e){return void 0!==e.args?e.args:e.field?bh(e.field,e.variables):null}vh.setStringify(Im);var Ry=function(){},My=function(e,t){return t.fieldName},jy=function(e,t,n){return(0,n.mergeObjects)(e,t)},Fy=function(e,t){return t},Vy=function(){function e(e){this.config=e,this.typePolicies=Object.create(null),this.toBeAdded=Object.create(null),this.supertypeMap=new Map,this.fuzzySubtypes=new Map,this.rootIdsByTypename=Object.create(null),this.rootTypenamesById=Object.create(null),this.usingPossibleTypes=!1,this.config=wd({dataIdFromObject:Tm},e),this.cache=this.config.cache,this.setRootTypename("Query"),this.setRootTypename("Mutation"),this.setRootTypename("Subscription"),e.possibleTypes&&this.addPossibleTypes(e.possibleTypes),e.typePolicies&&this.addTypePolicies(e.typePolicies)}return e.prototype.identify=function(e,t){var n,r=this,i=t&&(t.typename||(null===(n=t.storeObject)||void 0===n?void 0:n.__typename))||e.__typename;if(i===this.rootTypenamesById.ROOT_QUERY)return["ROOT_QUERY"];for(var o,a=t&&t.storeObject||e,s=wd(wd({},t),{typename:i,storeObject:a,readField:t&&t.readField||function(){var e=qy(arguments,a);return r.readField(e,{store:r.cache.data,variables:e.variables})}}),c=i&&this.getTypePolicy(i),l=c&&c.keyFn||this.config.dataIdFromObject;l;){var u=l(e,s);if(!Lm(u)){o=u;break}l=xy(u)}return o=o?String(o):void 0,s.keyObject?[o,s.keyObject]:[o]},e.prototype.addTypePolicies=function(e){var t=this;Object.keys(e).forEach((function(n){var r=e[n],i=r.queryType,o=r.mutationType,a=r.subscriptionType,s=Td(r,["queryType","mutationType","subscriptionType"]);i&&t.setRootTypename("Query",n),o&&t.setRootTypename("Mutation",n),a&&t.setRootTypename("Subscription",n),wm.call(t.toBeAdded,n)?t.toBeAdded[n].push(s):t.toBeAdded[n]=[s]}))},e.prototype.updateTypePolicy=function(e,t){var n=this,r=this.getTypePolicy(e),i=t.keyFields,o=t.fields;function a(e,t){e.merge="function"==typeof t?t:!0===t?jy:!1===t?Fy:e.merge}a(r,t.merge),r.keyFn=!1===i?Ry:Lm(i)?xy(i):"function"==typeof i?i:r.keyFn,o&&Object.keys(o).forEach((function(t){var r=n.getFieldPolicy(e,t,!0),i=o[t];if("function"==typeof i)r.read=i;else{var s=i.keyArgs,c=i.read,l=i.merge;r.keyFn=!1===s?My:Lm(s)?Cy(s):"function"==typeof s?s:r.keyFn,"function"==typeof c&&(r.read=c),a(r,l)}r.read&&r.merge&&(r.keyFn=r.keyFn||My)}))},e.prototype.setRootTypename=function(e,t){void 0===t&&(t=e);var n="ROOT_"+e.toUpperCase(),r=this.rootTypenamesById[n];t!==r&&(__DEV__?Ad(!r||r===e,"Cannot change root ".concat(e," __typename more than once")):Ad(!r||r===e,3),r&&delete this.rootIdsByTypename[r],this.rootIdsByTypename[t]=n,this.rootTypenamesById[n]=t)},e.prototype.addPossibleTypes=function(e){var t=this;this.usingPossibleTypes=!0,Object.keys(e).forEach((function(n){t.getSupertypeSet(n,!0),e[n].forEach((function(e){t.getSupertypeSet(e,!0).add(n);var r=e.match(Om);r&&r[0]===e||t.fuzzySubtypes.set(e,new RegExp(e))}))}))},e.prototype.getTypePolicy=function(e){var t=this;if(!wm.call(this.typePolicies,e)){var n=this.typePolicies[e]=Object.create(null);n.fields=Object.create(null);var r=this.supertypeMap.get(e);r&&r.size&&r.forEach((function(e){var r=t.getTypePolicy(e),i=r.fields,o=Td(r,["fields"]);Object.assign(n,o),Object.assign(n.fields,i)}))}var i=this.toBeAdded[e];return i&&i.length&&i.splice(0).forEach((function(n){t.updateTypePolicy(e,n)})),this.typePolicies[e]},e.prototype.getFieldPolicy=function(e,t,n){if(e){var r=this.getTypePolicy(e).fields;return r[t]||n&&(r[t]=Object.create(null))}},e.prototype.getSupertypeSet=function(e,t){var n=this.supertypeMap.get(e);return!n&&t&&this.supertypeMap.set(e,n=new Set),n},e.prototype.fragmentMatches=function(e,t,n,r){var i=this;if(!e.typeCondition)return!0;if(!t)return!1;var o=e.typeCondition.name.value;if(t===o)return!0;if(this.usingPossibleTypes&&this.supertypeMap.has(o))for(var a=this.getSupertypeSet(t,!0),s=[a],c=function(e){var t=i.getSupertypeSet(e,!1);t&&t.size&&s.indexOf(t)<0&&s.push(t)},l=!(!n||!this.fuzzySubtypes.size),u=!1,p=0;p1?s:t}:(r=wd({},a),wm.call(r,"from")||(r.from=t)),__DEV__&&void 0===r.from&&__DEV__&&Ad.warn("Undefined 'from' passed to readField with arguments ".concat((i=Array.from(e),o=Hm("stringifyForDisplay"),JSON.stringify(i,(function(e,t){return void 0===t?o:t})).split(JSON.stringify(o)).join("")))),void 0===r.variables&&(r.variables=n),r}function Uy(e){return function(t,n){if(Lm(t)||Lm(n))throw __DEV__?new Nd("Cannot automatically merge arrays"):new Nd(4);if(ch(t)&&ch(n)){var r=e.getFieldValue(t,"__typename"),i=e.getFieldValue(n,"__typename");if(r&&i&&r!==i)return n;if(dh(t)&&Cm(n))return e.merge(t.__ref,n),t;if(Cm(t)&&dh(n))return e.merge(t,n.__ref),n;if(Cm(t)&&Cm(n))return wd(wd({},t),n)}return n}}function Gy(e,t,n){var r="".concat(t).concat(n),i=e.flavors.get(r);return i||e.flavors.set(r,i=e.clientOnly===t&&e.deferred===n?e:wd(wd({},e),{clientOnly:t,deferred:n})),i}var By=function(){function e(e,t){this.cache=e,this.reader=t}return e.prototype.writeToStore=function(e,t){var n=this,r=t.query,i=t.result,o=t.dataId,a=t.variables,s=t.overwrite,c=Oh(r),l=new Em;a=wd(wd({},Ah(c)),a);var u={store:e,written:Object.create(null),merge:function(e,t){return l.merge(e,t)},variables:a,varString:Im(a),fragmentMap:uh(xh(r)),overwrite:!!s,incomingById:new Map,clientOnly:!1,deferred:!1,flavors:new Map},p=this.processSelectionSet({result:i||Object.create(null),dataId:o,selectionSet:c.selectionSet,mergeTree:{map:new Map},context:u});if(!dh(p))throw __DEV__?new Nd("Could not identify object ".concat(JSON.stringify(i))):new Nd(6);return u.incomingById.forEach((function(t,r){var i=t.storeObject,o=t.mergeTree,a=t.fieldNodeSet,s=fh(r);if(o&&o.map.size){var c=n.applyMerges(o,s,i,u);if(dh(c))return;i=c}if(__DEV__&&!u.overwrite){var l=Object.create(null);a.forEach((function(e){e.selectionSet&&(l[e.name.value]=!0)})),Object.keys(i).forEach((function(e){(function(e){return!0===l[Sm(e)]})(e)&&!function(e){var t=o&&o.map.get(e);return Boolean(t&&t.info&&t.info.merge)}(e)&&function(e,t,n,r){var i=function(e){var t=r.getFieldValue(e,n);return"object"==typeof t&&t},o=i(e);if(o){var a=i(t);if(a&&!dh(o)&&!Xh(o,a)&&!Object.keys(o).every((function(e){return void 0!==r.getFieldValue(a,e)}))){var s=r.getFieldValue(e,"__typename")||r.getFieldValue(t,"__typename"),c=Sm(n),l="".concat(s,".").concat(c);if(!Yy.has(l)){Yy.add(l);var u=[];Lm(o)||Lm(a)||[o,a].forEach((function(e){var t=r.getFieldValue(e,"__typename");"string"!=typeof t||u.includes(t)||u.push(t)})),__DEV__&&Ad.warn("Cache data may be lost when replacing the ".concat(c," field of a ").concat(s," object.\n\nTo address this problem (which is not a bug in Apollo Client), ").concat(u.length?"either ensure all objects of type "+u.join(" and ")+" have an ID or a custom merge function, or ":"","define a custom merge function for the ").concat(l," field, so InMemoryCache can safely merge these objects:\n\n existing: ").concat(JSON.stringify(o).slice(0,1e3),"\n incoming: ").concat(JSON.stringify(a).slice(0,1e3),"\n\nFor more information about these options, please refer to the documentation:\n\n * Ensuring entity objects have IDs: https://go.apollo.dev/c/generating-unique-identifiers\n * Defining custom merge functions: https://go.apollo.dev/c/merging-non-normalized-objects\n"))}}}}(s,i,e,u.store)}))}e.merge(r,i)})),e.retain(p.__ref),p},e.prototype.processSelectionSet=function(e){var t=this,n=e.dataId,r=e.result,i=e.selectionSet,o=e.context,a=e.mergeTree,s=this.cache.policies,c=Object.create(null),l=n&&s.rootTypenamesById[n]||wh(r,i,o.fragmentMap)||n&&o.store.get(n,"__typename");"string"==typeof l&&(c.__typename=l);var u=function(){var e=qy(arguments,c,o.variables);if(dh(e.from)){var t=o.incomingById.get(e.from.__ref);if(t){var n=s.readField(wd(wd({},e),{from:t.storeObject}),o);if(void 0!==n)return n}}return s.readField(e,o)},p=new Set;this.flattenFields(i,r,o,l).forEach((function(e,n){var i,o=Eh(n),f=r[o];if(p.add(n),void 0!==f){var d=s.getStoreFieldName({typename:l,fieldName:n.name.value,field:n,variables:e.variables}),h=zy(a,d),m=t.processFieldValue(f,n,n.selectionSet?Gy(e,!1,!1):e,h),v=void 0;n.selectionSet&&(dh(m)||Cm(m))&&(v=u("__typename",m));var y=s.getMergeFunction(l,n.name.value,v);y?h.info={field:n,typename:l,merge:y}:Wy(a,d),c=e.merge(c,((i={})[d]=m,i))}else!__DEV__||e.clientOnly||e.deferred||Gm.added(n)||s.getReadFunction(l,n.name.value)||__DEV__&&Ad.error("Missing field '".concat(Eh(n),"' while writing result ").concat(JSON.stringify(r,null,2)).substring(0,1e3))}));try{var f=s.identify(r,{typename:l,selectionSet:i,fragmentMap:o.fragmentMap,storeObject:c,readField:u}),d=f[0],h=f[1];n=n||d,h&&(c=o.merge(c,h))}catch(e){if(!n)throw e}if("string"==typeof n){var m=fh(n),v=o.written[n]||(o.written[n]=[]);if(v.indexOf(i)>=0)return m;if(v.push(i),this.reader&&this.reader.isFresh(r,m,i,o))return m;var y=o.incomingById.get(n);return y?(y.storeObject=o.merge(y.storeObject,c),y.mergeTree=$y(y.mergeTree,a),p.forEach((function(e){return y.fieldNodeSet.add(e)}))):o.incomingById.set(n,{storeObject:c,mergeTree:Hy(a)?void 0:a,fieldNodeSet:p}),m}return c},e.prototype.processFieldValue=function(e,t,n,r){var i=this;return t.selectionSet&&null!==e?Lm(e)?e.map((function(e,o){var a=i.processFieldValue(e,t,n,zy(r,o));return Wy(r,o),a})):this.processSelectionSet({result:e,selectionSet:t.selectionSet,context:n,mergeTree:r}):__DEV__?iv(e):e},e.prototype.flattenFields=function(e,t,n,r){void 0===r&&(r=wh(t,e,n.fragmentMap));var i=new Map,o=this.cache.policies,a=new cm(!1);return function e(s,c){var l=a.lookup(s,c.clientOnly,c.deferred);l.visited||(l.visited=!0,s.selections.forEach((function(a){if(dm(a,n.variables)){var s=c.clientOnly,l=c.deferred;if(s&&l||!Zm(a.directives)||a.directives.forEach((function(e){var t=e.name.value;if("client"===t&&(s=!0),"defer"===t){var r=bh(e,n.variables);r&&!1===r.if||(l=!0)}})),Th(a)){var u=i.get(a);u&&(s=s&&u.clientOnly,l=l&&u.deferred),i.set(a,Gy(n,s,l))}else{var p=ph(a,n.fragmentMap);p&&o.fragmentMatches(p,r,t,n.variables)&&e(p.selectionSet,Gy(n,s,l))}}})))}(e,n),i},e.prototype.applyMerges=function(e,t,n,r,i){var o,a=this;if(e.map.size&&!dh(n)){var s,c=Lm(n)||!dh(t)&&!Cm(t)?void 0:t,l=n;c&&!i&&(i=[dh(c)?c.__ref:c]);var u=function(e,t){return Lm(e)?"number"==typeof t?e[t]:void 0:r.store.getFieldValue(e,String(t))};e.map.forEach((function(e,t){var n=u(c,t),o=u(l,t);if(void 0!==o){i&&i.push(t);var p=a.applyMerges(e,n,o,r,i);p!==o&&(s=s||new Map).set(t,p),i&&Ad(i.pop()===t)}})),s&&(n=Lm(l)?l.slice(0):wd({},l),s.forEach((function(e,t){n[t]=e})))}return e.info?this.cache.policies.runMergeFunction(t,n,e.info,r,i&&(o=r.store).getStorage.apply(o,i)):n},e}(),Ky=[];function zy(e,t){var n=e.map;return n.has(t)||n.set(t,Ky.pop()||{map:new Map}),n.get(t)}function $y(e,t){if(e===t||!t||Hy(t))return e;if(!e||Hy(e))return t;var n=e.info&&t.info?wd(wd({},e.info),t.info):e.info||t.info,r=e.map.size&&t.map.size,i={info:n,map:r?new Map:e.map.size?e.map:t.map};if(r){var o=new Set(t.map.keys());e.map.forEach((function(e,n){i.map.set(n,$y(e,t.map.get(n))),o.delete(n)})),o.forEach((function(n){i.map.set(n,$y(t.map.get(n),e.map.get(n)))}))}return i}function Hy(e){return!e||!(e.info||e.map.size)}function Wy(e,t){var n=e.map,r=n.get(t);r&&Hy(r)&&(Ky.push(r),n.delete(t))}var Yy=new Set,Jy=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.watches=new Set,n.typenameDocumentCache=new Map,n.makeVar=Wv,n.txCount=0,n.config=function(e){return fm(_m,e)}(t),n.addTypename=!!n.config.addTypename,n.policies=new Vy({cache:n,dataIdFromObject:n.config.dataIdFromObject,possibleTypes:n.config.possibleTypes,typePolicies:n.config.typePolicies}),n.init(),n}return Ed(t,e),t.prototype.init=function(){var e=this.data=new hy.Root({policies:this.policies,resultCaching:this.config.resultCaching});this.optimisticData=e.stump,this.resetResultCache()},t.prototype.resetResultCache=function(e){var t=this,n=this.storeReader;this.storeWriter=new By(this,this.storeReader=new _y({cache:this,addTypename:this.addTypename,resultCacheMaxSize:this.config.resultCacheMaxSize,canonizeResults:km(this.config),canon:e?void 0:n&&n.canon})),this.maybeBroadcastWatch=Bv((function(e,n){return t.broadcastWatch(e,n)}),{max:this.config.resultCacheMaxSize,makeCacheKey:function(e){var n=e.optimistic?t.optimisticData:t.data;if(wy(n)){var r=e.optimistic,i=e.rootId,o=e.variables;return n.makeCacheKey(e.query,e.callback,Im({optimistic:r,rootId:i,variables:o}))}}}),new Set([this.data.group,this.optimisticData.group]).forEach((function(e){return e.resetCaching()}))},t.prototype.restore=function(e){return this.init(),e&&this.data.replace(e),this},t.prototype.extract=function(e){return void 0===e&&(e=!1),(e?this.optimisticData:this.data).extract()},t.prototype.read=function(e){var t=e.returnPartialData,n=void 0!==t&&t;try{return this.storeReader.diffQueryAgainstStore(wd(wd({},e),{store:e.optimistic?this.optimisticData:this.data,config:this.config,returnPartialData:n})).result||null}catch(e){if(e instanceof ly)return null;throw e}},t.prototype.write=function(e){try{return++this.txCount,this.storeWriter.writeToStore(this.data,e)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.modify=function(e){if(wm.call(e,"id")&&!e.id)return!1;var t=e.optimistic?this.optimisticData:this.data;try{return++this.txCount,t.modify(e.id||"ROOT_QUERY",e.fields)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.diff=function(e){return this.storeReader.diffQueryAgainstStore(wd(wd({},e),{store:e.optimistic?this.optimisticData:this.data,rootId:e.id||"ROOT_QUERY",config:this.config}))},t.prototype.watch=function(e){var t,n=this;return this.watches.size||$v(t=this).vars.forEach((function(e){return e.attachCache(t)})),this.watches.add(e),e.immediate&&this.maybeBroadcastWatch(e),function(){n.watches.delete(e)&&!n.watches.size&&Hv(n),n.maybeBroadcastWatch.forget(e)}},t.prototype.gc=function(e){Im.reset();var t=this.optimisticData.gc();return e&&!this.txCount&&(e.resetResultCache?this.resetResultCache(e.resetResultIdentities):e.resetResultIdentities&&this.storeReader.resetCanon()),t},t.prototype.retain=function(e,t){return(t?this.optimisticData:this.data).retain(e)},t.prototype.release=function(e,t){return(t?this.optimisticData:this.data).release(e)},t.prototype.identify=function(e){if(dh(e))return e.__ref;try{return this.policies.identify(e)[0]}catch(e){__DEV__&&Ad.warn(e)}},t.prototype.evict=function(e){if(!e.id){if(wm.call(e,"id"))return!1;e=wd(wd({},e),{id:"ROOT_QUERY"})}try{return++this.txCount,this.optimisticData.evict(e,this.data)}finally{--this.txCount||!1===e.broadcast||this.broadcastWatches()}},t.prototype.reset=function(e){var t=this;return this.init(),Im.reset(),e&&e.discardWatches?(this.watches.forEach((function(e){return t.maybeBroadcastWatch.forget(e)})),this.watches.clear(),Hv(this)):this.broadcastWatches(),Promise.resolve()},t.prototype.removeOptimistic=function(e){var t=this.optimisticData.removeLayer(e);t!==this.optimisticData&&(this.optimisticData=t,this.broadcastWatches())},t.prototype.batch=function(e){var t,n=this,r=e.update,i=e.optimistic,o=void 0===i||i,a=e.removeOptimistic,s=e.onWatchUpdated,c=function(e){var i=n,o=i.data,a=i.optimisticData;++n.txCount,e&&(n.data=n.optimisticData=e);try{return t=r(n)}finally{--n.txCount,n.data=o,n.optimisticData=a}},l=new Set;return s&&!this.txCount&&this.broadcastWatches(wd(wd({},e),{onWatchUpdated:function(e){return l.add(e),!1}})),"string"==typeof o?this.optimisticData=this.optimisticData.addLayer(o,c):!1===o?c(this.data):c(),"string"==typeof a&&(this.optimisticData=this.optimisticData.removeLayer(a)),s&&l.size?(this.broadcastWatches(wd(wd({},e),{onWatchUpdated:function(e,t){var n=s.call(this,e,t);return!1!==n&&l.delete(e),n}})),l.size&&l.forEach((function(e){return n.maybeBroadcastWatch.dirty(e)}))):this.broadcastWatches(e),t},t.prototype.performTransaction=function(e,t){return this.batch({update:e,optimistic:t||null!==t})},t.prototype.transformDocument=function(e){if(this.addTypename){var t=this.typenameDocumentCache.get(e);return t||(t=Gm(e),this.typenameDocumentCache.set(e,t),this.typenameDocumentCache.set(t,t)),t}return e},t.prototype.broadcastWatches=function(e){var t=this;this.txCount||this.watches.forEach((function(n){return t.maybeBroadcastWatch(n,e)}))},t.prototype.broadcastWatch=function(e,t){var n=e.lastDiff,r=this.diff(e);t&&(e.optimistic&&"string"==typeof t.optimistic&&(r.fromOptimisticTransaction=!0),t.onWatchUpdated&&!1===t.onWatchUpdated.call(this,e,r,n))||n&&Xh(n.result,r.result)||e.callback(e.lastDiff=r,n)},t}(cy);const Xy=e=>new sy({uri:e,connectToDevTools:!0,cache:new Jy({})});var Zy=new Map,eg=new Map,tg=!0,ng=!1;function rg(e){return e.replace(/[\s,]+/g," ").trim()}function ig(e){var t,n,r,i=rg(e);if(!Zy.has(i)){var o=(0,Iu.parse)(e,{experimentalFragmentVariables:ng,allowLegacyFragmentVariables:ng});if(!o||"Document"!==o.kind)throw new Error("Not a valid GraphQL document.");Zy.set(i,function(e){var t=new Set(e.definitions);t.forEach((function(e){e.loc&&delete e.loc,Object.keys(e).forEach((function(n){var r=e[n];r&&"object"==typeof r&&t.add(r)}))}));var n=e.loc;return n&&(delete n.startToken,delete n.endToken),e}((t=o,n=new Set,r=[],t.definitions.forEach((function(e){if("FragmentDefinition"===e.kind){var t=e.name.value,i=rg((a=e.loc).source.body.substring(a.start,a.end)),o=eg.get(t);o&&!o.has(i)?tg&&console.warn("Warning: fragment with name "+t+" already exists.\ngraphql-tag enforces all fragment names across your application to be unique; read more about\nthis in the docs: http://dev.apollodata.com/core/fragments.html#unique-names"):o||eg.set(t,o=new Set),o.add(i),n.has(i)||(n.add(i),r.push(e))}else r.push(e);var a})),wd(wd({},t),{definitions:r}))))}return Zy.get(i)}function og(e){for(var t=[],n=1;n{const{setQueryParams:t,setCurrentScreen:n,currentScreen:i,screens:o}=e,[a,s]=(0,r.useState)(!0);return(0,r.createElement)(dg,{id:"graphiql-router-sider","data-testid":"graphiql-router-sider",className:"graphiql-app-screen-sider",collapsible:!0,defaultCollapsed:a,collapsed:a,trigger:(0,r.createElement)("span",{"data-testid":"router-menu-collapse-trigger"},a?(0,r.createElement)(Ee,null):(0,r.createElement)(_e,null)),onCollapse:()=>{s(!a)}},(0,r.createElement)(za,{theme:"dark",mode:"inline",selectedKeys:i,activeKey:i,items:(()=>{let e=[];return o&&o.map((r=>{e.push({"data-testid":`router-menu-item-${r.id}`,id:`router-menu-item-${r.id}`,key:r.id,icon:r.icon,onClick:()=>{(e=>{n(e),t({screen:e})})(r.id)},label:r.title})})),e})()}))};var vg,yg,gg,bg,Eg,wg,Tg=(vg={screen:(bg=ou,Eg="graphiql",void 0===wg&&(wg=!0),iu(iu({},bg),{decode:function(){for(var e=[],t=0;t{const[t,n]=wu({screen:ou}),{endpoint:i,schema:o,setSchema:a}=lg(),{screen:s}=t,[c,l]=(0,r.useState)((()=>{const e=[{id:"graphiql",title:"GraphiQL",icon:(0,r.createElement)(he,null),render:()=>(0,r.createElement)(gd,null)},{id:"help",title:"Help",icon:(0,r.createElement)(ye,null),render:()=>(0,r.createElement)(ru,null)}],t=bc.P.applyFilters("graphiql_router_screens",e);return!0===Array.isArray(t)?t:e})());(0,r.useEffect)((()=>{if(null!==o)return;const e=pg();Xy(i).query({query:cg` - ${e} - `}).then((e=>{const t=null!=e&&e.data?fg(e.data):null;t!==o&&a(t)}))}),[i]);const[u,p]=(0,r.useState)((()=>{const e=c&&c.find((e=>e.id===s));return e?e.id:"graphiql"})());return u?(0,r.createElement)(hg,{"data-testid":"graphiql-router"},(0,r.createElement)(We,{style:{height:"calc(100vh - 32px)",width:"100%"}},(0,r.createElement)(mg,{setQueryParams:n,setCurrentScreen:p,currentScreen:u,screens:c}),(0,r.createElement)(We,{className:"screen-layout",style:{background:"#fff"}},(e=>{const t=null!==(n=c.find((e=>e.id===u)))&&void 0!==n?n:c[0];var n;return t?(0,r.createElement)(We,{className:"router-screen","data-testid":`router-screen-${t.id}`},null==t?void 0:t.render(e)):null})(e)))):null},gg=function(e){var t=Tu(vg),n=t[0],r=t[1];return s.createElement(yg,_u({query:n,setQuery:r},e))},gg.displayName="withQueryParams("+(yg.displayName||yg.name||"Component")+")",gg),_g=n(755),kg=pm?Symbol.for("__APOLLO_CONTEXT__"):"__APOLLO_CONTEXT__",Og=function(e){var t=e.client,n=e.children,r=function(){var e=s.createContext[kg];return e||(Object.defineProperty(s.createContext,kg,{value:e=s.createContext({}),enumerable:!1,writable:!1,configurable:!0}),e.displayName="ApolloContext"),e}();return s.createElement(r.Consumer,null,(function(e){return void 0===e&&(e={}),t&&e.client!==t&&(e=Object.assign({},e,{client:t})),__DEV__?Ad(e.client,'ApolloProvider was not passed a client instance. Make sure you pass in your client via the "client" prop.'):Ad(e.client,26),s.createElement(r.Provider,{value:e},n)}))};const{hooks:Sg,AppContextProvider:xg,useAppContext:Cg}=window.wpGraphiQL,Ng=()=>{const e=Cg();return Sg.applyFilters("graphiql_app",(0,r.createElement)(Tg,null),{appContext:e})},Ag={push:e=>{history.replaceState(null,null,e.href)},replace:e=>{history.replaceState(null,null,e.href)}};(0,r.render)((0,r.createElement)((()=>{const e=Sg.applyFilters("graphiql_query_params_provider_config",{query:ou,variables:ou}),[t,n]=(0,r.useState)(!1);return(0,r.useEffect)((()=>{if(!t){const e=document.getElementById("graphiql");e&&e.classList.remove("graphiql-container"),Sg.doAction("graphiql_rendered"),n(!0)}}),[]),t?(0,r.createElement)(Du,{history:Ag},(0,r.createElement)(Cu,{config:e},(e=>{const{query:t,setQuery:n}=e;return(0,r.createElement)(xg,{queryParams:t,setQueryParams:n},(0,r.createElement)(Og,{client:Xy((0,_g.O3)())},(0,r.createElement)(Ng,null)))}))):null}),null),document.getElementById("graphiql"))},755:function(e,t,n){"use strict";n.d(t,{O3:function(){return s},bp:function(){return a},iz:function(){return c}});var r=n(9307),i=n(6428);const o=(0,r.createContext)(),a=()=>(0,r.useContext)(o),s=()=>{var e,t,n;return null!==(e=null===(t=window)||void 0===t||null===(n=t.wpGraphiQLSettings)||void 0===n?void 0:n.graphqlEndpoint)&&void 0!==e?e:null},c=e=>{let{children:t,setQueryParams:n,queryParams:a}=e;const[c,l]=(0,r.useState)(null),[u,p]=(0,r.useState)(null!==(f=null===(d=window)||void 0===d||null===(h=d.wpGraphiQLSettings)||void 0===h?void 0:h.nonce)&&void 0!==f?f:null);var f,d,h;const[m,v]=(0,r.useState)(s()),[y,g]=(0,r.useState)(a);let b={endpoint:m,setEndpoint:v,nonce:u,setNonce:p,schema:c,setSchema:l,queryParams:y,setQueryParams:e=>{g(e),n(e)}},E=i.P.applyFilters("graphiql_app_context",b);return(0,r.createElement)(o.Provider,{value:E},t)}},6428:function(e,t,n){"use strict";n.d(t,{P:function(){return a}});var r=n(20),i=window.wp.hooks,o=n(755);const a=(0,i.createHooks)();window.wpGraphiQL={GraphQL:r,hooks:a,useAppContext:o.bp,AppContextProvider:o.iz}},4184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e=[],t=0;t0&&(l.from=i.default.Pos(l.from.line,l.from.ch),l.to=i.default.Pos(l.to.line,l.to.ch),i.default.signal(e,"hasCompletion",e,l,a)),l}}))},122:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(875),o=r(n(4631)),a=r(n(9068)),s=n(2311);function c(e,t,n){var r,i=(null===(r=t.fieldDef)||void 0===r?void 0:r.name)||"";"__"!==i.slice(0,2)&&(p(e,t,n,t.parentType),d(e,".")),d(e,i,"field-name",n,(0,s.getFieldReference)(t))}function l(e,t,n){var r;d(e,"@"+((null===(r=t.directiveDef)||void 0===r?void 0:r.name)||""),"directive-name",n,(0,s.getDirectiveReference)(t))}function u(e,t,n,r){d(e,": "),p(e,t,n,r)}function p(e,t,n,r){r instanceof i.GraphQLNonNull?(p(e,t,n,r.ofType),d(e,"!")):r instanceof i.GraphQLList?(d(e,"["),p(e,t,n,r.ofType),d(e,"]")):d(e,(null==r?void 0:r.name)||"","type-name",n,(0,s.getTypeReference)(t,r))}function f(e,t,n){var r=n.description;if(r){var i=document.createElement("div");i.className="info-description",t.renderDescription?i.innerHTML=t.renderDescription(r):i.appendChild(document.createTextNode(r)),e.appendChild(i)}!function(e,t,n){var r=n.deprecationReason;if(r){var i=document.createElement("div");i.className="info-deprecation",t.renderDescription?i.innerHTML=t.renderDescription(r):i.appendChild(document.createTextNode(r));var o=document.createElement("span");o.className="info-deprecation-label",o.appendChild(document.createTextNode("Deprecated: ")),i.insertBefore(o,i.firstChild),e.appendChild(i)}}(e,t,n)}function d(e,t,n,r,i){if(void 0===n&&(n=""),void 0===r&&(r={onClick:null}),void 0===i&&(i=null),n){var o=r.onClick,a=void 0;o?((a=document.createElement("a")).href="javascript:void 0",a.addEventListener("click",(function(e){o(i,e)}))):a=document.createElement("span"),a.className=n,a.appendChild(document.createTextNode(t)),e.appendChild(a)}else e.appendChild(document.createTextNode(t))}n(9965),o.default.registerHelper("info","graphql",(function(e,t){if(t.schema&&e.state){var n,r=e.state,i=r.kind,o=r.step,h=(0,a.default)(t.schema,e.state);return"Field"===i&&0===o&&h.fieldDef||"AliasedField"===i&&2===o&&h.fieldDef?(function(e,t,n){c(e,t,n),u(e,t,n,t.type)}(n=document.createElement("div"),h,t),f(n,t,h.fieldDef),n):"Directive"===i&&1===o&&h.directiveDef?(l(n=document.createElement("div"),h,t),f(n,t,h.directiveDef),n):"Argument"===i&&0===o&&h.argDef?(function(e,t,n){var r;t.directiveDef?l(e,t,n):t.fieldDef&&c(e,t,n);var i=(null===(r=t.argDef)||void 0===r?void 0:r.name)||"";d(e,"("),d(e,i,"arg-name",n,(0,s.getArgumentReference)(t)),u(e,t,n,t.inputType),d(e,")")}(n=document.createElement("div"),h,t),f(n,t,h.argDef),n):"EnumValue"===i&&h.enumValue&&h.enumValue.description?(function(e,t,n){var r,i=(null===(r=t.enumValue)||void 0===r?void 0:r.name)||"";p(e,t,n,t.inputType),d(e,"."),d(e,i,"enum-value",n,(0,s.getEnumValueReference)(t))}(n=document.createElement("div"),h,t),f(n,t,h.enumValue),n):"NamedType"===i&&h.type&&h.type.description?(p(n=document.createElement("div"),h,t,h.type),f(n,t,h.type),n):void 0}}))},2570:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=r(n(9068)),a=n(2311);n(5805),i.default.registerHelper("jump","graphql",(function(e,t){if(t.schema&&t.onClick&&e.state){var n=e.state,r=n.kind,i=n.step,s=(0,o.default)(t.schema,n);return"Field"===r&&0===i&&s.fieldDef||"AliasedField"===r&&2===i&&s.fieldDef?(0,a.getFieldReference)(s):"Directive"===r&&1===i&&s.directiveDef?(0,a.getDirectiveReference)(s):"Argument"===r&&0===i&&s.argDef?(0,a.getArgumentReference)(s):"EnumValue"===r&&s.enumValue?(0,a.getEnumValueReference)(s):"NamedType"===r&&s.type?(0,a.getTypeReference)(s):void 0}}))},1871:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=n(435),a=["error","warning","information","hint"],s={"GraphQL: Validation":"validation","GraphQL: Deprecation":"deprecation","GraphQL: Syntax":"syntax"};i.default.registerHelper("lint","graphql",(function(e,t){var n=t.schema;return(0,o.getDiagnostics)(e,n,t.validationRules,void 0,t.externalFragments).map((function(e){return{message:e.message,severity:e.severity?a[e.severity-1]:a[0],type:e.source?s[e.source]:void 0,from:i.default.Pos(e.range.start.line,e.range.start.character),to:i.default.Pos(e.range.end.line,e.range.end.character)}}))}))},9229:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=r(n(88));i.default.defineMode("graphql",o.default)},6276:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=n(435);function a(e,t){var n,r,i=e.levels;return((i&&0!==i.length?i[i.length-1]-((null===(n=this.electricInput)||void 0===n?void 0:n.test(t))?1:0):e.indentLevel)||0)*((null===(r=this.config)||void 0===r?void 0:r.indentUnit)||0)}i.default.defineMode("graphql-results",(function(e){var t=(0,o.onlineParser)({eatWhitespace:function(e){return e.eatSpace()},lexRules:s,parseRules:c,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:a,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));var s={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},c={Document:[(0,o.p)("{"),(0,o.list)("Entry",(0,o.p)(",")),(0,o.p)("}")],Entry:[(0,o.t)("String","def"),(0,o.p)(":"),"Value"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,o.t)("Number","number")],StringValue:[(0,o.t)("String","string")],BooleanValue:[(0,o.t)("Keyword","builtin")],NullValue:[(0,o.t)("Keyword","keyword")],ListValue:[(0,o.p)("["),(0,o.list)("Value",(0,o.p)(",")),(0,o.p)("]")],ObjectValue:[(0,o.p)("{"),(0,o.list)("ObjectField",(0,o.p)(",")),(0,o.p)("}")],ObjectField:[(0,o.t)("String","property"),(0,o.p)(":"),"Value"]}},2311:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getTypeReference=t.getEnumValueReference=t.getArgumentReference=t.getDirectiveReference=t.getFieldReference=void 0;var r=n(875);function i(e){return"__"===e.name.slice(0,2)}t.getFieldReference=function(e){return{kind:"Field",schema:e.schema,field:e.fieldDef,type:i(e.fieldDef)?null:e.parentType}},t.getDirectiveReference=function(e){return{kind:"Directive",schema:e.schema,directive:e.directiveDef}},t.getArgumentReference=function(e){return e.directiveDef?{kind:"Argument",schema:e.schema,argument:e.argDef,directive:e.directiveDef}:{kind:"Argument",schema:e.schema,argument:e.argDef,field:e.fieldDef,type:i(e.fieldDef)?null:e.parentType}},t.getEnumValueReference=function(e){return{kind:"EnumValue",value:e.enumValue||void 0,type:e.inputType?(0,r.getNamedType)(e.inputType):void 0}},t.getTypeReference=function(e,t){return{kind:"Type",schema:e.schema,type:t||e.type}}},3285:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){for(var n=[],r=e;null==r?void 0:r.kind;)n.push(r),r=r.prevState;for(var i=n.length-1;i>=0;i--)t(n[i])}},9068:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(875),o=n(8155),a=r(n(3285));function s(e,t,n){return n===o.SchemaMetaFieldDef.name&&e.getQueryType()===t?o.SchemaMetaFieldDef:n===o.TypeMetaFieldDef.name&&e.getQueryType()===t?o.TypeMetaFieldDef:n===o.TypeNameMetaFieldDef.name&&(0,i.isCompositeType)(t)?o.TypeNameMetaFieldDef:t&&t.getFields?t.getFields()[n]:void 0}t.default=function(e,t){var n={schema:e,type:null,parentType:null,inputType:null,directiveDef:null,fieldDef:null,argDef:null,argDefs:null,objectFieldDefs:null};return(0,a.default)(t,(function(t){var r,o;switch(t.kind){case"Query":case"ShortQuery":n.type=e.getQueryType();break;case"Mutation":n.type=e.getMutationType();break;case"Subscription":n.type=e.getSubscriptionType();break;case"InlineFragment":case"FragmentDefinition":t.type&&(n.type=e.getType(t.type));break;case"Field":case"AliasedField":n.fieldDef=n.type&&t.name?s(e,n.parentType,t.name):null,n.type=null===(r=n.fieldDef)||void 0===r?void 0:r.type;break;case"SelectionSet":n.parentType=n.type?(0,i.getNamedType)(n.type):null;break;case"Directive":n.directiveDef=t.name?e.getDirective(t.name):null;break;case"Arguments":var a=t.prevState?"Field"===t.prevState.kind?n.fieldDef:"Directive"===t.prevState.kind?n.directiveDef:"AliasedField"===t.prevState.kind?t.prevState.name&&s(e,n.parentType,t.prevState.name):null:null;n.argDefs=a?a.args:null;break;case"Argument":if(n.argDef=null,n.argDefs)for(var c=0;c1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+s))}return i[o][a]}(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,o){var a=function(e,t){return t?n(n(e.map((function(e){return{proximity:i(r(e.text),t),entry:e}})),(function(e){return e.proximity<=2})),(function(e){return!e.entry.isDeprecated})).sort((function(e,t){return(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.text.length-t.entry.text.length})).map((function(e){return e.entry})):n(e,(function(e){return!e.isDeprecated}))}(o,r(t.string));if(a){var s=null!==t.type&&/"|\w/.test(t.string[0])?t.start:t.end;return{list:a,from:{line:e.line,ch:s},to:{line:e.line,ch:t.end}}}}},9965:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631));function o(e,t){var n=e.state.info,r=t.target||t.srcElement;if(r instanceof HTMLElement&&"SPAN"===r.nodeName&&void 0===n.hoverTimeout){var o=r.getBoundingClientRect(),a=function(){clearTimeout(n.hoverTimeout),n.hoverTimeout=setTimeout(c,l)},s=function(){i.default.off(document,"mousemove",a),i.default.off(e.getWrapperElement(),"mouseout",s),clearTimeout(n.hoverTimeout),n.hoverTimeout=void 0},c=function(){i.default.off(document,"mousemove",a),i.default.off(e.getWrapperElement(),"mouseout",s),n.hoverTimeout=void 0,function(e,t){var n=e.coordsChar({left:(t.left+t.right)/2,top:(t.top+t.bottom)/2}),r=e.state.info.options,o=r.render||e.getHelper(n,"info");if(o){var a=e.getTokenAt(n,!0);if(a){var s=o(a,r,e,n);s&&function(e,t,n){var r=document.createElement("div");r.className="CodeMirror-info",r.appendChild(n),document.body.appendChild(r);var o=r.getBoundingClientRect(),a=window.getComputedStyle(r),s=o.right-o.left+parseFloat(a.marginLeft)+parseFloat(a.marginRight),c=o.bottom-o.top+parseFloat(a.marginTop)+parseFloat(a.marginBottom),l=t.bottom;c>window.innerHeight-t.bottom-15&&t.top>window.innerHeight-t.bottom&&(l=t.top-c),l<0&&(l=t.bottom);var u,p=Math.max(0,window.innerWidth-s-15);p>t.left&&(p=t.left),r.style.opacity="1",r.style.top=l+"px",r.style.left=p+"px";var f=function(){clearTimeout(u)},d=function(){clearTimeout(u),u=setTimeout(h,200)},h=function(){i.default.off(r,"mouseover",f),i.default.off(r,"mouseout",d),i.default.off(e.getWrapperElement(),"mouseout",d),r.style.opacity?(r.style.opacity="0",setTimeout((function(){r.parentNode&&r.parentNode.removeChild(r)}),600)):r.parentNode&&r.parentNode.removeChild(r)};i.default.on(r,"mouseover",f),i.default.on(r,"mouseout",d),i.default.on(e.getWrapperElement(),"mouseout",d)}(e,t,s)}}}(e,o)},l=function(e){var t=e.state.info.options;return(null==t?void 0:t.hoverTime)||500}(e);n.hoverTimeout=setTimeout(c,l),i.default.on(document,"mousemove",a),i.default.on(e.getWrapperElement(),"mouseout",s)}}i.default.defineOption("info",!1,(function(e,t,n){if(n&&n!==i.default.Init){var r=e.state.info.onMouseOver;i.default.off(e.getWrapperElement(),"mouseover",r),clearTimeout(e.state.info.hoverTimeout),delete e.state.info}if(t){var a=e.state.info=function(e){return{options:e instanceof Function?{render:e}:!0===e?{}:e}}(t);a.onMouseOver=o.bind(null,e),i.default.on(e.getWrapperElement(),"mouseover",a.onMouseOver)}}))},1277:function(e,t){"use strict";var n,r,i,o,a,s,c,l,u=this&&this.__extends||(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)});function p(){var e=o,t=[];if(m("{"),!g("}")){do{t.push(f())}while(g(","));m("}")}return{kind:"Object",start:e,end:s,members:t}}function f(){var e=o,t="String"===l?h():null;m("String"),m(":");var n=d();return{kind:"Member",start:e,end:s,key:t,value:n}}function d(){switch(l){case"[":return function(){var e=o,t=[];if(m("["),!g("]")){do{t.push(d())}while(g(","));m("]")}return{kind:"Array",start:e,end:s,values:t}}();case"{":return p();case"String":case"Number":case"Boolean":case"Null":var e=h();return E(),e}m("Value")}function h(){return{kind:l,start:o,end:a,value:JSON.parse(r.slice(o,a))}}function m(e){if(l!==e){var t;if("EOF"===l)t="[end of file]";else if(a-o>1)t="`"+r.slice(o,a)+"`";else{var n=r.slice(o).match(/^.+?\b/);t="`"+(n?n[0]:r[o])+"`"}throw y("Expected ".concat(e," but found ").concat(t,"."))}E()}Object.defineProperty(t,"__esModule",{value:!0}),t.JSONSyntaxError=void 0,t.default=function(e){r=e,i=e.length,o=a=s=-1,b(),E();var t=p();return m("EOF"),t};var v=function(e){function t(t,n){var r=e.call(this,t)||this;return r.position=n,r}return u(t,e),t}(Error);function y(e){return new v(e,{start:o,end:a})}function g(e){if(l===e)return E(),!0}function b(){return a31;)if(92===c)switch(c=b()){case 34:case 47:case 92:case 98:case 102:case 110:case 114:case 116:b();break;case 117:b(),w(),w(),w(),w();break;default:throw y("Bad character escape sequence.")}else{if(a===i)throw y("Unterminated string.");b()}if(34!==c)throw y("Unterminated string.");b()}();case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return l="Number",45===c&&b(),48===c?b():T(),46===c&&(b(),T()),void(69!==c&&101!==c||(43!==(c=b())&&45!==c||b(),T()));case 102:if("false"!==r.slice(o,o+5))break;return a+=4,b(),void(l="Boolean");case 110:if("null"!==r.slice(o,o+4))break;return a+=3,b(),void(l="Null");case 116:if("true"!==r.slice(o,o+4))break;return a+=3,b(),void(l="Boolean")}l=r[o],b()}else l="EOF"}function w(){if(c>=48&&c<=57||c>=65&&c<=70||c>=97&&c<=102)return b();throw y("Expected hexadecimal digit.")}function T(){if(c<48||c>57)throw y("Expected decimal digit.");do{b()}while(c>=48&&c<=57)}t.JSONSyntaxError=v},5805:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631));function o(e,t){var n=t.target||t.srcElement;if(n instanceof HTMLElement&&"SPAN"===(null==n?void 0:n.nodeName)){var r=n.getBoundingClientRect(),i={left:(r.left+r.right)/2,top:(r.top+r.bottom)/2};e.state.jump.cursor=i,e.state.jump.isHoldingModifier&&l(e)}}function a(e){e.state.jump.isHoldingModifier||!e.state.jump.cursor?e.state.jump.isHoldingModifier&&e.state.jump.marker&&u(e):e.state.jump.cursor=null}function s(e,t){if(!e.state.jump.isHoldingModifier&&t.key===(c?"Meta":"Control")){e.state.jump.isHoldingModifier=!0,e.state.jump.cursor&&l(e);var n=function(a){a.code===t.code&&(e.state.jump.isHoldingModifier=!1,e.state.jump.marker&&u(e),i.default.off(document,"keyup",n),i.default.off(document,"click",r),e.off("mousedown",o))},r=function(t){var n=e.state.jump.destination;n&&e.state.jump.options.onClick(n,t)},o=function(t,n){e.state.jump.destination&&(n.codemirrorIgnore=!0)};i.default.on(document,"keyup",n),i.default.on(document,"click",r),e.on("mousedown",o)}}i.default.defineOption("jump",!1,(function(e,t,n){if(n&&n!==i.default.Init){var r=e.state.jump.onMouseOver;i.default.off(e.getWrapperElement(),"mouseover",r);var c=e.state.jump.onMouseOut;i.default.off(e.getWrapperElement(),"mouseout",c),i.default.off(document,"keydown",e.state.jump.onKeyDown),delete e.state.jump}if(t){var l=e.state.jump={options:t,onMouseOver:o.bind(null,e),onMouseOut:a.bind(null,e),onKeyDown:s.bind(null,e)};i.default.on(e.getWrapperElement(),"mouseover",l.onMouseOver),i.default.on(e.getWrapperElement(),"mouseout",l.onMouseOut),i.default.on(document,"keydown",l.onKeyDown)}}));var c="undefined"!=typeof navigator&&navigator&&-1!==navigator.appVersion.indexOf("Mac");function l(e){if(!e.state.jump.marker){var t=e.state.jump.cursor,n=e.coordsChar(t),r=e.getTokenAt(n,!0),i=e.state.jump.options,o=i.getDestination||e.getHelper(n,"jump");if(o){var a=o(r,i,e);if(a){var s=e.markText({line:n.line,ch:r.start},{line:n.line,ch:r.end},{className:"CodeMirror-jump-token"});e.state.jump.marker=s,e.state.jump.destination=a}}}}function u(e){var t=e.state.jump.marker;e.state.jump.marker=null,e.state.jump.destination=null,t.clear()}},88:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(435),o=r(n(9655));t.default=function(e){var t=(0,i.onlineParser)({eatWhitespace:function(e){return e.eatWhile(i.isIgnored)},lexRules:i.LexRules,parseRules:i.ParseRules,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:o.default,electricInput:/^\s*[})\]]/,fold:"brace",lineComment:"#",closeBrackets:{pairs:'()[]{}""',explode:"()[]{}"}}}},9655:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t){var n,r,i=e.levels;return((i&&0!==i.length?i[i.length-1]-((null===(n=this.electricInput)||void 0===n?void 0:n.test(t))?1:0):e.indentLevel)||0)*((null===(r=this.config)||void 0===r?void 0:r.indentUnit)||0)}},6094:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=n(875),a=r(n(3285)),s=r(n(8984));i.default.registerHelper("hint","graphql-variables",(function(e,t){var n=e.getCursor(),r=e.getTokenAt(n),c=function(e,t,n){var r="Invalid"===t.state.kind?t.state.prevState:t.state,i=r.kind,c=r.step;if("Document"===i&&0===c)return(0,s.default)(e,t,[{text:"{"}]);var l=n.variableToType;if(l){var u=function(e,t){var n={type:null,fields:null};return(0,a.default)(t,(function(t){if("Variable"===t.kind)n.type=e[t.name];else if("ListValue"===t.kind){var r=n.type?(0,o.getNullableType)(n.type):void 0;n.type=r instanceof o.GraphQLList?r.ofType:null}else if("ObjectValue"===t.kind){var i=n.type?(0,o.getNamedType)(n.type):void 0;n.fields=i instanceof o.GraphQLInputObjectType?i.getFields():null}else if("ObjectField"===t.kind){var a=t.name&&n.fields?n.fields[t.name]:null;n.type=null==a?void 0:a.type}})),n}(l,t.state);if("Document"===i||"Variable"===i&&0===c){var p=Object.keys(l);return(0,s.default)(e,t,p.map((function(e){return{text:'"'.concat(e,'": '),type:l[e]}})))}if(("ObjectValue"===i||"ObjectField"===i&&0===c)&&u.fields){var f=Object.keys(u.fields).map((function(e){return u.fields[e]}));return(0,s.default)(e,t,f.map((function(e){return{text:'"'.concat(e.name,'": '),type:e.type,description:e.description}})))}if("StringValue"===i||"NumberValue"===i||"BooleanValue"===i||"NullValue"===i||"ListValue"===i&&1===c||"ObjectField"===i&&2===c||"Variable"===i&&2===c){var d=u.type?(0,o.getNamedType)(u.type):void 0;if(d instanceof o.GraphQLInputObjectType)return(0,s.default)(e,t,[{text:"{"}]);if(d instanceof o.GraphQLEnumType){var h=d.getValues();return(0,s.default)(e,t,h.map((function(e){return{text:'"'.concat(e.name,'"'),type:d,description:e.description}})))}if(d===o.GraphQLBoolean)return(0,s.default)(e,t,[{text:"true",type:o.GraphQLBoolean,description:"Not false."},{text:"false",type:o.GraphQLBoolean,description:"Not true."}])}}}(n,r,t);return(null==c?void 0:c.list)&&c.list.length>0&&(c.from=i.default.Pos(c.from.line,c.from.ch),c.to=i.default.Pos(c.to.line,c.to.ch),i.default.signal(e,"hasCompletion",e,c,r)),c}))},373:function(e,t,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return i(t,e),t},a=this&&this.__read||function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var c=s(n(4631)),l=n(875),u=o(n(1277));function p(e,t){if(!e||!t)return[];if(e instanceof l.GraphQLNonNull)return"Null"===t.kind?[[t,'Type "'.concat(e,'" is non-nullable and cannot be null.')]]:p(e.ofType,t);if("Null"===t.kind)return[];if(e instanceof l.GraphQLList){var n=e.ofType;return"Array"===t.kind?d(t.values||[],(function(e){return p(n,e)})):p(n,t)}if(e instanceof l.GraphQLInputObjectType){if("Object"!==t.kind)return[[t,'Type "'.concat(e,'" must be an Object.')]];var r=Object.create(null),i=d(t.members,(function(t){var n,i=null===(n=null==t?void 0:t.key)||void 0===n?void 0:n.value;r[i]=!0;var o=e.getFields()[i];return o?p(o?o.type:void 0,t.value):[[t.key,'Type "'.concat(e,'" does not have a field "').concat(i,'".')]]}));return Object.keys(e.getFields()).forEach((function(n){r[n]||e.getFields()[n].type instanceof l.GraphQLNonNull&&i.push([t,'Object of type "'.concat(e,'" is missing required field "').concat(n,'".')])})),i}return"Boolean"===e.name&&"Boolean"!==t.kind||"String"===e.name&&"String"!==t.kind||"ID"===e.name&&"Number"!==t.kind&&"String"!==t.kind||"Float"===e.name&&"Number"!==t.kind||"Int"===e.name&&("Number"!==t.kind||(0|t.value)!==t.value)||(e instanceof l.GraphQLEnumType||e instanceof l.GraphQLScalarType)&&("String"!==t.kind&&"Number"!==t.kind&&"Boolean"!==t.kind&&"Null"!==t.kind||null==(o=e.parseValue(t.value))||o!=o)?[[t,'Expected value of type "'.concat(e,'".')]]:[];var o}function f(e,t,n){return{message:n,severity:"error",type:"validation",from:e.posFromIndex(t.start),to:e.posFromIndex(t.end)}}function d(e,t){return Array.prototype.concat.apply([],e.map(t))}c.default.registerHelper("lint","graphql-variables",(function(e,t,n){if(!e)return[];var r;try{r=(0,u.default)(e)}catch(e){if(e instanceof u.JSONSyntaxError)return[f(n,e.position,e.message)];throw e}var i=t.variableToType;return i?function(e,t,n){var r=[];return n.members.forEach((function(n){var i;if(n){var o=null===(i=n.key)||void 0===i?void 0:i.value,s=t[o];s?p(s,n.value).forEach((function(t){var n=a(t,2),i=n[0],o=n[1];r.push(f(e,i,o))})):r.push(f(e,n.key,'Variable "$'.concat(o,'" does not appear in any GraphQL query.')))}})),r}(n,i,r):[]}))},9677:function(e,t,n){"use strict";var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(n(4631)),o=n(435);function a(e,t){var n,r,i=e.levels;return((i&&0!==i.length?i[i.length-1]-((null===(n=this.electricInput)||void 0===n?void 0:n.test(t))?1:0):e.indentLevel)||0)*((null===(r=this.config)||void 0===r?void 0:r.indentUnit)||0)}i.default.defineMode("graphql-variables",(function(e){var t=(0,o.onlineParser)({eatWhitespace:function(e){return e.eatSpace()},lexRules:s,parseRules:c,editorConfig:{tabSize:e.tabSize}});return{config:e,startState:t.startState,token:t.token,indent:a,electricInput:/^\s*[}\]]/,fold:"brace",closeBrackets:{pairs:'[]{}""',explode:"[]{}"}}}));var s={Punctuation:/^\[|]|\{|\}|:|,/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/,Keyword:/^true|false|null/},c={Document:[(0,o.p)("{"),(0,o.list)("Variable",(0,o.opt)((0,o.p)(","))),(0,o.p)("}")],Variable:[l("variable"),(0,o.p)(":"),"Value"],Value:function(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue"}return null;case"Keyword":switch(e.value){case"true":case"false":return"BooleanValue";case"null":return"NullValue"}return null}},NumberValue:[(0,o.t)("Number","number")],StringValue:[(0,o.t)("String","string")],BooleanValue:[(0,o.t)("Keyword","builtin")],NullValue:[(0,o.t)("Keyword","keyword")],ListValue:[(0,o.p)("["),(0,o.list)("Value",(0,o.opt)((0,o.p)(","))),(0,o.p)("]")],ObjectValue:[(0,o.p)("{"),(0,o.list)("ObjectField",(0,o.opt)((0,o.p)(","))),(0,o.p)("}")],ObjectField:[l("attribute"),(0,o.p)(":"),"Value"]};function l(e){return{style:e,match:function(e){return"String"===e.kind},update:function(e,t){e.name=t.value.slice(1,-1)}}}},4504:function(e,t,n){!function(e){"use strict";var t={},n=/[^\s\u00a0]/,r=e.Pos,i=e.cmpPos;function o(e){var t=e.search(n);return-1==t?0:t}function a(e,t){var n=e.getMode();return!1!==n.useInnerComments&&n.innerMode?e.getModeAt(t):n}e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",(function(e){e||(e=t);for(var n=this,i=1/0,o=this.listSelections(),a=null,s=o.length-1;s>=0;s--){var c=o[s].from(),l=o[s].to();c.line>=i||(l.line>=i&&(l=r(i,0)),i=c.line,null==a?n.uncomment(c,l,e)?a="un":(n.lineComment(c,l,e),a="line"):"un"==a?n.uncomment(c,l,e):n.lineComment(c,l,e))}})),e.defineExtension("lineComment",(function(e,i,s){s||(s=t);var c,l,u=this,p=a(u,e),f=u.getLine(e.line);if(null!=f&&(c=e,l=f,!/\bstring\b/.test(u.getTokenTypeAt(r(c.line,0)))||/^[\'\"\`]/.test(l))){var d=s.lineComment||p.lineComment;if(d){var h=Math.min(0!=i.ch||i.line==e.line?i.line+1:i.line,u.lastLine()+1),m=null==s.padding?" ":s.padding,v=s.commentBlankLines||e.line==i.line;u.operation((function(){if(s.indent){for(var t=null,i=e.line;ia.length)&&(t=a)}for(i=e.line;if||c.operation((function(){if(0!=s.fullLines){var t=n.test(c.getLine(f));c.replaceRange(d+p,r(f)),c.replaceRange(u+d,r(e.line,0));var a=s.blockCommentLead||l.blockCommentLead;if(null!=a)for(var h=e.line+1;h<=f;++h)(h!=f||t)&&c.replaceRange(a+d,r(h,0))}else{var m=0==i(c.getCursor("to"),o),v=!c.somethingSelected();c.replaceRange(p,o),m&&c.setSelection(v?o:c.getCursor("from"),o),c.replaceRange(u,e)}}))}}else(s.lineComment||l.lineComment)&&0!=s.fullLines&&c.lineComment(e,o,s)})),e.defineExtension("uncomment",(function(e,i,o){o||(o=t);var s,c=this,l=a(c,e),u=Math.min(0!=i.ch||i.line==e.line?i.line:i.line-1,c.lastLine()),p=Math.min(e.line,u),f=o.lineComment||l.lineComment,d=[],h=null==o.padding?" ":o.padding;e:if(f){for(var m=p;m<=u;++m){var v=c.getLine(m),y=v.indexOf(f);if(y>-1&&!/comment/.test(c.getTokenTypeAt(r(m,y+1)))&&(y=-1),-1==y&&n.test(v))break e;if(y>-1&&n.test(v.slice(0,y)))break e;d.push(v)}if(c.operation((function(){for(var e=p;e<=u;++e){var t=d[e-p],n=t.indexOf(f),i=n+f.length;n<0||(t.slice(i,i+h.length)==h&&(i+=h.length),s=!0,c.replaceRange("",r(e,n),r(e,i)))}})),s)return!0}var g=o.blockCommentStart||l.blockCommentStart,b=o.blockCommentEnd||l.blockCommentEnd;if(!g||!b)return!1;var E=o.blockCommentLead||l.blockCommentLead,w=c.getLine(p),T=w.indexOf(g);if(-1==T)return!1;var _=u==p?w:c.getLine(u),k=_.indexOf(b,u==p?T+g.length:0),O=r(p,T+1),S=r(u,k+1);if(-1==k||!/comment/.test(c.getTokenTypeAt(O))||!/comment/.test(c.getTokenTypeAt(S))||c.getRange(O,S,"\n").indexOf(b)>-1)return!1;var x=w.lastIndexOf(g,e.ch),C=-1==x?-1:w.slice(0,e.ch).indexOf(b,x+g.length);if(-1!=x&&-1!=C&&C+b.length!=e.ch)return!1;C=_.indexOf(b,i.ch);var N=_.slice(i.ch).lastIndexOf(g,C-i.ch);return x=-1==C||-1==N?-1:i.ch+N,(-1==C||-1==x||x==i.ch)&&(c.operation((function(){c.replaceRange("",r(u,k-(h&&_.slice(k-h.length,k)==h?h.length:0)),r(u,k+b.length));var e=T+g.length;if(h&&w.slice(e,e+h.length)==h&&(e+=h.length),c.replaceRange("",r(p,T),r(p,e)),E)for(var t=p+1;t<=u;++t){var i=c.getLine(t),o=i.indexOf(E);if(-1!=o&&!n.test(i.slice(0,o))){var a=o+E.length;h&&i.slice(a,a+h.length)==h&&(a+=h.length),c.replaceRange("",r(t,o),r(t,a))}}})),!0)}))}(n(4631))},5292:function(e,t,n){!function(e){function t(t,n,r){var i,o=t.getWrapperElement();return(i=o.appendChild(document.createElement("div"))).className=r?"CodeMirror-dialog CodeMirror-dialog-bottom":"CodeMirror-dialog CodeMirror-dialog-top","string"==typeof n?i.innerHTML=n:i.appendChild(n),e.addClass(o,"dialog-opened"),i}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",(function(r,i,o){o||(o={}),n(this,null);var a=t(this,r,o.bottom),s=!1,c=this;function l(t){if("string"==typeof t)p.value=t;else{if(s)return;s=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),c.focus(),o.onClose&&o.onClose(a)}}var u,p=a.getElementsByTagName("input")[0];return p?(p.focus(),o.value&&(p.value=o.value,!1!==o.selectValueOnOpen&&p.select()),o.onInput&&e.on(p,"input",(function(e){o.onInput(e,p.value,l)})),o.onKeyUp&&e.on(p,"keyup",(function(e){o.onKeyUp(e,p.value,l)})),e.on(p,"keydown",(function(t){o&&o.onKeyDown&&o.onKeyDown(t,p.value,l)||((27==t.keyCode||!1!==o.closeOnEnter&&13==t.keyCode)&&(p.blur(),e.e_stop(t),l()),13==t.keyCode&&i(p.value,t))})),!1!==o.closeOnBlur&&e.on(a,"focusout",(function(e){null!==e.relatedTarget&&l()}))):(u=a.getElementsByTagName("button")[0])&&(e.on(u,"click",(function(){l(),c.focus()})),!1!==o.closeOnBlur&&e.on(u,"blur",l),u.focus()),l})),e.defineExtension("openConfirm",(function(r,i,o){n(this,null);var a=t(this,r,o&&o.bottom),s=a.getElementsByTagName("button"),c=!1,l=this,u=1;function p(){c||(c=!0,e.rmClass(a.parentNode,"dialog-opened"),a.parentNode.removeChild(a),l.focus())}s[0].focus();for(var f=0;f",triples:"",explode:"[]{}"},n=e.Pos;function r(e,n){return"pairs"==n&&"string"==typeof e?e:"object"==typeof e&&null!=e[n]?e[n]:t[n]}e.defineOption("autoCloseBrackets",!1,(function(t,n,a){a&&a!=e.Init&&(t.removeKeyMap(i),t.state.closeBrackets=null),n&&(o(r(n,"pairs")),t.state.closeBrackets=n,t.addKeyMap(i))}));var i={Backspace:function(t){var i=s(t);if(!i||t.getOption("disableInput"))return e.Pass;for(var o=r(i,"pairs"),a=t.listSelections(),c=0;c=0;c--){var p=a[c].head;t.replaceRange("",n(p.line,p.ch-1),n(p.line,p.ch+1),"+delete")}},Enter:function(t){var n=s(t),i=n&&r(n,"explode");if(!i||t.getOption("disableInput"))return e.Pass;for(var o=t.listSelections(),a=0;a1&&h.indexOf(i)>=0&&t.getRange(n(w.line,w.ch-2),w)==i+i){if(w.ch>2&&/\bstring/.test(t.getTokenTypeAt(n(w.line,w.ch-2))))return e.Pass;b="addFour"}else if(m){var _=0==w.ch?" ":t.getRange(n(w.line,w.ch-1),w);if(e.isWordChar(T)||_==i||e.isWordChar(_))return e.Pass;b="both"}else{if(!y||!(0===T.length||/\s/.test(T)||d.indexOf(T)>-1))return e.Pass;b="both"}else b=m&&p(t,w)?"both":h.indexOf(i)>=0&&t.getRange(w,n(w.line,w.ch+3))==i+i+i?"skipThree":"skip";if(f){if(f!=b)return e.Pass}else f=b}var k=u%2?a.charAt(u-1):i,O=u%2?i:a.charAt(u+1);t.operation((function(){if("skip"==f)c(t,1);else if("skipThree"==f)c(t,3);else if("surround"==f){for(var e=t.getSelections(),n=0;n0?{line:a.head.line,ch:a.head.ch+t}:{line:a.head.line-1};n.push({anchor:s,head:s})}e.setSelections(n,i)}function l(t){var r=e.cmpPos(t.anchor,t.head)>0;return{anchor:new n(t.anchor.line,t.anchor.ch+(r?-1:1)),head:new n(t.head.line,t.head.ch+(r?1:-1))}}function u(e,t){var r=e.getRange(n(t.line,t.ch-1),n(t.line,t.ch+1));return 2==r.length?r:null}function p(e,t){var r=e.getTokenAt(n(t.line,t.ch+1));return/\bstring/.test(r.type)&&r.start==t.ch&&(0==t.ch||!/\bstring/.test(e.getTokenTypeAt(t)))}o(t.pairs+"`")}(n(4631))},4328:function(e,t,n){!function(e){var t=/MSIE \d/.test(navigator.userAgent)&&(null==document.documentMode||document.documentMode<8),n=e.Pos,r={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function i(e){return e&&e.bracketRegex||/[(){}[\]]/}function o(e,t,o){var s=e.getLineHandle(t.line),c=t.ch-1,l=o&&o.afterCursor;null==l&&(l=/(^| )cm-fat-cursor($| )/.test(e.getWrapperElement().className));var u=i(o),p=!l&&c>=0&&u.test(s.text.charAt(c))&&r[s.text.charAt(c)]||u.test(s.text.charAt(c+1))&&r[s.text.charAt(++c)];if(!p)return null;var f=">"==p.charAt(1)?1:-1;if(o&&o.strict&&f>0!=(c==t.ch))return null;var d=e.getTokenTypeAt(n(t.line,c+1)),h=a(e,n(t.line,c+(f>0?1:0)),f,d,o);return null==h?null:{from:n(t.line,c),to:h&&h.pos,match:h&&h.ch==p.charAt(0),forward:f>0}}function a(e,t,o,a,s){for(var c=s&&s.maxScanLineLength||1e4,l=s&&s.maxScanLines||1e3,u=[],p=i(s),f=o>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=f;d+=o){var h=e.getLine(d);if(h){var m=o>0?0:h.length-1,v=o>0?h.length:-1;if(!(h.length>c))for(d==t.line&&(m=t.ch-(o<0?1:0));m!=v;m+=o){var y=h.charAt(m);if(p.test(y)&&(void 0===a||(e.getTokenTypeAt(n(d,m+1))||"")==(a||""))){var g=r[y];if(g&&">"==g.charAt(1)==o>0)u.push(y);else{if(!u.length)return{pos:n(d,m),ch:y};u.pop()}}}}}return d-o!=(o>0?e.lastLine():e.firstLine())&&null}function s(e,r,i){for(var a=e.state.matchBrackets.maxHighlightLineLength||1e3,s=i&&i.highlightNonMatching,c=[],l=e.listSelections(),u=0;ut.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i).indexOf(";");if(-1!=a)return{startCh:r.end,end:e.Pos(i,a)}}}var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var c=r(s.line+1);if(null==c)break;s=c.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:s}})),e.registerHelper("fold","include",(function(t,n){function r(n){if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;null!=r(a+1);)++a;return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}}))}(n(4631))},8657:function(e,t,n){!function(e){"use strict";function t(t,n,i,o){if(i&&i.call){var a=i;i=null}else a=r(t,i,"rangeFinder");"number"==typeof n&&(n=e.Pos(n,0));var s=r(t,i,"minFoldSize");function c(e){var r=a(t,n);if(!r||r.to.line-r.from.linet.firstLine();)n=e.Pos(n.line-1,0),l=c(!1);if(l&&!l.cleared&&"unfold"!==o){var u=function(e,t,n){var i=r(e,t,"widget");if("function"==typeof i&&(i=i(n.from,n.to)),"string"==typeof i){var o=document.createTextNode(i);(i=document.createElement("span")).appendChild(o),i.className="CodeMirror-foldmarker"}else i&&(i=i.cloneNode(!0));return i}(t,i,l);e.on(u,"mousedown",(function(t){p.clear(),e.e_preventDefault(t)}));var p=t.markText(l.from,l.to,{replacedWith:u,clearOnEnter:r(t,i,"clearOnEnter"),__isFold:!0});p.on("clear",(function(n,r){e.signal(t,"unfold",t,n,r)})),e.signal(t,"fold",t,l.from,l.to)}}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",(function(e,n,r){t(this,e,n,r)})),e.defineExtension("isFolded",(function(e){for(var t=this.findMarksAt(e),n=0;n=l){if(f&&a&&f.test(a.className))return;o=i(s.indicatorOpen)}}(o||a)&&e.setGutterMarker(n,s.gutter,o)}))}function a(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function s(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation((function(){o(e,t.from,t.to)})),n.from=t.from,n.to=t.to)}function c(e,n,i){var o=e.state.foldGutter;if(o){var a=o.options;if(i==a.gutter){var s=r(e,n);s?s.clear():e.foldCode(t(n,0),a)}}}function l(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){s(e)}),n.foldOnChangeTimeSpan||600)}}function u(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout((function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?s(e):e.operation((function(){n.fromt.to&&(o(e,t.to,n.to),t.to=n.to)}))}),n.updateViewportTimeSpan||400)}}function p(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r1)){if(this.somethingSelected()){if(!n.hint.supportsSelection)return;for(var i=0;il.clientHeight+1;if(setTimeout((function(){C=a.getScrollInfo()})),N.bottom-x>0){var L=N.bottom-N.top;if(y.top-(y.bottom-N.top)-L>0)l.style.top=(b=y.top-L-T)+"px",E=!1;else if(L>x){l.style.height=x-5+"px",l.style.top=(b=y.bottom-N.top-T)+"px";var D=a.getCursor();n.from.ch!=D.ch&&(y=a.cursorCoords(D),l.style.left=(g=y.left-w)+"px",N=l.getBoundingClientRect())}}var I,P=N.right-S;if(A&&(P+=a.display.nativeBarWidth),P>0&&(N.right-N.left>S&&(l.style.width=S-5+"px",P-=N.right-N.left-S),l.style.left=(g=Math.max(y.left-P-w,0))+"px"),A)for(var R=l.firstChild;R;R=R.nextSibling)R.style.paddingRight=a.display.nativeBarWidth+"px";a.addKeyMap(this.keyMap=function(e,t){var n={Up:function(){t.moveFocus(-1)},Down:function(){t.moveFocus(1)},PageUp:function(){t.moveFocus(1-t.menuSize(),!0)},PageDown:function(){t.moveFocus(t.menuSize()-1,!0)},Home:function(){t.setFocus(0)},End:function(){t.setFocus(t.length-1)},Enter:t.pick,Tab:t.pick,Esc:t.close};/Mac/.test(navigator.platform)&&(n["Ctrl-P"]=function(){t.moveFocus(-1)},n["Ctrl-N"]=function(){t.moveFocus(1)});var r=e.options.customKeys,i=r?{}:n;function o(e,r){var o;o="string"!=typeof r?function(e){return r(e,t)}:n.hasOwnProperty(r)?n[r]:r,i[e]=o}if(r)for(var a in r)r.hasOwnProperty(a)&&o(a,r[a]);var s=e.options.extraKeys;if(s)for(var a in s)s.hasOwnProperty(a)&&o(a,s[a]);return i}(t,{moveFocus:function(e,t){r.changeActive(r.selectedHint+e,t)},setFocus:function(e){r.changeActive(e)},menuSize:function(){return r.screenAmount()},length:p.length,close:function(){t.close()},pick:function(){r.pick()},data:n})),t.options.closeOnUnfocus&&(a.on("blur",this.onBlur=function(){I=setTimeout((function(){t.close()}),100)}),a.on("focus",this.onFocus=function(){clearTimeout(I)})),a.on("scroll",this.onScroll=function(){var e=a.getScrollInfo(),n=a.getWrapperElement().getBoundingClientRect();C||(C=a.getScrollInfo());var r=b+C.top-e.top,i=r-(c.pageYOffset||(s.documentElement||s.body).scrollTop);if(E||(i+=l.offsetHeight),i<=n.top||i>=n.bottom)return t.close();l.style.top=r+"px",l.style.left=g+C.left-e.left+"px"}),e.on(l,"dblclick",(function(e){var t=o(l,e.target||e.srcElement);t&&null!=t.hintId&&(r.changeActive(t.hintId),r.pick())})),e.on(l,"click",(function(e){var n=o(l,e.target||e.srcElement);n&&null!=n.hintId&&(r.changeActive(n.hintId),t.options.completeOnSingleClick&&r.pick())})),e.on(l,"mousedown",(function(){setTimeout((function(){a.focus()}),20)}));var M=this.getSelectedHintRange();return 0===M.from&&0===M.to||this.scrollToActive(),e.signal(n,"select",p[this.selectedHint],l.childNodes[this.selectedHint]),!0}function s(e,t,n,r){if(e.async)e(t,r,n);else{var i=e(t,n);i&&i.then?i.then(r):r(i)}}t.prototype={close:function(){this.active()&&(this.cm.state.completionActive=null,this.tick=null,this.options.updateOnCursorActivity&&this.cm.off("cursorActivity",this.activityFunc),this.widget&&this.data&&e.signal(this.data,"close"),this.widget&&this.widget.close(),e.signal(this.cm,"endCompletion",this.cm))},active:function(){return this.cm.state.completionActive==this},pick:function(t,n){var r=t.list[n],o=this;this.cm.operation((function(){r.hint?r.hint(o.cm,t,r):o.cm.replaceRange(i(r),r.from||t.from,r.to||t.to,"complete"),e.signal(t,"pick",r),o.cm.scrollIntoView()})),this.options.closeOnPick&&this.close()},cursorActivity:function(){this.debounce&&(r(this.debounce),this.debounce=0);var e=this.startPos;this.data&&(e=this.data.from);var t=this.cm.getCursor(),i=this.cm.getLine(t.line);if(t.line!=this.startPos.line||i.length-t.ch!=this.startLen-this.startPos.ch||t.ch=this.data.list.length?t=n?this.data.list.length-1:0:t<0&&(t=n?0:this.data.list.length-1),this.selectedHint!=t){var r=this.hints.childNodes[this.selectedHint];r&&(r.className=r.className.replace(" CodeMirror-hint-active",""),r.removeAttribute("aria-selected")),(r=this.hints.childNodes[this.selectedHint=t]).className+=" CodeMirror-hint-active",r.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",r.id),this.scrollToActive(),e.signal(this.data,"select",this.data.list[this.selectedHint],r)}},scrollToActive:function(){var e=this.getSelectedHintRange(),t=this.hints.childNodes[e.from],n=this.hints.childNodes[e.to],r=this.hints.firstChild;t.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=n.offsetTop+n.offsetHeight-this.hints.clientHeight+r.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}},e.registerHelper("hint","auto",{resolve:function(t,n){var r,i=t.getHelpers(n,"hint");if(i.length){var o=function(e,t,n){var r=function(e,t){if(!e.somethingSelected())return t;for(var n=[],r=0;r0?t(e):i(o+1)}))}(0)};return o.async=!0,o.supportsSelection=!0,o}return(r=t.getHelper(t.getCursor(),"hintWords"))?function(t){return e.hint.fromList(t,{words:r})}:e.hint.anyword?function(t,n){return e.hint.anyword(t,n)}:function(){}}}),e.registerHelper("hint","fromList",(function(t,n){var r,i=t.getCursor(),o=t.getTokenAt(i),a=e.Pos(i.line,o.start),s=i;o.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};e.defineOption("hintOptions",null)}(n(4631))},3256:function(e,t,n){!function(e){"use strict";var t="CodeMirror-lint-markers";function n(e){e.parentNode&&e.parentNode.removeChild(e)}function r(t,r,i,o){var a=function(t,n,r){var i=document.createElement("div");function o(t){if(!i.parentNode)return e.off(document,"mousemove",o);i.style.top=Math.max(0,t.clientY-i.offsetHeight-5)+"px",i.style.left=t.clientX+5+"px"}return i.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme,i.appendChild(r.cloneNode(!0)),t.state.lint.options.selfContain?t.getWrapperElement().appendChild(i):document.body.appendChild(i),e.on(document,"mousemove",o),o(n),null!=i.style.opacity&&(i.style.opacity=1),i}(t,r,i);function s(){var t;e.off(o,"mouseout",s),a&&((t=a).parentNode&&(null==t.style.opacity&&n(t),t.style.opacity=0,setTimeout((function(){n(t)}),600)),a=null)}var c=setInterval((function(){if(a)for(var e=o;;e=e.parentNode){if(e&&11==e.nodeType&&(e=e.host),e==document.body)return;if(!e){s();break}}if(!a)return clearInterval(c)}),400);e.on(o,"mouseout",s)}function i(e,t,n){for(var i in this.marked=[],t instanceof Function&&(t={getAnnotations:t}),t&&!0!==t||(t={}),this.options={},this.linterOptions=t.options||{},o)this.options[i]=o[i];for(var i in t)o.hasOwnProperty(i)?null!=t[i]&&(this.options[i]=t[i]):t.options||(this.linterOptions[i]=t[i]);this.timeout=null,this.hasGutter=n,this.onMouseOver=function(t){!function(e,t){var n=t.target||t.srcElement;if(/\bCodeMirror-lint-mark-/.test(n.className)){for(var i=n.getBoundingClientRect(),o=(i.left+i.right)/2,a=(i.top+i.bottom)/2,s=e.findMarksAt(e.coordsChar({left:o,top:a},"client")),l=[],u=0;u-1)&&d.push(e.message)}));for(var h=null,m=o.hasGutter&&document.createDocumentFragment(),v=0;v1,l.tooltips)),l.highlightLines&&e.addLineClass(p,"wrap","CodeMirror-lint-line-"+h)}}l.onUpdateLinting&&l.onUpdateLinting(n,u,e)}}function p(e){var t=e.state.lint;t&&(clearTimeout(t.timeout),t.timeout=setTimeout((function(){l(e)}),t.options.delay))}e.defineOption("lint",!1,(function(n,r,o){if(o&&o!=e.Init&&(a(n),!1!==n.state.lint.options.lintOnChange&&n.off("change",p),e.off(n.getWrapperElement(),"mouseover",n.state.lint.onMouseOver),clearTimeout(n.state.lint.timeout),delete n.state.lint),r){for(var s=n.getOption("gutters"),c=!1,u=0;u '+e.phrase("(Use line:column or scroll% syntax)")+""}(e),e.phrase("Jump to line:"),n.line+1+":"+n.ch,(function(r){var i;if(r)if(i=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(r))e.setCursor(t(e,i[1]),Number(i[2]));else if(i=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(r)){var o=Math.round(e.lineCount()*Number(i[1])/100);/^[-+]/.test(i[1])&&(o=n.line+o+1),e.setCursor(o-1,n.ch)}else(i=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(r))&&e.setCursor(t(e,i[1]),n.ch)}))},e.keyMap.default["Alt-G"]="jumpToLine"}(n(4631),n(5292))},1699:function(e,t,n){!function(e){"use strict";function t(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function n(e){return e.state.search||(e.state.search=new t)}function r(e){return"string"==typeof e&&e==e.toLowerCase()}function i(e,t,n){return e.getSearchCursor(t,n,{caseFold:r(t),multiline:!0})}function o(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0,bottom:e.options.search.bottom}):i(prompt(n,r))}function a(e){return e.replace(/\\([nrt\\])/g,(function(e,t){return"n"==t?"\n":"r"==t?"\r":"t"==t?"\t":"\\"==t?"\\":e}))}function s(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],-1==t[2].indexOf("i")?"":"i")}catch(e){}else e=a(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function c(e,t,n){t.queryText=n,t.query=s(n),e.removeOverlay(t.overlay,r(t.query)),t.overlay=function(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);if(n&&n.index==t.pos)return t.pos+=n[0].length||1,"searching";n?t.pos=n.index:t.skipToEnd()}}}(t.query,r(t.query)),e.addOverlay(t.overlay),e.showMatchesOnScrollbar&&(t.annotate&&(t.annotate.clear(),t.annotate=null),t.annotate=e.showMatchesOnScrollbar(t.query,r(t.query)))}function l(t,r,i,a){var s=n(t);if(s.query)return u(t,r);var l=t.getSelection()||s.lastQuery;if(l instanceof RegExp&&"x^"==l.source&&(l=null),i&&t.openDialog){var f=null,h=function(n,r){e.e_stop(r),n&&(n!=s.queryText&&(c(t,s,n),s.posFrom=s.posTo=t.getCursor()),f&&(f.style.opacity=1),u(t,r.shiftKey,(function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((f=r).style.opacity=.4)})))};(function(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){p(e)},onKeyDown:i,bottom:e.options.search.bottom})})(t,d(t),l,h,(function(r,i){var o=e.keyName(r),a=t.getOption("extraKeys"),s=a&&a[o]||e.keyMap[t.getOption("keyMap")][o];"findNext"==s||"findPrev"==s||"findPersistentNext"==s||"findPersistentPrev"==s?(e.e_stop(r),c(t,n(t),i),t.execCommand(s)):"find"!=s&&"findPersistent"!=s||(e.e_stop(r),h(i,r))})),a&&l&&(c(t,s,l),u(t,r))}else o(t,d(t),"Search for:",l,(function(e){e&&!s.query&&t.operation((function(){c(t,s,e),s.posFrom=s.posTo=t.getCursor(),u(t,r)}))}))}function u(t,r,o){t.operation((function(){var a=n(t),s=i(t,a.query,r?a.posFrom:a.posTo);(s.find(r)||(s=i(t,a.query,r?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0))).find(r))&&(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),o&&o(s.from(),s.to()))}))}function p(e){e.operation((function(){var t=n(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))}))}function f(e,t){var n=e?document.createElement(e):document.createDocumentFragment();for(var r in t)n[r]=t[r];for(var i=2;iu);p++){var f=e.getLine(l++);s=null==s?f:s+"\n"+f}c*=2,t.lastIndex=n.ch;var d=t.exec(s);if(d){var h=s.slice(0,d.index).split("\n"),m=d[0].split("\n"),v=n.line+h.length-1,y=h[h.length-1].length;return{from:r(v,y),to:r(v+m.length-1,1==m.length?y+m[0].length:m[m.length-1].length),match:d}}}}function c(e,t,n){for(var r,i=0;i<=e.length;){t.lastIndex=i;var o=t.exec(e);if(!o)break;var a=o.index+o[0].length;if(a>e.length-n)break;(!r||a>r.index+r[0].length)&&(r=o),i=o.index+1}return r}function l(e,t,n){t=i(t,"g");for(var o=n.line,a=n.ch,s=e.firstLine();o>=s;o--,a=-1){var l=e.getLine(o),u=c(l,t,a<0?0:l.length-a);if(u)return{from:r(o,u.index),to:r(o,u.index+u[0].length),match:u}}}function u(e,t,n){if(!o(t))return l(e,t,n);t=i(t,"gm");for(var a,s=1,u=e.getLine(n.line).length-n.ch,p=n.line,f=e.firstLine();p>=f;){for(var d=0;d=f;d++){var h=e.getLine(p--);a=null==a?h:h+"\n"+a}s*=2;var m=c(a,t,u);if(m){var v=a.slice(0,m.index).split("\n"),y=m[0].split("\n"),g=p+v.length,b=v[v.length-1].length;return{from:r(g,b),to:r(g+y.length-1,1==y.length?b+y[0].length:y[y.length-1].length),match:m}}}}function p(e,t,n,r){if(e.length==t.length)return n;for(var i=0,o=n+Math.max(0,e.length-t.length);;){if(i==o)return i;var a=i+o>>1,s=r(e.slice(0,a)).length;if(s==n)return a;s>n?o=a:i=a+1}}function f(e,i,o,a){if(!i.length)return null;var s=a?t:n,c=s(i).split(/\r|\n\r?/);e:for(var l=o.line,u=o.ch,f=e.lastLine()+1-c.length;l<=f;l++,u=0){var d=e.getLine(l).slice(u),h=s(d);if(1==c.length){var m=h.indexOf(c[0]);if(-1==m)continue e;return o=p(d,h,m,s)+u,{from:r(l,p(d,h,m,s)+u),to:r(l,p(d,h,m+c[0].length,s)+u)}}var v=h.length-c[0].length;if(h.slice(v)==c[0]){for(var y=1;y=f;l--,u=-1){var d=e.getLine(l);u>-1&&(d=d.slice(0,u));var h=s(d);if(1==c.length){var m=h.lastIndexOf(c[0]);if(-1==m)continue e;return{from:r(l,p(d,h,m,s)),to:r(l,p(d,h,m+c[0].length,s))}}var v=c[c.length-1];if(h.slice(0,v.length)==v){var y=1;for(o=l-c.length+1;y(this.doc.getLine(n.line)||"").length&&(n.ch=0,n.line++)),0!=e.cmpPos(n,this.doc.clipPos(n))))return this.atOccurrence=!1;var i=this.matches(t,n);if(this.afterEmptyMatch=i&&0==e.cmpPos(i.from,i.to),i)return this.pos=i,this.atOccurrence=!0,this.pos.match||!0;var o=r(t?this.doc.firstLine():this.doc.lastLine()+1,0);return this.pos={from:o,to:o},this.atOccurrence=!1},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",(function(e,t,n){return new h(this.doc,e,t,n)})),e.defineDocExtension("getSearchCursor",(function(e,t,n){return new h(this,e,t,n)})),e.defineExtension("selectMatches",(function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)}))}(n(4631))},3412:function(e,t,n){!function(e){"use strict";var t=e.commands,n=e.Pos;function r(t,r){t.extendSelectionsBy((function(i){return t.display.shift||t.doc.extend||i.empty()?function(t,r,i){if(i<0&&0==r.ch)return t.clipPos(n(r.line-1));var o=t.getLine(r.line);if(i>0&&r.ch>=o.length)return t.clipPos(n(r.line+1,0));for(var a,s="start",c=r.ch,l=c,u=i<0?0:o.length,p=0;l!=u;l+=i,p++){var f=o.charAt(i<0?l-1:l),d="_"!=f&&e.isWordChar(f)?"w":"o";if("w"==d&&f.toUpperCase()==f&&(d="W"),"start"==s)"o"!=d?(s="in",a=d):c=l+i;else if("in"==s&&a!=d){if("w"==a&&"W"==d&&i<0&&l--,"W"==a&&"w"==d&&i>0){if(l==c+1){a="w";continue}l--}break}}return n(r.line,l)}(t.doc,i.head,r):r<0?i.from():i.to()}))}function i(t,r){if(t.isReadOnly())return e.Pass;t.operation((function(){for(var e=t.listSelections().length,i=[],o=-1,a=0;a=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},t.scrollLineDown=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},t.splitSelectionByLine=function(e){for(var t=e.listSelections(),r=[],i=0;io.line&&s==a.line&&0==a.ch||r.push({anchor:s==o.line?o:n(s,0),head:s==a.line?a:n(s)});e.setSelections(r,0)},t.singleSelectionTop=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},t.selectLine=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;s--){var l=r[i[s]];if(!(c&&e.cmpPos(l.head,c)>0)){var u=o(t,l.head);c=u.from,t.replaceRange(n(u.word),u.from,u.to)}}}))}function f(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var i=o(t,n);if(!i.word)return;n=i.from,r=i.to}return{from:n,to:r,query:t.getRange(n,r),word:i}}function d(e,t){var r=f(e);if(r){var i=r.query,o=e.getSearchCursor(i,t?r.to:r.from);(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):(o=e.getSearchCursor(i,t?n(e.firstLine(),0):e.clipPos(n(e.lastLine()))),(t?o.findNext():o.findPrevious())?e.setSelection(o.from(),o.to()):r.word&&e.setSelection(r.from,r.to))}}t.selectScope=function(e){c(e)||e.execCommand("selectAll")},t.selectBetweenBrackets=function(t){if(!c(t))return e.Pass},t.goToBracket=function(t){t.extendSelectionsBy((function(r){var i=t.scanForBracket(r.head,1,l(t.getTokenTypeAt(r.head)));if(i&&0!=e.cmpPos(i.pos,r.head))return i.pos;var o=t.scanForBracket(r.head,-1,l(t.getTokenTypeAt(n(r.head.line,r.head.ch+1))));return o&&n(o.pos.line,o.pos.ch+1)||r.head}))},t.swapLineUp=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.firstLine()-1,a=[],s=0;so?i.push(l,u):i.length&&(i[i.length-1]=u),o=u}t.operation((function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+s,n(t.lastLine()),null,"+swapLine"):t.replaceRange(s+"\n",n(o,0),null,"+swapLine")}t.setSelections(a),t.scrollIntoView()}))},t.swapLineDown=function(t){if(t.isReadOnly())return e.Pass;for(var r=t.listSelections(),i=[],o=t.lastLine()+1,a=r.length-1;a>=0;a--){var s=r[a],c=s.to().line+1,l=s.from().line;0!=s.to().ch||s.empty()||c--,c=0;e-=2){var r=i[e],o=i[e+1],a=t.getLine(r);r==t.lastLine()?t.replaceRange("",n(r-1),n(r),"+swapLine"):t.replaceRange("",n(r,0),n(r+1,0),"+swapLine"),t.replaceRange(a+"\n",n(o,0),null,"+swapLine")}t.scrollIntoView()}))},t.toggleCommentIndented=function(e){e.toggleComment({indent:!0})},t.joinLines=function(e){for(var t=e.listSelections(),r=[],i=0;i=0;o--){var a=r[o].head,s=t.getRange({line:a.line,ch:0},a),c=e.countColumn(s,null,t.getOption("tabSize")),l=t.findPosH(a,-1,"char",!1);if(s&&!/\S/.test(s)&&c%i==0){var u=new n(a.line,e.findColumn(s,c-i,i));u.ch!=a.ch&&(l=u)}t.replaceRange("",l,a,"+delete")}}))},t.delLineRight=function(e){e.operation((function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange("",t[r].anchor,n(t[r].to().line),"+delete");e.scrollIntoView()}))},t.upcaseAtCursor=function(e){p(e,(function(e){return e.toUpperCase()}))},t.downcaseAtCursor=function(e){p(e,(function(e){return e.toLowerCase()}))},t.setSublimeMark=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},t.selectToSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},t.deleteToSublimeMark=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},t.swapWithSublimeMark=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},t.sublimeYank=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},t.showInCenter=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)},t.findUnder=function(e){d(e,!0)},t.findUnderPrevious=function(e){d(e,!1)},t.findAllUnder=function(e){var t=f(e);if(t){for(var n=e.getSearchCursor(t.query),r=[],i=-1;n.findNext();)r.push({anchor:n.from(),head:n.to()}),n.from().line<=t.from.line&&n.from().ch<=t.from.ch&&i++;e.setSelections(r,i)}};var h=e.keyMap;h.macSublime={"Cmd-Left":"goLineStartSmart","Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-Left":"goSubwordLeft","Ctrl-Right":"goSubwordRight","Ctrl-Alt-Up":"scrollLineUp","Ctrl-Alt-Down":"scrollLineDown","Cmd-L":"selectLine","Shift-Cmd-L":"splitSelectionByLine",Esc:"singleSelectionTop","Cmd-Enter":"insertLineAfter","Shift-Cmd-Enter":"insertLineBefore","Cmd-D":"selectNextOccurrence","Shift-Cmd-Space":"selectScope","Shift-Cmd-M":"selectBetweenBrackets","Cmd-M":"goToBracket","Cmd-Ctrl-Up":"swapLineUp","Cmd-Ctrl-Down":"swapLineDown","Cmd-/":"toggleCommentIndented","Cmd-J":"joinLines","Shift-Cmd-D":"duplicateLine",F5:"sortLines","Shift-F5":"reverseSortLines","Cmd-F5":"sortLinesInsensitive","Shift-Cmd-F5":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Cmd-F2":"toggleBookmark","Shift-Cmd-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Cmd-K Cmd-D":"skipAndSelectNextOccurrence","Cmd-K Cmd-K":"delLineRight","Cmd-K Cmd-U":"upcaseAtCursor","Cmd-K Cmd-L":"downcaseAtCursor","Cmd-K Cmd-Space":"setSublimeMark","Cmd-K Cmd-A":"selectToSublimeMark","Cmd-K Cmd-W":"deleteToSublimeMark","Cmd-K Cmd-X":"swapWithSublimeMark","Cmd-K Cmd-Y":"sublimeYank","Cmd-K Cmd-C":"showInCenter","Cmd-K Cmd-G":"clearBookmarks","Cmd-K Cmd-Backspace":"delLineLeft","Cmd-K Cmd-1":"foldAll","Cmd-K Cmd-0":"unfoldAll","Cmd-K Cmd-J":"unfoldAll","Ctrl-Shift-Up":"addCursorToPrevLine","Ctrl-Shift-Down":"addCursorToNextLine","Cmd-F3":"findUnder","Shift-Cmd-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Cmd-[":"fold","Shift-Cmd-]":"unfold","Cmd-I":"findIncremental","Shift-Cmd-I":"findIncrementalReverse","Cmd-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"macDefault"},e.normalizeKeyMap(h.macSublime),h.pcSublime={"Shift-Tab":"indentLess","Shift-Ctrl-K":"deleteLine","Alt-Q":"wrapLines","Ctrl-T":"transposeChars","Alt-Left":"goSubwordLeft","Alt-Right":"goSubwordRight","Ctrl-Up":"scrollLineUp","Ctrl-Down":"scrollLineDown","Ctrl-L":"selectLine","Shift-Ctrl-L":"splitSelectionByLine",Esc:"singleSelectionTop","Ctrl-Enter":"insertLineAfter","Shift-Ctrl-Enter":"insertLineBefore","Ctrl-D":"selectNextOccurrence","Shift-Ctrl-Space":"selectScope","Shift-Ctrl-M":"selectBetweenBrackets","Ctrl-M":"goToBracket","Shift-Ctrl-Up":"swapLineUp","Shift-Ctrl-Down":"swapLineDown","Ctrl-/":"toggleCommentIndented","Ctrl-J":"joinLines","Shift-Ctrl-D":"duplicateLine",F9:"sortLines","Shift-F9":"reverseSortLines","Ctrl-F9":"sortLinesInsensitive","Shift-Ctrl-F9":"reverseSortLinesInsensitive",F2:"nextBookmark","Shift-F2":"prevBookmark","Ctrl-F2":"toggleBookmark","Shift-Ctrl-F2":"clearBookmarks","Alt-F2":"selectBookmarks",Backspace:"smartBackspace","Ctrl-K Ctrl-D":"skipAndSelectNextOccurrence","Ctrl-K Ctrl-K":"delLineRight","Ctrl-K Ctrl-U":"upcaseAtCursor","Ctrl-K Ctrl-L":"downcaseAtCursor","Ctrl-K Ctrl-Space":"setSublimeMark","Ctrl-K Ctrl-A":"selectToSublimeMark","Ctrl-K Ctrl-W":"deleteToSublimeMark","Ctrl-K Ctrl-X":"swapWithSublimeMark","Ctrl-K Ctrl-Y":"sublimeYank","Ctrl-K Ctrl-C":"showInCenter","Ctrl-K Ctrl-G":"clearBookmarks","Ctrl-K Ctrl-Backspace":"delLineLeft","Ctrl-K Ctrl-1":"foldAll","Ctrl-K Ctrl-0":"unfoldAll","Ctrl-K Ctrl-J":"unfoldAll","Ctrl-Alt-Up":"addCursorToPrevLine","Ctrl-Alt-Down":"addCursorToNextLine","Ctrl-F3":"findUnder","Shift-Ctrl-F3":"findUnderPrevious","Alt-F3":"findAllUnder","Shift-Ctrl-[":"fold","Shift-Ctrl-]":"unfold","Ctrl-I":"findIncremental","Shift-Ctrl-I":"findIncrementalReverse","Ctrl-H":"replace",F3:"findNext","Shift-F3":"findPrev",fallthrough:"pcDefault"},e.normalizeKeyMap(h.pcSublime);var m=h.default==h.macDefault;h.sublime=m?h.macSublime:h.pcSublime}(n(4631),n(2095),n(4328))},4631:function(e){e.exports=function(){"use strict";var e=navigator.userAgent,t=navigator.platform,n=/gecko\/\d/i.test(e),r=/MSIE \d/.test(e),i=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(e),o=/Edge\/(\d+)/.exec(e),a=r||i||o,s=a&&(r?document.documentMode||6:+(o||i)[1]),c=!o&&/WebKit\//.test(e),l=c&&/Qt\/\d+\.\d+/.test(e),u=!o&&/Chrome\/(\d+)/.exec(e),p=u&&+u[1],f=/Opera\//.test(e),d=/Apple Computer/.test(navigator.vendor),h=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(e),m=/PhantomJS/.test(e),v=d&&(/Mobile\/\w+/.test(e)||navigator.maxTouchPoints>2),y=/Android/.test(e),g=v||y||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(e),b=v||/Mac/.test(t),E=/\bCrOS\b/.test(e),w=/win/i.test(t),T=f&&e.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(f=!1,c=!0);var _=b&&(l||f&&(null==T||T<12.11)),k=n||a&&s>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var S,x=function(e,t){var n=e.className,r=O(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}};function C(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function N(e,t){return C(e).appendChild(t)}function A(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}}v?M=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:a&&(M=function(e){try{e.select()}catch(e){}});var Q=function(){this.id=null,this.f=null,this.time=0,this.handler=j(this.onTimeout,this)};function q(e,t){for(var n=0;n=t)return r+Math.min(a,t-i);if(i+=o-r,r=o+1,(i+=n-i%n)>=t)return r}}var $=[""];function H(e){for(;$.length<=e;)$.push(W($)+" ");return $[e]}function W(e){return e[e.length-1]}function Y(e,t){for(var n=[],r=0;r"€"&&(e.toUpperCase()!=e.toLowerCase()||Z.test(e))}function te(e,t){return t?!!(t.source.indexOf("\\w")>-1&&ee(e))||t.test(e):ee(e)}function ne(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var re=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ie(e){return e.charCodeAt(0)>=768&&re.test(e)}function oe(e,t,n){for(;(n<0?t>0:tn?-1:1;;){if(t==n)return t;var i=(t+n)/2,o=r<0?Math.ceil(i):Math.floor(i);if(o==t)return e(o)?t:n;e(o)?n=o:t=o+r}}var se=null;function ce(e,t,n){var r;se=null;for(var i=0;it)return i;o.to==t&&(o.from!=o.to&&"before"==n?r=i:se=i),o.from==t&&(o.from!=o.to&&"before"!=n?r=i:se=i)}return null!=r?r:se}var le=function(){var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,t=/[stwN]/,n=/[LRr]/,r=/[Lb1n]/,i=/[1n]/;function o(e,t,n){this.level=e,this.from=t,this.to=n}return function(a,s){var c,l="ltr"==s?"L":"R";if(0==a.length||"ltr"==s&&!e.test(a))return!1;for(var u=a.length,p=[],f=0;f-1&&(r[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function me(e,t){var n=de(e,t);if(n.length)for(var r=Array.prototype.slice.call(arguments,2),i=0;i0}function be(e){e.prototype.on=function(e,t){fe(this,e,t)},e.prototype.off=function(e,t){he(this,e,t)}}function Ee(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function we(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Te(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function _e(e){Ee(e),we(e)}function ke(e){return e.target||e.srcElement}function Oe(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),b&&e.ctrlKey&&1==t&&(t=3),t}var Se,xe,Ce=function(){if(a&&s<9)return!1;var e=A("div");return"draggable"in e||"dragDrop"in e}();function Ne(e){if(null==Se){var t=A("span","​");N(e,A("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(Se=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&s<8))}var n=Se?A("span","​"):A("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function Ae(e){if(null!=xe)return xe;var t=N(e,document.createTextNode("AخA")),n=S(t,0,1).getBoundingClientRect(),r=S(t,1,2).getBoundingClientRect();return C(e),!(!n||n.left==n.right)&&(xe=r.right-n.right<3)}var Le,De=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);-1==i&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");-1!=a?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},Ie=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(e){return!1}}:function(e){var t;try{t=e.ownerDocument.selection.createRange()}catch(e){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},Pe="oncopy"in(Le=A("div"))||(Le.setAttribute("oncopy","return;"),"function"==typeof Le.oncopy),Re=null;var Me={},je={};function Fe(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Me[e]=t}function Ve(e){if("string"==typeof e&&je.hasOwnProperty(e))e=je[e];else if(e&&"string"==typeof e.name&&je.hasOwnProperty(e.name)){var t=je[e.name];"string"==typeof t&&(t={name:t}),(e=X(t,e)).name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Ve("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Ve("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function Qe(e,t){t=Ve(t);var n=Me[t.name];if(!n)return Qe(e,"text/plain");var r=n(e,t);if(qe.hasOwnProperty(t.name)){var i=qe[t.name];for(var o in i)i.hasOwnProperty(o)&&(r.hasOwnProperty(o)&&(r["_"+o]=r[o]),r[o]=i[o])}if(r.name=t.name,t.helperType&&(r.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)r[a]=t.modeProps[a];return r}var qe={};function Ue(e,t){F(t,qe.hasOwnProperty(e)?qe[e]:qe[e]={})}function Ge(e,t){if(!0===t)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n}function Be(e,t){for(var n;e.innerMode&&(n=e.innerMode(t))&&n.mode!=e;)t=n.state,e=n.mode;return n||{mode:e,state:t}}function Ke(e,t,n){return!e.startState||e.startState(t,n)}var ze=function(e,t,n){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=n};function $e(e,t){if((t-=e.first)<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t=e.first&&tn?tt(n,$e(e,n).text.length):function(e,t){var n=e.ch;return null==n||n>t?tt(e.line,t):n<0?tt(e.line,0):e}(t,$e(e,t.line).text.length)}function lt(e,t){for(var n=[],r=0;r=this.string.length},ze.prototype.sol=function(){return this.pos==this.lineStart},ze.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},ze.prototype.next=function(){if(this.post},ze.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},ze.prototype.skipToEnd=function(){this.pos=this.string.length},ze.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},ze.prototype.backUp=function(e){this.pos-=e},ze.prototype.column=function(){return this.lastColumnPos0?null:(r&&!1!==t&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e};if(i(this.string.substr(this.pos,e.length))==i(e))return!1!==t&&(this.pos+=e.length),!0},ze.prototype.current=function(){return this.string.slice(this.start,this.pos)},ze.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},ze.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},ze.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};var ut=function(e,t){this.state=e,this.lookAhead=t},pt=function(e,t,n,r){this.state=t,this.doc=e,this.line=n,this.maxLookAhead=r||0,this.baseTokens=null,this.baseTokenPos=1};function ft(e,t,n,r){var i=[e.state.modeGen],o={};wt(e,t.text,e.doc.mode,n,(function(e,t){return i.push(e,t)}),o,r);for(var a=n.state,s=function(r){n.baseTokens=i;var s=e.state.overlays[r],c=1,l=0;n.state=!0,wt(e,t.text,s.mode,n,(function(e,t){for(var n=c;le&&i.splice(c,1,e,i[c+1],r),c+=2,l=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,c-n,e,"overlay "+t),c=n+2;else for(;ne.options.maxHighlightLength&&Ge(e.doc.mode,r.state),o=ft(e,t,r);i&&(r.state=i),t.stateAfter=r.save(!i),t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function ht(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return new pt(r,!0,t);var o=function(e,t,n){for(var r,i,o=e.doc,a=n?-1:t-(e.doc.mode.innerMode?1e3:100),s=t;s>a;--s){if(s<=o.first)return o.first;var c=$e(o,s-1),l=c.stateAfter;if(l&&(!n||s+(l instanceof ut?l.lookAhead:0)<=o.modeFrontier))return s;var u=V(c.text,null,e.options.tabSize);(null==i||r>u)&&(i=s-1,r=u)}return i}(e,t,n),a=o>r.first&&$e(r,o-1).stateAfter,s=a?pt.fromSaved(r,a,o):new pt(r,Ke(r.mode),o);return r.iter(o,t,(function(n){mt(e,n.text,s);var r=s.line;n.stateAfter=r==t-1||r%5==0||r>=i.viewFrom&&rt.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}pt.prototype.lookAhead=function(e){var t=this.doc.getLine(this.line+e);return null!=t&&e>this.maxLookAhead&&(this.maxLookAhead=e),t},pt.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},pt.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},pt.fromSaved=function(e,t,n){return t instanceof ut?new pt(e,Ge(e.mode,t.state),n,t.lookAhead):new pt(e,Ge(e.mode,t),n)},pt.prototype.save=function(e){var t=!1!==e?Ge(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ut(t,this.maxLookAhead):t};var gt=function(e,t,n){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=n};function bt(e,t,n,r){var i,o,a=e.doc,s=a.mode,c=$e(a,(t=ct(a,t)).line),l=ht(e,t.line,n),u=new ze(c.text,e.options.tabSize,l);for(r&&(o=[]);(r||u.pose.options.maxHighlightLength?(s=!1,a&&mt(e,t,r,p.pos),p.pos=t.length,c=null):c=Et(yt(n,p,r.state,f),o),f){var d=f[0].name;d&&(c="m-"+(c?d+" "+c:d))}if(!s||u!=c){for(;l=t:o.to>t);(r||(r=[])).push(new kt(a,o.from,s?null:o.to))}}return r}(n,i,a),c=function(e,t,n){var r;if(e)for(var i=0;i=t:o.to>t)||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var b=0;bt)&&(!n||It(n,o.marker)<0)&&(n=o.marker)}return n}function Ft(e,t,n,r,i){var o=$e(e,t),a=_t&&o.markedSpans;if(a)for(var s=0;s=0&&p<=0||u<=0&&p>=0)&&(u<=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?nt(l.to,n)>=0:nt(l.to,n)>0)||u>=0&&(c.marker.inclusiveRight&&i.inclusiveLeft?nt(l.from,r)<=0:nt(l.from,r)<0)))return!0}}}function Vt(e){for(var t;t=Rt(e);)e=t.find(-1,!0).line;return e}function Qt(e,t){var n=$e(e,t),r=Vt(n);return n==r?t:Je(r)}function qt(e,t){if(t>e.lastLine())return t;var n,r=$e(e,t);if(!Ut(e,r))return t;for(;n=Mt(r);)r=n.find(1,!0).line;return Je(r)+1}function Ut(e,t){var n=_t&&t.markedSpans;if(n)for(var r=void 0,i=0;it.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)}))}var $t=function(e,t,n){this.text=e,At(this,t),this.height=n?n(this):1};function Ht(e){e.parent=null,Nt(e)}$t.prototype.lineNo=function(){return Je(this)},be($t);var Wt={},Yt={};function Jt(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Yt:Wt;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Xt(e,t){var n=L("span",null,null,c?"padding-right: .1px":null),r={pre:L("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,a=void 0;r.pos=0,r.addToken=en,Ae(e.display.measure)&&(a=ue(o,e.doc.direction))&&(r.addToken=tn(r.addToken,a)),r.map=[],rn(o,r,dt(e,o,t!=e.display.externalMeasured&&Je(o))),o.styleClasses&&(o.styleClasses.bgClass&&(r.bgClass=R(o.styleClasses.bgClass,r.bgClass||"")),o.styleClasses.textClass&&(r.textClass=R(o.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ne(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(c){var s=r.content.lastChild;(/\bcm-tab\b/.test(s.className)||s.querySelector&&s.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return me(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=R(r.pre.className,r.textClass||"")),r}function Zt(e){var t=A("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function en(e,t,n,r,i,o,c){if(t){var l,u=e.splitSpaces?function(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;il&&p.from<=l);f++);if(p.to>=u)return e(n,r,i,o,a,s,c);e(n,r.slice(0,p.to-l),i,o,null,s,c),o=null,r=r.slice(p.to-l),l=p.to}}}function nn(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function rn(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,c,l,u,p,f,d=i.length,h=0,m=1,v="",y=0;;){if(y==h){c=l=u=s="",f=null,p=null,y=1/0;for(var g=[],b=void 0,E=0;Eh||T.collapsed&&w.to==h&&w.from==h)){if(null!=w.to&&w.to!=h&&y>w.to&&(y=w.to,l=""),T.className&&(c+=" "+T.className),T.css&&(s=(s?s+";":"")+T.css),T.startStyle&&w.from==h&&(u+=" "+T.startStyle),T.endStyle&&w.to==y&&(b||(b=[])).push(T.endStyle,w.to),T.title&&((f||(f={})).title=T.title),T.attributes)for(var _ in T.attributes)(f||(f={}))[_]=T.attributes[_];T.collapsed&&(!p||It(p.marker,T)<0)&&(p=w)}else w.from>h&&y>w.from&&(y=w.from)}if(b)for(var k=0;k=d)break;for(var S=Math.min(d,y);;){if(v){var x=h+v.length;if(!p){var C=x>S?v.slice(0,S-h):v;t.addToken(t,C,a?a+c:c,u,h+C.length==y?l:"",s,f)}if(x>=S){v=v.slice(S-h),h=S;break}h=x,u=""}v=i.slice(o,o=n[m++]),a=Jt(n[m++],t.cm.options)}}else for(var N=1;Nn)return{map:e.measure.maps[i],cache:e.measure.caches[i],before:!0}}}function Dn(e,t,n,r){return Rn(e,Pn(e,t),n,r)}function In(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&t2&&o.push((c.bottom+l.top)/2-n.top)}}o.push(n.bottom-n.top)}}(e,t.view,t.rect),t.hasHeights=!0),(o=function(e,t,n,r){var i,o=Fn(t.map,n,r),c=o.node,l=o.start,u=o.end,p=o.collapse;if(3==c.nodeType){for(var f=0;f<4;f++){for(;l&&ie(t.line.text.charAt(o.coverStart+l));)--l;for(;o.coverStart+u1}(e))return t;var n=screen.logicalXDPI/screen.deviceXDPI,r=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*n,right:t.right*n,top:t.top*r,bottom:t.bottom*r}}(e.display.measure,i))}else{var d;l>0&&(p=r="right"),i=e.options.lineWrapping&&(d=c.getClientRects()).length>1?d["right"==r?d.length-1:0]:c.getBoundingClientRect()}if(a&&s<9&&!l&&(!i||!i.left&&!i.right)){var h=c.parentNode.getClientRects()[0];i=h?{left:h.left,right:h.left+ar(e.display),top:h.top,bottom:h.bottom}:jn}for(var m=i.top-t.rect.top,v=i.bottom-t.rect.top,y=(m+v)/2,g=t.view.measure.heights,b=0;bt)&&(i=(o=c-s)-1,t>=c&&(a="right")),null!=i){if(r=e[l+2],s==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;l&&e[l-2]==e[l-3]&&e[l-1].insertLeft;)r=e[2+(l-=3)],a="left";if("right"==n&&i==c-s)for(;l=0&&(n=e[i]).left==n.right;i--);return n}function Qn(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var t=0;t=r.text.length?(c=r.text.length,l="before"):c<=0&&(c=0,l="after"),!s)return a("before"==l?c-1:c,"before"==l);function u(e,t,n){return a(n?e-1:e,1==s[t].level!=n)}var p=ce(s,c,l),f=se,d=u(c,p,"before"==l);return null!=f&&(d.other=u(c,f,"before"!=l)),d}function Yn(e,t){var n=0;t=ct(e.doc,t),e.options.lineWrapping||(n=ar(e.display)*t.ch);var r=$e(e.doc,t.line),i=Bt(r)+On(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function Jn(e,t,n,r,i){var o=tt(e,t,n);return o.xRel=i,r&&(o.outside=r),o}function Xn(e,t,n){var r=e.doc;if((n+=e.display.viewOffset)<0)return Jn(r.first,0,null,-1,-1);var i=Xe(r,n),o=r.first+r.size-1;if(i>o)return Jn(r.first+r.size-1,$e(r,o).text.length,null,1,1);t<0&&(t=0);for(var a=$e(r,i);;){var s=nr(e,a,i,t,n),c=jt(a,s.ch+(s.xRel>0||s.outside>0?1:0));if(!c)return s;var l=c.find(1);if(l.line==i)return l;a=$e(r,i=l.line)}}function Zn(e,t,n,r){r-=Kn(t);var i=t.text.length,o=ae((function(t){return Rn(e,n,t-1).bottom<=r}),i,0);return{begin:o,end:i=ae((function(t){return Rn(e,n,t).top>r}),o,i)}}function er(e,t,n,r){return n||(n=Pn(e,t)),Zn(e,t,n,zn(e,t,Rn(e,n,r),"line").top)}function tr(e,t,n,r){return!(e.bottom<=n)&&(e.top>n||(r?e.left:e.right)>t)}function nr(e,t,n,r,i){i-=Bt(t);var o=Pn(e,t),a=Kn(t),s=0,c=t.text.length,l=!0,u=ue(t,e.doc.direction);if(u){var p=(e.options.lineWrapping?ir:rr)(e,t,n,o,u,r,i);s=(l=1!=p.level)?p.from:p.to-1,c=l?p.to:p.from-1}var f,d,h=null,m=null,v=ae((function(t){var n=Rn(e,o,t);return n.top+=a,n.bottom+=a,!!tr(n,r,i,!1)&&(n.top<=i&&n.left<=r&&(h=t,m=n),!0)}),s,c),y=!1;if(m){var g=r-m.left=E.bottom?1:0}return Jn(n,v=oe(t.text,v,1),d,y,r-f)}function rr(e,t,n,r,i,o,a){var s=ae((function(s){var c=i[s],l=1!=c.level;return tr(Wn(e,tt(n,l?c.to:c.from,l?"before":"after"),"line",t,r),o,a,!0)}),0,i.length-1),c=i[s];if(s>0){var l=1!=c.level,u=Wn(e,tt(n,l?c.from:c.to,l?"after":"before"),"line",t,r);tr(u,o,a,!0)&&u.top>a&&(c=i[s-1])}return c}function ir(e,t,n,r,i,o,a){var s=Zn(e,t,r,a),c=s.begin,l=s.end;/\s/.test(t.text.charAt(l-1))&&l--;for(var u=null,p=null,f=0;f=l||d.to<=c)){var h=Rn(e,r,1!=d.level?Math.min(l,d.to)-1:Math.max(c,d.from)).right,m=hm)&&(u=d,p=m)}}return u||(u=i[i.length-1]),u.froml&&(u={from:u.from,to:l,level:u.level}),u}function or(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Mn){Mn=A("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Mn.appendChild(document.createTextNode("x")),Mn.appendChild(A("br"));Mn.appendChild(document.createTextNode("x"))}N(e.measure,Mn);var n=Mn.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),C(e.measure),n||1}function ar(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=A("span","xxxxxxxxxx"),n=A("pre",[t],"CodeMirror-line-like");N(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function sr(e){for(var t=e.display,n={},r={},i=t.gutters.clientLeft,o=t.gutters.firstChild,a=0;o;o=o.nextSibling,++a){var s=e.display.gutterSpecs[a].className;n[s]=o.offsetLeft+o.clientLeft+i,r[s]=o.clientWidth}return{fixedPos:cr(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:n,gutterWidth:r,wrapperWidth:t.wrapper.clientWidth}}function cr(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function lr(e){var t=or(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/ar(e.display)-3);return function(i){if(Ut(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;a0&&(c=$e(e.doc,l.line).text).length==l.ch){var u=V(c,c.length,e.options.tabSize)-c.length;l=tt(l.line,Math.max(0,Math.round((o-xn(e.display).left)/ar(e.display))-u))}return l}function fr(e,t){if(t>=e.display.viewTo)return null;if((t-=e.display.viewFrom)<0)return null;for(var n=e.display.view,r=0;rt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)_t&&Qt(e.doc,t)i.viewFrom?mr(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)mr(e);else if(t<=i.viewFrom){var o=vr(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):mr(e)}else if(n>=i.viewTo){var a=vr(e,t,t,-1);a?(i.view=i.view.slice(0,a.index),i.viewTo=a.lineN):mr(e)}else{var s=vr(e,t,t,-1),c=vr(e,n,n+r,1);s&&c?(i.view=i.view.slice(0,s.index).concat(an(e,s.lineN,c.lineN)).concat(i.view.slice(c.index)),i.viewTo+=r):mr(e)}var l=i.externalMeasured;l&&(n=i.lineN&&t=r.viewTo)){var o=r.view[fr(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==q(a,n)&&a.push(n)}}}function mr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function vr(e,t,n,r){var i,o=fr(e,t),a=e.display.view;if(!_t||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=e.display.viewFrom,c=0;c0){if(o==a.length-1)return null;i=s+a[o].size-t,o++}else i=s-t;t+=i,n+=i}for(;Qt(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function yr(e){for(var t=e.display.view,n=0,r=0;r=e.display.viewTo||c.to().line0?a:e.defaultCharWidth())+"px"}if(r.other){var s=n.appendChild(A("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));s.style.display="",s.style.left=r.other.left+"px",s.style.top=r.other.top+"px",s.style.height=.85*(r.other.bottom-r.other.top)+"px"}}function wr(e,t){return e.top-t.top||e.left-t.left}function Tr(e,t,n){var r=e.display,i=e.doc,o=document.createDocumentFragment(),a=xn(e.display),s=a.left,c=Math.max(r.sizerWidth,Nn(e)-r.sizer.offsetLeft)-a.right,l="ltr"==i.direction;function u(e,t,n,r){t<0&&(t=0),t=Math.round(t),r=Math.round(r),o.appendChild(A("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px;\n top: "+t+"px; width: "+(null==n?c-e:n)+"px;\n height: "+(r-t)+"px"))}function p(t,n,r){var o,a,p=$e(i,t),f=p.text.length;function d(n,r){return Hn(e,tt(t,n),"div",p,r)}function h(t,n,r){var i=er(e,p,null,t),o="ltr"==n==("after"==r)?"left":"right";return d("after"==r?i.begin:i.end-(/\s/.test(p.text.charAt(i.end-1))?2:1),o)[o]}var m=ue(p,i.direction);return function(e,t,n,r){if(!e)return r(t,n,"ltr",0);for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr",o),i=!0)}i||r(t,n,"ltr")}(m,n||0,null==r?f:r,(function(e,t,i,p){var v="ltr"==i,y=d(e,v?"left":"right"),g=d(t-1,v?"right":"left"),b=null==n&&0==e,E=null==r&&t==f,w=0==p,T=!m||p==m.length-1;if(g.top-y.top<=3){var _=(l?E:b)&&T,k=(l?b:E)&&w?s:(v?y:g).left,O=_?c:(v?g:y).right;u(k,y.top,O-k,y.bottom)}else{var S,x,C,N;v?(S=l&&b&&w?s:y.left,x=l?c:h(e,i,"before"),C=l?s:h(t,i,"after"),N=l&&E&&T?c:g.right):(S=l?h(e,i,"before"):s,x=!l&&b&&w?c:y.right,C=!l&&E&&T?s:g.left,N=l?h(t,i,"after"):c),u(S,y.top,x-S,y.bottom),y.bottom0?t.blinker=setInterval((function(){e.hasFocus()||xr(e),t.cursorDiv.style.visibility=(n=!n)?"":"hidden"}),e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function kr(e){e.hasFocus()||(e.display.input.focus(),e.state.focused||Sr(e))}function Or(e){e.state.delayingBlurEvent=!0,setTimeout((function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,e.state.focused&&xr(e))}),100)}function Sr(e,t){e.state.delayingBlurEvent&&!e.state.draggingText&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(me(e,"focus",e,t),e.state.focused=!0,P(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),c&&setTimeout((function(){return e.display.input.reset(!0)}),20)),e.display.input.receivedFocus()),_r(e))}function xr(e,t){e.state.delayingBlurEvent||(e.state.focused&&(me(e,"blur",e,t),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout((function(){e.state.focused||(e.display.shift=!1)}),150))}function Cr(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=Math.max(0,t.scroller.getBoundingClientRect().top),i=t.lineDiv.getBoundingClientRect().top,o=0,c=0;c.005||m<-.005)&&(ie.display.sizerWidth){var y=Math.ceil(f/ar(e.display));y>e.display.maxLineLength&&(e.display.maxLineLength=y,e.display.maxLine=l.line,e.display.maxLineChanged=!0)}}}Math.abs(o)>2&&(t.scroller.scrollTop+=o)}function Nr(e){if(e.widgets)for(var t=0;t=a&&(o=Xe(t,Bt($e(t,c))-e.wrapper.clientHeight),a=c)}return{from:o,to:Math.max(a,o+1)}}function Lr(e,t){var n=e.display,r=or(e.display);t.top<0&&(t.top=0);var i=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:n.scroller.scrollTop,o=An(e),a={};t.bottom-t.top>o&&(t.bottom=t.top+o);var s=e.doc.height+Sn(n),c=t.tops-r;if(t.topi+o){var u=Math.min(t.top,(l?s:t.bottom)-o);u!=i&&(a.scrollTop=u)}var p=e.options.fixedGutter?0:n.gutters.offsetWidth,f=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:n.scroller.scrollLeft-p,d=Nn(e)-n.gutters.offsetWidth,h=t.right-t.left>d;return h&&(t.right=t.left+d),t.left<10?a.scrollLeft=0:t.leftd+f-3&&(a.scrollLeft=t.right+(h?0:10)-d),a}function Dr(e,t){null!=t&&(Rr(e),e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+t)}function Ir(e){Rr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function Pr(e,t,n){null==t&&null==n||Rr(e),null!=t&&(e.curOp.scrollLeft=t),null!=n&&(e.curOp.scrollTop=n)}function Rr(e){var t=e.curOp.scrollToPos;t&&(e.curOp.scrollToPos=null,Mr(e,Yn(e,t.from),Yn(e,t.to),t.margin))}function Mr(e,t,n,r){var i=Lr(e,{left:Math.min(t.left,n.left),top:Math.min(t.top,n.top)-r,right:Math.max(t.right,n.right),bottom:Math.max(t.bottom,n.bottom)+r});Pr(e,i.scrollLeft,i.scrollTop)}function jr(e,t){Math.abs(e.doc.scrollTop-t)<2||(n||ui(e,{top:t}),Fr(e,t,!0),n&&ui(e),oi(e,100))}function Fr(e,t,n){t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),(e.display.scroller.scrollTop!=t||n)&&(e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t))}function Vr(e,t,n,r){t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(n?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!r||(e.doc.scrollLeft=t,di(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t))}function Qr(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Sn(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Cn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}var qr=function(e,t,n){this.cm=n;var r=this.vert=A("div",[A("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=A("div",[A("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");r.tabIndex=i.tabIndex=-1,e(r),e(i),fe(r,"scroll",(function(){r.clientHeight&&t(r.scrollTop,"vertical")})),fe(i,"scroll",(function(){i.clientWidth&&t(i.scrollLeft,"horizontal")})),this.checkedZeroWidth=!1,a&&s<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};qr.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.scrollTop=0,this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+o)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},qr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},qr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},qr.prototype.zeroWidthHack=function(){var e=b&&!h?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.visibility=this.vert.style.visibility="hidden",this.disableHoriz=new Q,this.disableVert=new Q},qr.prototype.enableZeroWidthBar=function(e,t,n){e.style.visibility="",t.set(1e3,(function r(){var i=e.getBoundingClientRect();("vert"==n?document.elementFromPoint(i.right-1,(i.top+i.bottom)/2):document.elementFromPoint((i.right+i.left)/2,i.bottom-1))!=e?e.style.visibility="hidden":t.set(1e3,r)}))},qr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Ur=function(){};function Gr(e,t){t||(t=Qr(e));var n=e.display.barWidth,r=e.display.barHeight;Br(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&Cr(e),Br(e,Qr(e)),n=e.display.barWidth,r=e.display.barHeight}function Br(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}Ur.prototype.update=function(){return{bottom:0,right:0}},Ur.prototype.setScrollLeft=function(){},Ur.prototype.setScrollTop=function(){},Ur.prototype.clear=function(){};var Kr={native:qr,null:Ur};function zr(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Kr[e.options.scrollbarStyle]((function(t){e.display.wrapper.insertBefore(t,e.display.scrollbarFiller),fe(t,"mousedown",(function(){e.state.focused&&setTimeout((function(){return e.display.input.focus()}),0)})),t.setAttribute("cm-not-content","true")}),(function(t,n){"horizontal"==n?Vr(e,t):jr(e,t)}),e),e.display.scrollbars.addClass&&P(e.display.wrapper,e.display.scrollbars.addClass)}var $r=0;function Hr(e){var t;e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++$r,markArrays:null},t=e.curOp,sn?sn.ops.push(t):t.ownsGroup=sn={ops:[t],delayedCallbacks:[]}}function Wr(e){var t=e.curOp;t&&function(e,t){var n=e.ownsGroup;if(n)try{!function(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new si(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Jr(e){e.updatedDisplay=e.mustUpdate&&ci(e.cm,e.update)}function Xr(e){var t=e.cm,n=t.display;e.updatedDisplay&&Cr(t),e.barMeasure=Qr(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Dn(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Cn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Nn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Zr(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!m){var o=A("div","​",null,"position: absolute;\n top: "+(t.top-n.viewOffset-On(e.display))+"px;\n height: "+(t.bottom-t.top+Cn(e)+n.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}(t,function(e,t,n,r){var i;null==r&&(r=0),e.options.lineWrapping||t!=n||(n="before"==t.sticky?tt(t.line,t.ch+1,"before"):t,t=t.ch?tt(t.line,"before"==t.sticky?t.ch-1:t.ch,"after"):t);for(var o=0;o<5;o++){var a=!1,s=Wn(e,t),c=n&&n!=t?Wn(e,n):s,l=Lr(e,i={left:Math.min(s.left,c.left),top:Math.min(s.top,c.top)-r,right:Math.max(s.left,c.left),bottom:Math.max(s.bottom,c.bottom)+r}),u=e.doc.scrollTop,p=e.doc.scrollLeft;if(null!=l.scrollTop&&(jr(e,l.scrollTop),Math.abs(e.doc.scrollTop-u)>1&&(a=!0)),null!=l.scrollLeft&&(Vr(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-p)>1&&(a=!0)),!a)break}return i}(t,ct(r,e.scrollToPos.from),ct(r,e.scrollToPos.to),e.scrollToPos.margin));var i=e.maybeHiddenMarkers,o=e.maybeUnhiddenMarkers;if(i)for(var a=0;a=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ht(e,t.highlightFrontier),i=[];t.iter(r.line,Math.min(t.first+t.size,e.display.viewTo+500),(function(o){if(r.line>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength?Ge(t.mode,r.state):null,c=ft(e,o,r,!0);s&&(r.state=s),o.styles=c.styles;var l=o.styleClasses,u=c.classes;u?o.styleClasses=u:l&&(o.styleClasses=null);for(var p=!a||a.length!=o.styles.length||l!=u&&(!l||!u||l.bgClass!=u.bgClass||l.textClass!=u.textClass),f=0;!p&&fn)return oi(e,e.options.workDelay),!0})),t.highlightFrontier=r.line,t.modeFrontier=Math.max(t.modeFrontier,r.line),i.length&&ti(e,(function(){for(var t=0;t=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==yr(e))return!1;hi(e)&&(mr(e),t.dims=sr(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),_t&&(o=Qt(e.doc,o),a=qt(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;(function(e,t,n){var r=e.display;0==r.view.length||t>=r.viewTo||n<=r.viewFrom?(r.view=an(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=an(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,fr(e,n)))),r.viewTo=n})(e,o,a),n.viewOffset=Bt($e(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=yr(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var u=function(e){if(e.hasFocus())return null;var t=I();if(!t||!D(e.display.lineDiv,t))return null;var n={activeElt:t};if(window.getSelection){var r=window.getSelection();r.anchorNode&&r.extend&&D(e.display.lineDiv,r.anchorNode)&&(n.anchorNode=r.anchorNode,n.anchorOffset=r.anchorOffset,n.focusNode=r.focusNode,n.focusOffset=r.focusOffset)}return n}(e);return l>4&&(n.lineDiv.style.display="none"),function(e,t,n){var r=e.display,i=e.options.lineNumbers,o=r.lineDiv,a=o.firstChild;function s(t){var n=t.nextSibling;return c&&b&&e.display.currentWheelTarget==t?t.style.display="none":t.parentNode.removeChild(t),n}for(var l=r.view,u=r.viewFrom,p=0;p-1&&(d=!1),pn(e,f,u,n)),d&&(C(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(et(e.options,u)))),a=f.node.nextSibling}else{var h=gn(e,f,u,n);o.insertBefore(h,a)}u+=f.size}for(;a;)a=s(a)}(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,function(e){if(e&&e.activeElt&&e.activeElt!=I()&&(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&D(document.body,e.anchorNode)&&D(document.body,e.focusNode))){var t=window.getSelection(),n=document.createRange();n.setEnd(e.anchorNode,e.anchorOffset),n.collapse(!1),t.removeAllRanges(),t.addRange(n),t.extend(e.focusNode,e.focusOffset)}}(u),C(n.cursorDiv),C(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,oi(e,400)),n.updateLineNumbers=null,!0}function li(e,t){for(var n=t.viewport,r=!0;;r=!1){if(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Nn(e))r&&(t.visible=Ar(e.display,e.doc,n));else if(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Sn(e.display)-An(e),n.top)}),t.visible=Ar(e.display,e.doc,n),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break;if(!ci(e,t))break;Cr(e);var i=Qr(e);gr(e),Gr(e,i),fi(e,i),t.force=!1}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function ui(e,t){var n=new si(e,t);if(ci(e,n)){Cr(e),li(e,n);var r=Qr(e);gr(e),Gr(e,r),fi(e,r),n.finish()}}function pi(e){var t=e.gutters.offsetWidth;e.sizer.style.marginLeft=t+"px",ln(e,"gutterChanged",e)}function fi(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Cn(e)+"px"}function di(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=cr(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=102&&(null==e.display.chromeScrollHack?e.display.sizer.style.pointerEvents="none":clearTimeout(e.display.chromeScrollHack),e.display.chromeScrollHack=setTimeout((function(){e.display.chromeScrollHack=null,e.display.sizer.style.pointerEvents=""}),100));var r=wi(t),i=r.x,o=r.y,a=Ei;0===t.deltaMode&&(i=t.deltaX,o=t.deltaY,a=1);var s=e.display,l=s.scroller,d=l.scrollWidth>l.clientWidth,h=l.scrollHeight>l.clientHeight;if(i&&d||o&&h){if(o&&b&&c)e:for(var m=t.target,v=s.view;m!=l;m=m.parentNode)for(var y=0;y=0&&nt(e,r.to())<=0)return n}return-1};var Oi=function(e,t){this.anchor=e,this.head=t};function Si(e,t,n){var r=e&&e.options.selectionsMayTouch,i=t[n];t.sort((function(e,t){return nt(e.from(),t.from())})),n=q(t,i);for(var o=1;o0:c>=0){var l=at(s.from(),a.from()),u=ot(s.to(),a.to()),p=s.empty()?a.from()==a.head:s.from()==s.head;o<=n&&--n,t.splice(--o,2,new Oi(p?u:l,p?l:u))}}return new ki(t,n)}function xi(e,t){return new ki([new Oi(e,t||e)],0)}function Ci(e){return e.text?tt(e.from.line+e.text.length-1,W(e.text).length+(1==e.text.length?e.from.ch:0)):e.to}function Ni(e,t){if(nt(e,t.from)<0)return e;if(nt(e,t.to)<=0)return Ci(t);var n=e.line+t.text.length-(t.to.line-t.from.line)-1,r=e.ch;return e.line==t.to.line&&(r+=Ci(t).ch-t.to.ch),tt(n,r)}function Ai(e,t){for(var n=[],r=0;r1&&e.remove(s.line+1,h-1),e.insert(s.line+1,y)}ln(e,"change",e,t)}function Mi(e,t,n){!function e(r,i,o){if(r.linked)for(var a=0;as-(e.cm?e.cm.options.historyEventDelay:500)||"*"==t.origin.charAt(0)))&&(o=function(e,t){return t?(qi(e.done),W(e.done)):e.done.length&&!W(e.done).ranges?W(e.done):e.done.length>1&&!e.done[e.done.length-2].ranges?(e.done.pop(),W(e.done)):void 0}(i,i.lastOp==r)))a=W(o.changes),0==nt(t.from,t.to)&&0==nt(t.from,a.to)?a.to=Ci(t):o.changes.push(Qi(e,t));else{var c=W(i.done);for(c&&c.ranges||Bi(e.sel,i.done),o={changes:[Qi(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=s,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,a||me(e,"historyAdded")}function Gi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||function(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}(e,o,W(i.done),t))?i.done[i.done.length-1]=t:Bi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&!1!==r.clearRedo&&qi(i.undone)}function Bi(e,t){var n=W(t);n&&n.ranges&&n.equals(e)||t.push(e)}function Ki(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),(function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o}))}function zi(e){if(!e)return null;for(var t,n=0;n-1&&(W(s)[p]=l[p],delete l[p])}}}return r}function Wi(e,t,n,r){if(r){var i=e.anchor;if(n){var o=nt(t,i)<0;o!=nt(n,i)<0?(i=t,t=n):o!=nt(t,n)<0&&(t=n)}return new Oi(i,t)}return new Oi(n||t,t)}function Yi(e,t,n,r,i){null==i&&(i=e.cm&&(e.cm.display.shift||e.extend)),to(e,new ki([Wi(e.sel.primary(),t,n,i)],0),r)}function Ji(e,t,n){for(var r=[],i=e.cm&&(e.cm.display.shift||e.extend),o=0;o=t.ch:s.to>t.ch))){if(i&&(me(c,"beforeCursorEnter"),c.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!c.atomic)continue;if(n){var p=c.find(r<0?1:-1),f=void 0;if((r<0?u:l)&&(p=co(e,p,-r,p&&p.line==t.line?o:null)),p&&p.line==t.line&&(f=nt(p,n))&&(r<0?f<0:f>0))return ao(e,p,t,r,i)}var d=c.find(r<0?-1:1);return(r<0?l:u)&&(d=co(e,d,r,d.line==t.line?o:null)),d?ao(e,d,t,r,i):null}}return t}function so(e,t,n,r,i){var o=r||1;return ao(e,t,n,o,i)||!i&&ao(e,t,n,o,!0)||ao(e,t,n,-o,i)||!i&&ao(e,t,n,-o,!0)||(e.cantEdit=!0,tt(e.first,0))}function co(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ct(e,tt(t.line-1)):null:n>0&&t.ch==(r||$e(e,t.line)).text.length?t.line0)){var u=[c,1],p=nt(l.from,s.from),f=nt(l.to,s.to);(p<0||!a.inclusiveLeft&&!p)&&u.push({from:l.from,to:s.from}),(f>0||!a.inclusiveRight&&!f)&&u.push({from:s.to,to:l.to}),i.splice.apply(i,u),c+=u.length-3}}return i}(e,t.from,t.to);if(r)for(var i=r.length-1;i>=0;--i)fo(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text,origin:t.origin});else fo(e,t)}}function fo(e,t){if(1!=t.text.length||""!=t.text[0]||0!=nt(t.from,t.to)){var n=Ai(e,t);Ui(e,t,n,e.cm?e.cm.curOp.id:NaN),vo(e,t,n,xt(e,t));var r=[];Mi(e,(function(e,n){n||-1!=q(r,e.history)||(Eo(e.history,t),r.push(e.history)),vo(e,t,null,xt(e,t))}))}}function ho(e,t,n){var r=e.cm&&e.cm.state.suppressEdits;if(!r||n){for(var i,o=e.history,a=e.sel,s="undo"==t?o.done:o.undone,c="undo"==t?o.undone:o.done,l=0;l=0;--d){var h=f(d);if(h)return h.v}}}}function mo(e,t){if(0!=t&&(e.first+=t,e.sel=new ki(Y(e.sel.ranges,(function(e){return new Oi(tt(e.anchor.line+t,e.anchor.ch),tt(e.head.line+t,e.head.ch))})),e.sel.primIndex),e.cm)){dr(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:tt(o,$e(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=He(e,t.from,t.to),n||(n=Ai(e,t)),e.cm?function(e,t,n){var r=e.doc,i=e.display,o=t.from,a=t.to,s=!1,c=o.line;e.options.lineWrapping||(c=Je(Vt($e(r,o.line))),r.iter(c,a.line+1,(function(e){if(e==i.maxLine)return s=!0,!0}))),r.sel.contains(t.from,t.to)>-1&&ye(e),Ri(r,t,n,lr(e)),e.options.lineWrapping||(r.iter(c,o.line+t.text.length,(function(e){var t=Kt(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,s=!1)})),s&&(e.curOp.updateMaxLine=!0)),function(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),!(e.highlightFrontiern;r--){var i=$e(e,r).stateAfter;if(i&&(!(i instanceof ut)||r+i.lookAhead1||!(this.children[0]instanceof To))){var s=[];this.collapse(s),this.children=[new To(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r0||0==a&&!1!==o.clearWhenEmpty)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=L("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(Ft(e,t.line,t,n,o)||t.line!=n.line&&Ft(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");_t=!0}o.addToHistory&&Ui(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,c=t.line,l=e.cm;if(e.iter(c,n.line+1,(function(r){l&&o.collapsed&&!l.options.lineWrapping&&Vt(r)==l.display.maxLine&&(s=!0),o.collapsed&&c!=t.line&&Ye(r,0),function(e,t,n){var r=n&&window.WeakSet&&(n.markedSpans||(n.markedSpans=new WeakSet));r&&e.markedSpans&&r.has(e.markedSpans)?e.markedSpans.push(t):(e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],r&&r.add(e.markedSpans)),t.marker.attachLine(e)}(r,new kt(o,c==t.line?t.ch:null,c==n.line?n.ch:null),e.cm&&e.cm.curOp),++c})),o.collapsed&&e.iter(t.line,n.line+1,(function(t){Ut(e,t)&&Ye(t,0)})),o.clearOnEnter&&fe(o,"beforeCursorEnter",(function(){return o.clear()})),o.readOnly&&(Tt=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++So,o.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),o.collapsed)dr(l,t.line,n.line+1);else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title)for(var u=t.line;u<=n.line;u++)hr(l,u,"text");o.atomic&&io(l.doc),ln(l,"markerAdded",l,o)}return o}xo.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&Hr(e),ge(this,"clear")){var n=this.find();n&&ln(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=u,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&dr(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&io(e.doc)),e&&ln(e,"markerCleared",e,this,r,i),t&&Wr(e),this.parent&&this.parent.clear()}},xo.prototype.find=function(e,t){var n,r;null==e&&"bookmark"==this.type&&(e=1);for(var i=0;i=0;c--)po(this,r[c]);s?eo(this,s):this.cm&&Ir(this.cm)})),undo:ii((function(){ho(this,"undo")})),redo:ii((function(){ho(this,"redo")})),undoSelection:ii((function(){ho(this,"undo",!0)})),redoSelection:ii((function(){ho(this,"redo",!0)})),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ct(this,e),t=ct(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,(function(o){var a=o.markedSpans;if(a)for(var s=0;s=c.to||null==c.from&&i!=e.line||null!=c.from&&i==t.line&&c.from>=t.ch||n&&!n(c.marker)||r.push(c.marker.parent||c.marker)}++i})),r},getAllMarks:function(){var e=[];return this.iter((function(t){var n=t.markedSpans;if(n)for(var r=0;re)return t=e,!0;e-=o,++n})),ct(this,tt(n,t))},indexFromPos:function(e){var t=(e=ct(this,e)).ch;if(e.linet&&(t=e.from),null!=e.to&&e.to-1)return t.state.draggingText(e),void setTimeout((function(){return t.display.input.focus()}),20);try{var p=e.dataTransfer.getData("Text");if(p){var f;if(t.state.draggingText&&!t.state.draggingText.copy&&(f=t.listSelections()),no(t.doc,xi(n,n)),f)for(var d=0;d=0;t--)yo(e.doc,"",r[t].from,r[t].to,"+delete");Ir(e)}))}function ea(e,t,n){var r=oe(e.text,t+n,n);return r<0||r>e.text.length?null:r}function ta(e,t,n){var r=ea(e,t.ch,n);return null==r?null:new tt(t.line,r,n<0?"after":"before")}function na(e,t,n,r,i){if(e){"rtl"==t.doc.direction&&(i=-i);var o=ue(n,t.doc.direction);if(o){var a,s=i<0?W(o):o[0],c=i<0==(1==s.level)?"after":"before";if(s.level>0||"rtl"==t.doc.direction){var l=Pn(t,n);a=i<0?n.text.length-1:0;var u=Rn(t,l,a).top;a=ae((function(e){return Rn(t,l,e).top==u}),i<0==(1==s.level)?s.from:s.to-1,a),"before"==c&&(a=ea(n,a,1))}else a=i<0?s.to:s.from;return new tt(r,a,c)}}return new tt(r,i<0?n.text.length:0,i<0?"before":"after")}Ko.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ko.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ko.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ko.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ko.default=b?Ko.macDefault:Ko.pcDefault;var ra={selectAll:lo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),G)},killLine:function(e){return Zo(e,(function(t){if(t.empty()){var n=$e(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new tt(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),tt(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=$e(e.doc,i.line-1).text;a&&(i=new tt(i.line,1),e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),tt(i.line-1,a.length-1),i,"+transpose"))}n.push(new Oi(i,i))}e.setSelections(n)}))},newlineAndIndent:function(e){return ti(e,(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange(e.doc.lineSeparator(),t[n].anchor,t[n].head,"+input");t=e.listSelections();for(var r=0;r-1&&(nt((i=l.ranges[i]).from(),t)<0||t.xRel>0)&&(nt(i.to(),t)>0||t.xRel<0)?function(e,t,n,r){var i=e.display,o=!1,l=ni(e,(function(t){c&&(i.scroller.draggable=!1),e.state.draggingText=!1,e.state.delayingBlurEvent&&(e.hasFocus()?e.state.delayingBlurEvent=!1:Or(e)),he(i.wrapper.ownerDocument,"mouseup",l),he(i.wrapper.ownerDocument,"mousemove",u),he(i.scroller,"dragstart",p),he(i.scroller,"drop",l),o||(Ee(t),r.addNew||Yi(e.doc,n,null,null,r.extend),c&&!d||a&&9==s?setTimeout((function(){i.wrapper.ownerDocument.body.focus({preventScroll:!0}),i.input.focus()}),20):i.input.focus())})),u=function(e){o=o||Math.abs(t.clientX-e.clientX)+Math.abs(t.clientY-e.clientY)>=10},p=function(){return o=!0};c&&(i.scroller.draggable=!0),e.state.draggingText=l,l.copy=!r.moveOnDrag,fe(i.wrapper.ownerDocument,"mouseup",l),fe(i.wrapper.ownerDocument,"mousemove",u),fe(i.scroller,"dragstart",p),fe(i.scroller,"drop",l),e.state.delayingBlurEvent=!0,setTimeout((function(){return i.input.focus()}),20),i.scroller.dragDrop&&i.scroller.dragDrop()}(e,r,t,o):function(e,t,n,r){a&&Or(e);var i=e.display,o=e.doc;Ee(t);var s,c,l=o.sel,u=l.ranges;if(r.addNew&&!r.extend?(c=o.sel.contains(n),s=c>-1?u[c]:new Oi(n,n)):(s=o.sel.primary(),c=o.sel.primIndex),"rectangle"==r.unit)r.addNew||(s=new Oi(n,n)),n=pr(e,t,!0,!0),c=-1;else{var p=ba(e,n,r.unit);s=r.extend?Wi(s,p.anchor,p.head,r.extend):p}r.addNew?-1==c?(c=u.length,to(o,Si(e,u.concat([s]),c),{scroll:!1,origin:"*mouse"})):u.length>1&&u[c].empty()&&"char"==r.unit&&!r.extend?(to(o,Si(e,u.slice(0,c).concat(u.slice(c+1)),0),{scroll:!1,origin:"*mouse"}),l=o.sel):Xi(o,c,s,B):(c=0,to(o,new ki([s],0),B),l=o.sel);var f=n;function d(t){if(0!=nt(f,t))if(f=t,"rectangle"==r.unit){for(var i=[],a=e.options.tabSize,u=V($e(o,n.line).text,n.ch,a),p=V($e(o,t.line).text,t.ch,a),d=Math.min(u,p),h=Math.max(u,p),m=Math.min(n.line,t.line),v=Math.min(e.lastLine(),Math.max(n.line,t.line));m<=v;m++){var y=$e(o,m).text,g=z(y,d,a);d==h?i.push(new Oi(tt(m,g),tt(m,g))):y.length>g&&i.push(new Oi(tt(m,g),tt(m,z(y,h,a))))}i.length||i.push(new Oi(n,n)),to(o,Si(e,l.ranges.slice(0,c).concat(i),c),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b,E=s,w=ba(e,t,r.unit),T=E.anchor;nt(w.anchor,T)>0?(b=w.head,T=at(E.from(),w.anchor)):(b=w.anchor,T=ot(E.to(),w.head));var _=l.ranges.slice(0);_[c]=function(e,t){var n=t.anchor,r=t.head,i=$e(e.doc,n.line);if(0==nt(n,r)&&n.sticky==r.sticky)return t;var o=ue(i);if(!o)return t;var a=ce(o,n.ch,n.sticky),s=o[a];if(s.from!=n.ch&&s.to!=n.ch)return t;var c,l=a+(s.from==n.ch==(1!=s.level)?0:1);if(0==l||l==o.length)return t;if(r.line!=n.line)c=(r.line-n.line)*("ltr"==e.doc.direction?1:-1)>0;else{var u=ce(o,r.ch,r.sticky),p=u-a||(r.ch-n.ch)*(1==s.level?-1:1);c=u==l-1||u==l?p<0:p>0}var f=o[l+(c?-1:0)],d=c==(1==f.level),h=d?f.from:f.to,m=d?"after":"before";return n.ch==h&&n.sticky==m?t:new Oi(new tt(n.line,h,m),r)}(e,new Oi(ct(o,T),b)),to(o,Si(e,_,c),B)}}var h=i.wrapper.getBoundingClientRect(),m=0;function v(t){var n=++m,a=pr(e,t,!0,"rectangle"==r.unit);if(a)if(0!=nt(a,f)){e.curOp.focus=I(),d(a);var s=Ar(i,o);(a.line>=s.to||a.lineh.bottom?20:0;c&&setTimeout(ni(e,(function(){m==n&&(i.scroller.scrollTop+=c,v(t))})),50)}}function y(t){e.state.selectingText=!1,m=1/0,t&&(Ee(t),i.input.focus()),he(i.wrapper.ownerDocument,"mousemove",g),he(i.wrapper.ownerDocument,"mouseup",b),o.history.lastSelOrigin=null}var g=ni(e,(function(e){0!==e.buttons&&Oe(e)?v(e):y(e)})),b=ni(e,y);e.state.selectingText=b,fe(i.wrapper.ownerDocument,"mousemove",g),fe(i.wrapper.ownerDocument,"mouseup",b)}(e,r,t,o)}(t,r,o,e):ke(e)==n.scroller&&Ee(e):2==i?(r&&Yi(t.doc,r),setTimeout((function(){return n.input.focus()}),20)):3==i&&(k?t.display.input.onContextMenu(e):Or(t)))}}function ba(e,t,n){if("char"==n)return new Oi(t,t);if("word"==n)return e.findWordAt(t);if("line"==n)return new Oi(tt(t.line,0),ct(e.doc,tt(t.line+1,0)));var r=n(e,t);return new Oi(r.from,r.to)}function Ea(e,t,n,r){var i,o;if(t.touches)i=t.touches[0].clientX,o=t.touches[0].clientY;else try{i=t.clientX,o=t.clientY}catch(e){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ee(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!ge(e,n))return Te(t);o-=s.top-a.viewOffset;for(var c=0;c=i)return me(e,n,e,Xe(e.doc,o),e.display.gutterSpecs[c].className,t),Te(t)}}function wa(e,t){return Ea(e,t,"gutterClick",!0)}function Ta(e,t){kn(e.display,t)||function(e,t){return!!ge(e,"gutterContextMenu")&&Ea(e,t,"gutterContextMenu",!1)}(e,t)||ve(e,t,"contextmenu")||k||e.display.input.onContextMenu(t)}function _a(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Un(e)}ya.prototype.compare=function(e,t,n){return this.time+400>e&&0==nt(t,this.pos)&&n==this.button};var ka={toString:function(){return"CodeMirror.Init"}},Oa={},Sa={};function xa(e,t,n){if(!t!=!(n&&n!=ka)){var r=e.display.dragFunctions,i=t?fe:he;i(e.display.scroller,"dragstart",r.start),i(e.display.scroller,"dragenter",r.enter),i(e.display.scroller,"dragover",r.over),i(e.display.scroller,"dragleave",r.leave),i(e.display.scroller,"drop",r.drop)}}function Ca(e){e.options.lineWrapping?(P(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),zt(e)),ur(e),dr(e),Un(e),setTimeout((function(){return Gr(e)}),100)}function Na(e,t){var n=this;if(!(this instanceof Na))return new Na(e,t);this.options=t=t?F(t):{},F(Oa,t,!1);var r=t.value;"string"==typeof r?r=new Io(r,t.mode,null,t.lineSeparator,t.direction):t.mode&&(r.modeOption=t.mode),this.doc=r;var i=new Na.inputStyles[t.inputStyle](this),o=this.display=new gi(e,r,i,t);for(var l in o.wrapper.CodeMirror=this,_a(this),t.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),zr(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Q,keySeq:null,specialChars:null},t.autofocus&&!g&&o.input.focus(),a&&s<11&&setTimeout((function(){return n.display.input.reset(!0)}),20),function(e){var t=e.display;fe(t.scroller,"mousedown",ni(e,ga)),fe(t.scroller,"dblclick",a&&s<11?ni(e,(function(t){if(!ve(e,t)){var n=pr(e,t);if(n&&!wa(e,t)&&!kn(e.display,t)){Ee(t);var r=e.findWordAt(n);Yi(e.doc,r.anchor,r.head)}}})):function(t){return ve(e,t)||Ee(t)}),fe(t.scroller,"contextmenu",(function(t){return Ta(e,t)})),fe(t.input.getField(),"contextmenu",(function(n){t.scroller.contains(n.target)||Ta(e,n)}));var n,r={end:0};function i(){t.activeTouch&&(n=setTimeout((function(){return t.activeTouch=null}),1e3),(r=t.activeTouch).end=+new Date)}function o(e){if(1!=e.touches.length)return!1;var t=e.touches[0];return t.radiusX<=1&&t.radiusY<=1}function c(e,t){if(null==t.left)return!0;var n=t.left-e.left,r=t.top-e.top;return n*n+r*r>400}fe(t.scroller,"touchstart",(function(i){if(!ve(e,i)&&!o(i)&&!wa(e,i)){t.input.ensurePolled(),clearTimeout(n);var a=+new Date;t.activeTouch={start:a,moved:!1,prev:a-r.end<=300?r:null},1==i.touches.length&&(t.activeTouch.left=i.touches[0].pageX,t.activeTouch.top=i.touches[0].pageY)}})),fe(t.scroller,"touchmove",(function(){t.activeTouch&&(t.activeTouch.moved=!0)})),fe(t.scroller,"touchend",(function(n){var r=t.activeTouch;if(r&&!kn(t,n)&&null!=r.left&&!r.moved&&new Date-r.start<300){var o,a=e.coordsChar(t.activeTouch,"page");o=!r.prev||c(r,r.prev)?new Oi(a,a):!r.prev.prev||c(r,r.prev.prev)?e.findWordAt(a):new Oi(tt(a.line,0),ct(e.doc,tt(a.line+1,0))),e.setSelection(o.anchor,o.head),e.focus(),Ee(n)}i()})),fe(t.scroller,"touchcancel",i),fe(t.scroller,"scroll",(function(){t.scroller.clientHeight&&(jr(e,t.scroller.scrollTop),Vr(e,t.scroller.scrollLeft,!0),me(e,"scroll",e))})),fe(t.scroller,"mousewheel",(function(t){return _i(e,t)})),fe(t.scroller,"DOMMouseScroll",(function(t){return _i(e,t)})),fe(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0})),t.dragFunctions={enter:function(t){ve(e,t)||_e(t)},over:function(t){ve(e,t)||(function(e,t){var n=pr(e,t);if(n){var r=document.createDocumentFragment();Er(e,n,r),e.display.dragCursor||(e.display.dragCursor=A("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),N(e.display.dragCursor,r)}}(e,t),_e(t))},start:function(t){return function(e,t){if(a&&(!e.state.draggingText||+new Date-Po<100))_e(t);else if(!ve(e,t)&&!kn(e.display,t)&&(t.dataTransfer.setData("Text",e.getSelection()),t.dataTransfer.effectAllowed="copyMove",t.dataTransfer.setDragImage&&!d)){var n=A("img",null,null,"position: fixed; left: 0; top: 0;");n.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",f&&(n.width=n.height=1,e.display.wrapper.appendChild(n),n._top=n.offsetTop),t.dataTransfer.setDragImage(n,0,0),f&&n.parentNode.removeChild(n)}}(e,t)},drop:ni(e,Ro),leave:function(t){ve(e,t)||Mo(e)}};var l=t.input.getField();fe(l,"keyup",(function(t){return da.call(e,t)})),fe(l,"keydown",ni(e,fa)),fe(l,"keypress",ni(e,ha)),fe(l,"focus",(function(t){return Sr(e,t)})),fe(l,"blur",(function(t){return xr(e,t)}))}(this),Vo(),Hr(this),this.curOp.forceUpdate=!0,ji(this,r),t.autofocus&&!g||this.hasFocus()?setTimeout((function(){n.hasFocus()&&!n.state.focused&&Sr(n)}),20):xr(this),Sa)Sa.hasOwnProperty(l)&&Sa[l](this,t[l],ka);hi(this),t.finishInit&&t.finishInit(this);for(var u=0;u150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=t>o.first?V($e(o,t-1).text,null,a):0:"add"==n?l=c+e.options.indentUnit:"subtract"==n?l=c-e.options.indentUnit:"number"==typeof n&&(l=c+n),l=Math.max(0,l);var p="",f=0;if(e.options.indentWithTabs)for(var d=Math.floor(l/a);d;--d)f+=a,p+="\t";if(fa,c=De(t),l=null;if(s&&r.ranges.length>1)if(Da&&Da.text.join("\n")==t){if(r.ranges.length%Da.text.length==0){l=[];for(var u=0;u=0;f--){var d=r.ranges[f],h=d.from(),m=d.to();d.empty()&&(n&&n>0?h=tt(h.line,h.ch-n):e.state.overwrite&&!s?m=tt(m.line,Math.min($e(o,m.line).text.length,m.ch+W(c).length)):s&&Da&&Da.lineWise&&Da.text.join("\n")==c.join("\n")&&(h=m=tt(h.line,0)));var v={from:h,to:m,text:l?l[f%l.length]:c,origin:i||(s?"paste":e.state.cutIncoming>a?"cut":"+input")};po(e.doc,v),ln(e,"inputRead",e,v)}t&&!s&&Ma(e,t),Ir(e),e.curOp.updateInput<2&&(e.curOp.updateInput=p),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function Ra(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||!t.hasFocus()||ti(t,(function(){return Pa(t,n,0,null,"paste")})),!0}function Ma(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=La(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test($e(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=La(e,i.head.line,"smart"));a&&ln(e,"electricInput",e,i.head.line)}}}function ja(e){for(var t=[],n=[],r=0;r0?0:-1));if(isNaN(u))a=null;else{var p=n>0?u>=55296&&u<56320:u>=56320&&u<57343;a=new tt(t.line,Math.max(0,Math.min(s.text.length,t.ch+n*(p?2:1))),-n)}}else a=i?function(e,t,n,r){var i=ue(t,e.doc.direction);if(!i)return ta(t,n,r);n.ch>=t.text.length?(n.ch=t.text.length,n.sticky="before"):n.ch<=0&&(n.ch=0,n.sticky="after");var o=ce(i,n.ch,n.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(r>0?a.to>n.ch:a.from=a.from&&f>=u.begin)){var d=p?"before":"after";return new tt(n.line,f,d)}}var h=function(e,t,r){for(var o=function(e,t){return t?new tt(n.line,c(e,1),"before"):new tt(n.line,e,"after")};e>=0&&e0==(1!=a.level),l=s?r.begin:c(r.end,-1);if(a.from<=l&&l0?u.end:c(u.begin,-1);return null==v||r>0&&v==t.text.length||!(m=h(r>0?0:i.length-1,r,l(v)))?null:m}(e.cm,s,t,n):ta(s,t,n);if(null==a){if(o||((l=t.line+c)=e.first+e.size||(t=new tt(l,t.ch,t.sticky),!(s=$e(e,l)))))return!1;t=na(i,e.cm,s,t.line,c)}else t=a;return!0}if("char"==r||"codepoint"==r)l();else if("column"==r)l(!0);else if("word"==r||"group"==r)for(var u=null,p="group"==r,f=e.cm&&e.cm.getHelper(t,"wordChars"),d=!0;!(n<0)||l(!d);d=!1){var h=s.text.charAt(t.ch)||"\n",m=te(h,f)?"w":p&&"\n"==h?"n":!p||/\s/.test(h)?null:"p";if(!p||d||m||(m="s"),u&&u!=m){n<0&&(n=1,l(),t.sticky="after");break}if(m&&(u=m),n>0&&!l(!d))break}var v=so(e,t,o,a,!0);return rt(o,v)&&(v.hitSide=!0),v}function qa(e,t,n,r){var i,o,a=e.doc,s=t.left;if("page"==r){var c=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(c-.5*or(e.display),3);i=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;(o=Xn(e,s,i)).outside;){if(n<0?i<=0:i>=a.height){o.hitSide=!0;break}i+=5*n}return o}var Ua=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Q,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};function Ga(e,t){var n=In(e,t.line);if(!n||n.hidden)return null;var r=$e(e.doc,t.line),i=Ln(n,r,t.line),o=ue(r,e.doc.direction),a="left";o&&(a=ce(o,t.ch)%2?"right":"left");var s=Fn(i.map,t.ch,a);return s.offset="right"==s.collapse?s.end:s.start,s}function Ba(e,t){return t&&(e.bad=!0),e}function Ka(e,t,n){var r;if(t==e.display.lineDiv){if(!(r=e.display.lineDiv.childNodes[n]))return Ba(e.clipPos(tt(e.display.viewTo-1)),!0);t=null,n=0}else for(r=t;;r=r.parentNode){if(!r||r==e.display.lineDiv)return null;if(r.parentNode&&r.parentNode==e.display.lineDiv)break}for(var i=0;i=t.display.viewTo||o.line=t.display.viewFrom&&Ga(t,i)||{node:c[0].measure.map[2],offset:0},u=o.liner.firstLine()&&(a=tt(a.line-1,$e(r.doc,a.line-1).length)),s.ch==$e(r.doc,s.line).text.length&&s.linei.viewTo-1)return!1;a.line==i.viewFrom||0==(e=fr(r,a.line))?(t=Je(i.view[0].line),n=i.view[0].node):(t=Je(i.view[e].line),n=i.view[e-1].node.nextSibling);var c,l,u=fr(r,s.line);if(u==i.view.length-1?(c=i.viewTo-1,l=i.lineDiv.lastChild):(c=Je(i.view[u+1].line)-1,l=i.view[u+1].node.previousSibling),!n)return!1;for(var p=r.doc.splitLines(function(e,t,n,r,i){var o="",a=!1,s=e.doc.lineSeparator(),c=!1;function l(){a&&(o+=s,c&&(o+=s),a=c=!1)}function u(e){e&&(l(),o+=e)}function p(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(n)return void u(n);var o,f=t.getAttribute("cm-marker");if(f){var d=e.findMarks(tt(r,0),tt(i+1,0),(v=+f,function(e){return e.id==v}));return void(d.length&&(o=d[0].find(0))&&u(He(e.doc,o.from,o.to).join(s)))}if("false"==t.getAttribute("contenteditable"))return;var h=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&0==t.textContent.length)return;h&&l();for(var m=0;m1&&f.length>1;)if(W(p)==W(f))p.pop(),f.pop(),c--;else{if(p[0]!=f[0])break;p.shift(),f.shift(),t++}for(var d=0,h=0,m=p[0],v=f[0],y=Math.min(m.length,v.length);da.ch&&g.charCodeAt(g.length-h-1)==b.charCodeAt(b.length-h-1);)d--,h++;p[p.length-1]=g.slice(0,g.length-h).replace(/^\u200b+/,""),p[0]=p[0].slice(d).replace(/\u200b+$/,"");var w=tt(t,d),T=tt(c,f.length?W(f).length-h:0);return p.length>1||p[0]||nt(w,T)?(yo(r.doc,p,w,T,"+input"),!0):void 0},Ua.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ua.prototype.reset=function(){this.forceCompositionEnd()},Ua.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Ua.prototype.readFromDOMSoon=function(){var e=this;null==this.readDOMTimeout&&(this.readDOMTimeout=setTimeout((function(){if(e.readDOMTimeout=null,e.composing){if(!e.composing.done)return;e.composing=null}e.updateFromDOM()}),80))},Ua.prototype.updateFromDOM=function(){var e=this;!this.cm.isReadOnly()&&this.pollContent()||ti(this.cm,(function(){return dr(e.cm)}))},Ua.prototype.setUneditable=function(e){e.contentEditable="false"},Ua.prototype.onKeyPress=function(e){0==e.charCode||this.composing||(e.preventDefault(),this.cm.isReadOnly()||ni(this.cm,Pa)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0))},Ua.prototype.readOnlyChanged=function(e){this.div.contentEditable=String("nocursor"!=e)},Ua.prototype.onContextMenu=function(){},Ua.prototype.resetPosition=function(){},Ua.prototype.needsContentAttribute=!0;var $a=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Q,this.hasSelection=!1,this.composing=null};$a.prototype.init=function(e){var t=this,n=this,r=this.cm;this.createField(e);var i=this.textarea;function o(e){if(!ve(r,e)){if(r.somethingSelected())Ia({lineWise:!1,text:r.getSelections()});else{if(!r.options.lineWiseCopyCut)return;var t=ja(r);Ia({lineWise:!0,text:t.text}),"cut"==e.type?r.setSelections(t.ranges,null,G):(n.prevInput="",i.value=t.text.join("\n"),M(i))}"cut"==e.type&&(r.state.cutIncoming=+new Date)}}e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),v&&(i.style.width="0px"),fe(i,"input",(function(){a&&s>=9&&t.hasSelection&&(t.hasSelection=null),n.poll()})),fe(i,"paste",(function(e){ve(r,e)||Ra(e,r)||(r.state.pasteIncoming=+new Date,n.fastPoll())})),fe(i,"cut",o),fe(i,"copy",o),fe(e.scroller,"paste",(function(t){if(!kn(e,t)&&!ve(r,t)){if(!i.dispatchEvent)return r.state.pasteIncoming=+new Date,void n.focus();var o=new Event("paste");o.clipboardData=t.clipboardData,i.dispatchEvent(o)}})),fe(e.lineSpace,"selectstart",(function(t){kn(e,t)||Ee(t)})),fe(i,"compositionstart",(function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}})),fe(i,"compositionend",(function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)}))},$a.prototype.createField=function(e){this.wrapper=Va(),this.textarea=this.wrapper.firstChild},$a.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},$a.prototype.prepareSelection=function(){var e=this.cm,t=e.display,n=e.doc,r=br(e);if(e.options.moveInputWithCursor){var i=Wn(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},$a.prototype.showSelection=function(e){var t=this.cm.display;N(t.cursorDiv,e.cursors),N(t.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},$a.prototype.reset=function(e){if(!this.contextMenuPending&&!this.composing){var t=this.cm;if(t.somethingSelected()){this.prevInput="";var n=t.getSelection();this.textarea.value=n,t.state.focused&&M(this.textarea),a&&s>=9&&(this.hasSelection=n)}else e||(this.prevInput=this.textarea.value="",a&&s>=9&&(this.hasSelection=null))}},$a.prototype.getField=function(){return this.textarea},$a.prototype.supportsTouch=function(){return!1},$a.prototype.focus=function(){if("nocursor"!=this.cm.options.readOnly&&(!g||I()!=this.textarea))try{this.textarea.focus()}catch(e){}},$a.prototype.blur=function(){this.textarea.blur()},$a.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},$a.prototype.receivedFocus=function(){this.slowPoll()},$a.prototype.slowPoll=function(){var e=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,(function(){e.poll(),e.cm.state.focused&&e.slowPoll()}))},$a.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0,t.polling.set(20,(function n(){t.poll()||e?(t.pollingFast=!1,t.slowPoll()):(e=!0,t.polling.set(60,n))}))},$a.prototype.poll=function(){var e=this,t=this.cm,n=this.textarea,r=this.prevInput;if(this.contextMenuPending||!t.state.focused||Ie(n)&&!r&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var i=n.value;if(i==r&&!t.somethingSelected())return!1;if(a&&s>=9&&this.hasSelection===i||b&&/[\uf700-\uf7ff]/.test(i))return t.display.input.reset(),!1;if(t.doc.sel==t.display.selForContextMenu){var o=i.charCodeAt(0);if(8203!=o||r||(r="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var c=0,l=Math.min(r.length,i.length);c1e3||i.indexOf("\n")>-1?n.value=e.prevInput="":e.prevInput=i,e.composing&&(e.composing.range.clear(),e.composing.range=t.markText(e.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"}))})),!0},$a.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},$a.prototype.onKeyPress=function(){a&&s>=9&&(this.hasSelection=null),this.fastPoll()},$a.prototype.onContextMenu=function(e){var t=this,n=t.cm,r=n.display,i=t.textarea;t.contextMenuPending&&t.contextMenuPending();var o=pr(n,e),l=r.scroller.scrollTop;if(o&&!f){n.options.resetSelectionOnContextMenu&&-1==n.doc.sel.contains(o)&&ni(n,to)(n.doc,xi(o),G);var u,p=i.style.cssText,d=t.wrapper.style.cssText,h=t.wrapper.offsetParent.getBoundingClientRect();if(t.wrapper.style.cssText="position: static",i.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(e.clientY-h.top-5)+"px; left: "+(e.clientX-h.left-5)+"px;\n z-index: 1000; background: "+(a?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",c&&(u=window.scrollY),r.input.focus(),c&&window.scrollTo(null,u),r.input.reset(),n.somethingSelected()||(i.value=t.prevInput=" "),t.contextMenuPending=y,r.selForContextMenu=n.doc.sel,clearTimeout(r.detectingSelectAll),a&&s>=9&&v(),k){_e(e);var m=function(){he(window,"mouseup",m),setTimeout(y,20)};fe(window,"mouseup",m)}else setTimeout(y,50)}function v(){if(null!=i.selectionStart){var e=n.somethingSelected(),o="​"+(e?i.value:"");i.value="⇚",i.value=o,t.prevInput=e?"":"​",i.selectionStart=1,i.selectionEnd=o.length,r.selForContextMenu=n.doc.sel}}function y(){if(t.contextMenuPending==y&&(t.contextMenuPending=!1,t.wrapper.style.cssText=d,i.style.cssText=p,a&&s<9&&r.scrollbars.setScrollTop(r.scroller.scrollTop=l),null!=i.selectionStart)){(!a||a&&s<9)&&v();var e=0,o=function(){r.selForContextMenu==n.doc.sel&&0==i.selectionStart&&i.selectionEnd>0&&"​"==t.prevInput?ni(n,lo)(n):e++<10?r.detectingSelectAll=setTimeout(o,500):(r.selForContextMenu=null,r.input.reset())};r.detectingSelectAll=setTimeout(o,200)}}},$a.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled="nocursor"==e,this.textarea.readOnly=!!e},$a.prototype.setUneditable=function(){},$a.prototype.needsContentAttribute=!1,function(e){var t=e.optionHandlers;function n(n,r,i,o){e.defaults[n]=r,i&&(t[n]=o?function(e,t,n){n!=ka&&i(e,t,n)}:i)}e.defineOption=n,e.Init=ka,n("value","",(function(e,t){return e.setValue(t)}),!0),n("mode",null,(function(e,t){e.doc.modeOption=t,Di(e)}),!0),n("indentUnit",2,Di,!0),n("indentWithTabs",!1),n("smartIndent",!0),n("tabSize",4,(function(e){Ii(e),Un(e),dr(e)}),!0),n("lineSeparator",null,(function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter((function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(-1==o)break;i=o+t.length,n.push(tt(r,o))}r++}));for(var i=n.length-1;i>=0;i--)yo(e.doc,t,n[i],tt(n[i].line,n[i].ch+t.length))}})),n("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,(function(e,t,n){e.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g"),n!=ka&&e.refresh()})),n("specialCharPlaceholder",Zt,(function(e){return e.refresh()}),!0),n("electricChars",!0),n("inputStyle",g?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),!0),n("spellcheck",!1,(function(e,t){return e.getInputField().spellcheck=t}),!0),n("autocorrect",!1,(function(e,t){return e.getInputField().autocorrect=t}),!0),n("autocapitalize",!1,(function(e,t){return e.getInputField().autocapitalize=t}),!0),n("rtlMoveVisually",!w),n("wholeLineUpdateBefore",!0),n("theme","default",(function(e){_a(e),yi(e)}),!0),n("keyMap","default",(function(e,t,n){var r=Xo(t),i=n!=ka&&Xo(n);i&&i.detach&&i.detach(e,r),r.attach&&r.attach(e,i||null)})),n("extraKeys",null),n("configureMouse",null),n("lineWrapping",!1,Ca,!0),n("gutters",[],(function(e,t){e.display.gutterSpecs=mi(t,e.options.lineNumbers),yi(e)}),!0),n("fixedGutter",!0,(function(e,t){e.display.gutters.style.left=t?cr(e.display)+"px":"0",e.refresh()}),!0),n("coverGutterNextToScrollbar",!1,(function(e){return Gr(e)}),!0),n("scrollbarStyle","native",(function(e){zr(e),Gr(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)}),!0),n("lineNumbers",!1,(function(e,t){e.display.gutterSpecs=mi(e.options.gutters,t),yi(e)}),!0),n("firstLineNumber",1,yi,!0),n("lineNumberFormatter",(function(e){return e}),yi,!0),n("showCursorWhenSelecting",!1,gr,!0),n("resetSelectionOnContextMenu",!0),n("lineWiseCopyCut",!0),n("pasteLinesPerSelection",!0),n("selectionsMayTouch",!1),n("readOnly",!1,(function(e,t){"nocursor"==t&&(xr(e),e.display.input.blur()),e.display.input.readOnlyChanged(t)})),n("screenReaderLabel",null,(function(e,t){t=""===t?null:t,e.display.input.screenReaderLabelChanged(t)})),n("disableInput",!1,(function(e,t){t||e.display.input.reset()}),!0),n("dragDrop",!0,xa),n("allowDropFileTypes",null),n("cursorBlinkRate",530),n("cursorScrollMargin",0),n("cursorHeight",1,gr,!0),n("singleCursorHeightPerLine",!0,gr,!0),n("workTime",100),n("workDelay",100),n("flattenSpans",!0,Ii,!0),n("addModeClass",!1,Ii,!0),n("pollInterval",100),n("undoDepth",200,(function(e,t){return e.doc.history.undoDepth=t})),n("historyEventDelay",1250),n("viewportMargin",10,(function(e){return e.refresh()}),!0),n("maxHighlightLength",1e4,Ii,!0),n("moveInputWithCursor",!0,(function(e,t){t||e.display.input.resetPosition()})),n("tabindex",null,(function(e,t){return e.display.input.getField().tabIndex=t||""})),n("autofocus",null),n("direction","ltr",(function(e,t){return e.doc.setDirection(t)}),!0),n("phrases",null)}(Na),function(e){var t=e.optionHandlers,n=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,n){var r=this.options,i=r[e];r[e]==n&&"mode"!=e||(r[e]=n,t.hasOwnProperty(e)&&ni(this,t[e])(this,n,i),me(this,"optionChange",this,e))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xo(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(La(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Ir(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var c=s;c0&&Xi(this.doc,r,new Oi(o,l[r].to()),G)}}})),getTokenAt:function(e,t){return bt(this,e,t)},getLineTokens:function(e,t){return bt(this,tt(e),t,!0)},getTokenTypeAt:function(e){e=ct(this.doc,e);var t,n=dt(this,$e(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]o&&(e=o,i=!0),r=$e(this.doc,e)}else r=e;return zn(this,r,{top:0,left:0},t||"page",n||i).top+(i?this.doc.height-Bt(r):0)},defaultTextHeight:function(){return or(this.display)},defaultCharWidth:function(){return ar(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o,a,s,c=this.display,l=(e=Wn(this,ct(this.doc,e))).bottom,u=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),c.sizer.appendChild(t),"over"==r)l=e.top;else if("above"==r||"near"==r){var p=Math.max(c.wrapper.clientHeight,this.doc.height),f=Math.max(c.sizer.clientWidth,c.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>p)&&e.top>t.offsetHeight?l=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=p&&(l=e.bottom),u+t.offsetWidth>f&&(u=f-t.offsetWidth)}t.style.top=l+"px",t.style.left=t.style.right="","right"==i?(u=c.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?u=0:"middle"==i&&(u=(c.sizer.clientWidth-t.offsetWidth)/2),t.style.left=u+"px"),n&&(o=this,a={left:u,top:l,right:u+t.offsetWidth,bottom:l+t.offsetHeight},null!=(s=Lr(o,a)).scrollTop&&jr(o,s.scrollTop),null!=s.scrollLeft&&Vr(o,s.scrollLeft))},triggerOnKeyDown:ri(fa),triggerOnKeyPress:ri(ha),triggerOnKeyUp:da,triggerOnMouseDown:ri(ga),execCommand:function(e){if(ra.hasOwnProperty(e))return ra[e].call(null,this)},triggerElectric:ri((function(e){Ma(this,e)})),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=ct(this.doc,e),a=0;a0&&a(t.charAt(n-1));)--n;for(;r.5||this.options.lineWrapping)&&ur(this),me(this,"refresh",this)})),swapDoc:ri((function(e){var t=this.doc;return t.cm=null,this.state.selectingText&&this.state.selectingText(),ji(this,e),Un(this),this.display.input.reset(),Pr(this,e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,ln(this,"swapDoc",this,t),t})),phrase:function(e){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:e},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},be(e),e.registerHelper=function(t,r,i){n.hasOwnProperty(t)||(n[t]=e[t]={_global:[]}),n[t][r]=i},e.registerGlobalHelper=function(t,r,i,o){e.registerHelper(t,r,o),n[t]._global.push({pred:i,val:o})}}(Na);var Ha="iter insert remove copy getEditor constructor".split(" ");for(var Wa in Io.prototype)Io.prototype.hasOwnProperty(Wa)&&q(Ha,Wa)<0&&(Na.prototype[Wa]=function(e){return function(){return e.apply(this.doc,arguments)}}(Io.prototype[Wa]));return be(Io),Na.inputStyles={textarea:$a,contenteditable:Ua},Na.defineMode=function(e){Na.defaults.mode||"null"==e||(Na.defaults.mode=e),Fe.apply(this,arguments)},Na.defineMIME=function(e,t){je[e]=t},Na.defineMode("null",(function(){return{token:function(e){return e.skipToEnd()}}})),Na.defineMIME("text/plain","null"),Na.defineExtension=function(e,t){Na.prototype[e]=t},Na.defineDocExtension=function(e,t){Io.prototype[e]=t},Na.fromTextArea=function(e,t){if((t=t?F(t):{}).value=e.value,!t.tabindex&&e.tabIndex&&(t.tabindex=e.tabIndex),!t.placeholder&&e.placeholder&&(t.placeholder=e.placeholder),null==t.autofocus){var n=I();t.autofocus=n==e||null!=e.getAttribute("autofocus")&&n==document.body}function r(){e.value=s.getValue()}var i;if(e.form&&(fe(e.form,"submit",r),!t.leaveSubmitMethodAlone)){var o=e.form;i=o.submit;try{var a=o.submit=function(){r(),o.submit=i,o.submit(),o.submit=a}}catch(e){}}t.finishInit=function(n){n.save=r,n.getTextArea=function(){return e},n.toTextArea=function(){n.toTextArea=isNaN,r(),e.parentNode.removeChild(n.getWrapperElement()),e.style.display="",e.form&&(he(e.form,"submit",r),t.leaveSubmitMethodAlone||"function"!=typeof e.form.submit||(e.form.submit=i))}},e.style.display="none";var s=Na((function(t){return e.parentNode.insertBefore(t,e.nextSibling)}),t);return s},function(e){e.off=he,e.on=fe,e.wheelEventPixels=Ti,e.Doc=Io,e.splitLines=De,e.countColumn=V,e.findColumn=z,e.isWordChar=ee,e.Pass=U,e.signal=me,e.Line=$t,e.changeEnd=Ci,e.scrollbarModel=Kr,e.Pos=tt,e.cmpPos=nt,e.modes=Me,e.mimeModes=je,e.resolveMode=Ve,e.getMode=Qe,e.modeExtensions=qe,e.extendMode=Ue,e.copyState=Ge,e.startState=Ke,e.innerMode=Be,e.commands=ra,e.keyMap=Ko,e.keyName=Jo,e.isModifierKey=Wo,e.lookupKey=Ho,e.normalizeKeyMap=$o,e.StringStream=ze,e.SharedTextMarker=No,e.TextMarker=xo,e.LineWidget=ko,e.e_preventDefault=Ee,e.e_stopPropagation=we,e.e_stop=_e,e.addClass=P,e.contains=D,e.rmClass=x,e.keyNames=qo}(Na),Na.version="5.65.6",Na}()},6876:function(e,t,n){!function(e){"use strict";e.defineMode("javascript",(function(t,n){var r,i,o=t.indentUnit,a=n.statementIndent,s=n.jsonld,c=n.json||s,l=!1!==n.trackScope,u=n.typescript,p=n.wordCharacters||/[\w$\xa1-\uffff]/,f=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("keyword d"),o=e("operator"),a={type:"atom",style:"atom"};return{if:e("if"),while:t,with:t,else:n,do:n,try:n,finally:n,return:i,break:i,continue:i,new:e("new"),delete:r,void:r,throw:r,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:o,typeof:o,instanceof:o,true:a,false:a,null:a,undefined:a,NaN:a,Infinity:a,this:e("this"),class:e("class"),super:e("atom"),yield:r,export:e("export"),import:e("import"),extends:r,await:r}}(),d=/[+\-*&%=<>!?|~^@]/,h=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function m(e,t,n){return r=e,i=n,t}function v(e,t){var n,r=e.next();if('"'==r||"'"==r)return t.tokenize=(n=r,function(e,t){var r,i=!1;if(s&&"@"==e.peek()&&e.match(h))return t.tokenize=v,m("jsonld-keyword","meta");for(;null!=(r=e.next())&&(r!=n||i);)i=!i&&"\\"==r;return i||(t.tokenize=v),m("string","string")}),t.tokenize(e,t);if("."==r&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if("."==r&&e.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return m(r);if("="==r&&e.eat(">"))return m("=>","operator");if("0"==r&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test(r))return e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if("/"==r)return e.eat("*")?(t.tokenize=y,y(e,t)):e.eat("/")?(e.skipToEnd(),m("comment","comment")):Ze(e,t,1)?(function(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}(e),e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string-2")):(e.eat("="),m("operator","operator",e.current()));if("`"==r)return t.tokenize=g,g(e,t);if("#"==r&&"!"==e.peek())return e.skipToEnd(),m("meta","meta");if("#"==r&&e.eatWhile(p))return m("variable","property");if("<"==r&&e.match("!--")||"-"==r&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start)))return e.skipToEnd(),m("comment","comment");if(d.test(r))return">"==r&&t.lexical&&">"==t.lexical.type||(e.eat("=")?"!"!=r&&"="!=r||e.eat("="):/[<>*+\-|&?]/.test(r)&&(e.eat(r),">"==r&&e.eat(r))),"?"==r&&e.eat(".")?m("."):m("operator","operator",e.current());if(p.test(r)){e.eatWhile(p);var i=e.current();if("."!=t.lastType){if(f.propertyIsEnumerable(i)){var o=f[i];return m(o.type,o.style,i)}if("async"==i&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",i)}return m("variable","variable",i)}}function y(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=v;break}r="*"==n}return m("comment","comment")}function g(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=v;break}r=!r&&"\\"==n}return m("quasi","string-2",e.current())}function b(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){if(u){var r=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,n));r&&(n=r.index)}for(var i=0,o=!1,a=n-1;a>=0;--a){var s=e.string.charAt(a),c="([{}])".indexOf(s);if(c>=0&&c<3){if(!i){++a;break}if(0==--i){"("==s&&(o=!0);break}}else if(c>=3&&c<6)++i;else if(p.test(s))o=!0;else if(/["'\/`]/.test(s))for(;;--a){if(0==a)return;if(e.string.charAt(a-1)==s&&"\\"!=e.string.charAt(a-2)){a--;break}}else if(o&&!i){++a;break}}o&&!i&&(t.fatArrowAt=a)}}var E={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function w(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function T(e,t){if(!l)return!1;for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(n=r.vars;n;n=n.next)if(n.name==t)return!0}function _(e,t,n,r,i){var o=e.cc;for(k.state=e,k.stream=i,k.marked=null,k.cc=o,k.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;)if((o.length?o.pop():c?U:Q)(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return k.marked?k.marked:"variable"==n&&T(e,r)?"variable-2":t}}var k={state:null,column:null,marked:null,cc:null};function O(){for(var e=arguments.length-1;e>=0;e--)k.cc.push(arguments[e])}function S(){return O.apply(null,arguments),!0}function x(e,t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}function C(e){var t=k.state;if(k.marked="def",l){if(t.context)if("var"==t.lexical.info&&t.context&&t.context.block){var r=N(e,t.context);if(null!=r)return void(t.context=r)}else if(!x(e,t.localVars))return void(t.localVars=new D(e,t.localVars));n.globalVars&&!x(e,t.globalVars)&&(t.globalVars=new D(e,t.globalVars))}}function N(e,t){if(t){if(t.block){var n=N(e,t.prev);return n?n==t.prev?t:new L(n,t.vars,!0):null}return x(e,t.vars)?t:new L(t.prev,new D(e,t.vars),!1)}return null}function A(e){return"public"==e||"private"==e||"protected"==e||"abstract"==e||"readonly"==e}function L(e,t,n){this.prev=e,this.vars=t,this.block=n}function D(e,t){this.name=e,this.next=t}var I=new D("this",new D("arguments",null));function P(){k.state.context=new L(k.state.context,k.state.localVars,!1),k.state.localVars=I}function R(){k.state.context=new L(k.state.context,k.state.localVars,!0),k.state.localVars=null}function M(){k.state.localVars=k.state.context.vars,k.state.context=k.state.context.prev}function j(e,t){var n=function(){var n=k.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new w(r,k.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function F(){var e=k.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function V(e){return function t(n){return n==e?S():";"==e||"}"==n||")"==n||"]"==n?O():S(t)}}function Q(e,t){return"var"==e?S(j("vardef",t),ke,V(";"),F):"keyword a"==e?S(j("form"),B,Q,F):"keyword b"==e?S(j("form"),Q,F):"keyword d"==e?k.stream.match(/^\s*$/,!1)?S():S(j("stat"),z,V(";"),F):"debugger"==e?S(V(";")):"{"==e?S(j("}"),R,ce,F,M):";"==e?S():"if"==e?("else"==k.state.lexical.info&&k.state.cc[k.state.cc.length-1]==F&&k.state.cc.pop()(),S(j("form"),B,Q,F,Ae)):"function"==e?S(Pe):"for"==e?S(j("form"),R,Le,Q,M,F):"class"==e||u&&"interface"==t?(k.marked="keyword",S(j("form","class"==e?e:t),Ve,F)):"variable"==e?u&&"declare"==t?(k.marked="keyword",S(Q)):u&&("module"==t||"enum"==t||"type"==t)&&k.stream.match(/^\s*\w/,!1)?(k.marked="keyword","enum"==t?S(Je):"type"==t?S(Me,V("operator"),de,V(";")):S(j("form"),Oe,V("{"),j("}"),ce,F,F)):u&&"namespace"==t?(k.marked="keyword",S(j("form"),U,Q,F)):u&&"abstract"==t?(k.marked="keyword",S(Q)):S(j("stat"),te):"switch"==e?S(j("form"),B,V("{"),j("}","switch"),R,ce,F,F,M):"case"==e?S(U,V(":")):"default"==e?S(V(":")):"catch"==e?S(j("form"),P,q,Q,F,M):"export"==e?S(j("stat"),Ge,F):"import"==e?S(j("stat"),Ke,F):"async"==e?S(Q):"@"==t?S(U,Q):O(j("stat"),U,V(";"),F)}function q(e){if("("==e)return S(je,V(")"))}function U(e,t){return K(e,t,!1)}function G(e,t){return K(e,t,!0)}function B(e){return"("!=e?O():S(j(")"),z,V(")"),F)}function K(e,t,n){if(k.state.fatArrowAt==k.stream.start){var r=n?X:J;if("("==e)return S(P,j(")"),ae(je,")"),F,V("=>"),r,M);if("variable"==e)return O(P,Oe,V("=>"),r,M)}var i=n?H:$;return E.hasOwnProperty(e)?S(i):"function"==e?S(Pe,i):"class"==e||u&&"interface"==t?(k.marked="keyword",S(j("form"),Fe,F)):"keyword c"==e||"async"==e?S(n?G:U):"("==e?S(j(")"),z,V(")"),F,i):"operator"==e||"spread"==e?S(n?G:U):"["==e?S(j("]"),Ye,F,i):"{"==e?se(re,"}",null,i):"quasi"==e?O(W,i):"new"==e?S(function(e){return function(t){return"."==t?S(e?ee:Z):"variable"==t&&u?S(we,e?H:$):O(e?G:U)}}(n)):S()}function z(e){return e.match(/[;\}\)\],]/)?O():O(U)}function $(e,t){return","==e?S(z):H(e,t,!1)}function H(e,t,n){var r=0==n?$:H,i=0==n?U:G;return"=>"==e?S(P,n?X:J,M):"operator"==e?/\+\+|--/.test(t)||u&&"!"==t?S(r):u&&"<"==t&&k.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?S(j(">"),ae(de,">"),F,r):"?"==t?S(U,V(":"),i):S(i):"quasi"==e?O(W,r):";"!=e?"("==e?se(G,")","call",r):"."==e?S(ne,r):"["==e?S(j("]"),z,V("]"),F,r):u&&"as"==t?(k.marked="keyword",S(de,r)):"regexp"==e?(k.state.lastType=k.marked="operator",k.stream.backUp(k.stream.pos-k.stream.start-1),S(i)):void 0:void 0}function W(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?S(W):S(z,Y)}function Y(e){if("}"==e)return k.marked="string-2",k.state.tokenize=g,S(W)}function J(e){return b(k.stream,k.state),O("{"==e?Q:U)}function X(e){return b(k.stream,k.state),O("{"==e?Q:G)}function Z(e,t){if("target"==t)return k.marked="keyword",S($)}function ee(e,t){if("target"==t)return k.marked="keyword",S(H)}function te(e){return":"==e?S(F,Q):O($,V(";"),F)}function ne(e){if("variable"==e)return k.marked="property",S()}function re(e,t){return"async"==e?(k.marked="property",S(re)):"variable"==e||"keyword"==k.style?(k.marked="property","get"==t||"set"==t?S(ie):(u&&k.state.fatArrowAt==k.stream.start&&(n=k.stream.match(/^\s*:\s*/,!1))&&(k.state.fatArrowAt=k.stream.pos+n[0].length),S(oe))):"number"==e||"string"==e?(k.marked=s?"property":k.style+" property",S(oe)):"jsonld-keyword"==e?S(oe):u&&A(t)?(k.marked="keyword",S(re)):"["==e?S(U,le,V("]"),oe):"spread"==e?S(G,oe):"*"==t?(k.marked="keyword",S(re)):":"==e?O(oe):void 0;var n}function ie(e){return"variable"!=e?O(oe):(k.marked="property",S(Pe))}function oe(e){return":"==e?S(G):"("==e?O(Pe):void 0}function ae(e,t,n){function r(i,o){if(n?n.indexOf(i)>-1:","==i){var a=k.state.lexical;return"call"==a.info&&(a.pos=(a.pos||0)+1),S((function(n,r){return n==t||r==t?O():O(e)}),r)}return i==t||o==t?S():n&&n.indexOf(";")>-1?O(e):S(V(t))}return function(n,i){return n==t||i==t?S():O(e,r)}}function se(e,t,n){for(var r=3;r"),de):"quasi"==e?O(ye,Ee):void 0}function he(e){if("=>"==e)return S(de)}function me(e){return e.match(/[\}\)\]]/)?S():","==e||";"==e?S(me):O(ve,me)}function ve(e,t){return"variable"==e||"keyword"==k.style?(k.marked="property",S(ve)):"?"==t||"number"==e||"string"==e?S(ve):":"==e?S(de):"["==e?S(V("variable"),ue,V("]"),ve):"("==e?O(Re,ve):e.match(/[;\}\)\],]/)?void 0:S()}function ye(e,t){return"quasi"!=e?O():"${"!=t.slice(t.length-2)?S(ye):S(de,ge)}function ge(e){if("}"==e)return k.marked="string-2",k.state.tokenize=g,S(ye)}function be(e,t){return"variable"==e&&k.stream.match(/^\s*[?:]/,!1)||"?"==t?S(be):":"==e?S(de):"spread"==e?S(be):O(de)}function Ee(e,t){return"<"==t?S(j(">"),ae(de,">"),F,Ee):"|"==t||"."==e||"&"==t?S(de):"["==e?S(de,V("]"),Ee):"extends"==t||"implements"==t?(k.marked="keyword",S(de)):"?"==t?S(de,V(":"),de):void 0}function we(e,t){if("<"==t)return S(j(">"),ae(de,">"),F,Ee)}function Te(){return O(de,_e)}function _e(e,t){if("="==t)return S(de)}function ke(e,t){return"enum"==t?(k.marked="keyword",S(Je)):O(Oe,le,Ce,Ne)}function Oe(e,t){return u&&A(t)?(k.marked="keyword",S(Oe)):"variable"==e?(C(t),S()):"spread"==e?S(Oe):"["==e?se(xe,"]"):"{"==e?se(Se,"}"):void 0}function Se(e,t){return"variable"!=e||k.stream.match(/^\s*:/,!1)?("variable"==e&&(k.marked="property"),"spread"==e?S(Oe):"}"==e?O():"["==e?S(U,V("]"),V(":"),Se):S(V(":"),Oe,Ce)):(C(t),S(Ce))}function xe(){return O(Oe,Ce)}function Ce(e,t){if("="==t)return S(G)}function Ne(e){if(","==e)return S(ke)}function Ae(e,t){if("keyword b"==e&&"else"==t)return S(j("form","else"),Q,F)}function Le(e,t){return"await"==t?S(Le):"("==e?S(j(")"),De,F):void 0}function De(e){return"var"==e?S(ke,Ie):"variable"==e?S(Ie):O(Ie)}function Ie(e,t){return")"==e?S():";"==e?S(Ie):"in"==t||"of"==t?(k.marked="keyword",S(U,Ie)):O(U,Ie)}function Pe(e,t){return"*"==t?(k.marked="keyword",S(Pe)):"variable"==e?(C(t),S(Pe)):"("==e?S(P,j(")"),ae(je,")"),F,pe,Q,M):u&&"<"==t?S(j(">"),ae(Te,">"),F,Pe):void 0}function Re(e,t){return"*"==t?(k.marked="keyword",S(Re)):"variable"==e?(C(t),S(Re)):"("==e?S(P,j(")"),ae(je,")"),F,pe,M):u&&"<"==t?S(j(">"),ae(Te,">"),F,Re):void 0}function Me(e,t){return"keyword"==e||"variable"==e?(k.marked="type",S(Me)):"<"==t?S(j(">"),ae(Te,">"),F):void 0}function je(e,t){return"@"==t&&S(U,je),"spread"==e?S(je):u&&A(t)?(k.marked="keyword",S(je)):u&&"this"==e?S(le,Ce):O(Oe,le,Ce)}function Fe(e,t){return"variable"==e?Ve(e,t):Qe(e,t)}function Ve(e,t){if("variable"==e)return C(t),S(Qe)}function Qe(e,t){return"<"==t?S(j(">"),ae(Te,">"),F,Qe):"extends"==t||"implements"==t||u&&","==e?("implements"==t&&(k.marked="keyword"),S(u?de:U,Qe)):"{"==e?S(j("}"),qe,F):void 0}function qe(e,t){return"async"==e||"variable"==e&&("static"==t||"get"==t||"set"==t||u&&A(t))&&k.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(k.marked="keyword",S(qe)):"variable"==e||"keyword"==k.style?(k.marked="property",S(Ue,qe)):"number"==e||"string"==e?S(Ue,qe):"["==e?S(U,le,V("]"),Ue,qe):"*"==t?(k.marked="keyword",S(qe)):u&&"("==e?O(Re,qe):";"==e||","==e?S(qe):"}"==e?S():"@"==t?S(U,qe):void 0}function Ue(e,t){if("!"==t)return S(Ue);if("?"==t)return S(Ue);if(":"==e)return S(de,Ce);if("="==t)return S(G);var n=k.state.lexical.prev;return O(n&&"interface"==n.info?Re:Pe)}function Ge(e,t){return"*"==t?(k.marked="keyword",S(We,V(";"))):"default"==t?(k.marked="keyword",S(U,V(";"))):"{"==e?S(ae(Be,"}"),We,V(";")):O(Q)}function Be(e,t){return"as"==t?(k.marked="keyword",S(V("variable"))):"variable"==e?O(G,Be):void 0}function Ke(e){return"string"==e?S():"("==e?O(U):"."==e?O($):O(ze,$e,We)}function ze(e,t){return"{"==e?se(ze,"}"):("variable"==e&&C(t),"*"==t&&(k.marked="keyword"),S(He))}function $e(e){if(","==e)return S(ze,$e)}function He(e,t){if("as"==t)return k.marked="keyword",S(ze)}function We(e,t){if("from"==t)return k.marked="keyword",S(U)}function Ye(e){return"]"==e?S():O(ae(G,"]"))}function Je(){return O(j("form"),Oe,V("{"),j("}"),ae(Xe,"}"),F,F)}function Xe(){return O(Oe,Ce)}function Ze(e,t,n){return t.tokenize==v&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}return P.lex=R.lex=!0,M.lex=!0,F.lex=!0,{startState:function(e){var t={tokenize:v,lastType:"sof",cc:[],lexical:new w((e||0)-o,0,"block",!1),localVars:n.localVars,context:n.localVars&&new L(null,null,!1),indented:e||0};return n.globalVars&&"object"==typeof n.globalVars&&(t.globalVars=n.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),b(e,t)),t.tokenize!=y&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==r?n:(t.lastType="operator"!=r||"++"!=i&&"--"!=i?r:"incdec",_(t,n,r,i,e))},indent:function(t,r){if(t.tokenize==y||t.tokenize==g)return e.Pass;if(t.tokenize!=v)return 0;var i,s=r&&r.charAt(0),c=t.lexical;if(!/^\s*else\b/.test(r))for(var l=t.cc.length-1;l>=0;--l){var u=t.cc[l];if(u==F)c=c.prev;else if(u!=Ae&&u!=M)break}for(;("stat"==c.type||"form"==c.type)&&("}"==s||(i=t.cc[t.cc.length-1])&&(i==$||i==H)&&!/^[,\.=+\-*:?[\(]/.test(r));)c=c.prev;a&&")"==c.type&&"stat"==c.prev.type&&(c=c.prev);var p=c.type,f=s==p;return"vardef"==p?c.indented+("operator"==t.lastType||","==t.lastType?c.info.length+1:0):"form"==p&&"{"==s?c.indented:"form"==p?c.indented+o:"stat"==p?c.indented+(function(e,t){return"operator"==e.lastType||","==e.lastType||d.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}(t,r)?a||o:0):"switch"!=c.info||f||0==n.doubleIndentSwitch?c.align?c.column+(f?0:1):c.indented+(f?0:o):c.indented+(/^(?:case|default)\b/.test(r)?o:2*o)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:c?null:"/*",blockCommentEnd:c?null:"*/",blockCommentContinue:c?null:" * ",lineComment:c?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:c?"json":"javascript",jsonldMode:s,jsonMode:c,expressionAllowed:Ze,skipExpression:function(t){_(t,"atom","atom","true",new e.StringStream("",2,null))}}})),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/manifest+json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}(n(4631))},640:function(e,t,n){"use strict";var r=n(1742),i={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,o,a,s,c,l,u=!1;t||(t={}),n=t.debug||!1;try{if(a=r(),s=document.createRange(),c=document.getSelection(),(l=document.createElement("span")).textContent=e,l.style.all="unset",l.style.position="fixed",l.style.top=0,l.style.clip="rect(0, 0, 0, 0)",l.style.whiteSpace="pre",l.style.webkitUserSelect="text",l.style.MozUserSelect="text",l.style.msUserSelect="text",l.style.userSelect="text",l.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[t.format]||i.default;window.clipboardData.setData(o,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(l),s.selectNodeContents(l),c.addRange(s),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),o=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(o,e)}}finally{c&&("function"==typeof c.removeRange?c.removeRange(s):c.removeAllRanges()),l&&document.body.removeChild(l),a()}return u}},4020:function(e){"use strict";var t="%[a-f0-9]{2}",n=new RegExp("("+t+")|([^%]+?)","gi"),r=new RegExp("("+t+")+","gi");function i(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],i(n),i(r))}function o(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(n)||[],r=1;r]/;e.exports=function(e){var n,r=""+e,i=t.exec(r);if(!i)return r;var o="",a=0,s=0;for(a=i.index;a{switch(e.kind){case"Query":case"ShortQuery":case"Mutation":case"Subscription":case"FragmentDefinition":t=e}})),t}function P(e,t,n){return n===D.SchemaMetaFieldDef.name&&e.getQueryType()===t?D.SchemaMetaFieldDef:n===D.TypeMetaFieldDef.name&&e.getQueryType()===t?D.TypeMetaFieldDef:n===D.TypeNameMetaFieldDef.name&&(0,L.isCompositeType)(t)?D.TypeNameMetaFieldDef:"getFields"in t?t.getFields()[n]:null}function R(e,t){const n=[];let r=e;for(;null==r?void 0:r.kind;)n.push(r),r=r.prevState;for(let e=n.length-1;e>=0;e--)t(n[e])}function M(e){const t=Object.keys(e),n=t.length,r=new Array(n);for(let i=0;i({proximity:Q(V(e.label),t),entry:e}))),(e=>e.proximity<=2)),(e=>!e.entry.isDeprecated)).sort(((e,t)=>(e.entry.isDeprecated?1:0)-(t.entry.isDeprecated?1:0)||e.proximity-t.proximity||e.entry.label.length-t.entry.label.length)).map((e=>e.entry)):F(e,(e=>!e.isDeprecated))}(t,V(e.string))}function F(e,t){const n=e.filter(t);return 0===n.length?e:n}function V(e){return e.toLowerCase().replace(/\W/g,"")}function Q(e,t){let n=function(e,t){let n,r;const i=[],o=e.length,a=t.length;for(n=0;n<=o;n++)i[n]=[n];for(r=1;r<=a;r++)i[0][r]=r;for(n=1;n<=o;n++)for(r=1;r<=a;r++){const o=e[n-1]===t[r-1]?0:1;i[n][r]=Math.min(i[n-1][r]+1,i[n][r-1]+1,i[n-1][r-1]+o),n>1&&r>1&&e[n-1]===t[r-2]&&e[n-2]===t[r-1]&&(i[n][r]=Math.min(i[n][r],i[n-2][r-2]+o))}return i[o][a]}(t,e);return e.length>t.length&&(n-=e.length-t.length-1,n+=0===e.indexOf(t)?0:.5),n}!function(e){e.is=function(e){return"string"==typeof e}}(r||(r={})),function(e){e.is=function(e){return"string"==typeof e}}(i||(i={})),function(e){e.MIN_VALUE=-2147483648,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(o||(o={})),function(e){e.MIN_VALUE=0,e.MAX_VALUE=2147483647,e.is=function(t){return"number"==typeof t&&e.MIN_VALUE<=t&&t<=e.MAX_VALUE}}(a||(a={})),function(e){e.create=function(e,t){return e===Number.MAX_VALUE&&(e=a.MAX_VALUE),t===Number.MAX_VALUE&&(t=a.MAX_VALUE),{line:e,character:t}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.uinteger(t.line)&&Pe.uinteger(t.character)}}(s||(s={})),function(e){e.create=function(e,t,n,r){if(Pe.uinteger(e)&&Pe.uinteger(t)&&Pe.uinteger(n)&&Pe.uinteger(r))return{start:s.create(e,t),end:s.create(n,r)};if(s.is(e)&&s.is(t))return{start:e,end:t};throw new Error("Range#create called with invalid arguments[".concat(e,", ").concat(t,", ").concat(n,", ").concat(r,"]"))},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&s.is(t.start)&&s.is(t.end)}}(c||(c={})),function(e){e.create=function(e,t){return{uri:e,range:t}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&c.is(t.range)&&(Pe.string(t.uri)||Pe.undefined(t.uri))}}(l||(l={})),function(e){e.create=function(e,t,n,r){return{targetUri:e,targetRange:t,targetSelectionRange:n,originSelectionRange:r}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&c.is(t.targetRange)&&Pe.string(t.targetUri)&&c.is(t.targetSelectionRange)&&(c.is(t.originSelectionRange)||Pe.undefined(t.originSelectionRange))}}(u||(u={})),function(e){e.create=function(e,t,n,r){return{red:e,green:t,blue:n,alpha:r}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.numberRange(t.red,0,1)&&Pe.numberRange(t.green,0,1)&&Pe.numberRange(t.blue,0,1)&&Pe.numberRange(t.alpha,0,1)}}(p||(p={})),function(e){e.create=function(e,t){return{range:e,color:t}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&c.is(t.range)&&p.is(t.color)}}(f||(f={})),function(e){e.create=function(e,t,n){return{label:e,textEdit:t,additionalTextEdits:n}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.label)&&(Pe.undefined(t.textEdit)||T.is(t))&&(Pe.undefined(t.additionalTextEdits)||Pe.typedArray(t.additionalTextEdits,T.is))}}(d||(d={})),function(e){e.Comment="comment",e.Imports="imports",e.Region="region"}(h||(h={})),function(e){e.create=function(e,t,n,r,i,o){var a={startLine:e,endLine:t};return Pe.defined(n)&&(a.startCharacter=n),Pe.defined(r)&&(a.endCharacter=r),Pe.defined(i)&&(a.kind=i),Pe.defined(o)&&(a.collapsedText=o),a},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.uinteger(t.startLine)&&Pe.uinteger(t.startLine)&&(Pe.undefined(t.startCharacter)||Pe.uinteger(t.startCharacter))&&(Pe.undefined(t.endCharacter)||Pe.uinteger(t.endCharacter))&&(Pe.undefined(t.kind)||Pe.string(t.kind))}}(m||(m={})),function(e){e.create=function(e,t){return{location:e,message:t}},e.is=function(e){var t=e;return Pe.defined(t)&&l.is(t.location)&&Pe.string(t.message)}}(v||(v={})),function(e){e.Error=1,e.Warning=2,e.Information=3,e.Hint=4}(y||(y={})),function(e){e.Unnecessary=1,e.Deprecated=2}(g||(g={})),function(e){e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.href)}}(b||(b={})),function(e){e.create=function(e,t,n,r,i,o){var a={range:e,message:t};return Pe.defined(n)&&(a.severity=n),Pe.defined(r)&&(a.code=r),Pe.defined(i)&&(a.source=i),Pe.defined(o)&&(a.relatedInformation=o),a},e.is=function(e){var t,n=e;return Pe.defined(n)&&c.is(n.range)&&Pe.string(n.message)&&(Pe.number(n.severity)||Pe.undefined(n.severity))&&(Pe.integer(n.code)||Pe.string(n.code)||Pe.undefined(n.code))&&(Pe.undefined(n.codeDescription)||Pe.string(null===(t=n.codeDescription)||void 0===t?void 0:t.href))&&(Pe.string(n.source)||Pe.undefined(n.source))&&(Pe.undefined(n.relatedInformation)||Pe.typedArray(n.relatedInformation,v.is))}}(E||(E={})),function(e){e.create=function(e,t){for(var n=[],r=2;r0&&(i.arguments=n),i},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.title)&&Pe.string(t.command)}}(w||(w={})),function(e){e.replace=function(e,t){return{range:e,newText:t}},e.insert=function(e,t){return{range:{start:e,end:e},newText:t}},e.del=function(e){return{range:e,newText:""}},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.newText)&&c.is(t.range)}}(T||(T={})),function(e){e.create=function(e,t,n){var r={label:e};return void 0!==t&&(r.needsConfirmation=t),void 0!==n&&(r.description=n),r},e.is=function(e){var t=e;return Pe.objectLiteral(t)&&Pe.string(t.label)&&(Pe.boolean(t.needsConfirmation)||void 0===t.needsConfirmation)&&(Pe.string(t.description)||void 0===t.description)}}(_||(_={})),function(e){e.is=function(e){var t=e;return Pe.string(t)}}(k||(k={})),function(e){e.replace=function(e,t,n){return{range:e,newText:t,annotationId:n}},e.insert=function(e,t,n){return{range:{start:e,end:e},newText:t,annotationId:n}},e.del=function(e,t){return{range:e,newText:"",annotationId:t}},e.is=function(e){var t=e;return T.is(t)&&(_.is(t.annotationId)||k.is(t.annotationId))}}(O||(O={})),function(e){e.create=function(e,t){return{textDocument:e,edits:t}},e.is=function(e){var t=e;return Pe.defined(t)&&G.is(t.textDocument)&&Array.isArray(t.edits)}}(S||(S={})),function(e){e.create=function(e,t,n){var r={kind:"create",uri:e};return void 0===t||void 0===t.overwrite&&void 0===t.ignoreIfExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"create"===t.kind&&Pe.string(t.uri)&&(void 0===t.options||(void 0===t.options.overwrite||Pe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Pe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(x||(x={})),function(e){e.create=function(e,t,n,r){var i={kind:"rename",oldUri:e,newUri:t};return void 0===n||void 0===n.overwrite&&void 0===n.ignoreIfExists||(i.options=n),void 0!==r&&(i.annotationId=r),i},e.is=function(e){var t=e;return t&&"rename"===t.kind&&Pe.string(t.oldUri)&&Pe.string(t.newUri)&&(void 0===t.options||(void 0===t.options.overwrite||Pe.boolean(t.options.overwrite))&&(void 0===t.options.ignoreIfExists||Pe.boolean(t.options.ignoreIfExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(C||(C={})),function(e){e.create=function(e,t,n){var r={kind:"delete",uri:e};return void 0===t||void 0===t.recursive&&void 0===t.ignoreIfNotExists||(r.options=t),void 0!==n&&(r.annotationId=n),r},e.is=function(e){var t=e;return t&&"delete"===t.kind&&Pe.string(t.uri)&&(void 0===t.options||(void 0===t.options.recursive||Pe.boolean(t.options.recursive))&&(void 0===t.options.ignoreIfNotExists||Pe.boolean(t.options.ignoreIfNotExists)))&&(void 0===t.annotationId||k.is(t.annotationId))}}(N||(N={})),function(e){e.is=function(e){var t=e;return t&&(void 0!==t.changes||void 0!==t.documentChanges)&&(void 0===t.documentChanges||t.documentChanges.every((function(e){return Pe.string(e.kind)?x.is(e)||C.is(e)||N.is(e):S.is(e)})))}}(A||(A={}));var q,U,G,B,K,z,$,H,W,Y,J,X,Z,ee,te,ne,re,ie,oe,ae,se,ce,le,ue,pe,fe,de,he,me,ve,ye,ge,be,Ee,we,Te,_e,ke,Oe,Se,xe,Ce,Ne,Ae,Le,De=function(){function e(e,t){this.edits=e,this.changeAnnotations=t}return e.prototype.insert=function(e,t,n){var r,i;if(void 0===n?r=T.insert(e,t):k.is(n)?(i=n,r=O.insert(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=O.insert(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.replace=function(e,t,n){var r,i;if(void 0===n?r=T.replace(e,t):k.is(n)?(i=n,r=O.replace(e,t,n)):(this.assertChangeAnnotations(this.changeAnnotations),i=this.changeAnnotations.manage(n),r=O.replace(e,t,i)),this.edits.push(r),void 0!==i)return i},e.prototype.delete=function(e,t){var n,r;if(void 0===t?n=T.del(e):k.is(t)?(r=t,n=O.del(e,t)):(this.assertChangeAnnotations(this.changeAnnotations),r=this.changeAnnotations.manage(t),n=O.del(e,r)),this.edits.push(n),void 0!==r)return r},e.prototype.add=function(e){this.edits.push(e)},e.prototype.all=function(){return this.edits},e.prototype.clear=function(){this.edits.splice(0,this.edits.length)},e.prototype.assertChangeAnnotations=function(e){if(void 0===e)throw new Error("Text edit change is not configured to manage change annotations.")},e}(),Ie=function(){function e(e){this._annotations=void 0===e?Object.create(null):e,this._counter=0,this._size=0}return e.prototype.all=function(){return this._annotations},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),e.prototype.manage=function(e,t){var n;if(k.is(e)?n=e:(n=this.nextId(),t=e),void 0!==this._annotations[n])throw new Error("Id ".concat(n," is already in use."));if(void 0===t)throw new Error("No annotation provided for id ".concat(n));return this._annotations[n]=t,this._size++,n},e.prototype.nextId=function(){return this._counter++,this._counter.toString()},e}();!function(){function e(e){var t=this;this._textEditChanges=Object.create(null),void 0!==e?(this._workspaceEdit=e,e.documentChanges?(this._changeAnnotations=new Ie(e.changeAnnotations),e.changeAnnotations=this._changeAnnotations.all(),e.documentChanges.forEach((function(e){if(S.is(e)){var n=new De(e.edits,t._changeAnnotations);t._textEditChanges[e.textDocument.uri]=n}}))):e.changes&&Object.keys(e.changes).forEach((function(n){var r=new De(e.changes[n]);t._textEditChanges[n]=r}))):this._workspaceEdit={}}Object.defineProperty(e.prototype,"edit",{get:function(){return this.initDocumentChanges(),void 0!==this._changeAnnotations&&(0===this._changeAnnotations.size?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),e.prototype.getTextEditChange=function(e){if(G.is(e)){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var t={uri:e.uri,version:e.version};if(!(r=this._textEditChanges[t.uri])){var n={textDocument:t,edits:i=[]};this._workspaceEdit.documentChanges.push(n),r=new De(i,this._changeAnnotations),this._textEditChanges[t.uri]=r}return r}if(this.initChanges(),void 0===this._workspaceEdit.changes)throw new Error("Workspace edit is not configured for normal text edit changes.");var r;if(!(r=this._textEditChanges[e])){var i=[];this._workspaceEdit.changes[e]=i,r=new De(i),this._textEditChanges[e]=r}return r},e.prototype.initDocumentChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._changeAnnotations=new Ie,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},e.prototype.initChanges=function(){void 0===this._workspaceEdit.documentChanges&&void 0===this._workspaceEdit.changes&&(this._workspaceEdit.changes=Object.create(null))},e.prototype.createFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(_.is(t)||k.is(t)?r=t:n=t,void 0===r?i=x.create(e,n):(o=k.is(r)?r:this._changeAnnotations.manage(r),i=x.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o},e.prototype.renameFile=function(e,t,n,r){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var i,o,a;if(_.is(n)||k.is(n)?i=n:r=n,void 0===i?o=C.create(e,t,r):(a=k.is(i)?i:this._changeAnnotations.manage(i),o=C.create(e,t,r,a)),this._workspaceEdit.documentChanges.push(o),void 0!==a)return a},e.prototype.deleteFile=function(e,t,n){if(this.initDocumentChanges(),void 0===this._workspaceEdit.documentChanges)throw new Error("Workspace edit is not configured for document changes.");var r,i,o;if(_.is(t)||k.is(t)?r=t:n=t,void 0===r?i=N.create(e,n):(o=k.is(r)?r:this._changeAnnotations.manage(r),i=N.create(e,n,o)),this._workspaceEdit.documentChanges.push(i),void 0!==o)return o}}(),function(e){e.create=function(e){return{uri:e}},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)}}(q||(q={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)&&Pe.integer(t.version)}}(U||(U={})),function(e){e.create=function(e,t){return{uri:e,version:t}},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)&&(null===t.version||Pe.integer(t.version))}}(G||(G={})),function(e){e.create=function(e,t,n,r){return{uri:e,languageId:t,version:n,text:r}},e.is=function(e){var t=e;return Pe.defined(t)&&Pe.string(t.uri)&&Pe.string(t.languageId)&&Pe.integer(t.version)&&Pe.string(t.text)}}(B||(B={})),function(e){e.PlainText="plaintext",e.Markdown="markdown",e.is=function(t){var n=t;return n===e.PlainText||n===e.Markdown}}(K||(K={})),function(e){e.is=function(e){var t=e;return Pe.objectLiteral(e)&&K.is(t.kind)&&Pe.string(t.value)}}(z||(z={})),function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}($||($={})),function(e){e.PlainText=1,e.Snippet=2}(H||(H={})),function(e){e.Deprecated=1}(W||(W={})),function(e){e.create=function(e,t,n){return{newText:e,insert:t,replace:n}},e.is=function(e){var t=e;return t&&Pe.string(t.newText)&&c.is(t.insert)&&c.is(t.replace)}}(Y||(Y={})),function(e){e.asIs=1,e.adjustIndentation=2}(J||(J={})),function(e){e.is=function(e){var t=e;return t&&(Pe.string(t.detail)||void 0===t.detail)&&(Pe.string(t.description)||void 0===t.description)}}(X||(X={})),function(e){e.create=function(e){return{label:e}}}(Z||(Z={})),function(e){e.create=function(e,t){return{items:e||[],isIncomplete:!!t}}}(ee||(ee={})),function(e){e.fromPlainText=function(e){return e.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")},e.is=function(e){var t=e;return Pe.string(t)||Pe.objectLiteral(t)&&Pe.string(t.language)&&Pe.string(t.value)}}(te||(te={})),function(e){e.is=function(e){var t=e;return!!t&&Pe.objectLiteral(t)&&(z.is(t.contents)||te.is(t.contents)||Pe.typedArray(t.contents,te.is))&&(void 0===e.range||c.is(e.range))}}(ne||(ne={})),function(e){e.create=function(e,t){return t?{label:e,documentation:t}:{label:e}}}(re||(re={})),function(e){e.create=function(e,t){for(var n=[],r=2;r=0;a--){var s=i[a],c=e.offsetAt(s.range.start),l=e.offsetAt(s.range.end);if(!(l<=o))throw new Error("Overlapping edit");r=r.substring(0,c)+s.newText+r.substring(l,r.length),o=c}return r}}(Le||(Le={}));var Pe,Re=function(){function e(e,t,n,r){this._uri=e,this._languageId=t,this._version=n,this._content=r,this._lineOffsets=void 0}return Object.defineProperty(e.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),e.prototype.getText=function(e){if(e){var t=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(t,n)}return this._content},e.prototype.update=function(e,t){this._content=e.text,this._version=t,this._lineOffsets=void 0},e.prototype.getLineOffsets=function(){if(void 0===this._lineOffsets){for(var e=[],t=this._content,n=!0,r=0;r0&&e.push(t.length),this._lineOffsets=e}return this._lineOffsets},e.prototype.positionAt=function(e){e=Math.max(Math.min(e,this._content.length),0);var t=this.getLineOffsets(),n=0,r=t.length;if(0===r)return s.create(0,e);for(;ne?r=i:n=i+1}var o=n-1;return s.create(o,e-t[o])},e.prototype.offsetAt=function(e){var t=this.getLineOffsets();if(e.line>=t.length)return this._content.length;if(e.line<0)return 0;var n=t[e.line],r=e.line+1this._start,this.getCurrentPosition=()=>this._pos,this.eol=()=>this._sourceText.length===this._pos,this.sol=()=>0===this._pos,this.peek=()=>this._sourceText.charAt(this._pos)?this._sourceText.charAt(this._pos):null,this.next=()=>{const e=this._sourceText.charAt(this._pos);return this._pos++,e},this.eat=e=>{if(this._testNextCharacter(e))return this._start=this._pos,this._pos++,this._sourceText.charAt(this._pos-1)},this.eatWhile=e=>{let t=this._testNextCharacter(e),n=!1;for(t&&(n=t,this._start=this._pos);t;)this._pos++,t=this._testNextCharacter(e),n=!0;return n},this.eatSpace=()=>this.eatWhile(/[\s\u00a0]/),this.skipToEnd=()=>{this._pos=this._sourceText.length},this.skipTo=e=>{this._pos=e},this.match=(e,t=!0,n=!1)=>{let r=null,i=null;return"string"==typeof e?(i=new RegExp(e,n?"i":"g").test(this._sourceText.substr(this._pos,e.length)),r=e):e instanceof RegExp&&(i=this._sourceText.slice(this._pos).match(e),r=null==i?void 0:i[0]),!(null==i||!("string"==typeof e||i instanceof Array&&this._sourceText.startsWith(i[0],this._pos)))&&(t&&(this._start=this._pos,r&&r.length&&(this._pos+=r.length)),i)},this.backUp=e=>{this._pos-=e},this.column=()=>this._pos,this.indentation=()=>{const e=this._sourceText.match(/\s*/);let t=0;if(e&&0!==e.length){const n=e[0];let r=0;for(;n.length>r;)9===n.charCodeAt(r)?t+=2:t++,r++}return t},this.current=()=>this._sourceText.slice(this._start,this._pos),this._start=0,this._pos=0,this._sourceText=e}_testNextCharacter(e){const t=this._sourceText.charAt(this._pos);let n=!1;return n="string"==typeof e?t===e:e instanceof RegExp?e.test(t):e(t),n}}function je(e){return{ofRule:e}}function Fe(e,t){return{ofRule:e,isList:!0,separator:t}}function Ve(e,t){return{style:t,match:t=>t.kind===e}}function Qe(e,t){return{style:t||"punctuation",match:t=>"Punctuation"===t.kind&&t.value===e}}const qe=e=>" "===e||"\t"===e||","===e||"\n"===e||"\r"===e||"\ufeff"===e||" "===e,Ue={Name:/^[_A-Za-z][_0-9A-Za-z]*/,Punctuation:/^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/,Number:/^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/,String:/^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/,Comment:/^#.*/},Ge={Document:[Fe("Definition")],Definition(e){switch(e.value){case"{":return"ShortQuery";case"query":return"Query";case"mutation":return"Mutation";case"subscription":return"Subscription";case"fragment":return L.Kind.FRAGMENT_DEFINITION;case"schema":return"SchemaDef";case"scalar":return"ScalarDef";case"type":return"ObjectTypeDef";case"interface":return"InterfaceDef";case"union":return"UnionDef";case"enum":return"EnumDef";case"input":return"InputDef";case"extend":return"ExtendDef";case"directive":return"DirectiveDef"}},ShortQuery:["SelectionSet"],Query:[Be("query"),je(Ke("def")),je("VariableDefinitions"),Fe("Directive"),"SelectionSet"],Mutation:[Be("mutation"),je(Ke("def")),je("VariableDefinitions"),Fe("Directive"),"SelectionSet"],Subscription:[Be("subscription"),je(Ke("def")),je("VariableDefinitions"),Fe("Directive"),"SelectionSet"],VariableDefinitions:[Qe("("),Fe("VariableDefinition"),Qe(")")],VariableDefinition:["Variable",Qe(":"),"Type",je("DefaultValue")],Variable:[Qe("$","variable"),Ke("variable")],DefaultValue:[Qe("="),"Value"],SelectionSet:[Qe("{"),Fe("Selection"),Qe("}")],Selection:(e,t)=>"..."===e.value?t.match(/[\s\u00a0,]*(on\b|@|{)/,!1)?"InlineFragment":"FragmentSpread":t.match(/[\s\u00a0,]*:/,!1)?"AliasedField":"Field",AliasedField:[Ke("property"),Qe(":"),Ke("qualifier"),je("Arguments"),Fe("Directive"),je("SelectionSet")],Field:[Ke("property"),je("Arguments"),Fe("Directive"),je("SelectionSet")],Arguments:[Qe("("),Fe("Argument"),Qe(")")],Argument:[Ke("attribute"),Qe(":"),"Value"],FragmentSpread:[Qe("..."),Ke("def"),Fe("Directive")],InlineFragment:[Qe("..."),je("TypeCondition"),Fe("Directive"),"SelectionSet"],FragmentDefinition:[Be("fragment"),je(function(e,t){const n=e.match;return e.match=e=>{let r=!1;return n&&(r=n(e)),r&&t.every((t=>t.match&&!t.match(e)))},e}(Ke("def"),[Be("on")])),"TypeCondition",Fe("Directive"),"SelectionSet"],TypeCondition:[Be("on"),"NamedType"],Value(e){switch(e.kind){case"Number":return"NumberValue";case"String":return"StringValue";case"Punctuation":switch(e.value){case"[":return"ListValue";case"{":return"ObjectValue";case"$":return"Variable";case"&":return"NamedType"}return null;case"Name":switch(e.value){case"true":case"false":return"BooleanValue"}return"null"===e.value?"NullValue":"EnumValue"}},NumberValue:[Ve("Number","number")],StringValue:[{style:"string",match:e=>"String"===e.kind,update(e,t){t.value.startsWith('"""')&&(e.inBlockstring=!t.value.slice(3).endsWith('"""'))}}],BooleanValue:[Ve("Name","builtin")],NullValue:[Ve("Name","keyword")],EnumValue:[Ke("string-2")],ListValue:[Qe("["),Fe("Value"),Qe("]")],ObjectValue:[Qe("{"),Fe("ObjectField"),Qe("}")],ObjectField:[Ke("attribute"),Qe(":"),"Value"],Type:e=>"["===e.value?"ListType":"NonNullType",ListType:[Qe("["),"Type",Qe("]"),je(Qe("!"))],NonNullType:["NamedType",je(Qe("!"))],NamedType:[("atom",{style:"atom",match:e=>"Name"===e.kind,update(e,t){var n;(null===(n=e.prevState)||void 0===n?void 0:n.prevState)&&(e.name=t.value,e.prevState.prevState.type=t.value)}})],Directive:[Qe("@","meta"),Ke("meta"),je("Arguments")],DirectiveDef:[Be("directive"),Qe("@","meta"),Ke("meta"),je("ArgumentsDef"),Be("on"),Fe("DirectiveLocation",Qe("|"))],InterfaceDef:[Be("interface"),Ke("atom"),je("Implements"),Fe("Directive"),Qe("{"),Fe("FieldDef"),Qe("}")],Implements:[Be("implements"),Fe("NamedType",Qe("&"))],DirectiveLocation:[Ke("string-2")],SchemaDef:[Be("schema"),Fe("Directive"),Qe("{"),Fe("OperationTypeDef"),Qe("}")],OperationTypeDef:[Ke("keyword"),Qe(":"),Ke("atom")],ScalarDef:[Be("scalar"),Ke("atom"),Fe("Directive")],ObjectTypeDef:[Be("type"),Ke("atom"),je("Implements"),Fe("Directive"),Qe("{"),Fe("FieldDef"),Qe("}")],FieldDef:[Ke("property"),je("ArgumentsDef"),Qe(":"),"Type",Fe("Directive")],ArgumentsDef:[Qe("("),Fe("InputValueDef"),Qe(")")],InputValueDef:[Ke("attribute"),Qe(":"),"Type",je("DefaultValue"),Fe("Directive")],UnionDef:[Be("union"),Ke("atom"),Fe("Directive"),Qe("="),Fe("UnionMember",Qe("|"))],UnionMember:["NamedType"],EnumDef:[Be("enum"),Ke("atom"),Fe("Directive"),Qe("{"),Fe("EnumValueDef"),Qe("}")],EnumValueDef:[Ke("string-2"),Fe("Directive")],InputDef:[Be("input"),Ke("atom"),Fe("Directive"),Qe("{"),Fe("InputValueDef"),Qe("}")],ExtendDef:[Be("extend"),"ObjectTypeDef"]};function Be(e){return{style:"keyword",match:t=>"Name"===t.kind&&t.value===e}}function Ke(e){return{style:e,match:e=>"Name"===e.kind,update(e,t){e.name=t.value}}}function ze(e={eatWhitespace:e=>e.eatWhile(qe),lexRules:Ue,parseRules:Ge,editorConfig:{}}){return{startState(){const t={level:0,step:0,name:null,kind:null,type:null,rule:null,needsSeperator:!1,prevState:null};return We(e.parseRules,t,L.Kind.DOCUMENT),t},token:(t,n)=>function(e,t,n){var r;if(t.inBlockstring)return e.match(/.*"""/)?(t.inBlockstring=!1,"string"):(e.skipToEnd(),"string");const{lexRules:i,parseRules:o,eatWhitespace:a,editorConfig:s}=n;if(t.rule&&0===t.rule.length?Ye(t):t.needsAdvance&&(t.needsAdvance=!1,Je(t,!0)),e.sol()){const n=(null==s?void 0:s.tabSize)||2;t.indentLevel=Math.floor(e.indentation()/n)}if(a(e))return"ws";const c=function(e,t){const n=Object.keys(e);for(let r=0;r0&&e[e.length-1]e)),s=new Set;st(r,((e,t)=>{var r,o,c,l,u;if(t.name&&(t.kind!==et.INTERFACE_DEF||a.includes(t.name)||s.add(t.name),t.kind===et.NAMED_TYPE&&(null===(r=t.prevState)||void 0===r?void 0:r.kind)===et.IMPLEMENTS))if(i.interfaceDef){if(null===(o=i.interfaceDef)||void 0===o?void 0:o.getInterfaces().find((({name:e})=>e===t.name)))return;const e=n.getType(t.name),r=null===(c=i.interfaceDef)||void 0===c?void 0:c.toConfig();i.interfaceDef=new L.GraphQLInterfaceType(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new L.GraphQLInterfaceType({name:t.name,fields:{}})]}))}else if(i.objectTypeDef){if(null===(l=i.objectTypeDef)||void 0===l?void 0:l.getInterfaces().find((({name:e})=>e===t.name)))return;const e=n.getType(t.name),r=null===(u=i.objectTypeDef)||void 0===u?void 0:u.toConfig();i.objectTypeDef=new L.GraphQLObjectType(Object.assign(Object.assign({},r),{interfaces:[...r.interfaces,e||new L.GraphQLInterfaceType({name:t.name,fields:{}})]}))}}));const c=i.interfaceDef||i.objectTypeDef,l=((null==c?void 0:c.getInterfaces())||[]).map((({name:e})=>e));return j(e,o.concat([...s].map((e=>({name:e})))).filter((({name:e})=>e!==(null==c?void 0:c.name)&&!l.includes(e))).map((e=>{const t={label:e.name,kind:$.Interface,type:e};return(null==e?void 0:e.description)&&(t.documentation=e.description),t})))}(c,l,e,t,f);if(u===et.SELECTION_SET||u===et.FIELD||u===et.ALIASED_FIELD)return function(e,t,n){var r;if(t.parentType){const i=t.parentType;let o=[];return"getFields"in i&&(o=M(i.getFields())),(0,L.isCompositeType)(i)&&o.push(L.TypeNameMetaFieldDef),i===(null===(r=null==n?void 0:n.schema)||void 0===r?void 0:r.getQueryType())&&o.push(L.SchemaMetaFieldDef,L.TypeMetaFieldDef),j(e,o.map(((e,t)=>{var n;const r={sortText:String(t)+e.name,label:e.name,detail:String(e.type),documentation:null!==(n=e.description)&&void 0!==n?n:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:$.Field,type:e.type},i=(e=>{const t=e.type;if((0,L.isCompositeType)(t))return rt;if((0,L.isListType)(t)&&(0,L.isCompositeType)(t.ofType))return rt;if((0,L.isNonNullType)(t)){if((0,L.isCompositeType)(t.ofType))return rt;if((0,L.isListType)(t.ofType)&&(0,L.isCompositeType)(t.ofType.ofType))return rt}return null})(e);return i&&(r.insertText=e.name+i,r.insertTextFormat=H.Snippet,r.command=tt),r})))}return[]}(c,f,s);if(u===et.ARGUMENTS||u===et.ARGUMENT&&0===p){const e=f.argDefs;if(e)return j(c,e.map((e=>{var t;return{label:e.name,insertText:e.name+": ",command:tt,detail:String(e.type),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,kind:$.Variable,type:e.type}})))}if((u===et.OBJECT_VALUE||u===et.OBJECT_FIELD&&0===p)&&f.objectFieldDefs){const e=M(f.objectFieldDefs),t=u===et.OBJECT_VALUE?$.Value:$.Field;return j(c,e.map((e=>{var n;return{label:e.name,detail:String(e.type),documentation:null!==(n=e.description)&&void 0!==n?n:void 0,kind:t,type:e.type}})))}if(u===et.ENUM_VALUE||u===et.LIST_VALUE&&1===p||u===et.OBJECT_FIELD&&2===p||u===et.ARGUMENT&&2===p)return function(e,t,n,r){const i=(0,L.getNamedType)(t.inputType),o=it(n,r,e).filter((e=>e.detail===i.name));return i instanceof L.GraphQLEnumType?j(e,i.getValues().map((e=>{var t;return{label:e.name,detail:String(i),documentation:null!==(t=e.description)&&void 0!==t?t:void 0,deprecated:Boolean(e.deprecationReason),isDeprecated:Boolean(e.deprecationReason),deprecationReason:e.deprecationReason,kind:$.EnumMember,type:i}})).concat(o)):i===L.GraphQLBoolean?j(e,o.concat([{label:"true",detail:String(L.GraphQLBoolean),documentation:"Not false.",kind:$.Variable,type:L.GraphQLBoolean},{label:"false",detail:String(L.GraphQLBoolean),documentation:"Not true.",kind:$.Variable,type:L.GraphQLBoolean}])):o}(c,f,t,e);if(u===et.VARIABLE&&1===p){const n=(0,L.getNamedType)(f.inputType);return j(c,it(t,e,c).filter((e=>e.detail===(null==n?void 0:n.name))))}return u===et.TYPE_CONDITION&&1===p||u===et.NAMED_TYPE&&null!=l.prevState&&l.prevState.kind===et.TYPE_CONDITION?function(e,t,n,r){let i;if(t.parentType)if((0,L.isAbstractType)(t.parentType)){const e=(0,L.assertAbstractType)(t.parentType),r=n.getPossibleTypes(e),o=Object.create(null);r.forEach((e=>{e.getInterfaces().forEach((e=>{o[e.name]=e}))})),i=r.concat(M(o))}else i=[t.parentType];else i=M(n.getTypeMap()).filter(L.isCompositeType);return j(e,i.map((e=>{const t=(0,L.getNamedType)(e);return{label:String(e),documentation:(null==t?void 0:t.description)||"",kind:$.Field}})))}(c,f,e):u===et.FRAGMENT_SPREAD&&1===p?function(e,t,n,r,i){if(!r)return[];const o=n.getTypeMap(),a=I(e.state),s=ot(r);i&&i.length>0&&s.push(...i);return j(e,s.filter((e=>o[e.typeCondition.name.value]&&!(a&&a.kind===et.FRAGMENT_DEFINITION&&a.name===e.name.value)&&(0,L.isCompositeType)(t.parentType)&&(0,L.isCompositeType)(o[e.typeCondition.name.value])&&(0,L.doTypesOverlap)(n,t.parentType,o[e.typeCondition.name.value]))).map((e=>({label:e.name.value,detail:String(o[e.typeCondition.name.value]),documentation:`fragment ${e.name.value} on ${e.typeCondition.name.value}`,kind:$.Field,type:o[e.typeCondition.name.value]}))))}(c,f,e,t,Array.isArray(i)?i:(e=>{const t=[];if(e)try{(0,L.visit)((0,L.parse)(e),{FragmentDefinition(e){t.push(e)}})}catch(e){return[]}return t})(i)):u===et.VARIABLE_DEFINITION&&2===p||u===et.LIST_TYPE&&1===p||u===et.NAMED_TYPE&&l.prevState&&(l.prevState.kind===et.VARIABLE_DEFINITION||l.prevState.kind===et.LIST_TYPE||l.prevState.kind===et.NON_NULL_TYPE)?function(e,t,n){return j(e,M(t.getTypeMap()).filter(L.isInputType).map((e=>({label:e.name,documentation:e.description,kind:$.Variable}))))}(c,e):u===et.DIRECTIVE?function(e,t,n,r){var i;return(null===(i=t.prevState)||void 0===i?void 0:i.kind)?j(e,n.getDirectives().filter((e=>ct(t.prevState,e))).map((e=>({label:e.name,documentation:e.description||"",kind:$.Function})))):[]}(c,l,e):[]}const rt=" {\n $1\n}";function it(e,t,n){let r,i=null;const o=Object.create({});return st(e,((e,a)=>{if((null==a?void 0:a.kind)===et.VARIABLE&&a.name&&(i=a.name),(null==a?void 0:a.kind)===et.NAMED_TYPE&&i){const e=((e,t)=>{var n,r,i,o,a,s,c,l,u,p;return(null===(n=e.prevState)||void 0===n?void 0:n.kind)===t?e.prevState:(null===(i=null===(r=e.prevState)||void 0===r?void 0:r.prevState)||void 0===i?void 0:i.kind)===t?e.prevState.prevState:(null===(s=null===(a=null===(o=e.prevState)||void 0===o?void 0:o.prevState)||void 0===a?void 0:a.prevState)||void 0===s?void 0:s.kind)===t?e.prevState.prevState.prevState:(null===(p=null===(u=null===(l=null===(c=e.prevState)||void 0===c?void 0:c.prevState)||void 0===l?void 0:l.prevState)||void 0===u?void 0:u.prevState)||void 0===p?void 0:p.kind)===t?e.prevState.prevState.prevState.prevState:void 0})(a,et.TYPE);(null==e?void 0:e.type)&&(r=t.getType(null==e?void 0:e.type))}i&&r&&(o[i]||(o[i]={detail:r.toString(),insertText:"$"===n.string?i:"$"+i,label:i,type:r,kind:$.Variable},i=null,r=null))})),M(o)}function ot(e){const t=[];return st(e,((e,n)=>{n.kind===et.FRAGMENT_DEFINITION&&n.name&&n.type&&t.push({kind:et.FRAGMENT_DEFINITION,name:{kind:L.Kind.NAME,value:n.name},selectionSet:{kind:et.SELECTION_SET,selections:[]},typeCondition:{kind:et.NAMED_TYPE,name:{kind:L.Kind.NAME,value:n.type}}})})),t}function at(e,t){let n=null,r=null,i=null;const o=st(e,((e,o,a,s)=>{if(s===t.line&&e.getCurrentPosition()>=t.character)return n=a,r=Object.assign({},o),i=e.current(),"BREAK"}));return{start:o.start,end:o.end,string:i||o.string,state:r||o.state,style:n||o.style}}function st(e,t){const n=e.split("\n"),r=ze();let i=r.startState(),o="",a=new Me("");for(let e=0;e{var d;switch(t.kind){case et.QUERY:case"ShortQuery":p=e.getQueryType();break;case et.MUTATION:p=e.getMutationType();break;case et.SUBSCRIPTION:p=e.getSubscriptionType();break;case et.INLINE_FRAGMENT:case et.FRAGMENT_DEFINITION:t.type&&(p=e.getType(t.type));break;case et.FIELD:case et.ALIASED_FIELD:p&&t.name?(a=u?P(e,u,t.name):null,p=a?a.type:null):a=null;break;case et.SELECTION_SET:u=(0,L.getNamedType)(p);break;case et.DIRECTIVE:i=t.name?e.getDirective(t.name):null;break;case et.INTERFACE_DEF:t.name&&(c=null,f=new L.GraphQLInterfaceType({name:t.name,interfaces:[],fields:{}}));break;case et.OBJECT_TYPE_DEF:t.name&&(f=null,c=new L.GraphQLObjectType({name:t.name,interfaces:[],fields:{}}));break;case et.ARGUMENTS:if(t.prevState)switch(t.prevState.kind){case et.FIELD:r=a&&a.args;break;case et.DIRECTIVE:r=i&&i.args;break;case et.ALIASED_FIELD:{const n=null===(d=t.prevState)||void 0===d?void 0:d.name;if(!n){r=null;break}const i=u?P(e,u,n):null;if(!i){r=null;break}r=i.args;break}default:r=null}else r=null;break;case et.ARGUMENT:if(r)for(let e=0;ee.value===t.name)):null;break;case et.LIST_VALUE:const m=(0,L.getNullableType)(s);s=m instanceof L.GraphQLList?m.ofType:null;break;case et.OBJECT_VALUE:const v=(0,L.getNamedType)(s);l=v instanceof L.GraphQLInputObjectType?v.getFields():null;break;case et.OBJECT_FIELD:const y=t.name&&l?l[t.name]:null;s=null==y?void 0:y.type;break;case et.NAMED_TYPE:t.name&&(p=e.getType(t.name))}})),{argDef:n,argDefs:r,directiveDef:i,enumValue:o,fieldDef:a,inputType:s,objectFieldDefs:l,parentType:u,type:p,interfaceDef:f,objectTypeDef:c}}var ut=n(4357),pt=n.n(ut);const ft=(e,t)=>{if(!t)return[];let n;try{n=(0,L.parse)(e)}catch(e){return[]}return dt(n,t)},dt=(e,t)=>{if(!t)return[];const n=new Map,r=new Set;(0,L.visit)(e,{FragmentDefinition(e){n.set(e.name.value,!0)},FragmentSpread(e){r.has(e.name.value)||r.add(e.name.value)}});const i=new Set;r.forEach((e=>{!n.has(e)&&t.has(e)&&i.add(pt()(t.get(e)))}));const o=[];return i.forEach((e=>{(0,L.visit)(e,{FragmentSpread(e){!r.has(e.name.value)&&t.get(e.name.value)&&(i.add(pt()(t.get(e.name.value))),r.add(e.name.value))}}),n.has(e.name.value)||o.push(e)})),o};function ht(e,t){e.push(t)}function mt(e,t){(0,L.isNonNullType)(t)?(mt(e,t.ofType),ht(e,"!")):(0,L.isListType)(t)?(ht(e,"["),mt(e,t.ofType),ht(e,"]")):ht(e,t.name)}function vt(e,t){const n=[];return t&&ht(n,"```graphql\n"),mt(n,e),t&&ht(n,"\n```"),n.join("")}const yt={Int:"integer",String:"string",Float:"number",ID:"string",Boolean:"boolean",DateTime:"string"};function gt(e,t){var n;let r=!1,i=Object.create(null);const o=Object.create(null);if("defaultValue"in e&&void 0!==e.defaultValue&&(i.default=e.defaultValue),(0,L.isEnumType)(e)&&(i.type="string",i.enum=e.getValues().map((e=>e.name))),(0,L.isScalarType)(e)&&(i.type=null!==(n=yt[e.name])&&void 0!==n?n:"any"),(0,L.isListType)(e)){i.type="array";const{definition:n,definitions:r}=gt(e.ofType,t);n.$ref?i.items={$ref:n.$ref}:i.items=n,r&&Object.keys(r).forEach((e=>{o[e]=r[e]}))}if((0,L.isNonNullType)(e)){r=!0;const{definition:n,definitions:a}=gt(e.ofType,t);i=n,a&&Object.keys(a).forEach((e=>{o[e]=a[e]}))}if((0,L.isInputObjectType)(e)){i.$ref=`#/definitions/${e.name}`;const n=e.getFields(),r={type:"object",properties:{},required:[]};e.description?(r.description=e.description+"\n"+vt(e),(null==t?void 0:t.useMarkdownDescription)&&(r.markdownDescription=e.description+"\n"+vt(e,!0))):(r.description=vt(e),(null==t?void 0:t.useMarkdownDescription)&&(r.markdownDescription=vt(e,!0))),Object.keys(n).forEach((e=>{const i=n[e],{required:a,definition:s,definitions:c}=gt(i.type,t),{definition:l}=gt(i,t);r.properties[e]=Object.assign(Object.assign({},s),l);const u=vt(i.type);if(r.properties[e].description=i.description?i.description+"\n"+u:u,null==t?void 0:t.useMarkdownDescription){const t=vt(i.type,!0);r.properties[e].markdownDescription=i.description?i.description+"\n"+t:t}a&&r.required.push(e),c&&Object.keys(c).map((e=>{o[e]=c[e]}))})),o[e.name]=r}return"description"in e&&!(0,L.isScalarType)(e)&&e.description&&!i.description?(i.description=e.description+"\n"+vt(e),(null==t?void 0:t.useMarkdownDescription)&&(i.markdownDescription=e.description+"\n"+vt(e,!0))):(i.description=vt(e),(null==t?void 0:t.useMarkdownDescription)&&(i.markdownDescription=vt(e,!0))),{required:r,definition:i,definitions:o}}function bt(e,t){const n={$schema:"https://json-schema.org/draft/2020-12/schema",type:"object",properties:{},required:[]};return e&&Object.entries(e).forEach((([e,r])=>{var i;const{definition:o,required:a,definitions:s}=gt(r,t);n.properties[e]=o,a&&(null===(i=n.required)||void 0===i||i.push(e)),s&&(n.definitions=Object.assign(Object.assign({},null==n?void 0:n.definitions),s))})),n}function Et(e,t,n){const r=wt(e,n);let i;return(0,L.visit)(t,{enter(e){if(!("Name"!==e.kind&&e.loc&&e.loc.start<=r&&r<=e.loc.end))return!1;i=e},leave(e){if(e.loc&&e.loc.start<=r&&r<=e.loc.end)return!1}}),i}function wt(e,t){const n=e.split("\n").slice(0,t.line);return t.character+n.map((e=>e.length+1)).reduce(((e,t)=>e+t),0)}class Tt{constructor(e,t){this.containsPosition=e=>this.start.line===e.line?this.start.character<=e.character:this.end.line===e.line?this.end.character>=e.character:this.start.line<=e.line&&this.end.line>=e.line,this.start=e,this.end=t}setStart(e,t){this.start=new _t(e,t)}setEnd(e,t){this.end=new _t(e,t)}}class _t{constructor(e,t){this.lessThanOrEqualTo=e=>this.linee!==L.NoUnusedFragmentsRule&&e!==L.ExecutableDefinitionsRule&&(!r||e!==L.KnownFragmentNamesRule)));return n&&Array.prototype.push.apply(o,n),i&&Array.prototype.push.apply(o,Ot),(0,L.validate)(e,t,o).filter((e=>{if(-1!==e.message.indexOf("Unknown directive")&&e.nodes){const t=e.nodes[0];if(t&&t.kind===L.Kind.DIRECTIVE){const e=t.name.value;if("arguments"===e||"argumentDefinitions"===e)return!1}}return!0}))}function xt(e,t){const n=Object.create(null);return t.definitions.forEach((t=>{if("OperationDefinition"===t.kind){const r=t.variableDefinitions;r&&r.forEach((({variable:t,type:r})=>{const i=(0,L.typeFromAST)(e,r);i?n[t.name.value]=i:r.kind===L.Kind.NAMED_TYPE&&"Float"===r.name.value&&(n[t.name.value]=L.GraphQLFloat)}))}})),n}function Ct(e,t){const n=t?xt(t,e):void 0,r=[];return(0,L.visit)(e,{OperationDefinition(e){r.push(e)}}),{variableToType:n,operations:r}}function Nt(e,t){if(t)try{const n=(0,L.parse)(t);return Object.assign(Object.assign({},Ct(n,e)),{documentAST:n})}catch(e){return}}const At=Nt;var Lt=function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))};const Dt="GraphQL";function It(e,t){if(!e)throw new Error(t)}function Pt(e,t){const n=t.loc;return It(n,"Expected ASTNode to have a location."),function(e,t){const n=kt(e,t.start),r=kt(e,t.end);return new Tt(n,r)}(e,n)}function Rt(e,t){const n=t.loc;return It(n,"Expected ASTNode to have a location."),kt(e,n.start)}function Mt(e,t,n){return Lt(this,void 0,void 0,(function*(){const r=t.name.value,i=n.filter((({definition:e})=>e.name&&e.name.value===r));if(0===i.length)throw Error(`Definition not found for GraphQL type ${r}`);const o=i.map((({filePath:e,content:t,definition:n})=>function(e,t,n){const r=n.name;return It(r,"Expected ASTNode to have a Name."),{path:e,position:Rt(t,n),range:Pt(t,n),name:r.value||"",language:Dt,projectRoot:e}}(e||"",t,n)));return{definitions:o,queryRange:o.map((n=>Pt(e,t)))}}))}function jt(e,t,n){return Lt(this,void 0,void 0,(function*(){const r=n.filter((({definition:e})=>e.name&&e.name.value===t));if(0===r.length)throw Error(`Definition not found for GraphQL type ${t}`);const i=[];return r.forEach((({filePath:t,content:n,definition:r})=>{var o;const a=null===(o=r.fields)||void 0===o?void 0:o.find((t=>t.name.value===e));if(null==a)return null;i.push(function(e,t,n){const r=n.name;return It(r,"Expected ASTNode to have a Name."),{path:e,position:Rt(t,n),range:Pt(t,n),name:r.value||"",language:Dt,projectRoot:e}}(t||"",n,a))})),{definitions:i,queryRange:[]}}))}function Ft(e,t,n){return Lt(this,void 0,void 0,(function*(){const r=t.name.value,i=n.filter((({definition:e})=>e.name.value===r));if(0===i.length)throw Error(`Definition not found for GraphQL fragment ${r}`);const o=i.map((({filePath:e,content:t,definition:n})=>Qt(e||"",t,n)));return{definitions:o,queryRange:o.map((n=>Pt(e,t)))}}))}function Vt(e,t,n){return{definitions:[Qt(e,t,n)],queryRange:n.name?[Pt(t,n.name)]:[]}}function Qt(e,t,n){const r=n.name;if(!r)throw Error("Expected ASTNode to have a Name.");return{path:e,position:Rt(t,n),range:Pt(t,n),name:r.value||"",language:Dt,projectRoot:e}}const qt={Error:"Error",Warning:"Warning",Information:"Information",Hint:"Hint"},Ut={[qt.Error]:1,[qt.Warning]:2,[qt.Information]:3,[qt.Hint]:4},Gt=(e,t)=>{if(!e)throw new Error(t)};function Bt(e,t=null,n,r,i){var o,a;let s=null;i&&(e+="string"==typeof i?"\n\n"+i:"\n\n"+i.reduce(((e,t)=>e+((0,L.print)(t)+"\n\n")),""));try{s=(0,L.parse)(e)}catch(t){if(t instanceof L.GraphQLError){const n=Ht(null!==(a=null===(o=t.locations)||void 0===o?void 0:o[0])&&void 0!==a?a:{line:0,column:0},e);return[{severity:Ut.Error,message:t.message,source:"GraphQL: Syntax",range:n}]}throw t}return Kt(s,t,n,r)}function Kt(e,t=null,n,r){if(!t)return[];const i=zt(St(t,e,n,r),(e=>$t(e,Ut.Error,"Validation"))),o=zt((0,L.validate)(t,e,[L.NoDeprecatedCustomRule]),(e=>$t(e,Ut.Warning,"Deprecation")));return i.concat(o)}function zt(e,t){return Array.prototype.concat.apply([],e.map(t))}function $t(e,t,n){if(!e.nodes)return[];const r=[];return e.nodes.forEach((i=>{const o="Variable"!==i.kind&&"name"in i&&void 0!==i.name?i.name:"variable"in i&&void 0!==i.variable?i.variable:i;if(o){Gt(e.locations,"GraphQL validation error requires locations.");const i=e.locations[0],a=function(e){const t=e.loc;return Gt(t,"Expected ASTNode to have a location."),t}(o),s=i.column+(a.end-a.start);r.push({source:`GraphQL: ${n}`,message:e.message,severity:t,range:new Tt(new _t(i.line-1,i.column-1),new _t(i.line-1,s))})}})),r}function Ht(e,t){const n=ze(),r=n.startState(),i=t.split("\n");Gt(i.length>=e.line,"Query text must have more lines than where the error happened");let o=null;for(let t=0;t({representativeName:t.name,startPosition:kt(e,t.loc.start),endPosition:kt(e,t.loc.end),kind:t.kind,children:t.selectionSet||t.fields||t.values||t.arguments||[]});return{Field:e=>{const n=e.alias?[Jt("plain",e.alias),Jt("plain",": ")]:[];return n.push(Jt("plain",e.name)),Object.assign({tokenizedText:n},t(e))},OperationDefinition:e=>Object.assign({tokenizedText:[Jt("keyword",e.operation),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),Document:e=>e.definitions,SelectionSet:e=>function(e,t){const n=[];for(let t=0;te.value,FragmentDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","fragment"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),InterfaceTypeDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","interface"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),EnumTypeDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","enum"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),EnumValueDefinition:e=>Object.assign({tokenizedText:[Jt("plain",e.name)]},t(e)),ObjectTypeDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","type"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),InputObjectTypeDefinition:e=>Object.assign({tokenizedText:[Jt("keyword","input"),Jt("whitespace"," "),Jt("class-name",e.name)]},t(e)),FragmentSpread:e=>Object.assign({tokenizedText:[Jt("plain","..."),Jt("class-name",e.name)]},t(e)),InputValueDefinition:e=>Object.assign({tokenizedText:[Jt("plain",e.name)]},t(e)),FieldDefinition:e=>Object.assign({tokenizedText:[Jt("plain",e.name)]},t(e)),InlineFragment:e=>e.selectionSet}}(e);return{outlineTrees:(0,L.visit)(t,{leave:e=>void 0!==n&&e.kind in n?n[e.kind](e):null})}}function Jt(e,t){return{kind:e,value:t}}function Xt(e,t,n,r,i){const o=r||at(t,n);if(!e||!o||!o.state)return"";const a=o.state,s=a.kind,c=a.step,l=lt(e,o.state),u=Object.assign(Object.assign({},i),{schema:e});if("Field"===s&&0===c&&l.fieldDef||"AliasedField"===s&&2===c&&l.fieldDef){const e=[];return Zt(e,u),function(e,t,n){tn(e,t,n),rn(e,t,n,t.type)}(e,l,u),en(e,u),an(e,0,l.fieldDef),e.join("").trim()}if("Directive"===s&&1===c&&l.directiveDef){const e=[];return Zt(e,u),nn(e,l),en(e,u),an(e,0,l.directiveDef),e.join("").trim()}if("Argument"===s&&0===c&&l.argDef){const e=[];return Zt(e,u),function(e,t,n){if(t.directiveDef?nn(e,t):t.fieldDef&&tn(e,t,n),!t.argDef)return;const r=t.argDef.name;sn(e,"("),sn(e,r),rn(e,t,n,t.inputType),sn(e,")")}(e,l,u),en(e,u),an(e,0,l.argDef),e.join("").trim()}if("EnumValue"===s&&l.enumValue&&"description"in l.enumValue){const e=[];return Zt(e,u),function(e,t,n){if(!t.enumValue)return;const r=t.enumValue.name;on(e,t,n,t.inputType),sn(e,"."),sn(e,r)}(e,l,u),en(e,u),an(e,0,l.enumValue),e.join("").trim()}if("NamedType"===s&&l.type&&"description"in l.type){const e=[];return Zt(e,u),on(e,l,u,l.type),en(e,u),an(e,0,l.type),e.join("").trim()}return""}function Zt(e,t){t.useMarkdown&&sn(e,"```graphql\n")}function en(e,t){t.useMarkdown&&sn(e,"\n```")}function tn(e,t,n){if(!t.fieldDef)return;const r=t.fieldDef.name;"__"!==r.slice(0,2)&&(on(e,t,n,t.parentType),sn(e,".")),sn(e,r)}function nn(e,t,n){t.directiveDef&&sn(e,"@"+t.directiveDef.name)}function rn(e,t,n,r){sn(e,": "),on(e,t,n,r)}function on(e,t,n,r){r&&(r instanceof L.GraphQLNonNull?(on(e,t,n,r.ofType),sn(e,"!")):r instanceof L.GraphQLList?(sn(e,"["),on(e,t,n,r.ofType),sn(e,"]")):sn(e,r.name))}function an(e,t,n){if(!n)return;const r="string"==typeof n.description?n.description:null;r&&(sn(e,"\n\n"),sn(e,r)),function(e,t,n){if(!n)return;const r=n.deprecationReason?n.deprecationReason:null;r&&(sn(e,"\n\n"),sn(e,"Deprecated: "),sn(e,r))}(e,0,n)}function sn(e,t){e.push(t)}const cn={Created:1,Changed:2,Deleted:3};var ln;!function(e){e.Text=1,e.Method=2,e.Function=3,e.Constructor=4,e.Field=5,e.Variable=6,e.Class=7,e.Interface=8,e.Module=9,e.Property=10,e.Unit=11,e.Value=12,e.Enum=13,e.Keyword=14,e.Snippet=15,e.Color=16,e.File=17,e.Reference=18,e.Folder=19,e.EnumMember=20,e.Constant=21,e.Struct=22,e.Event=23,e.Operator=24,e.TypeParameter=25}(ln||(ln={}))},5822:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLError=void 0,t.formatError=function(e){return e.toJSON()},t.printError=function(e){return e.toString()};var r=n(5690),i=n(9016),o=n(8038);class a extends Error{constructor(e,...t){var n,o,c;const{nodes:l,source:u,positions:p,path:f,originalError:d,extensions:h}=function(e){const t=e[0];return null==t||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}(t);super(e),this.name="GraphQLError",this.path=null!=f?f:void 0,this.originalError=null!=d?d:void 0,this.nodes=s(Array.isArray(l)?l:l?[l]:void 0);const m=s(null===(n=this.nodes)||void 0===n?void 0:n.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=u?u:null==m||null===(o=m[0])||void 0===o?void 0:o.source,this.positions=null!=p?p:null==m?void 0:m.map((e=>e.start)),this.locations=p&&u?p.map((e=>(0,i.getLocation)(u,e))):null==m?void 0:m.map((e=>(0,i.getLocation)(e.source,e.start)));const v=(0,r.isObjectLike)(null==d?void 0:d.extensions)?null==d?void 0:d.extensions:void 0;this.extensions=null!==(c=null!=h?h:v)&&void 0!==c?c:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=d&&d.stack?Object.defineProperty(this,"stack",{value:d.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const t of this.nodes)t.loc&&(e+="\n\n"+(0,o.printLocation)(t.loc));else if(this.source&&this.locations)for(const t of this.locations)e+="\n\n"+(0,o.printSourceLocation)(this.source,t);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function s(e){return void 0===e||0===e.length?void 0:e}t.GraphQLError=a},6972:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"GraphQLError",{enumerable:!0,get:function(){return r.GraphQLError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return r.formatError}}),Object.defineProperty(t,"locatedError",{enumerable:!0,get:function(){return o.locatedError}}),Object.defineProperty(t,"printError",{enumerable:!0,get:function(){return r.printError}}),Object.defineProperty(t,"syntaxError",{enumerable:!0,get:function(){return i.syntaxError}});var r=n(5822),i=n(338),o=n(1993)},1993:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.locatedError=function(e,t,n){var o;const a=(0,r.toError)(e);return s=a,Array.isArray(s.path)?a:new i.GraphQLError(a.message,{nodes:null!==(o=a.nodes)&&void 0!==o?o:t,source:a.source,positions:a.positions,path:n,originalError:a});var s};var r=n(7729),i=n(5822)},338:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.syntaxError=function(e,t,n){return new r.GraphQLError(`Syntax Error: ${n}`,{source:e,positions:[t]})};var r=n(5822)},8950:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.collectFields=function(e,t,n,r,i){const o=new Map;return c(e,t,n,r,i,o,new Set),o},t.collectSubfields=function(e,t,n,r,i){const o=new Map,a=new Set;for(const s of i)s.selectionSet&&c(e,t,n,r,s.selectionSet,o,a);return o};var r=n(2828),i=n(5003),o=n(7197),a=n(5115),s=n(8840);function c(e,t,n,i,o,a,s){for(const f of o.selections)switch(f.kind){case r.Kind.FIELD:{if(!l(n,f))continue;const e=(p=f).alias?p.alias.value:p.name.value,t=a.get(e);void 0!==t?t.push(f):a.set(e,[f]);break}case r.Kind.INLINE_FRAGMENT:if(!l(n,f)||!u(e,f,i))continue;c(e,t,n,i,f.selectionSet,a,s);break;case r.Kind.FRAGMENT_SPREAD:{const r=f.name.value;if(s.has(r)||!l(n,f))continue;s.add(r);const o=t[r];if(!o||!u(e,o,i))continue;c(e,t,n,i,o.selectionSet,a,s);break}}var p}function l(e,t){const n=(0,s.getDirectiveValues)(o.GraphQLSkipDirective,t,e);if(!0===(null==n?void 0:n.if))return!1;const r=(0,s.getDirectiveValues)(o.GraphQLIncludeDirective,t,e);return!1!==(null==r?void 0:r.if)}function u(e,t,n){const r=t.typeCondition;if(!r)return!0;const o=(0,a.typeFromAST)(e,r);return o===n||!!(0,i.isAbstractType)(o)&&e.isSubType(o,n)}},192:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidExecutionArguments=O,t.buildExecutionContext=S,t.buildResolveInfo=A,t.defaultTypeResolver=t.defaultFieldResolver=void 0,t.execute=_,t.executeSync=function(e){const t=_(e);if((0,c.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t},t.getFieldDef=F;var r=n(7242),i=n(8002),o=n(7706),a=n(6609),s=n(5690),c=n(4221),l=n(5456),u=n(7059),p=n(3179),f=n(9915),d=n(5822),h=n(1993),m=n(1807),v=n(2828),y=n(5003),g=n(8155),b=n(1671),E=n(8950),w=n(8840);const T=(0,l.memoize3)(((e,t,n)=>(0,E.collectSubfields)(e.schema,e.fragments,e.variableValues,t,n)));function _(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,document:n,variableValues:i,rootValue:o}=e;O(t,n,i);const a=S(e);if(!("schema"in a))return{errors:a};try{const{operation:e}=a,t=x(a,e,o);return(0,c.isPromise)(t)?t.then((e=>k(e,a.errors)),(e=>(a.errors.push(e),k(null,a.errors)))):k(t,a.errors)}catch(e){return a.errors.push(e),k(null,a.errors)}}function k(e,t){return 0===t.length?{data:e}:{errors:t,data:e}}function O(e,t,n){t||(0,r.devAssert)(!1,"Must provide document."),(0,b.assertValidSchema)(e),null==n||(0,s.isObjectLike)(n)||(0,r.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function S(e){var t,n;const{schema:r,document:i,rootValue:o,contextValue:a,variableValues:s,operationName:c,fieldResolver:l,typeResolver:u,subscribeFieldResolver:p}=e;let f;const h=Object.create(null);for(const e of i.definitions)switch(e.kind){case v.Kind.OPERATION_DEFINITION:if(null==c){if(void 0!==f)return[new d.GraphQLError("Must provide operation name if query contains multiple operations.")];f=e}else(null===(t=e.name)||void 0===t?void 0:t.value)===c&&(f=e);break;case v.Kind.FRAGMENT_DEFINITION:h[e.name.value]=e}if(!f)return null!=c?[new d.GraphQLError(`Unknown operation named "${c}".`)]:[new d.GraphQLError("Must provide an operation.")];const m=null!==(n=f.variableDefinitions)&&void 0!==n?n:[],y=(0,w.getVariableValues)(r,m,null!=s?s:{},{maxErrors:50});return y.errors?y.errors:{schema:r,fragments:h,rootValue:o,contextValue:a,operation:f,variableValues:y.coerced,fieldResolver:null!=l?l:j,typeResolver:null!=u?u:M,subscribeFieldResolver:null!=p?p:j,errors:[]}}function x(e,t,n){const r=e.schema.getRootType(t.operation);if(null==r)throw new d.GraphQLError(`Schema is not configured to execute ${t.operation} operation.`,{nodes:t});const i=(0,E.collectFields)(e.schema,e.fragments,e.variableValues,r,t.selectionSet),o=void 0;switch(t.operation){case m.OperationTypeNode.QUERY:return C(e,r,n,o,i);case m.OperationTypeNode.MUTATION:return function(e,t,n,r,i){return(0,f.promiseReduce)(i.entries(),((r,[i,o])=>{const a=(0,u.addPath)(undefined,i,t.name),s=N(e,t,n,o,a);return void 0===s?r:(0,c.isPromise)(s)?s.then((e=>(r[i]=e,r))):(r[i]=s,r)}),Object.create(null))}(e,r,n,0,i);case m.OperationTypeNode.SUBSCRIPTION:return C(e,r,n,o,i)}}function C(e,t,n,r,i){const o=Object.create(null);let a=!1;try{for(const[s,l]of i.entries()){const i=N(e,t,n,l,(0,u.addPath)(r,s,t.name));void 0!==i&&(o[s]=i,(0,c.isPromise)(i)&&(a=!0))}}catch(e){if(a)return(0,p.promiseForObject)(o).finally((()=>{throw e}));throw e}return a?(0,p.promiseForObject)(o):o}function N(e,t,n,r,i){var o;const a=F(e.schema,t,r[0]);if(!a)return;const s=a.type,l=null!==(o=a.resolve)&&void 0!==o?o:e.fieldResolver,p=A(e,a,r,t,i);try{const t=l(n,(0,w.getArgumentValues)(a,r[0],e.variableValues),e.contextValue,p);let o;return o=(0,c.isPromise)(t)?t.then((t=>D(e,s,r,p,i,t))):D(e,s,r,p,i,t),(0,c.isPromise)(o)?o.then(void 0,(t=>L((0,h.locatedError)(t,r,(0,u.pathToArray)(i)),s,e))):o}catch(t){return L((0,h.locatedError)(t,r,(0,u.pathToArray)(i)),s,e)}}function A(e,t,n,r,i){return{fieldName:t.name,fieldNodes:n,returnType:t.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function L(e,t,n){if((0,y.isNonNullType)(t))throw e;return n.errors.push(e),null}function D(e,t,n,r,s,l){if(l instanceof Error)throw l;if((0,y.isNonNullType)(t)){const i=D(e,t.ofType,n,r,s,l);if(null===i)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return i}return null==l?null:(0,y.isListType)(t)?function(e,t,n,r,i,o){if(!(0,a.isIterableObject)(o))throw new d.GraphQLError(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const s=t.ofType;let l=!1;const p=Array.from(o,((t,o)=>{const a=(0,u.addPath)(i,o,void 0);try{let i;return i=(0,c.isPromise)(t)?t.then((t=>D(e,s,n,r,a,t))):D(e,s,n,r,a,t),(0,c.isPromise)(i)?(l=!0,i.then(void 0,(t=>L((0,h.locatedError)(t,n,(0,u.pathToArray)(a)),s,e)))):i}catch(t){return L((0,h.locatedError)(t,n,(0,u.pathToArray)(a)),s,e)}}));return l?Promise.all(p):p}(e,t,n,r,s,l):(0,y.isLeafType)(t)?function(e,t){const n=e.serialize(t);if(null==n)throw new Error(`Expected \`${(0,i.inspect)(e)}.serialize(${(0,i.inspect)(t)})\` to return non-nullable value, returned: ${(0,i.inspect)(n)}`);return n}(t,l):(0,y.isAbstractType)(t)?function(e,t,n,r,i,o){var a;const s=null!==(a=t.resolveType)&&void 0!==a?a:e.typeResolver,l=e.contextValue,u=s(o,l,r,t);return(0,c.isPromise)(u)?u.then((a=>P(e,I(a,e,t,n,r,o),n,r,i,o))):P(e,I(u,e,t,n,r,o),n,r,i,o)}(e,t,n,r,s,l):(0,y.isObjectType)(t)?P(e,t,n,r,s,l):void(0,o.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,i.inspect)(t))}function I(e,t,n,r,o,a){if(null==e)throw new d.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}". Either the "${n.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if((0,y.isObjectType)(e))throw new d.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new d.GraphQLError(`Abstract type "${n.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}" with value ${(0,i.inspect)(a)}, received "${(0,i.inspect)(e)}".`);const s=t.schema.getType(e);if(null==s)throw new d.GraphQLError(`Abstract type "${n.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!(0,y.isObjectType)(s))throw new d.GraphQLError(`Abstract type "${n.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!t.schema.isSubType(n,s))throw new d.GraphQLError(`Runtime Object type "${s.name}" is not a possible type for "${n.name}".`,{nodes:r});return s}function P(e,t,n,r,i,o){const a=T(e,t,n);if(t.isTypeOf){const s=t.isTypeOf(o,e.contextValue,r);if((0,c.isPromise)(s))return s.then((r=>{if(!r)throw R(t,o,n);return C(e,t,o,i,a)}));if(!s)throw R(t,o,n)}return C(e,t,o,i,a)}function R(e,t,n){return new d.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,i.inspect)(t)}.`,{nodes:n})}const M=function(e,t,n,r){if((0,s.isObjectLike)(e)&&"string"==typeof e.__typename)return e.__typename;const i=n.schema.getPossibleTypes(r),o=[];for(let r=0;r{for(let t=0;tr(await n.next()),return:async()=>"function"==typeof n.return?r(await n.return()):{value:void 0,done:!0},async throw(e){if("function"==typeof n.throw)return r(await n.throw(e));throw e},[Symbol.asyncIterator](){return this}}}},6234:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSourceEventStream=d,t.subscribe=async function(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const t=await d(e);if(!(0,o.isAsyncIterable)(t))return t;const n=t=>(0,u.execute)({...e,rootValue:t});return(0,p.mapAsyncIterator)(t,n)};var r=n(7242),i=n(8002),o=n(8648),a=n(7059),s=n(5822),c=n(1993),l=n(8950),u=n(192),p=n(6082),f=n(8840);async function d(...e){const t=function(e){const t=e[0];return t&&"document"in t?t:{schema:t,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}(e),{schema:n,document:r,variableValues:p}=t;(0,u.assertValidExecutionArguments)(n,r,p);const d=(0,u.buildExecutionContext)(t);if(!("schema"in d))return{errors:d};try{const e=await async function(e){const{schema:t,fragments:n,operation:r,variableValues:i,rootValue:o}=e,p=t.getSubscriptionType();if(null==p)throw new s.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:r});const d=(0,l.collectFields)(t,n,i,p,r.selectionSet),[h,m]=[...d.entries()][0],v=(0,u.getFieldDef)(t,p,m[0]);if(!v){const e=m[0].name.value;throw new s.GraphQLError(`The subscription field "${e}" is not defined.`,{nodes:m})}const y=(0,a.addPath)(void 0,h,p.name),g=(0,u.buildResolveInfo)(e,v,m,p,y);try{var b;const t=(0,f.getArgumentValues)(v,m[0],i),n=e.contextValue,r=null!==(b=v.subscribe)&&void 0!==b?b:e.subscribeFieldResolver,a=await r(o,t,n,g);if(a instanceof Error)throw a;return a}catch(e){throw(0,c.locatedError)(e,m,(0,a.pathToArray)(y))}}(d);if(!(0,o.isAsyncIterable)(e))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,i.inspect)(e)}.`);return e}catch(e){if(e instanceof s.GraphQLError)return{errors:[e]};throw e}}},8840:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getArgumentValues=d,t.getDirectiveValues=function(e,t,n){var r;const i=null===(r=t.directives)||void 0===r?void 0:r.find((t=>t.name.value===e.name));if(i)return d(e,i,n)},t.getVariableValues=function(e,t,n,i){const s=[],d=null==i?void 0:i.maxErrors;try{const i=function(e,t,n,i){const s={};for(const d of t){const t=d.variable.name.value,m=(0,p.typeFromAST)(e,d.type);if(!(0,l.isInputType)(m)){const e=(0,c.print)(d.type);i(new a.GraphQLError(`Variable "$${t}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:d.type}));continue}if(!h(n,t)){if(d.defaultValue)s[t]=(0,f.valueFromAST)(d.defaultValue,m);else if((0,l.isNonNullType)(m)){const e=(0,r.inspect)(m);i(new a.GraphQLError(`Variable "$${t}" of required type "${e}" was not provided.`,{nodes:d}))}continue}const v=n[t];if(null===v&&(0,l.isNonNullType)(m)){const e=(0,r.inspect)(m);i(new a.GraphQLError(`Variable "$${t}" of non-null type "${e}" must not be null.`,{nodes:d}))}else s[t]=(0,u.coerceInputValue)(v,m,((e,n,s)=>{let c=`Variable "$${t}" got invalid value `+(0,r.inspect)(n);e.length>0&&(c+=` at "${t}${(0,o.printPathArray)(e)}"`),i(new a.GraphQLError(c+"; "+s.message,{nodes:d,originalError:s}))}))}return s}(e,t,n,(e=>{if(null!=d&&s.length>=d)throw new a.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");s.push(e)}));if(0===s.length)return{coerced:i}}catch(e){s.push(e)}return{errors:s}};var r=n(8002),i=n(2863),o=n(737),a=n(5822),s=n(2828),c=n(3033),l=n(5003),u=n(3679),p=n(5115),f=n(3770);function d(e,t,n){var o;const u={},p=null!==(o=t.arguments)&&void 0!==o?o:[],d=(0,i.keyMap)(p,(e=>e.name.value));for(const i of e.args){const e=i.name,o=i.type,p=d[e];if(!p){if(void 0!==i.defaultValue)u[e]=i.defaultValue;else if((0,l.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of required type "${(0,r.inspect)(o)}" was not provided.`,{nodes:t});continue}const m=p.value;let v=m.kind===s.Kind.NULL;if(m.kind===s.Kind.VARIABLE){const t=m.name.value;if(null==n||!h(n,t)){if(void 0!==i.defaultValue)u[e]=i.defaultValue;else if((0,l.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of required type "${(0,r.inspect)(o)}" was provided the variable "$${t}" which was not provided a runtime value.`,{nodes:m});continue}v=null==n[t]}if(v&&(0,l.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of non-null type "${(0,r.inspect)(o)}" must not be null.`,{nodes:m});const y=(0,f.valueFromAST)(m,o,n);if(void 0===y)throw new a.GraphQLError(`Argument "${e}" has invalid value ${(0,c.print)(m)}.`,{nodes:m});u[e]=y}return u}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},9728:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.graphql=function(e){return new Promise((t=>t(l(e))))},t.graphqlSync=function(e){const t=l(e);if((0,i.isPromise)(t))throw new Error("GraphQL execution failed to complete synchronously.");return t};var r=n(7242),i=n(4221),o=n(8370),a=n(1671),s=n(9504),c=n(192);function l(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:t,source:n,rootValue:i,contextValue:l,variableValues:u,operationName:p,fieldResolver:f,typeResolver:d}=e,h=(0,a.validateSchema)(t);if(h.length>0)return{errors:h};let m;try{m=(0,o.parse)(n)}catch(e){return{errors:[e]}}const v=(0,s.validate)(t,m);return v.length>0?{errors:v}:(0,c.execute)({schema:t,document:m,rootValue:i,contextValue:l,variableValues:u,operationName:p,fieldResolver:f,typeResolver:d})}},20:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BREAK",{enumerable:!0,get:function(){return a.BREAK}}),Object.defineProperty(t,"BreakingChangeType",{enumerable:!0,get:function(){return u.BreakingChangeType}}),Object.defineProperty(t,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return o.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(t,"DangerousChangeType",{enumerable:!0,get:function(){return u.DangerousChangeType}}),Object.defineProperty(t,"DirectiveLocation",{enumerable:!0,get:function(){return a.DirectiveLocation}}),Object.defineProperty(t,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return c.ExecutableDefinitionsRule}}),Object.defineProperty(t,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return c.FieldsOnCorrectTypeRule}}),Object.defineProperty(t,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return c.FragmentsOnCompositeTypesRule}}),Object.defineProperty(t,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return o.GRAPHQL_MAX_INT}}),Object.defineProperty(t,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return o.GRAPHQL_MIN_INT}}),Object.defineProperty(t,"GraphQLBoolean",{enumerable:!0,get:function(){return o.GraphQLBoolean}}),Object.defineProperty(t,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return o.GraphQLDeprecatedDirective}}),Object.defineProperty(t,"GraphQLDirective",{enumerable:!0,get:function(){return o.GraphQLDirective}}),Object.defineProperty(t,"GraphQLEnumType",{enumerable:!0,get:function(){return o.GraphQLEnumType}}),Object.defineProperty(t,"GraphQLError",{enumerable:!0,get:function(){return l.GraphQLError}}),Object.defineProperty(t,"GraphQLFloat",{enumerable:!0,get:function(){return o.GraphQLFloat}}),Object.defineProperty(t,"GraphQLID",{enumerable:!0,get:function(){return o.GraphQLID}}),Object.defineProperty(t,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return o.GraphQLIncludeDirective}}),Object.defineProperty(t,"GraphQLInputObjectType",{enumerable:!0,get:function(){return o.GraphQLInputObjectType}}),Object.defineProperty(t,"GraphQLInt",{enumerable:!0,get:function(){return o.GraphQLInt}}),Object.defineProperty(t,"GraphQLInterfaceType",{enumerable:!0,get:function(){return o.GraphQLInterfaceType}}),Object.defineProperty(t,"GraphQLList",{enumerable:!0,get:function(){return o.GraphQLList}}),Object.defineProperty(t,"GraphQLNonNull",{enumerable:!0,get:function(){return o.GraphQLNonNull}}),Object.defineProperty(t,"GraphQLObjectType",{enumerable:!0,get:function(){return o.GraphQLObjectType}}),Object.defineProperty(t,"GraphQLScalarType",{enumerable:!0,get:function(){return o.GraphQLScalarType}}),Object.defineProperty(t,"GraphQLSchema",{enumerable:!0,get:function(){return o.GraphQLSchema}}),Object.defineProperty(t,"GraphQLSkipDirective",{enumerable:!0,get:function(){return o.GraphQLSkipDirective}}),Object.defineProperty(t,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return o.GraphQLSpecifiedByDirective}}),Object.defineProperty(t,"GraphQLString",{enumerable:!0,get:function(){return o.GraphQLString}}),Object.defineProperty(t,"GraphQLUnionType",{enumerable:!0,get:function(){return o.GraphQLUnionType}}),Object.defineProperty(t,"Kind",{enumerable:!0,get:function(){return a.Kind}}),Object.defineProperty(t,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return c.KnownArgumentNamesRule}}),Object.defineProperty(t,"KnownDirectivesRule",{enumerable:!0,get:function(){return c.KnownDirectivesRule}}),Object.defineProperty(t,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return c.KnownFragmentNamesRule}}),Object.defineProperty(t,"KnownTypeNamesRule",{enumerable:!0,get:function(){return c.KnownTypeNamesRule}}),Object.defineProperty(t,"Lexer",{enumerable:!0,get:function(){return a.Lexer}}),Object.defineProperty(t,"Location",{enumerable:!0,get:function(){return a.Location}}),Object.defineProperty(t,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return c.LoneAnonymousOperationRule}}),Object.defineProperty(t,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return c.LoneSchemaDefinitionRule}}),Object.defineProperty(t,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return c.NoDeprecatedCustomRule}}),Object.defineProperty(t,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return c.NoFragmentCyclesRule}}),Object.defineProperty(t,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return c.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(t,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return c.NoUndefinedVariablesRule}}),Object.defineProperty(t,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return c.NoUnusedFragmentsRule}}),Object.defineProperty(t,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return c.NoUnusedVariablesRule}}),Object.defineProperty(t,"OperationTypeNode",{enumerable:!0,get:function(){return a.OperationTypeNode}}),Object.defineProperty(t,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return c.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(t,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return c.PossibleFragmentSpreadsRule}}),Object.defineProperty(t,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return c.PossibleTypeExtensionsRule}}),Object.defineProperty(t,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return c.ProvidedRequiredArgumentsRule}}),Object.defineProperty(t,"ScalarLeafsRule",{enumerable:!0,get:function(){return c.ScalarLeafsRule}}),Object.defineProperty(t,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return o.SchemaMetaFieldDef}}),Object.defineProperty(t,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return c.SingleFieldSubscriptionsRule}}),Object.defineProperty(t,"Source",{enumerable:!0,get:function(){return a.Source}}),Object.defineProperty(t,"Token",{enumerable:!0,get:function(){return a.Token}}),Object.defineProperty(t,"TokenKind",{enumerable:!0,get:function(){return a.TokenKind}}),Object.defineProperty(t,"TypeInfo",{enumerable:!0,get:function(){return u.TypeInfo}}),Object.defineProperty(t,"TypeKind",{enumerable:!0,get:function(){return o.TypeKind}}),Object.defineProperty(t,"TypeMetaFieldDef",{enumerable:!0,get:function(){return o.TypeMetaFieldDef}}),Object.defineProperty(t,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return o.TypeNameMetaFieldDef}}),Object.defineProperty(t,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return c.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(t,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return c.UniqueArgumentNamesRule}}),Object.defineProperty(t,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return c.UniqueDirectiveNamesRule}}),Object.defineProperty(t,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return c.UniqueDirectivesPerLocationRule}}),Object.defineProperty(t,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return c.UniqueEnumValueNamesRule}}),Object.defineProperty(t,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return c.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(t,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return c.UniqueFragmentNamesRule}}),Object.defineProperty(t,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return c.UniqueInputFieldNamesRule}}),Object.defineProperty(t,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return c.UniqueOperationNamesRule}}),Object.defineProperty(t,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return c.UniqueOperationTypesRule}}),Object.defineProperty(t,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return c.UniqueTypeNamesRule}}),Object.defineProperty(t,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return c.UniqueVariableNamesRule}}),Object.defineProperty(t,"ValidationContext",{enumerable:!0,get:function(){return c.ValidationContext}}),Object.defineProperty(t,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return c.ValuesOfCorrectTypeRule}}),Object.defineProperty(t,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return c.VariablesAreInputTypesRule}}),Object.defineProperty(t,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return c.VariablesInAllowedPositionRule}}),Object.defineProperty(t,"__Directive",{enumerable:!0,get:function(){return o.__Directive}}),Object.defineProperty(t,"__DirectiveLocation",{enumerable:!0,get:function(){return o.__DirectiveLocation}}),Object.defineProperty(t,"__EnumValue",{enumerable:!0,get:function(){return o.__EnumValue}}),Object.defineProperty(t,"__Field",{enumerable:!0,get:function(){return o.__Field}}),Object.defineProperty(t,"__InputValue",{enumerable:!0,get:function(){return o.__InputValue}}),Object.defineProperty(t,"__Schema",{enumerable:!0,get:function(){return o.__Schema}}),Object.defineProperty(t,"__Type",{enumerable:!0,get:function(){return o.__Type}}),Object.defineProperty(t,"__TypeKind",{enumerable:!0,get:function(){return o.__TypeKind}}),Object.defineProperty(t,"assertAbstractType",{enumerable:!0,get:function(){return o.assertAbstractType}}),Object.defineProperty(t,"assertCompositeType",{enumerable:!0,get:function(){return o.assertCompositeType}}),Object.defineProperty(t,"assertDirective",{enumerable:!0,get:function(){return o.assertDirective}}),Object.defineProperty(t,"assertEnumType",{enumerable:!0,get:function(){return o.assertEnumType}}),Object.defineProperty(t,"assertEnumValueName",{enumerable:!0,get:function(){return o.assertEnumValueName}}),Object.defineProperty(t,"assertInputObjectType",{enumerable:!0,get:function(){return o.assertInputObjectType}}),Object.defineProperty(t,"assertInputType",{enumerable:!0,get:function(){return o.assertInputType}}),Object.defineProperty(t,"assertInterfaceType",{enumerable:!0,get:function(){return o.assertInterfaceType}}),Object.defineProperty(t,"assertLeafType",{enumerable:!0,get:function(){return o.assertLeafType}}),Object.defineProperty(t,"assertListType",{enumerable:!0,get:function(){return o.assertListType}}),Object.defineProperty(t,"assertName",{enumerable:!0,get:function(){return o.assertName}}),Object.defineProperty(t,"assertNamedType",{enumerable:!0,get:function(){return o.assertNamedType}}),Object.defineProperty(t,"assertNonNullType",{enumerable:!0,get:function(){return o.assertNonNullType}}),Object.defineProperty(t,"assertNullableType",{enumerable:!0,get:function(){return o.assertNullableType}}),Object.defineProperty(t,"assertObjectType",{enumerable:!0,get:function(){return o.assertObjectType}}),Object.defineProperty(t,"assertOutputType",{enumerable:!0,get:function(){return o.assertOutputType}}),Object.defineProperty(t,"assertScalarType",{enumerable:!0,get:function(){return o.assertScalarType}}),Object.defineProperty(t,"assertSchema",{enumerable:!0,get:function(){return o.assertSchema}}),Object.defineProperty(t,"assertType",{enumerable:!0,get:function(){return o.assertType}}),Object.defineProperty(t,"assertUnionType",{enumerable:!0,get:function(){return o.assertUnionType}}),Object.defineProperty(t,"assertValidName",{enumerable:!0,get:function(){return u.assertValidName}}),Object.defineProperty(t,"assertValidSchema",{enumerable:!0,get:function(){return o.assertValidSchema}}),Object.defineProperty(t,"assertWrappingType",{enumerable:!0,get:function(){return o.assertWrappingType}}),Object.defineProperty(t,"astFromValue",{enumerable:!0,get:function(){return u.astFromValue}}),Object.defineProperty(t,"buildASTSchema",{enumerable:!0,get:function(){return u.buildASTSchema}}),Object.defineProperty(t,"buildClientSchema",{enumerable:!0,get:function(){return u.buildClientSchema}}),Object.defineProperty(t,"buildSchema",{enumerable:!0,get:function(){return u.buildSchema}}),Object.defineProperty(t,"coerceInputValue",{enumerable:!0,get:function(){return u.coerceInputValue}}),Object.defineProperty(t,"concatAST",{enumerable:!0,get:function(){return u.concatAST}}),Object.defineProperty(t,"createSourceEventStream",{enumerable:!0,get:function(){return s.createSourceEventStream}}),Object.defineProperty(t,"defaultFieldResolver",{enumerable:!0,get:function(){return s.defaultFieldResolver}}),Object.defineProperty(t,"defaultTypeResolver",{enumerable:!0,get:function(){return s.defaultTypeResolver}}),Object.defineProperty(t,"doTypesOverlap",{enumerable:!0,get:function(){return u.doTypesOverlap}}),Object.defineProperty(t,"execute",{enumerable:!0,get:function(){return s.execute}}),Object.defineProperty(t,"executeSync",{enumerable:!0,get:function(){return s.executeSync}}),Object.defineProperty(t,"extendSchema",{enumerable:!0,get:function(){return u.extendSchema}}),Object.defineProperty(t,"findBreakingChanges",{enumerable:!0,get:function(){return u.findBreakingChanges}}),Object.defineProperty(t,"findDangerousChanges",{enumerable:!0,get:function(){return u.findDangerousChanges}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return l.formatError}}),Object.defineProperty(t,"getArgumentValues",{enumerable:!0,get:function(){return s.getArgumentValues}}),Object.defineProperty(t,"getDirectiveValues",{enumerable:!0,get:function(){return s.getDirectiveValues}}),Object.defineProperty(t,"getEnterLeaveForKind",{enumerable:!0,get:function(){return a.getEnterLeaveForKind}}),Object.defineProperty(t,"getIntrospectionQuery",{enumerable:!0,get:function(){return u.getIntrospectionQuery}}),Object.defineProperty(t,"getLocation",{enumerable:!0,get:function(){return a.getLocation}}),Object.defineProperty(t,"getNamedType",{enumerable:!0,get:function(){return o.getNamedType}}),Object.defineProperty(t,"getNullableType",{enumerable:!0,get:function(){return o.getNullableType}}),Object.defineProperty(t,"getOperationAST",{enumerable:!0,get:function(){return u.getOperationAST}}),Object.defineProperty(t,"getOperationRootType",{enumerable:!0,get:function(){return u.getOperationRootType}}),Object.defineProperty(t,"getVariableValues",{enumerable:!0,get:function(){return s.getVariableValues}}),Object.defineProperty(t,"getVisitFn",{enumerable:!0,get:function(){return a.getVisitFn}}),Object.defineProperty(t,"graphql",{enumerable:!0,get:function(){return i.graphql}}),Object.defineProperty(t,"graphqlSync",{enumerable:!0,get:function(){return i.graphqlSync}}),Object.defineProperty(t,"introspectionFromSchema",{enumerable:!0,get:function(){return u.introspectionFromSchema}}),Object.defineProperty(t,"introspectionTypes",{enumerable:!0,get:function(){return o.introspectionTypes}}),Object.defineProperty(t,"isAbstractType",{enumerable:!0,get:function(){return o.isAbstractType}}),Object.defineProperty(t,"isCompositeType",{enumerable:!0,get:function(){return o.isCompositeType}}),Object.defineProperty(t,"isConstValueNode",{enumerable:!0,get:function(){return a.isConstValueNode}}),Object.defineProperty(t,"isDefinitionNode",{enumerable:!0,get:function(){return a.isDefinitionNode}}),Object.defineProperty(t,"isDirective",{enumerable:!0,get:function(){return o.isDirective}}),Object.defineProperty(t,"isEnumType",{enumerable:!0,get:function(){return o.isEnumType}}),Object.defineProperty(t,"isEqualType",{enumerable:!0,get:function(){return u.isEqualType}}),Object.defineProperty(t,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return a.isExecutableDefinitionNode}}),Object.defineProperty(t,"isInputObjectType",{enumerable:!0,get:function(){return o.isInputObjectType}}),Object.defineProperty(t,"isInputType",{enumerable:!0,get:function(){return o.isInputType}}),Object.defineProperty(t,"isInterfaceType",{enumerable:!0,get:function(){return o.isInterfaceType}}),Object.defineProperty(t,"isIntrospectionType",{enumerable:!0,get:function(){return o.isIntrospectionType}}),Object.defineProperty(t,"isLeafType",{enumerable:!0,get:function(){return o.isLeafType}}),Object.defineProperty(t,"isListType",{enumerable:!0,get:function(){return o.isListType}}),Object.defineProperty(t,"isNamedType",{enumerable:!0,get:function(){return o.isNamedType}}),Object.defineProperty(t,"isNonNullType",{enumerable:!0,get:function(){return o.isNonNullType}}),Object.defineProperty(t,"isNullableType",{enumerable:!0,get:function(){return o.isNullableType}}),Object.defineProperty(t,"isObjectType",{enumerable:!0,get:function(){return o.isObjectType}}),Object.defineProperty(t,"isOutputType",{enumerable:!0,get:function(){return o.isOutputType}}),Object.defineProperty(t,"isRequiredArgument",{enumerable:!0,get:function(){return o.isRequiredArgument}}),Object.defineProperty(t,"isRequiredInputField",{enumerable:!0,get:function(){return o.isRequiredInputField}}),Object.defineProperty(t,"isScalarType",{enumerable:!0,get:function(){return o.isScalarType}}),Object.defineProperty(t,"isSchema",{enumerable:!0,get:function(){return o.isSchema}}),Object.defineProperty(t,"isSelectionNode",{enumerable:!0,get:function(){return a.isSelectionNode}}),Object.defineProperty(t,"isSpecifiedDirective",{enumerable:!0,get:function(){return o.isSpecifiedDirective}}),Object.defineProperty(t,"isSpecifiedScalarType",{enumerable:!0,get:function(){return o.isSpecifiedScalarType}}),Object.defineProperty(t,"isType",{enumerable:!0,get:function(){return o.isType}}),Object.defineProperty(t,"isTypeDefinitionNode",{enumerable:!0,get:function(){return a.isTypeDefinitionNode}}),Object.defineProperty(t,"isTypeExtensionNode",{enumerable:!0,get:function(){return a.isTypeExtensionNode}}),Object.defineProperty(t,"isTypeNode",{enumerable:!0,get:function(){return a.isTypeNode}}),Object.defineProperty(t,"isTypeSubTypeOf",{enumerable:!0,get:function(){return u.isTypeSubTypeOf}}),Object.defineProperty(t,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return a.isTypeSystemDefinitionNode}}),Object.defineProperty(t,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return a.isTypeSystemExtensionNode}}),Object.defineProperty(t,"isUnionType",{enumerable:!0,get:function(){return o.isUnionType}}),Object.defineProperty(t,"isValidNameError",{enumerable:!0,get:function(){return u.isValidNameError}}),Object.defineProperty(t,"isValueNode",{enumerable:!0,get:function(){return a.isValueNode}}),Object.defineProperty(t,"isWrappingType",{enumerable:!0,get:function(){return o.isWrappingType}}),Object.defineProperty(t,"lexicographicSortSchema",{enumerable:!0,get:function(){return u.lexicographicSortSchema}}),Object.defineProperty(t,"locatedError",{enumerable:!0,get:function(){return l.locatedError}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return a.parse}}),Object.defineProperty(t,"parseConstValue",{enumerable:!0,get:function(){return a.parseConstValue}}),Object.defineProperty(t,"parseType",{enumerable:!0,get:function(){return a.parseType}}),Object.defineProperty(t,"parseValue",{enumerable:!0,get:function(){return a.parseValue}}),Object.defineProperty(t,"print",{enumerable:!0,get:function(){return a.print}}),Object.defineProperty(t,"printError",{enumerable:!0,get:function(){return l.printError}}),Object.defineProperty(t,"printIntrospectionSchema",{enumerable:!0,get:function(){return u.printIntrospectionSchema}}),Object.defineProperty(t,"printLocation",{enumerable:!0,get:function(){return a.printLocation}}),Object.defineProperty(t,"printSchema",{enumerable:!0,get:function(){return u.printSchema}}),Object.defineProperty(t,"printSourceLocation",{enumerable:!0,get:function(){return a.printSourceLocation}}),Object.defineProperty(t,"printType",{enumerable:!0,get:function(){return u.printType}}),Object.defineProperty(t,"resolveObjMapThunk",{enumerable:!0,get:function(){return o.resolveObjMapThunk}}),Object.defineProperty(t,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return o.resolveReadonlyArrayThunk}}),Object.defineProperty(t,"responsePathAsArray",{enumerable:!0,get:function(){return s.responsePathAsArray}}),Object.defineProperty(t,"separateOperations",{enumerable:!0,get:function(){return u.separateOperations}}),Object.defineProperty(t,"specifiedDirectives",{enumerable:!0,get:function(){return o.specifiedDirectives}}),Object.defineProperty(t,"specifiedRules",{enumerable:!0,get:function(){return c.specifiedRules}}),Object.defineProperty(t,"specifiedScalarTypes",{enumerable:!0,get:function(){return o.specifiedScalarTypes}}),Object.defineProperty(t,"stripIgnoredCharacters",{enumerable:!0,get:function(){return u.stripIgnoredCharacters}}),Object.defineProperty(t,"subscribe",{enumerable:!0,get:function(){return s.subscribe}}),Object.defineProperty(t,"syntaxError",{enumerable:!0,get:function(){return l.syntaxError}}),Object.defineProperty(t,"typeFromAST",{enumerable:!0,get:function(){return u.typeFromAST}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return c.validate}}),Object.defineProperty(t,"validateSchema",{enumerable:!0,get:function(){return o.validateSchema}}),Object.defineProperty(t,"valueFromAST",{enumerable:!0,get:function(){return u.valueFromAST}}),Object.defineProperty(t,"valueFromASTUntyped",{enumerable:!0,get:function(){return u.valueFromASTUntyped}}),Object.defineProperty(t,"version",{enumerable:!0,get:function(){return r.version}}),Object.defineProperty(t,"versionInfo",{enumerable:!0,get:function(){return r.versionInfo}}),Object.defineProperty(t,"visit",{enumerable:!0,get:function(){return a.visit}}),Object.defineProperty(t,"visitInParallel",{enumerable:!0,get:function(){return a.visitInParallel}}),Object.defineProperty(t,"visitWithTypeInfo",{enumerable:!0,get:function(){return u.visitWithTypeInfo}});var r=n(8696),i=n(9728),o=n(3226),a=n(2178),s=n(9931),c=n(1122),l=n(6972),u=n(9548)},7059:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addPath=function(e,t,n){return{prev:e,key:t,typename:n}},t.pathToArray=function(e){const t=[];let n=e;for(;n;)t.push(n.key),n=n.prev;return t.reverse()}},7242:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.devAssert=function(e,t){if(!Boolean(e))throw new Error(t)}},166:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.didYouMean=function(e,t){const[n,r]=t?[e,t]:[void 0,e];let i=" Did you mean ";n&&(i+=n+" ");const o=r.map((e=>`"${e}"`));switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}const a=o.slice(0,5),s=a.pop();return i+a.join(", ")+", or "+s+"?"}},4620:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.groupBy=function(e,t){const n=new Map;for(const r of e){const e=t(r),i=n.get(e);void 0===i?n.set(e,[r]):i.push(r)}return n}},3317:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identityFunc=function(e){return e}},8002:function(e,t){"use strict";function n(e,t){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,t){if(null===e)return"null";if(t.includes(e))return"[Circular]";const r=[...t,e];if(function(e){return"function"==typeof e.toJSON}(e)){const t=e.toJSON();if(t!==e)return"string"==typeof t?t:n(t,r)}else if(Array.isArray(e))return function(e,t){if(0===e.length)return"[]";if(t.length>2)return"[Array]";const r=Math.min(10,e.length),i=e.length-r,o=[];for(let i=0;i1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(e,r);return function(e,t){const r=Object.entries(e);if(0===r.length)return"{}";if(t.length>2)return"["+function(e){const t=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===t&&"function"==typeof e.constructor){const t=e.constructor.name;if("string"==typeof t&&""!==t)return t}return t}(e)+"]";const i=r.map((([e,r])=>e+": "+n(r,t)));return"{ "+i.join(", ")+" }"}(e,r)}(e,t);default:return String(e)}}Object.defineProperty(t,"__esModule",{value:!0}),t.inspect=function(e){return n(e,[])}},5752:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.instanceOf=void 0;var r=n(8002);const i=globalThis.process&&"production"===globalThis.process.env.NODE_ENV?function(e,t){return e instanceof t}:function(e,t){if(e instanceof t)return!0;if("object"==typeof e&&null!==e){var n;const i=t.prototype[Symbol.toStringTag];if(i===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(n=e.constructor)||void 0===n?void 0:n.name)){const t=(0,r.inspect)(e);throw new Error(`Cannot use ${i} "${t}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};t.instanceOf=i},7706:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.invariant=function(e,t){if(!Boolean(e))throw new Error(null!=t?t:"Unexpected invariant triggered.")}},8648:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsyncIterable=function(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}},6609:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isIterableObject=function(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}},5690:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isObjectLike=function(e){return"object"==typeof e&&null!==e}},4221:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isPromise=function(e){return"function"==typeof(null==e?void 0:e.then)}},2863:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyMap=function(e,t){const n=Object.create(null);for(const r of e)n[t(r)]=r;return n}},7154:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keyValMap=function(e,t,n){const r=Object.create(null);for(const i of e)r[t(i)]=n(i);return r}},6124:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mapValue=function(e,t){const n=Object.create(null);for(const r of Object.keys(e))n[r]=t(e[r],r);return n}},5456:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.memoize3=function(e){let t;return function(n,r,i){void 0===t&&(t=new WeakMap);let o=t.get(n);void 0===o&&(o=new WeakMap,t.set(n,o));let a=o.get(r);void 0===a&&(a=new WeakMap,o.set(r,a));let s=a.get(i);return void 0===s&&(s=e(n,r,i),a.set(i,s)),s}}},5250:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.naturalCompare=function(e,t){let i=0,o=0;for(;i0);let l=0;do{++o,l=10*l+s-n,s=t.charCodeAt(o)}while(r(s)&&l>0);if(cl)return 1}else{if(as)return 1;++i,++o}}return e.length-t.length};const n=48;function r(e){return!isNaN(e)&&n<=e&&e<=57}},737:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printPathArray=function(e){return e.map((e=>"number"==typeof e?"["+e.toString()+"]":"."+e)).join("")}},3179:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseForObject=function(e){return Promise.all(Object.values(e)).then((t=>{const n=Object.create(null);for(const[r,i]of Object.keys(e).entries())n[i]=t[r];return n}))}},9915:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promiseReduce=function(e,t,n){let i=n;for(const n of e)i=(0,r.isPromise)(i)?i.then((e=>t(e,n))):t(i,n);return i};var r=n(4221)},8070:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.suggestionList=function(e,t){const n=Object.create(null),o=new i(e),a=Math.floor(.4*e.length)+1;for(const e of t){const t=o.measure(e,a);void 0!==t&&(n[e]=t)}return Object.keys(n).sort(((e,t)=>{const i=n[e]-n[t];return 0!==i?i:(0,r.naturalCompare)(e,t)}))};var r=n(5250);class i{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=o(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,t){if(this._input===e)return 0;const n=e.toLowerCase();if(this._inputLowerCase===n)return 1;let r=o(n),i=this._inputArray;if(r.lengtht)return;const c=this._rows;for(let e=0;e<=s;e++)c[0][e]=e;for(let e=1;e<=a;e++){const n=c[(e-1)%3],o=c[e%3];let a=o[0]=e;for(let t=1;t<=s;t++){const s=r[e-1]===i[t-1]?0:1;let l=Math.min(n[t]+1,o[t-1]+1,n[t-1]+s);if(e>1&&t>1&&r[e-1]===i[t-2]&&r[e-2]===i[t-1]){const n=c[(e-2)%3][t-2];l=Math.min(l,n+1)}lt)return}const l=c[a%3][s];return l<=t?l:void 0}}function o(e){const t=e.length,n=new Array(t);for(let r=0;r0===t?e:e.slice(n))).slice(null!==(t=r)&&void 0!==t?t:0,o+1)},t.isPrintableAsBlockString=function(e){if(""===e)return!0;let t=!0,n=!1,r=!0,i=!1;for(let o=0;o1&&i.slice(1).every((e=>0===e.length||(0,r.isWhiteSpace)(e.charCodeAt(0)))),s=n.endsWith('\\"""'),c=e.endsWith('"')&&!s,l=e.endsWith("\\"),u=c||l,p=!(null!=t&&t.minimize)&&(!o||e.length>70||u||a||s);let f="";const d=o&&(0,r.isWhiteSpace)(e.charCodeAt(0));return(p&&!d||a)&&(f+="\n"),f+=n,(p||u)&&(f+="\n"),'"""'+f+'"""'};var r=n(100);function i(e){let t=0;for(;t=48&&e<=57}function r(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(t,"__esModule",{value:!0}),t.isDigit=n,t.isLetter=r,t.isNameContinue=function(e){return r(e)||n(e)||95===e},t.isNameStart=function(e){return r(e)||95===e},t.isWhiteSpace=function(e){return 9===e||32===e}},8333:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.DirectiveLocation=void 0,t.DirectiveLocation=n,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(n||(t.DirectiveLocation=n={}))},2178:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BREAK",{enumerable:!0,get:function(){return p.BREAK}}),Object.defineProperty(t,"DirectiveLocation",{enumerable:!0,get:function(){return h.DirectiveLocation}}),Object.defineProperty(t,"Kind",{enumerable:!0,get:function(){return a.Kind}}),Object.defineProperty(t,"Lexer",{enumerable:!0,get:function(){return c.Lexer}}),Object.defineProperty(t,"Location",{enumerable:!0,get:function(){return f.Location}}),Object.defineProperty(t,"OperationTypeNode",{enumerable:!0,get:function(){return f.OperationTypeNode}}),Object.defineProperty(t,"Source",{enumerable:!0,get:function(){return r.Source}}),Object.defineProperty(t,"Token",{enumerable:!0,get:function(){return f.Token}}),Object.defineProperty(t,"TokenKind",{enumerable:!0,get:function(){return s.TokenKind}}),Object.defineProperty(t,"getEnterLeaveForKind",{enumerable:!0,get:function(){return p.getEnterLeaveForKind}}),Object.defineProperty(t,"getLocation",{enumerable:!0,get:function(){return i.getLocation}}),Object.defineProperty(t,"getVisitFn",{enumerable:!0,get:function(){return p.getVisitFn}}),Object.defineProperty(t,"isConstValueNode",{enumerable:!0,get:function(){return d.isConstValueNode}}),Object.defineProperty(t,"isDefinitionNode",{enumerable:!0,get:function(){return d.isDefinitionNode}}),Object.defineProperty(t,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return d.isExecutableDefinitionNode}}),Object.defineProperty(t,"isSelectionNode",{enumerable:!0,get:function(){return d.isSelectionNode}}),Object.defineProperty(t,"isTypeDefinitionNode",{enumerable:!0,get:function(){return d.isTypeDefinitionNode}}),Object.defineProperty(t,"isTypeExtensionNode",{enumerable:!0,get:function(){return d.isTypeExtensionNode}}),Object.defineProperty(t,"isTypeNode",{enumerable:!0,get:function(){return d.isTypeNode}}),Object.defineProperty(t,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return d.isTypeSystemDefinitionNode}}),Object.defineProperty(t,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return d.isTypeSystemExtensionNode}}),Object.defineProperty(t,"isValueNode",{enumerable:!0,get:function(){return d.isValueNode}}),Object.defineProperty(t,"parse",{enumerable:!0,get:function(){return l.parse}}),Object.defineProperty(t,"parseConstValue",{enumerable:!0,get:function(){return l.parseConstValue}}),Object.defineProperty(t,"parseType",{enumerable:!0,get:function(){return l.parseType}}),Object.defineProperty(t,"parseValue",{enumerable:!0,get:function(){return l.parseValue}}),Object.defineProperty(t,"print",{enumerable:!0,get:function(){return u.print}}),Object.defineProperty(t,"printLocation",{enumerable:!0,get:function(){return o.printLocation}}),Object.defineProperty(t,"printSourceLocation",{enumerable:!0,get:function(){return o.printSourceLocation}}),Object.defineProperty(t,"visit",{enumerable:!0,get:function(){return p.visit}}),Object.defineProperty(t,"visitInParallel",{enumerable:!0,get:function(){return p.visitInParallel}});var r=n(2412),i=n(9016),o=n(8038),a=n(2828),s=n(3175),c=n(4274),l=n(8370),u=n(3033),p=n(285),f=n(1807),d=n(1352),h=n(8333)},2828:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Kind=void 0,t.Kind=n,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(n||(t.Kind=n={}))},4274:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Lexer=void 0,t.isPunctuatorTokenKind=function(e){return e===s.TokenKind.BANG||e===s.TokenKind.DOLLAR||e===s.TokenKind.AMP||e===s.TokenKind.PAREN_L||e===s.TokenKind.PAREN_R||e===s.TokenKind.SPREAD||e===s.TokenKind.COLON||e===s.TokenKind.EQUALS||e===s.TokenKind.AT||e===s.TokenKind.BRACKET_L||e===s.TokenKind.BRACKET_R||e===s.TokenKind.BRACE_L||e===s.TokenKind.PIPE||e===s.TokenKind.BRACE_R};var r=n(338),i=n(1807),o=n(849),a=n(100),s=n(3175);class c{constructor(e){const t=new i.Token(s.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=t,this.token=t,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==s.TokenKind.EOF)do{if(e.next)e=e.next;else{const t=m(this,e.end);e.next=t,t.prev=e,e=t}}while(e.kind===s.TokenKind.COMMENT);return e}}function l(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function u(e,t){return p(e.charCodeAt(t))&&f(e.charCodeAt(t+1))}function p(e){return e>=55296&&e<=56319}function f(e){return e>=56320&&e<=57343}function d(e,t){const n=e.source.body.codePointAt(t);if(void 0===n)return s.TokenKind.EOF;if(n>=32&&n<=126){const e=String.fromCodePoint(n);return'"'===e?"'\"'":`"${e}"`}return"U+"+n.toString(16).toUpperCase().padStart(4,"0")}function h(e,t,n,r,o){const a=e.line,s=1+n-e.lineStart;return new i.Token(t,n,r,a,s,o)}function m(e,t){const n=e.source.body,i=n.length;let o=t;for(;o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function k(e,t){const n=e.source.body;switch(n.charCodeAt(t+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,r.syntaxError)(e.source,t,`Invalid character escape sequence: "${n.slice(t,t+2)}".`)}function O(e,t){const n=e.source.body,i=n.length;let a=e.lineStart,c=t+3,p=c,f="";const m=[];for(;c=t)break;n=a.index+a[0].length,o+=1}return{line:o,column:t+1-n}};var r=n(7706);const i=/\r\n|[\n\r]/g},8370:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Parser=void 0,t.parse=function(e,t){return new u(e,t).parseDocument()},t.parseConstValue=function(e,t){const n=new u(e,t);n.expectToken(l.TokenKind.SOF);const r=n.parseConstValueLiteral();return n.expectToken(l.TokenKind.EOF),r},t.parseType=function(e,t){const n=new u(e,t);n.expectToken(l.TokenKind.SOF);const r=n.parseTypeReference();return n.expectToken(l.TokenKind.EOF),r},t.parseValue=function(e,t){const n=new u(e,t);n.expectToken(l.TokenKind.SOF);const r=n.parseValueLiteral(!1);return n.expectToken(l.TokenKind.EOF),r};var r=n(338),i=n(1807),o=n(8333),a=n(2828),s=n(4274),c=n(2412),l=n(3175);class u{constructor(e,t={}){const n=(0,c.isSource)(e)?e:new c.Source(e);this._lexer=new s.Lexer(n),this._options=t,this._tokenCounter=0}parseName(){const e=this.expectToken(l.TokenKind.NAME);return this.node(e,{kind:a.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:a.Kind.DOCUMENT,definitions:this.many(l.TokenKind.SOF,this.parseDefinition,l.TokenKind.EOF)})}parseDefinition(){if(this.peek(l.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),t=e?this._lexer.lookahead():this._lexer.token;if(t.kind===l.TokenKind.NAME){switch(t.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(t.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(t)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(l.TokenKind.BRACE_L))return this.node(e,{kind:a.Kind.OPERATION_DEFINITION,operation:i.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const t=this.parseOperationType();let n;return this.peek(l.TokenKind.NAME)&&(n=this.parseName()),this.node(e,{kind:a.Kind.OPERATION_DEFINITION,operation:t,name:n,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(l.TokenKind.NAME);switch(e.value){case"query":return i.OperationTypeNode.QUERY;case"mutation":return i.OperationTypeNode.MUTATION;case"subscription":return i.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(l.TokenKind.PAREN_L,this.parseVariableDefinition,l.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:a.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(l.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(l.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(l.TokenKind.DOLLAR),this.node(e,{kind:a.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:a.Kind.SELECTION_SET,selections:this.many(l.TokenKind.BRACE_L,this.parseSelection,l.TokenKind.BRACE_R)})}parseSelection(){return this.peek(l.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,t=this.parseName();let n,r;return this.expectOptionalToken(l.TokenKind.COLON)?(n=t,r=this.parseName()):r=t,this.node(e,{kind:a.Kind.FIELD,alias:n,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(l.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const t=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(l.TokenKind.PAREN_L,t,l.TokenKind.PAREN_R)}parseArgument(e=!1){const t=this._lexer.token,n=this.parseName();return this.expectToken(l.TokenKind.COLON),this.node(t,{kind:a.Kind.ARGUMENT,name:n,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(l.TokenKind.SPREAD);const t=this.expectOptionalKeyword("on");return!t&&this.peek(l.TokenKind.NAME)?this.node(e,{kind:a.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:a.Kind.INLINE_FRAGMENT,typeCondition:t?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const t=this._lexer.token;switch(t.kind){case l.TokenKind.BRACKET_L:return this.parseList(e);case l.TokenKind.BRACE_L:return this.parseObject(e);case l.TokenKind.INT:return this.advanceLexer(),this.node(t,{kind:a.Kind.INT,value:t.value});case l.TokenKind.FLOAT:return this.advanceLexer(),this.node(t,{kind:a.Kind.FLOAT,value:t.value});case l.TokenKind.STRING:case l.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case l.TokenKind.NAME:switch(this.advanceLexer(),t.value){case"true":return this.node(t,{kind:a.Kind.BOOLEAN,value:!0});case"false":return this.node(t,{kind:a.Kind.BOOLEAN,value:!1});case"null":return this.node(t,{kind:a.Kind.NULL});default:return this.node(t,{kind:a.Kind.ENUM,value:t.value})}case l.TokenKind.DOLLAR:if(e){if(this.expectToken(l.TokenKind.DOLLAR),this._lexer.token.kind===l.TokenKind.NAME){const e=this._lexer.token.value;throw(0,r.syntaxError)(this._lexer.source,t.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(t)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:a.Kind.STRING,value:e.value,block:e.kind===l.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:a.Kind.LIST,values:this.any(l.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),l.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:a.Kind.OBJECT,fields:this.any(l.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),l.TokenKind.BRACE_R)})}parseObjectField(e){const t=this._lexer.token,n=this.parseName();return this.expectToken(l.TokenKind.COLON),this.node(t,{kind:a.Kind.OBJECT_FIELD,name:n,value:this.parseValueLiteral(e)})}parseDirectives(e){const t=[];for(;this.peek(l.TokenKind.AT);)t.push(this.parseDirective(e));return t}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const t=this._lexer.token;return this.expectToken(l.TokenKind.AT),this.node(t,{kind:a.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let t;if(this.expectOptionalToken(l.TokenKind.BRACKET_L)){const n=this.parseTypeReference();this.expectToken(l.TokenKind.BRACKET_R),t=this.node(e,{kind:a.Kind.LIST_TYPE,type:n})}else t=this.parseNamedType();return this.expectOptionalToken(l.TokenKind.BANG)?this.node(e,{kind:a.Kind.NON_NULL_TYPE,type:t}):t}parseNamedType(){return this.node(this._lexer.token,{kind:a.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(l.TokenKind.STRING)||this.peek(l.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("schema");const n=this.parseConstDirectives(),r=this.many(l.TokenKind.BRACE_L,this.parseOperationTypeDefinition,l.TokenKind.BRACE_R);return this.node(e,{kind:a.Kind.SCHEMA_DEFINITION,description:t,directives:n,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,t=this.parseOperationType();this.expectToken(l.TokenKind.COLON);const n=this.parseNamedType();return this.node(e,{kind:a.Kind.OPERATION_TYPE_DEFINITION,operation:t,type:n})}parseScalarTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("scalar");const n=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:a.Kind.SCALAR_TYPE_DEFINITION,description:t,name:n,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("type");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.Kind.OBJECT_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(l.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(l.TokenKind.BRACE_L,this.parseFieldDefinition,l.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName(),r=this.parseArgumentDefs();this.expectToken(l.TokenKind.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:a.Kind.FIELD_DEFINITION,description:t,name:n,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(l.TokenKind.PAREN_L,this.parseInputValueDef,l.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseName();this.expectToken(l.TokenKind.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(l.TokenKind.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:a.Kind.INPUT_VALUE_DEFINITION,description:t,name:n,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("interface");const n=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.Kind.INTERFACE_TYPE_DEFINITION,description:t,name:n,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("union");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:a.Kind.UNION_TYPE_DEFINITION,description:t,name:n,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(l.TokenKind.EQUALS)?this.delimitedMany(l.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("enum");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:a.Kind.ENUM_TYPE_DEFINITION,description:t,name:n,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(l.TokenKind.BRACE_L,this.parseEnumValueDefinition,l.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,t=this.parseDescription(),n=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:a.Kind.ENUM_VALUE_DEFINITION,description:t,name:n,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,`${p(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("input");const n=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:a.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:t,name:n,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(l.TokenKind.BRACE_L,this.parseInputValueDef,l.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===l.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const t=this.parseConstDirectives(),n=this.optionalMany(l.TokenKind.BRACE_L,this.parseOperationTypeDefinition,l.TokenKind.BRACE_R);if(0===t.length&&0===n.length)throw this.unexpected();return this.node(e,{kind:a.Kind.SCHEMA_EXTENSION,directives:t,operationTypes:n})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const t=this.parseName(),n=this.parseConstDirectives();if(0===n.length)throw this.unexpected();return this.node(e,{kind:a.Kind.SCALAR_TYPE_EXTENSION,name:t,directives:n})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.Kind.OBJECT_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const t=this.parseName(),n=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===n.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.Kind.INTERFACE_TYPE_EXTENSION,name:t,interfaces:n,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.UNION_TYPE_EXTENSION,name:t,directives:n,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.ENUM_TYPE_EXTENSION,name:t,directives:n,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const t=this.parseName(),n=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===n.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:t,directives:n,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,t=this.parseDescription();this.expectKeyword("directive"),this.expectToken(l.TokenKind.AT);const n=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:a.Kind.DIRECTIVE_DEFINITION,description:t,name:n,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(l.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,t=this.parseName();if(Object.prototype.hasOwnProperty.call(o.DirectiveLocation,t.value))return t;throw this.unexpected(e)}node(e,t){return!0!==this._options.noLocation&&(t.loc=new i.Location(e,this._lexer.lastToken,this._lexer.source)),t}peek(e){return this._lexer.token.kind===e}expectToken(e){const t=this._lexer.token;if(t.kind===e)return this.advanceLexer(),t;throw(0,r.syntaxError)(this._lexer.source,t.start,`Expected ${f(e)}, found ${p(t)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const t=this._lexer.token;if(t.kind!==l.TokenKind.NAME||t.value!==e)throw(0,r.syntaxError)(this._lexer.source,t.start,`Expected "${e}", found ${p(t)}.`);this.advanceLexer()}expectOptionalKeyword(e){const t=this._lexer.token;return t.kind===l.TokenKind.NAME&&t.value===e&&(this.advanceLexer(),!0)}unexpected(e){const t=null!=e?e:this._lexer.token;return(0,r.syntaxError)(this._lexer.source,t.start,`Unexpected ${p(t)}.`)}any(e,t,n){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(n);)r.push(t.call(this));return r}optionalMany(e,t,n){if(this.expectOptionalToken(e)){const e=[];do{e.push(t.call(this))}while(!this.expectOptionalToken(n));return e}return[]}many(e,t,n){this.expectToken(e);const r=[];do{r.push(t.call(this))}while(!this.expectOptionalToken(n));return r}delimitedMany(e,t){this.expectOptionalToken(e);const n=[];do{n.push(t.call(this))}while(this.expectOptionalToken(e));return n}advanceLexer(){const{maxTokens:e}=this._options,t=this._lexer.advance();if(void 0!==e&&t.kind!==l.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,r.syntaxError)(this._lexer.source,t.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function p(e){const t=e.value;return f(e.kind)+(null!=t?` "${t}"`:"")}function f(e){return(0,s.isPunctuatorTokenKind)(e)?`"${e}"`:e}t.Parser=u},1352:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isConstValueNode=function e(t){return o(t)&&(t.kind===r.Kind.LIST?t.values.some(e):t.kind===r.Kind.OBJECT?t.fields.some((t=>e(t.value))):t.kind!==r.Kind.VARIABLE)},t.isDefinitionNode=function(e){return i(e)||a(e)||c(e)},t.isExecutableDefinitionNode=i,t.isSelectionNode=function(e){return e.kind===r.Kind.FIELD||e.kind===r.Kind.FRAGMENT_SPREAD||e.kind===r.Kind.INLINE_FRAGMENT},t.isTypeDefinitionNode=s,t.isTypeExtensionNode=l,t.isTypeNode=function(e){return e.kind===r.Kind.NAMED_TYPE||e.kind===r.Kind.LIST_TYPE||e.kind===r.Kind.NON_NULL_TYPE},t.isTypeSystemDefinitionNode=a,t.isTypeSystemExtensionNode=c,t.isValueNode=o;var r=n(2828);function i(e){return e.kind===r.Kind.OPERATION_DEFINITION||e.kind===r.Kind.FRAGMENT_DEFINITION}function o(e){return e.kind===r.Kind.VARIABLE||e.kind===r.Kind.INT||e.kind===r.Kind.FLOAT||e.kind===r.Kind.STRING||e.kind===r.Kind.BOOLEAN||e.kind===r.Kind.NULL||e.kind===r.Kind.ENUM||e.kind===r.Kind.LIST||e.kind===r.Kind.OBJECT}function a(e){return e.kind===r.Kind.SCHEMA_DEFINITION||s(e)||e.kind===r.Kind.DIRECTIVE_DEFINITION}function s(e){return e.kind===r.Kind.SCALAR_TYPE_DEFINITION||e.kind===r.Kind.OBJECT_TYPE_DEFINITION||e.kind===r.Kind.INTERFACE_TYPE_DEFINITION||e.kind===r.Kind.UNION_TYPE_DEFINITION||e.kind===r.Kind.ENUM_TYPE_DEFINITION||e.kind===r.Kind.INPUT_OBJECT_TYPE_DEFINITION}function c(e){return e.kind===r.Kind.SCHEMA_EXTENSION||l(e)}function l(e){return e.kind===r.Kind.SCALAR_TYPE_EXTENSION||e.kind===r.Kind.OBJECT_TYPE_EXTENSION||e.kind===r.Kind.INTERFACE_TYPE_EXTENSION||e.kind===r.Kind.UNION_TYPE_EXTENSION||e.kind===r.Kind.ENUM_TYPE_EXTENSION||e.kind===r.Kind.INPUT_OBJECT_TYPE_EXTENSION}},8038:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printLocation=function(e){return i(e.source,(0,r.getLocation)(e.source,e.start))},t.printSourceLocation=i;var r=n(9016);function i(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,a=e.locationOffset.line-1,s=t.line+a,c=1===t.line?n:0,l=t.column+c,u=`${e.name}:${s}:${l}\n`,p=r.split(/\r\n|[\n\r]/g),f=p[i];if(f.length>120){const e=Math.floor(l/80),t=l%80,n=[];for(let e=0;e["|",e])),["|","^".padStart(t)],["|",n[e+1]]])}return u+o([[s-1+" |",p[i-1]],[`${s} |`,f],["|","^".padStart(l)],[`${s+1} |`,p[i+1]]])}function o(e){const t=e.filter((([e,t])=>void 0!==t)),n=Math.max(...t.map((([e])=>e.length)));return t.map((([e,t])=>e.padStart(n)+(t?" "+t:""))).join("\n")}},8942:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printString=function(e){return`"${e.replace(n,r)}"`};const n=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function r(e){return i[e.charCodeAt(0)]}const i=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]},3033:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.print=function(e){return(0,o.visit)(e,a)};var r=n(849),i=n(8942),o=n(285);const a={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>s(e.definitions,"\n\n")},OperationDefinition:{leave(e){const t=l("(",s(e.variableDefinitions,", "),")"),n=s([e.operation,s([e.name,t]),s(e.directives," ")]," ");return("query"===n?"":n+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:t,defaultValue:n,directives:r})=>e+": "+t+l(" = ",n)+l(" ",s(r," "))},SelectionSet:{leave:({selections:e})=>c(e)},Field:{leave({alias:e,name:t,arguments:n,directives:r,selectionSet:i}){const o=l("",e,": ")+t;let a=o+l("(",s(n,", "),")");return a.length>80&&(a=o+l("(\n",u(s(n,"\n")),"\n)")),s([a,s(r," "),i]," ")}},Argument:{leave:({name:e,value:t})=>e+": "+t},FragmentSpread:{leave:({name:e,directives:t})=>"..."+e+l(" ",s(t," "))},InlineFragment:{leave:({typeCondition:e,directives:t,selectionSet:n})=>s(["...",l("on ",e),s(t," "),n]," ")},FragmentDefinition:{leave:({name:e,typeCondition:t,variableDefinitions:n,directives:r,selectionSet:i})=>`fragment ${e}${l("(",s(n,", "),")")} on ${t} ${l("",s(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:t})=>t?(0,r.printBlockString)(e):(0,i.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+s(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+s(e,", ")+"}"},ObjectField:{leave:({name:e,value:t})=>e+": "+t},Directive:{leave:({name:e,arguments:t})=>"@"+e+l("(",s(t,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:t,operationTypes:n})=>l("",e,"\n")+s(["schema",s(t," "),c(n)]," ")},OperationTypeDefinition:{leave:({operation:e,type:t})=>e+": "+t},ScalarTypeDefinition:{leave:({description:e,name:t,directives:n})=>l("",e,"\n")+s(["scalar",t,s(n," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>l("",e,"\n")+s(["type",t,l("implements ",s(n," & ")),s(r," "),c(i)]," ")},FieldDefinition:{leave:({description:e,name:t,arguments:n,type:r,directives:i})=>l("",e,"\n")+t+(p(n)?l("(\n",u(s(n,"\n")),"\n)"):l("(",s(n,", "),")"))+": "+r+l(" ",s(i," "))},InputValueDefinition:{leave:({description:e,name:t,type:n,defaultValue:r,directives:i})=>l("",e,"\n")+s([t+": "+n,l("= ",r),s(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:t,interfaces:n,directives:r,fields:i})=>l("",e,"\n")+s(["interface",t,l("implements ",s(n," & ")),s(r," "),c(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:t,directives:n,types:r})=>l("",e,"\n")+s(["union",t,s(n," "),l("= ",s(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:t,directives:n,values:r})=>l("",e,"\n")+s(["enum",t,s(n," "),c(r)]," ")},EnumValueDefinition:{leave:({description:e,name:t,directives:n})=>l("",e,"\n")+s([t,s(n," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:t,directives:n,fields:r})=>l("",e,"\n")+s(["input",t,s(n," "),c(r)]," ")},DirectiveDefinition:{leave:({description:e,name:t,arguments:n,repeatable:r,locations:i})=>l("",e,"\n")+"directive @"+t+(p(n)?l("(\n",u(s(n,"\n")),"\n)"):l("(",s(n,", "),")"))+(r?" repeatable":"")+" on "+s(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:t})=>s(["extend schema",s(e," "),c(t)]," ")},ScalarTypeExtension:{leave:({name:e,directives:t})=>s(["extend scalar",e,s(t," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>s(["extend type",e,l("implements ",s(t," & ")),s(n," "),c(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:t,directives:n,fields:r})=>s(["extend interface",e,l("implements ",s(t," & ")),s(n," "),c(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:t,types:n})=>s(["extend union",e,s(t," "),l("= ",s(n," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:t,values:n})=>s(["extend enum",e,s(t," "),c(n)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:t,fields:n})=>s(["extend input",e,s(t," "),c(n)]," ")}};function s(e,t=""){var n;return null!==(n=null==e?void 0:e.filter((e=>e)).join(t))&&void 0!==n?n:""}function c(e){return l("{\n",u(s(e,"\n")),"\n}")}function l(e,t,n=""){return null!=t&&""!==t?e+t+n:""}function u(e){return l(" ",e.replace(/\n/g,"\n "))}function p(e){var t;return null!==(t=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==t&&t}},2412:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Source=void 0,t.isSource=function(e){return(0,o.instanceOf)(e,a)};var r=n(7242),i=n(8002),o=n(5752);class a{constructor(e,t="GraphQL request",n={line:1,column:1}){"string"==typeof e||(0,r.devAssert)(!1,`Body must be a string. Received: ${(0,i.inspect)(e)}.`),this.body=e,this.name=t,this.locationOffset=n,this.locationOffset.line>0||(0,r.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,r.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}t.Source=a},3175:function(e,t){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.TokenKind=void 0,t.TokenKind=n,function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(n||(t.TokenKind=n={}))},285:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BREAK=void 0,t.getEnterLeaveForKind=c,t.getVisitFn=function(e,t,n){const{enter:r,leave:i}=c(e,t);return n?i:r},t.visit=function(e,t,n=o.QueryDocumentKeys){const l=new Map;for(const e of Object.values(a.Kind))l.set(e,c(t,e));let u,p,f,d=Array.isArray(e),h=[e],m=-1,v=[],y=e;const g=[],b=[];do{m++;const e=m===h.length,a=e&&0!==v.length;if(e){if(p=0===b.length?void 0:g[g.length-1],y=f,f=b.pop(),a)if(d){y=y.slice();let e=0;for(const[t,n]of v){const r=t-e;null===n?(y.splice(r,1),e++):y[r]=n}}else{y=Object.defineProperties({},Object.getOwnPropertyDescriptors(y));for(const[e,t]of v)y[e]=t}m=u.index,h=u.keys,v=u.edits,d=u.inArray,u=u.prev}else if(f){if(p=d?m:h[m],y=f[p],null==y)continue;g.push(p)}let c;if(!Array.isArray(y)){var E,w;(0,o.isNode)(y)||(0,r.devAssert)(!1,`Invalid AST Node: ${(0,i.inspect)(y)}.`);const n=e?null===(E=l.get(y.kind))||void 0===E?void 0:E.leave:null===(w=l.get(y.kind))||void 0===w?void 0:w.enter;if(c=null==n?void 0:n.call(t,y,p,f,g,b),c===s)break;if(!1===c){if(!e){g.pop();continue}}else if(void 0!==c&&(v.push([p,c]),!e)){if(!(0,o.isNode)(c)){g.pop();continue}y=c}}var T;void 0===c&&a&&v.push([p,y]),e?g.pop():(u={inArray:d,index:m,keys:h,edits:v,prev:u},d=Array.isArray(y),h=d?y:null!==(T=n[y.kind])&&void 0!==T?T:[],m=-1,v=[],f&&b.push(f),f=y)}while(void 0!==u);return 0!==v.length?v[v.length-1][1]:e},t.visitInParallel=function(e){const t=new Array(e.length).fill(null),n=Object.create(null);for(const r of Object.values(a.Kind)){let i=!1;const o=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let t=0;tc((0,y.valueFromASTUntyped)(e,t)),this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(s=e.extensionASTNodes)&&void 0!==s?s:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,r.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,a.inspect)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,r.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,r.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}t.GraphQLScalarType=Q;class q{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=()=>G(e),this._interfaces=()=>U(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,r.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,a.inspect)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:z(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function U(e){var t;const n=F(null!==(t=e.interfaces)&&void 0!==t?t:[]);return Array.isArray(n)||(0,r.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),n}function G(e){const t=V(e.fields);return K(t)||(0,r.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,p.mapValue)(t,((t,n)=>{var i;K(t)||(0,r.devAssert)(!1,`${e.name}.${n} field config must be an object.`),null==t.resolve||"function"==typeof t.resolve||(0,r.devAssert)(!1,`${e.name}.${n} field resolver must be a function if provided, but got: ${(0,a.inspect)(t.resolve)}.`);const o=null!==(i=t.args)&&void 0!==i?i:{};return K(o)||(0,r.devAssert)(!1,`${e.name}.${n} args must be an object with argument names as keys.`),{name:(0,g.assertName)(n),description:t.description,type:t.type,args:B(o),resolve:t.resolve,subscribe:t.subscribe,deprecationReason:t.deprecationReason,extensions:(0,d.toObjMap)(t.extensions),astNode:t.astNode}}))}function B(e){return Object.entries(e).map((([e,t])=>({name:(0,g.assertName)(e),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,d.toObjMap)(t.extensions),astNode:t.astNode})))}function K(e){return(0,c.isObjectLike)(e)&&!Array.isArray(e)}function z(e){return(0,p.mapValue)(e,(e=>({description:e.description,type:e.type,args:$(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function $(e){return(0,u.keyValMap)(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}t.GraphQLObjectType=q;class H{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=G.bind(void 0,e),this._interfaces=U.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:z(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}t.GraphQLInterfaceType=H;class W{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._types=Y.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Y(e){const t=F(e.types);return Array.isArray(t)||(0,r.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),t}t.GraphQLUnionType=W;class J{constructor(e){var t,n,i;this.name=(0,g.assertName)(e.name),this.description=e.description,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._values=(n=this.name,K(i=e.values)||(0,r.devAssert)(!1,`${n} values must be an object with value names as keys.`),Object.entries(i).map((([e,t])=>(K(t)||(0,r.devAssert)(!1,`${n}.${e} must refer to an object with a "value" key representing an internal value but got: ${(0,a.inspect)(t)}.`),{name:(0,g.assertEnumValueName)(e),description:t.description,value:void 0!==t.value?t.value:e,deprecationReason:t.deprecationReason,extensions:(0,d.toObjMap)(t.extensions),astNode:t.astNode})))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=(0,l.keyMap)(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const t=this._valueLookup.get(e);if(void 0===t)throw new h.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,a.inspect)(e)}`);return t.name}parseValue(e){if("string"!=typeof e){const t=(0,a.inspect)(e);throw new h.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${t}.`+X(this,t))}const t=this.getValue(e);if(null==t)throw new h.GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+X(this,e));return t.value}parseLiteral(e,t){if(e.kind!==m.Kind.ENUM){const t=(0,v.print)(e);throw new h.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${t}.`+X(this,t),{nodes:e})}const n=this.getValue(e.value);if(null==n){const t=(0,v.print)(e);throw new h.GraphQLError(`Value "${t}" does not exist in "${this.name}" enum.`+X(this,t),{nodes:e})}return n.value}toConfig(){const e=(0,u.keyValMap)(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function X(e,t){const n=e.getValues().map((e=>e.name)),r=(0,f.suggestionList)(t,n);return(0,i.didYouMean)("the enum value",r)}t.GraphQLEnumType=J;class Z{constructor(e){var t;this.name=(0,g.assertName)(e.name),this.description=e.description,this.extensions=(0,d.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(t=e.extensionASTNodes)&&void 0!==t?t:[],this._fields=ee.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=(0,p.mapValue)(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ee(e){const t=V(e.fields);return K(t)||(0,r.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,p.mapValue)(t,((t,n)=>(!("resolve"in t)||(0,r.devAssert)(!1,`${e.name}.${n} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,g.assertName)(n),description:t.description,type:t.type,defaultValue:t.defaultValue,deprecationReason:t.deprecationReason,extensions:(0,d.toObjMap)(t.extensions),astNode:t.astNode})))}t.GraphQLInputObjectType=Z},7197:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLSpecifiedByDirective=t.GraphQLSkipDirective=t.GraphQLIncludeDirective=t.GraphQLDirective=t.GraphQLDeprecatedDirective=t.DEFAULT_DEPRECATION_REASON=void 0,t.assertDirective=function(e){if(!f(e))throw new Error(`Expected ${(0,i.inspect)(e)} to be a GraphQL directive.`);return e},t.isDirective=f,t.isSpecifiedDirective=function(e){return b.some((({name:t})=>t===e.name))},t.specifiedDirectives=void 0;var r=n(7242),i=n(8002),o=n(5752),a=n(5690),s=n(7690),c=n(8333),l=n(3058),u=n(5003),p=n(2229);function f(e){return(0,o.instanceOf)(e,d)}class d{constructor(e){var t,n;this.name=(0,l.assertName)(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!==(t=e.isRepeatable)&&void 0!==t&&t,this.extensions=(0,s.toObjMap)(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,r.devAssert)(!1,`@${e.name} locations must be an Array.`);const i=null!==(n=e.args)&&void 0!==n?n:{};(0,a.isObjectLike)(i)&&!Array.isArray(i)||(0,r.devAssert)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=(0,u.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,u.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}t.GraphQLDirective=d;const h=new d({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[c.DirectiveLocation.FIELD,c.DirectiveLocation.FRAGMENT_SPREAD,c.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new u.GraphQLNonNull(p.GraphQLBoolean),description:"Included when true."}}});t.GraphQLIncludeDirective=h;const m=new d({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[c.DirectiveLocation.FIELD,c.DirectiveLocation.FRAGMENT_SPREAD,c.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new u.GraphQLNonNull(p.GraphQLBoolean),description:"Skipped when true."}}});t.GraphQLSkipDirective=m;const v="No longer supported";t.DEFAULT_DEPRECATION_REASON=v;const y=new d({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[c.DirectiveLocation.FIELD_DEFINITION,c.DirectiveLocation.ARGUMENT_DEFINITION,c.DirectiveLocation.INPUT_FIELD_DEFINITION,c.DirectiveLocation.ENUM_VALUE],args:{reason:{type:p.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:v}}});t.GraphQLDeprecatedDirective=y;const g=new d({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[c.DirectiveLocation.SCALAR],args:{url:{type:new u.GraphQLNonNull(p.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});t.GraphQLSpecifiedByDirective=g;const b=Object.freeze([h,m,y,g]);t.specifiedDirectives=b},3226:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return o.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(t,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return a.GRAPHQL_MAX_INT}}),Object.defineProperty(t,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return a.GRAPHQL_MIN_INT}}),Object.defineProperty(t,"GraphQLBoolean",{enumerable:!0,get:function(){return a.GraphQLBoolean}}),Object.defineProperty(t,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return o.GraphQLDeprecatedDirective}}),Object.defineProperty(t,"GraphQLDirective",{enumerable:!0,get:function(){return o.GraphQLDirective}}),Object.defineProperty(t,"GraphQLEnumType",{enumerable:!0,get:function(){return i.GraphQLEnumType}}),Object.defineProperty(t,"GraphQLFloat",{enumerable:!0,get:function(){return a.GraphQLFloat}}),Object.defineProperty(t,"GraphQLID",{enumerable:!0,get:function(){return a.GraphQLID}}),Object.defineProperty(t,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return o.GraphQLIncludeDirective}}),Object.defineProperty(t,"GraphQLInputObjectType",{enumerable:!0,get:function(){return i.GraphQLInputObjectType}}),Object.defineProperty(t,"GraphQLInt",{enumerable:!0,get:function(){return a.GraphQLInt}}),Object.defineProperty(t,"GraphQLInterfaceType",{enumerable:!0,get:function(){return i.GraphQLInterfaceType}}),Object.defineProperty(t,"GraphQLList",{enumerable:!0,get:function(){return i.GraphQLList}}),Object.defineProperty(t,"GraphQLNonNull",{enumerable:!0,get:function(){return i.GraphQLNonNull}}),Object.defineProperty(t,"GraphQLObjectType",{enumerable:!0,get:function(){return i.GraphQLObjectType}}),Object.defineProperty(t,"GraphQLScalarType",{enumerable:!0,get:function(){return i.GraphQLScalarType}}),Object.defineProperty(t,"GraphQLSchema",{enumerable:!0,get:function(){return r.GraphQLSchema}}),Object.defineProperty(t,"GraphQLSkipDirective",{enumerable:!0,get:function(){return o.GraphQLSkipDirective}}),Object.defineProperty(t,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return o.GraphQLSpecifiedByDirective}}),Object.defineProperty(t,"GraphQLString",{enumerable:!0,get:function(){return a.GraphQLString}}),Object.defineProperty(t,"GraphQLUnionType",{enumerable:!0,get:function(){return i.GraphQLUnionType}}),Object.defineProperty(t,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return s.SchemaMetaFieldDef}}),Object.defineProperty(t,"TypeKind",{enumerable:!0,get:function(){return s.TypeKind}}),Object.defineProperty(t,"TypeMetaFieldDef",{enumerable:!0,get:function(){return s.TypeMetaFieldDef}}),Object.defineProperty(t,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return s.TypeNameMetaFieldDef}}),Object.defineProperty(t,"__Directive",{enumerable:!0,get:function(){return s.__Directive}}),Object.defineProperty(t,"__DirectiveLocation",{enumerable:!0,get:function(){return s.__DirectiveLocation}}),Object.defineProperty(t,"__EnumValue",{enumerable:!0,get:function(){return s.__EnumValue}}),Object.defineProperty(t,"__Field",{enumerable:!0,get:function(){return s.__Field}}),Object.defineProperty(t,"__InputValue",{enumerable:!0,get:function(){return s.__InputValue}}),Object.defineProperty(t,"__Schema",{enumerable:!0,get:function(){return s.__Schema}}),Object.defineProperty(t,"__Type",{enumerable:!0,get:function(){return s.__Type}}),Object.defineProperty(t,"__TypeKind",{enumerable:!0,get:function(){return s.__TypeKind}}),Object.defineProperty(t,"assertAbstractType",{enumerable:!0,get:function(){return i.assertAbstractType}}),Object.defineProperty(t,"assertCompositeType",{enumerable:!0,get:function(){return i.assertCompositeType}}),Object.defineProperty(t,"assertDirective",{enumerable:!0,get:function(){return o.assertDirective}}),Object.defineProperty(t,"assertEnumType",{enumerable:!0,get:function(){return i.assertEnumType}}),Object.defineProperty(t,"assertEnumValueName",{enumerable:!0,get:function(){return l.assertEnumValueName}}),Object.defineProperty(t,"assertInputObjectType",{enumerable:!0,get:function(){return i.assertInputObjectType}}),Object.defineProperty(t,"assertInputType",{enumerable:!0,get:function(){return i.assertInputType}}),Object.defineProperty(t,"assertInterfaceType",{enumerable:!0,get:function(){return i.assertInterfaceType}}),Object.defineProperty(t,"assertLeafType",{enumerable:!0,get:function(){return i.assertLeafType}}),Object.defineProperty(t,"assertListType",{enumerable:!0,get:function(){return i.assertListType}}),Object.defineProperty(t,"assertName",{enumerable:!0,get:function(){return l.assertName}}),Object.defineProperty(t,"assertNamedType",{enumerable:!0,get:function(){return i.assertNamedType}}),Object.defineProperty(t,"assertNonNullType",{enumerable:!0,get:function(){return i.assertNonNullType}}),Object.defineProperty(t,"assertNullableType",{enumerable:!0,get:function(){return i.assertNullableType}}),Object.defineProperty(t,"assertObjectType",{enumerable:!0,get:function(){return i.assertObjectType}}),Object.defineProperty(t,"assertOutputType",{enumerable:!0,get:function(){return i.assertOutputType}}),Object.defineProperty(t,"assertScalarType",{enumerable:!0,get:function(){return i.assertScalarType}}),Object.defineProperty(t,"assertSchema",{enumerable:!0,get:function(){return r.assertSchema}}),Object.defineProperty(t,"assertType",{enumerable:!0,get:function(){return i.assertType}}),Object.defineProperty(t,"assertUnionType",{enumerable:!0,get:function(){return i.assertUnionType}}),Object.defineProperty(t,"assertValidSchema",{enumerable:!0,get:function(){return c.assertValidSchema}}),Object.defineProperty(t,"assertWrappingType",{enumerable:!0,get:function(){return i.assertWrappingType}}),Object.defineProperty(t,"getNamedType",{enumerable:!0,get:function(){return i.getNamedType}}),Object.defineProperty(t,"getNullableType",{enumerable:!0,get:function(){return i.getNullableType}}),Object.defineProperty(t,"introspectionTypes",{enumerable:!0,get:function(){return s.introspectionTypes}}),Object.defineProperty(t,"isAbstractType",{enumerable:!0,get:function(){return i.isAbstractType}}),Object.defineProperty(t,"isCompositeType",{enumerable:!0,get:function(){return i.isCompositeType}}),Object.defineProperty(t,"isDirective",{enumerable:!0,get:function(){return o.isDirective}}),Object.defineProperty(t,"isEnumType",{enumerable:!0,get:function(){return i.isEnumType}}),Object.defineProperty(t,"isInputObjectType",{enumerable:!0,get:function(){return i.isInputObjectType}}),Object.defineProperty(t,"isInputType",{enumerable:!0,get:function(){return i.isInputType}}),Object.defineProperty(t,"isInterfaceType",{enumerable:!0,get:function(){return i.isInterfaceType}}),Object.defineProperty(t,"isIntrospectionType",{enumerable:!0,get:function(){return s.isIntrospectionType}}),Object.defineProperty(t,"isLeafType",{enumerable:!0,get:function(){return i.isLeafType}}),Object.defineProperty(t,"isListType",{enumerable:!0,get:function(){return i.isListType}}),Object.defineProperty(t,"isNamedType",{enumerable:!0,get:function(){return i.isNamedType}}),Object.defineProperty(t,"isNonNullType",{enumerable:!0,get:function(){return i.isNonNullType}}),Object.defineProperty(t,"isNullableType",{enumerable:!0,get:function(){return i.isNullableType}}),Object.defineProperty(t,"isObjectType",{enumerable:!0,get:function(){return i.isObjectType}}),Object.defineProperty(t,"isOutputType",{enumerable:!0,get:function(){return i.isOutputType}}),Object.defineProperty(t,"isRequiredArgument",{enumerable:!0,get:function(){return i.isRequiredArgument}}),Object.defineProperty(t,"isRequiredInputField",{enumerable:!0,get:function(){return i.isRequiredInputField}}),Object.defineProperty(t,"isScalarType",{enumerable:!0,get:function(){return i.isScalarType}}),Object.defineProperty(t,"isSchema",{enumerable:!0,get:function(){return r.isSchema}}),Object.defineProperty(t,"isSpecifiedDirective",{enumerable:!0,get:function(){return o.isSpecifiedDirective}}),Object.defineProperty(t,"isSpecifiedScalarType",{enumerable:!0,get:function(){return a.isSpecifiedScalarType}}),Object.defineProperty(t,"isType",{enumerable:!0,get:function(){return i.isType}}),Object.defineProperty(t,"isUnionType",{enumerable:!0,get:function(){return i.isUnionType}}),Object.defineProperty(t,"isWrappingType",{enumerable:!0,get:function(){return i.isWrappingType}}),Object.defineProperty(t,"resolveObjMapThunk",{enumerable:!0,get:function(){return i.resolveObjMapThunk}}),Object.defineProperty(t,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return i.resolveReadonlyArrayThunk}}),Object.defineProperty(t,"specifiedDirectives",{enumerable:!0,get:function(){return o.specifiedDirectives}}),Object.defineProperty(t,"specifiedScalarTypes",{enumerable:!0,get:function(){return a.specifiedScalarTypes}}),Object.defineProperty(t,"validateSchema",{enumerable:!0,get:function(){return c.validateSchema}});var r=n(6829),i=n(5003),o=n(7197),a=n(2229),s=n(8155),c=n(1671),l=n(3058)},8155:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.introspectionTypes=t.__TypeKind=t.__Type=t.__Schema=t.__InputValue=t.__Field=t.__EnumValue=t.__DirectiveLocation=t.__Directive=t.TypeNameMetaFieldDef=t.TypeMetaFieldDef=t.TypeKind=t.SchemaMetaFieldDef=void 0,t.isIntrospectionType=function(e){return T.some((({name:t})=>e.name===t))};var r=n(8002),i=n(7706),o=n(8333),a=n(3033),s=n(8115),c=n(5003),l=n(2229);const u=new c.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:l.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(d))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new c.GraphQLNonNull(d),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:d,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:d,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(p))),resolve:e=>e.getDirectives()}})});t.__Schema=u;const p=new c.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new c.GraphQLNonNull(l.GraphQLString),resolve:e=>e.name},description:{type:l.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new c.GraphQLNonNull(l.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(f))),resolve:e=>e.locations},args:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(m))),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter((e=>null==e.deprecationReason))}})});t.__Directive=p;const f=new c.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:o.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:o.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:o.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:o.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:o.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:o.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:o.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:o.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:o.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:o.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:o.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:o.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:o.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:o.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:o.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:o.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:o.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:o.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:o.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});t.__DirectiveLocation=f;const d=new c.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new c.GraphQLNonNull(g),resolve:e=>(0,c.isScalarType)(e)?y.SCALAR:(0,c.isObjectType)(e)?y.OBJECT:(0,c.isInterfaceType)(e)?y.INTERFACE:(0,c.isUnionType)(e)?y.UNION:(0,c.isEnumType)(e)?y.ENUM:(0,c.isInputObjectType)(e)?y.INPUT_OBJECT:(0,c.isListType)(e)?y.LIST:(0,c.isNonNullType)(e)?y.NON_NULL:void(0,i.invariant)(!1,`Unexpected type: "${(0,r.inspect)(e)}".`)},name:{type:l.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:l.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:l.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new c.GraphQLList(new c.GraphQLNonNull(h)),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isObjectType)(e)||(0,c.isInterfaceType)(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new c.GraphQLList(new c.GraphQLNonNull(d)),resolve(e){if((0,c.isObjectType)(e)||(0,c.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new c.GraphQLList(new c.GraphQLNonNull(d)),resolve(e,t,n,{schema:r}){if((0,c.isAbstractType)(e))return r.getPossibleTypes(e)}},enumValues:{type:new c.GraphQLList(new c.GraphQLNonNull(v)),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isEnumType)(e)){const n=e.getValues();return t?n:n.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new c.GraphQLList(new c.GraphQLNonNull(m)),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:t}){if((0,c.isInputObjectType)(e)){const n=Object.values(e.getFields());return t?n:n.filter((e=>null==e.deprecationReason))}}},ofType:{type:d,resolve:e=>"ofType"in e?e.ofType:void 0}})});t.__Type=d;const h=new c.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new c.GraphQLNonNull(l.GraphQLString),resolve:e=>e.name},description:{type:l.GraphQLString,resolve:e=>e.description},args:{type:new c.GraphQLNonNull(new c.GraphQLList(new c.GraphQLNonNull(m))),args:{includeDeprecated:{type:l.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:t})=>t?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new c.GraphQLNonNull(d),resolve:e=>e.type},isDeprecated:{type:new c.GraphQLNonNull(l.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:l.GraphQLString,resolve:e=>e.deprecationReason}})});t.__Field=h;const m=new c.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new c.GraphQLNonNull(l.GraphQLString),resolve:e=>e.name},description:{type:l.GraphQLString,resolve:e=>e.description},type:{type:new c.GraphQLNonNull(d),resolve:e=>e.type},defaultValue:{type:l.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:t,defaultValue:n}=e,r=(0,s.astFromValue)(n,t);return r?(0,a.print)(r):null}},isDeprecated:{type:new c.GraphQLNonNull(l.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:l.GraphQLString,resolve:e=>e.deprecationReason}})});t.__InputValue=m;const v=new c.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new c.GraphQLNonNull(l.GraphQLString),resolve:e=>e.name},description:{type:l.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new c.GraphQLNonNull(l.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:l.GraphQLString,resolve:e=>e.deprecationReason}})});var y;t.__EnumValue=v,t.TypeKind=y,function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(y||(t.TypeKind=y={}));const g=new c.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:y.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:y.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:y.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:y.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:y.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:y.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:y.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:y.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});t.__TypeKind=g;const b={name:"__schema",type:new c.GraphQLNonNull(u),description:"Access the current type schema of this server.",args:[],resolve:(e,t,n,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};t.SchemaMetaFieldDef=b;const E={name:"__type",type:d,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new c.GraphQLNonNull(l.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:t},n,{schema:r})=>r.getType(t),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};t.TypeMetaFieldDef=E;const w={name:"__typename",type:new c.GraphQLNonNull(l.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,t,n,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};t.TypeNameMetaFieldDef=w;const T=Object.freeze([u,p,f,d,h,m,v,g]);t.introspectionTypes=T},2229:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GraphQLString=t.GraphQLInt=t.GraphQLID=t.GraphQLFloat=t.GraphQLBoolean=t.GRAPHQL_MIN_INT=t.GRAPHQL_MAX_INT=void 0,t.isSpecifiedScalarType=function(e){return v.some((({name:t})=>e.name===t))},t.specifiedScalarTypes=void 0;var r=n(8002),i=n(5690),o=n(5822),a=n(2828),s=n(3033),c=n(5003);const l=2147483647;t.GRAPHQL_MAX_INT=l;const u=-2147483648;t.GRAPHQL_MIN_INT=u;const p=new c.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const t=y(e);if("boolean"==typeof t)return t?1:0;let n=t;if("string"==typeof t&&""!==t&&(n=Number(t)),"number"!=typeof n||!Number.isInteger(n))throw new o.GraphQLError(`Int cannot represent non-integer value: ${(0,r.inspect)(t)}`);if(n>l||nl||el||tt.name===e))}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function h(e,t){const n=(0,l.getNamedType)(e);if(!t.has(n))if(t.add(n),(0,l.isUnionType)(n))for(const e of n.getTypes())h(e,t);else if((0,l.isObjectType)(n)||(0,l.isInterfaceType)(n)){for(const e of n.getInterfaces())h(e,t);for(const e of Object.values(n.getFields())){h(e.type,t);for(const n of e.args)h(n.type,t)}}else if((0,l.isInputObjectType)(n))for(const e of Object.values(n.getFields()))h(e.type,t);return t}t.GraphQLSchema=d},1671:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidSchema=function(e){const t=p(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))},t.validateSchema=p;var r=n(8002),i=n(5822),o=n(1807),a=n(298),s=n(5003),c=n(7197),l=n(8155),u=n(6829);function p(e){if((0,u.assertSchema)(e),e.__validationErrors)return e.__validationErrors;const t=new f(e);!function(e){const t=e.schema,n=t.getQueryType();if(n){if(!(0,s.isObjectType)(n)){var i;e.reportError(`Query root type must be Object type, it cannot be ${(0,r.inspect)(n)}.`,null!==(i=d(t,o.OperationTypeNode.QUERY))&&void 0!==i?i:n.astNode)}}else e.reportError("Query root type must be provided.",t.astNode);const a=t.getMutationType();var c;a&&!(0,s.isObjectType)(a)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,r.inspect)(a)}.`,null!==(c=d(t,o.OperationTypeNode.MUTATION))&&void 0!==c?c:a.astNode);const l=t.getSubscriptionType();var u;l&&!(0,s.isObjectType)(l)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,r.inspect)(l)}.`,null!==(u=d(t,o.OperationTypeNode.SUBSCRIPTION))&&void 0!==u?u:l.astNode)}(t),function(e){for(const n of e.schema.getDirectives())if((0,c.isDirective)(n)){h(e,n);for(const i of n.args){var t;h(e,i),(0,s.isInputType)(i.type)||e.reportError(`The type of @${n.name}(${i.name}:) must be Input Type but got: ${(0,r.inspect)(i.type)}.`,i.astNode),(0,s.isRequiredArgument)(i)&&null!=i.deprecationReason&&e.reportError(`Required argument @${n.name}(${i.name}:) cannot be deprecated.`,[k(i.astNode),null===(t=i.astNode)||void 0===t?void 0:t.type])}}else e.reportError(`Expected directive but got: ${(0,r.inspect)(n)}.`,null==n?void 0:n.astNode)}(t),function(e){const t=function(e){const t=Object.create(null),n=[],r=Object.create(null);return function i(o){if(t[o.name])return;t[o.name]=!0,r[o.name]=n.length;const a=Object.values(o.getFields());for(const t of a)if((0,s.isNonNullType)(t.type)&&(0,s.isInputObjectType)(t.type.ofType)){const o=t.type.ofType,a=r[o.name];if(n.push(t),void 0===a)i(o);else{const t=n.slice(a),r=t.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,t.map((e=>e.astNode)))}n.pop()}r[o.name]=void 0}}(e),n=e.schema.getTypeMap();for(const i of Object.values(n))(0,s.isNamedType)(i)?((0,l.isIntrospectionType)(i)||h(e,i),(0,s.isObjectType)(i)||(0,s.isInterfaceType)(i)?(m(e,i),v(e,i)):(0,s.isUnionType)(i)?b(e,i):(0,s.isEnumType)(i)?E(e,i):(0,s.isInputObjectType)(i)&&(w(e,i),t(i))):e.reportError(`Expected GraphQL named type but got: ${(0,r.inspect)(i)}.`,i.astNode)}(t);const n=t.getErrors();return e.__validationErrors=n,n}class f{constructor(e){this._errors=[],this.schema=e}reportError(e,t){const n=Array.isArray(t)?t.filter(Boolean):t;this._errors.push(new i.GraphQLError(e,{nodes:n}))}getErrors(){return this._errors}}function d(e,t){var n;return null===(n=[e.astNode,...e.extensionASTNodes].flatMap((e=>{var t;return null!==(t=null==e?void 0:e.operationTypes)&&void 0!==t?t:[]})).find((e=>e.operation===t)))||void 0===n?void 0:n.type}function h(e,t){t.name.startsWith("__")&&e.reportError(`Name "${t.name}" must not begin with "__", which is reserved by GraphQL introspection.`,t.astNode)}function m(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const c of n){var i;h(e,c),(0,s.isOutputType)(c.type)||e.reportError(`The type of ${t.name}.${c.name} must be Output Type but got: ${(0,r.inspect)(c.type)}.`,null===(i=c.astNode)||void 0===i?void 0:i.type);for(const n of c.args){const i=n.name;var o,a;h(e,n),(0,s.isInputType)(n.type)||e.reportError(`The type of ${t.name}.${c.name}(${i}:) must be Input Type but got: ${(0,r.inspect)(n.type)}.`,null===(o=n.astNode)||void 0===o?void 0:o.type),(0,s.isRequiredArgument)(n)&&null!=n.deprecationReason&&e.reportError(`Required argument ${t.name}.${c.name}(${i}:) cannot be deprecated.`,[k(n.astNode),null===(a=n.astNode)||void 0===a?void 0:a.type])}}}function v(e,t){const n=Object.create(null);for(const i of t.getInterfaces())(0,s.isInterfaceType)(i)?t!==i?n[i.name]?e.reportError(`Type ${t.name} can only implement ${i.name} once.`,T(t,i)):(n[i.name]=!0,g(e,t,i),y(e,t,i)):e.reportError(`Type ${t.name} cannot implement itself because it would create a circular reference.`,T(t,i)):e.reportError(`Type ${(0,r.inspect)(t)} must only implement Interface types, it cannot implement ${(0,r.inspect)(i)}.`,T(t,i))}function y(e,t,n){const i=t.getFields();for(const p of Object.values(n.getFields())){const f=p.name,d=i[f];if(d){var o,c;(0,a.isTypeSubTypeOf)(e.schema,d.type,p.type)||e.reportError(`Interface field ${n.name}.${f} expects type ${(0,r.inspect)(p.type)} but ${t.name}.${f} is type ${(0,r.inspect)(d.type)}.`,[null===(o=p.astNode)||void 0===o?void 0:o.type,null===(c=d.astNode)||void 0===c?void 0:c.type]);for(const i of p.args){const o=i.name,s=d.args.find((e=>e.name===o));var l,u;s?(0,a.isEqualType)(i.type,s.type)||e.reportError(`Interface field argument ${n.name}.${f}(${o}:) expects type ${(0,r.inspect)(i.type)} but ${t.name}.${f}(${o}:) is type ${(0,r.inspect)(s.type)}.`,[null===(l=i.astNode)||void 0===l?void 0:l.type,null===(u=s.astNode)||void 0===u?void 0:u.type]):e.reportError(`Interface field argument ${n.name}.${f}(${o}:) expected but ${t.name}.${f} does not provide it.`,[i.astNode,d.astNode])}for(const r of d.args){const i=r.name;!p.args.find((e=>e.name===i))&&(0,s.isRequiredArgument)(r)&&e.reportError(`Object field ${t.name}.${f} includes required argument ${i} that is missing from the Interface field ${n.name}.${f}.`,[r.astNode,p.astNode])}}else e.reportError(`Interface field ${n.name}.${f} expected but ${t.name} does not provide it.`,[p.astNode,t.astNode,...t.extensionASTNodes])}}function g(e,t,n){const r=t.getInterfaces();for(const i of n.getInterfaces())r.includes(i)||e.reportError(i===t?`Type ${t.name} cannot implement ${n.name} because it would create a circular reference.`:`Type ${t.name} must implement ${i.name} because it is implemented by ${n.name}.`,[...T(n,i),...T(t,n)])}function b(e,t){const n=t.getTypes();0===n.length&&e.reportError(`Union type ${t.name} must define one or more member types.`,[t.astNode,...t.extensionASTNodes]);const i=Object.create(null);for(const o of n)i[o.name]?e.reportError(`Union type ${t.name} can only include type ${o.name} once.`,_(t,o.name)):(i[o.name]=!0,(0,s.isObjectType)(o)||e.reportError(`Union type ${t.name} can only include Object types, it cannot include ${(0,r.inspect)(o)}.`,_(t,String(o))))}function E(e,t){const n=t.getValues();0===n.length&&e.reportError(`Enum type ${t.name} must define one or more values.`,[t.astNode,...t.extensionASTNodes]);for(const t of n)h(e,t)}function w(e,t){const n=Object.values(t.getFields());0===n.length&&e.reportError(`Input Object type ${t.name} must define one or more fields.`,[t.astNode,...t.extensionASTNodes]);for(const a of n){var i,o;h(e,a),(0,s.isInputType)(a.type)||e.reportError(`The type of ${t.name}.${a.name} must be Input Type but got: ${(0,r.inspect)(a.type)}.`,null===(i=a.astNode)||void 0===i?void 0:i.type),(0,s.isRequiredInputField)(a)&&null!=a.deprecationReason&&e.reportError(`Required input field ${t.name}.${a.name} cannot be deprecated.`,[k(a.astNode),null===(o=a.astNode)||void 0===o?void 0:o.type])}}function T(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>{var t;return null!==(t=e.interfaces)&&void 0!==t?t:[]})).filter((e=>e.name.value===t.name))}function _(e,t){const{astNode:n,extensionASTNodes:r}=e;return(null!=n?[n,...r]:r).flatMap((e=>{var t;return null!==(t=e.types)&&void 0!==t?t:[]})).filter((e=>e.name.value===t))}function k(e){var t;return null==e||null===(t=e.directives)||void 0===t?void 0:t.find((e=>e.name.value===c.GraphQLDeprecatedDirective.name))}},6226:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TypeInfo=void 0,t.visitWithTypeInfo=function(e,t){return{enter(...n){const i=n[0];e.enter(i);const a=(0,o.getEnterLeaveForKind)(t,i.kind).enter;if(a){const o=a.apply(t,n);return void 0!==o&&(e.leave(i),(0,r.isNode)(o)&&e.enter(o)),o}},leave(...n){const r=n[0],i=(0,o.getEnterLeaveForKind)(t,r.kind).leave;let a;return i&&(a=i.apply(t,n)),e.leave(r),a}}};var r=n(1807),i=n(2828),o=n(285),a=n(5003),s=n(8155),c=n(5115);class l{constructor(e,t,n){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=n?n:u,t&&((0,a.isInputType)(t)&&this._inputTypeStack.push(t),(0,a.isCompositeType)(t)&&this._parentTypeStack.push(t),(0,a.isOutputType)(t)&&this._typeStack.push(t))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const t=this._schema;switch(e.kind){case i.Kind.SELECTION_SET:{const e=(0,a.getNamedType)(this.getType());this._parentTypeStack.push((0,a.isCompositeType)(e)?e:void 0);break}case i.Kind.FIELD:{const n=this.getParentType();let r,i;n&&(r=this._getFieldDef(t,n,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push((0,a.isOutputType)(i)?i:void 0);break}case i.Kind.DIRECTIVE:this._directive=t.getDirective(e.name.value);break;case i.Kind.OPERATION_DEFINITION:{const n=t.getRootType(e.operation);this._typeStack.push((0,a.isObjectType)(n)?n:void 0);break}case i.Kind.INLINE_FRAGMENT:case i.Kind.FRAGMENT_DEFINITION:{const n=e.typeCondition,r=n?(0,c.typeFromAST)(t,n):(0,a.getNamedType)(this.getType());this._typeStack.push((0,a.isOutputType)(r)?r:void 0);break}case i.Kind.VARIABLE_DEFINITION:{const n=(0,c.typeFromAST)(t,e.type);this._inputTypeStack.push((0,a.isInputType)(n)?n:void 0);break}case i.Kind.ARGUMENT:{var n;let t,r;const i=null!==(n=this.getDirective())&&void 0!==n?n:this.getFieldDef();i&&(t=i.args.find((t=>t.name===e.name.value)),t&&(r=t.type)),this._argument=t,this._defaultValueStack.push(t?t.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(r)?r:void 0);break}case i.Kind.LIST:{const e=(0,a.getNullableType)(this.getInputType()),t=(0,a.isListType)(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,a.isInputType)(t)?t:void 0);break}case i.Kind.OBJECT_FIELD:{const t=(0,a.getNamedType)(this.getInputType());let n,r;(0,a.isInputObjectType)(t)&&(r=t.getFields()[e.name.value],r&&(n=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(n)?n:void 0);break}case i.Kind.ENUM:{const t=(0,a.getNamedType)(this.getInputType());let n;(0,a.isEnumType)(t)&&(n=t.getValue(e.value)),this._enumValue=n;break}}}leave(e){switch(e.kind){case i.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case i.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case i.Kind.DIRECTIVE:this._directive=null;break;case i.Kind.OPERATION_DEFINITION:case i.Kind.INLINE_FRAGMENT:case i.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case i.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case i.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.Kind.LIST:case i.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.Kind.ENUM:this._enumValue=null}}}function u(e,t,n){const r=n.name.value;return r===s.SchemaMetaFieldDef.name&&e.getQueryType()===t?s.SchemaMetaFieldDef:r===s.TypeMetaFieldDef.name&&e.getQueryType()===t?s.TypeMetaFieldDef:r===s.TypeNameMetaFieldDef.name&&(0,a.isCompositeType)(t)?s.TypeNameMetaFieldDef:(0,a.isObjectType)(t)||(0,a.isInterfaceType)(t)?t.getFields()[r]:void 0}t.TypeInfo=l},6526:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidName=function(e){const t=a(e);if(t)throw t;return e},t.isValidNameError=a;var r=n(7242),i=n(5822),o=n(3058);function a(e){if("string"==typeof e||(0,r.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new i.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,o.assertName)(e)}catch(e){return e}}},8115:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.astFromValue=function e(t,n){if((0,c.isNonNullType)(n)){const r=e(t,n.ofType);return(null==r?void 0:r.kind)===s.Kind.NULL?null:r}if(null===t)return{kind:s.Kind.NULL};if(void 0===t)return null;if((0,c.isListType)(n)){const r=n.ofType;if((0,o.isIterableObject)(t)){const n=[];for(const i of t){const t=e(i,r);null!=t&&n.push(t)}return{kind:s.Kind.LIST,values:n}}return e(t,r)}if((0,c.isInputObjectType)(n)){if(!(0,a.isObjectLike)(t))return null;const r=[];for(const i of Object.values(n.getFields())){const n=e(t[i.name],i.type);n&&r.push({kind:s.Kind.OBJECT_FIELD,name:{kind:s.Kind.NAME,value:i.name},value:n})}return{kind:s.Kind.OBJECT,fields:r}}if((0,c.isLeafType)(n)){const e=n.serialize(t);if(null==e)return null;if("boolean"==typeof e)return{kind:s.Kind.BOOLEAN,value:e};if("number"==typeof e&&Number.isFinite(e)){const t=String(e);return u.test(t)?{kind:s.Kind.INT,value:t}:{kind:s.Kind.FLOAT,value:t}}if("string"==typeof e)return(0,c.isEnumType)(n)?{kind:s.Kind.ENUM,value:e}:n===l.GraphQLID&&u.test(e)?{kind:s.Kind.INT,value:e}:{kind:s.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${(0,r.inspect)(e)}.`)}(0,i.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(n))};var r=n(8002),i=n(7706),o=n(6609),a=n(5690),s=n(2828),c=n(5003),l=n(2229);const u=/^-?(?:0|[1-9][0-9]*)$/},2906:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildASTSchema=u,t.buildSchema=function(e,t){return u((0,o.parse)(e,{noLocation:null==t?void 0:t.noLocation,allowLegacyFragmentVariables:null==t?void 0:t.allowLegacyFragmentVariables}),{assumeValidSDL:null==t?void 0:t.assumeValidSDL,assumeValid:null==t?void 0:t.assumeValid})};var r=n(7242),i=n(2828),o=n(8370),a=n(7197),s=n(6829),c=n(9504),l=n(3242);function u(e,t){null!=e&&e.kind===i.Kind.DOCUMENT||(0,r.devAssert)(!1,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&(0,c.assertValidSDL)(e);const n={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},o=(0,l.extendSchemaImpl)(n,e,t);if(null==o.astNode)for(const e of o.types)switch(e.name){case"Query":o.query=e;break;case"Mutation":o.mutation=e;break;case"Subscription":o.subscription=e}const u=[...o.directives,...a.specifiedDirectives.filter((e=>o.directives.every((t=>t.name!==e.name))))];return new s.GraphQLSchema({...o,directives:u})}},8686:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildClientSchema=function(e,t){(0,o.isObjectLike)(e)&&(0,o.isObjectLike)(e.__schema)||(0,r.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,i.inspect)(e)}.`);const n=e.__schema,h=(0,a.keyValMap)(n.types,(e=>e.name),(e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case u.TypeKind.SCALAR:return r=e,new c.GraphQLScalarType({name:r.name,description:r.description,specifiedByURL:r.specifiedByURL});case u.TypeKind.OBJECT:return n=e,new c.GraphQLObjectType({name:n.name,description:n.description,interfaces:()=>_(n),fields:()=>k(n)});case u.TypeKind.INTERFACE:return t=e,new c.GraphQLInterfaceType({name:t.name,description:t.description,interfaces:()=>_(t),fields:()=>k(t)});case u.TypeKind.UNION:return function(e){if(!e.possibleTypes){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing possibleTypes: ${t}.`)}return new c.GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(w)})}(e);case u.TypeKind.ENUM:return function(e){if(!e.enumValues){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing enumValues: ${t}.`)}return new c.GraphQLEnumType({name:e.name,description:e.description,values:(0,a.keyValMap)(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case u.TypeKind.INPUT_OBJECT:return function(e){if(!e.inputFields){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing inputFields: ${t}.`)}return new c.GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>S(e.inputFields)})}(e)}var t,n,r;const o=(0,i.inspect)(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${o}.`)}(e)));for(const e of[...p.specifiedScalarTypes,...u.introspectionTypes])h[e.name]&&(h[e.name]=e);const m=n.queryType?w(n.queryType):null,v=n.mutationType?w(n.mutationType):null,y=n.subscriptionType?w(n.subscriptionType):null,g=n.directives?n.directives.map((function(e){if(!e.args){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing directive args: ${t}.`)}if(!e.locations){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing directive locations: ${t}.`)}return new l.GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:S(e.args)})})):[];return new f.GraphQLSchema({description:n.description,query:m,mutation:v,subscription:y,types:Object.values(h),directives:g,assumeValid:null==t?void 0:t.assumeValid});function b(e){if(e.kind===u.TypeKind.LIST){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");return new c.GraphQLList(b(t))}if(e.kind===u.TypeKind.NON_NULL){const t=e.ofType;if(!t)throw new Error("Decorated type deeper than introspection query.");const n=b(t);return new c.GraphQLNonNull((0,c.assertNullableType)(n))}return E(e)}function E(e){const t=e.name;if(!t)throw new Error(`Unknown type reference: ${(0,i.inspect)(e)}.`);const n=h[t];if(!n)throw new Error(`Invalid or incomplete schema, unknown type: ${t}. Ensure that a full introspection query is used in order to build a client schema.`);return n}function w(e){return(0,c.assertObjectType)(E(e))}function T(e){return(0,c.assertInterfaceType)(E(e))}function _(e){if(null===e.interfaces&&e.kind===u.TypeKind.INTERFACE)return[];if(!e.interfaces){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing interfaces: ${t}.`)}return e.interfaces.map(T)}function k(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${(0,i.inspect)(e)}.`);return(0,a.keyValMap)(e.fields,(e=>e.name),O)}function O(e){const t=b(e.type);if(!(0,c.isOutputType)(t)){const e=(0,i.inspect)(t);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const t=(0,i.inspect)(e);throw new Error(`Introspection result missing field args: ${t}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:t,args:S(e.args)}}function S(e){return(0,a.keyValMap)(e,(e=>e.name),x)}function x(e){const t=b(e.type);if(!(0,c.isInputType)(t)){const e=(0,i.inspect)(t);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const n=null!=e.defaultValue?(0,d.valueFromAST)((0,s.parseValue)(e.defaultValue),t):void 0;return{description:e.description,type:t,defaultValue:n,deprecationReason:e.deprecationReason}}};var r=n(7242),i=n(8002),o=n(5690),a=n(7154),s=n(8370),c=n(5003),l=n(7197),u=n(8155),p=n(2229),f=n(6829),d=n(3770)},3679:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.coerceInputValue=function(e,t,n=d){return h(e,t,n,void 0)};var r=n(166),i=n(8002),o=n(7706),a=n(6609),s=n(5690),c=n(7059),l=n(737),u=n(8070),p=n(5822),f=n(5003);function d(e,t,n){let r="Invalid value "+(0,i.inspect)(t);throw e.length>0&&(r+=` at "value${(0,l.printPathArray)(e)}"`),n.message=r+": "+n.message,n}function h(e,t,n,l){if((0,f.isNonNullType)(t))return null!=e?h(e,t.ofType,n,l):void n((0,c.pathToArray)(l),e,new p.GraphQLError(`Expected non-nullable type "${(0,i.inspect)(t)}" not to be null.`));if(null==e)return null;if((0,f.isListType)(t)){const r=t.ofType;return(0,a.isIterableObject)(e)?Array.from(e,((e,t)=>{const i=(0,c.addPath)(l,t,void 0);return h(e,r,n,i)})):[h(e,r,n,l)]}if((0,f.isInputObjectType)(t)){if(!(0,s.isObjectLike)(e))return void n((0,c.pathToArray)(l),e,new p.GraphQLError(`Expected type "${t.name}" to be an object.`));const o={},a=t.getFields();for(const r of Object.values(a)){const a=e[r.name];if(void 0!==a)o[r.name]=h(a,r.type,n,(0,c.addPath)(l,r.name,t.name));else if(void 0!==r.defaultValue)o[r.name]=r.defaultValue;else if((0,f.isNonNullType)(r.type)){const t=(0,i.inspect)(r.type);n((0,c.pathToArray)(l),e,new p.GraphQLError(`Field "${r.name}" of required type "${t}" was not provided.`))}}for(const i of Object.keys(e))if(!a[i]){const o=(0,u.suggestionList)(i,Object.keys(t.getFields()));n((0,c.pathToArray)(l),e,new p.GraphQLError(`Field "${i}" is not defined by type "${t.name}".`+(0,r.didYouMean)(o)))}return o}if((0,f.isLeafType)(t)){let r;try{r=t.parseValue(e)}catch(r){return void(r instanceof p.GraphQLError?n((0,c.pathToArray)(l),e,r):n((0,c.pathToArray)(l),e,new p.GraphQLError(`Expected type "${t.name}". `+r.message,{originalError:r})))}return void 0===r&&n((0,c.pathToArray)(l),e,new p.GraphQLError(`Expected type "${t.name}".`)),r}(0,o.invariant)(!1,"Unexpected input type: "+(0,i.inspect)(t))}},6078:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.concatAST=function(e){const t=[];for(const n of e)t.push(...n.definitions);return{kind:r.Kind.DOCUMENT,definitions:t}};var r=n(2828)},3242:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSchema=function(e,t,n){(0,h.assertSchema)(e),null!=t&&t.kind===c.Kind.DOCUMENT||(0,r.devAssert)(!1,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&(0,m.assertValidSDLExtension)(t,e);const i=e.toConfig(),o=g(i,t,n);return i===o?e:new h.GraphQLSchema(o)},t.extendSchemaImpl=g;var r=n(7242),i=n(8002),o=n(7706),a=n(2863),s=n(6124),c=n(2828),l=n(1352),u=n(5003),p=n(7197),f=n(8155),d=n(2229),h=n(6829),m=n(9504),v=n(8840),y=n(3770);function g(e,t,n){var r,a,h,m;const v=[],g=Object.create(null),T=[];let _;const k=[];for(const e of t.definitions)if(e.kind===c.Kind.SCHEMA_DEFINITION)_=e;else if(e.kind===c.Kind.SCHEMA_EXTENSION)k.push(e);else if((0,l.isTypeDefinitionNode)(e))v.push(e);else if((0,l.isTypeExtensionNode)(e)){const t=e.name.value,n=g[t];g[t]=n?n.concat([e]):[e]}else e.kind===c.Kind.DIRECTIVE_DEFINITION&&T.push(e);if(0===Object.keys(g).length&&0===v.length&&0===T.length&&0===k.length&&null==_)return e;const O=Object.create(null);for(const t of e.types)O[t.name]=(S=t,(0,f.isIntrospectionType)(S)||(0,d.isSpecifiedScalarType)(S)?S:(0,u.isScalarType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];let i=n.specifiedByURL;for(const e of r){var o;i=null!==(o=w(e))&&void 0!==o?o:i}return new u.GraphQLScalarType({...n,specifiedByURL:i,extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isObjectType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];return new u.GraphQLObjectType({...n,interfaces:()=>[...e.getInterfaces().map(A),...Q(r)],fields:()=>({...(0,s.mapValue)(n.fields,L),...M(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isInterfaceType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];return new u.GraphQLInterfaceType({...n,interfaces:()=>[...e.getInterfaces().map(A),...Q(r)],fields:()=>({...(0,s.mapValue)(n.fields,L),...M(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isUnionType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];return new u.GraphQLUnionType({...n,types:()=>[...e.getTypes().map(A),...q(r)],extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isEnumType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[e.name])&&void 0!==t?t:[];return new u.GraphQLEnumType({...n,values:{...n.values,...V(r)},extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):(0,u.isInputObjectType)(S)?function(e){var t;const n=e.toConfig(),r=null!==(t=g[n.name])&&void 0!==t?t:[];return new u.GraphQLInputObjectType({...n,fields:()=>({...(0,s.mapValue)(n.fields,(e=>({...e,type:N(e.type)}))),...F(r)}),extensionASTNodes:n.extensionASTNodes.concat(r)})}(S):void(0,o.invariant)(!1,"Unexpected type: "+(0,i.inspect)(S)));var S;for(const e of v){var x;const t=e.name.value;O[t]=null!==(x=b[t])&&void 0!==x?x:U(e)}const C={query:e.query&&A(e.query),mutation:e.mutation&&A(e.mutation),subscription:e.subscription&&A(e.subscription),..._&&I([_]),...I(k)};return{description:null===(r=_)||void 0===r||null===(a=r.description)||void 0===a?void 0:a.value,...C,types:Object.values(O),directives:[...e.directives.map((function(e){const t=e.toConfig();return new p.GraphQLDirective({...t,args:(0,s.mapValue)(t.args,D)})})),...T.map((function(e){var t;return new p.GraphQLDirective({name:e.name.value,description:null===(t=e.description)||void 0===t?void 0:t.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:j(e.arguments),astNode:e})}))],extensions:Object.create(null),astNode:null!==(h=_)&&void 0!==h?h:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(k),assumeValid:null!==(m=null==n?void 0:n.assumeValid)&&void 0!==m&&m};function N(e){return(0,u.isListType)(e)?new u.GraphQLList(N(e.ofType)):(0,u.isNonNullType)(e)?new u.GraphQLNonNull(N(e.ofType)):A(e)}function A(e){return O[e.name]}function L(e){return{...e,type:N(e.type),args:e.args&&(0,s.mapValue)(e.args,D)}}function D(e){return{...e,type:N(e.type)}}function I(e){const t={};for(const r of e){var n;const e=null!==(n=r.operationTypes)&&void 0!==n?n:[];for(const n of e)t[n.operation]=P(n.type)}return t}function P(e){var t;const n=e.name.value,r=null!==(t=b[n])&&void 0!==t?t:O[n];if(void 0===r)throw new Error(`Unknown type: "${n}".`);return r}function R(e){return e.kind===c.Kind.LIST_TYPE?new u.GraphQLList(R(e.type)):e.kind===c.Kind.NON_NULL_TYPE?new u.GraphQLNonNull(R(e.type)):P(e)}function M(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={type:R(n.type),description:null===(r=n.description)||void 0===r?void 0:r.value,args:j(n.arguments),deprecationReason:E(n),astNode:n}}}return t}function j(e){const t=null!=e?e:[],n=Object.create(null);for(const e of t){var r;const t=R(e.type);n[e.name.value]={type:t,description:null===(r=e.description)||void 0===r?void 0:r.value,defaultValue:(0,y.valueFromAST)(e.defaultValue,t),deprecationReason:E(e),astNode:e}}return n}function F(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.fields)&&void 0!==n?n:[];for(const n of e){var r;const e=R(n.type);t[n.name.value]={type:e,description:null===(r=n.description)||void 0===r?void 0:r.value,defaultValue:(0,y.valueFromAST)(n.defaultValue,e),deprecationReason:E(n),astNode:n}}}return t}function V(e){const t=Object.create(null);for(const i of e){var n;const e=null!==(n=i.values)&&void 0!==n?n:[];for(const n of e){var r;t[n.name.value]={description:null===(r=n.description)||void 0===r?void 0:r.value,deprecationReason:E(n),astNode:n}}}return t}function Q(e){return e.flatMap((e=>{var t,n;return null!==(t=null===(n=e.interfaces)||void 0===n?void 0:n.map(P))&&void 0!==t?t:[]}))}function q(e){return e.flatMap((e=>{var t,n;return null!==(t=null===(n=e.types)||void 0===n?void 0:n.map(P))&&void 0!==t?t:[]}))}function U(e){var t;const n=e.name.value,r=null!==(t=g[n])&&void 0!==t?t:[];switch(e.kind){case c.Kind.OBJECT_TYPE_DEFINITION:{var i;const t=[e,...r];return new u.GraphQLObjectType({name:n,description:null===(i=e.description)||void 0===i?void 0:i.value,interfaces:()=>Q(t),fields:()=>M(t),astNode:e,extensionASTNodes:r})}case c.Kind.INTERFACE_TYPE_DEFINITION:{var o;const t=[e,...r];return new u.GraphQLInterfaceType({name:n,description:null===(o=e.description)||void 0===o?void 0:o.value,interfaces:()=>Q(t),fields:()=>M(t),astNode:e,extensionASTNodes:r})}case c.Kind.ENUM_TYPE_DEFINITION:{var a;const t=[e,...r];return new u.GraphQLEnumType({name:n,description:null===(a=e.description)||void 0===a?void 0:a.value,values:V(t),astNode:e,extensionASTNodes:r})}case c.Kind.UNION_TYPE_DEFINITION:{var s;const t=[e,...r];return new u.GraphQLUnionType({name:n,description:null===(s=e.description)||void 0===s?void 0:s.value,types:()=>q(t),astNode:e,extensionASTNodes:r})}case c.Kind.SCALAR_TYPE_DEFINITION:var l;return new u.GraphQLScalarType({name:n,description:null===(l=e.description)||void 0===l?void 0:l.value,specifiedByURL:w(e),astNode:e,extensionASTNodes:r});case c.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var p;const t=[e,...r];return new u.GraphQLInputObjectType({name:n,description:null===(p=e.description)||void 0===p?void 0:p.value,fields:()=>F(t),astNode:e,extensionASTNodes:r})}}}}const b=(0,a.keyMap)([...d.specifiedScalarTypes,...f.introspectionTypes],(e=>e.name));function E(e){const t=(0,v.getDirectiveValues)(p.GraphQLDeprecatedDirective,e);return null==t?void 0:t.reason}function w(e){const t=(0,v.getDirectiveValues)(p.GraphQLSpecifiedByDirective,e);return null==t?void 0:t.url}},3298:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DangerousChangeType=t.BreakingChangeType=void 0,t.findBreakingChanges=function(e,t){return d(e,t).filter((e=>e.type in r))},t.findDangerousChanges=function(e,t){return d(e,t).filter((e=>e.type in i))};var r,i,o=n(8002),a=n(7706),s=n(2863),c=n(3033),l=n(5003),u=n(2229),p=n(8115),f=n(6830);function d(e,t){return[...m(e,t),...h(e,t)]}function h(e,t){const n=[],i=S(e.getDirectives(),t.getDirectives());for(const e of i.removed)n.push({type:r.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(const[e,t]of i.persisted){const i=S(e.args,t.args);for(const t of i.added)(0,l.isRequiredArgument)(t)&&n.push({type:r.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${t.name} on directive ${e.name} was added.`});for(const t of i.removed)n.push({type:r.DIRECTIVE_ARG_REMOVED,description:`${t.name} was removed from ${e.name}.`});e.isRepeatable&&!t.isRepeatable&&n.push({type:r.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(const i of e.locations)t.locations.includes(i)||n.push({type:r.DIRECTIVE_LOCATION_REMOVED,description:`${i} was removed from ${e.name}.`})}return n}function m(e,t){const n=[],i=S(Object.values(e.getTypeMap()),Object.values(t.getTypeMap()));for(const e of i.removed)n.push({type:r.TYPE_REMOVED,description:(0,u.isSpecifiedScalarType)(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(const[e,t]of i.persisted)(0,l.isEnumType)(e)&&(0,l.isEnumType)(t)?n.push(...g(e,t)):(0,l.isUnionType)(e)&&(0,l.isUnionType)(t)?n.push(...y(e,t)):(0,l.isInputObjectType)(e)&&(0,l.isInputObjectType)(t)?n.push(...v(e,t)):(0,l.isObjectType)(e)&&(0,l.isObjectType)(t)||(0,l.isInterfaceType)(e)&&(0,l.isInterfaceType)(t)?n.push(...E(e,t),...b(e,t)):e.constructor!==t.constructor&&n.push({type:r.TYPE_CHANGED_KIND,description:`${e.name} changed from ${k(e)} to ${k(t)}.`});return n}function v(e,t){const n=[],o=S(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of o.added)(0,l.isRequiredInputField)(t)?n.push({type:r.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${t.name} on input type ${e.name} was added.`}):n.push({type:i.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${t.name} on input type ${e.name} was added.`});for(const t of o.removed)n.push({type:r.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,i]of o.persisted)_(t.type,i.type)||n.push({type:r.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(i.type)}.`});return n}function y(e,t){const n=[],o=S(e.getTypes(),t.getTypes());for(const t of o.added)n.push({type:i.TYPE_ADDED_TO_UNION,description:`${t.name} was added to union type ${e.name}.`});for(const t of o.removed)n.push({type:r.TYPE_REMOVED_FROM_UNION,description:`${t.name} was removed from union type ${e.name}.`});return n}function g(e,t){const n=[],o=S(e.getValues(),t.getValues());for(const t of o.added)n.push({type:i.VALUE_ADDED_TO_ENUM,description:`${t.name} was added to enum type ${e.name}.`});for(const t of o.removed)n.push({type:r.VALUE_REMOVED_FROM_ENUM,description:`${t.name} was removed from enum type ${e.name}.`});return n}function b(e,t){const n=[],o=S(e.getInterfaces(),t.getInterfaces());for(const t of o.added)n.push({type:i.IMPLEMENTED_INTERFACE_ADDED,description:`${t.name} added to interfaces implemented by ${e.name}.`});for(const t of o.removed)n.push({type:r.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${t.name}.`});return n}function E(e,t){const n=[],i=S(Object.values(e.getFields()),Object.values(t.getFields()));for(const t of i.removed)n.push({type:r.FIELD_REMOVED,description:`${e.name}.${t.name} was removed.`});for(const[t,o]of i.persisted)n.push(...w(e,t,o)),T(t.type,o.type)||n.push({type:r.FIELD_CHANGED_KIND,description:`${e.name}.${t.name} changed type from ${String(t.type)} to ${String(o.type)}.`});return n}function w(e,t,n){const o=[],a=S(t.args,n.args);for(const n of a.removed)o.push({type:r.ARG_REMOVED,description:`${e.name}.${t.name} arg ${n.name} was removed.`});for(const[n,s]of a.persisted)if(_(n.type,s.type)){if(void 0!==n.defaultValue)if(void 0===s.defaultValue)o.push({type:i.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} defaultValue was removed.`});else{const r=O(n.defaultValue,n.type),a=O(s.defaultValue,s.type);r!==a&&o.push({type:i.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${t.name} arg ${n.name} has changed defaultValue from ${r} to ${a}.`})}}else o.push({type:r.ARG_CHANGED_KIND,description:`${e.name}.${t.name} arg ${n.name} has changed type from ${String(n.type)} to ${String(s.type)}.`});for(const n of a.added)(0,l.isRequiredArgument)(n)?o.push({type:r.REQUIRED_ARG_ADDED,description:`A required arg ${n.name} on ${e.name}.${t.name} was added.`}):o.push({type:i.OPTIONAL_ARG_ADDED,description:`An optional arg ${n.name} on ${e.name}.${t.name} was added.`});return o}function T(e,t){return(0,l.isListType)(e)?(0,l.isListType)(t)&&T(e.ofType,t.ofType)||(0,l.isNonNullType)(t)&&T(e,t.ofType):(0,l.isNonNullType)(e)?(0,l.isNonNullType)(t)&&T(e.ofType,t.ofType):(0,l.isNamedType)(t)&&e.name===t.name||(0,l.isNonNullType)(t)&&T(e,t.ofType)}function _(e,t){return(0,l.isListType)(e)?(0,l.isListType)(t)&&_(e.ofType,t.ofType):(0,l.isNonNullType)(e)?(0,l.isNonNullType)(t)&&_(e.ofType,t.ofType)||!(0,l.isNonNullType)(t)&&_(e.ofType,t):(0,l.isNamedType)(t)&&e.name===t.name}function k(e){return(0,l.isScalarType)(e)?"a Scalar type":(0,l.isObjectType)(e)?"an Object type":(0,l.isInterfaceType)(e)?"an Interface type":(0,l.isUnionType)(e)?"a Union type":(0,l.isEnumType)(e)?"an Enum type":(0,l.isInputObjectType)(e)?"an Input type":void(0,a.invariant)(!1,"Unexpected type: "+(0,o.inspect)(e))}function O(e,t){const n=(0,p.astFromValue)(e,t);return null!=n||(0,a.invariant)(!1),(0,c.print)((0,f.sortValueNode)(n))}function S(e,t){const n=[],r=[],i=[],o=(0,s.keyMap)(e,(({name:e})=>e)),a=(0,s.keyMap)(t,(({name:e})=>e));for(const t of e){const e=a[t.name];void 0===e?r.push(t):i.push([t,e])}for(const e of t)void 0===o[e.name]&&n.push(e);return{added:n,persisted:i,removed:r}}t.BreakingChangeType=r,function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"}(r||(t.BreakingChangeType=r={})),t.DangerousChangeType=i,function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"}(i||(t.DangerousChangeType=i={}))},9363:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getIntrospectionQuery=function(e){const t={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},n=t.descriptions?"description":"",r=t.specifiedByUrl?"specifiedByURL":"",i=t.directiveIsRepeatable?"isRepeatable":"";function o(e){return t.inputValueDeprecation?e:""}return`\n query IntrospectionQuery {\n __schema {\n ${t.schemaDescription?n:""}\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ${n}\n ${i}\n locations\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ${n}\n ${r}\n fields(includeDeprecated: true) {\n name\n ${n}\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ${n}\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ${n}\n type { ...TypeRef }\n defaultValue\n ${o("isDeprecated")}\n ${o("deprecationReason")}\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n `}},9535:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOperationAST=function(e,t){let n=null;for(const o of e.definitions){var i;if(o.kind===r.Kind.OPERATION_DEFINITION)if(null==t){if(n)return null;n=o}else if((null===(i=o.name)||void 0===i?void 0:i.value)===t)return o}return n};var r=n(2828)},8678:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getOperationRootType=function(e,t){if("query"===t.operation){const n=e.getQueryType();if(!n)throw new r.GraphQLError("Schema does not define the required query root type.",{nodes:t});return n}if("mutation"===t.operation){const n=e.getMutationType();if(!n)throw new r.GraphQLError("Schema is not configured for mutations.",{nodes:t});return n}if("subscription"===t.operation){const n=e.getSubscriptionType();if(!n)throw new r.GraphQLError("Schema is not configured for subscriptions.",{nodes:t});return n}throw new r.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:t})};var r=n(5822)},9548:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BreakingChangeType",{enumerable:!0,get:function(){return _.BreakingChangeType}}),Object.defineProperty(t,"DangerousChangeType",{enumerable:!0,get:function(){return _.DangerousChangeType}}),Object.defineProperty(t,"TypeInfo",{enumerable:!0,get:function(){return v.TypeInfo}}),Object.defineProperty(t,"assertValidName",{enumerable:!0,get:function(){return T.assertValidName}}),Object.defineProperty(t,"astFromValue",{enumerable:!0,get:function(){return m.astFromValue}}),Object.defineProperty(t,"buildASTSchema",{enumerable:!0,get:function(){return c.buildASTSchema}}),Object.defineProperty(t,"buildClientSchema",{enumerable:!0,get:function(){return s.buildClientSchema}}),Object.defineProperty(t,"buildSchema",{enumerable:!0,get:function(){return c.buildSchema}}),Object.defineProperty(t,"coerceInputValue",{enumerable:!0,get:function(){return y.coerceInputValue}}),Object.defineProperty(t,"concatAST",{enumerable:!0,get:function(){return g.concatAST}}),Object.defineProperty(t,"doTypesOverlap",{enumerable:!0,get:function(){return w.doTypesOverlap}}),Object.defineProperty(t,"extendSchema",{enumerable:!0,get:function(){return l.extendSchema}}),Object.defineProperty(t,"findBreakingChanges",{enumerable:!0,get:function(){return _.findBreakingChanges}}),Object.defineProperty(t,"findDangerousChanges",{enumerable:!0,get:function(){return _.findDangerousChanges}}),Object.defineProperty(t,"getIntrospectionQuery",{enumerable:!0,get:function(){return r.getIntrospectionQuery}}),Object.defineProperty(t,"getOperationAST",{enumerable:!0,get:function(){return i.getOperationAST}}),Object.defineProperty(t,"getOperationRootType",{enumerable:!0,get:function(){return o.getOperationRootType}}),Object.defineProperty(t,"introspectionFromSchema",{enumerable:!0,get:function(){return a.introspectionFromSchema}}),Object.defineProperty(t,"isEqualType",{enumerable:!0,get:function(){return w.isEqualType}}),Object.defineProperty(t,"isTypeSubTypeOf",{enumerable:!0,get:function(){return w.isTypeSubTypeOf}}),Object.defineProperty(t,"isValidNameError",{enumerable:!0,get:function(){return T.isValidNameError}}),Object.defineProperty(t,"lexicographicSortSchema",{enumerable:!0,get:function(){return u.lexicographicSortSchema}}),Object.defineProperty(t,"printIntrospectionSchema",{enumerable:!0,get:function(){return p.printIntrospectionSchema}}),Object.defineProperty(t,"printSchema",{enumerable:!0,get:function(){return p.printSchema}}),Object.defineProperty(t,"printType",{enumerable:!0,get:function(){return p.printType}}),Object.defineProperty(t,"separateOperations",{enumerable:!0,get:function(){return b.separateOperations}}),Object.defineProperty(t,"stripIgnoredCharacters",{enumerable:!0,get:function(){return E.stripIgnoredCharacters}}),Object.defineProperty(t,"typeFromAST",{enumerable:!0,get:function(){return f.typeFromAST}}),Object.defineProperty(t,"valueFromAST",{enumerable:!0,get:function(){return d.valueFromAST}}),Object.defineProperty(t,"valueFromASTUntyped",{enumerable:!0,get:function(){return h.valueFromASTUntyped}}),Object.defineProperty(t,"visitWithTypeInfo",{enumerable:!0,get:function(){return v.visitWithTypeInfo}});var r=n(9363),i=n(9535),o=n(8678),a=n(8039),s=n(8686),c=n(2906),l=n(3242),u=n(8163),p=n(2821),f=n(5115),d=n(3770),h=n(7784),m=n(8115),v=n(6226),y=n(3679),g=n(6078),b=n(8243),E=n(2307),w=n(298),T=n(6526),_=n(3298)},8039:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.introspectionFromSchema=function(e,t){const n={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,...t},s=(0,i.parse)((0,a.getIntrospectionQuery)(n)),c=(0,o.executeSync)({schema:e,document:s});return!c.errors&&c.data||(0,r.invariant)(!1),c.data};var r=n(7706),i=n(8370),o=n(192),a=n(9363)},8163:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.lexicographicSortSchema=function(e){const t=e.toConfig(),n=(0,o.keyValMap)(f(t.types),(e=>e.name),(function(e){if((0,s.isScalarType)(e)||(0,l.isIntrospectionType)(e))return e;if((0,s.isObjectType)(e)){const t=e.toConfig();return new s.GraphQLObjectType({...t,interfaces:()=>g(t.interfaces),fields:()=>y(t.fields)})}if((0,s.isInterfaceType)(e)){const t=e.toConfig();return new s.GraphQLInterfaceType({...t,interfaces:()=>g(t.interfaces),fields:()=>y(t.fields)})}if((0,s.isUnionType)(e)){const t=e.toConfig();return new s.GraphQLUnionType({...t,types:()=>g(t.types)})}if((0,s.isEnumType)(e)){const t=e.toConfig();return new s.GraphQLEnumType({...t,values:p(t.values,(e=>e))})}if((0,s.isInputObjectType)(e)){const t=e.toConfig();return new s.GraphQLInputObjectType({...t,fields:()=>p(t.fields,(e=>({...e,type:a(e.type)})))})}(0,i.invariant)(!1,"Unexpected type: "+(0,r.inspect)(e))}));return new u.GraphQLSchema({...t,types:Object.values(n),directives:f(t.directives).map((function(e){const t=e.toConfig();return new c.GraphQLDirective({...t,locations:d(t.locations,(e=>e)),args:v(t.args)})})),query:m(t.query),mutation:m(t.mutation),subscription:m(t.subscription)});function a(e){return(0,s.isListType)(e)?new s.GraphQLList(a(e.ofType)):(0,s.isNonNullType)(e)?new s.GraphQLNonNull(a(e.ofType)):h(e)}function h(e){return n[e.name]}function m(e){return e&&h(e)}function v(e){return p(e,(e=>({...e,type:a(e.type)})))}function y(e){return p(e,(e=>({...e,type:a(e.type),args:e.args&&v(e.args)})))}function g(e){return f(e).map(h)}};var r=n(8002),i=n(7706),o=n(7154),a=n(5250),s=n(5003),c=n(7197),l=n(8155),u=n(6829);function p(e,t){const n=Object.create(null);for(const r of Object.keys(e).sort(a.naturalCompare))n[r]=t(e[r]);return n}function f(e){return d(e,(e=>e.name))}function d(e,t){return e.slice().sort(((e,n)=>{const r=t(e),i=t(n);return(0,a.naturalCompare)(r,i)}))}},2821:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printIntrospectionSchema=function(e){return h(e,l.isSpecifiedDirective,u.isIntrospectionType)},t.printSchema=function(e){return h(e,(e=>!(0,l.isSpecifiedDirective)(e)),d)},t.printType=v;var r=n(8002),i=n(7706),o=n(849),a=n(2828),s=n(3033),c=n(5003),l=n(7197),u=n(8155),p=n(2229),f=n(8115);function d(e){return!(0,p.isSpecifiedScalarType)(e)&&!(0,u.isIntrospectionType)(e)}function h(e,t,n){const r=e.getDirectives().filter(t),i=Object.values(e.getTypeMap()).filter(n);return[m(e),...r.map((e=>function(e){return _(e)+"directive @"+e.name+E(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...i.map((e=>v(e)))].filter(Boolean).join("\n\n")}function m(e){if(null==e.description&&function(e){const t=e.getQueryType();if(t&&"Query"!==t.name)return!1;const n=e.getMutationType();if(n&&"Mutation"!==n.name)return!1;const r=e.getSubscriptionType();return!r||"Subscription"===r.name}(e))return;const t=[],n=e.getQueryType();n&&t.push(` query: ${n.name}`);const r=e.getMutationType();r&&t.push(` mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&t.push(` subscription: ${i.name}`),_(e)+`schema {\n${t.join("\n")}\n}`}function v(e){return(0,c.isScalarType)(e)?function(e){return _(e)+`scalar ${e.name}`+(null==(t=e).specifiedByURL?"":` @specifiedBy(url: ${(0,s.print)({kind:a.Kind.STRING,value:t.specifiedByURL})})`);var t}(e):(0,c.isObjectType)(e)?function(e){return _(e)+`type ${e.name}`+y(e)+g(e)}(e):(0,c.isInterfaceType)(e)?function(e){return _(e)+`interface ${e.name}`+y(e)+g(e)}(e):(0,c.isUnionType)(e)?function(e){const t=e.getTypes(),n=t.length?" = "+t.join(" | "):"";return _(e)+"union "+e.name+n}(e):(0,c.isEnumType)(e)?function(e){const t=e.getValues().map(((e,t)=>_(e," ",!t)+" "+e.name+T(e.deprecationReason)));return _(e)+`enum ${e.name}`+b(t)}(e):(0,c.isInputObjectType)(e)?function(e){const t=Object.values(e.getFields()).map(((e,t)=>_(e," ",!t)+" "+w(e)));return _(e)+`input ${e.name}`+b(t)}(e):void(0,i.invariant)(!1,"Unexpected type: "+(0,r.inspect)(e))}function y(e){const t=e.getInterfaces();return t.length?" implements "+t.map((e=>e.name)).join(" & "):""}function g(e){return b(Object.values(e.getFields()).map(((e,t)=>_(e," ",!t)+" "+e.name+E(e.args," ")+": "+String(e.type)+T(e.deprecationReason))))}function b(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function E(e,t=""){return 0===e.length?"":e.every((e=>!e.description))?"("+e.map(w).join(", ")+")":"(\n"+e.map(((e,n)=>_(e," "+t,!n)+" "+t+w(e))).join("\n")+"\n"+t+")"}function w(e){const t=(0,f.astFromValue)(e.defaultValue,e.type);let n=e.name+": "+String(e.type);return t&&(n+=` = ${(0,s.print)(t)}`),n+T(e.deprecationReason)}function T(e){return null==e?"":e!==l.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,s.print)({kind:a.Kind.STRING,value:e})})`:" @deprecated"}function _(e,t="",n=!0){const{description:r}=e;return null==r?"":(t&&!n?"\n"+t:t)+(0,s.print)({kind:a.Kind.STRING,value:r,block:(0,o.isPrintableAsBlockString)(r)}).replace(/\n/g,"\n"+t)+"\n"}},8243:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.separateOperations=function(e){const t=[],n=Object.create(null);for(const i of e.definitions)switch(i.kind){case r.Kind.OPERATION_DEFINITION:t.push(i);break;case r.Kind.FRAGMENT_DEFINITION:n[i.name.value]=a(i.selectionSet)}const i=Object.create(null);for(const s of t){const t=new Set;for(const e of a(s.selectionSet))o(t,n,e);i[s.name?s.name.value:""]={kind:r.Kind.DOCUMENT,definitions:e.definitions.filter((e=>e===s||e.kind===r.Kind.FRAGMENT_DEFINITION&&t.has(e.name.value)))}}return i};var r=n(2828),i=n(285);function o(e,t,n){if(!e.has(n)){e.add(n);const r=t[n];if(void 0!==r)for(const n of r)o(e,t,n)}}function a(e){const t=[];return(0,i.visit)(e,{FragmentSpread(e){t.push(e.name.value)}}),t}},6830:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sortValueNode=function e(t){switch(t.kind){case i.Kind.OBJECT:return{...t,fields:(n=t.fields,n.map((t=>({...t,value:e(t.value)}))).sort(((e,t)=>(0,r.naturalCompare)(e.name.value,t.name.value))))};case i.Kind.LIST:return{...t,values:t.values.map(e)};case i.Kind.INT:case i.Kind.FLOAT:case i.Kind.STRING:case i.Kind.BOOLEAN:case i.Kind.NULL:case i.Kind.ENUM:case i.Kind.VARIABLE:return t}var n};var r=n(5250),i=n(2828)},2307:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stripIgnoredCharacters=function(e){const t=(0,o.isSource)(e)?e:new o.Source(e),n=t.body,s=new i.Lexer(t);let c="",l=!1;for(;s.advance().kind!==a.TokenKind.EOF;){const e=s.token,t=e.kind,o=!(0,i.isPunctuatorTokenKind)(e.kind);l&&(o||e.kind===a.TokenKind.SPREAD)&&(c+=" ");const u=n.slice(e.start,e.end);t===a.TokenKind.BLOCK_STRING?c+=(0,r.printBlockString)(e.value,{minimize:!0}):c+=u,l=o}return c};var r=n(849),i=n(4274),o=n(2412),a=n(3175)},298:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.doTypesOverlap=function(e,t,n){return t===n||((0,r.isAbstractType)(t)?(0,r.isAbstractType)(n)?e.getPossibleTypes(t).some((t=>e.isSubType(n,t))):e.isSubType(t,n):!!(0,r.isAbstractType)(n)&&e.isSubType(n,t))},t.isEqualType=function e(t,n){return t===n||((0,r.isNonNullType)(t)&&(0,r.isNonNullType)(n)||!(!(0,r.isListType)(t)||!(0,r.isListType)(n)))&&e(t.ofType,n.ofType)},t.isTypeSubTypeOf=function e(t,n,i){return n===i||((0,r.isNonNullType)(i)?!!(0,r.isNonNullType)(n)&&e(t,n.ofType,i.ofType):(0,r.isNonNullType)(n)?e(t,n.ofType,i):(0,r.isListType)(i)?!!(0,r.isListType)(n)&&e(t,n.ofType,i.ofType):!(0,r.isListType)(n)&&((0,r.isAbstractType)(i)&&((0,r.isInterfaceType)(n)||(0,r.isObjectType)(n))&&t.isSubType(i,n)))};var r=n(5003)},5115:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.typeFromAST=function e(t,n){switch(n.kind){case r.Kind.LIST_TYPE:{const r=e(t,n.type);return r&&new i.GraphQLList(r)}case r.Kind.NON_NULL_TYPE:{const r=e(t,n.type);return r&&new i.GraphQLNonNull(r)}case r.Kind.NAMED_TYPE:return t.getType(n.name.value)}};var r=n(2828),i=n(5003)},3770:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.valueFromAST=function e(t,n,l){if(t){if(t.kind===a.Kind.VARIABLE){const e=t.name.value;if(null==l||void 0===l[e])return;const r=l[e];if(null===r&&(0,s.isNonNullType)(n))return;return r}if((0,s.isNonNullType)(n)){if(t.kind===a.Kind.NULL)return;return e(t,n.ofType,l)}if(t.kind===a.Kind.NULL)return null;if((0,s.isListType)(n)){const r=n.ofType;if(t.kind===a.Kind.LIST){const n=[];for(const i of t.values)if(c(i,l)){if((0,s.isNonNullType)(r))return;n.push(null)}else{const t=e(i,r,l);if(void 0===t)return;n.push(t)}return n}const i=e(t,r,l);if(void 0===i)return;return[i]}if((0,s.isInputObjectType)(n)){if(t.kind!==a.Kind.OBJECT)return;const r=Object.create(null),i=(0,o.keyMap)(t.fields,(e=>e.name.value));for(const t of Object.values(n.getFields())){const n=i[t.name];if(!n||c(n.value,l)){if(void 0!==t.defaultValue)r[t.name]=t.defaultValue;else if((0,s.isNonNullType)(t.type))return;continue}const o=e(n.value,t.type,l);if(void 0===o)return;r[t.name]=o}return r}if((0,s.isLeafType)(n)){let e;try{e=n.parseLiteral(t,l)}catch(e){return}if(void 0===e)return;return e}(0,i.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(n))}};var r=n(8002),i=n(7706),o=n(2863),a=n(2828),s=n(5003);function c(e,t){return e.kind===a.Kind.VARIABLE&&(null==t||void 0===t[e.name.value])}},7784:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.valueFromASTUntyped=function e(t,n){switch(t.kind){case i.Kind.NULL:return null;case i.Kind.INT:return parseInt(t.value,10);case i.Kind.FLOAT:return parseFloat(t.value);case i.Kind.STRING:case i.Kind.ENUM:case i.Kind.BOOLEAN:return t.value;case i.Kind.LIST:return t.values.map((t=>e(t,n)));case i.Kind.OBJECT:return(0,r.keyValMap)(t.fields,(e=>e.name.value),(t=>e(t.value,n)));case i.Kind.VARIABLE:return null==n?void 0:n[t.name.value]}};var r=n(7154),i=n(2828)},3955:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValidationContext=t.SDLValidationContext=t.ASTValidationContext=void 0;var r=n(2828),i=n(285),o=n(6226);class a{constructor(e,t){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=t}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let t;if(this._fragments)t=this._fragments;else{t=Object.create(null);for(const e of this.getDocument().definitions)e.kind===r.Kind.FRAGMENT_DEFINITION&&(t[e.name.value]=e);this._fragments=t}return t[e]}getFragmentSpreads(e){let t=this._fragmentSpreads.get(e);if(!t){t=[];const n=[e];let i;for(;i=n.pop();)for(const e of i.selections)e.kind===r.Kind.FRAGMENT_SPREAD?t.push(e):e.selectionSet&&n.push(e.selectionSet);this._fragmentSpreads.set(e,t)}return t}getRecursivelyReferencedFragments(e){let t=this._recursivelyReferencedFragments.get(e);if(!t){t=[];const n=Object.create(null),r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!0!==n[i]){n[i]=!0;const e=this.getFragment(i);e&&(t.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,t)}return t}}t.ASTValidationContext=a;class s extends a{constructor(e,t,n){super(e,n),this._schema=t}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}t.SDLValidationContext=s;class c extends a{constructor(e,t,n,r){super(t,r),this._schema=e,this._typeInfo=n,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let t=this._variableUsages.get(e);if(!t){const n=[],r=new o.TypeInfo(this._schema);(0,i.visit)(e,(0,o.visitWithTypeInfo)(r,{VariableDefinition:()=>!1,Variable(e){n.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),t=n,this._variableUsages.set(e,t)}return t}getRecursiveVariableUsages(e){let t=this._recursiveVariableUsages.get(e);if(!t){t=this.getVariableUsages(e);for(const n of this.getRecursivelyReferencedFragments(e))t=t.concat(this.getVariableUsages(n));this._recursiveVariableUsages.set(e,t)}return t}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}t.ValidationContext=c},1122:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return a.ExecutableDefinitionsRule}}),Object.defineProperty(t,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return s.FieldsOnCorrectTypeRule}}),Object.defineProperty(t,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return c.FragmentsOnCompositeTypesRule}}),Object.defineProperty(t,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return l.KnownArgumentNamesRule}}),Object.defineProperty(t,"KnownDirectivesRule",{enumerable:!0,get:function(){return u.KnownDirectivesRule}}),Object.defineProperty(t,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return p.KnownFragmentNamesRule}}),Object.defineProperty(t,"KnownTypeNamesRule",{enumerable:!0,get:function(){return f.KnownTypeNamesRule}}),Object.defineProperty(t,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return d.LoneAnonymousOperationRule}}),Object.defineProperty(t,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return D.LoneSchemaDefinitionRule}}),Object.defineProperty(t,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return Q.NoDeprecatedCustomRule}}),Object.defineProperty(t,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return h.NoFragmentCyclesRule}}),Object.defineProperty(t,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return q.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(t,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return m.NoUndefinedVariablesRule}}),Object.defineProperty(t,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return v.NoUnusedFragmentsRule}}),Object.defineProperty(t,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return y.NoUnusedVariablesRule}}),Object.defineProperty(t,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return g.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(t,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return b.PossibleFragmentSpreadsRule}}),Object.defineProperty(t,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return V.PossibleTypeExtensionsRule}}),Object.defineProperty(t,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return E.ProvidedRequiredArgumentsRule}}),Object.defineProperty(t,"ScalarLeafsRule",{enumerable:!0,get:function(){return w.ScalarLeafsRule}}),Object.defineProperty(t,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return T.SingleFieldSubscriptionsRule}}),Object.defineProperty(t,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return j.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(t,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return _.UniqueArgumentNamesRule}}),Object.defineProperty(t,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return F.UniqueDirectiveNamesRule}}),Object.defineProperty(t,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return k.UniqueDirectivesPerLocationRule}}),Object.defineProperty(t,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return R.UniqueEnumValueNamesRule}}),Object.defineProperty(t,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return M.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(t,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return O.UniqueFragmentNamesRule}}),Object.defineProperty(t,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return S.UniqueInputFieldNamesRule}}),Object.defineProperty(t,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return x.UniqueOperationNamesRule}}),Object.defineProperty(t,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return I.UniqueOperationTypesRule}}),Object.defineProperty(t,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return P.UniqueTypeNamesRule}}),Object.defineProperty(t,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return C.UniqueVariableNamesRule}}),Object.defineProperty(t,"ValidationContext",{enumerable:!0,get:function(){return i.ValidationContext}}),Object.defineProperty(t,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return N.ValuesOfCorrectTypeRule}}),Object.defineProperty(t,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return A.VariablesAreInputTypesRule}}),Object.defineProperty(t,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return L.VariablesInAllowedPositionRule}}),Object.defineProperty(t,"specifiedRules",{enumerable:!0,get:function(){return o.specifiedRules}}),Object.defineProperty(t,"validate",{enumerable:!0,get:function(){return r.validate}});var r=n(9504),i=n(3955),o=n(4710),a=n(5285),s=n(9426),c=n(3558),l=n(9989),u=n(2826),p=n(1843),f=n(5961),d=n(870),h=n(658),m=n(7459),v=n(7317),y=n(8769),g=n(4331),b=n(5904),E=n(4312),w=n(7168),T=n(4666),_=n(4986),k=n(3576),O=n(5883),S=n(4313),x=n(2139),C=n(4243),N=n(6869),A=n(4942),L=n(8034),D=n(3411),I=n(856),P=n(1686),R=n(6400),M=n(4046),j=n(3878),F=n(6753),V=n(5715),Q=n(2860),q=n(2276)},5285:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ExecutableDefinitionsRule=function(e){return{Document(t){for(const n of t.definitions)if(!(0,o.isExecutableDefinitionNode)(n)){const t=n.kind===i.Kind.SCHEMA_DEFINITION||n.kind===i.Kind.SCHEMA_EXTENSION?"schema":'"'+n.name.value+'"';e.reportError(new r.GraphQLError(`The ${t} definition is not executable.`,{nodes:n}))}return!1}}};var r=n(5822),i=n(2828),o=n(1352)},9426:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FieldsOnCorrectTypeRule=function(e){return{Field(t){const n=e.getParentType();if(n&&!e.getFieldDef()){const c=e.getSchema(),l=t.name.value;let u=(0,r.didYouMean)("to use an inline fragment on",function(e,t,n){if(!(0,s.isAbstractType)(t))return[];const r=new Set,o=Object.create(null);for(const i of e.getPossibleTypes(t))if(i.getFields()[n]){r.add(i),o[i.name]=1;for(const e of i.getInterfaces()){var a;e.getFields()[n]&&(r.add(e),o[e.name]=(null!==(a=o[e.name])&&void 0!==a?a:0)+1)}}return[...r].sort(((t,n)=>{const r=o[n.name]-o[t.name];return 0!==r?r:(0,s.isInterfaceType)(t)&&e.isSubType(t,n)?-1:(0,s.isInterfaceType)(n)&&e.isSubType(n,t)?1:(0,i.naturalCompare)(t.name,n.name)})).map((e=>e.name))}(c,n,l));""===u&&(u=(0,r.didYouMean)(function(e,t){if((0,s.isObjectType)(e)||(0,s.isInterfaceType)(e)){const n=Object.keys(e.getFields());return(0,o.suggestionList)(t,n)}return[]}(n,l))),e.reportError(new a.GraphQLError(`Cannot query field "${l}" on type "${n.name}".`+u,{nodes:t}))}}}};var r=n(166),i=n(5250),o=n(8070),a=n(5822),s=n(5003)},3558:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FragmentsOnCompositeTypesRule=function(e){return{InlineFragment(t){const n=t.typeCondition;if(n){const t=(0,a.typeFromAST)(e.getSchema(),n);if(t&&!(0,o.isCompositeType)(t)){const t=(0,i.print)(n);e.reportError(new r.GraphQLError(`Fragment cannot condition on non composite type "${t}".`,{nodes:n}))}}},FragmentDefinition(t){const n=(0,a.typeFromAST)(e.getSchema(),t.typeCondition);if(n&&!(0,o.isCompositeType)(n)){const n=(0,i.print)(t.typeCondition);e.reportError(new r.GraphQLError(`Fragment "${t.name.value}" cannot condition on non composite type "${n}".`,{nodes:t.typeCondition}))}}}};var r=n(5822),i=n(3033),o=n(5003),a=n(5115)},9989:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KnownArgumentNamesOnDirectivesRule=c,t.KnownArgumentNamesRule=function(e){return{...c(e),Argument(t){const n=e.getArgument(),a=e.getFieldDef(),s=e.getParentType();if(!n&&a&&s){const n=t.name.value,c=a.args.map((e=>e.name)),l=(0,i.suggestionList)(n,c);e.reportError(new o.GraphQLError(`Unknown argument "${n}" on field "${s.name}.${a.name}".`+(0,r.didYouMean)(l),{nodes:t}))}}}};var r=n(166),i=n(8070),o=n(5822),a=n(2828),s=n(7197);function c(e){const t=Object.create(null),n=e.getSchema(),c=n?n.getDirectives():s.specifiedDirectives;for(const e of c)t[e.name]=e.args.map((e=>e.name));const l=e.getDocument().definitions;for(const e of l)if(e.kind===a.Kind.DIRECTIVE_DEFINITION){var u;const n=null!==(u=e.arguments)&&void 0!==u?u:[];t[e.name.value]=n.map((e=>e.name.value))}return{Directive(n){const a=n.name.value,s=t[a];if(n.arguments&&s)for(const t of n.arguments){const n=t.name.value;if(!s.includes(n)){const c=(0,i.suggestionList)(n,s);e.reportError(new o.GraphQLError(`Unknown argument "${n}" on directive "@${a}".`+(0,r.didYouMean)(c),{nodes:t}))}}return!1}}}},2826:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KnownDirectivesRule=function(e){const t=Object.create(null),n=e.getSchema(),u=n?n.getDirectives():l.specifiedDirectives;for(const e of u)t[e.name]=e.locations;const p=e.getDocument().definitions;for(const e of p)e.kind===c.Kind.DIRECTIVE_DEFINITION&&(t[e.name.value]=e.locations.map((e=>e.value)));return{Directive(n,l,u,p,f){const d=n.name.value,h=t[d];if(!h)return void e.reportError(new o.GraphQLError(`Unknown directive "@${d}".`,{nodes:n}));const m=function(e){const t=e[e.length-1];switch("kind"in t||(0,i.invariant)(!1),t.kind){case c.Kind.OPERATION_DEFINITION:return function(e){switch(e){case a.OperationTypeNode.QUERY:return s.DirectiveLocation.QUERY;case a.OperationTypeNode.MUTATION:return s.DirectiveLocation.MUTATION;case a.OperationTypeNode.SUBSCRIPTION:return s.DirectiveLocation.SUBSCRIPTION}}(t.operation);case c.Kind.FIELD:return s.DirectiveLocation.FIELD;case c.Kind.FRAGMENT_SPREAD:return s.DirectiveLocation.FRAGMENT_SPREAD;case c.Kind.INLINE_FRAGMENT:return s.DirectiveLocation.INLINE_FRAGMENT;case c.Kind.FRAGMENT_DEFINITION:return s.DirectiveLocation.FRAGMENT_DEFINITION;case c.Kind.VARIABLE_DEFINITION:return s.DirectiveLocation.VARIABLE_DEFINITION;case c.Kind.SCHEMA_DEFINITION:case c.Kind.SCHEMA_EXTENSION:return s.DirectiveLocation.SCHEMA;case c.Kind.SCALAR_TYPE_DEFINITION:case c.Kind.SCALAR_TYPE_EXTENSION:return s.DirectiveLocation.SCALAR;case c.Kind.OBJECT_TYPE_DEFINITION:case c.Kind.OBJECT_TYPE_EXTENSION:return s.DirectiveLocation.OBJECT;case c.Kind.FIELD_DEFINITION:return s.DirectiveLocation.FIELD_DEFINITION;case c.Kind.INTERFACE_TYPE_DEFINITION:case c.Kind.INTERFACE_TYPE_EXTENSION:return s.DirectiveLocation.INTERFACE;case c.Kind.UNION_TYPE_DEFINITION:case c.Kind.UNION_TYPE_EXTENSION:return s.DirectiveLocation.UNION;case c.Kind.ENUM_TYPE_DEFINITION:case c.Kind.ENUM_TYPE_EXTENSION:return s.DirectiveLocation.ENUM;case c.Kind.ENUM_VALUE_DEFINITION:return s.DirectiveLocation.ENUM_VALUE;case c.Kind.INPUT_OBJECT_TYPE_DEFINITION:case c.Kind.INPUT_OBJECT_TYPE_EXTENSION:return s.DirectiveLocation.INPUT_OBJECT;case c.Kind.INPUT_VALUE_DEFINITION:{const t=e[e.length-3];return"kind"in t||(0,i.invariant)(!1),t.kind===c.Kind.INPUT_OBJECT_TYPE_DEFINITION?s.DirectiveLocation.INPUT_FIELD_DEFINITION:s.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,i.invariant)(!1,"Unexpected kind: "+(0,r.inspect)(t.kind))}}(f);m&&!h.includes(m)&&e.reportError(new o.GraphQLError(`Directive "@${d}" may not be used on ${m}.`,{nodes:n}))}}};var r=n(8002),i=n(7706),o=n(5822),a=n(1807),s=n(8333),c=n(2828),l=n(7197)},1843:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KnownFragmentNamesRule=function(e){return{FragmentSpread(t){const n=t.name.value;e.getFragment(n)||e.reportError(new r.GraphQLError(`Unknown fragment "${n}".`,{nodes:t.name}))}}};var r=n(5822)},5961:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KnownTypeNamesRule=function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),s=Object.create(null);for(const t of e.getDocument().definitions)(0,a.isTypeDefinitionNode)(t)&&(s[t.name.value]=!0);const l=[...Object.keys(n),...Object.keys(s)];return{NamedType(t,u,p,f,d){const h=t.name.value;if(!n[h]&&!s[h]){var m;const n=null!==(m=d[2])&&void 0!==m?m:p,s=null!=n&&"kind"in(v=n)&&((0,a.isTypeSystemDefinitionNode)(v)||(0,a.isTypeSystemExtensionNode)(v));if(s&&c.includes(h))return;const u=(0,i.suggestionList)(h,s?c.concat(l):l);e.reportError(new o.GraphQLError(`Unknown type "${h}".`+(0,r.didYouMean)(u),{nodes:t}))}var v}}};var r=n(166),i=n(8070),o=n(5822),a=n(1352),s=n(8155);const c=[...n(2229).specifiedScalarTypes,...s.introspectionTypes].map((e=>e.name))},870:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoneAnonymousOperationRule=function(e){let t=0;return{Document(e){t=e.definitions.filter((e=>e.kind===i.Kind.OPERATION_DEFINITION)).length},OperationDefinition(n){!n.name&&t>1&&e.reportError(new r.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:n}))}}};var r=n(5822),i=n(2828)},3411:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LoneSchemaDefinitionRule=function(e){var t,n,i;const o=e.getSchema(),a=null!==(t=null!==(n=null!==(i=null==o?void 0:o.astNode)&&void 0!==i?i:null==o?void 0:o.getQueryType())&&void 0!==n?n:null==o?void 0:o.getMutationType())&&void 0!==t?t:null==o?void 0:o.getSubscriptionType();let s=0;return{SchemaDefinition(t){a?e.reportError(new r.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:t})):(s>0&&e.reportError(new r.GraphQLError("Must provide only one schema definition.",{nodes:t})),++s)}}};var r=n(5822)},658:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoFragmentCyclesRule=function(e){const t=Object.create(null),n=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(o(e),!1)};function o(a){if(t[a.name.value])return;const s=a.name.value;t[s]=!0;const c=e.getFragmentSpreads(a.selectionSet);if(0!==c.length){i[s]=n.length;for(const t of c){const a=t.name.value,s=i[a];if(n.push(t),void 0===s){const t=e.getFragment(a);t&&o(t)}else{const t=n.slice(s),i=t.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new r.GraphQLError(`Cannot spread fragment "${a}" within itself`+(""!==i?` via ${i}.`:"."),{nodes:t}))}n.pop()}i[s]=void 0}}};var r=n(5822)},7459:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoUndefinedVariablesRule=function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const i=e.getRecursiveVariableUsages(n);for(const{node:o}of i){const i=o.name.value;!0!==t[i]&&e.reportError(new r.GraphQLError(n.name?`Variable "$${i}" is not defined by operation "${n.name.value}".`:`Variable "$${i}" is not defined.`,{nodes:[o,n]}))}}},VariableDefinition(e){t[e.variable.name.value]=!0}}};var r=n(5822)},7317:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoUnusedFragmentsRule=function(e){const t=[],n=[];return{OperationDefinition:e=>(t.push(e),!1),FragmentDefinition:e=>(n.push(e),!1),Document:{leave(){const i=Object.create(null);for(const n of t)for(const t of e.getRecursivelyReferencedFragments(n))i[t.name.value]=!0;for(const t of n){const n=t.name.value;!0!==i[n]&&e.reportError(new r.GraphQLError(`Fragment "${n}" is never used.`,{nodes:t}))}}}}};var r=n(5822)},8769:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoUnusedVariablesRule=function(e){let t=[];return{OperationDefinition:{enter(){t=[]},leave(n){const i=Object.create(null),o=e.getRecursiveVariableUsages(n);for(const{node:e}of o)i[e.name.value]=!0;for(const o of t){const t=o.variable.name.value;!0!==i[t]&&e.reportError(new r.GraphQLError(n.name?`Variable "$${t}" is never used in operation "${n.name.value}".`:`Variable "$${t}" is never used.`,{nodes:o}))}}},VariableDefinition(e){t.push(e)}}};var r=n(5822)},4331:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.OverlappingFieldsCanBeMergedRule=function(e){const t=new E,n=new Map;return{SelectionSet(r){const o=function(e,t,n,r,i){const o=[],[a,s]=y(e,t,r,i);if(function(e,t,n,r,i){for(const[o,a]of Object.entries(i))if(a.length>1)for(let i=0;i`subfields "${e}" conflict because `+u(t))).join(" and "):e}function p(e,t,n,r,i,o,a){const s=e.getFragment(a);if(!s)return;const[c,l]=g(e,n,s);if(o!==c){d(e,t,n,r,i,o,c);for(const s of l)r.has(s,a,i)||(r.add(s,a,i),p(e,t,n,r,i,o,s))}}function f(e,t,n,r,i,o,a){if(o===a)return;if(r.has(o,a,i))return;r.add(o,a,i);const s=e.getFragment(o),c=e.getFragment(a);if(!s||!c)return;const[l,u]=g(e,n,s),[p,h]=g(e,n,c);d(e,t,n,r,i,l,p);for(const a of h)f(e,t,n,r,i,o,a);for(const o of u)f(e,t,n,r,i,o,a)}function d(e,t,n,r,i,o,a){for(const[s,c]of Object.entries(o)){const o=a[s];if(o)for(const a of c)for(const c of o){const o=h(e,n,r,i,s,a,c);o&&t.push(o)}}}function h(e,t,n,i,o,a,c){const[l,u,h]=a,[g,b,E]=c,w=i||l!==g&&(0,s.isObjectType)(l)&&(0,s.isObjectType)(g);if(!w){const e=u.name.value,t=b.name.value;if(e!==t)return[[o,`"${e}" and "${t}" are different fields`],[u],[b]];if(!function(e,t){const n=e.arguments,r=t.arguments;if(void 0===n||0===n.length)return void 0===r||0===r.length;if(void 0===r||0===r.length)return!1;if(n.length!==r.length)return!1;const i=new Map(r.map((({name:e,value:t})=>[e.value,t])));return n.every((e=>{const t=e.value,n=i.get(e.name.value);return void 0!==n&&m(t)===m(n)}))}(u,b))return[[o,"they have differing arguments"],[u],[b]]}const T=null==h?void 0:h.type,_=null==E?void 0:E.type;if(T&&_&&v(T,_))return[[o,`they return conflicting types "${(0,r.inspect)(T)}" and "${(0,r.inspect)(_)}"`],[u],[b]];const k=u.selectionSet,O=b.selectionSet;if(k&&O){const r=function(e,t,n,r,i,o,a,s){const c=[],[l,u]=y(e,t,i,o),[h,m]=y(e,t,a,s);d(e,c,t,n,r,l,h);for(const i of m)p(e,c,t,n,r,l,i);for(const i of u)p(e,c,t,n,r,h,i);for(const i of u)for(const o of m)f(e,c,t,n,r,i,o);return c}(e,t,n,w,(0,s.getNamedType)(T),k,(0,s.getNamedType)(_),O);return function(e,t,n,r){if(e.length>0)return[[t,e.map((([e])=>e))],[n,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,o,u,b)}}function m(e){return(0,a.print)((0,c.sortValueNode)(e))}function v(e,t){return(0,s.isListType)(e)?!(0,s.isListType)(t)||v(e.ofType,t.ofType):!!(0,s.isListType)(t)||((0,s.isNonNullType)(e)?!(0,s.isNonNullType)(t)||v(e.ofType,t.ofType):!!(0,s.isNonNullType)(t)||!(!(0,s.isLeafType)(e)&&!(0,s.isLeafType)(t))&&e!==t)}function y(e,t,n,r){const i=t.get(r);if(i)return i;const o=Object.create(null),a=Object.create(null);b(e,n,r,o,a);const s=[o,Object.keys(a)];return t.set(r,s),s}function g(e,t,n){const r=t.get(n.selectionSet);if(r)return r;const i=(0,l.typeFromAST)(e.getSchema(),n.typeCondition);return y(e,t,i,n.selectionSet)}function b(e,t,n,r,i){for(const a of n.selections)switch(a.kind){case o.Kind.FIELD:{const e=a.name.value;let n;((0,s.isObjectType)(t)||(0,s.isInterfaceType)(t))&&(n=t.getFields()[e]);const i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([t,a,n]);break}case o.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case o.Kind.INLINE_FRAGMENT:{const n=a.typeCondition,o=n?(0,l.typeFromAST)(e.getSchema(),n):t;b(e,o,a.selectionSet,r,i);break}}}class E{constructor(){this._data=new Map}has(e,t,n){var r;const[i,o]=ee.name.value)));for(const n of i.args)if(!a.has(n.name)&&(0,c.isRequiredArgument)(n)){const a=(0,r.inspect)(n.type);e.reportError(new o.GraphQLError(`Field "${i.name}" argument "${n.name}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}};var r=n(8002),i=n(2863),o=n(5822),a=n(2828),s=n(3033),c=n(5003),l=n(7197);function u(e){var t;const n=Object.create(null),u=e.getSchema(),f=null!==(t=null==u?void 0:u.getDirectives())&&void 0!==t?t:l.specifiedDirectives;for(const e of f)n[e.name]=(0,i.keyMap)(e.args.filter(c.isRequiredArgument),(e=>e.name));const d=e.getDocument().definitions;for(const e of d)if(e.kind===a.Kind.DIRECTIVE_DEFINITION){var h;const t=null!==(h=e.arguments)&&void 0!==h?h:[];n[e.name.value]=(0,i.keyMap)(t.filter(p),(e=>e.name.value))}return{Directive:{leave(t){const i=t.name.value,a=n[i];if(a){var l;const n=null!==(l=t.arguments)&&void 0!==l?l:[],u=new Set(n.map((e=>e.name.value)));for(const[n,l]of Object.entries(a))if(!u.has(n)){const a=(0,c.isType)(l.type)?(0,r.inspect)(l.type):(0,s.print)(l.type);e.reportError(new o.GraphQLError(`Directive "@${i}" argument "${n}" of type "${a}" is required, but it was not provided.`,{nodes:t}))}}}}}}function p(e){return e.type.kind===a.Kind.NON_NULL_TYPE&&null==e.defaultValue}},7168:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScalarLeafsRule=function(e){return{Field(t){const n=e.getType(),a=t.selectionSet;if(n)if((0,o.isLeafType)((0,o.getNamedType)(n))){if(a){const o=t.name.value,s=(0,r.inspect)(n);e.reportError(new i.GraphQLError(`Field "${o}" must not have a selection since type "${s}" has no subfields.`,{nodes:a}))}}else if(!a){const o=t.name.value,a=(0,r.inspect)(n);e.reportError(new i.GraphQLError(`Field "${o}" of type "${a}" must have a selection of subfields. Did you mean "${o} { ... }"?`,{nodes:t}))}}}};var r=n(8002),i=n(5822),o=n(5003)},4666:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SingleFieldSubscriptionsRule=function(e){return{OperationDefinition(t){if("subscription"===t.operation){const n=e.getSchema(),a=n.getSubscriptionType();if(a){const s=t.name?t.name.value:null,c=Object.create(null),l=e.getDocument(),u=Object.create(null);for(const e of l.definitions)e.kind===i.Kind.FRAGMENT_DEFINITION&&(u[e.name.value]=e);const p=(0,o.collectFields)(n,u,c,a,t.selectionSet);if(p.size>1){const t=[...p.values()].slice(1).flat();e.reportError(new r.GraphQLError(null!=s?`Subscription "${s}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:t}))}for(const t of p.values())t[0].name.value.startsWith("__")&&e.reportError(new r.GraphQLError(null!=s?`Subscription "${s}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:t}))}}}}};var r=n(5822),i=n(2828),o=n(8950)},3878:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueArgumentDefinitionNamesRule=function(e){return{DirectiveDefinition(e){var t;const r=null!==(t=e.arguments)&&void 0!==t?t:[];return n(`@${e.name.value}`,r)},InterfaceTypeDefinition:t,InterfaceTypeExtension:t,ObjectTypeDefinition:t,ObjectTypeExtension:t};function t(e){var t;const r=e.name.value,i=null!==(t=e.fields)&&void 0!==t?t:[];for(const e of i){var o;n(`${r}.${e.name.value}`,null!==(o=e.arguments)&&void 0!==o?o:[])}return!1}function n(t,n){const o=(0,r.groupBy)(n,(e=>e.name.value));for(const[n,r]of o)r.length>1&&e.reportError(new i.GraphQLError(`Argument "${t}(${n}:)" can only be defined once.`,{nodes:r.map((e=>e.name))}));return!1}};var r=n(4620),i=n(5822)},4986:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueArgumentNamesRule=function(e){return{Field:t,Directive:t};function t(t){var n;const o=null!==(n=t.arguments)&&void 0!==n?n:[],a=(0,r.groupBy)(o,(e=>e.name.value));for(const[t,n]of a)n.length>1&&e.reportError(new i.GraphQLError(`There can be only one argument named "${t}".`,{nodes:n.map((e=>e.name))}))}};var r=n(4620),i=n(5822)},6753:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueDirectiveNamesRule=function(e){const t=Object.create(null),n=e.getSchema();return{DirectiveDefinition(i){const o=i.name.value;if(null==n||!n.getDirective(o))return t[o]?e.reportError(new r.GraphQLError(`There can be only one directive named "@${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1;e.reportError(new r.GraphQLError(`Directive "@${o}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}))}}};var r=n(5822)},3576:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueDirectivesPerLocationRule=function(e){const t=Object.create(null),n=e.getSchema(),s=n?n.getDirectives():a.specifiedDirectives;for(const e of s)t[e.name]=!e.isRepeatable;const c=e.getDocument().definitions;for(const e of c)e.kind===i.Kind.DIRECTIVE_DEFINITION&&(t[e.name.value]=!e.repeatable);const l=Object.create(null),u=Object.create(null);return{enter(n){if(!("directives"in n)||!n.directives)return;let a;if(n.kind===i.Kind.SCHEMA_DEFINITION||n.kind===i.Kind.SCHEMA_EXTENSION)a=l;else if((0,o.isTypeDefinitionNode)(n)||(0,o.isTypeExtensionNode)(n)){const e=n.name.value;a=u[e],void 0===a&&(u[e]=a=Object.create(null))}else a=Object.create(null);for(const i of n.directives){const n=i.name.value;t[n]&&(a[n]?e.reportError(new r.GraphQLError(`The directive "@${n}" can only be used once at this location.`,{nodes:[a[n],i]})):a[n]=i)}}}};var r=n(5822),i=n(2828),o=n(1352),a=n(7197)},6400:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueEnumValueNamesRule=function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),o=Object.create(null);return{EnumTypeDefinition:a,EnumTypeExtension:a};function a(t){var a;const s=t.name.value;o[s]||(o[s]=Object.create(null));const c=null!==(a=t.values)&&void 0!==a?a:[],l=o[s];for(const t of c){const o=t.name.value,a=n[s];(0,i.isEnumType)(a)&&a.getValue(o)?e.reportError(new r.GraphQLError(`Enum value "${s}.${o}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):l[o]?e.reportError(new r.GraphQLError(`Enum value "${s}.${o}" can only be defined once.`,{nodes:[l[o],t.name]})):l[o]=t.name}return!1}};var r=n(5822),i=n(5003)},4046:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueFieldDefinitionNamesRule=function(e){const t=e.getSchema(),n=t?t.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:a,InputObjectTypeExtension:a,InterfaceTypeDefinition:a,InterfaceTypeExtension:a,ObjectTypeDefinition:a,ObjectTypeExtension:a};function a(t){var a;const s=t.name.value;i[s]||(i[s]=Object.create(null));const c=null!==(a=t.fields)&&void 0!==a?a:[],l=i[s];for(const t of c){const i=t.name.value;o(n[s],i)?e.reportError(new r.GraphQLError(`Field "${s}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:t.name})):l[i]?e.reportError(new r.GraphQLError(`Field "${s}.${i}" can only be defined once.`,{nodes:[l[i],t.name]})):l[i]=t.name}return!1}};var r=n(5822),i=n(5003);function o(e,t){return!!((0,i.isObjectType)(e)||(0,i.isInterfaceType)(e)||(0,i.isInputObjectType)(e))&&null!=e.getFields()[t]}},5883:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueFragmentNamesRule=function(e){const t=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(n){const i=n.name.value;return t[i]?e.reportError(new r.GraphQLError(`There can be only one fragment named "${i}".`,{nodes:[t[i],n.name]})):t[i]=n.name,!1}}};var r=n(5822)},4313:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueInputFieldNamesRule=function(e){const t=[];let n=Object.create(null);return{ObjectValue:{enter(){t.push(n),n=Object.create(null)},leave(){const e=t.pop();e||(0,r.invariant)(!1),n=e}},ObjectField(t){const r=t.name.value;n[r]?e.reportError(new i.GraphQLError(`There can be only one input field named "${r}".`,{nodes:[n[r],t.name]})):n[r]=t.name}}};var r=n(7706),i=n(5822)},2139:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueOperationNamesRule=function(e){const t=Object.create(null);return{OperationDefinition(n){const i=n.name;return i&&(t[i.value]?e.reportError(new r.GraphQLError(`There can be only one operation named "${i.value}".`,{nodes:[t[i.value],i]})):t[i.value]=i),!1},FragmentDefinition:()=>!1}};var r=n(5822)},856:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueOperationTypesRule=function(e){const t=e.getSchema(),n=Object.create(null),i=t?{query:t.getQueryType(),mutation:t.getMutationType(),subscription:t.getSubscriptionType()}:{};return{SchemaDefinition:o,SchemaExtension:o};function o(t){var o;const a=null!==(o=t.operationTypes)&&void 0!==o?o:[];for(const t of a){const o=t.operation,a=n[o];i[o]?e.reportError(new r.GraphQLError(`Type for ${o} already defined in the schema. It cannot be redefined.`,{nodes:t})):a?e.reportError(new r.GraphQLError(`There can be only one ${o} type in schema.`,{nodes:[a,t]})):n[o]=t}return!1}};var r=n(5822)},1686:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueTypeNamesRule=function(e){const t=Object.create(null),n=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(i){const o=i.name.value;if(null==n||!n.getType(o))return t[o]?e.reportError(new r.GraphQLError(`There can be only one type named "${o}".`,{nodes:[t[o],i.name]})):t[o]=i.name,!1;e.reportError(new r.GraphQLError(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}))}};var r=n(5822)},4243:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UniqueVariableNamesRule=function(e){return{OperationDefinition(t){var n;const o=null!==(n=t.variableDefinitions)&&void 0!==n?n:[],a=(0,r.groupBy)(o,(e=>e.variable.name.value));for(const[t,n]of a)n.length>1&&e.reportError(new i.GraphQLError(`There can be only one variable named "$${t}".`,{nodes:n.map((e=>e.variable.name))}))}}};var r=n(4620),i=n(5822)},6869:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValuesOfCorrectTypeRule=function(e){return{ListValue(t){const n=(0,l.getNullableType)(e.getParentInputType());if(!(0,l.isListType)(n))return u(e,t),!1},ObjectValue(t){const n=(0,l.getNamedType)(e.getInputType());if(!(0,l.isInputObjectType)(n))return u(e,t),!1;const r=(0,o.keyMap)(t.fields,(e=>e.name.value));for(const o of Object.values(n.getFields()))if(!r[o.name]&&(0,l.isRequiredInputField)(o)){const r=(0,i.inspect)(o.type);e.reportError(new s.GraphQLError(`Field "${n.name}.${o.name}" of required type "${r}" was not provided.`,{nodes:t}))}},ObjectField(t){const n=(0,l.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,l.isInputObjectType)(n)){const i=(0,a.suggestionList)(t.name.value,Object.keys(n.getFields()));e.reportError(new s.GraphQLError(`Field "${t.name.value}" is not defined by type "${n.name}".`+(0,r.didYouMean)(i),{nodes:t}))}},NullValue(t){const n=e.getInputType();(0,l.isNonNullType)(n)&&e.reportError(new s.GraphQLError(`Expected value of type "${(0,i.inspect)(n)}", found ${(0,c.print)(t)}.`,{nodes:t}))},EnumValue:t=>u(e,t),IntValue:t=>u(e,t),FloatValue:t=>u(e,t),StringValue:t=>u(e,t),BooleanValue:t=>u(e,t)}};var r=n(166),i=n(8002),o=n(2863),a=n(8070),s=n(5822),c=n(3033),l=n(5003);function u(e,t){const n=e.getInputType();if(!n)return;const r=(0,l.getNamedType)(n);if((0,l.isLeafType)(r))try{if(void 0===r.parseLiteral(t,void 0)){const r=(0,i.inspect)(n);e.reportError(new s.GraphQLError(`Expected value of type "${r}", found ${(0,c.print)(t)}.`,{nodes:t}))}}catch(r){const o=(0,i.inspect)(n);r instanceof s.GraphQLError?e.reportError(r):e.reportError(new s.GraphQLError(`Expected value of type "${o}", found ${(0,c.print)(t)}; `+r.message,{nodes:t,originalError:r}))}else{const r=(0,i.inspect)(n);e.reportError(new s.GraphQLError(`Expected value of type "${r}", found ${(0,c.print)(t)}.`,{nodes:t}))}}},4942:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VariablesAreInputTypesRule=function(e){return{VariableDefinition(t){const n=(0,a.typeFromAST)(e.getSchema(),t.type);if(void 0!==n&&!(0,o.isInputType)(n)){const n=t.variable.name.value,o=(0,i.print)(t.type);e.reportError(new r.GraphQLError(`Variable "$${n}" cannot be non-input type "${o}".`,{nodes:t.type}))}}}};var r=n(5822),i=n(3033),o=n(5003),a=n(5115)},8034:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.VariablesInAllowedPositionRule=function(e){let t=Object.create(null);return{OperationDefinition:{enter(){t=Object.create(null)},leave(n){const o=e.getRecursiveVariableUsages(n);for(const{node:n,type:a,defaultValue:s}of o){const o=n.name.value,u=t[o];if(u&&a){const t=e.getSchema(),p=(0,c.typeFromAST)(t,u.type);if(p&&!l(t,p,u.defaultValue,a,s)){const t=(0,r.inspect)(p),s=(0,r.inspect)(a);e.reportError(new i.GraphQLError(`Variable "$${o}" of type "${t}" used in position expecting type "${s}".`,{nodes:[u,n]}))}}}}},VariableDefinition(e){t[e.variable.name.value]=e}}};var r=n(8002),i=n(5822),o=n(2828),a=n(5003),s=n(298),c=n(5115);function l(e,t,n,r,i){if((0,a.isNonNullType)(r)&&!(0,a.isNonNullType)(t)){const a=void 0!==i;if((null==n||n.kind===o.Kind.NULL)&&!a)return!1;const c=r.ofType;return(0,s.isTypeSubTypeOf)(e,t,c)}return(0,s.isTypeSubTypeOf)(e,t,r)}},2860:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoDeprecatedCustomRule=function(e){return{Field(t){const n=e.getFieldDef(),o=null==n?void 0:n.deprecationReason;if(n&&null!=o){const a=e.getParentType();null!=a||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`The field ${a.name}.${n.name} is deprecated. ${o}`,{nodes:t}))}},Argument(t){const n=e.getArgument(),o=null==n?void 0:n.deprecationReason;if(n&&null!=o){const a=e.getDirective();if(null!=a)e.reportError(new i.GraphQLError(`Directive "@${a.name}" argument "${n.name}" is deprecated. ${o}`,{nodes:t}));else{const a=e.getParentType(),s=e.getFieldDef();null!=a&&null!=s||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`Field "${a.name}.${s.name}" argument "${n.name}" is deprecated. ${o}`,{nodes:t}))}}},ObjectField(t){const n=(0,o.getNamedType)(e.getParentInputType());if((0,o.isInputObjectType)(n)){const r=n.getFields()[t.name.value],o=null==r?void 0:r.deprecationReason;null!=o&&e.reportError(new i.GraphQLError(`The input field ${n.name}.${r.name} is deprecated. ${o}`,{nodes:t}))}},EnumValue(t){const n=e.getEnumValue(),a=null==n?void 0:n.deprecationReason;if(n&&null!=a){const s=(0,o.getNamedType)(e.getInputType());null!=s||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`The enum value "${s.name}.${n.name}" is deprecated. ${a}`,{nodes:t}))}}}};var r=n(7706),i=n(5822),o=n(5003)},2276:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NoSchemaIntrospectionCustomRule=function(e){return{Field(t){const n=(0,i.getNamedType)(e.getType());n&&(0,o.isIntrospectionType)(n)&&e.reportError(new r.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${t.name.value}".`,{nodes:t}))}}};var r=n(5822),i=n(5003),o=n(8155)},4710:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.specifiedSDLRules=t.specifiedRules=void 0;var r=n(5285),i=n(9426),o=n(3558),a=n(9989),s=n(2826),c=n(1843),l=n(5961),u=n(870),p=n(3411),f=n(658),d=n(7459),h=n(7317),m=n(8769),v=n(4331),y=n(5904),g=n(5715),b=n(4312),E=n(7168),w=n(4666),T=n(3878),_=n(4986),k=n(6753),O=n(3576),S=n(6400),x=n(4046),C=n(5883),N=n(4313),A=n(2139),L=n(856),D=n(1686),I=n(4243),P=n(6869),R=n(4942),M=n(8034);const j=Object.freeze([r.ExecutableDefinitionsRule,A.UniqueOperationNamesRule,u.LoneAnonymousOperationRule,w.SingleFieldSubscriptionsRule,l.KnownTypeNamesRule,o.FragmentsOnCompositeTypesRule,R.VariablesAreInputTypesRule,E.ScalarLeafsRule,i.FieldsOnCorrectTypeRule,C.UniqueFragmentNamesRule,c.KnownFragmentNamesRule,h.NoUnusedFragmentsRule,y.PossibleFragmentSpreadsRule,f.NoFragmentCyclesRule,I.UniqueVariableNamesRule,d.NoUndefinedVariablesRule,m.NoUnusedVariablesRule,s.KnownDirectivesRule,O.UniqueDirectivesPerLocationRule,a.KnownArgumentNamesRule,_.UniqueArgumentNamesRule,P.ValuesOfCorrectTypeRule,b.ProvidedRequiredArgumentsRule,M.VariablesInAllowedPositionRule,v.OverlappingFieldsCanBeMergedRule,N.UniqueInputFieldNamesRule]);t.specifiedRules=j;const F=Object.freeze([p.LoneSchemaDefinitionRule,L.UniqueOperationTypesRule,D.UniqueTypeNamesRule,S.UniqueEnumValueNamesRule,x.UniqueFieldDefinitionNamesRule,T.UniqueArgumentDefinitionNamesRule,k.UniqueDirectiveNamesRule,l.KnownTypeNamesRule,s.KnownDirectivesRule,O.UniqueDirectivesPerLocationRule,g.PossibleTypeExtensionsRule,a.KnownArgumentNamesOnDirectivesRule,_.UniqueArgumentNamesRule,N.UniqueInputFieldNamesRule,b.ProvidedRequiredArgumentsOnDirectivesRule]);t.specifiedSDLRules=F},9504:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertValidSDL=function(e){const t=u(e);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))},t.assertValidSDLExtension=function(e,t){const n=u(e,t);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))},t.validate=function(e,t,n=c.specifiedRules,u,p=new s.TypeInfo(e)){var f;const d=null!==(f=null==u?void 0:u.maxErrors)&&void 0!==f?f:100;t||(0,r.devAssert)(!1,"Must provide document."),(0,a.assertValidSchema)(e);const h=Object.freeze({}),m=[],v=new l.ValidationContext(e,t,p,(e=>{if(m.length>=d)throw m.push(new i.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),h;m.push(e)})),y=(0,o.visitInParallel)(n.map((e=>e(v))));try{(0,o.visit)(t,(0,s.visitWithTypeInfo)(p,y))}catch(e){if(e!==h)throw e}return m},t.validateSDL=u;var r=n(7242),i=n(5822),o=n(285),a=n(1671),s=n(6226),c=n(4710),l=n(3955);function u(e,t,n=c.specifiedSDLRules){const r=[],i=new l.SDLValidationContext(e,t,(e=>{r.push(e)})),a=n.map((e=>e(i)));return(0,o.visit)(e,(0,o.visitInParallel)(a)),r}},8696:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.versionInfo=t.version=void 0,t.version="16.8.1";const n=Object.freeze({major:16,minor:8,patch:1,preReleaseTag:null});t.versionInfo=n},8679:function(e,t,n){"use strict";var r=n(1296),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function c(e){return r.isMemo(e)?a:s[e.$$typeof]||i}s[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[r.Memo]=a;var l=Object.defineProperty,u=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(h){var i=d(n);i&&i!==h&&e(t,i,r)}var a=u(n);p&&(a=a.concat(p(n)));for(var s=c(t),m=c(n),v=0;v=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},l="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function u(e){var t=e.re=n(6066)(e.__opts__),r=e.__tlds__.slice();function s(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||r.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),r.push(t.src_xn),t.src_tlds=r.join("|"),t.email_fuzzy=RegExp(s(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(s(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(s(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(s(t.tpl_host_fuzzy_test),"i");var c=[];function l(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===i(n))return"[object RegExp]"!==i(n.validate)?o(n.validate)?r.validate=n.validate:l(t,n):r.validate=function(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(o(n.normalize)?r.normalize=n.normalize:n.normalize?l(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===i(e)}(n)?l(t,n):c.push(t)}})),c.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var u=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(a).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+u+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function p(e,t){var n=e.__index__,r=e.__last_index__,i=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=i,this.text=i,this.url=i}function f(e,t){var n=new p(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function d(e,t){if(!(this instanceof d))return new d(e,t);var n;t||(n=e,Object.keys(n||{}).reduce((function(e,t){return e||s.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=r({},s,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=r({},c,e),this.__compiled__={},this.__tlds__=l,this.__tlds_replaced__=!1,this.re={},u(this)}d.prototype.add=function(e,t){return this.__schemas__[e]=t,u(this),this},d.prototype.set=function(e){return this.__opts__=r(this.__opts__,e),this},d.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,i,o,a,s,c;if(this.re.schema_test.test(e))for((s=this.re.schema_search).lastIndex=0;null!==(t=s.exec(e));)if(i=this.testSchemaAt(e,t[2],s.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+i;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(c=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||c=0&&null!==(r=e.match(this.re.email_fuzzy))&&(o=r.index+r[1].length,a=r.index+r[0].length,(this.__index__<0||othis.__last_index__)&&(this.__schema__="mailto:",this.__index__=o,this.__last_index__=a)),this.__index__>=0},d.prototype.pretest=function(e){return this.re.pretest.test(e)},d.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},d.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(f(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(f(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},d.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),u(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,u(this),this)},d.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},d.prototype.onCompile=function(){},e.exports=d},6066:function(e,t,n){"use strict";e.exports=function(e){var t={};return t.src_Any=n(9369).source,t.src_Cc=n(9413).source,t.src_Z=n(5045).source,t.src_P=n(3189).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|"),t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-;]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+t.src_ZCc+").|;(?!"+t.src_ZCc+").|\\!+(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy='(^|[><|]|"|\\(|'+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t}},8552:function(e,t,n){var r=n(852)(n(5639),"DataView");e.exports=r},1989:function(e,t,n){var r=n(1789),i=n(401),o=n(7667),a=n(1327),s=n(1866);function c(e){var t=-1,n=null==e?0:e.length;for(this.clear();++tu))return!1;var f=c.get(e),d=c.get(t);if(f&&d)return f==t&&d==e;var h=-1,m=!0,v=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++h-1&&e%1==0&&e-1}},4705:function(e,t,n){var r=n(8470);e.exports=function(e,t){var n=this.__data__,i=r(n,e);return i<0?(++this.size,n.push([e,t])):n[i][1]=t,this}},4785:function(e,t,n){var r=n(1989),i=n(8407),o=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},1285:function(e,t,n){var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:function(e,t,n){var r=n(5050);e.exports=function(e,t){var n=r(this,e),i=n.size;return n.set(e,t),this.size+=n.size==i?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},4536:function(e,t,n){var r=n(852)(Object,"create");e.exports=r},6916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},1167:function(e,t,n){e=n.nmd(e);var r=n(1957),i=t&&!t.nodeType&&t,o=i&&e&&!e.nodeType&&e,a=o&&o.exports===i&&r.process,s=function(){try{return o&&o.require&&o.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=s},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5639:function(e,t,n){var r=n(1957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();e.exports=o},619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:function(e){e.exports=function(e){return this.__data__.has(e)}},1814:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},7465:function(e,t,n){var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,n){var r=n(8407),i=n(7071),o=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(e,t),this.size=n.size,this}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},3279:function(e,t,n){var r=n(3218),i=n(7771),o=n(4841),a=Math.max,s=Math.min;e.exports=function(e,t,n){var c,l,u,p,f,d,h=0,m=!1,v=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function g(t){var n=c,r=l;return c=l=void 0,h=t,p=e.apply(r,n)}function b(e){return h=e,f=setTimeout(w,t),m?g(e):p}function E(e){var n=e-d;return void 0===d||n>=t||n<0||v&&e-h>=u}function w(){var e=i();if(E(e))return T(e);f=setTimeout(w,function(e){var n=t-(e-d);return v?s(n,u-(e-h)):n}(e))}function T(e){return f=void 0,y&&c?g(e):(c=l=void 0,p)}function _(){var e=i(),n=E(e);if(c=arguments,l=this,d=e,n){if(void 0===f)return b(d);if(v)return clearTimeout(f),f=setTimeout(w,t),g(d)}return void 0===f&&(f=setTimeout(w,t)),p}return t=o(t)||0,r(n)&&(m=!!n.leading,u=(v="maxWait"in n)?a(o(n.maxWait)||0,t):u,y="trailing"in n?!!n.trailing:y),_.cancel=function(){void 0!==f&&clearTimeout(f),h=0,c=d=l=f=void 0},_.flush=function(){return void 0===f?p:T(i())},_}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},5694:function(e,t,n){var r=n(9454),i=n(7005),o=Object.prototype,a=o.hasOwnProperty,s=o.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return i(e)&&a.call(e,"callee")&&!s.call(e,"callee")};e.exports=c},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var r=n(3560),i=n(1780);e.exports=function(e){return null!=e&&i(e.length)&&!r(e)}},4144:function(e,t,n){e=n.nmd(e);var r=n(5639),i=n(5062),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,s=a&&a.exports===o?r.Buffer:void 0,c=(s?s.isBuffer:void 0)||i;e.exports=c},8446:function(e,t,n){var r=n(939);e.exports=function(e,t){return r(e,t)}},3560:function(e,t,n){var r=n(4239),i=n(3218);e.exports=function(e){if(!i(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},3448:function(e,t,n){var r=n(4239),i=n(7005);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},6719:function(e,t,n){var r=n(8749),i=n(1717),o=n(1167),a=o&&o.isTypedArray,s=a?i(a):r;e.exports=s},3674:function(e,t,n){var r=n(4636),i=n(280),o=n(8612);e.exports=function(e){return o(e)?r(e):i(e)}},7771:function(e,t,n){var r=n(5639);e.exports=function(){return r.Date.now()}},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},4841:function(e,t,n){var r=n(7561),i=n(3218),o=n(3448),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(o(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):a.test(e)?NaN:+e}},6961:function(e,t,n){var r,i=function(){var e=String.fromCharCode,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function i(e,t){if(!r[e]){r[e]={};for(var n=0;n>>8,n[2*r+1]=a%256}return n},decompressFromUint8Array:function(t){if(null==t)return o.decompress(t);for(var n=new Array(t.length/2),r=0,i=n.length;r>=1}else{for(i=1,r=0;r>=1}0==--p&&(p=Math.pow(2,d),d++),delete s[u]}else for(i=a[u],r=0;r>=1;0==--p&&(p=Math.pow(2,d),d++),a[l]=f++,u=String(c)}if(""!==u){if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(r=0;r>=1}else{for(i=1,r=0;r>=1}0==--p&&(p=Math.pow(2,d),d++),delete s[u]}else for(i=a[u],r=0;r>=1;0==--p&&(p=Math.pow(2,d),d++)}for(i=2,r=0;r>=1;for(;;){if(m<<=1,v==t-1){h.push(n(m));break}v++}return h.join("")},decompress:function(e){return null==e?"":""==e?null:o._decompress(e.length,32768,(function(t){return e.charCodeAt(t)}))},_decompress:function(t,n,r){var i,o,a,s,c,l,u,p=[],f=4,d=4,h=3,m="",v=[],y={val:r(0),position:n,index:1};for(i=0;i<3;i+=1)p[i]=i;for(a=0,c=Math.pow(2,2),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;switch(a){case 0:for(a=0,c=Math.pow(2,8),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;u=e(a);break;case 1:for(a=0,c=Math.pow(2,16),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;u=e(a);break;case 2:return""}for(p[3]=u,o=u,v.push(u);;){if(y.index>t)return"";for(a=0,c=Math.pow(2,h),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;switch(u=a){case 0:for(a=0,c=Math.pow(2,8),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;p[d++]=e(a),u=d-1,f--;break;case 1:for(a=0,c=Math.pow(2,16),l=1;l!=c;)s=y.val&y.position,y.position>>=1,0==y.position&&(y.position=n,y.val=r(y.index++)),a|=(s>0?1:0)*l,l<<=1;p[d++]=e(a),u=d-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,h),h++),p[u])m=p[u];else{if(u!==d)return null;m=o+o.charAt(0)}v.push(m),p[d++]=o+m.charAt(0),o=m,0==--f&&(f=Math.pow(2,h),h++)}}};return o}();void 0===(r=function(){return i}.call(t,n,t,e))||(e.exports=r)},9980:function(e,t,n){"use strict";e.exports=n(7024)},6233:function(e,t,n){"use strict";e.exports=n(5485)},813:function(e){"use strict";e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]},1947:function(e){"use strict";var t="<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*\\/?>",n="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",r=new RegExp("^(?:"+t+"|"+n+"|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|<[?][\\s\\S]*?[?]>|]*>|)"),i=new RegExp("^(?:"+t+"|"+n+")");e.exports.n=r,e.exports.q=i},7022:function(e,t,n){"use strict";var r=Object.prototype.hasOwnProperty;function i(e,t){return r.call(e,t)}function o(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)||e>=0&&e<=8||11===e||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function a(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var s=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,c=new RegExp(s.source+"|"+/&([a-z#][a-z0-9]{1,31});/gi.source,"gi"),l=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,u=n(6233),p=/[&<>"]/,f=/[&<>"]/g,d={"&":"&","<":"<",">":">",'"':"""};function h(e){return d[e]}var m=/[.?*+^$[\]\\(){}|-]/g,v=n(3189);t.lib={},t.lib.mdurl=n(8765),t.lib.ucmicro=n(4205),t.assign=function(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e},t.isString=function(e){return"[object String]"===function(e){return Object.prototype.toString.call(e)}(e)},t.has=i,t.unescapeMd=function(e){return e.indexOf("\\")<0?e:e.replace(s,"$1")},t.unescapeAll=function(e){return e.indexOf("\\")<0&&e.indexOf("&")<0?e:e.replace(c,(function(e,t,n){return t||function(e,t){var n=0;return i(u,t)?u[t]:35===t.charCodeAt(0)&&l.test(t)&&o(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?a(n):e}(e,n)}))},t.isValidEntityCode=o,t.fromCodePoint=a,t.escapeHtml=function(e){return p.test(e)?e.replace(f,h):e},t.arrayReplaceAt=function(e,t,n){return[].concat(e.slice(0,t),n,e.slice(t+1))},t.isSpace=function(e){switch(e){case 9:case 32:return!0}return!1},t.isWhiteSpace=function(e){if(e>=8192&&e<=8202)return!0;switch(e){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1},t.isMdAsciiPunct=function(e){switch(e){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}},t.isPunctChar=function(e){return v.test(e)},t.escapeRE=function(e){return e.replace(m,"\\$&")},t.normalizeReference=function(e){return e=e.trim().replace(/\s+/g," "),"Ṿ"==="ẞ".toLowerCase()&&(e=e.replace(/ẞ/g,"ß")),e.toLowerCase().toUpperCase()}},1685:function(e,t,n){"use strict";t.parseLinkLabel=n(3595),t.parseLinkDestination=n(2548),t.parseLinkTitle=n(8040)},2548:function(e,t,n){"use strict";var r=n(7022).unescapeAll;e.exports=function(e,t,n){var i,o,a=t,s={ok:!1,pos:0,lines:0,str:""};if(60===e.charCodeAt(t)){for(t++;t32)return s;if(41===i){if(0===o)break;o--}t++}return a===t||0!==o||(s.str=r(e.slice(a,t)),s.lines=0,s.pos=t,s.ok=!0),s}},3595:function(e){"use strict";e.exports=function(e,t,n){var r,i,o,a,s=-1,c=e.posMax,l=e.pos;for(e.pos=t+1,r=1;e.pos=n)return c;if(34!==(o=e.charCodeAt(t))&&39!==o&&40!==o)return c;for(t++,40===o&&(o=41);t=0))try{t.hostname=p.toASCII(t.hostname)}catch(e){}return u.encode(u.format(t))}function g(e){var t=u.parse(e,!0);if(t.hostname&&(!t.protocol||v.indexOf(t.protocol)>=0))try{t.hostname=p.toUnicode(t.hostname)}catch(e){}return u.decode(u.format(t),u.decode.defaultChars+"%")}function b(e,t){if(!(this instanceof b))return new b(e,t);t||r.isString(e)||(t=e||{},e="default"),this.inline=new c,this.block=new s,this.core=new a,this.renderer=new o,this.linkify=new l,this.validateLink=m,this.normalizeLink=y,this.normalizeLinkText=g,this.utils=r,this.helpers=r.assign({},i),this.options={},this.configure(e),t&&this.set(t)}b.prototype.set=function(e){return r.assign(this.options,e),this},b.prototype.configure=function(e){var t,n=this;if(r.isString(e)&&!(e=f[t=e]))throw new Error('Wrong `markdown-it` preset "'+t+'", check name');if(!e)throw new Error("Wrong `markdown-it` preset, can't be empty");return e.options&&n.set(e.options),e.components&&Object.keys(e.components).forEach((function(t){e.components[t].rules&&n[t].ruler.enableOnly(e.components[t].rules),e.components[t].rules2&&n[t].ruler2.enableOnly(e.components[t].rules2)})),this},b.prototype.enable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.enable(e,!0))}),this),n=n.concat(this.inline.ruler2.enable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+r);return this},b.prototype.disable=function(e,t){var n=[];Array.isArray(e)||(e=[e]),["core","block","inline"].forEach((function(t){n=n.concat(this[t].ruler.disable(e,!0))}),this),n=n.concat(this.inline.ruler2.disable(e,!0));var r=e.filter((function(e){return n.indexOf(e)<0}));if(r.length&&!t)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+r);return this},b.prototype.use=function(e){var t=[this].concat(Array.prototype.slice.call(arguments,1));return e.apply(e,t),this},b.prototype.parse=function(e,t){if("string"!=typeof e)throw new Error("Input data should be a String");var n=new this.core.State(e,this,t);return this.core.process(n),n.tokens},b.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},b.prototype.parseInline=function(e,t){var n=new this.core.State(e,this,t);return n.inlineMode=!0,this.core.process(n),n.tokens},b.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)},e.exports=b},2471:function(e,t,n){"use strict";var r=n(9580),i=[["table",n(1785),["paragraph","reference"]],["code",n(8768)],["fence",n(3542),["paragraph","reference","blockquote","list"]],["blockquote",n(5258),["paragraph","reference","blockquote","list"]],["hr",n(5634),["paragraph","reference","blockquote","list"]],["list",n(8532),["paragraph","reference","blockquote"]],["reference",n(3804)],["html_block",n(6329),["paragraph","reference","blockquote"]],["heading",n(1630),["paragraph","reference","blockquote"]],["lheading",n(6850)],["paragraph",n(6864)]];function o(){this.ruler=new r;for(var e=0;e=n))&&!(e.sCount[a]=c){e.line=n;break}for(r=0;r=o)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},a.prototype.parse=function(e,t,n,r){var i,o,a,s=new this.State(e,t,n,r);for(this.tokenize(s),a=(o=this.ruler2.getRules("")).length,i=0;i"+o(e[t].content)+""},a.code_block=function(e,t,n,r,i){var a=e[t];return""+o(e[t].content)+"\n"},a.fence=function(e,t,n,r,a){var s,c,l,u,p,f=e[t],d=f.info?i(f.info).trim():"",h="",m="";return d&&(h=(l=d.split(/(\s+)/g))[0],m=l.slice(2).join("")),0===(s=n.highlight&&n.highlight(f.content,h,m)||o(f.content)).indexOf(""+s+"\n"):"
"+s+"
\n"},a.image=function(e,t,n,r,i){var o=e[t];return o.attrs[o.attrIndex("alt")][1]=i.renderInlineAsText(o.children,n,r),i.renderToken(e,t,n)},a.hardbreak=function(e,t,n){return n.xhtmlOut?"
\n":"
\n"},a.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"
\n":"
\n":"\n"},a.text=function(e,t){return o(e[t].content)},a.html_block=function(e,t){return e[t].content},a.html_inline=function(e,t){return e[t].content},s.prototype.renderAttrs=function(e){var t,n,r;if(!e.attrs)return"";for(r="",t=0,n=e.attrs.length;t\n":">")},s.prototype.renderInline=function(e,t,n){for(var r,i="",o=this.rules,a=0,s=e.length;a=4)return!1;if(62!==e.src.charCodeAt(S++))return!1;if(i)return!0;for(c=d=e.sCount[t]+1,32===e.src.charCodeAt(S)?(S++,c++,d++,o=!1,E=!0):9===e.src.charCodeAt(S)?(E=!0,(e.bsCount[t]+d)%4==3?(S++,c++,d++,o=!1):o=!0):E=!1,h=[e.bMarks[t]],e.bMarks[t]=S;S=x,g=[e.sCount[t]],e.sCount[t]=d-c,b=[e.tShift[t]],e.tShift[t]=S-e.bMarks[t],T=e.md.block.ruler.getRules("blockquote"),y=e.parentType,e.parentType="blockquote",f=t+1;f=(x=e.eMarks[f])));f++)if(62!==e.src.charCodeAt(S++)||k){if(u)break;for(w=!1,s=0,l=T.length;s=x,m.push(e.bsCount[f]),e.bsCount[f]=e.sCount[f]+1+(E?1:0),g.push(e.sCount[f]),e.sCount[f]=d-c,b.push(e.tShift[f]),e.tShift[f]=S-e.bMarks[f]}for(v=e.blkIndent,e.blkIndent=0,(_=e.push("blockquote_open","blockquote",1)).markup=">",_.map=p=[t,0],e.md.block.tokenize(e,t,f),(_=e.push("blockquote_close","blockquote",-1)).markup=">",e.lineMax=O,e.parentType=y,p[1]=e.line,s=0;s=4))break;i=++r}return e.line=i,(o=e.push("code_block","code",0)).content=e.getLines(t,i,4+e.blkIndent,!1)+"\n",o.map=[t,e.line],!0}},3542:function(e){"use strict";e.exports=function(e,t,n,r){var i,o,a,s,c,l,u,p=!1,f=e.bMarks[t]+e.tShift[t],d=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(f+3>d)return!1;if(126!==(i=e.src.charCodeAt(f))&&96!==i)return!1;if(c=f,(o=(f=e.skipChars(f,i))-c)<3)return!1;if(u=e.src.slice(c,f),a=e.src.slice(f,d),96===i&&a.indexOf(String.fromCharCode(i))>=0)return!1;if(r)return!0;for(s=t;!(++s>=n||(f=c=e.bMarks[s]+e.tShift[s])<(d=e.eMarks[s])&&e.sCount[s]=4||(f=e.skipChars(f,i))-c=4)return!1;if(35!==(o=e.src.charCodeAt(l))||l>=u)return!1;for(a=1,o=e.src.charCodeAt(++l);35===o&&l6||ll&&r(e.src.charCodeAt(s-1))&&(u=s),e.line=t+1,(c=e.push("heading_open","h"+String(a),1)).markup="########".slice(0,a),c.map=[t,e.line],(c=e.push("inline","",0)).content=e.src.slice(l,u).trim(),c.map=[t,e.line],c.children=[],(c=e.push("heading_close","h"+String(a),-1)).markup="########".slice(0,a)),0))}},5634:function(e,t,n){"use strict";var r=n(7022).isSpace;e.exports=function(e,t,n,i){var o,a,s,c,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(42!==(o=e.src.charCodeAt(l++))&&45!==o&&95!==o)return!1;for(a=1;l|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^/,!0],[/^<\?/,/\?>/,!0],[/^/,!0],[/^/,!0],[new RegExp("^|$))","i"),/^$/,!0],[new RegExp(i.source+"\\s*$"),/^$/,!1]];e.exports=function(e,t,n,r){var i,a,s,c,l=e.bMarks[t]+e.tShift[t],u=e.eMarks[t];if(e.sCount[t]-e.blkIndent>=4)return!1;if(!e.md.options.html)return!1;if(60!==e.src.charCodeAt(l))return!1;for(c=e.src.slice(l,u),i=0;i=4)return!1;for(f=e.parentType,e.parentType="paragraph";d3)){if(e.sCount[d]>=e.blkIndent&&(c=e.bMarks[d]+e.tShift[d])<(l=e.eMarks[d])&&(45===(p=e.src.charCodeAt(c))||61===p)&&(c=e.skipChars(c,p),(c=e.skipSpaces(c))>=l)){u=61===p?1:2;break}if(!(e.sCount[d]<0)){for(i=!1,o=0,a=h.length;o=a)return-1;if((n=e.src.charCodeAt(o++))<48||n>57)return-1;for(;;){if(o>=a)return-1;if(!((n=e.src.charCodeAt(o++))>=48&&n<=57)){if(41===n||46===n)break;return-1}if(o-i>=10)return-1}return o=4)return!1;if(e.listIndent>=0&&e.sCount[t]-e.listIndent>=4&&e.sCount[t]=e.blkIndent&&(P=!0),(C=o(e,t))>=0){if(f=!0,A=e.bMarks[t]+e.tShift[t],g=Number(e.src.slice(A,C-1)),P&&1!==g)return!1}else{if(!((C=i(e,t))>=0))return!1;f=!1}if(P&&e.skipSpaces(C)>=e.eMarks[t])return!1;if(y=e.src.charCodeAt(C-1),r)return!0;for(v=e.tokens.length,f?(I=e.push("ordered_list_open","ol",1),1!==g&&(I.attrs=[["start",g]])):I=e.push("bullet_list_open","ul",1),I.map=m=[t,0],I.markup=String.fromCharCode(y),E=t,N=!1,D=e.md.block.ruler.getRules("list"),_=e.parentType,e.parentType="list";E=b?1:w-p)>4&&(u=1),l=p+u,(I=e.push("list_item_open","li",1)).markup=String.fromCharCode(y),I.map=d=[t,0],f&&(I.info=e.src.slice(A,C-1)),S=e.tight,O=e.tShift[t],k=e.sCount[t],T=e.listIndent,e.listIndent=e.blkIndent,e.blkIndent=l,e.tight=!0,e.tShift[t]=s-e.bMarks[t],e.sCount[t]=w,s>=b&&e.isEmpty(t+1)?e.line=Math.min(e.line+2,n):e.md.block.tokenize(e,t,n,!0),e.tight&&!N||(R=!1),N=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=e.listIndent,e.listIndent=T,e.tShift[t]=O,e.sCount[t]=k,e.tight=S,(I=e.push("list_item_close","li",-1)).markup=String.fromCharCode(y),E=t=e.line,d[1]=E,s=e.bMarks[t],E>=n)break;if(e.sCount[E]=4)break;for(L=!1,c=0,h=D.length;c3||e.sCount[c]<0)){for(r=!1,i=0,o=l.length;i=4)return!1;if(91!==e.src.charCodeAt(_))return!1;for(;++_3||e.sCount[O]<0)){for(b=!1,p=0,f=E.length;p0&&this.level++,this.tokens.push(i),i},o.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},o.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;et;)if(!i(this.src.charCodeAt(--e)))return e+1;return e},o.prototype.skipChars=function(e,t){for(var n=this.src.length;en;)if(t!==this.src.charCodeAt(--e))return e+1;return e},o.prototype.getLines=function(e,t,n,r){var o,a,s,c,l,u,p,f=e;if(e>=t)return"";for(u=new Array(t-e),o=0;fn?new Array(a-n+1).join(" ")+this.src.slice(c,l):this.src.slice(c,l)}return u.join("")},o.prototype.Token=r,e.exports=o},1785:function(e,t,n){"use strict";var r=n(7022).isSpace;function i(e,t){var n=e.bMarks[t]+e.tShift[t],r=e.eMarks[t];return e.src.substr(n,r-n)}function o(e){var t,n=[],r=0,i=e.length,o=!1,a=0,s="";for(t=e.charCodeAt(r);rn)return!1;if(f=t+1,e.sCount[f]=4)return!1;if((l=e.bMarks[f]+e.tShift[f])>=e.eMarks[f])return!1;if(124!==(_=e.src.charCodeAt(l++))&&45!==_&&58!==_)return!1;if(l>=e.eMarks[f])return!1;if(124!==(k=e.src.charCodeAt(l++))&&45!==k&&58!==k&&!r(k))return!1;if(45===_&&r(k))return!1;for(;l=4)return!1;if((d=o(c)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),0===(h=d.length)||h!==v.length)return!1;if(a)return!0;for(E=e.parentType,e.parentType="table",T=e.md.block.ruler.getRules("blockquote"),(m=e.push("table_open","table",1)).map=g=[t,0],(m=e.push("thead_open","thead",1)).map=[t,t+1],(m=e.push("tr_open","tr",1)).map=[t,t+1],u=0;u=4)break;for((d=o(c)).length&&""===d[0]&&d.shift(),d.length&&""===d[d.length-1]&&d.pop(),f===t+2&&((m=e.push("tbody_open","tbody",1)).map=b=[t+2,0]),(m=e.push("tr_open","tr",1)).map=[f,f+1],u=0;u/i.test(e)}e.exports=function(e){var t,n,o,a,s,c,l,u,p,f,d,h,m,v,y,g,b,E,w=e.tokens;if(e.md.options.linkify)for(n=0,o=w.length;n=0;t--)if("link_close"!==(c=a[t]).type){if("html_inline"===c.type&&(E=c.content,/^\s]/i.test(E)&&m>0&&m--,i(c.content)&&m++),!(m>0)&&"text"===c.type&&e.md.linkify.test(c.content)){for(p=c.content,b=e.md.linkify.match(p),l=[],h=c.level,d=0,u=0;ud&&((s=new e.Token("text","",0)).content=p.slice(d,f),s.level=h,l.push(s)),(s=new e.Token("link_open","a",1)).attrs=[["href",y]],s.level=h++,s.markup="linkify",s.info="auto",l.push(s),(s=new e.Token("text","",0)).content=g,s.level=h,l.push(s),(s=new e.Token("link_close","a",-1)).level=--h,s.markup="linkify",s.info="auto",l.push(s),d=b[u].lastIndex);d=0;t--)"text"!==(n=e[t]).type||i||(n.content=n.content.replace(r,o)),"link_open"===n.type&&"auto"===n.info&&i--,"link_close"===n.type&&"auto"===n.info&&i++}function s(e){var n,r,i=0;for(n=e.length-1;n>=0;n--)"text"!==(r=e[n]).type||i||t.test(r.content)&&(r.content=r.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/gm,"$1—").replace(/(^|\s)--(?=\s|$)/gm,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm,"$1–")),"link_open"===r.type&&"auto"===r.info&&i--,"link_close"===r.type&&"auto"===r.info&&i++}e.exports=function(e){var r;if(e.md.options.typographer)for(r=e.tokens.length-1;r>=0;r--)"inline"===e.tokens[r].type&&(n.test(e.tokens[r].content)&&a(e.tokens[r].children),t.test(e.tokens[r].content)&&s(e.tokens[r].children))}},8450:function(e,t,n){"use strict";var r=n(7022).isWhiteSpace,i=n(7022).isPunctChar,o=n(7022).isMdAsciiPunct,a=/['"]/,s=/['"]/g;function c(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}function l(e,t){var n,a,l,u,p,f,d,h,m,v,y,g,b,E,w,T,_,k,O,S,x;for(O=[],n=0;n=0&&!(O[_].level<=d);_--);if(O.length=_+1,"text"===a.type){p=0,f=(l=a.content).length;e:for(;p=0)m=l.charCodeAt(u.index-1);else for(_=n-1;_>=0&&"softbreak"!==e[_].type&&"hardbreak"!==e[_].type;_--)if(e[_].content){m=e[_].content.charCodeAt(e[_].content.length-1);break}if(v=32,p=48&&m<=57&&(T=w=!1),w&&T&&(w=y,T=g),w||T){if(T)for(_=O.length-1;_>=0&&(h=O[_],!(O[_].level=0;t--)"inline"===e.tokens[t].type&&a.test(e.tokens[t].content)&&l(e.tokens[t].children,e)}},6480:function(e,t,n){"use strict";var r=n(5872);function i(e,t,n){this.src=e,this.env=n,this.tokens=[],this.inlineMode=!1,this.md=t}i.prototype.Token=r,e.exports=i},3420:function(e){"use strict";var t=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,n=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;e.exports=function(e,r){var i,o,a,s,c,l,u=e.pos;if(60!==e.src.charCodeAt(u))return!1;for(c=e.pos,l=e.posMax;;){if(++u>=l)return!1;if(60===(s=e.src.charCodeAt(u)))return!1;if(62===s)break}return i=e.src.slice(c+1,u),n.test(i)?(o=e.md.normalizeLink(i),!!e.md.validateLink(o)&&(r||((a=e.push("link_open","a",1)).attrs=[["href",o]],a.markup="autolink",a.info="auto",(a=e.push("text","",0)).content=e.md.normalizeLinkText(i),(a=e.push("link_close","a",-1)).markup="autolink",a.info="auto"),e.pos+=i.length+2,!0)):!!t.test(i)&&(o=e.md.normalizeLink("mailto:"+i),!!e.md.validateLink(o)&&(r||((a=e.push("link_open","a",1)).attrs=[["href",o]],a.markup="autolink",a.info="auto",(a=e.push("text","",0)).content=e.md.normalizeLinkText(i),(a=e.push("link_close","a",-1)).markup="autolink",a.info="auto"),e.pos+=i.length+2,!0))}},9755:function(e){"use strict";e.exports=function(e,t){var n,r,i,o,a,s,c,l,u=e.pos;if(96!==e.src.charCodeAt(u))return!1;for(n=u,u++,r=e.posMax;ua;r-=h[r]+1)if((o=t[r]).marker===i.marker&&o.open&&o.end<0&&(c=!1,(o.close||i.open)&&(o.length+i.length)%3==0&&(o.length%3==0&&i.length%3==0||(c=!0)),!c)){l=r>0&&!t[r-1].open?h[r-1]+1:0,h[n]=n-r+l,h[r]=l,i.open=!1,o.end=n,o.close=!1,s=-1,d=-2;break}-1!==s&&(u[i.marker][(i.open?3:0)+(i.length||0)%3]=s)}}}e.exports=function(e){var n,r=e.tokens_meta,i=e.tokens_meta.length;for(t(0,e.delimiters),n=0;n=0;n--)95!==(r=t[n]).marker&&42!==r.marker||-1!==r.end&&(i=t[r.end],s=n>0&&t[n-1].end===r.end+1&&t[n-1].marker===r.marker&&t[n-1].token===r.token-1&&t[r.end+1].token===i.token+1,a=String.fromCharCode(r.marker),(o=e.tokens[r.token]).type=s?"strong_open":"em_open",o.tag=s?"strong":"em",o.nesting=1,o.markup=s?a+a:a,o.content="",(o=e.tokens[i.token]).type=s?"strong_close":"em_close",o.tag=s?"strong":"em",o.nesting=-1,o.markup=s?a+a:a,o.content="",s&&(e.tokens[t[n-1].token].content="",e.tokens[t[r.end+1].token].content="",n--))}e.exports.w=function(e,t){var n,r,i=e.pos,o=e.src.charCodeAt(i);if(t)return!1;if(95!==o&&42!==o)return!1;for(r=e.scanDelims(e.pos,42===o),n=0;n?@[]^_`{|}~-".split("").forEach((function(e){i[e.charCodeAt(0)]=1})),e.exports=function(e,t){var n,o=e.pos,a=e.posMax;if(92!==e.src.charCodeAt(o))return!1;if(++o=o||33!==(n=e.src.charCodeAt(a+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n)||!(i=e.src.slice(a).match(r))||(t||(e.push("html_inline","",0).content=e.src.slice(a,a+i[0].length)),e.pos+=i[0].length,0)))}},3006:function(e,t,n){"use strict";var r=n(7022).normalizeReference,i=n(7022).isSpace;e.exports=function(e,t){var n,o,a,s,c,l,u,p,f,d,h,m,v,y="",g=e.pos,b=e.posMax;if(33!==e.src.charCodeAt(e.pos))return!1;if(91!==e.src.charCodeAt(e.pos+1))return!1;if(l=e.pos+2,(c=e.md.helpers.parseLinkLabel(e,e.pos+1,!1))<0)return!1;if((u=c+1)=b)return!1;for(v=u,(f=e.md.helpers.parseLinkDestination(e.src,u,e.posMax)).ok&&(y=e.md.normalizeLink(f.str),e.md.validateLink(y)?u=f.pos:y=""),v=u;u=b||41!==e.src.charCodeAt(u))return e.pos=g,!1;u++}else{if(void 0===e.env.references)return!1;if(u=0?s=e.src.slice(v,u++):u=c+1):u=c+1,s||(s=e.src.slice(l,c)),!(p=e.env.references[r(s)]))return e.pos=g,!1;y=p.href,d=p.title}return t||(a=e.src.slice(l,c),e.md.inline.parse(a,e.md,e.env,m=[]),(h=e.push("image","img",0)).attrs=n=[["src",y],["alt",""]],h.children=m,h.content=a,d&&n.push(["title",d])),e.pos=u,e.posMax=b,!0}},1727:function(e,t,n){"use strict";var r=n(7022).normalizeReference,i=n(7022).isSpace;e.exports=function(e,t){var n,o,a,s,c,l,u,p,f="",d="",h=e.pos,m=e.posMax,v=e.pos,y=!0;if(91!==e.src.charCodeAt(e.pos))return!1;if(c=e.pos+1,(s=e.md.helpers.parseLinkLabel(e,e.pos,!0))<0)return!1;if((l=s+1)=m)return!1;if(v=l,(u=e.md.helpers.parseLinkDestination(e.src,l,e.posMax)).ok){for(f=e.md.normalizeLink(u.str),e.md.validateLink(f)?l=u.pos:f="",v=l;l=m||41!==e.src.charCodeAt(l))&&(y=!0),l++}if(y){if(void 0===e.env.references)return!1;if(l=0?a=e.src.slice(v,l++):l=s+1):l=s+1,a||(a=e.src.slice(c,s)),!(p=e.env.references[r(a)]))return e.pos=h,!1;f=p.href,d=p.title}return t||(e.pos=c,e.posMax=s,e.push("link_open","a",1).attrs=n=[["href",f]],d&&n.push(["title",d]),e.md.inline.tokenize(e),e.push("link_close","a",-1)),e.pos=l,e.posMax=m,!0}},3905:function(e,t,n){"use strict";var r=n(7022).isSpace;e.exports=function(e,t){var n,i,o,a=e.pos;if(10!==e.src.charCodeAt(a))return!1;if(n=e.pending.length-1,i=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(o=n-1;o>=1&&32===e.pending.charCodeAt(o-1);)o--;e.pending=e.pending.slice(0,o),e.push("hardbreak","br",0)}else e.pending=e.pending.slice(0,-1),e.push("softbreak","br",0);else e.push("softbreak","br",0);for(a++;a0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],o={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(i),this.tokens_meta.push(o),i},s.prototype.scanDelims=function(e,t){var n,r,s,c,l,u,p,f,d,h=e,m=!0,v=!0,y=this.posMax,g=this.src.charCodeAt(e);for(n=e>0?this.src.charCodeAt(e-1):32;h0&&r++,"text"===i[t].type&&t+1=0&&(n=this.attrs[t][1]),n},t.prototype.attrJoin=function(e,t){var n=this.attrIndex(e);n<0?this.attrPush([e,t]):this.attrs[n][1]=this.attrs[n][1]+" "+t},e.exports=t},3122:function(e){"use strict";var t={};function n(e,r){var i;return"string"!=typeof r&&(r=n.defaultChars),i=function(e){var n,r,i=t[e];if(i)return i;for(i=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),i.push(r);for(n=0;n=55296&&c<=57343?"���":String.fromCharCode(c),t+=6):240==(248&r)&&t+91114111?l+="����":(c-=65536,l+=String.fromCharCode(55296+(c>>10),56320+(1023&c))),t+=9):l+="�";return l}))}n.defaultChars=";/?:@&=+$,#",n.componentChars="",e.exports=n},729:function(e){"use strict";var t={};function n(e,r,i){var o,a,s,c,l,u="";for("string"!=typeof r&&(i=r,r=n.defaultChars),void 0===i&&(i=!0),l=function(e){var n,r,i=t[e];if(i)return i;for(i=t[e]=[],n=0;n<128;n++)r=String.fromCharCode(n),/^[0-9a-z]$/i.test(r)?i.push(r):i.push("%"+("0"+n.toString(16).toUpperCase()).slice(-2));for(n=0;n=55296&&s<=57343){if(s>=55296&&s<=56319&&o+1=56320&&c<=57343){u+=encodeURIComponent(e[o]+e[o+1]),o++;continue}u+="%EF%BF%BD"}else u+=encodeURIComponent(e[o]);return u}n.defaultChars=";/?:@&=+$,-_.!~*'()#",n.componentChars="-_.!~*'()",e.exports=n},2201:function(e){"use strict";e.exports=function(e){var t="";return t+=e.protocol||"",t+=e.slashes?"//":"",t+=e.auth?e.auth+"@":"",e.hostname&&-1!==e.hostname.indexOf(":")?t+="["+e.hostname+"]":t+=e.hostname||"",t+=e.port?":"+e.port:"",t+=e.pathname||"",(t+=e.search||"")+(e.hash||"")}},8765:function(e,t,n){"use strict";e.exports.encode=n(729),e.exports.decode=n(3122),e.exports.format=n(2201),e.exports.parse=n(9553)},9553:function(e){"use strict";function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var n=/^([a-z0-9.+-]+:)/i,r=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),a=["'"].concat(o),s=["%","/","?",";","#"].concat(a),c=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},f={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};t.prototype.parse=function(e,t){var r,o,a,d,h,m=e;if(m=m.trim(),!t&&1===e.split("#").length){var v=i.exec(m);if(v)return this.pathname=v[1],v[2]&&(this.search=v[2]),this}var y=n.exec(m);if(y&&(a=(y=y[0]).toLowerCase(),this.protocol=y,m=m.substr(y.length)),(t||y||m.match(/^\/\/[^@\/]+@[^@\/]+/))&&(!(h="//"===m.substr(0,2))||y&&p[y]||(m=m.substr(2),this.slashes=!0)),!p[y]&&(h||y&&!f[y])){var g,b,E=-1;for(r=0;r127?O+="x":O+=k[S];if(!O.match(l)){var C=_.slice(0,r),N=_.slice(r+1),A=k.match(u);A&&(C.push(A[1]),N.unshift(A[2])),N.length&&(m=N.join(".")+m),this.hostname=C.join(".");break}}}}this.hostname.length>255&&(this.hostname=""),T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var L=m.indexOf("#");-1!==L&&(this.hash=m.substr(L),m=m.slice(0,L));var D=m.indexOf("?");return-1!==D&&(this.search=m.substr(D),m=m.slice(0,D)),m&&(this.pathname=m),f[a]&&this.hostname&&!this.pathname&&(this.pathname=""),this},t.prototype.parseHost=function(e){var t=r.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},e.exports=function(e,n){if(e&&e instanceof t)return e;var r=new t;return r.parse(e,n),r}},4357:function(e){"use strict";function t(e,t){if(null!=e)return e;var n=new Error(void 0!==t?t:"Got unexpected "+e);throw n.framesToPop=1,n}e.exports=t,e.exports.default=t,Object.defineProperty(e.exports,"__esModule",{value:!0})},3689:function(e,t,n){"use strict";n.r(t),n.d(t,{decode:function(){return y},encode:function(){return g},toASCII:function(){return E},toUnicode:function(){return b},ucs2decode:function(){return d},ucs2encode:function(){return h}});const r=2147483647,i=36,o=/^xn--/,a=/[^\0-\x7E]/,s=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},l=Math.floor,u=String.fromCharCode;function p(e){throw new RangeError(c[e])}function f(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]);const i=function(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}((e=e.replace(s,".")).split("."),t).join(".");return r+i}function d(e){const t=[];let n=0;const r=e.length;for(;n=55296&&i<=56319&&nString.fromCodePoint(...e),m=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},v=function(e,t,n){let r=0;for(e=n?l(e/700):e>>1,e+=l(e/t);e>455;r+=i)e=l(e/35);return l(r+36*e/(e+38))},y=function(e){const t=[],n=e.length;let o=0,a=128,s=72,c=e.lastIndexOf("-");c<0&&(c=0);for(let n=0;n=128&&p("not-basic"),t.push(e.charCodeAt(n));for(let f=c>0?c+1:0;f=n&&p("invalid-input");const c=(u=e.charCodeAt(f++))-48<10?u-22:u-65<26?u-65:u-97<26?u-97:i;(c>=i||c>l((r-o)/t))&&p("overflow"),o+=c*t;const d=a<=s?1:a>=s+26?26:a-s;if(cl(r/h)&&p("overflow"),t*=h}const d=t.length+1;s=v(o-c,d,0==c),l(o/d)>r-a&&p("overflow"),a+=l(o/d),o%=d,t.splice(o++,0,a)}var u;return String.fromCodePoint(...t)},g=function(e){const t=[];let n=(e=d(e)).length,o=128,a=0,s=72;for(const n of e)n<128&&t.push(u(n));let c=t.length,f=c;for(c&&t.push("-");f=o&&tl((r-a)/d)&&p("overflow"),a+=(n-o)*d,o=n;for(const n of e)if(nr&&p("overflow"),n==o){let e=a;for(let n=i;;n+=i){const r=n<=s?1:n>=s+26?26:n-s;if(eNumber(e)-Number(t))).map((t=>e[t])):e}function f(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function d(e){const t=(e=f(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function h(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function m(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const i="string"==typeof n&&n.includes(e.arrayFormatSeparator),o="string"==typeof n&&!i&&u(n,e).includes(e.arrayFormatSeparator);n=o?u(n,e):n;const a=i||o?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(r[t]=n?u(n,e):n);const o=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],o):r[t]=o};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const i of e.split("&")){if(""===i)continue;let[e,a]=o(t.decode?i.replace(/\+/g," "):i,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:u(a,t),n(u(e,t),a,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=h(n[e],t);else r[e]=h(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=p(n):e[t]=n,e}),Object.create(null))}t.extract=d,t.parse=m,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const i=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[",i,"]"].join("")]:[...n,[l(t,e),"[",l(i,e),"]=",l(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),"[]"].join("")]:[...n,[l(t,e),"[]=",l(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[l(t,e),":list="].join("")]:[...n,[l(t,e),":list=",l(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?r:(i=null===i?"":i,0===r.length?[[l(n,e),t,l(i,e)].join("")]:[[r,l(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,l(t,e)]:[...n,[l(t,e),"=",l(r,e)].join("")]}}(t),i={};for(const t of Object.keys(e))n(t)||(i[t]=e[t]);const o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map((n=>{const i=e[n];return void 0===i?"":null===i?l(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?l(n,t)+"[]":i.reduce(r(n),[]).join("&"):l(n,t)+"="+l(i,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=o(e,"#");return Object.assign({url:n.split("?")[0]||"",query:m(d(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[s]:!0},n);const r=f(e.url).split("?")[0]||"",i=t.extract(e.url),o=t.parse(i,{sort:!1}),a=Object.assign(o,e.query);let c=t.stringify(a,n);c&&(c=`?${c}`);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u=`#${n[s]?l(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${c}${u}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[s]:!1},r);const{url:i,query:o,fragmentIdentifier:c}=t.parseUrl(e,r);return t.stringifyUrl({url:i,query:a(o,n),fragmentIdentifier:c},r)},t.exclude=(e,n,r)=>{const i=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,i,r)}},1162:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,i=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,s=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,l=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,p=n?Symbol.for("react.concurrent_mode"):60111,f=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,h=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),m=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");function v(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case p:case o:case s:case a:case d:return e;default:switch(e=e&&e.$$typeof){case l:case f:case m:case h:case c:return e;default:return t}}case i:return t}}}t.isFragment=function(e){return v(e)===o},t.isMemo=function(e){return v(e)===h}},1805:function(e,t,n){"use strict";e.exports=n(1162)},9921:function(e,t){"use strict";var n=60103,r=60106,i=60107,o=60108,a=60114,s=60109,c=60110,l=60112,u=60113,p=60120,f=60115,d=60116,h=60121,m=60122,v=60117,y=60129,g=60131;if("function"==typeof Symbol&&Symbol.for){var b=Symbol.for;n=b("react.element"),r=b("react.portal"),i=b("react.fragment"),o=b("react.strict_mode"),a=b("react.profiler"),s=b("react.provider"),c=b("react.context"),l=b("react.forward_ref"),u=b("react.suspense"),p=b("react.suspense_list"),f=b("react.memo"),d=b("react.lazy"),h=b("react.block"),m=b("react.server.block"),v=b("react.fundamental"),y=b("react.debug_trace_mode"),g=b("react.legacy_hidden")}t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===i||e===a||e===y||e===o||e===u||e===p||e===g||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===f||e.$$typeof===s||e.$$typeof===c||e.$$typeof===l||e.$$typeof===v||e.$$typeof===h||e[0]===m)},t.typeOf=function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case i:case a:case o:case u:case p:return e;default:switch(e=e&&e.$$typeof){case c:case l:case d:case f:case s:return e;default:return t}}case r:return t}}}},9864:function(e,t,n){"use strict";e.exports=n(9921)},6774:function(e){e.exports=function(e,t,n,r){var i=n?n.call(r,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),c=0;c{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},610:function(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))},1742:function(e){e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r","GT":">","Gt":"≫","gtdot":"⋗","gtlPar":"⦕","gtquest":"⩼","gtrapprox":"⪆","gtrarr":"⥸","gtrdot":"⋗","gtreqless":"⋛","gtreqqless":"⪌","gtrless":"≷","gtrsim":"≳","gvertneqq":"≩︀","gvnE":"≩︀","Hacek":"ˇ","hairsp":" ","half":"½","hamilt":"ℋ","HARDcy":"Ъ","hardcy":"ъ","harrcir":"⥈","harr":"↔","hArr":"⇔","harrw":"↭","Hat":"^","hbar":"ℏ","Hcirc":"Ĥ","hcirc":"ĥ","hearts":"♥","heartsuit":"♥","hellip":"…","hercon":"⊹","hfr":"𝔥","Hfr":"ℌ","HilbertSpace":"ℋ","hksearow":"⤥","hkswarow":"⤦","hoarr":"⇿","homtht":"∻","hookleftarrow":"↩","hookrightarrow":"↪","hopf":"𝕙","Hopf":"ℍ","horbar":"―","HorizontalLine":"─","hscr":"𝒽","Hscr":"ℋ","hslash":"ℏ","Hstrok":"Ħ","hstrok":"ħ","HumpDownHump":"≎","HumpEqual":"≏","hybull":"⁃","hyphen":"‐","Iacute":"Í","iacute":"í","ic":"⁣","Icirc":"Î","icirc":"î","Icy":"И","icy":"и","Idot":"İ","IEcy":"Е","iecy":"е","iexcl":"¡","iff":"⇔","ifr":"𝔦","Ifr":"ℑ","Igrave":"Ì","igrave":"ì","ii":"ⅈ","iiiint":"⨌","iiint":"∭","iinfin":"⧜","iiota":"℩","IJlig":"IJ","ijlig":"ij","Imacr":"Ī","imacr":"ī","image":"ℑ","ImaginaryI":"ⅈ","imagline":"ℐ","imagpart":"ℑ","imath":"ı","Im":"ℑ","imof":"⊷","imped":"Ƶ","Implies":"⇒","incare":"℅","in":"∈","infin":"∞","infintie":"⧝","inodot":"ı","intcal":"⊺","int":"∫","Int":"∬","integers":"ℤ","Integral":"∫","intercal":"⊺","Intersection":"⋂","intlarhk":"⨗","intprod":"⨼","InvisibleComma":"⁣","InvisibleTimes":"⁢","IOcy":"Ё","iocy":"ё","Iogon":"Į","iogon":"į","Iopf":"𝕀","iopf":"𝕚","Iota":"Ι","iota":"ι","iprod":"⨼","iquest":"¿","iscr":"𝒾","Iscr":"ℐ","isin":"∈","isindot":"⋵","isinE":"⋹","isins":"⋴","isinsv":"⋳","isinv":"∈","it":"⁢","Itilde":"Ĩ","itilde":"ĩ","Iukcy":"І","iukcy":"і","Iuml":"Ï","iuml":"ï","Jcirc":"Ĵ","jcirc":"ĵ","Jcy":"Й","jcy":"й","Jfr":"𝔍","jfr":"𝔧","jmath":"ȷ","Jopf":"𝕁","jopf":"𝕛","Jscr":"𝒥","jscr":"𝒿","Jsercy":"Ј","jsercy":"ј","Jukcy":"Є","jukcy":"є","Kappa":"Κ","kappa":"κ","kappav":"ϰ","Kcedil":"Ķ","kcedil":"ķ","Kcy":"К","kcy":"к","Kfr":"𝔎","kfr":"𝔨","kgreen":"ĸ","KHcy":"Х","khcy":"х","KJcy":"Ќ","kjcy":"ќ","Kopf":"𝕂","kopf":"𝕜","Kscr":"𝒦","kscr":"𝓀","lAarr":"⇚","Lacute":"Ĺ","lacute":"ĺ","laemptyv":"⦴","lagran":"ℒ","Lambda":"Λ","lambda":"λ","lang":"⟨","Lang":"⟪","langd":"⦑","langle":"⟨","lap":"⪅","Laplacetrf":"ℒ","laquo":"«","larrb":"⇤","larrbfs":"⤟","larr":"←","Larr":"↞","lArr":"⇐","larrfs":"⤝","larrhk":"↩","larrlp":"↫","larrpl":"⤹","larrsim":"⥳","larrtl":"↢","latail":"⤙","lAtail":"⤛","lat":"⪫","late":"⪭","lates":"⪭︀","lbarr":"⤌","lBarr":"⤎","lbbrk":"❲","lbrace":"{","lbrack":"[","lbrke":"⦋","lbrksld":"⦏","lbrkslu":"⦍","Lcaron":"Ľ","lcaron":"ľ","Lcedil":"Ļ","lcedil":"ļ","lceil":"⌈","lcub":"{","Lcy":"Л","lcy":"л","ldca":"⤶","ldquo":"“","ldquor":"„","ldrdhar":"⥧","ldrushar":"⥋","ldsh":"↲","le":"≤","lE":"≦","LeftAngleBracket":"⟨","LeftArrowBar":"⇤","leftarrow":"←","LeftArrow":"←","Leftarrow":"⇐","LeftArrowRightArrow":"⇆","leftarrowtail":"↢","LeftCeiling":"⌈","LeftDoubleBracket":"⟦","LeftDownTeeVector":"⥡","LeftDownVectorBar":"⥙","LeftDownVector":"⇃","LeftFloor":"⌊","leftharpoondown":"↽","leftharpoonup":"↼","leftleftarrows":"⇇","leftrightarrow":"↔","LeftRightArrow":"↔","Leftrightarrow":"⇔","leftrightarrows":"⇆","leftrightharpoons":"⇋","leftrightsquigarrow":"↭","LeftRightVector":"⥎","LeftTeeArrow":"↤","LeftTee":"⊣","LeftTeeVector":"⥚","leftthreetimes":"⋋","LeftTriangleBar":"⧏","LeftTriangle":"⊲","LeftTriangleEqual":"⊴","LeftUpDownVector":"⥑","LeftUpTeeVector":"⥠","LeftUpVectorBar":"⥘","LeftUpVector":"↿","LeftVectorBar":"⥒","LeftVector":"↼","lEg":"⪋","leg":"⋚","leq":"≤","leqq":"≦","leqslant":"⩽","lescc":"⪨","les":"⩽","lesdot":"⩿","lesdoto":"⪁","lesdotor":"⪃","lesg":"⋚︀","lesges":"⪓","lessapprox":"⪅","lessdot":"⋖","lesseqgtr":"⋚","lesseqqgtr":"⪋","LessEqualGreater":"⋚","LessFullEqual":"≦","LessGreater":"≶","lessgtr":"≶","LessLess":"⪡","lesssim":"≲","LessSlantEqual":"⩽","LessTilde":"≲","lfisht":"⥼","lfloor":"⌊","Lfr":"𝔏","lfr":"𝔩","lg":"≶","lgE":"⪑","lHar":"⥢","lhard":"↽","lharu":"↼","lharul":"⥪","lhblk":"▄","LJcy":"Љ","ljcy":"љ","llarr":"⇇","ll":"≪","Ll":"⋘","llcorner":"⌞","Lleftarrow":"⇚","llhard":"⥫","lltri":"◺","Lmidot":"Ŀ","lmidot":"ŀ","lmoustache":"⎰","lmoust":"⎰","lnap":"⪉","lnapprox":"⪉","lne":"⪇","lnE":"≨","lneq":"⪇","lneqq":"≨","lnsim":"⋦","loang":"⟬","loarr":"⇽","lobrk":"⟦","longleftarrow":"⟵","LongLeftArrow":"⟵","Longleftarrow":"⟸","longleftrightarrow":"⟷","LongLeftRightArrow":"⟷","Longleftrightarrow":"⟺","longmapsto":"⟼","longrightarrow":"⟶","LongRightArrow":"⟶","Longrightarrow":"⟹","looparrowleft":"↫","looparrowright":"↬","lopar":"⦅","Lopf":"𝕃","lopf":"𝕝","loplus":"⨭","lotimes":"⨴","lowast":"∗","lowbar":"_","LowerLeftArrow":"↙","LowerRightArrow":"↘","loz":"◊","lozenge":"◊","lozf":"⧫","lpar":"(","lparlt":"⦓","lrarr":"⇆","lrcorner":"⌟","lrhar":"⇋","lrhard":"⥭","lrm":"‎","lrtri":"⊿","lsaquo":"‹","lscr":"𝓁","Lscr":"ℒ","lsh":"↰","Lsh":"↰","lsim":"≲","lsime":"⪍","lsimg":"⪏","lsqb":"[","lsquo":"‘","lsquor":"‚","Lstrok":"Ł","lstrok":"ł","ltcc":"⪦","ltcir":"⩹","lt":"<","LT":"<","Lt":"≪","ltdot":"⋖","lthree":"⋋","ltimes":"⋉","ltlarr":"⥶","ltquest":"⩻","ltri":"◃","ltrie":"⊴","ltrif":"◂","ltrPar":"⦖","lurdshar":"⥊","luruhar":"⥦","lvertneqq":"≨︀","lvnE":"≨︀","macr":"¯","male":"♂","malt":"✠","maltese":"✠","Map":"⤅","map":"↦","mapsto":"↦","mapstodown":"↧","mapstoleft":"↤","mapstoup":"↥","marker":"▮","mcomma":"⨩","Mcy":"М","mcy":"м","mdash":"—","mDDot":"∺","measuredangle":"∡","MediumSpace":" ","Mellintrf":"ℳ","Mfr":"𝔐","mfr":"𝔪","mho":"℧","micro":"µ","midast":"*","midcir":"⫰","mid":"∣","middot":"·","minusb":"⊟","minus":"−","minusd":"∸","minusdu":"⨪","MinusPlus":"∓","mlcp":"⫛","mldr":"…","mnplus":"∓","models":"⊧","Mopf":"𝕄","mopf":"𝕞","mp":"∓","mscr":"𝓂","Mscr":"ℳ","mstpos":"∾","Mu":"Μ","mu":"μ","multimap":"⊸","mumap":"⊸","nabla":"∇","Nacute":"Ń","nacute":"ń","nang":"∠⃒","nap":"≉","napE":"⩰̸","napid":"≋̸","napos":"ʼn","napprox":"≉","natural":"♮","naturals":"ℕ","natur":"♮","nbsp":" ","nbump":"≎̸","nbumpe":"≏̸","ncap":"⩃","Ncaron":"Ň","ncaron":"ň","Ncedil":"Ņ","ncedil":"ņ","ncong":"≇","ncongdot":"⩭̸","ncup":"⩂","Ncy":"Н","ncy":"н","ndash":"–","nearhk":"⤤","nearr":"↗","neArr":"⇗","nearrow":"↗","ne":"≠","nedot":"≐̸","NegativeMediumSpace":"​","NegativeThickSpace":"​","NegativeThinSpace":"​","NegativeVeryThinSpace":"​","nequiv":"≢","nesear":"⤨","nesim":"≂̸","NestedGreaterGreater":"≫","NestedLessLess":"≪","NewLine":"\\n","nexist":"∄","nexists":"∄","Nfr":"𝔑","nfr":"𝔫","ngE":"≧̸","nge":"≱","ngeq":"≱","ngeqq":"≧̸","ngeqslant":"⩾̸","nges":"⩾̸","nGg":"⋙̸","ngsim":"≵","nGt":"≫⃒","ngt":"≯","ngtr":"≯","nGtv":"≫̸","nharr":"↮","nhArr":"⇎","nhpar":"⫲","ni":"∋","nis":"⋼","nisd":"⋺","niv":"∋","NJcy":"Њ","njcy":"њ","nlarr":"↚","nlArr":"⇍","nldr":"‥","nlE":"≦̸","nle":"≰","nleftarrow":"↚","nLeftarrow":"⇍","nleftrightarrow":"↮","nLeftrightarrow":"⇎","nleq":"≰","nleqq":"≦̸","nleqslant":"⩽̸","nles":"⩽̸","nless":"≮","nLl":"⋘̸","nlsim":"≴","nLt":"≪⃒","nlt":"≮","nltri":"⋪","nltrie":"⋬","nLtv":"≪̸","nmid":"∤","NoBreak":"⁠","NonBreakingSpace":" ","nopf":"𝕟","Nopf":"ℕ","Not":"⫬","not":"¬","NotCongruent":"≢","NotCupCap":"≭","NotDoubleVerticalBar":"∦","NotElement":"∉","NotEqual":"≠","NotEqualTilde":"≂̸","NotExists":"∄","NotGreater":"≯","NotGreaterEqual":"≱","NotGreaterFullEqual":"≧̸","NotGreaterGreater":"≫̸","NotGreaterLess":"≹","NotGreaterSlantEqual":"⩾̸","NotGreaterTilde":"≵","NotHumpDownHump":"≎̸","NotHumpEqual":"≏̸","notin":"∉","notindot":"⋵̸","notinE":"⋹̸","notinva":"∉","notinvb":"⋷","notinvc":"⋶","NotLeftTriangleBar":"⧏̸","NotLeftTriangle":"⋪","NotLeftTriangleEqual":"⋬","NotLess":"≮","NotLessEqual":"≰","NotLessGreater":"≸","NotLessLess":"≪̸","NotLessSlantEqual":"⩽̸","NotLessTilde":"≴","NotNestedGreaterGreater":"⪢̸","NotNestedLessLess":"⪡̸","notni":"∌","notniva":"∌","notnivb":"⋾","notnivc":"⋽","NotPrecedes":"⊀","NotPrecedesEqual":"⪯̸","NotPrecedesSlantEqual":"⋠","NotReverseElement":"∌","NotRightTriangleBar":"⧐̸","NotRightTriangle":"⋫","NotRightTriangleEqual":"⋭","NotSquareSubset":"⊏̸","NotSquareSubsetEqual":"⋢","NotSquareSuperset":"⊐̸","NotSquareSupersetEqual":"⋣","NotSubset":"⊂⃒","NotSubsetEqual":"⊈","NotSucceeds":"⊁","NotSucceedsEqual":"⪰̸","NotSucceedsSlantEqual":"⋡","NotSucceedsTilde":"≿̸","NotSuperset":"⊃⃒","NotSupersetEqual":"⊉","NotTilde":"≁","NotTildeEqual":"≄","NotTildeFullEqual":"≇","NotTildeTilde":"≉","NotVerticalBar":"∤","nparallel":"∦","npar":"∦","nparsl":"⫽⃥","npart":"∂̸","npolint":"⨔","npr":"⊀","nprcue":"⋠","nprec":"⊀","npreceq":"⪯̸","npre":"⪯̸","nrarrc":"⤳̸","nrarr":"↛","nrArr":"⇏","nrarrw":"↝̸","nrightarrow":"↛","nRightarrow":"⇏","nrtri":"⋫","nrtrie":"⋭","nsc":"⊁","nsccue":"⋡","nsce":"⪰̸","Nscr":"𝒩","nscr":"𝓃","nshortmid":"∤","nshortparallel":"∦","nsim":"≁","nsime":"≄","nsimeq":"≄","nsmid":"∤","nspar":"∦","nsqsube":"⋢","nsqsupe":"⋣","nsub":"⊄","nsubE":"⫅̸","nsube":"⊈","nsubset":"⊂⃒","nsubseteq":"⊈","nsubseteqq":"⫅̸","nsucc":"⊁","nsucceq":"⪰̸","nsup":"⊅","nsupE":"⫆̸","nsupe":"⊉","nsupset":"⊃⃒","nsupseteq":"⊉","nsupseteqq":"⫆̸","ntgl":"≹","Ntilde":"Ñ","ntilde":"ñ","ntlg":"≸","ntriangleleft":"⋪","ntrianglelefteq":"⋬","ntriangleright":"⋫","ntrianglerighteq":"⋭","Nu":"Ν","nu":"ν","num":"#","numero":"№","numsp":" ","nvap":"≍⃒","nvdash":"⊬","nvDash":"⊭","nVdash":"⊮","nVDash":"⊯","nvge":"≥⃒","nvgt":">⃒","nvHarr":"⤄","nvinfin":"⧞","nvlArr":"⤂","nvle":"≤⃒","nvlt":"<⃒","nvltrie":"⊴⃒","nvrArr":"⤃","nvrtrie":"⊵⃒","nvsim":"∼⃒","nwarhk":"⤣","nwarr":"↖","nwArr":"⇖","nwarrow":"↖","nwnear":"⤧","Oacute":"Ó","oacute":"ó","oast":"⊛","Ocirc":"Ô","ocirc":"ô","ocir":"⊚","Ocy":"О","ocy":"о","odash":"⊝","Odblac":"Ő","odblac":"ő","odiv":"⨸","odot":"⊙","odsold":"⦼","OElig":"Œ","oelig":"œ","ofcir":"⦿","Ofr":"𝔒","ofr":"𝔬","ogon":"˛","Ograve":"Ò","ograve":"ò","ogt":"⧁","ohbar":"⦵","ohm":"Ω","oint":"∮","olarr":"↺","olcir":"⦾","olcross":"⦻","oline":"‾","olt":"⧀","Omacr":"Ō","omacr":"ō","Omega":"Ω","omega":"ω","Omicron":"Ο","omicron":"ο","omid":"⦶","ominus":"⊖","Oopf":"𝕆","oopf":"𝕠","opar":"⦷","OpenCurlyDoubleQuote":"“","OpenCurlyQuote":"‘","operp":"⦹","oplus":"⊕","orarr":"↻","Or":"⩔","or":"∨","ord":"⩝","order":"ℴ","orderof":"ℴ","ordf":"ª","ordm":"º","origof":"⊶","oror":"⩖","orslope":"⩗","orv":"⩛","oS":"Ⓢ","Oscr":"𝒪","oscr":"ℴ","Oslash":"Ø","oslash":"ø","osol":"⊘","Otilde":"Õ","otilde":"õ","otimesas":"⨶","Otimes":"⨷","otimes":"⊗","Ouml":"Ö","ouml":"ö","ovbar":"⌽","OverBar":"‾","OverBrace":"⏞","OverBracket":"⎴","OverParenthesis":"⏜","para":"¶","parallel":"∥","par":"∥","parsim":"⫳","parsl":"⫽","part":"∂","PartialD":"∂","Pcy":"П","pcy":"п","percnt":"%","period":".","permil":"‰","perp":"⊥","pertenk":"‱","Pfr":"𝔓","pfr":"𝔭","Phi":"Φ","phi":"φ","phiv":"ϕ","phmmat":"ℳ","phone":"☎","Pi":"Π","pi":"π","pitchfork":"⋔","piv":"ϖ","planck":"ℏ","planckh":"ℎ","plankv":"ℏ","plusacir":"⨣","plusb":"⊞","pluscir":"⨢","plus":"+","plusdo":"∔","plusdu":"⨥","pluse":"⩲","PlusMinus":"±","plusmn":"±","plussim":"⨦","plustwo":"⨧","pm":"±","Poincareplane":"ℌ","pointint":"⨕","popf":"𝕡","Popf":"ℙ","pound":"£","prap":"⪷","Pr":"⪻","pr":"≺","prcue":"≼","precapprox":"⪷","prec":"≺","preccurlyeq":"≼","Precedes":"≺","PrecedesEqual":"⪯","PrecedesSlantEqual":"≼","PrecedesTilde":"≾","preceq":"⪯","precnapprox":"⪹","precneqq":"⪵","precnsim":"⋨","pre":"⪯","prE":"⪳","precsim":"≾","prime":"′","Prime":"″","primes":"ℙ","prnap":"⪹","prnE":"⪵","prnsim":"⋨","prod":"∏","Product":"∏","profalar":"⌮","profline":"⌒","profsurf":"⌓","prop":"∝","Proportional":"∝","Proportion":"∷","propto":"∝","prsim":"≾","prurel":"⊰","Pscr":"𝒫","pscr":"𝓅","Psi":"Ψ","psi":"ψ","puncsp":" ","Qfr":"𝔔","qfr":"𝔮","qint":"⨌","qopf":"𝕢","Qopf":"ℚ","qprime":"⁗","Qscr":"𝒬","qscr":"𝓆","quaternions":"ℍ","quatint":"⨖","quest":"?","questeq":"≟","quot":"\\"","QUOT":"\\"","rAarr":"⇛","race":"∽̱","Racute":"Ŕ","racute":"ŕ","radic":"√","raemptyv":"⦳","rang":"⟩","Rang":"⟫","rangd":"⦒","range":"⦥","rangle":"⟩","raquo":"»","rarrap":"⥵","rarrb":"⇥","rarrbfs":"⤠","rarrc":"⤳","rarr":"→","Rarr":"↠","rArr":"⇒","rarrfs":"⤞","rarrhk":"↪","rarrlp":"↬","rarrpl":"⥅","rarrsim":"⥴","Rarrtl":"⤖","rarrtl":"↣","rarrw":"↝","ratail":"⤚","rAtail":"⤜","ratio":"∶","rationals":"ℚ","rbarr":"⤍","rBarr":"⤏","RBarr":"⤐","rbbrk":"❳","rbrace":"}","rbrack":"]","rbrke":"⦌","rbrksld":"⦎","rbrkslu":"⦐","Rcaron":"Ř","rcaron":"ř","Rcedil":"Ŗ","rcedil":"ŗ","rceil":"⌉","rcub":"}","Rcy":"Р","rcy":"р","rdca":"⤷","rdldhar":"⥩","rdquo":"”","rdquor":"”","rdsh":"↳","real":"ℜ","realine":"ℛ","realpart":"ℜ","reals":"ℝ","Re":"ℜ","rect":"▭","reg":"®","REG":"®","ReverseElement":"∋","ReverseEquilibrium":"⇋","ReverseUpEquilibrium":"⥯","rfisht":"⥽","rfloor":"⌋","rfr":"𝔯","Rfr":"ℜ","rHar":"⥤","rhard":"⇁","rharu":"⇀","rharul":"⥬","Rho":"Ρ","rho":"ρ","rhov":"ϱ","RightAngleBracket":"⟩","RightArrowBar":"⇥","rightarrow":"→","RightArrow":"→","Rightarrow":"⇒","RightArrowLeftArrow":"⇄","rightarrowtail":"↣","RightCeiling":"⌉","RightDoubleBracket":"⟧","RightDownTeeVector":"⥝","RightDownVectorBar":"⥕","RightDownVector":"⇂","RightFloor":"⌋","rightharpoondown":"⇁","rightharpoonup":"⇀","rightleftarrows":"⇄","rightleftharpoons":"⇌","rightrightarrows":"⇉","rightsquigarrow":"↝","RightTeeArrow":"↦","RightTee":"⊢","RightTeeVector":"⥛","rightthreetimes":"⋌","RightTriangleBar":"⧐","RightTriangle":"⊳","RightTriangleEqual":"⊵","RightUpDownVector":"⥏","RightUpTeeVector":"⥜","RightUpVectorBar":"⥔","RightUpVector":"↾","RightVectorBar":"⥓","RightVector":"⇀","ring":"˚","risingdotseq":"≓","rlarr":"⇄","rlhar":"⇌","rlm":"‏","rmoustache":"⎱","rmoust":"⎱","rnmid":"⫮","roang":"⟭","roarr":"⇾","robrk":"⟧","ropar":"⦆","ropf":"𝕣","Ropf":"ℝ","roplus":"⨮","rotimes":"⨵","RoundImplies":"⥰","rpar":")","rpargt":"⦔","rppolint":"⨒","rrarr":"⇉","Rrightarrow":"⇛","rsaquo":"›","rscr":"𝓇","Rscr":"ℛ","rsh":"↱","Rsh":"↱","rsqb":"]","rsquo":"’","rsquor":"’","rthree":"⋌","rtimes":"⋊","rtri":"▹","rtrie":"⊵","rtrif":"▸","rtriltri":"⧎","RuleDelayed":"⧴","ruluhar":"⥨","rx":"℞","Sacute":"Ś","sacute":"ś","sbquo":"‚","scap":"⪸","Scaron":"Š","scaron":"š","Sc":"⪼","sc":"≻","sccue":"≽","sce":"⪰","scE":"⪴","Scedil":"Ş","scedil":"ş","Scirc":"Ŝ","scirc":"ŝ","scnap":"⪺","scnE":"⪶","scnsim":"⋩","scpolint":"⨓","scsim":"≿","Scy":"С","scy":"с","sdotb":"⊡","sdot":"⋅","sdote":"⩦","searhk":"⤥","searr":"↘","seArr":"⇘","searrow":"↘","sect":"§","semi":";","seswar":"⤩","setminus":"∖","setmn":"∖","sext":"✶","Sfr":"𝔖","sfr":"𝔰","sfrown":"⌢","sharp":"♯","SHCHcy":"Щ","shchcy":"щ","SHcy":"Ш","shcy":"ш","ShortDownArrow":"↓","ShortLeftArrow":"←","shortmid":"∣","shortparallel":"∥","ShortRightArrow":"→","ShortUpArrow":"↑","shy":"­","Sigma":"Σ","sigma":"σ","sigmaf":"ς","sigmav":"ς","sim":"∼","simdot":"⩪","sime":"≃","simeq":"≃","simg":"⪞","simgE":"⪠","siml":"⪝","simlE":"⪟","simne":"≆","simplus":"⨤","simrarr":"⥲","slarr":"←","SmallCircle":"∘","smallsetminus":"∖","smashp":"⨳","smeparsl":"⧤","smid":"∣","smile":"⌣","smt":"⪪","smte":"⪬","smtes":"⪬︀","SOFTcy":"Ь","softcy":"ь","solbar":"⌿","solb":"⧄","sol":"/","Sopf":"𝕊","sopf":"𝕤","spades":"♠","spadesuit":"♠","spar":"∥","sqcap":"⊓","sqcaps":"⊓︀","sqcup":"⊔","sqcups":"⊔︀","Sqrt":"√","sqsub":"⊏","sqsube":"⊑","sqsubset":"⊏","sqsubseteq":"⊑","sqsup":"⊐","sqsupe":"⊒","sqsupset":"⊐","sqsupseteq":"⊒","square":"□","Square":"□","SquareIntersection":"⊓","SquareSubset":"⊏","SquareSubsetEqual":"⊑","SquareSuperset":"⊐","SquareSupersetEqual":"⊒","SquareUnion":"⊔","squarf":"▪","squ":"□","squf":"▪","srarr":"→","Sscr":"𝒮","sscr":"𝓈","ssetmn":"∖","ssmile":"⌣","sstarf":"⋆","Star":"⋆","star":"☆","starf":"★","straightepsilon":"ϵ","straightphi":"ϕ","strns":"¯","sub":"⊂","Sub":"⋐","subdot":"⪽","subE":"⫅","sube":"⊆","subedot":"⫃","submult":"⫁","subnE":"⫋","subne":"⊊","subplus":"⪿","subrarr":"⥹","subset":"⊂","Subset":"⋐","subseteq":"⊆","subseteqq":"⫅","SubsetEqual":"⊆","subsetneq":"⊊","subsetneqq":"⫋","subsim":"⫇","subsub":"⫕","subsup":"⫓","succapprox":"⪸","succ":"≻","succcurlyeq":"≽","Succeeds":"≻","SucceedsEqual":"⪰","SucceedsSlantEqual":"≽","SucceedsTilde":"≿","succeq":"⪰","succnapprox":"⪺","succneqq":"⪶","succnsim":"⋩","succsim":"≿","SuchThat":"∋","sum":"∑","Sum":"∑","sung":"♪","sup1":"¹","sup2":"²","sup3":"³","sup":"⊃","Sup":"⋑","supdot":"⪾","supdsub":"⫘","supE":"⫆","supe":"⊇","supedot":"⫄","Superset":"⊃","SupersetEqual":"⊇","suphsol":"⟉","suphsub":"⫗","suplarr":"⥻","supmult":"⫂","supnE":"⫌","supne":"⊋","supplus":"⫀","supset":"⊃","Supset":"⋑","supseteq":"⊇","supseteqq":"⫆","supsetneq":"⊋","supsetneqq":"⫌","supsim":"⫈","supsub":"⫔","supsup":"⫖","swarhk":"⤦","swarr":"↙","swArr":"⇙","swarrow":"↙","swnwar":"⤪","szlig":"ß","Tab":"\\t","target":"⌖","Tau":"Τ","tau":"τ","tbrk":"⎴","Tcaron":"Ť","tcaron":"ť","Tcedil":"Ţ","tcedil":"ţ","Tcy":"Т","tcy":"т","tdot":"⃛","telrec":"⌕","Tfr":"𝔗","tfr":"𝔱","there4":"∴","therefore":"∴","Therefore":"∴","Theta":"Θ","theta":"θ","thetasym":"ϑ","thetav":"ϑ","thickapprox":"≈","thicksim":"∼","ThickSpace":"  ","ThinSpace":" ","thinsp":" ","thkap":"≈","thksim":"∼","THORN":"Þ","thorn":"þ","tilde":"˜","Tilde":"∼","TildeEqual":"≃","TildeFullEqual":"≅","TildeTilde":"≈","timesbar":"⨱","timesb":"⊠","times":"×","timesd":"⨰","tint":"∭","toea":"⤨","topbot":"⌶","topcir":"⫱","top":"⊤","Topf":"𝕋","topf":"𝕥","topfork":"⫚","tosa":"⤩","tprime":"‴","trade":"™","TRADE":"™","triangle":"▵","triangledown":"▿","triangleleft":"◃","trianglelefteq":"⊴","triangleq":"≜","triangleright":"▹","trianglerighteq":"⊵","tridot":"◬","trie":"≜","triminus":"⨺","TripleDot":"⃛","triplus":"⨹","trisb":"⧍","tritime":"⨻","trpezium":"⏢","Tscr":"𝒯","tscr":"𝓉","TScy":"Ц","tscy":"ц","TSHcy":"Ћ","tshcy":"ћ","Tstrok":"Ŧ","tstrok":"ŧ","twixt":"≬","twoheadleftarrow":"↞","twoheadrightarrow":"↠","Uacute":"Ú","uacute":"ú","uarr":"↑","Uarr":"↟","uArr":"⇑","Uarrocir":"⥉","Ubrcy":"Ў","ubrcy":"ў","Ubreve":"Ŭ","ubreve":"ŭ","Ucirc":"Û","ucirc":"û","Ucy":"У","ucy":"у","udarr":"⇅","Udblac":"Ű","udblac":"ű","udhar":"⥮","ufisht":"⥾","Ufr":"𝔘","ufr":"𝔲","Ugrave":"Ù","ugrave":"ù","uHar":"⥣","uharl":"↿","uharr":"↾","uhblk":"▀","ulcorn":"⌜","ulcorner":"⌜","ulcrop":"⌏","ultri":"◸","Umacr":"Ū","umacr":"ū","uml":"¨","UnderBar":"_","UnderBrace":"⏟","UnderBracket":"⎵","UnderParenthesis":"⏝","Union":"⋃","UnionPlus":"⊎","Uogon":"Ų","uogon":"ų","Uopf":"𝕌","uopf":"𝕦","UpArrowBar":"⤒","uparrow":"↑","UpArrow":"↑","Uparrow":"⇑","UpArrowDownArrow":"⇅","updownarrow":"↕","UpDownArrow":"↕","Updownarrow":"⇕","UpEquilibrium":"⥮","upharpoonleft":"↿","upharpoonright":"↾","uplus":"⊎","UpperLeftArrow":"↖","UpperRightArrow":"↗","upsi":"υ","Upsi":"ϒ","upsih":"ϒ","Upsilon":"Υ","upsilon":"υ","UpTeeArrow":"↥","UpTee":"⊥","upuparrows":"⇈","urcorn":"⌝","urcorner":"⌝","urcrop":"⌎","Uring":"Ů","uring":"ů","urtri":"◹","Uscr":"𝒰","uscr":"𝓊","utdot":"⋰","Utilde":"Ũ","utilde":"ũ","utri":"▵","utrif":"▴","uuarr":"⇈","Uuml":"Ü","uuml":"ü","uwangle":"⦧","vangrt":"⦜","varepsilon":"ϵ","varkappa":"ϰ","varnothing":"∅","varphi":"ϕ","varpi":"ϖ","varpropto":"∝","varr":"↕","vArr":"⇕","varrho":"ϱ","varsigma":"ς","varsubsetneq":"⊊︀","varsubsetneqq":"⫋︀","varsupsetneq":"⊋︀","varsupsetneqq":"⫌︀","vartheta":"ϑ","vartriangleleft":"⊲","vartriangleright":"⊳","vBar":"⫨","Vbar":"⫫","vBarv":"⫩","Vcy":"В","vcy":"в","vdash":"⊢","vDash":"⊨","Vdash":"⊩","VDash":"⊫","Vdashl":"⫦","veebar":"⊻","vee":"∨","Vee":"⋁","veeeq":"≚","vellip":"⋮","verbar":"|","Verbar":"‖","vert":"|","Vert":"‖","VerticalBar":"∣","VerticalLine":"|","VerticalSeparator":"❘","VerticalTilde":"≀","VeryThinSpace":" ","Vfr":"𝔙","vfr":"𝔳","vltri":"⊲","vnsub":"⊂⃒","vnsup":"⊃⃒","Vopf":"𝕍","vopf":"𝕧","vprop":"∝","vrtri":"⊳","Vscr":"𝒱","vscr":"𝓋","vsubnE":"⫋︀","vsubne":"⊊︀","vsupnE":"⫌︀","vsupne":"⊋︀","Vvdash":"⊪","vzigzag":"⦚","Wcirc":"Ŵ","wcirc":"ŵ","wedbar":"⩟","wedge":"∧","Wedge":"⋀","wedgeq":"≙","weierp":"℘","Wfr":"𝔚","wfr":"𝔴","Wopf":"𝕎","wopf":"𝕨","wp":"℘","wr":"≀","wreath":"≀","Wscr":"𝒲","wscr":"𝓌","xcap":"⋂","xcirc":"◯","xcup":"⋃","xdtri":"▽","Xfr":"𝔛","xfr":"𝔵","xharr":"⟷","xhArr":"⟺","Xi":"Ξ","xi":"ξ","xlarr":"⟵","xlArr":"⟸","xmap":"⟼","xnis":"⋻","xodot":"⨀","Xopf":"𝕏","xopf":"𝕩","xoplus":"⨁","xotime":"⨂","xrarr":"⟶","xrArr":"⟹","Xscr":"𝒳","xscr":"𝓍","xsqcup":"⨆","xuplus":"⨄","xutri":"△","xvee":"⋁","xwedge":"⋀","Yacute":"Ý","yacute":"ý","YAcy":"Я","yacy":"я","Ycirc":"Ŷ","ycirc":"ŷ","Ycy":"Ы","ycy":"ы","yen":"¥","Yfr":"𝔜","yfr":"𝔶","YIcy":"Ї","yicy":"ї","Yopf":"𝕐","yopf":"𝕪","Yscr":"𝒴","yscr":"𝓎","YUcy":"Ю","yucy":"ю","yuml":"ÿ","Yuml":"Ÿ","Zacute":"Ź","zacute":"ź","Zcaron":"Ž","zcaron":"ž","Zcy":"З","zcy":"з","Zdot":"Ż","zdot":"ż","zeetrf":"ℨ","ZeroWidthSpace":"​","Zeta":"Ζ","zeta":"ζ","zfr":"𝔷","Zfr":"ℨ","ZHcy":"Ж","zhcy":"ж","zigrarr":"⇝","zopf":"𝕫","Zopf":"ℤ","Zscr":"𝒵","zscr":"𝓏","zwj":"‍","zwnj":"‌"}')}},n={};function r(e){var i=n[e];if(void 0!==i)return i.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}r.m=t,e=[],r.O=function(t,n,i,o){if(!n){var a=1/0;for(u=0;u=o)&&Object.keys(r.O).every((function(e){return r.O[e](n[c])}))?n.splice(c--,1):(s=!1,o0&&e[u-1][2]>o;u--)e[u]=e[u-1];e[u]=[n,i,o]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){var e={143:0,826:0,905:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var i,o,a=n[0],s=n[1],c=n[2],l=0;if(a.some((function(t){return 0!==e[t]}))){for(i in s)r.o(s,i)&&(r.m[i]=s[i]);if(c)var u=c(r)}for(t&&t(n);l array('react', 'react-dom', 'wp-element'), 'version' => 'fb8db3223eb3f6563850'); diff --git a/lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.js b/lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.js deleted file mode 100644 index 185a30aa..00000000 --- a/lib/wp-graphql-1.17.0/build/graphiqlAuthSwitch.js +++ /dev/null @@ -1,5 +0,0 @@ -!function(){var e={4184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;tl))return!1;var p=s.get(e),d=s.get(t);if(p&&d)return p==t&&d==e;var h=-1,v=!0,m=2&n?new r:void 0;for(s.set(e,t),s.set(t,e);++h-1&&e%1==0&&e-1}},4705:function(e,t,n){var r=n(8470);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4785:function(e,t,n){var r=n(1989),o=n(8407),i=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1285:function(e,t,n){var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:function(e,t,n){var r=n(5050);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},4536:function(e,t,n){var r=n(852)(Object,"create");e.exports=r},6916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},1167:function(e,t,n){e=n.nmd(e);var r=n(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,c=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=c},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5639:function(e,t,n){var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:function(e){e.exports=function(e){return this.__data__.has(e)}},1814:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},7465:function(e,t,n){var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,n){var r=n(8407),o=n(7071),i=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},5694:function(e,t,n){var r=n(9454),o=n(7005),i=Object.prototype,a=i.hasOwnProperty,c=i.propertyIsEnumerable,s=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!c.call(e,"callee")};e.exports=s},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var r=n(3560),o=n(1780);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},4144:function(e,t,n){e=n.nmd(e);var r=n(5639),o=n(5062),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,c=a&&a.exports===i?r.Buffer:void 0,s=(c?c.isBuffer:void 0)||o;e.exports=s},8446:function(e,t,n){var r=n(939);e.exports=function(e,t){return r(e,t)}},3560:function(e,t,n){var r=n(4239),o=n(3218);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},6719:function(e,t,n){var r=n(8749),o=n(1717),i=n(1167),a=i&&i.isTypedArray,c=a?o(a):r;e.exports=c},3674:function(e,t,n){var r=n(4636),o=n(280),i=n(8612);e.exports=function(e){return i(e)?r(e):o(e)}},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},1162:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,c=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,u=n?Symbol.for("react.context"):60110,l=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,h=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),v=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");function m(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case l:case f:case i:case c:case a:case d:return e;default:switch(e=e&&e.$$typeof){case u:case p:case v:case h:case s:return e;default:return t}}case o:return t}}}t.isFragment=function(e){return m(e)===i},t.isMemo=function(e){return m(e)===h}},1805:function(e,t,n){"use strict";e.exports=n(1162)},9921:function(e,t){"use strict";var n=60103,r=60106,o=60107,i=60108,a=60114,c=60109,s=60110,u=60112,l=60113,f=60120,p=60115,d=60116,h=60121,v=60122,m=60117,g=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var b=Symbol.for;n=b("react.element"),r=b("react.portal"),o=b("react.fragment"),i=b("react.strict_mode"),a=b("react.profiler"),c=b("react.provider"),s=b("react.context"),u=b("react.forward_ref"),l=b("react.suspense"),f=b("react.suspense_list"),p=b("react.memo"),d=b("react.lazy"),h=b("react.block"),v=b("react.server.block"),m=b("react.fundamental"),g=b("react.debug_trace_mode"),y=b("react.legacy_hidden")}t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===a||e===g||e===i||e===l||e===f||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===p||e.$$typeof===c||e.$$typeof===s||e.$$typeof===u||e.$$typeof===m||e.$$typeof===h||e[0]===v)},t.typeOf=function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case a:case i:case l:case f:return e;default:switch(e=e&&e.$$typeof){case s:case u:case d:case p:case c:return e;default:return t}}case r:return t}}}},9864:function(e,t,n){"use strict";e.exports=n(9921)},6774:function(e){e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(t),s=0;s(0,e.useContext)(r),i=n=>{let{children:o}=n;const[i,a]=(0,e.useState)((()=>{var e;const t=null===(e=window)||void 0===e?void 0:e.localStorage.getItem("graphiql:usePublicFetcher");return!(t&&"false"===t)})()),c=t.applyFilters("graphiql_auth_switch_context_default_value",{usePublicFetcher:i,setUsePublicFetcher:a,toggleUsePublicFetcher:()=>{const e=!i;window.localStorage.setItem("graphiql:usePublicFetcher",e.toString()),a(e)}});return(0,e.createElement)(r.Provider,{value:c},o)};function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var m=window.React,g=n.n(m);function y(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function b(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1,n=T+=1;function r(t){if(0===t)R(n),e();else{var o=A((function(){r(t-1)}));M.set(n,o)}}return r(t),n}function D(e,t){return!!e&&e.contains(t)}function L(e){return e instanceof HTMLElement?e:P().findDOMNode(e)}N.cancel=function(e){var t=M.get(e);return R(t),j(t)};var I=n(1805);function z(e,t){"function"==typeof e?e(t):"object"===p(e)&&e&&"current"in e&&(e.current=t)}function F(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:2;t();var i=N((function(){o<=1?r({isCanceled:function(){return i!==e.current}}):n(r,o-1)}));e.current=i},t]}(),a=s(i,2),c=a[0],u=a[1];return ge((function(){if(r!==fe&&r!==ve){var e=ye.indexOf(r),n=ye[e+1],i=t(r);!1===i?o(n,!0):c((function(e){function t(){e.isCanceled()||o(n,!0)}!0===i?t():Promise.resolve(i).then(t)}))}}),[e,r]),m.useEffect((function(){return function(){u()}}),[]),[function(){o(pe,!0)},r]}(R,(function(e){if(e===pe){var t=Y.prepare;return!!t&&t(V())}var n;return X in Y&&z((null===(n=Y[X])||void 0===n?void 0:n.call(Y,V(),null))||null),X===he&&(q(V()),p>0&&(clearTimeout(H.current),H.current=setTimeout((function(){B({deadline:!0})}),p))),!0})),2),G=U[0],X=U[1],Z=be(X);$.current=Z,ge((function(){T(t);var n,r=F.current;F.current=!0,e&&(!r&&t&&u&&(n=se),r&&t&&i&&(n=ue),(r&&!t&&f||!r&&d&&!t&&f)&&(n=le),n&&(D(n),G()))}),[t]),(0,m.useEffect)((function(){(R===se&&!u||R===ue&&!i||R===le&&!f)&&D(ce)}),[u,i,f]),(0,m.useEffect)((function(){return function(){F.current=!1,clearTimeout(H.current)}}),[]),(0,m.useEffect)((function(){void 0!==j&&R===ce&&(null==P||P(j))}),[j,R]);var K=I;return Y.prepare&&X===de&&(K=h({transition:"none"},K)),[R,X,K,null!=j?j:t]}var xe=function(e){k(n,e);var t=S(n);function n(){return y(this,n),t.apply(this,arguments)}return w(n,[{key:"render",value:function(){return this.props.children}}]),n}(m.Component),Ce=xe,ke=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===p(e)&&(t=e.transitionSupport);var r=m.forwardRef((function(e,t){var r=e.visible,o=void 0===r||r,i=e.removeOnLeave,c=void 0===i||i,u=e.forceRender,l=e.children,p=e.motionName,d=e.leavedClassName,v=e.eventProps,g=n(e),y=(0,m.useRef)(),b=(0,m.useRef)(),w=s(we(g,o,(function(){try{return y.current instanceof HTMLElement?y.current:L(b.current)}catch(e){return null}}),e),4),x=w[0],C=w[1],k=w[2],O=w[3],E=m.useRef(O);O&&(E.current=!0);var S,_=m.useCallback((function(e){y.current=e,z(t,e)}),[t]),P=h(h({},v),{},{visible:o});if(l)if(x!==ce&&n(e)){var A,j;C===pe?j="prepare":be(C)?j="active":C===de&&(j="start"),S=l(h(h({},P),{},{className:f()(ae(p,x),(A={},a(A,ae(p,"".concat(x,"-").concat(j)),j),a(A,p,"string"==typeof p),A)),style:k}),_)}else S=O?l(h({},P),_):!c&&E.current?l(h(h({},P),{},{className:d}),_):u?l(h(h({},P),{},{style:{display:"none"}}),_):null;else S=null;return m.isValidElement(S)&&H(S)&&(S.ref||(S=m.cloneElement(S,{ref:_}))),m.createElement(Ce,{ref:b},S)}));return r.displayName="CSSMotion",r}(re),Oe="add",Ee="keep",Se="remove",_e="removed";function Pe(e){var t;return h(h({},t=e&&"object"===p(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function Ae(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(Pe)}function je(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,i=Ae(e),a=Ae(t);i.forEach((function(e){for(var t=!1,i=r;i1}));return s.forEach((function(e){(n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==Se}))).forEach((function(t){t.key===e&&(t.status=Ee)}))})),n}var Te=["component","children","onVisibleChanged","onAllRemoved"],Me=["status"],Re=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];!function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ke,n=function(e){k(r,e);var n=S(r);function r(){var e;y(this,r);for(var t=arguments.length,o=new Array(t),i=0;i=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function Et(e){var t,n,r;if(wt.isWindow(e)||9===e.nodeType){var o=wt.getWindow(e);t={left:wt.getWindowScrollLeft(o),top:wt.getWindowScrollTop(o)},n=wt.viewportWidth(o),r=wt.viewportHeight(o)}else t=wt.offset(e),n=wt.outerWidth(e),r=wt.outerHeight(e);return t.width=n,t.height=r,t}function St(e,t){var n=t.charAt(0),r=t.charAt(1),o=e.width,i=e.height,a=e.left,c=e.top;return"c"===n?c+=i/2:"b"===n&&(c+=i),"c"===r?a+=o/2:"r"===r&&(a+=o),{left:a,top:c}}function _t(e,t,n,r,o){var i=St(t,n[1]),a=St(e,n[0]),c=[a.left-i.left,a.top-i.top];return{left:Math.round(e.left-c[0]+r[0]-o[0]),top:Math.round(e.top-c[1]+r[1]-o[1])}}function Pt(e,t,n){return e.leftn.right}function At(e,t,n){return e.topn.bottom}function jt(e,t,n){var r=[];return wt.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function Tt(e,t){return e[t]=-e[t],e}function Mt(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function Rt(e,t){e[0]=Mt(e[0],t.width),e[1]=Mt(e[1],t.height)}function Nt(e,t,n,r){var o=n.points,i=n.offset||[0,0],a=n.targetOffset||[0,0],c=n.overflow,s=n.source||e;i=[].concat(i),a=[].concat(a);var u={},l=0,f=Ot(s,!(!(c=c||{})||!c.alwaysByViewport)),p=Et(s);Rt(i,p),Rt(a,t);var d=_t(p,t,o,i,a),h=wt.merge(p,d);if(f&&(c.adjustX||c.adjustY)&&r){if(c.adjustX&&Pt(d,p,f)){var v=jt(o,/[lr]/gi,{l:"r",r:"l"}),m=Tt(i,0),g=Tt(a,0);(function(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.left&&o.left+i.width>n.right&&(i.width-=o.left+i.width-n.right),r.adjustX&&o.left+i.width>n.right&&(o.left=Math.max(n.right-i.width,n.left)),r.adjustY&&o.top=n.top&&o.top+i.height>n.bottom&&(i.height-=o.top+i.height-n.bottom),r.adjustY&&o.top+i.height>n.bottom&&(o.top=Math.max(n.bottom-i.height,n.top)),wt.mix(o,i)}(d,p,f,u))}return h.width!==p.width&&wt.css(s,"width",wt.width(s)+h.width-p.width),h.height!==p.height&&wt.css(s,"height",wt.height(s)+h.height-p.height),wt.offset(s,{left:h.left,top:h.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:o,offset:i,targetOffset:a,overflow:u}}function Dt(e,t,n){var r=n.target||t,o=Et(r),i=!function(e,t){var n=Ot(e,t),r=Et(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return Nt(e,o,n,i)}Dt.__getOffsetParent=Ct,Dt.__getVisibleRectForElement=Ot;var Lt=n(8446),It=n.n(Lt),zt=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){Ft&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Bt?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){Ft&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t;$t.some((function(e){return!!~n.indexOf(e)}))&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),qt=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),nn="undefined"!=typeof WeakMap?new WeakMap:new zt,rn=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=Wt.getInstance(),r=new tn(t,n,this);nn.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){rn.prototype[e]=function(){var t;return(t=nn.get(this))[e].apply(t,arguments)}}));var on=void 0!==Ht.ResizeObserver?Ht.ResizeObserver:rn;function an(e,t){var n=null,r=null,o=new on((function(e){var o=s(e,1)[0].target;if(document.documentElement.contains(o)){var i=o.getBoundingClientRect(),a=i.width,c=i.height,u=Math.floor(a),l=Math.floor(c);n===u&&r===l||Promise.resolve().then((function(){t({width:u,height:l})})),n=u,r=l}}));return e&&o.observe(e),function(){o.disconnect()}}function cn(e){return"function"!=typeof e?null:e()}function sn(e){return"object"===p(e)&&e?e:null}var un=function(e,t){var n=e.children,r=e.disabled,o=e.target,i=e.align,a=e.onAlign,c=e.monitorWindowResize,u=e.monitorBufferTime,l=void 0===u?0:u,f=g().useRef({}),p=g().useRef(),d=g().Children.only(n),h=g().useRef({});h.current.disabled=r,h.current.target=o,h.current.align=i,h.current.onAlign=a;var v=function(e,t){var n=g().useRef(!1),r=g().useRef(null);function o(){window.clearTimeout(r.current)}return[function e(i){if(o(),n.current&&!0!==i)r.current=window.setTimeout((function(){n.current=!1,e()}),t);else{if(!1===function(){var e=h.current,t=e.disabled,n=e.target,r=e.align,o=e.onAlign;if(!t&&n){var i,a=p.current,c=cn(n),s=sn(n);f.current.element=c,f.current.point=s,f.current.align=r;var u=document.activeElement;return c&&function(e){if(!e)return!1;if(e.offsetParent)return!0;if(e.getBBox){var t=e.getBBox();if(t.width||t.height)return!0}if(e.getBoundingClientRect){var n=e.getBoundingClientRect();if(n.width||n.height)return!0}return!1}(c)?i=Dt(a,c,r):s&&(i=function(e,t,n){var r,o,i=wt.getDocument(e),a=i.defaultView||i.parentWindow,c=wt.getWindowScrollLeft(a),s=wt.getWindowScrollTop(a),u=wt.viewportWidth(a),l=wt.viewportHeight(a),f={left:r="pageX"in t?t.pageX:c+t.clientX,top:o="pageY"in t?t.pageY:s+t.clientY,width:0,height:0},p=r>=0&&r<=c+u&&o>=0&&o<=s+l,d=[n.points[0],"cc"];return Nt(e,f,Fe(Fe({},n),{},{points:d}),p)}(a,s,r)),function(e,t){e!==document.activeElement&&D(t,e)&&"function"==typeof e.focus&&e.focus()}(u,a),o&&i&&o(a,i),!0}return!1}())return;n.current=!0,r.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,o()}]}(0,l),m=s(v,2),y=m[0],b=m[1],w=g().useRef({cancel:function(){}}),x=g().useRef({cancel:function(){}});g().useEffect((function(){var e,t,n=cn(o),r=sn(o);p.current!==x.current.element&&(x.current.cancel(),x.current.element=p.current,x.current.cancel=an(p.current,y)),f.current.element===n&&((e=f.current.point)===(t=r)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&It()(f.current.align,i)||(y(),w.current.element!==n&&(w.current.cancel(),w.current.element=n,w.current.cancel=an(n,y)))})),g().useEffect((function(){r?b():y()}),[r]);var C=g().useRef(null);return g().useEffect((function(){c?C.current||(C.current=V(window,"resize",y)):C.current&&(C.current.remove(),C.current=null)}),[c]),g().useEffect((function(){return function(){w.current.cancel(),x.current.cancel(),C.current&&C.current.remove(),b()}}),[]),g().useImperativeHandle(t,(function(){return{forceAlign:function(){return y(!0)}}})),g().isValidElement(d)&&(d=g().cloneElement(d,{ref:F(d.ref,p)})),d},ln=g().forwardRef(un);ln.displayName="Align";var fn=ln,pn=$()?m.useLayoutEffect:m.useEffect;function dn(){dn=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new O(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=x(a,n);if(c){if(c===l)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=u(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===l)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var l={};function f(){}function d(){}function h(){}var v={};c(v,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(E([])));g&&g!==t&&n.call(g,o)&&(v=g);var y=h.prototype=f.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){function r(o,i,a,c){var s=u(e[o],e,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==p(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function x(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=u(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,l):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),k(n),l}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;k(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},e}function hn(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function vn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){hn(i,r,o,a,c,"next",e)}function c(e){hn(i,r,o,a,c,"throw",e)}a(void 0)}))}}var mn=["measure","alignPre","align",null,"motion"],gn=m.forwardRef((function(e,t){var n=e.visible,r=e.prefixCls,o=e.className,i=e.style,a=e.children,c=e.zIndex,l=e.stretch,p=e.destroyPopupOnHide,d=e.forceRender,v=e.align,g=e.point,y=e.getRootDomNode,b=e.getClassNameFromAlign,w=e.onAlign,x=e.onMouseEnter,C=e.onMouseLeave,k=e.onMouseDown,O=e.onTouchStart,E=e.onClick,S=(0,m.useRef)(),_=(0,m.useRef)(),P=s((0,m.useState)(),2),A=P[0],j=P[1],T=function(e){var t=s(m.useState({width:0,height:0}),2),n=t[0],r=t[1];return[m.useMemo((function(){var t={};if(e){var r=n.width,o=n.height;-1!==e.indexOf("height")&&o?t.height=o:-1!==e.indexOf("minHeight")&&o&&(t.minHeight=o),-1!==e.indexOf("width")&&r?t.width=r:-1!==e.indexOf("minWidth")&&r&&(t.minWidth=r)}return t}),[e,n]),function(e){r({width:e.offsetWidth,height:e.offsetHeight})}]}(l),M=s(T,2),R=M[0],D=M[1],L=function(e,t){var n=s(me(null),2),r=n[0],o=n[1],i=(0,m.useRef)();function a(e){o(e,!0)}function c(){N.cancel(i.current)}return(0,m.useEffect)((function(){a("measure")}),[e]),(0,m.useEffect)((function(){"measure"===r&&(l&&D(y())),r&&(i.current=N(vn(dn().mark((function e(){var t,n;return dn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=mn.indexOf(r),(n=mn[t+1])&&-1!==t&&a(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),(0,m.useEffect)((function(){return function(){c()}}),[]),[r,function(e){c(),i.current=N((function(){a((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(n),I=s(L,2),z=I[0],F=I[1],H=s((0,m.useState)(0),2),V=H[0],$=H[1],B=(0,m.useRef)();function W(){var e;null===(e=S.current)||void 0===e||e.forceAlign()}function q(e,t){var n=b(t);A!==n&&j(n),$((function(e){return e+1})),"align"===z&&(null==w||w(e,t))}pn((function(){"alignPre"===z&&$(0)}),[z]),pn((function(){"align"===z&&(V<2?W():F((function(){var e;null===(e=B.current)||void 0===e||e.call(B)})))}),[V]);var Y=h({},Le(e));function U(){return new Promise((function(e){B.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=Y[e];Y[e]=function(e,n){return F(),null==t?void 0:t(e,n)}})),m.useEffect((function(){Y.motionName||"motion"!==z||F()}),[Y.motionName,z]),m.useImperativeHandle(t,(function(){return{forceAlign:W,getElement:function(){return _.current}}}));var G=h(h({},R),{},{zIndex:c,opacity:"motion"!==z&&"stable"!==z&&n?0:void 0,pointerEvents:n||"stable"===z?void 0:"none"},i),X=!0;!(null==v?void 0:v.points)||"align"!==z&&"stable"!==z||(X=!1);var Z=a;return m.Children.count(a)>1&&(Z=m.createElement("div",{className:"".concat(r,"-content")},a)),m.createElement(De,u({visible:n,ref:_,leavedClassName:"".concat(r,"-hidden")},Y,{onAppearPrepare:U,onEnterPrepare:U,removeOnLeave:p,forceRender:d}),(function(e,t){var n=e.className,i=e.style,a=f()(r,o,A,n);return m.createElement(fn,{target:g||y,key:"popup",ref:S,monitorWindowResize:!0,disabled:X,align:v,onAlign:q},m.createElement("div",{ref:t,className:a,onMouseEnter:x,onMouseLeave:C,onMouseDownCapture:k,onTouchStartCapture:O,onClick:E,style:h(h({},i),G)},Z))}))}));gn.displayName="PopupInner";var yn=gn,bn=m.forwardRef((function(e,t){var n=e.prefixCls,r=e.visible,o=e.zIndex,i=e.children,a=e.mobile,c=(a=void 0===a?{}:a).popupClassName,s=a.popupStyle,l=a.popupMotion,p=void 0===l?{}:l,d=a.popupRender,v=e.onClick,g=m.useRef();m.useImperativeHandle(t,(function(){return{forceAlign:function(){},getElement:function(){return g.current}}}));var y=h({zIndex:o},s),b=i;return m.Children.count(i)>1&&(b=m.createElement("div",{className:"".concat(n,"-content")},i)),d&&(b=d(b)),m.createElement(De,u({visible:r,ref:g,removeOnLeave:!0},p),(function(e,t){var r=e.className,o=e.style,i=f()(n,c,r);return m.createElement("div",{ref:t,className:i,onClick:v,style:h(h({},o),y)},b)}))}));bn.displayName="MobilePopupInner";var wn=bn,xn=["visible","mobile"],Cn=m.forwardRef((function(e,t){var n=e.visible,r=e.mobile,o=v(e,xn),i=s((0,m.useState)(n),2),a=i[0],c=i[1],l=s((0,m.useState)(!1),2),f=l[0],p=l[1],d=h(h({},o),{},{visible:a});(0,m.useEffect)((function(){c(n),n&&r&&p(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4)))}())}),[n,r]);var g=f?m.createElement(wn,u({},d,{mobile:r,ref:t})):m.createElement(yn,u({},d,{ref:t}));return m.createElement("div",null,m.createElement(Ie,d),g)}));Cn.displayName="Popup";var kn=Cn,On=m.createContext(null);function En(){}var Sn,Pn,An,jn=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"],Tn=(Sn=W,Pn=function(e){k(n,e);var t=S(n);function n(e){var r,o;return y(this,n),(r=t.call(this,e)).popupRef=m.createRef(),r.triggerRef=m.createRef(),r.portalContainer=void 0,r.attachId=void 0,r.clickOutsideHandler=void 0,r.touchOutsideHandler=void 0,r.contextMenuOutsideHandler1=void 0,r.contextMenuOutsideHandler2=void 0,r.mouseDownTimeout=void 0,r.focusTime=void 0,r.preClickTime=void 0,r.preTouchTime=void 0,r.delayTimer=void 0,r.hasPopupMouseDown=void 0,r.onMouseEnter=function(e){var t=r.props.mouseEnterDelay;r.fireEvents("onMouseEnter",e),r.delaySetPopupVisible(!0,t,t?null:e)},r.onMouseMove=function(e){r.fireEvents("onMouseMove",e),r.setPoint(e)},r.onMouseLeave=function(e){r.fireEvents("onMouseLeave",e),r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)},r.onPopupMouseEnter=function(){r.clearDelayTimer()},r.onPopupMouseLeave=function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&D(null===(t=r.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||r.delaySetPopupVisible(!1,r.props.mouseLeaveDelay)},r.onFocus=function(e){r.fireEvents("onFocus",e),r.clearDelayTimer(),r.isFocusToShow()&&(r.focusTime=Date.now(),r.delaySetPopupVisible(!0,r.props.focusDelay))},r.onMouseDown=function(e){r.fireEvents("onMouseDown",e),r.preClickTime=Date.now()},r.onTouchStart=function(e){r.fireEvents("onTouchStart",e),r.preTouchTime=Date.now()},r.onBlur=function(e){r.fireEvents("onBlur",e),r.clearDelayTimer(),r.isBlurToHide()&&r.delaySetPopupVisible(!1,r.props.blurDelay)},r.onContextMenu=function(e){e.preventDefault(),r.fireEvents("onContextMenu",e),r.setPopupVisible(!0,e)},r.onContextMenuClose=function(){r.isContextMenuToShow()&&r.close()},r.onClick=function(e){if(r.fireEvents("onClick",e),r.focusTime){var t;if(r.preClickTime&&r.preTouchTime?t=Math.min(r.preClickTime,r.preTouchTime):r.preClickTime?t=r.preClickTime:r.preTouchTime&&(t=r.preTouchTime),Math.abs(t-r.focusTime)<20)return;r.focusTime=0}r.preClickTime=0,r.preTouchTime=0,r.isClickToShow()&&(r.isClickToHide()||r.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!r.state.popupVisible;(r.isClickToHide()&&!n||n&&r.isClickToShow())&&r.setPopupVisible(!r.state.popupVisible,e)},r.onPopupMouseDown=function(){var e;r.hasPopupMouseDown=!0,clearTimeout(r.mouseDownTimeout),r.mouseDownTimeout=window.setTimeout((function(){r.hasPopupMouseDown=!1}),0),r.context&&(e=r.context).onPopupMouseDown.apply(e,arguments)},r.onDocumentClick=function(e){if(!r.props.mask||r.props.maskClosable){var t=e.target,n=r.getRootDomNode(),o=r.getPopupDomNode();D(n,t)&&!r.isContextMenuOnly()||D(o,t)||r.hasPopupMouseDown||r.close()}},r.getRootDomNode=function(){var e=r.props.getTriggerDOMNode;if(e)return e(r.triggerRef.current);try{var t=L(r.triggerRef.current);if(t)return t}catch(e){}return P().findDOMNode(x(r))},r.getPopupClassNameFromAlign=function(e){var t=[],n=r.props,o=n.popupPlacement,i=n.builtinPlacements,a=n.prefixCls,c=n.alignPoint,s=n.getPopupClassNameFromAlign;return o&&i&&t.push(function(e,t,n,r){for(var o=n.points,i=Object.keys(e),a=0;a=0||r.indexOf("Bottom")>=0?i.top="".concat(o.height-t.offset[1],"px"):(r.indexOf("Top")>=0||r.indexOf("bottom")>=0)&&(i.top="".concat(-t.offset[1],"px")),r.indexOf("left")>=0||r.indexOf("Right")>=0?i.left="".concat(o.width-t.offset[0],"px"):(r.indexOf("right")>=0||r.indexOf("Left")>=0)&&(i.left="".concat(-t.offset[0],"px")),e.style.transformOrigin="".concat(i.left," ").concat(i.top)}},overlayInnerStyle:L,arrowContent:m.createElement("span",{className:"".concat(S,"-arrow-content"),style:A}),motion:{motionName:Bn(_,"zoom-big-fast",e.transitionName),motionDeadline:1e3}}),P?Xn(M,{className:N}):M)}));Kn.defaultProps={placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0};var Qn=Kn;function Jn(e){return-1!==$n.indexOf(e)}function er(e){var t,n=e.prefixCls,r=e.value,o=e.current,i=e.offset,a=void 0===i?0:i;return a&&(t={position:"absolute",top:"".concat(a,"00%"),left:0}),m.createElement("span",{style:t,className:f()("".concat(n,"-only-unit"),{current:o})},r)}function tr(e,t,n){for(var r=e,o=0;(r+10)%10!==t;)r+=n,o+=n;return o}function nr(e){var t,n,r=e.prefixCls,o=e.count,i=e.value,a=Number(i),c=Math.abs(o),l=s(m.useState(a),2),f=l[0],p=l[1],d=s(m.useState(c),2),h=d[0],v=d[1],g=function(){p(a),v(c)};if(m.useEffect((function(){var e=setTimeout((function(){g()}),1e3);return function(){clearTimeout(e)}}),[a]),f===a||Number.isNaN(a)||Number.isNaN(f))t=[m.createElement(er,u({},e,{key:a,current:!0}))],n={transition:"none"};else{t=[];for(var y=a+10,b=[],w=a;w<=y;w+=1)b.push(w);var x=b.findIndex((function(e){return e%10===f}));t=b.map((function(t,n){var r=t%10;return m.createElement(er,u({},e,{key:t,value:r,offset:n-x,current:n===x}))})),n={transform:"translateY(".concat(-tr(f,a,hg?"".concat(g,"+"):h,N=null!=c||null!=l,D="0"===R||0===R,L=b&&!D,I=L?"":R,z=(0,m.useMemo)((function(){return(null==I||""===I||D&&!_)&&!L}),[I,D,_,L]),F=(0,m.useRef)(h);z||(F.current=h);var H=F.current,V=(0,m.useRef)(I);z||(V.current=I);var $=V.current,B=(0,m.useRef)(L);z||(B.current=L);var W=(0,m.useMemo)((function(){if(!k)return u({},O);var e={marginTop:k[1]};return"rtl"===T?e.left=parseInt(k[0],10):e.right=-parseInt(k[0],10),u(u({},e),O)}),[T,k,O]),q=null!=C?C:"string"==typeof H||"number"==typeof H?H:void 0,Y=z||!s?null:m.createElement("span",{className:"".concat(M,"-status-text")},s),U=H&&"object"===p(H)?Xn(H,(function(e){return{style:u(u({},W),e.style)}})):void 0,G=f()((a(t={},"".concat(M,"-status-dot"),N),a(t,"".concat(M,"-status-").concat(c),!!c),a(t,"".concat(M,"-status-").concat(l),Jn(l)),t)),X={};l&&!Jn(l)&&(X.background=l);var Z=f()(M,(a(n={},"".concat(M,"-status"),N),a(n,"".concat(M,"-not-a-wrapper"),!i),a(n,"".concat(M,"-rtl"),"rtl"===T),n),E);if(!i&&N){var K=W.color;return m.createElement("span",u({},P,{className:Z,style:W}),m.createElement("span",{className:G,style:X}),m.createElement("span",{style:{color:K},className:"".concat(M,"-status-text")},s))}return m.createElement("span",u({},P,{className:Z}),i,m.createElement(De,{visible:!z,motionName:"".concat(M,"-zoom"),motionAppear:!1,motionDeadline:1e3},(function(e){var t,n=e.className,r=j("scroll-number",o),i=B.current,s=f()((a(t={},"".concat(M,"-dot"),i),a(t,"".concat(M,"-count"),!i),a(t,"".concat(M,"-count-sm"),"small"===x),a(t,"".concat(M,"-multiple-words"),!i&&$&&$.toString().length>1),a(t,"".concat(M,"-status-").concat(c),!!c),a(t,"".concat(M,"-status-").concat(l),Jn(l)),t)),p=u({},W);return l&&!Jn(l)&&((p=p||{}).background=l),m.createElement(rr,{prefixCls:r,show:!z,motionClassName:n,className:s,count:$,title:q,style:p,key:"scrollNumber"},U)})),Y)};or.Ribbon=function(e){var t,n=e.className,r=e.prefixCls,o=e.style,i=e.color,c=e.children,s=e.text,l=e.placement,p=void 0===l?"end":l,d=m.useContext(Hn),h=d.getPrefixCls,v=d.direction,g=h("ribbon",r),y=Jn(i),b=f()(g,"".concat(g,"-placement-").concat(p),(a(t={},"".concat(g,"-rtl"),"rtl"===v),a(t,"".concat(g,"-color-").concat(i),y),t),n),w={},x={};return i&&!y&&(w.background=i,x.color=i),m.createElement("div",{className:"".concat(g,"-wrapper")},c,m.createElement("div",{className:b,style:u(u({},w),o)},m.createElement("span",{className:"".concat(g,"-text")},s),m.createElement("div",{className:"".concat(g,"-corner"),style:x})))};var ir=or;function ar(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];return g().Children.forEach(e,(function(e){(null!=e||t.keepEmpty)&&(Array.isArray(e)?n=n.concat(ar(e)):(0,I.isFragment)(e)&&e.props?n=n.concat(ar(e.props.children,t)):n.push(e))})),n}var cr={};function sr(e,t){}var ur=function(e,t){!function(e,t,n){t||cr[n]||(e(!1,n),cr[n]=!0)}(sr,e,t)},lr=new Map,fr=new on((function(e){e.forEach((function(e){var t,n=e.target;null===(t=lr.get(n))||void 0===t||t.forEach((function(e){return e(n)}))}))})),pr=function(e){k(n,e);var t=S(n);function n(){return y(this,n),t.apply(this,arguments)}return w(n,[{key:"render",value:function(){return this.props.children}}]),n}(m.Component),dr=m.createContext(null);function hr(e){var t=e.children,n=e.disabled,r=m.useRef(null),o=m.useRef(null),i=m.useContext(dr),a="function"==typeof t,c=a?t(r):t,s=m.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),u=!a&&m.isValidElement(c)&&H(c),l=u?c.ref:null,f=m.useMemo((function(){return F(l,r)}),[l,r]),p=m.useRef(e);p.current=e;var d=m.useCallback((function(e){var t=p.current,n=t.onResize,r=t.data,o=e.getBoundingClientRect(),a=o.width,c=o.height,u=e.offsetWidth,l=e.offsetHeight,f=Math.floor(a),d=Math.floor(c);if(s.current.width!==f||s.current.height!==d||s.current.offsetWidth!==u||s.current.offsetHeight!==l){var v={width:f,height:d,offsetWidth:u,offsetHeight:l};s.current=v;var m=u===Math.round(a)?a:u,g=l===Math.round(c)?c:l,y=h(h({},v),{},{offsetWidth:m,offsetHeight:g});null==i||i(y,e,r),n&&Promise.resolve().then((function(){n(y,e)}))}}),[]);return m.useEffect((function(){var e,t,i=L(r.current)||L(o.current);return i&&!n&&(e=i,t=d,lr.has(e)||(lr.set(e,new Set),fr.observe(e)),lr.get(e).add(t)),function(){return function(e,t){lr.has(e)&&(lr.get(e).delete(t),lr.get(e).size||(fr.unobserve(e),lr.delete(e)))}(i,d)}}),[r.current,n]),m.createElement(pr,{ref:o},u?m.cloneElement(c,{ref:f}):c)}function vr(e){var t=e.children;return("function"==typeof t?[t]:ar(t)).map((function(t,n){var r=(null==t?void 0:t.key)||"".concat("rc-observer-key","-").concat(n);return m.createElement(hr,u({},e,{key:r}),t)}))}vr.Collection=function(e){var t=e.children,n=e.onBatchResize,r=m.useRef(0),o=m.useRef([]),i=m.useContext(dr),a=m.useCallback((function(e,t,a){r.current+=1;var c=r.current;o.current.push({size:e,element:t,data:a}),Promise.resolve().then((function(){c===r.current&&(null==n||n(o.current),o.current=[])})),null==i||i(e,t,a)}),[n,i]);return m.createElement(dr.Provider,{value:a},t)};var mr=vr;function gr(){var e=m.useReducer((function(e){return e+1}),0);return s(e,2)[1]}var yr=["xxl","xl","lg","md","sm","xs"],br={xs:"(max-width: 575px)",sm:"(min-width: 576px)",md:"(min-width: 768px)",lg:"(min-width: 992px)",xl:"(min-width: 1200px)",xxl:"(min-width: 1600px)"},wr=new Map,xr=-1,Cr={},kr={matchHandlers:{},dispatch:function(e){return Cr=e,wr.forEach((function(e){return e(Cr)})),wr.size>=1},subscribe:function(e){return wr.size||this.register(),xr+=1,wr.set(xr,e),e(Cr),xr},unsubscribe:function(e){wr.delete(e),wr.size||this.unregister()},unregister:function(){var e=this;Object.keys(br).forEach((function(t){var n=br[t],r=e.matchHandlers[n];null==r||r.mql.removeListener(null==r?void 0:r.listener)})),wr.clear()},register:function(){var e=this;Object.keys(br).forEach((function(t){var n=br[t],r=function(n){var r=n.matches;e.dispatch(u(u({},Cr),a({},t,r)))},o=window.matchMedia(n);o.addListener(r),e.matchHandlers[n]={mql:o,listener:r},r(o)}))}},Or=m.createContext("default"),Er=function(e){var t=e.children,n=e.size;return m.createElement(Or.Consumer,null,(function(e){return m.createElement(Or.Provider,{value:n||e},t)}))},Sr=Or,_r=function(e,t){var n,r,o=m.useContext(Sr),i=s(m.useState(1),2),c=i[0],l=i[1],d=s(m.useState(!1),2),h=d[0],v=d[1],g=s(m.useState(!0),2),y=g[0],b=g[1],w=m.useRef(),x=m.useRef(),C=F(t,w),k=m.useContext(Hn).getPrefixCls,O=function(){if(x.current&&w.current){var t=x.current.offsetWidth,n=w.current.offsetWidth;if(0!==t&&0!==n){var r=e.gap,o=void 0===r?4:r;2*o0&&void 0!==arguments[0])||arguments[0],t=(0,m.useRef)({}),n=gr();return(0,m.useEffect)((function(){var r=kr.subscribe((function(r){t.current=r,e&&n()}));return function(){return kr.unsubscribe(r)}}),[]),t.current}(Object.keys("object"===p(z)&&z||{}).some((function(e){return["xs","sm","md","lg","xl","xxl"].includes(e)}))),V=m.useMemo((function(){if("object"!==p(z))return{};var e=yr.find((function(e){return H[e]})),t=z[e];return t?{width:t,height:t,lineHeight:"".concat(t,"px"),fontSize:T?t/2:18}:{}}),[H,z]),$=k("avatar",S),B=f()((a(n={},"".concat($,"-lg"),"large"===z),a(n,"".concat($,"-sm"),"small"===z),n)),W=m.isValidElement(A),q=f()($,B,(a(r={},"".concat($,"-").concat(_),!!_),a(r,"".concat($,"-image"),W||A&&y),a(r,"".concat($,"-icon"),!!T),r),M),Y="number"==typeof z?{width:z,height:z,lineHeight:"".concat(z,"px"),fontSize:T?z/2:18}:{};if("string"==typeof A&&y)E=m.createElement("img",{src:A,draggable:N,srcSet:j,onError:function(){var t=e.onError;!1!==(t?t():void 0)&&b(!1)},alt:R,crossOrigin:L});else if(W)E=A;else if(T)E=T;else if(h||1!==c){var U="scale(".concat(c,") translateX(-50%)"),G={msTransform:U,WebkitTransform:U,transform:U},X="number"==typeof z?{lineHeight:"".concat(z,"px")}:{};E=m.createElement(mr,{onResize:O},m.createElement("span",{className:"".concat($,"-string"),ref:function(e){x.current=e},style:u(u({},X),G)},D))}else E=m.createElement("span",{className:"".concat($,"-string"),style:{opacity:0},ref:function(e){x.current=e}},D);return delete I.onError,delete I.gap,m.createElement("span",u({},I,{style:u(u(u({},Y),V),I.style),className:q,ref:C}),E)},Pr=m.forwardRef(_r);Pr.defaultProps={shape:"circle",size:"default"};var Ar=Pr,jr=function(e){return e?"function"==typeof e?e():e:null},Tr=m.forwardRef((function(e,t){var n=e.prefixCls,r=e.title,o=e.content,i=e._overlay,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Vr(e){return $r(e)/255}function $r(e){return parseInt(e,16)}var Br={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Wr(e){var t={r:0,g:0,b:0},n=1,r=null,o=null,i=null,a=!1,c=!1;return"string"==typeof e&&(e=function(e){if(0===(e=e.trim().toLowerCase()).length)return!1;var t=!1;if(Br[e])e=Br[e],t=!0;else if("transparent"===e)return{r:0,g:0,b:0,a:0,format:"name"};var n=Gr.rgb.exec(e);return n?{r:n[1],g:n[2],b:n[3]}:(n=Gr.rgba.exec(e))?{r:n[1],g:n[2],b:n[3],a:n[4]}:(n=Gr.hsl.exec(e))?{h:n[1],s:n[2],l:n[3]}:(n=Gr.hsla.exec(e))?{h:n[1],s:n[2],l:n[3],a:n[4]}:(n=Gr.hsv.exec(e))?{h:n[1],s:n[2],v:n[3]}:(n=Gr.hsva.exec(e))?{h:n[1],s:n[2],v:n[3],a:n[4]}:(n=Gr.hex8.exec(e))?{r:$r(n[1]),g:$r(n[2]),b:$r(n[3]),a:Vr(n[4]),format:t?"name":"hex8"}:(n=Gr.hex6.exec(e))?{r:$r(n[1]),g:$r(n[2]),b:$r(n[3]),format:t?"name":"hex"}:(n=Gr.hex4.exec(e))?{r:$r(n[1]+n[1]),g:$r(n[2]+n[2]),b:$r(n[3]+n[3]),a:Vr(n[4]+n[4]),format:t?"name":"hex8"}:!!(n=Gr.hex3.exec(e))&&{r:$r(n[1]+n[1]),g:$r(n[2]+n[2]),b:$r(n[3]+n[3]),format:t?"name":"hex"}}(e)),"object"==typeof e&&(Xr(e.r)&&Xr(e.g)&&Xr(e.b)?(t=function(e,t,n){return{r:255*Ir(e,255),g:255*Ir(t,255),b:255*Ir(n,255)}}(e.r,e.g,e.b),a=!0,c="%"===String(e.r).substr(-1)?"prgb":"rgb"):Xr(e.h)&&Xr(e.s)&&Xr(e.v)?(r=zr(e.s),o=zr(e.v),t=function(e,t,n){e=6*Ir(e,360),t=Ir(t,100),n=Ir(n,100);var r=Math.floor(e),o=e-r,i=n*(1-t),a=n*(1-o*t),c=n*(1-(1-o)*t),s=r%6;return{r:255*[n,a,i,i,c,n][s],g:255*[c,n,n,a,i,i][s],b:255*[i,i,c,n,n,a][s]}}(e.h,r,o),a=!0,c="hsv"):Xr(e.h)&&Xr(e.s)&&Xr(e.l)&&(r=zr(e.s),i=zr(e.l),t=function(e,t,n){var r,o,i;if(e=Ir(e,360),t=Ir(t,100),n=Ir(n,100),0===t)o=n,i=n,r=n;else{var a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=Hr(c,a,e+1/3),o=Hr(c,a,e),i=Hr(c,a,e-1/3)}return{r:255*r,g:255*o,b:255*i}}(e.h,r,i),a=!0,c="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(n=e.a)),n=function(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}(n),{ok:a,format:e.format||c,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:n}}var qr="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)",Yr="[\\s|\\(]+("+qr+")[,|\\s]+("+qr+")[,|\\s]+("+qr+")\\s*\\)?",Ur="[\\s|\\(]+("+qr+")[,|\\s]+("+qr+")[,|\\s]+("+qr+")[,|\\s]+("+qr+")\\s*\\)?",Gr={CSS_UNIT:new RegExp(qr),rgb:new RegExp("rgb"+Yr),rgba:new RegExp("rgba"+Ur),hsl:new RegExp("hsl"+Yr),hsla:new RegExp("hsla"+Ur),hsv:new RegExp("hsv"+Yr),hsva:new RegExp("hsva"+Ur),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Xr(e){return Boolean(Gr.CSS_UNIT.exec(String(e)))}var Zr=[{index:7,opacity:.15},{index:6,opacity:.25},{index:5,opacity:.3},{index:5,opacity:.45},{index:5,opacity:.65},{index:5,opacity:.85},{index:4,opacity:.9},{index:3,opacity:.95},{index:2,opacity:.97},{index:1,opacity:.98}];function Kr(e){var t=function(e,t,n){e=Ir(e,255),t=Ir(t,255),n=Ir(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,c=r-o,s=0===r?0:c/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/c+(t=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function to(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function no(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function ro(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=Wr(e),o=5;o>0;o-=1){var i=Kr(r),a=Qr(Wr({h:eo(i,o,!0),s:to(i,o,!0),v:no(i,o,!0)}));n.push(a)}n.push(Qr(r));for(var c=1;c<=4;c+=1){var s=Kr(r),u=Qr(Wr({h:eo(s,c),s:to(s,c),v:no(s,c)}));n.push(u)}return"dark"===t.theme?Zr.map((function(e){var r=e.index,o=e.opacity;return Qr(Jr(Wr(t.backgroundColor||"#141414"),Wr(n[r]),100*o))})):n}var oo={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},io={},ao={};Object.keys(oo).forEach((function(e){io[e]=ro(oo[e]),io[e].primary=io[e][5],ao[e]=ro(oo[e],{theme:"dark",backgroundColor:"#141414"}),ao[e].primary=ao[e][5]})),io.red,io.volcano,io.gold,io.orange,io.yellow,io.lime,io.green,io.cyan,io.blue,io.geekblue,io.purple,io.magenta,io.grey;var co="rc-util-key";function so(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):co}function uo(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function lo(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!$())return null;var r,o=document.createElement("style");(null===(t=n.csp)||void 0===t?void 0:t.nonce)&&(o.nonce=null===(r=n.csp)||void 0===r?void 0:r.nonce),o.innerHTML=e;var i=uo(n),a=i.firstChild;return n.prepend&&i.prepend?i.prepend(o):n.prepend&&a?i.insertBefore(o,a):i.appendChild(o),o}var fo=new Map;function po(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=uo(t);return Array.from(fo.get(n).children).find((function(n){return"STYLE"===n.tagName&&n.getAttribute(so(t))===e}))}function ho(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=uo(n);if(!fo.has(r)){var o=lo("",n),i=o.parentNode;fo.set(r,i),i.removeChild(o)}var a,c,s,u=po(t,n);if(u)return(null===(a=n.csp)||void 0===a?void 0:a.nonce)&&u.nonce!==(null===(c=n.csp)||void 0===c?void 0:c.nonce)&&(u.nonce=null===(s=n.csp)||void 0===s?void 0:s.nonce),u.innerHTML!==e&&(u.innerHTML=e),u;var l=lo(e,n);return l.setAttribute(so(n),t),l}function vo(e){return"object"===p(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===p(e.icon)||"function"==typeof e.icon)}function mo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){var r=e[n];return"class"===n?(t.className=r,delete t.class):t[n]=r,t}),{})}function go(e,t,n){return n?g().createElement(e.tag,h(h({key:t},mo(e.attrs)),n),(e.children||[]).map((function(n,r){return go(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))):g().createElement(e.tag,h({key:t},mo(e.attrs)),(e.children||[]).map((function(n,r){return go(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})))}function yo(e){return ro(e)[0]}function bo(e){return e?Array.isArray(e)?e:[e]:[]}var wo="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",xo=["icon","className","onClick","style","primaryColor","secondaryColor"],Co={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},ko=function(e){var t,n,r=e.icon,o=e.className,i=e.onClick,a=e.style,c=e.primaryColor,s=e.secondaryColor,u=v(e,xo),l=Co;if(c&&(l={primaryColor:c,secondaryColor:s||yo(c)}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:wo,t=(0,m.useContext)(Lr).csp;(0,m.useEffect)((function(){ho(e,"@ant-design-icons",{prepend:!0,csp:t})}),[])}(),t=vo(r),n="icon should be icon definiton, but got ".concat(r),ur(t,"[@ant-design/icons] ".concat(n)),!vo(r))return null;var f=r;return f&&"function"==typeof f.icon&&(f=h(h({},f),{},{icon:f.icon(l.primaryColor,l.secondaryColor)})),go(f.icon,"svg-".concat(f.name),h({className:o,onClick:i,style:a,"data-icon":f.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},u))};ko.displayName="IconReact",ko.getTwoToneColors=function(){return h({},Co)},ko.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;Co.primaryColor=t,Co.secondaryColor=n||yo(t),Co.calculated=!!n};var Oo=ko;function Eo(e){var t=s(bo(e),2),n=t[0],r=t[1];return Oo.setTwoToneColors({primaryColor:n,secondaryColor:r})}var So=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];Eo("#1890ff");var _o=m.forwardRef((function(e,t){var n,r=e.className,o=e.icon,i=e.spin,c=e.rotate,u=e.tabIndex,l=e.onClick,p=e.twoToneColor,d=v(e,So),g=m.useContext(Lr).prefixCls,y=void 0===g?"anticon":g,b=f()(y,(a(n={},"".concat(y,"-").concat(o.name),!!o.name),a(n,"".concat(y,"-spin"),!!i||"loading"===o.name),n),r),w=u;void 0===w&&l&&(w=-1);var x=c?{msTransform:"rotate(".concat(c,"deg)"),transform:"rotate(".concat(c,"deg)")}:void 0,C=s(bo(p),2),k=C[0],O=C[1];return m.createElement("span",h(h({role:"img","aria-label":o.name},d),{},{ref:t,tabIndex:w,onClick:l,className:b}),m.createElement(Oo,{icon:o,primaryColor:k,secondaryColor:O,style:x}))}));_o.displayName="AntdIcon",_o.getTwoToneColor=function(){var e=Oo.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},_o.setTwoToneColor=Eo;var Po=_o,Ao=function(e,t){return m.createElement(Po,h(h({},e),{},{ref:t,icon:Dr}))};Ao.displayName="UserAddOutlined";var jo=m.forwardRef(Ao),To=n(9864),Mo=n(6774),Ro=n.n(Mo),No=function(e){function t(e,r,s,u,p){for(var d,h,v,m,w,C=0,k=0,O=0,E=0,S=0,M=0,N=v=d=0,L=0,I=0,z=0,F=0,H=s.length,V=H-1,$="",B="",W="",q="";Ld)&&(F=($=$.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(m,"$1"+e.trim());case 58:return e.trim()+t.replace(m,"$1"+e.trim());default:if(0<1*n&&0s.charCodeAt(8))break;case 115:a=a.replace(s,"-webkit-"+s)+";"+a;break;case 207:case 102:a=a.replace(s,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var Qo=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&Ko(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i=ti&&(ti=t+1),Jo.set(e,t),ei.set(t,e)},ii="style["+Go+'][data-styled-version="5.3.5"]',ai=new RegExp("^"+Go+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),ci=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(Go))return r}}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(Go,"active"),r.setAttribute("data-styled-version","5.3.5");var a=ui();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},fi=function(){function e(e){var t=this.element=li(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(u+=e+",")})),r+=""+c+s+'{content:"'+u+'"}/*!sc*/\n'}}}return r}(this)},e}(),gi=/(a)(d)/gi,yi=function(e){return String.fromCharCode(e+(e>25?39:97))};function bi(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=yi(t%52)+n;return(yi(t%52)+n).replace(gi,"$1-$2")}var wi=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},xi=function(e){return wi(5381,e)};function Ci(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var c=n(i,"."+a,void 0,r);t.insertRules(r,a,c)}o.push(a),this.staticRulesId=a}else{for(var s=this.rules.length,u=wi(this.baseHash,n.hash),l="",f=0;f>>0);if(!t.hasNameForId(r,v)){var m=n(l,"."+v,void 0,r);t.insertRules(r,v,m)}o.push(v)}}return o.join(" ")},e}(),Ei=/^\s*\/\/.*$/gm,Si=[":","[",".","#"];function _i(e){var t,n,r,o,i=void 0===e?Wo:e,a=i.options,c=void 0===a?Wo:a,s=i.plugins,u=void 0===s?Bo:s,l=new No(c),f=[],p=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,i,a,c,s,u,l,f){switch(n){case 1:if(0===l&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===u)return r+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(o[0]+r),"";default:return r+(0===f?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),d=function(e,r,i){return 0===r&&-1!==Si.indexOf(i[n.length])||i.match(o)?e:"."+t};function h(e,i,a,c){void 0===c&&(c="&");var s=e.replace(Ei,""),u=i&&a?a+" "+i+" { "+s+" }":s;return t=c,n=i,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),l(a||!i?"":i,u)}return l.use([].concat(u,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,d))},p,function(e){if(-2===e){var t=f;return f=[],t}}])),h.hash=u.length?u.reduce((function(e,t){return t.name||Ko(15),wi(e,t.name)}),5381).toString():"",h}var Pi=g().createContext(),Ai=(Pi.Consumer,g().createContext()),ji=(Ai.Consumer,new mi),Ti=_i();function Mi(){return(0,m.useContext)(Pi)||ji}function Ri(e){var t=(0,m.useState)(e.stylisPlugins),n=t[0],r=t[1],o=Mi(),i=(0,m.useMemo)((function(){var t=o;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),a=(0,m.useMemo)((function(){return _i({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,m.useEffect)((function(){Ro()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),g().createElement(Pi.Provider,{value:i},g().createElement(Ai.Provider,{value:a},e.children))}var Ni=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=Ti);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return Ko(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=Ti),this.name+e.hash},e}(),Di=/([A-Z])/,Li=/([A-Z])/g,Ii=/^ms-/,zi=function(e){return"-"+e.toLowerCase()};function Fi(e){return Di.test(e)?e.replace(Li,zi).replace(Ii,"-ms-"):e}var Hi=function(e){return null==e||!1===e||""===e};function Vi(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,c=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,qi=/(^-|-$)/g;function Yi(e){return e.replace(Wi,"-").replace(qi,"")}function Ui(e){return"string"==typeof e&&!0}var Gi=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Xi=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Zi(e,t,n){var r=e[n];Gi(t)&&Gi(r)?Ki(r,t):e[n]=t}function Ki(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r>>0)}("5.3.5"+n+Ji[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):c,u=t.displayName,l=void 0===u?function(e){return Ui(e)?"styled."+e:"Styled("+Yo(e)+")"}(e):u,f=t.displayName&&t.componentId?Yi(t.displayName)+"-"+t.componentId:t.componentId||s,p=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,d=t.shouldForwardProp;r&&e.shouldForwardProp&&(d=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var h,v=new Oi(n,f,r?e.componentStyle:void 0),y=v.isStatic&&0===a.length,b=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,c=e.foldedComponentIds,s=e.shouldForwardProp,u=e.styledComponentId,l=e.target,f=function(e,t,n){void 0===e&&(e=Wo);var r=Ho({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,i,a=e;for(t in qo(a)&&(a=a(r)),a)r[t]=o[t]="className"===t?(n=o[t],i=a[t],n&&i?n+" "+i:n||i):a[t]})),[r,o]}(function(e,t,n){return void 0===n&&(n=Wo),e.theme!==n.theme&&e.theme||t||n.theme}(t,(0,m.useContext)(Qi),a)||Wo,t,o),p=f[0],d=f[1],h=function(e,t,n,r){var o=Mi(),i=(0,m.useContext)(Ai)||Ti;return t?e.generateAndInjectStyles(Wo,o,i):e.generateAndInjectStyles(n,o,i)}(i,r,p),v=n,g=d.$as||t.$as||d.as||t.as||l,y=Ui(g),b=d!==t?Ho({},t,{},d):t,w={};for(var x in b)"$"!==x[0]&&"as"!==x&&("forwardedAs"===x?w.as=b[x]:(s?s(x,Io,g):!y||Io(x))&&(w[x]=b[x]));return t.style&&d.style!==t.style&&(w.style=Ho({},t.style,{},d.style)),w.className=Array.prototype.concat(c,u,h!==u?h:null,t.className,d.className).filter(Boolean).join(" "),w.ref=v,(0,m.createElement)(g,w)}(h,e,t,y)};return b.displayName=l,(h=g().forwardRef(b)).attrs=p,h.componentStyle=v,h.displayName=l,h.shouldForwardProp=d,h.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):Bo,h.styledComponentId=f,h.target=r?e.target:e,h.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(t,["componentId"]),i=r&&r+"-"+(Ui(e)?e:Yi(Yo(e)));return ea(e,Ho({},o,{attrs:p,componentId:i}),n)},Object.defineProperty(h,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Ki({},e.defaultProps,t):t}}),h.toString=function(){return"."+h.styledComponentId},o&&Fo()(h,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),h}var ta,na=function(e){return function e(t,n,r){if(void 0===r&&(r=Wo),!(0,To.isValidElementType)(n))return Ko(1,String(n));var o=function(){return t(n,r,Bi.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,Ho({},r,{},o))},o.attrs=function(o){return e(t,n,Ho({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(ea,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){na[e]=na(e)})),ta=function(e,t){this.rules=e,this.componentId=t,this.isStatic=Ci(e),mi.registerId(this.componentId+1)}.prototype,ta.createStyles=function(e,t,n,r){var o=r(Vi(this.rules,t,n,r).join(""),""),i=this.componentId+e;n.insertRules(i,i,o)},ta.removeStyles=function(e,t){t.clearRules(this.componentId+e)},ta.renderStyles=function(e,t,n,r){e>2&&mi.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)},function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=ui();return""},this.getStyleTags=function(){return e.sealed?Ko(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return Ko(2);var n=((t={})[Go]="",t["data-styled-version"]="5.3.5",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=ui();return r&&(n.nonce=r),[g().createElement("style",Ho({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new mi({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?Ko(2):g().createElement(Ri,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return Ko(3)}}();const ra=na.div` - .ant-avatar > img { - filter: grayscale(${e=>null!=e&&e.usePublicFetcher?100:0}); - } -`;var oa=()=>{var t,n,r,i,a;const c=o(),{usePublicFetcher:s,toggleUsePublicFetcher:u}=c,l=s?"Switch to execute as the logged-in user":"Switch to execute as a public user";return(0,e.createElement)(ra,{usePublicFetcher:s,className:"antd-app graphiql-auth-toggle","data-testid":"auth-switch"},(0,e.createElement)("span",{style:{margin:"0 5px"}},(0,e.createElement)(Qn,{getPopupContainer:()=>window.document.getElementsByClassName("graphiql-auth-toggle")[0],placement:"bottom",title:l},(0,e.createElement)("button",{"aria-label":l,type:"button",onClick:u,className:"toolbar-button"},(0,e.createElement)(ir,{dot:!s,status:"success"},(0,e.createElement)(Nr,{shape:"circle",size:"small",title:l,src:null!==(t=null===(n=window)||void 0===n||null===(r=n.wpGraphiQLSettings)||void 0===r?void 0:r.avatarUrl)&&void 0!==t?t:null,icon:null!==(i=window)&&void 0!==i&&null!==(a=i.wpGraphiQLSettings)&&void 0!==a&&a.avatarUrl?null:(0,e.createElement)(jo,null)}))))))};const{hooks:ia,useAppContext:aa}=window.wpGraphiQL;ia.addFilter("graphiql_fetcher","graphiql-auth-switch",((e,t)=>{const{usePublicFetcher:n}=o(),{endpoint:r}=aa();return n?(e=>t=>{const n={method:"POST",headers:{Accept:"application/json","content-type":"application/json"},body:JSON.stringify(t),credentials:"omit"};return fetch(e,n).then((e=>e.json()))})(r):e})),ia.addFilter("graphiql_app","graphiql-auth",(t=>(0,e.createElement)(i,null,t))),ia.addFilter("graphiql_toolbar_before_buttons","graphiql-auth-switch",(t=>(t.push((0,e.createElement)(oa,{key:"auth-switch"})),t)),1)}()}(); \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.asset.php b/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.asset.php deleted file mode 100644 index 557e0161..00000000 --- a/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-element'), 'version' => '869eff3829c2cd794f4e'); diff --git a/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.css b/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.css deleted file mode 100644 index d9317adf..00000000 --- a/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.css +++ /dev/null @@ -1 +0,0 @@ -.graphiql-fullscreen #wp-graphiql-wrapper{inset:0;padding:0;position:fixed;z-index:99999}#graphiql-fullscreen-toggle{align-items:center;display:flex;height:30px;justify-content:center;padding:8px}#wp-graphiql-wrapper .contract-icon,.graphiql-fullscreen #wp-graphiql-wrapper .expand-icon{display:none}.graphiql-fullscreen #wp-graphiql-wrapper .contract-icon{display:block} diff --git a/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.js b/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.js deleted file mode 100644 index 72db82cc..00000000 --- a/lib/wp-graphql-1.17.0/build/graphiqlFullscreenToggle.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";var e=window.wp.element;const{hooks:t}=window.wpGraphiQL,o=()=>(0,e.createElement)("button",{id:"graphiql-fullscreen-toggle",className:"toolbar-button",title:"Toggle Full Screen",onClick:()=>{document.body.classList.toggle("graphiql-fullscreen")}},(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",className:"expand-icon",viewBox:"0 0 512 512"},(0,e.createElement)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M432 320v112H320M421.8 421.77L304 304M80 192V80h112M90.2 90.23L208 208M320 80h112v112M421.77 90.2L304 208M192 432H80V320M90.23 421.8L208 304"})),(0,e.createElement)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",className:"contract-icon",viewBox:"0 0 512 512"},(0,e.createElement)("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M304 416V304h112M314.2 314.23L432 432M208 96v112H96M197.8 197.77L80 80M416 208H304V96M314.23 197.8L432 80M96 304h112v112M197.77 314.2L80 432"})));t.addFilter("graphiql_toolbar_after_buttons","graphiql-extension",((t,n)=>(t.push((0,e.createElement)(o,{key:"fullscreen-toggle"})),t)))}(); \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.asset.php b/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.asset.php deleted file mode 100644 index 7b1973b6..00000000 --- a/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'react-dom', 'wp-element'), 'version' => 'afcdd7bc76e2b7fe5cd5'); diff --git a/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.css b/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.css deleted file mode 100644 index 6ad4295e..00000000 --- a/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.css +++ /dev/null @@ -1 +0,0 @@ -#wp-graphiql-wrapper .docExplorerWrap{background:#fff;box-shadow:0 0 8px rgba(0,0,0,.15);position:relative;z-index:4}#wp-graphiql-wrapper .docExplorerWrap .doc-explorer-title-bar{cursor:default;display:flex;height:34px;line-height:14px;padding:8px 8px 5px;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}#wp-graphiql-wrapper .docExplorerWrap .doc-explorer-title{flex:1 1;font-weight:700;overflow-x:hidden;overflow-y:hidden;padding:5px 0 10px 10px;text-align:center;text-overflow:ellipsis;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text;white-space:nowrap}#wp-graphiql-wrapper .docExplorerWrap .doc-explorer-rhs{position:relative} diff --git a/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.js b/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.js deleted file mode 100644 index c5d10c27..00000000 --- a/lib/wp-graphql-1.17.0/build/graphiqlQueryComposer.js +++ /dev/null @@ -1,14 +0,0 @@ -!function(){var e={4184:function(e,t){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var e=[],t=0;tu))return!1;var d=c.get(e),p=c.get(t);if(d&&p)return d==t&&p==e;var m=-1,v=!0,h=2&n?new r:void 0;for(c.set(e,t),c.set(t,e);++m-1&&e%1==0&&e-1}},4705:function(e,t,n){var r=n(8470);e.exports=function(e,t){var n=this.__data__,o=r(n,e);return o<0?(++this.size,n.push([e,t])):n[o][1]=t,this}},4785:function(e,t,n){var r=n(1989),o=n(8407),i=n(7071);e.exports=function(){this.size=0,this.__data__={hash:new r,map:new(i||o),string:new r}}},1285:function(e,t,n){var r=n(5050);e.exports=function(e){var t=r(this,e).delete(e);return this.size-=t?1:0,t}},6e3:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).get(e)}},9916:function(e,t,n){var r=n(5050);e.exports=function(e){return r(this,e).has(e)}},5265:function(e,t,n){var r=n(5050);e.exports=function(e,t){var n=r(this,e),o=n.size;return n.set(e,t),this.size+=n.size==o?0:1,this}},8776:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}},4536:function(e,t,n){var r=n(852)(Object,"create");e.exports=r},6916:function(e,t,n){var r=n(5569)(Object.keys,Object);e.exports=r},1167:function(e,t,n){e=n.nmd(e);var r=n(1957),o=t&&!t.nodeType&&t,i=o&&e&&!e.nodeType&&e,a=i&&i.exports===o&&r.process,l=function(){try{return i&&i.require&&i.require("util").types||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=l},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},5569:function(e){e.exports=function(e,t){return function(n){return e(t(n))}}},5639:function(e,t,n){var r=n(1957),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},619:function(e){e.exports=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this}},2385:function(e){e.exports=function(e){return this.__data__.has(e)}},1814:function(e){e.exports=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}},7465:function(e,t,n){var r=n(8407);e.exports=function(){this.__data__=new r,this.size=0}},3779:function(e){e.exports=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}},7599:function(e){e.exports=function(e){return this.__data__.get(e)}},4758:function(e){e.exports=function(e){return this.__data__.has(e)}},4309:function(e,t,n){var r=n(8407),o=n(7071),i=n(3369);e.exports=function(e,t){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!o||a.length<199)return a.push([e,t]),this.size=++n.size,this;n=this.__data__=new i(a)}return n.set(e,t),this.size=n.size,this}},346:function(e){var t=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return t.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},7990:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},3279:function(e,t,n){var r=n(3218),o=n(7771),i=n(4841),a=Math.max,l=Math.min;e.exports=function(e,t,n){var c,s,u,f,d,p,m=0,v=!1,h=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=c,r=s;return c=s=void 0,m=t,f=e.apply(r,n)}function b(e){return m=e,d=setTimeout(C,t),v?y(e):f}function w(e){var n=e-p;return void 0===p||n>=t||n<0||h&&e-m>=u}function C(){var e=o();if(w(e))return x(e);d=setTimeout(C,function(e){var n=t-(e-p);return h?l(n,u-(e-m)):n}(e))}function x(e){return d=void 0,g&&c?y(e):(c=s=void 0,f)}function E(){var e=o(),n=w(e);if(c=arguments,s=this,p=e,n){if(void 0===d)return b(p);if(h)return clearTimeout(d),d=setTimeout(C,t),y(p)}return void 0===d&&(d=setTimeout(C,t)),f}return t=i(t)||0,r(n)&&(v=!!n.leading,u=(h="maxWait"in n)?a(i(n.maxWait)||0,t):u,g="trailing"in n?!!n.trailing:g),E.cancel=function(){void 0!==d&&clearTimeout(d),m=0,c=p=s=d=void 0},E.flush=function(){return void 0===d?f:x(o())},E}},7813:function(e){e.exports=function(e,t){return e===t||e!=e&&t!=t}},5694:function(e,t,n){var r=n(9454),o=n(7005),i=Object.prototype,a=i.hasOwnProperty,l=i.propertyIsEnumerable,c=r(function(){return arguments}())?r:function(e){return o(e)&&a.call(e,"callee")&&!l.call(e,"callee")};e.exports=c},1469:function(e){var t=Array.isArray;e.exports=t},8612:function(e,t,n){var r=n(3560),o=n(1780);e.exports=function(e){return null!=e&&o(e.length)&&!r(e)}},4144:function(e,t,n){e=n.nmd(e);var r=n(5639),o=n(5062),i=t&&!t.nodeType&&t,a=i&&e&&!e.nodeType&&e,l=a&&a.exports===i?r.Buffer:void 0,c=(l?l.isBuffer:void 0)||o;e.exports=c},8446:function(e,t,n){var r=n(939);e.exports=function(e,t){return r(e,t)}},3560:function(e,t,n){var r=n(4239),o=n(3218);e.exports=function(e){if(!o(e))return!1;var t=r(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}},1780:function(e){e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}},3218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},7005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},3448:function(e,t,n){var r=n(4239),o=n(7005);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},6719:function(e,t,n){var r=n(8749),o=n(1717),i=n(1167),a=i&&i.isTypedArray,l=a?o(a):r;e.exports=l},3674:function(e,t,n){var r=n(4636),o=n(280),i=n(8612);e.exports=function(e){return i(e)?r(e):o(e)}},7771:function(e,t,n){var r=n(5639);e.exports=function(){return r.Date.now()}},479:function(e){e.exports=function(){return[]}},5062:function(e){e.exports=function(){return!1}},4841:function(e,t,n){var r=n(7561),o=n(3218),i=n(3448),a=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):a.test(e)?NaN:+e}},7563:function(e,t,n){"use strict";const r=n(610),o=n(4020),i=n(500),a=n(2806),l=Symbol("encodeFragmentIdentifier");function c(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function s(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function u(e,t){return t.decode?o(e):e}function f(e){return Array.isArray(e)?e.sort():"object"==typeof e?f(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function d(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){const t=(e=d(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function m(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function v(e,t){c((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),i="string"==typeof n&&!o&&u(n,e).includes(e.arrayFormatSeparator);n=i?u(n,e):n;const a=o||i?n.split(e.arrayFormatSeparator).map((t=>u(t,e))):null===n?n:u(n,e);r[t]=a};case"bracket-separator":return(t,n,r)=>{const o=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!o)return void(r[t]=n?u(n,e):n);const i=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>u(t,e)));void 0!==r[t]?r[t]=[].concat(r[t],i):r[t]=i};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;let[e,a]=i(t.decode?o.replace(/\+/g," "):o,"=");a=void 0===a?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?a:u(a,t),n(u(e,t),a,r)}for(const e of Object.keys(r)){const n=r[e];if("object"==typeof n&&null!==n)for(const e of Object.keys(n))n[e]=m(n[e],t);else r[e]=m(n,t)}return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=f(n):e[t]=n,e}),Object.create(null))}t.extract=p,t.parse=v,t.stringify=(e,t)=>{if(!e)return"";c((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const n=n=>t.skipNull&&null==e[n]||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[s(t,e),"[",o,"]"].join("")]:[...n,[s(t,e),"[",s(o,e),"]=",s(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[s(t,e),"[]"].join("")]:[...n,[s(t,e),"[]=",s(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[s(t,e),":list="].join("")]:[...n,[s(t,e),":list=",s(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[s(n,e),t,s(o,e)].join("")]:[[r,s(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,s(t,e)]:[...n,[s(t,e),"=",s(r,e)].join("")]}}(t),o={};for(const t of Object.keys(e))n(t)||(o[t]=e[t]);const i=Object.keys(o);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const o=e[n];return void 0===o?"":null===o?s(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?s(n,t)+"[]":o.reduce(r(n),[]).join("&"):s(n,t)+"="+s(o,t)})).filter((e=>e.length>0)).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[n,r]=i(e,"#");return Object.assign({url:n.split("?")[0]||"",query:v(p(e),t)},t&&t.parseFragmentIdentifier&&r?{fragmentIdentifier:u(r,t)}:{})},t.stringifyUrl=(e,n)=>{n=Object.assign({encode:!0,strict:!0,[l]:!0},n);const r=d(e.url).split("?")[0]||"",o=t.extract(e.url),i=t.parse(o,{sort:!1}),a=Object.assign(i,e.query);let c=t.stringify(a,n);c&&(c=`?${c}`);let u=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);return e.fragmentIdentifier&&(u=`#${n[l]?s(e.fragmentIdentifier,n):e.fragmentIdentifier}`),`${r}${c}${u}`},t.pick=(e,n,r)=>{r=Object.assign({parseFragmentIdentifier:!0,[l]:!1},r);const{url:o,query:i,fragmentIdentifier:c}=t.parseUrl(e,r);return t.stringifyUrl({url:o,query:a(i,n),fragmentIdentifier:c},r)},t.exclude=(e,n,r)=>{const o=Array.isArray(n)?e=>!n.includes(e):(e,t)=>!n(e,t);return t.pick(e,o,r)}},1162:function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,i=n?Symbol.for("react.fragment"):60107,a=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,s=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,d=n?Symbol.for("react.forward_ref"):60112,p=n?Symbol.for("react.suspense"):60113,m=(n&&Symbol.for("react.suspense_list"),n?Symbol.for("react.memo"):60115),v=n?Symbol.for("react.lazy"):60116;n&&Symbol.for("react.block"),n&&Symbol.for("react.fundamental"),n&&Symbol.for("react.responder"),n&&Symbol.for("react.scope");function h(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case i:case l:case a:case p:return e;default:switch(e=e&&e.$$typeof){case s:case d:case v:case m:case c:return e;default:return t}}case o:return t}}}t.isFragment=function(e){return h(e)===i},t.isMemo=function(e){return h(e)===m}},1805:function(e,t,n){"use strict";e.exports=n(1162)},9921:function(e,t){"use strict";var n=60103,r=60106,o=60107,i=60108,a=60114,l=60109,c=60110,s=60112,u=60113,f=60120,d=60115,p=60116,m=60121,v=60122,h=60117,g=60129,y=60131;if("function"==typeof Symbol&&Symbol.for){var b=Symbol.for;n=b("react.element"),r=b("react.portal"),o=b("react.fragment"),i=b("react.strict_mode"),a=b("react.profiler"),l=b("react.provider"),c=b("react.context"),s=b("react.forward_ref"),u=b("react.suspense"),f=b("react.suspense_list"),d=b("react.memo"),p=b("react.lazy"),m=b("react.block"),v=b("react.server.block"),h=b("react.fundamental"),g=b("react.debug_trace_mode"),y=b("react.legacy_hidden")}t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===a||e===g||e===i||e===u||e===f||e===y||"object"==typeof e&&null!==e&&(e.$$typeof===p||e.$$typeof===d||e.$$typeof===l||e.$$typeof===c||e.$$typeof===s||e.$$typeof===h||e.$$typeof===m||e[0]===v)},t.typeOf=function(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case o:case a:case i:case u:case f:return e;default:switch(e=e&&e.$$typeof){case c:case s:case p:case d:case l:return e;default:return t}}case r:return t}}}},9864:function(e,t,n){"use strict";e.exports=n(9921)},6774:function(e){e.exports=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(t),c=0;c{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},610:function(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){"use strict";function e(){return e=Object.assign?Object.assign.bind():function(e){for(var t=1;tr(s),f=e=>{let{children:n}=e;const r=c(),{queryParams:i,setQueryParams:a}=r,[u,f]=o((()=>{var e,t,n;const r=null!==(e=null===(t=window)||void 0===t?void 0:t.localStorage.getItem("graphiql:isQueryComposerOpen"))&&void 0!==e?e:null,o="true"===(null==i?void 0:i.explorerIsOpen),a=null!==(n=null==i?void 0:i.isQueryComposerOpen)&&void 0!==n?n:o;return null!==a?a:null!==r&&r})()),d=l.applyFilters("graphiql_explorer_context_default_value",{isQueryComposerOpen:u,toggleExplorer:()=>{(e=>{var t;u!==e&&f(e);const n={...i,isQueryComposerOpen:e,explorerIsOpen:void 0};JSON.stringify(n)!==JSON.stringify(i)&&a(n),null===(t=window)||void 0===t||t.localStorage.setItem("graphiql:isQueryComposerOpen",`${e}`)})(!u)}});return(0,t.createElement)(s.Provider,{value:d},n)},{useEffect:d}=wp.element;var p=e=>{const{isQueryComposerOpen:n,toggleExplorer:r}=u(),{children:o}=e,i="400px";return n?(0,t.createElement)("div",{className:"docExplorerWrap doc-explorer-app query-composer-wrap",style:{height:"100%",width:i,minWidth:i,zIndex:8,display:n?"flex":"none",flexDirection:"column",overflow:"hidden"}},(0,t.createElement)("div",{className:"doc-explorer"},(0,t.createElement)("div",{className:"doc-explorer-title-bar"},(0,t.createElement)("div",{className:"doc-explorer-title"},"Query Composer"),(0,t.createElement)("div",{className:"doc-explorer-rhs"},(0,t.createElement)("div",{className:"docExplorerHide",style:{cursor:"pointer",fontSize:"18px",margin:"-7px -8px -6px 0",padding:"18px 16px 15px 12px",background:0,border:0,lineHeight:"14px"},onClick:r},"✕"))),(0,t.createElement)("div",{className:"doc-explorer-contents",style:{backgroundColor:"#ffffff",borderTop:"1px solid #d6d6d6",bottom:0,left:0,overflowY:"hidden",padding:"0",right:0,top:"47px",position:"absolute"}},o))):null},m=wpGraphiQL.GraphQL,v=window.React,h=n.n(v);let g=null;const y=e=>{const t=e.getFields();if(t.id){const e=["id"];return t.email?e.push("email"):t.name&&e.push("name"),e}if(t.edges)return["edges"];if(t.node)return["node"];if(t.nodes)return["nodes"];const n=[];return Object.keys(t).forEach((e=>{(0,m.isLeafType)(t[e].type)&&n.push(e)})),n.length?n.slice(0,2):["__typename"]},b={keyword:"#B11A04",def:"#D2054E",property:"#1F61A0",qualifier:"#1C92A9",attribute:"#8B2BB9",number:"#2882F9",string:"#D64292",builtin:"#D47509",string2:"#0B7FC7",variable:"#397D13",atom:"#CA9800"},w=(0,t.createElement)("svg",{width:"12",height:"9"},(0,t.createElement)("path",{fill:"#666",d:"M 0 2 L 9 2 L 4.5 7.5 z"})),C=(0,t.createElement)("svg",{width:"12",height:"9"},(0,t.createElement)("path",{fill:"#666",d:"M 0 0 L 0 9 L 5.5 4.5 z"})),x=(0,t.createElement)("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0ZM16 16H2V2H16V16ZM14.99 6L13.58 4.58L6.99 11.17L4.41 8.6L2.99 10.01L6.99 14L14.99 6Z",fill:"#666"})),E=(0,t.createElement)("svg",{style:{marginRight:"3px",marginLeft:"-3px"},width:"12",height:"12",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,t.createElement)("path",{d:"M16 2V16H2V2H16ZM16 0H2C0.9 0 0 0.9 0 2V16C0 17.1 0.9 18 2 18H16C17.1 18 18 17.1 18 16V2C18 0.9 17.1 0 16 0Z",fill:"#CCC"})),k={buttonStyle:{fontSize:"1.2em",padding:"0px",backgroundColor:"white",border:"none",margin:"5px 0px",height:"40px",width:"100%",display:"block",maxWidth:"none"},actionButtonStyle:{padding:"0px",backgroundColor:"white",border:"none",margin:"0px",maxWidth:"none",height:"15px",width:"15px",display:"inline-block",fontSize:"smaller"},explorerActionsStyle:{margin:"4px -8px -8px",paddingLeft:"8px",bottom:"0px",width:"100%",textAlign:"center",background:"none",borderTop:"none",borderBottom:"none"}},S={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",variableDefinitions:[],name:{kind:"Name",value:"NewQuery"},directives:[],selectionSet:{kind:"SelectionSet",selections:[]}}]},O=e=>{if(g&&g[0]===e)return g[1];{const n=(e=>{try{return e.trim()?(0,m.parse)(e,{noLocation:!0}):null}catch(e){return new Error(e)}})(e);var t;return n?n instanceof Error?g?null!==(t=g[1])&&void 0!==t?t:"":S:(g=[e,n],n):S}},N=e=>e.charAt(0).toUpperCase()+e.slice(1),P=e=>(0,m.isNonNullType)(e.type)&&void 0===e.defaultValue,A=e=>{let t=e;for(;(0,m.isWrappingType)(t);)t=t.ofType;return t},M=e=>{let t=e;for(;(0,m.isWrappingType)(t);)t=t.ofType;return t},R=(e,t)=>{if("string"!=typeof t&&"VariableDefinition"===t.kind)return t.variable;if((0,m.isScalarType)(e))try{switch(e.name){case"String":return{kind:"StringValue",value:String(e.parseValue(t))};case"Float":return{kind:"FloatValue",value:String(e.parseValue(parseFloat(t)))};case"Int":return{kind:"IntValue",value:String(e.parseValue(parseInt(t,10)))};case"Boolean":try{const e=JSON.parse(t);return"boolean"==typeof e?{kind:"BooleanValue",value:e}:{kind:"BooleanValue",value:!1}}catch(e){return{kind:"BooleanValue",value:!1}}default:return{kind:"StringValue",value:String(e.parseValue(t))}}}catch(e){return console.error("error coercing arg value",e,t),{kind:"StringValue",value:t}}else try{const n=e.parseValue(t);return n?{kind:"EnumValue",value:String(n)}:{kind:"EnumValue",value:e.getValues()[0].name}}catch(t){return{kind:"EnumValue",value:e.getValues()[0].name}}},T=(e,t,n,r)=>{const o=[];for(const i of r)if((0,m.isRequiredInputField)(i)||t&&t(n,i)){const r=M(i.type);if((0,m.isInputObjectType)(r)){const a=r.getFields();o.push({kind:"ObjectField",name:{kind:"Name",value:i.name},value:{kind:"ObjectValue",fields:T(e,t,n,Object.keys(a).map((e=>a[e])))}})}else(0,m.isLeafType)(r)&&o.push({kind:"ObjectField",name:{kind:"Name",value:i.name},value:e(n,i,r)})}return o},F=(e,t,n)=>{const r=[];for(const o of n.args)if(P(o)||t&&t(n,o)){const i=M(o.type);if((0,m.isInputObjectType)(i)){const a=i.getFields();r.push({kind:"Argument",name:{kind:"Name",value:o.name},value:{kind:"ObjectValue",fields:T(e,t,n,Object.keys(a).map((e=>a[e])))}})}else(0,m.isLeafType)(i)&&r.push({kind:"Argument",name:{kind:"Name",value:o.name},value:e(n,o,i)})}return r},I=(e,t,n)=>(e=>{if((0,m.isEnumType)(e))return{kind:"EnumValue",value:e.getValues()[0].name};switch(e.name){case"String":default:return{kind:"StringValue",value:""};case"Float":return{kind:"FloatValue",value:"1.5"};case"Int":return{kind:"IntValue",value:"10"};case"Boolean":return{kind:"BooleanValue",value:!1}}})(n);function j(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e){if(Array.isArray(e))return e}function D(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function K(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function G(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:1,n=ae+=1;function r(t){if(0===t)ce(n),e();else{var o=oe((function(){r(t-1)}));le.set(n,o)}}return r(t),n}function ue(e,t){return!!e&&e.contains(t)}function fe(e){return e instanceof HTMLElement?e:re().findDOMNode(e)}se.cancel=function(e){var t=le.get(e);return ce(t),ie(t)};var de=n(1805);function pe(e,t,n){var r=v.useRef({});return"value"in r.current&&!n(r.current.condition,t)||(r.current.value=e(),r.current.condition=t),r.current.value}function me(e,t){"function"==typeof e?e(t):"object"===W(e)&&e&&"current"in e&&(e.current=t)}function ve(){for(var e=arguments.length,t=new Array(e),n=0;n1&&void 0!==arguments[1]?arguments[1]:2;t();var i=se((function(){o<=1?r({isCanceled:function(){return i!==e.current}}):n(r,o-1)}));e.current=i},t]}(),a=z(i,2),l=a[0],c=a[1];return Ge((function(){if(r!==$e&&r!==qe){var e=Ye.indexOf(r),n=Ye[e+1],i=t(r);!1===i?o(n,!0):l((function(e){function t(){e.isCanceled()||o(n,!0)}!0===i?t():Promise.resolve(i).then(t)}))}}),[e,r]),v.useEffect((function(){return function(){c()}}),[]),[function(){o(We,!0)},r]}(M,(function(e){if(e===We){var t=B.prepare;return!!t&&t(V())}var n;return G in B&&I((null===(n=B[G])||void 0===n?void 0:n.call(B,V(),null))||null),G===Ue&&(W(V()),u>0&&(clearTimeout(D.current),D.current=setTimeout((function(){H({deadline:!0})}),u))),!0})),2),K=q[0],G=q[1],Y=Xe(G);L.current=Y,Ge((function(){P(t);var n,r=_.current;_.current=!0,e&&(!r&&t&&l&&(n=Le),r&&t&&i&&(n=ze),(r&&!t&&s||!r&&f&&!t&&s)&&(n=He),n&&(R(n),K()))}),[t]),(0,v.useEffect)((function(){(M===Le&&!l||M===ze&&!i||M===He&&!s)&&R(Ve)}),[l,i,s]),(0,v.useEffect)((function(){return function(){_.current=!1,clearTimeout(D.current)}}),[]),(0,v.useEffect)((function(){void 0!==N&&M===Ve&&(null==S||S(N))}),[N,M]);var X=F;return B.prepare&&G===Be&&(X=U({transition:"none"},X)),[M,G,X,null!=N?N:t]}var Ze=function(e){Z(n,e);var t=te(n);function n(){return K(this,n),t.apply(this,arguments)}return Y(n,[{key:"render",value:function(){return this.props.children}}]),n}(v.Component),Je=Ze,et=function(e){var t=e;function n(e){return!(!e.motionName||!t)}"object"===W(e)&&(t=e.transitionSupport);var r=v.forwardRef((function(e,t){var r=e.visible,o=void 0===r||r,i=e.removeOnLeave,a=void 0===i||i,l=e.forceRender,c=e.children,s=e.motionName,u=e.leavedClassName,f=e.eventProps,d=n(e),p=(0,v.useRef)(),m=(0,v.useRef)(),h=z(Qe(d,o,(function(){try{return p.current instanceof HTMLElement?p.current:fe(m.current)}catch(e){return null}}),e),4),g=h[0],y=h[1],b=h[2],w=h[3],C=v.useRef(w);w&&(C.current=!0);var x,E=v.useCallback((function(e){p.current=e,me(t,e)}),[t]),k=U(U({},f),{},{visible:o});if(c)if(g!==Ve&&n(e)){var S,O;y===We?O="prepare":Xe(y)?O="active":y===Be&&(O="start"),x=c(U(U({},k),{},{className:$()(De(s,g),(S={},j(S,De(s,"".concat(g,"-").concat(O)),O),j(S,s,"string"==typeof s),S)),style:b}),E)}else x=w?c(U({},k),E):!a&&C.current?c(U(U({},k),{},{className:u}),E):l?c(U(U({},k),{},{style:{display:"none"}}),E):null;else x=null;return v.isValidElement(x)&&he(x)&&(x.ref||(x=v.cloneElement(x,{ref:E}))),v.createElement(Je,{ref:m},x)}));return r.displayName="CSSMotion",r}(Ie),tt="add",nt="keep",rt="remove",ot="removed";function it(e){var t;return U(U({},t=e&&"object"===W(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function at(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.map(it)}function lt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=[],r=0,o=t.length,i=at(e),a=at(t);i.forEach((function(e){for(var t=!1,i=r;i1}));return c.forEach((function(e){n=n.filter((function(t){var n=t.key,r=t.status;return n!==e||r!==rt})),n.forEach((function(t){t.key===e&&(t.status=nt)}))})),n}var ct=["component","children","onVisibleChanged","onAllRemoved"],st=["status"],ut=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"],ft=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:et,r=function(t){Z(o,t);var r=te(o);function o(){var e;K(this,o);for(var t=arguments.length,n=new Array(t),i=0;i=0&&n.left>=0&&n.bottom>n.top&&n.right>n.left?n:null}function on(e){var t,n,r;if(Jt.isWindow(e)||9===e.nodeType){var o=Jt.getWindow(e);t={left:Jt.getWindowScrollLeft(o),top:Jt.getWindowScrollTop(o)},n=Jt.viewportWidth(o),r=Jt.viewportHeight(o)}else t=Jt.offset(e),n=Jt.outerWidth(e),r=Jt.outerHeight(e);return t.width=n,t.height=r,t}function an(e,t){var n=t.charAt(0),r=t.charAt(1),o=e.width,i=e.height,a=e.left,l=e.top;return"c"===n?l+=i/2:"b"===n&&(l+=i),"c"===r?a+=o/2:"r"===r&&(a+=o),{left:a,top:l}}function ln(e,t,n,r,o){var i=an(t,n[1]),a=an(e,n[0]),l=[a.left-i.left,a.top-i.top];return{left:Math.round(e.left-l[0]+r[0]-o[0]),top:Math.round(e.top-l[1]+r[1]-o[1])}}function cn(e,t,n){return e.leftn.right}function sn(e,t,n){return e.topn.bottom}function un(e,t,n){var r=[];return Jt.each(e,(function(e){r.push(e.replace(t,(function(e){return n[e]})))})),r}function fn(e,t){return e[t]=-e[t],e}function dn(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function pn(e,t){e[0]=dn(e[0],t.width),e[1]=dn(e[1],t.height)}function mn(e,t,n,r){var o=n.points,i=n.offset||[0,0],a=n.targetOffset||[0,0],l=n.overflow,c=n.source||e;i=[].concat(i),a=[].concat(a);var s={},u=0,f=rn(c,!(!(l=l||{})||!l.alwaysByViewport)),d=on(c);pn(i,d),pn(a,t);var p=ln(d,t,o,i,a),m=Jt.merge(d,p);if(f&&(l.adjustX||l.adjustY)&&r){if(l.adjustX&&cn(p,d,f)){var v=un(o,/[lr]/gi,{l:"r",r:"l"}),h=fn(i,0),g=fn(a,0);(function(e,t,n){return e.left>n.right||e.left+t.widthn.bottom||e.top+t.height=n.left&&o.left+i.width>n.right&&(i.width-=o.left+i.width-n.right),r.adjustX&&o.left+i.width>n.right&&(o.left=Math.max(n.right-i.width,n.left)),r.adjustY&&o.top=n.top&&o.top+i.height>n.bottom&&(i.height-=o.top+i.height-n.bottom),r.adjustY&&o.top+i.height>n.bottom&&(o.top=Math.max(n.bottom-i.height,n.top)),Jt.mix(o,i)}(p,d,f,s))}return m.width!==d.width&&Jt.css(c,"width",Jt.width(c)+m.width-d.width),m.height!==d.height&&Jt.css(c,"height",Jt.height(c)+m.height-d.height),Jt.offset(c,{left:m.left,top:m.top},{useCssRight:n.useCssRight,useCssBottom:n.useCssBottom,useCssTransform:n.useCssTransform,ignoreShake:n.ignoreShake}),{points:o,offset:i,targetOffset:a,overflow:s}}function vn(e,t,n){var r=n.target||t,o=on(r),i=!function(e,t){var n=rn(e,t),r=on(e);return!n||r.left+r.width<=n.left||r.top+r.height<=n.top||r.left>=n.right||r.top>=n.bottom}(r,n.overflow&&n.overflow.alwaysByViewport);return mn(e,o,n,i)}vn.__getOffsetParent=tn,vn.__getVisibleRectForElement=rn;var hn=n(8446),gn=n.n(hn),yn=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){bn&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),En?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){bn&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,r=xn.some((function(e){return!!~n.indexOf(e)}));r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Sn=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),Dn="undefined"!=typeof WeakMap?new WeakMap:new yn,Vn=function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=kn.getInstance(),r=new jn(t,n,this);Dn.set(this,r)};["observe","unobserve","disconnect"].forEach((function(e){Vn.prototype[e]=function(){var t;return(t=Dn.get(this))[e].apply(t,arguments)}}));var Ln=void 0!==wn.ResizeObserver?wn.ResizeObserver:Vn;function zn(e,t){var n=null,r=null,o=new Ln((function(e){var o=z(e,1)[0].target;if(document.documentElement.contains(o)){var i=o.getBoundingClientRect(),a=i.width,l=i.height,c=Math.floor(a),s=Math.floor(l);n===c&&r===s||Promise.resolve().then((function(){t({width:c,height:s})})),n=c,r=s}}));return e&&o.observe(e),function(){o.disconnect()}}function Hn(e){return"function"!=typeof e?null:e()}function $n(e){return"object"===W(e)&&e?e:null}var Wn=function(e,t){var n=e.children,r=e.disabled,o=e.target,i=e.align,a=e.onAlign,l=e.monitorWindowResize,c=e.monitorBufferTime,s=void 0===c?0:c,u=h().useRef({}),f=h().useRef(),d=h().Children.only(n),p=h().useRef({});p.current.disabled=r,p.current.target=o,p.current.align=i,p.current.onAlign=a;var m=function(e,t){var n=h().useRef(!1),r=h().useRef(null);function o(){window.clearTimeout(r.current)}return[function e(i){if(o(),n.current&&!0!==i)r.current=window.setTimeout((function(){n.current=!1,e()}),t);else{if(!1===function(){var e=p.current,t=e.disabled,n=e.target,r=e.align,o=e.onAlign;if(!t&&n){var i,a=f.current,l=Hn(n),c=$n(n);u.current.element=l,u.current.point=c,u.current.align=r;var s=document.activeElement;return l&&ht(l)?i=vn(a,l,r):c&&(i=function(e,t,n){var r,o,i=Jt.getDocument(e),a=i.defaultView||i.parentWindow,l=Jt.getWindowScrollLeft(a),c=Jt.getWindowScrollTop(a),s=Jt.viewportWidth(a),u=Jt.viewportHeight(a),f={left:r="pageX"in t?t.pageX:l+t.clientX,top:o="pageY"in t?t.pageY:c+t.clientY,width:0,height:0},d=r>=0&&r<=l+s&&o>=0&&o<=c+u,p=[n.points[0],"cc"];return mn(e,f,yt(yt({},n),{},{points:p}),d)}(a,c,r)),function(e,t){e!==document.activeElement&&ue(t,e)&&"function"==typeof e.focus&&e.focus()}(s,a),o&&i&&o(a,i),!0}return!1}())return;n.current=!0,r.current=window.setTimeout((function(){n.current=!1}),t)}},function(){n.current=!1,o()}]}(0,s),v=z(m,2),g=v[0],y=v[1],b=h().useRef({cancel:function(){}}),w=h().useRef({cancel:function(){}});h().useEffect((function(){var e,t,n=Hn(o),r=$n(o);f.current!==w.current.element&&(w.current.cancel(),w.current.element=f.current,w.current.cancel=zn(f.current,g)),u.current.element===n&&((e=u.current.point)===(t=r)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&gn()(u.current.align,i)||(g(),b.current.element!==n&&(b.current.cancel(),b.current.element=n,b.current.cancel=zn(n,g)))})),h().useEffect((function(){r?y():g()}),[r]);var C=h().useRef(null);return h().useEffect((function(){l?C.current||(C.current=ge(window,"resize",g)):C.current&&(C.current.remove(),C.current=null)}),[l]),h().useEffect((function(){return function(){b.current.cancel(),w.current.cancel(),C.current&&C.current.remove(),y()}}),[]),h().useImperativeHandle(t,(function(){return{forceAlign:function(){return g(!0)}}})),h().isValidElement(d)&&(d=h().cloneElement(d,{ref:ve(d.ref,f)})),d},Bn=h().forwardRef(Wn);Bn.displayName="Align";var Un=Bn,qn=ye()?v.useLayoutEffect:v.useEffect;function Kn(){Kn=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function l(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,n){return e[t]=n}}function c(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new E(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var l=w(a,n);if(l){if(l===u)continue;return l}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=s(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),i}function s(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var u={};function f(){}function d(){}function p(){}var m={};l(m,o,(function(){return this}));var v=Object.getPrototypeOf,h=v&&v(v(k([])));h&&h!==t&&n.call(h,o)&&(m=h);var g=p.prototype=f.prototype=Object.create(m);function y(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(o,i,a,l){var c=s(e[o],e,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==W(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,l)}),(function(e){r("throw",e,a,l)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,l)}))}l(c.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=s(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function k(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var l=n.call(i,"catchLoc"),c=n.call(i,"finallyLoc");if(l&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:k(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Gn(e,t,n,r,o,i,a){try{var l=e[i](a),c=l.value}catch(e){return void n(e)}l.done?t(c):Promise.resolve(c).then(r,o)}function Yn(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Gn(i,r,o,a,l,"next",e)}function l(e){Gn(i,r,o,a,l,"throw",e)}a(void 0)}))}}var Xn=["measure","alignPre","align",null,"motion"],Qn=v.forwardRef((function(t,n){var r=t.visible,o=t.prefixCls,i=t.className,a=t.style,l=t.children,c=t.zIndex,s=t.stretch,u=t.destroyPopupOnHide,f=t.forceRender,d=t.align,p=t.point,m=t.getRootDomNode,h=t.getClassNameFromAlign,g=t.onAlign,y=t.onMouseEnter,b=t.onMouseLeave,w=t.onMouseDown,C=t.onTouchStart,x=t.onClick,E=(0,v.useRef)(),k=(0,v.useRef)(),S=z((0,v.useState)(),2),O=S[0],N=S[1],P=function(e){var t=z(v.useState({width:0,height:0}),2),n=t[0],r=t[1];return[v.useMemo((function(){var t={};if(e){var r=n.width,o=n.height;-1!==e.indexOf("height")&&o?t.height=o:-1!==e.indexOf("minHeight")&&o&&(t.minHeight=o),-1!==e.indexOf("width")&&r?t.width=r:-1!==e.indexOf("minWidth")&&r&&(t.minWidth=r)}return t}),[e,n]),function(e){r({width:e.offsetWidth,height:e.offsetHeight})}]}(s),A=z(P,2),M=A[0],R=A[1],T=function(e,t){var n=z(Ke(null),2),r=n[0],o=n[1],i=(0,v.useRef)();function a(e){o(e,!0)}function l(){se.cancel(i.current)}return(0,v.useEffect)((function(){a("measure")}),[e]),(0,v.useEffect)((function(){"measure"===r&&(s&&R(m())),r&&(i.current=se(Yn(Kn().mark((function e(){var t,n;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Xn.indexOf(r),(n=Xn[t+1])&&-1!==t&&a(n);case 3:case"end":return e.stop()}}),e)})))))}),[r]),(0,v.useEffect)((function(){return function(){l()}}),[]),[r,function(e){l(),i.current=se((function(){a((function(e){switch(r){case"align":return"motion";case"motion":return"stable"}return e})),null==e||e()}))}]}(r),F=z(T,2),I=F[0],j=F[1],_=z((0,v.useState)(0),2),D=_[0],V=_[1],L=(0,v.useRef)();function H(){var e;null===(e=E.current)||void 0===e||e.forceAlign()}function W(e,t){var n=h(t);O!==n&&N(n),V((function(e){return e+1})),"align"===I&&(null==g||g(e,t))}qn((function(){"alignPre"===I&&V(0)}),[I]),qn((function(){"align"===I&&(D<2?H():j((function(){var e;null===(e=L.current)||void 0===e||e.call(L)})))}),[D]);var B=U({},pt(t));function q(){return new Promise((function(e){L.current=e}))}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach((function(e){var t=B[e];B[e]=function(e,n){return j(),null==t?void 0:t(e,n)}})),v.useEffect((function(){B.motionName||"motion"!==I||j()}),[B.motionName,I]),v.useImperativeHandle(n,(function(){return{forceAlign:H,getElement:function(){return k.current}}}));var K=U(U({},M),{},{zIndex:c,opacity:"motion"!==I&&"stable"!==I&&r?0:void 0,pointerEvents:r||"stable"===I?void 0:"none"},a),G=!0;!(null==d?void 0:d.points)||"align"!==I&&"stable"!==I||(G=!1);var Y=l;return v.Children.count(l)>1&&(Y=v.createElement("div",{className:"".concat(o,"-content")},l)),v.createElement(dt,e({visible:r,ref:k,leavedClassName:"".concat(o,"-hidden")},B,{onAppearPrepare:q,onEnterPrepare:q,removeOnLeave:u,forceRender:f}),(function(e,t){var n=e.className,r=e.style,a=$()(o,i,O,n);return v.createElement(Un,{target:p||m,key:"popup",ref:E,monitorWindowResize:!0,disabled:G,align:d,onAlign:W},v.createElement("div",{ref:t,className:a,onMouseEnter:y,onMouseLeave:b,onMouseDownCapture:w,onTouchStartCapture:C,onClick:x,style:U(U({},r),K)},Y))}))}));Qn.displayName="PopupInner";var Zn=Qn,Jn=v.forwardRef((function(t,n){var r=t.prefixCls,o=t.visible,i=t.zIndex,a=t.children,l=t.mobile,c=(l=void 0===l?{}:l).popupClassName,s=l.popupStyle,u=l.popupMotion,f=void 0===u?{}:u,d=l.popupRender,p=t.onClick,m=v.useRef();v.useImperativeHandle(n,(function(){return{forceAlign:function(){},getElement:function(){return m.current}}}));var h=U({zIndex:i},s),g=a;return v.Children.count(a)>1&&(g=v.createElement("div",{className:"".concat(r,"-content")},a)),d&&(g=d(g)),v.createElement(dt,e({visible:o,ref:m,removeOnLeave:!0},f),(function(e,t){var n=e.className,o=e.style,i=$()(r,c,n);return v.createElement("div",{ref:t,className:i,onClick:p,style:U(U({},o),h)},g)}))}));Jn.displayName="MobilePopupInner";var er=Jn,tr=["visible","mobile"],nr=v.forwardRef((function(t,n){var r=t.visible,o=t.mobile,i=q(t,tr),a=z((0,v.useState)(r),2),l=a[0],c=a[1],s=z((0,v.useState)(!1),2),u=s[0],f=s[1],d=U(U({},i),{},{visible:l});(0,v.useEffect)((function(){c(r),r&&o&&f(xe())}),[r,o]);var p=u?v.createElement(er,e({},d,{mobile:o,ref:n})):v.createElement(Zn,e({},d,{ref:n}));return v.createElement("div",null,v.createElement(mt,d),p)}));nr.displayName="Popup";var rr=nr,or=v.createContext(null);function ir(){}var ar,lr,cr,sr=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"],ur=(ar=we,lr=function(t){Z(r,t);var n=te(r);function r(t){var o,i;return K(this,r),(o=n.call(this,t)).popupRef=v.createRef(),o.triggerRef=v.createRef(),o.portalContainer=void 0,o.attachId=void 0,o.clickOutsideHandler=void 0,o.touchOutsideHandler=void 0,o.contextMenuOutsideHandler1=void 0,o.contextMenuOutsideHandler2=void 0,o.mouseDownTimeout=void 0,o.focusTime=void 0,o.preClickTime=void 0,o.preTouchTime=void 0,o.delayTimer=void 0,o.hasPopupMouseDown=void 0,o.onMouseEnter=function(e){var t=o.props.mouseEnterDelay;o.fireEvents("onMouseEnter",e),o.delaySetPopupVisible(!0,t,t?null:e)},o.onMouseMove=function(e){o.fireEvents("onMouseMove",e),o.setPoint(e)},o.onMouseLeave=function(e){o.fireEvents("onMouseLeave",e),o.delaySetPopupVisible(!1,o.props.mouseLeaveDelay)},o.onPopupMouseEnter=function(){o.clearDelayTimer()},o.onPopupMouseLeave=function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&ue(null===(t=o.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||o.delaySetPopupVisible(!1,o.props.mouseLeaveDelay)},o.onFocus=function(e){o.fireEvents("onFocus",e),o.clearDelayTimer(),o.isFocusToShow()&&(o.focusTime=Date.now(),o.delaySetPopupVisible(!0,o.props.focusDelay))},o.onMouseDown=function(e){o.fireEvents("onMouseDown",e),o.preClickTime=Date.now()},o.onTouchStart=function(e){o.fireEvents("onTouchStart",e),o.preTouchTime=Date.now()},o.onBlur=function(e){o.fireEvents("onBlur",e),o.clearDelayTimer(),o.isBlurToHide()&&o.delaySetPopupVisible(!1,o.props.blurDelay)},o.onContextMenu=function(e){e.preventDefault(),o.fireEvents("onContextMenu",e),o.setPopupVisible(!0,e)},o.onContextMenuClose=function(){o.isContextMenuToShow()&&o.close()},o.onClick=function(e){if(o.fireEvents("onClick",e),o.focusTime){var t;if(o.preClickTime&&o.preTouchTime?t=Math.min(o.preClickTime,o.preTouchTime):o.preClickTime?t=o.preClickTime:o.preTouchTime&&(t=o.preTouchTime),Math.abs(t-o.focusTime)<20)return;o.focusTime=0}o.preClickTime=0,o.preTouchTime=0,o.isClickToShow()&&(o.isClickToHide()||o.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var n=!o.state.popupVisible;(o.isClickToHide()&&!n||n&&o.isClickToShow())&&o.setPopupVisible(!o.state.popupVisible,e)},o.onPopupMouseDown=function(){var e;o.hasPopupMouseDown=!0,clearTimeout(o.mouseDownTimeout),o.mouseDownTimeout=window.setTimeout((function(){o.hasPopupMouseDown=!1}),0),o.context&&(e=o.context).onPopupMouseDown.apply(e,arguments)},o.onDocumentClick=function(e){if(!o.props.mask||o.props.maskClosable){var t=e.target,n=o.getRootDomNode(),r=o.getPopupDomNode();ue(n,t)&&!o.isContextMenuOnly()||ue(r,t)||o.hasPopupMouseDown||o.close()}},o.getRootDomNode=function(){var e=o.props.getTriggerDOMNode;if(e)return e(o.triggerRef.current);try{var t=fe(o.triggerRef.current);if(t)return t}catch(e){}return re().findDOMNode(X(o))},o.getPopupClassNameFromAlign=function(e){var t=[],n=o.props,r=n.popupPlacement,i=n.builtinPlacements,a=n.prefixCls,l=n.alignPoint,c=n.getPopupClassNameFromAlign;return r&&i&&t.push(function(e,t,n,r){for(var o=n.points,i=Object.keys(e),a=0;a=0||r.indexOf("Bottom")>=0?i.top="".concat(o.height-t.offset[1],"px"):(r.indexOf("Top")>=0||r.indexOf("bottom")>=0)&&(i.top="".concat(-t.offset[1],"px")),r.indexOf("left")>=0||r.indexOf("Right")>=0?i.left="".concat(o.width-t.offset[0],"px"):(r.indexOf("right")>=0||r.indexOf("Left")>=0)&&(i.left="".concat(-t.offset[0],"px")),e.style.transformOrigin="".concat(i.left," ").concat(i.top)}},overlayInnerStyle:F,arrowContent:v.createElement("span",{className:"".concat(E,"-arrow-content"),style:O}),motion:{motionName:Ar(k,"zoom-big-fast",t.transitionName),motionDeadline:1e3}}),S?Dr(A,{className:R}):A)}));Lr.defaultProps={placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0};var zr=Lr;function Hr(e,t){var n=U({},e);return Array.isArray(t)&&t.forEach((function(e){delete n[e]})),n}var $r=v.createContext(!1),Wr=function(e){var t=e.children,n=e.disabled,r=v.useContext($r);return v.createElement($r.Provider,{value:n||r},t)},Br=$r,Ur=v.createContext(void 0),qr=function(e){var t=e.children,n=e.size;return v.createElement(Ur.Consumer,null,(function(e){return v.createElement(Ur.Provider,{value:n||e},t)}))},Kr=Ur,Gr="rc-util-key";function Yr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mark;return t?t.startsWith("data-")?t:"data-".concat(t):Gr}function Xr(e){return e.attachTo?e.attachTo:document.querySelector("head")||document.body}function Qr(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!ye())return null;var r,o=document.createElement("style");(null===(t=n.csp)||void 0===t?void 0:t.nonce)&&(o.nonce=null===(r=n.csp)||void 0===r?void 0:r.nonce),o.innerHTML=e;var i=Xr(n),a=i.firstChild;return n.prepend&&i.prepend?i.prepend(o):n.prepend&&a?i.insertBefore(o,a):i.appendChild(o),o}var Zr=new Map;function Jr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Xr(t);return Array.from(Zr.get(n).children).find((function(n){return"STYLE"===n.tagName&&n.getAttribute(Yr(t))===e}))}function eo(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=Xr(n);if(!Zr.has(r)){var o=Qr("",n),i=o.parentNode;Zr.set(r,i),i.removeChild(o)}var a,l,c,s=Jr(t,n);if(s)return(null===(a=n.csp)||void 0===a?void 0:a.nonce)&&s.nonce!==(null===(l=n.csp)||void 0===l?void 0:l.nonce)&&(s.nonce=null===(c=n.csp)||void 0===c?void 0:c.nonce),s.innerHTML!==e&&(s.innerHTML=e),s;var u=Qr(e,n);return u.setAttribute(Yr(n),t),u}var to,no=0,ro={};function oo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=no++,r=t;function o(){(r-=1)<=0?(e(),delete ro[n]):ro[n]=se(o)}return ro[n]=se(o),n}function io(e){return!e||null===e.offsetParent||e.hidden}function ao(e){var t=(e||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return!(t&&t[1]&&t[2]&&t[3]&&t[1]===t[2]&&t[2]===t[3])}oo.cancel=function(e){void 0!==e&&(se.cancel(ro[e]),delete ro[e])},oo.ids=ro;var lo=function(e){Z(n,e);var t=te(n);function n(){var e;return K(this,n),(e=t.apply(this,arguments)).containerRef=v.createRef(),e.animationStart=!1,e.destroyed=!1,e.onClick=function(t,n){var r,o,i=e.props,a=i.insertExtraNode;if(!(i.disabled||!t||io(t)||t.className.indexOf("-leave")>=0)){e.extraNode=document.createElement("div");var l=X(e).extraNode,c=e.context.getPrefixCls;l.className="".concat(c(""),"-click-animating-node");var s=e.getAttributeName();if(t.setAttribute(s,"true"),n&&"#ffffff"!==n&&"rgb(255, 255, 255)"!==n&&ao(n)&&!/rgba\((?:\d*, ){3}0\)/.test(n)&&"transparent"!==n){l.style.borderColor=n;var u=(null===(r=t.getRootNode)||void 0===r?void 0:r.call(t))||t.ownerDocument,f=u instanceof Document?u.body:null!==(o=u.firstChild)&&void 0!==o?o:u;to=eo("\n [".concat(c(""),"-click-animating-without-extra-node='true']::after, .").concat(c(""),"-click-animating-node {\n --antd-wave-shadow-color: ").concat(n,";\n }"),"antd-wave",{csp:e.csp,attachTo:f})}a&&t.appendChild(l),["transition","animation"].forEach((function(n){t.addEventListener("".concat(n,"start"),e.onTransitionStart),t.addEventListener("".concat(n,"end"),e.onTransitionEnd)}))}},e.onTransitionStart=function(t){if(!e.destroyed){var n=e.containerRef.current;t&&t.target===n&&!e.animationStart&&e.resetEffect(n)}},e.onTransitionEnd=function(t){t&&"fadeEffect"===t.animationName&&e.resetEffect(t.target)},e.bindAnimationEvent=function(t){if(t&&t.getAttribute&&!t.getAttribute("disabled")&&!(t.className.indexOf("disabled")>=0)){var n=function(n){if("INPUT"!==n.target.tagName&&!io(n.target)){e.resetEffect(t);var r=getComputedStyle(t).getPropertyValue("border-top-color")||getComputedStyle(t).getPropertyValue("border-color")||getComputedStyle(t).getPropertyValue("background-color");e.clickWaveTimeoutId=window.setTimeout((function(){return e.onClick(t,r)}),0),oo.cancel(e.animationStartId),e.animationStart=!0,e.animationStartId=oo((function(){e.animationStart=!1}),10)}};return t.addEventListener("click",n,!0),{cancel:function(){t.removeEventListener("click",n,!0)}}}},e.renderWave=function(t){var n=t.csp,r=e.props.children;if(e.csp=n,!v.isValidElement(r))return r;var o=e.containerRef;return he(r)&&(o=ve(r.ref,e.containerRef)),Dr(r,{ref:o})},e}return Y(n,[{key:"componentDidMount",value:function(){this.destroyed=!1;var e=this.containerRef.current;e&&1===e.nodeType&&(this.instance=this.bindAnimationEvent(e))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var e=this.context.getPrefixCls,t=this.props.insertExtraNode;return"".concat(e(""),t?"-click-animating":"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(e){var t=this;if(e&&e!==this.extraNode&&e instanceof Element){var n=this.props.insertExtraNode,r=this.getAttributeName();e.setAttribute(r,"false"),to&&(to.innerHTML=""),n&&this.extraNode&&e.contains(this.extraNode)&&e.removeChild(this.extraNode),["transition","animation"].forEach((function(n){e.removeEventListener("".concat(n,"start"),t.onTransitionStart),e.removeEventListener("".concat(n,"end"),t.onTransitionEnd)}))}}},{key:"render",value:function(){return v.createElement(Cr,null,this.renderWave)}}]),n}(v.Component);lo.contextType=wr;var co=(0,v.forwardRef)((function(t,n){return v.createElement(lo,e({ref:n},t))})),so=v.createContext(void 0),uo={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"},fo=(0,v.createContext)({});function po(e,t){(function(e){return"string"==typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var n=function(e){return"string"==typeof e&&-1!==e.indexOf("%")}(e);return e=360===t?e:Math.min(t,Math.max(0,parseFloat(e))),n&&(e=parseInt(String(e*t),10)/100),Math.abs(e-t)<1e-6?1:e=360===t?(e<0?e%t+t:e%t)/parseFloat(String(t)):e%t/parseFloat(String(t))}function mo(e){return Math.min(1,Math.max(0,e))}function vo(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ho(e){return e<=1?100*Number(e)+"%":e}function go(e){return 1===e.length?"0"+e:String(e)}function yo(e,t,n){e=po(e,255),t=po(t,255),n=po(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=0,l=(r+o)/2;if(r===o)a=0,i=0;else{var c=r-o;switch(a=l>.5?c/(2-r-o):c/(r+o),r){case e:i=(t-n)/c+(t1&&(n-=1),n<1/6?e+6*n*(t-e):n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function wo(e,t,n){e=po(e,255),t=po(t,255),n=po(n,255);var r=Math.max(e,t,n),o=Math.min(e,t,n),i=0,a=r,l=r-o,c=0===r?0:l/r;if(r===o)i=0;else{switch(r){case e:i=(t-n)/l+(t=60&&Math.round(e.h)<=240?n?Math.round(e.h)-2*t:Math.round(e.h)+2*t:n?Math.round(e.h)+2*t:Math.round(e.h)-2*t)<0?r+=360:r>=360&&(r-=360),r}function _o(e,t,n){return 0===e.h&&0===e.s?e.s:((r=n?e.s-.16*t:4===t?e.s+.16:e.s+.05*t)>1&&(r=1),n&&5===t&&r>.1&&(r=.1),r<.06&&(r=.06),Number(r.toFixed(2)));var r}function Do(e,t,n){var r;return(r=n?e.v+.05*t:e.v-.15*t)>1&&(r=1),Number(r.toFixed(2))}function Vo(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[],r=So(e),o=5;o>0;o-=1){var i=To(r),a=Fo(So({h:jo(i,o,!0),s:_o(i,o,!0),v:Do(i,o,!0)}));n.push(a)}n.push(Fo(r));for(var l=1;l<=4;l+=1){var c=To(r),s=Fo(So({h:jo(c,l),s:_o(c,l),v:Do(c,l)}));n.push(s)}return"dark"===t.theme?Ro.map((function(e){var r=e.index,o=e.opacity;return Fo(Io(So(t.backgroundColor||"#141414"),So(n[r]),100*o))})):n}var Lo={red:"#F5222D",volcano:"#FA541C",orange:"#FA8C16",gold:"#FAAD14",yellow:"#FADB14",lime:"#A0D911",green:"#52C41A",cyan:"#13C2C2",blue:"#1890FF",geekblue:"#2F54EB",purple:"#722ED1",magenta:"#EB2F96",grey:"#666666"},zo={},Ho={};Object.keys(Lo).forEach((function(e){zo[e]=Vo(Lo[e]),zo[e].primary=zo[e][5],Ho[e]=Vo(Lo[e],{theme:"dark",backgroundColor:"#141414"}),Ho[e].primary=Ho[e][5]})),zo.red,zo.volcano,zo.gold,zo.orange,zo.yellow,zo.lime,zo.green,zo.cyan,zo.blue,zo.geekblue,zo.purple,zo.magenta,zo.grey;var $o={};function Wo(e,t){}var Bo=function(e,t){!function(e,t,n){t||$o[n]||(e(!1,n),$o[n]=!0)}(Wo,e,t)};function Uo(e){return"object"===W(e)&&"string"==typeof e.name&&"string"==typeof e.theme&&("object"===W(e.icon)||"function"==typeof e.icon)}function qo(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.keys(e).reduce((function(t,n){var r=e[n];return"class"===n?(t.className=r,delete t.class):t[n]=r,t}),{})}function Ko(e,t,n){return n?h().createElement(e.tag,U(U({key:t},qo(e.attrs)),n),(e.children||[]).map((function(n,r){return Ko(n,"".concat(t,"-").concat(e.tag,"-").concat(r))}))):h().createElement(e.tag,U({key:t},qo(e.attrs)),(e.children||[]).map((function(n,r){return Ko(n,"".concat(t,"-").concat(e.tag,"-").concat(r))})))}function Go(e){return Vo(e)[0]}function Yo(e){return e?Array.isArray(e)?e:[e]:[]}var Xo="\n.anticon {\n display: inline-block;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n",Qo=["icon","className","onClick","style","primaryColor","secondaryColor"],Zo={primaryColor:"#333",secondaryColor:"#E6E6E6",calculated:!1},Jo=function(e){var t=e.icon,n=e.className,r=e.onClick,o=e.style,i=e.primaryColor,a=e.secondaryColor,l=q(e,Qo),c=Zo;if(i&&(c={primaryColor:i,secondaryColor:a||Go(i)}),function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xo,t=(0,v.useContext)(fo).csp;(0,v.useEffect)((function(){eo(e,"@ant-design-icons",{prepend:!0,csp:t})}),[])}(),function(e,t){Bo(e,"[@ant-design/icons] ".concat(t))}(Uo(t),"icon should be icon definiton, but got ".concat(t)),!Uo(t))return null;var s=t;return s&&"function"==typeof s.icon&&(s=U(U({},s),{},{icon:s.icon(c.primaryColor,c.secondaryColor)})),Ko(s.icon,"svg-".concat(s.name),U({className:n,onClick:r,style:o,"data-icon":s.name,width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},l))};Jo.displayName="IconReact",Jo.getTwoToneColors=function(){return U({},Zo)},Jo.setTwoToneColors=function(e){var t=e.primaryColor,n=e.secondaryColor;Zo.primaryColor=t,Zo.secondaryColor=n||Go(t),Zo.calculated=!!n};var ei=Jo;function ti(e){var t=z(Yo(e),2),n=t[0],r=t[1];return ei.setTwoToneColors({primaryColor:n,secondaryColor:r})}var ni=["className","icon","spin","rotate","tabIndex","onClick","twoToneColor"];ti("#1890ff");var ri=v.forwardRef((function(e,t){var n,r=e.className,o=e.icon,i=e.spin,a=e.rotate,l=e.tabIndex,c=e.onClick,s=e.twoToneColor,u=q(e,ni),f=v.useContext(fo).prefixCls,d=void 0===f?"anticon":f,p=$()(d,(j(n={},"".concat(d,"-").concat(o.name),!!o.name),j(n,"".concat(d,"-spin"),!!i||"loading"===o.name),n),r),m=l;void 0===m&&c&&(m=-1);var h=a?{msTransform:"rotate(".concat(a,"deg)"),transform:"rotate(".concat(a,"deg)")}:void 0,g=z(Yo(s),2),y=g[0],b=g[1];return v.createElement("span",U(U({role:"img","aria-label":o.name},u),{},{ref:t,tabIndex:m,onClick:c,className:p}),v.createElement(ei,{icon:o,primaryColor:y,secondaryColor:b,style:h}))}));ri.displayName="AntdIcon",ri.getTwoToneColor=function(){var e=ei.getTwoToneColors();return e.calculated?[e.primaryColor,e.secondaryColor]:e.primaryColor},ri.setTwoToneColor=ti;var oi=ri,ii=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:uo}))};ii.displayName="LoadingOutlined";var ai=v.forwardRef(ii),li=function(){return{width:0,opacity:0,transform:"scale(0)"}},ci=function(e){return{width:e.scrollWidth,opacity:1,transform:"scale(1)"}},si=function(e){var t=e.prefixCls,n=!!e.loading;return e.existIcon?h().createElement("span",{className:"".concat(t,"-loading-icon")},h().createElement(ai,null)):h().createElement(dt,{visible:n,motionName:"".concat(t,"-loading-icon-motion"),removeOnLeave:!0,onAppearStart:li,onAppearActive:ci,onEnterStart:li,onEnterActive:ci,onLeaveStart:ci,onLeaveActive:li},(function(e,n){var r=e.className,o=e.style;return h().createElement("span",{className:"".concat(t,"-loading-icon"),style:o,ref:n},h().createElement(ai,{className:r}))}))},ui=/^[\u4e00-\u9fa5]{2}$/,fi=ui.test.bind(ui);function di(e){return"text"===e||"link"===e}function pi(e){return"danger"===e?{danger:!0}:{type:e}}xr("default","primary","ghost","dashed","link","text"),xr("default","circle","round"),xr("submit","button","reset");var mi=function(t,n){var r,o=t.loading,i=void 0!==o&&o,a=t.prefixCls,l=t.type,c=void 0===l?"default":l,s=t.danger,u=t.shape,f=void 0===u?"default":u,d=t.size,p=t.disabled,m=t.className,h=t.children,g=t.icon,y=t.ghost,b=void 0!==y&&y,w=t.block,C=void 0!==w&&w,x=t.htmlType,E=void 0===x?"button":x,k=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);oe.checked?e.styleConfig.checkboxChecked:e.styleConfig.checkboxUnchecked;function yi(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function bi(e){return function(e){if(Array.isArray(e))return D(e)}(e)||yi(e)||V(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function wi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=[];return h().Children.forEach(e,(function(e){(null!=e||t.keepEmpty)&&(Array.isArray(e)?n=n.concat(wi(e)):(0,de.isFragment)(e)&&e.props?n=n.concat(wi(e.props.children,t)):n.push(e))})),n}var Ci="RC_FORM_INTERNAL_HOOKS",xi=function(){Bo(!1,"Can not find FormContext. Please make sure you wrap Field under Form.")},Ei=v.createContext({getFieldValue:xi,getFieldsValue:xi,getFieldError:xi,getFieldWarning:xi,getFieldsError:xi,isFieldsTouched:xi,isFieldTouched:xi,isFieldValidating:xi,isFieldsValidating:xi,resetFields:xi,setFields:xi,setFieldsValue:xi,validateFields:xi,submit:xi,getInternalHooks:function(){return xi(),{dispatch:xi,initEntityValue:xi,registerField:xi,useSubscribe:xi,setInitialValues:xi,destroyForm:xi,setCallbacks:xi,registerWatch:xi,getFields:xi,setValidateMessages:xi,setPreserve:xi,getInitialValue:xi}}});function ki(e){return null==e?[]:Array.isArray(e)?e:[e]}function Si(){return Si=Object.assign?Object.assign.bind():function(e){for(var t=1;t1?t-1:0),r=1;r=i)return e;switch(e){case"%s":return String(n[o++]);case"%d":return Number(n[o++]);case"%j":try{return JSON.stringify(n[o++])}catch(e){return"[Circular]"}break;default:return e}}));return a}return e}function Ii(e,t){return null==e||!("array"!==t||!Array.isArray(e)||e.length)||!(!function(e){return"string"===e||"url"===e||"hex"===e||"email"===e||"date"===e||"pattern"===e}(t)||"string"!=typeof e||e)}function ji(e,t,n){var r=0,o=e.length;!function i(a){if(a&&a.length)n(a);else{var l=r;r+=1,l()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,$i=/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i,Wi={integer:function(e){return Wi.number(e)&&parseInt(e,10)===e},float:function(e){return Wi.number(e)&&!Wi.integer(e)},array:function(e){return Array.isArray(e)},regexp:function(e){if(e instanceof RegExp)return!0;try{return!!new RegExp(e)}catch(e){return!1}},date:function(e){return"function"==typeof e.getTime&&"function"==typeof e.getMonth&&"function"==typeof e.getYear&&!isNaN(e.getTime())},number:function(e){return!isNaN(e)&&"number"==typeof e},object:function(e){return"object"==typeof e&&!Wi.array(e)},method:function(e){return"function"==typeof e},email:function(e){return"string"==typeof e&&e.length<=320&&!!e.match(Hi)},url:function(e){return"string"==typeof e&&e.length<=2048&&!!e.match(function(){if(Li)return Li;var e="[a-fA-F\\d:]",t=function(t){return t&&t.includeBoundaries?"(?:(?<=\\s|^)(?="+e+")|(?<="+e+")(?=\\s|$))":""},n="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",r="[a-fA-F\\d]{1,4}",o=("\n(?:\n(?:"+r+":){7}(?:"+r+"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:"+r+":){6}(?:"+n+"|:"+r+"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:"+r+":){5}(?::"+n+"|(?::"+r+"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:"+r+":){4}(?:(?::"+r+"){0,1}:"+n+"|(?::"+r+"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:"+r+":){3}(?:(?::"+r+"){0,2}:"+n+"|(?::"+r+"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:"+r+":){2}(?:(?::"+r+"){0,3}:"+n+"|(?::"+r+"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:"+r+":){1}(?:(?::"+r+"){0,4}:"+n+"|(?::"+r+"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::"+r+"){0,5}:"+n+"|(?::"+r+"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),i=new RegExp("(?:^"+n+"$)|(?:^"+o+"$)"),a=new RegExp("^"+n+"$"),l=new RegExp("^"+o+"$"),c=function(e){return e&&e.exact?i:new RegExp("(?:"+t(e)+n+t(e)+")|(?:"+t(e)+o+t(e)+")","g")};c.v4=function(e){return e&&e.exact?a:new RegExp(""+t(e)+n+t(e),"g")},c.v6=function(e){return e&&e.exact?l:new RegExp(""+t(e)+o+t(e),"g")};var s=c.v4().source,u=c.v6().source;return Li=new RegExp("(?:^(?:(?:(?:[a-z]+:)?//)|www\\.)(?:\\S+(?::\\S*)?@)?(?:localhost|"+s+"|"+u+'|(?:(?:[a-z\\u00a1-\\uffff0-9][-_]*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))(?::\\d{2,5})?(?:[/?#][^\\s"]*)?$)',"i")}())},hex:function(e){return"string"==typeof e&&!!e.match($i)}},Bi=zi,Ui=function(e,t,n,r,o){(/^\s+$/.test(t)||""===t)&&r.push(Fi(o.messages.whitespace,e.fullField))},qi=function(e,t,n,r,o){if(e.required&&void 0===t)zi(e,t,n,r,o);else{var i=e.type;["integer","float","array","regexp","object","method","email","number","date","url","hex"].indexOf(i)>-1?Wi[i](t)||r.push(Fi(o.messages.types[i],e.fullField,e.type)):i&&typeof t!==e.type&&r.push(Fi(o.messages.types[i],e.fullField,e.type))}},Ki=function(e,t,n,r,o){var i="number"==typeof e.len,a="number"==typeof e.min,l="number"==typeof e.max,c=t,s=null,u="number"==typeof t,f="string"==typeof t,d=Array.isArray(t);if(u?s="number":f?s="string":d&&(s="array"),!s)return!1;d&&(c=t.length),f&&(c=t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"_").length),i?c!==e.len&&r.push(Fi(o.messages[s].len,e.fullField,e.len)):a&&!l&&ce.max?r.push(Fi(o.messages[s].max,e.fullField,e.max)):a&&l&&(ce.max)&&r.push(Fi(o.messages[s].range,e.fullField,e.min,e.max))},Gi=function(e,t,n,r,o){e.enum=Array.isArray(e.enum)?e.enum:[],-1===e.enum.indexOf(t)&&r.push(Fi(o.messages.enum,e.fullField,e.enum.join(", ")))},Yi=function(e,t,n,r,o){e.pattern&&(e.pattern instanceof RegExp?(e.pattern.lastIndex=0,e.pattern.test(t)||r.push(Fi(o.messages.pattern.mismatch,e.fullField,t,e.pattern))):"string"==typeof e.pattern&&(new RegExp(e.pattern).test(t)||r.push(Fi(o.messages.pattern.mismatch,e.fullField,t,e.pattern))))},Xi=function(e,t,n,r,o){var i=e.type,a=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t,i)&&!e.required)return n();Bi(e,t,r,a,o,i),Ii(t,i)||qi(e,t,r,a,o)}n(a)},Qi={string:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t,"string")&&!e.required)return n();Bi(e,t,r,i,o,"string"),Ii(t,"string")||(qi(e,t,r,i,o),Ki(e,t,r,i,o),Yi(e,t,r,i,o),!0===e.whitespace&&Ui(e,t,r,i,o))}n(i)},method:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&qi(e,t,r,i,o)}n(i)},number:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(""===t&&(t=void 0),Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&(qi(e,t,r,i,o),Ki(e,t,r,i,o))}n(i)},boolean:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&qi(e,t,r,i,o)}n(i)},regexp:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),Ii(t)||qi(e,t,r,i,o)}n(i)},integer:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&(qi(e,t,r,i,o),Ki(e,t,r,i,o))}n(i)},float:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&(qi(e,t,r,i,o),Ki(e,t,r,i,o))}n(i)},array:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(null==t&&!e.required)return n();Bi(e,t,r,i,o,"array"),null!=t&&(qi(e,t,r,i,o),Ki(e,t,r,i,o))}n(i)},object:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&qi(e,t,r,i,o)}n(i)},enum:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o),void 0!==t&&Gi(e,t,r,i,o)}n(i)},pattern:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t,"string")&&!e.required)return n();Bi(e,t,r,i,o),Ii(t,"string")||Yi(e,t,r,i,o)}n(i)},date:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t,"date")&&!e.required)return n();var a;Bi(e,t,r,i,o),Ii(t,"date")||(a=t instanceof Date?t:new Date(t),qi(e,a,r,i,o),a&&Ki(e,a.getTime(),r,i,o))}n(i)},url:Xi,hex:Xi,email:Xi,required:function(e,t,n,r,o){var i=[],a=Array.isArray(t)?"array":typeof t;Bi(e,t,r,i,o,a),n(i)},any:function(e,t,n,r,o){var i=[];if(e.required||!e.required&&r.hasOwnProperty(e.field)){if(Ii(t)&&!e.required)return n();Bi(e,t,r,i,o)}n(i)}};function Zi(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var e=JSON.parse(JSON.stringify(this));return e.clone=this.clone,e}}}var Ji=Zi(),ea=function(){function e(e){this.rules=null,this._messages=Ji,this.define(e)}var t=e.prototype;return t.define=function(e){var t=this;if(!e)throw new Error("Cannot configure a schema with no rules");if("object"!=typeof e||Array.isArray(e))throw new Error("Rules must be an object");this.rules={},Object.keys(e).forEach((function(n){var r=e[n];t.rules[n]=Array.isArray(r)?r:[r]}))},t.messages=function(e){return e&&(this._messages=Vi(Zi(),e)),this._messages},t.validate=function(t,n,r){var o=this;void 0===n&&(n={}),void 0===r&&(r=function(){});var i=t,a=n,l=r;if("function"==typeof a&&(l=a,a={}),!this.rules||0===Object.keys(this.rules).length)return l&&l(null,i),Promise.resolve(i);if(a.messages){var c=this.messages();c===Ji&&(c=Zi()),Vi(c,a.messages),a.messages=c}else a.messages=this.messages();var s={};(a.keys||Object.keys(this.rules)).forEach((function(e){var n=o.rules[e],r=i[e];n.forEach((function(n){var a=n;"function"==typeof a.transform&&(i===t&&(i=Si({},i)),r=i[e]=a.transform(r)),(a="function"==typeof a?{validator:a}:Si({},a)).validator=o.getValidationMethod(a),a.validator&&(a.field=e,a.fullField=a.fullField||e,a.type=o.getType(a),s[e]=s[e]||[],s[e].push({rule:a,value:r,source:i,field:e}))}))}));var u={};return function(e,t,n,r,o){if(t.first){var i=new Promise((function(t,i){var a=function(e){var t=[];return Object.keys(e).forEach((function(n){t.push.apply(t,e[n]||[])})),t}(e);ji(a,n,(function(e){return r(e),e.length?i(new _i(e,Ti(e))):t(o)}))}));return i.catch((function(e){return e})),i}var a=!0===t.firstFields?Object.keys(e):t.firstFields||[],l=Object.keys(e),c=l.length,s=0,u=[],f=new Promise((function(t,i){var f=function(e){if(u.push.apply(u,e),++s===c)return r(u),u.length?i(new _i(u,Ti(u))):t(o)};l.length||(r(u),t(o)),l.forEach((function(t){var r=e[t];-1!==a.indexOf(t)?ji(r,n,f):function(e,t,n){var r=[],o=0,i=e.length;function a(e){r.push.apply(r,e||[]),++o===i&&n(r)}e.forEach((function(e){t(e,a)}))}(r,n,f)}))}));return f.catch((function(e){return e})),f}(s,a,(function(t,n){var r,o=t.rule,l=!("object"!==o.type&&"array"!==o.type||"object"!=typeof o.fields&&"object"!=typeof o.defaultField);function c(e,t){return Si({},t,{fullField:o.fullField+"."+e,fullFields:o.fullFields?[].concat(o.fullFields,[e]):[e]})}function s(r){void 0===r&&(r=[]);var s=Array.isArray(r)?r:[r];!a.suppressWarning&&s.length&&e.warning("async-validator:",s),s.length&&void 0!==o.message&&(s=[].concat(o.message));var f=s.map(Di(o,i));if(a.first&&f.length)return u[o.field]=1,n(f);if(l){if(o.required&&!t.value)return void 0!==o.message?f=[].concat(o.message).map(Di(o,i)):a.error&&(f=[a.error(o,Fi(a.messages.required,o.field))]),n(f);var d={};o.defaultField&&Object.keys(t.value).map((function(e){d[e]=o.defaultField})),d=Si({},d,t.rule.fields);var p={};Object.keys(d).forEach((function(e){var t=d[e],n=Array.isArray(t)?t:[t];p[e]=n.map(c.bind(null,e))}));var m=new e(p);m.messages(a.messages),t.rule.options&&(t.rule.options.messages=a.messages,t.rule.options.error=a.error),m.validate(t.value,t.rule.options||a,(function(e){var t=[];f&&f.length&&t.push.apply(t,f),e&&e.length&&t.push.apply(t,e),n(t.length?t:null)}))}else n(f)}if(l=l&&(o.required||!o.required&&t.value),o.field=t.field,o.asyncValidator)r=o.asyncValidator(o,t.value,s,t.source,a);else if(o.validator){try{r=o.validator(o,t.value,s,t.source,a)}catch(e){null==console.error||console.error(e),a.suppressValidatorError||setTimeout((function(){throw e}),0),s(e.message)}!0===r?s():!1===r?s("function"==typeof o.message?o.message(o.fullField||o.field):o.message||(o.fullField||o.field)+" fails"):r instanceof Array?s(r):r instanceof Error&&s(r.message)}r&&r.then&&r.then((function(){return s()}),(function(e){return s(e)}))}),(function(e){!function(e){var t=[],n={};function r(e){var n;Array.isArray(e)?t=(n=t).concat.apply(n,e):t.push(e)}for(var o=0;o3&&void 0!==arguments[3]&&arguments[3];return t.length&&r&&void 0===n&&!ra(e,t.slice(0,-1))?e:ia(e,t,n,r)}var la=function e(t){return Array.isArray(t)?function(t){return t.map((function(t){return e(t)}))}(t):"object"===W(t)&&null!==t?function(t){if(Object.getPrototypeOf(t)===Object.prototype){var n={};for(var r in t)n[r]=e(t[r]);return n}return t}(t):t};function ca(e){return ki(e)}function sa(e,t){return ra(e,t)}function ua(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=aa(e,t,n,r);return o}function fa(e,t){var n={};return t.forEach((function(t){var r=sa(e,t);n=ua(n,t,r)})),n}function da(e,t){return e&&e.some((function(e){return ha(e,t)}))}function pa(e){return"object"===W(e)&&null!==e&&Object.getPrototypeOf(e)===Object.prototype}function ma(e,t){var n=Array.isArray(e)?bi(e):U({},e);return t?(Object.keys(t).forEach((function(e){var r=n[e],o=t[e],i=pa(r)&&pa(o);n[e]=i?ma(r,o||{}):la(o)})),n):n}function va(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r=r||n<0||n>=r)return e;var o=e[t],i=t-n;return i>0?[].concat(bi(e.slice(0,n)),[o],bi(e.slice(n,t)),bi(e.slice(t+1,r))):i<0?[].concat(bi(e.slice(0,t)),bi(e.slice(t+1,n+1)),[o],bi(e.slice(n+1,r))):e}var ba=ea;function wa(e,t){return e.replace(/\$\{\w+\}/g,(function(e){var n=e.slice(2,-1);return t[n]}))}var Ca="CODE_LOGIC_ERROR";function xa(_x,e,t,n,r){return Ea.apply(this,arguments)}function Ea(){return Ea=Yn(Kn().mark((function e(t,n,r,o,i){var a,l,c,s,u,f,d,p,m;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return delete(a=U({},r)).ruleIndex,a.validator&&(l=a.validator,a.validator=function(){try{return l.apply(void 0,arguments)}catch(e){return console.error(e),Promise.reject(Ca)}}),c=null,a&&"array"===a.type&&a.defaultField&&(c=a.defaultField,delete a.defaultField),s=new ba(j({},t,[a])),u=va({},na,o.validateMessages),s.messages(u),f=[],e.prev=9,e.next=12,Promise.resolve(s.validate(j({},t,n),U({},o)));case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(9),e.t0.errors&&(f=e.t0.errors.map((function(e,t){var n=e.message,r=n===Ca?u.default:n;return v.isValidElement(r)?v.cloneElement(r,{key:"error_".concat(t)}):r})));case 17:if(f.length||!c){e.next=22;break}return e.next=20,Promise.all(n.map((function(e,n){return xa("".concat(t,".").concat(n),e,c,o,i)})));case 20:return d=e.sent,e.abrupt("return",d.reduce((function(e,t){return[].concat(bi(e),bi(t))}),[]));case 22:return p=U(U({},r),{},{name:t,enum:(r.enum||[]).join(", ")},i),m=f.map((function(e){return"string"==typeof e?wa(e,p):e})),e.abrupt("return",m);case 25:case"end":return e.stop()}}),e,null,[[9,14]])}))),Ea.apply(this,arguments)}function ka(){return(ka=Yn(Kn().mark((function e(t){return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.all(t).then((function(e){var t;return(t=[]).concat.apply(t,bi(e))})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Sa(){return(Sa=Yn(Kn().mark((function e(t){var n;return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=0,e.abrupt("return",new Promise((function(e){t.forEach((function(r){r.then((function(r){r.errors.length&&e([r]),(n+=1)===t.length&&e([])}))}))})));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Oa=["name"],Na=[];function Pa(e,t,n,r,o,i){return"function"==typeof e?e(t,n,"source"in i?{source:i.source}:{}):r!==o}var Aa=function(e){Z(n,e);var t=te(n);function n(e){var r;return K(this,n),(r=t.call(this,e)).state={resetCount:0},r.cancelRegisterFunc=null,r.mounted=!1,r.touched=!1,r.dirty=!1,r.validatePromise=null,r.prevValidating=void 0,r.errors=Na,r.warnings=Na,r.cancelRegister=function(){var e=r.props,t=e.preserve,n=e.isListField,o=e.name;r.cancelRegisterFunc&&r.cancelRegisterFunc(n,t,ca(o)),r.cancelRegisterFunc=null},r.getNamePath=function(){var e=r.props,t=e.name,n=e.fieldContext.prefixName;return void 0!==t?[].concat(bi(void 0===n?[]:n),bi(t)):[]},r.getRules=function(){var e=r.props,t=e.rules,n=void 0===t?[]:t,o=e.fieldContext;return n.map((function(e){return"function"==typeof e?e(o):e}))},r.refresh=function(){r.mounted&&r.setState((function(e){return{resetCount:e.resetCount+1}}))},r.triggerMetaEvent=function(e){var t=r.props.onMetaChange;null==t||t(U(U({},r.getMeta()),{},{destroy:e}))},r.onStoreChange=function(e,t,n){var o=r.props,i=o.shouldUpdate,a=o.dependencies,l=void 0===a?[]:a,c=o.onReset,s=n.store,u=r.getNamePath(),f=r.getValue(e),d=r.getValue(s),p=t&&da(t,u);switch("valueUpdate"===n.type&&"external"===n.source&&f!==d&&(r.touched=!0,r.dirty=!0,r.validatePromise=null,r.errors=Na,r.warnings=Na,r.triggerMetaEvent()),n.type){case"reset":if(!t||p)return r.touched=!1,r.dirty=!1,r.validatePromise=null,r.errors=Na,r.warnings=Na,r.triggerMetaEvent(),null==c||c(),void r.refresh();break;case"remove":if(i)return void r.reRender();break;case"setField":if(p){var m=n.data;return"touched"in m&&(r.touched=m.touched),"validating"in m&&!("originRCField"in m)&&(r.validatePromise=m.validating?Promise.resolve([]):null),"errors"in m&&(r.errors=m.errors||Na),"warnings"in m&&(r.warnings=m.warnings||Na),r.dirty=!0,r.triggerMetaEvent(),void r.reRender()}if(i&&!u.length&&Pa(i,e,s,f,d,n))return void r.reRender();break;case"dependenciesUpdate":if(l.map(ca).some((function(e){return da(n.relatedFields,e)})))return void r.reRender();break;default:if(p||(!l.length||u.length||i)&&Pa(i,e,s,f,d,n))return void r.reRender()}!0===i&&r.reRender()},r.validateRules=function(e){var t=r.getNamePath(),n=r.getValue(),o=Promise.resolve().then((function(){if(!r.mounted)return[];var i=r.props,a=i.validateFirst,l=void 0!==a&&a,c=i.messageVariables,s=(e||{}).triggerName,u=r.getRules();s&&(u=u.filter((function(e){var t=e.validateTrigger;return!t||ki(t).includes(s)})));var f=function(e,t,n,r,o,i){var a,l=e.join("."),c=n.map((function(e,t){var n=e.validator,r=U(U({},e),{},{ruleIndex:t});return n&&(r.validator=function(e,t,r){var o=!1,i=n(e,t,(function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&void 0!==arguments[0]?arguments[0]:Na;if(r.validatePromise===o){r.validatePromise=null;var t=[],n=[];e.forEach((function(e){var r=e.rule.warningOnly,o=e.errors,i=void 0===o?Na:o;r?n.push.apply(n,bi(i)):t.push.apply(t,bi(i))})),r.errors=t,r.warnings=n,r.triggerMetaEvent(),r.reRender()}})),f}));return r.validatePromise=o,r.dirty=!0,r.errors=Na,r.warnings=Na,r.triggerMetaEvent(),r.reRender(),o},r.isFieldValidating=function(){return!!r.validatePromise},r.isFieldTouched=function(){return r.touched},r.isFieldDirty=function(){return!(!r.dirty&&void 0===r.props.initialValue)||void 0!==(0,r.props.fieldContext.getInternalHooks(Ci).getInitialValue)(r.getNamePath())},r.getErrors=function(){return r.errors},r.getWarnings=function(){return r.warnings},r.isListField=function(){return r.props.isListField},r.isList=function(){return r.props.isList},r.isPreserve=function(){return r.props.preserve},r.getMeta=function(){return r.prevValidating=r.isFieldValidating(),{touched:r.isFieldTouched(),validating:r.prevValidating,errors:r.errors,warnings:r.warnings,name:r.getNamePath()}},r.getOnlyChild=function(e){if("function"==typeof e){var t=r.getMeta();return U(U({},r.getOnlyChild(e(r.getControlled(),t,r.props.fieldContext))),{},{isFunction:!0})}var n=wi(e);return 1===n.length&&v.isValidElement(n[0])?{child:n[0],isFunction:!1}:{child:n,isFunction:!1}},r.getValue=function(e){var t=r.props.fieldContext.getFieldsValue,n=r.getNamePath();return sa(e||t(!0),n)},r.getControlled=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=r.props,n=t.trigger,o=t.validateTrigger,i=t.getValueFromEvent,a=t.normalize,l=t.valuePropName,c=t.getValueProps,s=t.fieldContext,u=void 0!==o?o:s.validateTrigger,f=r.getNamePath(),d=s.getInternalHooks,p=s.getFieldsValue,m=d(Ci),v=m.dispatch,h=r.getValue(),g=c||function(e){return j({},l,e)},y=e[n],b=U(U({},e),g(h));b[n]=function(){var e;r.touched=!0,r.dirty=!0,r.triggerMetaEvent();for(var t=arguments.length,n=new Array(t),o=0;o=0&&t<=n.length?(l.keys=[].concat(bi(l.keys.slice(0,t)),[l.id],bi(l.keys.slice(t))),i([].concat(bi(n.slice(0,t)),[e],bi(n.slice(t))))):(l.keys=[].concat(bi(l.keys),[l.id]),i([].concat(bi(n),[e]))),l.id+=1},remove:function(e){var t=u(),n=new Set(Array.isArray(e)?e:[e]);n.size<=0||(l.keys=l.keys.filter((function(e,t){return!n.has(t)})),i(t.filter((function(e,t){return!n.has(t)}))))},move:function(e,t){if(e!==t){var n=u();e<0||e>=n.length||t<0||t>=n.length||(l.keys=ya(l.keys,e,t),i(ya(n,e,t)))}}},d=o||[];return Array.isArray(d)||(d=[]),r(d.map((function(__,e){var t=l.keys[e];return void 0===t&&(l.keys[e]=l.id,t=l.keys[e],l.id+=1),{name:e,key:t,isListField:!0}})),f,t)}))))},Fa="__@field_split__";function Ia(e){return e.map((function(e){return"".concat(W(e),":").concat(e)})).join(Fa)}var ja=function(){function e(){K(this,e),this.kvs=new Map}return Y(e,[{key:"set",value:function(e,t){this.kvs.set(Ia(e),t)}},{key:"get",value:function(e){return this.kvs.get(Ia(e))}},{key:"update",value:function(e,t){var n=t(this.get(e));n?this.set(e,n):this.delete(e)}},{key:"delete",value:function(e){this.kvs.delete(Ia(e))}},{key:"map",value:function(e){return bi(this.kvs.entries()).map((function(t){var n=z(t,2),r=n[0],o=n[1],i=r.split(Fa);return e({key:i.map((function(e){var t=z(e.match(/^([^:]*):(.*)$/),3),n=t[1],r=t[2];return"number"===n?Number(r):r})),value:o})}))}},{key:"toJSON",value:function(){var e={};return this.map((function(t){var n=t.key,r=t.value;return e[n.join(".")]=r,null})),e}}]),e}(),_a=ja,Da=["name","errors"],Va=Y((function e(t){var n=this;K(this,e),this.formHooked=!1,this.forceRootUpdate=void 0,this.subscribable=!0,this.store={},this.fieldEntities=[],this.initialValues={},this.callbacks={},this.validateMessages=null,this.preserve=null,this.lastValidatePromise=null,this.getForm=function(){return{getFieldValue:n.getFieldValue,getFieldsValue:n.getFieldsValue,getFieldError:n.getFieldError,getFieldWarning:n.getFieldWarning,getFieldsError:n.getFieldsError,isFieldsTouched:n.isFieldsTouched,isFieldTouched:n.isFieldTouched,isFieldValidating:n.isFieldValidating,isFieldsValidating:n.isFieldsValidating,resetFields:n.resetFields,setFields:n.setFields,setFieldsValue:n.setFieldsValue,validateFields:n.validateFields,submit:n.submit,_init:!0,getInternalHooks:n.getInternalHooks}},this.getInternalHooks=function(e){return e===Ci?(n.formHooked=!0,{dispatch:n.dispatch,initEntityValue:n.initEntityValue,registerField:n.registerField,useSubscribe:n.useSubscribe,setInitialValues:n.setInitialValues,destroyForm:n.destroyForm,setCallbacks:n.setCallbacks,setValidateMessages:n.setValidateMessages,getFields:n.getFields,setPreserve:n.setPreserve,getInitialValue:n.getInitialValue,registerWatch:n.registerWatch}):(Bo(!1,"`getInternalHooks` is internal usage. Should not call directly."),null)},this.useSubscribe=function(e){n.subscribable=e},this.prevWithoutPreserves=null,this.setInitialValues=function(e,t){if(n.initialValues=e||{},t){var r,o=va({},e,n.store);null===(r=n.prevWithoutPreserves)||void 0===r||r.map((function(t){var n=t.key;o=ua(o,n,sa(e,n))})),n.prevWithoutPreserves=null,n.updateStore(o)}},this.destroyForm=function(){var e=new _a;n.getFieldEntities(!0).forEach((function(t){n.isMergedPreserve(t.isPreserve())||e.set(t.getNamePath(),!0)})),n.prevWithoutPreserves=e},this.getInitialValue=function(e){var t=sa(n.initialValues,e);return e.length?la(t):t},this.setCallbacks=function(e){n.callbacks=e},this.setValidateMessages=function(e){n.validateMessages=e},this.setPreserve=function(e){n.preserve=e},this.watchList=[],this.registerWatch=function(e){return n.watchList.push(e),function(){n.watchList=n.watchList.filter((function(t){return t!==e}))}},this.notifyWatch=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(n.watchList.length){var t=n.getFieldsValue();n.watchList.forEach((function(n){n(t,e)}))}},this.timeoutId=null,this.warningUnhooked=function(){},this.updateStore=function(e){n.store=e},this.getFieldEntities=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return e?n.fieldEntities.filter((function(e){return e.getNamePath().length})):n.fieldEntities},this.getFieldsMap=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=new _a;return n.getFieldEntities(e).forEach((function(e){var n=e.getNamePath();t.set(n,e)})),t},this.getFieldEntitiesForNamePathList=function(e){if(!e)return n.getFieldEntities(!0);var t=n.getFieldsMap(!0);return e.map((function(e){var n=ca(e);return t.get(n)||{INVALIDATE_NAME_PATH:ca(e)}}))},this.getFieldsValue=function(e,t){if(n.warningUnhooked(),!0===e&&!t)return n.store;var r=n.getFieldEntitiesForNamePathList(Array.isArray(e)?e:null),o=[];return r.forEach((function(n){var r,i="INVALIDATE_NAME_PATH"in n?n.INVALIDATE_NAME_PATH:n.getNamePath();if(e||!(null===(r=n.isListField)||void 0===r?void 0:r.call(n)))if(t){var a="getMeta"in n?n.getMeta():null;t(a)&&o.push(i)}else o.push(i)})),fa(n.store,o.map(ca))},this.getFieldValue=function(e){n.warningUnhooked();var t=ca(e);return sa(n.store,t)},this.getFieldsError=function(e){return n.warningUnhooked(),n.getFieldEntitiesForNamePathList(e).map((function(t,n){return t&&!("INVALIDATE_NAME_PATH"in t)?{name:t.getNamePath(),errors:t.getErrors(),warnings:t.getWarnings()}:{name:ca(e[n]),errors:[],warnings:[]}}))},this.getFieldError=function(e){n.warningUnhooked();var t=ca(e);return n.getFieldsError([t])[0].errors},this.getFieldWarning=function(e){n.warningUnhooked();var t=ca(e);return n.getFieldsError([t])[0].warnings},this.isFieldsTouched=function(){n.warningUnhooked();for(var e=arguments.length,t=new Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:{},t=new _a,r=n.getFieldEntities(!0);r.forEach((function(e){var n=e.props.initialValue,r=e.getNamePath();if(void 0!==n){var o=t.get(r)||new Set;o.add({entity:e,value:n}),t.set(r,o)}}));var o,i=function(r){r.forEach((function(r){if(void 0!==r.props.initialValue){var o=r.getNamePath();if(void 0!==n.getInitialValue(o))Bo(!1,"Form already set 'initialValues' with path '".concat(o.join("."),"'. Field can not overwrite it."));else{var i=t.get(o);if(i&&i.size>1)Bo(!1,"Multiple Field with path '".concat(o.join("."),"' set 'initialValue'. Can not decide which one to pick."));else if(i){var a=n.getFieldValue(o);e.skipExist&&void 0!==a||n.updateStore(ua(n.store,o,bi(i)[0].value))}}}}))};e.entities?o=e.entities:e.namePathList?(o=[],e.namePathList.forEach((function(e){var n,r=t.get(e);r&&(n=o).push.apply(n,bi(bi(r).map((function(e){return e.entity}))))}))):o=r,i(o)},this.resetFields=function(e){n.warningUnhooked();var t=n.store;if(!e)return n.updateStore(va({},n.initialValues)),n.resetWithFieldInitialValue(),n.notifyObservers(t,null,{type:"reset"}),void n.notifyWatch();var r=e.map(ca);r.forEach((function(e){var t=n.getInitialValue(e);n.updateStore(ua(n.store,e,t))})),n.resetWithFieldInitialValue({namePathList:r}),n.notifyObservers(t,r,{type:"reset"}),n.notifyWatch(r)},this.setFields=function(e){n.warningUnhooked();var t=n.store,r=[];e.forEach((function(e){var o=e.name,i=(e.errors,q(e,Da)),a=ca(o);r.push(a),"value"in i&&n.updateStore(ua(n.store,a,i.value)),n.notifyObservers(t,[a],{type:"setField",data:e})})),n.notifyWatch(r)},this.getFields=function(){return n.getFieldEntities(!0).map((function(e){var t=e.getNamePath(),r=U(U({},e.getMeta()),{},{name:t,value:n.getFieldValue(t)});return Object.defineProperty(r,"originRCField",{value:!0}),r}))},this.initEntityValue=function(e){var t=e.props.initialValue;if(void 0!==t){var r=e.getNamePath();void 0===sa(n.store,r)&&n.updateStore(ua(n.store,r,t))}},this.isMergedPreserve=function(e){var t=void 0!==e?e:n.preserve;return null==t||t},this.registerField=function(e){n.fieldEntities.push(e);var t=e.getNamePath();if(n.notifyWatch([t]),void 0!==e.props.initialValue){var r=n.store;n.resetWithFieldInitialValue({entities:[e],skipExist:!0}),n.notifyObservers(r,[e.getNamePath()],{type:"valueUpdate",source:"internal"})}return function(r,o){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(n.fieldEntities=n.fieldEntities.filter((function(t){return t!==e})),!n.isMergedPreserve(o)&&(!r||i.length>1)){var a=r?void 0:n.getInitialValue(t);if(t.length&&n.getFieldValue(t)!==a&&n.fieldEntities.every((function(e){return!ha(e.getNamePath(),t)}))){var l=n.store;n.updateStore(ua(l,t,a,!0)),n.notifyObservers(l,[t],{type:"remove"}),n.triggerDependenciesUpdate(l,t)}}n.notifyWatch([t])}},this.dispatch=function(e){switch(e.type){case"updateValue":var t=e.namePath,r=e.value;n.updateValue(t,r);break;case"validateField":var o=e.namePath,i=e.triggerName;n.validateFields([o],{triggerName:i})}},this.notifyObservers=function(e,t,r){if(n.subscribable){var o=U(U({},r),{},{store:n.getFieldsValue(!0)});n.getFieldEntities().forEach((function(n){(0,n.onStoreChange)(e,t,o)}))}else n.forceRootUpdate()},this.triggerDependenciesUpdate=function(e,t){var r=n.getDependencyChildrenFields(t);return r.length&&n.validateFields(r),n.notifyObservers(e,r,{type:"dependenciesUpdate",relatedFields:[t].concat(bi(r))}),r},this.updateValue=function(e,t){var r=ca(e),o=n.store;n.updateStore(ua(n.store,r,t)),n.notifyObservers(o,[r],{type:"valueUpdate",source:"internal"}),n.notifyWatch([r]);var i=n.triggerDependenciesUpdate(o,r),a=n.callbacks.onValuesChange;a&&a(fa(n.store,[r]),n.getFieldsValue()),n.triggerOnFieldsChange([r].concat(bi(i)))},this.setFieldsValue=function(e){n.warningUnhooked();var t=n.store;if(e){var r=va(n.store,e);n.updateStore(r)}n.notifyObservers(t,null,{type:"valueUpdate",source:"external"}),n.notifyWatch()},this.getDependencyChildrenFields=function(e){var t=new Set,r=[],o=new _a;return n.getFieldEntities().forEach((function(e){(e.props.dependencies||[]).forEach((function(t){var n=ca(t);o.update(n,(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Set;return t.add(e),t}))}))})),function e(n){(o.get(n)||new Set).forEach((function(n){if(!t.has(n)){t.add(n);var o=n.getNamePath();n.isFieldDirty()&&o.length&&(r.push(o),e(o))}}))}(e),r},this.triggerOnFieldsChange=function(e,t){var r=n.callbacks.onFieldsChange;if(r){var o=n.getFields();if(t){var i=new _a;t.forEach((function(e){var t=e.name,n=e.errors;i.set(t,n)})),o.forEach((function(e){e.errors=i.get(e.name)||e.errors}))}r(o.filter((function(t){var n=t.name;return da(e,n)})),o)}},this.validateFields=function(e,t){n.warningUnhooked();var r=!!e,o=r?e.map(ca):[],i=[];n.getFieldEntities(!0).forEach((function(a){if(r||o.push(a.getNamePath()),(null==t?void 0:t.recursive)&&r){var l=a.getNamePath();l.every((function(t,n){return e[n]===t||void 0===e[n]}))&&o.push(l)}if(a.props.rules&&a.props.rules.length){var c=a.getNamePath();if(!r||da(o,c)){var s=a.validateRules(U({validateMessages:U(U({},na),n.validateMessages)},t));i.push(s.then((function(){return{name:c,errors:[],warnings:[]}})).catch((function(e){var t=[],n=[];return e.forEach((function(e){var r=e.rule.warningOnly,o=e.errors;r?n.push.apply(n,bi(o)):t.push.apply(t,bi(o))})),t.length?Promise.reject({name:c,errors:t,warnings:n}):{name:c,errors:t,warnings:n}})))}}}));var a=function(e){var t=!1,n=e.length,r=[];return e.length?new Promise((function(o,i){e.forEach((function(e,a){e.catch((function(e){return t=!0,e})).then((function(e){n-=1,r[a]=e,n>0||(t&&i(r),o(r))}))}))})):Promise.resolve([])}(i);n.lastValidatePromise=a,a.catch((function(e){return e})).then((function(e){var t=e.map((function(e){return e.name}));n.notifyObservers(n.store,t,{type:"validateFinish"}),n.triggerOnFieldsChange(t,e)}));var l=a.then((function(){return n.lastValidatePromise===a?Promise.resolve(n.getFieldsValue(o)):Promise.reject([])})).catch((function(e){var t=e.filter((function(e){return e&&e.errors.length}));return Promise.reject({values:n.getFieldsValue(o),errorFields:t,outOfDate:n.lastValidatePromise!==a})}));return l.catch((function(e){return e})),l},this.submit=function(){n.warningUnhooked(),n.validateFields().then((function(e){var t=n.callbacks.onFinish;if(t)try{t(e)}catch(e){console.error(e)}})).catch((function(e){var t=n.callbacks.onFinishFailed;t&&t(e)}))},this.forceRootUpdate=t})),La=function(e){var t=v.useRef(),n=z(v.useState({}),2)[1];if(!t.current)if(e)t.current=e;else{var r=new Va((function(){n({})}));t.current=r.getForm()}return[t.current]},za=v.createContext({triggerFormChange:function(){},triggerFormFinish:function(){},registerForm:function(){},unregisterForm:function(){}}),Ha=function(e){var t=e.validateMessages,n=e.onFormChange,r=e.onFormFinish,o=e.children,i=v.useContext(za),a=v.useRef({});return v.createElement(za.Provider,{value:U(U({},i),{},{validateMessages:U(U({},i.validateMessages),t),triggerFormChange:function(e,t){n&&n(e,{changedFields:t,forms:a.current}),i.triggerFormChange(e,t)},triggerFormFinish:function(e,t){r&&r(e,{values:t,forms:a.current}),i.triggerFormFinish(e,t)},registerForm:function(e,t){e&&(a.current=U(U({},a.current),{},j({},e,t))),i.registerForm(e,t)},unregisterForm:function(e){var t=U({},a.current);delete t[e],a.current=t,i.unregisterForm(e)}})},o)},$a=za,Wa=["name","initialValues","fields","form","preserve","children","component","validateMessages","validateTrigger","onValuesChange","onFieldsChange","onFinish","onFinishFailed"],Ba=function(t,n){var r=t.name,o=t.initialValues,i=t.fields,a=t.form,l=t.preserve,c=t.children,s=t.component,u=void 0===s?"form":s,f=t.validateMessages,d=t.validateTrigger,p=void 0===d?"onChange":d,m=t.onValuesChange,h=t.onFieldsChange,g=t.onFinish,y=t.onFinishFailed,b=q(t,Wa),w=v.useContext($a),C=z(La(a),1)[0],x=C.getInternalHooks(Ci),E=x.useSubscribe,k=x.setInitialValues,S=x.setCallbacks,O=x.setValidateMessages,N=x.setPreserve,P=x.destroyForm;v.useImperativeHandle(n,(function(){return C})),v.useEffect((function(){return w.registerForm(r,C),function(){w.unregisterForm(r)}}),[w,C,r]),O(U(U({},w.validateMessages),f)),S({onValuesChange:m,onFieldsChange:function(e){if(w.triggerFormChange(r,e),h){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=(0,v.useState)(),r=z(n,2),o=r[0],i=r[1],a=(0,v.useMemo)((function(){return Ua(o)}),[o]),l=(0,v.useRef)(a);l.current=a;var c=(0,v.useContext)(Ei),s=t||c,u=s&&s._init,f=ca(e),d=(0,v.useRef)(f);return d.current=f,(0,v.useEffect)((function(){if(u){var e=s.getFieldsValue,t=(0,(0,s.getInternalHooks)(Ci).registerWatch)((function(e){var t=sa(e,d.current),n=Ua(t);l.current!==n&&(l.current=n,i(t))})),n=sa(e(),d.current);return i(n),t}}),[]),o},Ka=v.forwardRef(Ba);Ka.FormProvider=Ha,Ka.Field=Ma,Ka.List=Ta,Ka.useForm=La,Ka.useWatch=qa;var Ga=Ka,Ya=v.createContext({labelAlign:"right",vertical:!1,itemRef:function(){}}),Xa=v.createContext(null),Qa=v.createContext({prefixCls:""}),Za=v.createContext({}),Ja=function(t){var n=t.children,r=t.status,o=t.override,i=(0,v.useContext)(Za),a=(0,v.useMemo)((function(){var t=e({},i);return o&&delete t.isFormItemInput,r&&(delete t.status,delete t.hasFeedback,delete t.feedbackIcon),t}),[r,o,i]);return v.createElement(Za.Provider,{value:a},n)},el={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 01-1.9-5.2c0-4.4 3.6-8 8-8l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z"}}]},name:"close-circle",theme:"filled"},tl=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:el}))};tl.displayName="CloseCircleFilled";var nl=v.forwardRef(tl);function rl(e){return!(!e.addonBefore&&!e.addonAfter)}function ol(e){return!!(e.prefix||e.suffix||e.allowClear)}function il(e,t,n,r){if(n){var o=t;if("click"===t.type){var i=e.cloneNode(!0);return o=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value="",void n(o)}if(void 0!==r)return o=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,void n(o);n(o)}}function al(e){return null==e?"":String(e)}var ll=function(e){var t=e.inputElement,n=e.prefixCls,r=e.prefix,o=e.suffix,i=e.addonBefore,a=e.addonAfter,l=e.className,c=e.style,s=e.affixWrapperClassName,u=e.groupClassName,f=e.wrapperClassName,d=e.disabled,p=e.readOnly,m=e.focused,g=e.triggerFocus,y=e.allowClear,b=e.value,w=e.handleReset,C=e.hidden,x=(0,v.useRef)(null),E=(0,v.cloneElement)(t,{value:b,hidden:C});if(ol(e)){var k,S="".concat(n,"-affix-wrapper"),O=$()(S,(j(k={},"".concat(S,"-disabled"),d),j(k,"".concat(S,"-focused"),m),j(k,"".concat(S,"-readonly"),p),j(k,"".concat(S,"-input-with-clear-btn"),o&&y&&b),k),!rl(e)&&l,s),N=(o||y)&&h().createElement("span",{className:"".concat(n,"-suffix")},function(){var e;if(!y)return null;var t=!d&&!p&&b,r="".concat(n,"-clear-icon"),i="object"===W(y)&&(null==y?void 0:y.clearIcon)?y.clearIcon:"✖";return h().createElement("span",{onClick:w,onMouseDown:function(e){return e.preventDefault()},className:$()(r,(e={},j(e,"".concat(r,"-hidden"),!t),j(e,"".concat(r,"-has-suffix"),!!o),e)),role:"button",tabIndex:-1},i)}(),o);E=h().createElement("span",{className:O,style:c,hidden:!rl(e)&&C,onMouseDown:function(e){var t;(null===(t=x.current)||void 0===t?void 0:t.contains(e.target))&&(null==g||g())},ref:x},r&&h().createElement("span",{className:"".concat(n,"-prefix")},r),(0,v.cloneElement)(t,{style:null,value:b,hidden:null}),N)}if(rl(e)){var P="".concat(n,"-group"),A="".concat(P,"-addon"),M=$()("".concat(n,"-wrapper"),P,f),R=$()("".concat(n,"-group-wrapper"),l,u);return h().createElement("span",{className:R,style:c,hidden:C},h().createElement("span",{className:M},i&&h().createElement("span",{className:A},i),(0,v.cloneElement)(E,{style:null,hidden:null}),a&&h().createElement("span",{className:A},a)))}return E},cl=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","type","inputClassName"],sl=(0,v.forwardRef)((function(e,t){var n=e.autoComplete,r=e.onChange,o=e.onFocus,i=e.onBlur,a=e.onPressEnter,l=e.onKeyDown,c=e.prefixCls,s=void 0===c?"rc-input":c,u=e.disabled,f=e.htmlSize,d=e.className,p=e.maxLength,m=e.suffix,g=e.showCount,y=e.type,b=void 0===y?"text":y,w=e.inputClassName,C=q(e,cl),x=z(br(e.defaultValue,{value:e.value}),2),E=x[0],k=x[1],S=z((0,v.useState)(!1),2),O=S[0],N=S[1],P=(0,v.useRef)(null),A=function(e){P.current&&function(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}(P.current,e)};(0,v.useImperativeHandle)(t,(function(){return{focus:A,blur:function(){var e;null===(e=P.current)||void 0===e||e.blur()},setSelectionRange:function(e,t,n){var r;null===(r=P.current)||void 0===r||r.setSelectionRange(e,t,n)},select:function(){var e;null===(e=P.current)||void 0===e||e.select()},input:P.current}})),(0,v.useEffect)((function(){N((function(e){return(!e||!u)&&e}))}),[u]);var M;return h().createElement(ll,U(U({},C),{},{prefixCls:s,className:d,inputElement:(M=Hr(e,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","affixWrapperClassName","groupClassName","inputClassName","wrapperClassName","htmlSize"]),h().createElement("input",U(U({autoComplete:n},M),{},{onChange:function(t){void 0===e.value&&k(t.target.value),P.current&&il(P.current,t,r)},onFocus:function(e){N(!0),null==o||o(e)},onBlur:function(e){N(!1),null==i||i(e)},onKeyDown:function(e){a&&"Enter"===e.key&&a(e),null==l||l(e)},className:$()(s,j({},"".concat(s,"-disabled"),u),w,!rl(e)&&!ol(e)&&d),ref:P,size:f,type:b}))),handleReset:function(e){k(""),A(),P.current&&il(P.current,e,r)},value:al(E),focused:O,triggerFocus:A,suffix:function(){var e=Number(p)>0;if(m||g){var t=bi(al(E)).length,n="object"===W(g)?g.formatter({count:t,maxLength:p}):"".concat(t).concat(e?" / ".concat(p):"");return h().createElement(h().Fragment,null,!!g&&h().createElement("span",{className:$()("".concat(s,"-show-count-suffix"),j({},"".concat(s,"-show-count-has-suffix"),!!m))},n),m)}return null}(),disabled:u}))})),ul=sl;function fl(e,t,n){var r;return $()((j(r={},"".concat(e,"-status-success"),"success"===t),j(r,"".concat(e,"-status-warning"),"warning"===t),j(r,"".concat(e,"-status-error"),"error"===t),j(r,"".concat(e,"-status-validating"),"validating"===t),j(r,"".concat(e,"-has-feedback"),n),r))}xr("warning","error","");var dl=function(e,t){return t||e};function pl(e,t,n,r){if(n){var o=t;if("click"===t.type){var i=e.cloneNode(!0);return o=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value="",void n(o)}if(void 0!==r)return o=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,void n(o);n(o)}}var ml=(0,v.forwardRef)((function(t,n){var r,o,i,a=t.prefixCls,l=t.bordered,c=void 0===l||l,s=t.status,u=t.size,f=t.disabled,d=t.onBlur,p=t.onFocus,m=t.suffix,g=t.allowClear,y=t.addonAfter,b=t.addonBefore,w=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o1&&void 0!==arguments[1]&&arguments[1],n=e.getAttribute("id")||e.getAttribute("data-reactid")||e.getAttribute("name");if(t&&zl[n])return zl[n];var r=window.getComputedStyle(e),o=r.getPropertyValue("box-sizing")||r.getPropertyValue("-moz-box-sizing")||r.getPropertyValue("-webkit-box-sizing"),i=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),a=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width")),l=Ll.map((function(e){return"".concat(e,":").concat(r.getPropertyValue(e))})).join(";"),c={sizingStyle:l,paddingSize:i,borderSize:a,boxSizing:o};return t&&n&&(zl[n]=c),c}var $l,Wl=n(6774),Bl=n.n(Wl);!function(e){e[e.NONE=0]="NONE",e[e.RESIZING=1]="RESIZING",e[e.RESIZED=2]="RESIZED"}($l||($l={}));var Ul=function(t){Z(r,t);var n=te(r);function r(t){var o;return K(this,r),(o=n.call(this,t)).nextFrameActionId=void 0,o.resizeFrameId=void 0,o.textArea=void 0,o.saveTextArea=function(e){o.textArea=e},o.handleResize=function(e){var t=o.state.resizeStatus,n=o.props,r=n.autoSize,i=n.onResize;t===$l.NONE&&("function"==typeof i&&i(e),r&&o.resizeOnNextFrame())},o.resizeOnNextFrame=function(){cancelAnimationFrame(o.nextFrameActionId),o.nextFrameActionId=requestAnimationFrame(o.resizeTextarea)},o.resizeTextarea=function(){var e=o.props.autoSize;if(e&&o.textArea){var t=e.minRows,n=e.maxRows,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;_l||((_l=document.createElement("textarea")).setAttribute("tab-index","-1"),_l.setAttribute("aria-hidden","true"),document.body.appendChild(_l)),e.getAttribute("wrap")?_l.setAttribute("wrap",e.getAttribute("wrap")):_l.removeAttribute("wrap");var o=Hl(e,t),i=o.paddingSize,a=o.borderSize,l=o.boxSizing,c=o.sizingStyle;_l.setAttribute("style","".concat(c,";").concat(Vl)),_l.value=e.value||e.placeholder||"";var s,u=Number.MIN_SAFE_INTEGER,f=Number.MAX_SAFE_INTEGER,d=_l.scrollHeight;if("border-box"===l?d+=a:"content-box"===l&&(d-=i),null!==n||null!==r){_l.value=" ";var p=_l.scrollHeight-i;null!==n&&(u=p*n,"border-box"===l&&(u=u+i+a),d=Math.max(u,d)),null!==r&&(f=p*r,"border-box"===l&&(f=f+i+a),s=d>f?"":"hidden",d=Math.min(f,d))}return{height:d,minHeight:u,maxHeight:f,overflowY:s,resize:"none"}}(o.textArea,!1,t,n);o.setState({textareaStyles:r,resizeStatus:$l.RESIZING},(function(){cancelAnimationFrame(o.resizeFrameId),o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:$l.RESIZED},(function(){o.resizeFrameId=requestAnimationFrame((function(){o.setState({resizeStatus:$l.NONE}),o.fixFirefoxAutoScroll()}))}))}))}))}},o.renderTextArea=function(){var t=o.props,n=t.prefixCls,r=void 0===n?"rc-textarea":n,i=t.autoSize,a=t.onResize,l=t.className,c=t.disabled,s=o.state,u=s.textareaStyles,f=s.resizeStatus,d=Hr(o.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),p=$()(r,l,j({},"".concat(r,"-disabled"),c));"value"in d&&(d.value=d.value||"");var m=U(U(U({},o.props.style),u),f===$l.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return v.createElement(Dl,{onResize:o.handleResize,disabled:!(i||a)},v.createElement("textarea",e({},d,{className:p,style:m,ref:o.saveTextArea})))},o.state={textareaStyles:{},resizeStatus:$l.NONE},o}return Y(r,[{key:"componentDidUpdate",value:function(e){e.value===this.props.value&&Bl()(e.autoSize,this.props.autoSize)||this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var e=this.textArea.selectionStart,t=this.textArea.selectionEnd;this.textArea.setSelectionRange(e,t)}}catch(e){}}},{key:"render",value:function(){return this.renderTextArea()}}]),r}(v.Component),ql=Ul,Kl=function(t){Z(r,t);var n=te(r);function r(e){var t;K(this,r),(t=n.call(this,e)).resizableTextArea=void 0,t.focus=function(){t.resizableTextArea.textArea.focus()},t.saveTextArea=function(e){t.resizableTextArea=e},t.handleChange=function(e){var n=t.props.onChange;t.setValue(e.target.value,(function(){t.resizableTextArea.resizeTextarea()})),n&&n(e)},t.handleKeyDown=function(e){var n=t.props,r=n.onPressEnter,o=n.onKeyDown;13===e.keyCode&&r&&r(e),o&&o(e)};var o=void 0===e.value||null===e.value?e.defaultValue:e.value;return t.state={value:o},t}return Y(r,[{key:"setValue",value:function(e,t){"value"in this.props||this.setState({value:e},t)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return v.createElement(ql,e({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(e){return"value"in e?{value:e.value}:null}}]),r}(v.Component),Gl=Kl,Yl=xr("text","input"),Xl=function(e){Z(n,e);var t=te(n);function n(){return K(this,n),t.apply(this,arguments)}return Y(n,[{key:"renderClearIcon",value:function(e){var t,n=this.props,r=n.value,o=n.disabled,i=n.readOnly,a=n.handleReset,l=n.suffix,c=!o&&!i&&r,s="".concat(e,"-clear-icon");return v.createElement(nl,{onClick:a,onMouseDown:function(e){return e.preventDefault()},className:$()((t={},j(t,"".concat(s,"-hidden"),!c),j(t,"".concat(s,"-has-suffix"),!!l),t),s),role:"button"})}},{key:"renderTextAreaWithClearIcon",value:function(e,t,n){var r,o=this.props,i=o.value,a=o.allowClear,l=o.className,c=o.style,s=o.direction,u=o.bordered,f=o.hidden,d=o.status,p=n.status,m=n.hasFeedback;if(!a)return Dr(t,{value:i});var h,g=$()("".concat(e,"-affix-wrapper"),"".concat(e,"-affix-wrapper-textarea-with-clear-btn"),fl("".concat(e,"-affix-wrapper"),dl(p,d),m),(j(r={},"".concat(e,"-affix-wrapper-rtl"),"rtl"===s),j(r,"".concat(e,"-affix-wrapper-borderless"),!u),j(r,"".concat(l),!((h=this.props).addonBefore||h.addonAfter)&&l),r));return v.createElement("span",{className:g,style:c,hidden:f},Dr(t,{style:null,value:i}),this.renderClearIcon(e))}},{key:"render",value:function(){var e=this;return v.createElement(Za.Consumer,null,(function(t){var n=e.props,r=n.prefixCls,o=n.inputType,i=n.element;if(o===Yl[0])return e.renderTextAreaWithClearIcon(r,i,t)}))}}]),n}(v.Component),Ql=Xl;function Zl(e,t){return bi(e||"").slice(0,t).join("")}function Jl(e,t,n,r){var o=n;return e?o=Zl(n,r):bi(t||"").lengthr&&(o=t),o}var ec=v.forwardRef((function(t,n){var r,o=t.prefixCls,i=t.bordered,a=void 0===i||i,l=t.showCount,c=void 0!==l&&l,s=t.maxLength,u=t.className,f=t.style,d=t.size,p=t.disabled,m=t.onCompositionStart,h=t.onCompositionEnd,g=t.onChange,y=t.status,b=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0,Y=C("input",o);v.useImperativeHandle(n,(function(){var e;return{resizableTextArea:null===(e=T.current)||void 0===e?void 0:e.resizableTextArea,focus:function(e){var t,n;!function(e,t){if(e){e.focus(t);var n=(t||{}).cursor;if(n){var r=e.value.length;switch(n){case"start":e.setSelectionRange(0,0);break;case"end":e.setSelectionRange(r,r);break;default:e.setSelectionRange(0,r)}}}}(null===(n=null===(t=T.current)||void 0===t?void 0:t.resizableTextArea)||void 0===n?void 0:n.textArea,e)},blur:function(){var e;return null===(e=T.current)||void 0===e?void 0:e.blur()}}}));var X=v.createElement(Gl,e({},Hr(b,["allowClear"]),{disabled:S,className:$()((r={},j(r,"".concat(Y,"-borderless"),!a),j(r,u,u&&!c),j(r,"".concat(Y,"-sm"),"small"===E||"small"===d),j(r,"".concat(Y,"-lg"),"large"===E||"large"===d),r),fl(Y,R)),style:c?void 0:f,prefixCls:Y,onCompositionStart:function(e){D(!0),V.current=B,L.current=e.currentTarget.selectionStart,null==m||m(e)},onChange:function(e){var t=e.target.value;!_&&G&&(t=Jl(e.target.selectionStart>=s+1||e.target.selectionStart===t.length||!e.target.selectionStart,B,t,s)),K(t),pl(e.currentTarget,e,g,t)},onCompositionEnd:function(e){var t;D(!1);var n=e.currentTarget.value;G&&(n=Jl(L.current>=s+1||L.current===(null===(t=V.current)||void 0===t?void 0:t.length),V.current,n,s)),n!==B&&(K(n),pl(e.currentTarget,e,g,n)),null==h||h(e)},ref:T})),Q=function(e){return null==e?"":String(e)}(B);_||!G||null!==b.value&&void 0!==b.value||(Q=Zl(Q,s));var Z=v.createElement(Ql,e({disabled:S},b,{prefixCls:Y,direction:x,inputType:"text",value:Q,element:X,handleReset:function(e){var t,n,r;K(""),null===(t=T.current)||void 0===t||t.focus(),pl(null===(r=null===(n=T.current)||void 0===n?void 0:n.resizableTextArea)||void 0===r?void 0:r.textArea,e,g)},ref:F,bordered:a,status:y,style:c?void 0:f}));if(c||P){var J,ee,te=bi(Q).length;return ee="object"===W(c)?c.formatter({count:te,maxLength:s}):"".concat(te).concat(G?" / ".concat(s):""),v.createElement("div",{hidden:q,className:$()("".concat(Y,"-textarea"),(J={},j(J,"".concat(Y,"-textarea-rtl"),"rtl"===x),j(J,"".concat(Y,"-textarea-show-count"),c),j(J,"".concat(Y,"-textarea-in-form-item"),A),J),fl("".concat(Y,"-textarea"),R,P),u),style:f,"data-count":ee},Z,P&&v.createElement("span",{className:"".concat(Y,"-textarea-suffix")},M))}return Z})),tc=ec,nc=vl;nc.Group=function(t){var n,r=(0,v.useContext)(wr),o=r.getPrefixCls,i=r.direction,a=t.prefixCls,l=t.className,c=void 0===l?"":l,s=o("input-group",a),u=$()(s,(j(n={},"".concat(s,"-lg"),"large"===t.size),j(n,"".concat(s,"-sm"),"small"===t.size),j(n,"".concat(s,"-compact"),t.compact),j(n,"".concat(s,"-rtl"),"rtl"===i),n),c),f=(0,v.useContext)(Za),d=(0,v.useMemo)((function(){return e(e({},f),{isFormItemInput:!1})}),[f]);return v.createElement("span",{className:u,style:t.style,onMouseEnter:t.onMouseEnter,onMouseLeave:t.onMouseLeave,onFocus:t.onFocus,onBlur:t.onBlur},v.createElement(Za.Provider,{value:d},t.children))},nc.Search=Al,nc.TextArea=tc,nc.Password=kl;var rc=nc;const{useRef:oc,useEffect:ic}=wp.element;var ac=e=>{let n=oc(null);const{arg:r,argValue:o,styleConfig:i}=e,a=M(r.type),l="string"==typeof o.value?o.value:"",c="StringValue"===e.argValue.kind?i.colors.string:i.colors.number;return(0,t.createElement)("span",{style:{color:c}},"String"===a.name?'"':"",(0,t.createElement)(rc,{name:r.name,style:{width:"15ch",color:c,minHeight:"16px"},size:"small",ref:e=>{n=e},type:"text",onChange:t=>{var n;n=t,e.setArgValue(n,!0)},value:l}),"String"===a.name?'"':"")};const{isInputObjectType:lc,isLeafType:cc}=wpGraphiQL.GraphQL,{useState:sc}=wp.element;var uc=e=>{let n;const r=()=>e.selection.fields.find((t=>t.name.value===e.arg.name)),{arg:o,parentField:i}=e,a=r();return(0,t.createElement)(Xu,{argValue:a?a.value:null,arg:o,parentField:i,addArg:()=>{const{selection:t,arg:r,getDefaultScalarArgValue:o,parentField:i,makeDefaultArg:a}=e,l=M(r.type);let c=null;if(n)c=n;else if(lc(l)){const e=l.getFields();c={kind:"ObjectField",name:{kind:"Name",value:r.name},value:{kind:"ObjectValue",fields:T(o,a,i,Object.keys(e).map((t=>e[t])))}}}else cc(l)&&(c={kind:"ObjectField",name:{kind:"Name",value:r.name},value:o(i,r,l)});if(c)return e.modifyFields([...t.fields||[],c],!0);console.error("Unable to add arg for argType",l)},removeArg:()=>{const{selection:t}=e,o=r();n=o,e.modifyFields(t.fields.filter((e=>e!==o)),!0)},setArgFields:t=>e.modifyFields(e.selection.fields.map((n=>n.name.value===e.arg.name?{...n,value:{kind:"ObjectValue",fields:t}}:n)),!0),setArgValue:(t,n)=>{let o=!1,i=!1,a=!1;try{"VariableDefinition"===t.kind?i=!0:null==t?o=!0:"string"==typeof t.kind&&(a=!0)}catch(e){}const{selection:l}=e,c=r();if(!c)return void console.error("missing arg selection when setting arg value");const s=M(e.arg.type);if(!(cc(s)||i||o||a))return void console.warn("Unable to handle non leaf types in InputArgView.setArgValue",t);let u,f;return null==t?f=null:!t.target&&t.kind&&"VariableDefinition"===t.kind?(u=t,f=u.variable):"string"==typeof t.kind?f=t:t.target&&"string"==typeof t.target.value&&(u=t.target.value,f=R(s,u)),e.modifyFields((l.fields||[]).map((e=>e===c?{...e,value:f}:e)),n)},getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition})},fc={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(e){var t=e.keyCode;if(e.altKey&&!e.ctrlKey||e.metaKey||t>=fc.F1&&t<=fc.F12)return!1;switch(t){case fc.ALT:case fc.CAPS_LOCK:case fc.CONTEXT_MENU:case fc.CTRL:case fc.DOWN:case fc.END:case fc.ESC:case fc.HOME:case fc.INSERT:case fc.LEFT:case fc.MAC_FF_META:case fc.META:case fc.NUMLOCK:case fc.NUM_CENTER:case fc.PAGE_DOWN:case fc.PAGE_UP:case fc.PAUSE:case fc.PRINT_SCREEN:case fc.RIGHT:case fc.SHIFT:case fc.UP:case fc.WIN_KEY:case fc.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(e){if(e>=fc.ZERO&&e<=fc.NINE)return!0;if(e>=fc.NUM_ZERO&&e<=fc.NUM_MULTIPLY)return!0;if(e>=fc.A&&e<=fc.Z)return!0;if(-1!==window.navigator.userAgent.indexOf("WebKit")&&0===e)return!0;switch(e){case fc.SPACE:case fc.QUESTION_MARK:case fc.NUM_PLUS:case fc.NUM_MINUS:case fc.NUM_PERIOD:case fc.NUM_DIVISION:case fc.SEMICOLON:case fc.DASH:case fc.EQUALS:case fc.COMMA:case fc.PERIOD:case fc.SLASH:case fc.APOSTROPHE:case fc.SINGLE_QUOTE:case fc.OPEN_SQUARE_BRACKET:case fc.BACKSLASH:case fc.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},dc=fc;function pc(e,t){var n,r=e.key;return"value"in e&&(n=e.value),null!=r?r:void 0!==n?n:"rc-index-key-".concat(t)}function mc(e,t){var n=e||{};return{label:n.label||(t?"children":"label"),value:n.value||"value",options:n.options||"options"}}function vc(e){var t=U({},e);return"props"in t||Object.defineProperty(t,"props",{get:function(){return Bo(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),t}}),t}var hc=["prefixCls","disabled","visible","children","popupElement","containerWidth","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],gc=function(t,n){var r=t.prefixCls,o=(t.disabled,t.visible),i=t.children,a=t.popupElement,l=t.containerWidth,c=t.animation,s=t.transitionName,u=t.dropdownStyle,f=t.dropdownClassName,d=t.direction,p=void 0===d?"ltr":d,m=t.placement,h=t.dropdownMatchSelectWidth,g=t.dropdownRender,y=t.dropdownAlign,b=t.getPopupContainer,w=t.empty,C=t.getTriggerDOMNode,x=t.onPopupVisibleChange,E=t.onPopupMouseEnter,k=q(t,hc),S="".concat(r,"-dropdown"),O=a;g&&(O=g(a));var N=v.useMemo((function(){return function(e){var t=!0===e?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:t,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:t,adjustY:1}}}}(h)}),[h]),P=c?"".concat(S,"-").concat(c):s,A=v.useRef(null);v.useImperativeHandle(n,(function(){return{getPopupElement:function(){return A.current}}}));var M=U({minWidth:l},u);return"number"==typeof h?M.width=h:h&&(M.width=l),v.createElement(ur,e({},k,{showAction:x?["click"]:[],hideAction:x?["click"]:[],popupPlacement:m||("rtl"===p?"bottomRight":"bottomLeft"),builtinPlacements:N,prefixCls:S,popupTransitionName:P,popup:v.createElement("div",{ref:A,onMouseEnter:E},O),popupAlign:y,popupVisible:o,getPopupContainer:b,popupClassName:$()(f,j({},"".concat(S,"-empty"),w)),popupStyle:M,getTriggerDOMNode:C,onPopupVisibleChange:x}),i)},yc=v.forwardRef(gc);yc.displayName="SelectTrigger";var bc=yc,wc="".concat("accept acceptCharset accessKey action allowFullScreen allowTransparency\n alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge\n charSet checked classID className colSpan cols content contentEditable contextMenu\n controls coords crossOrigin data dateTime default defer dir disabled download draggable\n encType form formAction formEncType formMethod formNoValidate formTarget frameBorder\n headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity\n is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media\n mediaGroup method min minLength multiple muted name noValidate nonce open\n optimum pattern placeholder poster preload radioGroup readOnly rel required\n reversed role rowSpan rows sandbox scope scoped scrolling seamless selected\n shape size sizes span spellCheck src srcDoc srcLang srcSet start step style\n summary tabIndex target title type useMap value width wmode wrap"," ").concat("onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown\n onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick\n onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown\n onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel\n onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough\n onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata\n onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError").split(/[\s\n]+/),Cc="aria-",xc="data-";function Ec(e,t){return 0===e.indexOf(t)}function kc(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];t=!1===n?{aria:!0,data:!0,attr:!0}:!0===n?{aria:!0}:U({},n);var r={};return Object.keys(e).forEach((function(n){(t.aria&&("role"===n||Ec(n,Cc))||t.data&&Ec(n,xc)||t.attr&&wc.includes(n))&&(r[n]=e[n])})),r}var Sc=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Oc=void 0;function Nc(t,n){var r=t.prefixCls,o=t.invalidate,i=t.item,a=t.renderItem,l=t.responsive,c=t.responsiveDisabled,s=t.registerSize,u=t.itemKey,f=t.className,d=t.style,p=t.children,m=t.display,h=t.order,g=t.component,y=void 0===g?"div":g,b=q(t,Sc),w=l&&!m;function C(e){s(u,e)}v.useEffect((function(){return function(){C(null)}}),[]);var x,E=a&&i!==Oc?a(i):p;o||(x={opacity:w?0:1,height:w?0:Oc,overflowY:w?"hidden":Oc,order:l?h:Oc,pointerEvents:w?"none":Oc,position:w?"absolute":Oc});var k={};w&&(k["aria-hidden"]=!0);var S=v.createElement(y,e({className:$()(!o&&r,f),style:U(U({},x),d)},k,b,{ref:n}),E);return l&&(S=v.createElement(Dl,{onResize:function(e){C(e.offsetWidth)},disabled:c},S)),S}var Pc=v.forwardRef(Nc);Pc.displayName="Item";var Ac=Pc,Mc=["component"],Rc=["className"],Tc=["className"],Fc=function(t,n){var r=v.useContext(Dc);if(!r){var o=t.component,i=void 0===o?"div":o,a=q(t,Mc);return v.createElement(i,e({},a,{ref:n}))}var l=r.className,c=q(r,Rc),s=t.className,u=q(t,Tc);return v.createElement(Dc.Provider,{value:null},v.createElement(Ac,e({ref:n,className:$()(l,s)},c,u)))},Ic=v.forwardRef(Fc);Ic.displayName="RawItem";var jc=Ic,_c=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],Dc=v.createContext(null),Vc="responsive",Lc="invalidate";function zc(e){return"+ ".concat(e.length," ...")}function Hc(t,n){var r,o,i,a,l=t.prefixCls,c=void 0===l?"rc-overflow":l,s=t.data,u=void 0===s?[]:s,f=t.renderItem,d=t.renderRawItem,p=t.itemKey,m=t.itemWidth,h=void 0===m?10:m,g=t.ssr,y=t.style,b=t.className,w=t.maxCount,C=t.renderRest,x=t.renderRawRest,E=t.suffix,k=t.component,S=void 0===k?"div":k,O=t.itemComponent,N=t.onVisibleChange,P=q(t,_c),A=(r=z(Ke({}),2)[1],o=(0,v.useRef)([]),i=0,a=0,function(e){var t=i;return i+=1,o.current.lengthw,me=(0,v.useMemo)((function(){var e=u;return fe?e=null===T&&M?u:u.slice(0,Math.min(u.length,I/h)):"number"==typeof w&&(e=u.slice(0,w)),e}),[u,h,T,w,fe]),ve=(0,v.useMemo)((function(){return fe?u.slice(re+1):u.slice(me.length)}),[u,me,fe,re]),he=(0,v.useCallback)((function(e,t){var n;return"function"==typeof p?p(e):null!==(n=p&&(null==e?void 0:e[p]))&&void 0!==n?n:t}),[p]),ge=(0,v.useCallback)(f||function(e){return e},[f]);function ye(e,t){ne(e),t||(ae(eI){ye(r-1),J(e-o-Y+B);break}}E&&we(0)+Y>I&&J(null)}}),[I,_,B,Y,he,me]);var Ce=ie&&!!ve.length,xe={};null!==Z&&fe&&(xe={position:"absolute",left:Z,top:0});var Ee,ke={prefixCls:le,responsive:fe,component:O,invalidate:de},Se=d?function(e,t){var n=he(e,t);return v.createElement(Dc.Provider,{key:n,value:U(U({},ke),{},{order:t,item:e,itemKey:n,registerSize:be,display:t<=re})},d(e,t))}:function(t,n){var r=he(t,n);return v.createElement(Ac,e({},ke,{order:n,key:r,item:t,renderItem:ge,itemKey:r,registerSize:be,display:n<=re}))},Oe={order:Ce?re:Number.MAX_SAFE_INTEGER,className:"".concat(le,"-rest"),registerSize:function(e,t){K(t),H(B)},display:Ce};if(x)x&&(Ee=v.createElement(Dc.Provider,{value:U(U({},ke),Oe)},x(ve)));else{var Ne=C||zc;Ee=v.createElement(Ac,e({},ke,Oe),"function"==typeof Ne?Ne(ve):Ne)}var Pe=v.createElement(S,e({className:$()(!de&&c,b),style:y,ref:n},P),me.map(Se),pe?Ee:null,E&&v.createElement(Ac,e({},ke,{responsive:ue,responsiveDisabled:!fe,order:re,className:"".concat(le,"-suffix"),registerSize:function(e,t){X(t)},display:!0,style:xe}),E));return ue&&(Pe=v.createElement(Dl,{onResize:function(e,t){F(t.clientWidth)},disabled:!fe},Pe)),Pe}var $c=v.forwardRef(Hc);$c.displayName="Overflow",$c.Item=jc,$c.RESPONSIVE=Vc,$c.INVALIDATE=Lc;var Wc=$c,Bc=function(e){var t,n=e.className,r=e.customizeIcon,o=e.customizeIconProps,i=e.onMouseDown,a=e.onClick,l=e.children;return t="function"==typeof r?r(o):r,v.createElement("span",{className:n,onMouseDown:function(e){e.preventDefault(),i&&i(e)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:a,"aria-hidden":!0},void 0!==t?t:v.createElement("span",{className:$()(n.split(/\s+/).map((function(e){return"".concat(e,"-icon")})))},l))},Uc=function(e,t){var n,r,o=e.prefixCls,i=e.id,a=e.inputElement,l=e.disabled,c=e.tabIndex,s=e.autoFocus,u=e.autoComplete,f=e.editable,d=e.activeDescendantId,p=e.value,m=e.maxLength,h=e.onKeyDown,g=e.onMouseDown,y=e.onChange,b=e.onPaste,w=e.onCompositionStart,C=e.onCompositionEnd,x=e.open,E=e.attrs,k=a||v.createElement("input",null),S=k,O=S.ref,N=S.props,P=N.onKeyDown,A=N.onChange,M=N.onMouseDown,R=N.onCompositionStart,T=N.onCompositionEnd,F=N.style;return k.props,v.cloneElement(k,U(U(U({type:"search"},N),{},{id:i,ref:ve(t,O),disabled:l,tabIndex:c,autoComplete:u||"off",autoFocus:s,className:$()("".concat(o,"-selection-search-input"),null===(n=k)||void 0===n||null===(r=n.props)||void 0===r?void 0:r.className),role:"combobox","aria-expanded":x,"aria-haspopup":"listbox","aria-owns":"".concat(i,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(i,"_list"),"aria-activedescendant":d},E),{},{value:f?p:"",maxLength:m,readOnly:!f,unselectable:f?null:"on",style:U(U({},F),{},{opacity:f?null:0}),onKeyDown:function(e){h(e),P&&P(e)},onMouseDown:function(e){g(e),M&&M(e)},onChange:function(e){y(e),A&&A(e)},onCompositionStart:function(e){w(e),R&&R(e)},onCompositionEnd:function(e){C(e),T&&T(e)},onPaste:b}))},qc=v.forwardRef(Uc);qc.displayName="Input";var Kc=qc;function Gc(e){return Array.isArray(e)?e:void 0!==e?[e]:[]}var Yc="undefined"!=typeof window&&window.document&&window.document.documentElement;function Xc(e){var t;return null!==(t=e.key)&&void 0!==t?t:e.value}var Qc=function(e){e.preventDefault(),e.stopPropagation()},Zc=function(e){var t,n,r=e.id,o=e.prefixCls,i=e.values,a=e.open,l=e.searchValue,c=e.inputRef,s=e.placeholder,u=e.disabled,f=e.mode,d=e.showSearch,p=e.autoFocus,m=e.autoComplete,h=e.activeDescendantId,g=e.tabIndex,y=e.removeIcon,b=e.maxTagCount,w=e.maxTagTextLength,C=e.maxTagPlaceholder,x=void 0===C?function(e){return"+ ".concat(e.length," ...")}:C,E=e.tagRender,k=e.onToggleOpen,S=e.onRemove,O=e.onInputChange,N=e.onInputPaste,P=e.onInputKeyDown,A=e.onInputMouseDown,M=e.onInputCompositionStart,R=e.onInputCompositionEnd,T=v.useRef(null),F=z((0,v.useState)(0),2),I=F[0],_=F[1],D=z((0,v.useState)(!1),2),V=D[0],L=D[1],H="".concat(o,"-selection"),W=a||"tags"===f?l:"",B="tags"===f||d&&(a||V);function U(e,t,n,r,o){return v.createElement("span",{className:$()("".concat(H,"-item"),j({},"".concat(H,"-item-disabled"),n)),title:"string"==typeof e||"number"==typeof e?e.toString():void 0},v.createElement("span",{className:"".concat(H,"-item-content")},t),r&&v.createElement(Bc,{className:"".concat(H,"-item-remove"),onMouseDown:Qc,onClick:o,customizeIcon:y},"×"))}t=function(){_(T.current.scrollWidth)},n=[W],Yc?v.useLayoutEffect(t,n):v.useEffect(t,n);var q=v.createElement("div",{className:"".concat(H,"-search"),style:{width:I},onFocus:function(){L(!0)},onBlur:function(){L(!1)}},v.createElement(Kc,{ref:c,open:a,prefixCls:o,id:r,inputElement:null,disabled:u,autoFocus:p,autoComplete:m,editable:B,activeDescendantId:h,value:W,onKeyDown:P,onMouseDown:A,onChange:O,onPaste:N,onCompositionStart:M,onCompositionEnd:R,tabIndex:g,attrs:kc(e,!0)}),v.createElement("span",{ref:T,className:"".concat(H,"-search-mirror"),"aria-hidden":!0},W," ")),K=v.createElement(Wc,{prefixCls:"".concat(H,"-overflow"),data:i,renderItem:function(e){var t=e.disabled,n=e.label,r=e.value,o=!u&&!t,i=n;if("number"==typeof w&&("string"==typeof n||"number"==typeof n)){var l=String(i);l.length>w&&(i="".concat(l.slice(0,w),"..."))}var c=function(t){t&&t.stopPropagation(),S(e)};return"function"==typeof E?function(e,t,n,r,o){return v.createElement("span",{onMouseDown:function(e){Qc(e),k(!a)}},E({label:t,value:e,disabled:n,closable:r,onClose:o}))}(r,i,t,o,c):U(n,i,t,o,c)},renderRest:function(e){var t="function"==typeof x?x(e):x;return U(t,t,!1)},suffix:q,itemKey:Xc,maxCount:b});return v.createElement(v.Fragment,null,K,!i.length&&!W&&v.createElement("span",{className:"".concat(H,"-placeholder")},s))},Jc=function(e){var t=e.inputElement,n=e.prefixCls,r=e.id,o=e.inputRef,i=e.disabled,a=e.autoFocus,l=e.autoComplete,c=e.activeDescendantId,s=e.mode,u=e.open,f=e.values,d=e.placeholder,p=e.tabIndex,m=e.showSearch,h=e.searchValue,g=e.activeValue,y=e.maxLength,b=e.onInputKeyDown,w=e.onInputMouseDown,C=e.onInputChange,x=e.onInputPaste,E=e.onInputCompositionStart,k=e.onInputCompositionEnd,S=z(v.useState(!1),2),O=S[0],N=S[1],P="combobox"===s,A=P||m,M=f[0],R=h||"";P&&g&&!O&&(R=g),v.useEffect((function(){P&&N(!1)}),[P,g]);var T=!("combobox"!==s&&!u&&!m||!R),F=!M||"string"!=typeof M.label&&"number"!=typeof M.label?void 0:M.label.toString();return v.createElement(v.Fragment,null,v.createElement("span",{className:"".concat(n,"-selection-search")},v.createElement(Kc,{ref:o,prefixCls:n,id:r,open:u,inputElement:t,disabled:i,autoFocus:a,autoComplete:l,editable:A,activeDescendantId:c,value:R,onKeyDown:b,onMouseDown:w,onChange:function(e){N(!0),C(e)},onPaste:x,onCompositionStart:E,onCompositionEnd:k,tabIndex:p,attrs:kc(e,!0),maxLength:P?y:void 0})),!P&&M&&!T&&v.createElement("span",{className:"".concat(n,"-selection-item"),title:F},M.label),function(){if(M)return null;var e=T?{visibility:"hidden"}:void 0;return v.createElement("span",{className:"".concat(n,"-selection-placeholder"),style:e},d)}())};function es(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:250,t=v.useRef(null),n=v.useRef(null);function r(r){(r||null===t.current)&&(t.current=r),window.clearTimeout(n.current),n.current=window.setTimeout((function(){t.current=null}),e)}return v.useEffect((function(){return function(){window.clearTimeout(n.current)}}),[]),[function(){return t.current},r]}var ts=function(t,n){var r=(0,v.useRef)(null),o=(0,v.useRef)(!1),i=t.prefixCls,a=t.open,l=t.mode,c=t.showSearch,s=t.tokenWithEnter,u=t.onSearch,f=t.onSearchSubmit,d=t.onToggleOpen,p=t.onInputKeyDown,m=t.domRef;v.useImperativeHandle(n,(function(){return{focus:function(){r.current.focus()},blur:function(){r.current.blur()}}}));var h=z(es(0),2),g=h[0],y=h[1],b=(0,v.useRef)(null),w=function(e){!1!==u(e,!0,o.current)&&d(!0)},C={inputRef:r,onInputKeyDown:function(e){var t,n=e.which;n!==dc.UP&&n!==dc.DOWN||e.preventDefault(),p&&p(e),n!==dc.ENTER||"tags"!==l||o.current||a||null==f||f(e.target.value),t=n,[dc.ESC,dc.SHIFT,dc.BACKSPACE,dc.TAB,dc.WIN_KEY,dc.ALT,dc.META,dc.WIN_KEY_RIGHT,dc.CTRL,dc.SEMICOLON,dc.EQUALS,dc.CAPS_LOCK,dc.CONTEXT_MENU,dc.F1,dc.F2,dc.F3,dc.F4,dc.F5,dc.F6,dc.F7,dc.F8,dc.F9,dc.F10,dc.F11,dc.F12].includes(t)||d(!0)},onInputMouseDown:function(){y(!0)},onInputChange:function(e){var t=e.target.value;if(s&&b.current&&/[\r\n]/.test(b.current)){var n=b.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");t=t.replace(n,b.current)}b.current=null,w(t)},onInputPaste:function(e){var t=e.clipboardData.getData("text");b.current=t},onInputCompositionStart:function(){o.current=!0},onInputCompositionEnd:function(e){o.current=!1,"combobox"!==l&&w(e.target.value)}},x="multiple"===l||"tags"===l?v.createElement(Zc,e({},t,C)):v.createElement(Jc,e({},t,C));return v.createElement("div",{ref:m,className:"".concat(i,"-selector"),onClick:function(e){e.target!==r.current&&(void 0!==document.body.style.msTouchAction?setTimeout((function(){r.current.focus()})):r.current.focus())},onMouseDown:function(e){var t=g();e.target===r.current||t||e.preventDefault(),("combobox"===l||c&&t)&&a||(a&&u("",!0,!1),d())}},x)},ns=v.forwardRef(ts);ns.displayName="Selector";var rs=ns,os=v.createContext(null),is=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","showArrow","inputIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],as=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"];function ls(e){return"tags"===e||"multiple"===e}var cs=v.forwardRef((function(t,n){var r,o,i=t.id,a=t.prefixCls,l=t.className,c=t.showSearch,s=t.tagRender,u=t.direction,f=t.omitDomProps,d=t.displayValues,p=t.onDisplayValuesChange,m=t.emptyOptions,h=t.notFoundContent,g=void 0===h?"Not Found":h,y=t.onClear,b=t.mode,w=t.disabled,C=t.loading,x=t.getInputElement,E=t.getRawInputElement,k=t.open,S=t.defaultOpen,O=t.onDropdownVisibleChange,N=t.activeValue,P=t.onActiveValueChange,A=t.activeDescendantId,M=t.searchValue,R=t.onSearch,T=t.onSearchSplit,F=t.tokenSeparators,I=t.allowClear,_=t.showArrow,D=t.inputIcon,V=t.clearIcon,L=t.OptionList,H=t.animation,B=t.transitionName,K=t.dropdownStyle,G=t.dropdownClassName,Y=t.dropdownMatchSelectWidth,X=t.dropdownRender,Q=t.dropdownAlign,Z=t.placement,J=t.getPopupContainer,ee=t.showAction,te=void 0===ee?[]:ee,ne=t.onFocus,re=t.onBlur,oe=t.onKeyUp,ie=t.onKeyDown,ae=t.onMouseDown,le=q(t,is),ce=ls(b),se=(void 0!==c?c:ce)||"combobox"===b,ue=U({},le);as.forEach((function(e){delete ue[e]})),null==f||f.forEach((function(e){delete ue[e]}));var fe=z(v.useState(!1),2),de=fe[0],me=fe[1];v.useEffect((function(){me(xe())}),[]);var he=v.useRef(null),ge=v.useRef(null),ye=v.useRef(null),be=v.useRef(null),we=v.useRef(null),Ce=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=z(v.useState(!1),2),n=t[0],r=t[1],o=v.useRef(null),i=function(){window.clearTimeout(o.current)};return v.useEffect((function(){return i}),[]),[n,function(t,n){i(),o.current=window.setTimeout((function(){r(t),n&&n()}),e)},i]}(),Ee=z(Ce,3),ke=Ee[0],Se=Ee[1],Oe=Ee[2];v.useImperativeHandle(n,(function(){var e,t;return{focus:null===(e=be.current)||void 0===e?void 0:e.focus,blur:null===(t=be.current)||void 0===t?void 0:t.blur,scrollTo:function(e){var t;return null===(t=we.current)||void 0===t?void 0:t.scrollTo(e)}}}));var Ne=v.useMemo((function(){var e;if("combobox"!==b)return M;var t=null===(e=d[0])||void 0===e?void 0:e.value;return"string"==typeof t||"number"==typeof t?String(t):""}),[M,b,d]),Pe="combobox"===b&&"function"==typeof x&&x()||null,Ae="function"==typeof E&&E(),Me=function(){for(var e=arguments.length,t=new Array(e),n=0;n1,l.reduce((function(t,n){return[].concat(bi(t),bi(e(n,a)))}),[]).filter((function(e){return e}))}(e,t);return n?r:null}(e,F);return"combobox"!==b&&i&&(o="",null==T||T(i),De(!1),r=!1),R&&Ne!==o&&R(o,{source:t?"typing":"effect"}),r};v.useEffect((function(){Ie||ce||"combobox"===b||Le("",!1,!1)}),[Ie]),v.useEffect((function(){Te&&w&&Fe(!1),w&&Se(!1)}),[w]);var ze=z(es(),2),He=ze[0],$e=ze[1],We=v.useRef(!1),Be=[];v.useEffect((function(){return function(){Be.forEach((function(e){return clearTimeout(e)})),Be.splice(0,Be.length)}}),[]);var Ue,qe=z(v.useState(null),2),Ke=qe[0],Ge=qe[1],Ye=z(v.useState({}),2)[1];qn((function(){if(_e){var e,t=Math.ceil(null===(e=he.current)||void 0===e?void 0:e.offsetWidth);Ke===t||Number.isNaN(t)||Ge(t)}}),[_e]),Ae&&(Ue=function(e){De(e)}),function(e,t,n,r){var o=v.useRef(null);o.current={open:t,triggerOpen:n,customizedTrigger:r},v.useEffect((function(){function e(e){var t,n;if(!(null===(t=o.current)||void 0===t?void 0:t.customizedTrigger)){var r=e.target;r.shadowRoot&&e.composed&&(r=e.composedPath()[0]||r),o.current.open&&[he.current,null===(n=ye.current)||void 0===n?void 0:n.getPopupElement()].filter((function(e){return e})).every((function(e){return!e.contains(r)&&e!==r}))&&o.current.triggerOpen(!1)}}return window.addEventListener("mousedown",e),function(){return window.removeEventListener("mousedown",e)}}),[])}(0,_e,De,!!Ae);var Xe,Qe,Ze=v.useMemo((function(){return U(U({},t),{},{notFoundContent:g,open:Ie,triggerOpen:_e,id:i,showSearch:se,multiple:ce,toggleOpen:De})}),[t,g,_e,Ie,i,se,ce,De]),Je=void 0!==_?_:C||!ce&&"combobox"!==b;Je&&(Xe=v.createElement(Bc,{className:$()("".concat(a,"-arrow"),j({},"".concat(a,"-arrow-loading"),C)),customizeIcon:D,customizeIconProps:{loading:C,searchValue:Ne,open:Ie,focused:ke,showSearch:se}})),!w&&I&&(d.length||Ne)&&(Qe=v.createElement(Bc,{className:"".concat(a,"-clear"),onMouseDown:function(){null==y||y(),p([],{type:"clear",values:d}),Le("",!1,!1)},customizeIcon:V},"×"));var et,tt=v.createElement(L,{ref:we}),nt=$()(a,l,(j(o={},"".concat(a,"-focused"),ke),j(o,"".concat(a,"-multiple"),ce),j(o,"".concat(a,"-single"),!ce),j(o,"".concat(a,"-allow-clear"),I),j(o,"".concat(a,"-show-arrow"),Je),j(o,"".concat(a,"-disabled"),w),j(o,"".concat(a,"-loading"),C),j(o,"".concat(a,"-open"),Ie),j(o,"".concat(a,"-customize-input"),Pe),j(o,"".concat(a,"-show-search"),se),o)),rt=v.createElement(bc,{ref:ye,disabled:w,prefixCls:a,visible:_e,popupElement:tt,containerWidth:Ke,animation:H,transitionName:B,dropdownStyle:K,dropdownClassName:G,direction:u,dropdownMatchSelectWidth:Y,dropdownRender:X,dropdownAlign:Q,placement:Z,getPopupContainer:J,empty:m,getTriggerDOMNode:function(){return ge.current},onPopupVisibleChange:Ue,onPopupMouseEnter:function(){Ye({})}},Ae?v.cloneElement(Ae,{ref:Me}):v.createElement(rs,e({},t,{domRef:ge,prefixCls:a,inputElement:Pe,ref:be,id:i,showSearch:se,mode:b,activeDescendantId:A,tagRender:s,values:d,open:Ie,onToggleOpen:De,activeValue:N,searchValue:Ne,onSearch:Le,onSearchSubmit:function(e){e&&e.trim()&&R(e,{source:"submit"})},onRemove:function(e){var t=d.filter((function(t){return t!==e}));p(t,{type:"remove",values:[e]})},tokenWithEnter:Ve})));return et=Ae?rt:v.createElement("div",e({className:nt},ue,{ref:he,onMouseDown:function(e){var t,n=e.target,r=null===(t=ye.current)||void 0===t?void 0:t.getPopupElement();if(r&&r.contains(n)){var o=setTimeout((function(){var e,t=Be.indexOf(o);-1!==t&&Be.splice(t,1),Oe(),de||r.contains(document.activeElement)||null===(e=be.current)||void 0===e||e.focus()}));Be.push(o)}for(var i=arguments.length,a=new Array(i>1?i-1:0),l=1;l=0;a-=1){var l=o[a];if(!l.disabled){o.splice(a,1),i=l;break}}i&&p(o,{type:"remove",values:[i]})}for(var c=arguments.length,s=new Array(c>1?c-1:0),u=1;u1?t-1:0),r=1;r1&&void 0!==arguments[1]&&arguments[1];return wi(e).map((function(e,n){if(!v.isValidElement(e)||!e.type)return null;var r=e.type.isSelectOptGroup,o=e.key,i=e.props,a=i.children,l=q(i,ms);return t||!r?vs(e):U(U({key:"__RC_SELECT_GRP__".concat(null===o?n:o,"__"),label:o},l),{},{options:hs(a)})})).filter((function(e){return e}))}function gs(e,t,n,r,o){return v.useMemo((function(){var i=e;!e&&(i=hs(t));var a=new Map,l=new Map,c=function(e,t,n){n&&"string"==typeof n&&e.set(t[n],t)};return function e(t){for(var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=0;sn},e}return t=a,(n=[{key:"componentDidMount",value:function(){this.scrollbarRef.current.addEventListener("touchstart",this.onScrollbarTouchStart),this.thumbRef.current.addEventListener("touchstart",this.onMouseDown)}},{key:"componentDidUpdate",value:function(e){e.scrollTop!==this.props.scrollTop&&this.delayHidden()}},{key:"componentWillUnmount",value:function(){this.removeEvents(),clearTimeout(this.visibleTimeout)}},{key:"render",value:function(){var e=this.state,t=e.dragging,n=e.visible,r=this.props.prefixCls,o=this.getSpinHeight(),i=this.getTop(),a=this.showScroll(),l=a&&n;return v.createElement("div",{ref:this.scrollbarRef,className:$()("".concat(r,"-scrollbar"),As({},"".concat(r,"-scrollbar-show"),a)),style:{width:8,top:0,bottom:0,right:0,position:"absolute",display:l?null:"none"},onMouseDown:this.onContainerMouseDown,onMouseMove:this.delayHidden},v.createElement("div",{ref:this.thumbRef,className:$()("".concat(r,"-scrollbar-thumb"),As({},"".concat(r,"-scrollbar-thumb-moving"),t)),style:{width:"100%",height:o,top:i,left:0,position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"},onMouseDown:this.onMouseDown}))}}])&&Rs(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),a}(v.Component);function Ds(e){var t=e.children,n=e.setRef,r=v.useCallback((function(e){n(e)}),[]);return v.cloneElement(t,{ref:r})}function Vs(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&void 0!==arguments[1]&&arguments[1],a=e<0&&i.current.top||e>0&&i.current.bottom;return t&&a?(clearTimeout(r.current),n.current=!1):a&&!n.current||o(),!n.current&&a}},Gs=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","component","onScroll","onVisibleChange"];function Ys(){return Ys=Object.assign||function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Gs),w=!(!1===p||!i||!a),C=w&&u&&a*u.length>i,x=Js((0,v.useState)(0),2),E=x[0],k=x[1],S=Js((0,v.useState)(!1),2),O=S[0],N=S[1],P=$()(r,o),A=u||tu,M=(0,v.useRef)(),R=(0,v.useRef)(),T=(0,v.useRef)(),F=v.useCallback((function(e){return"function"==typeof d?d(e):null==e?void 0:e[d]}),[d]),I={getKey:F};function j(e){k((function(t){var n=function(e){var t=e;return Number.isNaN(Z.current)||(t=Math.min(t,Z.current)),Math.max(t,0)}("function"==typeof e?e(t):e);return M.current.scrollTop=n,n}))}var _=(0,v.useRef)({start:0,end:A.length}),D=(0,v.useRef)(),V=Js(function(e,t,n){var r=Ws(v.useState(e),2),o=r[0],i=r[1],a=Ws(v.useState(null),2),l=a[0],c=a[1];return v.useEffect((function(){var r=function(e,t,n){var r,o,i=e.length,a=t.length;if(0===i&&0===a)return null;i=E&&void 0===t&&(t=c,n=o),d>E+i&&void 0===r&&(r=c),o=d}return void 0===t&&(t=0,n=0),void 0===r&&(r=A.length-1),{scrollHeight:o,start:t,end:r=Math.min(r+1,A.length),offset:n}}),[C,w,E,A,U,i]),K=q.scrollHeight,G=q.start,Y=q.end,X=q.offset;_.current.start=G,_.current.end=Y;var Q=K-i,Z=(0,v.useRef)(Q);Z.current=Q;var J=E<=0,ee=E>=Q,te=Ks(J,ee),ne=function(e,t,n,r){var o=(0,v.useRef)(0),i=(0,v.useRef)(null),a=(0,v.useRef)(null),l=(0,v.useRef)(!1),c=Ks(t,n);return[function(t){if(e){se.cancel(i.current);var n=t.deltaY;o.current+=n,a.current=n,c(n)||(qs||t.preventDefault(),i.current=se((function(){var e,t=l.current?10:1;e=o.current*t,j((function(t){return t+e})),o.current=0})))}},function(t){e&&(l.current=t.detail===a.current)}]}(w,J,ee),re=Js(ne,2),oe=re[0],ie=re[1];!function(e,t,n){var r,o=(0,v.useRef)(!1),i=(0,v.useRef)(0),a=(0,v.useRef)(null),l=(0,v.useRef)(null),c=function(e){if(o.current){var t=Math.ceil(e.touches[0].pageY),r=i.current-t;i.current=t,n(r)&&e.preventDefault(),clearInterval(l.current),l.current=setInterval((function(){(!n(r*=.9333333333333333,!0)||Math.abs(r)<=.1)&&clearInterval(l.current)}),16)}},s=function(){o.current=!1,r()},u=function(e){r(),1!==e.touches.length||o.current||(o.current=!0,i.current=Math.ceil(e.touches[0].pageY),a.current=e.target,a.current.addEventListener("touchmove",c),a.current.addEventListener("touchend",s))};r=function(){a.current&&(a.current.removeEventListener("touchmove",c),a.current.removeEventListener("touchend",s))},qn((function(){return e&&t.current.addEventListener("touchstart",u),function(){var e;null===(e=t.current)||void 0===e||e.removeEventListener("touchstart",u),r(),clearInterval(l.current)}}),[e])}(w,M,(function(e,t){return!te(e,t)&&(oe({preventDefault:function(){},deltaY:e}),!0)})),qn((function(){function e(e){w&&e.preventDefault()}return M.current.addEventListener("wheel",oe),M.current.addEventListener("DOMMouseScroll",ie),M.current.addEventListener("MozMousePixelScroll",e),function(){M.current&&(M.current.removeEventListener("wheel",oe),M.current.removeEventListener("DOMMouseScroll",ie),M.current.removeEventListener("MozMousePixelScroll",e))}}),[w]);var ae=function(e,t,n,r,o,i,a,l){var c=v.useRef();return function(l){if(null!=l){if(se.cancel(c.current),"number"==typeof l)a(l);else if(l&&"object"===$s(l)){var s,u=l.align;s="index"in l?l.index:t.findIndex((function(e){return o(e)===l.key}));var f=l.offset,d=void 0===f?0:f;!function l(f,p){if(!(f<0)&&e.current){var m=e.current.clientHeight,v=!1,h=p;if(m){for(var g=p||u,y=0,b=0,w=0,C=Math.min(t.length,s),x=0;x<=C;x+=1){var E=o(t[x]);b=y;var k=n.get(E);y=w=b+(void 0===k?r:k),x===s&&void 0===k&&(v=!0)}var S=null;switch(g){case"top":S=b-d;break;case"bottom":S=w-m+d;break;default:var O=e.current.scrollTop;bO+m&&(h="bottom")}null!==S&&S!==e.current.scrollTop&&a(S)}c.current=se((function(){v&&i(),l(f-1,h)}))}}(3)}}else null===(p=T.current)||void 0===p||p.delayHidden();var p}}(M,A,B,a,F,W,j);v.useImperativeHandle(t,(function(){return{scrollTo:ae}})),qn((function(){if(y){var e=A.slice(G,Y+1);y(e,A)}}),[G,Y,A]);var le=function(e,t,n,r,o,i){var a=i.getKey;return e.slice(t,n+1).map((function(e,n){var i=o(e,t+n,{}),l=a(e);return v.createElement(Ds,{key:l,setRef:function(t){return r(e,t)}},i)}))}(A,G,Y,H,f,I),ce=null;return i&&(ce=Qs(Zs({},c?"height":"maxHeight",i),nu),w&&(ce.overflowY="hidden",O&&(ce.pointerEvents="none"))),v.createElement("div",Ys({style:Qs(Qs({},s),{},{position:"relative"}),className:P},b),v.createElement(h,{className:"".concat(r,"-holder"),style:ce,ref:M,onScroll:function(e){var t=e.currentTarget.scrollTop;t!==E&&j(t),null==g||g(e)}},v.createElement(Ns,{prefixCls:r,height:K,offset:X,onInnerResize:W,ref:R},le)),w&&v.createElement(_s,{ref:T,prefixCls:r,scrollTop:E,height:i,scrollHeight:K,count:A.length,onScroll:function(e){j(e)},onStartMove:function(){N(!0)},onStopMove:function(){N(!1)}}))}var ou=v.forwardRef(ru);ou.displayName="List";var iu=ou,au=v.createContext(null),lu=["disabled","title","children","style","className"];function cu(e){return"string"==typeof e||"number"==typeof e}var su=function(t,n){var r=v.useContext(os),o=r.prefixCls,i=r.id,a=r.open,l=r.multiple,c=r.mode,s=r.searchValue,u=r.toggleOpen,f=r.notFoundContent,d=r.onPopupScroll,p=v.useContext(au),m=p.flattenOptions,h=p.onActiveValue,g=p.defaultActiveFirstOption,y=p.onSelect,b=p.menuItemSelectedIcon,w=p.rawValues,C=p.fieldNames,x=p.virtual,E=p.listHeight,k=p.listItemHeight,S="".concat(o,"-item"),O=pe((function(){return m}),[a,m],(function(e,t){return t[0]&&e[1]!==t[1]})),N=v.useRef(null),P=function(e){e.preventDefault()},A=function(e){N.current&&N.current.scrollTo("number"==typeof e?{index:e}:e)},M=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=O.length,r=0;r1&&void 0!==arguments[1]&&arguments[1];F(e);var n={source:t?"keyboard":"mouse"},r=O[e];r?h(r.value,e,n):h(null,-1,n)};(0,v.useEffect)((function(){I(!1!==g?M(0):-1)}),[O.length,s]);var _=v.useCallback((function(e){return w.has(e)&&"combobox"!==c}),[c,bi(w).toString()]);(0,v.useEffect)((function(){var e,t=setTimeout((function(){if(!l&&a&&1===w.size){var e=Array.from(w)[0],t=O.findIndex((function(t){return t.data.value===e}));-1!==t&&(I(t),A(t))}}));return a&&(null===(e=N.current)||void 0===e||e.scrollTo(void 0)),function(){return clearTimeout(t)}}),[a,s]);var D=function(e){void 0!==e&&y(e,{selected:!w.has(e)}),l||u(!1)};if(v.useImperativeHandle(n,(function(){return{onKeyDown:function(e){var t=e.which,n=e.ctrlKey;switch(t){case dc.N:case dc.P:case dc.UP:case dc.DOWN:var r=0;if(t===dc.UP?r=-1:t===dc.DOWN?r=1:/(mac\sos|macintosh)/i.test(navigator.appVersion)&&n&&(t===dc.N?r=1:t===dc.P&&(r=-1)),0!==r){var o=M(T+r,r);A(o),I(o,!0)}break;case dc.ENTER:var i=O[T];i&&!i.data.disabled?D(i.value):D(void 0),a&&e.preventDefault();break;case dc.ESC:u(!1),a&&e.stopPropagation()}},onKeyUp:function(){},scrollTo:function(e){A(e)}}})),0===O.length)return v.createElement("div",{role:"listbox",id:"".concat(i,"_list"),className:"".concat(S,"-empty"),onMouseDown:P},f);var V=Object.keys(C).map((function(e){return C[e]})),L=function(e){return e.label},H=function(t){var n=O[t];if(!n)return null;var r=n.data||{},o=r.value,a=n.group,l=kc(r,!0),c=L(n);return n?v.createElement("div",e({"aria-label":"string"!=typeof c||a?null:c},l,{key:t,role:a?"presentation":"option",id:"".concat(i,"_list_").concat(t),"aria-selected":_(o)}),o):null};return v.createElement(v.Fragment,null,v.createElement("div",{role:"listbox",id:"".concat(i,"_list"),style:{height:0,width:0,overflow:"hidden"}},H(T-1),H(T),H(T+1)),v.createElement(iu,{itemKey:"key",ref:N,data:O,height:E,itemHeight:k,fullHeight:!1,onMouseDown:P,onScroll:d,virtual:x},(function(t,n){var r,o=t.group,i=t.groupOption,a=t.data,l=t.label,c=t.value,s=a.key;if(o){var u,f=null!==(u=a.title)&&void 0!==u?u:cu(l)?l.toString():void 0;return v.createElement("div",{className:$()(S,"".concat(S,"-group")),title:f},void 0!==l?l:s)}var d=a.disabled,p=a.title,m=(a.children,a.style),h=a.className,g=Hr(q(a,lu),V),y=_(c),w="".concat(S,"-option"),C=$()(S,w,h,(j(r={},"".concat(w,"-grouped"),i),j(r,"".concat(w,"-active"),T===n&&!d),j(r,"".concat(w,"-disabled"),d),j(r,"".concat(w,"-selected"),y),r)),x=L(t),E=!b||"function"==typeof b||y,k="number"==typeof x?x:x||c,O=cu(k)?k.toString():void 0;return void 0!==p&&(O=p),v.createElement("div",e({},kc(g),{"aria-selected":y,className:C,title:O,onMouseMove:function(){T===n||d||I(n)},onClick:function(){d||D(c)},style:m}),v.createElement("div",{className:"".concat(w,"-content")},k),v.isValidElement(b)||y,E&&v.createElement(Bc,{className:"".concat(S,"-option-state"),customizeIcon:b,customizeIconProps:{isSelected:y}},y?"✓":null))})))},uu=v.forwardRef(su);uu.displayName="OptionList";var fu=uu,du=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","listHeight","listItemHeight","value","defaultValue","labelInValue","onChange"],pu=["inputValue"],mu=v.forwardRef((function(t,n){var r=t.id,o=t.mode,i=t.prefixCls,a=void 0===i?"rc-select":i,l=t.backfill,c=t.fieldNames,s=t.inputValue,u=t.searchValue,f=t.onSearch,d=t.autoClearSearchValue,p=void 0===d||d,m=t.onSelect,h=t.onDeselect,g=t.dropdownMatchSelectWidth,y=void 0===g||g,b=t.filterOption,w=t.filterSort,C=t.optionFilterProp,x=t.optionLabelProp,E=t.options,k=t.children,S=t.defaultActiveFirstOption,O=t.menuItemSelectedIcon,N=t.virtual,P=t.listHeight,A=void 0===P?200:P,M=t.listItemHeight,R=void 0===M?20:M,T=t.value,F=t.defaultValue,I=t.labelInValue,_=t.onChange,D=q(t,du),V=function(e){var t=z(v.useState(),2),n=t[0],r=t[1];return v.useEffect((function(){var e;r("rc_select_".concat((ds?(e=fs,fs+=1):e="TEST_OR_SSR",e)))}),[]),e||n}(r),L=ls(o),H=!(E||!k),$=v.useMemo((function(){return(void 0!==b||"combobox"!==o)&&b}),[b,o]),B=v.useMemo((function(){return mc(c,H)}),[JSON.stringify(c),H]),K=z(br("",{value:void 0!==u?u:s,postState:function(e){return e||""}}),2),G=K[0],Y=K[1],X=gs(E,k,B,C,x),Q=X.valueOptions,Z=X.labelOptions,J=X.options,ee=v.useCallback((function(e){return Gc(e).map((function(e){var t,n,r,o,i;!function(e){return!e||"object"!==W(e)}(e)?(r=e.key,n=e.label,t=null!==(i=e.value)&&void 0!==i?i:r):t=e;var a,l=Q.get(t);return l&&(void 0===n&&(n=null==l?void 0:l[x||B.label]),void 0===r&&(r=null!==(a=null==l?void 0:l.key)&&void 0!==a?a:t),o=null==l?void 0:l.disabled),{label:n,value:t,key:r,disabled:o}}))}),[B,x,Q]),te=z(br(F,{value:T}),2),ne=te[0],re=te[1],oe=function(e,t){var n=v.useRef({values:new Map,options:new Map});return[v.useMemo((function(){var r=n.current,o=r.values,i=r.options,a=e.map((function(e){var t;return void 0===e.label?U(U({},e),{},{label:null===(t=o.get(e.value))||void 0===t?void 0:t.label}):e})),l=new Map,c=new Map;return a.forEach((function(e){l.set(e.value,e),c.set(e.value,t.get(e.value)||i.get(e.value))})),n.current.values=l,n.current.options=c,a}),[e,t]),v.useCallback((function(e){return t.get(e)||n.current.options.get(e)}),[t])]}(v.useMemo((function(){var e,t=ee(ne);return"combobox"!==o||(null===(e=t[0])||void 0===e?void 0:e.value)?t:[]}),[ne,ee,o]),Q),ie=z(oe,2),ae=ie[0],le=ie[1],ce=v.useMemo((function(){if(!o&&1===ae.length){var e=ae[0];if(null===e.value&&(null===e.label||void 0===e.label))return[]}return ae.map((function(e){var t;return U(U({},e),{},{label:null!==(t=e.label)&&void 0!==t?t:e.value})}))}),[o,ae]),se=v.useMemo((function(){return new Set(ae.map((function(e){return e.value})))}),[ae]);v.useEffect((function(){if("combobox"===o){var e,t=null===(e=ae[0])||void 0===e?void 0:e.value;null!=t&&Y(String(t))}}),[ae]);var ue=ys((function(e,t){var n,r=null!=t?t:e;return j(n={},B.value,e),j(n,B.label,r),n})),fe=v.useMemo((function(){if("tags"!==o)return J;var e=bi(J);return bi(ae).sort((function(e,t){return e.value1&&void 0!==arguments[1]?arguments[1]:{},n=t.fieldNames,r=t.childrenAsData,o=[],i=mc(n,!1),a=i.label,l=i.value,c=i.options;function s(e,t){e.forEach((function(e){var n=e[a];if(t||!(c in e)){var i=e[l];o.push({key:pc(e,o.length),groupOption:t,data:e,label:n,value:i})}else{var u=n;void 0===u&&r&&(u=e.label),o.push({key:pc(e,o.length),group:!0,data:e,label:u}),s(e[c],!0)}}))}return s(e,!1),o}(me,{fieldNames:B,childrenAsData:H})}),[me,B,H]),he=function(e){var t=ee(e);if(re(t),_&&(t.length!==ae.length||t.some((function(e,t){var n;return(null===(n=ae[t])||void 0===n?void 0:n.value)!==(null==e?void 0:e.value)})))){var n=I?t:t.map((function(e){return e.value})),r=t.map((function(e){return vc(le(e.value))}));_(L?n:n[0],L?r:r[0])}},ge=z(v.useState(null),2),ye=ge[0],be=ge[1],we=z(v.useState(0),2),Ce=we[0],xe=we[1],Ee=void 0!==S?S:"combobox"!==o,ke=v.useCallback((function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.source,i=void 0===r?"keyboard":r;xe(t),l&&"combobox"===o&&null!==e&&"keyboard"===i&&be(String(e))}),[l,o]),Se=function(e,t){var n=function(){var t,n=le(e);return[I?{label:null==n?void 0:n[B.label],value:e,key:null!==(t=null==n?void 0:n.key)&&void 0!==t?t:e}:e,vc(n)]};if(t&&m){var r=z(n(),2),o=r[0],i=r[1];m(o,i)}else if(!t&&h){var a=z(n(),2),l=a[0],c=a[1];h(l,c)}},Oe=ys((function(e,t){var n,r=!L||t.selected;n=r?L?[].concat(bi(ae),[e]):[e]:ae.filter((function(t){return t.value!==e})),he(n),Se(e,r),"combobox"===o?be(""):ls&&!p||(Y(""),be(""))})),Ne=v.useMemo((function(){var e=!1!==N&&!1!==y;return U(U({},X),{},{flattenOptions:ve,onActiveValue:ke,defaultActiveFirstOption:Ee,onSelect:Oe,menuItemSelectedIcon:O,rawValues:se,fieldNames:B,virtual:e,listHeight:A,listItemHeight:R,childrenAsData:H})}),[X,ve,ke,Ee,Oe,O,se,B,N,y,A,R,H]);return v.createElement(au.Provider,{value:Ne},v.createElement(ss,e({},D,{id:V,prefixCls:a,ref:n,omitDomProps:pu,mode:o,displayValues:ce,onDisplayValuesChange:function(e,t){he(e),"remove"!==t.type&&"clear"!==t.type||t.values.forEach((function(e){Se(e.value,!1)}))},searchValue:G,onSearch:function(e,t){if(Y(e),be(null),"submit"!==t.source)"blur"!==t.source&&("combobox"===o&&he(e),null==f||f(e));else{var n=(e||"").trim();if(n){var r=Array.from(new Set([].concat(bi(se),[n])));he(r),Se(n,!0),Y("")}}},onSearchSplit:function(e){var t=e;"tags"!==o&&(t=e.map((function(e){var t=Z.get(e);return null==t?void 0:t.value})).filter((function(e){return void 0!==e})));var n=Array.from(new Set([].concat(bi(se),bi(t))));he(n),n.forEach((function(e){Se(e,!0)}))},dropdownMatchSelectWidth:y,OptionList:fu,emptyOptions:!ve.length,activeValue:ye,activeDescendantId:"".concat(V,"_list_").concat(Ce)})))})),vu=mu;vu.Option=xs,vu.OptGroup=ws;var hu=vu,gu=(0,v.createContext)(void 0),yu={placeholder:"Select time",rangePlaceholder:["Start time","End time"]},bu={lang:e({placeholder:"Select date",yearPlaceholder:"Select year",quarterPlaceholder:"Select quarter",monthPlaceholder:"Select month",weekPlaceholder:"Select week",rangePlaceholder:["Start date","End date"],rangeYearPlaceholder:["Start year","End year"],rangeQuarterPlaceholder:["Start quarter","End quarter"],rangeMonthPlaceholder:["Start month","End month"],rangeWeekPlaceholder:["Start week","End week"]},{locale:"en_US",today:"Today",now:"Now",backToToday:"Back to today",ok:"OK",clear:"Clear",month:"Month",year:"Year",timeSelect:"select time",dateSelect:"select date",weekSelect:"Choose a week",monthSelect:"Choose a month",yearSelect:"Choose a year",decadeSelect:"Choose a decade",yearFormat:"YYYY",dateFormat:"M/D/YYYY",dayFormat:"D",dateTimeFormat:"M/D/YYYY HH:mm:ss",monthBeforeYear:!0,previousMonth:"Previous month (PageUp)",nextMonth:"Next month (PageDown)",previousYear:"Last year (Control + left)",nextYear:"Next year (Control + right)",previousDecade:"Last decade",nextDecade:"Next decade",previousCentury:"Last century",nextCentury:"Next century"}),timePickerLocale:e({},yu)},wu="${label} is not a valid ${type}",Cu={locale:"en",Pagination:{items_per_page:"/ page",jump_to:"Go to",jump_to_confirm:"confirm",page:"Page",prev_page:"Previous Page",next_page:"Next Page",prev_5:"Previous 5 Pages",next_5:"Next 5 Pages",prev_3:"Previous 3 Pages",next_3:"Next 3 Pages",page_size:"Page Size"},DatePicker:bu,TimePicker:yu,Calendar:bu,global:{placeholder:"Please select"},Table:{filterTitle:"Filter menu",filterConfirm:"OK",filterReset:"Reset",filterEmptyText:"No filters",filterCheckall:"Select all items",filterSearchPlaceholder:"Search in filters",emptyText:"No data",selectAll:"Select current page",selectInvert:"Invert current page",selectNone:"Clear all data",selectionAll:"Select all data",sortTitle:"Sort",expand:"Expand row",collapse:"Collapse row",triggerDesc:"Click to sort descending",triggerAsc:"Click to sort ascending",cancelSort:"Click to cancel sorting"},Modal:{okText:"OK",cancelText:"Cancel",justOkText:"OK"},Popconfirm:{okText:"OK",cancelText:"Cancel"},Transfer:{titles:["",""],searchPlaceholder:"Search here",itemUnit:"item",itemsUnit:"items",remove:"Remove",selectCurrent:"Select current page",removeCurrent:"Remove current page",selectAll:"Select all data",removeAll:"Remove all data",selectInvert:"Invert current page"},Upload:{uploading:"Uploading...",removeFile:"Remove file",uploadError:"Upload error",previewFile:"Preview file",downloadFile:"Download file"},Empty:{description:"No Data"},Icon:{icon:"icon"},Text:{edit:"Edit",copy:"Copy",copied:"Copied",expand:"Expand"},PageHeader:{back:"Back"},Form:{optional:"(optional)",defaultValidateMessages:{default:"Field validation error for ${label}",required:"Please enter ${label}",enum:"${label} must be one of [${enum}]",whitespace:"${label} cannot be a blank character",date:{format:"${label} date format is invalid",parse:"${label} cannot be converted to a date",invalid:"${label} is an invalid date"},types:{string:wu,method:wu,array:wu,object:wu,number:wu,date:wu,boolean:wu,integer:wu,float:wu,regexp:wu,email:wu,url:wu,hex:wu},string:{len:"${label} must be ${len} characters",min:"${label} must be at least ${min} characters",max:"${label} must be up to ${max} characters",range:"${label} must be between ${min}-${max} characters"},number:{len:"${label} must be equal to ${len}",min:"${label} must be minimum ${min}",max:"${label} must be maximum ${max}",range:"${label} must be between ${min}-${max}"},array:{len:"Must be ${len} ${label}",min:"At least ${min} ${label}",max:"At most ${max} ${label}",range:"The amount of ${label} must be between ${min}-${max}"},pattern:{mismatch:"${label} does not match the pattern ${pattern}"}}},Image:{preview:"Preview"}},xu=Cu,Eu=function(t){Z(r,t);var n=te(r);function r(){return K(this,r),n.apply(this,arguments)}return Y(r,[{key:"getLocale",value:function(){var t=this.props,n=t.componentName,r=t.defaultLocale||xu[null!=n?n:"global"],o=this.context,i=n&&o?o[n]:{};return e(e({},r instanceof Function?r():r),i||{})}},{key:"getLocaleCode",value:function(){var e=this.context,t=e&&e.locale;return e&&e.exist&&!t?xu.locale:t}},{key:"render",value:function(){return this.props.children(this.getLocale(),this.getLocaleCode(),this.context)}}]),r}(v.Component);Eu.defaultProps={componentName:"global"},Eu.contextType=gu;var ku=function(){var e=(0,v.useContext(wr).getPrefixCls)("empty-img-default");return v.createElement("svg",{className:e,width:"184",height:"152",viewBox:"0 0 184 152",xmlns:"http://www.w3.org/2000/svg"},v.createElement("g",{fill:"none",fillRule:"evenodd"},v.createElement("g",{transform:"translate(24 31.67)"},v.createElement("ellipse",{className:"".concat(e,"-ellipse"),cx:"67.797",cy:"106.89",rx:"67.797",ry:"12.668"}),v.createElement("path",{className:"".concat(e,"-path-1"),d:"M122.034 69.674L98.109 40.229c-1.148-1.386-2.826-2.225-4.593-2.225h-51.44c-1.766 0-3.444.839-4.592 2.225L13.56 69.674v15.383h108.475V69.674z"}),v.createElement("path",{className:"".concat(e,"-path-2"),d:"M101.537 86.214L80.63 61.102c-1.001-1.207-2.507-1.867-4.048-1.867H31.724c-1.54 0-3.047.66-4.048 1.867L6.769 86.214v13.792h94.768V86.214z",transform:"translate(13.56)"}),v.createElement("path",{className:"".concat(e,"-path-3"),d:"M33.83 0h67.933a4 4 0 0 1 4 4v93.344a4 4 0 0 1-4 4H33.83a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4z"}),v.createElement("path",{className:"".concat(e,"-path-4"),d:"M42.678 9.953h50.237a2 2 0 0 1 2 2V36.91a2 2 0 0 1-2 2H42.678a2 2 0 0 1-2-2V11.953a2 2 0 0 1 2-2zM42.94 49.767h49.713a2.262 2.262 0 1 1 0 4.524H42.94a2.262 2.262 0 0 1 0-4.524zM42.94 61.53h49.713a2.262 2.262 0 1 1 0 4.525H42.94a2.262 2.262 0 0 1 0-4.525zM121.813 105.032c-.775 3.071-3.497 5.36-6.735 5.36H20.515c-3.238 0-5.96-2.29-6.734-5.36a7.309 7.309 0 0 1-.222-1.79V69.675h26.318c2.907 0 5.25 2.448 5.25 5.42v.04c0 2.971 2.37 5.37 5.277 5.37h34.785c2.907 0 5.277-2.421 5.277-5.393V75.1c0-2.972 2.343-5.426 5.25-5.426h26.318v33.569c0 .617-.077 1.216-.221 1.789z"})),v.createElement("path",{className:"".concat(e,"-path-5"),d:"M149.121 33.292l-6.83 2.65a1 1 0 0 1-1.317-1.23l1.937-6.207c-2.589-2.944-4.109-6.534-4.109-10.408C138.802 8.102 148.92 0 161.402 0 173.881 0 184 8.102 184 18.097c0 9.995-10.118 18.097-22.599 18.097-4.528 0-8.744-1.066-12.28-2.902z"}),v.createElement("g",{className:"".concat(e,"-g"),transform:"translate(149.65 15.383)"},v.createElement("ellipse",{cx:"20.654",cy:"3.167",rx:"2.849",ry:"2.815"}),v.createElement("path",{d:"M5.698 5.63H0L2.898.704zM9.259.704h4.985V5.63H9.259z"}))))},Su=function(){var e=(0,v.useContext(wr).getPrefixCls)("empty-img-simple");return v.createElement("svg",{className:e,width:"64",height:"41",viewBox:"0 0 64 41",xmlns:"http://www.w3.org/2000/svg"},v.createElement("g",{transform:"translate(0 1)",fill:"none",fillRule:"evenodd"},v.createElement("ellipse",{className:"".concat(e,"-ellipse"),cx:"32",cy:"33",rx:"32",ry:"7"}),v.createElement("g",{className:"".concat(e,"-g"),fillRule:"nonzero"},v.createElement("path",{d:"M55 12.76L44.854 1.258C44.367.474 43.656 0 42.907 0H21.093c-.749 0-1.46.474-1.947 1.257L9 12.761V22h46v-9.24z"}),v.createElement("path",{d:"M41.613 15.931c0-1.605.994-2.93 2.227-2.931H55v18.137C55 33.26 53.68 35 52.05 35h-40.1C10.32 35 9 33.259 9 31.137V13h11.16c1.233 0 2.227 1.323 2.227 2.928v.022c0 1.605 1.005 2.901 2.237 2.901h14.752c1.232 0 2.237-1.308 2.237-2.913v-.007z",className:"".concat(e,"-path")}))))},Ou=v.createElement(ku,null),Nu=v.createElement(Su,null),Pu=function(t){var n=t.className,r=t.prefixCls,o=t.image,i=void 0===o?Ou:o,a=t.description,l=t.children,c=t.imageStyle,s=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const[n,r]=Yu(!0),{definition:o}=e,{argValue:i,arg:a,styleConfig:l}=e,c=M(a.type);let s=null;if(i)if("Variable"===i.kind)s=(0,t.createElement)("span",{style:{color:l.colors.variable}},"$",i.name.value);else if(qu(c))s="Boolean"===c.name?(0,t.createElement)(Wu,{getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],size:"small",style:{color:l.colors.builtin,minHeight:"16px",minWidth:"16ch"},onChange:t=>{const n={target:{value:t}};e.setArgValue(n)},value:"BooleanValue"===i.kind?i.value:void 0},(0,t.createElement)(Wu.Option,{key:"true",value:"true"},"true"),(0,t.createElement)(Wu.Option,{key:"false",value:"false"},"false")):(0,t.createElement)(ac,{setArgValue:e.setArgValue,arg:a,argValue:i,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig});else if(Bu(c))"EnumValue"===i.kind?s=(0,t.createElement)(Wu,{size:"small",getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],style:{backgroundColor:"white",minHeight:"16px",minWidth:"20ch",color:l.colors.string2},onChange:t=>{const n={target:{value:t}};e.setArgValue(n)},value:i.value},c.getValues().map(((e,n)=>(0,t.createElement)(Wu.Option,{key:n,value:e.name},e.name)))):console.error("arg mismatch between arg and selection",c,i);else if(Uu(c))if("ObjectValue"===i.kind){const n=c.getFields();s=(0,t.createElement)("div",{style:{marginLeft:16}},Object.keys(n).sort().map((r=>(0,t.createElement)(uc,{key:r,arg:n[r],parentField:e.parentField,selection:i,modifyFields:e.setArgFields,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition}))))}else console.error("arg mismatch between arg and selection",c,i);const u=i&&"Variable"===i.kind,f=void 0!==o.name&&i?(0,t.createElement)(zr,{getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],title:u?"Remove the variable":"Extract the current value into a GraphQL variable"},(0,t.createElement)(hi,{type:u?"danger":"default",size:"small",className:"toolbar-button",title:u?"Remove the variable":"Extract the current value into a GraphQL variable",onClick:t=>{t.preventDefault(),t.stopPropagation(),u?(()=>{if(!i||!i.name||!i.name.value)return;const t=i.name.value,n=(e.definition.variableDefinitions||[]).find((e=>e.variable.name.value===t));if(!n)return;const r=n.defaultValue,o=e.setArgValue(r,{commit:!1});if(o){const n=o.definitions.find((t=>t.name.value===e.definition.name.value));if(!n)return;let r=0;Gu(n,{Variable(e){e.name.value===t&&(r+=1)}});let i=n.variableDefinitions||[];r<2&&(i=i.filter((e=>e.variable.name.value!==t)));const a={...n,variableDefinitions:i},l=o.definitions.map((e=>n===e?a:e)),c={...o,definitions:l};e.onCommit(c)}})():(()=>{const t=a.name,n=(e.definition.variableDefinitions||[]).filter((e=>e.variable.name.value.startsWith(t))).length;let r;r=n>0?`${t}${n}`:t;const o=a.type.toString(),l={kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:r}},type:Ku(o),directives:[]};let c,s={};if(null!=i){const t=Gu(i,{Variable(t){const n=t.name.value,r=(o=n,(e.definition.variableDefinitions||[]).find((e=>e.variable.name.value===o)));var o;if(s[n]=s[n]+1||1,r)return r.defaultValue}});c={..."NonNullType"===l.type.kind?{...l,type:l.type.type}:l,defaultValue:t}}else c=l;const u=Object.entries(s).filter((e=>{let[t,n]=e;return n<2})).map((e=>{let[t,n]=e;return t}));if(c){const t=e.setArgValue(c,!1);if(t){const n=t.definitions.find((t=>!!(t.operation&&t.name&&t.name.value&&e.definition.name&&e.definition.name.value)&&t.name.value===e.definition.name.value)),r=[...(null==n?void 0:n.variableDefinitions)||[],c].filter((e=>-1===u.indexOf(e.variable.name.value))),o={...n,variableDefinitions:r},i=t.definitions.map((e=>n===e?o:e)),a={...t,definitions:i};e.onCommit(a)}}})()}},(0,t.createElement)("span",{style:{color:u?"inherit":l.colors.variable}},"$"))):null;return(0,t.createElement)("div",{style:{cursor:"pointer",minHeight:"20px",WebkitUserSelect:"none",userSelect:"none"},"data-arg-name":a.name,"data-arg-type":c.name,className:`graphiql-explorer-${a.name}`},(0,t.createElement)("span",{style:{cursor:"pointer"},onClick:t=>{const n=!i;n?e.addArg(!0):e.removeArg(!0),r(n)}},Uu(c)?(0,t.createElement)("span",null,i?e.styleConfig.arrowOpen:e.styleConfig.arrowClosed):(0,t.createElement)(gi,{checked:!!i,styleConfig:e.styleConfig}),(0,t.createElement)("span",{style:{color:l.colors.attribute},title:a.description,onMouseEnter:()=>{null!=i&&r(!0)},onMouseLeave:()=>r(!0)},a.name,P(a)?"*":"",": ",f," ")," "),s||(0,t.createElement)("span",null)," ")};const{isInputObjectType:Qu,isLeafType:Zu}=wpGraphiQL.GraphQL;var Ju=e=>{let n;const r=()=>{const{selection:t}=e;return(t.arguments||[]).find((t=>t.name.value===e.arg.name))},{arg:o,parentField:i}=e,a=r();return(0,t.createElement)(Xu,{argValue:a?a.value:null,arg:o,parentField:i,addArg:t=>{const{selection:r,getDefaultScalarArgValue:o,makeDefaultArg:i,parentField:a,arg:l}=e,c=M(l.type);let s=null;if(n)s=n;else if(Qu(c)){const e=c.getFields();s={kind:"Argument",name:{kind:"Name",value:l.name},value:{kind:"ObjectValue",fields:T(o,i,a,Object.keys(e).map((t=>e[t])))}}}else Zu(c)&&(s={kind:"Argument",name:{kind:"Name",value:l.name},value:o(a,l,c)});return s?e.modifyArguments([...r.arguments||[],s],t):(console.error("Unable to add arg for argType",c),null)},removeArg:t=>{const{selection:o}=e,i=r();return n=r(),e.modifyArguments((o.arguments||[]).filter((e=>e!==i)),t)},setArgFields:(t,n)=>{const{selection:o}=e,i=r();if(i)return e.modifyArguments((o.arguments||[]).map((e=>e===i?{...e,value:{kind:"ObjectValue",fields:t}}:e)),n);console.error("missing arg selection when setting arg value")},setArgValue:(t,n)=>{let o=!1,i=!1,a=!1;try{"VariableDefinition"===t.kind?i=!0:null==t?o=!0:"string"==typeof t.kind&&(a=!0)}catch(e){}const{selection:l}=e,c=r();if(!c&&!i)return void console.error("missing arg selection when setting arg value");const s=M(e.arg.type);if(!(Zu(s)||i||o||a))return void console.warn("Unable to handle non leaf types in ArgView._setArgValue");let u,f;return null==t?f=null:t.target&&"string"==typeof t.target.value?(u=t.target.value,f=R(s,u)):t.target||"VariableDefinition"!==t.kind?"string"==typeof t.kind&&(f=t):(u=t,f=u.variable),e.modifyArguments((l.arguments||[]).map((e=>e===c?{...e,value:f}:e)),n)},getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition})},ef={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M574 665.4a8.03 8.03 0 00-11.3 0L446.5 781.6c-53.8 53.8-144.6 59.5-204 0-59.5-59.5-53.8-150.2 0-204l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3l-39.8-39.8a8.03 8.03 0 00-11.3 0L191.4 526.5c-84.6 84.6-84.6 221.5 0 306s221.5 84.6 306 0l116.2-116.2c3.1-3.1 3.1-8.2 0-11.3L574 665.4zm258.6-474c-84.6-84.6-221.5-84.6-306 0L410.3 307.6a8.03 8.03 0 000 11.3l39.7 39.7c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c53.8-53.8 144.6-59.5 204 0 59.5 59.5 53.8 150.2 0 204L665.3 562.6a8.03 8.03 0 000 11.3l39.8 39.8c3.1 3.1 8.2 3.1 11.3 0l116.2-116.2c84.5-84.6 84.5-221.5 0-306.1zM610.1 372.3a8.03 8.03 0 00-11.3 0L372.3 598.7a8.03 8.03 0 000 11.3l39.6 39.6c3.1 3.1 8.2 3.1 11.3 0l226.4-226.4c3.1-3.1 3.1-8.2 0-11.3l-39.5-39.6z"}}]},name:"link",theme:"outlined"},tf=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:ef}))};tf.displayName="LinkOutlined";var nf=v.forwardRef(tf),rf=e=>{let n;const r=()=>e.selections.find((t=>"FragmentSpread"===t.kind&&t.name.value===e.fragment.name.value)),{styleConfig:o}=e,i=r();return(0,t.createElement)("div",{className:`graphiql-explorer-${e.fragment.name.value}`},(0,t.createElement)("span",{style:{cursor:"pointer"},onClick:i?()=>{const t=r();n=t,e.modifySelections(e.selections.filter((t=>!("FragmentSpread"===t.kind&&t.name.value===e.fragment.name.value))))}:()=>{e.modifySelections([...e.selections,n||{kind:"FragmentSpread",name:e.fragment.name}])}},(0,t.createElement)(gi,{checked:!!i,styleConfig:e.styleConfig}),(0,t.createElement)("span",{style:{color:o.colors.def},className:`graphiql-explorer-${e.fragment.name.value}`},e.fragment.name.value),(0,t.createElement)(zr,{getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],title:`Edit the ${e.fragment.name.value} Fragment`},(0,t.createElement)(hi,{style:{height:"18px",margin:"0px 5px"},title:`Edit the ${e.fragment.name.value} Fragment`,type:"primary",size:"small",onClick:t=>{t.preventDefault(),t.stopPropagation();const n=window.document.getElementById(`collapse-wrap-fragment-${e.fragment.name.value}`);n&&n.scrollIntoView({behavior:"smooth",block:"start",inline:"nearest"})},icon:(0,t.createElement)(nf,null)}))))},of=e=>{let n;const r=()=>{const t=e.selections.find((t=>"InlineFragment"===t.kind&&t.typeCondition&&e.implementingType.name===t.typeCondition.name.value));return t?"InlineFragment"===t.kind?t:void 0:null},o=(t,n)=>{const o=r();return e.modifySelections(e.selections.map((n=>n===o?{directives:n.directives,kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:t}}:n)),n)},{implementingType:i,schema:a,getDefaultFieldNames:l,styleConfig:c}=e,s=r(),u=i.getFields(),f=s&&s.selectionSet?s.selectionSet.selections:[];return(0,t.createElement)("div",{className:`graphiql-explorer-${i.name}`},(0,t.createElement)("span",{style:{cursor:"pointer"},onClick:s?()=>{const t=r();n=t,e.modifySelections(e.selections.filter((e=>e!==t)))}:()=>{e.modifySelections([...e.selections,n||{kind:"InlineFragment",typeCondition:{kind:"NamedType",name:{kind:"Name",value:e.implementingType.name}},selectionSet:{kind:"SelectionSet",selections:e.getDefaultFieldNames(e.implementingType).map((e=>({kind:"Field",name:{kind:"Name",value:e}})))}}])}},(0,t.createElement)(gi,{checked:!!s,styleConfig:e.styleConfig}),(0,t.createElement)("span",{style:{color:c.colors.atom}},e.implementingType.name)),s?(0,t.createElement)("div",{style:{marginLeft:16}},Object.keys(u).sort().map((n=>(0,t.createElement)(vf,{key:n,field:u[n],selections:f,modifySelections:o,schema:a,getDefaultFieldNames:l,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,onCommit:e.onCommit,styleConfig:e.styleConfig,definition:e.definition,availableFragments:e.availableFragments})))):null)},af={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M176 511a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0zm280 0a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"ellipsis",theme:"outlined"},lf=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:af}))};lf.displayName="EllipsisOutlined";var cf=v.forwardRef(lf);const{getNamedType:sf,isInterfaceType:uf,isObjectType:ff,isUnionType:df}=wpGraphiQL.GraphQL,{useState:pf}=wp.element,mf=e=>{const[n,r]=pf(!1);let o;const i=()=>{const t=e.selections.find((t=>"Field"===t.kind&&e.field.name===t.name.value));return t?"Field"===t.kind?t:void 0:null},a=(t,n)=>{const r=i();if(r)return e.modifySelections(e.selections.map((e=>e===r?{alias:r.alias,arguments:t,directives:r.directives,kind:"Field",name:r.name,selectionSet:r.selectionSet}:e)),n);console.error("Missing selection when setting arguments",t)},l=(t,n)=>e.modifySelections(e.selections.map((n=>{if("Field"===n.kind&&e.field.name===n.name.value){if("Field"!==n.kind)throw new Error("invalid selection");return{alias:n.alias,arguments:n.arguments,directives:n.directives,kind:"Field",name:n.name,selectionSet:{kind:"SelectionSet",selections:t}}}return n})),n),{field:c,schema:s,getDefaultFieldNames:u,styleConfig:f}=e,d=i(),p=A(c.type),m=c.args.sort(((e,t)=>e.name.localeCompare(t.name)));let v=`graphiql-explorer-node graphiql-explorer-${c.name}`;c.isDeprecated&&(v+=" graphiql-explorer-deprecated");const h=ff(p)||uf(p)||df(p)?e.availableFragments&&e.availableFragments[p.name]:null,g=d&&d.selectionSet?d.selectionSet.selections:[],y=(0,t.createElement)("div",{className:v},(0,t.createElement)("span",{title:c.description,style:{cursor:"pointer",display:"inline-flex",alignItems:"center",minHeight:"16px",WebkitUserSelect:"none",userSelect:"none"},"data-field-name":c.name,"data-field-type":p.name,onClick:t=>{if(i()&&!t.altKey)(()=>{const t=i();o=t,e.modifySelections(e.selections.filter((e=>e!==t)))})();else{const n=sf(e.field.type),r=ff(n)&&n.getFields();r&&t.altKey?(t=>{const n={kind:"SelectionSet",selections:t?Object.keys(t).map((e=>({kind:"Field",name:{kind:"Name",value:e},arguments:[]}))):[]},r=[...e.selections.filter((t=>"InlineFragment"===t.kind||t.name.value!==e.field.name)),{kind:"Field",name:{kind:"Name",value:e.field.name},arguments:F(e.getDefaultScalarArgValue,e.makeDefaultArg,e.field),selectionSet:n}];e.modifySelections(r)})(r):(t=>{const n=[...e.selections,o||{kind:"Field",name:{kind:"Name",value:e.field.name},arguments:F(e.getDefaultScalarArgValue,e.makeDefaultArg,e.field)}];e.modifySelections(n)})()}},onMouseEnter:()=>{ff(p)&&d&&d.selectionSet&&d.selectionSet.selections.filter((e=>"FragmentSpread"!==e.kind)).length>0&&r(!0)},onMouseLeave:()=>r(!1)},ff(p)?(0,t.createElement)("span",null,d?e.styleConfig.arrowOpen:e.styleConfig.arrowClosed):null,ff(p)?null:(0,t.createElement)(gi,{checked:!!d,styleConfig:e.styleConfig}),(0,t.createElement)("span",{style:{color:f.colors.property},className:"graphiql-explorer-field-view"},c.name),n?(0,t.createElement)(zr,{getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],title:"Extract selections into a new reusable fragment"},(0,t.createElement)(hi,{size:"small",type:"primary",title:"Extract selections into a new reusable fragment",onClick:t=>{t.preventDefault(),t.stopPropagation();let n=`${p.name}Fragment`;const o=(h||[]).filter((e=>e.name.value.startsWith(n))).length;o>0&&(n=`${n}${o}`);const i=[{kind:"FragmentSpread",name:{kind:"Name",value:n},directives:[]}],a={kind:"FragmentDefinition",name:{kind:"Name",value:n},typeCondition:{kind:"NamedType",name:{kind:"Name",value:p.name}},directives:[],selectionSet:{kind:"SelectionSet",selections:g}},c=l(i,!1);if(c){const t={...c,definitions:[...c.definitions,a]};e.onCommit(t)}else console.warn("Unable to complete extractFragment operation");r(!1)},icon:(0,t.createElement)(cf,null),style:{height:"18px",margin:"0px 5px"}})):null),d&&m.length?(0,t.createElement)("div",{style:{marginLeft:16},className:"graphiql-explorer-graphql-arguments"},m.map((n=>(0,t.createElement)(Ju,{key:n.name,parentField:c,arg:n,selection:d,modifyArguments:a,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition})))):null);if(d){const n=A(p),r=n&&"getFields"in n?n.getFields():null;if(r)return(0,t.createElement)("div",{className:`graphiql-explorer-${c.name}`},y,(0,t.createElement)("div",{style:{marginLeft:16}},h?h.map((n=>{const r=s.getType(n.typeCondition.name.value),o=n.name.value;return r?(0,t.createElement)(rf,{key:o,fragment:n,selections:g,modifySelections:l,schema:s,styleConfig:e.styleConfig,onCommit:e.onCommit}):null})):null,Object.keys(r).sort().map((n=>(0,t.createElement)(mf,{key:n,field:r[n],selections:g,modifySelections:l,schema:s,getDefaultFieldNames:u,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition,availableFragments:e.availableFragments}))),uf(p)||df(p)?s.getPossibleTypes(p).map((n=>(0,t.createElement)(of,{key:n.name,implementingType:n,selections:g,modifySelections:l,schema:s,getDefaultFieldNames:u,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition}))):null));if(df(p))return(0,t.createElement)("div",{className:`graphiql-explorer-${c.name}`},y,(0,t.createElement)("div",{style:{marginLeft:16}},s.getPossibleTypes(p).map((n=>(0,t.createElement)(of,{key:n.name,implementingType:n,selections:g,modifySelections:l,schema:s,getDefaultFieldNames:u,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition})))))}return y};var vf=mf,hf=n(9864),gf=function(e){function t(e,r,c,s,d){for(var p,m,v,h,w,x=0,E=0,k=0,S=0,O=0,T=0,I=v=p=0,_=0,D=0,V=0,L=0,z=c.length,H=z-1,$="",W="",B="",U="";_p)&&(L=($=$.replace(" ",":")).length),0r&&(r=(t=t.trim()).charCodeAt(0)),r){case 38:return t.replace(h,"$1"+e.trim());case 58:return e.trim()+t.replace(h,"$1"+e.trim());default:if(0<1*n&&0c.charCodeAt(8))break;case 115:a=a.replace(c,"-webkit-"+c)+";"+a;break;case 207:case 102:a=a.replace(c,"-webkit-"+(102r.charCodeAt(0)&&(r=r.trim()),r=[r],01?t-1:0),r=1;r0?" Args: "+n.join(", "):""))}var jf=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,n=0;n=this.groupSizes.length){for(var n=this.groupSizes,r=n.length,o=r;e>=o;)(o<<=1)<0&&If(16,""+e);this.groupSizes=new Uint32Array(o),this.groupSizes.set(n),this.length=o;for(var i=r;i=this.length||0===this.groupSizes[e])return t;for(var n=this.groupSizes[e],r=this.indexOfGroup(e),o=r+n,i=r;i=Vf&&(Vf=t+1),_f.set(e,t),Df.set(t,e)},$f="style["+Rf+'][data-styled-version="5.3.5"]',Wf=new RegExp("^"+Rf+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),Bf=function(e,t,n){for(var r,o=n.split(","),i=0,a=o.length;i=0;n--){var r=t[n];if(r&&1===r.nodeType&&r.hasAttribute(Rf))return r}}(n),i=void 0!==o?o.nextSibling:null;r.setAttribute(Rf,"active"),r.setAttribute("data-styled-version","5.3.5");var a=qf();return a&&r.setAttribute("nonce",a),n.insertBefore(r,i),r},Gf=function(){function e(e){var t=this.element=Kf(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,n=0,r=t.length;n=0){var n=document.createTextNode(t),r=this.nodes[e];return this.element.insertBefore(n,r||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(s+=e+",")})),r+=""+l+c+'{content:"'+s+'"}/*!sc*/\n'}}}return r}(this)},e}(),ed=/(a)(d)/gi,td=function(e){return String.fromCharCode(e+(e>25?39:97))};function nd(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=td(t%52)+n;return(td(t%52)+n).replace(ed,"$1-$2")}var rd=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},od=function(e){return rd(5381,e)};function id(e){for(var t=0;t>>0);if(!t.hasNameForId(r,a)){var l=n(i,"."+a,void 0,r);t.insertRules(r,a,l)}o.push(a),this.staticRulesId=a}else{for(var c=this.rules.length,s=rd(this.baseHash,n.hash),u="",f=0;f>>0);if(!t.hasNameForId(r,v)){var h=n(u,"."+v,void 0,r);t.insertRules(r,v,h)}o.push(v)}}return o.join(" ")},e}(),cd=/^\s*\/\/.*$/gm,sd=[":","[",".","#"];function ud(e){var t,n,r,o,i=void 0===e?Nf:e,a=i.options,l=void 0===a?Nf:a,c=i.plugins,s=void 0===c?Of:c,u=new gf(l),f=[],d=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(n,r,o,i,a,l,c,s,u,f){switch(n){case 1:if(0===u&&64===r.charCodeAt(0))return e(r+";"),"";break;case 2:if(0===s)return r+"/*|*/";break;case 3:switch(s){case 102:case 112:return e(o[0]+r),"";default:return r+(0===f?"/*|*/":"")}case-2:r.split("/*|*/}").forEach(t)}}}((function(e){f.push(e)})),p=function(e,r,i){return 0===r&&-1!==sd.indexOf(i[n.length])||i.match(o)?e:"."+t};function m(e,i,a,l){void 0===l&&(l="&");var c=e.replace(cd,""),s=i&&a?a+" "+i+" { "+c+" }":c;return t=l,n=i,r=new RegExp("\\"+n+"\\b","g"),o=new RegExp("(\\"+n+"\\b){2,}"),u(a||!i?"":i,s)}return u.use([].concat(s,[function(e,t,o){2===e&&o.length&&o[0].lastIndexOf(n)>0&&(o[0]=o[0].replace(r,p))},d,function(e){if(-2===e){var t=f;return f=[],t}}])),m.hash=s.length?s.reduce((function(e,t){return t.name||If(15),rd(e,t.name)}),5381).toString():"",m}var fd=h().createContext(),dd=(fd.Consumer,h().createContext()),pd=(dd.Consumer,new Jf),md=ud();function vd(){return(0,v.useContext)(fd)||pd}function hd(e){var t=(0,v.useState)(e.stylisPlugins),n=t[0],r=t[1],o=vd(),i=(0,v.useMemo)((function(){var t=o;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t}),[e.disableCSSOMInjection,e.sheet,e.target]),a=(0,v.useMemo)((function(){return ud({options:{prefix:!e.disableVendorPrefixes},plugins:n})}),[e.disableVendorPrefixes,n]);return(0,v.useEffect)((function(){Bl()(n,e.stylisPlugins)||r(e.stylisPlugins)}),[e.stylisPlugins]),h().createElement(fd.Provider,{value:i},h().createElement(dd.Provider,{value:a},e.children))}var gd=function(){function e(e,t){var n=this;this.inject=function(e,t){void 0===t&&(t=md);var r=n.name+t.hash;e.hasNameForId(n.id,r)||e.insertRules(n.id,r,t(n.rules,r,"@keyframes"))},this.toString=function(){return If(12,String(n.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=md),this.name+e.hash},e}(),yd=/([A-Z])/,bd=/([A-Z])/g,wd=/^ms-/,Cd=function(e){return"-"+e.toLowerCase()};function xd(e){return yd.test(e)?e.replace(bd,Cd).replace(wd,"-ms-"):e}var Ed=function(e){return null==e||!1===e||""===e};function kd(e,t,n,r){if(Array.isArray(e)){for(var o,i=[],a=0,l=e.length;a1?t-1:0),r=1;r?@[\\\]^`{|}~-]+/g,Pd=/(^-|-$)/g;function Ad(e){return e.replace(Nd,"-").replace(Pd,"")}function Md(e){return"string"==typeof e&&!0}var Rd=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},Td=function(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e};function Fd(e,t,n){var r=e[n];Rd(t)&&Rd(r)?Id(r,t):e[n]=t}function Id(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r>>0)}("5.3.5"+n+_d[n]);return t?t+"-"+r:r}(t.displayName,t.parentComponentId):l,s=t.displayName,u=void 0===s?function(e){return Md(e)?"styled."+e:"Styled("+Af(e)+")"}(e):s,f=t.displayName&&t.componentId?Ad(t.displayName)+"-"+t.componentId:t.componentId||c,d=r&&e.attrs?Array.prototype.concat(e.attrs,a).filter(Boolean):a,p=t.shouldForwardProp;r&&e.shouldForwardProp&&(p=t.shouldForwardProp?function(n,r,o){return e.shouldForwardProp(n,r,o)&&t.shouldForwardProp(n,r,o)}:e.shouldForwardProp);var m,g=new ld(n,f,r?e.componentStyle:void 0),y=g.isStatic&&0===a.length,b=function(e,t){return function(e,t,n,r){var o=e.attrs,i=e.componentStyle,a=e.defaultProps,l=e.foldedComponentIds,c=e.shouldForwardProp,s=e.styledComponentId,u=e.target,f=function(e,t,n){void 0===e&&(e=Nf);var r=Ef({},t,{theme:e}),o={};return n.forEach((function(e){var t,n,i,a=e;for(t in Pf(a)&&(a=a(r)),a)r[t]=o[t]="className"===t?(n=o[t],i=a[t],n&&i?n+" "+i:n||i):a[t]})),[r,o]}(function(e,t,n){return void 0===n&&(n=Nf),e.theme!==n.theme&&e.theme||t||n.theme}(t,(0,v.useContext)(jd),a)||Nf,t,o),d=f[0],p=f[1],m=function(e,t,n,r){var o=vd(),i=(0,v.useContext)(dd)||md;return t?e.generateAndInjectStyles(Nf,o,i):e.generateAndInjectStyles(n,o,i)}(i,r,d),h=n,g=p.$as||t.$as||p.as||t.as||u,y=Md(g),b=p!==t?Ef({},t,{},p):t,w={};for(var C in b)"$"!==C[0]&&"as"!==C&&("forwardedAs"===C?w.as=b[C]:(c?c(C,wf,g):!y||wf(C))&&(w[C]=b[C]));return t.style&&p.style!==t.style&&(w.style=Ef({},t.style,{},p.style)),w.className=Array.prototype.concat(l,s,m!==s?m:null,t.className,p.className).filter(Boolean).join(" "),w.ref=h,(0,v.createElement)(g,w)}(m,e,t,y)};return b.displayName=u,(m=h().forwardRef(b)).attrs=d,m.componentStyle=g,m.displayName=u,m.shouldForwardProp=p,m.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):Of,m.styledComponentId=f,m.target=r?e.target:e,m.withComponent=function(e){var r=t.componentId,o=function(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r=0||(o[n]=e[n]);return o}(t,["componentId"]),i=r&&r+"-"+(Md(e)?e:Ad(Af(e)));return Dd(e,Ef({},o,{attrs:d,componentId:i}),n)},Object.defineProperty(m,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?Id({},e.defaultProps,t):t}}),m.toString=function(){return"."+m.styledComponentId},o&&xf()(m,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),m}var Vd=function(e){return function e(t,n,r){if(void 0===r&&(r=Nf),!(0,hf.isValidElementType)(n))return If(1,String(n));var o=function(){return t(n,r,Od.apply(void 0,arguments))};return o.withConfig=function(o){return e(t,n,Ef({},r,{},o))},o.attrs=function(o){return e(t,n,Ef({},r,{attrs:Array.prototype.concat(r.attrs,o).filter(Boolean)}))},o}(Dd,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach((function(e){Vd[e]=Vd(e)})),function(){var e=function(e,t){this.rules=e,this.componentId=t,this.isStatic=id(e),Jf.registerId(this.componentId+1)}.prototype;e.createStyles=function(e,t,n,r){var o=r(kd(this.rules,t,n,r).join(""),""),i=this.componentId+e;n.insertRules(i,i,o)},e.removeStyles=function(e,t){t.clearRules(this.componentId+e)},e.renderStyles=function(e,t,n,r){e>2&&Jf.registerId(this.componentId+e),this.removeStyles(e,n),this.createStyles(e,t,n,r)}}(),function(){var e=function(){var e=this;this._emitSheetCSS=function(){var t=e.instance.toString();if(!t)return"";var n=qf();return""},this.getStyleTags=function(){return e.sealed?If(2):e._emitSheetCSS()},this.getStyleElement=function(){var t;if(e.sealed)return If(2);var n=((t={})[Rf]="",t["data-styled-version"]="5.3.5",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),r=qf();return r&&(n.nonce=r),[h().createElement("style",Ef({},n,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new Jf({isServer:!0}),this.sealed=!1}.prototype;e.collectStyles=function(e){return this.sealed?If(2):h().createElement(hd,{sheet:this.instance},e)},e.interleaveWithNodeStream=function(e){return If(3)}}();var Ld=Vd,zd={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0051.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z"}},{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"check-circle",theme:"outlined"},Hd=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:zd}))};Hd.displayName="CheckCircleOutlined";var $d=v.forwardRef(Hd),Wd={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 00-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z"}},{tag:"path",attrs:{d:"M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}}]},name:"close-circle",theme:"outlined"},Bd=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Wd}))};Bd.displayName="CloseCircleOutlined";var Ud=v.forwardRef(Bd),qd={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 688a48 48 0 1096 0 48 48 0 10-96 0zm24-112h48c4.4 0 8-3.6 8-8V296c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8z"}}]},name:"exclamation-circle",theme:"outlined"},Kd=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:qd}))};Kd.displayName="ExclamationCircleOutlined";var Gd=v.forwardRef(Kd),Yd={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},Xd=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Yd}))};Xd.displayName="InfoCircleOutlined";var Qd,Zd=v.forwardRef(Xd),Jd=U({},ne),ep=Jd.version,tp=Jd.render,np=Jd.unmountComponentAtNode;try{Number((ep||"").split(".")[0])>=18&&(Qd=Jd.createRoot)}catch(Yh){}function rp(e){var t=Jd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===W(t)&&(t.usingClientEntryPoint=e)}var op="__rc_react_root__";function ip(_x){return ap.apply(this,arguments)}function ap(){return(ap=Yn(Kn().mark((function e(t){return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then((function(){var e;null===(e=t[op])||void 0===e||e.unmount(),delete t[op]})));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lp(e){np(e)}function cp(){return(cp=Yn(Kn().mark((function e(t){return Kn().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===Qd){e.next=2;break}return e.abrupt("return",ip(t));case 2:lp(t);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var sp=function(t){Z(r,t);var n=te(r);function r(){var e;K(this,r);for(var t=arguments.length,o=new Array(t),i=0;i=i&&(o.key=l[0].notice.key,o.updateMark=mp(),o.userPassKey=r,l.shift()),l.push({notice:o,holderCallback:n})),{notices:l}}))},e.remove=function(t){e.setState((function(e){return{notices:e.notices.filter((function(e){var n=e.notice,r=n.key;return(n.userPassKey||r)!==t}))}}))},e.noticePropsMap={},e}return Y(r,[{key:"getTransitionName",value:function(){var e=this.props,t=e.prefixCls,n=e.animation,r=this.props.transitionName;return!r&&n&&(r="".concat(t,"-").concat(n)),r}},{key:"render",value:function(){var t=this,n=this.state.notices,r=this.props,o=r.prefixCls,i=r.className,a=r.closeIcon,l=r.style,c=[];return n.forEach((function(e,r){var i=e.notice,l=e.holderCallback,s=r===n.length-1?i.updateMark:void 0,u=i.key,f=i.userPassKey,d=U(U(U({prefixCls:o,closeIcon:a},i),i.props),{},{key:u,noticeKey:f||u,updateMark:s,onClose:function(e){var n;t.remove(e),null===(n=i.onClose)||void 0===n||n.call(i)},onClick:i.onClick,children:i.content});c.push(u),t.noticePropsMap[u]={props:d,holderCallback:l}})),v.createElement("div",{className:$()(o,i),style:l},v.createElement(ft,{keys:c,motionName:this.getTransitionName(),onVisibleChanged:function(e,n){var r=n.key;e||delete t.noticePropsMap[r]}},(function(n){var r=n.key,i=n.className,a=n.style,l=n.visible,c=t.noticePropsMap[r],s=c.props,u=c.holderCallback;return u?v.createElement("div",{key:r,className:$()(i,"".concat(o,"-hook-holder")),style:U({},a),ref:function(e){void 0!==r&&(e?(t.hookRefs.set(r,e),u(e,s)):t.hookRefs.delete(r))}}):v.createElement(sp,e({},s,{className:$()(i,null==s?void 0:s.className),style:U(U({},a),null==s?void 0:s.style),visible:l}))})))}}]),r}(v.Component);vp.newInstance=void 0,vp.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}},vp.newInstance=function(t,n){var r=t||{},o=r.getContainer,i=q(r,fp),a=document.createElement("div");o?o().appendChild(a):document.body.appendChild(a);var l,c,s=!1;l=v.createElement(vp,e({},i,{ref:function(e){s||(s=!0,n({notice:function(t){e.add(t)},removeNotice:function(t){e.remove(t)},component:e,destroy:function(){!function(e){cp.apply(this,arguments)}(a),a.parentNode&&a.parentNode.removeChild(a)},useNotification:function(){return up(e)}}))}})),c=a,Qd?function(e,t){rp(!0);var n=t[op]||Qd(t);rp(!1),n.render(e),t[op]=n}(l,c):function(e,t){tp(e,t)}(l,c)};var hp=vp,gp=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function yp(e,t){if(e.length!==t.length)return!1;for(var n=0;n>16,g:(65280&e)>>8,b:255&e}}(t)),this.originalInput=t;var o=So(t);this.originalInput=t,this.r=o.r,this.g=o.g,this.b=o.b,this.a=o.a,this.roundA=Math.round(100*this.a)/100,this.format=null!==(r=n.format)&&void 0!==r?r:o.format,this.gradientType=n.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=o.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},e.prototype.getLuminance=function(){var e=this.toRgb(),t=e.r/255,n=e.g/255,r=e.b/255;return.2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(e){return this.a=vo(e),this.roundA=Math.round(100*this.a)/100,this},e.prototype.toHsv=function(){var e=wo(this.r,this.g,this.b);return{h:360*e.h,s:e.s,v:e.v,a:this.a}},e.prototype.toHsvString=function(){var e=wo(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.v);return 1===this.a?"hsv("+t+", "+n+"%, "+r+"%)":"hsva("+t+", "+n+"%, "+r+"%, "+this.roundA+")"},e.prototype.toHsl=function(){var e=yo(this.r,this.g,this.b);return{h:360*e.h,s:e.s,l:e.l,a:this.a}},e.prototype.toHslString=function(){var e=yo(this.r,this.g,this.b),t=Math.round(360*e.h),n=Math.round(100*e.s),r=Math.round(100*e.l);return 1===this.a?"hsl("+t+", "+n+"%, "+r+"%)":"hsla("+t+", "+n+"%, "+r+"%, "+this.roundA+")"},e.prototype.toHex=function(e){return void 0===e&&(e=!1),Co(this.r,this.g,this.b,e)},e.prototype.toHexString=function(e){return void 0===e&&(e=!1),"#"+this.toHex(e)},e.prototype.toHex8=function(e){return void 0===e&&(e=!1),function(e,t,n,r,o){var i,a=[go(Math.round(e).toString(16)),go(Math.round(t).toString(16)),go(Math.round(n).toString(16)),go((i=r,Math.round(255*parseFloat(i)).toString(16)))];return o&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))&&a[3].startsWith(a[3].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0):a.join("")}(this.r,this.g,this.b,this.a,e)},e.prototype.toHex8String=function(e){return void 0===e&&(e=!1),"#"+this.toHex8(e)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var e=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return 1===this.a?"rgb("+e+", "+t+", "+n+")":"rgba("+e+", "+t+", "+n+", "+this.roundA+")"},e.prototype.toPercentageRgb=function(){var e=function(e){return Math.round(100*po(e,255))+"%"};return{r:e(this.r),g:e(this.g),b:e(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var e=function(e){return Math.round(100*po(e,255))};return 1===this.a?"rgb("+e(this.r)+"%, "+e(this.g)+"%, "+e(this.b)+"%)":"rgba("+e(this.r)+"%, "+e(this.g)+"%, "+e(this.b)+"%, "+this.roundA+")"},e.prototype.toName=function(){if(0===this.a)return"transparent";if(this.a<1)return!1;for(var e="#"+Co(this.r,this.g,this.b,!1),t=0,n=Object.entries(ko);t=0;return t||!r||!e.startsWith("hex")&&"name"!==e?("rgb"===e&&(n=this.toRgbString()),"prgb"===e&&(n=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(n=this.toHexString()),"hex3"===e&&(n=this.toHexString(!0)),"hex4"===e&&(n=this.toHex8String(!0)),"hex8"===e&&(n=this.toHex8String()),"name"===e&&(n=this.toName()),"hsl"===e&&(n=this.toHslString()),"hsv"===e&&(n=this.toHsvString()),n||this.toHexString()):"name"===e&&0===this.a?this.toName():this.toRgbString()},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l+=t/100,n.l=mo(n.l),new e(n)},e.prototype.brighten=function(t){void 0===t&&(t=10);var n=this.toRgb();return n.r=Math.max(0,Math.min(255,n.r-Math.round(-t/100*255))),n.g=Math.max(0,Math.min(255,n.g-Math.round(-t/100*255))),n.b=Math.max(0,Math.min(255,n.b-Math.round(-t/100*255))),new e(n)},e.prototype.darken=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.l-=t/100,n.l=mo(n.l),new e(n)},e.prototype.tint=function(e){return void 0===e&&(e=10),this.mix("white",e)},e.prototype.shade=function(e){return void 0===e&&(e=10),this.mix("black",e)},e.prototype.desaturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s-=t/100,n.s=mo(n.s),new e(n)},e.prototype.saturate=function(t){void 0===t&&(t=10);var n=this.toHsl();return n.s+=t/100,n.s=mo(n.s),new e(n)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(t){var n=this.toHsl(),r=(n.h+t)%360;return n.h=r<0?360+r:r,new e(n)},e.prototype.mix=function(t,n){void 0===n&&(n=50);var r=this.toRgb(),o=new e(t).toRgb(),i=n/100;return new e({r:(o.r-r.r)*i+r.r,g:(o.g-r.g)*i+r.g,b:(o.b-r.b)*i+r.b,a:(o.a-r.a)*i+r.a})},e.prototype.analogous=function(t,n){void 0===t&&(t=6),void 0===n&&(n=30);var r=this.toHsl(),o=360/n,i=[this];for(r.h=(r.h-(o*t>>1)+720)%360;--t;)r.h=(r.h+o)%360,i.push(new e(r));return i},e.prototype.complement=function(){var t=this.toHsl();return t.h=(t.h+180)%360,new e(t)},e.prototype.monochromatic=function(t){void 0===t&&(t=6);for(var n=this.toHsv(),r=n.h,o=n.s,i=n.v,a=[],l=1/t;t--;)a.push(new e({h:r,s:o,v:i})),i=(i+l)%1;return a},e.prototype.splitcomplement=function(){var t=this.toHsl(),n=t.h;return[this,new e({h:(n+72)%360,s:t.s,l:t.l}),new e({h:(n+216)%360,s:t.s,l:t.l})]},e.prototype.onBackground=function(t){var n=this.toRgb(),r=new e(t).toRgb();return new e({r:r.r+(n.r-r.r)*n.a,g:r.g+(n.g-r.g)*n.a,b:r.b+(n.b-r.b)*n.a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(t){for(var n=this.toHsl(),r=n.h,o=[this],i=360/t,a=1;a0&&(E=v.createElement(Ha,{validateMessages:k},o)),c&&(E=v.createElement(xp,{locale:c,_ANT_MARK__:"internalMark"},E)),(g||i)&&(E=v.createElement(fo.Provider,{value:x},E)),s&&(E=v.createElement(qr,{size:s},E)),void 0!==y&&(E=v.createElement(Wr,{disabled:y},E)),v.createElement(wr.Provider,{value:C},E)},om=function(t){return v.useEffect((function(){t.direction&&(Gp.config({rtl:"rtl"===t.direction}),Cm.config({rtl:"rtl"===t.direction}))}),[t.direction]),v.createElement(Eu,null,(function(n,__,r){return v.createElement(Cr,null,(function(n){return v.createElement(rm,e({parentContext:n,legacyLocale:r},t))}))}))};om.ConfigContext=wr,om.SizeContext=Kr,om.config=function(e){var t=e.prefixCls,n=e.iconPrefixCls,r=e.theme;void 0!==t&&(Qp=t),void 0!==n&&(Zp=n),r&&function(e,t){var n=function(e,t){var n={},r=function(e,t){var n=e.clone();return(n=(null==t?void 0:t(n))||n).toRgbString()},o=function(e,t){var o=new Yp(e),i=Vo(o.toRgbString());n["".concat(t,"-color")]=r(o),n["".concat(t,"-color-disabled")]=i[1],n["".concat(t,"-color-hover")]=i[4],n["".concat(t,"-color-active")]=i[7],n["".concat(t,"-color-outline")]=o.clone().setAlpha(.2).toRgbString(),n["".concat(t,"-color-deprecated-bg")]=i[1],n["".concat(t,"-color-deprecated-border")]=i[3]};if(t.primaryColor){o(t.primaryColor,"primary");var i=new Yp(t.primaryColor),a=Vo(i.toRgbString());a.forEach((function(e,t){n["primary-".concat(t+1)]=e})),n["primary-color-deprecated-l-35"]=r(i,(function(e){return e.lighten(35)})),n["primary-color-deprecated-l-20"]=r(i,(function(e){return e.lighten(20)})),n["primary-color-deprecated-t-20"]=r(i,(function(e){return e.tint(20)})),n["primary-color-deprecated-t-50"]=r(i,(function(e){return e.tint(50)})),n["primary-color-deprecated-f-12"]=r(i,(function(e){return e.setAlpha(.12*e.getAlpha())}));var l=new Yp(a[0]);n["primary-color-active-deprecated-f-30"]=r(l,(function(e){return e.setAlpha(.3*e.getAlpha())})),n["primary-color-active-deprecated-d-02"]=r(l,(function(e){return e.darken(2)}))}t.successColor&&o(t.successColor,"success"),t.warningColor&&o(t.warningColor,"warning"),t.errorColor&&o(t.errorColor,"error"),t.infoColor&&o(t.infoColor,"info");var c=Object.keys(n).map((function(t){return"--".concat(e,"-").concat(t,": ").concat(n[t],";")}));return"\n :root {\n ".concat(c.join("\n"),"\n }\n ").trim()}(e,t);ye()&&eo(n,"".concat(Xp,"-dynamic-theme"))}(em(),r)};var im,am,lm,cm=om,sm={},um=4.5,fm=24,dm=24,pm="",mm="topRight",vm=!1;function hm(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fm,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:dm;switch(e){case"top":t={left:"50%",transform:"translateX(-50%)",right:"auto",top:n,bottom:"auto"};break;case"topLeft":t={left:0,top:n,bottom:"auto"};break;case"topRight":t={right:0,top:n,bottom:"auto"};break;case"bottom":t={left:"50%",transform:"translateX(-50%)",right:"auto",top:"auto",bottom:r};break;case"bottomLeft":t={left:0,top:"auto",bottom:r};break;default:t={right:0,top:"auto",bottom:r}}return t}function gm(e,t){var n=e.placement,r=void 0===n?mm:n,o=e.top,i=e.bottom,a=e.getContainer,l=void 0===a?im:a,c=e.prefixCls,s=nm(),u=s.getPrefixCls,f=s.getIconPrefixCls,d=u("notification",c||pm),p=f(),m="".concat(d,"-").concat(r),v=sm[m];if(v)Promise.resolve(v).then((function(e){t({prefixCls:"".concat(d,"-notice"),iconPrefixCls:p,instance:e})}));else{var h=$()("".concat(d,"-").concat(r),j({},"".concat(d,"-rtl"),!0===vm));sm[m]=new Promise((function(e){hp.newInstance({prefixCls:d,className:h,style:hm(r,o,i),getContainer:l,maxCount:lm},(function(n){e(n),t({prefixCls:"".concat(d,"-notice"),iconPrefixCls:p,instance:n})}))}))}}var ym={success:$d,info:Zd,error:Ud,warning:Gd};function bm(e,t,n){var r=e.duration,o=e.icon,i=e.type,a=e.description,l=e.message,c=e.btn,s=e.onClose,u=e.onClick,f=e.key,d=e.style,p=e.className,m=e.closeIcon,h=void 0===m?am:m,g=void 0===r?um:r,y=null;o?y=v.createElement("span",{className:"".concat(t,"-icon")},e.icon):i&&(y=v.createElement(ym[i]||null,{className:"".concat(t,"-icon ").concat(t,"-icon-").concat(i)}));var b=v.createElement("span",{className:"".concat(t,"-close-x")},h||v.createElement(_u,{className:"".concat(t,"-close-icon")})),w=!a&&y?v.createElement("span",{className:"".concat(t,"-message-single-line-auto-margin")}):null;return{content:v.createElement(cm,{iconPrefixCls:n},v.createElement("div",{className:y?"".concat(t,"-with-icon"):"",role:"alert"},y,v.createElement("div",{className:"".concat(t,"-message")},w,l),v.createElement("div",{className:"".concat(t,"-description")},a),c?v.createElement("span",{className:"".concat(t,"-btn")},c):null)),duration:g,closable:!0,closeIcon:b,onClose:s,onClick:u,key:f,style:d||{},className:$()(p,j({},"".concat(t,"-").concat(i),!!i))}}var wm={open:function(e){gm(e,(function(t){var n=t.prefixCls,r=t.iconPrefixCls;t.instance.notice(bm(e,n,r))}))},close:function(e){Object.keys(sm).forEach((function(t){return Promise.resolve(sm[t]).then((function(t){t.removeNotice(e)}))}))},config:function(e){var t=e.duration,n=e.placement,r=e.bottom,o=e.top,i=e.getContainer,a=e.closeIcon,l=e.prefixCls;void 0!==l&&(pm=l),void 0!==t&&(um=t),void 0!==n?mm=n:e.rtl&&(mm="topLeft"),void 0!==r&&(dm=r),void 0!==o&&(fm=o),void 0!==i&&(im=i),void 0!==a&&(am=a),void 0!==e.rtl&&(vm=e.rtl),void 0!==e.maxCount&&(lm=e.maxCount)},destroy:function(){Object.keys(sm).forEach((function(e){Promise.resolve(sm[e]).then((function(e){e.destroy()})),delete sm[e]}))}};["success","info","warning","error"].forEach((function(t){wm[t]=function(n){return wm.open(e(e({},n),{type:t}))}})),wm.warn=wm.warning,wm.useNotification=function(t,n){return function(){var r,o=null,i=z(up({add:function(e,t){null==o||o.component.add(e,t)}}),2),a=i[0],l=i[1],c=v.useRef({});return c.current.open=function(i){var l=i.prefixCls,c=r("notification",l);t(e(e({},i),{prefixCls:c}),(function(e){var t=e.prefixCls,r=e.instance;o=r,a(n(i,t))}))},["success","info","warning","error"].forEach((function(t){c.current[t]=function(n){return c.current.open(e(e({},n),{type:t}))}})),[c.current,v.createElement(Cr,{key:"holder"},(function(e){return r=e.getPrefixCls,l}))]}}(gm,bm);var Cm=wm,xm=["children","locked"],Em=v.createContext(null);function km(e){var t=e.children,n=e.locked,r=q(e,xm),o=v.useContext(Em),i=pe((function(){return e=r,t=U({},o),Object.keys(e).forEach((function(n){var r=e[n];void 0!==r&&(t[n]=r)})),t;var e,t}),[o,r],(function(e,t){return!(n||e[0]===t[0]&&Bl()(e[1],t[1]))}));return v.createElement(Em.Provider,{value:i},t)}function Sm(e,t,n,r){var o=v.useContext(Em),i=o.activeKey,a=o.onActive,l=o.onInactive,c={active:i===e};return t||(c.onMouseEnter=function(t){null==n||n({key:e,domEvent:t}),a(e)},c.onMouseLeave=function(t){null==r||r({key:e,domEvent:t}),l(e)}),c}var Om=["item"];function Nm(e){var t=e.item,n=q(e,Om);return Object.defineProperty(n,"item",{get:function(){return Bo(!1,"`info.item` is deprecated since we will move to function component that not provides React Node instance in future."),t}}),n}function Pm(e){var t=e.icon,n=e.props,r=e.children;return("function"==typeof t?v.createElement(t,U({},n)):t)||r||null}function Am(e){var t=v.useContext(Em),n=t.mode,r=t.rtl,o=t.inlineIndent;return"inline"!==n?null:r?{paddingRight:e*o}:{paddingLeft:e*o}}var Mm=[],Rm=v.createContext(null);function Tm(){return v.useContext(Rm)}var Fm=v.createContext(Mm);function Im(e){var t=v.useContext(Fm);return v.useMemo((function(){return void 0!==e?[].concat(bi(t),[e]):t}),[t,e])}var jm=v.createContext(null),_m=v.createContext(null);function Dm(e,t){return void 0===e?null:"".concat(e,"-").concat(t)}function Vm(e){return Dm(v.useContext(_m),e)}var Lm=v.createContext({}),zm=["title","attribute","elementRef"],Hm=["style","className","eventKey","warnKey","disabled","itemIcon","children","role","onMouseEnter","onMouseLeave","onClick","onKeyDown","onFocus"],$m=["active"],Wm=function(t){Z(r,t);var n=te(r);function r(){return K(this,r),n.apply(this,arguments)}return Y(r,[{key:"render",value:function(){var t=this.props,n=t.title,r=t.attribute,o=t.elementRef,i=Hr(q(t,zm),["eventKey"]);return Bo(!r,"`attribute` of Menu.Item is deprecated. Please pass attribute directly."),v.createElement(Wc.Item,e({},r,{title:"string"==typeof n?n:void 0},i,{ref:o}))}}]),r}(v.Component),Bm=function(t){var n,r=t.style,o=t.className,i=t.eventKey,a=(t.warnKey,t.disabled),l=t.itemIcon,c=t.children,s=t.role,u=t.onMouseEnter,f=t.onMouseLeave,d=t.onClick,p=t.onKeyDown,m=t.onFocus,h=q(t,Hm),g=Vm(i),y=v.useContext(Em),b=y.prefixCls,w=y.onItemClick,C=y.disabled,x=y.overflowDisabled,E=y.itemIcon,k=y.selectedKeys,S=y.onActive,O=v.useContext(Lm)._internalRenderMenuItem,N="".concat(b,"-item"),P=v.useRef(),A=v.useRef(),M=C||a,R=Im(i),T=function(e){return{key:i,keyPath:bi(R).reverse(),item:P.current,domEvent:e}},F=l||E,I=Sm(i,M,u,f),_=I.active,D=q(I,$m),V=k.includes(i),L=Am(R.length),z={};"option"===t.role&&(z["aria-selected"]=V);var H=v.createElement(Wm,e({ref:P,elementRef:A,role:null===s?"none":s||"menuitem",tabIndex:a?null:-1,"data-menu-id":x&&g?null:g},h,D,z,{component:"li","aria-disabled":a,style:U(U({},L),r),className:$()(N,(n={},j(n,"".concat(N,"-active"),_),j(n,"".concat(N,"-selected"),V),j(n,"".concat(N,"-disabled"),M),n),o),onClick:function(e){if(!M){var t=T(e);null==d||d(Nm(t)),w(t)}},onKeyDown:function(e){if(null==p||p(e),e.which===dc.ENTER){var t=T(e);null==d||d(Nm(t)),w(t)}},onFocus:function(e){S(i),null==m||m(e)}}),c,v.createElement(Pm,{props:U(U({},t),{},{isSelected:V}),icon:F}));return O&&(H=O(H,t,{selected:V})),H},Um=function(e){var t=e.eventKey,n=Tm(),r=Im(t);return v.useEffect((function(){if(n)return n.registerPath(t,r),function(){n.unregisterPath(t,r)}}),[r]),n?null:v.createElement(Bm,e)},qm=["label","children","key","type"];function Km(e,t){return wi(e).map((function(e,n){if(v.isValidElement(e)){var r,o,i=e.key,a=null!==(r=null===(o=e.props)||void 0===o?void 0:o.eventKey)&&void 0!==r?r:i;null==a&&(a="tmp_key-".concat([].concat(bi(t),[n]).join("-")));var l={key:a,eventKey:a};return v.cloneElement(e,l)}return e}))}function Gm(t){return(t||[]).map((function(t,n){if(t&&"object"===W(t)){var r=t.label,o=t.children,i=t.key,a=t.type,l=q(t,qm),c=null!=i?i:"tmp-".concat(n);return o||"group"===a?"group"===a?v.createElement(_v,e({key:c},l,{title:r}),Gm(o)):v.createElement(fv,e({key:c},l,{title:r}),Gm(o)):"divider"===a?v.createElement(Dv,e({key:c},l)):v.createElement(Um,e({key:c},l),r)}return null})).filter((function(e){return e}))}function Ym(e,t,n){var r=e;return t&&(r=Gm(t)),Km(r,n)}function Xm(e){var t=v.useRef(e);t.current=e;var n=v.useCallback((function(){for(var e,n=arguments.length,r=new Array(n),o=0;o1&&(b.motionAppear=!1);var w=b.onVisibleChanged;return b.onVisibleChanged=function(e){return p.current||e||g(!0),null==w?void 0:w(e)},h?null:v.createElement(km,{mode:a,locked:!p.current},v.createElement(dt,e({visible:y},b,{forceRender:s,removeOnLeave:!1,leavedClassName:"".concat(c,"-hidden")}),(function(e){var t=e.className,r=e.style;return v.createElement(ev,{id:n,className:t,style:r},i)})))}var cv=["style","className","title","eventKey","warnKey","disabled","internalPopupClose","children","itemIcon","expandIcon","popupClassName","popupOffset","onClick","onMouseEnter","onMouseLeave","onTitleClick","onTitleMouseEnter","onTitleMouseLeave"],sv=["active"],uv=function(t){var n,r=t.style,o=t.className,i=t.title,a=t.eventKey,l=(t.warnKey,t.disabled),c=t.internalPopupClose,s=t.children,u=t.itemIcon,f=t.expandIcon,d=t.popupClassName,p=t.popupOffset,m=t.onClick,h=t.onMouseEnter,g=t.onMouseLeave,y=t.onTitleClick,b=t.onTitleMouseEnter,w=t.onTitleMouseLeave,C=q(t,cv),x=Vm(a),E=v.useContext(Em),k=E.prefixCls,S=E.mode,O=E.openKeys,N=E.disabled,P=E.overflowDisabled,A=E.activeKey,M=E.selectedKeys,R=E.itemIcon,T=E.expandIcon,F=E.onItemClick,I=E.onOpenChange,_=E.onActive,D=v.useContext(Lm)._internalRenderSubMenuItem,V=v.useContext(jm).isSubPathKey,L=Im(),H="".concat(k,"-submenu"),W=N||l,B=v.useRef(),K=v.useRef(),G=u||R,Y=f||T,X=O.includes(a),Q=!P&&X,Z=V(M,a),J=Sm(a,W,b,w),ee=J.active,te=q(J,sv),ne=z(v.useState(!1),2),re=ne[0],oe=ne[1],ie=function(e){W||oe(e)},ae=v.useMemo((function(){return ee||"inline"!==S&&(re||V([A],a))}),[S,ee,A,re,a,V]),le=Am(L.length),ce=Xm((function(e){null==m||m(Nm(e)),F(e)})),se=x&&"".concat(x,"-popup"),ue=v.createElement("div",e({role:"menuitem",style:le,className:"".concat(H,"-title"),tabIndex:W?null:-1,ref:B,title:"string"==typeof i?i:null,"data-menu-id":P&&x?null:x,"aria-expanded":Q,"aria-haspopup":!0,"aria-controls":se,"aria-disabled":W,onClick:function(e){W||(null==y||y({key:a,domEvent:e}),"inline"===S&&I(a,!X))},onFocus:function(){_(a)}},te),i,v.createElement(Pm,{icon:"horizontal"!==S?Y:null,props:U(U({},t),{},{isOpen:Q,isSubMenu:!0})},v.createElement("i",{className:"".concat(H,"-arrow")}))),fe=v.useRef(S);if("inline"!==S&&(fe.current=L.length>1?"vertical":S),!P){var de=fe.current;ue=v.createElement(av,{mode:de,prefixCls:H,visible:!c&&Q&&"inline"!==S,popupClassName:d,popupOffset:p,popup:v.createElement(km,{mode:"horizontal"===de?"vertical":de},v.createElement(ev,{id:se,ref:K},s)),disabled:W,onVisibleChange:function(e){"inline"!==S&&I(a,e)}},ue)}var pe=v.createElement(Wc.Item,e({role:"none"},C,{component:"li",style:r,className:$()(H,"".concat(H,"-").concat(S),o,(n={},j(n,"".concat(H,"-open"),Q),j(n,"".concat(H,"-active"),ae),j(n,"".concat(H,"-selected"),Z),j(n,"".concat(H,"-disabled"),W),n)),onMouseEnter:function(e){ie(!0),null==h||h({key:a,domEvent:e})},onMouseLeave:function(e){ie(!1),null==g||g({key:a,domEvent:e})}}),ue,!P&&v.createElement(lv,{id:se,open:Q,keyPath:L},s));return D&&(pe=D(pe,t,{selected:Z,active:ae,open:Q,disabled:W})),v.createElement(km,{onItemClick:ce,mode:"horizontal"===S?"vertical":S,itemIcon:G,expandIcon:Y},pe)};function fv(e){var t,n=e.eventKey,r=e.children,o=Im(n),i=Km(r,o),a=Tm();return v.useEffect((function(){if(a)return a.registerPath(n,o),function(){a.unregisterPath(n,o)}}),[o]),t=a?i:v.createElement(uv,e,i),v.createElement(Fm.Provider,{value:o},t)}function dv(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(ht(e)){var n=e.nodeName.toLowerCase(),r=["input","select","textarea","button"].includes(n)||e.isContentEditable||"a"===n&&!!e.getAttribute("href"),o=e.getAttribute("tabindex"),i=Number(o),a=null;return o&&!Number.isNaN(i)?a=i:r&&null===a&&(a=0),r&&e.disabled&&(a=null),null!==a&&(a>=0||t&&a<0)}return!1}function pv(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=bi(e.querySelectorAll("*")).filter((function(e){return dv(e,t)}));return dv(e,t)&&n.unshift(e),n}var mv=dc.LEFT,vv=dc.RIGHT,hv=dc.UP,gv=dc.DOWN,yv=dc.ENTER,bv=dc.ESC,wv=dc.HOME,Cv=dc.END,xv=[hv,gv,mv,vv];function Ev(e,t){return pv(e,!0).filter((function(e){return t.has(e)}))}function kv(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;if(!e)return null;var o=Ev(e,t),i=o.length,a=o.findIndex((function(e){return n===e}));return r<0?-1===a?a=i-1:a-=1:r>0&&(a+=1),o[a=(a+i)%i]}var Sv=Math.random().toFixed(5).toString().slice(2),Ov=0,Nv="__RC_UTIL_PATH_SPLIT__",Pv=function(e){return e.join(Nv)},Av="rc-menu-more";var Mv=["prefixCls","rootClassName","style","className","tabIndex","items","children","direction","id","mode","inlineCollapsed","disabled","disabledOverflow","subMenuOpenDelay","subMenuCloseDelay","forceSubMenuRender","defaultOpenKeys","openKeys","activeKey","defaultActiveFirst","selectable","multiple","defaultSelectedKeys","selectedKeys","onSelect","onDeselect","inlineIndent","motion","defaultMotions","triggerSubMenuAction","builtinPlacements","itemIcon","expandIcon","overflowedIndicator","overflowedIndicatorPopupClassName","getPopupContainer","onClick","onOpenChange","onKeyDown","openAnimation","openTransitionName","_internalRenderMenuItem","_internalRenderSubMenuItem"],Rv=[],Tv=v.forwardRef((function(t,n){var r,o,i=t.prefixCls,a=void 0===i?"rc-menu":i,l=t.rootClassName,c=t.style,s=t.className,u=t.tabIndex,f=void 0===u?0:u,d=t.items,p=t.children,m=t.direction,h=t.id,g=t.mode,y=void 0===g?"vertical":g,b=t.inlineCollapsed,w=t.disabled,C=t.disabledOverflow,x=t.subMenuOpenDelay,E=void 0===x?.1:x,k=t.subMenuCloseDelay,S=void 0===k?.1:k,O=t.forceSubMenuRender,N=t.defaultOpenKeys,P=t.openKeys,A=t.activeKey,M=t.defaultActiveFirst,R=t.selectable,T=void 0===R||R,F=t.multiple,I=void 0!==F&&F,_=t.defaultSelectedKeys,D=t.selectedKeys,V=t.onSelect,L=t.onDeselect,H=t.inlineIndent,W=void 0===H?24:H,B=t.motion,K=t.defaultMotions,G=t.triggerSubMenuAction,Y=void 0===G?"hover":G,X=t.builtinPlacements,Q=t.itemIcon,Z=t.expandIcon,J=t.overflowedIndicator,ee=void 0===J?"...":J,te=t.overflowedIndicatorPopupClassName,ne=t.getPopupContainer,re=t.onClick,oe=t.onOpenChange,ie=t.onKeyDown,ae=(t.openAnimation,t.openTransitionName,t._internalRenderMenuItem),le=t._internalRenderSubMenuItem,ce=q(t,Mv),ue=v.useMemo((function(){return Ym(p,d,Rv)}),[p,d]),fe=z(v.useState(!1),2),de=fe[0],pe=fe[1],me=v.useRef(),ve=function(e){var t=z(br(e,{value:e}),2),n=t[0],r=t[1];return v.useEffect((function(){Ov+=1;var e="".concat(Sv,"-").concat(Ov);r("rc-menu-uuid-".concat(e))}),[]),n}(h),he="rtl"===m,ge=z(v.useMemo((function(){return"inline"!==y&&"vertical"!==y||!b?[y,!1]:["vertical",b]}),[y,b]),2),ye=ge[0],be=ge[1],we=z(v.useState(0),2),Ce=we[0],xe=we[1],Ee=Ce>=ue.length-1||"horizontal"!==ye||C,ke=z(br(N,{value:P,postState:function(e){return e||Rv}}),2),Se=ke[0],Oe=ke[1],Ne=function(e){Oe(e),null==oe||oe(e)},Pe=z(v.useState(Se),2),Ae=Pe[0],Me=Pe[1],Re="inline"===ye,Te=v.useRef(!1);v.useEffect((function(){Re&&Me(Se)}),[Se]),v.useEffect((function(){Te.current?Re?Oe(Ae):Ne(Rv):Te.current=!0}),[Re]);var Fe=function(){var e=z(v.useState({}),2)[1],t=(0,v.useRef)(new Map),n=(0,v.useRef)(new Map),r=z(v.useState([]),2),o=r[0],i=r[1],a=(0,v.useRef)(0),l=(0,v.useRef)(!1),c=(0,v.useCallback)((function(r,o){var i=Pv(o);n.current.set(i,r),t.current.set(r,i),a.current+=1;var c,s=a.current;c=function(){s===a.current&&(l.current||e({}))},Promise.resolve().then(c)}),[]),s=(0,v.useCallback)((function(e,r){var o=Pv(r);n.current.delete(o),t.current.delete(e)}),[]),u=(0,v.useCallback)((function(e){i(e)}),[]),f=(0,v.useCallback)((function(e,n){var r=(t.current.get(e)||"").split(Nv);return n&&o.includes(r[0])&&r.unshift(Av),r}),[o]),d=(0,v.useCallback)((function(e,t){return e.some((function(e){return f(e,!0).includes(t)}))}),[f]),p=(0,v.useCallback)((function(e){var r="".concat(t.current.get(e)).concat(Nv),o=new Set;return bi(n.current.keys()).forEach((function(e){e.startsWith(r)&&o.add(n.current.get(e))})),o}),[]);return v.useEffect((function(){return function(){l.current=!0}}),[]),{registerPath:c,unregisterPath:s,refreshOverflowKeys:u,isSubPathKey:d,getKeyPath:f,getKeys:function(){var e=bi(t.current.keys());return o.length&&e.push(Av),e},getSubPathKeys:p}}(),Ie=Fe.registerPath,je=Fe.unregisterPath,_e=Fe.refreshOverflowKeys,De=Fe.isSubPathKey,Ve=Fe.getKeyPath,Le=Fe.getKeys,ze=Fe.getSubPathKeys,He=v.useMemo((function(){return{registerPath:Ie,unregisterPath:je}}),[Ie,je]),$e=v.useMemo((function(){return{isSubPathKey:De}}),[De]);v.useEffect((function(){_e(Ee?Rv:ue.slice(Ce+1).map((function(e){return e.key})))}),[Ce,Ee]);var We=z(br(A||M&&(null===(r=ue[0])||void 0===r?void 0:r.key),{value:A}),2),Be=We[0],Ue=We[1],qe=Xm((function(e){Ue(e)})),Ke=Xm((function(){Ue(void 0)}));(0,v.useImperativeHandle)(n,(function(){return{list:me.current,focus:function(e){var t,n,r,o,i=null!=Be?Be:null===(t=ue.find((function(e){return!e.props.disabled})))||void 0===t?void 0:t.key;i&&(null===(n=me.current)||void 0===n||null===(r=n.querySelector("li[data-menu-id='".concat(Dm(ve,i),"']")))||void 0===r||null===(o=r.focus)||void 0===o||o.call(r,e))}}}));var Ge=z(br(_||[],{value:D,postState:function(e){return Array.isArray(e)?e:null==e?Rv:[e]}}),2),Ye=Ge[0],Xe=Ge[1],Qe=Xm((function(e){null==re||re(Nm(e)),function(e){if(T){var t,n=e.key,r=Ye.includes(n);t=I?r?Ye.filter((function(e){return e!==n})):[].concat(bi(Ye),[n]):[n],Xe(t);var o=U(U({},e),{},{selectedKeys:t});r?null==L||L(o):null==V||V(o)}!I&&Se.length&&"inline"!==ye&&Ne(Rv)}(e)})),Ze=Xm((function(e,t){var n=Se.filter((function(t){return t!==e}));if(t)n.push(e);else if("inline"!==ye){var r=ze(e);n=n.filter((function(e){return!r.has(e)}))}Bl()(Se,n)||Ne(n)})),Je=Xm(ne),et=function(e,t,n,r,o,i,a,l,c,s){var u=v.useRef(),f=v.useRef();f.current=t;var d=function(){se.cancel(u.current)};return v.useEffect((function(){return function(){d()}}),[]),function(p){var m=p.which;if([].concat(xv,[yv,bv,wv,Cv]).includes(m)){var v,h,g,y=function(){return v=new Set,h=new Map,g=new Map,i().forEach((function(e){var t=document.querySelector("[data-menu-id='".concat(Dm(r,e),"']"));t&&(v.add(t),g.set(t,e),h.set(e,t))})),v};y();var b=function(e,t){for(var n=e||document.activeElement;n;){if(t.has(n))return n;n=n.parentElement}return null}(h.get(t),v),w=g.get(b),C=function(e,t,n,r){var o,i,a,l,c="prev",s="next",u="children",f="parent";if("inline"===e&&r===yv)return{inlineTrigger:!0};var d=(j(o={},hv,c),j(o,gv,s),o),p=(j(i={},mv,n?s:c),j(i,vv,n?c:s),j(i,gv,u),j(i,yv,u),i),m=(j(a={},hv,c),j(a,gv,s),j(a,yv,u),j(a,bv,f),j(a,mv,n?u:f),j(a,vv,n?f:u),a);switch(null===(l={inline:d,horizontal:p,vertical:m,inlineSub:d,horizontalSub:m,verticalSub:m}["".concat(e).concat(t?"":"Sub")])||void 0===l?void 0:l[r]){case c:return{offset:-1,sibling:!0};case s:return{offset:1,sibling:!0};case f:return{offset:-1,sibling:!1};case u:return{offset:1,sibling:!1};default:return null}}(e,1===a(w,!0).length,n,m);if(!C&&m!==wv&&m!==Cv)return;(xv.includes(m)||[wv,Cv].includes(m))&&p.preventDefault();var x=function(e){if(e){var t=e,n=e.querySelector("a");(null==n?void 0:n.getAttribute("href"))&&(t=n);var r=g.get(e);l(r),d(),u.current=se((function(){f.current===r&&t.focus()}))}};if([wv,Cv].includes(m)||C.sibling||!b){var E,k,S=Ev(E=b&&"inline"!==e?function(e){for(var t=e;t;){if(t.getAttribute("data-menu-list"))return t;t=t.parentElement}return null}(b):o.current,v);k=m===wv?S[0]:m===Cv?S[S.length-1]:kv(E,v,b,C.offset),x(k)}else if(C.inlineTrigger)c(w);else if(C.offset>0)c(w,!0),d(),u.current=se((function(){y();var e=b.getAttribute("aria-controls"),t=kv(document.getElementById(e),v);x(t)}),5);else if(C.offset<0){var O=a(w,!0),N=O[O.length-2],P=h.get(N);c(N,!1),x(P)}}null==s||s(p)}}(ye,Be,he,ve,me,Le,Ve,Ue,(function(e,t){var n=null!=t?t:!Se.includes(e);Ze(e,n)}),ie);v.useEffect((function(){pe(!0)}),[]);var tt=v.useMemo((function(){return{_internalRenderMenuItem:ae,_internalRenderSubMenuItem:le}}),[ae,le]),nt="horizontal"!==ye||C?ue:ue.map((function(e,t){return v.createElement(km,{key:e.key,overflowDisabled:t>Ce},e)})),rt=v.createElement(Wc,e({id:h,ref:me,prefixCls:"".concat(a,"-overflow"),component:"ul",itemComponent:Um,className:$()(a,"".concat(a,"-root"),"".concat(a,"-").concat(ye),s,(o={},j(o,"".concat(a,"-inline-collapsed"),be),j(o,"".concat(a,"-rtl"),he),o),l),dir:m,style:c,role:"menu",tabIndex:f,data:nt,renderRawItem:function(e){return e},renderRawRest:function(e){var t=e.length,n=t?ue.slice(-t):null;return v.createElement(fv,{eventKey:Av,title:ee,disabled:Ee,internalPopupClose:0===t,popupClassName:te},n)},maxCount:"horizontal"!==ye||C?Wc.INVALIDATE:Wc.RESPONSIVE,ssr:"full","data-menu-list":!0,onVisibleChange:function(e){xe(e)},onKeyDown:et},ce));return v.createElement(Lm.Provider,{value:tt},v.createElement(_m.Provider,{value:ve},v.createElement(km,{prefixCls:a,rootClassName:l,mode:ye,openKeys:Se,rtl:he,disabled:w,motion:de?B:null,defaultMotions:de?K:null,activeKey:Be,onActive:qe,onInactive:Ke,selectedKeys:Ye,inlineIndent:W,subMenuOpenDelay:E,subMenuCloseDelay:S,forceSubMenuRender:O,builtinPlacements:X,triggerSubMenuAction:Y,getPopupContainer:Je,itemIcon:Q,expandIcon:Z,onItemClick:Qe,onOpenChange:Ze},v.createElement(jm.Provider,{value:$e},rt),v.createElement("div",{style:{display:"none"},"aria-hidden":!0},v.createElement(Rm.Provider,{value:He},ue)))))})),Fv=["className","title","eventKey","children"],Iv=["children"],jv=function(t){var n=t.className,r=t.title,o=(t.eventKey,t.children),i=q(t,Fv),a=v.useContext(Em).prefixCls,l="".concat(a,"-item-group");return v.createElement("li",e({},i,{onClick:function(e){return e.stopPropagation()},className:$()(l,n)}),v.createElement("div",{className:"".concat(l,"-title"),title:"string"==typeof r?r:void 0},r),v.createElement("ul",{className:"".concat(l,"-list")},o))};function _v(e){var t=e.children,n=q(e,Iv),r=Km(t,Im(n.eventKey));return Tm()?r:v.createElement(jv,Hr(n,["warnKey"]),r)}function Dv(e){var t=e.className,n=e.style,r=v.useContext(Em).prefixCls;return Tm()?null:v.createElement("li",{className:$()("".concat(r,"-item-divider"),t),style:n})}var Vv=Im,Lv=Tv;Lv.Item=Um,Lv.SubMenu=fv,Lv.ItemGroup=_v,Lv.Divider=Dv;var zv=Lv,Hv=v.createContext({}),$v=function(t){var n=t.prefixCls,r=t.className,o=t.dashed,i=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=0?"".concat(e,"-slide-down"):"".concat(e,"-slide-up")}(),trigger:w,overlay:function(){var e,n=t.overlay;return e="function"==typeof n?n():n,e=v.Children.only("string"==typeof e?v.createElement("span",null,e):e),v.createElement(Yv,{prefixCls:"".concat(g,"-menu"),expandIcon:v.createElement("span",{className:"".concat(g,"-menu-submenu-arrow")},v.createElement(uh,{className:"".concat(g,"-menu-submenu-arrow-icon")})),mode:"vertical",selectable:!1,onClick:P,validator:function(e){e.mode}},e)},placement:(C=t.placement,C?C.includes("Center")?C.slice(0,C.indexOf("Center")):C:"rtl"===a?"bottomRight":"bottomLeft"),onVisibleChange:S}),b)});xh.Button=Ch,xh.defaultProps={mouseEnterDelay:.15,mouseLeaveDelay:.1};var Eh=xh,kh=Eh,Sh=v.forwardRef((function(e,t){var n,r=e.prefixCls,o=e.forceRender,i=e.className,a=e.style,l=e.children,c=e.isActive,s=e.role,u=z(v.useState(c||o),2),f=u[0],d=u[1];return v.useEffect((function(){(o||c)&&d(!0)}),[o,c]),f?v.createElement("div",{ref:t,className:$()("".concat(r,"-content"),(n={},j(n,"".concat(r,"-content-active"),c),j(n,"".concat(r,"-content-inactive"),!c),n),i),style:a,role:s},v.createElement("div",{className:"".concat(r,"-content-box")},l)):null}));Sh.displayName="PanelContent";var Oh=Sh,Nh=function(t){Z(r,t);var n=te(r);function r(){var e;K(this,r);for(var t=arguments.length,o=new Array(t),i=0;i-1?t.splice(n,1):t.push(e)}r.setActiveKey(t)},r.getNewChild=function(e,t){if(!e)return null;var n=r.state.activeKey,o=r.props,i=o.prefixCls,a=o.openMotion,l=o.accordion,c=o.destroyInactivePanel,s=o.expandIcon,u=o.collapsible,f=e.key||String(t),d=e.props,p=d.header,m=d.headerClass,h=d.destroyInactivePanel,g=d.collapsible,y=null!=g?g:u,b={key:f,panelKey:f,header:p,headerClass:m,isActive:l?n[0]===f:n.indexOf(f)>-1,prefixCls:i,destroyInactivePanel:null!=h?h:c,openMotion:a,accordion:l,children:e.props.children,onItemClick:"disabled"===y?null:r.onClickItem,expandIcon:s,collapsible:y};return"string"==typeof e.type?e:(Object.keys(b).forEach((function(e){void 0===b[e]&&delete b[e]})),v.cloneElement(e,b))},r.getItems=function(){return wi(r.props.children).map(r.getNewChild)},r.setActiveKey=function(e){"activeKey"in r.props||r.setState({activeKey:e}),r.props.onChange(r.props.accordion?e[0]:e)};var o=e.activeKey,i=e.defaultActiveKey;return"activeKey"in e&&(i=o),r.state={activeKey:Ah(i)},r}return Y(n,[{key:"shouldComponentUpdate",value:function(e,t){return!Bl()(this.props,e)||!Bl()(this.state,t)}},{key:"render",value:function(){var e,t=this.props,n=t.prefixCls,r=t.className,o=t.style,i=t.accordion,a=$()((j(e={},n,!0),j(e,r,!!r),e));return v.createElement("div",{className:a,style:o,role:i?"tablist":null},this.getItems())}}],[{key:"getDerivedStateFromProps",value:function(e){var t={};return"activeKey"in e&&(t.activeKey=Ah(e.activeKey)),t}}]),n}(v.Component);Mh.defaultProps={prefixCls:"rc-collapse",onChange:function(){},accordion:!1,destroyInactivePanel:!1},Mh.Panel=Ph;var Rh=Mh,Th=(Mh.Panel,function(t){var n,r=v.useContext(wr),o=r.getPrefixCls,i=r.direction,a=t.prefixCls,l=t.className,c=void 0===l?"":l,s=t.bordered,u=void 0===s||s,f=t.ghost,d=t.expandIconPosition,p=void 0===d?"start":d,m=o("collapse",a),h=v.useMemo((function(){return"left"===p?"start":"right"===p?"end":p}),[p]),g=$()("".concat(m,"-icon-position-").concat(h),(j(n={},"".concat(m,"-borderless"),!u),j(n,"".concat(m,"-rtl"),"rtl"===i),j(n,"".concat(m,"-ghost"),!!f),n),c),y=e(e({},Mr),{motionAppear:!1,leavedClassName:"".concat(m,"-content-hidden")});return v.createElement(Rh,e({openMotion:y},t,{expandIcon:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.expandIcon,r=n?n(e):v.createElement(uh,{rotate:e.isActive?90:void 0});return Dr(r,(function(){return{className:$()(r.props.className,"".concat(m,"-arrow"))}}))},prefixCls:m,className:g}),wi(t.children).map((function(t,n){var r;if(null===(r=t.props)||void 0===r?void 0:r.disabled){var o=t.key||String(n),i=t.props,a=i.disabled,l=i.collapsible;return Dr(t,e(e({},Hr(t.props,["disabled"])),{key:o,collapsible:null!=l?l:a?"disabled":void 0}))}return t})))});Th.Panel=function(t){var n=v.useContext(wr).getPrefixCls,r=t.prefixCls,o=t.className,i=void 0===o?"":o,a=t.showArrow,l=void 0===a||a,c=n("collapse",r),s=$()(j({},"".concat(c,"-no-arrow"),!l),i);return v.createElement(Rh.Panel,e({},t,{prefixCls:c,className:s}))};var Fh=Th,Ih={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"},jh=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Ih}))};jh.displayName="CopyOutlined";var _h=v.forwardRef(jh),Dh={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},Vh=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Dh}))};Vh.displayName="MoreOutlined";var Lh=v.forwardRef(Vh);const{hooks:zh}=wpGraphiQL,{useEffect:Hh}=wp.element,$h=Ld.div` - .ant-collapse { - margin-bottom: 10px; - } - .ant-collapse-content { - padding-left: 15px; - padding-top: 0px; - max-height: 450px; - overflow-y: scroll; - } - .ant-collapse-content-box { - padding: 0; - } -`;var Wh=e=>{var n,r;let o;const{index:i}=e,a=(t,n)=>{let r,i=e.definition;if(0===i.selectionSet.selections.length&&o&&(i=o),"FragmentDefinition"===i.kind)r={...i,selectionSet:{...i.selectionSet,selections:t}};else if("OperationDefinition"===i.kind){let e=t.filter((e=>!("Field"===e.kind&&"__typename"===e.name.value)));0===e.length&&(e=[{kind:"Field",name:{kind:"Name",value:"__typename ## Placeholder value"}}]),r={...i,selectionSet:{...i.selectionSet,selections:e}}}return o=r,e.onEdit(r,n)};Hh((()=>{Cm.config({top:50,placement:"topRight",getContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0]})}));const{operationType:l,definition:c,schema:s,getDefaultFieldNames:u,styleConfig:f}=e,d=(()=>{const{operationType:t,name:n}=e;return`${t}-${n||"unknown"}`})(),p=e.fields||{},m=c.selectionSet.selections,v=e.name||`${N(l)} Name`,h={clone:(0,t.createElement)(Jv.Item,{key:"clone"},(0,t.createElement)(hi,{type:"link",style:{marginRight:5},onClick:t=>{t.preventDefault(),t.stopPropagation(),e.onOperationClone(),Cm.success({message:`${N(l)} "${v}" was cloned`})},icon:(0,t.createElement)(_h,null)},`Clone ${N(l)}`)),destroy:(0,t.createElement)(Jv.Item,{key:"destroy"},(0,t.createElement)(lh,{zIndex:1e4,getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0],title:`Are you sure you want to delete ${N(l)} "${v}"`,onCancel:e=>{e.preventDefault(),e.stopPropagation()},onConfirm:t=>{t.preventDefault(),t.stopPropagation(),e.onOperationDestroy(),Cm.success({message:`${N(l)} "${v}" was deleted`})}},(0,t.createElement)(hi,{type:"link",onClick:e=>{e.preventDefault(),e.stopPropagation()},icon:(0,t.createElement)(Ud,null)},`Delete ${N(l)}`)))},g=zh.applyFilters("graphiql_explorer_operation_action_menu_items",h,{Menu:Jv,props:e});if(Object.keys(g).length<1)return null;const y=g&&Object.keys(g).length?Object.keys(g).map((e=>{var t;return null!==(t=g[e])&&void 0!==t?t:null})):null,b=(0,t.createElement)(Jv,null,y),w=(0,t.createElement)(kh,{overlay:b,arrow:!0,getPopupContainer:()=>window.document.getElementsByClassName("doc-explorer-app")[0]},(0,t.createElement)(hi,{type:"text",onClick:e=>e.stopPropagation()},(0,t.createElement)(Lh,null)));return(0,t.createElement)($h,{id:`collapse-wrap-${i}`},(0,t.createElement)("span",{id:`collapse-wrap-${d}`}),(0,t.createElement)(Fh,{key:`collapse-${i}`,id:`collapse-${i}`,tabIndex:"0",defaultActiveKey:0},(0,t.createElement)(Fh.Panel,{key:0,header:(0,t.createElement)("span",{style:{textOverflow:"ellipsis",display:"inline-block",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",verticalAlign:"middle",fontSize:"smaller",color:f.colors.keyword,paddingBottom:0},className:"graphiql-operation-title-bar"},l," ",(0,t.createElement)("span",{style:{color:f.colors.def}},(0,t.createElement)(rc,{id:`operationName-${i}`,name:"operation-name","data-lpignore":"true",defaultValue:null!==(n=e.name)&&void 0!==n?n:"",placeholder:null!==(r=e.name)&&void 0!==r?r:"name",onChange:t=>{var n;e.name!==t.target.value&&(n=t,e.onOperationRename(n.target.value))},value:e.name,onClick:e=>{e.stopPropagation(),e.preventDefault()},style:{color:f.colors.def,width:`${Math.max(15,v.length)}ch`,fontSize:"smaller"}}))),extra:w},(0,t.createElement)("div",{style:{padding:"10px 0 0 0"}},Object.keys(p).sort().map((n=>(0,t.createElement)(vf,{key:n,field:p[n],selections:m,modifySelections:a,schema:s,getDefaultFieldNames:u,getDefaultScalarArgValue:e.getDefaultScalarArgValue,makeDefaultArg:e.makeDefaultArg,onRunOperation:e.onRunOperation,styleConfig:e.styleConfig,onCommit:e.onCommit,definition:e.definition,availableFragments:e.availableFragments})))))))};function Bh(e){var t=z(v.useState(e),2),n=t[0],r=t[1];return v.useEffect((function(){var t=setTimeout((function(){r(e)}),e.length?0:10);return function(){clearTimeout(t)}}),[e]),n}var Uh=[];function qh(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{key:"string"==typeof e?e:"".concat(n,"-").concat(r),error:e,errorStatus:t}}function Kh(t){var n=t.help,r=t.helpStatus,o=t.errors,i=void 0===o?Uh:o,a=t.warnings,l=void 0===a?Uh:a,c=t.className,s=v.useContext(Qa).prefixCls,u=v.useContext(wr).getPrefixCls,f="".concat(s,"-item-explain"),d=u(),p=Bh(i),m=Bh(l),h=v.useMemo((function(){return null!=n?[qh(n,r,"help")]:[].concat(bi(p.map((function(e,t){return qh(e,"error","error",t)}))),bi(m.map((function(e,t){return qh(e,"warning","warning",t)}))))}),[n,r,p,m]);return v.createElement(dt,e({},Mr,{motionName:"".concat(d,"-show-help"),motionAppear:!1,motionEnter:!1,visible:!!h.length,onLeaveStart:function(e){return e.style.height="auto",{height:e.offsetHeight}}}),(function(t){var n=t.className,r=t.style;return v.createElement("div",{className:$()(f,n,c),style:r},v.createElement(ft,e({keys:h},Mr,{motionName:"".concat(d,"-show-help-item"),component:!1}),(function(e){var t=e.key,n=e.error,r=e.errorStatus,o=e.className,i=e.style;return v.createElement("div",{key:t,role:"alert",className:$()(o,j({},"".concat(f,"-").concat(r),r)),style:i},n)})))}))}function Gh(e){return"object"==typeof e&&null!=e&&1===e.nodeType}function Yh(e,t){return(!t||"hidden"!==e)&&"visible"!==e&&"clip"!==e}function Xh(e,t){if(e.clientHeightt||i>e&&a=t&&l>=n?i-e-r:a>t&&ln?a-t+o:0}function Zh(e,t){var n=window,r=t.scrollMode,o=t.block,i=t.inline,a=t.boundary,l=t.skipOverflowHiddenElements,c="function"==typeof a?a:function(e){return e!==a};if(!Gh(e))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,u=[],f=e;Gh(f)&&c(f);){if((f=f.parentElement)===s){u.push(f);break}null!=f&&f===document.body&&Xh(f)&&!Xh(document.documentElement)||null!=f&&Xh(f,l)&&u.push(f)}for(var d=n.visualViewport?n.visualViewport.width:innerWidth,p=n.visualViewport?n.visualViewport.height:innerHeight,m=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,h=e.getBoundingClientRect(),g=h.height,y=h.width,b=h.top,w=h.right,C=h.bottom,x=h.left,E="start"===o||"nearest"===o?b:"end"===o?C:b+g/2,k="center"===i?x+y/2:"end"===i?w:x,S=[],O=0;O=0&&x>=0&&C<=p&&w<=d&&b>=R&&C<=F&&x>=I&&w<=T)return S;var j=getComputedStyle(N),_=parseInt(j.borderLeftWidth,10),D=parseInt(j.borderTopWidth,10),V=parseInt(j.borderRightWidth,10),L=parseInt(j.borderBottomWidth,10),z=0,H=0,$="offsetWidth"in N?N.offsetWidth-N.clientWidth-_-V:0,W="offsetHeight"in N?N.offsetHeight-N.clientHeight-D-L:0;if(s===N)z="start"===o?E:"end"===o?E-p:"nearest"===o?Qh(v,v+p,p,D,L,v+E,v+E+g,g):E-p/2,H="start"===i?k:"center"===i?k-d/2:"end"===i?k-d:Qh(m,m+d,d,_,V,m+k,m+k+y,y),z=Math.max(0,z+v),H=Math.max(0,H+m);else{z="start"===o?E-R-D:"end"===o?E-F+L+W:"nearest"===o?Qh(R,F,A,D,L+W,E,E+g,g):E-(R+A/2)+W/2,H="start"===i?k-I-_:"center"===i?k-(I+M/2)+$/2:"end"===i?k-T+V+$:Qh(I,T,M,_,V+$,k,k+y,y);var B=N.scrollLeft,U=N.scrollTop;E+=U-(z=Math.max(0,Math.min(U+z,N.scrollHeight-A+W))),k+=B-(H=Math.max(0,Math.min(B+H,N.scrollWidth-M+$)))}S.push({el:N,top:z,left:H})}return S}function Jh(e){return e===Object(e)&&0!==Object.keys(e).length}var eg=function(e,t){var n=e.isConnected||e.ownerDocument.documentElement.contains(e);if(Jh(t)&&"function"==typeof t.behavior)return t.behavior(n?Zh(e,t):[]);if(n){var r=function(e){return!1===e?{block:"end",inline:"nearest"}:Jh(e)?e:{block:"start",inline:"nearest"}}(t);return function(e,t){void 0===t&&(t="auto");var n="scrollBehavior"in document.body.style;e.forEach((function(e){var r=e.el,o=e.top,i=e.left;r.scroll&&n?r.scroll({top:o,left:i,behavior:t}):(r.scrollTop=o,r.scrollLeft=i)}))}(Zh(e,r),r.behavior)}},tg=["parentNode"];function ng(e){return void 0===e||!1===e?[]:Array.isArray(e)?e:[e]}function rg(e,t){if(e.length){var n=e.join("_");return t?"".concat(t,"_").concat(n):tg.indexOf(n)>=0?"".concat("form_item","_").concat(n):n}}function og(e){return ng(e).join("_")}function ig(t){var n=z(La(),1)[0],r=v.useRef({}),o=v.useMemo((function(){return null!=t?t:e(e({},n),{__INTERNAL__:{itemRef:function(e){return function(t){var n=og(e);t?r.current[n]=t:delete r.current[n]}}},scrollToField:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=ng(t),i=rg(r,o.__INTERNAL__.name),a=i?document.getElementById(i):null;a&&eg(a,e({scrollMode:"if-needed",block:"nearest"},n))},getFieldInstance:function(e){var t=og(e);return r.current[t]}})}),[t,n]);return[o]}var ag,lg=function(t,n){var r,o=v.useContext(Kr),i=v.useContext(Br),a=v.useContext(wr),l=a.getPrefixCls,c=a.direction,s=a.form,u=t.prefixCls,f=t.className,d=void 0===f?"":f,p=t.size,m=void 0===p?o:p,h=t.disabled,g=void 0===h?i:h,y=t.form,b=t.colon,w=t.labelAlign,C=t.labelWrap,x=t.labelCol,E=t.wrapperCol,k=t.hideRequiredMark,S=t.layout,O=void 0===S?"horizontal":S,N=t.scrollToFirstError,P=t.requiredMark,A=t.onFinishFailed,M=t.name,R=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o=1},subscribe:function(e){return fg.size||this.register(),dg+=1,fg.set(dg,e),e(pg),dg},unsubscribe:function(e){fg.delete(e),fg.size||this.unregister()},unregister:function(){var e=this;Object.keys(ug).forEach((function(t){var n=ug[t],r=e.matchHandlers[n];null==r||r.mql.removeListener(null==r?void 0:r.listener)})),fg.clear()},register:function(){var t=this;Object.keys(ug).forEach((function(n){var r=ug[n],o=function(r){var o=r.matches;t.dispatch(e(e({},pg),j({},n,o)))},i=window.matchMedia(r);i.addListener(o),t.matchHandlers[r]={mql:i,listener:o},o(i)}))}},vg=mg,hg=(0,v.createContext)({}),gg=(xr("top","middle","bottom","stretch"),xr("start","end","center","space-around","space-between","space-evenly"),v.forwardRef((function(t,n){var r,o=t.prefixCls,i=t.justify,a=t.align,l=t.className,c=t.style,s=t.children,u=t.gutter,f=void 0===u?0:u,d=t.wrap,p=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0?S[0]/-2:void 0,A=null!=S[1]&&S[1]>0?S[1]/-2:void 0;if(P&&(N.marginLeft=P,N.marginRight=P),C){var M=z(S,2);N.rowGap=M[1]}else A&&(N.marginTop=A,N.marginBottom=A);var R=z(S,2),T=R[0],F=R[1],I=v.useMemo((function(){return{gutter:[T,F],wrap:d,supportFlexGap:C}}),[T,F,d,C]);return v.createElement(hg.Provider,{value:I},v.createElement("div",e({},p,{className:O,style:e(e({},N),c),ref:n}),s))}))),yg=gg,bg=["xs","sm","md","lg","xl","xxl"],wg=v.forwardRef((function(t,n){var r,o=v.useContext(wr),i=o.getPrefixCls,a=o.direction,l=v.useContext(hg),c=l.gutter,s=l.wrap,u=l.supportFlexGap,f=t.prefixCls,d=t.span,p=t.order,m=t.offset,h=t.push,g=t.pull,y=t.className,b=t.children,w=t.flex,C=t.style,x=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o0){var N=c[0]/2;O.paddingLeft=N,O.paddingRight=N}if(c&&c[1]>0&&!u){var P=c[1]/2;O.paddingTop=P,O.paddingBottom=P}return w&&(O.flex=function(e){return"number"==typeof e?"".concat(e," ").concat(e," auto"):/^\d+(\.\d+)?(px|em|rem|%)$/.test(e)?"0 0 ".concat(e):e}(w),!1!==s||O.minWidth||(O.minWidth=0)),v.createElement("div",e({},x,{style:e(e({},O),C),className:S,ref:n}),b)})),Cg=wg,xg=function(t){var n=t.prefixCls,r=t.status,o=t.wrapperCol,i=t.children,a=t.errors,l=t.warnings,c=t._internalItemRender,s=t.extra,u=t.help,f="".concat(n,"-item"),d=v.useContext(Ya),p=o||d.wrapperCol||{},m=$()("".concat(f,"-control"),p.className),h=v.useMemo((function(){return e({},d)}),[d]);delete h.labelCol,delete h.wrapperCol;var g=v.createElement("div",{className:"".concat(f,"-control-input")},v.createElement("div",{className:"".concat(f,"-control-input-content")},i)),y=v.useMemo((function(){return{prefixCls:n,status:r}}),[n,r]),b=v.createElement(Qa.Provider,{value:y},v.createElement(Kh,{errors:a,warnings:l,help:u,helpStatus:r,className:"".concat(f,"-explain-connected")})),w=s?v.createElement("div",{className:"".concat(f,"-extra")},s):null,C=c&&"pro_table_render"===c.mark&&c.render?c.render(t,{input:g,errorList:b,extra:w}):v.createElement(v.Fragment,null,g,b,w);return v.createElement(Ya.Provider,{value:h},v.createElement(Cg,e({},p,{className:m}),C))},Eg={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M623.6 316.7C593.6 290.4 554 276 512 276s-81.6 14.5-111.6 40.7C369.2 344 352 380.7 352 420v7.6c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V420c0-44.1 43.1-80 96-80s96 35.9 96 80c0 31.1-22 59.6-56.1 72.7-21.2 8.1-39.2 22.3-52.1 40.9-13.1 19-19.9 41.8-19.9 64.9V620c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8v-22.7a48.3 48.3 0 0130.9-44.8c59-22.7 97.1-74.7 97.1-132.5.1-39.3-17.1-76-48.3-103.3zM472 732a40 40 0 1080 0 40 40 0 10-80 0z"}}]},name:"question-circle",theme:"outlined"},kg=function(e,t){return v.createElement(oi,U(U({},e),{},{ref:t,icon:Eg}))};kg.displayName="QuestionCircleOutlined";var Sg=v.forwardRef(kg),Og=function(t){var n,r,o,i=t.prefixCls,a=t.label,l=t.htmlFor,c=t.labelCol,s=t.labelAlign,u=t.colon,f=t.required,d=t.requiredMark,p=t.tooltip,m=z((n="Form",o=v.useContext(gu),[v.useMemo((function(){var t=xu.Form,n=o?o.Form:{};return e(e({},"function"==typeof t?t():t),n||{})}),[n,r,o])]),1)[0];return a?v.createElement(Ya.Consumer,{key:"label"},(function(t){var n,r,o=t.vertical,h=t.labelAlign,g=t.labelCol,y=t.labelWrap,b=t.colon,w=c||g||{},C=s||h,x="".concat(i,"-item-label"),E=$()(x,"left"===C&&"".concat(x,"-left"),w.className,j({},"".concat(x,"-wrap"),!!y)),k=a,S=!0===u||!1!==b&&!1!==u;S&&!o&&"string"==typeof a&&""!==a.trim()&&(k=a.replace(/[:|:]\s*$/,""));var O=function(e){return e?"object"!==W(e)||v.isValidElement(e)?{title:e}:e:null}(p);if(O){var N=O.icon,P=void 0===N?v.createElement(Sg,null):N,A=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{const{actionOptions:n,addOperation:r}=e,o=45*n.length;return(0,t.createElement)(t.Fragment,null,(0,t.createElement)("div",{style:{padding:"10px 10px 0 10px",borderTop:"1px solid #ccc",overflowY:"hidden",minHeight:`${o}px`}},(0,t.createElement)(Mg,{name:"add-graphql-operation",className:"variable-editor-title graphiql-explorer-actions",layout:"inline",onSubmit:e=>e.preventDefault()},n.map(((e,n)=>{const{type:o}=e;return(0,t.createElement)(hi,{key:n,style:{marginBottom:"5px",textTransform:"capitalize"},block:!0,type:"primary",onClick:()=>r(o)},"Add New ",o)})))))};const{useAppContext:Tg}=wpGraphiQL,{GraphQLObjectType:Fg,print:Ig}=wpGraphiQL.GraphQL,{useState:jg,useEffect:_g,useRef:Dg}=wp.element;var Vg=e=>{const[n,r]=jg("query"),[o,i]=jg(null),[a,l]=jg(null);let c=Dg(null);_g((()=>{}));const s=e=>{},{schema:u,query:f}=Tg(),{makeDefaultArg:d}=e;if(!u)return(0,t.createElement)("div",{style:{fontFamily:"sans-serif"},className:"error-container"},"No Schema Available");const p={colors:e.colors||b,checkboxChecked:e.checkboxChecked||x,checkboxUnchecked:e.checkboxUnchecked||E,arrowClosed:e.arrowClosed||C,arrowOpen:e.arrowOpen||w,styles:e.styles?{...k,...e.styles}:k},m=u.getQueryType(),v=u.getMutationType(),h=u.getSubscriptionType();if(!m&&!v&&!h)return(0,t.createElement)("div",null,"Missing query type");const g=m&&m.getFields(),P=v&&v.getFields(),A=h&&h.getFields(),M=O(f),R=e.getDefaultFieldNames||y,T=e.getDefaultScalarArgValue||I,F=M.definitions.map((e=>"FragmentDefinition"===e.kind||"OperationDefinition"===e.kind?e:null)).filter(Boolean),j=0===F.length?S.definitions:F;let _=[];g&&_.push({type:"query",label:"Queries",fields:()=>g}),A&&_.push({type:"subscription",label:"Subscriptions",fields:()=>A}),P&&_.push({type:"mutation",label:"Mutations",fields:()=>P});const D=(0,t.createElement)(Rg,{query:f,actionOptions:_,addOperation:t=>{const n=M.definitions,r=1===M.definitions.length&&M.definitions[0]===S.definitions[0],o=r?[]:n.filter((e=>"OperationDefinition"===e.kind&&e.operation===t)),i=`My${N(t)}${0===o.length?"":o.length+1}`,a={kind:"OperationDefinition",operation:t,name:{kind:"Name",value:i},variableDefinitions:[],directives:[],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"__typename # Placeholder value",loc:null},arguments:[],directives:[],selectionSet:null,loc:null}],loc:null},loc:null},l=r?[a]:[...M.definitions,a],c={...M,definitions:l};e.onEdit(Ig(c))}}),V=j.reduce(((e,t)=>{if("FragmentDefinition"===t.kind){const n=t.typeCondition.name.value,r=[...e[n]||[],t].sort(((e,t)=>e.name.value.localeCompare(t.name.value)));return{...e,[n]:r}}return e}),{});return(0,t.createElement)("div",{ref:e=>{c=e},style:{fontSize:12,textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0,padding:0,fontFamily:'Consolas, Inconsolata, "Droid Sans Mono", Monaco, monospace',display:"flex",flexDirection:"column",height:"100%"},className:"graphiql-explorer-root antd-app"},(0,t.createElement)("div",{style:{flexGrow:1,overflowY:"scroll",width:"100%",padding:"8px"}},j.map(((n,r)=>{const o=n&&n.name&&n.name.value,i="FragmentDefinition"===n.kind?"fragment":n&&n.operation||"query",a="FragmentDefinition"===n.kind&&"NamedType"===n.typeCondition.kind&&u.getType(n.typeCondition.name.value),l=a instanceof Fg?a.getFields():null,c="query"===i?g:"mutation"===i?P:"subscription"===i?A:"FragmentDefinition"===n.kind?l:null,f="FragmentDefinition"===n.kind?n.typeCondition.name.value:null,m=t=>{const n=Ig(t);e.onEdit(n)};return(0,t.createElement)(Wh,{key:r,index:r,isLast:r===j.length-1,fields:c,operationType:i,name:o,definition:n,onOperationRename:t=>{const r=((e,t)=>{const n=null==t||""===t?null:{kind:"Name",value:t,loc:void 0},r={...e,name:n},o=M.definitions.map((t=>e===t?r:t));return{...M,definitions:o}})(n,t);e.onEdit(Ig(r))},onOperationDestroy:()=>{const t=(e=>{const t=M.definitions.filter((t=>e!==t));return{...M,definitions:t}})(n);e.onEdit(Ig(t))},onOperationClone:()=>{const t=(e=>{let t;t="FragmentDefinition"===e.kind?"fragment":e.operation;const n={kind:"Name",value:(e.name&&e.name.value||"")+"Copy",loc:void 0},r={...e,name:n},o=[...M.definitions,r];return{...M,definitions:o}})(n);e.onEdit(Ig(t))},onTypeName:f,onMount:s,onCommit:m,onEdit:(e,t)=>{let r;if(r="object"!=typeof t||void 0===t.commit||t.commit,e){const t={...M,definitions:M.definitions.map((t=>t===n?e:t))};return r?(m(t),t):t}return M},schema:u,getDefaultFieldNames:R,getDefaultScalarArgValue:T,makeDefaultArg:d,onRunOperation:()=>{e.onRunOperation&&e.onRunOperation(o)},styleConfig:p,availableFragments:V})}))),D)},Lg=function(e){var t,n;function r(t){var n;return(n=e.call(this,t)||this).state={hasError:!1,error:null},n}n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r.getDerivedStateFromError=function(e){return{hasError:!0,error:e}};var o=r.prototype;return o.componentDidCatch=function(e,t){return this.props.onDidCatch(e,t)},o.render=function(){var e=this.state,t=this.props,n=t.render,r=t.children,o=t.renderError;return e.hasError?o?o({error:e.error}):null:n?n():r||null},r}(v.PureComponent),zg=function(e,t){switch(t.type){case"catch":return{didCatch:!0,error:t.error};case"reset":return{didCatch:!1,error:null};default:return e}},Hg=e=>{let{children:n}=e;const{ErrorBoundary:r,didCatch:o,error:i}=function(e){var t=(0,v.useReducer)(zg,{didCatch:!1,error:null}),n=t[0],r=t[1],o=(0,v.useRef)(null);function i(){return t=function(t,n){r({type:"catch",error:t}),e&&e.onDidCatch&&e.onDidCatch(t,n)},function(e){return h().createElement(Lg,{onDidCatch:t,children:e.children,render:e.render,renderError:e.renderError})};var t}var a,l=(0,v.useCallback)((function(){o.current=i(),r({type:"reset"})}),[]);return{ErrorBoundary:(a=o.current,null!==a?a:(o.current=i(),o.current)),didCatch:n.didCatch,error:n.error,reset:l}}();return o&&console.warn({error:i}),o?(0,t.createElement)("div",{style:{padding:18,fontFamily:"sans-serif"}},(0,t.createElement)("div",null,"Something went wrong"),(0,t.createElement)("details",{style:{whiteSpace:"pre-wrap"}},i?i.message:null,(0,t.createElement)("br",null),i.stack?i.stack:null)):(0,t.createElement)(r,null,n)},$g=n(3279),Wg=n.n($g),Bg=(xr("small","default","large"),null),Ug=function(t){Z(r,t);var n=te(r);function r(t){var o;K(this,r),(o=n.call(this,t)).debouncifyUpdateSpinning=function(e){var t=(e||o.props).delay;t&&(o.cancelExistingSpin(),o.updateSpinning=Wg()(o.originalUpdateSpinning,t))},o.updateSpinning=function(){var e=o.props.spinning;o.state.spinning!==e&&o.setState({spinning:e})},o.renderSpin=function(t){var n,r=t.direction,i=o.props,a=i.spinPrefixCls,l=i.className,c=i.size,s=i.tip,u=i.wrapperClassName,f=i.style,d=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o{let{schema:n,children:r}=e;return n?(0,t.createElement)("div",{style:{fontSize:12,textOverflow:"ellipsis",whiteSpace:"nowrap",margin:0,padding:0,fontFamily:'Consolas, Inconsolata, "Droid Sans Mono", Monaco, monospace',display:"flex",flexDirection:"column",height:"100%"},className:"graphiql-explorer-root"},r):(0,t.createElement)("div",{style:{fontFamily:"sans-serif",textAlign:"center"},className:"error-container"},(0,t.createElement)(Kg,null))};var Zg=e=>{const{query:n,setQuery:r}=e,{schema:o}=Gg(),[i,a]=Yg(null);return Xg((()=>{const e=O(n);i!==e&&a(e)}),[n]),(0,t.createElement)(t.Fragment,null,(0,t.createElement)(p,null,(0,t.createElement)(Hg,null,(0,t.createElement)(Qg,{schema:o},(0,t.createElement)(Vg,{schema:o,query:n,onEdit:e=>{r(e)}})))))};function Jg(e,t){if(null==e)return e;if(0===e.length&&(!t||t&&""!==e))return null;var n=e instanceof Array?e[0]:e;return null==n||t||""!==n?n:null}var ey={encode:function(e){return null==e?e:String(e)},decode:function(e){var t=Jg(e,!0);return null==t?t:String(t)}},ty={encode:function(e){return null==e?e:e?"1":"0"},decode:function(e){var t=Jg(e);return null==t?t:"1"===t||"0"!==t&&null}},ny=n(7563);'{}[],":'.split("").map((function(e){return[e,encodeURIComponent(e)]})),Object.prototype.hasOwnProperty,v.createContext({location:{},getLocation:function(){return{}},setLocation:function(){}}),(0,ny.parse)("");const{hooks:ry}=window.wpGraphiQL;ry.addFilter("graphiql_toolbar_after_buttons","graphiql-extension",((e,n)=>{const{GraphiQL:r}=n,{toggleExplorer:o}=u();return e.push((0,t.createElement)(s.Consumer,{key:"graphiql-query-composer-button"},(e=>(0,t.createElement)(r.Button,{onClick:()=>{o()},label:"Query Composer",title:"Query Composer"})))),e})),ry.addFilter("graphiql_before_graphiql","graphiql-explorer",((n,r)=>(n.push((0,t.createElement)(Zg,e({},r,{key:"graphiql-explorer"}))),n))),ry.addFilter("graphiql_app","graphiql-explorer",((e,n)=>{let{appContext:r}=n;return(0,t.createElement)(f,{appContext:r},e)}),99),ry.addFilter("graphiql_query_params_provider_config","graphiql-explorer",(e=>({...e,isQueryComposerOpen:ty,explorerIsOpen:ey})))}()}(); \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/build/index.asset.php b/lib/wp-graphql-1.17.0/build/index.asset.php deleted file mode 100644 index a35ba105..00000000 --- a/lib/wp-graphql-1.17.0/build/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('wp-element', 'wp-hooks'), 'version' => '16cb921597c1ed7eed91'); diff --git a/lib/wp-graphql-1.17.0/build/index.js b/lib/wp-graphql-1.17.0/build/index.js deleted file mode 100644 index 52de03d8..00000000 --- a/lib/wp-graphql-1.17.0/build/index.js +++ /dev/null @@ -1 +0,0 @@ -!function(){"use strict";var e={755:function(e,n,t){t.d(n,{bp:function(){return a},iz:function(){return s}});var r=t(9307),i=t(6428);const o=(0,r.createContext)(),a=()=>(0,r.useContext)(o),s=e=>{let{children:n,setQueryParams:t,queryParams:a}=e;const[s,u]=(0,r.useState)(null),[c,p]=(0,r.useState)(null!==(l=null===(d=window)||void 0===d||null===(f=d.wpGraphiQLSettings)||void 0===f?void 0:f.nonce)&&void 0!==l?l:null);var l,d,f;const[y,m]=(0,r.useState)(null!==(h=null===(T=window)||void 0===T||null===(b=T.wpGraphiQLSettings)||void 0===b?void 0:b.graphqlEndpoint)&&void 0!==h?h:null);var h,T,b;const[v,g]=(0,r.useState)(a);let E={endpoint:y,setEndpoint:m,nonce:c,setNonce:p,schema:s,setSchema:u,queryParams:v,setQueryParams:e=>{g(e),t(e)}},N=i.P.applyFilters("graphiql_app_context",E);return(0,r.createElement)(o.Provider,{value:N},n)}},6428:function(e,n,t){t.d(n,{P:function(){return a}});var r=t(20),i=window.wp.hooks,o=t(755);const a=(0,i.createHooks)();window.wpGraphiQL={GraphQL:r,hooks:a,useAppContext:o.bp,AppContextProvider:o.iz}},5822:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.GraphQLError=void 0,n.formatError=function(e){return e.toJSON()},n.printError=function(e){return e.toString()};var r=t(5690),i=t(9016),o=t(8038);class a extends Error{constructor(e,...n){var t,o,u;const{nodes:c,source:p,positions:l,path:d,originalError:f,extensions:y}=function(e){const n=e[0];return null==n||"kind"in n||"length"in n?{nodes:n,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:n}(n);super(e),this.name="GraphQLError",this.path=null!=d?d:void 0,this.originalError=null!=f?f:void 0,this.nodes=s(Array.isArray(c)?c:c?[c]:void 0);const m=s(null===(t=this.nodes)||void 0===t?void 0:t.map((e=>e.loc)).filter((e=>null!=e)));this.source=null!=p?p:null==m||null===(o=m[0])||void 0===o?void 0:o.source,this.positions=null!=l?l:null==m?void 0:m.map((e=>e.start)),this.locations=l&&p?l.map((e=>(0,i.getLocation)(p,e))):null==m?void 0:m.map((e=>(0,i.getLocation)(e.source,e.start)));const h=(0,r.isObjectLike)(null==f?void 0:f.extensions)?null==f?void 0:f.extensions:void 0;this.extensions=null!==(u=null!=y?y:h)&&void 0!==u?u:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),null!=f&&f.stack?Object.defineProperty(this,"stack",{value:f.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let e=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(e+="\n\n"+(0,o.printLocation)(n.loc));else if(this.source&&this.locations)for(const n of this.locations)e+="\n\n"+(0,o.printSourceLocation)(this.source,n);return e}toJSON(){const e={message:this.message};return null!=this.locations&&(e.locations=this.locations),null!=this.path&&(e.path=this.path),null!=this.extensions&&Object.keys(this.extensions).length>0&&(e.extensions=this.extensions),e}}function s(e){return void 0===e||0===e.length?void 0:e}n.GraphQLError=a},6972:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"GraphQLError",{enumerable:!0,get:function(){return r.GraphQLError}}),Object.defineProperty(n,"formatError",{enumerable:!0,get:function(){return r.formatError}}),Object.defineProperty(n,"locatedError",{enumerable:!0,get:function(){return o.locatedError}}),Object.defineProperty(n,"printError",{enumerable:!0,get:function(){return r.printError}}),Object.defineProperty(n,"syntaxError",{enumerable:!0,get:function(){return i.syntaxError}});var r=t(5822),i=t(338),o=t(1993)},1993:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.locatedError=function(e,n,t){var o;const a=(0,r.toError)(e);return s=a,Array.isArray(s.path)?a:new i.GraphQLError(a.message,{nodes:null!==(o=a.nodes)&&void 0!==o?o:n,source:a.source,positions:a.positions,path:t,originalError:a});var s};var r=t(7729),i=t(5822)},338:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.syntaxError=function(e,n,t){return new r.GraphQLError(`Syntax Error: ${t}`,{source:e,positions:[n]})};var r=t(5822)},8950:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.collectFields=function(e,n,t,r,i){const o=new Map;return u(e,n,t,r,i,o,new Set),o},n.collectSubfields=function(e,n,t,r,i){const o=new Map,a=new Set;for(const s of i)s.selectionSet&&u(e,n,t,r,s.selectionSet,o,a);return o};var r=t(2828),i=t(5003),o=t(7197),a=t(5115),s=t(8840);function u(e,n,t,i,o,a,s){for(const d of o.selections)switch(d.kind){case r.Kind.FIELD:{if(!c(t,d))continue;const e=(l=d).alias?l.alias.value:l.name.value,n=a.get(e);void 0!==n?n.push(d):a.set(e,[d]);break}case r.Kind.INLINE_FRAGMENT:if(!c(t,d)||!p(e,d,i))continue;u(e,n,t,i,d.selectionSet,a,s);break;case r.Kind.FRAGMENT_SPREAD:{const r=d.name.value;if(s.has(r)||!c(t,d))continue;s.add(r);const o=n[r];if(!o||!p(e,o,i))continue;u(e,n,t,i,o.selectionSet,a,s);break}}var l}function c(e,n){const t=(0,s.getDirectiveValues)(o.GraphQLSkipDirective,n,e);if(!0===(null==t?void 0:t.if))return!1;const r=(0,s.getDirectiveValues)(o.GraphQLIncludeDirective,n,e);return!1!==(null==r?void 0:r.if)}function p(e,n,t){const r=n.typeCondition;if(!r)return!0;const o=(0,a.typeFromAST)(e,r);return o===t||!!(0,i.isAbstractType)(o)&&e.isSubType(o,t)}},192:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.assertValidExecutionArguments=_,n.buildExecutionContext=L,n.buildResolveInfo=A,n.defaultTypeResolver=n.defaultFieldResolver=void 0,n.execute=O,n.executeSync=function(e){const n=O(e);if((0,u.isPromise)(n))throw new Error("GraphQL execution failed to complete synchronously.");return n},n.getFieldDef=V;var r=t(7242),i=t(8002),o=t(7706),a=t(6609),s=t(5690),u=t(4221),c=t(5456),p=t(7059),l=t(3179),d=t(9915),f=t(5822),y=t(1993),m=t(1807),h=t(2828),T=t(5003),b=t(8155),v=t(1671),g=t(8950),E=t(8840);const N=(0,c.memoize3)(((e,n,t)=>(0,g.collectSubfields)(e.schema,e.fragments,e.variableValues,n,t)));function O(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:n,document:t,variableValues:i,rootValue:o}=e;_(n,t,i);const a=L(e);if(!("schema"in a))return{errors:a};try{const{operation:e}=a,n=S(a,e,o);return(0,u.isPromise)(n)?n.then((e=>I(e,a.errors)),(e=>(a.errors.push(e),I(null,a.errors)))):I(n,a.errors)}catch(e){return a.errors.push(e),I(null,a.errors)}}function I(e,n){return 0===n.length?{data:e}:{errors:n,data:e}}function _(e,n,t){n||(0,r.devAssert)(!1,"Must provide document."),(0,v.assertValidSchema)(e),null==t||(0,s.isObjectLike)(t)||(0,r.devAssert)(!1,"Variables must be provided as an Object where each property is a variable value. Perhaps look to see if an unparsed JSON string was provided.")}function L(e){var n,t;const{schema:r,document:i,rootValue:o,contextValue:a,variableValues:s,operationName:u,fieldResolver:c,typeResolver:p,subscribeFieldResolver:l}=e;let d;const y=Object.create(null);for(const e of i.definitions)switch(e.kind){case h.Kind.OPERATION_DEFINITION:if(null==u){if(void 0!==d)return[new f.GraphQLError("Must provide operation name if query contains multiple operations.")];d=e}else(null===(n=e.name)||void 0===n?void 0:n.value)===u&&(d=e);break;case h.Kind.FRAGMENT_DEFINITION:y[e.name.value]=e}if(!d)return null!=u?[new f.GraphQLError(`Unknown operation named "${u}".`)]:[new f.GraphQLError("Must provide an operation.")];const m=null!==(t=d.variableDefinitions)&&void 0!==t?t:[],T=(0,E.getVariableValues)(r,m,null!=s?s:{},{maxErrors:50});return T.errors?T.errors:{schema:r,fragments:y,rootValue:o,contextValue:a,operation:d,variableValues:T.coerced,fieldResolver:null!=c?c:G,typeResolver:null!=p?p:x,subscribeFieldResolver:null!=l?l:G,errors:[]}}function S(e,n,t){const r=e.schema.getRootType(n.operation);if(null==r)throw new f.GraphQLError(`Schema is not configured to execute ${n.operation} operation.`,{nodes:n});const i=(0,g.collectFields)(e.schema,e.fragments,e.variableValues,r,n.selectionSet),o=void 0;switch(n.operation){case m.OperationTypeNode.QUERY:return D(e,r,t,o,i);case m.OperationTypeNode.MUTATION:return function(e,n,t,r,i){return(0,d.promiseReduce)(i.entries(),((r,[i,o])=>{const a=(0,p.addPath)(undefined,i,n.name),s=j(e,n,t,o,a);return void 0===s?r:(0,u.isPromise)(s)?s.then((e=>(r[i]=e,r))):(r[i]=s,r)}),Object.create(null))}(e,r,t,0,i);case m.OperationTypeNode.SUBSCRIPTION:return D(e,r,t,o,i)}}function D(e,n,t,r,i){const o=Object.create(null);let a=!1;try{for(const[s,c]of i.entries()){const i=j(e,n,t,c,(0,p.addPath)(r,s,n.name));void 0!==i&&(o[s]=i,(0,u.isPromise)(i)&&(a=!0))}}catch(e){if(a)return(0,l.promiseForObject)(o).finally((()=>{throw e}));throw e}return a?(0,l.promiseForObject)(o):o}function j(e,n,t,r,i){var o;const a=V(e.schema,n,r[0]);if(!a)return;const s=a.type,c=null!==(o=a.resolve)&&void 0!==o?o:e.fieldResolver,l=A(e,a,r,n,i);try{const n=c(t,(0,E.getArgumentValues)(a,r[0],e.variableValues),e.contextValue,l);let o;return o=(0,u.isPromise)(n)?n.then((n=>R(e,s,r,l,i,n))):R(e,s,r,l,i,n),(0,u.isPromise)(o)?o.then(void 0,(n=>P((0,y.locatedError)(n,r,(0,p.pathToArray)(i)),s,e))):o}catch(n){return P((0,y.locatedError)(n,r,(0,p.pathToArray)(i)),s,e)}}function A(e,n,t,r,i){return{fieldName:n.name,fieldNodes:t,returnType:n.type,parentType:r,path:i,schema:e.schema,fragments:e.fragments,rootValue:e.rootValue,operation:e.operation,variableValues:e.variableValues}}function P(e,n,t){if((0,T.isNonNullType)(n))throw e;return t.errors.push(e),null}function R(e,n,t,r,s,c){if(c instanceof Error)throw c;if((0,T.isNonNullType)(n)){const i=R(e,n.ofType,t,r,s,c);if(null===i)throw new Error(`Cannot return null for non-nullable field ${r.parentType.name}.${r.fieldName}.`);return i}return null==c?null:(0,T.isListType)(n)?function(e,n,t,r,i,o){if(!(0,a.isIterableObject)(o))throw new f.GraphQLError(`Expected Iterable, but did not find one for field "${r.parentType.name}.${r.fieldName}".`);const s=n.ofType;let c=!1;const l=Array.from(o,((n,o)=>{const a=(0,p.addPath)(i,o,void 0);try{let i;return i=(0,u.isPromise)(n)?n.then((n=>R(e,s,t,r,a,n))):R(e,s,t,r,a,n),(0,u.isPromise)(i)?(c=!0,i.then(void 0,(n=>P((0,y.locatedError)(n,t,(0,p.pathToArray)(a)),s,e)))):i}catch(n){return P((0,y.locatedError)(n,t,(0,p.pathToArray)(a)),s,e)}}));return c?Promise.all(l):l}(e,n,t,r,s,c):(0,T.isLeafType)(n)?function(e,n){const t=e.serialize(n);if(null==t)throw new Error(`Expected \`${(0,i.inspect)(e)}.serialize(${(0,i.inspect)(n)})\` to return non-nullable value, returned: ${(0,i.inspect)(t)}`);return t}(n,c):(0,T.isAbstractType)(n)?function(e,n,t,r,i,o){var a;const s=null!==(a=n.resolveType)&&void 0!==a?a:e.typeResolver,c=e.contextValue,p=s(o,c,r,n);return(0,u.isPromise)(p)?p.then((a=>k(e,w(a,e,n,t,r,o),t,r,i,o))):k(e,w(p,e,n,t,r,o),t,r,i,o)}(e,n,t,r,s,c):(0,T.isObjectType)(n)?k(e,n,t,r,s,c):void(0,o.invariant)(!1,"Cannot complete value of unexpected output type: "+(0,i.inspect)(n))}function w(e,n,t,r,o,a){if(null==e)throw new f.GraphQLError(`Abstract type "${t.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}". Either the "${t.name}" type should provide a "resolveType" function or each possible type should provide an "isTypeOf" function.`,r);if((0,T.isObjectType)(e))throw new f.GraphQLError("Support for returning GraphQLObjectType from resolveType was removed in graphql-js@16.0.0 please return type name instead.");if("string"!=typeof e)throw new f.GraphQLError(`Abstract type "${t.name}" must resolve to an Object type at runtime for field "${o.parentType.name}.${o.fieldName}" with value ${(0,i.inspect)(a)}, received "${(0,i.inspect)(e)}".`);const s=n.schema.getType(e);if(null==s)throw new f.GraphQLError(`Abstract type "${t.name}" was resolved to a type "${e}" that does not exist inside the schema.`,{nodes:r});if(!(0,T.isObjectType)(s))throw new f.GraphQLError(`Abstract type "${t.name}" was resolved to a non-object type "${e}".`,{nodes:r});if(!n.schema.isSubType(t,s))throw new f.GraphQLError(`Runtime Object type "${s.name}" is not a possible type for "${t.name}".`,{nodes:r});return s}function k(e,n,t,r,i,o){const a=N(e,n,t);if(n.isTypeOf){const s=n.isTypeOf(o,e.contextValue,r);if((0,u.isPromise)(s))return s.then((r=>{if(!r)throw F(n,o,t);return D(e,n,o,i,a)}));if(!s)throw F(n,o,t)}return D(e,n,o,i,a)}function F(e,n,t){return new f.GraphQLError(`Expected value of type "${e.name}" but got: ${(0,i.inspect)(n)}.`,{nodes:t})}const x=function(e,n,t,r){if((0,s.isObjectLike)(e)&&"string"==typeof e.__typename)return e.__typename;const i=t.schema.getPossibleTypes(r),o=[];for(let r=0;r{for(let n=0;nr(await t.next()),return:async()=>"function"==typeof t.return?r(await t.return()):{value:void 0,done:!0},async throw(e){if("function"==typeof t.throw)return r(await t.throw(e));throw e},[Symbol.asyncIterator](){return this}}}},6234:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.createSourceEventStream=f,n.subscribe=async function(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const n=await f(e);if(!(0,o.isAsyncIterable)(n))return n;const t=n=>(0,p.execute)({...e,rootValue:n});return(0,l.mapAsyncIterator)(n,t)};var r=t(7242),i=t(8002),o=t(8648),a=t(7059),s=t(5822),u=t(1993),c=t(8950),p=t(192),l=t(6082),d=t(8840);async function f(...e){const n=function(e){const n=e[0];return n&&"document"in n?n:{schema:n,document:e[1],rootValue:e[2],contextValue:e[3],variableValues:e[4],operationName:e[5],subscribeFieldResolver:e[6]}}(e),{schema:t,document:r,variableValues:l}=n;(0,p.assertValidExecutionArguments)(t,r,l);const f=(0,p.buildExecutionContext)(n);if(!("schema"in f))return{errors:f};try{const e=await async function(e){const{schema:n,fragments:t,operation:r,variableValues:i,rootValue:o}=e,l=n.getSubscriptionType();if(null==l)throw new s.GraphQLError("Schema is not configured to execute subscription operation.",{nodes:r});const f=(0,c.collectFields)(n,t,i,l,r.selectionSet),[y,m]=[...f.entries()][0],h=(0,p.getFieldDef)(n,l,m[0]);if(!h){const e=m[0].name.value;throw new s.GraphQLError(`The subscription field "${e}" is not defined.`,{nodes:m})}const T=(0,a.addPath)(void 0,y,l.name),b=(0,p.buildResolveInfo)(e,h,m,l,T);try{var v;const n=(0,d.getArgumentValues)(h,m[0],i),t=e.contextValue,r=null!==(v=h.subscribe)&&void 0!==v?v:e.subscribeFieldResolver,a=await r(o,n,t,b);if(a instanceof Error)throw a;return a}catch(e){throw(0,u.locatedError)(e,m,(0,a.pathToArray)(T))}}(f);if(!(0,o.isAsyncIterable)(e))throw new Error(`Subscription field must return Async Iterable. Received: ${(0,i.inspect)(e)}.`);return e}catch(e){if(e instanceof s.GraphQLError)return{errors:[e]};throw e}}},8840:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.getArgumentValues=f,n.getDirectiveValues=function(e,n,t){var r;const i=null===(r=n.directives)||void 0===r?void 0:r.find((n=>n.name.value===e.name));if(i)return f(e,i,t)},n.getVariableValues=function(e,n,t,i){const s=[],f=null==i?void 0:i.maxErrors;try{const i=function(e,n,t,i){const s={};for(const f of n){const n=f.variable.name.value,m=(0,l.typeFromAST)(e,f.type);if(!(0,c.isInputType)(m)){const e=(0,u.print)(f.type);i(new a.GraphQLError(`Variable "$${n}" expected value of type "${e}" which cannot be used as an input type.`,{nodes:f.type}));continue}if(!y(t,n)){if(f.defaultValue)s[n]=(0,d.valueFromAST)(f.defaultValue,m);else if((0,c.isNonNullType)(m)){const e=(0,r.inspect)(m);i(new a.GraphQLError(`Variable "$${n}" of required type "${e}" was not provided.`,{nodes:f}))}continue}const h=t[n];if(null===h&&(0,c.isNonNullType)(m)){const e=(0,r.inspect)(m);i(new a.GraphQLError(`Variable "$${n}" of non-null type "${e}" must not be null.`,{nodes:f}))}else s[n]=(0,p.coerceInputValue)(h,m,((e,t,s)=>{let u=`Variable "$${n}" got invalid value `+(0,r.inspect)(t);e.length>0&&(u+=` at "${n}${(0,o.printPathArray)(e)}"`),i(new a.GraphQLError(u+"; "+s.message,{nodes:f,originalError:s}))}))}return s}(e,n,t,(e=>{if(null!=f&&s.length>=f)throw new a.GraphQLError("Too many errors processing variables, error limit reached. Execution aborted.");s.push(e)}));if(0===s.length)return{coerced:i}}catch(e){s.push(e)}return{errors:s}};var r=t(8002),i=t(2863),o=t(737),a=t(5822),s=t(2828),u=t(3033),c=t(5003),p=t(3679),l=t(5115),d=t(3770);function f(e,n,t){var o;const p={},l=null!==(o=n.arguments)&&void 0!==o?o:[],f=(0,i.keyMap)(l,(e=>e.name.value));for(const i of e.args){const e=i.name,o=i.type,l=f[e];if(!l){if(void 0!==i.defaultValue)p[e]=i.defaultValue;else if((0,c.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of required type "${(0,r.inspect)(o)}" was not provided.`,{nodes:n});continue}const m=l.value;let h=m.kind===s.Kind.NULL;if(m.kind===s.Kind.VARIABLE){const n=m.name.value;if(null==t||!y(t,n)){if(void 0!==i.defaultValue)p[e]=i.defaultValue;else if((0,c.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of required type "${(0,r.inspect)(o)}" was provided the variable "$${n}" which was not provided a runtime value.`,{nodes:m});continue}h=null==t[n]}if(h&&(0,c.isNonNullType)(o))throw new a.GraphQLError(`Argument "${e}" of non-null type "${(0,r.inspect)(o)}" must not be null.`,{nodes:m});const T=(0,d.valueFromAST)(m,o,t);if(void 0===T)throw new a.GraphQLError(`Argument "${e}" has invalid value ${(0,u.print)(m)}.`,{nodes:m});p[e]=T}return p}function y(e,n){return Object.prototype.hasOwnProperty.call(e,n)}},9728:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.graphql=function(e){return new Promise((n=>n(c(e))))},n.graphqlSync=function(e){const n=c(e);if((0,i.isPromise)(n))throw new Error("GraphQL execution failed to complete synchronously.");return n};var r=t(7242),i=t(4221),o=t(8370),a=t(1671),s=t(9504),u=t(192);function c(e){arguments.length<2||(0,r.devAssert)(!1,"graphql@16 dropped long-deprecated support for positional arguments, please pass an object instead.");const{schema:n,source:t,rootValue:i,contextValue:c,variableValues:p,operationName:l,fieldResolver:d,typeResolver:f}=e,y=(0,a.validateSchema)(n);if(y.length>0)return{errors:y};let m;try{m=(0,o.parse)(t)}catch(e){return{errors:[e]}}const h=(0,s.validate)(n,m);return h.length>0?{errors:h}:(0,u.execute)({schema:n,document:m,rootValue:i,contextValue:c,variableValues:p,operationName:l,fieldResolver:d,typeResolver:f})}},20:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BREAK",{enumerable:!0,get:function(){return a.BREAK}}),Object.defineProperty(n,"BreakingChangeType",{enumerable:!0,get:function(){return p.BreakingChangeType}}),Object.defineProperty(n,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return o.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(n,"DangerousChangeType",{enumerable:!0,get:function(){return p.DangerousChangeType}}),Object.defineProperty(n,"DirectiveLocation",{enumerable:!0,get:function(){return a.DirectiveLocation}}),Object.defineProperty(n,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return u.ExecutableDefinitionsRule}}),Object.defineProperty(n,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return u.FieldsOnCorrectTypeRule}}),Object.defineProperty(n,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return u.FragmentsOnCompositeTypesRule}}),Object.defineProperty(n,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return o.GRAPHQL_MAX_INT}}),Object.defineProperty(n,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return o.GRAPHQL_MIN_INT}}),Object.defineProperty(n,"GraphQLBoolean",{enumerable:!0,get:function(){return o.GraphQLBoolean}}),Object.defineProperty(n,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return o.GraphQLDeprecatedDirective}}),Object.defineProperty(n,"GraphQLDirective",{enumerable:!0,get:function(){return o.GraphQLDirective}}),Object.defineProperty(n,"GraphQLEnumType",{enumerable:!0,get:function(){return o.GraphQLEnumType}}),Object.defineProperty(n,"GraphQLError",{enumerable:!0,get:function(){return c.GraphQLError}}),Object.defineProperty(n,"GraphQLFloat",{enumerable:!0,get:function(){return o.GraphQLFloat}}),Object.defineProperty(n,"GraphQLID",{enumerable:!0,get:function(){return o.GraphQLID}}),Object.defineProperty(n,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return o.GraphQLIncludeDirective}}),Object.defineProperty(n,"GraphQLInputObjectType",{enumerable:!0,get:function(){return o.GraphQLInputObjectType}}),Object.defineProperty(n,"GraphQLInt",{enumerable:!0,get:function(){return o.GraphQLInt}}),Object.defineProperty(n,"GraphQLInterfaceType",{enumerable:!0,get:function(){return o.GraphQLInterfaceType}}),Object.defineProperty(n,"GraphQLList",{enumerable:!0,get:function(){return o.GraphQLList}}),Object.defineProperty(n,"GraphQLNonNull",{enumerable:!0,get:function(){return o.GraphQLNonNull}}),Object.defineProperty(n,"GraphQLObjectType",{enumerable:!0,get:function(){return o.GraphQLObjectType}}),Object.defineProperty(n,"GraphQLScalarType",{enumerable:!0,get:function(){return o.GraphQLScalarType}}),Object.defineProperty(n,"GraphQLSchema",{enumerable:!0,get:function(){return o.GraphQLSchema}}),Object.defineProperty(n,"GraphQLSkipDirective",{enumerable:!0,get:function(){return o.GraphQLSkipDirective}}),Object.defineProperty(n,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return o.GraphQLSpecifiedByDirective}}),Object.defineProperty(n,"GraphQLString",{enumerable:!0,get:function(){return o.GraphQLString}}),Object.defineProperty(n,"GraphQLUnionType",{enumerable:!0,get:function(){return o.GraphQLUnionType}}),Object.defineProperty(n,"Kind",{enumerable:!0,get:function(){return a.Kind}}),Object.defineProperty(n,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return u.KnownArgumentNamesRule}}),Object.defineProperty(n,"KnownDirectivesRule",{enumerable:!0,get:function(){return u.KnownDirectivesRule}}),Object.defineProperty(n,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return u.KnownFragmentNamesRule}}),Object.defineProperty(n,"KnownTypeNamesRule",{enumerable:!0,get:function(){return u.KnownTypeNamesRule}}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return a.Lexer}}),Object.defineProperty(n,"Location",{enumerable:!0,get:function(){return a.Location}}),Object.defineProperty(n,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return u.LoneAnonymousOperationRule}}),Object.defineProperty(n,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return u.LoneSchemaDefinitionRule}}),Object.defineProperty(n,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return u.NoDeprecatedCustomRule}}),Object.defineProperty(n,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return u.NoFragmentCyclesRule}}),Object.defineProperty(n,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return u.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(n,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return u.NoUndefinedVariablesRule}}),Object.defineProperty(n,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return u.NoUnusedFragmentsRule}}),Object.defineProperty(n,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return u.NoUnusedVariablesRule}}),Object.defineProperty(n,"OperationTypeNode",{enumerable:!0,get:function(){return a.OperationTypeNode}}),Object.defineProperty(n,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return u.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(n,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return u.PossibleFragmentSpreadsRule}}),Object.defineProperty(n,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return u.PossibleTypeExtensionsRule}}),Object.defineProperty(n,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return u.ProvidedRequiredArgumentsRule}}),Object.defineProperty(n,"ScalarLeafsRule",{enumerable:!0,get:function(){return u.ScalarLeafsRule}}),Object.defineProperty(n,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return o.SchemaMetaFieldDef}}),Object.defineProperty(n,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return u.SingleFieldSubscriptionsRule}}),Object.defineProperty(n,"Source",{enumerable:!0,get:function(){return a.Source}}),Object.defineProperty(n,"Token",{enumerable:!0,get:function(){return a.Token}}),Object.defineProperty(n,"TokenKind",{enumerable:!0,get:function(){return a.TokenKind}}),Object.defineProperty(n,"TypeInfo",{enumerable:!0,get:function(){return p.TypeInfo}}),Object.defineProperty(n,"TypeKind",{enumerable:!0,get:function(){return o.TypeKind}}),Object.defineProperty(n,"TypeMetaFieldDef",{enumerable:!0,get:function(){return o.TypeMetaFieldDef}}),Object.defineProperty(n,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return o.TypeNameMetaFieldDef}}),Object.defineProperty(n,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return u.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(n,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return u.UniqueArgumentNamesRule}}),Object.defineProperty(n,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return u.UniqueDirectiveNamesRule}}),Object.defineProperty(n,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return u.UniqueDirectivesPerLocationRule}}),Object.defineProperty(n,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return u.UniqueEnumValueNamesRule}}),Object.defineProperty(n,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return u.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(n,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return u.UniqueFragmentNamesRule}}),Object.defineProperty(n,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return u.UniqueInputFieldNamesRule}}),Object.defineProperty(n,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return u.UniqueOperationNamesRule}}),Object.defineProperty(n,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return u.UniqueOperationTypesRule}}),Object.defineProperty(n,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return u.UniqueTypeNamesRule}}),Object.defineProperty(n,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return u.UniqueVariableNamesRule}}),Object.defineProperty(n,"ValidationContext",{enumerable:!0,get:function(){return u.ValidationContext}}),Object.defineProperty(n,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return u.ValuesOfCorrectTypeRule}}),Object.defineProperty(n,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return u.VariablesAreInputTypesRule}}),Object.defineProperty(n,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return u.VariablesInAllowedPositionRule}}),Object.defineProperty(n,"__Directive",{enumerable:!0,get:function(){return o.__Directive}}),Object.defineProperty(n,"__DirectiveLocation",{enumerable:!0,get:function(){return o.__DirectiveLocation}}),Object.defineProperty(n,"__EnumValue",{enumerable:!0,get:function(){return o.__EnumValue}}),Object.defineProperty(n,"__Field",{enumerable:!0,get:function(){return o.__Field}}),Object.defineProperty(n,"__InputValue",{enumerable:!0,get:function(){return o.__InputValue}}),Object.defineProperty(n,"__Schema",{enumerable:!0,get:function(){return o.__Schema}}),Object.defineProperty(n,"__Type",{enumerable:!0,get:function(){return o.__Type}}),Object.defineProperty(n,"__TypeKind",{enumerable:!0,get:function(){return o.__TypeKind}}),Object.defineProperty(n,"assertAbstractType",{enumerable:!0,get:function(){return o.assertAbstractType}}),Object.defineProperty(n,"assertCompositeType",{enumerable:!0,get:function(){return o.assertCompositeType}}),Object.defineProperty(n,"assertDirective",{enumerable:!0,get:function(){return o.assertDirective}}),Object.defineProperty(n,"assertEnumType",{enumerable:!0,get:function(){return o.assertEnumType}}),Object.defineProperty(n,"assertEnumValueName",{enumerable:!0,get:function(){return o.assertEnumValueName}}),Object.defineProperty(n,"assertInputObjectType",{enumerable:!0,get:function(){return o.assertInputObjectType}}),Object.defineProperty(n,"assertInputType",{enumerable:!0,get:function(){return o.assertInputType}}),Object.defineProperty(n,"assertInterfaceType",{enumerable:!0,get:function(){return o.assertInterfaceType}}),Object.defineProperty(n,"assertLeafType",{enumerable:!0,get:function(){return o.assertLeafType}}),Object.defineProperty(n,"assertListType",{enumerable:!0,get:function(){return o.assertListType}}),Object.defineProperty(n,"assertName",{enumerable:!0,get:function(){return o.assertName}}),Object.defineProperty(n,"assertNamedType",{enumerable:!0,get:function(){return o.assertNamedType}}),Object.defineProperty(n,"assertNonNullType",{enumerable:!0,get:function(){return o.assertNonNullType}}),Object.defineProperty(n,"assertNullableType",{enumerable:!0,get:function(){return o.assertNullableType}}),Object.defineProperty(n,"assertObjectType",{enumerable:!0,get:function(){return o.assertObjectType}}),Object.defineProperty(n,"assertOutputType",{enumerable:!0,get:function(){return o.assertOutputType}}),Object.defineProperty(n,"assertScalarType",{enumerable:!0,get:function(){return o.assertScalarType}}),Object.defineProperty(n,"assertSchema",{enumerable:!0,get:function(){return o.assertSchema}}),Object.defineProperty(n,"assertType",{enumerable:!0,get:function(){return o.assertType}}),Object.defineProperty(n,"assertUnionType",{enumerable:!0,get:function(){return o.assertUnionType}}),Object.defineProperty(n,"assertValidName",{enumerable:!0,get:function(){return p.assertValidName}}),Object.defineProperty(n,"assertValidSchema",{enumerable:!0,get:function(){return o.assertValidSchema}}),Object.defineProperty(n,"assertWrappingType",{enumerable:!0,get:function(){return o.assertWrappingType}}),Object.defineProperty(n,"astFromValue",{enumerable:!0,get:function(){return p.astFromValue}}),Object.defineProperty(n,"buildASTSchema",{enumerable:!0,get:function(){return p.buildASTSchema}}),Object.defineProperty(n,"buildClientSchema",{enumerable:!0,get:function(){return p.buildClientSchema}}),Object.defineProperty(n,"buildSchema",{enumerable:!0,get:function(){return p.buildSchema}}),Object.defineProperty(n,"coerceInputValue",{enumerable:!0,get:function(){return p.coerceInputValue}}),Object.defineProperty(n,"concatAST",{enumerable:!0,get:function(){return p.concatAST}}),Object.defineProperty(n,"createSourceEventStream",{enumerable:!0,get:function(){return s.createSourceEventStream}}),Object.defineProperty(n,"defaultFieldResolver",{enumerable:!0,get:function(){return s.defaultFieldResolver}}),Object.defineProperty(n,"defaultTypeResolver",{enumerable:!0,get:function(){return s.defaultTypeResolver}}),Object.defineProperty(n,"doTypesOverlap",{enumerable:!0,get:function(){return p.doTypesOverlap}}),Object.defineProperty(n,"execute",{enumerable:!0,get:function(){return s.execute}}),Object.defineProperty(n,"executeSync",{enumerable:!0,get:function(){return s.executeSync}}),Object.defineProperty(n,"extendSchema",{enumerable:!0,get:function(){return p.extendSchema}}),Object.defineProperty(n,"findBreakingChanges",{enumerable:!0,get:function(){return p.findBreakingChanges}}),Object.defineProperty(n,"findDangerousChanges",{enumerable:!0,get:function(){return p.findDangerousChanges}}),Object.defineProperty(n,"formatError",{enumerable:!0,get:function(){return c.formatError}}),Object.defineProperty(n,"getArgumentValues",{enumerable:!0,get:function(){return s.getArgumentValues}}),Object.defineProperty(n,"getDirectiveValues",{enumerable:!0,get:function(){return s.getDirectiveValues}}),Object.defineProperty(n,"getEnterLeaveForKind",{enumerable:!0,get:function(){return a.getEnterLeaveForKind}}),Object.defineProperty(n,"getIntrospectionQuery",{enumerable:!0,get:function(){return p.getIntrospectionQuery}}),Object.defineProperty(n,"getLocation",{enumerable:!0,get:function(){return a.getLocation}}),Object.defineProperty(n,"getNamedType",{enumerable:!0,get:function(){return o.getNamedType}}),Object.defineProperty(n,"getNullableType",{enumerable:!0,get:function(){return o.getNullableType}}),Object.defineProperty(n,"getOperationAST",{enumerable:!0,get:function(){return p.getOperationAST}}),Object.defineProperty(n,"getOperationRootType",{enumerable:!0,get:function(){return p.getOperationRootType}}),Object.defineProperty(n,"getVariableValues",{enumerable:!0,get:function(){return s.getVariableValues}}),Object.defineProperty(n,"getVisitFn",{enumerable:!0,get:function(){return a.getVisitFn}}),Object.defineProperty(n,"graphql",{enumerable:!0,get:function(){return i.graphql}}),Object.defineProperty(n,"graphqlSync",{enumerable:!0,get:function(){return i.graphqlSync}}),Object.defineProperty(n,"introspectionFromSchema",{enumerable:!0,get:function(){return p.introspectionFromSchema}}),Object.defineProperty(n,"introspectionTypes",{enumerable:!0,get:function(){return o.introspectionTypes}}),Object.defineProperty(n,"isAbstractType",{enumerable:!0,get:function(){return o.isAbstractType}}),Object.defineProperty(n,"isCompositeType",{enumerable:!0,get:function(){return o.isCompositeType}}),Object.defineProperty(n,"isConstValueNode",{enumerable:!0,get:function(){return a.isConstValueNode}}),Object.defineProperty(n,"isDefinitionNode",{enumerable:!0,get:function(){return a.isDefinitionNode}}),Object.defineProperty(n,"isDirective",{enumerable:!0,get:function(){return o.isDirective}}),Object.defineProperty(n,"isEnumType",{enumerable:!0,get:function(){return o.isEnumType}}),Object.defineProperty(n,"isEqualType",{enumerable:!0,get:function(){return p.isEqualType}}),Object.defineProperty(n,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return a.isExecutableDefinitionNode}}),Object.defineProperty(n,"isInputObjectType",{enumerable:!0,get:function(){return o.isInputObjectType}}),Object.defineProperty(n,"isInputType",{enumerable:!0,get:function(){return o.isInputType}}),Object.defineProperty(n,"isInterfaceType",{enumerable:!0,get:function(){return o.isInterfaceType}}),Object.defineProperty(n,"isIntrospectionType",{enumerable:!0,get:function(){return o.isIntrospectionType}}),Object.defineProperty(n,"isLeafType",{enumerable:!0,get:function(){return o.isLeafType}}),Object.defineProperty(n,"isListType",{enumerable:!0,get:function(){return o.isListType}}),Object.defineProperty(n,"isNamedType",{enumerable:!0,get:function(){return o.isNamedType}}),Object.defineProperty(n,"isNonNullType",{enumerable:!0,get:function(){return o.isNonNullType}}),Object.defineProperty(n,"isNullableType",{enumerable:!0,get:function(){return o.isNullableType}}),Object.defineProperty(n,"isObjectType",{enumerable:!0,get:function(){return o.isObjectType}}),Object.defineProperty(n,"isOutputType",{enumerable:!0,get:function(){return o.isOutputType}}),Object.defineProperty(n,"isRequiredArgument",{enumerable:!0,get:function(){return o.isRequiredArgument}}),Object.defineProperty(n,"isRequiredInputField",{enumerable:!0,get:function(){return o.isRequiredInputField}}),Object.defineProperty(n,"isScalarType",{enumerable:!0,get:function(){return o.isScalarType}}),Object.defineProperty(n,"isSchema",{enumerable:!0,get:function(){return o.isSchema}}),Object.defineProperty(n,"isSelectionNode",{enumerable:!0,get:function(){return a.isSelectionNode}}),Object.defineProperty(n,"isSpecifiedDirective",{enumerable:!0,get:function(){return o.isSpecifiedDirective}}),Object.defineProperty(n,"isSpecifiedScalarType",{enumerable:!0,get:function(){return o.isSpecifiedScalarType}}),Object.defineProperty(n,"isType",{enumerable:!0,get:function(){return o.isType}}),Object.defineProperty(n,"isTypeDefinitionNode",{enumerable:!0,get:function(){return a.isTypeDefinitionNode}}),Object.defineProperty(n,"isTypeExtensionNode",{enumerable:!0,get:function(){return a.isTypeExtensionNode}}),Object.defineProperty(n,"isTypeNode",{enumerable:!0,get:function(){return a.isTypeNode}}),Object.defineProperty(n,"isTypeSubTypeOf",{enumerable:!0,get:function(){return p.isTypeSubTypeOf}}),Object.defineProperty(n,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return a.isTypeSystemDefinitionNode}}),Object.defineProperty(n,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return a.isTypeSystemExtensionNode}}),Object.defineProperty(n,"isUnionType",{enumerable:!0,get:function(){return o.isUnionType}}),Object.defineProperty(n,"isValidNameError",{enumerable:!0,get:function(){return p.isValidNameError}}),Object.defineProperty(n,"isValueNode",{enumerable:!0,get:function(){return a.isValueNode}}),Object.defineProperty(n,"isWrappingType",{enumerable:!0,get:function(){return o.isWrappingType}}),Object.defineProperty(n,"lexicographicSortSchema",{enumerable:!0,get:function(){return p.lexicographicSortSchema}}),Object.defineProperty(n,"locatedError",{enumerable:!0,get:function(){return c.locatedError}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return a.parse}}),Object.defineProperty(n,"parseConstValue",{enumerable:!0,get:function(){return a.parseConstValue}}),Object.defineProperty(n,"parseType",{enumerable:!0,get:function(){return a.parseType}}),Object.defineProperty(n,"parseValue",{enumerable:!0,get:function(){return a.parseValue}}),Object.defineProperty(n,"print",{enumerable:!0,get:function(){return a.print}}),Object.defineProperty(n,"printError",{enumerable:!0,get:function(){return c.printError}}),Object.defineProperty(n,"printIntrospectionSchema",{enumerable:!0,get:function(){return p.printIntrospectionSchema}}),Object.defineProperty(n,"printLocation",{enumerable:!0,get:function(){return a.printLocation}}),Object.defineProperty(n,"printSchema",{enumerable:!0,get:function(){return p.printSchema}}),Object.defineProperty(n,"printSourceLocation",{enumerable:!0,get:function(){return a.printSourceLocation}}),Object.defineProperty(n,"printType",{enumerable:!0,get:function(){return p.printType}}),Object.defineProperty(n,"resolveObjMapThunk",{enumerable:!0,get:function(){return o.resolveObjMapThunk}}),Object.defineProperty(n,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return o.resolveReadonlyArrayThunk}}),Object.defineProperty(n,"responsePathAsArray",{enumerable:!0,get:function(){return s.responsePathAsArray}}),Object.defineProperty(n,"separateOperations",{enumerable:!0,get:function(){return p.separateOperations}}),Object.defineProperty(n,"specifiedDirectives",{enumerable:!0,get:function(){return o.specifiedDirectives}}),Object.defineProperty(n,"specifiedRules",{enumerable:!0,get:function(){return u.specifiedRules}}),Object.defineProperty(n,"specifiedScalarTypes",{enumerable:!0,get:function(){return o.specifiedScalarTypes}}),Object.defineProperty(n,"stripIgnoredCharacters",{enumerable:!0,get:function(){return p.stripIgnoredCharacters}}),Object.defineProperty(n,"subscribe",{enumerable:!0,get:function(){return s.subscribe}}),Object.defineProperty(n,"syntaxError",{enumerable:!0,get:function(){return c.syntaxError}}),Object.defineProperty(n,"typeFromAST",{enumerable:!0,get:function(){return p.typeFromAST}}),Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return u.validate}}),Object.defineProperty(n,"validateSchema",{enumerable:!0,get:function(){return o.validateSchema}}),Object.defineProperty(n,"valueFromAST",{enumerable:!0,get:function(){return p.valueFromAST}}),Object.defineProperty(n,"valueFromASTUntyped",{enumerable:!0,get:function(){return p.valueFromASTUntyped}}),Object.defineProperty(n,"version",{enumerable:!0,get:function(){return r.version}}),Object.defineProperty(n,"versionInfo",{enumerable:!0,get:function(){return r.versionInfo}}),Object.defineProperty(n,"visit",{enumerable:!0,get:function(){return a.visit}}),Object.defineProperty(n,"visitInParallel",{enumerable:!0,get:function(){return a.visitInParallel}}),Object.defineProperty(n,"visitWithTypeInfo",{enumerable:!0,get:function(){return p.visitWithTypeInfo}});var r=t(8696),i=t(9728),o=t(3226),a=t(2178),s=t(9931),u=t(1122),c=t(6972),p=t(9548)},7059:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.addPath=function(e,n,t){return{prev:e,key:n,typename:t}},n.pathToArray=function(e){const n=[];let t=e;for(;t;)n.push(t.key),t=t.prev;return n.reverse()}},7242:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.devAssert=function(e,n){if(!Boolean(e))throw new Error(n)}},166:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.didYouMean=function(e,n){const[t,r]=n?[e,n]:[void 0,e];let i=" Did you mean ";t&&(i+=t+" ");const o=r.map((e=>`"${e}"`));switch(o.length){case 0:return"";case 1:return i+o[0]+"?";case 2:return i+o[0]+" or "+o[1]+"?"}const a=o.slice(0,5),s=a.pop();return i+a.join(", ")+", or "+s+"?"}},4620:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.groupBy=function(e,n){const t=new Map;for(const r of e){const e=n(r),i=t.get(e);void 0===i?t.set(e,[r]):i.push(r)}return t}},3317:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.identityFunc=function(e){return e}},8002:function(e,n){function t(e,n){switch(typeof e){case"string":return JSON.stringify(e);case"function":return e.name?`[function ${e.name}]`:"[function]";case"object":return function(e,n){if(null===e)return"null";if(n.includes(e))return"[Circular]";const r=[...n,e];if(function(e){return"function"==typeof e.toJSON}(e)){const n=e.toJSON();if(n!==e)return"string"==typeof n?n:t(n,r)}else if(Array.isArray(e))return function(e,n){if(0===e.length)return"[]";if(n.length>2)return"[Array]";const r=Math.min(10,e.length),i=e.length-r,o=[];for(let i=0;i1&&o.push(`... ${i} more items`),"["+o.join(", ")+"]"}(e,r);return function(e,n){const r=Object.entries(e);if(0===r.length)return"{}";if(n.length>2)return"["+function(e){const n=Object.prototype.toString.call(e).replace(/^\[object /,"").replace(/]$/,"");if("Object"===n&&"function"==typeof e.constructor){const n=e.constructor.name;if("string"==typeof n&&""!==n)return n}return n}(e)+"]";const i=r.map((([e,r])=>e+": "+t(r,n)));return"{ "+i.join(", ")+" }"}(e,r)}(e,n);default:return String(e)}}Object.defineProperty(n,"__esModule",{value:!0}),n.inspect=function(e){return t(e,[])}},5752:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.instanceOf=void 0;var r=t(8002);const i=globalThis.process&&"production"===globalThis.process.env.NODE_ENV?function(e,n){return e instanceof n}:function(e,n){if(e instanceof n)return!0;if("object"==typeof e&&null!==e){var t;const i=n.prototype[Symbol.toStringTag];if(i===(Symbol.toStringTag in e?e[Symbol.toStringTag]:null===(t=e.constructor)||void 0===t?void 0:t.name)){const n=(0,r.inspect)(e);throw new Error(`Cannot use ${i} "${n}" from another module or realm.\n\nEnsure that there is only one instance of "graphql" in the node_modules\ndirectory. If different versions of "graphql" are the dependencies of other\nrelied on modules, use "resolutions" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate "graphql" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.`)}}return!1};n.instanceOf=i},7706:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.invariant=function(e,n){if(!Boolean(e))throw new Error(null!=n?n:"Unexpected invariant triggered.")}},8648:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isAsyncIterable=function(e){return"function"==typeof(null==e?void 0:e[Symbol.asyncIterator])}},6609:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isIterableObject=function(e){return"object"==typeof e&&"function"==typeof(null==e?void 0:e[Symbol.iterator])}},5690:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isObjectLike=function(e){return"object"==typeof e&&null!==e}},4221:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.isPromise=function(e){return"function"==typeof(null==e?void 0:e.then)}},2863:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.keyMap=function(e,n){const t=Object.create(null);for(const r of e)t[n(r)]=r;return t}},7154:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.keyValMap=function(e,n,t){const r=Object.create(null);for(const i of e)r[n(i)]=t(i);return r}},6124:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.mapValue=function(e,n){const t=Object.create(null);for(const r of Object.keys(e))t[r]=n(e[r],r);return t}},5456:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.memoize3=function(e){let n;return function(t,r,i){void 0===n&&(n=new WeakMap);let o=n.get(t);void 0===o&&(o=new WeakMap,n.set(t,o));let a=o.get(r);void 0===a&&(a=new WeakMap,o.set(r,a));let s=a.get(i);return void 0===s&&(s=e(t,r,i),a.set(i,s)),s}}},5250:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.naturalCompare=function(e,n){let i=0,o=0;for(;i0);let c=0;do{++o,c=10*c+s-t,s=n.charCodeAt(o)}while(r(s)&&c>0);if(uc)return 1}else{if(as)return 1;++i,++o}}return e.length-n.length};const t=48;function r(e){return!isNaN(e)&&t<=e&&e<=57}},737:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.printPathArray=function(e){return e.map((e=>"number"==typeof e?"["+e.toString()+"]":"."+e)).join("")}},3179:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.promiseForObject=function(e){return Promise.all(Object.values(e)).then((n=>{const t=Object.create(null);for(const[r,i]of Object.keys(e).entries())t[i]=n[r];return t}))}},9915:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.promiseReduce=function(e,n,t){let i=t;for(const t of e)i=(0,r.isPromise)(i)?i.then((e=>n(e,t))):n(i,t);return i};var r=t(4221)},8070:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.suggestionList=function(e,n){const t=Object.create(null),o=new i(e),a=Math.floor(.4*e.length)+1;for(const e of n){const n=o.measure(e,a);void 0!==n&&(t[e]=n)}return Object.keys(t).sort(((e,n)=>{const i=t[e]-t[n];return 0!==i?i:(0,r.naturalCompare)(e,n)}))};var r=t(5250);class i{constructor(e){this._input=e,this._inputLowerCase=e.toLowerCase(),this._inputArray=o(this._inputLowerCase),this._rows=[new Array(e.length+1).fill(0),new Array(e.length+1).fill(0),new Array(e.length+1).fill(0)]}measure(e,n){if(this._input===e)return 0;const t=e.toLowerCase();if(this._inputLowerCase===t)return 1;let r=o(t),i=this._inputArray;if(r.lengthn)return;const u=this._rows;for(let e=0;e<=s;e++)u[0][e]=e;for(let e=1;e<=a;e++){const t=u[(e-1)%3],o=u[e%3];let a=o[0]=e;for(let n=1;n<=s;n++){const s=r[e-1]===i[n-1]?0:1;let c=Math.min(t[n]+1,o[n-1]+1,t[n-1]+s);if(e>1&&n>1&&r[e-1]===i[n-2]&&r[e-2]===i[n-1]){const t=u[(e-2)%3][n-2];c=Math.min(c,t+1)}cn)return}const c=u[a%3][s];return c<=n?c:void 0}}function o(e){const n=e.length,t=new Array(n);for(let r=0;r0===n?e:e.slice(t))).slice(null!==(n=r)&&void 0!==n?n:0,o+1)},n.isPrintableAsBlockString=function(e){if(""===e)return!0;let n=!0,t=!1,r=!0,i=!1;for(let o=0;o1&&i.slice(1).every((e=>0===e.length||(0,r.isWhiteSpace)(e.charCodeAt(0)))),s=t.endsWith('\\"""'),u=e.endsWith('"')&&!s,c=e.endsWith("\\"),p=u||c,l=!(null!=n&&n.minimize)&&(!o||e.length>70||p||a||s);let d="";const f=o&&(0,r.isWhiteSpace)(e.charCodeAt(0));return(l&&!f||a)&&(d+="\n"),d+=t,(l||p)&&(d+="\n"),'"""'+d+'"""'};var r=t(100);function i(e){let n=0;for(;n=48&&e<=57}function r(e){return e>=97&&e<=122||e>=65&&e<=90}Object.defineProperty(n,"__esModule",{value:!0}),n.isDigit=t,n.isLetter=r,n.isNameContinue=function(e){return r(e)||t(e)||95===e},n.isNameStart=function(e){return r(e)||95===e},n.isWhiteSpace=function(e){return 9===e||32===e}},8333:function(e,n){var t;Object.defineProperty(n,"__esModule",{value:!0}),n.DirectiveLocation=void 0,n.DirectiveLocation=t,function(e){e.QUERY="QUERY",e.MUTATION="MUTATION",e.SUBSCRIPTION="SUBSCRIPTION",e.FIELD="FIELD",e.FRAGMENT_DEFINITION="FRAGMENT_DEFINITION",e.FRAGMENT_SPREAD="FRAGMENT_SPREAD",e.INLINE_FRAGMENT="INLINE_FRAGMENT",e.VARIABLE_DEFINITION="VARIABLE_DEFINITION",e.SCHEMA="SCHEMA",e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.FIELD_DEFINITION="FIELD_DEFINITION",e.ARGUMENT_DEFINITION="ARGUMENT_DEFINITION",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.ENUM_VALUE="ENUM_VALUE",e.INPUT_OBJECT="INPUT_OBJECT",e.INPUT_FIELD_DEFINITION="INPUT_FIELD_DEFINITION"}(t||(n.DirectiveLocation=t={}))},2178:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BREAK",{enumerable:!0,get:function(){return l.BREAK}}),Object.defineProperty(n,"DirectiveLocation",{enumerable:!0,get:function(){return y.DirectiveLocation}}),Object.defineProperty(n,"Kind",{enumerable:!0,get:function(){return a.Kind}}),Object.defineProperty(n,"Lexer",{enumerable:!0,get:function(){return u.Lexer}}),Object.defineProperty(n,"Location",{enumerable:!0,get:function(){return d.Location}}),Object.defineProperty(n,"OperationTypeNode",{enumerable:!0,get:function(){return d.OperationTypeNode}}),Object.defineProperty(n,"Source",{enumerable:!0,get:function(){return r.Source}}),Object.defineProperty(n,"Token",{enumerable:!0,get:function(){return d.Token}}),Object.defineProperty(n,"TokenKind",{enumerable:!0,get:function(){return s.TokenKind}}),Object.defineProperty(n,"getEnterLeaveForKind",{enumerable:!0,get:function(){return l.getEnterLeaveForKind}}),Object.defineProperty(n,"getLocation",{enumerable:!0,get:function(){return i.getLocation}}),Object.defineProperty(n,"getVisitFn",{enumerable:!0,get:function(){return l.getVisitFn}}),Object.defineProperty(n,"isConstValueNode",{enumerable:!0,get:function(){return f.isConstValueNode}}),Object.defineProperty(n,"isDefinitionNode",{enumerable:!0,get:function(){return f.isDefinitionNode}}),Object.defineProperty(n,"isExecutableDefinitionNode",{enumerable:!0,get:function(){return f.isExecutableDefinitionNode}}),Object.defineProperty(n,"isSelectionNode",{enumerable:!0,get:function(){return f.isSelectionNode}}),Object.defineProperty(n,"isTypeDefinitionNode",{enumerable:!0,get:function(){return f.isTypeDefinitionNode}}),Object.defineProperty(n,"isTypeExtensionNode",{enumerable:!0,get:function(){return f.isTypeExtensionNode}}),Object.defineProperty(n,"isTypeNode",{enumerable:!0,get:function(){return f.isTypeNode}}),Object.defineProperty(n,"isTypeSystemDefinitionNode",{enumerable:!0,get:function(){return f.isTypeSystemDefinitionNode}}),Object.defineProperty(n,"isTypeSystemExtensionNode",{enumerable:!0,get:function(){return f.isTypeSystemExtensionNode}}),Object.defineProperty(n,"isValueNode",{enumerable:!0,get:function(){return f.isValueNode}}),Object.defineProperty(n,"parse",{enumerable:!0,get:function(){return c.parse}}),Object.defineProperty(n,"parseConstValue",{enumerable:!0,get:function(){return c.parseConstValue}}),Object.defineProperty(n,"parseType",{enumerable:!0,get:function(){return c.parseType}}),Object.defineProperty(n,"parseValue",{enumerable:!0,get:function(){return c.parseValue}}),Object.defineProperty(n,"print",{enumerable:!0,get:function(){return p.print}}),Object.defineProperty(n,"printLocation",{enumerable:!0,get:function(){return o.printLocation}}),Object.defineProperty(n,"printSourceLocation",{enumerable:!0,get:function(){return o.printSourceLocation}}),Object.defineProperty(n,"visit",{enumerable:!0,get:function(){return l.visit}}),Object.defineProperty(n,"visitInParallel",{enumerable:!0,get:function(){return l.visitInParallel}});var r=t(2412),i=t(9016),o=t(8038),a=t(2828),s=t(3175),u=t(4274),c=t(8370),p=t(3033),l=t(285),d=t(1807),f=t(1352),y=t(8333)},2828:function(e,n){var t;Object.defineProperty(n,"__esModule",{value:!0}),n.Kind=void 0,n.Kind=t,function(e){e.NAME="Name",e.DOCUMENT="Document",e.OPERATION_DEFINITION="OperationDefinition",e.VARIABLE_DEFINITION="VariableDefinition",e.SELECTION_SET="SelectionSet",e.FIELD="Field",e.ARGUMENT="Argument",e.FRAGMENT_SPREAD="FragmentSpread",e.INLINE_FRAGMENT="InlineFragment",e.FRAGMENT_DEFINITION="FragmentDefinition",e.VARIABLE="Variable",e.INT="IntValue",e.FLOAT="FloatValue",e.STRING="StringValue",e.BOOLEAN="BooleanValue",e.NULL="NullValue",e.ENUM="EnumValue",e.LIST="ListValue",e.OBJECT="ObjectValue",e.OBJECT_FIELD="ObjectField",e.DIRECTIVE="Directive",e.NAMED_TYPE="NamedType",e.LIST_TYPE="ListType",e.NON_NULL_TYPE="NonNullType",e.SCHEMA_DEFINITION="SchemaDefinition",e.OPERATION_TYPE_DEFINITION="OperationTypeDefinition",e.SCALAR_TYPE_DEFINITION="ScalarTypeDefinition",e.OBJECT_TYPE_DEFINITION="ObjectTypeDefinition",e.FIELD_DEFINITION="FieldDefinition",e.INPUT_VALUE_DEFINITION="InputValueDefinition",e.INTERFACE_TYPE_DEFINITION="InterfaceTypeDefinition",e.UNION_TYPE_DEFINITION="UnionTypeDefinition",e.ENUM_TYPE_DEFINITION="EnumTypeDefinition",e.ENUM_VALUE_DEFINITION="EnumValueDefinition",e.INPUT_OBJECT_TYPE_DEFINITION="InputObjectTypeDefinition",e.DIRECTIVE_DEFINITION="DirectiveDefinition",e.SCHEMA_EXTENSION="SchemaExtension",e.SCALAR_TYPE_EXTENSION="ScalarTypeExtension",e.OBJECT_TYPE_EXTENSION="ObjectTypeExtension",e.INTERFACE_TYPE_EXTENSION="InterfaceTypeExtension",e.UNION_TYPE_EXTENSION="UnionTypeExtension",e.ENUM_TYPE_EXTENSION="EnumTypeExtension",e.INPUT_OBJECT_TYPE_EXTENSION="InputObjectTypeExtension"}(t||(n.Kind=t={}))},4274:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.Lexer=void 0,n.isPunctuatorTokenKind=function(e){return e===s.TokenKind.BANG||e===s.TokenKind.DOLLAR||e===s.TokenKind.AMP||e===s.TokenKind.PAREN_L||e===s.TokenKind.PAREN_R||e===s.TokenKind.SPREAD||e===s.TokenKind.COLON||e===s.TokenKind.EQUALS||e===s.TokenKind.AT||e===s.TokenKind.BRACKET_L||e===s.TokenKind.BRACKET_R||e===s.TokenKind.BRACE_L||e===s.TokenKind.PIPE||e===s.TokenKind.BRACE_R};var r=t(338),i=t(1807),o=t(849),a=t(100),s=t(3175);class u{constructor(e){const n=new i.Token(s.TokenKind.SOF,0,0,0,0);this.source=e,this.lastToken=n,this.token=n,this.line=1,this.lineStart=0}get[Symbol.toStringTag](){return"Lexer"}advance(){return this.lastToken=this.token,this.token=this.lookahead()}lookahead(){let e=this.token;if(e.kind!==s.TokenKind.EOF)do{if(e.next)e=e.next;else{const n=m(this,e.end);e.next=n,n.prev=e,e=n}}while(e.kind===s.TokenKind.COMMENT);return e}}function c(e){return e>=0&&e<=55295||e>=57344&&e<=1114111}function p(e,n){return l(e.charCodeAt(n))&&d(e.charCodeAt(n+1))}function l(e){return e>=55296&&e<=56319}function d(e){return e>=56320&&e<=57343}function f(e,n){const t=e.source.body.codePointAt(n);if(void 0===t)return s.TokenKind.EOF;if(t>=32&&t<=126){const e=String.fromCodePoint(t);return'"'===e?"'\"'":`"${e}"`}return"U+"+t.toString(16).toUpperCase().padStart(4,"0")}function y(e,n,t,r,o){const a=e.line,s=1+t-e.lineStart;return new i.Token(n,t,r,a,s,o)}function m(e,n){const t=e.source.body,i=t.length;let o=n;for(;o=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:-1}function I(e,n){const t=e.source.body;switch(t.charCodeAt(n+1)){case 34:return{value:'"',size:2};case 92:return{value:"\\",size:2};case 47:return{value:"/",size:2};case 98:return{value:"\b",size:2};case 102:return{value:"\f",size:2};case 110:return{value:"\n",size:2};case 114:return{value:"\r",size:2};case 116:return{value:"\t",size:2}}throw(0,r.syntaxError)(e.source,n,`Invalid character escape sequence: "${t.slice(n,n+2)}".`)}function _(e,n){const t=e.source.body,i=t.length;let a=e.lineStart,u=n+3,l=u,d="";const m=[];for(;u=n)break;t=a.index+a[0].length,o+=1}return{line:o,column:n+1-t}};var r=t(7706);const i=/\r\n|[\n\r]/g},8370:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.Parser=void 0,n.parse=function(e,n){return new p(e,n).parseDocument()},n.parseConstValue=function(e,n){const t=new p(e,n);t.expectToken(c.TokenKind.SOF);const r=t.parseConstValueLiteral();return t.expectToken(c.TokenKind.EOF),r},n.parseType=function(e,n){const t=new p(e,n);t.expectToken(c.TokenKind.SOF);const r=t.parseTypeReference();return t.expectToken(c.TokenKind.EOF),r},n.parseValue=function(e,n){const t=new p(e,n);t.expectToken(c.TokenKind.SOF);const r=t.parseValueLiteral(!1);return t.expectToken(c.TokenKind.EOF),r};var r=t(338),i=t(1807),o=t(8333),a=t(2828),s=t(4274),u=t(2412),c=t(3175);class p{constructor(e,n={}){const t=(0,u.isSource)(e)?e:new u.Source(e);this._lexer=new s.Lexer(t),this._options=n,this._tokenCounter=0}parseName(){const e=this.expectToken(c.TokenKind.NAME);return this.node(e,{kind:a.Kind.NAME,value:e.value})}parseDocument(){return this.node(this._lexer.token,{kind:a.Kind.DOCUMENT,definitions:this.many(c.TokenKind.SOF,this.parseDefinition,c.TokenKind.EOF)})}parseDefinition(){if(this.peek(c.TokenKind.BRACE_L))return this.parseOperationDefinition();const e=this.peekDescription(),n=e?this._lexer.lookahead():this._lexer.token;if(n.kind===c.TokenKind.NAME){switch(n.value){case"schema":return this.parseSchemaDefinition();case"scalar":return this.parseScalarTypeDefinition();case"type":return this.parseObjectTypeDefinition();case"interface":return this.parseInterfaceTypeDefinition();case"union":return this.parseUnionTypeDefinition();case"enum":return this.parseEnumTypeDefinition();case"input":return this.parseInputObjectTypeDefinition();case"directive":return this.parseDirectiveDefinition()}if(e)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,"Unexpected description, descriptions are supported only on type definitions.");switch(n.value){case"query":case"mutation":case"subscription":return this.parseOperationDefinition();case"fragment":return this.parseFragmentDefinition();case"extend":return this.parseTypeSystemExtension()}}throw this.unexpected(n)}parseOperationDefinition(){const e=this._lexer.token;if(this.peek(c.TokenKind.BRACE_L))return this.node(e,{kind:a.Kind.OPERATION_DEFINITION,operation:i.OperationTypeNode.QUERY,name:void 0,variableDefinitions:[],directives:[],selectionSet:this.parseSelectionSet()});const n=this.parseOperationType();let t;return this.peek(c.TokenKind.NAME)&&(t=this.parseName()),this.node(e,{kind:a.Kind.OPERATION_DEFINITION,operation:n,name:t,variableDefinitions:this.parseVariableDefinitions(),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseOperationType(){const e=this.expectToken(c.TokenKind.NAME);switch(e.value){case"query":return i.OperationTypeNode.QUERY;case"mutation":return i.OperationTypeNode.MUTATION;case"subscription":return i.OperationTypeNode.SUBSCRIPTION}throw this.unexpected(e)}parseVariableDefinitions(){return this.optionalMany(c.TokenKind.PAREN_L,this.parseVariableDefinition,c.TokenKind.PAREN_R)}parseVariableDefinition(){return this.node(this._lexer.token,{kind:a.Kind.VARIABLE_DEFINITION,variable:this.parseVariable(),type:(this.expectToken(c.TokenKind.COLON),this.parseTypeReference()),defaultValue:this.expectOptionalToken(c.TokenKind.EQUALS)?this.parseConstValueLiteral():void 0,directives:this.parseConstDirectives()})}parseVariable(){const e=this._lexer.token;return this.expectToken(c.TokenKind.DOLLAR),this.node(e,{kind:a.Kind.VARIABLE,name:this.parseName()})}parseSelectionSet(){return this.node(this._lexer.token,{kind:a.Kind.SELECTION_SET,selections:this.many(c.TokenKind.BRACE_L,this.parseSelection,c.TokenKind.BRACE_R)})}parseSelection(){return this.peek(c.TokenKind.SPREAD)?this.parseFragment():this.parseField()}parseField(){const e=this._lexer.token,n=this.parseName();let t,r;return this.expectOptionalToken(c.TokenKind.COLON)?(t=n,r=this.parseName()):r=n,this.node(e,{kind:a.Kind.FIELD,alias:t,name:r,arguments:this.parseArguments(!1),directives:this.parseDirectives(!1),selectionSet:this.peek(c.TokenKind.BRACE_L)?this.parseSelectionSet():void 0})}parseArguments(e){const n=e?this.parseConstArgument:this.parseArgument;return this.optionalMany(c.TokenKind.PAREN_L,n,c.TokenKind.PAREN_R)}parseArgument(e=!1){const n=this._lexer.token,t=this.parseName();return this.expectToken(c.TokenKind.COLON),this.node(n,{kind:a.Kind.ARGUMENT,name:t,value:this.parseValueLiteral(e)})}parseConstArgument(){return this.parseArgument(!0)}parseFragment(){const e=this._lexer.token;this.expectToken(c.TokenKind.SPREAD);const n=this.expectOptionalKeyword("on");return!n&&this.peek(c.TokenKind.NAME)?this.node(e,{kind:a.Kind.FRAGMENT_SPREAD,name:this.parseFragmentName(),directives:this.parseDirectives(!1)}):this.node(e,{kind:a.Kind.INLINE_FRAGMENT,typeCondition:n?this.parseNamedType():void 0,directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentDefinition(){const e=this._lexer.token;return this.expectKeyword("fragment"),!0===this._options.allowLegacyFragmentVariables?this.node(e,{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),variableDefinitions:this.parseVariableDefinitions(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()}):this.node(e,{kind:a.Kind.FRAGMENT_DEFINITION,name:this.parseFragmentName(),typeCondition:(this.expectKeyword("on"),this.parseNamedType()),directives:this.parseDirectives(!1),selectionSet:this.parseSelectionSet()})}parseFragmentName(){if("on"===this._lexer.token.value)throw this.unexpected();return this.parseName()}parseValueLiteral(e){const n=this._lexer.token;switch(n.kind){case c.TokenKind.BRACKET_L:return this.parseList(e);case c.TokenKind.BRACE_L:return this.parseObject(e);case c.TokenKind.INT:return this.advanceLexer(),this.node(n,{kind:a.Kind.INT,value:n.value});case c.TokenKind.FLOAT:return this.advanceLexer(),this.node(n,{kind:a.Kind.FLOAT,value:n.value});case c.TokenKind.STRING:case c.TokenKind.BLOCK_STRING:return this.parseStringLiteral();case c.TokenKind.NAME:switch(this.advanceLexer(),n.value){case"true":return this.node(n,{kind:a.Kind.BOOLEAN,value:!0});case"false":return this.node(n,{kind:a.Kind.BOOLEAN,value:!1});case"null":return this.node(n,{kind:a.Kind.NULL});default:return this.node(n,{kind:a.Kind.ENUM,value:n.value})}case c.TokenKind.DOLLAR:if(e){if(this.expectToken(c.TokenKind.DOLLAR),this._lexer.token.kind===c.TokenKind.NAME){const e=this._lexer.token.value;throw(0,r.syntaxError)(this._lexer.source,n.start,`Unexpected variable "$${e}" in constant value.`)}throw this.unexpected(n)}return this.parseVariable();default:throw this.unexpected()}}parseConstValueLiteral(){return this.parseValueLiteral(!0)}parseStringLiteral(){const e=this._lexer.token;return this.advanceLexer(),this.node(e,{kind:a.Kind.STRING,value:e.value,block:e.kind===c.TokenKind.BLOCK_STRING})}parseList(e){return this.node(this._lexer.token,{kind:a.Kind.LIST,values:this.any(c.TokenKind.BRACKET_L,(()=>this.parseValueLiteral(e)),c.TokenKind.BRACKET_R)})}parseObject(e){return this.node(this._lexer.token,{kind:a.Kind.OBJECT,fields:this.any(c.TokenKind.BRACE_L,(()=>this.parseObjectField(e)),c.TokenKind.BRACE_R)})}parseObjectField(e){const n=this._lexer.token,t=this.parseName();return this.expectToken(c.TokenKind.COLON),this.node(n,{kind:a.Kind.OBJECT_FIELD,name:t,value:this.parseValueLiteral(e)})}parseDirectives(e){const n=[];for(;this.peek(c.TokenKind.AT);)n.push(this.parseDirective(e));return n}parseConstDirectives(){return this.parseDirectives(!0)}parseDirective(e){const n=this._lexer.token;return this.expectToken(c.TokenKind.AT),this.node(n,{kind:a.Kind.DIRECTIVE,name:this.parseName(),arguments:this.parseArguments(e)})}parseTypeReference(){const e=this._lexer.token;let n;if(this.expectOptionalToken(c.TokenKind.BRACKET_L)){const t=this.parseTypeReference();this.expectToken(c.TokenKind.BRACKET_R),n=this.node(e,{kind:a.Kind.LIST_TYPE,type:t})}else n=this.parseNamedType();return this.expectOptionalToken(c.TokenKind.BANG)?this.node(e,{kind:a.Kind.NON_NULL_TYPE,type:n}):n}parseNamedType(){return this.node(this._lexer.token,{kind:a.Kind.NAMED_TYPE,name:this.parseName()})}peekDescription(){return this.peek(c.TokenKind.STRING)||this.peek(c.TokenKind.BLOCK_STRING)}parseDescription(){if(this.peekDescription())return this.parseStringLiteral()}parseSchemaDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("schema");const t=this.parseConstDirectives(),r=this.many(c.TokenKind.BRACE_L,this.parseOperationTypeDefinition,c.TokenKind.BRACE_R);return this.node(e,{kind:a.Kind.SCHEMA_DEFINITION,description:n,directives:t,operationTypes:r})}parseOperationTypeDefinition(){const e=this._lexer.token,n=this.parseOperationType();this.expectToken(c.TokenKind.COLON);const t=this.parseNamedType();return this.node(e,{kind:a.Kind.OPERATION_TYPE_DEFINITION,operation:n,type:t})}parseScalarTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("scalar");const t=this.parseName(),r=this.parseConstDirectives();return this.node(e,{kind:a.Kind.SCALAR_TYPE_DEFINITION,description:n,name:t,directives:r})}parseObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("type");const t=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.Kind.OBJECT_TYPE_DEFINITION,description:n,name:t,interfaces:r,directives:i,fields:o})}parseImplementsInterfaces(){return this.expectOptionalKeyword("implements")?this.delimitedMany(c.TokenKind.AMP,this.parseNamedType):[]}parseFieldsDefinition(){return this.optionalMany(c.TokenKind.BRACE_L,this.parseFieldDefinition,c.TokenKind.BRACE_R)}parseFieldDefinition(){const e=this._lexer.token,n=this.parseDescription(),t=this.parseName(),r=this.parseArgumentDefs();this.expectToken(c.TokenKind.COLON);const i=this.parseTypeReference(),o=this.parseConstDirectives();return this.node(e,{kind:a.Kind.FIELD_DEFINITION,description:n,name:t,arguments:r,type:i,directives:o})}parseArgumentDefs(){return this.optionalMany(c.TokenKind.PAREN_L,this.parseInputValueDef,c.TokenKind.PAREN_R)}parseInputValueDef(){const e=this._lexer.token,n=this.parseDescription(),t=this.parseName();this.expectToken(c.TokenKind.COLON);const r=this.parseTypeReference();let i;this.expectOptionalToken(c.TokenKind.EQUALS)&&(i=this.parseConstValueLiteral());const o=this.parseConstDirectives();return this.node(e,{kind:a.Kind.INPUT_VALUE_DEFINITION,description:n,name:t,type:r,defaultValue:i,directives:o})}parseInterfaceTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("interface");const t=this.parseName(),r=this.parseImplementsInterfaces(),i=this.parseConstDirectives(),o=this.parseFieldsDefinition();return this.node(e,{kind:a.Kind.INTERFACE_TYPE_DEFINITION,description:n,name:t,interfaces:r,directives:i,fields:o})}parseUnionTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("union");const t=this.parseName(),r=this.parseConstDirectives(),i=this.parseUnionMemberTypes();return this.node(e,{kind:a.Kind.UNION_TYPE_DEFINITION,description:n,name:t,directives:r,types:i})}parseUnionMemberTypes(){return this.expectOptionalToken(c.TokenKind.EQUALS)?this.delimitedMany(c.TokenKind.PIPE,this.parseNamedType):[]}parseEnumTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("enum");const t=this.parseName(),r=this.parseConstDirectives(),i=this.parseEnumValuesDefinition();return this.node(e,{kind:a.Kind.ENUM_TYPE_DEFINITION,description:n,name:t,directives:r,values:i})}parseEnumValuesDefinition(){return this.optionalMany(c.TokenKind.BRACE_L,this.parseEnumValueDefinition,c.TokenKind.BRACE_R)}parseEnumValueDefinition(){const e=this._lexer.token,n=this.parseDescription(),t=this.parseEnumValueName(),r=this.parseConstDirectives();return this.node(e,{kind:a.Kind.ENUM_VALUE_DEFINITION,description:n,name:t,directives:r})}parseEnumValueName(){if("true"===this._lexer.token.value||"false"===this._lexer.token.value||"null"===this._lexer.token.value)throw(0,r.syntaxError)(this._lexer.source,this._lexer.token.start,`${l(this._lexer.token)} is reserved and cannot be used for an enum value.`);return this.parseName()}parseInputObjectTypeDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("input");const t=this.parseName(),r=this.parseConstDirectives(),i=this.parseInputFieldsDefinition();return this.node(e,{kind:a.Kind.INPUT_OBJECT_TYPE_DEFINITION,description:n,name:t,directives:r,fields:i})}parseInputFieldsDefinition(){return this.optionalMany(c.TokenKind.BRACE_L,this.parseInputValueDef,c.TokenKind.BRACE_R)}parseTypeSystemExtension(){const e=this._lexer.lookahead();if(e.kind===c.TokenKind.NAME)switch(e.value){case"schema":return this.parseSchemaExtension();case"scalar":return this.parseScalarTypeExtension();case"type":return this.parseObjectTypeExtension();case"interface":return this.parseInterfaceTypeExtension();case"union":return this.parseUnionTypeExtension();case"enum":return this.parseEnumTypeExtension();case"input":return this.parseInputObjectTypeExtension()}throw this.unexpected(e)}parseSchemaExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("schema");const n=this.parseConstDirectives(),t=this.optionalMany(c.TokenKind.BRACE_L,this.parseOperationTypeDefinition,c.TokenKind.BRACE_R);if(0===n.length&&0===t.length)throw this.unexpected();return this.node(e,{kind:a.Kind.SCHEMA_EXTENSION,directives:n,operationTypes:t})}parseScalarTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("scalar");const n=this.parseName(),t=this.parseConstDirectives();if(0===t.length)throw this.unexpected();return this.node(e,{kind:a.Kind.SCALAR_TYPE_EXTENSION,name:n,directives:t})}parseObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("type");const n=this.parseName(),t=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===t.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.Kind.OBJECT_TYPE_EXTENSION,name:n,interfaces:t,directives:r,fields:i})}parseInterfaceTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("interface");const n=this.parseName(),t=this.parseImplementsInterfaces(),r=this.parseConstDirectives(),i=this.parseFieldsDefinition();if(0===t.length&&0===r.length&&0===i.length)throw this.unexpected();return this.node(e,{kind:a.Kind.INTERFACE_TYPE_EXTENSION,name:n,interfaces:t,directives:r,fields:i})}parseUnionTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("union");const n=this.parseName(),t=this.parseConstDirectives(),r=this.parseUnionMemberTypes();if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.UNION_TYPE_EXTENSION,name:n,directives:t,types:r})}parseEnumTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("enum");const n=this.parseName(),t=this.parseConstDirectives(),r=this.parseEnumValuesDefinition();if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.ENUM_TYPE_EXTENSION,name:n,directives:t,values:r})}parseInputObjectTypeExtension(){const e=this._lexer.token;this.expectKeyword("extend"),this.expectKeyword("input");const n=this.parseName(),t=this.parseConstDirectives(),r=this.parseInputFieldsDefinition();if(0===t.length&&0===r.length)throw this.unexpected();return this.node(e,{kind:a.Kind.INPUT_OBJECT_TYPE_EXTENSION,name:n,directives:t,fields:r})}parseDirectiveDefinition(){const e=this._lexer.token,n=this.parseDescription();this.expectKeyword("directive"),this.expectToken(c.TokenKind.AT);const t=this.parseName(),r=this.parseArgumentDefs(),i=this.expectOptionalKeyword("repeatable");this.expectKeyword("on");const o=this.parseDirectiveLocations();return this.node(e,{kind:a.Kind.DIRECTIVE_DEFINITION,description:n,name:t,arguments:r,repeatable:i,locations:o})}parseDirectiveLocations(){return this.delimitedMany(c.TokenKind.PIPE,this.parseDirectiveLocation)}parseDirectiveLocation(){const e=this._lexer.token,n=this.parseName();if(Object.prototype.hasOwnProperty.call(o.DirectiveLocation,n.value))return n;throw this.unexpected(e)}node(e,n){return!0!==this._options.noLocation&&(n.loc=new i.Location(e,this._lexer.lastToken,this._lexer.source)),n}peek(e){return this._lexer.token.kind===e}expectToken(e){const n=this._lexer.token;if(n.kind===e)return this.advanceLexer(),n;throw(0,r.syntaxError)(this._lexer.source,n.start,`Expected ${d(e)}, found ${l(n)}.`)}expectOptionalToken(e){return this._lexer.token.kind===e&&(this.advanceLexer(),!0)}expectKeyword(e){const n=this._lexer.token;if(n.kind!==c.TokenKind.NAME||n.value!==e)throw(0,r.syntaxError)(this._lexer.source,n.start,`Expected "${e}", found ${l(n)}.`);this.advanceLexer()}expectOptionalKeyword(e){const n=this._lexer.token;return n.kind===c.TokenKind.NAME&&n.value===e&&(this.advanceLexer(),!0)}unexpected(e){const n=null!=e?e:this._lexer.token;return(0,r.syntaxError)(this._lexer.source,n.start,`Unexpected ${l(n)}.`)}any(e,n,t){this.expectToken(e);const r=[];for(;!this.expectOptionalToken(t);)r.push(n.call(this));return r}optionalMany(e,n,t){if(this.expectOptionalToken(e)){const e=[];do{e.push(n.call(this))}while(!this.expectOptionalToken(t));return e}return[]}many(e,n,t){this.expectToken(e);const r=[];do{r.push(n.call(this))}while(!this.expectOptionalToken(t));return r}delimitedMany(e,n){this.expectOptionalToken(e);const t=[];do{t.push(n.call(this))}while(this.expectOptionalToken(e));return t}advanceLexer(){const{maxTokens:e}=this._options,n=this._lexer.advance();if(void 0!==e&&n.kind!==c.TokenKind.EOF&&(++this._tokenCounter,this._tokenCounter>e))throw(0,r.syntaxError)(this._lexer.source,n.start,`Document contains more that ${e} tokens. Parsing aborted.`)}}function l(e){const n=e.value;return d(e.kind)+(null!=n?` "${n}"`:"")}function d(e){return(0,s.isPunctuatorTokenKind)(e)?`"${e}"`:e}n.Parser=p},1352:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.isConstValueNode=function e(n){return o(n)&&(n.kind===r.Kind.LIST?n.values.some(e):n.kind===r.Kind.OBJECT?n.fields.some((n=>e(n.value))):n.kind!==r.Kind.VARIABLE)},n.isDefinitionNode=function(e){return i(e)||a(e)||u(e)},n.isExecutableDefinitionNode=i,n.isSelectionNode=function(e){return e.kind===r.Kind.FIELD||e.kind===r.Kind.FRAGMENT_SPREAD||e.kind===r.Kind.INLINE_FRAGMENT},n.isTypeDefinitionNode=s,n.isTypeExtensionNode=c,n.isTypeNode=function(e){return e.kind===r.Kind.NAMED_TYPE||e.kind===r.Kind.LIST_TYPE||e.kind===r.Kind.NON_NULL_TYPE},n.isTypeSystemDefinitionNode=a,n.isTypeSystemExtensionNode=u,n.isValueNode=o;var r=t(2828);function i(e){return e.kind===r.Kind.OPERATION_DEFINITION||e.kind===r.Kind.FRAGMENT_DEFINITION}function o(e){return e.kind===r.Kind.VARIABLE||e.kind===r.Kind.INT||e.kind===r.Kind.FLOAT||e.kind===r.Kind.STRING||e.kind===r.Kind.BOOLEAN||e.kind===r.Kind.NULL||e.kind===r.Kind.ENUM||e.kind===r.Kind.LIST||e.kind===r.Kind.OBJECT}function a(e){return e.kind===r.Kind.SCHEMA_DEFINITION||s(e)||e.kind===r.Kind.DIRECTIVE_DEFINITION}function s(e){return e.kind===r.Kind.SCALAR_TYPE_DEFINITION||e.kind===r.Kind.OBJECT_TYPE_DEFINITION||e.kind===r.Kind.INTERFACE_TYPE_DEFINITION||e.kind===r.Kind.UNION_TYPE_DEFINITION||e.kind===r.Kind.ENUM_TYPE_DEFINITION||e.kind===r.Kind.INPUT_OBJECT_TYPE_DEFINITION}function u(e){return e.kind===r.Kind.SCHEMA_EXTENSION||c(e)}function c(e){return e.kind===r.Kind.SCALAR_TYPE_EXTENSION||e.kind===r.Kind.OBJECT_TYPE_EXTENSION||e.kind===r.Kind.INTERFACE_TYPE_EXTENSION||e.kind===r.Kind.UNION_TYPE_EXTENSION||e.kind===r.Kind.ENUM_TYPE_EXTENSION||e.kind===r.Kind.INPUT_OBJECT_TYPE_EXTENSION}},8038:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.printLocation=function(e){return i(e.source,(0,r.getLocation)(e.source,e.start))},n.printSourceLocation=i;var r=t(9016);function i(e,n){const t=e.locationOffset.column-1,r="".padStart(t)+e.body,i=n.line-1,a=e.locationOffset.line-1,s=n.line+a,u=1===n.line?t:0,c=n.column+u,p=`${e.name}:${s}:${c}\n`,l=r.split(/\r\n|[\n\r]/g),d=l[i];if(d.length>120){const e=Math.floor(c/80),n=c%80,t=[];for(let e=0;e["|",e])),["|","^".padStart(n)],["|",t[e+1]]])}return p+o([[s-1+" |",l[i-1]],[`${s} |`,d],["|","^".padStart(c)],[`${s+1} |`,l[i+1]]])}function o(e){const n=e.filter((([e,n])=>void 0!==n)),t=Math.max(...n.map((([e])=>e.length)));return n.map((([e,n])=>e.padStart(t)+(n?" "+n:""))).join("\n")}},8942:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.printString=function(e){return`"${e.replace(t,r)}"`};const t=/[\x00-\x1f\x22\x5c\x7f-\x9f]/g;function r(e){return i[e.charCodeAt(0)]}const i=["\\u0000","\\u0001","\\u0002","\\u0003","\\u0004","\\u0005","\\u0006","\\u0007","\\b","\\t","\\n","\\u000B","\\f","\\r","\\u000E","\\u000F","\\u0010","\\u0011","\\u0012","\\u0013","\\u0014","\\u0015","\\u0016","\\u0017","\\u0018","\\u0019","\\u001A","\\u001B","\\u001C","\\u001D","\\u001E","\\u001F","","",'\\"',"","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\\\","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","\\u007F","\\u0080","\\u0081","\\u0082","\\u0083","\\u0084","\\u0085","\\u0086","\\u0087","\\u0088","\\u0089","\\u008A","\\u008B","\\u008C","\\u008D","\\u008E","\\u008F","\\u0090","\\u0091","\\u0092","\\u0093","\\u0094","\\u0095","\\u0096","\\u0097","\\u0098","\\u0099","\\u009A","\\u009B","\\u009C","\\u009D","\\u009E","\\u009F"]},3033:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.print=function(e){return(0,o.visit)(e,a)};var r=t(849),i=t(8942),o=t(285);const a={Name:{leave:e=>e.value},Variable:{leave:e=>"$"+e.name},Document:{leave:e=>s(e.definitions,"\n\n")},OperationDefinition:{leave(e){const n=c("(",s(e.variableDefinitions,", "),")"),t=s([e.operation,s([e.name,n]),s(e.directives," ")]," ");return("query"===t?"":t+" ")+e.selectionSet}},VariableDefinition:{leave:({variable:e,type:n,defaultValue:t,directives:r})=>e+": "+n+c(" = ",t)+c(" ",s(r," "))},SelectionSet:{leave:({selections:e})=>u(e)},Field:{leave({alias:e,name:n,arguments:t,directives:r,selectionSet:i}){const o=c("",e,": ")+n;let a=o+c("(",s(t,", "),")");return a.length>80&&(a=o+c("(\n",p(s(t,"\n")),"\n)")),s([a,s(r," "),i]," ")}},Argument:{leave:({name:e,value:n})=>e+": "+n},FragmentSpread:{leave:({name:e,directives:n})=>"..."+e+c(" ",s(n," "))},InlineFragment:{leave:({typeCondition:e,directives:n,selectionSet:t})=>s(["...",c("on ",e),s(n," "),t]," ")},FragmentDefinition:{leave:({name:e,typeCondition:n,variableDefinitions:t,directives:r,selectionSet:i})=>`fragment ${e}${c("(",s(t,", "),")")} on ${n} ${c("",s(r," ")," ")}`+i},IntValue:{leave:({value:e})=>e},FloatValue:{leave:({value:e})=>e},StringValue:{leave:({value:e,block:n})=>n?(0,r.printBlockString)(e):(0,i.printString)(e)},BooleanValue:{leave:({value:e})=>e?"true":"false"},NullValue:{leave:()=>"null"},EnumValue:{leave:({value:e})=>e},ListValue:{leave:({values:e})=>"["+s(e,", ")+"]"},ObjectValue:{leave:({fields:e})=>"{"+s(e,", ")+"}"},ObjectField:{leave:({name:e,value:n})=>e+": "+n},Directive:{leave:({name:e,arguments:n})=>"@"+e+c("(",s(n,", "),")")},NamedType:{leave:({name:e})=>e},ListType:{leave:({type:e})=>"["+e+"]"},NonNullType:{leave:({type:e})=>e+"!"},SchemaDefinition:{leave:({description:e,directives:n,operationTypes:t})=>c("",e,"\n")+s(["schema",s(n," "),u(t)]," ")},OperationTypeDefinition:{leave:({operation:e,type:n})=>e+": "+n},ScalarTypeDefinition:{leave:({description:e,name:n,directives:t})=>c("",e,"\n")+s(["scalar",n,s(t," ")]," ")},ObjectTypeDefinition:{leave:({description:e,name:n,interfaces:t,directives:r,fields:i})=>c("",e,"\n")+s(["type",n,c("implements ",s(t," & ")),s(r," "),u(i)]," ")},FieldDefinition:{leave:({description:e,name:n,arguments:t,type:r,directives:i})=>c("",e,"\n")+n+(l(t)?c("(\n",p(s(t,"\n")),"\n)"):c("(",s(t,", "),")"))+": "+r+c(" ",s(i," "))},InputValueDefinition:{leave:({description:e,name:n,type:t,defaultValue:r,directives:i})=>c("",e,"\n")+s([n+": "+t,c("= ",r),s(i," ")]," ")},InterfaceTypeDefinition:{leave:({description:e,name:n,interfaces:t,directives:r,fields:i})=>c("",e,"\n")+s(["interface",n,c("implements ",s(t," & ")),s(r," "),u(i)]," ")},UnionTypeDefinition:{leave:({description:e,name:n,directives:t,types:r})=>c("",e,"\n")+s(["union",n,s(t," "),c("= ",s(r," | "))]," ")},EnumTypeDefinition:{leave:({description:e,name:n,directives:t,values:r})=>c("",e,"\n")+s(["enum",n,s(t," "),u(r)]," ")},EnumValueDefinition:{leave:({description:e,name:n,directives:t})=>c("",e,"\n")+s([n,s(t," ")]," ")},InputObjectTypeDefinition:{leave:({description:e,name:n,directives:t,fields:r})=>c("",e,"\n")+s(["input",n,s(t," "),u(r)]," ")},DirectiveDefinition:{leave:({description:e,name:n,arguments:t,repeatable:r,locations:i})=>c("",e,"\n")+"directive @"+n+(l(t)?c("(\n",p(s(t,"\n")),"\n)"):c("(",s(t,", "),")"))+(r?" repeatable":"")+" on "+s(i," | ")},SchemaExtension:{leave:({directives:e,operationTypes:n})=>s(["extend schema",s(e," "),u(n)]," ")},ScalarTypeExtension:{leave:({name:e,directives:n})=>s(["extend scalar",e,s(n," ")]," ")},ObjectTypeExtension:{leave:({name:e,interfaces:n,directives:t,fields:r})=>s(["extend type",e,c("implements ",s(n," & ")),s(t," "),u(r)]," ")},InterfaceTypeExtension:{leave:({name:e,interfaces:n,directives:t,fields:r})=>s(["extend interface",e,c("implements ",s(n," & ")),s(t," "),u(r)]," ")},UnionTypeExtension:{leave:({name:e,directives:n,types:t})=>s(["extend union",e,s(n," "),c("= ",s(t," | "))]," ")},EnumTypeExtension:{leave:({name:e,directives:n,values:t})=>s(["extend enum",e,s(n," "),u(t)]," ")},InputObjectTypeExtension:{leave:({name:e,directives:n,fields:t})=>s(["extend input",e,s(n," "),u(t)]," ")}};function s(e,n=""){var t;return null!==(t=null==e?void 0:e.filter((e=>e)).join(n))&&void 0!==t?t:""}function u(e){return c("{\n",p(s(e,"\n")),"\n}")}function c(e,n,t=""){return null!=n&&""!==n?e+n+t:""}function p(e){return c(" ",e.replace(/\n/g,"\n "))}function l(e){var n;return null!==(n=null==e?void 0:e.some((e=>e.includes("\n"))))&&void 0!==n&&n}},2412:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.Source=void 0,n.isSource=function(e){return(0,o.instanceOf)(e,a)};var r=t(7242),i=t(8002),o=t(5752);class a{constructor(e,n="GraphQL request",t={line:1,column:1}){"string"==typeof e||(0,r.devAssert)(!1,`Body must be a string. Received: ${(0,i.inspect)(e)}.`),this.body=e,this.name=n,this.locationOffset=t,this.locationOffset.line>0||(0,r.devAssert)(!1,"line in locationOffset is 1-indexed and must be positive."),this.locationOffset.column>0||(0,r.devAssert)(!1,"column in locationOffset is 1-indexed and must be positive.")}get[Symbol.toStringTag](){return"Source"}}n.Source=a},3175:function(e,n){var t;Object.defineProperty(n,"__esModule",{value:!0}),n.TokenKind=void 0,n.TokenKind=t,function(e){e.SOF="",e.EOF="",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"}(t||(n.TokenKind=t={}))},285:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.BREAK=void 0,n.getEnterLeaveForKind=u,n.getVisitFn=function(e,n,t){const{enter:r,leave:i}=u(e,n);return t?i:r},n.visit=function(e,n,t=o.QueryDocumentKeys){const c=new Map;for(const e of Object.values(a.Kind))c.set(e,u(n,e));let p,l,d,f=Array.isArray(e),y=[e],m=-1,h=[],T=e;const b=[],v=[];do{m++;const e=m===y.length,a=e&&0!==h.length;if(e){if(l=0===v.length?void 0:b[b.length-1],T=d,d=v.pop(),a)if(f){T=T.slice();let e=0;for(const[n,t]of h){const r=n-e;null===t?(T.splice(r,1),e++):T[r]=t}}else{T=Object.defineProperties({},Object.getOwnPropertyDescriptors(T));for(const[e,n]of h)T[e]=n}m=p.index,y=p.keys,h=p.edits,f=p.inArray,p=p.prev}else if(d){if(l=f?m:y[m],T=d[l],null==T)continue;b.push(l)}let u;if(!Array.isArray(T)){var g,E;(0,o.isNode)(T)||(0,r.devAssert)(!1,`Invalid AST Node: ${(0,i.inspect)(T)}.`);const t=e?null===(g=c.get(T.kind))||void 0===g?void 0:g.leave:null===(E=c.get(T.kind))||void 0===E?void 0:E.enter;if(u=null==t?void 0:t.call(n,T,l,d,b,v),u===s)break;if(!1===u){if(!e){b.pop();continue}}else if(void 0!==u&&(h.push([l,u]),!e)){if(!(0,o.isNode)(u)){b.pop();continue}T=u}}var N;void 0===u&&a&&h.push([l,T]),e?b.pop():(p={inArray:f,index:m,keys:y,edits:h,prev:p},f=Array.isArray(T),y=f?T:null!==(N=t[T.kind])&&void 0!==N?N:[],m=-1,h=[],d&&v.push(d),d=T)}while(void 0!==p);return 0!==h.length?h[h.length-1][1]:e},n.visitInParallel=function(e){const n=new Array(e.length).fill(null),t=Object.create(null);for(const r of Object.values(a.Kind)){let i=!1;const o=new Array(e.length).fill(void 0),a=new Array(e.length).fill(void 0);for(let n=0;nu((0,T.valueFromASTUntyped)(e,n)),this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(s=e.extensionASTNodes)&&void 0!==s?s:[],null==e.specifiedByURL||"string"==typeof e.specifiedByURL||(0,r.devAssert)(!1,`${this.name} must provide "specifiedByURL" as a string, but got: ${(0,a.inspect)(e.specifiedByURL)}.`),null==e.serialize||"function"==typeof e.serialize||(0,r.devAssert)(!1,`${this.name} must provide "serialize" function. If this custom Scalar is also used as an input type, ensure "parseValue" and "parseLiteral" functions are also provided.`),e.parseLiteral&&("function"==typeof e.parseValue&&"function"==typeof e.parseLiteral||(0,r.devAssert)(!1,`${this.name} must provide both "parseValue" and "parseLiteral" functions.`))}get[Symbol.toStringTag](){return"GraphQLScalarType"}toConfig(){return{name:this.name,description:this.description,specifiedByURL:this.specifiedByURL,serialize:this.serialize,parseValue:this.parseValue,parseLiteral:this.parseLiteral,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}n.GraphQLScalarType=M;class K{constructor(e){var n;this.name=(0,b.assertName)(e.name),this.description=e.description,this.isTypeOf=e.isTypeOf,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._fields=()=>$(e),this._interfaces=()=>Q(e),null==e.isTypeOf||"function"==typeof e.isTypeOf||(0,r.devAssert)(!1,`${this.name} must provide "isTypeOf" as a function, but got: ${(0,a.inspect)(e.isTypeOf)}.`)}get[Symbol.toStringTag](){return"GraphQLObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:q(this.getFields()),isTypeOf:this.isTypeOf,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function Q(e){var n;const t=V(null!==(n=e.interfaces)&&void 0!==n?n:[]);return Array.isArray(t)||(0,r.devAssert)(!1,`${e.name} interfaces must be an Array or a function which returns an Array.`),t}function $(e){const n=C(e.fields);return B(n)||(0,r.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,l.mapValue)(n,((n,t)=>{var i;B(n)||(0,r.devAssert)(!1,`${e.name}.${t} field config must be an object.`),null==n.resolve||"function"==typeof n.resolve||(0,r.devAssert)(!1,`${e.name}.${t} field resolver must be a function if provided, but got: ${(0,a.inspect)(n.resolve)}.`);const o=null!==(i=n.args)&&void 0!==i?i:{};return B(o)||(0,r.devAssert)(!1,`${e.name}.${t} args must be an object with argument names as keys.`),{name:(0,b.assertName)(t),description:n.description,type:n.type,args:U(o),resolve:n.resolve,subscribe:n.subscribe,deprecationReason:n.deprecationReason,extensions:(0,f.toObjMap)(n.extensions),astNode:n.astNode}}))}function U(e){return Object.entries(e).map((([e,n])=>({name:(0,b.assertName)(e),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,f.toObjMap)(n.extensions),astNode:n.astNode})))}function B(e){return(0,u.isObjectLike)(e)&&!Array.isArray(e)}function q(e){return(0,l.mapValue)(e,(e=>({description:e.description,type:e.type,args:Y(e.args),resolve:e.resolve,subscribe:e.subscribe,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}function Y(e){return(0,p.keyValMap)(e,(e=>e.name),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})))}n.GraphQLObjectType=K;class J{constructor(e){var n;this.name=(0,b.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._fields=$.bind(void 0,e),this._interfaces=Q.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLInterfaceType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}getInterfaces(){return"function"==typeof this._interfaces&&(this._interfaces=this._interfaces()),this._interfaces}toConfig(){return{name:this.name,description:this.description,interfaces:this.getInterfaces(),fields:q(this.getFields()),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}n.GraphQLInterfaceType=J;class X{constructor(e){var n;this.name=(0,b.assertName)(e.name),this.description=e.description,this.resolveType=e.resolveType,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._types=H.bind(void 0,e),null==e.resolveType||"function"==typeof e.resolveType||(0,r.devAssert)(!1,`${this.name} must provide "resolveType" as a function, but got: ${(0,a.inspect)(e.resolveType)}.`)}get[Symbol.toStringTag](){return"GraphQLUnionType"}getTypes(){return"function"==typeof this._types&&(this._types=this._types()),this._types}toConfig(){return{name:this.name,description:this.description,types:this.getTypes(),resolveType:this.resolveType,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function H(e){const n=V(e.types);return Array.isArray(n)||(0,r.devAssert)(!1,`Must provide Array of types or a function which returns such an array for Union ${e.name}.`),n}n.GraphQLUnionType=X;class z{constructor(e){var n,t,i;this.name=(0,b.assertName)(e.name),this.description=e.description,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._values=(t=this.name,B(i=e.values)||(0,r.devAssert)(!1,`${t} values must be an object with value names as keys.`),Object.entries(i).map((([e,n])=>(B(n)||(0,r.devAssert)(!1,`${t}.${e} must refer to an object with a "value" key representing an internal value but got: ${(0,a.inspect)(n)}.`),{name:(0,b.assertEnumValueName)(e),description:n.description,value:void 0!==n.value?n.value:e,deprecationReason:n.deprecationReason,extensions:(0,f.toObjMap)(n.extensions),astNode:n.astNode})))),this._valueLookup=new Map(this._values.map((e=>[e.value,e]))),this._nameLookup=(0,c.keyMap)(this._values,(e=>e.name))}get[Symbol.toStringTag](){return"GraphQLEnumType"}getValues(){return this._values}getValue(e){return this._nameLookup[e]}serialize(e){const n=this._valueLookup.get(e);if(void 0===n)throw new y.GraphQLError(`Enum "${this.name}" cannot represent value: ${(0,a.inspect)(e)}`);return n.name}parseValue(e){if("string"!=typeof e){const n=(0,a.inspect)(e);throw new y.GraphQLError(`Enum "${this.name}" cannot represent non-string value: ${n}.`+W(this,n))}const n=this.getValue(e);if(null==n)throw new y.GraphQLError(`Value "${e}" does not exist in "${this.name}" enum.`+W(this,e));return n.value}parseLiteral(e,n){if(e.kind!==m.Kind.ENUM){const n=(0,h.print)(e);throw new y.GraphQLError(`Enum "${this.name}" cannot represent non-enum value: ${n}.`+W(this,n),{nodes:e})}const t=this.getValue(e.value);if(null==t){const n=(0,h.print)(e);throw new y.GraphQLError(`Value "${n}" does not exist in "${this.name}" enum.`+W(this,n),{nodes:e})}return t.value}toConfig(){const e=(0,p.keyValMap)(this.getValues(),(e=>e.name),(e=>({description:e.description,value:e.value,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,values:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function W(e,n){const t=e.getValues().map((e=>e.name)),r=(0,d.suggestionList)(n,t);return(0,i.didYouMean)("the enum value",r)}n.GraphQLEnumType=z;class Z{constructor(e){var n;this.name=(0,b.assertName)(e.name),this.description=e.description,this.extensions=(0,f.toObjMap)(e.extensions),this.astNode=e.astNode,this.extensionASTNodes=null!==(n=e.extensionASTNodes)&&void 0!==n?n:[],this._fields=ee.bind(void 0,e)}get[Symbol.toStringTag](){return"GraphQLInputObjectType"}getFields(){return"function"==typeof this._fields&&(this._fields=this._fields()),this._fields}toConfig(){const e=(0,l.mapValue)(this.getFields(),(e=>({description:e.description,type:e.type,defaultValue:e.defaultValue,deprecationReason:e.deprecationReason,extensions:e.extensions,astNode:e.astNode})));return{name:this.name,description:this.description,fields:e,extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes}}toString(){return this.name}toJSON(){return this.toString()}}function ee(e){const n=C(e.fields);return B(n)||(0,r.devAssert)(!1,`${e.name} fields must be an object with field names as keys or a function which returns such an object.`),(0,l.mapValue)(n,((n,t)=>(!("resolve"in n)||(0,r.devAssert)(!1,`${e.name}.${t} field has a resolve property, but Input Types cannot define resolvers.`),{name:(0,b.assertName)(t),description:n.description,type:n.type,defaultValue:n.defaultValue,deprecationReason:n.deprecationReason,extensions:(0,f.toObjMap)(n.extensions),astNode:n.astNode})))}n.GraphQLInputObjectType=Z},7197:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.GraphQLSpecifiedByDirective=n.GraphQLSkipDirective=n.GraphQLIncludeDirective=n.GraphQLDirective=n.GraphQLDeprecatedDirective=n.DEFAULT_DEPRECATION_REASON=void 0,n.assertDirective=function(e){if(!d(e))throw new Error(`Expected ${(0,i.inspect)(e)} to be a GraphQL directive.`);return e},n.isDirective=d,n.isSpecifiedDirective=function(e){return v.some((({name:n})=>n===e.name))},n.specifiedDirectives=void 0;var r=t(7242),i=t(8002),o=t(5752),a=t(5690),s=t(7690),u=t(8333),c=t(3058),p=t(5003),l=t(2229);function d(e){return(0,o.instanceOf)(e,f)}class f{constructor(e){var n,t;this.name=(0,c.assertName)(e.name),this.description=e.description,this.locations=e.locations,this.isRepeatable=null!==(n=e.isRepeatable)&&void 0!==n&&n,this.extensions=(0,s.toObjMap)(e.extensions),this.astNode=e.astNode,Array.isArray(e.locations)||(0,r.devAssert)(!1,`@${e.name} locations must be an Array.`);const i=null!==(t=e.args)&&void 0!==t?t:{};(0,a.isObjectLike)(i)&&!Array.isArray(i)||(0,r.devAssert)(!1,`@${e.name} args must be an object with argument names as keys.`),this.args=(0,p.defineArguments)(i)}get[Symbol.toStringTag](){return"GraphQLDirective"}toConfig(){return{name:this.name,description:this.description,locations:this.locations,args:(0,p.argsToArgsConfig)(this.args),isRepeatable:this.isRepeatable,extensions:this.extensions,astNode:this.astNode}}toString(){return"@"+this.name}toJSON(){return this.toString()}}n.GraphQLDirective=f;const y=new f({name:"include",description:"Directs the executor to include this field or fragment only when the `if` argument is true.",locations:[u.DirectiveLocation.FIELD,u.DirectiveLocation.FRAGMENT_SPREAD,u.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new p.GraphQLNonNull(l.GraphQLBoolean),description:"Included when true."}}});n.GraphQLIncludeDirective=y;const m=new f({name:"skip",description:"Directs the executor to skip this field or fragment when the `if` argument is true.",locations:[u.DirectiveLocation.FIELD,u.DirectiveLocation.FRAGMENT_SPREAD,u.DirectiveLocation.INLINE_FRAGMENT],args:{if:{type:new p.GraphQLNonNull(l.GraphQLBoolean),description:"Skipped when true."}}});n.GraphQLSkipDirective=m;const h="No longer supported";n.DEFAULT_DEPRECATION_REASON=h;const T=new f({name:"deprecated",description:"Marks an element of a GraphQL schema as no longer supported.",locations:[u.DirectiveLocation.FIELD_DEFINITION,u.DirectiveLocation.ARGUMENT_DEFINITION,u.DirectiveLocation.INPUT_FIELD_DEFINITION,u.DirectiveLocation.ENUM_VALUE],args:{reason:{type:l.GraphQLString,description:"Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted using the Markdown syntax, as specified by [CommonMark](https://commonmark.org/).",defaultValue:h}}});n.GraphQLDeprecatedDirective=T;const b=new f({name:"specifiedBy",description:"Exposes a URL that specifies the behavior of this scalar.",locations:[u.DirectiveLocation.SCALAR],args:{url:{type:new p.GraphQLNonNull(l.GraphQLString),description:"The URL that specifies the behavior of this scalar."}}});n.GraphQLSpecifiedByDirective=b;const v=Object.freeze([y,m,T,b]);n.specifiedDirectives=v},3226:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"DEFAULT_DEPRECATION_REASON",{enumerable:!0,get:function(){return o.DEFAULT_DEPRECATION_REASON}}),Object.defineProperty(n,"GRAPHQL_MAX_INT",{enumerable:!0,get:function(){return a.GRAPHQL_MAX_INT}}),Object.defineProperty(n,"GRAPHQL_MIN_INT",{enumerable:!0,get:function(){return a.GRAPHQL_MIN_INT}}),Object.defineProperty(n,"GraphQLBoolean",{enumerable:!0,get:function(){return a.GraphQLBoolean}}),Object.defineProperty(n,"GraphQLDeprecatedDirective",{enumerable:!0,get:function(){return o.GraphQLDeprecatedDirective}}),Object.defineProperty(n,"GraphQLDirective",{enumerable:!0,get:function(){return o.GraphQLDirective}}),Object.defineProperty(n,"GraphQLEnumType",{enumerable:!0,get:function(){return i.GraphQLEnumType}}),Object.defineProperty(n,"GraphQLFloat",{enumerable:!0,get:function(){return a.GraphQLFloat}}),Object.defineProperty(n,"GraphQLID",{enumerable:!0,get:function(){return a.GraphQLID}}),Object.defineProperty(n,"GraphQLIncludeDirective",{enumerable:!0,get:function(){return o.GraphQLIncludeDirective}}),Object.defineProperty(n,"GraphQLInputObjectType",{enumerable:!0,get:function(){return i.GraphQLInputObjectType}}),Object.defineProperty(n,"GraphQLInt",{enumerable:!0,get:function(){return a.GraphQLInt}}),Object.defineProperty(n,"GraphQLInterfaceType",{enumerable:!0,get:function(){return i.GraphQLInterfaceType}}),Object.defineProperty(n,"GraphQLList",{enumerable:!0,get:function(){return i.GraphQLList}}),Object.defineProperty(n,"GraphQLNonNull",{enumerable:!0,get:function(){return i.GraphQLNonNull}}),Object.defineProperty(n,"GraphQLObjectType",{enumerable:!0,get:function(){return i.GraphQLObjectType}}),Object.defineProperty(n,"GraphQLScalarType",{enumerable:!0,get:function(){return i.GraphQLScalarType}}),Object.defineProperty(n,"GraphQLSchema",{enumerable:!0,get:function(){return r.GraphQLSchema}}),Object.defineProperty(n,"GraphQLSkipDirective",{enumerable:!0,get:function(){return o.GraphQLSkipDirective}}),Object.defineProperty(n,"GraphQLSpecifiedByDirective",{enumerable:!0,get:function(){return o.GraphQLSpecifiedByDirective}}),Object.defineProperty(n,"GraphQLString",{enumerable:!0,get:function(){return a.GraphQLString}}),Object.defineProperty(n,"GraphQLUnionType",{enumerable:!0,get:function(){return i.GraphQLUnionType}}),Object.defineProperty(n,"SchemaMetaFieldDef",{enumerable:!0,get:function(){return s.SchemaMetaFieldDef}}),Object.defineProperty(n,"TypeKind",{enumerable:!0,get:function(){return s.TypeKind}}),Object.defineProperty(n,"TypeMetaFieldDef",{enumerable:!0,get:function(){return s.TypeMetaFieldDef}}),Object.defineProperty(n,"TypeNameMetaFieldDef",{enumerable:!0,get:function(){return s.TypeNameMetaFieldDef}}),Object.defineProperty(n,"__Directive",{enumerable:!0,get:function(){return s.__Directive}}),Object.defineProperty(n,"__DirectiveLocation",{enumerable:!0,get:function(){return s.__DirectiveLocation}}),Object.defineProperty(n,"__EnumValue",{enumerable:!0,get:function(){return s.__EnumValue}}),Object.defineProperty(n,"__Field",{enumerable:!0,get:function(){return s.__Field}}),Object.defineProperty(n,"__InputValue",{enumerable:!0,get:function(){return s.__InputValue}}),Object.defineProperty(n,"__Schema",{enumerable:!0,get:function(){return s.__Schema}}),Object.defineProperty(n,"__Type",{enumerable:!0,get:function(){return s.__Type}}),Object.defineProperty(n,"__TypeKind",{enumerable:!0,get:function(){return s.__TypeKind}}),Object.defineProperty(n,"assertAbstractType",{enumerable:!0,get:function(){return i.assertAbstractType}}),Object.defineProperty(n,"assertCompositeType",{enumerable:!0,get:function(){return i.assertCompositeType}}),Object.defineProperty(n,"assertDirective",{enumerable:!0,get:function(){return o.assertDirective}}),Object.defineProperty(n,"assertEnumType",{enumerable:!0,get:function(){return i.assertEnumType}}),Object.defineProperty(n,"assertEnumValueName",{enumerable:!0,get:function(){return c.assertEnumValueName}}),Object.defineProperty(n,"assertInputObjectType",{enumerable:!0,get:function(){return i.assertInputObjectType}}),Object.defineProperty(n,"assertInputType",{enumerable:!0,get:function(){return i.assertInputType}}),Object.defineProperty(n,"assertInterfaceType",{enumerable:!0,get:function(){return i.assertInterfaceType}}),Object.defineProperty(n,"assertLeafType",{enumerable:!0,get:function(){return i.assertLeafType}}),Object.defineProperty(n,"assertListType",{enumerable:!0,get:function(){return i.assertListType}}),Object.defineProperty(n,"assertName",{enumerable:!0,get:function(){return c.assertName}}),Object.defineProperty(n,"assertNamedType",{enumerable:!0,get:function(){return i.assertNamedType}}),Object.defineProperty(n,"assertNonNullType",{enumerable:!0,get:function(){return i.assertNonNullType}}),Object.defineProperty(n,"assertNullableType",{enumerable:!0,get:function(){return i.assertNullableType}}),Object.defineProperty(n,"assertObjectType",{enumerable:!0,get:function(){return i.assertObjectType}}),Object.defineProperty(n,"assertOutputType",{enumerable:!0,get:function(){return i.assertOutputType}}),Object.defineProperty(n,"assertScalarType",{enumerable:!0,get:function(){return i.assertScalarType}}),Object.defineProperty(n,"assertSchema",{enumerable:!0,get:function(){return r.assertSchema}}),Object.defineProperty(n,"assertType",{enumerable:!0,get:function(){return i.assertType}}),Object.defineProperty(n,"assertUnionType",{enumerable:!0,get:function(){return i.assertUnionType}}),Object.defineProperty(n,"assertValidSchema",{enumerable:!0,get:function(){return u.assertValidSchema}}),Object.defineProperty(n,"assertWrappingType",{enumerable:!0,get:function(){return i.assertWrappingType}}),Object.defineProperty(n,"getNamedType",{enumerable:!0,get:function(){return i.getNamedType}}),Object.defineProperty(n,"getNullableType",{enumerable:!0,get:function(){return i.getNullableType}}),Object.defineProperty(n,"introspectionTypes",{enumerable:!0,get:function(){return s.introspectionTypes}}),Object.defineProperty(n,"isAbstractType",{enumerable:!0,get:function(){return i.isAbstractType}}),Object.defineProperty(n,"isCompositeType",{enumerable:!0,get:function(){return i.isCompositeType}}),Object.defineProperty(n,"isDirective",{enumerable:!0,get:function(){return o.isDirective}}),Object.defineProperty(n,"isEnumType",{enumerable:!0,get:function(){return i.isEnumType}}),Object.defineProperty(n,"isInputObjectType",{enumerable:!0,get:function(){return i.isInputObjectType}}),Object.defineProperty(n,"isInputType",{enumerable:!0,get:function(){return i.isInputType}}),Object.defineProperty(n,"isInterfaceType",{enumerable:!0,get:function(){return i.isInterfaceType}}),Object.defineProperty(n,"isIntrospectionType",{enumerable:!0,get:function(){return s.isIntrospectionType}}),Object.defineProperty(n,"isLeafType",{enumerable:!0,get:function(){return i.isLeafType}}),Object.defineProperty(n,"isListType",{enumerable:!0,get:function(){return i.isListType}}),Object.defineProperty(n,"isNamedType",{enumerable:!0,get:function(){return i.isNamedType}}),Object.defineProperty(n,"isNonNullType",{enumerable:!0,get:function(){return i.isNonNullType}}),Object.defineProperty(n,"isNullableType",{enumerable:!0,get:function(){return i.isNullableType}}),Object.defineProperty(n,"isObjectType",{enumerable:!0,get:function(){return i.isObjectType}}),Object.defineProperty(n,"isOutputType",{enumerable:!0,get:function(){return i.isOutputType}}),Object.defineProperty(n,"isRequiredArgument",{enumerable:!0,get:function(){return i.isRequiredArgument}}),Object.defineProperty(n,"isRequiredInputField",{enumerable:!0,get:function(){return i.isRequiredInputField}}),Object.defineProperty(n,"isScalarType",{enumerable:!0,get:function(){return i.isScalarType}}),Object.defineProperty(n,"isSchema",{enumerable:!0,get:function(){return r.isSchema}}),Object.defineProperty(n,"isSpecifiedDirective",{enumerable:!0,get:function(){return o.isSpecifiedDirective}}),Object.defineProperty(n,"isSpecifiedScalarType",{enumerable:!0,get:function(){return a.isSpecifiedScalarType}}),Object.defineProperty(n,"isType",{enumerable:!0,get:function(){return i.isType}}),Object.defineProperty(n,"isUnionType",{enumerable:!0,get:function(){return i.isUnionType}}),Object.defineProperty(n,"isWrappingType",{enumerable:!0,get:function(){return i.isWrappingType}}),Object.defineProperty(n,"resolveObjMapThunk",{enumerable:!0,get:function(){return i.resolveObjMapThunk}}),Object.defineProperty(n,"resolveReadonlyArrayThunk",{enumerable:!0,get:function(){return i.resolveReadonlyArrayThunk}}),Object.defineProperty(n,"specifiedDirectives",{enumerable:!0,get:function(){return o.specifiedDirectives}}),Object.defineProperty(n,"specifiedScalarTypes",{enumerable:!0,get:function(){return a.specifiedScalarTypes}}),Object.defineProperty(n,"validateSchema",{enumerable:!0,get:function(){return u.validateSchema}});var r=t(6829),i=t(5003),o=t(7197),a=t(2229),s=t(8155),u=t(1671),c=t(3058)},8155:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.introspectionTypes=n.__TypeKind=n.__Type=n.__Schema=n.__InputValue=n.__Field=n.__EnumValue=n.__DirectiveLocation=n.__Directive=n.TypeNameMetaFieldDef=n.TypeMetaFieldDef=n.TypeKind=n.SchemaMetaFieldDef=void 0,n.isIntrospectionType=function(e){return N.some((({name:n})=>e.name===n))};var r=t(8002),i=t(7706),o=t(8333),a=t(3033),s=t(8115),u=t(5003),c=t(2229);const p=new u.GraphQLObjectType({name:"__Schema",description:"A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.",fields:()=>({description:{type:c.GraphQLString,resolve:e=>e.description},types:{description:"A list of all types supported by this server.",type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(f))),resolve:e=>Object.values(e.getTypeMap())},queryType:{description:"The type that query operations will be rooted at.",type:new u.GraphQLNonNull(f),resolve:e=>e.getQueryType()},mutationType:{description:"If this server supports mutation, the type that mutation operations will be rooted at.",type:f,resolve:e=>e.getMutationType()},subscriptionType:{description:"If this server support subscription, the type that subscription operations will be rooted at.",type:f,resolve:e=>e.getSubscriptionType()},directives:{description:"A list of all directives supported by this server.",type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(l))),resolve:e=>e.getDirectives()}})});n.__Schema=p;const l=new u.GraphQLObjectType({name:"__Directive",description:"A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.",fields:()=>({name:{type:new u.GraphQLNonNull(c.GraphQLString),resolve:e=>e.name},description:{type:c.GraphQLString,resolve:e=>e.description},isRepeatable:{type:new u.GraphQLNonNull(c.GraphQLBoolean),resolve:e=>e.isRepeatable},locations:{type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(d))),resolve:e=>e.locations},args:{type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(m))),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:n})=>n?e.args:e.args.filter((e=>null==e.deprecationReason))}})});n.__Directive=l;const d=new u.GraphQLEnumType({name:"__DirectiveLocation",description:"A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.",values:{QUERY:{value:o.DirectiveLocation.QUERY,description:"Location adjacent to a query operation."},MUTATION:{value:o.DirectiveLocation.MUTATION,description:"Location adjacent to a mutation operation."},SUBSCRIPTION:{value:o.DirectiveLocation.SUBSCRIPTION,description:"Location adjacent to a subscription operation."},FIELD:{value:o.DirectiveLocation.FIELD,description:"Location adjacent to a field."},FRAGMENT_DEFINITION:{value:o.DirectiveLocation.FRAGMENT_DEFINITION,description:"Location adjacent to a fragment definition."},FRAGMENT_SPREAD:{value:o.DirectiveLocation.FRAGMENT_SPREAD,description:"Location adjacent to a fragment spread."},INLINE_FRAGMENT:{value:o.DirectiveLocation.INLINE_FRAGMENT,description:"Location adjacent to an inline fragment."},VARIABLE_DEFINITION:{value:o.DirectiveLocation.VARIABLE_DEFINITION,description:"Location adjacent to a variable definition."},SCHEMA:{value:o.DirectiveLocation.SCHEMA,description:"Location adjacent to a schema definition."},SCALAR:{value:o.DirectiveLocation.SCALAR,description:"Location adjacent to a scalar definition."},OBJECT:{value:o.DirectiveLocation.OBJECT,description:"Location adjacent to an object type definition."},FIELD_DEFINITION:{value:o.DirectiveLocation.FIELD_DEFINITION,description:"Location adjacent to a field definition."},ARGUMENT_DEFINITION:{value:o.DirectiveLocation.ARGUMENT_DEFINITION,description:"Location adjacent to an argument definition."},INTERFACE:{value:o.DirectiveLocation.INTERFACE,description:"Location adjacent to an interface definition."},UNION:{value:o.DirectiveLocation.UNION,description:"Location adjacent to a union definition."},ENUM:{value:o.DirectiveLocation.ENUM,description:"Location adjacent to an enum definition."},ENUM_VALUE:{value:o.DirectiveLocation.ENUM_VALUE,description:"Location adjacent to an enum value definition."},INPUT_OBJECT:{value:o.DirectiveLocation.INPUT_OBJECT,description:"Location adjacent to an input object type definition."},INPUT_FIELD_DEFINITION:{value:o.DirectiveLocation.INPUT_FIELD_DEFINITION,description:"Location adjacent to an input object field definition."}}});n.__DirectiveLocation=d;const f=new u.GraphQLObjectType({name:"__Type",description:"The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name, description and optional `specifiedByURL`, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.",fields:()=>({kind:{type:new u.GraphQLNonNull(b),resolve:e=>(0,u.isScalarType)(e)?T.SCALAR:(0,u.isObjectType)(e)?T.OBJECT:(0,u.isInterfaceType)(e)?T.INTERFACE:(0,u.isUnionType)(e)?T.UNION:(0,u.isEnumType)(e)?T.ENUM:(0,u.isInputObjectType)(e)?T.INPUT_OBJECT:(0,u.isListType)(e)?T.LIST:(0,u.isNonNullType)(e)?T.NON_NULL:void(0,i.invariant)(!1,`Unexpected type: "${(0,r.inspect)(e)}".`)},name:{type:c.GraphQLString,resolve:e=>"name"in e?e.name:void 0},description:{type:c.GraphQLString,resolve:e=>"description"in e?e.description:void 0},specifiedByURL:{type:c.GraphQLString,resolve:e=>"specifiedByURL"in e?e.specifiedByURL:void 0},fields:{type:new u.GraphQLList(new u.GraphQLNonNull(y)),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:n}){if((0,u.isObjectType)(e)||(0,u.isInterfaceType)(e)){const t=Object.values(e.getFields());return n?t:t.filter((e=>null==e.deprecationReason))}}},interfaces:{type:new u.GraphQLList(new u.GraphQLNonNull(f)),resolve(e){if((0,u.isObjectType)(e)||(0,u.isInterfaceType)(e))return e.getInterfaces()}},possibleTypes:{type:new u.GraphQLList(new u.GraphQLNonNull(f)),resolve(e,n,t,{schema:r}){if((0,u.isAbstractType)(e))return r.getPossibleTypes(e)}},enumValues:{type:new u.GraphQLList(new u.GraphQLNonNull(h)),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:n}){if((0,u.isEnumType)(e)){const t=e.getValues();return n?t:t.filter((e=>null==e.deprecationReason))}}},inputFields:{type:new u.GraphQLList(new u.GraphQLNonNull(m)),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve(e,{includeDeprecated:n}){if((0,u.isInputObjectType)(e)){const t=Object.values(e.getFields());return n?t:t.filter((e=>null==e.deprecationReason))}}},ofType:{type:f,resolve:e=>"ofType"in e?e.ofType:void 0}})});n.__Type=f;const y=new u.GraphQLObjectType({name:"__Field",description:"Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.",fields:()=>({name:{type:new u.GraphQLNonNull(c.GraphQLString),resolve:e=>e.name},description:{type:c.GraphQLString,resolve:e=>e.description},args:{type:new u.GraphQLNonNull(new u.GraphQLList(new u.GraphQLNonNull(m))),args:{includeDeprecated:{type:c.GraphQLBoolean,defaultValue:!1}},resolve:(e,{includeDeprecated:n})=>n?e.args:e.args.filter((e=>null==e.deprecationReason))},type:{type:new u.GraphQLNonNull(f),resolve:e=>e.type},isDeprecated:{type:new u.GraphQLNonNull(c.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:c.GraphQLString,resolve:e=>e.deprecationReason}})});n.__Field=y;const m=new u.GraphQLObjectType({name:"__InputValue",description:"Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.",fields:()=>({name:{type:new u.GraphQLNonNull(c.GraphQLString),resolve:e=>e.name},description:{type:c.GraphQLString,resolve:e=>e.description},type:{type:new u.GraphQLNonNull(f),resolve:e=>e.type},defaultValue:{type:c.GraphQLString,description:"A GraphQL-formatted string representing the default value for this input value.",resolve(e){const{type:n,defaultValue:t}=e,r=(0,s.astFromValue)(t,n);return r?(0,a.print)(r):null}},isDeprecated:{type:new u.GraphQLNonNull(c.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:c.GraphQLString,resolve:e=>e.deprecationReason}})});n.__InputValue=m;const h=new u.GraphQLObjectType({name:"__EnumValue",description:"One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.",fields:()=>({name:{type:new u.GraphQLNonNull(c.GraphQLString),resolve:e=>e.name},description:{type:c.GraphQLString,resolve:e=>e.description},isDeprecated:{type:new u.GraphQLNonNull(c.GraphQLBoolean),resolve:e=>null!=e.deprecationReason},deprecationReason:{type:c.GraphQLString,resolve:e=>e.deprecationReason}})});var T;n.__EnumValue=h,n.TypeKind=T,function(e){e.SCALAR="SCALAR",e.OBJECT="OBJECT",e.INTERFACE="INTERFACE",e.UNION="UNION",e.ENUM="ENUM",e.INPUT_OBJECT="INPUT_OBJECT",e.LIST="LIST",e.NON_NULL="NON_NULL"}(T||(n.TypeKind=T={}));const b=new u.GraphQLEnumType({name:"__TypeKind",description:"An enum describing what kind of type a given `__Type` is.",values:{SCALAR:{value:T.SCALAR,description:"Indicates this type is a scalar."},OBJECT:{value:T.OBJECT,description:"Indicates this type is an object. `fields` and `interfaces` are valid fields."},INTERFACE:{value:T.INTERFACE,description:"Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields."},UNION:{value:T.UNION,description:"Indicates this type is a union. `possibleTypes` is a valid field."},ENUM:{value:T.ENUM,description:"Indicates this type is an enum. `enumValues` is a valid field."},INPUT_OBJECT:{value:T.INPUT_OBJECT,description:"Indicates this type is an input object. `inputFields` is a valid field."},LIST:{value:T.LIST,description:"Indicates this type is a list. `ofType` is a valid field."},NON_NULL:{value:T.NON_NULL,description:"Indicates this type is a non-null. `ofType` is a valid field."}}});n.__TypeKind=b;const v={name:"__schema",type:new u.GraphQLNonNull(p),description:"Access the current type schema of this server.",args:[],resolve:(e,n,t,{schema:r})=>r,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};n.SchemaMetaFieldDef=v;const g={name:"__type",type:f,description:"Request the type information of a single type.",args:[{name:"name",description:void 0,type:new u.GraphQLNonNull(c.GraphQLString),defaultValue:void 0,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0}],resolve:(e,{name:n},t,{schema:r})=>r.getType(n),deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};n.TypeMetaFieldDef=g;const E={name:"__typename",type:new u.GraphQLNonNull(c.GraphQLString),description:"The name of the current Object type at runtime.",args:[],resolve:(e,n,t,{parentType:r})=>r.name,deprecationReason:void 0,extensions:Object.create(null),astNode:void 0};n.TypeNameMetaFieldDef=E;const N=Object.freeze([p,l,d,f,y,m,h,b]);n.introspectionTypes=N},2229:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.GraphQLString=n.GraphQLInt=n.GraphQLID=n.GraphQLFloat=n.GraphQLBoolean=n.GRAPHQL_MIN_INT=n.GRAPHQL_MAX_INT=void 0,n.isSpecifiedScalarType=function(e){return h.some((({name:n})=>e.name===n))},n.specifiedScalarTypes=void 0;var r=t(8002),i=t(5690),o=t(5822),a=t(2828),s=t(3033),u=t(5003);const c=2147483647;n.GRAPHQL_MAX_INT=c;const p=-2147483648;n.GRAPHQL_MIN_INT=p;const l=new u.GraphQLScalarType({name:"Int",description:"The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.",serialize(e){const n=T(e);if("boolean"==typeof n)return n?1:0;let t=n;if("string"==typeof n&&""!==n&&(t=Number(n)),"number"!=typeof t||!Number.isInteger(t))throw new o.GraphQLError(`Int cannot represent non-integer value: ${(0,r.inspect)(n)}`);if(t>c||tc||ec||nn.name===e))}toConfig(){return{description:this.description,query:this.getQueryType(),mutation:this.getMutationType(),subscription:this.getSubscriptionType(),types:Object.values(this.getTypeMap()),directives:this.getDirectives(),extensions:this.extensions,astNode:this.astNode,extensionASTNodes:this.extensionASTNodes,assumeValid:void 0!==this.__validationErrors}}}function y(e,n){const t=(0,c.getNamedType)(e);if(!n.has(t))if(n.add(t),(0,c.isUnionType)(t))for(const e of t.getTypes())y(e,n);else if((0,c.isObjectType)(t)||(0,c.isInterfaceType)(t)){for(const e of t.getInterfaces())y(e,n);for(const e of Object.values(t.getFields())){y(e.type,n);for(const t of e.args)y(t.type,n)}}else if((0,c.isInputObjectType)(t))for(const e of Object.values(t.getFields()))y(e.type,n);return n}n.GraphQLSchema=f},1671:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.assertValidSchema=function(e){const n=l(e);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))},n.validateSchema=l;var r=t(8002),i=t(5822),o=t(1807),a=t(298),s=t(5003),u=t(7197),c=t(8155),p=t(6829);function l(e){if((0,p.assertSchema)(e),e.__validationErrors)return e.__validationErrors;const n=new d(e);!function(e){const n=e.schema,t=n.getQueryType();if(t){if(!(0,s.isObjectType)(t)){var i;e.reportError(`Query root type must be Object type, it cannot be ${(0,r.inspect)(t)}.`,null!==(i=f(n,o.OperationTypeNode.QUERY))&&void 0!==i?i:t.astNode)}}else e.reportError("Query root type must be provided.",n.astNode);const a=n.getMutationType();var u;a&&!(0,s.isObjectType)(a)&&e.reportError(`Mutation root type must be Object type if provided, it cannot be ${(0,r.inspect)(a)}.`,null!==(u=f(n,o.OperationTypeNode.MUTATION))&&void 0!==u?u:a.astNode);const c=n.getSubscriptionType();var p;c&&!(0,s.isObjectType)(c)&&e.reportError(`Subscription root type must be Object type if provided, it cannot be ${(0,r.inspect)(c)}.`,null!==(p=f(n,o.OperationTypeNode.SUBSCRIPTION))&&void 0!==p?p:c.astNode)}(n),function(e){for(const t of e.schema.getDirectives())if((0,u.isDirective)(t)){y(e,t);for(const i of t.args){var n;y(e,i),(0,s.isInputType)(i.type)||e.reportError(`The type of @${t.name}(${i.name}:) must be Input Type but got: ${(0,r.inspect)(i.type)}.`,i.astNode),(0,s.isRequiredArgument)(i)&&null!=i.deprecationReason&&e.reportError(`Required argument @${t.name}(${i.name}:) cannot be deprecated.`,[I(i.astNode),null===(n=i.astNode)||void 0===n?void 0:n.type])}}else e.reportError(`Expected directive but got: ${(0,r.inspect)(t)}.`,null==t?void 0:t.astNode)}(n),function(e){const n=function(e){const n=Object.create(null),t=[],r=Object.create(null);return function i(o){if(n[o.name])return;n[o.name]=!0,r[o.name]=t.length;const a=Object.values(o.getFields());for(const n of a)if((0,s.isNonNullType)(n.type)&&(0,s.isInputObjectType)(n.type.ofType)){const o=n.type.ofType,a=r[o.name];if(t.push(n),void 0===a)i(o);else{const n=t.slice(a),r=n.map((e=>e.name)).join(".");e.reportError(`Cannot reference Input Object "${o.name}" within itself through a series of non-null fields: "${r}".`,n.map((e=>e.astNode)))}t.pop()}r[o.name]=void 0}}(e),t=e.schema.getTypeMap();for(const i of Object.values(t))(0,s.isNamedType)(i)?((0,c.isIntrospectionType)(i)||y(e,i),(0,s.isObjectType)(i)||(0,s.isInterfaceType)(i)?(m(e,i),h(e,i)):(0,s.isUnionType)(i)?v(e,i):(0,s.isEnumType)(i)?g(e,i):(0,s.isInputObjectType)(i)&&(E(e,i),n(i))):e.reportError(`Expected GraphQL named type but got: ${(0,r.inspect)(i)}.`,i.astNode)}(n);const t=n.getErrors();return e.__validationErrors=t,t}class d{constructor(e){this._errors=[],this.schema=e}reportError(e,n){const t=Array.isArray(n)?n.filter(Boolean):n;this._errors.push(new i.GraphQLError(e,{nodes:t}))}getErrors(){return this._errors}}function f(e,n){var t;return null===(t=[e.astNode,...e.extensionASTNodes].flatMap((e=>{var n;return null!==(n=null==e?void 0:e.operationTypes)&&void 0!==n?n:[]})).find((e=>e.operation===n)))||void 0===t?void 0:t.type}function y(e,n){n.name.startsWith("__")&&e.reportError(`Name "${n.name}" must not begin with "__", which is reserved by GraphQL introspection.`,n.astNode)}function m(e,n){const t=Object.values(n.getFields());0===t.length&&e.reportError(`Type ${n.name} must define one or more fields.`,[n.astNode,...n.extensionASTNodes]);for(const u of t){var i;y(e,u),(0,s.isOutputType)(u.type)||e.reportError(`The type of ${n.name}.${u.name} must be Output Type but got: ${(0,r.inspect)(u.type)}.`,null===(i=u.astNode)||void 0===i?void 0:i.type);for(const t of u.args){const i=t.name;var o,a;y(e,t),(0,s.isInputType)(t.type)||e.reportError(`The type of ${n.name}.${u.name}(${i}:) must be Input Type but got: ${(0,r.inspect)(t.type)}.`,null===(o=t.astNode)||void 0===o?void 0:o.type),(0,s.isRequiredArgument)(t)&&null!=t.deprecationReason&&e.reportError(`Required argument ${n.name}.${u.name}(${i}:) cannot be deprecated.`,[I(t.astNode),null===(a=t.astNode)||void 0===a?void 0:a.type])}}}function h(e,n){const t=Object.create(null);for(const i of n.getInterfaces())(0,s.isInterfaceType)(i)?n!==i?t[i.name]?e.reportError(`Type ${n.name} can only implement ${i.name} once.`,N(n,i)):(t[i.name]=!0,b(e,n,i),T(e,n,i)):e.reportError(`Type ${n.name} cannot implement itself because it would create a circular reference.`,N(n,i)):e.reportError(`Type ${(0,r.inspect)(n)} must only implement Interface types, it cannot implement ${(0,r.inspect)(i)}.`,N(n,i))}function T(e,n,t){const i=n.getFields();for(const l of Object.values(t.getFields())){const d=l.name,f=i[d];if(f){var o,u;(0,a.isTypeSubTypeOf)(e.schema,f.type,l.type)||e.reportError(`Interface field ${t.name}.${d} expects type ${(0,r.inspect)(l.type)} but ${n.name}.${d} is type ${(0,r.inspect)(f.type)}.`,[null===(o=l.astNode)||void 0===o?void 0:o.type,null===(u=f.astNode)||void 0===u?void 0:u.type]);for(const i of l.args){const o=i.name,s=f.args.find((e=>e.name===o));var c,p;s?(0,a.isEqualType)(i.type,s.type)||e.reportError(`Interface field argument ${t.name}.${d}(${o}:) expects type ${(0,r.inspect)(i.type)} but ${n.name}.${d}(${o}:) is type ${(0,r.inspect)(s.type)}.`,[null===(c=i.astNode)||void 0===c?void 0:c.type,null===(p=s.astNode)||void 0===p?void 0:p.type]):e.reportError(`Interface field argument ${t.name}.${d}(${o}:) expected but ${n.name}.${d} does not provide it.`,[i.astNode,f.astNode])}for(const r of f.args){const i=r.name;!l.args.find((e=>e.name===i))&&(0,s.isRequiredArgument)(r)&&e.reportError(`Object field ${n.name}.${d} includes required argument ${i} that is missing from the Interface field ${t.name}.${d}.`,[r.astNode,l.astNode])}}else e.reportError(`Interface field ${t.name}.${d} expected but ${n.name} does not provide it.`,[l.astNode,n.astNode,...n.extensionASTNodes])}}function b(e,n,t){const r=n.getInterfaces();for(const i of t.getInterfaces())r.includes(i)||e.reportError(i===n?`Type ${n.name} cannot implement ${t.name} because it would create a circular reference.`:`Type ${n.name} must implement ${i.name} because it is implemented by ${t.name}.`,[...N(t,i),...N(n,t)])}function v(e,n){const t=n.getTypes();0===t.length&&e.reportError(`Union type ${n.name} must define one or more member types.`,[n.astNode,...n.extensionASTNodes]);const i=Object.create(null);for(const o of t)i[o.name]?e.reportError(`Union type ${n.name} can only include type ${o.name} once.`,O(n,o.name)):(i[o.name]=!0,(0,s.isObjectType)(o)||e.reportError(`Union type ${n.name} can only include Object types, it cannot include ${(0,r.inspect)(o)}.`,O(n,String(o))))}function g(e,n){const t=n.getValues();0===t.length&&e.reportError(`Enum type ${n.name} must define one or more values.`,[n.astNode,...n.extensionASTNodes]);for(const n of t)y(e,n)}function E(e,n){const t=Object.values(n.getFields());0===t.length&&e.reportError(`Input Object type ${n.name} must define one or more fields.`,[n.astNode,...n.extensionASTNodes]);for(const a of t){var i,o;y(e,a),(0,s.isInputType)(a.type)||e.reportError(`The type of ${n.name}.${a.name} must be Input Type but got: ${(0,r.inspect)(a.type)}.`,null===(i=a.astNode)||void 0===i?void 0:i.type),(0,s.isRequiredInputField)(a)&&null!=a.deprecationReason&&e.reportError(`Required input field ${n.name}.${a.name} cannot be deprecated.`,[I(a.astNode),null===(o=a.astNode)||void 0===o?void 0:o.type])}}function N(e,n){const{astNode:t,extensionASTNodes:r}=e;return(null!=t?[t,...r]:r).flatMap((e=>{var n;return null!==(n=e.interfaces)&&void 0!==n?n:[]})).filter((e=>e.name.value===n.name))}function O(e,n){const{astNode:t,extensionASTNodes:r}=e;return(null!=t?[t,...r]:r).flatMap((e=>{var n;return null!==(n=e.types)&&void 0!==n?n:[]})).filter((e=>e.name.value===n))}function I(e){var n;return null==e||null===(n=e.directives)||void 0===n?void 0:n.find((e=>e.name.value===u.GraphQLDeprecatedDirective.name))}},6226:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.TypeInfo=void 0,n.visitWithTypeInfo=function(e,n){return{enter(...t){const i=t[0];e.enter(i);const a=(0,o.getEnterLeaveForKind)(n,i.kind).enter;if(a){const o=a.apply(n,t);return void 0!==o&&(e.leave(i),(0,r.isNode)(o)&&e.enter(o)),o}},leave(...t){const r=t[0],i=(0,o.getEnterLeaveForKind)(n,r.kind).leave;let a;return i&&(a=i.apply(n,t)),e.leave(r),a}}};var r=t(1807),i=t(2828),o=t(285),a=t(5003),s=t(8155),u=t(5115);class c{constructor(e,n,t){this._schema=e,this._typeStack=[],this._parentTypeStack=[],this._inputTypeStack=[],this._fieldDefStack=[],this._defaultValueStack=[],this._directive=null,this._argument=null,this._enumValue=null,this._getFieldDef=null!=t?t:p,n&&((0,a.isInputType)(n)&&this._inputTypeStack.push(n),(0,a.isCompositeType)(n)&&this._parentTypeStack.push(n),(0,a.isOutputType)(n)&&this._typeStack.push(n))}get[Symbol.toStringTag](){return"TypeInfo"}getType(){if(this._typeStack.length>0)return this._typeStack[this._typeStack.length-1]}getParentType(){if(this._parentTypeStack.length>0)return this._parentTypeStack[this._parentTypeStack.length-1]}getInputType(){if(this._inputTypeStack.length>0)return this._inputTypeStack[this._inputTypeStack.length-1]}getParentInputType(){if(this._inputTypeStack.length>1)return this._inputTypeStack[this._inputTypeStack.length-2]}getFieldDef(){if(this._fieldDefStack.length>0)return this._fieldDefStack[this._fieldDefStack.length-1]}getDefaultValue(){if(this._defaultValueStack.length>0)return this._defaultValueStack[this._defaultValueStack.length-1]}getDirective(){return this._directive}getArgument(){return this._argument}getEnumValue(){return this._enumValue}enter(e){const n=this._schema;switch(e.kind){case i.Kind.SELECTION_SET:{const e=(0,a.getNamedType)(this.getType());this._parentTypeStack.push((0,a.isCompositeType)(e)?e:void 0);break}case i.Kind.FIELD:{const t=this.getParentType();let r,i;t&&(r=this._getFieldDef(n,t,e),r&&(i=r.type)),this._fieldDefStack.push(r),this._typeStack.push((0,a.isOutputType)(i)?i:void 0);break}case i.Kind.DIRECTIVE:this._directive=n.getDirective(e.name.value);break;case i.Kind.OPERATION_DEFINITION:{const t=n.getRootType(e.operation);this._typeStack.push((0,a.isObjectType)(t)?t:void 0);break}case i.Kind.INLINE_FRAGMENT:case i.Kind.FRAGMENT_DEFINITION:{const t=e.typeCondition,r=t?(0,u.typeFromAST)(n,t):(0,a.getNamedType)(this.getType());this._typeStack.push((0,a.isOutputType)(r)?r:void 0);break}case i.Kind.VARIABLE_DEFINITION:{const t=(0,u.typeFromAST)(n,e.type);this._inputTypeStack.push((0,a.isInputType)(t)?t:void 0);break}case i.Kind.ARGUMENT:{var t;let n,r;const i=null!==(t=this.getDirective())&&void 0!==t?t:this.getFieldDef();i&&(n=i.args.find((n=>n.name===e.name.value)),n&&(r=n.type)),this._argument=n,this._defaultValueStack.push(n?n.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(r)?r:void 0);break}case i.Kind.LIST:{const e=(0,a.getNullableType)(this.getInputType()),n=(0,a.isListType)(e)?e.ofType:e;this._defaultValueStack.push(void 0),this._inputTypeStack.push((0,a.isInputType)(n)?n:void 0);break}case i.Kind.OBJECT_FIELD:{const n=(0,a.getNamedType)(this.getInputType());let t,r;(0,a.isInputObjectType)(n)&&(r=n.getFields()[e.name.value],r&&(t=r.type)),this._defaultValueStack.push(r?r.defaultValue:void 0),this._inputTypeStack.push((0,a.isInputType)(t)?t:void 0);break}case i.Kind.ENUM:{const n=(0,a.getNamedType)(this.getInputType());let t;(0,a.isEnumType)(n)&&(t=n.getValue(e.value)),this._enumValue=t;break}}}leave(e){switch(e.kind){case i.Kind.SELECTION_SET:this._parentTypeStack.pop();break;case i.Kind.FIELD:this._fieldDefStack.pop(),this._typeStack.pop();break;case i.Kind.DIRECTIVE:this._directive=null;break;case i.Kind.OPERATION_DEFINITION:case i.Kind.INLINE_FRAGMENT:case i.Kind.FRAGMENT_DEFINITION:this._typeStack.pop();break;case i.Kind.VARIABLE_DEFINITION:this._inputTypeStack.pop();break;case i.Kind.ARGUMENT:this._argument=null,this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.Kind.LIST:case i.Kind.OBJECT_FIELD:this._defaultValueStack.pop(),this._inputTypeStack.pop();break;case i.Kind.ENUM:this._enumValue=null}}}function p(e,n,t){const r=t.name.value;return r===s.SchemaMetaFieldDef.name&&e.getQueryType()===n?s.SchemaMetaFieldDef:r===s.TypeMetaFieldDef.name&&e.getQueryType()===n?s.TypeMetaFieldDef:r===s.TypeNameMetaFieldDef.name&&(0,a.isCompositeType)(n)?s.TypeNameMetaFieldDef:(0,a.isObjectType)(n)||(0,a.isInterfaceType)(n)?n.getFields()[r]:void 0}n.TypeInfo=c},6526:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.assertValidName=function(e){const n=a(e);if(n)throw n;return e},n.isValidNameError=a;var r=t(7242),i=t(5822),o=t(3058);function a(e){if("string"==typeof e||(0,r.devAssert)(!1,"Expected name to be a string."),e.startsWith("__"))return new i.GraphQLError(`Name "${e}" must not begin with "__", which is reserved by GraphQL introspection.`);try{(0,o.assertName)(e)}catch(e){return e}}},8115:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.astFromValue=function e(n,t){if((0,u.isNonNullType)(t)){const r=e(n,t.ofType);return(null==r?void 0:r.kind)===s.Kind.NULL?null:r}if(null===n)return{kind:s.Kind.NULL};if(void 0===n)return null;if((0,u.isListType)(t)){const r=t.ofType;if((0,o.isIterableObject)(n)){const t=[];for(const i of n){const n=e(i,r);null!=n&&t.push(n)}return{kind:s.Kind.LIST,values:t}}return e(n,r)}if((0,u.isInputObjectType)(t)){if(!(0,a.isObjectLike)(n))return null;const r=[];for(const i of Object.values(t.getFields())){const t=e(n[i.name],i.type);t&&r.push({kind:s.Kind.OBJECT_FIELD,name:{kind:s.Kind.NAME,value:i.name},value:t})}return{kind:s.Kind.OBJECT,fields:r}}if((0,u.isLeafType)(t)){const e=t.serialize(n);if(null==e)return null;if("boolean"==typeof e)return{kind:s.Kind.BOOLEAN,value:e};if("number"==typeof e&&Number.isFinite(e)){const n=String(e);return p.test(n)?{kind:s.Kind.INT,value:n}:{kind:s.Kind.FLOAT,value:n}}if("string"==typeof e)return(0,u.isEnumType)(t)?{kind:s.Kind.ENUM,value:e}:t===c.GraphQLID&&p.test(e)?{kind:s.Kind.INT,value:e}:{kind:s.Kind.STRING,value:e};throw new TypeError(`Cannot convert value to AST: ${(0,r.inspect)(e)}.`)}(0,i.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(t))};var r=t(8002),i=t(7706),o=t(6609),a=t(5690),s=t(2828),u=t(5003),c=t(2229);const p=/^-?(?:0|[1-9][0-9]*)$/},2906:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.buildASTSchema=p,n.buildSchema=function(e,n){return p((0,o.parse)(e,{noLocation:null==n?void 0:n.noLocation,allowLegacyFragmentVariables:null==n?void 0:n.allowLegacyFragmentVariables}),{assumeValidSDL:null==n?void 0:n.assumeValidSDL,assumeValid:null==n?void 0:n.assumeValid})};var r=t(7242),i=t(2828),o=t(8370),a=t(7197),s=t(6829),u=t(9504),c=t(3242);function p(e,n){null!=e&&e.kind===i.Kind.DOCUMENT||(0,r.devAssert)(!1,"Must provide valid Document AST."),!0!==(null==n?void 0:n.assumeValid)&&!0!==(null==n?void 0:n.assumeValidSDL)&&(0,u.assertValidSDL)(e);const t={description:void 0,types:[],directives:[],extensions:Object.create(null),extensionASTNodes:[],assumeValid:!1},o=(0,c.extendSchemaImpl)(t,e,n);if(null==o.astNode)for(const e of o.types)switch(e.name){case"Query":o.query=e;break;case"Mutation":o.mutation=e;break;case"Subscription":o.subscription=e}const p=[...o.directives,...a.specifiedDirectives.filter((e=>o.directives.every((n=>n.name!==e.name))))];return new s.GraphQLSchema({...o,directives:p})}},8686:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.buildClientSchema=function(e,n){(0,o.isObjectLike)(e)&&(0,o.isObjectLike)(e.__schema)||(0,r.devAssert)(!1,`Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ${(0,i.inspect)(e)}.`);const t=e.__schema,y=(0,a.keyValMap)(t.types,(e=>e.name),(e=>function(e){if(null!=e&&null!=e.name&&null!=e.kind)switch(e.kind){case p.TypeKind.SCALAR:return r=e,new u.GraphQLScalarType({name:r.name,description:r.description,specifiedByURL:r.specifiedByURL});case p.TypeKind.OBJECT:return t=e,new u.GraphQLObjectType({name:t.name,description:t.description,interfaces:()=>O(t),fields:()=>I(t)});case p.TypeKind.INTERFACE:return n=e,new u.GraphQLInterfaceType({name:n.name,description:n.description,interfaces:()=>O(n),fields:()=>I(n)});case p.TypeKind.UNION:return function(e){if(!e.possibleTypes){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing possibleTypes: ${n}.`)}return new u.GraphQLUnionType({name:e.name,description:e.description,types:()=>e.possibleTypes.map(E)})}(e);case p.TypeKind.ENUM:return function(e){if(!e.enumValues){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing enumValues: ${n}.`)}return new u.GraphQLEnumType({name:e.name,description:e.description,values:(0,a.keyValMap)(e.enumValues,(e=>e.name),(e=>({description:e.description,deprecationReason:e.deprecationReason})))})}(e);case p.TypeKind.INPUT_OBJECT:return function(e){if(!e.inputFields){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing inputFields: ${n}.`)}return new u.GraphQLInputObjectType({name:e.name,description:e.description,fields:()=>L(e.inputFields)})}(e)}var n,t,r;const o=(0,i.inspect)(e);throw new Error(`Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ${o}.`)}(e)));for(const e of[...l.specifiedScalarTypes,...p.introspectionTypes])y[e.name]&&(y[e.name]=e);const m=t.queryType?E(t.queryType):null,h=t.mutationType?E(t.mutationType):null,T=t.subscriptionType?E(t.subscriptionType):null,b=t.directives?t.directives.map((function(e){if(!e.args){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing directive args: ${n}.`)}if(!e.locations){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing directive locations: ${n}.`)}return new c.GraphQLDirective({name:e.name,description:e.description,isRepeatable:e.isRepeatable,locations:e.locations.slice(),args:L(e.args)})})):[];return new d.GraphQLSchema({description:t.description,query:m,mutation:h,subscription:T,types:Object.values(y),directives:b,assumeValid:null==n?void 0:n.assumeValid});function v(e){if(e.kind===p.TypeKind.LIST){const n=e.ofType;if(!n)throw new Error("Decorated type deeper than introspection query.");return new u.GraphQLList(v(n))}if(e.kind===p.TypeKind.NON_NULL){const n=e.ofType;if(!n)throw new Error("Decorated type deeper than introspection query.");const t=v(n);return new u.GraphQLNonNull((0,u.assertNullableType)(t))}return g(e)}function g(e){const n=e.name;if(!n)throw new Error(`Unknown type reference: ${(0,i.inspect)(e)}.`);const t=y[n];if(!t)throw new Error(`Invalid or incomplete schema, unknown type: ${n}. Ensure that a full introspection query is used in order to build a client schema.`);return t}function E(e){return(0,u.assertObjectType)(g(e))}function N(e){return(0,u.assertInterfaceType)(g(e))}function O(e){if(null===e.interfaces&&e.kind===p.TypeKind.INTERFACE)return[];if(!e.interfaces){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing interfaces: ${n}.`)}return e.interfaces.map(N)}function I(e){if(!e.fields)throw new Error(`Introspection result missing fields: ${(0,i.inspect)(e)}.`);return(0,a.keyValMap)(e.fields,(e=>e.name),_)}function _(e){const n=v(e.type);if(!(0,u.isOutputType)(n)){const e=(0,i.inspect)(n);throw new Error(`Introspection must provide output type for fields, but received: ${e}.`)}if(!e.args){const n=(0,i.inspect)(e);throw new Error(`Introspection result missing field args: ${n}.`)}return{description:e.description,deprecationReason:e.deprecationReason,type:n,args:L(e.args)}}function L(e){return(0,a.keyValMap)(e,(e=>e.name),S)}function S(e){const n=v(e.type);if(!(0,u.isInputType)(n)){const e=(0,i.inspect)(n);throw new Error(`Introspection must provide input type for arguments, but received: ${e}.`)}const t=null!=e.defaultValue?(0,f.valueFromAST)((0,s.parseValue)(e.defaultValue),n):void 0;return{description:e.description,type:n,defaultValue:t,deprecationReason:e.deprecationReason}}};var r=t(7242),i=t(8002),o=t(5690),a=t(7154),s=t(8370),u=t(5003),c=t(7197),p=t(8155),l=t(2229),d=t(6829),f=t(3770)},3679:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.coerceInputValue=function(e,n,t=f){return y(e,n,t,void 0)};var r=t(166),i=t(8002),o=t(7706),a=t(6609),s=t(5690),u=t(7059),c=t(737),p=t(8070),l=t(5822),d=t(5003);function f(e,n,t){let r="Invalid value "+(0,i.inspect)(n);throw e.length>0&&(r+=` at "value${(0,c.printPathArray)(e)}"`),t.message=r+": "+t.message,t}function y(e,n,t,c){if((0,d.isNonNullType)(n))return null!=e?y(e,n.ofType,t,c):void t((0,u.pathToArray)(c),e,new l.GraphQLError(`Expected non-nullable type "${(0,i.inspect)(n)}" not to be null.`));if(null==e)return null;if((0,d.isListType)(n)){const r=n.ofType;return(0,a.isIterableObject)(e)?Array.from(e,((e,n)=>{const i=(0,u.addPath)(c,n,void 0);return y(e,r,t,i)})):[y(e,r,t,c)]}if((0,d.isInputObjectType)(n)){if(!(0,s.isObjectLike)(e))return void t((0,u.pathToArray)(c),e,new l.GraphQLError(`Expected type "${n.name}" to be an object.`));const o={},a=n.getFields();for(const r of Object.values(a)){const a=e[r.name];if(void 0!==a)o[r.name]=y(a,r.type,t,(0,u.addPath)(c,r.name,n.name));else if(void 0!==r.defaultValue)o[r.name]=r.defaultValue;else if((0,d.isNonNullType)(r.type)){const n=(0,i.inspect)(r.type);t((0,u.pathToArray)(c),e,new l.GraphQLError(`Field "${r.name}" of required type "${n}" was not provided.`))}}for(const i of Object.keys(e))if(!a[i]){const o=(0,p.suggestionList)(i,Object.keys(n.getFields()));t((0,u.pathToArray)(c),e,new l.GraphQLError(`Field "${i}" is not defined by type "${n.name}".`+(0,r.didYouMean)(o)))}return o}if((0,d.isLeafType)(n)){let r;try{r=n.parseValue(e)}catch(r){return void(r instanceof l.GraphQLError?t((0,u.pathToArray)(c),e,r):t((0,u.pathToArray)(c),e,new l.GraphQLError(`Expected type "${n.name}". `+r.message,{originalError:r})))}return void 0===r&&t((0,u.pathToArray)(c),e,new l.GraphQLError(`Expected type "${n.name}".`)),r}(0,o.invariant)(!1,"Unexpected input type: "+(0,i.inspect)(n))}},6078:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.concatAST=function(e){const n=[];for(const t of e)n.push(...t.definitions);return{kind:r.Kind.DOCUMENT,definitions:n}};var r=t(2828)},3242:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.extendSchema=function(e,n,t){(0,y.assertSchema)(e),null!=n&&n.kind===u.Kind.DOCUMENT||(0,r.devAssert)(!1,"Must provide valid Document AST."),!0!==(null==t?void 0:t.assumeValid)&&!0!==(null==t?void 0:t.assumeValidSDL)&&(0,m.assertValidSDLExtension)(n,e);const i=e.toConfig(),o=b(i,n,t);return i===o?e:new y.GraphQLSchema(o)},n.extendSchemaImpl=b;var r=t(7242),i=t(8002),o=t(7706),a=t(2863),s=t(6124),u=t(2828),c=t(1352),p=t(5003),l=t(7197),d=t(8155),f=t(2229),y=t(6829),m=t(9504),h=t(8840),T=t(3770);function b(e,n,t){var r,a,y,m;const h=[],b=Object.create(null),N=[];let O;const I=[];for(const e of n.definitions)if(e.kind===u.Kind.SCHEMA_DEFINITION)O=e;else if(e.kind===u.Kind.SCHEMA_EXTENSION)I.push(e);else if((0,c.isTypeDefinitionNode)(e))h.push(e);else if((0,c.isTypeExtensionNode)(e)){const n=e.name.value,t=b[n];b[n]=t?t.concat([e]):[e]}else e.kind===u.Kind.DIRECTIVE_DEFINITION&&N.push(e);if(0===Object.keys(b).length&&0===h.length&&0===N.length&&0===I.length&&null==O)return e;const _=Object.create(null);for(const n of e.types)_[n.name]=(L=n,(0,d.isIntrospectionType)(L)||(0,f.isSpecifiedScalarType)(L)?L:(0,p.isScalarType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];let i=t.specifiedByURL;for(const e of r){var o;i=null!==(o=E(e))&&void 0!==o?o:i}return new p.GraphQLScalarType({...t,specifiedByURL:i,extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isObjectType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];return new p.GraphQLObjectType({...t,interfaces:()=>[...e.getInterfaces().map(A),...M(r)],fields:()=>({...(0,s.mapValue)(t.fields,P),...x(r)}),extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isInterfaceType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];return new p.GraphQLInterfaceType({...t,interfaces:()=>[...e.getInterfaces().map(A),...M(r)],fields:()=>({...(0,s.mapValue)(t.fields,P),...x(r)}),extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isUnionType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];return new p.GraphQLUnionType({...t,types:()=>[...e.getTypes().map(A),...K(r)],extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isEnumType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[e.name])&&void 0!==n?n:[];return new p.GraphQLEnumType({...t,values:{...t.values,...C(r)},extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):(0,p.isInputObjectType)(L)?function(e){var n;const t=e.toConfig(),r=null!==(n=b[t.name])&&void 0!==n?n:[];return new p.GraphQLInputObjectType({...t,fields:()=>({...(0,s.mapValue)(t.fields,(e=>({...e,type:j(e.type)}))),...V(r)}),extensionASTNodes:t.extensionASTNodes.concat(r)})}(L):void(0,o.invariant)(!1,"Unexpected type: "+(0,i.inspect)(L)));var L;for(const e of h){var S;const n=e.name.value;_[n]=null!==(S=v[n])&&void 0!==S?S:Q(e)}const D={query:e.query&&A(e.query),mutation:e.mutation&&A(e.mutation),subscription:e.subscription&&A(e.subscription),...O&&w([O]),...w(I)};return{description:null===(r=O)||void 0===r||null===(a=r.description)||void 0===a?void 0:a.value,...D,types:Object.values(_),directives:[...e.directives.map((function(e){const n=e.toConfig();return new l.GraphQLDirective({...n,args:(0,s.mapValue)(n.args,R)})})),...N.map((function(e){var n;return new l.GraphQLDirective({name:e.name.value,description:null===(n=e.description)||void 0===n?void 0:n.value,locations:e.locations.map((({value:e})=>e)),isRepeatable:e.repeatable,args:G(e.arguments),astNode:e})}))],extensions:Object.create(null),astNode:null!==(y=O)&&void 0!==y?y:e.astNode,extensionASTNodes:e.extensionASTNodes.concat(I),assumeValid:null!==(m=null==t?void 0:t.assumeValid)&&void 0!==m&&m};function j(e){return(0,p.isListType)(e)?new p.GraphQLList(j(e.ofType)):(0,p.isNonNullType)(e)?new p.GraphQLNonNull(j(e.ofType)):A(e)}function A(e){return _[e.name]}function P(e){return{...e,type:j(e.type),args:e.args&&(0,s.mapValue)(e.args,R)}}function R(e){return{...e,type:j(e.type)}}function w(e){const n={};for(const r of e){var t;const e=null!==(t=r.operationTypes)&&void 0!==t?t:[];for(const t of e)n[t.operation]=k(t.type)}return n}function k(e){var n;const t=e.name.value,r=null!==(n=v[t])&&void 0!==n?n:_[t];if(void 0===r)throw new Error(`Unknown type: "${t}".`);return r}function F(e){return e.kind===u.Kind.LIST_TYPE?new p.GraphQLList(F(e.type)):e.kind===u.Kind.NON_NULL_TYPE?new p.GraphQLNonNull(F(e.type)):k(e)}function x(e){const n=Object.create(null);for(const i of e){var t;const e=null!==(t=i.fields)&&void 0!==t?t:[];for(const t of e){var r;n[t.name.value]={type:F(t.type),description:null===(r=t.description)||void 0===r?void 0:r.value,args:G(t.arguments),deprecationReason:g(t),astNode:t}}}return n}function G(e){const n=null!=e?e:[],t=Object.create(null);for(const e of n){var r;const n=F(e.type);t[e.name.value]={type:n,description:null===(r=e.description)||void 0===r?void 0:r.value,defaultValue:(0,T.valueFromAST)(e.defaultValue,n),deprecationReason:g(e),astNode:e}}return t}function V(e){const n=Object.create(null);for(const i of e){var t;const e=null!==(t=i.fields)&&void 0!==t?t:[];for(const t of e){var r;const e=F(t.type);n[t.name.value]={type:e,description:null===(r=t.description)||void 0===r?void 0:r.value,defaultValue:(0,T.valueFromAST)(t.defaultValue,e),deprecationReason:g(t),astNode:t}}}return n}function C(e){const n=Object.create(null);for(const i of e){var t;const e=null!==(t=i.values)&&void 0!==t?t:[];for(const t of e){var r;n[t.name.value]={description:null===(r=t.description)||void 0===r?void 0:r.value,deprecationReason:g(t),astNode:t}}}return n}function M(e){return e.flatMap((e=>{var n,t;return null!==(n=null===(t=e.interfaces)||void 0===t?void 0:t.map(k))&&void 0!==n?n:[]}))}function K(e){return e.flatMap((e=>{var n,t;return null!==(n=null===(t=e.types)||void 0===t?void 0:t.map(k))&&void 0!==n?n:[]}))}function Q(e){var n;const t=e.name.value,r=null!==(n=b[t])&&void 0!==n?n:[];switch(e.kind){case u.Kind.OBJECT_TYPE_DEFINITION:{var i;const n=[e,...r];return new p.GraphQLObjectType({name:t,description:null===(i=e.description)||void 0===i?void 0:i.value,interfaces:()=>M(n),fields:()=>x(n),astNode:e,extensionASTNodes:r})}case u.Kind.INTERFACE_TYPE_DEFINITION:{var o;const n=[e,...r];return new p.GraphQLInterfaceType({name:t,description:null===(o=e.description)||void 0===o?void 0:o.value,interfaces:()=>M(n),fields:()=>x(n),astNode:e,extensionASTNodes:r})}case u.Kind.ENUM_TYPE_DEFINITION:{var a;const n=[e,...r];return new p.GraphQLEnumType({name:t,description:null===(a=e.description)||void 0===a?void 0:a.value,values:C(n),astNode:e,extensionASTNodes:r})}case u.Kind.UNION_TYPE_DEFINITION:{var s;const n=[e,...r];return new p.GraphQLUnionType({name:t,description:null===(s=e.description)||void 0===s?void 0:s.value,types:()=>K(n),astNode:e,extensionASTNodes:r})}case u.Kind.SCALAR_TYPE_DEFINITION:var c;return new p.GraphQLScalarType({name:t,description:null===(c=e.description)||void 0===c?void 0:c.value,specifiedByURL:E(e),astNode:e,extensionASTNodes:r});case u.Kind.INPUT_OBJECT_TYPE_DEFINITION:{var l;const n=[e,...r];return new p.GraphQLInputObjectType({name:t,description:null===(l=e.description)||void 0===l?void 0:l.value,fields:()=>V(n),astNode:e,extensionASTNodes:r})}}}}const v=(0,a.keyMap)([...f.specifiedScalarTypes,...d.introspectionTypes],(e=>e.name));function g(e){const n=(0,h.getDirectiveValues)(l.GraphQLDeprecatedDirective,e);return null==n?void 0:n.reason}function E(e){const n=(0,h.getDirectiveValues)(l.GraphQLSpecifiedByDirective,e);return null==n?void 0:n.url}},3298:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.DangerousChangeType=n.BreakingChangeType=void 0,n.findBreakingChanges=function(e,n){return f(e,n).filter((e=>e.type in r))},n.findDangerousChanges=function(e,n){return f(e,n).filter((e=>e.type in i))};var r,i,o=t(8002),a=t(7706),s=t(2863),u=t(3033),c=t(5003),p=t(2229),l=t(8115),d=t(6830);function f(e,n){return[...m(e,n),...y(e,n)]}function y(e,n){const t=[],i=L(e.getDirectives(),n.getDirectives());for(const e of i.removed)t.push({type:r.DIRECTIVE_REMOVED,description:`${e.name} was removed.`});for(const[e,n]of i.persisted){const i=L(e.args,n.args);for(const n of i.added)(0,c.isRequiredArgument)(n)&&t.push({type:r.REQUIRED_DIRECTIVE_ARG_ADDED,description:`A required arg ${n.name} on directive ${e.name} was added.`});for(const n of i.removed)t.push({type:r.DIRECTIVE_ARG_REMOVED,description:`${n.name} was removed from ${e.name}.`});e.isRepeatable&&!n.isRepeatable&&t.push({type:r.DIRECTIVE_REPEATABLE_REMOVED,description:`Repeatable flag was removed from ${e.name}.`});for(const i of e.locations)n.locations.includes(i)||t.push({type:r.DIRECTIVE_LOCATION_REMOVED,description:`${i} was removed from ${e.name}.`})}return t}function m(e,n){const t=[],i=L(Object.values(e.getTypeMap()),Object.values(n.getTypeMap()));for(const e of i.removed)t.push({type:r.TYPE_REMOVED,description:(0,p.isSpecifiedScalarType)(e)?`Standard scalar ${e.name} was removed because it is not referenced anymore.`:`${e.name} was removed.`});for(const[e,n]of i.persisted)(0,c.isEnumType)(e)&&(0,c.isEnumType)(n)?t.push(...b(e,n)):(0,c.isUnionType)(e)&&(0,c.isUnionType)(n)?t.push(...T(e,n)):(0,c.isInputObjectType)(e)&&(0,c.isInputObjectType)(n)?t.push(...h(e,n)):(0,c.isObjectType)(e)&&(0,c.isObjectType)(n)||(0,c.isInterfaceType)(e)&&(0,c.isInterfaceType)(n)?t.push(...g(e,n),...v(e,n)):e.constructor!==n.constructor&&t.push({type:r.TYPE_CHANGED_KIND,description:`${e.name} changed from ${I(e)} to ${I(n)}.`});return t}function h(e,n){const t=[],o=L(Object.values(e.getFields()),Object.values(n.getFields()));for(const n of o.added)(0,c.isRequiredInputField)(n)?t.push({type:r.REQUIRED_INPUT_FIELD_ADDED,description:`A required field ${n.name} on input type ${e.name} was added.`}):t.push({type:i.OPTIONAL_INPUT_FIELD_ADDED,description:`An optional field ${n.name} on input type ${e.name} was added.`});for(const n of o.removed)t.push({type:r.FIELD_REMOVED,description:`${e.name}.${n.name} was removed.`});for(const[n,i]of o.persisted)O(n.type,i.type)||t.push({type:r.FIELD_CHANGED_KIND,description:`${e.name}.${n.name} changed type from ${String(n.type)} to ${String(i.type)}.`});return t}function T(e,n){const t=[],o=L(e.getTypes(),n.getTypes());for(const n of o.added)t.push({type:i.TYPE_ADDED_TO_UNION,description:`${n.name} was added to union type ${e.name}.`});for(const n of o.removed)t.push({type:r.TYPE_REMOVED_FROM_UNION,description:`${n.name} was removed from union type ${e.name}.`});return t}function b(e,n){const t=[],o=L(e.getValues(),n.getValues());for(const n of o.added)t.push({type:i.VALUE_ADDED_TO_ENUM,description:`${n.name} was added to enum type ${e.name}.`});for(const n of o.removed)t.push({type:r.VALUE_REMOVED_FROM_ENUM,description:`${n.name} was removed from enum type ${e.name}.`});return t}function v(e,n){const t=[],o=L(e.getInterfaces(),n.getInterfaces());for(const n of o.added)t.push({type:i.IMPLEMENTED_INTERFACE_ADDED,description:`${n.name} added to interfaces implemented by ${e.name}.`});for(const n of o.removed)t.push({type:r.IMPLEMENTED_INTERFACE_REMOVED,description:`${e.name} no longer implements interface ${n.name}.`});return t}function g(e,n){const t=[],i=L(Object.values(e.getFields()),Object.values(n.getFields()));for(const n of i.removed)t.push({type:r.FIELD_REMOVED,description:`${e.name}.${n.name} was removed.`});for(const[n,o]of i.persisted)t.push(...E(e,n,o)),N(n.type,o.type)||t.push({type:r.FIELD_CHANGED_KIND,description:`${e.name}.${n.name} changed type from ${String(n.type)} to ${String(o.type)}.`});return t}function E(e,n,t){const o=[],a=L(n.args,t.args);for(const t of a.removed)o.push({type:r.ARG_REMOVED,description:`${e.name}.${n.name} arg ${t.name} was removed.`});for(const[t,s]of a.persisted)if(O(t.type,s.type)){if(void 0!==t.defaultValue)if(void 0===s.defaultValue)o.push({type:i.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${n.name} arg ${t.name} defaultValue was removed.`});else{const r=_(t.defaultValue,t.type),a=_(s.defaultValue,s.type);r!==a&&o.push({type:i.ARG_DEFAULT_VALUE_CHANGE,description:`${e.name}.${n.name} arg ${t.name} has changed defaultValue from ${r} to ${a}.`})}}else o.push({type:r.ARG_CHANGED_KIND,description:`${e.name}.${n.name} arg ${t.name} has changed type from ${String(t.type)} to ${String(s.type)}.`});for(const t of a.added)(0,c.isRequiredArgument)(t)?o.push({type:r.REQUIRED_ARG_ADDED,description:`A required arg ${t.name} on ${e.name}.${n.name} was added.`}):o.push({type:i.OPTIONAL_ARG_ADDED,description:`An optional arg ${t.name} on ${e.name}.${n.name} was added.`});return o}function N(e,n){return(0,c.isListType)(e)?(0,c.isListType)(n)&&N(e.ofType,n.ofType)||(0,c.isNonNullType)(n)&&N(e,n.ofType):(0,c.isNonNullType)(e)?(0,c.isNonNullType)(n)&&N(e.ofType,n.ofType):(0,c.isNamedType)(n)&&e.name===n.name||(0,c.isNonNullType)(n)&&N(e,n.ofType)}function O(e,n){return(0,c.isListType)(e)?(0,c.isListType)(n)&&O(e.ofType,n.ofType):(0,c.isNonNullType)(e)?(0,c.isNonNullType)(n)&&O(e.ofType,n.ofType)||!(0,c.isNonNullType)(n)&&O(e.ofType,n):(0,c.isNamedType)(n)&&e.name===n.name}function I(e){return(0,c.isScalarType)(e)?"a Scalar type":(0,c.isObjectType)(e)?"an Object type":(0,c.isInterfaceType)(e)?"an Interface type":(0,c.isUnionType)(e)?"a Union type":(0,c.isEnumType)(e)?"an Enum type":(0,c.isInputObjectType)(e)?"an Input type":void(0,a.invariant)(!1,"Unexpected type: "+(0,o.inspect)(e))}function _(e,n){const t=(0,l.astFromValue)(e,n);return null!=t||(0,a.invariant)(!1),(0,u.print)((0,d.sortValueNode)(t))}function L(e,n){const t=[],r=[],i=[],o=(0,s.keyMap)(e,(({name:e})=>e)),a=(0,s.keyMap)(n,(({name:e})=>e));for(const n of e){const e=a[n.name];void 0===e?r.push(n):i.push([n,e])}for(const e of n)void 0===o[e.name]&&t.push(e);return{added:t,persisted:i,removed:r}}n.BreakingChangeType=r,function(e){e.TYPE_REMOVED="TYPE_REMOVED",e.TYPE_CHANGED_KIND="TYPE_CHANGED_KIND",e.TYPE_REMOVED_FROM_UNION="TYPE_REMOVED_FROM_UNION",e.VALUE_REMOVED_FROM_ENUM="VALUE_REMOVED_FROM_ENUM",e.REQUIRED_INPUT_FIELD_ADDED="REQUIRED_INPUT_FIELD_ADDED",e.IMPLEMENTED_INTERFACE_REMOVED="IMPLEMENTED_INTERFACE_REMOVED",e.FIELD_REMOVED="FIELD_REMOVED",e.FIELD_CHANGED_KIND="FIELD_CHANGED_KIND",e.REQUIRED_ARG_ADDED="REQUIRED_ARG_ADDED",e.ARG_REMOVED="ARG_REMOVED",e.ARG_CHANGED_KIND="ARG_CHANGED_KIND",e.DIRECTIVE_REMOVED="DIRECTIVE_REMOVED",e.DIRECTIVE_ARG_REMOVED="DIRECTIVE_ARG_REMOVED",e.REQUIRED_DIRECTIVE_ARG_ADDED="REQUIRED_DIRECTIVE_ARG_ADDED",e.DIRECTIVE_REPEATABLE_REMOVED="DIRECTIVE_REPEATABLE_REMOVED",e.DIRECTIVE_LOCATION_REMOVED="DIRECTIVE_LOCATION_REMOVED"}(r||(n.BreakingChangeType=r={})),n.DangerousChangeType=i,function(e){e.VALUE_ADDED_TO_ENUM="VALUE_ADDED_TO_ENUM",e.TYPE_ADDED_TO_UNION="TYPE_ADDED_TO_UNION",e.OPTIONAL_INPUT_FIELD_ADDED="OPTIONAL_INPUT_FIELD_ADDED",e.OPTIONAL_ARG_ADDED="OPTIONAL_ARG_ADDED",e.IMPLEMENTED_INTERFACE_ADDED="IMPLEMENTED_INTERFACE_ADDED",e.ARG_DEFAULT_VALUE_CHANGE="ARG_DEFAULT_VALUE_CHANGE"}(i||(n.DangerousChangeType=i={}))},9363:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.getIntrospectionQuery=function(e){const n={descriptions:!0,specifiedByUrl:!1,directiveIsRepeatable:!1,schemaDescription:!1,inputValueDeprecation:!1,...e},t=n.descriptions?"description":"",r=n.specifiedByUrl?"specifiedByURL":"",i=n.directiveIsRepeatable?"isRepeatable":"";function o(e){return n.inputValueDeprecation?e:""}return`\n query IntrospectionQuery {\n __schema {\n ${n.schemaDescription?t:""}\n queryType { name }\n mutationType { name }\n subscriptionType { name }\n types {\n ...FullType\n }\n directives {\n name\n ${t}\n ${i}\n locations\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n }\n }\n }\n\n fragment FullType on __Type {\n kind\n name\n ${t}\n ${r}\n fields(includeDeprecated: true) {\n name\n ${t}\n args${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields${o("(includeDeprecated: true)")} {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n ${t}\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n\n fragment InputValue on __InputValue {\n name\n ${t}\n type { ...TypeRef }\n defaultValue\n ${o("isDeprecated")}\n ${o("deprecationReason")}\n }\n\n fragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n `}},9535:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.getOperationAST=function(e,n){let t=null;for(const o of e.definitions){var i;if(o.kind===r.Kind.OPERATION_DEFINITION)if(null==n){if(t)return null;t=o}else if((null===(i=o.name)||void 0===i?void 0:i.value)===n)return o}return t};var r=t(2828)},8678:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.getOperationRootType=function(e,n){if("query"===n.operation){const t=e.getQueryType();if(!t)throw new r.GraphQLError("Schema does not define the required query root type.",{nodes:n});return t}if("mutation"===n.operation){const t=e.getMutationType();if(!t)throw new r.GraphQLError("Schema is not configured for mutations.",{nodes:n});return t}if("subscription"===n.operation){const t=e.getSubscriptionType();if(!t)throw new r.GraphQLError("Schema is not configured for subscriptions.",{nodes:n});return t}throw new r.GraphQLError("Can only have query, mutation and subscription operations.",{nodes:n})};var r=t(5822)},9548:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BreakingChangeType",{enumerable:!0,get:function(){return O.BreakingChangeType}}),Object.defineProperty(n,"DangerousChangeType",{enumerable:!0,get:function(){return O.DangerousChangeType}}),Object.defineProperty(n,"TypeInfo",{enumerable:!0,get:function(){return h.TypeInfo}}),Object.defineProperty(n,"assertValidName",{enumerable:!0,get:function(){return N.assertValidName}}),Object.defineProperty(n,"astFromValue",{enumerable:!0,get:function(){return m.astFromValue}}),Object.defineProperty(n,"buildASTSchema",{enumerable:!0,get:function(){return u.buildASTSchema}}),Object.defineProperty(n,"buildClientSchema",{enumerable:!0,get:function(){return s.buildClientSchema}}),Object.defineProperty(n,"buildSchema",{enumerable:!0,get:function(){return u.buildSchema}}),Object.defineProperty(n,"coerceInputValue",{enumerable:!0,get:function(){return T.coerceInputValue}}),Object.defineProperty(n,"concatAST",{enumerable:!0,get:function(){return b.concatAST}}),Object.defineProperty(n,"doTypesOverlap",{enumerable:!0,get:function(){return E.doTypesOverlap}}),Object.defineProperty(n,"extendSchema",{enumerable:!0,get:function(){return c.extendSchema}}),Object.defineProperty(n,"findBreakingChanges",{enumerable:!0,get:function(){return O.findBreakingChanges}}),Object.defineProperty(n,"findDangerousChanges",{enumerable:!0,get:function(){return O.findDangerousChanges}}),Object.defineProperty(n,"getIntrospectionQuery",{enumerable:!0,get:function(){return r.getIntrospectionQuery}}),Object.defineProperty(n,"getOperationAST",{enumerable:!0,get:function(){return i.getOperationAST}}),Object.defineProperty(n,"getOperationRootType",{enumerable:!0,get:function(){return o.getOperationRootType}}),Object.defineProperty(n,"introspectionFromSchema",{enumerable:!0,get:function(){return a.introspectionFromSchema}}),Object.defineProperty(n,"isEqualType",{enumerable:!0,get:function(){return E.isEqualType}}),Object.defineProperty(n,"isTypeSubTypeOf",{enumerable:!0,get:function(){return E.isTypeSubTypeOf}}),Object.defineProperty(n,"isValidNameError",{enumerable:!0,get:function(){return N.isValidNameError}}),Object.defineProperty(n,"lexicographicSortSchema",{enumerable:!0,get:function(){return p.lexicographicSortSchema}}),Object.defineProperty(n,"printIntrospectionSchema",{enumerable:!0,get:function(){return l.printIntrospectionSchema}}),Object.defineProperty(n,"printSchema",{enumerable:!0,get:function(){return l.printSchema}}),Object.defineProperty(n,"printType",{enumerable:!0,get:function(){return l.printType}}),Object.defineProperty(n,"separateOperations",{enumerable:!0,get:function(){return v.separateOperations}}),Object.defineProperty(n,"stripIgnoredCharacters",{enumerable:!0,get:function(){return g.stripIgnoredCharacters}}),Object.defineProperty(n,"typeFromAST",{enumerable:!0,get:function(){return d.typeFromAST}}),Object.defineProperty(n,"valueFromAST",{enumerable:!0,get:function(){return f.valueFromAST}}),Object.defineProperty(n,"valueFromASTUntyped",{enumerable:!0,get:function(){return y.valueFromASTUntyped}}),Object.defineProperty(n,"visitWithTypeInfo",{enumerable:!0,get:function(){return h.visitWithTypeInfo}});var r=t(9363),i=t(9535),o=t(8678),a=t(8039),s=t(8686),u=t(2906),c=t(3242),p=t(8163),l=t(2821),d=t(5115),f=t(3770),y=t(7784),m=t(8115),h=t(6226),T=t(3679),b=t(6078),v=t(8243),g=t(2307),E=t(298),N=t(6526),O=t(3298)},8039:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.introspectionFromSchema=function(e,n){const t={specifiedByUrl:!0,directiveIsRepeatable:!0,schemaDescription:!0,inputValueDeprecation:!0,...n},s=(0,i.parse)((0,a.getIntrospectionQuery)(t)),u=(0,o.executeSync)({schema:e,document:s});return!u.errors&&u.data||(0,r.invariant)(!1),u.data};var r=t(7706),i=t(8370),o=t(192),a=t(9363)},8163:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.lexicographicSortSchema=function(e){const n=e.toConfig(),t=(0,o.keyValMap)(d(n.types),(e=>e.name),(function(e){if((0,s.isScalarType)(e)||(0,c.isIntrospectionType)(e))return e;if((0,s.isObjectType)(e)){const n=e.toConfig();return new s.GraphQLObjectType({...n,interfaces:()=>b(n.interfaces),fields:()=>T(n.fields)})}if((0,s.isInterfaceType)(e)){const n=e.toConfig();return new s.GraphQLInterfaceType({...n,interfaces:()=>b(n.interfaces),fields:()=>T(n.fields)})}if((0,s.isUnionType)(e)){const n=e.toConfig();return new s.GraphQLUnionType({...n,types:()=>b(n.types)})}if((0,s.isEnumType)(e)){const n=e.toConfig();return new s.GraphQLEnumType({...n,values:l(n.values,(e=>e))})}if((0,s.isInputObjectType)(e)){const n=e.toConfig();return new s.GraphQLInputObjectType({...n,fields:()=>l(n.fields,(e=>({...e,type:a(e.type)})))})}(0,i.invariant)(!1,"Unexpected type: "+(0,r.inspect)(e))}));return new p.GraphQLSchema({...n,types:Object.values(t),directives:d(n.directives).map((function(e){const n=e.toConfig();return new u.GraphQLDirective({...n,locations:f(n.locations,(e=>e)),args:h(n.args)})})),query:m(n.query),mutation:m(n.mutation),subscription:m(n.subscription)});function a(e){return(0,s.isListType)(e)?new s.GraphQLList(a(e.ofType)):(0,s.isNonNullType)(e)?new s.GraphQLNonNull(a(e.ofType)):y(e)}function y(e){return t[e.name]}function m(e){return e&&y(e)}function h(e){return l(e,(e=>({...e,type:a(e.type)})))}function T(e){return l(e,(e=>({...e,type:a(e.type),args:e.args&&h(e.args)})))}function b(e){return d(e).map(y)}};var r=t(8002),i=t(7706),o=t(7154),a=t(5250),s=t(5003),u=t(7197),c=t(8155),p=t(6829);function l(e,n){const t=Object.create(null);for(const r of Object.keys(e).sort(a.naturalCompare))t[r]=n(e[r]);return t}function d(e){return f(e,(e=>e.name))}function f(e,n){return e.slice().sort(((e,t)=>{const r=n(e),i=n(t);return(0,a.naturalCompare)(r,i)}))}},2821:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.printIntrospectionSchema=function(e){return y(e,c.isSpecifiedDirective,p.isIntrospectionType)},n.printSchema=function(e){return y(e,(e=>!(0,c.isSpecifiedDirective)(e)),f)},n.printType=h;var r=t(8002),i=t(7706),o=t(849),a=t(2828),s=t(3033),u=t(5003),c=t(7197),p=t(8155),l=t(2229),d=t(8115);function f(e){return!(0,l.isSpecifiedScalarType)(e)&&!(0,p.isIntrospectionType)(e)}function y(e,n,t){const r=e.getDirectives().filter(n),i=Object.values(e.getTypeMap()).filter(t);return[m(e),...r.map((e=>function(e){return O(e)+"directive @"+e.name+g(e.args)+(e.isRepeatable?" repeatable":"")+" on "+e.locations.join(" | ")}(e))),...i.map((e=>h(e)))].filter(Boolean).join("\n\n")}function m(e){if(null==e.description&&function(e){const n=e.getQueryType();if(n&&"Query"!==n.name)return!1;const t=e.getMutationType();if(t&&"Mutation"!==t.name)return!1;const r=e.getSubscriptionType();return!r||"Subscription"===r.name}(e))return;const n=[],t=e.getQueryType();t&&n.push(` query: ${t.name}`);const r=e.getMutationType();r&&n.push(` mutation: ${r.name}`);const i=e.getSubscriptionType();return i&&n.push(` subscription: ${i.name}`),O(e)+`schema {\n${n.join("\n")}\n}`}function h(e){return(0,u.isScalarType)(e)?function(e){return O(e)+`scalar ${e.name}`+(null==(n=e).specifiedByURL?"":` @specifiedBy(url: ${(0,s.print)({kind:a.Kind.STRING,value:n.specifiedByURL})})`);var n}(e):(0,u.isObjectType)(e)?function(e){return O(e)+`type ${e.name}`+T(e)+b(e)}(e):(0,u.isInterfaceType)(e)?function(e){return O(e)+`interface ${e.name}`+T(e)+b(e)}(e):(0,u.isUnionType)(e)?function(e){const n=e.getTypes(),t=n.length?" = "+n.join(" | "):"";return O(e)+"union "+e.name+t}(e):(0,u.isEnumType)(e)?function(e){const n=e.getValues().map(((e,n)=>O(e," ",!n)+" "+e.name+N(e.deprecationReason)));return O(e)+`enum ${e.name}`+v(n)}(e):(0,u.isInputObjectType)(e)?function(e){const n=Object.values(e.getFields()).map(((e,n)=>O(e," ",!n)+" "+E(e)));return O(e)+`input ${e.name}`+v(n)}(e):void(0,i.invariant)(!1,"Unexpected type: "+(0,r.inspect)(e))}function T(e){const n=e.getInterfaces();return n.length?" implements "+n.map((e=>e.name)).join(" & "):""}function b(e){return v(Object.values(e.getFields()).map(((e,n)=>O(e," ",!n)+" "+e.name+g(e.args," ")+": "+String(e.type)+N(e.deprecationReason))))}function v(e){return 0!==e.length?" {\n"+e.join("\n")+"\n}":""}function g(e,n=""){return 0===e.length?"":e.every((e=>!e.description))?"("+e.map(E).join(", ")+")":"(\n"+e.map(((e,t)=>O(e," "+n,!t)+" "+n+E(e))).join("\n")+"\n"+n+")"}function E(e){const n=(0,d.astFromValue)(e.defaultValue,e.type);let t=e.name+": "+String(e.type);return n&&(t+=` = ${(0,s.print)(n)}`),t+N(e.deprecationReason)}function N(e){return null==e?"":e!==c.DEFAULT_DEPRECATION_REASON?` @deprecated(reason: ${(0,s.print)({kind:a.Kind.STRING,value:e})})`:" @deprecated"}function O(e,n="",t=!0){const{description:r}=e;return null==r?"":(n&&!t?"\n"+n:n)+(0,s.print)({kind:a.Kind.STRING,value:r,block:(0,o.isPrintableAsBlockString)(r)}).replace(/\n/g,"\n"+n)+"\n"}},8243:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.separateOperations=function(e){const n=[],t=Object.create(null);for(const i of e.definitions)switch(i.kind){case r.Kind.OPERATION_DEFINITION:n.push(i);break;case r.Kind.FRAGMENT_DEFINITION:t[i.name.value]=a(i.selectionSet)}const i=Object.create(null);for(const s of n){const n=new Set;for(const e of a(s.selectionSet))o(n,t,e);i[s.name?s.name.value:""]={kind:r.Kind.DOCUMENT,definitions:e.definitions.filter((e=>e===s||e.kind===r.Kind.FRAGMENT_DEFINITION&&n.has(e.name.value)))}}return i};var r=t(2828),i=t(285);function o(e,n,t){if(!e.has(t)){e.add(t);const r=n[t];if(void 0!==r)for(const t of r)o(e,n,t)}}function a(e){const n=[];return(0,i.visit)(e,{FragmentSpread(e){n.push(e.name.value)}}),n}},6830:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.sortValueNode=function e(n){switch(n.kind){case i.Kind.OBJECT:return{...n,fields:(t=n.fields,t.map((n=>({...n,value:e(n.value)}))).sort(((e,n)=>(0,r.naturalCompare)(e.name.value,n.name.value))))};case i.Kind.LIST:return{...n,values:n.values.map(e)};case i.Kind.INT:case i.Kind.FLOAT:case i.Kind.STRING:case i.Kind.BOOLEAN:case i.Kind.NULL:case i.Kind.ENUM:case i.Kind.VARIABLE:return n}var t};var r=t(5250),i=t(2828)},2307:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.stripIgnoredCharacters=function(e){const n=(0,o.isSource)(e)?e:new o.Source(e),t=n.body,s=new i.Lexer(n);let u="",c=!1;for(;s.advance().kind!==a.TokenKind.EOF;){const e=s.token,n=e.kind,o=!(0,i.isPunctuatorTokenKind)(e.kind);c&&(o||e.kind===a.TokenKind.SPREAD)&&(u+=" ");const p=t.slice(e.start,e.end);n===a.TokenKind.BLOCK_STRING?u+=(0,r.printBlockString)(e.value,{minimize:!0}):u+=p,c=o}return u};var r=t(849),i=t(4274),o=t(2412),a=t(3175)},298:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.doTypesOverlap=function(e,n,t){return n===t||((0,r.isAbstractType)(n)?(0,r.isAbstractType)(t)?e.getPossibleTypes(n).some((n=>e.isSubType(t,n))):e.isSubType(n,t):!!(0,r.isAbstractType)(t)&&e.isSubType(t,n))},n.isEqualType=function e(n,t){return n===t||((0,r.isNonNullType)(n)&&(0,r.isNonNullType)(t)||!(!(0,r.isListType)(n)||!(0,r.isListType)(t)))&&e(n.ofType,t.ofType)},n.isTypeSubTypeOf=function e(n,t,i){return t===i||((0,r.isNonNullType)(i)?!!(0,r.isNonNullType)(t)&&e(n,t.ofType,i.ofType):(0,r.isNonNullType)(t)?e(n,t.ofType,i):(0,r.isListType)(i)?!!(0,r.isListType)(t)&&e(n,t.ofType,i.ofType):!(0,r.isListType)(t)&&((0,r.isAbstractType)(i)&&((0,r.isInterfaceType)(t)||(0,r.isObjectType)(t))&&n.isSubType(i,t)))};var r=t(5003)},5115:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.typeFromAST=function e(n,t){switch(t.kind){case r.Kind.LIST_TYPE:{const r=e(n,t.type);return r&&new i.GraphQLList(r)}case r.Kind.NON_NULL_TYPE:{const r=e(n,t.type);return r&&new i.GraphQLNonNull(r)}case r.Kind.NAMED_TYPE:return n.getType(t.name.value)}};var r=t(2828),i=t(5003)},3770:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.valueFromAST=function e(n,t,c){if(n){if(n.kind===a.Kind.VARIABLE){const e=n.name.value;if(null==c||void 0===c[e])return;const r=c[e];if(null===r&&(0,s.isNonNullType)(t))return;return r}if((0,s.isNonNullType)(t)){if(n.kind===a.Kind.NULL)return;return e(n,t.ofType,c)}if(n.kind===a.Kind.NULL)return null;if((0,s.isListType)(t)){const r=t.ofType;if(n.kind===a.Kind.LIST){const t=[];for(const i of n.values)if(u(i,c)){if((0,s.isNonNullType)(r))return;t.push(null)}else{const n=e(i,r,c);if(void 0===n)return;t.push(n)}return t}const i=e(n,r,c);if(void 0===i)return;return[i]}if((0,s.isInputObjectType)(t)){if(n.kind!==a.Kind.OBJECT)return;const r=Object.create(null),i=(0,o.keyMap)(n.fields,(e=>e.name.value));for(const n of Object.values(t.getFields())){const t=i[n.name];if(!t||u(t.value,c)){if(void 0!==n.defaultValue)r[n.name]=n.defaultValue;else if((0,s.isNonNullType)(n.type))return;continue}const o=e(t.value,n.type,c);if(void 0===o)return;r[n.name]=o}return r}if((0,s.isLeafType)(t)){let e;try{e=t.parseLiteral(n,c)}catch(e){return}if(void 0===e)return;return e}(0,i.invariant)(!1,"Unexpected input type: "+(0,r.inspect)(t))}};var r=t(8002),i=t(7706),o=t(2863),a=t(2828),s=t(5003);function u(e,n){return e.kind===a.Kind.VARIABLE&&(null==n||void 0===n[e.name.value])}},7784:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.valueFromASTUntyped=function e(n,t){switch(n.kind){case i.Kind.NULL:return null;case i.Kind.INT:return parseInt(n.value,10);case i.Kind.FLOAT:return parseFloat(n.value);case i.Kind.STRING:case i.Kind.ENUM:case i.Kind.BOOLEAN:return n.value;case i.Kind.LIST:return n.values.map((n=>e(n,t)));case i.Kind.OBJECT:return(0,r.keyValMap)(n.fields,(e=>e.name.value),(n=>e(n.value,t)));case i.Kind.VARIABLE:return null==t?void 0:t[n.name.value]}};var r=t(7154),i=t(2828)},3955:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.ValidationContext=n.SDLValidationContext=n.ASTValidationContext=void 0;var r=t(2828),i=t(285),o=t(6226);class a{constructor(e,n){this._ast=e,this._fragments=void 0,this._fragmentSpreads=new Map,this._recursivelyReferencedFragments=new Map,this._onError=n}get[Symbol.toStringTag](){return"ASTValidationContext"}reportError(e){this._onError(e)}getDocument(){return this._ast}getFragment(e){let n;if(this._fragments)n=this._fragments;else{n=Object.create(null);for(const e of this.getDocument().definitions)e.kind===r.Kind.FRAGMENT_DEFINITION&&(n[e.name.value]=e);this._fragments=n}return n[e]}getFragmentSpreads(e){let n=this._fragmentSpreads.get(e);if(!n){n=[];const t=[e];let i;for(;i=t.pop();)for(const e of i.selections)e.kind===r.Kind.FRAGMENT_SPREAD?n.push(e):e.selectionSet&&t.push(e.selectionSet);this._fragmentSpreads.set(e,n)}return n}getRecursivelyReferencedFragments(e){let n=this._recursivelyReferencedFragments.get(e);if(!n){n=[];const t=Object.create(null),r=[e.selectionSet];let i;for(;i=r.pop();)for(const e of this.getFragmentSpreads(i)){const i=e.name.value;if(!0!==t[i]){t[i]=!0;const e=this.getFragment(i);e&&(n.push(e),r.push(e.selectionSet))}}this._recursivelyReferencedFragments.set(e,n)}return n}}n.ASTValidationContext=a;class s extends a{constructor(e,n,t){super(e,t),this._schema=n}get[Symbol.toStringTag](){return"SDLValidationContext"}getSchema(){return this._schema}}n.SDLValidationContext=s;class u extends a{constructor(e,n,t,r){super(n,r),this._schema=e,this._typeInfo=t,this._variableUsages=new Map,this._recursiveVariableUsages=new Map}get[Symbol.toStringTag](){return"ValidationContext"}getSchema(){return this._schema}getVariableUsages(e){let n=this._variableUsages.get(e);if(!n){const t=[],r=new o.TypeInfo(this._schema);(0,i.visit)(e,(0,o.visitWithTypeInfo)(r,{VariableDefinition:()=>!1,Variable(e){t.push({node:e,type:r.getInputType(),defaultValue:r.getDefaultValue()})}})),n=t,this._variableUsages.set(e,n)}return n}getRecursiveVariableUsages(e){let n=this._recursiveVariableUsages.get(e);if(!n){n=this.getVariableUsages(e);for(const t of this.getRecursivelyReferencedFragments(e))n=n.concat(this.getVariableUsages(t));this._recursiveVariableUsages.set(e,n)}return n}getType(){return this._typeInfo.getType()}getParentType(){return this._typeInfo.getParentType()}getInputType(){return this._typeInfo.getInputType()}getParentInputType(){return this._typeInfo.getParentInputType()}getFieldDef(){return this._typeInfo.getFieldDef()}getDirective(){return this._typeInfo.getDirective()}getArgument(){return this._typeInfo.getArgument()}getEnumValue(){return this._typeInfo.getEnumValue()}}n.ValidationContext=u},1122:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"ExecutableDefinitionsRule",{enumerable:!0,get:function(){return a.ExecutableDefinitionsRule}}),Object.defineProperty(n,"FieldsOnCorrectTypeRule",{enumerable:!0,get:function(){return s.FieldsOnCorrectTypeRule}}),Object.defineProperty(n,"FragmentsOnCompositeTypesRule",{enumerable:!0,get:function(){return u.FragmentsOnCompositeTypesRule}}),Object.defineProperty(n,"KnownArgumentNamesRule",{enumerable:!0,get:function(){return c.KnownArgumentNamesRule}}),Object.defineProperty(n,"KnownDirectivesRule",{enumerable:!0,get:function(){return p.KnownDirectivesRule}}),Object.defineProperty(n,"KnownFragmentNamesRule",{enumerable:!0,get:function(){return l.KnownFragmentNamesRule}}),Object.defineProperty(n,"KnownTypeNamesRule",{enumerable:!0,get:function(){return d.KnownTypeNamesRule}}),Object.defineProperty(n,"LoneAnonymousOperationRule",{enumerable:!0,get:function(){return f.LoneAnonymousOperationRule}}),Object.defineProperty(n,"LoneSchemaDefinitionRule",{enumerable:!0,get:function(){return R.LoneSchemaDefinitionRule}}),Object.defineProperty(n,"NoDeprecatedCustomRule",{enumerable:!0,get:function(){return M.NoDeprecatedCustomRule}}),Object.defineProperty(n,"NoFragmentCyclesRule",{enumerable:!0,get:function(){return y.NoFragmentCyclesRule}}),Object.defineProperty(n,"NoSchemaIntrospectionCustomRule",{enumerable:!0,get:function(){return K.NoSchemaIntrospectionCustomRule}}),Object.defineProperty(n,"NoUndefinedVariablesRule",{enumerable:!0,get:function(){return m.NoUndefinedVariablesRule}}),Object.defineProperty(n,"NoUnusedFragmentsRule",{enumerable:!0,get:function(){return h.NoUnusedFragmentsRule}}),Object.defineProperty(n,"NoUnusedVariablesRule",{enumerable:!0,get:function(){return T.NoUnusedVariablesRule}}),Object.defineProperty(n,"OverlappingFieldsCanBeMergedRule",{enumerable:!0,get:function(){return b.OverlappingFieldsCanBeMergedRule}}),Object.defineProperty(n,"PossibleFragmentSpreadsRule",{enumerable:!0,get:function(){return v.PossibleFragmentSpreadsRule}}),Object.defineProperty(n,"PossibleTypeExtensionsRule",{enumerable:!0,get:function(){return C.PossibleTypeExtensionsRule}}),Object.defineProperty(n,"ProvidedRequiredArgumentsRule",{enumerable:!0,get:function(){return g.ProvidedRequiredArgumentsRule}}),Object.defineProperty(n,"ScalarLeafsRule",{enumerable:!0,get:function(){return E.ScalarLeafsRule}}),Object.defineProperty(n,"SingleFieldSubscriptionsRule",{enumerable:!0,get:function(){return N.SingleFieldSubscriptionsRule}}),Object.defineProperty(n,"UniqueArgumentDefinitionNamesRule",{enumerable:!0,get:function(){return G.UniqueArgumentDefinitionNamesRule}}),Object.defineProperty(n,"UniqueArgumentNamesRule",{enumerable:!0,get:function(){return O.UniqueArgumentNamesRule}}),Object.defineProperty(n,"UniqueDirectiveNamesRule",{enumerable:!0,get:function(){return V.UniqueDirectiveNamesRule}}),Object.defineProperty(n,"UniqueDirectivesPerLocationRule",{enumerable:!0,get:function(){return I.UniqueDirectivesPerLocationRule}}),Object.defineProperty(n,"UniqueEnumValueNamesRule",{enumerable:!0,get:function(){return F.UniqueEnumValueNamesRule}}),Object.defineProperty(n,"UniqueFieldDefinitionNamesRule",{enumerable:!0,get:function(){return x.UniqueFieldDefinitionNamesRule}}),Object.defineProperty(n,"UniqueFragmentNamesRule",{enumerable:!0,get:function(){return _.UniqueFragmentNamesRule}}),Object.defineProperty(n,"UniqueInputFieldNamesRule",{enumerable:!0,get:function(){return L.UniqueInputFieldNamesRule}}),Object.defineProperty(n,"UniqueOperationNamesRule",{enumerable:!0,get:function(){return S.UniqueOperationNamesRule}}),Object.defineProperty(n,"UniqueOperationTypesRule",{enumerable:!0,get:function(){return w.UniqueOperationTypesRule}}),Object.defineProperty(n,"UniqueTypeNamesRule",{enumerable:!0,get:function(){return k.UniqueTypeNamesRule}}),Object.defineProperty(n,"UniqueVariableNamesRule",{enumerable:!0,get:function(){return D.UniqueVariableNamesRule}}),Object.defineProperty(n,"ValidationContext",{enumerable:!0,get:function(){return i.ValidationContext}}),Object.defineProperty(n,"ValuesOfCorrectTypeRule",{enumerable:!0,get:function(){return j.ValuesOfCorrectTypeRule}}),Object.defineProperty(n,"VariablesAreInputTypesRule",{enumerable:!0,get:function(){return A.VariablesAreInputTypesRule}}),Object.defineProperty(n,"VariablesInAllowedPositionRule",{enumerable:!0,get:function(){return P.VariablesInAllowedPositionRule}}),Object.defineProperty(n,"specifiedRules",{enumerable:!0,get:function(){return o.specifiedRules}}),Object.defineProperty(n,"validate",{enumerable:!0,get:function(){return r.validate}});var r=t(9504),i=t(3955),o=t(4710),a=t(5285),s=t(9426),u=t(3558),c=t(9989),p=t(2826),l=t(1843),d=t(5961),f=t(870),y=t(658),m=t(7459),h=t(7317),T=t(8769),b=t(4331),v=t(5904),g=t(4312),E=t(7168),N=t(4666),O=t(4986),I=t(3576),_=t(5883),L=t(4313),S=t(2139),D=t(4243),j=t(6869),A=t(4942),P=t(8034),R=t(3411),w=t(856),k=t(1686),F=t(6400),x=t(4046),G=t(3878),V=t(6753),C=t(5715),M=t(2860),K=t(2276)},5285:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.ExecutableDefinitionsRule=function(e){return{Document(n){for(const t of n.definitions)if(!(0,o.isExecutableDefinitionNode)(t)){const n=t.kind===i.Kind.SCHEMA_DEFINITION||t.kind===i.Kind.SCHEMA_EXTENSION?"schema":'"'+t.name.value+'"';e.reportError(new r.GraphQLError(`The ${n} definition is not executable.`,{nodes:t}))}return!1}}};var r=t(5822),i=t(2828),o=t(1352)},9426:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.FieldsOnCorrectTypeRule=function(e){return{Field(n){const t=e.getParentType();if(t&&!e.getFieldDef()){const u=e.getSchema(),c=n.name.value;let p=(0,r.didYouMean)("to use an inline fragment on",function(e,n,t){if(!(0,s.isAbstractType)(n))return[];const r=new Set,o=Object.create(null);for(const i of e.getPossibleTypes(n))if(i.getFields()[t]){r.add(i),o[i.name]=1;for(const e of i.getInterfaces()){var a;e.getFields()[t]&&(r.add(e),o[e.name]=(null!==(a=o[e.name])&&void 0!==a?a:0)+1)}}return[...r].sort(((n,t)=>{const r=o[t.name]-o[n.name];return 0!==r?r:(0,s.isInterfaceType)(n)&&e.isSubType(n,t)?-1:(0,s.isInterfaceType)(t)&&e.isSubType(t,n)?1:(0,i.naturalCompare)(n.name,t.name)})).map((e=>e.name))}(u,t,c));""===p&&(p=(0,r.didYouMean)(function(e,n){if((0,s.isObjectType)(e)||(0,s.isInterfaceType)(e)){const t=Object.keys(e.getFields());return(0,o.suggestionList)(n,t)}return[]}(t,c))),e.reportError(new a.GraphQLError(`Cannot query field "${c}" on type "${t.name}".`+p,{nodes:n}))}}}};var r=t(166),i=t(5250),o=t(8070),a=t(5822),s=t(5003)},3558:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.FragmentsOnCompositeTypesRule=function(e){return{InlineFragment(n){const t=n.typeCondition;if(t){const n=(0,a.typeFromAST)(e.getSchema(),t);if(n&&!(0,o.isCompositeType)(n)){const n=(0,i.print)(t);e.reportError(new r.GraphQLError(`Fragment cannot condition on non composite type "${n}".`,{nodes:t}))}}},FragmentDefinition(n){const t=(0,a.typeFromAST)(e.getSchema(),n.typeCondition);if(t&&!(0,o.isCompositeType)(t)){const t=(0,i.print)(n.typeCondition);e.reportError(new r.GraphQLError(`Fragment "${n.name.value}" cannot condition on non composite type "${t}".`,{nodes:n.typeCondition}))}}}};var r=t(5822),i=t(3033),o=t(5003),a=t(5115)},9989:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.KnownArgumentNamesOnDirectivesRule=u,n.KnownArgumentNamesRule=function(e){return{...u(e),Argument(n){const t=e.getArgument(),a=e.getFieldDef(),s=e.getParentType();if(!t&&a&&s){const t=n.name.value,u=a.args.map((e=>e.name)),c=(0,i.suggestionList)(t,u);e.reportError(new o.GraphQLError(`Unknown argument "${t}" on field "${s.name}.${a.name}".`+(0,r.didYouMean)(c),{nodes:n}))}}}};var r=t(166),i=t(8070),o=t(5822),a=t(2828),s=t(7197);function u(e){const n=Object.create(null),t=e.getSchema(),u=t?t.getDirectives():s.specifiedDirectives;for(const e of u)n[e.name]=e.args.map((e=>e.name));const c=e.getDocument().definitions;for(const e of c)if(e.kind===a.Kind.DIRECTIVE_DEFINITION){var p;const t=null!==(p=e.arguments)&&void 0!==p?p:[];n[e.name.value]=t.map((e=>e.name.value))}return{Directive(t){const a=t.name.value,s=n[a];if(t.arguments&&s)for(const n of t.arguments){const t=n.name.value;if(!s.includes(t)){const u=(0,i.suggestionList)(t,s);e.reportError(new o.GraphQLError(`Unknown argument "${t}" on directive "@${a}".`+(0,r.didYouMean)(u),{nodes:n}))}}return!1}}}},2826:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.KnownDirectivesRule=function(e){const n=Object.create(null),t=e.getSchema(),p=t?t.getDirectives():c.specifiedDirectives;for(const e of p)n[e.name]=e.locations;const l=e.getDocument().definitions;for(const e of l)e.kind===u.Kind.DIRECTIVE_DEFINITION&&(n[e.name.value]=e.locations.map((e=>e.value)));return{Directive(t,c,p,l,d){const f=t.name.value,y=n[f];if(!y)return void e.reportError(new o.GraphQLError(`Unknown directive "@${f}".`,{nodes:t}));const m=function(e){const n=e[e.length-1];switch("kind"in n||(0,i.invariant)(!1),n.kind){case u.Kind.OPERATION_DEFINITION:return function(e){switch(e){case a.OperationTypeNode.QUERY:return s.DirectiveLocation.QUERY;case a.OperationTypeNode.MUTATION:return s.DirectiveLocation.MUTATION;case a.OperationTypeNode.SUBSCRIPTION:return s.DirectiveLocation.SUBSCRIPTION}}(n.operation);case u.Kind.FIELD:return s.DirectiveLocation.FIELD;case u.Kind.FRAGMENT_SPREAD:return s.DirectiveLocation.FRAGMENT_SPREAD;case u.Kind.INLINE_FRAGMENT:return s.DirectiveLocation.INLINE_FRAGMENT;case u.Kind.FRAGMENT_DEFINITION:return s.DirectiveLocation.FRAGMENT_DEFINITION;case u.Kind.VARIABLE_DEFINITION:return s.DirectiveLocation.VARIABLE_DEFINITION;case u.Kind.SCHEMA_DEFINITION:case u.Kind.SCHEMA_EXTENSION:return s.DirectiveLocation.SCHEMA;case u.Kind.SCALAR_TYPE_DEFINITION:case u.Kind.SCALAR_TYPE_EXTENSION:return s.DirectiveLocation.SCALAR;case u.Kind.OBJECT_TYPE_DEFINITION:case u.Kind.OBJECT_TYPE_EXTENSION:return s.DirectiveLocation.OBJECT;case u.Kind.FIELD_DEFINITION:return s.DirectiveLocation.FIELD_DEFINITION;case u.Kind.INTERFACE_TYPE_DEFINITION:case u.Kind.INTERFACE_TYPE_EXTENSION:return s.DirectiveLocation.INTERFACE;case u.Kind.UNION_TYPE_DEFINITION:case u.Kind.UNION_TYPE_EXTENSION:return s.DirectiveLocation.UNION;case u.Kind.ENUM_TYPE_DEFINITION:case u.Kind.ENUM_TYPE_EXTENSION:return s.DirectiveLocation.ENUM;case u.Kind.ENUM_VALUE_DEFINITION:return s.DirectiveLocation.ENUM_VALUE;case u.Kind.INPUT_OBJECT_TYPE_DEFINITION:case u.Kind.INPUT_OBJECT_TYPE_EXTENSION:return s.DirectiveLocation.INPUT_OBJECT;case u.Kind.INPUT_VALUE_DEFINITION:{const n=e[e.length-3];return"kind"in n||(0,i.invariant)(!1),n.kind===u.Kind.INPUT_OBJECT_TYPE_DEFINITION?s.DirectiveLocation.INPUT_FIELD_DEFINITION:s.DirectiveLocation.ARGUMENT_DEFINITION}default:(0,i.invariant)(!1,"Unexpected kind: "+(0,r.inspect)(n.kind))}}(d);m&&!y.includes(m)&&e.reportError(new o.GraphQLError(`Directive "@${f}" may not be used on ${m}.`,{nodes:t}))}}};var r=t(8002),i=t(7706),o=t(5822),a=t(1807),s=t(8333),u=t(2828),c=t(7197)},1843:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.KnownFragmentNamesRule=function(e){return{FragmentSpread(n){const t=n.name.value;e.getFragment(t)||e.reportError(new r.GraphQLError(`Unknown fragment "${t}".`,{nodes:n.name}))}}};var r=t(5822)},5961:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.KnownTypeNamesRule=function(e){const n=e.getSchema(),t=n?n.getTypeMap():Object.create(null),s=Object.create(null);for(const n of e.getDocument().definitions)(0,a.isTypeDefinitionNode)(n)&&(s[n.name.value]=!0);const c=[...Object.keys(t),...Object.keys(s)];return{NamedType(n,p,l,d,f){const y=n.name.value;if(!t[y]&&!s[y]){var m;const t=null!==(m=f[2])&&void 0!==m?m:l,s=null!=t&&"kind"in(h=t)&&((0,a.isTypeSystemDefinitionNode)(h)||(0,a.isTypeSystemExtensionNode)(h));if(s&&u.includes(y))return;const p=(0,i.suggestionList)(y,s?u.concat(c):c);e.reportError(new o.GraphQLError(`Unknown type "${y}".`+(0,r.didYouMean)(p),{nodes:n}))}var h}}};var r=t(166),i=t(8070),o=t(5822),a=t(1352),s=t(8155);const u=[...t(2229).specifiedScalarTypes,...s.introspectionTypes].map((e=>e.name))},870:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.LoneAnonymousOperationRule=function(e){let n=0;return{Document(e){n=e.definitions.filter((e=>e.kind===i.Kind.OPERATION_DEFINITION)).length},OperationDefinition(t){!t.name&&n>1&&e.reportError(new r.GraphQLError("This anonymous operation must be the only defined operation.",{nodes:t}))}}};var r=t(5822),i=t(2828)},3411:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.LoneSchemaDefinitionRule=function(e){var n,t,i;const o=e.getSchema(),a=null!==(n=null!==(t=null!==(i=null==o?void 0:o.astNode)&&void 0!==i?i:null==o?void 0:o.getQueryType())&&void 0!==t?t:null==o?void 0:o.getMutationType())&&void 0!==n?n:null==o?void 0:o.getSubscriptionType();let s=0;return{SchemaDefinition(n){a?e.reportError(new r.GraphQLError("Cannot define a new schema within a schema extension.",{nodes:n})):(s>0&&e.reportError(new r.GraphQLError("Must provide only one schema definition.",{nodes:n})),++s)}}};var r=t(5822)},658:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoFragmentCyclesRule=function(e){const n=Object.create(null),t=[],i=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition:e=>(o(e),!1)};function o(a){if(n[a.name.value])return;const s=a.name.value;n[s]=!0;const u=e.getFragmentSpreads(a.selectionSet);if(0!==u.length){i[s]=t.length;for(const n of u){const a=n.name.value,s=i[a];if(t.push(n),void 0===s){const n=e.getFragment(a);n&&o(n)}else{const n=t.slice(s),i=n.slice(0,-1).map((e=>'"'+e.name.value+'"')).join(", ");e.reportError(new r.GraphQLError(`Cannot spread fragment "${a}" within itself`+(""!==i?` via ${i}.`:"."),{nodes:n}))}t.pop()}i[s]=void 0}}};var r=t(5822)},7459:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoUndefinedVariablesRule=function(e){let n=Object.create(null);return{OperationDefinition:{enter(){n=Object.create(null)},leave(t){const i=e.getRecursiveVariableUsages(t);for(const{node:o}of i){const i=o.name.value;!0!==n[i]&&e.reportError(new r.GraphQLError(t.name?`Variable "$${i}" is not defined by operation "${t.name.value}".`:`Variable "$${i}" is not defined.`,{nodes:[o,t]}))}}},VariableDefinition(e){n[e.variable.name.value]=!0}}};var r=t(5822)},7317:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoUnusedFragmentsRule=function(e){const n=[],t=[];return{OperationDefinition:e=>(n.push(e),!1),FragmentDefinition:e=>(t.push(e),!1),Document:{leave(){const i=Object.create(null);for(const t of n)for(const n of e.getRecursivelyReferencedFragments(t))i[n.name.value]=!0;for(const n of t){const t=n.name.value;!0!==i[t]&&e.reportError(new r.GraphQLError(`Fragment "${t}" is never used.`,{nodes:n}))}}}}};var r=t(5822)},8769:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoUnusedVariablesRule=function(e){let n=[];return{OperationDefinition:{enter(){n=[]},leave(t){const i=Object.create(null),o=e.getRecursiveVariableUsages(t);for(const{node:e}of o)i[e.name.value]=!0;for(const o of n){const n=o.variable.name.value;!0!==i[n]&&e.reportError(new r.GraphQLError(t.name?`Variable "$${n}" is never used in operation "${t.name.value}".`:`Variable "$${n}" is never used.`,{nodes:o}))}}},VariableDefinition(e){n.push(e)}}};var r=t(5822)},4331:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.OverlappingFieldsCanBeMergedRule=function(e){const n=new g,t=new Map;return{SelectionSet(r){const o=function(e,n,t,r,i){const o=[],[a,s]=T(e,n,r,i);if(function(e,n,t,r,i){for(const[o,a]of Object.entries(i))if(a.length>1)for(let i=0;i`subfields "${e}" conflict because `+p(n))).join(" and "):e}function l(e,n,t,r,i,o,a){const s=e.getFragment(a);if(!s)return;const[u,c]=b(e,t,s);if(o!==u){f(e,n,t,r,i,o,u);for(const s of c)r.has(s,a,i)||(r.add(s,a,i),l(e,n,t,r,i,o,s))}}function d(e,n,t,r,i,o,a){if(o===a)return;if(r.has(o,a,i))return;r.add(o,a,i);const s=e.getFragment(o),u=e.getFragment(a);if(!s||!u)return;const[c,p]=b(e,t,s),[l,y]=b(e,t,u);f(e,n,t,r,i,c,l);for(const a of y)d(e,n,t,r,i,o,a);for(const o of p)d(e,n,t,r,i,o,a)}function f(e,n,t,r,i,o,a){for(const[s,u]of Object.entries(o)){const o=a[s];if(o)for(const a of u)for(const u of o){const o=y(e,t,r,i,s,a,u);o&&n.push(o)}}}function y(e,n,t,i,o,a,u){const[c,p,y]=a,[b,v,g]=u,E=i||c!==b&&(0,s.isObjectType)(c)&&(0,s.isObjectType)(b);if(!E){const e=p.name.value,n=v.name.value;if(e!==n)return[[o,`"${e}" and "${n}" are different fields`],[p],[v]];if(!function(e,n){const t=e.arguments,r=n.arguments;if(void 0===t||0===t.length)return void 0===r||0===r.length;if(void 0===r||0===r.length)return!1;if(t.length!==r.length)return!1;const i=new Map(r.map((({name:e,value:n})=>[e.value,n])));return t.every((e=>{const n=e.value,t=i.get(e.name.value);return void 0!==t&&m(n)===m(t)}))}(p,v))return[[o,"they have differing arguments"],[p],[v]]}const N=null==y?void 0:y.type,O=null==g?void 0:g.type;if(N&&O&&h(N,O))return[[o,`they return conflicting types "${(0,r.inspect)(N)}" and "${(0,r.inspect)(O)}"`],[p],[v]];const I=p.selectionSet,_=v.selectionSet;if(I&&_){const r=function(e,n,t,r,i,o,a,s){const u=[],[c,p]=T(e,n,i,o),[y,m]=T(e,n,a,s);f(e,u,n,t,r,c,y);for(const i of m)l(e,u,n,t,r,c,i);for(const i of p)l(e,u,n,t,r,y,i);for(const i of p)for(const o of m)d(e,u,n,t,r,i,o);return u}(e,n,t,E,(0,s.getNamedType)(N),I,(0,s.getNamedType)(O),_);return function(e,n,t,r){if(e.length>0)return[[n,e.map((([e])=>e))],[t,...e.map((([,e])=>e)).flat()],[r,...e.map((([,,e])=>e)).flat()]]}(r,o,p,v)}}function m(e){return(0,a.print)((0,u.sortValueNode)(e))}function h(e,n){return(0,s.isListType)(e)?!(0,s.isListType)(n)||h(e.ofType,n.ofType):!!(0,s.isListType)(n)||((0,s.isNonNullType)(e)?!(0,s.isNonNullType)(n)||h(e.ofType,n.ofType):!!(0,s.isNonNullType)(n)||!(!(0,s.isLeafType)(e)&&!(0,s.isLeafType)(n))&&e!==n)}function T(e,n,t,r){const i=n.get(r);if(i)return i;const o=Object.create(null),a=Object.create(null);v(e,t,r,o,a);const s=[o,Object.keys(a)];return n.set(r,s),s}function b(e,n,t){const r=n.get(t.selectionSet);if(r)return r;const i=(0,c.typeFromAST)(e.getSchema(),t.typeCondition);return T(e,n,i,t.selectionSet)}function v(e,n,t,r,i){for(const a of t.selections)switch(a.kind){case o.Kind.FIELD:{const e=a.name.value;let t;((0,s.isObjectType)(n)||(0,s.isInterfaceType)(n))&&(t=n.getFields()[e]);const i=a.alias?a.alias.value:e;r[i]||(r[i]=[]),r[i].push([n,a,t]);break}case o.Kind.FRAGMENT_SPREAD:i[a.name.value]=!0;break;case o.Kind.INLINE_FRAGMENT:{const t=a.typeCondition,o=t?(0,c.typeFromAST)(e.getSchema(),t):n;v(e,o,a.selectionSet,r,i);break}}}class g{constructor(){this._data=new Map}has(e,n,t){var r;const[i,o]=ee.name.value)));for(const t of i.args)if(!a.has(t.name)&&(0,u.isRequiredArgument)(t)){const a=(0,r.inspect)(t.type);e.reportError(new o.GraphQLError(`Field "${i.name}" argument "${t.name}" of type "${a}" is required, but it was not provided.`,{nodes:n}))}}}}};var r=t(8002),i=t(2863),o=t(5822),a=t(2828),s=t(3033),u=t(5003),c=t(7197);function p(e){var n;const t=Object.create(null),p=e.getSchema(),d=null!==(n=null==p?void 0:p.getDirectives())&&void 0!==n?n:c.specifiedDirectives;for(const e of d)t[e.name]=(0,i.keyMap)(e.args.filter(u.isRequiredArgument),(e=>e.name));const f=e.getDocument().definitions;for(const e of f)if(e.kind===a.Kind.DIRECTIVE_DEFINITION){var y;const n=null!==(y=e.arguments)&&void 0!==y?y:[];t[e.name.value]=(0,i.keyMap)(n.filter(l),(e=>e.name.value))}return{Directive:{leave(n){const i=n.name.value,a=t[i];if(a){var c;const t=null!==(c=n.arguments)&&void 0!==c?c:[],p=new Set(t.map((e=>e.name.value)));for(const[t,c]of Object.entries(a))if(!p.has(t)){const a=(0,u.isType)(c.type)?(0,r.inspect)(c.type):(0,s.print)(c.type);e.reportError(new o.GraphQLError(`Directive "@${i}" argument "${t}" of type "${a}" is required, but it was not provided.`,{nodes:n}))}}}}}}function l(e){return e.type.kind===a.Kind.NON_NULL_TYPE&&null==e.defaultValue}},7168:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.ScalarLeafsRule=function(e){return{Field(n){const t=e.getType(),a=n.selectionSet;if(t)if((0,o.isLeafType)((0,o.getNamedType)(t))){if(a){const o=n.name.value,s=(0,r.inspect)(t);e.reportError(new i.GraphQLError(`Field "${o}" must not have a selection since type "${s}" has no subfields.`,{nodes:a}))}}else if(!a){const o=n.name.value,a=(0,r.inspect)(t);e.reportError(new i.GraphQLError(`Field "${o}" of type "${a}" must have a selection of subfields. Did you mean "${o} { ... }"?`,{nodes:n}))}}}};var r=t(8002),i=t(5822),o=t(5003)},4666:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.SingleFieldSubscriptionsRule=function(e){return{OperationDefinition(n){if("subscription"===n.operation){const t=e.getSchema(),a=t.getSubscriptionType();if(a){const s=n.name?n.name.value:null,u=Object.create(null),c=e.getDocument(),p=Object.create(null);for(const e of c.definitions)e.kind===i.Kind.FRAGMENT_DEFINITION&&(p[e.name.value]=e);const l=(0,o.collectFields)(t,p,u,a,n.selectionSet);if(l.size>1){const n=[...l.values()].slice(1).flat();e.reportError(new r.GraphQLError(null!=s?`Subscription "${s}" must select only one top level field.`:"Anonymous Subscription must select only one top level field.",{nodes:n}))}for(const n of l.values())n[0].name.value.startsWith("__")&&e.reportError(new r.GraphQLError(null!=s?`Subscription "${s}" must not select an introspection top level field.`:"Anonymous Subscription must not select an introspection top level field.",{nodes:n}))}}}}};var r=t(5822),i=t(2828),o=t(8950)},3878:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueArgumentDefinitionNamesRule=function(e){return{DirectiveDefinition(e){var n;const r=null!==(n=e.arguments)&&void 0!==n?n:[];return t(`@${e.name.value}`,r)},InterfaceTypeDefinition:n,InterfaceTypeExtension:n,ObjectTypeDefinition:n,ObjectTypeExtension:n};function n(e){var n;const r=e.name.value,i=null!==(n=e.fields)&&void 0!==n?n:[];for(const e of i){var o;t(`${r}.${e.name.value}`,null!==(o=e.arguments)&&void 0!==o?o:[])}return!1}function t(n,t){const o=(0,r.groupBy)(t,(e=>e.name.value));for(const[t,r]of o)r.length>1&&e.reportError(new i.GraphQLError(`Argument "${n}(${t}:)" can only be defined once.`,{nodes:r.map((e=>e.name))}));return!1}};var r=t(4620),i=t(5822)},4986:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueArgumentNamesRule=function(e){return{Field:n,Directive:n};function n(n){var t;const o=null!==(t=n.arguments)&&void 0!==t?t:[],a=(0,r.groupBy)(o,(e=>e.name.value));for(const[n,t]of a)t.length>1&&e.reportError(new i.GraphQLError(`There can be only one argument named "${n}".`,{nodes:t.map((e=>e.name))}))}};var r=t(4620),i=t(5822)},6753:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueDirectiveNamesRule=function(e){const n=Object.create(null),t=e.getSchema();return{DirectiveDefinition(i){const o=i.name.value;if(null==t||!t.getDirective(o))return n[o]?e.reportError(new r.GraphQLError(`There can be only one directive named "@${o}".`,{nodes:[n[o],i.name]})):n[o]=i.name,!1;e.reportError(new r.GraphQLError(`Directive "@${o}" already exists in the schema. It cannot be redefined.`,{nodes:i.name}))}}};var r=t(5822)},3576:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueDirectivesPerLocationRule=function(e){const n=Object.create(null),t=e.getSchema(),s=t?t.getDirectives():a.specifiedDirectives;for(const e of s)n[e.name]=!e.isRepeatable;const u=e.getDocument().definitions;for(const e of u)e.kind===i.Kind.DIRECTIVE_DEFINITION&&(n[e.name.value]=!e.repeatable);const c=Object.create(null),p=Object.create(null);return{enter(t){if(!("directives"in t)||!t.directives)return;let a;if(t.kind===i.Kind.SCHEMA_DEFINITION||t.kind===i.Kind.SCHEMA_EXTENSION)a=c;else if((0,o.isTypeDefinitionNode)(t)||(0,o.isTypeExtensionNode)(t)){const e=t.name.value;a=p[e],void 0===a&&(p[e]=a=Object.create(null))}else a=Object.create(null);for(const i of t.directives){const t=i.name.value;n[t]&&(a[t]?e.reportError(new r.GraphQLError(`The directive "@${t}" can only be used once at this location.`,{nodes:[a[t],i]})):a[t]=i)}}}};var r=t(5822),i=t(2828),o=t(1352),a=t(7197)},6400:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueEnumValueNamesRule=function(e){const n=e.getSchema(),t=n?n.getTypeMap():Object.create(null),o=Object.create(null);return{EnumTypeDefinition:a,EnumTypeExtension:a};function a(n){var a;const s=n.name.value;o[s]||(o[s]=Object.create(null));const u=null!==(a=n.values)&&void 0!==a?a:[],c=o[s];for(const n of u){const o=n.name.value,a=t[s];(0,i.isEnumType)(a)&&a.getValue(o)?e.reportError(new r.GraphQLError(`Enum value "${s}.${o}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:n.name})):c[o]?e.reportError(new r.GraphQLError(`Enum value "${s}.${o}" can only be defined once.`,{nodes:[c[o],n.name]})):c[o]=n.name}return!1}};var r=t(5822),i=t(5003)},4046:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueFieldDefinitionNamesRule=function(e){const n=e.getSchema(),t=n?n.getTypeMap():Object.create(null),i=Object.create(null);return{InputObjectTypeDefinition:a,InputObjectTypeExtension:a,InterfaceTypeDefinition:a,InterfaceTypeExtension:a,ObjectTypeDefinition:a,ObjectTypeExtension:a};function a(n){var a;const s=n.name.value;i[s]||(i[s]=Object.create(null));const u=null!==(a=n.fields)&&void 0!==a?a:[],c=i[s];for(const n of u){const i=n.name.value;o(t[s],i)?e.reportError(new r.GraphQLError(`Field "${s}.${i}" already exists in the schema. It cannot also be defined in this type extension.`,{nodes:n.name})):c[i]?e.reportError(new r.GraphQLError(`Field "${s}.${i}" can only be defined once.`,{nodes:[c[i],n.name]})):c[i]=n.name}return!1}};var r=t(5822),i=t(5003);function o(e,n){return!!((0,i.isObjectType)(e)||(0,i.isInterfaceType)(e)||(0,i.isInputObjectType)(e))&&null!=e.getFields()[n]}},5883:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueFragmentNamesRule=function(e){const n=Object.create(null);return{OperationDefinition:()=>!1,FragmentDefinition(t){const i=t.name.value;return n[i]?e.reportError(new r.GraphQLError(`There can be only one fragment named "${i}".`,{nodes:[n[i],t.name]})):n[i]=t.name,!1}}};var r=t(5822)},4313:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueInputFieldNamesRule=function(e){const n=[];let t=Object.create(null);return{ObjectValue:{enter(){n.push(t),t=Object.create(null)},leave(){const e=n.pop();e||(0,r.invariant)(!1),t=e}},ObjectField(n){const r=n.name.value;t[r]?e.reportError(new i.GraphQLError(`There can be only one input field named "${r}".`,{nodes:[t[r],n.name]})):t[r]=n.name}}};var r=t(7706),i=t(5822)},2139:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueOperationNamesRule=function(e){const n=Object.create(null);return{OperationDefinition(t){const i=t.name;return i&&(n[i.value]?e.reportError(new r.GraphQLError(`There can be only one operation named "${i.value}".`,{nodes:[n[i.value],i]})):n[i.value]=i),!1},FragmentDefinition:()=>!1}};var r=t(5822)},856:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueOperationTypesRule=function(e){const n=e.getSchema(),t=Object.create(null),i=n?{query:n.getQueryType(),mutation:n.getMutationType(),subscription:n.getSubscriptionType()}:{};return{SchemaDefinition:o,SchemaExtension:o};function o(n){var o;const a=null!==(o=n.operationTypes)&&void 0!==o?o:[];for(const n of a){const o=n.operation,a=t[o];i[o]?e.reportError(new r.GraphQLError(`Type for ${o} already defined in the schema. It cannot be redefined.`,{nodes:n})):a?e.reportError(new r.GraphQLError(`There can be only one ${o} type in schema.`,{nodes:[a,n]})):t[o]=n}return!1}};var r=t(5822)},1686:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueTypeNamesRule=function(e){const n=Object.create(null),t=e.getSchema();return{ScalarTypeDefinition:i,ObjectTypeDefinition:i,InterfaceTypeDefinition:i,UnionTypeDefinition:i,EnumTypeDefinition:i,InputObjectTypeDefinition:i};function i(i){const o=i.name.value;if(null==t||!t.getType(o))return n[o]?e.reportError(new r.GraphQLError(`There can be only one type named "${o}".`,{nodes:[n[o],i.name]})):n[o]=i.name,!1;e.reportError(new r.GraphQLError(`Type "${o}" already exists in the schema. It cannot also be defined in this type definition.`,{nodes:i.name}))}};var r=t(5822)},4243:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.UniqueVariableNamesRule=function(e){return{OperationDefinition(n){var t;const o=null!==(t=n.variableDefinitions)&&void 0!==t?t:[],a=(0,r.groupBy)(o,(e=>e.variable.name.value));for(const[n,t]of a)t.length>1&&e.reportError(new i.GraphQLError(`There can be only one variable named "$${n}".`,{nodes:t.map((e=>e.variable.name))}))}}};var r=t(4620),i=t(5822)},6869:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.ValuesOfCorrectTypeRule=function(e){return{ListValue(n){const t=(0,c.getNullableType)(e.getParentInputType());if(!(0,c.isListType)(t))return p(e,n),!1},ObjectValue(n){const t=(0,c.getNamedType)(e.getInputType());if(!(0,c.isInputObjectType)(t))return p(e,n),!1;const r=(0,o.keyMap)(n.fields,(e=>e.name.value));for(const o of Object.values(t.getFields()))if(!r[o.name]&&(0,c.isRequiredInputField)(o)){const r=(0,i.inspect)(o.type);e.reportError(new s.GraphQLError(`Field "${t.name}.${o.name}" of required type "${r}" was not provided.`,{nodes:n}))}},ObjectField(n){const t=(0,c.getNamedType)(e.getParentInputType());if(!e.getInputType()&&(0,c.isInputObjectType)(t)){const i=(0,a.suggestionList)(n.name.value,Object.keys(t.getFields()));e.reportError(new s.GraphQLError(`Field "${n.name.value}" is not defined by type "${t.name}".`+(0,r.didYouMean)(i),{nodes:n}))}},NullValue(n){const t=e.getInputType();(0,c.isNonNullType)(t)&&e.reportError(new s.GraphQLError(`Expected value of type "${(0,i.inspect)(t)}", found ${(0,u.print)(n)}.`,{nodes:n}))},EnumValue:n=>p(e,n),IntValue:n=>p(e,n),FloatValue:n=>p(e,n),StringValue:n=>p(e,n),BooleanValue:n=>p(e,n)}};var r=t(166),i=t(8002),o=t(2863),a=t(8070),s=t(5822),u=t(3033),c=t(5003);function p(e,n){const t=e.getInputType();if(!t)return;const r=(0,c.getNamedType)(t);if((0,c.isLeafType)(r))try{if(void 0===r.parseLiteral(n,void 0)){const r=(0,i.inspect)(t);e.reportError(new s.GraphQLError(`Expected value of type "${r}", found ${(0,u.print)(n)}.`,{nodes:n}))}}catch(r){const o=(0,i.inspect)(t);r instanceof s.GraphQLError?e.reportError(r):e.reportError(new s.GraphQLError(`Expected value of type "${o}", found ${(0,u.print)(n)}; `+r.message,{nodes:n,originalError:r}))}else{const r=(0,i.inspect)(t);e.reportError(new s.GraphQLError(`Expected value of type "${r}", found ${(0,u.print)(n)}.`,{nodes:n}))}}},4942:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.VariablesAreInputTypesRule=function(e){return{VariableDefinition(n){const t=(0,a.typeFromAST)(e.getSchema(),n.type);if(void 0!==t&&!(0,o.isInputType)(t)){const t=n.variable.name.value,o=(0,i.print)(n.type);e.reportError(new r.GraphQLError(`Variable "$${t}" cannot be non-input type "${o}".`,{nodes:n.type}))}}}};var r=t(5822),i=t(3033),o=t(5003),a=t(5115)},8034:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.VariablesInAllowedPositionRule=function(e){let n=Object.create(null);return{OperationDefinition:{enter(){n=Object.create(null)},leave(t){const o=e.getRecursiveVariableUsages(t);for(const{node:t,type:a,defaultValue:s}of o){const o=t.name.value,p=n[o];if(p&&a){const n=e.getSchema(),l=(0,u.typeFromAST)(n,p.type);if(l&&!c(n,l,p.defaultValue,a,s)){const n=(0,r.inspect)(l),s=(0,r.inspect)(a);e.reportError(new i.GraphQLError(`Variable "$${o}" of type "${n}" used in position expecting type "${s}".`,{nodes:[p,t]}))}}}}},VariableDefinition(e){n[e.variable.name.value]=e}}};var r=t(8002),i=t(5822),o=t(2828),a=t(5003),s=t(298),u=t(5115);function c(e,n,t,r,i){if((0,a.isNonNullType)(r)&&!(0,a.isNonNullType)(n)){const a=void 0!==i;if((null==t||t.kind===o.Kind.NULL)&&!a)return!1;const u=r.ofType;return(0,s.isTypeSubTypeOf)(e,n,u)}return(0,s.isTypeSubTypeOf)(e,n,r)}},2860:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoDeprecatedCustomRule=function(e){return{Field(n){const t=e.getFieldDef(),o=null==t?void 0:t.deprecationReason;if(t&&null!=o){const a=e.getParentType();null!=a||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`The field ${a.name}.${t.name} is deprecated. ${o}`,{nodes:n}))}},Argument(n){const t=e.getArgument(),o=null==t?void 0:t.deprecationReason;if(t&&null!=o){const a=e.getDirective();if(null!=a)e.reportError(new i.GraphQLError(`Directive "@${a.name}" argument "${t.name}" is deprecated. ${o}`,{nodes:n}));else{const a=e.getParentType(),s=e.getFieldDef();null!=a&&null!=s||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`Field "${a.name}.${s.name}" argument "${t.name}" is deprecated. ${o}`,{nodes:n}))}}},ObjectField(n){const t=(0,o.getNamedType)(e.getParentInputType());if((0,o.isInputObjectType)(t)){const r=t.getFields()[n.name.value],o=null==r?void 0:r.deprecationReason;null!=o&&e.reportError(new i.GraphQLError(`The input field ${t.name}.${r.name} is deprecated. ${o}`,{nodes:n}))}},EnumValue(n){const t=e.getEnumValue(),a=null==t?void 0:t.deprecationReason;if(t&&null!=a){const s=(0,o.getNamedType)(e.getInputType());null!=s||(0,r.invariant)(!1),e.reportError(new i.GraphQLError(`The enum value "${s.name}.${t.name}" is deprecated. ${a}`,{nodes:n}))}}}};var r=t(7706),i=t(5822),o=t(5003)},2276:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.NoSchemaIntrospectionCustomRule=function(e){return{Field(n){const t=(0,i.getNamedType)(e.getType());t&&(0,o.isIntrospectionType)(t)&&e.reportError(new r.GraphQLError(`GraphQL introspection has been disabled, but the requested query contained the field "${n.name.value}".`,{nodes:n}))}}};var r=t(5822),i=t(5003),o=t(8155)},4710:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.specifiedSDLRules=n.specifiedRules=void 0;var r=t(5285),i=t(9426),o=t(3558),a=t(9989),s=t(2826),u=t(1843),c=t(5961),p=t(870),l=t(3411),d=t(658),f=t(7459),y=t(7317),m=t(8769),h=t(4331),T=t(5904),b=t(5715),v=t(4312),g=t(7168),E=t(4666),N=t(3878),O=t(4986),I=t(6753),_=t(3576),L=t(6400),S=t(4046),D=t(5883),j=t(4313),A=t(2139),P=t(856),R=t(1686),w=t(4243),k=t(6869),F=t(4942),x=t(8034);const G=Object.freeze([r.ExecutableDefinitionsRule,A.UniqueOperationNamesRule,p.LoneAnonymousOperationRule,E.SingleFieldSubscriptionsRule,c.KnownTypeNamesRule,o.FragmentsOnCompositeTypesRule,F.VariablesAreInputTypesRule,g.ScalarLeafsRule,i.FieldsOnCorrectTypeRule,D.UniqueFragmentNamesRule,u.KnownFragmentNamesRule,y.NoUnusedFragmentsRule,T.PossibleFragmentSpreadsRule,d.NoFragmentCyclesRule,w.UniqueVariableNamesRule,f.NoUndefinedVariablesRule,m.NoUnusedVariablesRule,s.KnownDirectivesRule,_.UniqueDirectivesPerLocationRule,a.KnownArgumentNamesRule,O.UniqueArgumentNamesRule,k.ValuesOfCorrectTypeRule,v.ProvidedRequiredArgumentsRule,x.VariablesInAllowedPositionRule,h.OverlappingFieldsCanBeMergedRule,j.UniqueInputFieldNamesRule]);n.specifiedRules=G;const V=Object.freeze([l.LoneSchemaDefinitionRule,P.UniqueOperationTypesRule,R.UniqueTypeNamesRule,L.UniqueEnumValueNamesRule,S.UniqueFieldDefinitionNamesRule,N.UniqueArgumentDefinitionNamesRule,I.UniqueDirectiveNamesRule,c.KnownTypeNamesRule,s.KnownDirectivesRule,_.UniqueDirectivesPerLocationRule,b.PossibleTypeExtensionsRule,a.KnownArgumentNamesOnDirectivesRule,O.UniqueArgumentNamesRule,j.UniqueInputFieldNamesRule,v.ProvidedRequiredArgumentsOnDirectivesRule]);n.specifiedSDLRules=V},9504:function(e,n,t){Object.defineProperty(n,"__esModule",{value:!0}),n.assertValidSDL=function(e){const n=p(e);if(0!==n.length)throw new Error(n.map((e=>e.message)).join("\n\n"))},n.assertValidSDLExtension=function(e,n){const t=p(e,n);if(0!==t.length)throw new Error(t.map((e=>e.message)).join("\n\n"))},n.validate=function(e,n,t=u.specifiedRules,p,l=new s.TypeInfo(e)){var d;const f=null!==(d=null==p?void 0:p.maxErrors)&&void 0!==d?d:100;n||(0,r.devAssert)(!1,"Must provide document."),(0,a.assertValidSchema)(e);const y=Object.freeze({}),m=[],h=new c.ValidationContext(e,n,l,(e=>{if(m.length>=f)throw m.push(new i.GraphQLError("Too many validation errors, error limit reached. Validation aborted.")),y;m.push(e)})),T=(0,o.visitInParallel)(t.map((e=>e(h))));try{(0,o.visit)(n,(0,s.visitWithTypeInfo)(l,T))}catch(e){if(e!==y)throw e}return m},n.validateSDL=p;var r=t(7242),i=t(5822),o=t(285),a=t(1671),s=t(6226),u=t(4710),c=t(3955);function p(e,n,t=u.specifiedSDLRules){const r=[],i=new c.SDLValidationContext(e,n,(e=>{r.push(e)})),a=t.map((e=>e(i)));return(0,o.visit)(e,(0,o.visitInParallel)(a)),r}},8696:function(e,n){Object.defineProperty(n,"__esModule",{value:!0}),n.versionInfo=n.version=void 0,n.version="16.8.1";const t=Object.freeze({major:16,minor:8,patch:1,preReleaseTag:null});n.versionInfo=t},9307:function(e){e.exports=window.wp.element}},n={};function t(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return e[r](o,o.exports,t),o.exports}t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},t.d=function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t(6428)}(); \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/build/style-app.css b/lib/wp-graphql-1.17.0/build/style-app.css deleted file mode 100644 index fefda03a..00000000 --- a/lib/wp-graphql-1.17.0/build/style-app.css +++ /dev/null @@ -1 +0,0 @@ -#graphiql{display:flex;flex:1}#graphiql .spinner{background:none;visibility:visible}#wp-graphiql-wrapper .doc-explorer-title,#wp-graphiql-wrapper .history-title{overflow-x:visible;padding-top:7px}#wp-graphiql-wrapper .docExplorerWrap,#wp-graphiql-wrapper .historyPaneWrap{background:#fff;box-shadow:0 0 8px rgba(0,0,0,.15);position:relative;z-index:3}#wp-graphiql-wrapper .graphiql-container .doc-explorer-back{overflow:hidden} diff --git a/lib/wp-graphql-1.17.0/cli/wp-cli.php b/lib/wp-graphql-1.17.0/cli/wp-cli.php deleted file mode 100644 index e2b9ade4..00000000 --- a/lib/wp-graphql-1.17.0/cli/wp-cli.php +++ /dev/null @@ -1,64 +0,0 @@ -init(); - $settings->register_settings(); - - // Get all the registered settings fields - $fields = $settings->settings_api->get_settings_fields(); - - // Loop over the registered settings fields and delete the options - if ( ! empty( $fields ) && is_array( $fields ) ) { - foreach ( $fields as $group => $fields ) { - delete_option( $group ); - } - } - - do_action( 'graphql_delete_data' ); -} diff --git a/lib/wp-graphql-1.17.0/phpcs.xml.dist b/lib/wp-graphql-1.17.0/phpcs.xml.dist deleted file mode 100644 index fb4632c7..00000000 --- a/lib/wp-graphql-1.17.0/phpcs.xml.dist +++ /dev/null @@ -1,165 +0,0 @@ - - - Coding standards for the WPGraphQL plugin - - - ./access-functions.php - ./activation.php - ./deactivation.php - ./wp-graphql.php - ./src - ./phpstan/* - */**/tests/ - */node_modules/* - */vendor/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/lib/wp-graphql-1.17.0/readme.txt b/lib/wp-graphql-1.17.0/readme.txt deleted file mode 100644 index b79fd009..00000000 --- a/lib/wp-graphql-1.17.0/readme.txt +++ /dev/null @@ -1,1557 +0,0 @@ -=== WPGraphQL === -Contributors: jasonbahl, tylerbarnes1, ryankanner, hughdevore, chopinbach, kidunot89 -Tags: GraphQL, JSON, API, Gatsby, Faust, Headless, Decoupled, Svelte, React, Nextjs, Vue, Apollo, REST, JSON, HTTP, Remote, Query Language -Requires at least: 5.0 -Tested up to: 6.2 -Requires PHP: 7.1 -Stable tag: 1.17.0 -License: GPL-3 -License URI: https://www.gnu.org/licenses/gpl-3.0.html - -=== Description === - -WPGraphQL is a free, open-source WordPress plugin that provides an extendable GraphQL schema and API for any WordPress site. - -Below are some links to help you get started with WPGraphQL - -- WPGraphQL.com -- Quick Start Guide -- Intro to GraphQL -- Intro to WordPress -- Join the WPGraphQL community on Slack - -= Build rich JavaScript applications with WordPress and GraphQL = - -WPGraphQL allows you to separate your CMS from your presentation layer. Content creators can use the CMS they know, while developers can use the frameworks and tools they love. - -WPGraphQL works great with: - -- [Gatsby](https://gatsbyjs.com) -- [Apollo Client](https://www.apollographql.com/docs/react/) -- [NextJS](https://nextjs.org/) -- ...and more - -= Query what you need. Get exactly that. = - -With GraphQL, the client makes declarative queries, asking for the exact data needed, and in exactly what was asked for is given in response, nothing more. This allows the client have control over their application, and allows the GraphQL server to perform more efficiently by only fetching the resources requested. - -= Fetch many resources in a single request. = - -GraphQL queries allow access to multiple root resources, and also smoothly follow references between connected resources. While typical a REST API would require round-trip requests to many endpoints, GraphQL APIs can get all the data your app needs in a single request. Apps using GraphQL can be quick even on slow mobile network connections. - -= Powerful Debugging Tools = - -WPGraphQL ships with GraphiQL in your WordPress dashboard, allowing you to browse your site's GraphQL Schema and test Queries and Mutations. - -= Upgrading = - -It is recommended that anytime you want to update WPGraphQL that you get familiar with what's changed in the release. - -WPGraphQL publishes [release notes on Github](https://github.com/wp-graphql/wp-graphql/releases). - -WPGraphQL has been following Semver practices for a few years. We will continue to follow Semver and let version numbers communicate meaning. The summary of Semver versioning is as follows: - -- *MAJOR* version when you make incompatible API changes, -- *MINOR* version when you add functionality in a backwards compatible manner, and -- *PATCH* version when you make backwards compatible bug fixes. - -You can read more about the details of Semver at semver.org - -== Frequently Asked Questions == - -= Can I use WPGraphQL with xx JavaScript Framework? = - -WPGraphQL turns your WordPress site into a GraphQL API. Any client that can make http requests to the GraphQL endpoint can be used to interact with WPGraphQL. - -= Where do I get WPGraphQL Swag? = - -WPGraphQL Swag is available on the Gatsby Swag store. - -= What's the relationship between Gatsby, WP Engine, and WPGraphQL? = - -[WP Engine](https://wpengine.com/) is the employer of Jason Bahl, the creator and maintainer of WPGraphQL. He was previously employed by [Gatsby](https://gatsbyjs.com). - -You can read more about this [here](https://www.wpgraphql.com/2021/02/07/whats-next-for-wpgraphql/). - -Gatsby and WP Engine both believe that a strong GraphQL API for WordPress is a benefit for the web. Neither Gatsby or WP Engine are required to be used with WPGraphQL, however it's important to acknowledge and understand what's possible because of their investments into WPGraphQL and the future of headless WordPress! - -== Privacy Policy == - -WPGraphQL uses [Appsero](https://appsero.com) SDK to collect some telemetry data upon user's confirmation. This helps us to troubleshoot problems faster & make product improvements. - -Appsero SDK **does not gather any data by default.** The SDK only starts gathering basic telemetry data **when a user allows it via the admin notice**. We collect the data to ensure a great user experience for all our users. - -Integrating Appsero SDK **DOES NOT IMMEDIATELY** start gathering data, **without confirmation from users in any case.** - -Learn more about how [Appsero collects and uses this data](https://appsero.com/privacy-policy/). - -== Upgrade Notice == - -= 1.16.0 = - -**WPGraphQL Smart Cache** -For WPGraphQL Smart Cache users, you should update WPGraphQL Smart Cache to v1.2.0 when updating -WPGraphQL to v1.16.0 to ensure caches continue to purge as expected. - -**Cursor Pagination Updates** -This version fixes some behaviors of Cursor Pagination which _may_ lead to behavior changes in your application. - -As with any release, we recommend you test in staging environments. For this release, specifically any -queries you have using pagination arguments (`first`, `last`, `after`, `before`). - -= 1.14.6 = - -This release includes a security patch. It's recommended to update as soon as possible. - -If you're unable to update to the latest version, we have a snippet you can add to your site. - -You can read more about it here: https://github.com/wp-graphql/wp-graphql/security/advisories/GHSA-cfh4-7wq9-6pgg - -= 1.13.0 = - -The `ContentRevisionUnion` Union has been removed, and the `RootQuery.revisions` and `User.revisions` connections that used to resolve to this Type now resolve to the `ContentNode` Interface type. - -This is _technically_ a Schema Breaking change, however the behavior for most users querying these fields should remain the same. - -For example, this query worked before, and still works now: - -```graphql -{ - viewer { - revisions { - nodes { - __typename - ... on Post { - id - uri - isRevision - } - ... on Page { - id - uri - isRevision - } - } - } - } - revisions { - nodes { - __typename - ... on Post { - id - uri - isRevision - } - ... on Page { - id - uri - isRevision - } - } - } -} -``` - -If you were using a fragment to reference: `...on UserToContentRevisionUnionConnection` or `...on RootQueryToContentRevisionUnionConnection` you would need to update those references to `...on UserToRevisionsConnection` and `...on RootQueryToRevisionsConnection` respectively. - -= 1.12.0 = - -This release removes the `ContentNode` and `DatabaseIdentifier` interfaces from the `NodeWithFeaturedImage` Interface. - -This is considered a breaking change for client applications using a `...on NodeWithFeaturedImage` fragment that reference fields applied by those interfaces. If you have client applications doing this (or are unsure if you do) you can use the following filter to bring back the previous behavior: - -```php -add_filter( 'graphql_wp_interface_type_config', function( $config ) { - if ( $config['name'] === 'NodeWithFeaturedImage' ) { - $config['interfaces'][] = 'ContentNode'; - $config['interfaces'][] = 'DatabaseIdentifier'; - } - return $config; -}, 10, 1 ); -``` - -= 1.10.0 = - -PR ([#2490](https://github.com/wp-graphql/wp-graphql/pull/2490)) fixes a bug that some users were -using as a feature. - -When a page is marked as the "Posts Page" WordPress does not resolve that page by URI, and this -bugfix no longer will resolve that page by URI. - -You can [read more](https://github.com/wp-graphql/wp-graphql/issues/2486#issuecomment-1232169375) -about why this change was made and find a snippet of code that will bring the old functionality back -if you've built features around it. - - -= 1.9.0 = - -There are 2 changes that **might** require action when updating to 1.9.0. - - -1. ([#2464](https://github.com/wp-graphql/wp-graphql/pull/2464)) - -When querying for a `nodeByUri`, if your site has the "page_for_posts" setting configured, the behavior of the `nodeByUri` query for that uri might be different for you. - -Previously a bug caused this query to return a "Page" type, when it should have returned a "ContentType" Type. - -The bug fix might change your application if you were using the bug as a feature. - - - -2. ([#2457](https://github.com/wp-graphql/wp-graphql/pull/2457)) - -There were a lot of bug fixes related to connections to ensure they behave as intended. If you were querying lists of data, in some cases the data might be returned in a different order than it was before. - -For example, using the "last" input on a Comment or User query should still return the same nodes, but in a different order than before. - -This might cause behavior you don't want in your application because you had coded around the bug. This change was needed to support proper backward pagination. - - - -= 1.6.7 = - -There's been a bugfix in the Post Model layer which _might_ break existing behaviors. - -WordPress Post Type registry allows for a post_type to be registered as `public` (`true` or `false`) -and `publicly_queryable` (`true` or `false`). - -WPGraphQL's Model Layer was allowing published content of any post_type to be exposed publicly. This -change better respects the `public` and `publicly_queryable` properties of post types better. - -Now, if a post_type is `public=>true`, published content of that post_type can be queried by public -WPGraphQL requests. - -If a `post_type` is set to `public=>false`, then we fallback to the `publicly_queryable` property. -If a post_type is set to `publicly_queryable => true`, then published content of the Post Type can -be queried in WPGraphQL by public users. - -If both `public=>false` and `publicly_queryable` is `false` or not defined, then the content of the -post_type will only be accessible via authenticated queries by users with proper capabilities to -access the post_type. - -**Possible Action:** You might need to adjust your post_type registration to better reflect your intent. - -- `public=>true`: The entries in the post_type will be public in WPGraphQL and will have a public -URI in WordPress. -- `public=>false, publicly_queryable=>true`: The entries in the post_type will be public in WPGraphQL, -but will not have individually respected URI from WordPress, and can not be queried by URI in WPGraphQL. -- `public=>false,publicly_queryable=>false`: The entries in the post_type will only be accessible in -WPGraphQL by authenticated requests for users with proper capabilities to interact with the post_type. - -= 1.5.0 = - -The `MenuItem.path` field was changed from `non-null` to nullable and some clients may need to make adjustments to support this. - -= 1.4.0 = - -The `uri` field was non-null on some Types in the Schema but has been changed to be nullable on all types that have it. This might require clients to update code to expect possible null values. - -= 1.2.0 = - -Composer dependencies are no longer versioned in Github. Recommended install source is WordPress.org or using Composer to get the code from Packagist.org or WPackagist.org. - -== Changelog == - -= 1.17.0 = - -**New Features** - -- [#2940](https://github.com/wp-graphql/wp-graphql/pull/2940): feat: add graphql_format_name() access method -- [#2256](https://github.com/wp-graphql/wp-graphql/pull/2256): feat: add connectedTerms connection to Taxonomy Object - -**Chores / Bugfixes** - -- [#2808](https://github.com/wp-graphql/wp-graphql/pull/2808): fix: fallback to template filename if sanitized name is empty -- [#2968](https://github.com/wp-graphql/wp-graphql/pull/2968): fix: Add graphql_debug warning when using `hasPublishedPosts: ATTACHMENT` -- [#2968](https://github.com/wp-graphql/wp-graphql/pull/2968): fix: improve DX for updateComment mutation -- [#2962](https://github.com/wp-graphql/wp-graphql/pull/2962): fix: respect hasPublishedPosts where arg on unauthenticated users queries -- [#2967](https://github.com/wp-graphql/wp-graphql/pull/2967): fix: use all roles for UserRoleEnum instead of the filtered editible_roles -- [#2940](https://github.com/wp-graphql/wp-graphql/pull/2940): fix: Decode slug so it works with other languages -- [#2959](https://github.com/wp-graphql/wp-graphql/pull/2959): chore: remove @phpstan-ignore annotations -- [#2945](https://github.com/wp-graphql/wp-graphql/pull/2945): fix: rename fields registered by connections when using `rename_graphql_field()` -- [#2949](https://github.com/wp-graphql/wp-graphql/pull/2949): fix: correctly get default user role for settings selectbox -- [#2955](https://github.com/wp-graphql/wp-graphql/pull/2955): test: back-fill register_graphql_input|union_type() tests -- [#2953](https://github.com/wp-graphql/wp-graphql/pull/2953): fix: term uri, early return. (Follow up to [#2341](https://github.com/wp-graphql/wp-graphql/pull/2341)) -- [#2956](https://github.com/wp-graphql/wp-graphql/pull/2956): chore(deps-dev): bump postcss from 8.4.12 to 8.4.31 -- [#2954](https://github.com/wp-graphql/wp-graphql/pull/2954): fix: regression to autoloader for bedrock sites. (Follow-up to [#2935](https://github.com/wp-graphql/wp-graphql/pull/2935)) -- [#2950](https://github.com/wp-graphql/wp-graphql/pull/2950): fix: rename typo in component name - AuthSwitchProvider -- [#2948](https://github.com/wp-graphql/wp-graphql/pull/2948): chore: fix spelling mistakes (non-logical) -- [#2944](https://github.com/wp-graphql/wp-graphql/pull/2944): fix: skip setting if no $setting['group'] -- [#2934](https://github.com/wp-graphql/wp-graphql/pull/2934): chore(deps-dev): bump composer/composer from 2.2.21 to 2.2.22 -- [#2936](https://github.com/wp-graphql/wp-graphql/pull/2936): chore(deps): bump graphql from 16.5.0 to 16.8.1 -- [#2341](https://github.com/wp-graphql/wp-graphql/pull/2341): fix: wrong term URI on sub-sites of multisite subdomain installs -- [#2935](https://github.com/wp-graphql/wp-graphql/pull/2935): fix: admin notice wasn't displaying if composer dependencies were missing -- [#2933](https://github.com/wp-graphql/wp-graphql/pull/2933): chore: remove unused parameters from resolver callbacks -- [#2932](https://github.com/wp-graphql/wp-graphql/pull/2932): chore: cleanup PHPCS inline annotations -- [#2934](https://github.com/wp-graphql/wp-graphql/pull/2634): chore: use .php extension for stub files -- [#2924](https://github.com/wp-graphql/wp-graphql/pull/2924): chore: upgrade WPCS to v3.0 -- [#2921](https://github.com/wp-graphql/wp-graphql/pull/2921): fix: zip artifact in GitHub not in sub folder - -= 1.16.0 = - -**New Features** - -- [#2918](https://github.com/wp-graphql/wp-graphql/pull/2918): feat: Use graphql endpoint without scheme in url header. -- [#2882](https://github.com/wp-graphql/wp-graphql/pull/2882): feat: Config and Cursor Classes refactor - - -= 1.15.0 = - -**New Features** - -- [#2908](https://github.com/wp-graphql/wp-graphql/pull/2908): feat: Skip param added to Utils::map_input(). Thanks @kidunot89! - -**Chores / Bugfixes** - -- [#2907](https://github.com/wp-graphql/wp-graphql/pull/2907): ci: Use WP 6.3 image, not the beta one -- [#2902](https://github.com/wp-graphql/wp-graphql/pull/2902): chore: handle unused variables (phpcs). Thanks @justlevine! -- [#2901](https://github.com/wp-graphql/wp-graphql/pull/2901): chore: remove useless ternaries (phpcs). Thanks @justlevine! -- [#2898](https://github.com/wp-graphql/wp-graphql/pull/2898): chore: restore excluded PHPCS sniffs. Thanks @justlevine! -- [#2899](https://github.com/wp-graphql/wp-graphql/pull/2899): chore: Configure PHPCS blank line check and autofix. Thanks @justlevine! -- [#2900](https://github.com/wp-graphql/wp-graphql/pull/2900): chore: implement PHPCS sniffs from Slevomat Coding Standards. Thanks @justlevine! -- [#2897](https://github.com/wp-graphql/wp-graphql/pull/2897): fix: default excerptRendered to empty string. Thanks @izzygld! -- [#2890](https://github.com/wp-graphql/wp-graphql/pull/2890): fix: Use hostname for graphql cache header url for varnish -- [#2892](https://github.com/wp-graphql/wp-graphql/pull/2889): chore: GitHub template tweaks. Thanks @justlevine! -- [#2889](https://github.com/wp-graphql/wp-graphql/pull/2889): ci: update tests to test against WordPress 6.3, simplify the matrix -- [#2891](https://github.com/wp-graphql/wp-graphql/pull/2891): chore: bump graphql-php to 14.11.10 and update Composer dev-deps. Thanks @justlevine! - - -= 1.14.10 = - -**Chores / Bugfixes** - -- [#2874](https://github.com/wp-graphql/wp-graphql/pull/2874): fix: improve PostObjectCursor support for meta queries. Thanks @kidunot89! -- [#2880](https://github.com/wp-graphql/wp-graphql/pull/2880): fix: increase clarity of the description of "asPreview" argument - -= 1.14.9 = - -**Chores / Bugfixes** - -- [#2865](https://github.com/wp-graphql/wp-graphql/pull/2865): fix: user roles should return empty if user doesn't have roles. Thanks @j3ang! -- [#2870](https://github.com/wp-graphql/wp-graphql/pull/2870): fix: Type Loader returns null when "graphql_single_name" value has underscores [regression] -- [#2871](https://github.com/wp-graphql/wp-graphql/pull/2871): fix: update tests, follow-up to [#2865](https://github.com/wp-graphql/wp-graphql/pull/2865) - - -= 1.14.8 = - -**Chores / Bugfixes** - -- [#2855](https://github.com/wp-graphql/wp-graphql/pull/2855): perf: enforce static closures when possible (PHPCS). Thanks @justlevine! -- [#2857](https://github.com/wp-graphql/wp-graphql/pull/2857): fix: Prevent truncation of query name inside the GraphiQL Query composer explorer tab. Thanks @LarsEjaas! -- [#2856](https://github.com/wp-graphql/wp-graphql/pull/2856): chore: add missing translator comments. Thanks @justlevine! -- [#2862](https://github.com/wp-graphql/wp-graphql/pull/2862): chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 -- [#2861](https://github.com/wp-graphql/wp-graphql/pull/2861): fix: output `list:$type` keys for Root fields that return a list of nodes - - -= 1.14.7 = - -**Chores / Bugfixes** - -- [#2853](https://github.com/wp-graphql/wp-graphql/pull/2853): fix: internal server error when query max depth setting is left empty -- [#2851](https://github.com/wp-graphql/wp-graphql/pull/2851): fix: querying posts by slug or uri with non-ascii characters -- [#2849](https://github.com/wp-graphql/wp-graphql/pull/2849): ci: Indent WP 6.2 in workflow file. Fixes Docker deploys. Thanks @markkelnar! -- [#2846](https://github.com/wp-graphql/wp-graphql/pull/2846): chore(deps): bump tough-cookie from 4.0.0 to 4.1.3 - - -= 1.14.6 = - -**Chores / Bugfixes** - -- [#2841](https://github.com/wp-graphql/wp-graphql/pull/2841): ci: support STEP_DEBUG in Code Quality workflow. Thanks @justlevine! -- [#2840](https://github.com/wp-graphql/wp-graphql/pull/2840): fix: update createMediaItem mutation to have better validation of input. -- [#2838](https://github.com/wp-graphql/wp-graphql/pull/2838): chore: update security.md - - -= 1.14.5 = - -**Chores / Bugfixes** - -- [#2834](https://github.com/wp-graphql/wp-graphql/pull/2834): fix: improve how the Query Analyzer tracks list types, only tracking lists from the RootType and not nested lists. -- [#2828](https://github.com/wp-graphql/wp-graphql/pull/2828): chore: update composer dev-deps to latest. Thanks @justlevine! -- [#2835](https://github.com/wp-graphql/wp-graphql/pull/2835): ci: update docker deploy workflow to use latest docker actions. -- [#2836](https://github.com/wp-graphql/wp-graphql/pull/2836): ci: update schema upload workflow to pin mariadb to 10.8.2 - - -= 1.14.4 = - -**New Features** - -- [#2826](https://github.com/wp-graphql/wp-graphql/pull/2826): feat: pass connection config to connection field - -**Chores / Bugfixes** - -- [#2818](https://github.com/wp-graphql/wp-graphql/pull/2818): chore: update webonyx/graphql-php to v14.11.9. Thanks @justlevine! -- [#2813](https://github.com/wp-graphql/wp-graphql/pull/2813): fix: replace double negation with true. Thanks @cesarkohl! - - -= 1.14.3 = - -**Chores / Bugfixes** - -- [#2801](https://github.com/wp-graphql/wp-graphql/pull/2801): fix: conflict between custom post type and media slugs -- [#2799](https://github.com/wp-graphql/wp-graphql/pull/2794): fix: querying posts by slug fails when custom permalinks are set -- [#2794](https://github.com/wp-graphql/wp-graphql/pull/2794): chore(deps): bump guzzlehttp/psr7 from 1.9.0 to 1.9.1 - - -= 1.14.2 = - -**Chores / Bugfixes** - -- [#2792](https://github.com/wp-graphql/wp-graphql/pull/2792): fix: uri field is null when querying the page for posts uri - -= 1.14.1 = - -**New Features** - -- [#2763](https://github.com/wp-graphql/wp-graphql/pull/2763): feat: add `shouldShowAdminToolbar` field to the User type, resolving from the "show_admin_bar_front" meta value. Thanks @blakewilson! - -**Chores / Bugfixes** - -- [#2758](https://github.com/wp-graphql/wp-graphql/pull/2758): fix: Allow post types and taxonomies to be registered without "graphql_plural_name". -- [#2762](https://github.com/wp-graphql/wp-graphql/pull/2762): Bump webpack version. -- [#2770](https://github.com/wp-graphql/wp-graphql/pull/2770): fix: wrong order in term/post ancestor queries. Thanks @creative-andrew! -- [#2775](https://github.com/wp-graphql/wp-graphql/pull/2775): fix: properly resolve when querying terms filtered by multiple taxonomies. Thanks @thecodeassassin! -- [#2776](https://github.com/wp-graphql/wp-graphql/pull/2776): chore: remove internal usage of deprecated functions. Thanks @justlevine! -- [#2777](https://github.com/wp-graphql/wp-graphql/pull/2777): chore: update composer dev-deps (not PHPStan). Thanks @justlevine! -- [#2778](https://github.com/wp-graphql/wp-graphql/pull/2778): fix: Update PHPStan and fix smells. Thanks @justlevine! -- [#2779](https://github.com/wp-graphql/wp-graphql/pull/2779): ci: test against WordPress 6.2. Thanks @justlevine! -- [#2781](https://github.com/wp-graphql/wp-graphql/pull/2781): chore: call _doing_it_wrong() when using deprecated PostObjectUnion and TermObjectUnion. Thanks @justlevine! -- [#2782](https://github.com/wp-graphql/wp-graphql/pull/2782): ci: fix deprecation warnings in Github workflows. Thanks @justlevine! -- [#2786](https://github.com/wp-graphql/wp-graphql/pull/2786): fix: early return for HTTP OPTIONS requests. - -= 1.14.0 = - -**New Features** - -- [#2745](https://github.com/wp-graphql/wp-graphql/pull/2745): feat: Allow fields, connections and mutations to optionally be registered with undersores in the field name. -- [#2651](https://github.com/wp-graphql/wp-graphql/pull/2651): feat: Add `deregister_graphql_mutation()` and `graphql_excluded_mutations` filter. Thanks @justlevine! -- [#2652](https://github.com/wp-graphql/wp-graphql/pull/2652): feat: Add `deregister_graphql_connection` and `graphql_excluded_connections` filter. Thanks @justlevine! -- [#2680](https://github.com/wp-graphql/wp-graphql/pull/2680): feat: Refactor the NodeResolver::resolve_uri to use WP_Query. Thanks @justlevine! -- [#2643](https://github.com/wp-graphql/wp-graphql/pull/2643): feat: Add post_lock check on edit/delete mutation. Thanks @markkelnar! -- [#2649](https://github.com/wp-graphql/wp-graphql/pull/2649): feat: Add `pageInfo` field to the Connection type. - -**Chores / Bugfixes** - -- [#2752](https://github.com/wp-graphql/wp-graphql/pull/2752): fix: handle 404s in NodeResolver.php. Thanks @justlevine! -- [#2735](https://github.com/wp-graphql/wp-graphql/pull/2735): fix: Explicitly check for DEBUG enabled value for tests. Thanks @markkelnar! -- [#2659](https://github.com/wp-graphql/wp-graphql/pull/2659): test: Add tests for nodeByUri. Thanks @justlevine! -- [#2724](https://github.com/wp-graphql/wp-graphql/pull/2724): test: Add test for graphql:Query key in headers. Thanks @markkelnar! -- [#2718](https://github.com/wp-graphql/wp-graphql/pull/2718): fix: deprecation notice. Thanks @decodekult! -- [#2705](https://github.com/wp-graphql/wp-graphql/pull/2705): chore: Use fully qualified classnames in PHPDoc annotations. Thanks @justlevine! -- [#2706](https://github.com/wp-graphql/wp-graphql/pull/2706): chore: update PHPStan and fix newly surfaced sniffs. Thanks @justlevine! -- [#2698](https://github.com/wp-graphql/wp-graphql/pull/2698): chore: bump simple-get from 3.15.1 to 3.16.0. Thanks @dependabot! -- [#2701](https://github.com/wp-graphql/wp-graphql/pull/2701): fix: navigation url. Thanks @jiwon-mun! -- [#2704](https://github.com/wp-graphql/wp-graphql/pull/2704): fix: missing apostrophe after escape. Thanks @i-mann! -- [#2709](https://github.com/wp-graphql/wp-graphql/pull/2709): chore: update http-cache-semantics. Thanks @dependabot! -- [#2707](https://github.com/wp-graphql/wp-graphql/pull/2707): ci: update and fix Lint PR workflow. Thanks @justlevine! -- [#2689](https://github.com/wp-graphql/wp-graphql/pull/2689): fix: prevent infinite recursion for interfaces that implement themselves as an interface. -- [#2691](https://github.com/wp-graphql/wp-graphql/pull/2691): fix: prevent non-node types from being output in the query analyzer lis-type -- [#2684](https://github.com/wp-graphql/wp-graphql/pull/2684): chore: remove deprecated use of WPGraphQL\Data\DataSource::resolve_user(). Thanks @renatonascalves -- [#2675](https://github.com/wp-graphql/wp-graphql/pull/2675): ci: keep the develop branch in sync with master. - -= 1.13.10 = - -**Chores / Bugfixes** - -- [#2741](https://github.com/wp-graphql/wp-graphql/pull/2741): Change the plugin name from "WP GraphQL" to "WPGraphQL". Thanks @josephfusco! -- [#2742](https://github.com/wp-graphql/wp-graphql/pull/2742): Update Stalebot rules. Thanks @justlevine! - -= 1.13.9 = - -**Chores / Bugfixes** - -- [#2726](https://github.com/wp-graphql/wp-graphql/pull/2726): fix: invalid schema when custom post types and custom taxonomies are registered with underscores in the "graphql_single_name" / "graphql_plural_name" - -= 1.13.8 = - -**Chores / Bugfixes** - -- [#2712](https://github.com/wp-graphql/wp-graphql/pull/2712): fix: query analyzer outputting unexpected list types - -= 1.13.7 = - -**Chores / Bugfixes** - -- ([#2661](https://github.com/wp-graphql/wp-graphql/pull/2661)): chore(deps): bump simple-git from 3.10.0 to 3.15.1 -- ([#2665](https://github.com/wp-graphql/wp-graphql/pull/2665)): chore(deps): bump decode-uri-component from 0.2.0 to 0.2.2 -- ([#2668](https://github.com/wp-graphql/wp-graphql/pull/2668)): test: Multiple domain tests. Thanks @markkelnar! -- ([#2669](https://github.com/wp-graphql/wp-graphql/pull/2669)): ci: Use last working version of xdebug for php7. Thanks @markkelnar! -- ([#2671](https://github.com/wp-graphql/wp-graphql/pull/2671)): fix: correct regressions to field formatting forcing snake_case and UcFirst fields to be lcfirst/camelCase -- ([#2672](https://github.com/wp-graphql/wp-graphql/pull/2672)): chore: update lint-pr workflow - - -= 1.13.6 = - -**New Feature** - -- ([#2657](https://github.com/wp-graphql/wp-graphql/pull/2657)): feat: pass unfiltered args through to filters in the ConnectionResolver classes. Thanks @kidunot89! -- ([#2655](https://github.com/wp-graphql/wp-graphql/pull/2655)): feat: add `includeDefaultInterfaces` to connection config, allowing connections to be registered without the default `Connection` and `Edge` interfaces applied.. Thanks @justlevine! - -**Chores / Bugfixes** - -- ([#2656](https://github.com/wp-graphql/wp-graphql/pull/2656)): chore: clean up NodeResolver::resolve_uri() logic. Thanks @justlevine! - -= 1.13.5 = - -**Chores / Bugfixes** - -- ([#2647](https://github.com/wp-graphql/wp-graphql/pull/2647)): fix: properly register the node field on ConnectionEdge interfaces -- ([#2645](https://github.com/wp-graphql/wp-graphql/pull/2645)): fix: regression where fields of an object type were forced to be camelCase. This allows snake_case fields again. - - -= 1.13.4 = - -**Chores / Bugfixes** - -- ([#2631](https://github.com/wp-graphql/wp-graphql/pull/2631)): simplify (DRY up) connection interface registration. - -= 1.13.3 = - -- fix: update versions for WordPress.org deploys - -= 1.13.2 = - -**Chores / Bugfixes** - -- ([#2627](https://github.com/wp-graphql/wp-graphql/pull/2627)): fix: Fixes regression where Connection classes were moved to another namespace. This adds deprecated classes back to the old namespace to extend the new classes. Thanks @justlevine! - -= 1.13.1 = - -**Chores / Bugfixes** - -- ([#2625](https://github.com/wp-graphql/wp-graphql/pull/2625)): fix: Fixes a regression to v1.13.0 where mutations registered with an uppercase first letter weren't properly being transformed to a lowercase first letter when the field is added to the Schema. - - -= 1.13.0 = - -**Possible Breaking Change for some users** - -The work to introduce the `Connection` and `Edge` (and other) Interfaces required the `User.revisions` and `RootQuery.revisions` connection to -change from resolving to the `ContentRevisionUnion` type and instead resolve to the `ContentNode` type. - -We believe that it's highly likely that most users will not be impacted by this change. - -Any queries that directly reference the following types: - -- `...on UserToContentRevisionUnionConnection` -- `...on RootQueryToContentRevisionUnionConnection` - -Would need to be updated to reference these types instead: - -- `...on UserToRevisionsConnection` -- `...on RootQueryToRevisionsConnection` - -For example: - -**BEFORE** - -```graphql -{ - viewer { - revisions { - ... on UserToContentRevisionUnionConnection { - nodes { - __typename - ... on Post { - id - uri - isRevision - } - ... on Page { - id - uri - isRevision - } - } - } - } - } - revisions { - ... on RootQueryToContentRevisionUnionConnection { - nodes { - __typename - ... on Post { - id - uri - isRevision - } - ... on Page { - id - uri - isRevision - } - } - } - } -} -``` - -**AFTER** - -```graphql -{ - viewer { - revisions { - ... on UserToRevisionsConnection { - nodes { - __typename - ... on Post { - id - uri - isRevision - } - ... on Page { - id - uri - isRevision - } - } - } - } - } - revisions { - ... on RootQueryToRevisionsConnection { - nodes { - __typename - ... on Post { - id - uri - isRevision - } - ... on Page { - id - uri - isRevision - } - } - } - } -} -``` - -**New Features** - -- ([#2617](https://github.com/wp-graphql/wp-graphql/pull/2617): feat: Introduce Connection, Edge and other common Interfaces. -- ([#2563](https://github.com/wp-graphql/wp-graphql/pull/2563): feat: refactor mutation registration to use new `WPMutationType`. Thanks @justlevine! -- ([#2557](https://github.com/wp-graphql/wp-graphql/pull/2557): feat: add `deregister_graphql_type()` access function and corresponding `graphql_excluded_types` filter. Thanks @justlevine! -- ([#2546](https://github.com/wp-graphql/wp-graphql/pull/2546): feat: Add new `register_graphql_edge_fields()` and `register_graphql_connection_where_args()` access functions. Thanks @justlevine! - -**Chores / Bugfixes** - -- ([#2622](https://github.com/wp-graphql/wp-graphql/pull/2622): fix: deprecate the `previews` field for non-publicly queryable post types, and limit the `Previewable` Interface to publicly queryable post types. -- ([#2614](https://github.com/wp-graphql/wp-graphql/pull/2614): chore(deps): bump loader-utils from 2.0.3 to 2.0.4. -- ([#2540](https://github.com/wp-graphql/wp-graphql/pull/2540): fix: deprecate `Comment.approved` field in favor of `Comment.status: CommentStatusEnum`. Thanks @justlevine! -- ([#2542](https://github.com/wp-graphql/wp-graphql/pull/2542): Move parse_request logic in `NodeResolver::resolve_uri()` to its own method. Thanks @justlevine! - - -= 1.12.2 = - -**New Features** - -- ([#2541](https://github.com/wp-graphql/wp-graphql/pull/2541)): feat: Obfuscate SendPasswordResetEmail response. Thanks @justlevine! - -**Chores / Bugfixes** - -- ([#2544](https://github.com/wp-graphql/wp-graphql/pull/2544)): chore: log and cleanup deprecations. Thanks @justlevine! -- ([#2605](https://github.com/wp-graphql/wp-graphql/pull/2605)): chore: bump tested version of WordPress to 6.1. Thanks @justlevine! -- ([#2606](https://github.com/wp-graphql/wp-graphql/pull/2606)): fix: update resolver in post->author connection to be more strict about the value of the author ID -- ([#2609](https://github.com/wp-graphql/wp-graphql/pull/2609)): chore(deps): bump loader-utils from 2.0.2 to 2.0.3 - - -= 1.12.1 = - -**New Features** - -- ([#2593](https://github.com/wp-graphql/wp-graphql/pull/2593)): feat: use sha256 instead of md5 for hashing queryId -- ([#2581](https://github.com/wp-graphql/wp-graphql/pull/2581)): feat: support deprecation reason when using `register_graphql_connection`. -- ([#2603](https://github.com/wp-graphql/wp-graphql/pull/2603)): feat: add GraphQL operation name to x-graphql-keys headers. - -**Chores / Bugfixes** - -- ([#2472](https://github.com/wp-graphql/wp-graphql/pull/2472)): fix: Return CommentAuthor avatar urls in public requests. Thanks @justlevine! -- ([#2549](https://github.com/wp-graphql/wp-graphql/pull/2549)): chore: fix bug_report.yml description input. Thanks @justlevine! -- ([#2582](https://github.com/wp-graphql/wp-graphql/pull/2582)): fix(noderesolver): adding extra_query_vars in graphql_pre_resolve_uri. Thanks @yanmorinokamca! -- ([#2583](https://github.com/wp-graphql/wp-graphql/pull/2583)): chore: prepare docs for new website. Thanks @moonmeister! -- ([#2590](https://github.com/wp-graphql/wp-graphql/pull/2590)): fix: Add list of node types as X-GraphQL-Keys instead of list of edge types -- ([#2599](https://github.com/wp-graphql/wp-graphql/pull/2599)): fix: only use Appsero `add_plugin_data` if the method exists in the version of the Appsero client that's loaded. -- ([#2600](https://github.com/wp-graphql/wp-graphql/pull/2600)): docs: fix contributing doc render errors. Thanks @moonmeister! - - -= 1.12.0 = - -**Upgrading** - -This release removes the `ContentNode` and `DatabaseIdentifier` interfaces from the `NodeWithFeaturedImage` Interface. - -This is considered a breaking change for client applications using a `...on NodeWithFeaturedImage` fragment that reference fields applied by those interfaces. If you have client applications doing this (or are unsure if you do) you can use the following filter to bring back the previous behavior: - -```php -add_filter( 'graphql_wp_interface_type_config', function( $config ) { - if ( $config['name'] === 'NodeWithFeaturedImage' ) { - $config['interfaces'][] = 'ContentNode'; - $config['interfaces'][] = 'DatabaseIdentifier'; - } - return $config; -}, 10, 1 ); -``` - -**New Features** - -- ([#2399](https://github.com/wp-graphql/wp-graphql/pull/2399)): New Schema Customization options for register_post_type and register_taxonomy. Thanks @justlevine! -- ([#2565](https://github.com/wp-graphql/wp-graphql/pull/2565)): Expose X-GraphQL-URL header. - -**Chores / Bugfixes** - -- ([#2568](https://github.com/wp-graphql/wp-graphql/pull/2568)): Fix typo in docs. Thanks @altearius! -- ([#2569](https://github.com/wp-graphql/wp-graphql/pull/2569)): Update Appsero Client SDK. -- ([#2571](https://github.com/wp-graphql/wp-graphql/pull/2571)): Dependabot bumps. -- ([#2572](https://github.com/wp-graphql/wp-graphql/pull/2572)): Fixes a bug in the GraphiQL Query Composer when working with fields that return Unions. Thanks @chrisherold! -- ([#2556](https://github.com/wp-graphql/wp-graphql/pull/2556)): Updates script that installs test environment to use env vars. Makes spinning up environments more convenient for contributors. Thanks @justlevine! -- ([#2538](https://github.com/wp-graphql/wp-graphql/pull/2538)): Updates phpstan and fixes surfaced issues. Thanks @justlevine! -- ([#2545](https://github.com/wp-graphql/wp-graphql/pull/2545)): Update WPBrowser to v3.1.6 and update test for SendPasswordResetEmail. Thanks @justlevine! - -= 1.11.3 = - -**Chores / Bugfixes** - -- ([#2555](https://github.com/wp-graphql/wp-graphql/pull/2555)): Further changes to `X-GraphQL-Keys` header output. Truncate keys based on a filterable max length. Output the skipped keys in extensions payload for debugging, and add `skipped:$type` keys to the X-GraphQL-Keys header for nodes that are skipped. - - -= 1.11.2 = - -**Chores / Bugfixes** - -- ([#2551](https://github.com/wp-graphql/wp-graphql/pull/2551)): Chunks X-GraphQL-Keys header into multiple headers under a set max header limit length. -- ([#2539](https://github.com/wp-graphql/wp-graphql/pull/2539)): Set IDE direction to prevent breaks in RTL mode. Thanks @justlevine! -- ([#2549](https://github.com/wp-graphql/wp-graphql/pull/2549)): Fix bug_report.yml field to be textarea instead of input. Thanks @justlevine! - -= 1.11.1 = - -**Chores / Bugfixes** - -- ([#2530](https://github.com/wp-graphql/wp-graphql/pull/2530)): Fixes a regression introduced in v1.11.0 where querying menuItems with parentId where arg set to 0 was returning all menuItems instead of just top level items. - - -= 1.11.0 = - -**New Features** - -- ([#2519](https://github.com/wp-graphql/wp-graphql/pull/2519)): Add new "QueryAnalyzer" class which tracks Types, Models and Nodes asked for and returned in a request and adds them to the response headers. -- ([#2519](https://github.com/wp-graphql/wp-graphql/pull/2519)): Add 2nd argument to `graphql()` function that will return the `Request` object instead executing and returning the response. -- ([#2522](https://github.com/wp-graphql/wp-graphql/pull/2522)): Allow global/database IDs in Comment connection where args. Thanks @justlevine! -- ([#2523](https://github.com/wp-graphql/wp-graphql/pull/2523)): Allow global/database IDs in MenuItem connection where args ID Inputs. Thanks @justlevine! -- ([#2524](https://github.com/wp-graphql/wp-graphql/pull/2524)): Allow global/database IDs in Term connection where args ID Inputs. Thanks @justlevine! -- ([#2525](https://github.com/wp-graphql/wp-graphql/pull/2525)): Allow global/database IDs in Post connection where args ID Inputs. Thanks @justlevine! - -**Chores / Bugfixes** - -- ([#2521](https://github.com/wp-graphql/wp-graphql/pull/2521)): Refactor `$args` in AbstractConnectionResolver. Thanks @justlevine! -- ([#2526](https://github.com/wp-graphql/wp-graphql/pull/2526)): Ensure tracked data in QueryAnalyzer is unique. - - -= 1.10.0 = - -**New Features** - -- ([#2503](https://github.com/wp-graphql/wp-graphql/pull/2503)): Enable codeception debugging via Github Actions. Thanks @justlevine! -- ([#2502](https://github.com/wp-graphql/wp-graphql/pull/2502)): Add `idType` arg to `RootQuery.comment`. Thanks @justlevine! -- ([#2505](https://github.com/wp-graphql/wp-graphql/pull/2505)): Return user after `resetUserPassword` mutation. Thanks @justlevine! - -**Chores / Bugfixes** - -- ([#2482](https://github.com/wp-graphql/wp-graphql/pull/2482)): Add PHP Code Sniffer support for the WordPress.com VIP GO standard. Thanks @renatonascalves! -- ([#2490](https://github.com/wp-graphql/wp-graphql/pull/2490)): Fix bug related to querying the page set as "Posts Page" -- ([#2497](https://github.com/wp-graphql/wp-graphql/pull/2497)): Only enqueue admin scripts on the settings page. Thanks @justlevine! -- ([#2498](https://github.com/wp-graphql/wp-graphql/pull/2498)): Add `include` and `exclude` args to `MediaDetails.sizes`. Thanks @justlevine! -- ([#2499](https://github.com/wp-graphql/wp-graphql/pull/2499)): Check for multiple theme capabilities in the Theme Model. Thanks @justlevine! -- ([#2504](https://github.com/wp-graphql/wp-graphql/pull/2504)): Filter `mediaItems` query by `mimeType`. Thanks @justlevine! -- ([#2506](https://github.com/wp-graphql/wp-graphql/pull/2506)): Update descriptions for input fields that accept a `databaseId`. Thanks @justlevine! -- ([#2511](https://github.com/wp-graphql/wp-graphql/pull/2511)): Update link in docs to point to correct "nonce" example. Thanks @NielsdeBlaauw! - - -= 1.9.1 = - -**Chores / Bugfixes** - -- ([#2471](https://github.com/wp-graphql/wp-graphql/pull/2471)): feat: PHPCS: enhancements to the Coding Standards Setup. Thanks @renatonascalves! -- ([#2472](https://github.com/wp-graphql/wp-graphql/pull/2472)): fix: return CommentAuthor avatar urls to public users. Thanks @justlevine! -- ([#2473](https://github.com/wp-graphql/wp-graphql/pull/2473)): fix: Update GraphiQL "user switch" to be accessible. Thanks @nickcernis! -- ([#2477](https://github.com/wp-graphql/wp-graphql/pull/2477)): fix(graphiql): graphiql fails if variables are invalid json - - -= 1.9.0 = - -**Upgrading** - -There are 2 changes that **might** require action when updating to 1.9.0. - - -1. ([#2464](https://github.com/wp-graphql/wp-graphql/pull/2464)) - -When querying for a `nodeByUri`, if your site has the "page_for_posts" setting configured, the behavior of the `nodeByUri` query for that uri might be different for you. - -Previously a bug caused this query to return a "Page" type, when it should have returned a "ContentType" Type. - -The bug fix might change your application if you were using the bug as a feature. - - - -2. ([#2457](https://github.com/wp-graphql/wp-graphql/pull/2457)) - -There were a lot of bug fixes related to connections to ensure they behave as intended. If you were querying lists of data, in some cases the data might be returned in a different order than it was before. - -For example, using the "last" input on a Comment or User query should still return the same nodes, but in a different order than before. - -This might cause behavior you don't want in your application because you had coded around the bug. This change was needed to support proper backward pagination. - -** Chores / Bugfixes** - -- ([#2450](https://github.com/wp-graphql/wp-graphql/pull/2450)): Fix PHPCompatibility lint config. Thanks @justlevine! -- ([#2452](https://github.com/wp-graphql/wp-graphql/pull/2452)): Fixes a bug with `Comment.author` connections not properly resolving for public (non-authenticated) requests. -- ([#2453](https://github.com/wp-graphql/wp-graphql/pull/2453)): Update Github Workflows to use PHP 7.3. Thanks @justlevine! -- ([#2454](https://github.com/wp-graphql/wp-graphql/pull/2454)): Add linter to ensure Pull Requests use "Conventional Commit" standards. -- ([#2455](https://github.com/wp-graphql/wp-graphql/pull/2455)): Refactors and Lints the WPUnit tests. Cleans up some "leaky" data in test suites. Thanks @justlevine! -- ([#2457](https://github.com/wp-graphql/wp-graphql/pull/2457)): Refactor Connection Resolvers to better adhere to Relay Connection spec. This fixes several bugs related to pagination across connections, specifically User and Comment connections which didn't properly support backward pagination at all. Thanks @justlevine! -- ([#2460](https://github.com/wp-graphql/wp-graphql/pull/2460)): Update documentation for running tests with Docker. Thanks @markkelnar! -- ([#2463](https://github.com/wp-graphql/wp-graphql/pull/2463)): Add Issue templates to the repo. Thanks @justlevine! -- ([#2464](https://github.com/wp-graphql/wp-graphql/pull/2464)): Fixes node resolver when "page_for_posts" setting is set to a page. - - -= 1.8.7 = - -**Chores / Bugfixes** - -- ([#2441](https://github.com/wp-graphql/wp-graphql/pull/2441)): Fix `contentNodes` field not showing if a taxonomy is registered without connected post types. Thanks @saimonh3! -- ([#2446](https://github.com/wp-graphql/wp-graphql/pull/2446)): Update "terser" from 5.11.0 to 5.14.2 (GraphiQL Dependency) -- ([#2440](https://github.com/wp-graphql/wp-graphql/pull/2440)): Update JS dependencies for GraphiQL - -**New Features** - -- ([#2435](https://github.com/wp-graphql/wp-graphql/pull/2435)): Add filter in execute for query string. Thanks @markkelnar! -- ([#2432](https://github.com/wp-graphql/wp-graphql/pull/2432)): Add `query_id` to `after_execute_actions` for batch requests. Thanks @markkelnar! - - -= 1.8.6 = - -**Chores / Bugfixes** - -- ([#2427](https://github.com/wp-graphql/wp-graphql/pull/2427)): Fixes a regression of the 1.8.3 release where there could be fatal errors when GraphQL Tracing is enabled and a queryId is used as a query param. - - -= 1.8.5 = - -**Chores / Bugfixes** - -- ([#2422](https://github.com/wp-graphql/wp-graphql/pull/2422)): Fixes a regression of the 1.8.3 release where there could be fatal errors when GraphQL Tracing is enabled. - - -= 1.8.4 = - -**Chores / Bugfixes** - -- ([#2416](https://github.com/wp-graphql/wp-graphql/pull/2416)): Fixes schema artifact workflow in Github. - -= 1.8.3 = - -**New Features** - -- ([#2388](https://github.com/wp-graphql/wp-graphql/pull/2388)): Adds ability to query menus by SLUG and LOCATION. Thanks @justlevine! - -**Chores / Bugfixes** - -- ([#2412](https://github.com/wp-graphql/wp-graphql/pull/2412)): Update tests to run in PHP 8, 8.1 and with WordPress 6.0. Updates Docker Deploy workflow as well. -- ([#2411](https://github.com/wp-graphql/wp-graphql/pull/2411)): Fixes bug where menuItems "location" arg was conflicting if a taxonomy is also registered with "location" as its name. -- ([#2410](https://github.com/wp-graphql/wp-graphql/pull/2410)): Fixes a regression with Taxonomy Connection pagination. -- ([#2406](https://github.com/wp-graphql/wp-graphql/pull/2406)): Updates PHPUnit, WPBrowser and WPGraphQL Test Case for use in workflows. Thanks @justlevine! -- ([#2387](https://github.com/wp-graphql/wp-graphql/pull/2387)): Fixes a bug with asset versions when querying for Enqueued Scripts and Styles. Thanks @justlevine! - - - -= 1.8.2 = - -**New Features** - -- ([#2363](https://github.com/wp-graphql/wp-graphql/pull/2363)): Adds "uri" field to MenuItem type which resolves the path of the node which can then be used in a `nodeByUri` query to get the linked node. The path is relative and does not contain subdirectory path in a subdirectory multisite. the `path` field does include the multisite subdirectory path, still. Thanks @josephfusco and @justlevine! -- ([#2337](https://github.com/wp-graphql/wp-graphql/pull/2337)): Allows for either global ID or databaseId to be supplied in the ID field for user mutations. Thanks @justlevine! -- ([#2338](https://github.com/wp-graphql/wp-graphql/pull/2338)): Allows either global "relay" ID or databaseId for post object mutations. Thanks @justlevine! -- ([#2336](https://github.com/wp-graphql/wp-graphql/pull/2336)): Allows either global "relay" ID or databaseId for term object mutations. Thanks @justlevine! -- ([#2331](https://github.com/wp-graphql/wp-graphql/pull/2331)): Allows either global "relay" ID or databaseId for MediaItem object mutations. Thanks @justlevine! -- ([#2328](https://github.com/wp-graphql/wp-graphql/pull/2328)): Allows either global "relay" ID or databaseId for Comment object mutations. Thanks @justlevine! - - -**Chores/Bugfixes** - -- ([#2368](https://github.com/wp-graphql/wp-graphql/pull/2368)): Updates dependencies for Schema Linter workflow. -- ([#2369](https://github.com/wp-graphql/wp-graphql/pull/2369)): Replaces the Codecov badge in the README with Coveralls badge. Thanks @justlevine! -- ([#2374](https://github.com/wp-graphql/wp-graphql/pull/2374)): Updates descriptions for PostObjectFieldFormatEnum. Thanks @justlevine! -- ([#2375](https://github.com/wp-graphql/wp-graphql/pull/2375)): Sets up the testing integration workflow to be able to run in multisite. Adds one workflow that runs in multisite. Fixes tests related to multisite. -- ([#2376](https://github.com/wp-graphql/wp-graphql/pull/2276)): Adds support for `['auth']['callback']` and `isPrivate` for the `register_graphql_mutation()` API. -- ([#2379](https://github.com/wp-graphql/wp-graphql/pull/2379)): Fixes a bug where term mutations were adding slashes when being stored in the database. -- ([#2380](https://github.com/wp-graphql/wp-graphql/pull/2380)): Fixes a bug where WPGraphQL wasn't sending the Wp class to the `parse_request` filter as a reference. -- ([#2382](https://github.com/wp-graphql/wp-graphql/pull/2382)): Fixes a bug where `register_graphql_field()` was not being respected by GraphQL Types added to the schema to represent Setting Groups of the core WordPress `register_setting()` API. - - -= 1.8.1 = - -**New Features** - -- ([#2349](https://github.com/wp-graphql/wp-graphql/pull/2349)): Adds tags to wpkses_post for WPGraphQL settings pages to be extended further. Thanks @eavonius! - -**Chores/Bugfixes** - -- ([#2358](https://github.com/wp-graphql/wp-graphql/pull/2358)): Updates NPM dependencies. Thanks @dependabot! -- ([#2357](https://github.com/wp-graphql/wp-graphql/pull/2357)): Updates NPM dependencies. Thanks @dependabot! -- ([#2356](https://github.com/wp-graphql/wp-graphql/pull/2356)): Refactors codebase to take advantage of the work done in #2353. Thanks @justlevine! -- ([#2354](https://github.com/wp-graphql/wp-graphql/pull/2354)): Fixes console warnings in GraphiQL related to missing React keys. -- ([#2353](https://github.com/wp-graphql/wp-graphql/pull/2353)): Refactors the WPGraphQL::get_allowed_post_types() and WPGraphQL::get_allowed_taxonomies() functions. Thanks @justlevine! -- ([#2350](https://github.com/wp-graphql/wp-graphql/pull/2350)): Fixes bug where Comment Authors were not always properly returning - -= 1.8.0 = - -**New Features** - -- ([#2286](https://github.com/wp-graphql/wp-graphql/pull/2286)): Introduce new `Utils::get_database_id_from_id()` function to help DRY up some code around inputs that can accept Global IDs or Database IDs. Thanks @justlevine! -- ([#2327](https://github.com/wp-graphql/wp-graphql/pull/2327)): Update capability for plugin queries. Changes from `update_plugins` to `activate_plugins`. Thanks @justlevine! -- ([#2298](https://github.com/wp-graphql/wp-graphql/pull/2298)): Adds `$where` arguments to Plugin Connections. Thanks @justlevine! -- ([#2332](https://github.com/wp-graphql/wp-graphql/pull/2332)): Adds new Github workflow to build the GraphiQL App on pushes to `develop` and `master`. This should allow users that install WPGraphQL to install/update with Composer and have the GraphiQL app running, instead of having to run `npm install && npm run build` in addition to `composer install`. - -**Chores / Bugfixes** - -- ([#2286](https://github.com/wp-graphql/wp-graphql/pull/2286)): Remove old, no-longer used JS files. Remnant from 1.7.0 release. -- ([#2296](https://github.com/wp-graphql/wp-graphql/pull/2296)): Fixes bug with how post/page templates are added to the Schema. Thanks @justlevine! -- ([#2295](https://github.com/wp-graphql/wp-graphql/pull/2295)): Fixes bug where menus were returning when they shouldn't be. Thanks @justlevine! -- ([#2299](https://github.com/wp-graphql/wp-graphql/pull/2299)): Fixes bug with author ID not being cast to an integer properly in the MediaItemUpdate mutation. Thanks @abaicus! -- ([#2310](https://github.com/wp-graphql/wp-graphql/pull/2310)): Bumps node-forge npm dependency -- ([#2317](https://github.com/wp-graphql/wp-graphql/pull/2317)): Bumps composer dependencies -- ([#2291](https://github.com/wp-graphql/wp-graphql/pull/2291)): Add "allow-plugins" to composer.json to reduce warning output when running composer install. Thanks @justlevine! -- ([#2294](https://github.com/wp-graphql/wp-graphql/pull/2294)): Refactors AbstractConnectionResolver::get_nodes() to prevent double slicing. Thanks @justlevine! -- ([#2293](https://github.com/wp-graphql/wp-graphql/pull/2293)): Fixes connections that can be missing nodes when before/after arguments are empty. Thanks @justlevine! -- ([#2323](https://github.com/wp-graphql/wp-graphql/pull/2323)): Fixes bug in Comment mutations. Thanks @justlevine! -- ([#2320](https://github.com/wp-graphql/wp-graphql/pull/2320)): Fixes bug with filtering comments by commentType. Thanks @justlevine! -- ([#2319](https://github.com/wp-graphql/wp-graphql/pull/2319)): Fixes bug with the comment_text filter in Comment queries. Thanks @justlevine! - -= 1.7.2 = - -**Chores / Bugfixes** - -- ([#2276](https://github.com/wp-graphql/wp-graphql/pull/2276)): Fixes a bug where `generalSettings.url` field was not in the Schema for multisite installs. -- ([#2278](https://github.com/wp-graphql/wp-graphql/pull/2278)): Adds a composer post-install script that installs JS dependencies and builds the JS app when `composer install` is run -- ([#2277](https://github.com/wp-graphql/wp-graphql/pull/2277)): Adds a condition to the docker image to only run `npm` scripts if the project has a package.json. Thanks @markkelnar! - - -= 1.7.1 = - -**Chores / Bugfixes** - -- ([#2268](https://github.com/wp-graphql/wp-graphql/pull/2268)): Fixes a bug in GraphiQL that would update browser history with every change to a query param. - - -= 1.7.0 = - -**Chores / Bugfixes** - -- ([#2228](https://github.com/wp-graphql/wp-graphql/pull/2228)): Allows optional fields to be set to empty values in the `updateUser` mutation. Thanks @victormattosvm! -- ([#2247](https://github.com/wp-graphql/wp-graphql/pull/2247)): Add WordPress 5.9 to the automated testing matrix. Thanks @markkelnar! -- ([#2242](https://github.com/wp-graphql/wp-graphql/pull/2242)): Adds End 2 End tests to test GraphiQL functionality in the admin. -- ([#2261](https://github.com/wp-graphql/wp-graphql/pull/2261)): Fixes a bug where the `pageByUri` query might return incorrect data when custom permalinks are set. Thanks @blakewilson! -- ([#2263](https://github.com/wp-graphql/wp-graphql/pull/2263)): Adds documentation entry for WordPress Application Passwords guide. Thanks @abhisekmazumdar! -- ([#2262](https://github.com/wp-graphql/wp-graphql/pull/2262)): Fixes a bug where settings registered via the core `register_setting()` API would cause Schema Introspection failures, causing GraphiQL and other tools to not work properly. - -**New Features** - -- ([#2248](https://github.com/wp-graphql/wp-graphql/pull/2248)): WPGraphiQL (the GraphiQL IDE in the WordPress dashboard) has been re-built to have an extension architecture and some updated user interfaces. Thanks for contributing to this effort @scottyzen! -- ([#2246](https://github.com/wp-graphql/wp-graphql/pull/2246)): Adds support for querying the `avatar` for the CommentAuthor Type and the Commenter Interface type. -- ([#2236](https://github.com/wp-graphql/wp-graphql/pull/2236)): Introduces new `graphql_model_prepare_fields` filter and deprecates `graphql_return_modeled_data` filter. Thanks @justlevine! -- ([#2265](https://github.com/wp-graphql/wp-graphql/pull/2265)): Adds opt-in telemetry tracking via Appsero, to allow us to collect helpful information for prioritizing future feature work, etc. - -= 1.6.12 = - -**Chores / Bugfixes** - -- ([#2209](https://github.com/wp-graphql/wp-graphql/pull/2209)): Adds WordPress 5.8 to the testing matrix. Thanks @markkelnar! -- ([#2211](https://github.com/wp-graphql/wp-graphql/pull/2211)), ([#2216](https://github.com/wp-graphql/wp-graphql/pull/2216)), ([#2221](https://github.com/wp-graphql/wp-graphql/pull/2221)), ([#2223](https://github.com/wp-graphql/wp-graphql/pull/2223)): Bumps NPM dependencies for GraphiQL -- ([#2212](https://github.com/wp-graphql/wp-graphql/pull/2212)): Fixes how the `TermObject.uri` strips the link down to the path. Thanks @theodesp! -- ([#2215](https://github.com/wp-graphql/wp-graphql/pull/2215)): Fixes testing environment to play nice with a recent wp-browser update. -- ([#2218](https://github.com/wp-graphql/wp-graphql/pull/2218)): Update note on settings page explaining that Public Introspection is enabled when GraphQL Debug mode is enabled. -- ([#2220](https://github.com/wp-graphql/wp-graphql/pull/2220)): Adds CodeQL workflow to analyze JavaScript on PRs - - -= 1.6.11 = - -**Chores / Bugfixes** - -- ([#2177](https://github.com/wp-graphql/wp-graphql/pull/2177)): Prevents PHP notice when clientMutationId is not set on mutations. Thanks @oskarmodig! -- ([#2182](https://github.com/wp-graphql/wp-graphql/pull/2182)): Fixes bug where the graphql endpoint couldn't be accessed by a site domain other than the site_url(). Thanks @moommeister! -- ([#2184](https://github.com/wp-graphql/wp-graphql/pull/2184)): Fixes regression where duplicate type warning was not being displayed after lazy type loading was added in v1.6.0. -- ([#2189](https://github.com/wp-graphql/wp-graphql/pull/2189)): Fixes bug with content node previews -- ([#2196](https://github.com/wp-graphql/wp-graphql/pull/2196)): Further bug fixes for content node previews. Thanks @apmattews! -- ([#2197](https://github.com/wp-graphql/wp-graphql/pull/2197)): Fixes call to prepare_fields() to not be called statically. Thanks @justlevine! - -**New Features** - -- ([#2188](https://github.com/wp-graphql/wp-graphql/pull/2188)): Adds `contentTypeName` to the `ContentNode` type. -- ([#2199](https://github.com/wp-graphql/wp-graphql/pull/2199)): Pass the TypeRegistry instance through to the `graphql_schema_config` filter. -- ([#2204](https://github.com/wp-graphql/wp-graphql/pull/2204)): Allow a `root_value` to be set when calling the `graphql()` function. -- ([#2203](https://github.com/wp-graphql/wp-graphql/pull/2203)): Adds new filter to mutations to filter the input args before execution, and a new action after execution, before returning the mutation, to allow additional data to be stored during mutations. Thanks @markkelnar! - -= 1.6.10 = - -- Updating stable tag for WordPress.org - -= 1.6.9 = - -- No functional changes from v1.6.8. Fixing an issue with deploy to WordPress.org - -= 1.6.8 = - -**Chores / Bugfixes** - -- ([#2143](https://github.com/wp-graphql/wp-graphql/pull/2143)): Adds `taxonomyName` field to the `TermNode` interface. Thanks @jeanfredrik! -- ([#2168](https://github.com/wp-graphql/wp-graphql/pull/2168)): Allows the GraphiQL screen markup to be filtered -- ([#2150](https://github.com/wp-graphql/wp-graphql/pull/2150)): Updates GraphiQL npm dependency to v1.4.7 -- ([#2145](https://github.com/wp-graphql/wp-graphql/pull/2145)): Fixes a bug with cursor pagination stability - - -**New Features** - -- ([#2141](https://github.com/wp-graphql/wp-graphql/pull/2141)): Adds a new `graphql_wp_connection_type_config` filter to allow customizing connection configurations. Thanks @justlevine! - - -= 1.6.7 - -**Chores / Bugfixes** - -- ([#2135](https://github.com/wp-graphql/wp-graphql/pull/2135)): Fixes permission check in the Post model layer. Posts of a `'publicly_queryable' => true` post_type can be queried publicly (non-authenticated requests) via WPGraphQL, even if the post_type is set to `'public' => false`. Thanks @kellenmace! -- ([#2093](https://github.com/wp-graphql/wp-graphql/pull/2093)): Fixes `Post.pinged` field to properly return an array. Thanks @justlevine! -- ([#2132](https://github.com/wp-graphql/wp-graphql/pull/2132)): Fix issue where querying posts by slug could erroneously return null. Thanks @ChrisWiegman! -- ([#2127](https://github.com/wp-graphql/wp-graphql/pull/2127)): Update endpoint in documentation examples. Thanks @RafidMuhyim! - - -= 1.6.6 - -**New Features** - -- ([#2106](https://github.com/wp-graphql/wp-graphql/pull/2106)): Add new `pre_graphql_execute_request` filter to better support full query caching. Thanks @markkelnar! -- ([#2123](https://github.com/wp-graphql/wp-graphql/pull/2123)): Add new `graphql_dataloader_get_cached` filter to better support persistent object caching in the Model Layer. Thanks @kidunot89! - -**Chores / Bugfixes** - -- ([#2094](https://github.com/wp-graphql/wp-graphql/pull/2094)): fix broken link in docs. Thanks @duffn! -- ([#2108](https://github.com/wp-graphql/wp-graphql/pull/2108)): Update lucatume/wp-browser dependency. Thanks @markkelnar! -- ([#2111](https://github.com/wp-graphql/wp-graphql/pull/2111)): Correct variable name passed to filter. Thanks @markkelnar! -- ([#2112](https://github.com/wp-graphql/wp-graphql/pull/2112)): Doc typo corrections. Thanks @nexxai! -- ([#2115](https://github.com/wp-graphql/wp-graphql/pull/2115)): Updates to GraphiQL npm dependencies. Thanks @alexghirelli! -- ([#2124](https://github.com/wp-graphql/wp-graphql/pull/2124)): Updates `tmpl` npm dependency. - - -= 1.6.5 - -**Chores / Bugfixes** - -- ([#2081](https://github.com/wp-graphql/wp-graphql/pull/2081)): Set `is_graphql_request` earlier in Request.php. Thanks @jordanmaslyn! -- ([#2085](https://github.com/wp-graphql/wp-graphql/pull/2085)): Bump codeception from 4.1.21 to 4.1.22 - -**New Features** - -- ([#2076](https://github.com/wp-graphql/wp-graphql/pull/2076)): Add `$graphiql` global variable to allow extensions the ability to more easily remove hooks/filters from the class. - - -= 1.6.4 - -**Chores / Bugfixes** - -- ([#2076](https://github.com/wp-graphql/wp-graphql/pull/2076)): Updates WPGraphiQL IDE to use latest react, GraphiQL and other dependencies. - -**New Features** - -- ([#2076](https://github.com/wp-graphql/wp-graphql/pull/2076)): WPGraphiQL IDE now resizes when the browser window is resized. - - -= 1.6.3 - -**Chores / Bugfixes** - -- ([#2064](https://github.com/wp-graphql/wp-graphql/pull/2064)): Fixes bug where using `asQuery` argument could return an error instead of a null when the ID passed could not be previewed. -- ([#2072](https://github.com/wp-graphql/wp-graphql/pull/2072)): Fixes bug (regression with 1.6) where Object Types for page templates were not properly loading in the Schema after Lazy Loading was introduced in 1.6. -- ([#2059](https://github.com/wp-graphql/wp-graphql/pull/2059)): Update typos and links in docs. Thanks @nicolnt! -- ([#2058](https://github.com/wp-graphql/wp-graphql/pull/2058)): Fixes bug in the filter_post_meta_for_previews was causing PHP warnings. Thanks @zolon4! - - -= 1.6.2 = - -**Chores / Bugfixes** - -- ([#2051](https://github.com/wp-graphql/wp-graphql/pull/2051)): Fixes a bug where Types that share the same name as a PHP function (ex: `Header` / `header()`) would try and call the function when loading the Type. See ([Issue #2047](https://github.com/wp-graphql/wp-graphql/issues/2047)) -- ([#2055](https://github.com/wp-graphql/wp-graphql/pull/2055)): Fixes a bug where Connections registered from Types were adding connections to the registry too late causing some queries to fail. See Issue ([Issue #2054](https://github.com/wp-graphql/wp-graphql/issues/2054)) - - -= 1.6.1 = - -**Chores / Bugfixes** - -- ([#2043](https://github.com/wp-graphql/wp-graphql/pull/2043)): Fixes a regression with GraphQL Request Execution that was causing Gatsby to fail builds. - - -= 1.6.0 = - -**Chores / Bugfixes** - -- ([#2000](https://github.com/wp-graphql/wp-graphql/pull/2000)): This fixes issue where all Types of the Schema were loaded for each GraphQL request. Now only the types required to fulfill the request are loaded on each request. Thanks @chriszarate! -- ([#2031](https://github.com/wp-graphql/wp-graphql/pull/2031)): This fixes a performance issue in the WPGraphQL model layer where determining whether a User is a published author was generating expensive MySQL queries on sites with a lot of users and a lot of content. Thanks @chriszarate! - -= 1.5.8 = - -**Chores / Bugfixes** - -- ([#2038](https://github.com/wp-graphql/wp-graphql/pull/2038)): Exclude documentation directory from code archived by composer and deployed to WordPress.org - -= 1.5.7 = - -**Chores / Bugfixes** - -- Update to trigger a missed deploy to WordPress.org. no functional changes from v1.5.6 - -= 1.5.6 = - -**Chores / Bugfixes** - -- ([#2035](https://github.com/wp-graphql/wp-graphql/pull/2035)): Fixes a bug where variables passed to `after_execute_actions` weren't properly set for Batch Queries. - -**New Features** - -- ([#2035](https://github.com/wp-graphql/wp-graphql/pull/2035)): (Yes, same PR as the bugfix above). Adds 2 new actions `graphql_before_execute` and `graphql_after_execute` to allow actions to run before/after the execution of entire Batch requests vs. the hooks that currently run _within_ each the execution of each operation within a request. - - -= 1.5.5 = - -**Chores / Bugfixes** - -- ([#2023](https://github.com/wp-graphql/wp-graphql/pull/2023)): Fixes issue with deploying Docker Testing Images. Thanks @markkelnar! -- ([#2025](https://github.com/wp-graphql/wp-graphql/pull/2025)): Update test workflow to test against WordPress 5.8 (released today) and updates the readme.txt to reflect the plugin has been tested up to 5.8 -- ([#2028](https://github.com/wp-graphql/wp-graphql/pull/2028)): Update Codeception test environment to prevent WordPress from entering maintenance mode during tests. - -= 1.5.4 = - -**Chores / Bugfixes** - -- ([#2012](https://github.com/wp-graphql/wp-graphql/pull/2012)): Adds functional tests back to the Github testing workflow! -- ([#2016](https://github.com/wp-graphql/wp-graphql/pull/2016)): Ignore Schema Linter workflow on releases, run on PRs only. -- ([#2019](https://github.com/wp-graphql/wp-graphql/pull/2019)): Deploy Docker Testing Image on releases. Thanks @markkelnar! - -**New Features** - -- ([#2011](https://github.com/wp-graphql/wp-graphql/pull/2011)): Introduces a new API to allow Types to register connections at the Type registration level and refactors several internal Types to use this new API. - - -= 1.5.3 = - -**Chores / Bugfixes** - -- ([#2001](https://github.com/wp-graphql/wp-graphql/pull/2001)): Updates Docker environment to use MariaDB instead of MySQL to play nice with those fancy M1 Macs. Thanks @chriszarate! -- ([#2002](https://github.com/wp-graphql/wp-graphql/pull/2002)): Add PHP8 Docker image to deploy upon releases. Thanks @markkelnar! -- ([#2006](https://github.com/wp-graphql/wp-graphql/pull/2006)): Update Docker to use $PROJECT_DIR variable instead of hardcoded value to allow composed docker images to run their own tests from their own project. Thanks @markkelnar! -- ([#2007](https://github.com/wp-graphql/wp-graphql/pull/2007)): Update broken links to Relay spec. Thanks @ramyareye! - -**New Features** - -- ([#2009](https://github.com/wp-graphql/wp-graphql/pull/2009)): Adds new WPConnectionType class and refactors register_graphql_connection() to use the class. Functionality should be the same, but this sets the codebase up for some new connection APIs. - - -= 1.5.2 = - -**Chores / Bugfixes** - -- ([#1992](https://github.com/wp-graphql/wp-graphql/pull/1992)): Fixes bug that caused conflict with the AmpWP plugin. -- ([#1994](https://github.com/wp-graphql/wp-graphql/pull/1994)): Fixes bug where querying a node by uri could return a node of a different post type. -- ([#1997](https://github.com/wp-graphql/wp-graphql/pull/1997)): Fixes bug where Enums could be generated with no values when a taxonomy was set to show in GraphQL but it's associated post_type(s) are not shown in graphql. - - -= 1.5.1 = - -**Chores / Bugfixes** - -- ([#1987](https://github.com/wp-graphql/wp-graphql/pull/1987)): Fixes Relay Spec link in documentation Thanks @ramyareye! -- ([#1988](https://github.com/wp-graphql/wp-graphql/pull/1988)): Fixes docblock and parameter Type in preview filter callback. Thanks @zolon4! -- ([#1986](https://github.com/wp-graphql/wp-graphql/pull/1986)): Update WP environment variables for testing with PHP8. Thanks @markkelnar! - -**New Features** - -- ([#1984](https://github.com/wp-graphql/wp-graphql/pull/1984)): Support for PHP8! No functional changes to the code, just changes to dependency declarations and test environment. -- ([#1990](https://github.com/wp-graphql/wp-graphql/pull/1990)): Adds `isTermNode` and `isContentNode` to the `UniformResourceIdentifiable` Interface - - - -= 1.5.0 = - -**Chores / Bugfixes** - -- ([#1865](https://github.com/wp-graphql/wp-graphql/pull/1865)): Change `MenuItem.path` field from `nonNull` to nullable as the value can be null in WordPress. Thanks @furedal! -- ([#1978](https://github.com/wp-graphql/wp-graphql/pull/1978)): Use "docker compose" instead of docker-compose in the run-docker.sh script. Thanks @markkelnar! -- ([#1974](https://github.com/wp-graphql/wp-graphql/pull/1974)): Separates app setup and app-post-setup scripts for use in the Docker/test environment setup. Thanks @markkelnar! -- ([#1972](https://github.com/wp-graphql/wp-graphql/pull/1972)): Pushes Docker images when new releases are tagged. Thanks @markkelnar! -- ([#1970](https://github.com/wp-graphql/wp-graphql/pull/1970)): Change Docker Image names specific to the WP and PHP versions. Thanks @markkelnar! -- ([#1967](https://github.com/wp-graphql/wp-graphql/pull/1967)): Update xdebug max nesting level to allow coverage to pass with resolver instrumentation active. Thanks @markkelnar! - - -**New Features** - -- ([#1977](https://github.com/wp-graphql/wp-graphql/pull/1977)): Allow same string to be passed for "graphql_single_name" and "graphql_plural_name" (ex: "deer" and "deer") when registering Post Types and Taxonomies. Same strings will be prefixed with "all" for plurals. Thanks @apmatthews! -- ([#1787](https://github.com/wp-graphql/wp-graphql/pull/1787)): Adds a new "ContentTypesOf. Thanks @plong0! - - -= 1.4.3 = - -- No functional change. Version bump to fix previous deploy. - -= 1.4.2 = - -**Chores / Bugfixes** - -- ([#1963](https://github.com/wp-graphql/wp-graphql/pull/1963)): Fixes a regression in v1.4.0 where the `uri` field on Terms was returning `null`. The issue was actually wider than that as resolvers on Object Types that implement interfaces weren't being fully respected. -- ([#1956](https://github.com/wp-graphql/wp-graphql/pull/1956)): Adds `SpaceAfterFunction` Code Sniffer rule and adjusts the codebase to respect the rule. Thanks @markkelnar! - - -= 1.4.1 = - -**Chores / Bugfixes** - -- ([#1958](https://github.com/wp-graphql/wp-graphql/pull/1958)): Fixes a regression in 1.4.0 where `register_graphql_interfaces_to_types` was broken. - - -= 1.4.0 = - -**Chores / Bugfixes** - -- ([#1951](https://github.com/wp-graphql/wp-graphql/pull/1951)): Fixes bug with the `uri` field. Some Types in the Schema had the `uri` field as nullable field and some as a non-null field. This fixes it and makes the field consistently nullable as some Nodes with a URI might have a `null` value if the node is private. -- ([#1953](https://github.com/wp-graphql/wp-graphql/pull/1953)): Fixes bug with Settings groups with underscores not showing in the Schema properly. Thanks @markkelnar! - -**New Features** - -- ([#1951](https://github.com/wp-graphql/wp-graphql/pull/1951)): Updates GraphQL-PHP to v14.8.0 (from 14.4.0) and Introduces the ability for Interfaces to implement other Interfaces! - -= 1.3.10 = - -**Chores / Bugfixes** - -- ([#1940](https://github.com/wp-graphql/wp-graphql/pull/1940)): Adds Breaking Change inspector to run on new Pull Requests. Thanks @markkelnar! -- ([#1937](https://github.com/wp-graphql/wp-graphql/pull/1937)): Fixed typo in documentation. Thanks @LeonardoDB! -- ([#1923](https://github.com/wp-graphql/wp-graphql/issues/1923)): Fixed bug where User Model didn't support the databaseId field - -**New Features** - -- ([#1938](https://github.com/wp-graphql/wp-graphql/pull/1938)): Adds new functionality to the `register_graphql_connection()` API. Thanks @kidunot89! - -= 1.3.9 = - -**Chores / Bugfixes** - -- ([#1902](https://github.com/wp-graphql/wp-graphql/pull/1902)): Moves more documentation into markdown. Thanks @markkelnar! -- ([#1917](https://github.com/wp-graphql/wp-graphql/pull/1917)): Updates docblock on WPObjectType. Thanks @markkelnar! -- ([#1926](https://github.com/wp-graphql/wp-graphql/pull/1926)): Removes Telemetry. -- ([#1928](https://github.com/wp-graphql/wp-graphql/pull/1928)): Fixes bug (#1864) that was causing errors when get_post_meta() was used with a null meta key. -- ([#1929](https://github.com/wp-graphql/wp-graphql/pull/1929)): Adds Github Workflow to upload schema.graphql as release asset. - -**New Features** - -- ([#1924](https://github.com/wp-graphql/wp-graphql/pull/1924)): Adds new `graphql_http_request_response_errors` filter. Thanks @kidunot89! -- ([#1908](https://github.com/wp-graphql/wp-graphql/pull/1908)): Adds new `graphql_pre_resolve_uri` filter, allowing 3rd parties to filter the behavior of the nodeByUri resolver. Thanks @renatonascalves! - -= 1.3.8 = - -**Chores / Bugfixes** - -- ([#1897](https://github.com/wp-graphql/wp-graphql/pull/1897)): Fails batch requests when disabled earlier. -- ([#1893](https://github.com/wp-graphql/wp-graphql/pull/1893)): Moves more documentation into markdown. Thanks @markkelnar! - -**New Features** - -- ([#1897](https://github.com/wp-graphql/wp-graphql/pull/1897)): Adds new setting to set a max number of batch operations to allow per Batch request. - - -= 1.3.7 = - -**Chores / Bugfixes** - -- ([#1885](https://github.com/wp-graphql/wp-graphql/pull/1885)): Fixes regression to `register_graphql_connection` that was breaking custom connections registered by 3rd party plugins. - - -= 1.3.6 = - -**Chores / Bugfixes** - -- ([#1878](https://github.com/wp-graphql/wp-graphql/pull/1878)): Limits the x-hacker header to be output when in DEBUG mode by default. Thanks @wvffle! -- ([#1880](https://github.com/wp-graphql/wp-graphql/pull/1880)): Fixes the formatting of the modified date for Post objects. Thanks @chriszarate! -- ([#1851](https://github.com/wp-graphql/wp-graphql/pull/1851)): Update Schema Linker Github Action. Thanks @markkelnar! -- ([#1858](https://github.com/wp-graphql/wp-graphql/pull/1858)): Start migrating docs into markdown files within the repo. Thanks @markkelnar! -- ([#1856](https://github.com/wp-graphql/wp-graphql/pull/1856)): Move Schema Linter Github Action into multiple steps. Thanks @szepeviktor! - -**New Features** - -- ([#1872](https://github.com/wp-graphql/wp-graphql/pull/1872)): Adds new setting to the GraphQL Settings page to allow site administrators to restrict the endpoint to authenticated requests. -- ([#1874](https://github.com/wp-graphql/wp-graphql/pull/1874)): Adds new setting to the GraphQL Settings page to allow site administrators to disable Batch Queries. -- ([#1875](https://github.com/wp-graphql/wp-graphql/pull/1875)): Adds new setting to the GraphQL Settings page to allow site administrators to enable a max query depth and specify the depth. - - -= 1.3.5 = - -**Chores / Bugfixes** - -- ([#1846](https://github.com/wp-graphql/wp-graphql/pull/1846)): Fixes bug where sites with no menu locations can throw a php error in the MenuItemConnectionResolver. Thanks @markkelnar! - -= 1.3.4 = - -**New Features** - -- ([#1834](https://github.com/wp-graphql/wp-graphql/pull/1834)): Adds new `rename_graphql_type` function that allows Types to be given a new name in the Schema. Thanks @kidunot89! -- ([#1830](https://github.com/wp-graphql/wp-graphql/pull/1830)): Adds new `rename_graphql_field_name` function that allows fields to be given re-named in the Schema. Thanks @kidunot89! - -**Chores / Bugfixes** - -- ([#1820](https://github.com/wp-graphql/wp-graphql/pull/1820)): Fixes bug where one test in the test suite wasn't executing properly. Thanks @markkelnar! -- ([#1817](https://github.com/wp-graphql/wp-graphql/pull/1817)): Fixes docker environment to allow xdebug to run. Thanks @markkelnar! -- ([#1833](https://github.com/wp-graphql/wp-graphql/pull/1833)): Allow specific Test Suites to be executed when running tests with Docker. Thanks @markkelnar! -- ([#1816](https://github.com/wp-graphql/wp-graphql/pull/1816)): Fixes bug where user roles without a name caused errors when building the Schema -- ([#1824](https://github.com/wp-graphql/wp-graphql/pull/1824)): Fixes bug where setting the role of tracing/query logs to "any" wasn't being respected. Thanks @toriphes! -- ([#1828](https://github.com/wp-graphql/wp-graphql/pull/1828)): Fixes bug with Term connection pagination ordering - - - -= 1.3.3 = - -**Bugfixes / Chores** - -- ([#1806](https://github.com/wp-graphql/wp-graphql/pull/1806)): Fixes bug where databaseId couldn't be queried on the CommentAuthor type -- ([#1808](https://github.com/wp-graphql/wp-graphql/pull/1808)) & ([#1811](https://github.com/wp-graphql/wp-graphql/pull/1811)): Updates Schema descriptions across the board. Thanks @markkelnar! -- ([#1809](https://github.com/wp-graphql/wp-graphql/pull/1809)): Fixes bug where child terms couldn't properly be queried by URI. -- ([#1812](https://github.com/wp-graphql/wp-graphql/pull/1812)): Fixes bug where querying users in a site with many non-published authors can return 0 results. - -= 1.3.2 = - -**Bugfix** - -- Fixes ([#1802](https://github.com/wp-graphql/wp-graphql/issues/1802)) by reversing a change to how initial post types and taxonomies are setup. - -= 1.3.1 = - -**Bugfix** - -- patches a bug where default post types and taxonomies disappeared from the Schema - -= 1.3.0 = - -**Notable changes** - -Between this release and the prior release ([v1.2.6](https://github.com/wp-graphql/wp-graphql/releases/tag/v1.2.6)) includes changes to pagination under the hood. - -While these releases correcting mistakes and buggy behavior, it's possible that workarounds have already been implemented either in the server or in client applications. - -For example, there was a bug with `start/end` cursors being reversed for backward pagination. - -If a client application were reversing the cursors to fix the issue, the reversal in the client will now _cause_ the issue. - -It's recommended to test your applications against this release, _specifically_ in regards to pagination. - -**Bugfixes / Chores** - -- ([#1797](https://github.com/wp-graphql/wp-graphql/pull/1797)): Update test environment to allow custom permalink structures to be better tested. Moves the "show_in_graphql" setup of core post types and taxonomies into the `register_post_type_args` and `register_taxonomy_args` filters instead of modifying global filters directly. -- ([#1794](https://github.com/wp-graphql/wp-graphql/pull/1794)): Cleanup to PHPStan config. Thanks @szepeviktor! -- ([#1795](https://github.com/wp-graphql/wp-graphql/pull/1795)) and ([#1793](https://github.com/wp-graphql/wp-graphql/pull/1793)): Don't throw errors when external urls are provided as input for queries that try and resolve by uri -- ([#1792](https://github.com/wp-graphql/wp-graphql/pull/1792)): Add missing descriptions to various fields in the Schema. Thanks @markkelnar! -- ([#1791](https://github.com/wp-graphql/wp-graphql/pull/1791)): Update where `WP_GRAPHQL_URL` is defined to follow recommendation from WordPress.org. -- ([#1784](https://github.com/wp-graphql/wp-graphql/pull/1784)): Fix `UsersConnectionSearchColumnEnum` to show the proper values that were accidentally replaced. -- ([#1781](https://github.com/wp-graphql/wp-graphql/pull/1781)): Fixes various bugs related to pagination. Between this release and the v1.2.6 release the following bugs have been worked on in regards to pagination: ([#1780](https://github.com/wp-graphql/wp-graphql/pull/1780), [#1411](https://github.com/wp-graphql/wp-graphql/pull/1411), [#1552](https://github.com/wp-graphql/wp-graphql/pull/1552), [#1714](https://github.com/wp-graphql/wp-graphql/pull/1714), [#1440](https://github.com/wp-graphql/wp-graphql/pull/1440)) - -= 1.2.6 = - -**Bugfixes / Chores** - -- ([#1773](https://github.com/wp-graphql/wp-graphql/pull/1773)) Fixes multiple issues ([#1411](https://github.com/wp-graphql/wp-graphql/pull/1411), [#1440](https://github.com/wp-graphql/wp-graphql/pull/1440), [#1714](https://github.com/wp-graphql/wp-graphql/pull/1714), [#1552](https://github.com/wp-graphql/wp-graphql/pull/1552)) related to backward pagination . -- ([#1775](https://github.com/wp-graphql/wp-graphql/pull/1775)) Updates resolver for `MenuItem.children` connection to ensure the children belong to the same menu as well to prevent orphaned items from being returned. -- ([#1774](https://github.com/wp-graphql/wp-graphql/pull/1774)) Fixes bug where the `terms` connection wasn't properly being added to all Post Types that have taxonomy relationships. Thanks @toriphes! -- ([#1752](https://github.com/wp-graphql/wp-graphql/pull/1752)) Update documentation in README. Thanks @markkelnar! -- ([#1759](https://github.com/wp-graphql/wp-graphql/pull/1759)) Update WPGraphQL Includes method to be called only if composer install has been run. Helpful for contributors that have cloned the plugin locally. Thanks @rsm0128! -- ([#1760](https://github.com/wp-graphql/wp-graphql/pull/1760)) Fixes the `MediaItem.sizes` resolver. (see: [#1758](https://github.com/wp-graphql/wp-graphql/pull/1758)). Thanks @rsm0128! -- ([#1763](https://github.com/wp-graphql/wp-graphql/pull/1763)) Update `testVersion` in phpcs.xml to match required php version. Thanks @GaryJones! - -= 1.2.5 = - -**Bugfixes / Chores** - -- ([#1748](https://github.com/wp-graphql/wp-graphql/pull/1748)) Fixes issue where installing the plugin in Trellis using Composer was causing the plugin not to load properly. - -= 1.2.4 = - -**Bugfixes / Chores** - -- More work to fix Github -> SVN deploys. 🤦‍♂️ - -= 1.2.3 = - -**Bugfixes / Chores** - -- Addresses bug (still) causing deploys to WordPress.org to fail and not include the vendor directory. - -= 1.2.2 = - -**Bugfixes / Chores** - -- Fixes Github workflow to deploy to WordPress.org - -= 1.2.1 = - -**Bugfixes / Chores** - -- ([#1741](https://github.com/wp-graphql/wp-graphql/pull/1741)) Fix issue with DefaultTemplate not being registered to the Schema and throwing errors when no other templates are registered. - -= 1.2.0 = - -**New** - -- ([#1732](https://github.com/wp-graphql/wp-graphql/pull/1732)) Add `isPrivacyPage` to the Schema for the Page type. Thanks @Marco-Daniel! - -**Bugfixes / Chores** - -- ([#1734](https://github.com/wp-graphql/wp-graphql/pull/1734)) Remove Composer dependencies from being versioned in Github. Update Github workflows to install dependencies for deploying to WordPress.org and uploading release assets on Github. - -= 1.1.8 = - -**Bugfixes / Chores** - -- Fix release asset url in Github action. - -= 1.1.7 = - -**Bugfixes / Chores** - -- Fix release upload url in Github action. - -= 1.1.6 = - -**Bugfixes / Chores** - -- ([#1723](https://github.com/wp-graphql/wp-graphql/pull/1723)) Fix CI Schema Linter action. Thanks @szepeviktor! -- ([#1722](https://github.com/wp-graphql/wp-graphql/pull/1722)) Update PR Template message. Thanks @szepeviktor! -- ([#1730](https://github.com/wp-graphql/wp-graphql/pull/1730)) Updates redundant test configuration in Github workflow. Thanks @szepeviktor! - -= 1.1.5 = - -**Bugfixes / Chores** - -- ([#1718](https://github.com/wp-graphql/wp-graphql/pull/1718)) Simplify the main plugin file to adhere to more modern WP plugin standards. Move the WPGraphQL class to it's own file under the src directory. Thanks @szepeviktor! -- ([#1704](https://github.com/wp-graphql/wp-graphql/pull/1704)) Fix end tags for inputs on the WPGraphQL Settings page to adhere to the w3 spec for inputs. Thanks @therealgilles! -- ([#1706](https://github.com/wp-graphql/wp-graphql/pull/1706)) Show all content types in the ContentTypeEnum, not just public ones. Thanks @ljanecek! -- ([#1699](https://github.com/wp-graphql/wp-graphql/pull/1699)) Set default value for 2nd parameter on `Tracker->get_info()` method. Thanks @SpartakusMd! - -= 1.1.4 = - -**Bugfixes** - -- ([#1715](https://github.com/wp-graphql/wp-graphql/pull/1715)) Updates `WPGraphQL\Type\Object` namespace to be `WPGraphQL\Type\ObjectType` to play nice with newer versions of PHP where `Object` is a reserved namespace. -- ([#1711](https://github.com/wp-graphql/wp-graphql/pull/1711)) Updates regex in phpstan.neon.dist. Thanks @szepeviktor! -- ([#1719](https://github.com/wp-graphql/wp-graphql/pull/1719)) Update to backtrace that is output with graphql_debug messages to ensure it includes a `file` key in the returned array, before returning the trace. Thanks @kidunot89! - -= 1.1.3 = - -**Bugfixes** - -- ([#1693](https://github.com/wp-graphql/wp-graphql/pull/1693)) Clear global user in the Router in case plugins have attempted to set the user before API authentication has been executed. Thanks @therealgilles! - -**New** - -- ([#972](https://github.com/wp-graphql/wp-graphql/pull/972)) `graphql_pre_model_data_is_private` filter was added to the Abstract Model.php allowing Model's `is_private()` check to be bypassed. - - -= 1.1.2 = - -**Bugfixes** - -- ([#1676](https://github.com/wp-graphql/wp-graphql/pull/1676)) Add a `nav_menu_item` loader to allow previous menu item IDs to work properly with WPGraphQL should they be passed to a node query (like, if the ID were persisted somewhere already) -- Update cases of menu item IDs to be `post:$id` instead of `nav_menu_item:$id` -- Update tests to test that both the old `nav_menu_item:$id` and `post:$id` work for nav menu item node queries to support previously issued IDs - -= 1.1.1 = - -**Bugfixes** - -- ([#1670](https://github.com/wp-graphql/wp-graphql/issues/1670)) Fixes a bug with querying pages that are set as to be the posts page - -= 1.1.0 = - -This release centers around updating code quality by implementing [PHPStan](https://phpstan.org/) checks. PHPStan is a tool that statically analyzes PHP codebases to detect bugs. This release centers around updating Docblocks and overall code quality, and implements automated tests to check code quality on every pull request. - -**New** - -- Update PHPStan (Code Quality checker) to v0.12.64 -- Increases PHPStan code quality checks to Level 8 (highest level). - -**Bugfixes** -- ([#1653](https://github.com/wp-graphql/wp-graphql/issues/1653)) Fixes bug where WPGraphQL was explicitly setting `has_published_posts` on WP_Query but WP_Query does this under the hood already. Thanks @jmartinhoj! -- Fixes issue with Comment Model returning comments that are not associated with a Post object. Comments with no associated Post object are not public entities. -- Update docblocks to be compatible with PHPStan Level 8. -- Removed some uncalled code -- Added early returns in some places to prevent unnecessary added execution - -= 1.0.5 = - -**New** - -- Updates GraphQL-PHP from v14.3.0 to v14.4.0 -- Updates GraphQL-Relay-PHP from v0.3.1 to v0.5.0 - -**Bugfixes** - -- Fixes a bug where CI Tests were not passing when code coverage is enabled -- ([#1633](https://github.com/wp-graphql/wp-graphql/pull/1633)) Fixes bug where Introspection Queries were showing fields with no deprecationReason as deprecated because it was outputting an empty string instead of a null value. -- ([#1627](https://github.com/wp-graphql/wp-graphql/pull/1627)) Fixes bug where fields on the Model called multiple times might weren't being set properly -- Updates Theme tests to be more resilient for WP Core updates where new themes are introduced - -= 1.0.4 = - -**Bugfixes** - -- Fixes a regression to previews introduced by v1.0.3 - -= 1.0.3 = - -**Bugfixes** - -- ([#1623](https://github.com/wp-graphql/wp-graphql/pull/1623)): Queries for single posts will only return posts of that post_type -- ([#1624](https://github.com/wp-graphql/wp-graphql/pull/1624)): Passes Menu Item Labels through html_entity_decode - -= 1.0.2 = - -**Bugfixes** - -- fix issue with using the count() function on potentially not-countable value -- fix bug where post_status was being checked instead of comment_status -- fix error message when restoring a comment doesn't work -- ([#1610](https://github.com/wp-graphql/wp-graphql/issues/1610)) fix check to see if current user has permission to update another Author's post. Thanks @maximilianschmidt! - - -**New Features** - -- ([#1608](https://github.com/wp-graphql/wp-graphql/pull/1608)) move connections from each post type->contentType to be ContentNode->ContentType. Thanks @jeanfredrik! -- pass status code through as a param of the `graphql_process_http_request_response` action -- add test for mutating other authors posts - -= 1.0.1 = - -**Bugfixes** -- ([#1589](https://github.com/wp-graphql/wp-graphql/pull/1589)) Fixes a php type bug in TypeRegistry.php. Thanks @szepeviktor! -- [Fixes bug](https://github.com/wp-graphql/wp-graphql/compare/master...release/v1.0.1?expand=1#diff-74d71c4d1f9d84b9b0d946ca96eb875274f95d60611611d84cc01cdf6ed04021) with how GraphQL PHP Debug flags are set. -- ([#1598](https://github.com/wp-graphql/wp-graphql/pull/1598)) Fixes bug where Post Types registered with the same graphql_single_name and graphql_plural_name are the same value. -- ([#1615](https://github.com/wp-graphql/wp-graphql/issues/1615)) Fixes bug where fields added to the Schema that that were using get_post_meta() for Previews weren't always resolving properly. - -**New Features** -- Adds a setting to allow users to opt-in to tracking active installs of WPGraphQL. -- Removed old docs that used to be in this repo as markdown. Docs are now written in WordPress and the wpgraphql.com is a Gatsby site built from the content in WordPress and the [code in this repo](https://github.com/wp-graphql/wpgraphql.com). Looking to contribute content to the docs? Open an issue on this repo or the wpgraphql.com repo and we'll work with you to get content updated. We have future plans to allow the community to contribute by writing content in the WordPress install, but for now, Github issues will do. - -= 1.0 = - -Public Stable Release. - -This release contains no technical changes. - -Read the announcement: [https://www.wpgraphql.com/2020/11/16/announcing-wpgraphql-v1/](https://www.wpgraphql.com/2020/11/16/announcing-wpgraphql-v1/) - -Previous release notes can be found on Github: [https://github.com/wp-graphql/wp-graphql/releases](https://github.com/wp-graphql/wp-graphql/releases) diff --git a/lib/wp-graphql-1.17.0/src/Admin/Admin.php b/lib/wp-graphql-1.17.0/src/Admin/Admin.php deleted file mode 100644 index eff2c92e..00000000 --- a/lib/wp-graphql-1.17.0/src/Admin/Admin.php +++ /dev/null @@ -1,70 +0,0 @@ -admin_enabled = apply_filters( 'graphql_show_admin', true ); - $this->graphiql_enabled = apply_filters( 'graphql_enable_graphiql', get_graphql_setting( 'graphiql_enabled', true ) ); - - // This removes the menu page for WPGraphiQL as it's now built into WPGraphQL - if ( $this->graphiql_enabled ) { - add_action( - 'admin_menu', - static function () { - remove_menu_page( 'wp-graphiql/wp-graphiql.php' ); - } - ); - } - - // If the admin is disabled, prevent admin from being scaffolded. - if ( false === $this->admin_enabled ) { - return; - } - - $this->settings = new Settings(); - $this->settings->init(); - - if ( 'on' === $this->graphiql_enabled || true === $this->graphiql_enabled ) { - global $graphiql; - $graphiql = new GraphiQL(); - $graphiql->init(); - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Admin/GraphiQL/GraphiQL.php b/lib/wp-graphql-1.17.0/src/Admin/GraphiQL/GraphiQL.php deleted file mode 100644 index f733277f..00000000 --- a/lib/wp-graphql-1.17.0/src/Admin/GraphiQL/GraphiQL.php +++ /dev/null @@ -1,249 +0,0 @@ -is_enabled = get_graphql_setting( 'graphiql_enabled' ) !== 'off'; - - /** - * If GraphiQL is disabled, don't set it up in the Admin - */ - if ( ! $this->is_enabled ) { - return; - } - - // Register the admin page - add_action( 'admin_menu', [ $this, 'register_admin_page' ], 9 ); - add_action( 'admin_bar_menu', [ $this, 'register_admin_bar_menu' ], 100 ); - // Enqueue GraphiQL React App - add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_graphiql' ] ); - - /** - * Enqueue extension styles and scripts - * - * These extensions are part of WPGraphiQL core, but were built in a way - * to showcase how extension APIs can be used to extend WPGraphiQL - */ - add_action( 'enqueue_graphiql_extension', [ $this, 'graphiql_enqueue_query_composer' ] ); - add_action( 'enqueue_graphiql_extension', [ $this, 'graphiql_enqueue_auth_switch' ] ); - add_action( 'enqueue_graphiql_extension', [ $this, 'graphiql_enqueue_fullscreen_toggle' ] ); - } - - /** - * Registers admin bar menu - * - * @param \WP_Admin_Bar $admin_bar The Admin Bar Instance - * - * @return void - */ - public function register_admin_bar_menu( WP_Admin_Bar $admin_bar ) { - if ( ! current_user_can( 'manage_options' ) || 'off' === get_graphql_setting( 'show_graphiql_link_in_admin_bar' ) ) { - return; - } - - $icon_url = 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTcuNDY4IDMwMi42NmwtMTQuMzc2LTguMyAxNjAuMTUtMjc3LjM4IDE0LjM3NiA4LjN6Ii8+PHBhdGggZmlsbD0iI0UxMDA5OCIgZD0iTTM5LjggMjcyLjJoMzIwLjN2MTYuNkgzOS44eiIvPjxwYXRoIGZpbGw9IiNFMTAwOTgiIGQ9Ik0yMDYuMzQ4IDM3NC4wMjZsLTE2MC4yMS05Mi41IDguMy0xNC4zNzYgMTYwLjIxIDkyLjV6TTM0NS41MjIgMTMyLjk0N2wtMTYwLjIxLTkyLjUgOC4zLTE0LjM3NiAxNjAuMjEgOTIuNXoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTQuNDgyIDEzMi44ODNsLTguMy0xNC4zNzUgMTYwLjIxLTkyLjUgOC4zIDE0LjM3NnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzQyLjU2OCAzMDIuNjYzbC0xNjAuMTUtMjc3LjM4IDE0LjM3Ni04LjMgMTYwLjE1IDI3Ny4zOHpNNTIuNSAxMDcuNWgxNi42djE4NUg1Mi41ek0zMzAuOSAxMDcuNWgxNi42djE4NWgtMTYuNnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMjAzLjUyMiAzNjdsLTcuMjUtMTIuNTU4IDEzOS4zNC04MC40NSA3LjI1IDEyLjU1N3oiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzY5LjUgMjk3LjljLTkuNiAxNi43LTMxIDIyLjQtNDcuNyAxMi44LTE2LjctOS42LTIyLjQtMzEtMTIuOC00Ny43IDkuNi0xNi43IDMxLTIyLjQgNDcuNy0xMi44IDE2LjggOS43IDIyLjUgMzEgMTIuOCA0Ny43TTkwLjkgMTM3Yy05LjYgMTYuNy0zMSAyMi40LTQ3LjcgMTIuOC0xNi43LTkuNi0yMi40LTMxLTEyLjgtNDcuNyA5LjYtMTYuNyAzMS0yMi40IDQ3LjctMTIuOCAxNi43IDkuNyAyMi40IDMxIDEyLjggNDcuN00zMC41IDI5Ny45Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi44IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMzA5LjEgMTM3Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi43IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMjAwIDM5NS44Yy0xOS4zIDAtMzQuOS0xNS42LTM0LjktMzQuOSAwLTE5LjMgMTUuNi0zNC45IDM0LjktMzQuOSAxOS4zIDAgMzQuOSAxNS42IDM0LjkgMzQuOSAwIDE5LjItMTUuNiAzNC45LTM0LjkgMzQuOU0yMDAgNzRjLTE5LjMgMC0zNC45LTE1LjYtMzQuOS0zNC45IDAtMTkuMyAxNS42LTM0LjkgMzQuOS0zNC45IDE5LjMgMCAzNC45IDE1LjYgMzQuOSAzNC45IDAgMTkuMy0xNS42IDM0LjktMzQuOSAzNC45Ii8+PC9zdmc+'; - - $icon = sprintf( - '', - $icon_url - ); - - $admin_bar->add_menu( - [ - 'id' => 'graphiql-ide', - 'title' => $icon . __( 'GraphiQL IDE', 'wp-graphql' ), - 'href' => trailingslashit( admin_url() ) . 'admin.php?page=graphiql-ide', - ] - ); - } - - /** - * Register the admin page as a subpage - * - * @return void - */ - public function register_admin_page() { - - // Top level menu page should be labeled GraphQL - add_menu_page( - __( 'GraphQL', 'wp-graphql' ), - __( 'GraphQL', 'wp-graphql' ), - 'manage_options', - 'graphiql-ide', - [ $this, 'render_graphiql_admin_page' ], - 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTcuNDY4IDMwMi42NmwtMTQuMzc2LTguMyAxNjAuMTUtMjc3LjM4IDE0LjM3NiA4LjN6Ii8+PHBhdGggZmlsbD0iI0UxMDA5OCIgZD0iTTM5LjggMjcyLjJoMzIwLjN2MTYuNkgzOS44eiIvPjxwYXRoIGZpbGw9IiNFMTAwOTgiIGQ9Ik0yMDYuMzQ4IDM3NC4wMjZsLTE2MC4yMS05Mi41IDguMy0xNC4zNzYgMTYwLjIxIDkyLjV6TTM0NS41MjIgMTMyLjk0N2wtMTYwLjIxLTkyLjUgOC4zLTE0LjM3NiAxNjAuMjEgOTIuNXoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTQuNDgyIDEzMi44ODNsLTguMy0xNC4zNzUgMTYwLjIxLTkyLjUgOC4zIDE0LjM3NnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzQyLjU2OCAzMDIuNjYzbC0xNjAuMTUtMjc3LjM4IDE0LjM3Ni04LjMgMTYwLjE1IDI3Ny4zOHpNNTIuNSAxMDcuNWgxNi42djE4NUg1Mi41ek0zMzAuOSAxMDcuNWgxNi42djE4NWgtMTYuNnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMjAzLjUyMiAzNjdsLTcuMjUtMTIuNTU4IDEzOS4zNC04MC40NSA3LjI1IDEyLjU1N3oiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzY5LjUgMjk3LjljLTkuNiAxNi43LTMxIDIyLjQtNDcuNyAxMi44LTE2LjctOS42LTIyLjQtMzEtMTIuOC00Ny43IDkuNi0xNi43IDMxLTIyLjQgNDcuNy0xMi44IDE2LjggOS43IDIyLjUgMzEgMTIuOCA0Ny43TTkwLjkgMTM3Yy05LjYgMTYuNy0zMSAyMi40LTQ3LjcgMTIuOC0xNi43LTkuNi0yMi40LTMxLTEyLjgtNDcuNyA5LjYtMTYuNyAzMS0yMi40IDQ3LjctMTIuOCAxNi43IDkuNyAyMi40IDMxIDEyLjggNDcuN00zMC41IDI5Ny45Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi44IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMzA5LjEgMTM3Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi43IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMjAwIDM5NS44Yy0xOS4zIDAtMzQuOS0xNS42LTM0LjktMzQuOSAwLTE5LjMgMTUuNi0zNC45IDM0LjktMzQuOSAxOS4zIDAgMzQuOSAxNS42IDM0LjkgMzQuOSAwIDE5LjItMTUuNiAzNC45LTM0LjkgMzQuOU0yMDAgNzRjLTE5LjMgMC0zNC45LTE1LjYtMzQuOS0zNC45IDAtMTkuMyAxNS42LTM0LjkgMzQuOS0zNC45IDE5LjMgMCAzNC45IDE1LjYgMzQuOSAzNC45IDAgMTkuMy0xNS42IDM0LjktMzQuOSAzNC45Ii8+PC9zdmc+' - ); - - // Sub menu should be labeled GraphiQL IDE - add_submenu_page( - 'graphiql-ide', - __( 'GraphiQL IDE', 'wp-graphql' ), - __( 'GraphiQL IDE', 'wp-graphql' ), - 'manage_options', - 'graphiql-ide', - [ $this, 'render_graphiql_admin_page' ] - ); - } - - /** - * Render the markup to load GraphiQL to. - * - * @return void - */ - public function render_graphiql_admin_page() { - $rendered = apply_filters( 'graphql_render_admin_page', '
Loading ...
' ); - - echo wp_kses_post( $rendered ); - } - - /** - * Enqueues the stylesheet and js for the WPGraphiQL app - * - * @return void - */ - public function enqueue_graphiql() { - if ( null === get_current_screen() || ! strpos( get_current_screen()->id, 'graphiql' ) ) { - return; - } - - $asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/index.asset.php'; - - // Setup some globals that can be used by GraphiQL - // and extending scripts - wp_enqueue_script( - 'wp-graphiql', // Handle. - WPGRAPHQL_PLUGIN_URL . 'build/index.js', - $asset_file['dependencies'], - $asset_file['version'], - true - ); - - $app_asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/app.asset.php'; - - wp_enqueue_script( - 'wp-graphiql-app', // Handle. - WPGRAPHQL_PLUGIN_URL . 'build/app.js', - array_merge( [ 'wp-graphiql' ], $app_asset_file['dependencies'] ), - $app_asset_file['version'], - true - ); - - wp_enqueue_style( - 'wp-graphiql-app', - WPGRAPHQL_PLUGIN_URL . 'build/app.css', - [ 'wp-components' ], - $app_asset_file['version'] - ); - - wp_localize_script( - 'wp-graphiql', - 'wpGraphiQLSettings', - [ - 'nonce' => wp_create_nonce( 'wp_rest' ), - 'graphqlEndpoint' => trailingslashit( site_url() ) . 'index.php?' . graphql_get_endpoint(), - 'avatarUrl' => 0 !== get_current_user_id() ? get_avatar_url( get_current_user_id() ) : null, - 'externalFragments' => apply_filters( 'graphiql_external_fragments', [] ), - ] - ); - - // Extensions looking to extend GraphiQL can hook in here, - // after the window object is established, but before the App renders - do_action( 'enqueue_graphiql_extension' ); - } - - /** - * Enqueue the GraphiQL Auth Switch extension, which adds a button to the GraphiQL toolbar - * that allows the user to switch between the logged in user and the current user - * - * @return void - */ - public function graphiql_enqueue_auth_switch() { - $auth_switch_asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/graphiqlAuthSwitch.asset.php'; - - wp_enqueue_script( - 'wp-graphiql-auth-switch', // Handle. - WPGRAPHQL_PLUGIN_URL . 'build/graphiqlAuthSwitch.js', - array_merge( [ 'wp-graphiql', 'wp-graphiql-app' ], $auth_switch_asset_file['dependencies'] ), - $auth_switch_asset_file['version'], - true - ); - } - - /** - * Enqueue the Query Composer extension, which adds a button to the GraphiQL toolbar - * that allows the user to open the Query Composer and compose a query with a form-based UI - * - * @return void - */ - public function graphiql_enqueue_query_composer() { - - // Enqueue the assets for the Explorer before enqueueing the app, - // so that the JS in the exporter that hooks into the app will be available - // by time the app is enqueued - $composer_asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/graphiqlQueryComposer.asset.php'; - - wp_enqueue_script( - 'wp-graphiql-query-composer', // Handle. - WPGRAPHQL_PLUGIN_URL . 'build/graphiqlQueryComposer.js', - array_merge( [ 'wp-graphiql', 'wp-graphiql-app' ], $composer_asset_file['dependencies'] ), - $composer_asset_file['version'], - true - ); - - wp_enqueue_style( - 'wp-graphiql-query-composer', - WPGRAPHQL_PLUGIN_URL . 'build/graphiqlQueryComposer.css', - [ 'wp-components' ], - $composer_asset_file['version'] - ); - } - - /** - * Enqueue the GraphiQL Fullscreen Toggle extension, which adds a button to the GraphiQL toolbar - * that allows the user to toggle the fullscreen mode - * - * @return void - */ - public function graphiql_enqueue_fullscreen_toggle() { - $fullscreen_toggle_asset_file = include WPGRAPHQL_PLUGIN_DIR . 'build/graphiqlFullscreenToggle.asset.php'; - - wp_enqueue_script( - 'wp-graphiql-fullscreen-toggle', // Handle. - WPGRAPHQL_PLUGIN_URL . 'build/graphiqlFullscreenToggle.js', - array_merge( [ 'wp-graphiql', 'wp-graphiql-app' ], $fullscreen_toggle_asset_file['dependencies'] ), - $fullscreen_toggle_asset_file['version'], - true - ); - - wp_enqueue_style( - 'wp-graphiql-fullscreen-toggle', - WPGRAPHQL_PLUGIN_URL . 'build/graphiqlFullscreenToggle.css', - [ 'wp-components' ], - $fullscreen_toggle_asset_file['version'] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Admin/Settings/Settings.php b/lib/wp-graphql-1.17.0/src/Admin/Settings/Settings.php deleted file mode 100644 index cde654c9..00000000 --- a/lib/wp-graphql-1.17.0/src/Admin/Settings/Settings.php +++ /dev/null @@ -1,281 +0,0 @@ -wp_environment = $this->get_wp_environment(); - $this->settings_api = new SettingsRegistry(); - - add_action( 'admin_menu', [ $this, 'add_options_page' ] ); - add_action( 'init', [ $this, 'register_settings' ] ); - add_action( 'admin_init', [ $this, 'initialize_settings_page' ] ); - add_action( 'admin_enqueue_scripts', [ $this, 'initialize_settings_page_scripts' ] ); - } - - /** - * Return the environment. Default to production. - * - * @return string The environment set using WP_ENVIRONMENT_TYPE. - */ - protected function get_wp_environment() { - if ( function_exists( 'wp_get_environment_type' ) ) { - return wp_get_environment_type(); - } - - return 'production'; - } - - /** - * Add the options page to the WP Admin - * - * @return void - */ - public function add_options_page() { - $graphiql_enabled = get_graphql_setting( 'graphiql_enabled' ); - - if ( 'off' === $graphiql_enabled ) { - add_menu_page( - __( 'WPGraphQL Settings', 'wp-graphql' ), - __( 'GraphQL', 'wp-graphql' ), - 'manage_options', - 'graphql-settings', - [ $this, 'render_settings_page' ], - 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0MDAgNDAwIj48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTcuNDY4IDMwMi42NmwtMTQuMzc2LTguMyAxNjAuMTUtMjc3LjM4IDE0LjM3NiA4LjN6Ii8+PHBhdGggZmlsbD0iI0UxMDA5OCIgZD0iTTM5LjggMjcyLjJoMzIwLjN2MTYuNkgzOS44eiIvPjxwYXRoIGZpbGw9IiNFMTAwOTgiIGQ9Ik0yMDYuMzQ4IDM3NC4wMjZsLTE2MC4yMS05Mi41IDguMy0xNC4zNzYgMTYwLjIxIDkyLjV6TTM0NS41MjIgMTMyLjk0N2wtMTYwLjIxLTkyLjUgOC4zLTE0LjM3NiAxNjAuMjEgOTIuNXoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNNTQuNDgyIDEzMi44ODNsLTguMy0xNC4zNzUgMTYwLjIxLTkyLjUgOC4zIDE0LjM3NnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzQyLjU2OCAzMDIuNjYzbC0xNjAuMTUtMjc3LjM4IDE0LjM3Ni04LjMgMTYwLjE1IDI3Ny4zOHpNNTIuNSAxMDcuNWgxNi42djE4NUg1Mi41ek0zMzAuOSAxMDcuNWgxNi42djE4NWgtMTYuNnoiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMjAzLjUyMiAzNjdsLTcuMjUtMTIuNTU4IDEzOS4zNC04MC40NSA3LjI1IDEyLjU1N3oiLz48cGF0aCBmaWxsPSIjRTEwMDk4IiBkPSJNMzY5LjUgMjk3LjljLTkuNiAxNi43LTMxIDIyLjQtNDcuNyAxMi44LTE2LjctOS42LTIyLjQtMzEtMTIuOC00Ny43IDkuNi0xNi43IDMxLTIyLjQgNDcuNy0xMi44IDE2LjggOS43IDIyLjUgMzEgMTIuOCA0Ny43TTkwLjkgMTM3Yy05LjYgMTYuNy0zMSAyMi40LTQ3LjcgMTIuOC0xNi43LTkuNi0yMi40LTMxLTEyLjgtNDcuNyA5LjYtMTYuNyAzMS0yMi40IDQ3LjctMTIuOCAxNi43IDkuNyAyMi40IDMxIDEyLjggNDcuN00zMC41IDI5Ny45Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi44IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMzA5LjEgMTM3Yy05LjYtMTYuNy0zLjktMzggMTIuOC00Ny43IDE2LjctOS42IDM4LTMuOSA0Ny43IDEyLjggOS42IDE2LjcgMy45IDM4LTEyLjggNDcuNy0xNi43IDkuNi0zOC4xIDMuOS00Ny43LTEyLjhNMjAwIDM5NS44Yy0xOS4zIDAtMzQuOS0xNS42LTM0LjktMzQuOSAwLTE5LjMgMTUuNi0zNC45IDM0LjktMzQuOSAxOS4zIDAgMzQuOSAxNS42IDM0LjkgMzQuOSAwIDE5LjItMTUuNiAzNC45LTM0LjkgMzQuOU0yMDAgNzRjLTE5LjMgMC0zNC45LTE1LjYtMzQuOS0zNC45IDAtMTkuMyAxNS42LTM0LjkgMzQuOS0zNC45IDE5LjMgMCAzNC45IDE1LjYgMzQuOSAzNC45IDAgMTkuMy0xNS42IDM0LjktMzQuOSAzNC45Ii8+PC9zdmc+' - ); - } else { - add_submenu_page( - 'graphiql-ide', - __( 'WPGraphQL Settings', 'wp-graphql' ), - __( 'Settings', 'wp-graphql' ), - 'manage_options', - 'graphql-settings', - [ $this, 'render_settings_page' ] - ); - } - } - - /** - * Registers the initial settings for WPGraphQL - * - * @return void - */ - public function register_settings() { - $this->settings_api->register_section( - 'graphql_general_settings', - [ - 'title' => __( 'WPGraphQL General Settings', 'wp-graphql' ), - ] - ); - - $custom_endpoint = apply_filters( 'graphql_endpoint', null ); - $this->settings_api->register_field( - 'graphql_general_settings', - [ - 'name' => 'graphql_endpoint', - 'label' => __( 'GraphQL Endpoint', 'wp-graphql' ), - 'desc' => sprintf( - // translators: %1$s is the site url, %2$s is the default endpoint - __( 'The endpoint (path) for the GraphQL API on the site. %1$s/%2$s.
Note: Changing the endpoint to something other than "graphql" could have an affect on tooling in the GraphQL ecosystem', 'wp-graphql' ), - site_url(), - get_graphql_setting( 'graphql_endpoint', 'graphql' ) - ), - 'type' => 'text', - 'value' => ! empty( $custom_endpoint ) ? $custom_endpoint : null, - 'default' => ! empty( $custom_endpoint ) ? $custom_endpoint : 'graphql', - 'disabled' => ! empty( $custom_endpoint ), - 'sanitize_callback' => static function ( $value ) { - if ( empty( $value ) ) { - add_settings_error( 'graphql_endpoint', 'required', __( 'The "GraphQL Endpoint" field is required and cannot be blank. The default endpoint is "graphql"', 'wp-graphql' ), 'error' ); - - return 'graphql'; - } - - return $value; - }, - ] - ); - - $this->settings_api->register_fields( - 'graphql_general_settings', - [ - [ - 'name' => 'restrict_endpoint_to_logged_in_users', - 'label' => __( 'Restrict Endpoint to Authenticated Users', 'wp-graphql' ), - 'desc' => __( 'Limit the execution of GraphQL operations to authenticated requests. Non-authenticated requests to the GraphQL endpoint will not execute and will return an error.', 'wp-graphql' ), - 'type' => 'checkbox', - 'default' => 'off', - ], - [ - 'name' => 'batch_queries_enabled', - 'label' => __( 'Enable Batch Queries', 'wp-graphql' ), - 'desc' => __( 'WPGraphQL supports batch queries, or the ability to send multiple GraphQL operations in a single HTTP request. Batch requests are enabled by default.', 'wp-graphql' ), - 'type' => 'checkbox', - 'default' => 'on', - ], - [ - 'name' => 'batch_limit', - 'label' => __( 'Batch Query Limit', 'wp-graphql' ), - 'desc' => __( 'If Batch Queries are enabled, this value sets the max number of batch operations to allow per request. Requests containing more batch operations than allowed will be rejected before execution.', 'wp-graphql' ), - 'type' => 'number', - 'default' => 10, - ], - [ - 'name' => 'query_depth_enabled', - 'label' => __( 'Enable Query Depth Limiting', 'wp-graphql' ), - 'desc' => __( 'Enabling this will limit the depth of queries WPGraphQL will execute using the value of the Max Depth setting.', 'wp-graphql' ), - 'type' => 'checkbox', - 'default' => 'off', - ], - [ - 'name' => 'query_depth_max', - 'label' => __( 'Max Depth to allow for GraphQL Queries', 'wp-graphql' ), - 'desc' => __( 'If Query Depth limiting is enabled, this is the number of levels WPGraphQL will allow. Queries with deeper nesting will be rejected. Must be a positive integer value. Default 10.', 'wp-graphql' ), - 'type' => 'number', - 'default' => 10, - 'sanitize_callback' => static function ( $value ) { - // if the entered value is not a positive integer, default to 10 - if ( ! absint( $value ) ) { - $value = 10; - } - return absint( $value ); - }, - ], - [ - 'name' => 'graphiql_enabled', - 'label' => __( 'Enable GraphiQL IDE', 'wp-graphql' ), - 'desc' => __( 'GraphiQL IDE is a tool for exploring the GraphQL Schema and test GraphQL operations. Uncheck this to disable GraphiQL in the Dashboard.', 'wp-graphql' ), - 'type' => 'checkbox', - 'default' => 'on', - ], - [ - 'name' => 'show_graphiql_link_in_admin_bar', - 'label' => __( 'GraphiQL IDE Admin Bar Link', 'wp-graphql' ), - 'desc' => __( 'Show GraphiQL IDE Link in the WordPress Admin Bar', 'wp-graphql' ), - 'type' => 'checkbox', - 'default' => 'on', - ], - [ - 'name' => 'delete_data_on_deactivate', - 'label' => __( 'Delete Data on Deactivation', 'wp-graphql' ), - 'desc' => __( 'Delete settings and any other data stored by WPGraphQL upon de-activation of the plugin. Un-checking this will keep data after the plugin is de-activated.', 'wp-graphql' ), - 'type' => 'checkbox', - 'default' => 'on', - ], - [ - 'name' => 'debug_mode_enabled', - 'label' => __( 'Enable GraphQL Debug Mode', 'wp-graphql' ), - 'desc' => defined( 'GRAPHQL_DEBUG' ) - // translators: %s is the value of the GRAPHQL_DEBUG constant - ? sprintf( __( 'This setting is disabled. "GRAPHQL_DEBUG" has been set to "%s" with code', 'wp-graphql' ), GRAPHQL_DEBUG ? 'true' : 'false' ) - : __( 'Whether GraphQL requests should execute in "debug" mode. This setting is disabled if GRAPHQL_DEBUG is defined in wp-config.php.
This will provide more information in GraphQL errors but can leak server implementation details so this setting is NOT RECOMMENDED FOR PRODUCTION ENVIRONMENTS.', 'wp-graphql' ), - 'type' => 'checkbox', - 'value' => true === \WPGraphQL::debug() ? 'on' : get_graphql_setting( 'debug_mode_enabled', 'off' ), - 'disabled' => defined( 'GRAPHQL_DEBUG' ), - ], - [ - 'name' => 'tracing_enabled', - 'label' => __( 'Enable GraphQL Tracing', 'wp-graphql' ), - 'desc' => __( 'Adds trace data to the extensions portion of GraphQL responses. This can help identify bottlenecks for specific fields.', 'wp-graphql' ), - 'type' => 'checkbox', - 'default' => 'off', - ], - [ - 'name' => 'tracing_user_role', - 'label' => __( 'Tracing Role', 'wp-graphql' ), - 'desc' => __( 'If Tracing is enabled, this limits it to requests from users with the specified User Role.', 'wp-graphql' ), - 'type' => 'user_role_select', - 'default' => 'administrator', - ], - [ - 'name' => 'query_logs_enabled', - 'label' => __( 'Enable GraphQL Query Logs', 'wp-graphql' ), - 'desc' => __( 'Adds SQL Query logs to the extensions portion of GraphQL responses.
Note: This is a debug tool that can have an impact on performance and is not recommended to have active in production.', 'wp-graphql' ), - 'type' => 'checkbox', - 'default' => 'off', - ], - [ - 'name' => 'query_log_user_role', - 'label' => __( 'Query Log Role', 'wp-graphql' ), - 'desc' => __( 'If Query Logs are enabled, this limits them to requests from users with the specified User Role.', 'wp-graphql' ), - 'type' => 'user_role_select', - 'default' => 'administrator', - ], - [ - 'name' => 'public_introspection_enabled', - 'label' => __( 'Enable Public Introspection', 'wp-graphql' ), - 'desc' => sprintf( - // translators: %s is either empty or a string with a note about debug mode. - __( 'GraphQL Introspection is a feature that allows the GraphQL Schema to be queried. For Production and Staging environments, WPGraphQL will by default limit introspection queries to authenticated requests. Checking this enables Introspection for public requests, regardless of environment. %s ', 'wp-graphql' ), - true === \WPGraphQL::debug() ? '' . __( 'NOTE: This setting is force enabled because GraphQL Debug Mode is enabled. ', 'wp-graphql' ) . '' : '' - ), - 'type' => 'checkbox', - 'default' => ( 'local' === $this->get_wp_environment() || 'development' === $this->get_wp_environment() ) ? 'on' : 'off', - 'value' => true === \WPGraphQL::debug() ? 'on' : get_graphql_setting( 'public_introspection_enabled', 'off' ), - 'disabled' => true === \WPGraphQL::debug(), - ], - ] - ); - - // Action to hook into to register settings - do_action( 'graphql_register_settings', $this ); - } - - /** - * Initialize the settings admin page - * - * @return void - */ - public function initialize_settings_page() { - $this->settings_api->admin_init(); - } - - /** - * Initialize the styles and scripts used on the settings admin page - * - * @param string $hook_suffix The current admin page. - */ - public function initialize_settings_page_scripts( string $hook_suffix ): void { - $this->settings_api->admin_enqueue_scripts( $hook_suffix ); - } - - /** - * Render the settings page in the admin - * - * @return void - */ - public function render_settings_page() { - ?> -
- settings_api->show_navigation(); - $this->settings_api->show_forms(); - ?> -
- - * @link https://tareq.co Tareq Hasan - * - * @package WPGraphQL\Admin\Settings - */ -class SettingsRegistry { - - /** - * Settings sections array - * - * @var array - */ - protected $settings_sections = []; - - /** - * Settings fields array - * - * @var array - */ - protected $settings_fields = []; - - /** - * @return array - */ - public function get_settings_sections() { - return $this->settings_sections; - } - - /** - * @return array - */ - public function get_settings_fields() { - return $this->settings_fields; - } - - /** - * Enqueue scripts and styles - * - * @param string $hook_suffix The current admin page. - * - * @return void - */ - public function admin_enqueue_scripts( string $hook_suffix ) { - if ( 'graphql_page_graphql-settings' !== $hook_suffix ) { - return; - } - - wp_enqueue_style( 'wp-color-picker' ); - wp_enqueue_media(); - wp_enqueue_script( 'wp-color-picker' ); - wp_enqueue_script( 'jquery' ); - - // Action to enqueue scripts on the WPGraphQL Settings page. - do_action( 'graphql_settings_enqueue_scripts' ); - } - - /** - * Set settings sections - * - * @param string $slug Setting Section Slug - * @param array $section setting section config - * - * @return \WPGraphQL\Admin\Settings\SettingsRegistry - */ - public function register_section( string $slug, array $section ) { - $section['id'] = $slug; - $this->settings_sections[ $slug ] = $section; - - return $this; - } - - /** - * Register fields to a section - * - * @param string $section The slug of the section to register a field to - * @param array $fields settings fields array - * - * @return \WPGraphQL\Admin\Settings\SettingsRegistry - */ - public function register_fields( string $section, array $fields ) { - foreach ( $fields as $field ) { - $this->register_field( $section, $field ); - } - - return $this; - } - - /** - * Register a field to a section - * - * @param string $section The slug of the section to register a field to - * @param array $field The config for the field being registered - * - * @return \WPGraphQL\Admin\Settings\SettingsRegistry - */ - public function register_field( string $section, array $field ) { - $defaults = [ - 'name' => '', - 'label' => '', - 'desc' => '', - 'type' => 'text', - ]; - - $field_config = wp_parse_args( $field, $defaults ); - - // Get the field name before the filter is passed. - $field_name = $field_config['name']; - - // Unset it, as we don't want it to be filterable - unset( $field_config['name'] ); - - /** - * Filter the setting field config - * - * @param array $field_config The field config for the setting - * @param string $field_name The name of the field (unfilterable in the config) - * @param string $section The slug of the section the field is registered to - */ - $field = apply_filters( 'graphql_setting_field_config', $field_config, $field_name, $section ); - - // Add the field name back after the filter has been applied - $field['name'] = $field_name; - - // Add the field to the section - $this->settings_fields[ $section ][] = $field; - - return $this; - } - - /** - * Initialize and registers the settings sections and fields to WordPress - * - * Usually this should be called at `admin_init` hook. - * - * This function gets the initiated settings sections and fields. Then - * registers them to WordPress and ready for use. - * - * @return void - */ - public function admin_init() { - // Action that fires when settings are being initialized - do_action( 'graphql_init_settings', $this ); - - /** - * Filter the settings sections - * - * @param array $setting_sections The registered settings sections - */ - $setting_sections = apply_filters( 'graphql_settings_sections', $this->settings_sections ); - - foreach ( $setting_sections as $id => $section ) { - if ( false === get_option( $id ) ) { - add_option( $id ); - } - - if ( isset( $section['desc'] ) && ! empty( $section['desc'] ) ) { - $section['desc'] = '
' . $section['desc'] . '
'; - $callback = static function () use ( $section ) { - echo wp_kses( str_replace( '"', '\"', $section['desc'] ), Utils::get_allowed_wp_kses_html() ); - }; - } elseif ( isset( $section['callback'] ) ) { - $callback = $section['callback']; - } else { - $callback = null; - } - - add_settings_section( $id, $section['title'], $callback, $id ); - } - - //register settings fields - foreach ( $this->settings_fields as $section => $field ) { - foreach ( $field as $option ) { - $name = $option['name']; - $type = isset( $option['type'] ) ? $option['type'] : 'text'; - $label = isset( $option['label'] ) ? $option['label'] : ''; - $callback = isset( $option['callback'] ) ? $option['callback'] : [ - $this, - 'callback_' . $type, - ]; - - $args = [ - 'id' => $name, - 'class' => isset( $option['class'] ) ? $option['class'] : $name, - 'label_for' => "{$section}[{$name}]", - 'desc' => isset( $option['desc'] ) ? $option['desc'] : '', - 'name' => $label, - 'section' => $section, - 'size' => isset( $option['size'] ) ? $option['size'] : null, - 'options' => isset( $option['options'] ) ? $option['options'] : '', - 'std' => isset( $option['default'] ) ? $option['default'] : '', - 'sanitize_callback' => isset( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : '', - 'type' => $type, - 'placeholder' => isset( $option['placeholder'] ) ? $option['placeholder'] : '', - 'min' => isset( $option['min'] ) ? $option['min'] : '', - 'max' => isset( $option['max'] ) ? $option['max'] : '', - 'step' => isset( $option['step'] ) ? $option['step'] : '', - 'disabled' => isset( $option['disabled'] ) ? (bool) $option['disabled'] : false, - 'value' => isset( $option['value'] ) ? $option['value'] : null, - ]; - - add_settings_field( "{$section}[{$name}]", $label, $callback, $section, $section, $args ); - } - } - - // creates our settings in the options table - foreach ( $this->settings_sections as $id => $section ) { - register_setting( $id, $id, [ $this, 'sanitize_options' ] ); - } - } - - /** - * Get field description for display - * - * @param array $args settings field args - * - * @return string - */ - public function get_field_description( array $args ): string { - if ( ! empty( $args['desc'] ) ) { - $desc = sprintf( '

%s

', $args['desc'] ); - } else { - $desc = ''; - } - - return $desc; - } - - /** - * Displays a text field for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_text( array $args ) { - $value = isset( $args['value'] ) && ! empty( $args['value'] ) ? esc_attr( $args['value'] ) : esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); - $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; - $type = isset( $args['type'] ) ? $args['type'] : 'text'; - $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"'; - $disabled = isset( $args['disabled'] ) && true === $args['disabled'] ? 'disabled' : null; - $html = sprintf( '', $type, $size, $args['section'], $args['id'], $value, $placeholder, $disabled ); - $html .= $this->get_field_description( $args ); - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a url field for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_url( array $args ) { - $this->callback_text( $args ); - } - - /** - * Displays a number field for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_number( array $args ) { - $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); - $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; - $type = isset( $args['type'] ) ? $args['type'] : 'number'; - $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"'; - $min = ( '' === $args['min'] ) ? '' : ' min="' . $args['min'] . '"'; - $max = ( '' === $args['max'] ) ? '' : ' max="' . $args['max'] . '"'; - $step = ( '' === $args['step'] ) ? '' : ' step="' . $args['step'] . '"'; - - $html = sprintf( '', $type, $size, $args['section'], $args['id'], $value, $placeholder, $min, $max, $step ); - $html .= $this->get_field_description( $args ); - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a checkbox for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_checkbox( array $args ) { - $value = isset( $args['value'] ) && ! empty( $args['value'] ) ? esc_attr( $args['value'] ) : esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); - $disabled = isset( $args['disabled'] ) && true === $args['disabled'] ? 'disabled' : null; - - $html = '
'; - $html .= sprintf( '', $args['desc'] ); - $html .= '
'; - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a multicheckbox for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_multicheck( array $args ) { - $value = $this->get_option( $args['id'], $args['section'], $args['std'] ); - $html = '
'; - $html .= sprintf( '', $args['section'], $args['id'] ); - foreach ( $args['options'] as $key => $label ) { - $checked = isset( $value[ $key ] ) ? $value[ $key ] : '0'; - $html .= sprintf( '
', $label ); - } - - $html .= $this->get_field_description( $args ); - $html .= '
'; - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a radio button for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_radio( array $args ) { - $value = $this->get_option( $args['id'], $args['section'], $args['std'] ); - $html = '
'; - - foreach ( $args['options'] as $key => $label ) { - $html .= sprintf( '
', $label ); - } - - $html .= $this->get_field_description( $args ); - $html .= '
'; - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a selectbox for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_select( array $args ) { - $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); - $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; - $html = sprintf( '' ); - $html .= $this->get_field_description( $args ); - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a textarea for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_textarea( array $args ) { - $value = esc_textarea( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); - $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; - $placeholder = empty( $args['placeholder'] ) ? '' : ' placeholder="' . $args['placeholder'] . '"'; - - $html = sprintf( '', $size, $args['section'], $args['id'], $placeholder, $value ); - $html .= $this->get_field_description( $args ); - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays the html for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_html( array $args ) { - echo wp_kses( $this->get_field_description( $args ), Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a rich text textarea for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_wysiwyg( array $args ) { - $value = $this->get_option( $args['id'], $args['section'], $args['std'] ); - $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : '500px'; - - echo '
'; - - $editor_settings = [ - 'teeny' => true, - 'textarea_name' => $args['section'] . '[' . $args['id'] . ']', - 'textarea_rows' => 10, - ]; - - if ( isset( $args['options'] ) && is_array( $args['options'] ) ) { - $editor_settings = array_merge( $editor_settings, $args['options'] ); - } - - wp_editor( $value, $args['section'] . '-' . $args['id'], $editor_settings ); - - echo '
'; - - echo wp_kses( $this->get_field_description( $args ), Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a file upload field for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_file( array $args ) { - $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); - $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; - $label = isset( $args['options']['button_label'] ) ? $args['options']['button_label'] : __( 'Choose File', 'wp-graphql' ); - - $html = sprintf( '', $size, $args['section'], $args['id'], $value ); - $html .= ''; - $html .= $this->get_field_description( $args ); - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a password field for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_password( array $args ) { - $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); - $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; - - $html = sprintf( '', $size, $args['section'], $args['id'], $value ); - $html .= $this->get_field_description( $args ); - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Displays a color picker field for a settings field - * - * @param array $args settings field args - * - * @return void - */ - public function callback_color( $args ) { - $value = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); - $size = isset( $args['size'] ) && ! is_null( $args['size'] ) ? $args['size'] : 'regular'; - - $html = sprintf( '', $size, $args['section'], $args['id'], $value, $args['std'] ); - $html .= $this->get_field_description( $args ); - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - - /** - * Displays a select box for creating the pages select box - * - * @param array $args settings field args - * - * @return void - */ - public function callback_pages( array $args ) { - $dropdown_args = array_merge( - [ - 'selected' => esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ), - 'name' => $args['section'] . '[' . $args['id'] . ']', - 'id' => $args['section'] . '[' . $args['id'] . ']', - 'echo' => 0, - ], - $args - ); - - $clean_args = []; - foreach ( $dropdown_args as $key => $arg ) { - $clean_args[ $key ] = wp_kses( $arg, Utils::get_allowed_wp_kses_html() ); - } - - // Ignore phpstan as this is providing an array as expected - // @phpstan-ignore-next-line - echo wp_dropdown_pages( $clean_args ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped - } - - /** - * Displays a select box for user roles - * - * @param array $args settings field args - * - * @return void - */ - public function callback_user_role_select( array $args ) { - $selected = esc_attr( $this->get_option( $args['id'], $args['section'], $args['std'] ) ); - - if ( empty( $selected ) ) { - $selected = isset( $args['default'] ) ? $args['default'] : null; - } - - $name = $args['section'] . '[' . $args['id'] . ']'; - $id = $args['section'] . '[' . $args['id'] . ']'; - - echo ''; - echo wp_kses( $this->get_field_description( $args ), Utils::get_allowed_wp_kses_html() ); - } - - /** - * Sanitize callback for Settings API - * - * @param array $options - * - * @return mixed - */ - public function sanitize_options( array $options ) { - if ( ! $options ) { - return $options; - } - - foreach ( $options as $option_slug => $option_value ) { - $sanitize_callback = $this->get_sanitize_callback( $option_slug ); - - // If callback is set, call it - if ( $sanitize_callback ) { - $options[ $option_slug ] = call_user_func( $sanitize_callback, $option_value ); - continue; - } - } - - return $options; - } - - /** - * Get sanitization callback for given option slug - * - * @param string $slug option slug - * - * @return mixed string or bool false - */ - public function get_sanitize_callback( $slug = '' ) { - if ( empty( $slug ) ) { - return false; - } - - // Iterate over registered fields and see if we can find proper callback - foreach ( $this->settings_fields as $options ) { - foreach ( $options as $option ) { - if ( $slug !== $option['name'] ) { - continue; - } - - // Return the callback name - return isset( $option['sanitize_callback'] ) && is_callable( $option['sanitize_callback'] ) ? $option['sanitize_callback'] : false; - } - } - - return false; - } - - /** - * Get the value of a settings field - * - * @param string $option settings field name - * @param string $section the section name this field belongs to - * @param string $default_value default text if it's not found - * - * @return string - */ - public function get_option( $option, $section, $default_value = '' ) { - $options = get_option( $section ); - - if ( isset( $options[ $option ] ) ) { - return $options[ $option ]; - } - - return $default_value; - } - - /** - * Show navigations as tab - * - * Shows all the settings section labels as tab - * - * @return void - */ - public function show_navigation() { - $html = ''; - - echo wp_kses( $html, Utils::get_allowed_wp_kses_html() ); - } - - /** - * Show the section settings forms - * - * This function displays every sections in a different form - * - * @return void - */ - public function show_forms() { - ?> -
- settings_sections as $id => $form ) { ?> - - -
- script(); - } - - /** - * Tabbable JavaScript codes & Initiate Color Picker - * - * This code uses localstorage for displaying active tabs - * - * @return void - */ - public function script() { - ?> - - _style_fix(); - } - - /** - * Add styles to adjust some settings - * - * @return void - */ - public function _style_fix() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore - global $wp_version; - - if ( version_compare( $wp_version, '3.8', '<=' ) ) : - ?> - - new CommentAuthorLoader( $this ), - 'comment' => new CommentLoader( $this ), - 'enqueued_script' => new EnqueuedScriptLoader( $this ), - 'enqueued_stylesheet' => new EnqueuedStylesheetLoader( $this ), - 'plugin' => new PluginLoader( $this ), - 'nav_menu_item' => new PostObjectLoader( $this ), - 'post' => new PostObjectLoader( $this ), - 'post_type' => new PostTypeLoader( $this ), - 'taxonomy' => new TaxonomyLoader( $this ), - 'term' => new TermObjectLoader( $this ), - 'theme' => new ThemeLoader( $this ), - 'user' => new UserLoader( $this ), - 'user_role' => new UserRoleLoader( $this ), - ]; - - /** - * This filters the data loaders, allowing for additional loaders to be - * added to the AppContext or for existing loaders to be replaced if - * needed. - * - * @params array $loaders The loaders accessible in the AppContext - * @params AppContext $this The AppContext - */ - $this->loaders = apply_filters( 'graphql_data_loaders', $loaders, $this ); - - /** - * This sets up the NodeResolver to allow nodes to be resolved by URI - * - * @param \WPGraphQL\AppContext $app_context The AppContext instance - */ - $this->node_resolver = new NodeResolver( $this ); - - /** - * This filters the config for the AppContext. - * - * This can be used to store additional context config, which is available to resolvers - * throughout the resolution of a GraphQL request. - * - * @params array $config The config array of the AppContext object - */ - $this->config = apply_filters( 'graphql_app_context_config', $this->config ); - } - - /** - * Retrieves loader assigned to $key - * - * @param string $key The name of the loader to get - * - * @return mixed - * - * @deprecated Use get_loader instead. - */ - public function getLoader( $key ) { - _deprecated_function( __METHOD__, '0.8.4', self::class . '::get_loader()' ); - return $this->get_loader( $key ); - } - - /** - * Retrieves loader assigned to $key - * - * @param string $key The name of the loader to get - * - * @return mixed - */ - public function get_loader( $key ) { - if ( ! array_key_exists( $key, $this->loaders ) ) { - // translators: %s is the key of the loader that was not found. - throw new UserError( esc_html( sprintf( __( 'No loader assigned to the key %s', 'wp-graphql' ), $key ) ) ); - } - - return $this->loaders[ $key ]; - } - - /** - * Returns the $args for the connection the field is a part of - * - * @deprecated use get_connection_args() instead - * @return array|mixed - */ - public function getConnectionArgs() { - _deprecated_function( __METHOD__, '0.8.4', self::class . '::get_connection_args()' ); - return $this->get_connection_args(); - } - - /** - * Returns the $args for the connection the field is a part of - * - * @return array|mixed - */ - public function get_connection_args() { - return isset( $this->currentConnection ) && isset( $this->connectionArgs[ $this->currentConnection ] ) ? $this->connectionArgs[ $this->currentConnection ] : []; - } - - /** - * Returns the current connection - * - * @return mixed|null|String - */ - public function get_current_connection() { - return isset( $this->currentConnection ) ? $this->currentConnection : null; - } - - /** - * @return mixed|null|String - * @deprecated use get_current_connection instead. - */ - public function getCurrentConnection() { - return $this->get_current_connection(); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Connection/Comments.php b/lib/wp-graphql-1.17.0/src/Connection/Comments.php deleted file mode 100644 index acb0351b..00000000 --- a/lib/wp-graphql-1.17.0/src/Connection/Comments.php +++ /dev/null @@ -1,38 +0,0 @@ - 1, - * 'comment_author' => 'admin', - * 'comment_author_email' => 'admin@admin.com', - * 'comment_author_url' => 'http://', - * 'comment_content' => 'content here', - * 'comment_type' => '', - * 'comment_parent' => 0, - * 'comment_date' => $time, - * 'comment_approved' => 1, - */ - - $user = self::get_comment_author( $input['authorEmail'] ?? null ); - - if ( false !== $user ) { - $output_args['user_id'] = $user->ID; - - $input['author'] = ! empty( $input['author'] ) ? $input['author'] : $user->display_name; - $input['authorEmail'] = ! empty( $input['authorEmail'] ) ? $input['authorEmail'] : $user->user_email; - $input['authorUrl'] = ! empty( $input['authorUrl'] ) ? $input['authorUrl'] : $user->user_url; - } - - if ( empty( $input['author'] ) ) { - if ( ! $update ) { - throw new UserError( esc_html__( 'Comment must include an authorName.', 'wp-graphql' ) ); - } - } else { - $output_args['comment_author'] = $input['author']; - } - - if ( ! empty( $input['authorEmail'] ) ) { - if ( false === is_email( apply_filters( 'pre_user_email', $input['authorEmail'] ) ) ) { - throw new UserError( esc_html__( 'The email address you are trying to use is invalid', 'wp-graphql' ) ); - } - $output_args['comment_author_email'] = $input['authorEmail']; - } - - if ( ! empty( $input['authorUrl'] ) ) { - $output_args['comment_author_url'] = $input['authorUrl']; - } - - if ( ! empty( $input['commentOn'] ) ) { - $output_args['comment_post_ID'] = $input['commentOn']; - } - - if ( ! empty( $input['date'] ) && false !== strtotime( $input['date'] ) ) { - $output_args['comment_date'] = gmdate( 'Y-m-d H:i:s', strtotime( $input['date'] ) ); - } - - if ( ! empty( $input['content'] ) ) { - $output_args['comment_content'] = $input['content']; - } - - if ( ! empty( $input['parent'] ) ) { - $output_args['comment_parent'] = Utils::get_database_id_from_id( $input['parent'] ); - } - - if ( ! empty( $input['type'] ) ) { - $output_args['comment_type'] = $input['type']; - } - - if ( ! empty( $input['status'] ) ) { - $output_args['comment_approved'] = $input['status']; - } - - // Fallback to deprecated `approved` input. - if ( empty( $output_args['comment_approved'] ) && isset( $input['approved'] ) ) { - $output_args['comment_approved'] = $input['approved']; - } - - /** - * Filter the $insert_post_args - * - * @param array $output_args The array of $input_post_args that will be passed to wp_new_comment - * @param array $input The data that was entered as input for the mutation - * @param string $mutation_type The type of mutation being performed ( create, edit, etc ) - */ - $output_args = apply_filters( 'graphql_comment_insert_post_args', $output_args, $input, $mutation_name ); - - return $output_args; - } - - /** - * This updates commentmeta. - * - * @param int $comment_id The ID of the postObject the comment is connected to - * @param array $input The input for the mutation - * @param string $mutation_name The name of the mutation ( ex: create, update, delete ) - * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers - * - * @return void - */ - public static function update_additional_comment_data( int $comment_id, array $input, string $mutation_name, AppContext $context, ResolveInfo $info ) { - - /** - * @todo: should account for authentication - */ - $intended_comment_status = 0; - $default_comment_status = 0; - - do_action( 'graphql_comment_object_mutation_update_additional_data', $comment_id, $input, $mutation_name, $context, $info, $intended_comment_status, $default_comment_status ); - } - - /** - * Gets the user object for the comment author. - * - * @param ?string $author_email The authorEmail provided to the mutation input. - * - * @return \WP_User|false - */ - protected static function get_comment_author( string $author_email = null ) { - $user = wp_get_current_user(); - - // Fail if no logged in user. - if ( 0 === $user->ID ) { - return false; - } - - // Return the current user if they can only handle their own comments or if there's no specified author. - if ( empty( $author_email ) || ! $user->has_cap( 'moderate_comments' ) ) { - return $user; - } - - $author = get_user_by( 'email', $author_email ); - - return ! empty( $author->ID ) ? $author : false; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Config.php b/lib/wp-graphql-1.17.0/src/Data/Config.php deleted file mode 100644 index 978a2964..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Config.php +++ /dev/null @@ -1,477 +0,0 @@ -get( 'suppress_filters' ) ) { - $query->set( 'suppress_filters', 0 ); - } - - if ( ! $query->get( 'suppress_filters' ) ) { - - /** - * Filters the WHERE clause of the query. - * - * Specifically for manipulating paging queries. - ** - * - * @param string $where The WHERE clause of the query. - * @param \WPGraphQL\Data\WP_User_Query $query The WP_User_Query instance (passed by reference). - */ - $query->query_where = apply_filters_ref_array( - 'graphql_users_where', - [ - $query->query_where, - &$query, - ] - ); - - /** - * Filters the ORDER BY clause of the query. - * - * @param string $orderby The ORDER BY clause of the query. - * @param \WPGraphQL\Data\WP_User_Query $query The WP_User_Query instance (passed by reference). - */ - $query->query_orderby = apply_filters_ref_array( - 'graphql_users_orderby', - [ - $query->query_orderby, - &$query, - ] - ); - } - - return $query; - } - ); - - /** - * Filter the WP_User_Query to support cursor based pagination where a user ID can be used - * as a point of comparison when slicing the results to return. - */ - add_filter( - 'graphql_users_where', - [ - $this, - 'graphql_wp_user_query_cursor_pagination_support', - ], - 10, - 2 - ); - - /** - * Filter WP_User_Query order by add some stability to meta query ordering - */ - add_filter( - 'graphql_users_orderby', - [ - $this, - 'graphql_wp_user_query_cursor_pagination_stability', - ], - 10, - 2 - ); - } - - /** - * When posts are ordered by fields that have duplicate values, we need to consider - * another field to "stabilize" the query order. We use IDs as they're always unique. - * - * This allows for posts with the same title or same date or same meta value to exist - * and for their cursors to properly go forward/backward to the proper place in the database. - * - * @param string $orderby The ORDER BY clause of the query. - * @param \WP_Query $query The WP_Query instance executing. - * - * @return string - */ - public function graphql_wp_query_cursor_pagination_stability( string $orderby, WP_Query $query ) { - // Bail early if it's not a GraphQL Request. - if ( true !== is_graphql_request() ) { - return $orderby; - } - - /** - * If pre-filter hooked, return $pre_orderby. - * - * @param null|string $pre_orderby The pre-filtered ORDER BY clause of the query. - * @param string $orderby The ORDER BY clause of the query. - * @param \WP_Query $query The WP_Query instance (passed by reference). - * - * @return null|string - */ - $pre_orderby = apply_filters( 'graphql_pre_wp_query_cursor_pagination_stability', null, $orderby, $query ); - if ( null !== $pre_orderby ) { - return $pre_orderby; - } - - // Bail early if disabled by connection. - if ( isset( $query->query_vars['graphql_apply_cursor_pagination_orderby'] ) - && false === $query->query_vars['graphql_apply_cursor_pagination_orderby'] ) { - return $orderby; - } - - // Bail early if the cursor "graphql_cursor_compare" arg is not in the query, - if ( ! isset( $query->query_vars['graphql_cursor_compare'] ) ) { - return $orderby; - } - - // Check the cursor compare order - $order = '>' === $query->query_vars['graphql_cursor_compare'] ? 'ASC' : 'DESC'; - - // Get Cursor ID key. - $cursor = new PostObjectCursor( $query->query_vars ); - $key = $cursor->get_cursor_id_key(); - - // If there is a cursor compare in the arguments, use it as the stablizer for cursors. - return "{$orderby}, {$key} {$order}"; - } - - /** - * This filters the WPQuery 'where' $args, enforcing the query to return results before or - * after the referenced cursor - * - * @param string $where The WHERE clause of the query. - * @param \WP_Query $query The WP_Query instance (passed by reference). - * - * @return string - */ - public function graphql_wp_query_cursor_pagination_support( string $where, WP_Query $query ) { - // Bail early if it's not a GraphQL Request. - if ( true !== is_graphql_request() ) { - return $where; - } - - /** - * If pre-filter hooked, return $pre_where. - * - * @param null|string $pre_where The pre-filtered WHERE clause of the query. - * @param string $where The WHERE clause of the query. - * @param \WP_Query $query The WP_Query instance (passed by reference). - * - * @return null|string - */ - $pre_where = apply_filters( 'graphql_pre_wp_query_cursor_pagination_support', null, $where, $query ); - if ( null !== $pre_where ) { - return $pre_where; - } - - // Bail early if disabled by connection. - if ( isset( $query->query_vars['graphql_apply_cursor_pagination_where'] ) - && false === $query->query_vars['graphql_apply_cursor_pagination_where'] ) { - return $where; - } - - // Apply the after cursor, moving forward through results - if ( ! empty( $query->query_vars['graphql_after_cursor'] ) ) { - $after_cursor = new PostObjectCursor( $query->query_vars, 'after' ); - $where .= $after_cursor->get_where(); - } - - // Apply the after cursor, moving backward through results. - if ( ! empty( $query->query_vars['graphql_before_cursor'] ) ) { - $before_cursor = new PostObjectCursor( $query->query_vars, 'before' ); - $where .= $before_cursor->get_where(); - } - - return $where; - } - - /** - * When users are ordered by a meta query the order might be random when - * the meta values have same values multiple times. This filter adds a - * secondary ordering by the post ID which forces stable order in such cases. - * - * @param string $orderby The ORDER BY clause of the query. - * - * @return string - */ - public function graphql_wp_user_query_cursor_pagination_stability( $orderby, \WP_User_Query $query ) { - - // Bail early if it's not a GraphQL Request. - if ( true !== is_graphql_request() ) { - return $orderby; - } - - /** - * If pre-filter hooked, return $pre_orderby. - * - * @param null|string $pre_orderby The pre-filtered ORDER BY clause of the query. - * @param string $orderby The ORDER BY clause of the query. - * @param \WP_User_Query $query The WP_User_Query instance (passed by reference). - * - * @return null|string - */ - $pre_orderby = apply_filters( 'graphql_pre_wp_user_query_cursor_pagination_stability', null, $orderby, $query ); - if ( null !== $pre_orderby ) { - return $pre_orderby; - } - - // Bail early if disabled by connection. - if ( isset( $query->query_vars['graphql_apply_cursor_pagination_orderby'] ) - && false === $query->query_vars['graphql_apply_cursor_pagination_orderby'] ) { - return $orderby; - } - - // Bail early if the cursor "graphql_cursor_compare" arg is not in the query, - if ( ! isset( $query->query_vars['graphql_cursor_compare'] ) ) { - return $orderby; - } - - // Check the cursor compare order - $order = '>' === $query->query_vars['graphql_cursor_compare'] ? 'ASC' : 'DESC'; - - // Get Cursor ID key. - $cursor = new UserCursor( $query->query_vars ); - $key = $cursor->get_cursor_id_key(); - - return "{$orderby}, {$key} {$order}"; - } - - /** - * This filters the WP_User_Query 'where' $args, enforcing the query to return results before or - * after the referenced cursor - * - * @param string $where The WHERE clause of the query. - * @param \WP_User_Query $query The WP_User_Query instance (passed by reference). - * - * @return string - */ - public function graphql_wp_user_query_cursor_pagination_support( $where, \WP_User_Query $query ) { - - // Bail early if it's not a GraphQL Request. - if ( true !== is_graphql_request() ) { - return $where; - } - - /** - * If pre-filter hooked, return $pre_where. - * - * @param null|string $pre_where The pre-filtered WHERE clause of the query. - * @param string $where The WHERE clause of the query. - * @param \WP_User_Query $query The WP_Query instance (passed by reference). - * - * @return null|string - */ - $pre_where = apply_filters( 'graphql_pre_wp_user_query_cursor_pagination_support', null, $where, $query ); - if ( null !== $pre_where ) { - return $pre_where; - } - - // Bail early if disabled by connection. - if ( isset( $query->query_vars['graphql_apply_cursor_pagination_where'] ) - && false === $query->query_vars['graphql_apply_cursor_pagination_where'] ) { - return $where; - } - - // Apply the after cursor. - if ( ! empty( $query->query_vars['graphql_after_cursor'] ) ) { - $after_cursor = new UserCursor( $query->query_vars, 'after' ); - $where = $where . $after_cursor->get_where(); - } - - // Apply the after cursor. - if ( ! empty( $query->query_vars['graphql_before_cursor'] ) ) { - $before_cursor = new UserCursor( $query->query_vars, 'before' ); - $where = $where . $before_cursor->get_where(); - } - - return $where; - } - - /** - * This filters the term_clauses in the WP_Term_Query to support cursor based pagination, where - * we can move forward or backward from a particular record, instead of typical offset - * pagination which can be much more expensive and less accurate. - * - * @param array $pieces Terms query SQL clauses. - * @param array $taxonomies An array of taxonomies. - * @param array $args An array of terms query arguments. - * - * @return array $pieces - */ - public function graphql_wp_term_query_cursor_pagination_support( array $pieces, array $taxonomies, array $args ) { - - // Bail early if it's not a GraphQL Request. - if ( true !== is_graphql_request() ) { - return $pieces; - } - - /** - * If pre-filter hooked, return $pre_pieces. - * - * @param null|array $pre_pieces The pre-filtered term query SQL clauses. - * @param array $pieces Terms query SQL clauses. - * @param array $taxonomies An array of taxonomies. - * @param array $args An array of terms query arguments. - * - * @return null|array - */ - $pre_pieces = apply_filters( 'graphql_pre_wp_term_query_cursor_pagination_support', null, $pieces, $taxonomies, $args ); - if ( null !== $pre_pieces ) { - return $pre_pieces; - } - - // Bail early if disabled by connection. - if ( isset( $args['graphql_apply_cursor_pagination_where'] ) - && false === $args['graphql_apply_cursor_pagination_where'] ) { - return $pieces; - } - - // Bail early if the cursor "graphql_cursor_compare" arg is not in the query, - if ( ! isset( $args['graphql_cursor_compare'] ) ) { - return $pieces; - } - - // Determine the limit for the query - if ( isset( $args['number'] ) && absint( $args['number'] ) ) { - $pieces['limits'] = sprintf( ' LIMIT 0, %d', absint( $args['number'] ) ); - } - - // Apply the after cursor. - if ( ! empty( $args['graphql_after_cursor'] ) ) { - $after_cursor = new TermObjectCursor( $args, 'after' ); - $pieces['where'] = $pieces['where'] . $after_cursor->get_where(); - } - - // Apply the before cursor. - if ( ! empty( $args['graphql_before_cursor'] ) ) { - $before_cursor = new TermObjectCursor( $args, 'before' ); - $pieces['where'] = $pieces['where'] . $before_cursor->get_where(); - } - - return $pieces; - } - - /** - * This returns a modified version of the $pieces of the comment query clauses if the request - * is a GraphQL Request and before or after cursors are passed to the query - * - * @param array $pieces A compacted array of comment query clauses. - * @param \WP_Comment_Query $query Current instance of WP_Comment_Query, passed by reference. - * - * @return array $pieces - */ - public function graphql_wp_comments_query_cursor_pagination_support( array $pieces, WP_Comment_Query $query ) { - - // Bail early if it's not a GraphQL Request. - if ( true !== is_graphql_request() ) { - return $pieces; - } - - /** - * If pre-filter hooked, return $pre_pieces. - * - * @param null|array $pre_pieces The pre-filtered comment query clauses. - * @param array $pieces A compacted array of comment query clauses. - * @param \WP_Comment_Query $query Current instance of WP_Comment_Query, passed by reference. - * - * @return null|array - */ - $pre_pieces = apply_filters( 'graphql_pre_wp_comments_query_cursor_pagination_support', null, $pieces, $query ); - if ( null !== $pre_pieces ) { - return $pre_pieces; - } - - // Bail early if disabled by connection. - if ( isset( $query->query_vars['graphql_apply_cursor_pagination_where'] ) - && false === $query->query_vars['graphql_apply_cursor_pagination_where'] ) { - return $pieces; - } - - // Apply the after cursor, moving forward through results. - if ( ! empty( $query->query_vars['graphql_after_cursor'] ) ) { - $after_cursor = new CommentObjectCursor( $query->query_vars, 'after' ); - $pieces['where'] .= $after_cursor->get_where(); - } - - // Apply the after cursor, moving backward through results. - if ( ! empty( $query->query_vars['graphql_before_cursor'] ) ) { - $before_cursor = new CommentObjectCursor( $query->query_vars, 'before' ); - $pieces['where'] .= $before_cursor->get_where(); - } - - return $pieces; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/AbstractConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/AbstractConnectionResolver.php deleted file mode 100644 index fa6bfb25..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/AbstractConnectionResolver.php +++ /dev/null @@ -1,1030 +0,0 @@ -query_args ); - * return new WP_Comment_Query( $this->query_args ); - * return new WP_Term_Query( $this->query_args ); - * - * Whatever it is will be passed through filters so that fields throughout - * have context from what was queried and can make adjustments as needed, such - * as exposing `totalCount` in pageInfo, etc. - * - * @var mixed - */ - protected $query; - - /** - * @var array - */ - protected $items; - - /** - * @var array - */ - protected $ids; - - /** - * @var array - */ - protected $nodes; - - /** - * @var array - */ - protected $edges; - - /** - * @var int - */ - protected $query_amount; - - /** - * ConnectionResolver constructor. - * - * @param mixed $source source passed down from the resolve tree - * @param array $args array of arguments input in the field as part of the GraphQL - * query - * @param \WPGraphQL\AppContext $context Object containing app context that gets passed down the resolve - * tree - * @param \GraphQL\Type\Definition\ResolveInfo $info Info about fields passed down the resolve tree - * - * @throws \Exception - */ - public function __construct( $source, array $args, AppContext $context, ResolveInfo $info ) { - - // Bail if the Post->ID is empty, as that indicates a private post. - if ( $source instanceof Post && empty( $source->ID ) ) { - $this->should_execute = false; - } - - /** - * Set the source (the root object) for the resolver - */ - $this->source = $source; - - /** - * Set the context of the resolver - */ - $this->context = $context; - - /** - * Set the resolveInfo for the resolver - */ - $this->info = $info; - - /** - * Get the loader for the Connection - */ - $this->loader = $this->getLoader(); - - /** - * Set the args for the resolver - */ - $this->args = $args; - - /** - * - * Filters the GraphQL args before they are used in get_query_args(). - * - * @param array $args The GraphQL args passed to the resolver. - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the ConnectionResolver. - * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. - * - * @since 1.11.0 - */ - $this->args = apply_filters( 'graphql_connection_args', $this->get_args(), $this, $args ); - - /** - * Determine the query amount for the resolver. - * - * This is the amount of items to query from the database. We determine this by - * determining how many items were asked for (first/last), then compare with the - * max amount allowed to query (default is 100), and then we fetch 1 more than - * that amount, so we know whether hasNextPage/hasPreviousPage should be true. - * - * If there are more items than were asked for, then there's another page. - */ - $this->query_amount = $this->get_query_amount(); - - /** - * Get the Query Args. This accepts the input args and maps it to how it should be - * used in the WP_Query - * - * Filters the args - * - * @param array $query_args The query args to be used with the executable query to get data. - * This should take in the GraphQL args and return args for use in fetching the data. - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the ConnectionResolver - * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. - */ - $this->query_args = apply_filters( 'graphql_connection_query_args', $this->get_query_args(), $this, $args ); - } - - /** - * Returns the source of the connection - * - * @return mixed - */ - public function getSource() { - return $this->source; - } - - /** - * Get the loader name - * - * @return \WPGraphQL\Data\Loader\AbstractDataLoader - * @throws \Exception - */ - protected function getLoader() { - $name = $this->get_loader_name(); - if ( empty( $name ) || ! is_string( $name ) ) { - throw new Exception( esc_html__( 'The Connection Resolver needs to define a loader name', 'wp-graphql' ) ); - } - - return $this->context->get_loader( $name ); - } - - /** - * Returns the $args passed to the connection - * - * @deprecated Deprecated since v1.11.0 in favor of $this->get_args(); - * - * @codeCoverageIgnore - */ - public function getArgs(): array { - _deprecated_function( __METHOD__, '1.11.0', static::class . '::get_args()' ); - return $this->get_args(); - } - - /** - * Returns the $args passed to the connection. - * - * Useful for modifying the $args before they are passed to $this->get_query_args(). - * - * @return array - */ - public function get_args(): array { - return $this->args; - } - - /** - * Returns the AppContext of the connection - * - * @return \WPGraphQL\AppContext - */ - public function getContext(): AppContext { - return $this->context; - } - - /** - * Returns the ResolveInfo of the connection - * - * @return \GraphQL\Type\Definition\ResolveInfo - */ - public function getInfo(): ResolveInfo { - return $this->info; - } - - /** - * Returns whether the connection should execute - * - * @return bool - */ - public function getShouldExecute(): bool { - return $this->should_execute; - } - - /** - * @param string $key The key of the query arg to set - * @param mixed $value The value of the query arg to set - * - * @return \WPGraphQL\Data\Connection\AbstractConnectionResolver - * - * @deprecated 0.3.0 - * - * @codeCoverageIgnore - */ - public function setQueryArg( $key, $value ) { - _deprecated_function( __METHOD__, '0.3.0', static::class . '::set_query_arg()' ); - - return $this->set_query_arg( $key, $value ); - } - - /** - * Given a key and value, this sets a query_arg which will modify the query_args used by - * the connection resolvers get_query(); - * - * @param string $key The key of the query arg to set - * @param mixed $value The value of the query arg to set - * - * @return \WPGraphQL\Data\Connection\AbstractConnectionResolver - */ - public function set_query_arg( $key, $value ) { - $this->query_args[ $key ] = $value; - - return $this; - } - - /** - * Whether the connection should resolve as a one-to-one connection. - * - * @return \WPGraphQL\Data\Connection\AbstractConnectionResolver - */ - public function one_to_one() { - $this->one_to_one = true; - - return $this; - } - - /** - * Get_loader_name - * - * Return the name of the loader to be used with the connection resolver - * - * @return string - */ - abstract public function get_loader_name(); - - /** - * Get_query_args - * - * This method is used to accept the GraphQL Args input to the connection and return args - * that can be used in the Query to the datasource. - * - * For example, if the ConnectionResolver uses WP_Query to fetch the data, this - * should return $args for use in `new WP_Query` - * - * @return array - */ - abstract public function get_query_args(); - - /** - * Get_query - * - * The Query used to get items from the database (or even external datasource) are all - * different. - * - * Each connection resolver should be responsible for defining the Query object that - * is used to fetch items. - * - * @return mixed - */ - abstract public function get_query(); - - /** - * Should_execute - * - * Determine whether or not the query should execute. - * - * Return true to execute, return false to prevent execution. - * - * Various criteria can be used to determine whether a Connection Query should - * be executed. - * - * For example, if a user is requesting revisions of a Post, and the user doesn't have - * permission to edit the post, they don't have permission to view the revisions, and therefore - * we can prevent the query to fetch revisions from executing in the first place. - * - * @return bool - */ - abstract public function should_execute(); - - /** - * Is_valid_offset - * - * Determine whether or not the the offset is valid, i.e the item corresponding to the offset - * exists. Offset is equivalent to WordPress ID (e.g post_id, term_id). So this function is - * equivalent to checking if the WordPress object exists for the given ID. - * - * @param mixed $offset The offset to validate. Typically a WordPress Database ID - * - * @return bool - */ - abstract public function is_valid_offset( $offset ); - - /** - * Return an array of ids from the query - * - * Each Query class in WP and potential datasource handles this differently, so each connection - * resolver should handle getting the items into a uniform array of items. - * - * Note: This is not an abstract function to prevent backwards compatibility issues, so it - * instead throws an exception. Classes that extend AbstractConnectionResolver should - * override this method, instead of AbstractConnectionResolver::get_ids(). - * - * @since 1.9.0 - * - * @throws \Exception if child class forgot to implement this. - * - * @return array the array of IDs. - */ - public function get_ids_from_query() { - throw new Exception( - sprintf( - // translators: %s is the name of the connection resolver class. - esc_html__( 'Class %s does not implement a valid method `get_ids_from_query()`.', 'wp-graphql' ), - static::class - ) - ); - } - - /** - * Given an ID, return the model for the entity or null - * - * @param mixed $id The ID to identify the object by. Could be a database ID or an in-memory ID - * (like post_type name) - * - * @return mixed|\WPGraphQL\Model\Model|null - * @throws \Exception - */ - public function get_node_by_id( $id ) { - return $this->loader->load( $id ); - } - - /** - * Get_query_amount - * - * Returns the max between what was requested and what is defined as the $max_query_amount to - * ensure that queries don't exceed unwanted limits when querying data. - * - * @return int - * @throws \Exception - */ - public function get_query_amount() { - - /** - * Filter the maximum number of posts per page that should be queried. The default is 100 to prevent queries from - * being exceedingly resource intensive, however individual systems can override this for their specific needs. - * - * This filter is intentionally applied AFTER the query_args filter, as - * - * @param int $max_posts the maximum number of posts per page. - * @param mixed $source source passed down from the resolve tree - * @param array $args array of arguments input in the field as part of the GraphQL query - * @param \WPGraphQL\AppContext $context Object containing app context that gets passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info Info about fields passed down the resolve tree - * - * @since 0.0.6 - */ - $max_query_amount = apply_filters( 'graphql_connection_max_query_amount', 100, $this->source, $this->args, $this->context, $this->info ); - - return min( $max_query_amount, absint( $this->get_amount_requested() ) ); - } - - /** - * Get_amount_requested - * - * This checks the $args to determine the amount requested, and if - * - * @return int|null - * @throws \Exception - */ - public function get_amount_requested() { - - /** - * Set the default amount - */ - $amount_requested = 10; - - /** - * If both first & last are used in the input args, throw an exception as that won't - * work properly - */ - if ( ! empty( $this->args['first'] ) && ! empty( $this->args['last'] ) ) { - throw new UserError( esc_html__( 'first and last cannot be used together. For forward pagination, use first & after. For backward pagination, use last & before.', 'wp-graphql' ) ); - } - - /** - * If first is set, and is a positive integer, use it for the $amount_requested - * but if it's set to anything that isn't a positive integer, throw an exception - */ - if ( ! empty( $this->args['first'] ) && is_int( $this->args['first'] ) ) { - if ( 0 > $this->args['first'] ) { - throw new UserError( esc_html__( 'first must be a positive integer.', 'wp-graphql' ) ); - } - - $amount_requested = $this->args['first']; - } - - /** - * If last is set, and is a positive integer, use it for the $amount_requested - * but if it's set to anything that isn't a positive integer, throw an exception - */ - if ( ! empty( $this->args['last'] ) && is_int( $this->args['last'] ) ) { - if ( 0 > $this->args['last'] ) { - throw new UserError( esc_html__( 'last must be a positive integer.', 'wp-graphql' ) ); - } - - $amount_requested = $this->args['last']; - } - - /** - * This filter allows to modify the requested connection page size - * - * @param int $amount the requested amount - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $resolver Instance of the connection resolver class - */ - return max( 0, apply_filters( 'graphql_connection_amount_requested', $amount_requested, $this ) ); - } - - /** - * Gets the offset for the `after` cursor. - * - * @return int|string|null - */ - public function get_after_offset() { - if ( ! empty( $this->args['after'] ) ) { - return $this->get_offset_for_cursor( $this->args['after'] ); - } - - return null; - } - - /** - * Gets the offset for the `before` cursor. - * - * @return int|string|null - */ - public function get_before_offset() { - if ( ! empty( $this->args['before'] ) ) { - return $this->get_offset_for_cursor( $this->args['before'] ); - } - - return null; - } - - /** - * Gets the array index for the given offset. - * - * @param int|string|false $offset The cursor pagination offset. - * @param array $ids The array of ids from the query. - * - * @return int|false $index The array index of the offset. - */ - public function get_array_index_for_offset( $offset, $ids ) { - if ( false === $offset ) { - return false; - } - - // We use array_values() to ensure we're getting a positional index, and not a key. - return array_search( $offset, array_values( $ids ), true ); - } - - /** - * Returns an array slice of IDs, per the Relay Cursor Connection spec. - * - * The resulting array should be overfetched by 1. - * - * @see https://relay.dev/graphql/connections.htm#sec-Pagination-algorithm - * - * @param array $ids The array of IDs from the query to slice, ordered as expected by the GraphQL query. - * - * @since 1.9.0 - * - * @return array - */ - public function apply_cursors_to_ids( array $ids ) { - if ( empty( $ids ) ) { - return []; - } - - // First we slice the array from the front. - if ( ! empty( $this->args['after'] ) ) { - $offset = $this->get_offset_for_cursor( $this->args['after'] ); - $index = $this->get_array_index_for_offset( $offset, $ids ); - - if ( false !== $index ) { - // We want to start with the first id after the index. - $ids = array_slice( $ids, $index + 1, null, true ); - } - } - - // Then we slice the array from the back. - if ( ! empty( $this->args['before'] ) ) { - $offset = $this->get_offset_for_cursor( $this->args['before'] ); - $index = $this->get_array_index_for_offset( $offset, $ids ); - - if ( false !== $index ) { - // Because array indexes start at 0, we can overfetch without adding 1 to $index. - $ids = array_slice( $ids, 0, $index, true ); - } - } - - return $ids; - } - - /** - * Returns an array of IDs for the connection. - * - * These IDs have been fetched from the query with all the query args applied, - * then sliced (overfetching by 1) by pagination args. - * - * @return array - */ - public function get_ids() { - $ids = $this->get_ids_from_query(); - - return $this->apply_cursors_to_ids( $ids ); - } - - /** - * Get_offset - * - * This returns the offset to be used in the $query_args based on the $args passed to the - * GraphQL query. - * - * @deprecated 1.9.0 - * - * @codeCoverageIgnore - * - * @return int|mixed - */ - public function get_offset() { - _deprecated_function( __METHOD__, '1.9.0', static::class . '::get_offset_for_cursor()' ); - - // Using shorthand since this is for deprecated code. - $cursor = $this->args['after'] ?? null; - $cursor = $cursor ?: ( $this->args['before'] ?? null ); - - return $this->get_offset_for_cursor( $cursor ); - } - - /** - * Returns the offset for a given cursor. - * - * Connections that use a string-based offset should override this method. - * - * @return int|mixed - */ - public function get_offset_for_cursor( string $cursor = null ) { - $offset = false; - - // We avoid using ArrayConnection::cursorToOffset() because it assumes an `int` offset. - if ( ! empty( $cursor ) ) { - $offset = substr( base64_decode( $cursor ), strlen( 'arrayconnection:' ) ); - } - - /** - * We assume a numeric $offset is an integer ID. - * If it isn't this method should be overridden by the child class. - */ - return is_numeric( $offset ) ? absint( $offset ) : $offset; - } - - /** - * Has_next_page - * - * Whether there is a next page in the connection. - * - * If there are more "items" than were asked for in the "first" argument - * ore if there are more "items" after the "before" argument, has_next_page() - * will be set to true - * - * @return boolean - */ - public function has_next_page() { - if ( ! empty( $this->args['first'] ) ) { - return ! empty( $this->ids ) && count( $this->ids ) > $this->query_amount; - } - - $before_offset = $this->get_before_offset(); - - if ( $before_offset ) { - return $this->is_valid_offset( $before_offset ); - } - - return false; - } - - /** - * Has_previous_page - * - * Whether there is a previous page in the connection. - * - * If there are more "items" than were asked for in the "last" argument - * or if there are more "items" before the "after" argument, has_previous_page() - * will be set to true. - * - * @return boolean - */ - public function has_previous_page() { - if ( ! empty( $this->args['last'] ) ) { - return ! empty( $this->ids ) && count( $this->ids ) > $this->query_amount; - } - - $after_offset = $this->get_after_offset(); - if ( $after_offset ) { - return $this->is_valid_offset( $after_offset ); - } - - return false; - } - - /** - * Get_start_cursor - * - * Determine the start cursor from the connection - * - * @return mixed string|null - */ - public function get_start_cursor() { - $first_edge = $this->edges && ! empty( $this->edges ) ? $this->edges[0] : null; - - return isset( $first_edge['cursor'] ) ? $first_edge['cursor'] : null; - } - - /** - * Get_end_cursor - * - * Determine the end cursor from the connection - * - * @return mixed string|null - */ - public function get_end_cursor() { - $last_edge = ! empty( $this->edges ) ? $this->edges[ count( $this->edges ) - 1 ] : null; - - return isset( $last_edge['cursor'] ) ? $last_edge['cursor'] : null; - } - - /** - * Gets the IDs for the currently-paginated slice of nodes. - * - * We slice the array to match the amount of items that was asked for, as we over-fetched by 1 item to calculate pageInfo. - * - * @used-by AbstractConnectionResolver::get_nodes() - * - * @return array - */ - public function get_ids_for_nodes() { - if ( empty( $this->ids ) ) { - return []; - } - - // If we're going backwards then our overfetched ID is at the front. - if ( ! empty( $this->args['last'] ) && count( $this->ids ) > absint( $this->args['last'] ) ) { - return array_slice( $this->ids, count( $this->ids ) - absint( $this->args['last'] ), $this->query_amount, true ); - } - - // If we're going forwards, our overfetched ID is at the back. - return array_slice( $this->ids, 0, $this->query_amount, true ); - } - - /** - * Get_nodes - * - * Get the nodes from the query. - * - * @uses AbstractConnectionResolver::get_ids_for_nodes() - * - * @return array - * @throws \Exception - */ - public function get_nodes() { - $nodes = []; - - // These are already sliced and ordered, we're just populating node data. - $ids = $this->get_ids_for_nodes(); - - foreach ( $ids as $id ) { - $model = $this->get_node_by_id( $id ); - if ( true === $this->is_valid_model( $model ) ) { - $nodes[ $id ] = $model; - } - } - - return $nodes; - } - - /** - * Validates Model. - * - * If model isn't a class with a `fields` member, this function with have be overridden in - * the Connection class. - * - * @param \WPGraphQL\Model\Model|mixed $model The model being validated - * - * @return bool - */ - protected function is_valid_model( $model ) { - return isset( $model->fields ) && ! empty( $model->fields ); - } - - /** - * Given an ID, a cursor is returned - * - * @param int $id - * - * @return string - */ - protected function get_cursor_for_node( $id ) { - return base64_encode( 'arrayconnection:' . $id ); - } - - /** - * Get_edges - * - * This iterates over the nodes and returns edges - * - * @return array - */ - public function get_edges() { - // Bail early if there are no nodes. - if ( empty( $this->nodes ) ) { - return []; - } - - $edges = []; - - // The nodes are already ordered, sliced, and populated. What's left is to populate the edge data for each one. - foreach ( $this->nodes as $id => $node ) { - $edge = [ - 'cursor' => $this->get_cursor_for_node( $id ), - 'node' => $node, - 'source' => $this->source, - 'connection' => $this, - ]; - - /** - * Create the edge, pass it through a filter. - * - * @param array $edge The edge within the connection - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the connection resolver class - */ - $edge = apply_filters( - 'graphql_connection_edge', - $edge, - $this - ); - - /** - * If not empty, add the edge to the edges - */ - if ( ! empty( $edge ) ) { - $edges[] = $edge; - } - } - - return $edges; - } - - /** - * Get_page_info - * - * Returns pageInfo for the connection - * - * @return array - */ - public function get_page_info() { - $page_info = [ - 'startCursor' => $this->get_start_cursor(), - 'endCursor' => $this->get_end_cursor(), - 'hasNextPage' => (bool) $this->has_next_page(), - 'hasPreviousPage' => (bool) $this->has_previous_page(), - ]; - - /** - * Filter the pageInfo that is returned to the connection. - * - * This filter allows for additional fields to be filtered into the pageInfo - * of a connection, such as "totalCount", etc, because the filter has enough - * context of the query, args, request, etc to be able to calculate and return - * that information. - * - * example: - * - * You would want to register a "total" field to the PageInfo type, then filter - * the pageInfo to return the total for the query, something to this tune: - * - * add_filter( 'graphql_connection_page_info', function( $page_info, $connection ) { - * - * $page_info['total'] = null; - * - * if ( $connection->query instanceof WP_Query ) { - * if ( isset( $connection->query->found_posts ) { - * $page_info['total'] = (int) $connection->query->found_posts; - * } - * } - * - * return $page_info; - * - * }); - */ - return apply_filters( 'graphql_connection_page_info', $page_info, $this ); - } - - /** - * Execute the resolver query and get the data for the connection - * - * @return array - * - * @throws \Exception - */ - public function execute_and_get_ids() { - - /** - * If should_execute is explicitly set to false already, we can - * prevent execution quickly. If it's not, we need to - * call the should_execute() method to execute any situational logic - * to determine if the connection query should execute or not - */ - $should_execute = false === $this->should_execute ? false : $this->should_execute(); - - /** - * Check if the connection should execute. If conditions are met that should prevent - * the execution, we can bail from resolving early, before the query is executed. - * - * Filter whether the connection should execute. - * - * @param bool $should_execute Whether the connection should execute - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver - */ - $this->should_execute = apply_filters( 'graphql_connection_should_execute', $should_execute, $this ); - if ( false === $this->should_execute ) { - return []; - } - - /** - * Set the query for the resolver, for use as reference in filters, etc - * - * Filter the query. For core data, the query is typically an instance of: - * - * WP_Query - * WP_Comment_Query - * WP_User_Query - * WP_Term_Query - * ... - * - * But in some cases, the actual mechanism for querying data should be overridden. For - * example, perhaps you're using ElasticSearch or Solr (hypothetical) and want to offload - * the query to that instead of a native WP_Query class. You could override this with a - * query to that datasource instead. - * - * @param mixed $query Instance of the Query for the resolver - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver - */ - $this->query = apply_filters( 'graphql_connection_query', $this->get_query(), $this ); - - /** - * Filter the connection IDs - * - * @param array $ids Array of IDs this connection will be resolving - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver - */ - $this->ids = apply_filters( 'graphql_connection_ids', $this->get_ids(), $this ); - - if ( empty( $this->ids ) ) { - return []; - } - - /** - * Buffer the IDs for deferred resolution - */ - $this->loader->buffer( $this->ids ); - - return $this->ids; - } - - /** - * Get_connection - * - * Get the connection to return to the Connection Resolver - * - * @return mixed|array|\GraphQL\Deferred - * - * @throws \Exception - */ - public function get_connection() { - $this->execute_and_get_ids(); - - /** - * Return a Deferred function to load all buffered nodes before - * returning the connection. - */ - return new Deferred( - function () { - if ( ! empty( $this->ids ) ) { - $this->loader->load_many( $this->ids ); - } - - /** - * Set the items. These are the "nodes" that make up the connection. - * - * Filters the nodes in the connection - * - * @param array $nodes The nodes in the connection - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver - */ - $this->nodes = apply_filters( 'graphql_connection_nodes', $this->get_nodes(), $this ); - - /** - * Filters the edges in the connection - * - * @param array $nodes The nodes in the connection - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver Instance of the Connection Resolver - */ - $this->edges = apply_filters( 'graphql_connection_edges', $this->get_edges(), $this ); - - if ( true === $this->one_to_one ) { - // For one to one connections, return the first edge. - $connection = ! empty( $this->edges[ array_key_first( $this->edges ) ] ) ? $this->edges[ array_key_first( $this->edges ) ] : null; - } else { - // For plural connections (default) return edges/nodes/pageInfo - $connection = [ - 'nodes' => $this->nodes, - 'edges' => $this->edges, - 'pageInfo' => $this->get_page_info(), - ]; - } - - /** - * Filter the connection. In some cases, connections will want to provide - * additional information other than edges, nodes, and pageInfo - * - * This filter allows additional fields to be returned to the connection resolver - * - * @param array $connection The connection data being returned - * @param \WPGraphQL\Data\Connection\AbstractConnectionResolver $connection_resolver The instance of the connection resolver - */ - return apply_filters( 'graphql_connection', $connection, $this ); - } - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/CommentConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/CommentConnectionResolver.php deleted file mode 100644 index 6e047187..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/CommentConnectionResolver.php +++ /dev/null @@ -1,338 +0,0 @@ -args['last'] ) ? $this->args['last'] : null; - $first = ! empty( $this->args['first'] ) ? $this->args['first'] : null; - - $query_args = []; - - /** - * Don't calculate the total rows, it's not needed and can be expensive - */ - $query_args['no_found_rows'] = true; - - /** - * Set the default comment_status for Comment Queries to be "comment_approved" - */ - $query_args['status'] = 'approve'; - - /** - * Set the number, ensuring it doesn't exceed the amount set as the $max_query_amount - * - * @since 0.0.6 - */ - $query_args['number'] = min( max( absint( $first ), absint( $last ), 10 ), $this->get_query_amount() ) + 1; - - /** - * Set the default order - */ - $query_args['orderby'] = 'comment_date'; - - /** - * Take any of the $this->args that were part of the GraphQL query and map their - * GraphQL names to the WP_Term_Query names to be used in the WP_Term_Query - * - * @since 0.0.5 - */ - $input_fields = []; - if ( ! empty( $this->args['where'] ) ) { - $input_fields = $this->sanitize_input_fields( $this->args['where'] ); - } - - /** - * Merge the default $query_args with the $this->args that were entered - * in the query. - * - * @since 0.0.5 - */ - if ( ! empty( $input_fields ) ) { - $query_args = array_merge( $query_args, $input_fields ); - } - - /** - * If the current user cannot moderate comments, do not include unapproved comments - */ - if ( ! current_user_can( 'moderate_comments' ) ) { - $query_args['status'] = [ 'approve' ]; - $query_args['include_unapproved'] = get_current_user_id() ? [ get_current_user_id() ] : []; - if ( empty( $query_args['include_unapproved'] ) ) { - unset( $query_args['include_unapproved'] ); - } - } - - /** - * Throw an exception if the query is attempted to be queried by - */ - if ( 'comment__in' === $query_args['orderby'] && empty( $query_args['comment__in'] ) ) { - throw new UserError( esc_html__( 'In order to sort by comment__in, an array of IDs must be passed as the commentIn argument', 'wp-graphql' ) ); - } - - /** - * If there's no orderby params in the inputArgs, set order based on the first/last argument - */ - if ( empty( $query_args['order'] ) ) { - $query_args['order'] = ! empty( $last ) ? 'ASC' : 'DESC'; - } - - /** - * Set the graphql_cursor_compare to determine - * whether the data is being paginated forward (>) or backward (<) - * default to forward - */ - $query_args['graphql_cursor_compare'] = ( isset( $last ) ) ? '>' : '<'; - - // these args are used by the cursor builder to generate the proper SQL needed to respect the cursors - $query_args['graphql_after_cursor'] = $this->get_after_offset(); - $query_args['graphql_before_cursor'] = $this->get_before_offset(); - - /** - * Pass the graphql $this->args to the WP_Query - */ - $query_args['graphql_args'] = $this->args; - - // encode the graphql args as a cache domain to ensure the - // graphql_args are used to identify different queries. - // see: https://core.trac.wordpress.org/ticket/35075 - $encoded_args = wp_json_encode( $this->args ); - $query_args['cache_domain'] = ! empty( $encoded_args ) ? 'graphql:' . md5( $encoded_args ) : 'graphql'; - - /** - * We only want to query IDs because deferred resolution will resolve the full - * objects. - */ - $query_args['fields'] = 'ids'; - - /** - * Filter the query_args that should be applied to the query. This filter is applied AFTER the input args from - * the GraphQL Query have been applied and has the potential to override the GraphQL Query Input Args. - * - * @param array $query_args array of query_args being passed to the - * @param mixed $source source passed down from the resolve tree - * @param array $args array of arguments input in the field as part of the GraphQL query - * @param \WPGraphQL\AppContext $context object passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info info about fields passed down the resolve tree - * - * @since 0.0.6 - */ - return apply_filters( 'graphql_comment_connection_query_args', $query_args, $this->source, $this->args, $this->context, $this->info ); - } - - /** - * Get_query - * - * Return the instance of the WP_Comment_Query - * - * @return \WP_Comment_Query - * @throws \Exception - */ - public function get_query() { - return new WP_Comment_Query( $this->query_args ); - } - - /** - * Return the name of the loader - * - * @return string - */ - public function get_loader_name() { - return 'comment'; - } - - /** - * {@inheritDoc} - */ - public function get_ids_from_query() { - /** @var array $ids */ - $ids = ! empty( $this->query->get_comments() ) ? $this->query->get_comments() : []; - - // If we're going backwards, we need to reverse the array. - if ( ! empty( $this->args['last'] ) ) { - $ids = array_reverse( $ids ); - } - - return $ids; - } - - /** - * This can be used to determine whether the connection query should even execute. - * - * For example, if the $source were a post_type that didn't support comments, we could prevent - * the connection query from even executing. In our case, we prevent comments from even showing - * in the Schema for post types that don't have comment support, so we don't need to worry - * about that, but there may be other situations where we'd need to prevent it. - * - * @return boolean - */ - public function should_execute() { - return true; - } - - - /** - * Filters the GraphQL args before they are used in get_query_args(). - * - * @return array - */ - public function get_args(): array { - $args = $this->args; - - if ( ! empty( $args['where'] ) ) { - // Ensure all IDs are converted to database IDs. - foreach ( $args['where'] as $input_key => $input_value ) { - if ( empty( $input_value ) ) { - continue; - } - - switch ( $input_key ) { - case 'authorIn': - case 'authorNotIn': - case 'commentIn': - case 'commentNotIn': - case 'parentIn': - case 'parentNotIn': - case 'contentAuthorIn': - case 'contentAuthorNotIn': - case 'contentId': - case 'contentIdIn': - case 'contentIdNotIn': - case 'contentAuthor': - case 'userId': - if ( is_array( $input_value ) ) { - $args['where'][ $input_key ] = array_map( - static function ( $id ) { - return Utils::get_database_id_from_id( $id ); - }, - $input_value - ); - break; - } - $args['where'][ $input_key ] = Utils::get_database_id_from_id( $input_value ); - break; - case 'includeUnapproved': - if ( is_string( $input_value ) ) { - $input_value = [ $input_value ]; - } - $args['where'][ $input_key ] = array_map( - static function ( $id ) { - if ( is_email( $id ) ) { - return $id; - } - - return Utils::get_database_id_from_id( $id ); - }, - $input_value - ); - break; - } - } - } - - /** - * - * Filters the GraphQL args before they are used in get_query_args(). - * - * @param array $args The GraphQL args passed to the resolver. - * @param \WPGraphQL\Data\Connection\CommentConnectionResolver $connection_resolver Instance of the ConnectionResolver - * - * @since 1.11.0 - */ - return apply_filters( 'graphql_comment_connection_args', $args, $this ); - } - - /** - * This sets up the "allowed" args, and translates the GraphQL-friendly keys to - * WP_Comment_Query friendly keys. - * - * There's probably a cleaner/more dynamic way to approach this, but this was quick. I'd be - * down to explore more dynamic ways to map this, but for now this gets the job done. - * - * @param array $args The array of query arguments - * - * @since 0.0.5 - * @return array - */ - public function sanitize_input_fields( array $args ) { - $arg_mapping = [ - 'authorEmail' => 'author_email', - 'authorIn' => 'author__in', - 'authorNotIn' => 'author__not_in', - 'authorUrl' => 'author_url', - 'commentIn' => 'comment__in', - 'commentNotIn' => 'comment__not_in', - 'commentType' => 'type', - 'commentTypeIn' => 'type__in', - 'commentTypeNotIn' => 'type__not_in', - 'contentAuthor' => 'post_author', - 'contentAuthorIn' => 'post_author__in', - 'contentAuthorNotIn' => 'post_author__not_in', - 'contentId' => 'post_id', - 'contentIdIn' => 'post__in', - 'contentIdNotIn' => 'post__not_in', - 'contentName' => 'post_name', - 'contentParent' => 'post_parent', - 'contentStatus' => 'post_status', - 'contentType' => 'post_type', - 'includeUnapproved' => 'include_unapproved', - 'parentIn' => 'parent__in', - 'parentNotIn' => 'parent__not_in', - 'userId' => 'user_id', - ]; - - /** - * Map and sanitize the input args to the WP_Comment_Query compatible args - */ - $query_args = Utils::map_input( $args, $arg_mapping ); - - /** - * Filter the input fields - * - * This allows plugins/themes to hook in and alter what $args should be allowed to be passed - * from a GraphQL Query to the get_terms query - * - * @since 0.0.5 - */ - $query_args = apply_filters( 'graphql_map_input_fields_to_wp_comment_query', $query_args, $args, $this->source, $this->args, $this->context, $this->info ); - - return ! empty( $query_args ) && is_array( $query_args ) ? $query_args : []; - } - - /** - * Determine whether or not the the offset is valid, i.e the comment corresponding to the - * offset exists. Offset is equivalent to comment_id. So this function is equivalent to - * checking if the comment with the given ID exists. - * - * @param int $offset The ID of the node used for the cursor offset - * - * @return bool - */ - public function is_valid_offset( $offset ) { - return ! empty( get_comment( $offset ) ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/ContentTypeConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/ContentTypeConnectionResolver.php deleted file mode 100644 index 36aa2db8..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/ContentTypeConnectionResolver.php +++ /dev/null @@ -1,90 +0,0 @@ -query; - - if ( empty( $queried ) ) { - return $ids; - } - - foreach ( $queried as $item ) { - $ids[] = $item; - } - - return $ids; - } - - /** - * {@inheritDoc} - */ - public function get_query_args() { - // If any args are added to filter/sort the connection - return []; - } - - - /** - * Get the items from the source - * - * @return array - */ - public function get_query() { - if ( isset( $this->query_args['contentTypeNames'] ) && is_array( $this->query_args['contentTypeNames'] ) ) { - return $this->query_args['contentTypeNames']; - } - - if ( isset( $this->query_args['name'] ) ) { - return [ $this->query_args['name'] ]; - } - - $query_args = $this->query_args; - return \WPGraphQL::get_allowed_post_types( 'names', $query_args ); - } - - /** - * The name of the loader to load the data - * - * @return string - */ - public function get_loader_name() { - return 'post_type'; - } - - /** - * Determine if the offset used for pagination is valid - * - * @param mixed $offset - * - * @return bool - */ - public function is_valid_offset( $offset ) { - return (bool) get_post_type_object( $offset ); - } - - /** - * Determine if the query should execute - * - * @return bool - */ - public function should_execute() { - return true; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedScriptsConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedScriptsConnectionResolver.php deleted file mode 100644 index 05323ec4..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedScriptsConnectionResolver.php +++ /dev/null @@ -1,120 +0,0 @@ -fieldName || 'registeredScripts' === $info->fieldName ) { - return 1000; - } - return $max; - }, - 10, - 5 - ); - - parent::__construct( $source, $args, $context, $info ); - } - - /** - * {@inheritDoc} - */ - public function get_ids_from_query() { - $ids = []; - $queried = $this->get_query(); - - if ( empty( $queried ) ) { - return $ids; - } - - foreach ( $queried as $key => $item ) { - $ids[ $key ] = $item; - } - - return $ids; - } - - /** - * {@inheritDoc} - */ - public function get_query_args() { - // If any args are added to filter/sort the connection - return []; - } - - - /** - * Get the items from the source - * - * @return array - */ - public function get_query() { - return $this->source->enqueuedScriptsQueue ? $this->source->enqueuedScriptsQueue : []; - } - - /** - * The name of the loader to load the data - * - * @return string - */ - public function get_loader_name() { - return 'enqueued_script'; - } - - /** - * Determine if the model is valid - * - * @param ?\_WP_Dependency $model - * - * @return bool - */ - protected function is_valid_model( $model ) { - return isset( $model->handle ); - } - - /** - * Determine if the offset used for pagination is valid - * - * @param mixed $offset - * - * @return bool - */ - public function is_valid_offset( $offset ) { - global $wp_scripts; - return isset( $wp_scripts->registered[ $offset ] ); - } - - /** - * Determine if the query should execute - * - * @return bool - */ - public function should_execute() { - return true; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php deleted file mode 100644 index ee7cdad6..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php +++ /dev/null @@ -1,128 +0,0 @@ -fieldName || 'registeredStylesheets' === $info->fieldName ) { - return 1000; - } - return $max; - }, - 10, - 5 - ); - - parent::__construct( $source, $args, $context, $info ); - } - - /** - * Get the IDs from the source - * - * @return array - */ - public function get_ids_from_query() { - $ids = []; - $queried = $this->get_query(); - - if ( empty( $queried ) ) { - return $ids; - } - - foreach ( $queried as $key => $item ) { - $ids[ $key ] = $item; - } - - return $ids; - } - - /** - * {@inheritDoc} - */ - public function get_query_args() { - // If any args are added to filter/sort the connection - return []; - } - - - /** - * Get the items from the source - * - * @return array - */ - public function get_query() { - return $this->source->enqueuedStylesheetsQueue ? $this->source->enqueuedStylesheetsQueue : []; - } - - /** - * The name of the loader to load the data - * - * @return string - */ - public function get_loader_name() { - return 'enqueued_stylesheet'; - } - - /** - * Determine if the model is valid - * - * @param ?\_WP_Dependency $model - * - * @return bool - */ - protected function is_valid_model( $model ) { - return isset( $model->handle ); - } - - /** - * Determine if the offset used for pagination is valid - * - * @param mixed $offset - * - * @return bool - */ - public function is_valid_offset( $offset ) { - global $wp_styles; - return isset( $wp_styles->registered[ $offset ] ); - } - - /** - * Determine if the query should execute - * - * @return bool - */ - public function should_execute() { - return true; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/MenuConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/MenuConnectionResolver.php deleted file mode 100644 index a2800663..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/MenuConnectionResolver.php +++ /dev/null @@ -1,50 +0,0 @@ - false, - 'include' => [], - 'taxonomy' => 'nav_menu', - 'fields' => 'ids', - ]; - - if ( ! empty( $this->args['where']['slug'] ) ) { - $term_args['slug'] = $this->args['where']['slug']; - $term_args['include'] = null; - } - - $theme_locations = get_nav_menu_locations(); - - // If a location is specified in the args, use it - if ( ! empty( $this->args['where']['location'] ) ) { - // Exclude unset and non-existent locations - $term_args['include'] = ! empty( $theme_locations[ $this->args['where']['location'] ] ) ? $theme_locations[ $this->args['where']['location'] ] : -1; - // If the current user cannot edit theme options - } elseif ( ! current_user_can( 'edit_theme_options' ) ) { - $term_args['include'] = array_values( $theme_locations ); - } - - if ( ! empty( $this->args['where']['id'] ) ) { - $term_args['include'] = $this->args['where']['id']; - } - - $query_args = parent::get_query_args(); - - return array_merge( $query_args, $term_args ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/MenuItemConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/MenuItemConnectionResolver.php deleted file mode 100644 index 17a7dcc3..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/MenuItemConnectionResolver.php +++ /dev/null @@ -1,125 +0,0 @@ -args['last'] ) ? $this->args['last'] : null; - - $menu_locations = get_theme_mod( 'nav_menu_locations' ); - - $query_args = parent::get_query_args(); - $query_args['orderby'] = 'menu_order'; - $query_args['order'] = isset( $last ) ? 'DESC' : 'ASC'; - - if ( isset( $this->args['where']['parentDatabaseId'] ) ) { - $query_args['meta_key'] = '_menu_item_menu_item_parent'; - $query_args['meta_value'] = (int) $this->args['where']['parentDatabaseId']; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value - } - - if ( ! empty( $this->args['where']['parentId'] ) || ( isset( $this->args['where']['parentId'] ) && 0 === (int) $this->args['where']['parentId'] ) ) { - $query_args['meta_key'] = '_menu_item_menu_item_parent'; - $query_args['meta_value'] = $this->args['where']['parentId']; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value - } - - // Get unique list of locations as the default limitation of - // locations to allow public queries for. - // Public queries should only be allowed to query for - // Menu Items assigned to a Menu Location - $locations = is_array( $menu_locations ) && ! empty( $menu_locations ) ? array_unique( array_values( $menu_locations ) ) : []; - - // If the location argument is set, set the argument to the input argument - if ( isset( $this->args['where']['location'], $menu_locations[ $this->args['where']['location'] ] ) ) { - $locations = [ $menu_locations[ $this->args['where']['location'] ] ]; - - // if the $locations are NOT set and the user has proper capabilities, let the user query - // all menu items connected to any menu - } elseif ( current_user_can( 'edit_theme_options' ) ) { - $locations = null; - } - - // Only query for menu items in assigned locations. - if ( ! empty( $locations ) && is_array( $locations ) ) { - - // unset the location arg - // we don't need this passed as a taxonomy parameter to wp_query - unset( $query_args['location'] ); - - $query_args['tax_query'][] = [ - 'taxonomy' => 'nav_menu', - 'field' => 'term_id', - 'terms' => $locations, - 'include_children' => false, - 'operator' => 'IN', - ]; - } - - return $query_args; - } - - /** - * Filters the GraphQL args before they are used in get_query_args(). - * - * @return array - */ - public function get_args(): array { - $args = $this->args; - - if ( ! empty( $args['where'] ) ) { - // Ensure all IDs are converted to database IDs. - foreach ( $args['where'] as $input_key => $input_value ) { - if ( empty( $input_value ) ) { - continue; - } - - switch ( $input_key ) { - case 'parentId': - $args['where'][ $input_key ] = Utils::get_database_id_from_id( $input_value ); - break; - } - } - } - - /** - * - * Filters the GraphQL args before they are used in get_query_args(). - * - * @param array $args The GraphQL args passed to the resolver. - * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. - * - * @since 1.11.0 - */ - return apply_filters( 'graphql_menu_item_connection_args', $args, $this->args ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/PluginConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/PluginConnectionResolver.php deleted file mode 100644 index 026c1c26..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/PluginConnectionResolver.php +++ /dev/null @@ -1,261 +0,0 @@ -query ) ? $this->query : []; - - if ( empty( $queried ) ) { - return $ids; - } - - foreach ( $queried as $key => $item ) { - $ids[ $key ] = $key; - } - - return $ids; - } - - /** - * {@inheritDoc} - */ - public function get_query_args() { - if ( ! empty( $this->args['where']['status'] ) ) { - $this->args['where']['stati'] = [ $this->args['where']['status'] ]; - } elseif ( ! empty( $this->args['where']['stati'] ) && is_string( $this->args['where']['stati'] ) ) { - $this->args['where']['stati'] = [ $this->args['where']['stati'] ]; - } - - return $this->args; - } - - /** - * {@inheritDoc} - * - * @return array - */ - public function get_query() { - // File has not loaded. - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - // This is missing must use and drop in plugins, so we need to fetch and merge them separately. - $site_plugins = apply_filters( 'all_plugins', get_plugins() ); - $mu_plugins = apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ? get_mu_plugins() : []; - $dropin_plugins = apply_filters( 'show_advanced_plugins', true, 'dropins' ) ? get_dropins() : []; - - $all_plugins = array_merge( $site_plugins, $mu_plugins, $dropin_plugins ); - - // Bail early if no plugins. - if ( empty( $all_plugins ) ) { - return []; - } - - // Holds the plugin names sorted by status. The other ` status => [ plugin_names ] ` will be added later. - $plugins_by_status = [ - 'mustuse' => array_flip( array_keys( $mu_plugins ) ), - 'dropins' => array_flip( array_keys( $dropin_plugins ) ), - ]; - - // Permissions. - $can_update = current_user_can( 'update_plugins' ); - $can_view_autoupdates = $can_update && function_exists( 'wp_is_auto_update_enabled_for_type' ) && wp_is_auto_update_enabled_for_type( 'plugin' ); - $show_network_plugins = apply_filters( 'show_network_active_plugins', current_user_can( 'manage_network_plugins' ) ); - - // Store the plugin stati as array keys for performance. - $active_stati = ! empty( $this->args['where']['stati'] ) ? array_flip( $this->args['where']['stati'] ) : []; - - // Get additional plugin info. - $upgradable_list = $can_update && isset( $active_stati['upgrade'] ) ? get_site_transient( 'update_plugins' ) : []; - $recently_activated_list = isset( $active_stati['recently_activated'] ) ? get_site_option( 'recently_activated', [] ) : []; - - // Loop through the plugins, add additional data, and store them in $plugins_by_status. - foreach ( (array) $all_plugins as $plugin_file => $plugin_data ) { - if ( ! file_exists( WP_PLUGIN_DIR . '/' . $plugin_file ) ) { - unset( $all_plugins[ $plugin_file ] ); - continue; - } - - // Handle multisite plugins. - if ( is_multisite() && is_network_only_plugin( $plugin_file ) && ! is_plugin_active( $plugin_file ) ) { - - // Check for inactive network plugins. - if ( $show_network_plugins ) { - - // add the plugin to the network_inactive and network_inactive list since "network_inactive" are considered inactive - $plugins_by_status['inactive'][ $plugin_file ] = $plugin_file; - $plugins_by_status['network_inactive'][ $plugin_file ] = $plugin_file; - } else { - // Unset and skip to next plugin. - unset( $all_plugins[ $plugin_file ] ); - continue; - } - } elseif ( is_plugin_active_for_network( $plugin_file ) ) { - // Check for active network plugins. - if ( $show_network_plugins ) { - // add the plugin to the network_activated and active list, since "network_activated" are active - $plugins_by_status['active'][ $plugin_file ] = $plugin_file; - $plugins_by_status['network_activated'][ $plugin_file ] = $plugin_file; - } else { - // Unset and skip to next plugin. - unset( $all_plugins[ $plugin_file ] ); - continue; - } - } - - // Populate active/inactive lists. - // @todo should this include MU/Dropins? - if ( is_plugin_active( $plugin_file ) ) { - $plugins_by_status['active'][ $plugin_file ] = $plugin_file; - } else { - $plugins_by_status['inactive'][ $plugin_file ] = $plugin_file; - } - - // Populate recently activated list. - if ( isset( $recently_activated_list[ $plugin_file ] ) ) { - $plugins_by_status['recently_activated'][ $plugin_file ] = $plugin_file; - } - - // Populate paused list. - if ( is_plugin_paused( $plugin_file ) ) { - $plugins_by_status['paused'][ $plugin_file ] = $plugin_file; - } - - // Get update information. - if ( $can_update && isset( $upgradable_list->response[ $plugin_file ] ) ) { - // An update is available. - $plugin_data['update'] = true; - // Extra info if known. - $plugin_data = array_merge( (array) $upgradable_list->response[ $plugin_file ], [ 'update-supported' => true ], $plugin_data ); - - // Populate upgradable list. - $plugins_by_status['upgrade'][ $plugin_file ] = $plugin_file; - } elseif ( isset( $upgradable_list->no_update[ $plugin_file ] ) ) { - $plugin_data = array_merge( (array) $upgradable_list->no_update[ $plugin_file ], [ 'update-supported' => true ], $plugin_data ); - } elseif ( empty( $plugin_data['update-supported'] ) ) { - $plugin_data['update-supported'] = false; - } - - // Get autoupdate information. - if ( $can_view_autoupdates ) { - /* - * Create the payload that's used for the auto_update_plugin filter. - * This is the same data contained within $upgradable_list->(response|no_update) however - * not all plugins will be contained in those keys, this avoids unexpected warnings. - */ - $filter_payload = [ - 'id' => $plugin_file, - 'slug' => '', - 'plugin' => $plugin_file, - 'new_version' => '', - 'url' => '', - 'package' => '', - 'icons' => [], - 'banners' => [], - 'banners_rtl' => [], - 'tested' => '', - 'requires_php' => '', - 'compatibility' => new \stdClass(), - ]; - $filter_payload = (object) wp_parse_args( $plugin_data, $filter_payload ); - - if ( function_exists( 'wp_is_auto_update_forced_for_item' ) ) { - $auto_update_forced = wp_is_auto_update_forced_for_item( 'plugin', null, $filter_payload ); - $plugin_data['auto-update-forced'] = $auto_update_forced; - } - } - - // Save any changes to the plugin data. - $all_plugins[ $plugin_file ] = $plugin_data; - } - - $plugins_by_status['all'] = array_flip( array_keys( $all_plugins ) ); - - /** - * Filters the plugins by status. - * */ - $filtered_plugins = ! empty( $active_stati ) ? array_values( array_intersect_key( $plugins_by_status, $active_stati ) ) : []; - // If plugins exist for the filter, flatten and return them. Otherwise, return the full list. - $filtered_plugins = ! empty( $filtered_plugins ) ? array_merge( [], ...$filtered_plugins ) : $plugins_by_status['all']; - - if ( ! empty( $this->args['where']['search'] ) ) { - // Filter by search args. - $s = sanitize_text_field( $this->args['where']['search'] ); - $matches = array_keys( - array_filter( - $all_plugins, - static function ( $plugin ) use ( $s ) { - foreach ( $plugin as $value ) { - if ( is_string( $value ) && false !== stripos( wp_strip_all_tags( $value ), $s ) ) { - return true; - } - } - - return false; - } - ) - ); - if ( ! empty( $matches ) ) { - $filtered_plugins = array_intersect_key( $filtered_plugins, array_flip( $matches ) ); - } - } - - // Return plugin data filtered by args. - return ! empty( $filtered_plugins ) ? array_intersect_key( $all_plugins, $filtered_plugins ) : []; - } - - /** - * {@inheritDoc} - */ - public function get_loader_name() { - return 'plugin'; - } - - /** - * {@inheritDoc} - */ - public function is_valid_offset( $offset ) { - // File has not loaded. - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - // This is missing must use and drop in plugins, so we need to fetch and merge them separately. - $site_plugins = apply_filters( 'all_plugins', get_plugins() ); - $mu_plugins = apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ? get_mu_plugins() : []; - $dropin_plugins = apply_filters( 'show_advanced_plugins', true, 'dropins' ) ? get_dropins() : []; - - $all_plugins = array_merge( $site_plugins, $mu_plugins, $dropin_plugins ); - - return array_key_exists( $offset, $all_plugins ); - } - - /** - * @return bool - */ - public function should_execute() { - if ( is_multisite() ) { - // update_, install_, and delete_ are handled above with is_super_admin(). - $menu_perms = get_site_option( 'menu_items', [] ); - if ( empty( $menu_perms['plugins'] ) && ! current_user_can( 'manage_network_plugins' ) ) { - return false; - } - } elseif ( ! current_user_can( 'activate_plugins' ) ) { - return false; - } - - return true; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/PostObjectConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/PostObjectConnectionResolver.php deleted file mode 100644 index 03881b0b..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/PostObjectConnectionResolver.php +++ /dev/null @@ -1,622 +0,0 @@ -post_type = $post_type; - } elseif ( 'any' === $post_type ) { - $post_types = \WPGraphQL::get_allowed_post_types(); - $this->post_type = ! empty( $post_types ) ? array_values( $post_types ) : []; - } else { - $post_type = is_array( $post_type ) ? $post_type : [ $post_type ]; - unset( $post_type['attachment'] ); - unset( $post_type['revision'] ); - $this->post_type = $post_type; - } - - /** - * Call the parent construct to setup class data - */ - parent::__construct( $source, $args, $context, $info ); - } - - /** - * Return the name of the loader - * - * @return string - */ - public function get_loader_name() { - return 'post'; - } - - /** - * Returns the query being executed - * - * @return \WP_Query|object - * - * @throws \Exception - */ - public function get_query() { - // Get query class. - $queryClass = ! empty( $this->context->queryClass ) - ? $this->context->queryClass - : '\WP_Query'; - - $query = new $queryClass( $this->query_args ); - - if ( isset( $query->query_vars['suppress_filters'] ) && true === $query->query_vars['suppress_filters'] ) { - throw new InvariantViolation( esc_html__( 'WP_Query has been modified by a plugin or theme to suppress_filters, which will cause issues with WPGraphQL Execution. If you need to suppress filters for a specific reason within GraphQL, consider registering a custom field to the WPGraphQL Schema with a custom resolver.', 'wp-graphql' ) ); - } - - return $query; - } - - /** - * {@inheritDoc} - */ - public function get_ids_from_query() { - $ids = ! empty( $this->query->posts ) ? $this->query->posts : []; - - // If we're going backwards, we need to reverse the array. - if ( ! empty( $this->args['last'] ) ) { - $ids = array_reverse( $ids ); - } - - return $ids; - } - - /** - * Determine whether the Query should execute. If it's determined that the query should - * not be run based on context such as, but not limited to, who the user is, where in the - * ResolveTree the Query is, the relation to the node the Query is connected to, etc - * - * Return false to prevent the query from executing. - * - * @return bool - */ - public function should_execute() { - if ( false === $this->should_execute ) { - return false; - } - - /** - * For revisions, we only want to execute the connection query if the user - * has access to edit the parent post. - * - * If the user doesn't have permission to edit the parent post, then we shouldn't - * even execute the connection - */ - if ( isset( $this->post_type ) && 'revision' === $this->post_type ) { - if ( $this->source instanceof Post ) { - $parent_post_type_obj = get_post_type_object( $this->source->post_type ); - if ( ! isset( $parent_post_type_obj->cap->edit_post ) || ! current_user_can( $parent_post_type_obj->cap->edit_post, $this->source->ID ) ) { - $this->should_execute = false; - } - /** - * If the connection is from the RootQuery, check if the user - * has the 'edit_posts' capability - */ - } elseif ( ! current_user_can( 'edit_posts' ) ) { - $this->should_execute = false; - } - } - - return $this->should_execute; - } - - /** - * Here, we map the args from the input, then we make sure that we're only querying - * for IDs. The IDs are then passed down the resolve tree, and deferred resolvers - * handle batch resolution of the posts. - * - * @return array - */ - public function get_query_args() { - /** - * Prepare for later use - */ - $last = ! empty( $this->args['last'] ) ? $this->args['last'] : null; - $first = ! empty( $this->args['first'] ) ? $this->args['first'] : null; - - $query_args = []; - /** - * Ignore sticky posts by default - */ - $query_args['ignore_sticky_posts'] = true; - - /** - * Set the post_type for the query based on the type of post being queried - */ - $query_args['post_type'] = ! empty( $this->post_type ) ? $this->post_type : 'post'; - - /** - * Don't calculate the total rows, it's not needed and can be expensive - */ - $query_args['no_found_rows'] = true; - - /** - * Set the post_status to "publish" by default - */ - $query_args['post_status'] = 'publish'; - - /** - * Set posts_per_page the highest value of $first and $last, with a (filterable) max of 100 - */ - $query_args['posts_per_page'] = $this->one_to_one ? 1 : min( max( absint( $first ), absint( $last ), 10 ), $this->query_amount ) + 1; - - // set the graphql cursor args - $query_args['graphql_cursor_compare'] = ( ! empty( $last ) ) ? '>' : '<'; - $query_args['graphql_after_cursor'] = $this->get_after_offset(); - $query_args['graphql_before_cursor'] = $this->get_before_offset(); - - /** - * If the cursor offsets not empty, - * ignore sticky posts on the query - */ - if ( ! empty( $this->get_after_offset() ) || ! empty( $this->get_after_offset() ) ) { - $query_args['ignore_sticky_posts'] = true; - } - - /** - * Pass the graphql $args to the WP_Query - */ - $query_args['graphql_args'] = $this->args; - - /** - * Collect the input_fields and sanitize them to prepare them for sending to the WP_Query - */ - $input_fields = []; - if ( ! empty( $this->args['where'] ) ) { - $input_fields = $this->sanitize_input_fields( $this->args['where'] ); - } - - /** - * If the post_type is "attachment" set the default "post_status" $query_arg to "inherit" - */ - if ( 'attachment' === $this->post_type || 'revision' === $this->post_type ) { - $query_args['post_status'] = 'inherit'; - } - - /** - * Unset the "post_parent" for attachments, as we don't really care if they - * have a post_parent set by default - */ - if ( 'attachment' === $this->post_type && isset( $input_fields['parent'] ) ) { - unset( $input_fields['parent'] ); - } - - /** - * Merge the input_fields with the default query_args - */ - if ( ! empty( $input_fields ) ) { - $query_args = array_merge( $query_args, $input_fields ); - } - - /** - * If the query is a search, the source is not another Post, and the parent input $arg is not - * explicitly set in the query, unset the $query_args['post_parent'] so the search - * can search all posts, not just top level posts. - */ - if ( ! $this->source instanceof \WP_Post && isset( $query_args['search'] ) && ! isset( $input_fields['parent'] ) ) { - unset( $query_args['post_parent'] ); - } - - /** - * If the query contains search default the results to - */ - if ( isset( $query_args['search'] ) && ! empty( $query_args['search'] ) ) { - /** - * Don't order search results by title (causes funky issues with cursors) - */ - $query_args['search_orderby_title'] = false; - $query_args['orderby'] = 'date'; - $query_args['order'] = isset( $last ) ? 'ASC' : 'DESC'; - } - - if ( empty( $this->args['where']['orderby'] ) && ! empty( $query_args['post__in'] ) ) { - $post_in = $query_args['post__in']; - // Make sure the IDs are integers - $post_in = array_map( - static function ( $id ) { - return absint( $id ); - }, - $post_in - ); - - // If we're coming backwards, let's reverse the IDs - if ( ! empty( $this->args['last'] ) || ! empty( $this->args['before'] ) ) { - $post_in = array_reverse( $post_in ); - } - - $cursor_offset = $this->get_offset_for_cursor( $this->args['after'] ?? ( $this->args['before'] ?? 0 ) ); - - if ( ! empty( $cursor_offset ) ) { - // Determine if the offset is in the array - $key = array_search( $cursor_offset, $post_in, true ); - - // If the offset is in the array - if ( false !== $key ) { - $key = absint( $key ); - $post_in = array_slice( $post_in, $key + 1, null, true ); - } - } - - $query_args['post__in'] = $post_in; - $query_args['orderby'] = 'post__in'; - $query_args['order'] = isset( $last ) ? 'ASC' : 'DESC'; - } - - /** - * Map the orderby inputArgs to the WP_Query - */ - if ( isset( $this->args['where']['orderby'] ) && is_array( $this->args['where']['orderby'] ) ) { - $query_args['orderby'] = []; - - foreach ( $this->args['where']['orderby'] as $orderby_input ) { - // Create a type hint for orderby_input. This is an array with a field and order key. - /** @var array $orderby_input */ - if ( empty( $orderby_input['field'] ) ) { - continue; - } - - /** - * These orderby options should not include the order parameter. - */ - if ( in_array( - $orderby_input['field'], - [ - 'post__in', - 'post_name__in', - 'post_parent__in', - ], - true - ) ) { - $query_args['orderby'] = esc_sql( $orderby_input['field'] ); - - // If we're ordering explicitly, there's no reason to check other orderby inputs. - break; - } - - $order = $orderby_input['order']; - - if ( isset( $query_args['graphql_args']['last'] ) && ! empty( $query_args['graphql_args']['last'] ) ) { - if ( 'ASC' === $order ) { - $order = 'DESC'; - } else { - $order = 'ASC'; - } - } - - $query_args['orderby'][ esc_sql( $orderby_input['field'] ) ] = esc_sql( $order ); - } - } - - /** - * Convert meta_value_num to separate meta_value value field which our - * graphql_wp_term_query_cursor_pagination_support knowns how to handle - */ - if ( isset( $query_args['orderby'] ) && 'meta_value_num' === $query_args['orderby'] ) { - $query_args['orderby'] = [ - 'meta_value' => empty( $query_args['order'] ) ? 'DESC' : $query_args['order'], // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value - ]; - unset( $query_args['order'] ); - $query_args['meta_type'] = 'NUMERIC'; - } - - /** - * If there's no orderby params in the inputArgs, set order based on the first/last argument - */ - if ( empty( $query_args['orderby'] ) ) { - $query_args['order'] = ! empty( $last ) ? 'ASC' : 'DESC'; - } - - /** - * NOTE: Only IDs should be queried here as the Deferred resolution will handle - * fetching the full objects, either from cache of from a follow-up query to the DB - */ - $query_args['fields'] = 'ids'; - - /** - * Filter the $query args to allow folks to customize queries programmatically - * - * @param array $query_args The args that will be passed to the WP_Query - * @param mixed $source The source that's passed down the GraphQL queries - * @param array $args The inputArgs on the field - * @param \WPGraphQL\AppContext $context The AppContext passed down the GraphQL tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the GraphQL tree - */ - return apply_filters( 'graphql_post_object_connection_query_args', $query_args, $this->source, $this->args, $this->context, $this->info ); - } - - /** - * This sets up the "allowed" args, and translates the GraphQL-friendly keys to WP_Query - * friendly keys. There's probably a cleaner/more dynamic way to approach this, but - * this was quick. I'd be down to explore more dynamic ways to map this, but for - * now this gets the job done. - * - * @param array $where_args The args passed to the connection - * - * @return array - * @since 0.0.5 - */ - public function sanitize_input_fields( array $where_args ) { - $arg_mapping = [ - 'authorIn' => 'author__in', - 'authorName' => 'author_name', - 'authorNotIn' => 'author__not_in', - 'categoryId' => 'cat', - 'categoryIn' => 'category__in', - 'categoryName' => 'category_name', - 'categoryNotIn' => 'category__not_in', - 'contentTypes' => 'post_type', - 'dateQuery' => 'date_query', - 'hasPassword' => 'has_password', - 'id' => 'p', - 'in' => 'post__in', - 'mimeType' => 'post_mime_type', - 'nameIn' => 'post_name__in', - 'notIn' => 'post__not_in', - 'parent' => 'post_parent', - 'parentIn' => 'post_parent__in', - 'parentNotIn' => 'post_parent__not_in', - 'password' => 'post_password', - 'search' => 's', - 'stati' => 'post_status', - 'status' => 'post_status', - 'tagId' => 'tag_id', - 'tagIds' => 'tag__and', - 'tagIn' => 'tag__in', - 'tagNotIn' => 'tag__not_in', - 'tagSlugAnd' => 'tag_slug__and', - 'tagSlugIn' => 'tag_slug__in', - ]; - - /** - * Map and sanitize the input args to the WP_Query compatible args - */ - $query_args = Utils::map_input( $where_args, $arg_mapping ); - - if ( ! empty( $query_args['post_status'] ) ) { - $allowed_stati = $this->sanitize_post_stati( $query_args['post_status'] ); - $query_args['post_status'] = ! empty( $allowed_stati ) ? $allowed_stati : [ 'publish' ]; - } - - /** - * Filter the input fields - * This allows plugins/themes to hook in and alter what $args should be allowed to be passed - * from a GraphQL Query to the WP_Query - * - * @param array $query_args The mapped query arguments - * @param array $args Query "where" args - * @param mixed $source The query results for a query calling this - * @param array $all_args All of the arguments for the query (not just the "where" args) - * @param \WPGraphQL\AppContext $context The AppContext object - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * @param mixed|string|array $post_type The post type for the query - * - * @return array - * @since 0.0.5 - */ - $query_args = apply_filters( 'graphql_map_input_fields_to_wp_query', $query_args, $where_args, $this->source, $this->args, $this->context, $this->info, $this->post_type ); - - /** - * Return the Query Args - */ - return ! empty( $query_args ) && is_array( $query_args ) ? $query_args : []; - } - - /** - * Limit the status of posts a user can query. - * - * By default, published posts are public, and other statuses require permission to access. - * - * This strips the status from the query_args if the user doesn't have permission to query for - * posts of that status. - * - * @param mixed $stati The status(es) to sanitize - * - * @return array|null - */ - public function sanitize_post_stati( $stati ) { - - /** - * If no stati is explicitly set by the input, default to publish. This will be the - * most common scenario. - */ - if ( empty( $stati ) ) { - $stati = [ 'publish' ]; - } - - /** - * Parse the list of stati - */ - $statuses = wp_parse_slug_list( $stati ); - - /** - * Get the Post Type object - */ - $post_type_objects = []; - if ( is_array( $this->post_type ) ) { - foreach ( $this->post_type as $post_type ) { - $post_type_objects[] = get_post_type_object( $post_type ); - } - } else { - $post_type_objects[] = get_post_type_object( $this->post_type ); - } - - /** - * Make sure the statuses are allowed to be queried by the current user. If so, allow it, - * otherwise return null, effectively removing it from the $allowed_statuses that will - * be passed to WP_Query - */ - $allowed_statuses = array_filter( - array_map( - static function ( $status ) use ( $post_type_objects ) { - foreach ( $post_type_objects as $post_type_object ) { - if ( 'publish' === $status ) { - return $status; - } - - if ( 'private' === $status && ( ! isset( $post_type_object->cap->read_private_posts ) || ! current_user_can( $post_type_object->cap->read_private_posts ) ) ) { - return null; - } - - if ( ! isset( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->edit_posts ) ) { - return null; - } - - return $status; - } - }, - $statuses - ) - ); - - /** - * If there are no allowed statuses to pass to WP_Query, prevent the connection - * from executing - * - * For example, if a subscriber tries to query: - * - * { - * posts( where: { stati: [ DRAFT ] } ) { - * ...fields - * } - * } - * - * We can safely prevent the execution of the query because they are asking for content - * in a status that we know they can't ask for. - */ - if ( empty( $allowed_statuses ) ) { - $this->should_execute = false; - } - - /** - * Return the $allowed_statuses to the query args - */ - return $allowed_statuses; - } - - /** - * Filters the GraphQL args before they are used in get_query_args(). - * - * @return array - */ - public function get_args(): array { - $args = $this->args; - - if ( ! empty( $args['where'] ) ) { - // Ensure all IDs are converted to database IDs. - foreach ( $args['where'] as $input_key => $input_value ) { - if ( empty( $input_value ) ) { - continue; - } - - switch ( $input_key ) { - case 'in': - case 'notIn': - case 'parent': - case 'parentIn': - case 'parentNotIn': - case 'authorIn': - case 'authorNotIn': - case 'categoryIn': - case 'categoryNotIn': - case 'tagId': - case 'tagIn': - case 'tagNotIn': - if ( is_array( $input_value ) ) { - $args['where'][ $input_key ] = array_map( - static function ( $id ) { - return Utils::get_database_id_from_id( $id ); - }, - $input_value - ); - break; - } - - $args['where'][ $input_key ] = Utils::get_database_id_from_id( $input_value ); - break; - } - } - } - - /** - * - * Filters the GraphQL args before they are used in get_query_args(). - * - * @param array $args The GraphQL args passed to the resolver. - * @param \WPGraphQL\Data\Connection\PostObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver. - * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. - * - * @since 1.11.0 - */ - return apply_filters( 'graphql_post_object_connection_args', $args, $this, $this->args ); - } - - /** - * Determine whether or not the the offset is valid, i.e the post corresponding to the offset - * exists. Offset is equivalent to post_id. So this function is equivalent to checking if the - * post with the given ID exists. - * - * @param int $offset The ID of the node used in the cursor offset - * - * @return bool - */ - public function is_valid_offset( $offset ) { - return (bool) get_post( absint( $offset ) ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/TaxonomyConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/TaxonomyConnectionResolver.php deleted file mode 100644 index 76235289..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/TaxonomyConnectionResolver.php +++ /dev/null @@ -1,90 +0,0 @@ -query; - - if ( empty( $queried ) ) { - return $ids; - } - - foreach ( $queried as $item ) { - $ids[] = $item; - } - - return $ids; - } - - /** - * {@inheritDoc} - */ - public function get_query_args() { - // If any args are added to filter/sort the connection - return []; - } - - - /** - * Get the items from the source - * - * @return array - */ - public function get_query() { - if ( isset( $this->query_args['name'] ) ) { - return [ $this->query_args['name'] ]; - } - - if ( isset( $this->query_args['in'] ) ) { - return is_array( $this->query_args['in'] ) ? $this->query_args['in'] : [ $this->query_args['in'] ]; - } - - $query_args = $this->query_args; - return \WPGraphQL::get_allowed_taxonomies( 'names', $query_args ); - } - - /** - * The name of the loader to load the data - * - * @return string - */ - public function get_loader_name() { - return 'taxonomy'; - } - - /** - * Determine if the offset used for pagination is valid - * - * @param mixed $offset - * - * @return bool - */ - public function is_valid_offset( $offset ) { - return (bool) get_taxonomy( $offset ); - } - - /** - * Determine if the query should execute - * - * @return bool - */ - public function should_execute() { - return true; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/TermObjectConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/TermObjectConnectionResolver.php deleted file mode 100644 index c0b4583b..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/TermObjectConnectionResolver.php +++ /dev/null @@ -1,324 +0,0 @@ -taxonomy = $taxonomy; - parent::__construct( $source, $args, $context, $info ); - } - - /** - * {@inheritDoc} - */ - public function get_query_args() { - $all_taxonomies = \WPGraphQL::get_allowed_taxonomies(); - $taxonomy = ! empty( $this->taxonomy ) && in_array( $this->taxonomy, $all_taxonomies, true ) ? [ $this->taxonomy ] : $all_taxonomies; - - if ( ! empty( $this->args['where']['taxonomies'] ) ) { - /** - * Set the taxonomy for the $args - */ - $requested_taxonomies = $this->args['where']['taxonomies']; - $taxonomy = array_intersect( $all_taxonomies, $requested_taxonomies ); - } - - - $query_args = [ - 'taxonomy' => $taxonomy, - ]; - - /** - * Prepare for later use - */ - $last = ! empty( $this->args['last'] ) ? $this->args['last'] : null; - $first = ! empty( $this->args['first'] ) ? $this->args['first'] : null; - - /** - * Set hide_empty as false by default - */ - $query_args['hide_empty'] = false; - - /** - * Set the number, ensuring it doesn't exceed the amount set as the $max_query_amount - */ - $query_args['number'] = min( max( absint( $first ), absint( $last ), 10 ), $this->query_amount ) + 1; - - /** - * Don't calculate the total rows, it's not needed and can be expensive - */ - $query_args['count'] = false; - - /** - * Take any of the $args that were part of the GraphQL query and map their - * GraphQL names to the WP_Term_Query names to be used in the WP_Term_Query - * - * @since 0.0.5 - */ - $input_fields = []; - if ( ! empty( $this->args['where'] ) ) { - $input_fields = $this->sanitize_input_fields(); - } - - /** - * Merge the default $query_args with the $args that were entered - * in the query. - * - * @since 0.0.5 - */ - if ( ! empty( $input_fields ) ) { - $query_args = array_merge( $query_args, $input_fields ); - } - - $query_args['graphql_cursor_compare'] = ( ! empty( $last ) ) ? '>' : '<'; - $query_args['graphql_after_cursor'] = $this->get_after_offset(); - $query_args['graphql_before_cursor'] = $this->get_before_offset(); - - /** - * Pass the graphql $args to the WP_Query - */ - $query_args['graphql_args'] = $this->args; - - /** - * NOTE: We query for JUST the IDs here as deferred resolution of the nodes gets the full - * object from the cache or a follow-up request for the full object if it's not cached. - */ - $query_args['fields'] = 'ids'; - - /** - * If there's no orderby params in the inputArgs, default to ordering by name. - */ - if ( empty( $query_args['orderby'] ) ) { - $query_args['orderby'] = 'name'; - } - - /** - * If orderby params set but not order, default to ASC if going forward, DESC if going backward. - */ - if ( empty( $query_args['order'] ) && 'name' === $query_args['orderby'] ) { - $query_args['order'] = ! empty( $last ) ? 'DESC' : 'ASC'; - } elseif ( empty( $query_args['order'] ) ) { - $query_args['order'] = ! empty( $last ) ? 'ASC' : 'DESC'; - } - - /** - * Filter the query_args that should be applied to the query. This filter is applied AFTER the input args from - * the GraphQL Query have been applied and has the potential to override the GraphQL Query Input Args. - * - * @param array $query_args array of query_args being passed to the - * @param mixed $source source passed down from the resolve tree - * @param array $args array of arguments input in the field as part of the GraphQL query - * @param \WPGraphQL\AppContext $context object passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info info about fields passed down the resolve tree - * - * @since 0.0.6 - */ - $query_args = apply_filters( 'graphql_term_object_connection_query_args', $query_args, $this->source, $this->args, $this->context, $this->info ); - - return $query_args; - } - - /** - * Return an instance of WP_Term_Query with the args mapped to the query - * - * @return \WP_Term_Query - * @throws \Exception - */ - public function get_query() { - return new \WP_Term_Query( $this->query_args ); - } - - /** - * {@inheritDoc} - */ - public function get_ids_from_query() { - /** @var string[] $ids **/ - $ids = ! empty( $this->query->get_terms() ) ? $this->query->get_terms() : []; - - // If we're going backwards, we need to reverse the array. - if ( ! empty( $this->args['last'] ) ) { - $ids = array_reverse( $ids ); - } - - return $ids; - } - - /** - * {@inheritDoc} - */ - public function get_loader_name() { - return 'term'; - } - - /** - * Whether the connection query should execute. Certain contexts _may_ warrant - * restricting the query to execute at all. Default is true, meaning any time - * a TermObjectConnection resolver is asked for, it will execute. - * - * @return bool - */ - public function should_execute() { - return true; - } - - /** - * This maps the GraphQL "friendly" args to get_terms $args. - * There's probably a cleaner/more dynamic way to approach this, but this was quick. I'd be down - * to explore more dynamic ways to map this, but for now this gets the job done. - * - * @since 0.0.5 - * @return array - */ - public function sanitize_input_fields() { - $arg_mapping = [ - 'objectIds' => 'object_ids', - 'hideEmpty' => 'hide_empty', - 'excludeTree' => 'exclude_tree', - 'termTaxonomId' => 'term_taxonomy_id', - 'termTaxonomyId' => 'term_taxonomy_id', - 'nameLike' => 'name__like', - 'descriptionLike' => 'description__like', - 'padCounts' => 'pad_counts', - 'childOf' => 'child_of', - 'cacheDomain' => 'cache_domain', - 'updateTermMetaCache' => 'update_term_meta_cache', - 'taxonomies' => 'taxonomy', - ]; - - $where_args = ! empty( $this->args['where'] ) ? $this->args['where'] : null; - - // Deprecate usage of 'termTaxonomId'. - if ( ! empty( $where_args['termTaxonomId'] ) ) { - _deprecated_argument( 'where.termTaxonomId', '1.11.0', 'The `termTaxonomId` where arg is deprecated. Use `termTaxonomyId` instead.' ); - - // Only convert value if 'termTaxonomyId' isnt already set. - if ( empty( $where_args['termTaxonomyId'] ) ) { - $where_args['termTaxonomyId'] = $where_args['termTaxonomId']; - } - } - - /** - * Map and sanitize the input args to the WP_Term_Query compatible args - */ - $query_args = Utils::map_input( $where_args, $arg_mapping ); - - /** - * Filter the input fields - * This allows plugins/themes to hook in and alter what $args should be allowed to be passed - * from a GraphQL Query to the get_terms query - * - * @param array $query_args Array of mapped query args - * @param array $where_args Array of query "where" args - * @param string $taxonomy The name of the taxonomy - * @param mixed $source The query results - * @param array $all_args All of the query arguments (not just the "where" args) - * @param \WPGraphQL\AppContext $context The AppContext object - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * - * @since 0.0.5 - * @return array - */ - $query_args = apply_filters( 'graphql_map_input_fields_to_get_terms', $query_args, $where_args, $this->taxonomy, $this->source, $this->args, $this->context, $this->info ); - - return ! empty( $query_args ) && is_array( $query_args ) ? $query_args : []; - } - - /** - * Filters the GraphQL args before they are used in get_query_args(). - * - * @return array - */ - public function get_args(): array { - $args = $this->args; - - if ( ! empty( $args['where'] ) ) { - // Ensure all IDs are converted to database IDs. - foreach ( $args['where'] as $input_key => $input_value ) { - if ( empty( $input_value ) ) { - continue; - } - - switch ( $input_key ) { - case 'exclude': - case 'excludeTree': - case 'include': - case 'objectIds': - case 'termTaxonomId': - case 'termTaxonomyId': - if ( is_array( $input_value ) ) { - $args['where'][ $input_key ] = array_map( - static function ( $id ) { - return Utils::get_database_id_from_id( $id ); - }, - $input_value - ); - break; - } - - $args['where'][ $input_key ] = Utils::get_database_id_from_id( $input_value ); - break; - } - } - } - - /** - * - * Filters the GraphQL args before they are used in get_query_args(). - * - * @param array $args The GraphQL args passed to the resolver. - * @param \WPGraphQL\Data\Connection\TermObjectConnectionResolver $connection_resolver Instance of the ConnectionResolver - * @param array $unfiltered_args Array of arguments input in the field as part of the GraphQL query. - * - * @since 1.11.0 - */ - return apply_filters( 'graphql_term_object_connection_args', $args, $this, $this->args ); - } - - /** - * Determine whether or not the the offset is valid, i.e the term corresponding to the offset - * exists. Offset is equivalent to term_id. So this function is equivalent to checking if the - * term with the given ID exists. - * - * @param int $offset The ID of the node used in the cursor for offset - * - * @return bool - */ - public function is_valid_offset( $offset ) { - return get_term( absint( $offset ) ) instanceof \WP_Term; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/ThemeConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/ThemeConnectionResolver.php deleted file mode 100644 index 0c08f4c1..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/ThemeConnectionResolver.php +++ /dev/null @@ -1,88 +0,0 @@ -query ) ? $this->query : []; - - if ( empty( $queried ) ) { - return $ids; - } - - foreach ( $queried as $key => $item ) { - $ids[ $key ] = $item; - } - - return $ids; - } - - /** - * {@inheritDoc} - */ - public function get_query_args() { - $query_args = [ - 'allowed' => null, - ]; - - return $query_args; - } - - - /** - * Get the items from the source - * - * @return array - */ - public function get_query() { - $query_args = $this->query_args; - - return array_keys( wp_get_themes( $query_args ) ); - } - - /** - * The name of the loader to load the data - * - * @return string - */ - public function get_loader_name() { - return 'theme'; - } - - /** - * Determine if the offset used for pagination is valid - * - * @param mixed $offset - * - * @return bool - */ - public function is_valid_offset( $offset ) { - $theme = wp_get_theme( $offset ); - return $theme->exists(); - } - - /** - * Determine if the query should execute - * - * @return bool - */ - public function should_execute() { - return true; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/UserConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/UserConnectionResolver.php deleted file mode 100644 index 7a02db68..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/UserConnectionResolver.php +++ /dev/null @@ -1,299 +0,0 @@ -args['last'] ) ? $this->args['last'] : null; - - /** - * Set the $query_args based on various defaults and primary input $args - */ - $query_args['count_total'] = false; - - /** - * Pass the graphql $args to the WP_Query - */ - $query_args['graphql_args'] = $this->args; - - /** - * Set the graphql_cursor_compare to determine what direction the - * query should be paginated - */ - $query_args['graphql_cursor_compare'] = ( ! empty( $last ) ) ? '>' : '<'; - - $query_args['graphql_after_cursor'] = $this->get_after_offset(); - $query_args['graphql_before_cursor'] = $this->get_before_offset(); - - /** - * Set the number, ensuring it doesn't exceed the amount set as the $max_query_amount - * - * We query one extra than what is being asked for so that we can determine if there is a next - * page. - */ - $query_args['number'] = $this->get_query_amount() + 1; - - /** - * Take any of the input $args (under the "where" input) that were part of the GraphQL query and map and - * sanitize their GraphQL input to apply to the WP_Query - */ - $input_fields = []; - if ( ! empty( $this->args['where'] ) ) { - $input_fields = $this->sanitize_input_fields( $this->args['where'] ); - } - - /** - * Merge the default $query_args with the $args that were entered in the query. - * - * @since 0.0.5 - */ - if ( ! empty( $input_fields ) ) { - $query_args = array_merge( $query_args, $input_fields ); - } - - /** - * Only query the IDs and let deferred resolution query the nodes - */ - $query_args['fields'] = 'ID'; - - /** - * If the request is not authenticated, limit the query to users that have - * published posts, as they're considered publicly facing users. - */ - if ( ! is_user_logged_in() && empty( $query_args['has_published_posts'] ) ) { - $query_args['has_published_posts'] = true; - } - - /** - * If `has_published_posts` is set to `attachment`, throw a warning. - * - * @todo Remove this when the `hasPublishedPosts` enum type changes. - * - * @see https://github.com/wp-graphql/wp-graphql/issues/2963 - */ - if ( ! empty( $query_args['has_published_posts'] ) && 'attachment' === $query_args['has_published_posts'] ) { - graphql_debug( - __( 'The `hasPublishedPosts` where arg does not support the `ATTACHMENT` value, and will be removed from the possible enum values in a future release.', 'wp-graphql' ), - [ - 'operationName' => $this->context->operationName ?? '', - 'query' => $this->context->query ?? '', - 'variables' => $this->context->variables ?? '', - ] - ); - } - - if ( ! empty( $query_args['search'] ) ) { - $query_args['search'] = '*' . $query_args['search'] . '*'; - $query_args['orderby'] = 'user_login'; - $query_args['order'] = ! empty( $last ) ? 'DESC' : 'ASC'; - } - - /** - * Map the orderby inputArgs to the WP_User_Query - */ - if ( ! empty( $this->args['where']['orderby'] ) && is_array( $this->args['where']['orderby'] ) ) { - foreach ( $this->args['where']['orderby'] as $orderby_input ) { - /** - * These orderby options should not include the order parameter. - */ - if ( in_array( - $orderby_input['field'], - [ - 'login__in', - 'nicename__in', - ], - true - ) ) { - $query_args['orderby'] = esc_sql( $orderby_input['field'] ); - } elseif ( ! empty( $orderby_input['field'] ) ) { - $order = $orderby_input['order']; - if ( ! empty( $this->args['last'] ) ) { - if ( 'ASC' === $order ) { - $order = 'DESC'; - } else { - $order = 'ASC'; - } - } - - $query_args['orderby'] = esc_sql( $orderby_input['field'] ); - $query_args['order'] = esc_sql( $order ); - } - } - } - - /** - * Convert meta_value_num to separate meta_value value field which our - * graphql_wp_term_query_cursor_pagination_support knowns how to handle - */ - if ( isset( $query_args['orderby'] ) && 'meta_value_num' === $query_args['orderby'] ) { - $query_args['orderby'] = [ - 'meta_value' => empty( $query_args['order'] ) ? 'DESC' : $query_args['order'], // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value - ]; - unset( $query_args['order'] ); - $query_args['meta_type'] = 'NUMERIC'; - } - - /** - * If there's no orderby params in the inputArgs, set order based on the first/last argument - */ - if ( empty( $query_args['order'] ) ) { - $query_args['order'] = ! empty( $last ) ? 'DESC' : 'ASC'; - } - - return $query_args; - } - - /** - * Return an instance of the WP_User_Query with the args for the connection being executed - * - * @return object|\WP_User_Query - * @throws \Exception - */ - public function get_query() { - // Get query class. - $queryClass = ! empty( $this->context->queryClass ) - ? $this->context->queryClass - : '\WP_User_Query'; - - return new $queryClass( $this->query_args ); - } - - /** - * Returns an array of ids from the query being executed. - * - * @return array - */ - public function get_ids_from_query() { - $ids = method_exists( $this->query, 'get_results' ) ? $this->query->get_results() : []; - - // If we're going backwards, we need to reverse the array. - if ( ! empty( $this->args['last'] ) ) { - $ids = array_reverse( $ids ); - } - - return $ids; - } - - /** - * This sets up the "allowed" args, and translates the GraphQL-friendly keys to WP_User_Query - * friendly keys. - * - * There's probably a cleaner/more dynamic way to approach this, but this was quick. I'd be - * down to explore more dynamic ways to map this, but for now this gets the job done. - * - * @param array $args The query "where" args - * - * @return array - * @since 0.0.5 - */ - protected function sanitize_input_fields( array $args ) { - - /** - * Only users with the "list_users" capability can filter users by roles - */ - if ( - ( - ! empty( $args['roleIn'] ) || - ! empty( $args['roleNotIn'] ) || - ! empty( $args['role'] ) - ) && - ! current_user_can( 'list_users' ) - ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to filter users by role.', 'wp-graphql' ) ); - } - - $arg_mapping = [ - 'roleIn' => 'role__in', - 'roleNotIn' => 'role__not_in', - 'searchColumns' => 'search_columns', - 'hasPublishedPosts' => 'has_published_posts', - 'nicenameIn' => 'nicename__in', - 'nicenameNotIn' => 'nicename__not_in', - 'loginIn' => 'login__in', - 'loginNotIn' => 'login__not_in', - ]; - - /** - * Map and sanitize the input args to the WP_User_Query compatible args - */ - $query_args = Utils::map_input( $args, $arg_mapping ); - - /** - * Filter the input fields - * - * This allows plugins/themes to hook in and alter what $args should be allowed to be passed - * from a GraphQL Query to the WP_User_Query - * - * @param array $query_args The mapped query args - * @param array $args The query "where" args - * @param mixed $source The query results of the query calling this relation - * @param array $all_args Array of all the query args (not just the "where" args) - * @param \WPGraphQL\AppContext $context The AppContext object - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * - * @return array - * @since 0.0.5 - */ - $query_args = apply_filters( 'graphql_map_input_fields_to_wp_user_query', $query_args, $args, $this->source, $this->args, $this->context, $this->info ); - - return ! empty( $query_args ) && is_array( $query_args ) ? $query_args : []; - } - - /** - * Determine whether or not the the offset is valid, i.e the user corresponding to the offset - * exists. Offset is equivalent to user_id. So this function is equivalent to checking if the - * user with the given ID exists. - * - * @param int $offset The ID of the node used as the offset in the cursor - * - * @return bool - */ - public function is_valid_offset( $offset ) { - return (bool) get_user_by( 'ID', absint( $offset ) ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Connection/UserRoleConnectionResolver.php b/lib/wp-graphql-1.17.0/src/Data/Connection/UserRoleConnectionResolver.php deleted file mode 100644 index be0c9946..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Connection/UserRoleConnectionResolver.php +++ /dev/null @@ -1,97 +0,0 @@ -query_args['slugIn'] ) ) { - return $this->query_args['slugIn']; - } - - $ids = []; - $queried = $this->get_query(); - - if ( empty( $queried ) ) { - return $ids; - } - - foreach ( $queried as $key => $item ) { - $ids[ $key ] = $item; - } - - return $ids; - } - - /** - * {@inheritDoc} - */ - public function get_query_args() { - // If any args are added to filter/sort the connection - return []; - } - - /** - * {@inheritDoc} - * - * @return array - */ - public function get_query() { - $wp_roles = wp_roles(); - $roles = ! empty( $wp_roles->get_names() ) ? array_keys( $wp_roles->get_names() ) : []; - - return $roles; - } - - /** - * {@inheritDoc} - */ - public function get_loader_name() { - return 'user_role'; - } - - /** - * @param mixed $offset Whether the provided offset is valid for the connection - * - * @return bool - */ - public function is_valid_offset( $offset ) { - return (bool) get_role( $offset ); - } - - /** - * @return bool - */ - public function should_execute() { - if ( - current_user_can( 'list_users' ) || - ( - $this->source instanceof User && - get_current_user_id() === $this->source->userId - ) - ) { - return true; - } - - return false; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/AbstractCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/AbstractCursor.php deleted file mode 100644 index 309a2f09..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Cursor/AbstractCursor.php +++ /dev/null @@ -1,329 +0,0 @@ -wpdb = $wpdb; - $this->query_vars = $query_vars; - $this->cursor = $cursor; - - /** - * Get the cursor offset if any - */ - $offset = $this->get_query_var( 'graphql_' . $cursor . '_cursor' ); - - // Handle deprecated use of `graphql_cursor_offset`. - if ( empty( $offset ) ) { - $offset = $this->get_query_var( 'graphql_cursor_offset' ); - - if ( ! empty( $offset ) ) { - _doing_it_wrong( self::class . "::get_query_var('graphql_cursor_offset')", "Use 'graphql_before_cursor' or 'graphql_after_cursor' instead.", '1.9.0' ); - } - } - - $this->cursor_offset = ! empty( $offset ) ? absint( $offset ) : 0; - - // Get the WP Object for the cursor. - $this->cursor_node = $this->get_cursor_node(); - - // Get the direction for the builder query. - $this->compare = $this->get_cursor_compare(); - - $this->builder = new CursorBuilder( $this->compare ); - } - - /** - * Get the query variable for the provided name. - * - * @param string $name . - * - * @return mixed|null - */ - public function get_query_var( string $name ) { - if ( isset( $this->query_vars[ $name ] ) && '' !== $this->query_vars[ $name ] ) { - return $this->query_vars[ $name ]; - } - return null; - } - - /** - * Get the direction pagination is going in. - * - * @return string - */ - public function get_cursor_compare() { - if ( 'before' === $this->cursor ) { - return '>'; - } - - return '<'; - } - - /** - * Ensure the cursor_offset is a positive integer and we have a valid object for our cursor node. - * - * @return bool - */ - protected function is_valid_offset_and_node() { - if ( - ! is_int( $this->cursor_offset ) || - 0 >= $this->cursor_offset || - ! $this->cursor_node - ) { - return false; - } - - return true; - } - - /** - * Validates cursor compare field configuration. Validation failure results in a fatal - * error because query execution is guaranteed to fail. - * - * @param array|mixed $field Threshold configuration. - * - * @throws \GraphQL\Error\InvariantViolation Invalid configuration format. - * - * @return void - */ - protected function validate_cursor_compare_field( $field ): void { - // Throw if an array not provided. - if ( ! is_array( $field ) ) { - throw new InvariantViolation( - esc_html( - sprintf( - /* translators: %1$s: Cursor class name. %2$s: value type. */ - __( 'Invalid value provided for %1$s cursor compare field. Expected Array, %2$s given.', 'wp-graphql' ), - static::class, - gettype( $field ) - ) - ) - ); - } - - // Guard against missing or invalid "table column". - if ( empty( $field['key'] ) || ! is_string( $field['key'] ) ) { - throw new InvariantViolation( - esc_html( - sprintf( - /* translators: %s: Cursor class name. */ - __( 'Expected "key" value to be provided for %s cursor compare field. A string value must be given.', 'wp-graphql' ), - static::class - ) - ) - ); - } - - // Guard against missing or invalid "by". - if ( ! isset( $field['value'] ) ) { - throw new InvariantViolation( - esc_html( - sprintf( - /* translators: %s: Cursor class name. */ - __( 'Expected "value" value to be provided for %s cursor compare field. A scalar value must be given.', 'wp-graphql' ), - static::class - ) - ) - ); - } - - // Guard against invalid "type". - if ( ! empty( $field['type'] ) && ! is_string( $field['type'] ) ) { - throw new InvariantViolation( - esc_html( - sprintf( - /* translators: %s: Cursor class name. */ - __( 'Invalid value provided for "type" value to be provided for type of %s cursor compare field. A string value must be given.', 'wp-graphql' ), - static::class - ) - ) - ); - } - - // Guard against invalid "order". - if ( ! empty( $field['order'] ) && ! in_array( strtoupper( $field['order'] ), [ 'ASC', 'DESC' ], true ) ) { - throw new InvariantViolation( - esc_html( - sprintf( - /* translators: %s: Cursor class name. */ - __( 'Invalid value provided for "order" value to be provided for type of %s cursor compare field. Either "ASC" or "DESC" must be given.', 'wp-graphql' ), - static::class - ) - ) - ); - } - } - - /** - * Returns the ID key. - * - * @return mixed - */ - public function get_cursor_id_key() { - $key = $this->get_query_var( 'graphql_cursor_id_key' ); - if ( null === $key ) { - $key = $this->id_key; - } - - return $key; - } - - /** - * Applies cursor compare fields to the cursor cutoff. - * - * @param array $fallback Fallback cursor compare fields. - * - * @throws \GraphQL\Error\InvariantViolation Invalid configuration format. - */ - protected function compare_with_cursor_fields( $fallback = [] ): void { - /** - * Get cursor compare fields from query vars. - * - * @var array|null $cursor_compare_fields - */ - $cursor_compare_fields = $this->get_query_var( 'graphql_cursor_compare_fields' ); - if ( null === $cursor_compare_fields ) { - $cursor_compare_fields = $fallback; - } - // Bail early if no cursor compare fields. - if ( empty( $cursor_compare_fields ) ) { - return; - } - - if ( ! is_array( $cursor_compare_fields ) ) { - throw new InvariantViolation( - esc_html( - sprintf( - /* translators: %s: value type. */ - __( 'Invalid value provided for graphql_cursor_compare_fields. Expected Array, %s given.', 'wp-graphql' ), - gettype( $cursor_compare_fields ) - ) - ) - ); - } - - // Check if only one cursor compare field provided, wrap it in an array. - if ( ! isset( $cursor_compare_fields[0] ) ) { - $cursor_compare_fields = [ $cursor_compare_fields ]; - } - - foreach ( $cursor_compare_fields as $field ) { - $this->validate_cursor_compare_field( $field ); - - $key = $field['key']; - $value = $field['value']; - $type = ! empty( $field['type'] ) ? $field['type'] : null; - $order = ! empty( $field['order'] ) ? $field['order'] : null; - - $this->builder->add_field( $key, $value, $type, $order ); - } - } - - /** - * Applies ID field to the cursor builder. - */ - protected function compare_with_id_field(): void { - // Get ID value. - $value = $this->get_query_var( 'graphql_cursor_id_value' ); - if ( null === $value ) { - $value = (string) $this->cursor_offset; - } - - // Get ID SQL Query alias. - $key = $this->get_cursor_id_key(); - - $this->builder->add_field( $key, $value, 'ID' ); - } - - /** - * Get the WP Object instance for the cursor. - * - * This is cached internally so it should not generate additionl queries. - * - * @return mixed|null; - */ - abstract public function get_cursor_node(); - - /** - * Return the additional AND operators for the where statement - * - * @return string - */ - abstract public function get_where(); - - /** - * Generate the final SQL string to be appended to WHERE clause - * - * @return string - */ - abstract public function to_sql(); -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/CommentObjectCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/CommentObjectCursor.php deleted file mode 100644 index 018d738c..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Cursor/CommentObjectCursor.php +++ /dev/null @@ -1,148 +0,0 @@ -query_vars; - } - - // Initialize the class properties. - parent::__construct( $query_vars, $cursor ); - - // Set ID Key. - $this->id_key = "{$this->wpdb->comments}.comment_ID"; - } - - /** - * {@inheritDoc} - * - * @return ?\WP_Comment - */ - public function get_cursor_node() { - // Bail if no offset. - if ( ! $this->cursor_offset ) { - return null; - } - - /** - * If pre-hooked, return filtered node. - * - * @param null|\WP_Comment $pre_comment The pre-filtered comment node. - * @param int $offset The cursor offset. - * @param \WPGraphQL\Data\Cursor\CommentObjectCursor $node The cursor instance. - * - * @return null|\WP_Comment - */ - $pre_comment = apply_filters( 'graphql_pre_comment_cursor_node', null, $this->cursor_offset, $this ); - if ( null !== $pre_comment ) { - return $pre_comment; - } - - // Get cursor node. - $comment = WP_Comment::get_instance( $this->cursor_offset ); - - return false !== $comment ? $comment : null; - } - - /** - * {@inheritDoc} - */ - public function get_where() { - // If we have a bad cursor, just skip. - if ( ! $this->is_valid_offset_and_node() ) { - return ''; - } - - $orderby = $this->get_query_var( 'orderby' ); - $order = $this->get_query_var( 'order' ); - - // if there's custom ordering, use it to determine the cursor - if ( ! empty( $orderby ) ) { - $this->compare_with( $orderby, $order ); - } - - /** - * If there's no orderby specified yet, compare with the following fields. - */ - if ( ! $this->builder->has_fields() ) { - $this->compare_with_cursor_fields( - [ - [ - 'key' => "{$this->wpdb->comments}.comment_date", - 'by' => $this->cursor_node ? $this->cursor_node->comment_date : null, - 'type' => 'DATETIME', - ], - ] - ); - } - - $this->compare_with_id_field(); - - return $this->to_sql(); - } - - /** - * Get AND operator for given order by key - * - * @param string $by The order by key - * @param string $order The order direction ASC or DESC - * - * @return void - */ - public function compare_with( $by, $order ) { - // Bail early, if "key" and "value" provided in query_vars. - $key = $this->get_query_var( "graphql_cursor_compare_by_{$by}_key" ); - $value = $this->get_query_var( "graphql_cursor_compare_by_{$by}_value" ); - if ( ! empty( $key ) && ! empty( $value ) ) { - $this->builder->add_field( $key, $value, null, $order ); - return; - } - - $key = "{$this->wpdb->comments}.{$by}"; - $value = $this->cursor_node->{$by}; - $type = null; - - if ( 'comment_date' === $by ) { - $type = 'DATETIME'; - } - - $value = $this->cursor_node->{$by} ?? null; - if ( ! empty( $value ) ) { - $this->builder->add_field( $key, $value, $type ); - return; - } - } - - /** - *{@inheritDoc} - */ - public function to_sql() { - $sql = $this->builder->to_sql(); - return ! empty( $sql ) ? ' AND ' . $sql : ''; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/CursorBuilder.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/CursorBuilder.php deleted file mode 100644 index 7c726941..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Cursor/CursorBuilder.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * @var string - */ - public $compare; - - /** - * CursorBuilder constructor. - * - * @param string $compare - * - * @return void - */ - public function __construct( $compare = '>' ) { - $this->compare = $compare; - $this->fields = []; - } - - /** - * Add ordering field. The order you call this method matters. First field - * will be the primary field and latter ones will be used if the primary - * field has duplicate values - * - * @param string $key database column - * @param mixed|string|int $value value from the current cursor - * @param string|null $type type cast - * @param string|null $order custom order - * @param object|null $object_cursor The Cursor class - * - * @return void - */ - public function add_field( string $key, $value, string $type = null, string $order = null, $object_cursor = null ) { - - /** - * Filters the field used for ordering when cursors are used for pagination - * - * @param array $field The field key, value, type and order - * @param \WPGraphQL\Data\Cursor\CursorBuilder $cursor_builder The CursorBuilder class - * @param ?object $object_cursor The Cursor class - */ - $field = apply_filters( - 'graphql_cursor_ordering_field', - [ - 'key' => esc_sql( $key ), - 'value' => esc_sql( $value ), - 'type' => ! empty( $type ) ? esc_sql( $type ) : '', - 'order' => ! empty( $order ) ? esc_sql( $order ) : '', - ], - $this, - $object_cursor - ); - - // Bail if the filtered field comes back empty - if ( empty( $field ) ) { - return; - } - - // Bail if the filtered field doesn't come back as an array - if ( ! is_array( $field ) ) { - return; - } - - $escaped_field = []; - - // Escape the filtered array - foreach ( $field as $field_key => $value ) { - $escaped_field[ $field_key ] = esc_sql( $value ); - } - - $this->fields[] = $escaped_field; - } - - /** - * Returns true at least one ordering field has been added - * - * @return boolean - */ - public function has_fields() { - return count( $this->fields ) > 0; - } - - /** - * Generate the final SQL string to be appended to WHERE clause - * - * @param mixed|array|null $fields - * - * @return string - */ - public function to_sql( $fields = null ) { - if ( null === $fields ) { - $fields = $this->fields; - } - - if ( count( $fields ) === 0 ) { - return ''; - } - - $field = $fields[0]; - - $key = $field['key']; - $value = $field['value']; - $type = $field['type']; - $order = $field['order']; - - $compare = $this->compare; - - if ( $order ) { - $compare = 'DESC' === $order ? '<' : '>'; - } - - if ( 'ID' !== $type ) { - $cast = $this->get_cast_for_type( $type ); - if ( 'CHAR' === $cast ) { - $value = '"' . wp_unslash( $value ) . '"'; - } elseif ( $cast ) { - $key = "CAST( $key as $cast )"; - $value = "CAST( '$value' as $cast )"; - } - } - - if ( count( $fields ) === 1 ) { - return " {$key} {$compare} {$value} "; - } - - $nest = $this->to_sql( \array_slice( $fields, 1 ) ); - - $sql = ' %1$s %2$s= %3$s AND ( %1$s %2$s %3$s OR ( %4$s ) ) '; - - return sprintf( $sql, $key, $compare, $value, $nest ); - } - - - /** - * Copied from - * https://github.com/WordPress/WordPress/blob/c4f8bc468db56baa2a3bf917c99cdfd17c3391ce/wp-includes/class-wp-meta-query.php#L272-L296 - * - * It's an instance method. No way to call it without creating the instance? - * - * Return the appropriate alias for the given meta type if applicable. - * - * @param string $type MySQL type to cast meta_value. - * - * @return string MySQL type. - */ - public function get_cast_for_type( $type = '' ) { - if ( empty( $type ) ) { - return 'CHAR'; - } - $meta_type = strtoupper( $type ); - if ( ! preg_match( '/^(?:BINARY|CHAR|DATE|DATETIME|SIGNED|UNSIGNED|TIME|NUMERIC(?:\(\d+(?:,\s?\d+)?\))?|DECIMAL(?:\(\d+(?:,\s?\d+)?\))?)$/', $meta_type ) ) { - return 'CHAR'; - } - if ( 'NUMERIC' === $meta_type ) { - $meta_type = 'SIGNED'; - } - - return $meta_type; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/PostObjectCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/PostObjectCursor.php deleted file mode 100644 index 70d34143..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Cursor/PostObjectCursor.php +++ /dev/null @@ -1,293 +0,0 @@ -query_vars; - } - - // Initialize the class properties. - parent::__construct( $query_vars, $cursor ); - - // Set ID key. - $this->id_key = "{$this->wpdb->posts}.ID"; - } - - /** - * {@inheritDoc} - * - * @return ?\WP_Post - */ - public function get_cursor_node() { - // Bail if no offset. - if ( ! $this->cursor_offset ) { - return null; - } - - /** - * If pre-hooked, return filtered node. - * - * @param null|\WP_Post $pre_post The pre-filtered post node. - * @param int $offset The cursor offset. - * @param \WPGraphQL\Data\Cursor\PostObjectCursor $node The cursor instance. - * - * @return null|\WP_Post - */ - $pre_post = apply_filters( 'graphql_pre_post_cursor_node', null, $this->cursor_offset, $this ); - if ( null !== $pre_post ) { - return $pre_post; - } - - // Get cursor node. - $post = \WP_Post::get_instance( $this->cursor_offset ); - - return false !== $post ? $post : null; - } - - /** - * @deprecated 1.9.0 - * - * @return ?\WP_Post - */ - public function get_cursor_post() { - _deprecated_function( __METHOD__, '1.9.0', self::class . '::get_cursor_node()' ); - - return $this->cursor_node; - } - - /** - * {@inheritDoc} - */ - public function to_sql() { - $orderby = isset( $this->query_vars['orderby'] ) ? $this->query_vars['orderby'] : null; - - $orderby_should_not_convert_to_sql = isset( $orderby ) && in_array( - $orderby, - [ - 'post__in', - 'post_name__in', - 'post_parent__in', - ], - true - ); - - if ( true === $orderby_should_not_convert_to_sql ) { - return ''; - } - - $sql = $this->builder->to_sql(); - - if ( empty( $sql ) ) { - return ''; - } - - return ' AND ' . $sql; - } - - /** - * {@inheritDoc} - */ - public function get_where() { - // If we have a bad cursor, just skip. - if ( ! $this->is_valid_offset_and_node() ) { - return ''; - } - - $orderby = $this->get_query_var( 'orderby' ); - $order = $this->get_query_var( 'order' ); - - if ( 'menu_order' === $orderby ) { - if ( '>' === $this->compare ) { - $order = 'DESC'; - $this->compare = '<'; - } elseif ( '<' === $this->compare ) { - $this->compare = '>'; - $order = 'ASC'; - } - } - - if ( ! empty( $orderby ) && is_array( $orderby ) ) { - - /** - * Loop through all order keys if it is an array - */ - foreach ( $orderby as $by => $order ) { - $this->compare_with( $by, $order ); - } - } elseif ( ! empty( $orderby ) && is_string( $orderby ) ) { - - /** - * If $orderby is just a string just compare with it directly as DESC - */ - $this->compare_with( $orderby, $order ); - } - - /** - * If there's no orderby specified yet, compare with the following fields. - */ - if ( ! $this->builder->has_fields() ) { - $this->compare_with_cursor_fields( - [ - [ - 'key' => "{$this->wpdb->posts}.post_date", - 'value' => $this->cursor_node ? $this->cursor_node->post_date : null, - 'type' => 'DATETIME', - ], - ] - ); - } - - $this->compare_with_id_field(); - - return $this->to_sql(); - } - - /** - * Get AND operator for given order by key - * - * @param string $by The order by key - * @param string $order The order direction ASC or DESC - * - * @return void - */ - private function compare_with( $by, $order ) { - // Bail early, if "key" and "value" provided in query_vars. - $key = $this->get_query_var( "graphql_cursor_compare_by_{$by}_key" ); - $value = $this->get_query_var( "graphql_cursor_compare_by_{$by}_value" ); - if ( ! empty( $key ) && ! empty( $value ) ) { - $this->builder->add_field( $key, $value, null, $order ); - return; - } - - /** - * Find out whether this is a post field - */ - $orderby_post_fields = [ - 'post_author', - 'post_title', - 'post_type', - 'post_name', - 'post_modified', - 'post_date', - 'post_parent', - 'menu_order', - ]; - if ( in_array( $by, $orderby_post_fields, true ) ) { - $key = "{$this->wpdb->posts}.{$by}"; - $value = $this->cursor_node->{$by} ?? null; - } - - /** - * If key or value are null, check whether this is a meta key based ordering before bailing. - */ - if ( null === $key || null === $value ) { - $meta_key = $this->get_meta_key( $by ); - if ( $meta_key ) { - $this->compare_with_meta_field( $meta_key, $order ); - } - return; - } - - // Add field to build. - $this->builder->add_field( $key, $value, null, $order ); - } - - /** - * Compare with meta key field - * - * @param string $meta_key post meta key - * @param string $order The comparison string - * - * @return void - */ - private function compare_with_meta_field( string $meta_key, string $order ) { - $meta_type = $this->get_query_var( 'meta_type' ); - $meta_value = get_post_meta( $this->cursor_offset, $meta_key, true ); - - $key = "{$this->wpdb->postmeta}.meta_value"; - - /** - * WP uses mt1, mt2 etc. style aliases for additional meta value joins. - */ - $meta_query = $this->get_query_var( 'meta_query' ); - if ( ! empty( $meta_query ) && is_array( $meta_query ) ) { - if ( ! empty( $meta_query['relation'] ) ) { - unset( $meta_query['relation'] ); - } - - $meta_keys = array_column( $meta_query, 'key' ); - $index = array_search( $meta_key, $meta_keys, true ); - - if ( $index && 1 < count( $meta_query ) ) { - $key = "mt{$index}.meta_value"; - } - } - - /** - * Allow filtering the meta key used for cursor based pagination - * - * @param string $key The meta key to use for cursor based pagination - * @param string $meta_key The original meta key - * @param string $meta_type The meta type - * @param string $order The order direction - * @param object $cursor The PostObjectCursor instance - */ - $key = apply_filters( 'graphql_post_object_cursor_meta_key', $key, $meta_key, $meta_type, $order, $this ); - - $this->builder->add_field( $key, $meta_value, $meta_type, $order, $this ); - } - - /** - * Get the actual meta key if any - * - * @param string $by The order by key - * - * @return string|null - */ - private function get_meta_key( $by ) { - if ( 'meta_value' === $by || 'meta_value_num' === $by ) { - return $this->get_query_var( 'meta_key' ); - } - - /** - * Check for the WP 4.2+ style meta clauses - * https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ - */ - if ( ! isset( $this->query_vars['meta_query'][ $by ] ) ) { - return null; - } - - $clause = $this->query_vars['meta_query'][ $by ]; - - return empty( $clause['key'] ) ? null : $clause['key']; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/TermObjectCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/TermObjectCursor.php deleted file mode 100644 index 45d1eb34..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Cursor/TermObjectCursor.php +++ /dev/null @@ -1,227 +0,0 @@ -get_query_var( $name ); - } - - /** - * {@inheritDoc} - * - * @return ?\WP_Term ; - */ - public function get_cursor_node() { - // Bail if no offset. - if ( ! $this->cursor_offset ) { - return null; - } - - /** - * If pre-hooked, return filtered node. - * - * @param null|\WP_Term $pre_term The pre-filtered term node. - * @param int $offset The cursor offset. - * @param \WPGraphQL\Data\Cursor\TermObjectCursor $node The cursor instance. - * - * @return null|\WP_Term - */ - $pre_term = apply_filters( 'graphql_pre_term_cursor_node', null, $this->cursor_offset, $this ); - if ( null !== $pre_term ) { - return $pre_term; - } - - // Get cursor node. - $term = WP_Term::get_instance( $this->cursor_offset ); - - return $term instanceof WP_Term ? $term : null; - } - - /** - * @return ?\WP_Term ; - * @deprecated 1.9.0 - */ - public function get_cursor_term() { - _deprecated_function( __METHOD__, '1.9.0', self::class . '::get_cursor_node()' ); - - return $this->cursor_node; - } - - /** - * Build and return the SQL statement to add to the Query - * - * @param array|null $fields The fields from the CursorBuilder to convert to SQL - * - * @return string - */ - public function to_sql( $fields = null ) { - $sql = $this->builder->to_sql( $fields ); - if ( empty( $sql ) ) { - return ''; - } - return ' AND ' . $sql; - } - - /** - * {@inheritDoc} - */ - public function get_where() { - // If we have a bad cursor, just skip. - if ( ! $this->is_valid_offset_and_node() ) { - return ''; - } - - $orderby = $this->get_query_var( 'orderby' ); - $order = $this->get_query_var( 'order' ); - - if ( 'name' === $orderby ) { - if ( '>' === $this->compare ) { - $order = 'DESC'; - $this->compare = '<'; - } elseif ( '<' === $this->compare ) { - $this->compare = '>'; - $order = 'ASC'; - } - } - - /** - * If $orderby is just a string just compare with it directly as DESC - */ - if ( ! empty( $orderby ) && is_string( $orderby ) ) { - $this->compare_with( $orderby, $order ); - } - - /** - * If there's no orderby specified yet, compare with the following fields. - */ - if ( ! $this->builder->has_fields() ) { - $this->compare_with_cursor_fields(); - } - - /** - * If there's no cursor_compare fields applied then compare by the ID field. - */ - if ( ! $this->builder->has_fields() ) { - $this->compare_with_id_field(); - } - - - return $this->to_sql(); - } - - /** - * Get AND operator for given order by key - * - * @param string $by The order by key - * @param string $order The order direction ASC or DESC - * - * @return void - */ - private function compare_with( string $by, string $order ) { - - // Bail early, if "key" and "value" provided in query_vars. - $key = $this->get_query_var( "graphql_cursor_compare_by_{$by}_key" ); - $value = $this->get_query_var( "graphql_cursor_compare_by_{$by}_value" ); - if ( ! empty( $key ) && ! empty( $value ) ) { - $this->builder->add_field( $key, $value, null, $order ); - return; - } - - // Set "key" as term table column and get "value" from cursor node. - $key = "t.{$by}"; - $value = $this->cursor_node->{$by}; - - /** - * If key or value are null, check whether this is a meta key based ordering before bailing. - */ - if ( null === $value ) { - $meta_key = $this->get_meta_key( $by ); - if ( $meta_key ) { - $this->compare_with_meta_field( $meta_key, $order ); - } - return; - } - - $this->builder->add_field( $key, $value, null, $order ); - } - - /** - * Compare with meta key field - * - * @param string $meta_key meta key - * @param string $order The comparison string - * - * @return void - */ - private function compare_with_meta_field( string $meta_key, string $order ) { - $meta_type = $this->get_query_var( 'meta_type' ); - $meta_value = get_term_meta( $this->cursor_offset, $meta_key, true ); - - $key = "{$this->wpdb->termmeta}.meta_value"; - - /** - * WP uses mt1, mt2 etc. style aliases for additional meta value joins. - */ - if ( 0 !== $this->meta_join_alias ) { - $key = "mt{$this->meta_join_alias}.meta_value"; - } - - ++$this->meta_join_alias; - - $this->builder->add_field( $key, $meta_value, $meta_type, $order, $this ); - } - - /** - * Get the actual meta key if any - * - * @param string $by The order by key - * - * @return string|null - */ - private function get_meta_key( string $by ) { - if ( 'meta_value' === $by || 'meta_value_num' === $by ) { - return $this->get_query_var( 'meta_key' ); - } - - /** - * Check for the WP 4.2+ style meta clauses - * https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ - */ - if ( ! isset( $this->query_vars['meta_query'][ $by ] ) ) { - return null; - } - - $clause = $this->query_vars['meta_query'][ $by ]; - - return empty( $clause['key'] ) ? null : $clause['key']; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Cursor/UserCursor.php b/lib/wp-graphql-1.17.0/src/Data/Cursor/UserCursor.php deleted file mode 100644 index 23812026..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Cursor/UserCursor.php +++ /dev/null @@ -1,255 +0,0 @@ -query_vars; - } - - // Initialize the class properties. - parent::__construct( $query_vars, $cursor ); - - // Set ID key. - $this->id_key = "{$this->wpdb->users}.ID"; - } - - /** - * {@inheritDoc} - * - * Unlike most queries, users by default are in ascending order. - */ - public function get_cursor_compare() { - if ( 'before' === $this->cursor ) { - return '<'; - } - return '>'; - } - - /** - * {@inheritDoc} - * - * @return ?\WP_User - */ - public function get_cursor_node() { - // Bail if no offset. - if ( ! $this->cursor_offset ) { - return null; - } - - /** - * If pre-hooked, return filtered node. - * - * @param null|\WP_User $pre_user The pre-filtered user node. - * @param int $offset The cursor offset. - * @param \WPGraphQL\Data\Cursor\UserCursor $node The cursor instance. - * - * @return null|\WP_User - */ - $pre_user = apply_filters( 'graphql_pre_user_cursor_node', null, $this->cursor_offset, $this ); - if ( null !== $pre_user ) { - return $pre_user; - } - - // Get cursor node. - $user = get_user_by( 'id', $this->cursor_offset ); - - return false !== $user ? $user : null; - } - - /** - * @return ?\WP_User - * @deprecated 1.9.0 - */ - public function get_cursor_user() { - _deprecated_function( __METHOD__, '1.9.0', self::class . '::get_cursor_node()' ); - - return $this->cursor_node; - } - - /** - * {@inheritDoc} - */ - public function to_sql() { - return ' AND ' . $this->builder->to_sql(); - } - - /** - * {@inheritDoc} - */ - public function get_where() { - // If we have a bad cursor, just skip. - if ( ! $this->is_valid_offset_and_node() ) { - return ''; - } - - $orderby = $this->get_query_var( 'orderby' ); - $order = $this->get_query_var( 'order' ); - - if ( ! empty( $orderby ) && is_array( $orderby ) ) { - - /** - * Loop through all order keys if it is an array - */ - foreach ( $orderby as $by => $order ) { - $this->compare_with( $by, $order ); - } - } elseif ( ! empty( $orderby ) && is_string( $orderby ) && 'login' !== $orderby ) { - - /** - * If $orderby is just a string just compare with it directly as DESC - */ - $this->compare_with( $orderby, $order ); - } - - /** - * If there's no orderby specified yet, compare with the following fields. - */ - if ( ! $this->builder->has_fields() ) { - $this->compare_with_cursor_fields( - [ - [ - 'key' => "{$this->wpdb->users}.user_login", - 'value' => $this->cursor_node ? $this->cursor_node->user_login : null, - 'type' => 'CHAR', - ], - ] - ); - } - - $this->compare_with_id_field(); - - return $this->to_sql(); - } - - /** - * Get AND operator for given order by key - * - * @param string $by The order by key - * @param string $order The order direction ASC or DESC - * - * @return void - */ - private function compare_with( $by, $order ) { - // Bail early, if "key" and "value" provided in query_vars. - $key = $this->get_query_var( "graphql_cursor_compare_by_{$by}_key" ); - $value = $this->get_query_var( "graphql_cursor_compare_by_{$by}_value" ); - if ( ! empty( $key ) && ! empty( $value ) ) { - $this->builder->add_field( $key, $value, null, $order ); - return; - } - - /** - * Find out whether this is a user field - */ - $orderby_user_fields = [ - 'user_email', - 'user_login', - 'user_nicename', - 'user_registered', - 'user_url', - ]; - if ( in_array( $by, $orderby_user_fields, true ) ) { - $key = "{$this->wpdb->users}.{$by}"; - $value = $this->cursor_node->{$by} ?? null; - } - - /** - * If key or value are null, check whether this is a meta key based ordering before bailing. - */ - if ( null === $key || null === $value ) { - $meta_key = $this->get_meta_key( $by ); - if ( $meta_key ) { - $this->compare_with_meta_field( $meta_key, $order ); - } - return; - } - - // Add field to build. - $this->builder->add_field( $key, $value, null, $order ); - } - - /** - * Compare with meta key field - * - * @param string $meta_key user meta key - * @param string $order The comparison string - * - * @return void - */ - private function compare_with_meta_field( string $meta_key, string $order ) { - $meta_type = $this->get_query_var( 'meta_type' ); - $meta_value = get_user_meta( $this->cursor_offset, $meta_key, true ); - - $key = "{$this->wpdb->usermeta}.meta_value"; - - /** - * WP uses mt1, mt2 etc. style aliases for additional meta value joins. - */ - if ( 0 !== $this->meta_join_alias ) { - $key = "mt{$this->meta_join_alias}.meta_value"; - } - - ++$this->meta_join_alias; - - $this->builder->add_field( $key, $meta_value, $meta_type, $order ); - } - - /** - * Get the actual meta key if any - * - * @param string $by The order by key - * - * @return string|null - */ - private function get_meta_key( $by ) { - if ( 'meta_value' === $by ) { - return $this->get_query_var( 'meta_key' ); - } - - /** - * Check for the WP 4.2+ style meta clauses - * https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/ - */ - if ( ! isset( $this->query_vars['meta_query'][ $by ] ) ) { - return null; - } - - $clause = $this->query_vars['meta_query'][ $by ]; - - return empty( $clause['key'] ) ? null : $clause['key']; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/DataSource.php b/lib/wp-graphql-1.17.0/src/Data/DataSource.php deleted file mode 100644 index 39624552..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/DataSource.php +++ /dev/null @@ -1,727 +0,0 @@ -get_loader( \'comment\' )->load_deferred( $id ) instead.' ); - - return $context->get_loader( 'comment' )->load_deferred( $id ); - } - - /** - * Retrieves a WP_Comment object for the ID that gets passed - * - * @param int $comment_id The ID of the comment the comment author is associated with. - * - * @return mixed|\WPGraphQL\Model\CommentAuthor|null - * @throws \Exception Throws Exception. - */ - public static function resolve_comment_author( int $comment_id ) { - $comment_author = get_comment( $comment_id ); - - return ! empty( $comment_author ) ? new CommentAuthor( $comment_author ) : null; - } - - /** - * Wrapper for the CommentsConnectionResolver class - * - * @param mixed $source The object the connection is coming from - * @param array $args Query args to pass to the connection resolver - * @param \WPGraphQL\AppContext $context The context of the query to pass along - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * - * @return mixed - * @throws \Exception - * @since 0.0.5 - */ - public static function resolve_comments_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { - $resolver = new CommentConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - } - - /** - * Wrapper for PluginsConnectionResolver::resolve - * - * @param mixed $source The object the connection is coming from - * @param array $args Array of arguments to pass to resolve method - * @param \WPGraphQL\AppContext $context AppContext object passed down - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * - * @return array - * @throws \Exception - * @since 0.0.5 - */ - public static function resolve_plugins_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { - $resolver = new PluginConnectionResolver( $source, $args, $context, $info ); - return $resolver->get_connection(); - } - - /** - * Returns the post object for the ID and post type passed - * - * @param int $id ID of the post you are trying to retrieve - * @param \WPGraphQL\AppContext $context The context of the GraphQL Request - * - * @return \GraphQL\Deferred - * - * @throws \GraphQL\Error\UserError - * @throws \Exception - * - * @since 0.0.5 - * @deprecated Use the Loader passed in $context instead - */ - public static function resolve_post_object( int $id, AppContext $context ) { - _deprecated_function( __METHOD__, '0.8.4', 'Use $context->get_loader( \'post\' )->load_deferred( $id ) instead.' ); - return $context->get_loader( 'post' )->load_deferred( $id ); - } - - /** - * @param int $id The ID of the menu item to load - * @param \WPGraphQL\AppContext $context The context of the GraphQL request - * - * @return \GraphQL\Deferred|null - * @throws \Exception - * - * @deprecated Use the Loader passed in $context instead - */ - public static function resolve_menu_item( int $id, AppContext $context ) { - _deprecated_function( __METHOD__, '0.8.4', 'Use $context->get_loader( \'post\' )->load_deferred( $id ) instead.' ); - return $context->get_loader( 'post' )->load_deferred( $id ); - } - - /** - * Wrapper for PostObjectsConnectionResolver - * - * @param mixed $source The object the connection is coming from - * @param array $args Arguments to pass to the resolve method - * @param \WPGraphQL\AppContext $context AppContext object to pass down - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * @param mixed|string|array $post_type Post type of the post we are trying to resolve - * - * @return mixed - * @throws \Exception - * @since 0.0.5 - */ - public static function resolve_post_objects_connection( $source, array $args, AppContext $context, ResolveInfo $info, $post_type ) { - $resolver = new PostObjectConnectionResolver( $source, $args, $context, $info, $post_type ); - - return $resolver->get_connection(); - } - - /** - * Retrieves the taxonomy object for the name of the taxonomy passed - * - * @param string $taxonomy Name of the taxonomy you want to retrieve the taxonomy object for - * - * @return \WPGraphQL\Model\Taxonomy object - * @throws \GraphQL\Error\UserError|\Exception - * @since 0.0.5 - */ - public static function resolve_taxonomy( $taxonomy ) { - - /** - * Get the allowed_taxonomies - * - * @var string[] $allowed_taxonomies - */ - $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies(); - - if ( ! in_array( $taxonomy, $allowed_taxonomies, true ) ) { - // translators: %s is the name of the taxonomy. - throw new UserError( esc_html( sprintf( __( 'No taxonomy was found with the name %s', 'wp-graphql' ), $taxonomy ) ) ); - } - - $tax_object = get_taxonomy( $taxonomy ); - - if ( ! $tax_object instanceof \WP_Taxonomy ) { - // translators: %s is the name of the taxonomy. - throw new UserError( esc_html( sprintf( __( 'No taxonomy was found with the name %s', 'wp-graphql' ), $taxonomy ) ) ); - } - - return new Taxonomy( $tax_object ); - } - - /** - * Get the term object for a term - * - * @param int $id ID of the term you are trying to retrieve the object for - * @param \WPGraphQL\AppContext $context The context of the GraphQL Request - * - * @return mixed - * @throws \Exception - * @since 0.0.5 - * - * @deprecated Use the Loader passed in $context instead - */ - public static function resolve_term_object( $id, AppContext $context ) { - _deprecated_function( __METHOD__, '0.8.4', 'Use $context->get_loader( \'term\' )->load_deferred( $id ) instead.' ); - return $context->get_loader( 'term' )->load_deferred( $id ); - } - - /** - * Wrapper for TermObjectConnectionResolver::resolve - * - * @param mixed $source The object the connection is coming from - * @param array $args Array of args to be passed to the resolve method - * @param \WPGraphQL\AppContext $context The AppContext object to be passed down - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * @param string $taxonomy The name of the taxonomy the term belongs to - * - * @return array - * @throws \Exception - * @since 0.0.5 - */ - public static function resolve_term_objects_connection( $source, array $args, AppContext $context, ResolveInfo $info, string $taxonomy ) { - $resolver = new TermObjectConnectionResolver( $source, $args, $context, $info, $taxonomy ); - - return $resolver->get_connection(); - } - - /** - * Retrieves the theme object for the theme you are looking for - * - * @param string $stylesheet Directory name for the theme. - * - * @return \WPGraphQL\Model\Theme object - * @throws \GraphQL\Error\UserError - * @throws \Exception - * @since 0.0.5 - */ - public static function resolve_theme( $stylesheet ) { - $theme = wp_get_theme( $stylesheet ); - if ( $theme->exists() ) { - return new Theme( $theme ); - } else { - // translators: %s is the name of the theme stylesheet. - throw new UserError( esc_html( sprintf( __( 'No theme was found with the stylesheet: %s', 'wp-graphql' ), $stylesheet ) ) ); - } - } - - /** - * Wrapper for the ThemesConnectionResolver::resolve method - * - * @param mixed $source The object the connection is coming from - * @param array $args Passes an array of arguments to the resolve method - * @param \WPGraphQL\AppContext $context The AppContext object to be passed down - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * - * @return array - * @throws \Exception - * @since 0.0.5 - */ - public static function resolve_themes_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { - $resolver = new ThemeConnectionResolver( $source, $args, $context, $info ); - return $resolver->get_connection(); - } - - /** - * Gets the user object for the user ID specified - * - * @param int $id ID of the user you want the object for - * @param \WPGraphQL\AppContext $context The AppContext - * - * @return \GraphQL\Deferred - * @throws \Exception - * - * @since 0.0.5 - * @deprecated Use the Loader passed in $context instead - */ - public static function resolve_user( $id, AppContext $context ) { - _deprecated_function( __METHOD__, '0.8.4', 'Use $context->get_loader( \'user\' )->load_deferred( $id ) instead.' ); - return $context->get_loader( 'user' )->load_deferred( $id ); - } - - /** - * Wrapper for the UsersConnectionResolver::resolve method - * - * @param mixed $source The object the connection is coming from - * @param array $args Array of args to be passed down to the resolve method - * @param \WPGraphQL\AppContext $context The AppContext object to be passed down - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * - * @return array - * @throws \Exception - * @since 0.0.5 - */ - public static function resolve_users_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { - $resolver = new UserConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - } - - /** - * Returns an array of data about the user role you are requesting - * - * @param string $name Name of the user role you want info for - * - * @return \WPGraphQL\Model\UserRole - * @throws \Exception - * @since 0.0.30 - */ - public static function resolve_user_role( $name ) { - $role = isset( wp_roles()->roles[ $name ] ) ? wp_roles()->roles[ $name ] : null; - - if ( null === $role ) { - // translators: %s is the name of the user role. - throw new UserError( esc_html( sprintf( __( 'No user role was found with the name %s', 'wp-graphql' ), $name ) ) ); - } else { - $role = (array) $role; - $role['id'] = $name; - $role['displayName'] = $role['name']; - $role['name'] = $name; - - return new UserRole( $role ); - } - } - - /** - * Resolve the avatar for a user - * - * @param int $user_id ID of the user to get the avatar data for - * @param array $args The args to pass to the get_avatar_data function - * - * @return \WPGraphQL\Model\Avatar|null - * @throws \Exception - */ - public static function resolve_avatar( int $user_id, array $args ) { - $avatar = get_avatar_data( absint( $user_id ), $args ); - - // if there's no url returned, return null - if ( empty( $avatar['url'] ) ) { - return null; - } - - return new Avatar( $avatar ); - } - - /** - * Resolve the connection data for user roles - * - * @param array $source The Query results - * @param array $args The query arguments - * @param \WPGraphQL\AppContext $context The AppContext passed down to the query - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object - * - * @return array - * @throws \Exception - */ - public static function resolve_user_role_connection( $source, array $args, AppContext $context, ResolveInfo $info ) { - $resolver = new UserRoleConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - } - - /** - * Format the setting group name to our standard. - * - * @param string $group - * - * @return string $group - */ - public static function format_group_name( string $group ) { - $replaced_group = graphql_format_name( $group, ' ', '/[^a-zA-Z0-9 -]/' ); - - if ( ! empty( $replaced_group ) ) { - $group = $replaced_group; - } - - $group = lcfirst( str_replace( '_', ' ', ucwords( $group, '_' ) ) ); - $group = lcfirst( str_replace( '-', ' ', ucwords( $group, '_' ) ) ); - $group = lcfirst( str_replace( ' ', '', ucwords( $group, ' ' ) ) ); - - return $group; - } - - /** - * Get all of the allowed settings by group and return the - * settings group that matches the group param - * - * @param string $group - * - * @return array $settings_groups[ $group ] - */ - public static function get_setting_group_fields( string $group, TypeRegistry $type_registry ) { - - /** - * Get all of the settings, sorted by group - */ - $settings_groups = self::get_allowed_settings_by_group( $type_registry ); - - return ! empty( $settings_groups[ $group ] ) ? $settings_groups[ $group ] : []; - } - - /** - * Get all of the allowed settings by group - * - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry - * - * @return array $allowed_settings_by_group - */ - public static function get_allowed_settings_by_group( TypeRegistry $type_registry ) { - - /** - * Get all registered settings - */ - $registered_settings = get_registered_settings(); - - /** - * Loop through the $registered_settings array and build an array of - * settings for each group ( general, reading, discussion, writing, reading, etc. ) - * if the setting is allowed in REST or GraphQL - */ - $allowed_settings_by_group = []; - foreach ( $registered_settings as $key => $setting ) { - // Bail if the setting doesn't have a group. - if ( empty( $setting['group'] ) ) { - continue; - } - - $group = self::format_group_name( $setting['group'] ); - - if ( ! isset( $setting['type'] ) || ! $type_registry->get_type( $setting['type'] ) ) { - continue; - } - - if ( ! isset( $setting['show_in_graphql'] ) ) { - if ( isset( $setting['show_in_rest'] ) && false !== $setting['show_in_rest'] ) { - $setting['key'] = $key; - $allowed_settings_by_group[ $group ][ $key ] = $setting; - } - } elseif ( true === $setting['show_in_graphql'] ) { - $setting['key'] = $key; - $allowed_settings_by_group[ $group ][ $key ] = $setting; - } - } - - /** - * Set the setting groups that are allowed - */ - $allowed_settings_by_group = ! empty( $allowed_settings_by_group ) && is_array( $allowed_settings_by_group ) ? $allowed_settings_by_group : []; - - /** - * Filter the $allowed_settings_by_group to allow enabling or disabling groups in the GraphQL Schema. - * - * @param array $allowed_settings_by_group - */ - return apply_filters( 'graphql_allowed_settings_by_group', $allowed_settings_by_group ); - } - - /** - * Get all of the $allowed_settings - * - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry - * - * @return array $allowed_settings - */ - public static function get_allowed_settings( TypeRegistry $type_registry ) { - - /** - * Get all registered settings - */ - $registered_settings = get_registered_settings(); - - /** - * Set allowed settings variable. - */ - $allowed_settings = []; - - if ( ! empty( $registered_settings ) ) { - - /** - * Loop through the $registered_settings and if the setting is allowed in REST or GraphQL - * add it to the $allowed_settings array - */ - foreach ( $registered_settings as $key => $setting ) { - if ( ! isset( $setting['type'] ) || ! $type_registry->get_type( $setting['type'] ) ) { - continue; - } - - if ( ! isset( $setting['show_in_graphql'] ) ) { - if ( isset( $setting['show_in_rest'] ) && false !== $setting['show_in_rest'] ) { - $setting['key'] = $key; - $allowed_settings[ $key ] = $setting; - } - } elseif ( true === $setting['show_in_graphql'] ) { - $setting['key'] = $key; - $allowed_settings[ $key ] = $setting; - } - } - } - - /** - * Verify that we have the allowed settings - */ - $allowed_settings = ! empty( $allowed_settings ) && is_array( $allowed_settings ) ? $allowed_settings : []; - - /** - * Filter the $allowed_settings to allow some to be enabled or disabled from showing in - * the GraphQL Schema. - * - * @param array $allowed_settings - * - * @return array - */ - return apply_filters( 'graphql_allowed_setting_groups', $allowed_settings ); - } - - /** - * We get the node interface and field from the relay library. - * - * The first method is the way we resolve an ID to its object. The second is the way we resolve - * an object that implements node to its type. - * - * @return array - * @throws \GraphQL\Error\UserError - */ - public static function get_node_definition() { - if ( null === self::$node_definition ) { - $node_definition = Relay::nodeDefinitions( - // The ID fetcher definition - static function ( $global_id, AppContext $context, ResolveInfo $info ) { - self::resolve_node( $global_id, $context, $info ); - }, - // Type resolver - static function ( $node ) { - self::resolve_node_type( $node ); - } - ); - - self::$node_definition = $node_definition; - } - - return self::$node_definition; - } - - /** - * Given a node, returns the GraphQL Type - * - * @param mixed $node The node to resolve the type of - * - * @return string - */ - public static function resolve_node_type( $node ) { - $type = null; - - if ( true === is_object( $node ) ) { - switch ( true ) { - case $node instanceof Post: - if ( $node->isRevision ) { - $parent_post = get_post( $node->parentDatabaseId ); - if ( ! empty( $parent_post ) ) { - $parent_post_type = $parent_post->post_type; - /** @var \WP_Post_Type $post_type_object */ - $post_type_object = get_post_type_object( $parent_post_type ); - $type = $post_type_object->graphql_single_name; - } - } else { - /** @var \WP_Post_Type $post_type_object */ - $post_type_object = get_post_type_object( $node->post_type ); - $type = $post_type_object->graphql_single_name; - } - break; - case $node instanceof Term: - /** @var \WP_Taxonomy $tax_object */ - $tax_object = get_taxonomy( $node->taxonomyName ); - $type = $tax_object->graphql_single_name; - break; - case $node instanceof Comment: - $type = 'Comment'; - break; - case $node instanceof PostType: - $type = 'ContentType'; - break; - case $node instanceof Taxonomy: - $type = 'Taxonomy'; - break; - case $node instanceof Theme: - $type = 'Theme'; - break; - case $node instanceof User: - $type = 'User'; - break; - case $node instanceof Plugin: - $type = 'Plugin'; - break; - case $node instanceof CommentAuthor: - $type = 'CommentAuthor'; - break; - case $node instanceof Menu: - $type = 'Menu'; - break; - case $node instanceof \_WP_Dependency: - $type = isset( $node->type ) ? $node->type : null; - break; - default: - $type = null; - } - } - - /** - * Add a filter to allow externally registered node types to return the proper type - * based on the node_object that's returned - * - * @param mixed|object|array $type The type definition the node should resolve to. - * @param mixed|object|array $node The $node that is being resolved - * - * @since 0.0.6 - */ - $type = apply_filters( 'graphql_resolve_node_type', $type, $node ); - $type = ucfirst( $type ); - - /** - * If the $type is not properly resolved, throw an exception - * - * @since 0.0.6 - */ - if ( empty( $type ) ) { - throw new UserError( esc_html__( 'No type was found matching the node', 'wp-graphql' ) ); - } - - /** - * Return the resolved $type for the $node - * - * @since 0.0.5 - */ - return $type; - } - - /** - * Given the ID of a node, this resolves the data - * - * @param string $global_id The Global ID of the node - * @param \WPGraphQL\AppContext $context The Context of the GraphQL Request - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo for the GraphQL Request - * - * @return null|string - * @throws \Exception - */ - public static function resolve_node( $global_id, AppContext $context, ResolveInfo $info ) { - if ( empty( $global_id ) ) { - throw new UserError( esc_html__( 'An ID needs to be provided to resolve a node.', 'wp-graphql' ) ); - } - - /** - * Convert the encoded ID into an array we can work with - * - * @since 0.0.4 - */ - $id_components = Relay::fromGlobalId( $global_id ); - - /** - * If the $id_components is a proper array with a type and id - * - * @since 0.0.5 - */ - if ( is_array( $id_components ) && ! empty( $id_components['id'] ) && ! empty( $id_components['type'] ) ) { - - /** - * Get the allowed_post_types and allowed_taxonomies - * - * @since 0.0.5 - */ - - $loader = $context->get_loader( $id_components['type'] ); - - if ( $loader ) { - return $loader->load_deferred( $id_components['id'] ); - } - - return null; - } else { - // translators: %s is the global ID. - throw new UserError( esc_html( sprintf( __( 'The global ID isn\'t recognized ID: %s', 'wp-graphql' ), $global_id ) ) ); - } - } - - /** - * Returns array of nav menu location names - * - * @return array - */ - public static function get_registered_nav_menu_locations() { - global $_wp_registered_nav_menus; - - return ! empty( $_wp_registered_nav_menus ) && is_array( $_wp_registered_nav_menus ) ? array_keys( $_wp_registered_nav_menus ) : []; - } - - /** - * This resolves a resource, given a URI (the path / permalink to a resource) - * - * Based largely on the core parse_request function in wp-includes/class-wp.php - * - * @param string $uri The URI to fetch a resource from - * @param \WPGraphQL\AppContext $context The AppContext passed through the GraphQL Resolve Tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed through the GraphQL Resolve tree - * - * @return mixed - * @throws \Exception - */ - public static function resolve_resource_by_uri( $uri, $context, $info ) { - $node_resolver = new NodeResolver( $context ); - - return $node_resolver->resolve_uri( $uri ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/AbstractDataLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/AbstractDataLoader.php deleted file mode 100644 index fa530daf..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/AbstractDataLoader.php +++ /dev/null @@ -1,509 +0,0 @@ -context = $context; - } - - /** - * Given a Database ID, the particular loader will buffer it and resolve it deferred. - * - * @param mixed|int|string $database_id The database ID for a particular loader to load an - * object - * - * @return \GraphQL\Deferred|null - * @throws \Exception - */ - public function load_deferred( $database_id ) { - if ( empty( $database_id ) ) { - return null; - } - - $database_id = absint( $database_id ) ? absint( $database_id ) : sanitize_text_field( $database_id ); - - $this->buffer( [ $database_id ] ); - - return new Deferred( - function () use ( $database_id ) { - return $this->load( $database_id ); - } - ); - } - - /** - * Add keys to buffer to be loaded in single batch later. - * - * @param array $keys The keys of the objects to buffer - * - * @return $this - * @throws \Exception - */ - public function buffer( array $keys ) { - foreach ( $keys as $index => $key ) { - $key = $this->key_to_scalar( $key ); - if ( ! is_scalar( $key ) ) { - throw new Exception( - static::class . '::buffer expects all keys to be scalars, but key ' . - 'at position ' . esc_html( $index ) . ' is ' . esc_html( - Utils::printSafe( $keys ) . '. ' . - $this->get_scalar_key_hint( $key ) - ) - ); - } - $this->buffer[ $key ] = 1; - } - - return $this; - } - - /** - * Loads a key and returns value represented by this key. - * Internally this method will load all currently buffered items and cache them locally. - * - * @param mixed $key - * - * @return mixed - * @throws \Exception - */ - public function load( $key ) { - $key = $this->key_to_scalar( $key ); - if ( ! is_scalar( $key ) ) { - throw new Exception( - static::class . '::load expects key to be scalar, but got ' . esc_html( - Utils::printSafe( $key ) . - $this->get_scalar_key_hint( $key ) - ) - ); - } - if ( ! $this->shouldCache ) { - $this->buffer = []; - } - $keys = [ $key ]; - $this->buffer( $keys ); - $result = $this->load_buffered(); - - return isset( $result[ $key ] ) ? $this->normalize_entry( $result[ $key ], $key ) : null; - } - - /** - * Adds the provided key and value to the cache. If the key already exists, no - * change is made. Returns itself for method chaining. - * - * @param mixed $key - * @param mixed $value - * - * @return $this - * @throws \Exception - */ - public function prime( $key, $value ) { - $key = $this->key_to_scalar( $key ); - if ( ! is_scalar( $key ) ) { - throw new Exception( - static::class . '::prime is expecting scalar $key, but got ' . esc_html( - Utils::printSafe( $key ) - . $this->get_scalar_key_hint( $key ) - ) - ); - } - if ( null === $value ) { - throw new Exception( - static::class . '::prime is expecting non-null $value, but got null. Double-check for null or ' . - ' use `clear` if you want to clear the cache' - ); - } - if ( ! $this->get_cached( $key ) ) { - /** - * For adding third-party caching support. - * Use this filter to store the queried value in a cache. - * - * @param mixed $value Queried object. - * @param mixed $key Object key. - * @param string $loader_class Loader classname. Use as a means of identified the loader. - * @param mixed $loader Loader instance. - */ - $this->set_cached( $key, $value ); - } - - return $this; - } - - /** - * Clears the value at `key` from the cache, if it exists. Returns itself for - * method chaining. - * - * @param array $keys - * - * @return $this - */ - public function clear( array $keys ) { - foreach ( $keys as $key ) { - $key = $this->key_to_scalar( $key ); - if ( isset( $this->cached[ $key ] ) ) { - unset( $this->cached[ $key ] ); - } - } - - return $this; - } - - /** - * Clears the entire cache. To be used when some event results in unknown - * invalidations across this particular `DataLoader`. Returns itself for - * method chaining. - * - * @return \WPGraphQL\Data\Loader\AbstractDataLoader - * @deprecated in favor of clear_all - */ - public function clearAll() { - _deprecated_function( __METHOD__, '0.8.4', static::class . '::clear_all()' ); - return $this->clear_all(); - } - - /** - * Clears the entire cache. To be used when some event results in unknown - * invalidations across this particular `DataLoader`. Returns itself for - * method chaining. - * - * @return \WPGraphQL\Data\Loader\AbstractDataLoader - */ - public function clear_all() { - $this->cached = []; - - return $this; - } - - /** - * Loads multiple keys. Returns generator where each entry directly corresponds to entry in - * $keys. If second argument $asArray is set to true, returns array instead of generator - * - * @param array $keys - * @param bool $asArray - * - * @return array|\Generator - * @throws \Exception - * - * @deprecated Use load_many instead - */ - public function loadMany( array $keys, $asArray = false ) { - _deprecated_function( __METHOD__, '0.8.4', static::class . '::load_many()' ); - return $this->load_many( $keys, $asArray ); - } - - /** - * Loads multiple keys. Returns generator where each entry directly corresponds to entry in - * $keys. If second argument $asArray is set to true, returns array instead of generator - * - * @param array $keys - * @param bool $asArray - * - * @return array|\Generator - * @throws \Exception - */ - public function load_many( array $keys, $asArray = false ) { - if ( empty( $keys ) ) { - return []; - } - if ( ! $this->shouldCache ) { - $this->buffer = []; - } - $this->buffer( $keys ); - $generator = $this->generate_many( $keys, $this->load_buffered() ); - - return $asArray ? iterator_to_array( $generator ) : $generator; - } - - /** - * Given an array of keys, this yields the object from the cached results - * - * @param array $keys The keys to generate results for - * @param array $result The results for all keys - * - * @return \Generator - */ - private function generate_many( array $keys, array $result ) { - foreach ( $keys as $key ) { - $key = $this->key_to_scalar( $key ); - yield isset( $result[ $key ] ) ? $this->get_model( $result[ $key ], $key ) : null; - } - } - - /** - * This checks to see if any items are in the buffer, and if there are this - * executes the loaders `loadKeys` method to load the items and adds them - * to the cache if necessary - * - * @return array - * @throws \Exception - */ - private function load_buffered() { - // Do not load previously-cached entries: - $keysToLoad = []; - foreach ( $this->buffer as $key => $unused ) { - if ( ! $this->get_cached( $key ) ) { - $keysToLoad[] = $key; - } - } - - $result = []; - if ( ! empty( $keysToLoad ) ) { - try { - $loaded = $this->loadKeys( $keysToLoad ); - } catch ( \Throwable $e ) { - throw new Exception( - 'Method ' . static::class . '::loadKeys is expected to return array, but it threw: ' . - esc_html( $e->getMessage() ), - 0, - $e // phpcs:ignore WordPress.Security.EscapeOutput.ExceptionNotEscaped - ); - } - - if ( ! is_array( $loaded ) ) { - throw new Exception( - 'Method ' . static::class . '::loadKeys is expected to return an array with keys ' . - 'but got: ' . esc_html( Utils::printSafe( $loaded ) ) - ); - } - if ( $this->shouldCache ) { - foreach ( $loaded as $key => $value ) { - $this->set_cached( $key, $value ); - } - } - } - - // Re-include previously-cached entries to result: - $result += array_intersect_key( $this->cached, $this->buffer ); - - $this->buffer = []; - - return $result; - } - - /** - * This helps to ensure null values aren't being loaded by accident. - * - * @param mixed $key - * - * @return string - */ - private function get_scalar_key_hint( $key ) { - if ( null === $key ) { - return ' Make sure to add additional checks for null values.'; - } else { - return ' Try overriding ' . self::class . '::key_to_scalar if your keys are composite.'; - } - } - - /** - * For loaders that need to decode keys, this method can help with that. - * For example, if we wanted to accept a list of RELAY style global IDs and pass them - * to the loader, we could have the loader centrally decode the keys into their - * integer values in the PostObjectLoader by overriding this method. - * - * @param mixed $key - * - * @return mixed - */ - protected function key_to_scalar( $key ) { - return $key; - } - - /** - * @param mixed $key - * - * @return mixed - * @deprecated Use key_to_scalar instead - */ - protected function keyToScalar( $key ) { - _deprecated_function( __METHOD__, '0.8.4', static::class . '::key_to_scalar()' ); - return $this->key_to_scalar( $key ); - } - - /** - * @param mixed $entry The entry loaded from the dataloader to be used to generate a Model - * @param mixed $key The Key used to identify the loaded entry - * - * @return null|\WPGraphQL\Model\Model - */ - protected function normalize_entry( $entry, $key ) { - - /** - * This filter allows the model generated by the DataLoader to be filtered. - * - * Returning anything other than null here will bypass the default model generation - * for an object. - * - * One example would be WooCommerce Products returning a custom Model for posts of post_type "product". - * - * @param null $model The filtered model to return. Default null - * @param mixed $entry The entry loaded from the dataloader to be used to generate a Model - * @param mixed $key The Key used to identify the loaded entry - * @param \WPGraphQL\Data\Loader\AbstractDataLoader $abstract_data_loader The AbstractDataLoader instance - */ - $model = null; - $pre_get_model = apply_filters( 'graphql_dataloader_pre_get_model', $model, $entry, $key, $this ); - - /** - * If a Model has been pre-loaded via filter, return it and skip the - */ - if ( ! empty( $pre_get_model ) ) { - $model = $pre_get_model; - } else { - $model = $this->get_model( $entry, $key ); - } - - if ( $model instanceof Model && 'private' === $model->get_visibility() ) { - return null; - } - - /** - * Filter the model before returning. - * - * @param mixed $model The Model to be returned by the loader - * @param mixed $entry The entry loaded by dataloader that was used to create the Model - * @param mixed $key The Key that was used to load the entry - * @param \WPGraphQL\Data\Loader\AbstractDataLoader $loader The AbstractDataLoader Instance - */ - return apply_filters( 'graphql_dataloader_get_model', $model, $entry, $key, $this ); - } - - /** - * Returns a cached data object by key. - * - * @param mixed $key Key. - * - * @return mixed - */ - protected function get_cached( $key ) { - $value = null; - if ( isset( $this->cached[ $key ] ) ) { - $value = $this->cached[ $key ]; - } - - /** - * Use this filter to retrieving cached data objects from third-party caching system. - * - * @param mixed $value Value to be cached. - * @param mixed $key Key identifying object. - * @param string $loader_class Loader class name. - * @param mixed $loader Loader instance. - */ - $value = apply_filters( - 'graphql_dataloader_get_cached', - $value, - $key, - static::class, - $this - ); - - if ( $value && ! isset( $this->cached[ $key ] ) ) { - $this->cached[ $key ] = $value; - } - - return $value; - } - - /** - * Caches a data object by key. - * - * @param mixed $key Key. - * @param mixed $value Data object. - * - * @return mixed - */ - protected function set_cached( $key, $value ) { - /** - * Use this filter to store entry in a third-party caching system. - * - * @param mixed $value Value to be cached. - * @param mixed $key Key identifying object. - * @param string $loader_class Loader class name. - * @param mixed $loader Loader instance. - */ - $this->cached[ $key ] = apply_filters( - 'graphql_dataloader_set_cached', - $value, - $key, - static::class, - $this - ); - } - - /** - * If the loader needs to do any tweaks between getting raw data from the DB and caching, - * this can be overridden by the specific loader and used for transformations, etc. - * - * @param mixed $entry The User Role object - * @param mixed $key The Key to identify the user role by - * - * @return \WPGraphQL\Model\Model - */ - protected function get_model( $entry, $key ) { - return $entry; - } - - /** - * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded - * values - * - * Note that order of returned values must match exactly the order of keys. - * If some entry is not available for given key - it must include null for the missing key. - * - * For example: - * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] - * - * @param array $keys - * - * @return array - */ - abstract protected function loadKeys( array $keys ); -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/CommentAuthorLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/CommentAuthorLoader.php deleted file mode 100644 index e2788cc1..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/CommentAuthorLoader.php +++ /dev/null @@ -1,58 +0,0 @@ - $keys, - 'orderby' => 'comment__in', - 'number' => count( $keys ), - 'no_found_rows' => true, - 'count' => false, - ]; - - /** - * Execute the query. Call get_comments() to add them to the cache. - */ - $query = new \WP_Comment_Query( $args ); - $query->get_comments(); - $loaded = []; - foreach ( $keys as $key ) { - $loaded[ $key ] = \WP_Comment::get_instance( $key ); - } - return $loaded; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/CommentLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/CommentLoader.php deleted file mode 100644 index 82da2f30..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/CommentLoader.php +++ /dev/null @@ -1,75 +0,0 @@ -fields ) ) { - return null; - } - - return $comment_model; - } - - /** - * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded - * comments as the values - * - * Note that order of returned values must match exactly the order of keys. - * If some entry is not available for given key - it must include null for the missing key. - * - * For example: - * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] - * - * @param array $keys - * - * @return array - * @throws \Exception - */ - public function loadKeys( array $keys = [] ) { - - /** - * Prepare the args for the query. We're provided a specific set of IDs of comments - * so we want to query as efficiently as possible with as little overhead to get the comment - * objects. No need to count the rows, etc. - */ - $args = [ - 'comment__in' => $keys, - 'orderby' => 'comment__in', - 'number' => count( $keys ), - 'no_found_rows' => true, - 'count' => false, - ]; - - /** - * Execute the query. Call get_comments() to add them to the cache. - */ - $query = new \WP_Comment_Query( $args ); - $query->get_comments(); - $loaded = []; - foreach ( $keys as $key ) { - $loaded[ $key ] = \WP_Comment::get_instance( $key ); - } - return $loaded; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedScriptLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedScriptLoader.php deleted file mode 100644 index 9b237433..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedScriptLoader.php +++ /dev/null @@ -1,35 +0,0 @@ -registered[ $key ] ) ) { - $script = $wp_scripts->registered[ $key ]; - $script->type = 'EnqueuedScript'; - $loaded[ $key ] = $script; - } else { - $loaded[ $key ] = null; - } - } - return $loaded; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedStylesheetLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedStylesheetLoader.php deleted file mode 100644 index ef46a443..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/EnqueuedStylesheetLoader.php +++ /dev/null @@ -1,33 +0,0 @@ -registered[ $key ] ) ) { - $stylesheet = $wp_styles->registered[ $key ]; - $stylesheet->type = 'EnqueuedStylesheet'; - $loaded[ $key ] = $stylesheet; - } else { - $loaded[ $key ] = null; - } - } - return $loaded; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/PluginLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/PluginLoader.php deleted file mode 100644 index 2d2fc75d..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/PluginLoader.php +++ /dev/null @@ -1,60 +0,0 @@ -context; - - if ( ! empty( $entry->post_author ) && absint( $entry->post_author ) ) { - $user_id = $entry->post_author; - $context->get_loader( 'user' )->load_deferred( $user_id ); - } - - if ( 'revision' === $entry->post_type && ! empty( $entry->post_parent ) && absint( $entry->post_parent ) ) { - $post_parent = $entry->post_parent; - $context->get_loader( 'post' )->load_deferred( $post_parent ); - } - - if ( 'nav_menu_item' === $entry->post_type ) { - return new MenuItem( $entry ); - } - - $post = new Post( $entry ); - if ( empty( $post->fields ) ) { - return null; - } - - return $post; - } - - /** - * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded - * posts as the values - * - * Note that order of returned values must match exactly the order of keys. - * If some entry is not available for given key - it must include null for the missing key. - * - * For example: - * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] - * - * @param array $keys - * - * @return array - * @throws \Exception - */ - public function loadKeys( array $keys ) { - if ( empty( $keys ) ) { - return $keys; - } - - /** - * Prepare the args for the query. We're provided a specific - * set of IDs, so we want to query as efficiently as possible with - * as little overhead as possible. We don't want to return post counts, - * we don't want to include sticky posts, and we want to limit the query - * to the count of the keys provided. The query must also return results - * in the same order the keys were provided in. - */ - $post_types = \WPGraphQL::get_allowed_post_types(); - $post_types = array_merge( $post_types, [ 'revision', 'nav_menu_item' ] ); - $args = [ - 'post_type' => $post_types, - 'post_status' => 'any', - 'posts_per_page' => count( $keys ), - 'post__in' => $keys, - 'orderby' => 'post__in', - 'no_found_rows' => true, - 'split_the_query' => false, - 'ignore_sticky_posts' => true, - ]; - - /** - * Ensure that WP_Query doesn't first ask for IDs since we already have them. - */ - add_filter( - 'split_the_query', - static function ( $split, \WP_Query $query ) { - if ( false === $query->get( 'split_the_query' ) ) { - return false; - } - - return $split; - }, - 10, - 2 - ); - new \WP_Query( $args ); - $loaded_posts = []; - foreach ( $keys as $key ) { - /** - * The query above has added our objects to the cache - * so now we can pluck them from the cache to return here - * and if they don't exist we can throw an error, otherwise - * we can proceed to resolve the object via the Model layer. - */ - $post_object = get_post( (int) $key ); - - if ( ! $post_object instanceof \WP_Post ) { - $loaded_posts[ $key ] = null; - } else { - - /** - * Once dependencies are loaded, return the Post Object - */ - $loaded_posts[ $key ] = $post_object; - } - } - return $loaded_posts; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/PostTypeLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/PostTypeLoader.php deleted file mode 100644 index 00ff7a77..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/PostTypeLoader.php +++ /dev/null @@ -1,46 +0,0 @@ -taxonomy ) { - $menu = new Menu( $entry ); - if ( empty( $menu->fields ) ) { - return null; - } else { - return $menu; - } - } else { - $term = new Term( $entry ); - if ( empty( $term->fields ) ) { - return null; - } else { - return $term; - } - } - } - return null; - } - - /** - * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded - * posts as the values - * - * Note that order of returned values must match exactly the order of keys. - * If some entry is not available for given key - it must include null for the missing key. - * - * For example: - * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] - * - * @param int[] $keys - * - * @return array - * @throws \Exception - */ - public function loadKeys( array $keys ) { - if ( empty( $keys ) ) { - return $keys; - } - - /** - * Prepare the args for the query. We're provided a specific set of IDs for terms, - * so we want to query as efficiently as possible with as little overhead as possible. - */ - $args = [ - 'include' => $keys, - 'number' => count( $keys ), - 'orderby' => 'include', - 'hide_empty' => false, - ]; - - /** - * Execute the query. This adds the terms to the cache - */ - $query = new \WP_Term_Query( $args ); - $terms = $query->get_terms(); - - if ( empty( $terms ) || ! is_array( $terms ) ) { - return []; - } - - $loaded = []; - - /** - * Loop over the keys and return an array of loaded_terms, where the key is the ID and the value is - * the Term passed through the Model layer - */ - foreach ( $keys as $key ) { - - /** - * The query above has added our objects to the cache, so now we can pluck - * them from the cache to pass through the model layer, or return null if the - * object isn't in the cache, meaning it didn't come back when queried. - */ - $loaded[ $key ] = get_term( (int) $key ); - } - - return $loaded; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/ThemeLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/ThemeLoader.php deleted file mode 100644 index 20c9020c..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/ThemeLoader.php +++ /dev/null @@ -1,52 +0,0 @@ -get_stylesheet(); - $theme = wp_get_theme( $stylesheet ); - if ( $theme->exists() ) { - $loaded[ $key ] = $theme; - } else { - $loaded[ $key ] = null; - } - } - } - } - - return $loaded; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/UserLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/UserLoader.php deleted file mode 100644 index a0ebdd6a..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/UserLoader.php +++ /dev/null @@ -1,179 +0,0 @@ - true, // User 2 is public (has published posts) - * ] - * - * In this example, user 1 is not public (has no published posts) and is - * omitted from the returned array. - * - * @param array $keys Array of author IDs (int). - * - * @return array - */ - public function get_public_users( array $keys ) { - - // Get public post types that are set to show in GraphQL - // as public users are determined by whether they've published - // content in one of these post types - $post_types = \WPGraphQL::get_allowed_post_types( - 'names', - [ - 'public' => true, - ] - ); - - /** - * Exclude revisions and attachments, since neither ever receive the - * "publish" post status. - */ - unset( $post_types['revision'], $post_types['attachment'] ); - - /** - * Only retrieve public posts by the provided author IDs. Also, - * get_posts_by_author_sql only accepts a single author ID, so we'll need to - * add our own IN statement. - */ - $author_id = null; - $public_only = true; - - $where = get_posts_by_author_sql( $post_types, true, $author_id, $public_only ); - $ids = implode( ', ', array_fill( 0, count( $keys ), '%d' ) ); - $count = count( $keys ); - - global $wpdb; - - $results = $wpdb->get_results( // phpcs:ignore WordPress.DB.DirectDatabaseQuery.NoCaching,WordPress.DB.DirectDatabaseQuery.DirectQuery - $wpdb->prepare( - "SELECT DISTINCT `post_author` FROM $wpdb->posts $where AND `post_author` IN ( $ids ) LIMIT $count", // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared,WordPress.DB.PreparedSQLPlaceholders.UnfinishedPrepare - $keys - ) - ); - - /** - * Empty results or error. - */ - if ( ! is_array( $results ) ) { - return []; - } - - /** - * Reduce to an associative array that can be easily consumed. - */ - return array_reduce( - $results, - static function ( $carry, $result ) { - $carry[ (int) $result->post_author ] = true; - return $carry; - }, - [] - ); - } - - /** - * Given array of keys, loads and returns a map consisting of keys from `keys` array and loaded - * values - * - * Note that order of returned values must match exactly the order of keys. - * If some entry is not available for given key - it must include null for the missing key. - * - * For example: - * loadKeys(['a', 'b', 'c']) -> ['a' => 'value1, 'b' => null, 'c' => 'value3'] - * - * @param array $keys - * - * @return array - * @throws \Exception - */ - public function loadKeys( array $keys ) { - if ( empty( $keys ) ) { - return $keys; - } - - /** - * Prepare the args for the query. We're provided a specific - * set of IDs, so we want to query as efficiently as possible with - * as little overhead as possible. We don't want to return post counts, - * we don't want to include sticky posts, and we want to limit the query - * to the count of the keys provided. We don't care about the order since we - * will reorder them ourselves to match the order of the provided keys. - */ - $args = [ - 'include' => $keys, - 'number' => count( $keys ), - 'count_total' => false, - 'fields' => 'all_with_meta', - ]; - - /** - * Query for the users and get the results - */ - $query = new \WP_User_Query( $args ); - $query->get_results(); - - /** - * Determine which of the users are public (have published posts). - */ - $public_users = $this->get_public_users( $keys ); - - /** - * Loop over the keys and reduce to an associative array, providing the - * WP_User instance (if found) or null. This ensures that the returned array - * has the same keys that were provided and in the same order. - */ - return array_reduce( - $keys, - static function ( $carry, $key ) use ( $public_users ) { - $user = get_user_by( 'id', $key ); // Cached via previous WP_User_Query. - - if ( $user instanceof \WP_User ) { - /** - * Set a property on the user that can be accessed by the User model. - */ - // @phpstan-ignore-next-line - $user->is_private = ! isset( $public_users[ $key ] ); - - $carry[ $key ] = $user; - } else { - $carry[ $key ] = null; - } - - return $carry; - }, - [] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/Loader/UserRoleLoader.php b/lib/wp-graphql-1.17.0/src/Data/Loader/UserRoleLoader.php deleted file mode 100644 index c438baf1..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/Loader/UserRoleLoader.php +++ /dev/null @@ -1,52 +0,0 @@ -roles; - - $loaded = []; - if ( ! empty( $wp_roles ) && is_array( $wp_roles ) ) { - foreach ( $keys as $key ) { - if ( isset( $wp_roles[ $key ] ) ) { - $role = $wp_roles[ $key ]; - $role['slug'] = $key; - $role['id'] = $key; - $role['displayName'] = $role['name']; - $role['name'] = $key; - $loaded[ $key ] = $role; - } else { - $loaded[ $key ] = null; - } - } - } - - return $loaded; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/MediaItemMutation.php b/lib/wp-graphql-1.17.0/src/Data/MediaItemMutation.php deleted file mode 100644 index 8a026ef3..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/MediaItemMutation.php +++ /dev/null @@ -1,144 +0,0 @@ -name; - - /** - * Prepare the data for inserting the mediaItem - * NOTE: These are organized in the same order as: http://v2.wp-api.org/reference/media/#schema-meta - */ - if ( ! empty( $input['date'] ) && false !== strtotime( $input['date'] ) ) { - $insert_post_args['post_date'] = gmdate( 'Y-m-d H:i:s', strtotime( $input['date'] ) ); - } - - if ( ! empty( $input['dateGmt'] ) && false !== strtotime( $input['dateGmt'] ) ) { - $insert_post_args['post_date_gmt'] = gmdate( 'Y-m-d H:i:s', strtotime( $input['dateGmt'] ) ); - } - - if ( ! empty( $input['slug'] ) ) { - $insert_post_args['post_name'] = $input['slug']; - } - - if ( ! empty( $input['status'] ) ) { - $insert_post_args['post_status'] = $input['status']; - } else { - $insert_post_args['post_status'] = 'inherit'; - } - - if ( ! empty( $input['title'] ) ) { - $insert_post_args['post_title'] = $input['title']; - } elseif ( ! empty( $file['file'] ) ) { - $insert_post_args['post_title'] = basename( $file['file'] ); - } - - if ( ! empty( $input['authorId'] ) ) { - $insert_post_args['post_author'] = Utils::get_database_id_from_id( $input['authorId'] ); - } - - if ( ! empty( $input['commentStatus'] ) ) { - $insert_post_args['comment_status'] = $input['commentStatus']; - } - - if ( ! empty( $input['pingStatus'] ) ) { - $insert_post_args['ping_status'] = $input['pingStatus']; - } - - if ( ! empty( $input['caption'] ) ) { - $insert_post_args['post_excerpt'] = $input['caption']; - } - - if ( ! empty( $input['description'] ) ) { - $insert_post_args['post_content'] = $input['description']; - } else { - $insert_post_args['post_content'] = ''; - } - - if ( ! empty( $file['type'] ) ) { - $insert_post_args['post_mime_type'] = $file['type']; - } elseif ( ! empty( $input['fileType'] ) ) { - $insert_post_args['post_mime_type'] = $input['fileType']; - } - - if ( ! empty( $input['parentId'] ) ) { - $insert_post_args['post_parent'] = Utils::get_database_id_from_id( $input['parentId'] ); - } - - /** - * Filter the $insert_post_args - * - * @param array $insert_post_args The array of $input_post_args that will be passed to wp_insert_attachment - * @param array $input The data that was entered as input for the mutation - * @param \WP_Post_Type $post_type_object The post_type_object that the mutation is affecting - * @param string $mutation_type The type of mutation being performed (create, update, delete) - */ - $insert_post_args = apply_filters( 'graphql_media_item_insert_post_args', $insert_post_args, $input, $post_type_object, $mutation_name ); - - return $insert_post_args; - } - - /** - * This updates additional data related to a mediaItem, such as postmeta. - * - * @param int $media_item_id The ID of the media item being mutated - * @param array $input The input on the mutation - * @param \WP_Post_Type $post_type_object The Post Type Object for the item being mutated - * @param string $mutation_name The name of the mutation - * @param \WPGraphQL\AppContext $context The AppContext that is passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo that is passed down the resolve tree - * - * @return void - */ - public static function update_additional_media_item_data( int $media_item_id, array $input, WP_Post_Type $post_type_object, string $mutation_name, AppContext $context, ResolveInfo $info ) { - - /** - * Update alt text postmeta for the mediaItem - */ - if ( ! empty( $input['altText'] ) ) { - update_post_meta( $media_item_id, '_wp_attachment_image_alt', $input['altText'] ); - } - - /** - * Run an action after the additional data has been updated. This is a great spot to hook into to - * update additional data related to mediaItems, such as updating additional postmeta, - * or sending emails to Kevin. . .whatever you need to do with the mediaItem. - * - * @param int $media_item_id The ID of the mediaItem being mutated - * @param array $input The input for the mutation - * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated - * @param string $mutation_name The name of the mutation (ex: create, update, delete) - * @param \WPGraphQL\AppContext $context The AppContext that is passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo that is passed down the resolve tree - */ - do_action( 'graphql_media_item_mutation_update_additional_data', $media_item_id, $input, $post_type_object, $mutation_name, $context, $info ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/NodeResolver.php b/lib/wp-graphql-1.17.0/src/Data/NodeResolver.php deleted file mode 100644 index ecd96185..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/NodeResolver.php +++ /dev/null @@ -1,622 +0,0 @@ -wp = $wp; - $this->wp->matched_rule = Router::$route . '/?$'; - $this->context = $context; - } - - /** - * Given a Post object, validates it before returning it. - * - * @param \WP_Post $post - * - * @return \WP_Post|null - */ - public function validate_post( WP_Post $post ) { - if ( isset( $this->wp->query_vars['post_type'] ) && ( $post->post_type !== $this->wp->query_vars['post_type'] ) ) { - return null; - } - - if ( ! $this->is_valid_node_type( 'ContentNode' ) ) { - return null; - } - - /** - * Disabling the following code for now, since add_rewrite_uri() would cause a request to direct to a different valid permalink. - */ - /* phpcs:disable - if ( ! isset( $this->wp->query_vars['uri'] ) ) { - return $post; - } - $permalink = get_permalink( $post ); - $parsed_path = $permalink ? wp_parse_url( $permalink, PHP_URL_PATH ) : null; - $trimmed_path = $parsed_path ? rtrim( ltrim( $parsed_path, '/' ), '/' ) : null; - $uri_path = rtrim( ltrim( $this->wp->query_vars['uri'], '/' ), '/' ); - if ( $trimmed_path !== $uri_path ) { - return null; - } - phpcs:enable */ - - if ( empty( $this->wp->query_vars['uri'] ) ) { - return $post; - } - - // if the uri doesn't have the post's urlencoded name or ID in it, we must've found something we didn't expect - // so we will return null - if ( false === strpos( $this->wp->query_vars['uri'], (string) $post->ID ) && false === strpos( $this->wp->query_vars['uri'], urldecode( sanitize_title( $post->post_name ) ) ) ) { - return null; - } - - return $post; - } - - /** - * Given a Term object, validates it before returning it. - * - * @param \WP_Term $term - * - * @return \WP_Term|null - */ - public function validate_term( \WP_Term $term ) { - if ( ! $this->is_valid_node_type( 'TermNode' ) ) { - return null; - } - - if ( isset( $this->wp->query_vars['taxonomy'] ) && $term->taxonomy !== $this->wp->query_vars['taxonomy'] ) { - return null; - } - - return $term; - } - - /** - * Given the URI of a resource, this method attempts to resolve it and return the - * appropriate related object - * - * @param string $uri The path to be used as an identifier for the - * resource. - * @param mixed|array|string $extra_query_vars Any extra query vars to consider - * - * @return mixed - * @throws \Exception - */ - public function resolve_uri( string $uri, $extra_query_vars = '' ) { - - /** - * When this filter return anything other than null, it will be used as a resolved node - * and the execution will be skipped. - * - * This is to be used in extensions to resolve their own nodes which might not use - * WordPress permalink structure. - * - * @param mixed|null $node The node, defaults to nothing. - * @param string $uri The uri being searched. - * @param \WPGraphQL\AppContext $content The app context. - * @param \WP $wp WP object. - * @param mixed|array|string $extra_query_vars Any extra query vars to consider. - */ - $node = apply_filters( 'graphql_pre_resolve_uri', null, $uri, $this->context, $this->wp, $extra_query_vars ); - - if ( ! empty( $node ) ) { - return $node; - } - - /** - * Try to resolve the URI with WP_Query. - * - * This is the way WordPress native permalinks are resolved. - * - * @see \WP::main() - */ - - // Parse the URI and sets the $wp->query_vars property. - $uri = $this->parse_request( $uri, $extra_query_vars ); - - /** - * If the URI is '/', we can resolve it now. - * - * We don't rely on $this->parse_request(), since the home page doesn't get a rewrite rule. - */ - if ( '/' === $uri ) { - return $this->resolve_home_page(); - } - - /** - * Filter the query class used to resolve the URI. By default this is WP_Query. - * - * This can be used by Extensions which use a different query class to resolve data. - * - * @param class-string $query_class The query class used to resolve the URI. Defaults to WP_Query. - * @param ?string $uri The uri being searched. - * @param \WPGraphQL\AppContext $content The app context. - * @param \WP $wp WP object. - * @param mixed|array|string $extra_query_vars Any extra query vars to consider. - */ - $query_class = apply_filters( 'graphql_resolve_uri_query_class', 'WP_Query', $uri, $this->context, $this->wp, $extra_query_vars ); - - if ( ! class_exists( $query_class ) ) { - throw new UserError( - esc_html( - sprintf( - /* translators: %s: The query class used to resolve the URI */ - __( 'The query class %s used to resolve the URI does not exist.', 'wp-graphql' ), - $query_class - ) - ) - ); - } - - /** @var \WP_Query $query */ - $query = new $query_class( $this->wp->query_vars ); - - // is the query is an archive - if ( isset( $query->posts[0] ) && $query->posts[0] instanceof WP_Post && ! $query->is_archive() ) { - $queried_object = $query->posts[0]; - } else { - $queried_object = $query->get_queried_object(); - } - - /** - * When this filter return anything other than null, it will be used as a resolved node - * and the execution will be skipped. - * - * This is to be used in extensions to resolve their own nodes which might not use - * WordPress permalink structure. - * - * It differs from 'graphql_pre_resolve_uri' in that it has been called after the query has been run using the query vars. - * - * @param mixed|null $node The node, defaults to nothing. - * @param ?string $uri The uri being searched. - * @param \WP_Term|\WP_Post_Type|\WP_Post|\WP_User|null $queried_object The queried object, if WP_Query returns one. - * @param \WP_Query $query The query object. - * @param \WPGraphQL\AppContext $content The app context. - * @param \WP $wp WP object. - * @param mixed|array|string $extra_query_vars Any extra query vars to consider. - */ - $node = apply_filters( 'graphql_resolve_uri', null, $uri, $queried_object, $query, $this->context, $this->wp, $extra_query_vars ); - - if ( ! empty( $node ) ) { - return $node; - } - - - // Resolve Post Objects. - if ( $queried_object instanceof WP_Post ) { - // If Page for Posts is set, we need to return the Page archive, not the page. - if ( $query->is_posts_page ) { - // If were intentionally querying for a something other than a ContentType, we need to return null instead of the archive. - if ( ! $this->is_valid_node_type( 'ContentType' ) ) { - return null; - } - - $post_type_object = get_post_type_object( 'post' ); - - if ( ! $post_type_object ) { - return null; - } - - return ! empty( $post_type_object->name ) ? $this->context->get_loader( 'post_type' )->load_deferred( $post_type_object->name ) : null; - } - - // Validate the post before returning it. - if ( ! $this->validate_post( $queried_object ) ) { - return null; - } - - return ! empty( $queried_object->ID ) ? $this->context->get_loader( 'post' )->load_deferred( $queried_object->ID ) : null; - } - - // Resolve Terms. - if ( $queried_object instanceof \WP_Term ) { - // Validate the term before returning it. - if ( ! $this->validate_term( $queried_object ) ) { - return null; - } - - return ! empty( $queried_object->term_id ) ? $this->context->get_loader( 'term' )->load_deferred( $queried_object->term_id ) : null; - } - - // Resolve Post Types. - if ( $queried_object instanceof \WP_Post_Type ) { - - // Bail if we're explicitly requesting a different GraphQL type. - if ( ! $this->is_valid_node_type( 'ContentType' ) ) { - return null; - } - - - - return ! empty( $queried_object->name ) ? $this->context->get_loader( 'post_type' )->load_deferred( $queried_object->name ) : null; - } - - // Resolve Users - if ( $queried_object instanceof \WP_User ) { - // Bail if we're explicitly requesting a different GraphQL type. - if ( ! $this->is_valid_node_type( 'User' ) ) { - return null; - } - - return ! empty( $queried_object->ID ) ? $this->context->get_loader( 'user' )->load_deferred( $queried_object->ID ) : null; - } - - /** - * This filter provides a fallback for resolving nodes that were unable to be resolved by NodeResolver::resolve_uri. - * - * This can be used by Extensions to resolve edge cases that are not handled by the core NodeResolver. - * - * @param mixed|null $node The node, defaults to nothing. - * @param ?string $uri The uri being searched. - * @param \WP_Term|\WP_Post_Type|\WP_Post|\WP_User|null $queried_object The queried object, if WP_Query returns one. - * @param \WP_Query $query The query object. - * @param \WPGraphQL\AppContext $content The app context. - * @param \WP $wp WP object. - * @param mixed|array|string $extra_query_vars Any extra query vars to consider. - */ - return apply_filters( 'graphql_post_resolve_uri', $node, $uri, $queried_object, $query, $this->context, $this->wp, $extra_query_vars ); - } - - /** - * Parses a URL to produce an array of query variables. - * - * Mimics WP::parse_request() - * - * @param string $uri - * @param array|string $extra_query_vars - * - * @return string|null The parsed uri. - */ - public function parse_request( string $uri, $extra_query_vars = '' ) { - // Attempt to parse the provided URI. - $parsed_url = wp_parse_url( $uri ); - - if ( false === $parsed_url ) { - graphql_debug( - __( 'Cannot parse provided URI', 'wp-graphql' ), - [ - 'uri' => $uri, - ] - ); - return null; - } - - // Bail if external URI. - if ( isset( $parsed_url['host'] ) ) { - $site_url = wp_parse_url( site_url() ); - $home_url = wp_parse_url( home_url() ); - - /** - * @var array $home_url - * @var array $site_url - */ - if ( ! in_array( - $parsed_url['host'], - [ - $site_url['host'], - $home_url['host'], - ], - true - ) ) { - graphql_debug( - __( 'Cannot return a resource for an external URI', 'wp-graphql' ), - [ - 'uri' => $uri, - ] - ); - return null; - } - } - - if ( isset( $parsed_url['query'] ) && ( empty( $parsed_url['path'] ) || '/' === $parsed_url['path'] ) ) { - $uri = $parsed_url['query']; - } elseif ( isset( $parsed_url['path'] ) ) { - $uri = $parsed_url['path']; - } - - /** - * Follows pattern from WP::parse_request() - * - * @see https://github.com/WordPress/wordpress-develop/blob/6.0.2/src/wp-includes/class-wp.php#L135 - */ - global $wp_rewrite; - - $this->wp->query_vars = []; - $post_type_query_vars = []; - - if ( is_array( $extra_query_vars ) ) { - $this->wp->query_vars = &$extra_query_vars; - } elseif ( ! empty( $extra_query_vars ) ) { - parse_str( $extra_query_vars, $this->wp->extra_query_vars ); - } - - // Set uri to Query vars. - $this->wp->query_vars['uri'] = $uri; - - // Process PATH_INFO, REQUEST_URI, and 404 for permalinks. - - // Fetch the rewrite rules. - $rewrite = $wp_rewrite->wp_rewrite_rules(); - if ( ! empty( $rewrite ) ) { - // If we match a rewrite rule, this will be cleared. - $error = '404'; - $this->wp->did_permalink = true; - - $pathinfo = ! empty( $uri ) ? $uri : ''; - list( $pathinfo ) = explode( '?', $pathinfo ); - $pathinfo = str_replace( '%', '%25', $pathinfo ); - - list( $req_uri ) = explode( '?', $pathinfo ); - $home_path = parse_url( home_url(), PHP_URL_PATH ); // phpcs:ignore WordPress.WP.AlternativeFunctions.parse_url_parse_url - $home_path_regex = ''; - if ( is_string( $home_path ) && '' !== $home_path ) { - $home_path = trim( $home_path, '/' ); - $home_path_regex = sprintf( '|^%s|i', preg_quote( $home_path, '|' ) ); - } - - /* - * Trim path info from the end and the leading home path from the front. - * For path info requests, this leaves us with the requesting filename, if any. - * For 404 requests, this leaves us with the requested permalink. - */ - $query = ''; - $matches = null; - $req_uri = str_replace( $pathinfo, '', $req_uri ); - $req_uri = trim( $req_uri, '/' ); - $pathinfo = trim( $pathinfo, '/' ); - - if ( ! empty( $home_path_regex ) ) { - $req_uri = preg_replace( $home_path_regex, '', $req_uri ); - $req_uri = trim( $req_uri, '/' ); // @phpstan-ignore-line - $pathinfo = preg_replace( $home_path_regex, '', $pathinfo ); - $pathinfo = trim( $pathinfo, '/' ); // @phpstan-ignore-line - } - - // The requested permalink is in $pathinfo for path info requests and - // $req_uri for other requests. - if ( ! empty( $pathinfo ) && ! preg_match( '|^.*' . $wp_rewrite->index . '$|', $pathinfo ) ) { - $requested_path = $pathinfo; - } else { - // If the request uri is the index, blank it out so that we don't try to match it against a rule. - if ( $req_uri === $wp_rewrite->index ) { - $req_uri = ''; - } - $requested_path = $req_uri; - } - $requested_file = $req_uri; - - $this->wp->request = $requested_path; - - // Look for matches. - $request_match = $requested_path; - if ( empty( $request_match ) ) { - // An empty request could only match against ^$ regex - if ( isset( $rewrite['$'] ) ) { - $this->wp->matched_rule = '$'; - $query = $rewrite['$']; - $matches = [ '' ]; - } - } else { - foreach ( (array) $rewrite as $match => $query ) { - // If the requested file is the anchor of the match, prepend it to the path info. - if ( ! empty( $requested_file ) && strpos( $match, $requested_file ) === 0 && $requested_file !== $requested_path ) { - $request_match = $requested_file . '/' . $requested_path; - } - - if ( - preg_match( "#^$match#", $request_match, $matches ) || - preg_match( "#^$match#", urldecode( $request_match ), $matches ) - ) { - if ( $wp_rewrite->use_verbose_page_rules && preg_match( '/pagename=\$matches\[([0-9]+)\]/', $query, $varmatch ) ) { - // This is a verbose page match, let's check to be sure about it. - $page = get_page_by_path( $matches[ $varmatch[1] ] ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_page_by_path_get_page_by_path - if ( ! $page ) { - continue; - } - - $post_status_obj = get_post_status_object( $page->post_status ); - if ( - ( ! isset( $post_status_obj->public ) || ! $post_status_obj->public ) && - ( ! isset( $post_status_obj->protected ) || ! $post_status_obj->protected ) && - ( ! isset( $post_status_obj->private ) || ! $post_status_obj->private ) && - ( ! isset( $post_status_obj->exclude_from_search ) || $post_status_obj->exclude_from_search ) - ) { - continue; - } - } - - // Got a match. - $this->wp->matched_rule = $match; - break; - } - } - } - - if ( ! empty( $this->wp->matched_rule ) ) { - // Trim the query of everything up to the '?'. - $query = preg_replace( '!^.+\?!', '', $query ); - - // Substitute the substring matches into the query. - $query = addslashes( \WP_MatchesMapRegex::apply( $query, $matches ) ); // @phpstan-ignore-line - - $this->wp->matched_query = $query; - - // Parse the query. - parse_str( $query, $perma_query_vars ); - - // If we're processing a 404 request, clear the error var since we found something. - // @phpstan-ignore-next-line - if ( '404' == $error ) { // phpcs:ignore Universal.Operators.StrictComparisons.LooseEqual - unset( $error ); - } - } - } - - /** - * Filters the query variables allowed before processing. - * - * Allows (publicly allowed) query vars to be added, removed, or changed prior - * to executing the query. Needed to allow custom rewrite rules using your own arguments - * to work, or any other custom query variables you want to be publicly available. - * - * @since 1.5.0 - * - * @param string[] $public_query_vars The array of allowed query variable names. - */ - $this->wp->public_query_vars = apply_filters( 'query_vars', $this->wp->public_query_vars ); - - foreach ( get_post_types( [ 'show_in_graphql' => true ], 'objects' ) as $post_type => $t ) { - /** @var \WP_Post_Type $t */ - if ( $t->query_var ) { - $post_type_query_vars[ $t->query_var ] = $post_type; - } - } - - foreach ( $this->wp->public_query_vars as $wpvar ) { - $parsed_query = []; - if ( isset( $parsed_url['query'] ) ) { - parse_str( $parsed_url['query'], $parsed_query ); - } - - if ( isset( $this->wp->extra_query_vars[ $wpvar ] ) ) { - $this->wp->query_vars[ $wpvar ] = $this->wp->extra_query_vars[ $wpvar ]; - } elseif ( isset( $_GET[ $wpvar ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification - $this->wp->query_vars[ $wpvar ] = $_GET[ $wpvar ]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized,WordPress.Security.NonceVerification.Recommended - } elseif ( isset( $perma_query_vars[ $wpvar ] ) ) { - $this->wp->query_vars[ $wpvar ] = $perma_query_vars[ $wpvar ]; - } elseif ( isset( $parsed_query[ $wpvar ] ) ) { - $this->wp->query_vars[ $wpvar ] = $parsed_query[ $wpvar ]; - } - - if ( ! empty( $this->wp->query_vars[ $wpvar ] ) ) { - if ( ! is_array( $this->wp->query_vars[ $wpvar ] ) ) { - $this->wp->query_vars[ $wpvar ] = (string) $this->wp->query_vars[ $wpvar ]; - } else { - foreach ( $this->wp->query_vars[ $wpvar ] as $vkey => $v ) { - if ( is_scalar( $v ) ) { - $this->wp->query_vars[ $wpvar ][ $vkey ] = (string) $v; - } - } - } - - if ( isset( $post_type_query_vars[ $wpvar ] ) ) { - $this->wp->query_vars['post_type'] = $post_type_query_vars[ $wpvar ]; - $this->wp->query_vars['name'] = $this->wp->query_vars[ $wpvar ]; - } - } - } - - // Convert urldecoded spaces back into '+'. - foreach ( get_taxonomies( [ 'show_in_graphql' => true ], 'objects' ) as $t ) { - if ( $t->query_var && isset( $this->wp->query_vars[ $t->query_var ] ) ) { - $this->wp->query_vars[ $t->query_var ] = str_replace( ' ', '+', $this->wp->query_vars[ $t->query_var ] ); - } - } - - // Limit publicly queried post_types to those that are publicly_queryable - if ( isset( $this->wp->query_vars['post_type'] ) ) { - $queryable_post_types = get_post_types( [ 'show_in_graphql' => true ] ); - if ( ! is_array( $this->wp->query_vars['post_type'] ) ) { - if ( ! in_array( $this->wp->query_vars['post_type'], $queryable_post_types, true ) ) { - unset( $this->wp->query_vars['post_type'] ); - } - } else { - $this->wp->query_vars['post_type'] = array_intersect( $this->wp->query_vars['post_type'], $queryable_post_types ); - } - } - - // Resolve conflicts between posts with numeric slugs and date archive queries. - $this->wp->query_vars = wp_resolve_numeric_slug_conflicts( $this->wp->query_vars ); - - foreach ( (array) $this->wp->private_query_vars as $var ) { - if ( isset( $this->wp->extra_query_vars[ $var ] ) ) { - $this->wp->query_vars[ $var ] = $this->wp->extra_query_vars[ $var ]; - } - } - - if ( isset( $error ) ) { - $this->wp->query_vars['error'] = $error; - } - - /** - * Filters the array of parsed query variables. - * - * @param array $query_vars The array of requested query variables. - * - * @since 2.1.0 - */ - $this->wp->query_vars = apply_filters( 'request', $this->wp->query_vars ); - - // We don't need the GraphQL args anymore. - unset( $this->wp->query_vars['graphql'] ); - - do_action_ref_array( 'parse_request', [ &$this->wp ] ); - - return $uri; - } - - /** - * Checks if the node type is set in the query vars and, if so, whether it matches the node type. - */ - protected function is_valid_node_type( string $node_type ): bool { - return ! isset( $this->wp->query_vars['nodeType'] ) || $this->wp->query_vars['nodeType'] === $node_type; - } - - /** - * Resolves the home page. - * - * If the homepage is a static page, return the page, otherwise we return the Posts `ContentType`. - * - * @todo Replace `ContentType` with an `Archive` type. - */ - protected function resolve_home_page(): ?Deferred { - $page_id = get_option( 'page_on_front', 0 ); - $show_on_front = get_option( 'show_on_front', 'posts' ); - - // If the homepage is a static page, return the page. - if ( 'page' === $show_on_front && ! empty( $page_id ) ) { - $page = get_post( $page_id ); - - if ( empty( $page ) ) { - return null; - } - - return $this->context->get_loader( 'post' )->load_deferred( $page->ID ); - } - - // If the homepage is set to latest posts, we need to make sure not to resolve it when when for other types. - if ( ! $this->is_valid_node_type( 'ContentType' ) ) { - return null; - } - - // We dont have an 'Archive' type, so we resolve to the ContentType. - return $this->context->get_loader( 'post_type' )->load_deferred( 'post' ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/PostObjectMutation.php b/lib/wp-graphql-1.17.0/src/Data/PostObjectMutation.php deleted file mode 100644 index 7c2261eb..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/PostObjectMutation.php +++ /dev/null @@ -1,496 +0,0 @@ -name; - - /** - * Prepare the data for inserting the post - * NOTE: These are organized in the same order as: https://developer.wordpress.org/reference/functions/wp_insert_post/ - */ - if ( ! empty( $input['authorId'] ) ) { - $insert_post_args['post_author'] = Utils::get_database_id_from_id( $input['authorId'] ); - } - - if ( ! empty( $input['date'] ) && false !== strtotime( $input['date'] ) ) { - $insert_post_args['post_date'] = gmdate( 'Y-m-d H:i:s', strtotime( $input['date'] ) ); - } - - if ( ! empty( $input['content'] ) ) { - $insert_post_args['post_content'] = $input['content']; - } - - if ( ! empty( $input['title'] ) ) { - $insert_post_args['post_title'] = $input['title']; - } - - if ( ! empty( $input['excerpt'] ) ) { - $insert_post_args['post_excerpt'] = $input['excerpt']; - } - - if ( ! empty( $input['status'] ) ) { - $insert_post_args['post_status'] = $input['status']; - } - - if ( ! empty( $input['commentStatus'] ) ) { - $insert_post_args['comment_status'] = $input['commentStatus']; - } - - if ( ! empty( $input['pingStatus'] ) ) { - $insert_post_args['ping_status'] = $input['pingStatus']; - } - - if ( ! empty( $input['password'] ) ) { - $insert_post_args['post_password'] = $input['password']; - } - - if ( ! empty( $input['slug'] ) ) { - $insert_post_args['post_name'] = $input['slug']; - } - - if ( ! empty( $input['toPing'] ) ) { - $insert_post_args['to_ping'] = $input['toPing']; - } - - if ( ! empty( $input['pinged'] ) ) { - $insert_post_args['pinged'] = $input['pinged']; - } - - if ( ! empty( $input['parentId'] ) ) { - $insert_post_args['post_parent'] = Utils::get_database_id_from_id( $input['parentId'] ); - } - - if ( ! empty( $input['menuOrder'] ) ) { - $insert_post_args['menu_order'] = $input['menuOrder']; - } - - if ( ! empty( $input['mimeType'] ) ) { - $insert_post_args['post_mime_type'] = $input['mimeType']; - } - - if ( ! empty( $input['commentCount'] ) ) { - $insert_post_args['comment_count'] = $input['commentCount']; - } - - /** - * Filter the $insert_post_args - * - * @param array $insert_post_args The array of $input_post_args that will be passed to wp_insert_post - * @param array $input The data that was entered as input for the mutation - * @param \WP_Post_Type $post_type_object The post_type_object that the mutation is affecting - * @param string $mutation_type The type of mutation being performed (create, edit, etc) - */ - $insert_post_args = apply_filters( 'graphql_post_object_insert_post_args', $insert_post_args, $input, $post_type_object, $mutation_name ); - - /** - * Return the $args - */ - return $insert_post_args; - } - - /** - * This updates additional data related to a post object, such as postmeta, term relationships, - * etc. - * - * @param int $post_id $post_id The ID of the postObject being - * mutated - * @param array $input The input for the mutation - * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being - * mutated - * @param string $mutation_name The name of the mutation (ex: create, update, - * delete) - * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers - * @param string $intended_post_status The intended post_status the post should have - * according to the mutation input - * @param string $default_post_status The default status posts should use if an - * intended status wasn't set - * - * @return void - */ - public static function update_additional_post_object_data( $post_id, $input, $post_type_object, $mutation_name, AppContext $context, ResolveInfo $info, $default_post_status = null, $intended_post_status = null ) { - - /** - * Sets the post lock - * - * @param bool $is_locked Whether the post is locked - * @param int $post_id The ID of the postObject being mutated - * @param array $input The input for the mutation - * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated - * @param string $mutation_name The name of the mutation (ex: create, update, delete) - * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers - * @param ?string $intended_post_status The intended post_status the post should have according to the mutation input - * @param ?string $default_post_status The default status posts should use if an intended status wasn't set - * - * @return bool - */ - if ( true === apply_filters( 'graphql_post_object_mutation_set_edit_lock', true, $post_id, $input, $post_type_object, $mutation_name, $context, $info, $default_post_status, $intended_post_status ) ) { - /** - * Set the post_lock for the $new_post_id - */ - self::set_edit_lock( $post_id ); - } - - /** - * Update the _edit_last field - */ - update_post_meta( $post_id, '_edit_last', get_current_user_id() ); - - /** - * Update the postmeta fields - */ - if ( ! empty( $input['desiredSlug'] ) ) { - update_post_meta( $post_id, '_wp_desired_post_slug', $input['desiredSlug'] ); - } - - /** - * Set the object terms - * - * @param int $post_id The ID of the postObject being mutated - * @param array $input The input for the mutation - * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated - * @param string $mutation_name The name of the mutation (ex: create, update, delete) - */ - self::set_object_terms( $post_id, $input, $post_type_object, $mutation_name ); - - /** - * Run an action after the additional data has been updated. This is a great spot to hook into to - * update additional data related to postObjects, such as setting relationships, updating additional postmeta, - * or sending emails to Kevin. . .whatever you need to do with the postObject. - * - * @param int $post_id The ID of the postObject being mutated - * @param array $input The input for the mutation - * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated - * @param string $mutation_name The name of the mutation (ex: create, update, delete) - * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers - * @param ?string $intended_post_status The intended post_status the post should have according to the mutation input - * @param ?string $default_post_status The default status posts should use if an intended status wasn't set - */ - do_action( 'graphql_post_object_mutation_update_additional_data', $post_id, $input, $post_type_object, $mutation_name, $context, $info, $default_post_status, $intended_post_status ); - - /** - * Sets the post lock - * - * @param bool $is_locked Whether the post is locked. - * @param int $post_id The ID of the postObject being mutated - * @param array $input The input for the mutation - * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated - * @param string $mutation_name The name of the mutation (ex: create, update, delete) - * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers - * @param ?string $intended_post_status The intended post_status the post should have according to the mutation input - * @param ?string $default_post_status The default status posts should use if an intended status wasn't set - * - * @return bool - */ - if ( true === apply_filters( 'graphql_post_object_mutation_set_edit_lock', true, $post_id, $input, $post_type_object, $mutation_name, $context, $info, $default_post_status, $intended_post_status ) ) { - /** - * Set the post_lock for the $new_post_id - */ - self::remove_edit_lock( $post_id ); - } - } - - /** - * Given a $post_id and $input from the mutation, check to see if any term associations are - * being made, and properly set the relationships - * - * @param int $post_id The ID of the postObject being mutated - * @param array $input The input for the mutation - * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being - * mutated - * @param string $mutation_name The name of the mutation (ex: create, update, delete) - * - * @return void - */ - protected static function set_object_terms( int $post_id, array $input, WP_Post_Type $post_type_object, string $mutation_name ) { - - /** - * Fire an action before setting object terms during a GraphQL Post Object Mutation. - * - * One example use for this hook would be to create terms from the input that may not exist yet, so that they can be set as a relation below. - * - * @param int $post_id The ID of the postObject being mutated - * @param array $input The input for the mutation - * @param \WP_Post_Type $post_type_object The Post Type Object for the type of post being mutated - * @param string $mutation_name The name of the mutation (ex: create, update, delete) - */ - do_action( 'graphql_post_object_mutation_set_object_terms', $post_id, $input, $post_type_object, $mutation_name ); - - /** - * Get the allowed taxonomies and iterate through them to find the term inputs to use for setting relationships - * - * @var \WP_Taxonomy[] $allowed_taxonomies - */ - $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); - - foreach ( $allowed_taxonomies as $tax_object ) { - - /** - * If the taxonomy is in the array of taxonomies registered to the post_type - */ - if ( in_array( $tax_object->name, get_object_taxonomies( $post_type_object->name ), true ) ) { - - /** - * If there is input for the taxonomy, process it - */ - if ( isset( $input[ lcfirst( $tax_object->graphql_plural_name ) ] ) ) { - $term_input = $input[ lcfirst( $tax_object->graphql_plural_name ) ]; - - /** - * Default append to true, but allow input to set it to false. - */ - $append = ! isset( $term_input['append'] ) || false !== $term_input['append']; - - /** - * Start an array of terms to connect - */ - $terms_to_connect = []; - - /** - * Filter whether to allow terms to be created during a post mutation. - * - * If a post mutation includes term input for a term that does not already exist, - * this will allow terms to be created in order to connect the term to the post object, - * but if filtered to false, this will prevent the term that doesn't already exist - * from being created during the mutation of the post. - * - * @param bool $allow_term_creation Whether new terms should be created during the post object mutation - * @param \WP_Taxonomy $tax_object The Taxonomy object for the term being added to the Post Object - */ - $allow_term_creation = apply_filters( 'graphql_post_object_mutations_allow_term_creation', true, $tax_object ); - - /** - * If there are nodes in the term_input - */ - if ( ! empty( $term_input['nodes'] ) && is_array( $term_input['nodes'] ) ) { - foreach ( $term_input['nodes'] as $node ) { - $term_exists = false; - - /** - * Handle the input for ID first. - */ - if ( ! empty( $node['id'] ) ) { - if ( ! absint( $node['id'] ) ) { - $id_parts = Relay::fromGlobalId( $node['id'] ); - - if ( ! empty( $id_parts['id'] ) ) { - $term_exists = get_term_by( 'id', absint( $id_parts['id'] ), $tax_object->name ); - if ( isset( $term_exists->term_id ) ) { - $terms_to_connect[] = $term_exists->term_id; - } - } - } else { - $term_exists = get_term_by( 'id', absint( $node['id'] ), $tax_object->name ); - if ( isset( $term_exists->term_id ) ) { - $terms_to_connect[] = $term_exists->term_id; - } - } - - /** - * Next, handle the input for slug if there wasn't an ID input - */ - } elseif ( ! empty( $node['slug'] ) ) { - $sanitized_slug = sanitize_text_field( $node['slug'] ); - $term_exists = get_term_by( 'slug', $sanitized_slug, $tax_object->name ); - if ( isset( $term_exists->term_id ) ) { - $terms_to_connect[] = $term_exists->term_id; - } - /** - * If the input for the term isn't an existing term, check to make sure - * we're allowed to create new terms during a Post Object mutation - */ - } - - /** - * If no term exists so far, and terms are set to be allowed to be created - * during a post object mutation, create the term to connect based on the - * input - */ - if ( ! $term_exists && true === $allow_term_creation ) { - - /** - * If the current user cannot edit terms, don't create terms to connect - */ - if ( ! isset( $tax_object->cap->edit_terms ) || ! current_user_can( $tax_object->cap->edit_terms ) ) { - return; - } - - $created_term = self::create_term_to_connect( $node, $tax_object->name ); - - if ( ! empty( $created_term ) ) { - $terms_to_connect[] = $created_term; - } - } - } - } - - /** - * If the current user cannot edit terms, don't create terms to connect - */ - if ( ! isset( $tax_object->cap->assign_terms ) || ! current_user_can( $tax_object->cap->assign_terms ) ) { - return; - } - - wp_set_object_terms( $post_id, $terms_to_connect, $tax_object->name, $append ); - } - } - } - } - - /** - * Given an array of Term properties (slug, name, description, etc), create the term and return - * a term_id - * - * @param array $node The node input for the term - * @param string $taxonomy The taxonomy the term input is for - * - * @return int $term_id The ID of the created term. 0 if no term was created. - */ - protected static function create_term_to_connect( $node, $taxonomy ) { - $created_term = []; - $term_to_create = []; - $term_args = []; - - if ( ! empty( $node['name'] ) ) { - $term_to_create['name'] = sanitize_text_field( $node['name'] ); - } elseif ( ! empty( $node['slug'] ) ) { - $term_to_create['name'] = sanitize_text_field( $node['slug'] ); - } - - if ( ! empty( $node['slug'] ) ) { - $term_args['slug'] = sanitize_text_field( $node['slug'] ); - } - - if ( ! empty( $node['description'] ) ) { - $term_args['description'] = sanitize_text_field( $node['description'] ); - } - - /** - * @todo: consider supporting "parent" input in $term_args - */ - - if ( isset( $term_to_create['name'] ) && ! empty( $term_to_create['name'] ) ) { - $created_term = wp_insert_term( $term_to_create['name'], $taxonomy, $term_args ); - } - - if ( is_wp_error( $created_term ) ) { - if ( isset( $created_term->error_data['term_exists'] ) ) { - return $created_term->error_data['term_exists']; - } - - return 0; - } - - /** - * Return the created term, or 0 - */ - return isset( $created_term['term_id'] ) ? absint( $created_term['term_id'] ) : 0; - } - - /** - * This is a copy of the wp_set_post_lock function that exists in WordPress core, but is not - * accessible because that part of WordPress is never loaded for WPGraphQL executions - * - * Mark the post as currently being edited by the current user - * - * @param int $post_id ID of the post being edited. - * - * @return array|false Array of the lock time and user ID. False if the post does not exist, or - * there is no current user. - */ - public static function set_edit_lock( $post_id ) { - $post = get_post( $post_id ); - $user_id = get_current_user_id(); - - if ( empty( $post ) ) { - return false; - } - - if ( 0 === $user_id ) { - return false; - } - - $now = time(); - $lock = "$now:$user_id"; - update_post_meta( $post->ID, '_edit_lock', $lock ); - - return [ $now, $user_id ]; - } - - /** - * Remove the edit lock for a post - * - * @param int $post_id ID of the post to delete the lock for - * - * @return bool - */ - public static function remove_edit_lock( int $post_id ) { - $post = get_post( $post_id ); - - if ( empty( $post ) ) { - return false; - } - - return delete_post_meta( $post->ID, '_edit_lock' ); - } - - /** - * Check the edit lock for a post - * - * @param false|int $post_id ID of the post to delete the lock for - * @param array $input The input for the mutation - * - * @return false|int Return false if no lock or the user_id of the owner of the lock - */ - public static function check_edit_lock( $post_id, array $input ) { - if ( false === $post_id ) { - return false; - } - - // If override the edit lock is set, return early - if ( isset( $input['ignoreEditLock'] ) && true === $input['ignoreEditLock'] ) { - return false; - } - - require_once ABSPATH . 'wp-admin/includes/post.php'; - - if ( function_exists( 'wp_check_post_lock' ) ) { - return wp_check_post_lock( $post_id ); - } - - return false; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/TermObjectMutation.php b/lib/wp-graphql-1.17.0/src/Data/TermObjectMutation.php deleted file mode 100644 index caeeb5db..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/TermObjectMutation.php +++ /dev/null @@ -1,87 +0,0 @@ -name; - - /** - * Prepare the data for inserting the term - */ - if ( ! empty( $input['aliasOf'] ) ) { - $insert_args['alias_of'] = $input['aliasOf']; - } - - if ( ! empty( $input['name'] ) ) { - $insert_args['name'] = $input['name']; - } - - if ( ! empty( $input['description'] ) ) { - $insert_args['description'] = $input['description']; - } - - if ( ! empty( $input['slug'] ) ) { - $insert_args['slug'] = $input['slug']; - } - - /** - * If the parentId argument was entered, we need to validate that it's actually a legit term that can - * be set as a parent - */ - if ( ! empty( $input['parentId'] ) ) { - - /** - * Convert parent ID to WordPress ID - */ - $parent_id = Utils::get_database_id_from_id( $input['parentId'] ); - - if ( empty( $parent_id ) ) { - throw new UserError( esc_html__( 'The parent ID is not a valid ID', 'wp-graphql' ) ); - } - - /** - * Ensure there's actually a parent term to be associated with - */ - $parent_term = get_term( absint( $parent_id ), $taxonomy->name ); - - if ( ! $parent_term instanceof \WP_Term ) { - throw new UserError( esc_html__( 'The parent does not exist', 'wp-graphql' ) ); - } - - $insert_args['parent'] = $parent_term->term_id; - } - - /** - * Filter the $insert_args - * - * @param array $insert_args The array of input args that will be passed to the functions that insert terms - * @param array $input The data that was entered as input for the mutation - * @param \WP_Taxonomy $taxonomy The taxonomy object of the term being mutated - * @param string $mutation_name The name of the mutation being performed (create, edit, etc) - */ - return apply_filters( 'graphql_term_object_insert_term_args', $insert_args, $input, $taxonomy, $mutation_name ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Data/UserMutation.php b/lib/wp-graphql-1.17.0/src/Data/UserMutation.php deleted file mode 100644 index 207fb171..00000000 --- a/lib/wp-graphql-1.17.0/src/Data/UserMutation.php +++ /dev/null @@ -1,314 +0,0 @@ - [ - 'type' => 'String', - 'description' => __( 'A string that contains the plain text password for the user.', 'wp-graphql' ), - ], - 'nicename' => [ - 'type' => 'String', - 'description' => __( 'A string that contains a URL-friendly name for the user. The default is the user\'s username.', 'wp-graphql' ), - ], - 'websiteUrl' => [ - 'type' => 'String', - 'description' => __( 'A string containing the user\'s URL for the user\'s web site.', 'wp-graphql' ), - ], - 'email' => [ - 'type' => 'String', - 'description' => __( 'A string containing the user\'s email address.', 'wp-graphql' ), - ], - 'displayName' => [ - 'type' => 'String', - 'description' => __( 'A string that will be shown on the site. Defaults to user\'s username. It is likely that you will want to change this, for both appearance and security through obscurity (that is if you dont use and delete the default admin user).', 'wp-graphql' ), - ], - 'nickname' => [ - 'type' => 'String', - 'description' => __( 'The user\'s nickname, defaults to the user\'s username.', 'wp-graphql' ), - ], - 'firstName' => [ - 'type' => 'String', - 'description' => __( ' The user\'s first name.', 'wp-graphql' ), - ], - 'lastName' => [ - 'type' => 'String', - 'description' => __( 'The user\'s last name.', 'wp-graphql' ), - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'A string containing content about the user.', 'wp-graphql' ), - ], - 'richEditing' => [ - 'type' => 'String', - 'description' => __( 'A string for whether to enable the rich editor or not. False if not empty.', 'wp-graphql' ), - ], - 'registered' => [ - 'type' => 'String', - 'description' => __( 'The date the user registered. Format is Y-m-d H:i:s.', 'wp-graphql' ), - ], - 'roles' => [ - 'type' => [ 'list_of' => 'String' ], - 'description' => __( 'An array of roles to be assigned to the user.', 'wp-graphql' ), - ], - 'jabber' => [ - 'type' => 'String', - 'description' => __( 'User\'s Jabber account.', 'wp-graphql' ), - ], - 'aim' => [ - 'type' => 'String', - 'description' => __( 'User\'s AOL IM account.', 'wp-graphql' ), - ], - 'yim' => [ - 'type' => 'String', - 'description' => __( 'User\'s Yahoo IM account.', 'wp-graphql' ), - ], - 'locale' => [ - 'type' => 'String', - 'description' => __( 'User\'s locale.', 'wp-graphql' ), - ], - ]; - - /** - * Filters all of the fields available for input - * - * @var array $input_fields - */ - self::$input_fields = apply_filters( 'graphql_user_mutation_input_fields', $input_fields ); - } - - return ( ! empty( self::$input_fields ) ) ? self::$input_fields : null; - } - - /** - * Maps the GraphQL input to a format that the WordPress functions can use - * - * @param array $input Data coming from the GraphQL mutation query input - * @param string $mutation_name Name of the mutation being performed - * - * @return array - */ - public static function prepare_user_object( $input, $mutation_name ) { - $insert_user_args = []; - - /** - * Optional fields - */ - if ( isset( $input['nicename'] ) ) { - $insert_user_args['user_nicename'] = $input['nicename']; - } - - if ( isset( $input['websiteUrl'] ) ) { - $insert_user_args['user_url'] = esc_url( $input['websiteUrl'] ); - } - - if ( isset( $input['displayName'] ) ) { - $insert_user_args['display_name'] = $input['displayName']; - } - - if ( isset( $input['nickname'] ) ) { - $insert_user_args['nickname'] = $input['nickname']; - } - - if ( isset( $input['firstName'] ) ) { - $insert_user_args['first_name'] = $input['firstName']; - } - - if ( isset( $input['lastName'] ) ) { - $insert_user_args['last_name'] = $input['lastName']; - } - - if ( isset( $input['description'] ) ) { - $insert_user_args['description'] = $input['description']; - } - - if ( isset( $input['richEditing'] ) ) { - $insert_user_args['rich_editing'] = $input['richEditing']; - } - - if ( isset( $input['registered'] ) ) { - $insert_user_args['user_registered'] = $input['registered']; - } - - if ( isset( $input['locale'] ) ) { - $insert_user_args['locale'] = $input['locale']; - } - - /** - * Required fields - */ - if ( ! empty( $input['email'] ) ) { - if ( false === is_email( apply_filters( 'pre_user_email', $input['email'] ) ) ) { - throw new UserError( esc_html__( 'The email address you are trying to use is invalid', 'wp-graphql' ) ); - } - $insert_user_args['user_email'] = $input['email']; - } - - if ( ! empty( $input['password'] ) ) { - $insert_user_args['user_pass'] = $input['password']; - } else { - $insert_user_args['user_pass'] = null; - } - - if ( ! empty( $input['username'] ) ) { - $insert_user_args['user_login'] = $input['username']; - } - - if ( ! empty( $input['roles'] ) ) { - /** - * Pluck the first role out of the array since the insert and update functions only - * allow one role to be set at a time. We will add all of the roles passed to the - * mutation later on after the initial object has been created or updated. - */ - $insert_user_args['role'] = $input['roles'][0]; - } - - /** - * Filters the mappings for input to arguments - * - * @param array $insert_user_args The arguments to ultimately be passed to the WordPress function - * @param array $input Input data from the GraphQL mutation - * @param string $mutation_name What user mutation is being performed for context - */ - $insert_user_args = apply_filters( 'graphql_user_insert_post_args', $insert_user_args, $input, $mutation_name ); - - return $insert_user_args; - } - - /** - * This updates additional data related to the user object after the initial mutation has - * happened - * - * @param int $user_id The ID of the user being mutated - * @param array $input The input data from the GraphQL query - * @param string $mutation_name Name of the mutation currently being run - * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the Resolve Tree - * - * @return void - * @throws \Exception - */ - public static function update_additional_user_object_data( $user_id, $input, $mutation_name, AppContext $context, ResolveInfo $info ) { - $roles = ! empty( $input['roles'] ) ? $input['roles'] : []; - self::add_user_roles( $user_id, $roles ); - - /** - * Run an action after the additional data has been updated. This is a great spot to hook into to - * update additional data related to users, such as setting relationships, updating additional usermeta, - * or sending emails to Kevin... whatever you need to do with the userObject. - * - * @param int $user_id The ID of the user being mutated - * @param array $input The input for the mutation - * @param string $mutation_name The name of the mutation (ex: create, update, delete) - * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the Resolve Tree - */ - do_action( 'graphql_user_object_mutation_update_additional_data', $user_id, $input, $mutation_name, $context, $info ); - } - - /** - * Method to add user roles to a user object - * - * @param int $user_id The ID of the user - * @param array $roles List of roles that need to get added to the user - * - * @return void - * @throws \Exception - */ - private static function add_user_roles( $user_id, $roles ) { - if ( empty( $roles ) || ! is_array( $roles ) || ! current_user_can( 'edit_user', $user_id ) ) { - return; - } - - $user = get_user_by( 'ID', $user_id ); - - if ( false !== $user ) { - foreach ( $roles as $role ) { - $verified = self::verify_user_role( $role, $user_id ); - - if ( true === $verified ) { - $user->add_role( $role ); - } elseif ( is_wp_error( $verified ) ) { - throw new Exception( esc_html( $verified->get_error_message() ) ); - } elseif ( false === $verified ) { - // Translators: The placeholder is the name of the user role - throw new Exception( esc_html( sprintf( __( 'The %s role cannot be added to this user', 'wp-graphql' ), $role ) ) ); - } - } - } - } - - /** - * Method to check if the user role is valid, and if the current user has permission to add, or - * remove it from a user. - * - * @param string $role Name of the role trying to get added to a user object - * @param int $user_id The ID of the user being mutated - * - * @return mixed|bool|\WP_Error - */ - private static function verify_user_role( $role, $user_id ) { - global $wp_roles; - - $potential_role = isset( $wp_roles->role_objects[ $role ] ) ? $wp_roles->role_objects[ $role ] : ''; - - if ( empty( $wp_roles->role_objects[ $role ] ) ) { - // Translators: The placeholder is the name of the user role - return new \WP_Error( 'wpgraphql_user_invalid_role', sprintf( __( 'The role %s does not exist', 'wp-graphql' ), $role ) ); - } - - /* - * Don't let anyone with 'edit_users' (admins) edit their own role to something without it. - * Multisite super admins can freely edit their blog roles -- they possess all caps. - */ - if ( - ! ( is_multisite() && current_user_can( 'manage_sites' ) ) && - get_current_user_id() === $user_id && - ! $potential_role->has_cap( 'edit_users' ) - ) { - return new \WP_Error( 'wpgraphql_user_invalid_role', __( 'Sorry, you cannot remove user editing permissions for your own account.', 'wp-graphql' ) ); - } - - /** - * The function for this is only loaded on admin pages. See note: https://codex.wordpress.org/Function_Reference/get_editable_roles#Notes - */ - if ( ! function_exists( 'get_editable_roles' ) ) { - require_once ABSPATH . 'wp-admin/includes/admin.php'; - } - - $editable_roles = get_editable_roles(); - - if ( empty( $editable_roles[ $role ] ) ) { - // Translators: %s is the name of the role that can't be added to the user. - return new \WP_Error( 'wpgraphql_user_invalid_role', sprintf( __( 'Sorry, you are not allowed to give this the following role: %s.', 'wp-graphql' ), $role ) ); - } else { - return true; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/Avatar.php b/lib/wp-graphql-1.17.0/src/Model/Avatar.php deleted file mode 100644 index 4a9a64e6..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/Avatar.php +++ /dev/null @@ -1,83 +0,0 @@ -data = $avatar; - parent::__construct(); - } - - /** - * Initializes the object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'size' => function () { - return ! empty( $this->data['size'] ) ? absint( $this->data['size'] ) : null; - }, - 'height' => function () { - return ! empty( $this->data['height'] ) ? absint( $this->data['height'] ) : null; - }, - 'width' => function () { - return ! empty( $this->data['width'] ) ? absint( $this->data['width'] ) : null; - }, - 'default' => function () { - return ! empty( $this->data['default'] ) ? $this->data['default'] : null; - }, - 'forceDefault' => function () { - return ! empty( $this->data['force_default'] ); - }, - 'rating' => function () { - return ! empty( $this->data['rating'] ) ? $this->data['rating'] : null; - }, - 'scheme' => function () { - return ! empty( $this->data['scheme'] ) ? $this->data['scheme'] : null; - }, - 'extraAttr' => function () { - return ! empty( $this->data['extra_attr'] ) ? $this->data['extra_attr'] : null; - }, - 'foundAvatar' => function () { - return ! empty( $this->data['found_avatar'] ); - }, - 'url' => function () { - return ! empty( $this->data['url'] ) ? $this->data['url'] : null; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/Comment.php b/lib/wp-graphql-1.17.0/src/Model/Comment.php deleted file mode 100644 index 3e6203ec..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/Comment.php +++ /dev/null @@ -1,194 +0,0 @@ -data = $comment; - $owner = ! empty( $comment->user_id ) ? absint( $comment->user_id ) : null; - parent::__construct( 'moderate_comments', $allowed_restricted_fields, $owner ); - } - - /** - * Method for determining if the data should be considered private or not - * - * @return bool - * @throws \Exception - */ - protected function is_private() { - if ( empty( $this->data->comment_post_ID ) ) { - return true; - } - - // if the current user is the author of the comment, the comment should not be private - if ( 0 !== wp_get_current_user()->ID && absint( $this->data->user_id ) === absint( wp_get_current_user()->ID ) ) { - return false; - } - - $commented_on = get_post( (int) $this->data->comment_post_ID ); - - if ( ! $commented_on instanceof \WP_Post ) { - return true; - } - - // A comment is considered private if it is attached to a private post. - if ( true === ( new Post( $commented_on ) )->is_private() ) { - return true; - } - - if ( 0 === absint( $this->data->comment_approved ) && ! current_user_can( 'moderate_comments' ) ) { - return true; - } - - return false; - } - - /** - * Initializes the object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - return ! empty( $this->data->comment_ID ) ? Relay::toGlobalId( 'comment', $this->data->comment_ID ) : null; - }, - 'commentId' => function () { - return ! empty( $this->data->comment_ID ) ? absint( $this->data->comment_ID ) : 0; - }, - 'databaseId' => function () { - return ! empty( $this->data->comment_ID ) ? $this->data->comment_ID : 0; - }, - 'commentAuthorEmail' => function () { - return ! empty( $this->data->comment_author_email ) ? $this->data->comment_author_email : 0; - }, - 'comment_ID' => function () { - return ! empty( $this->data->comment_ID ) ? absint( $this->data->comment_ID ) : 0; - }, - 'comment_post_ID' => function () { - return ! empty( $this->data->comment_post_ID ) ? absint( $this->data->comment_post_ID ) : null; - }, - 'comment_parent_id' => function () { - return ! empty( $this->data->comment_parent ) ? absint( $this->data->comment_parent ) : 0; - }, - 'parentDatabaseId' => function () { - return ! empty( $this->data->comment_parent ) ? absint( $this->data->comment_parent ) : 0; - }, - 'parentId' => function () { - return ! empty( $this->comment_parent_id ) ? Relay::toGlobalId( 'comment', $this->data->comment_parent ) : null; - }, - 'comment_author' => function () { - return ! empty( $this->data->comment_author ) ? absint( $this->data->comment_author ) : null; - }, - 'comment_author_url' => function () { - return ! empty( $this->data->comment_author_url ) ? absint( $this->data->comment_author_url ) : null; - }, - 'authorIp' => function () { - return ! empty( $this->data->comment_author_IP ) ? $this->data->comment_author_IP : null; - }, - 'date' => function () { - return ! empty( $this->data->comment_date ) ? $this->data->comment_date : null; - }, - 'dateGmt' => function () { - return ! empty( $this->data->comment_date_gmt ) ? $this->data->comment_date_gmt : null; - }, - 'contentRaw' => function () { - return ! empty( $this->data->comment_content ) ? $this->data->comment_content : null; - }, - 'contentRendered' => function () { - $content = ! empty( $this->data->comment_content ) ? $this->data->comment_content : null; - - return $this->html_entity_decode( apply_filters( 'comment_text', $content, $this->data ), 'contentRendered', false ); - }, - 'karma' => function () { - return ! empty( $this->data->comment_karma ) ? $this->data->comment_karma : null; - }, - 'approved' => function () { - _doing_it_wrong( __METHOD__, 'The approved field is deprecated in favor of `status`', '1.13.0' ); - return ! empty( $this->data->comment_approved ) && 'hold' !== $this->data->comment_approved; - }, - 'status' => function () { - if ( ! is_numeric( $this->data->comment_approved ) ) { - return $this->data->comment_approved; - } - - return '1' === $this->data->comment_approved ? 'approve' : 'hold'; - }, - 'agent' => function () { - return ! empty( $this->data->comment_agent ) ? $this->data->comment_agent : null; - }, - 'type' => function () { - return ! empty( $this->data->comment_type ) ? $this->data->comment_type : null; - }, - 'userId' => function () { - return ! empty( $this->data->user_id ) ? absint( $this->data->user_id ) : null; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/CommentAuthor.php b/lib/wp-graphql-1.17.0/src/Model/CommentAuthor.php deleted file mode 100644 index 00edc766..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/CommentAuthor.php +++ /dev/null @@ -1,66 +0,0 @@ -data = $comment_author; - parent::__construct(); - } - - /** - * Initializes the object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - return ! empty( $this->data->comment_ID ) ? Relay::toGlobalId( 'comment_author', $this->data->comment_ID ) : null; - }, - 'databaseId' => function () { - return ! empty( $this->data->comment_ID ) ? absint( $this->data->comment_ID ) : null; - }, - 'name' => function () { - return ! empty( $this->data->comment_author ) ? $this->data->comment_author : null; - }, - 'email' => function () { - return current_user_can( 'moderate_comments' ) && ! empty( $this->data->comment_author_email ) ? $this->data->comment_author_email : null; - }, - 'url' => function () { - return ! empty( $this->data->comment_author_url ) ? $this->data->comment_author_url : ''; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/Menu.php b/lib/wp-graphql-1.17.0/src/Model/Menu.php deleted file mode 100644 index 0cd8f586..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/Menu.php +++ /dev/null @@ -1,114 +0,0 @@ -data = $term; - parent::__construct(); - } - - /** - * Determines whether a Menu should be considered private. - * - * If a Menu is not connected to a menu that's assigned to a location - * it's not considered a public node - * - * @return bool - * @throws \Exception - */ - public function is_private() { - - // If the current user can edit theme options, consider the menu public - if ( current_user_can( 'edit_theme_options' ) ) { - return false; - } - - $locations = get_theme_mod( 'nav_menu_locations' ); - if ( empty( $locations ) ) { - return true; - } - $location_ids = array_values( $locations ); - if ( empty( $location_ids ) || ! in_array( $this->data->term_id, array_values( $location_ids ), true ) ) { - return true; - } - - return false; - } - - /** - * Initializes the Menu object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - return ! empty( $this->data->term_id ) ? Relay::toGlobalId( 'term', (string) $this->data->term_id ) : null; - }, - 'count' => function () { - return ! empty( $this->data->count ) ? absint( $this->data->count ) : null; - }, - 'menuId' => function () { - return ! empty( $this->data->term_id ) ? absint( $this->data->term_id ) : null; - }, - 'databaseId' => function () { - return ! empty( $this->data->term_id ) ? absint( $this->data->term_id ) : null; - }, - 'name' => function () { - return ! empty( $this->data->name ) ? $this->data->name : null; - }, - 'slug' => function () { - return ! empty( $this->data->slug ) ? urldecode( $this->data->slug ) : null; - }, - 'locations' => function () { - $menu_locations = get_theme_mod( 'nav_menu_locations' ); - - if ( empty( $menu_locations ) || ! is_array( $menu_locations ) ) { - return null; - } - - $locations = null; - foreach ( $menu_locations as $location => $id ) { - if ( absint( $id ) === ( $this->data->term_id ) ) { - $locations[] = $location; - } - } - - return $locations; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/MenuItem.php b/lib/wp-graphql-1.17.0/src/Model/MenuItem.php deleted file mode 100644 index a406a666..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/MenuItem.php +++ /dev/null @@ -1,206 +0,0 @@ -data = wp_setup_nav_menu_item( $post ); - parent::__construct(); - } - - /** - * Determines whether a MenuItem should be considered private. - * - * If a MenuItem is not connected to a menu that's assigned to a location - * it's not considered a public node - * - * @return bool - * @throws \Exception - */ - public function is_private() { - - // If the current user can edit theme options, consider the menu item public - if ( current_user_can( 'edit_theme_options' ) ) { - return false; - } - - // Get menu locations for the active theme - $locations = get_theme_mod( 'nav_menu_locations' ); - - // If there are no menu locations, consider the MenuItem private - if ( empty( $locations ) ) { - return true; - } - - // Get the values of the locations - $location_ids = array_values( $locations ); - $menus = wp_get_object_terms( $this->data->ID, 'nav_menu', [ 'fields' => 'ids' ] ); - - // If there are no menus - if ( empty( $menus ) ) { - return true; - } - - if ( is_wp_error( $menus ) ) { - // translators: %s is the menu item ID. - throw new Exception( esc_html( sprintf( __( 'No menus could be found for menu item %s', 'wp-graphql' ), $this->data->ID ) ) ); - } - - $menu_id = $menus[0]; - if ( empty( $location_ids ) || ! in_array( $menu_id, $location_ids, true ) ) { - return true; - } - - return false; - } - - /** - * Initialize the MenuItem object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - return ! empty( $this->data->ID ) ? Relay::toGlobalId( 'post', $this->data->ID ) : null; - }, - 'parentId' => function () { - return ! empty( $this->data->menu_item_parent ) ? Relay::toGlobalId( 'post', $this->data->menu_item_parent ) : null; - }, - 'parentDatabaseId' => function () { - return $this->data->menu_item_parent; - }, - 'cssClasses' => function () { - // If all we have is a non-array or an array with one empty - // string, return an empty array. - if ( ! isset( $this->data->classes ) || ! is_array( $this->data->classes ) || empty( $this->data->classes ) || empty( $this->data->classes[0] ) ) { - return []; - } - - return $this->data->classes; - }, - 'description' => function () { - return ( ! empty( $this->data->description ) ) ? $this->data->description : null; - }, - 'label' => function () { - return ( ! empty( $this->data->title ) ) ? $this->html_entity_decode( $this->data->title, 'label', true ) : null; - }, - 'linkRelationship' => function () { - return ! empty( $this->data->xfn ) ? $this->data->xfn : null; - }, - 'menuItemId' => function () { - return absint( $this->data->ID ); - }, - 'databaseId' => function () { - return absint( $this->data->ID ); - }, - 'objectId' => function () { - return ( absint( $this->data->object_id ) ); - }, - 'target' => function () { - return ! empty( $this->data->target ) ? $this->data->target : null; - }, - 'title' => function () { - return ( ! empty( $this->data->attr_title ) ) ? $this->data->attr_title : null; - }, - 'uri' => function () { - $url = $this->data->url; - - return ! empty( $url ) ? str_ireplace( home_url(), '', $url ) : null; - }, - 'url' => function () { - return ! empty( $this->data->url ) ? $this->data->url : null; - }, - 'path' => function () { - $url = $this->url; - - if ( ! empty( $url ) ) { - /** @var array $parsed */ - $parsed = wp_parse_url( $url ); - if ( isset( $parsed['host'] ) && strpos( home_url(), $parsed['host'] ) ) { - return $parsed['path']; - } - } - - return $url; - }, - 'order' => function () { - return $this->data->menu_order; - }, - 'menuId' => function () { - return ! empty( $this->menuDatabaseId ) ? Relay::toGlobalId( 'term', (string) $this->menuDatabaseId ) : null; - }, - 'menuDatabaseId' => function () { - $menus = wp_get_object_terms( $this->data->ID, 'nav_menu' ); - if ( is_wp_error( $menus ) ) { - throw new UserError( esc_html( $menus->get_error_message() ) ); - } - - return ! empty( $menus[0]->term_id ) ? $menus[0]->term_id : null; - }, - 'locations' => function () { - if ( empty( $this->menuDatabaseId ) ) { - return null; - } - - $menu_locations = get_theme_mod( 'nav_menu_locations' ); - - if ( empty( $menu_locations ) || ! is_array( $menu_locations ) ) { - return null; - } - - $locations = null; - foreach ( $menu_locations as $location => $id ) { - if ( absint( $id ) === ( $this->menuDatabaseId ) ) { - $locations[] = $location; - } - } - - return $locations; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/Model.php b/lib/wp-graphql-1.17.0/src/Model/Model.php deleted file mode 100644 index ab28ce6b..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/Model.php +++ /dev/null @@ -1,552 +0,0 @@ -data ) ) { - // translators: %s is the name of the model. - throw new Exception( esc_html( sprintf( __( 'An empty data set was used to initialize the modeling of this %s object', 'wp-graphql' ), $this->get_model_name() ) ) ); - } - - $this->restricted_cap = $restricted_cap; - $this->allowed_restricted_fields = $allowed_restricted_fields; - $this->owner = $owner; - $this->current_user = wp_get_current_user(); - - if ( 'private' === $this->get_visibility() ) { - return; - } - - $this->init(); - $this->prepare_fields(); - } - - /** - * Magic method to re-map the isset check on the child class looking for properties when - * resolving the fields - * - * @param string $key The name of the field you are trying to retrieve - * - * @return bool - */ - public function __isset( $key ) { - return isset( $this->fields[ $key ] ); - } - - /** - * Magic method to re-map setting new properties to the class inside of the $fields prop rather - * than on the class in unique properties - * - * @param string $key Name of the key to set the data to - * @param callable|int|string|mixed $value The value to set to the key - * - * @return void - */ - public function __set( $key, $value ) { - $this->fields[ $key ] = $value; - } - - /** - * Magic method to re-map where external calls go to look for properties on the child objects. - * This is crucial to let objects modeled through this class work with the default field - * resolver. - * - * @param string $key Name of the property that is trying to be accessed - * - * @return mixed|null - */ - public function __get( $key ) { - if ( isset( $this->fields[ $key ] ) ) { - /** - * If the property has already been processed and cached to the model - * return the processed value. - * - * Otherwise, if it's a callable, process it and cache the value. - */ - if ( is_scalar( $this->fields[ $key ] ) || ( is_object( $this->fields[ $key ] ) && ! is_callable( $this->fields[ $key ] ) ) || is_array( $this->fields[ $key ] ) ) { - return $this->fields[ $key ]; - } elseif ( is_callable( $this->fields[ $key ] ) ) { - $data = call_user_func( $this->fields[ $key ] ); - $this->$key = $data; - - return $data; - } else { - return $this->fields[ $key ]; - } - } else { - return null; - } - } - - /** - * Generic model setup before the resolver function executes - * - * @return void - */ - public function setup() { - } - - /** - * Generic model tear down after the fields are setup. This can be used - * to reset state to where it was before the model was setup. - * - * @return void - */ - public function tear_down() { - } - - /** - * Returns the name of the model, built from the child className - * - * @return string - */ - protected function get_model_name() { - $name = static::class; - - if ( empty( $this->model_name ) ) { - if ( false !== strpos( static::class, '\\' ) ) { - $starting_character = strrchr( static::class, '\\' ); - if ( ! empty( $starting_character ) ) { - $name = substr( $starting_character, 1 ); - } - } - $this->model_name = $name . 'Object'; - } - - return ! empty( $this->model_name ) ? $this->model_name : $name; - } - - /** - * Return the visibility state for the current piece of data - * - * @return string|null - */ - public function get_visibility() { - if ( null === $this->visibility ) { - - /** - * Filter for the capability to check against for restricted data - * - * @param string $restricted_cap The capability to check against - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param string|null $visibility The visibility that has currently been set for the data at this point - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return string - */ - $protected_cap = apply_filters( 'graphql_restricted_data_cap', $this->restricted_cap, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); - - /** - * Filter to short circuit default is_private check for the model. This is expensive in some cases so - * this filter lets you prevent this from running by returning a true or false value. - * - * @param ?bool $is_private Whether the model data is private. Defaults to null. - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param string|null $visibility The visibility that has currently been set for the data at this point - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return bool|null - */ - $pre_is_private = apply_filters( 'graphql_pre_model_data_is_private', null, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); - - // If 3rd party code has not filtered this, use the Models default logic to determine - // whether the model should be considered private - if ( null !== $pre_is_private ) { - $is_private = $pre_is_private; - } else { - $is_private = $this->is_private(); - } - - /** - * Filter to determine if the data should be considered private or not - * - * @param boolean $is_private Whether the model is private - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param string|null $visibility The visibility that has currently been set for the data at this point - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return bool - */ - $is_private = apply_filters( 'graphql_data_is_private', (bool) $is_private, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); - - if ( true === $is_private ) { - $this->visibility = 'private'; - } elseif ( null !== $this->owner && true === $this->owner_matches_current_user() ) { - $this->visibility = 'public'; - } elseif ( empty( $protected_cap ) || current_user_can( $protected_cap ) ) { - $this->visibility = 'public'; - } else { - $this->visibility = 'restricted'; - } - } - - /** - * Filter the visibility name to be returned - * - * @param string|null $visibility The visibility that has currently been set for the data at this point - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return string - */ - return apply_filters( 'graphql_object_visibility', $this->visibility, $this->get_model_name(), $this->data, $this->owner, $this->current_user ); - } - - /** - * Method to return the private state of the object. Can be overwritten in classes extending - * this one. - * - * @return bool - */ - protected function is_private() { - return false; - } - - /** - * Whether or not the owner of the data matches the current user - * - * @return bool - */ - protected function owner_matches_current_user() { - if ( empty( $this->current_user->ID ) || empty( $this->owner ) ) { - return false; - } - - return absint( $this->owner ) === absint( $this->current_user->ID ); - } - - /** - * Restricts fields for the data to only return the allowed fields if the data is restricted - * - * @return void - */ - protected function restrict_fields() { - $this->fields = array_intersect_key( - $this->fields, - array_flip( - /** - * Filter for the allowed restricted fields - * - * @param array $allowed_restricted_fields The fields to allow when the data is designated as restricted to the current user - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param string|null $visibility The visibility that has currently been set for the data at this point - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return array - */ - apply_filters( 'graphql_allowed_fields_on_restricted_type', $this->allowed_restricted_fields, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ) - ) - ); - } - - /** - * Wraps all fields with another callback layer so we can inject hooks & filters into them - * - * @return void - */ - protected function wrap_fields() { - if ( ! is_array( $this->fields ) || empty( $this->fields ) ) { - return; - } - - $clean_array = []; - $self = $this; - foreach ( $this->fields as $key => $data ) { - $clean_array[ $key ] = function () use ( $key, $data, $self ) { - if ( is_array( $data ) ) { - $callback = ( ! empty( $data['callback'] ) ) ? $data['callback'] : null; - - /** - * Capability to check required for the field - * - * @param string $capability The capability to check against to return the field - * @param string $key The name of the field on the type - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param string $visibility The visibility setting for this piece of data - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return string - */ - $cap_check = ( ! empty( $data['capability'] ) ) ? apply_filters( 'graphql_model_field_capability', $data['capability'], $key, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ) : ''; - if ( ! empty( $cap_check ) ) { - if ( ! current_user_can( $data['capability'] ) ) { - $callback = null; - } - } - } else { - $callback = $data; - } - - /** - * Filter to short circuit the callback for any field on a type. Returning anything - * other than null will stop the callback for the field from executing, and will - * return your data or execute your callback instead. - * - * @param ?string $result The data returned from the callback. Null by default. - * @param string $key The name of the field on the type - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param string $visibility The visibility setting for this piece of data - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return null|callable|int|string|array|mixed - */ - $pre = apply_filters( 'graphql_pre_return_field_from_model', null, $key, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); - - if ( ! is_null( $pre ) ) { - $result = $pre; - } else { - if ( is_callable( $callback ) ) { - $self->setup(); - $field = call_user_func( $callback ); - $self->tear_down(); - } else { - $field = $callback; - } - - /** - * Filter the data returned by the default callback for the field - * - * @param string $field The data returned from the callback - * @param string $key The name of the field on the type - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param string $visibility The visibility setting for this piece of data - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return mixed - */ - $result = apply_filters( 'graphql_return_field_from_model', $field, $key, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); - } - - /** - * Hook that fires after the data is returned for the field - * - * @param string $result The returned data for the field - * @param string $key The name of the field on the type - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param string $visibility The visibility setting for this piece of data - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - */ - do_action( 'graphql_after_return_field_from_model', $result, $key, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); - - return $result; - }; - } - - $this->fields = $clean_array; - } - - /** - * Adds the model visibility fields to the data - * - * @return void - */ - private function add_model_visibility() { - - /** - * @TODO: potentially abstract this out into a more central spot - */ - $this->fields['isPublic'] = function () { - return 'public' === $this->get_visibility(); - }; - $this->fields['isRestricted'] = function () { - return 'restricted' === $this->get_visibility(); - }; - $this->fields['isPrivate'] = function () { - return 'private' === $this->get_visibility(); - }; - } - - /** - * Returns instance of the data fully modeled - * - * @return void - */ - protected function prepare_fields() { - if ( 'restricted' === $this->get_visibility() ) { - $this->restrict_fields(); - } - - /** - * Add support for the deprecated "graphql_return_modeled_data" filter. - * - * @param array $fields The array of fields for the model - * @param string $model_name Name of the model the filter is currently being executed in - * @param string $visibility The visibility setting for this piece of data - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return array - * - * @deprecated 1.7.0 use "graphql_model_prepare_fields" filter instead, which passes additional context to the filter - */ - $this->fields = apply_filters_deprecated( 'graphql_return_modeled_data', [ $this->fields, $this->get_model_name(), $this->visibility, $this->owner, $this->current_user ], '1.7.0', 'graphql_model_prepare_fields' ); - - /** - * Filter the array of fields for the Model before the object is hydrated with it - * - * @param array $fields The array of fields for the model - * @param string $model_name Name of the model the filter is currently being executed in - * @param mixed $data The un-modeled incoming data - * @param string $visibility The visibility setting for this piece of data - * @param null|int $owner The user ID for the owner of this piece of data - * @param \WP_User $current_user The current user for the session - * - * @return array - */ - $this->fields = apply_filters( 'graphql_model_prepare_fields', $this->fields, $this->get_model_name(), $this->data, $this->visibility, $this->owner, $this->current_user ); - $this->wrap_fields(); - $this->add_model_visibility(); - } - - /** - * Given a string, and optional context, this decodes html entities if html_entity_decode is - * enabled. - * - * @param string $str The string to decode - * @param string $field_name The name of the field being encoded - * @param bool $enabled Whether decoding is enabled by default for the string passed in - * - * @return string - */ - public function html_entity_decode( $str, $field_name, $enabled = false ) { - - /** - * Determine whether html_entity_decode should be applied to the string - * - * @param bool $enabled Whether decoding is enabled by default for the string passed in - * @param string $str The string to decode - * @param string $field_name The name of the field being encoded - * @param \WPGraphQL\Model\Model $model The Model the field is being decoded on - */ - $decoding_enabled = apply_filters( 'graphql_html_entity_decoding_enabled', $enabled, $str, $field_name, $this ); - - if ( false === $decoding_enabled ) { - return $str; - } - - return html_entity_decode( $str ); - } - - /** - * Filter the fields returned for the object - * - * @param null|string|array $fields The field or fields to build in the modeled object. You can - * pass null to build all of the fields, a string to only - * build an object with one field, or an array of field keys - * to build an object with those keys and their respective - * values. - * - * @return void - */ - public function filter( $fields ) { - if ( is_string( $fields ) ) { - $fields = [ $fields ]; - } - - if ( is_array( $fields ) ) { - $this->fields = array_intersect_key( $this->fields, array_flip( $fields ) ); - } - } - - /** - * @return mixed - */ - abstract protected function init(); -} diff --git a/lib/wp-graphql-1.17.0/src/Model/Plugin.php b/lib/wp-graphql-1.17.0/src/Model/Plugin.php deleted file mode 100644 index 9af0b640..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/Plugin.php +++ /dev/null @@ -1,96 +0,0 @@ -data = $plugin; - parent::__construct(); - } - - /** - * Method for determining if the data should be considered private or not - * - * @return bool - */ - protected function is_private() { - if ( is_multisite() ) { - // update_, install_, and delete_ are handled above with is_super_admin(). - $menu_perms = get_site_option( 'menu_items', [] ); - if ( empty( $menu_perms['plugins'] ) && ! current_user_can( 'manage_network_plugins' ) ) { - return true; - } - } elseif ( ! current_user_can( 'activate_plugins' ) ) { - return true; - } - - return false; - } - - /** - * Initializes the object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - return ! empty( $this->data['Path'] ) ? Relay::toGlobalId( 'plugin', $this->data['Path'] ) : null; - }, - 'name' => function () { - return ! empty( $this->data['Name'] ) ? $this->data['Name'] : null; - }, - 'pluginUri' => function () { - return ! empty( $this->data['PluginURI'] ) ? $this->data['PluginURI'] : null; - }, - 'description' => function () { - return ! empty( $this->data['Description'] ) ? $this->data['Description'] : null; - }, - 'author' => function () { - return ! empty( $this->data['Author'] ) ? $this->data['Author'] : null; - }, - 'authorUri' => function () { - return ! empty( $this->data['AuthorURI'] ) ? $this->data['AuthorURI'] : null; - }, - 'version' => function () { - return ! empty( $this->data['Version'] ) ? $this->data['Version'] : null; - }, - 'path' => function () { - return ! empty( $this->data['Path'] ) ? $this->data['Path'] : null; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/Post.php b/lib/wp-graphql-1.17.0/src/Model/Post.php deleted file mode 100644 index 55b6f7cf..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/Post.php +++ /dev/null @@ -1,852 +0,0 @@ -data = $post; - $this->post_type_object = get_post_type_object( $post->post_type ); - - /** - * If the post type is 'revision', we need to get the post_type_object - * of the parent post type to determine capabilities from - */ - if ( 'revision' === $post->post_type && ! empty( $post->post_parent ) ) { - $parent = get_post( absint( $post->post_parent ) ); - if ( ! empty( $parent ) ) { - $this->post_type_object = get_post_type_object( $parent->post_type ); - } - } - - /** - * Mimic core functionality for templates, as seen here: - * https://github.com/WordPress/WordPress/blob/6fd8080e7ee7599b36d4528f72a8ced612130b8c/wp-includes/template-loader.php#L56 - */ - if ( 'attachment' === $this->data->post_type ) { - remove_filter( 'the_content', 'prepend_attachment' ); - } - - $allowed_restricted_fields = [ - 'databaseId', - 'enqueuedScriptsQueue', - 'enqueuedStylesheetsQueue', - 'id', - 'isRestricted', - 'link', - 'post_status', - 'post_type', - 'slug', - 'status', - 'titleRendered', - 'uri', - 'isPostsPage', - 'isFrontPage', - 'isPrivacyPage', - ]; - - if ( isset( $this->post_type_object->graphql_single_name ) ) { - $allowed_restricted_fields[] = $this->post_type_object->graphql_single_name . 'Id'; - } - - $restricted_cap = $this->get_restricted_cap(); - - parent::__construct( $restricted_cap, $allowed_restricted_fields, (int) $post->post_author ); - } - - /** - * Setup the global data for the model to have proper context when resolving - * - * @return void - */ - public function setup() { - global $wp_query, $post; - - /** - * Store the global post before overriding - */ - $this->global_post = $post; - - /** - * Set the resolving post to the global $post. That way any filters that - * might be applied when resolving fields can rely on global post and - * post data being set up. - */ - if ( $this->data instanceof WP_Post ) { - $id = $this->data->ID; - $post_type = $this->data->post_type; - $post_name = $this->data->post_name; - $data = $this->data; - - if ( 'revision' === $this->data->post_type ) { - $id = $this->data->post_parent; - $parent = get_post( $this->data->post_parent ); - if ( empty( $parent ) ) { - $this->fields = []; - return; - } - $post_type = $parent->post_type; - $post_name = $parent->post_name; - $data = $parent; - } - - /** - * Clear out existing postdata - */ - $wp_query->reset_postdata(); - - /** - * Parse the query to tell WordPress how to - * setup global state - */ - if ( 'post' === $post_type ) { - $wp_query->parse_query( - [ - 'page' => '', - 'p' => $id, - ] - ); - } elseif ( 'page' === $post_type ) { - $wp_query->parse_query( - [ - 'page' => '', - 'pagename' => $post_name, - ] - ); - } elseif ( 'attachment' === $post_type ) { - $wp_query->parse_query( - [ - 'attachment' => $post_name, - ] - ); - } else { - $wp_query->parse_query( - [ - $post_type => $post_name, - 'post_type' => $post_type, - 'name' => $post_name, - ] - ); - } - - $wp_query->setup_postdata( $data ); - $GLOBALS['post'] = $data; // phpcs:ignore WordPress.WP.GlobalVariablesOverride - $wp_query->queried_object = get_post( $this->data->ID ); - $wp_query->queried_object_id = $this->data->ID; - } - } - - /** - * Retrieve the cap to check if the data should be restricted for the post - * - * @return string - */ - protected function get_restricted_cap() { - if ( ! empty( $this->data->post_password ) ) { - return isset( $this->post_type_object->cap->edit_others_posts ) ? $this->post_type_object->cap->edit_others_posts : 'edit_others_posts'; - } - - switch ( $this->data->post_status ) { - case 'trash': - $cap = isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts'; - break; - case 'draft': - case 'future': - case 'pending': - $cap = isset( $this->post_type_object->cap->edit_others_posts ) ? $this->post_type_object->cap->edit_others_posts : 'edit_others_posts'; - break; - default: - $cap = ''; - break; - } - - return $cap; - } - - /** - * Determine if the model is private - * - * @return bool - */ - public function is_private() { - - /** - * If the post is of post_type "revision", we need to access the parent of the Post - * so that we can check access rights of the parent post. Revision access is inherit - * to the Parent it is a revision of. - */ - if ( 'revision' === $this->data->post_type ) { - - // Get the post - $parent_post = get_post( $this->data->post_parent ); - - // If the parent post doesn't exist, the revision should be considered private - if ( ! $parent_post instanceof WP_Post ) { - return true; - } - - // Determine if the revision is private using capabilities relative to the parent - return $this->is_post_private( $parent_post ); - } - - /** - * Media Items (attachments) are all public. Once uploaded to the media library - * they are exposed with a public URL on the site. - * - * The WP REST API sets media items to private if they don't have a `post_parent` set, but - * this has broken production apps, because media items can be uploaded directly to the - * media library and published as a featured image, published inline within content, or - * within a Gutenberg block, etc, but then a consumer tries to ask for data of a published - * image and REST returns nothing because the media item is treated as private. - * - * Currently, we're treating all media items as public because there's nothing explicit in - * how WP Core handles privacy of media library items. By default they're publicly exposed. - */ - if ( 'attachment' === $this->data->post_type ) { - return false; - } - - /** - * Published content is public, not private - */ - if ( 'publish' === $this->data->post_status && $this->post_type_object && ( true === $this->post_type_object->public || true === $this->post_type_object->publicly_queryable ) ) { - return false; - } - - return $this->is_post_private( $this->data ); - } - - /** - * Method for determining if the data should be considered private or not - * - * @param \WP_Post $post_object The object of the post we need to verify permissions for - * - * @return bool - */ - protected function is_post_private( $post_object = null ) { - $post_type_object = $this->post_type_object; - - if ( ! $post_type_object ) { - return true; - } - - if ( ! $post_object ) { - $post_object = $this->data; - } - - /** - * If the status is NOT publish and the user does NOT have capabilities to edit posts, - * consider the post private. - */ - if ( ! isset( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->edit_posts ) ) { - return true; - } - - /** - * If the owner of the content is the current user - */ - if ( ( true === $this->owner_matches_current_user() ) && 'revision' !== $post_object->post_type ) { - return false; - } - - /** - * If the post_type isn't (not registered) or is not allowed in WPGraphQL, - * mark the post as private - */ - - if ( empty( $post_type_object->name ) || ! in_array( $post_type_object->name, \WPGraphQL::get_allowed_post_types(), true ) ) { - return true; - } - - if ( 'private' === $this->data->post_status && ( ! isset( $post_type_object->cap->read_private_posts ) || ! current_user_can( $post_type_object->cap->read_private_posts ) ) ) { - return true; - } - - if ( 'revision' === $this->data->post_type || 'auto-draft' === $this->data->post_status ) { - $parent = get_post( (int) $this->data->post_parent ); - - if ( empty( $parent ) ) { - return true; - } - - $parent_post_type_obj = $post_type_object; - - if ( 'private' === $parent->post_status ) { - $cap = isset( $parent_post_type_obj->cap->read_private_posts ) ? $parent_post_type_obj->cap->read_private_posts : 'read_private_posts'; - } else { - $cap = isset( $parent_post_type_obj->cap->edit_post ) ? $parent_post_type_obj->cap->edit_post : 'edit_post'; - } - - if ( ! current_user_can( $cap, $parent->ID ) ) { - return true; - } - } - - return false; - } - - /** - * Initialize the Post object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'ID' => function () { - return $this->data->ID; - }, - 'post_author' => function () { - if ( $this->isPreview ) { - $parent_post = get_post( $this->parentDatabaseId ); - if ( empty( $parent_post ) ) { - return null; - } - - return (int) $parent_post->post_author; - } - - return ! empty( $this->data->post_author ) ? $this->data->post_author : null; - }, - 'id' => function () { - return ( ! empty( $this->data->post_type ) && ! empty( $this->databaseId ) ) ? Relay::toGlobalId( 'post', (string) $this->databaseId ) : null; - }, - 'databaseId' => function () { - return ! empty( $this->data->ID ) ? absint( $this->data->ID ) : null; - }, - 'post_type' => function () { - return ! empty( $this->data->post_type ) ? $this->data->post_type : null; - }, - 'authorId' => function () { - if ( true === $this->isPreview ) { - $parent_post = get_post( $this->data->post_parent ); - if ( empty( $parent_post ) ) { - return null; - } - $id = (int) $parent_post->post_author; - } else { - $id = ! empty( $this->data->post_author ) ? (int) $this->data->post_author : null; - } - - return Relay::toGlobalId( 'user', (string) $id ); - }, - 'authorDatabaseId' => function () { - if ( true === $this->isPreview ) { - $parent_post = get_post( $this->data->post_parent ); - if ( empty( $parent_post ) ) { - return null; - } - - return $parent_post->post_author; - } - - return ! empty( $this->data->post_author ) ? (int) $this->data->post_author : null; - }, - 'date' => function () { - return ! empty( $this->data->post_date ) && '0000-00-00 00:00:00' !== $this->data->post_date ? Utils::prepare_date_response( $this->data->post_date_gmt, $this->data->post_date ) : null; - }, - 'dateGmt' => function () { - return ! empty( $this->data->post_date_gmt ) ? Utils::prepare_date_response( $this->data->post_date_gmt ) : null; - }, - 'contentRendered' => function () { - $content = ! empty( $this->data->post_content ) ? $this->data->post_content : null; - - return ! empty( $content ) ? $this->html_entity_decode( apply_filters( 'the_content', $content ), 'contentRendered', false ) : null; - }, - 'pageTemplate' => function () { - $slug = get_page_template_slug( $this->data->ID ); - - return ! empty( $slug ) ? $slug : null; - }, - 'contentRaw' => [ - 'callback' => function () { - return ! empty( $this->data->post_content ) ? $this->data->post_content : null; - }, - 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', - ], - 'titleRendered' => function () { - $id = ! empty( $this->data->ID ) ? $this->data->ID : null; - $title = ! empty( $this->data->post_title ) ? $this->data->post_title : null; - - return $this->html_entity_decode( apply_filters( 'the_title', $title, $id ), 'titleRendered', true ); - }, - 'titleRaw' => [ - 'callback' => function () { - return ! empty( $this->data->post_title ) ? $this->data->post_title : null; - }, - 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', - ], - 'excerptRendered' => function () { - $excerpt = ! empty( $this->data->post_excerpt ) ? $this->data->post_excerpt : ''; - $excerpt = apply_filters( 'get_the_excerpt', $excerpt, $this->data ); - - return $this->html_entity_decode( apply_filters( 'the_excerpt', $excerpt ), 'excerptRendered' ); - }, - 'excerptRaw' => [ - 'callback' => function () { - return ! empty( $this->data->post_excerpt ) ? $this->data->post_excerpt : null; - }, - 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', - ], - 'post_status' => function () { - return ! empty( $this->data->post_status ) ? $this->data->post_status : null; - }, - 'status' => function () { - return ! empty( $this->data->post_status ) ? $this->data->post_status : null; - }, - 'commentStatus' => function () { - return ! empty( $this->data->comment_status ) ? $this->data->comment_status : null; - }, - 'pingStatus' => function () { - return ! empty( $this->data->ping_status ) ? $this->data->ping_status : null; - }, - 'slug' => function () { - return ! empty( $this->data->post_name ) ? urldecode( $this->data->post_name ) : null; - }, - 'template' => function () { - $registered_templates = wp_get_theme()->get_page_templates( null, $this->data->post_type ); - - $template = [ - '__typename' => 'DefaultTemplate', - 'templateName' => 'Default', - ]; - - if ( true === $this->isPreview ) { - $parent_post = get_post( $this->parentDatabaseId ); - - if ( empty( $parent_post ) ) { - return $template; - } - - $registered_templates = wp_get_theme()->get_page_templates( $parent_post ); - - if ( empty( $registered_templates ) ) { - return $template; - } - $set_template = get_post_meta( $this->parentDatabaseId, '_wp_page_template', true ); - $template_name = get_page_template_slug( $this->parentDatabaseId ); - - if ( empty( $set_template ) ) { - $set_template = get_post_meta( $this->data->ID, '_wp_page_template', true ); - } - - if ( empty( $template_name ) ) { - $template_name = get_page_template_slug( $this->data->ID ); - } - - $template_name = ! empty( $template_name ) ? $template_name : 'Default'; - } else { - if ( empty( $registered_templates ) ) { - return $template; - } - - $set_template = get_post_meta( $this->data->ID, '_wp_page_template', true ); - $template_name = get_page_template_slug( $this->data->ID ); - - $template_name = ! empty( $template_name ) ? $template_name : 'Default'; - } - - if ( ! empty( $registered_templates[ $set_template ] ) ) { - $name = Utils::format_type_name_for_wp_template( $registered_templates[ $set_template ], $set_template ); - - // If the name is empty, fallback to DefaultTemplate - if ( empty( $name ) ) { - $name = 'DefaultTemplate'; - } - - $template = [ - '__typename' => $name, - 'templateName' => ucwords( $registered_templates[ $set_template ] ), - ]; - } - - return $template; - }, - 'isFrontPage' => function () { - if ( 'page' !== $this->data->post_type || 'page' !== get_option( 'show_on_front' ) ) { - return false; - } - if ( absint( get_option( 'page_on_front', 0 ) ) === $this->data->ID ) { - return true; - } - - return false; - }, - 'isPrivacyPage' => function () { - if ( 'page' !== $this->data->post_type ) { - return false; - } - if ( absint( get_option( 'wp_page_for_privacy_policy', 0 ) ) === $this->data->ID ) { - return true; - } - - return false; - }, - 'isPostsPage' => function () { - if ( 'page' !== $this->data->post_type ) { - return false; - } - if ( 'posts' !== get_option( 'show_on_front', 'posts' ) && absint( get_option( 'page_for_posts', 0 ) ) === $this->data->ID ) { - return true; - } - - return false; - }, - 'toPing' => function () { - $to_ping = get_to_ping( $this->databaseId ); - - return ! empty( $to_ping ) ? implode( ',', (array) $to_ping ) : null; - }, - 'pinged' => function () { - $punged = get_pung( $this->databaseId ); - - return ! empty( implode( ',', (array) $punged ) ) ? $punged : null; - }, - 'modified' => function () { - return ! empty( $this->data->post_modified ) && '0000-00-00 00:00:00' !== $this->data->post_modified ? Utils::prepare_date_response( $this->data->post_modified ) : null; - }, - 'modifiedGmt' => function () { - return ! empty( $this->data->post_modified_gmt ) ? Utils::prepare_date_response( $this->data->post_modified_gmt ) : null; - }, - 'parentId' => function () { - return ( ! empty( $this->data->post_type ) && ! empty( $this->data->post_parent ) ) ? Relay::toGlobalId( 'post', (string) $this->data->post_parent ) : null; - }, - 'parentDatabaseId' => function () { - return ! empty( $this->data->post_parent ) ? absint( $this->data->post_parent ) : null; - }, - 'editLastId' => function () { - $edit_last = get_post_meta( $this->data->ID, '_edit_last', true ); - - return ! empty( $edit_last ) ? absint( $edit_last ) : null; - }, - 'editLock' => function () { - require_once ABSPATH . 'wp-admin/includes/post.php'; - if ( ! wp_check_post_lock( $this->data->ID ) ) { - return null; - } - - $edit_lock = get_post_meta( $this->data->ID, '_edit_lock', true ); - $edit_lock_parts = ! empty( $edit_lock ) ? explode( ':', $edit_lock ) : null; - - return ! empty( $edit_lock_parts ) ? $edit_lock_parts : null; - }, - 'enclosure' => function () { - $enclosure = get_post_meta( $this->data->ID, 'enclosure', true ); - - return ! empty( $enclosure ) ? $enclosure : null; - }, - 'guid' => function () { - return ! empty( $this->data->guid ) ? $this->data->guid : null; - }, - 'menuOrder' => function () { - return ! empty( $this->data->menu_order ) ? absint( $this->data->menu_order ) : null; - }, - 'link' => function () { - $link = get_permalink( $this->data->ID ); - - if ( $this->isPreview ) { - $link = get_preview_post_link( $this->parentDatabaseId ); - } elseif ( $this->isRevision ) { - $link = get_permalink( $this->data->ID ); - } - - return ! empty( $link ) ? urldecode( $link ) : null; - }, - 'uri' => function () { - $uri = $this->link; - - if ( true === $this->isFrontPage ) { - return '/'; - } - - // if the page is set as the posts page - // the page node itself is not identifiable - // by URI. Instead, the uri would return the - // Post content type as that uri - // represents the blog archive instead of a page - if ( true === $this->isPostsPage ) { - return null; - } - - return ! empty( $uri ) ? str_ireplace( home_url(), '', $uri ) : null; - }, - 'commentCount' => function () { - return ! empty( $this->data->comment_count ) ? absint( $this->data->comment_count ) : null; - }, - 'featuredImageId' => function () { - return ! empty( $this->featuredImageDatabaseId ) ? Relay::toGlobalId( 'post', (string) $this->featuredImageDatabaseId ) : null; - }, - 'featuredImageDatabaseId' => function () { - if ( $this->isRevision ) { - $id = $this->parentDatabaseId; - } else { - $id = $this->data->ID; - } - - $thumbnail_id = get_post_thumbnail_id( $id ); - - return ! empty( $thumbnail_id ) ? absint( $thumbnail_id ) : null; - }, - 'password' => [ - 'callback' => function () { - return ! empty( $this->data->post_password ) ? $this->data->post_password : null; - }, - 'capability' => isset( $this->post_type_object->cap->edit_others_posts ) ?: 'edit_others_posts', - ], - 'enqueuedScriptsQueue' => static function () { - global $wp_scripts; - do_action( 'wp_enqueue_scripts' ); - $queue = $wp_scripts->queue; - $wp_scripts->reset(); - $wp_scripts->queue = []; - - return $queue; - }, - 'enqueuedStylesheetsQueue' => static function () { - global $wp_styles; - do_action( 'wp_enqueue_scripts' ); - $queue = $wp_styles->queue; - $wp_styles->reset(); - $wp_styles->queue = []; - - return $queue; - }, - 'isRevision' => function () { - return 'revision' === $this->data->post_type; - }, - 'previewRevisionDatabaseId' => [ - 'callback' => function () { - $revisions = wp_get_post_revisions( - $this->data->ID, - [ - 'posts_per_page' => 1, - 'fields' => 'ids', - 'check_enabled' => false, - ] - ); - - return is_array( $revisions ) && ! empty( $revisions ) ? array_values( $revisions )[0] : null; - }, - 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', - ], - 'previewRevisionId' => function () { - return ! empty( $this->previewRevisionDatabaseId ) ? Relay::toGlobalId( 'post', (string) $this->previewRevisionDatabaseId ) : null; - }, - 'isPreview' => function () { - if ( $this->isRevision ) { - $revisions = wp_get_post_revisions( - $this->parentDatabaseId, - [ - 'posts_per_page' => 1, - 'fields' => 'ids', - 'check_enabled' => false, - ] - ); - - if ( in_array( $this->data->ID, array_values( $revisions ), true ) ) { - return true; - } - } - - if ( ! post_type_supports( $this->data->post_type, 'revisions' ) && 'draft' === $this->data->post_status ) { - return true; - } - - return false; - }, - 'isSticky' => function () { - return is_sticky( $this->databaseId ); - }, - ]; - - if ( 'attachment' === $this->data->post_type ) { - $attachment_fields = [ - 'captionRendered' => function () { - $caption = apply_filters( 'the_excerpt', apply_filters( 'get_the_excerpt', $this->data->post_excerpt, $this->data ) ); - - return ! empty( $caption ) ? $caption : null; - }, - 'captionRaw' => [ - 'callback' => function () { - return ! empty( $this->data->post_excerpt ) ? $this->data->post_excerpt : null; - }, - 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', - ], - 'altText' => function () { - return get_post_meta( $this->data->ID, '_wp_attachment_image_alt', true ); - }, - 'descriptionRendered' => function () { - return ! empty( $this->data->post_content ) ? apply_filters( 'the_content', $this->data->post_content ) : null; - }, - 'descriptionRaw' => [ - 'callback' => function () { - return ! empty( $this->data->post_content ) ? $this->data->post_content : null; - }, - 'capability' => isset( $this->post_type_object->cap->edit_posts ) ? $this->post_type_object->cap->edit_posts : 'edit_posts', - ], - 'mediaType' => function () { - return wp_attachment_is_image( $this->data->ID ) ? 'image' : 'file'; - }, - 'mediaItemUrl' => function () { - return wp_get_attachment_url( $this->data->ID ); - }, - 'sourceUrl' => function () { - $source_url = wp_get_attachment_image_src( $this->data->ID, 'full' ); - - return ! empty( $source_url ) ? $source_url[0] : null; - }, - 'sourceUrlsBySize' => function () { - /** - * This returns an empty array on the VIP Go platform. - */ - $sizes = get_intermediate_image_sizes(); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_intermediate_image_sizes_get_intermediate_image_sizes - $urls = []; - if ( ! empty( $sizes ) && is_array( $sizes ) ) { - foreach ( $sizes as $size ) { - $img_src = wp_get_attachment_image_src( $this->data->ID, $size ); - $urls[ $size ] = ! empty( $img_src ) ? $img_src[0] : null; - } - } - - return $urls; - }, - 'mimeType' => function () { - return ! empty( $this->data->post_mime_type ) ? $this->data->post_mime_type : null; - }, - 'mediaDetails' => function () { - $media_details = wp_get_attachment_metadata( $this->data->ID ); - if ( ! empty( $media_details ) ) { - $media_details['ID'] = $this->data->ID; - - return $media_details; - } - - return null; - }, - ]; - - $this->fields = array_merge( $this->fields, $attachment_fields ); - } - - /** - * Set the {post_type}Id field to the Model. - */ - if ( isset( $this->post_type_object ) && isset( $this->post_type_object->graphql_single_name ) ) { - $type_id = $this->post_type_object->graphql_single_name . 'Id'; - $this->fields[ $type_id ] = function () { - return absint( $this->data->ID ); - }; - } - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/PostType.php b/lib/wp-graphql-1.17.0/src/Model/PostType.php deleted file mode 100644 index e80b1a17..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/PostType.php +++ /dev/null @@ -1,218 +0,0 @@ -data = $post_type; - - $allowed_restricted_fields = [ - 'id', - 'name', - 'description', - 'hierarchical', - 'slug', - 'taxonomies', - 'graphql_single_name', - 'graphqlSingleName', - 'graphql_plural_name', - 'graphqlPluralName', - 'showInGraphql', - 'isRestricted', - 'uri', - 'isPostsPage', - 'isFrontPage', - 'label', - ]; - - $capability = isset( $post_type->cap->edit_posts ) ? $post_type->cap->edit_posts : 'edit_posts'; - - parent::__construct( $capability, $allowed_restricted_fields ); - } - - /** - * Method for determining if the data should be considered private or not - * - * @return bool - */ - protected function is_private() { - if ( false === $this->data->public && ( ! isset( $this->data->cap->edit_posts ) || ! current_user_can( $this->data->cap->edit_posts ) ) ) { - return true; - } - - return false; - } - - /** - * Initializes the object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - return ! empty( $this->data->name ) ? Relay::toGlobalId( 'post_type', $this->data->name ) : null; - }, - 'name' => function () { - return ! empty( $this->data->name ) ? $this->data->name : null; - }, - 'label' => function () { - return ! empty( $this->data->label ) ? $this->data->label : null; - }, - 'labels' => function () { - return get_post_type_labels( $this->data ); - }, - 'description' => function () { - return ! empty( $this->data->description ) ? $this->data->description : ''; - }, - 'public' => function () { - return ! empty( $this->data->public ) ? (bool) $this->data->public : null; - }, - 'hierarchical' => function () { - return true === $this->data->hierarchical || ! empty( $this->data->hierarchical ); - }, - 'excludeFromSearch' => function () { - return true === $this->data->exclude_from_search; - }, - 'publiclyQueryable' => function () { - return true === $this->data->publicly_queryable; - }, - 'showUi' => function () { - return true === $this->data->show_ui; - }, - 'showInMenu' => function () { - return true === $this->data->show_in_menu; - }, - 'showInNavMenus' => function () { - return true === $this->data->show_in_nav_menus; - }, - 'showInAdminBar' => function () { - return true === $this->data->show_in_admin_bar; - }, - 'menuPosition' => function () { - return ! empty( $this->data->menu_position ) ? $this->data->menu_position : null; - }, - 'menuIcon' => function () { - return ! empty( $this->data->menu_icon ) ? $this->data->menu_icon : null; - }, - 'hasArchive' => function () { - return ! empty( $this->uri ); - }, - 'canExport' => function () { - return true === $this->data->can_export; - }, - 'deleteWithUser' => function () { - return true === $this->data->delete_with_user; - }, - 'taxonomies' => function () { - $object_taxonomies = get_object_taxonomies( $this->data->name ); - return ( ! empty( $object_taxonomies ) ) ? $object_taxonomies : null; - }, - 'showInRest' => function () { - return true === $this->data->show_in_rest; - }, - 'restBase' => function () { - return ! empty( $this->data->rest_base ) ? $this->data->rest_base : null; - }, - 'restControllerClass' => function () { - return ! empty( $this->data->rest_controller_class ) ? $this->data->rest_controller_class : null; - }, - 'showInGraphql' => function () { - return true === $this->data->show_in_graphql; - }, - 'graphqlSingleName' => function () { - return ! empty( $this->data->graphql_single_name ) ? $this->data->graphql_single_name : null; - }, - 'graphql_single_name' => function () { - return ! empty( $this->data->graphql_single_name ) ? $this->data->graphql_single_name : null; - }, - 'graphqlPluralName' => function () { - return ! empty( $this->data->graphql_plural_name ) ? $this->data->graphql_plural_name : null; - }, - 'graphql_plural_name' => function () { - return ! empty( $this->data->graphql_plural_name ) ? $this->data->graphql_plural_name : null; - }, - 'uri' => function () { - $link = get_post_type_archive_link( $this->name ); - return ! empty( $link ) ? trailingslashit( str_ireplace( home_url(), '', $link ) ) : null; - }, - // If the homepage settings are to set to - 'isPostsPage' => function () { - if ( - 'post' === $this->name && - ( - 'posts' === get_option( 'show_on_front', 'posts' ) || - empty( (int) get_option( 'page_for_posts', 0 ) ) ) - ) { - return true; - } - - return false; - }, - 'isFrontPage' => function () { - if ( - 'post' === $this->name && - ( - 'posts' === get_option( 'show_on_front', 'posts' ) || - empty( (int) get_option( 'page_on_front', 0 ) ) - ) - ) { - return true; - } - - return false; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/Taxonomy.php b/lib/wp-graphql-1.17.0/src/Model/Taxonomy.php deleted file mode 100644 index c6a9b296..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/Taxonomy.php +++ /dev/null @@ -1,160 +0,0 @@ -data = $taxonomy; - - $allowed_restricted_fields = [ - 'id', - 'name', - 'description', - 'hierarchical', - 'object_type', - 'restBase', - 'graphql_single_name', - 'graphqlSingleName', - 'graphql_plural_name', - 'graphqlPluralName', - 'showInGraphql', - 'isRestricted', - ]; - - $capability = isset( $this->data->cap->edit_terms ) ? $this->data->cap->edit_terms : 'edit_terms'; - - parent::__construct( $capability, $allowed_restricted_fields ); - } - - /** - * Method for determining if the data should be considered private or not - * - * @return bool - */ - protected function is_private() { - if ( false === $this->data->public && ( ! isset( $this->data->cap->edit_terms ) || ! current_user_can( $this->data->cap->edit_terms ) ) ) { - return true; - } - - return false; - } - - /** - * Initializes the object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - return ! empty( $this->data->name ) ? Relay::toGlobalId( 'taxonomy', $this->data->name ) : null; - }, - 'object_type' => function () { - return ! empty( $this->data->object_type ) ? $this->data->object_type : null; - }, - 'name' => function () { - return ! empty( $this->data->name ) ? $this->data->name : null; - }, - 'label' => function () { - return ! empty( $this->data->label ) ? $this->data->label : null; - }, - 'description' => function () { - return ! empty( $this->data->description ) ? $this->data->description : ''; - }, - 'public' => function () { - return ! empty( $this->data->public ) ? (bool) $this->data->public : true; - }, - 'hierarchical' => function () { - return true === $this->data->hierarchical; - }, - 'showUi' => function () { - return true === $this->data->show_ui; - }, - 'showInMenu' => function () { - return true === $this->data->show_in_menu; - }, - 'showInNavMenus' => function () { - return true === $this->data->show_in_nav_menus; - }, - 'showCloud' => function () { - return true === $this->data->show_tagcloud; - }, - 'showInQuickEdit' => function () { - return true === $this->data->show_in_quick_edit; - }, - 'showInAdminColumn' => function () { - return true === $this->data->show_admin_column; - }, - 'showInRest' => function () { - return true === $this->data->show_in_rest; - }, - 'restBase' => function () { - return ! empty( $this->data->rest_base ) ? $this->data->rest_base : null; - }, - 'restControllerClass' => function () { - return ! empty( $this->data->rest_controller_class ) ? $this->data->rest_controller_class : null; - }, - 'showInGraphql' => function () { - return true === $this->data->show_in_graphql; - }, - 'graphqlSingleName' => function () { - return ! empty( $this->data->graphql_single_name ) ? $this->data->graphql_single_name : null; - }, - 'graphql_single_name' => function () { - return ! empty( $this->data->graphql_single_name ) ? $this->data->graphql_single_name : null; - }, - 'graphqlPluralName' => function () { - return ! empty( $this->data->graphql_plural_name ) ? $this->data->graphql_plural_name : null; - }, - 'graphql_plural_name' => function () { - return ! empty( $this->data->graphql_plural_name ) ? $this->data->graphql_plural_name : null; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/Term.php b/lib/wp-graphql-1.17.0/src/Model/Term.php deleted file mode 100644 index d330a4d7..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/Term.php +++ /dev/null @@ -1,211 +0,0 @@ -data = $term; - $taxonomy = get_taxonomy( $term->taxonomy ); - $this->taxonomy_object = $taxonomy instanceof WP_Taxonomy ? $taxonomy : null; - parent::__construct(); - } - - /** - * Setup the global state for the model to have proper context when resolving - * - * @return void - */ - public function setup() { - global $wp_query, $post; - - /** - * Store the global post before overriding - */ - $this->global_post = $post; - - if ( $this->data instanceof WP_Term ) { - - /** - * Reset global post - */ - $GLOBALS['post'] = get_post( 0 ); // phpcs:ignore WordPress.WP.GlobalVariablesOverride - - /** - * Parse the query to tell WordPress - * how to setup global state - */ - if ( 'category' === $this->data->taxonomy ) { - $wp_query->parse_query( - [ - 'category_name' => $this->data->slug, - ] - ); - } elseif ( 'post_tag' === $this->data->taxonomy ) { - $wp_query->parse_query( - [ - 'tag' => $this->data->slug, - ] - ); - } - - $wp_query->queried_object = get_term( $this->data->term_id, $this->data->taxonomy ); - $wp_query->queried_object_id = $this->data->term_id; - } - } - - /** - * Reset global state after the model fields - * have been generated - * - * @return void - */ - public function tear_down() { - $GLOBALS['post'] = $this->global_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride - wp_reset_postdata(); - } - - /** - * Initializes the Term object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - return ( ! empty( $this->data->taxonomy ) && ! empty( $this->data->term_id ) ) ? Relay::toGlobalId( 'term', (string) $this->data->term_id ) : null; - }, - 'term_id' => function () { - return ( ! empty( $this->data->term_id ) ) ? absint( $this->data->term_id ) : null; - }, - 'databaseId' => function () { - return ( ! empty( $this->data->term_id ) ) ? absint( $this->data->term_id ) : null; - }, - 'count' => function () { - return ! empty( $this->data->count ) ? absint( $this->data->count ) : null; - }, - 'description' => function () { - return ! empty( $this->data->description ) ? $this->html_entity_decode( $this->data->description, 'description' ) : null; - }, - 'name' => function () { - return ! empty( $this->data->name ) ? $this->html_entity_decode( $this->data->name, 'name', true ) : null; - }, - 'slug' => function () { - return ! empty( $this->data->slug ) ? urldecode( $this->data->slug ) : null; - }, - 'termGroupId' => function () { - return ! empty( $this->data->term_group ) ? absint( $this->data->term_group ) : null; - }, - 'termTaxonomyId' => function () { - return ! empty( $this->data->term_taxonomy_id ) ? absint( $this->data->term_taxonomy_id ) : null; - }, - 'taxonomyName' => function () { - return ! empty( $this->taxonomy_object->name ) ? $this->taxonomy_object->name : null; - }, - 'link' => function () { - $link = get_term_link( $this->data->term_id ); - - return ( ! is_wp_error( $link ) ) ? $link : null; - }, - 'parentId' => function () { - return ! empty( $this->data->parent ) ? Relay::toGlobalId( 'term', (string) $this->data->parent ) : null; - }, - 'parentDatabaseId' => function () { - return ! empty( $this->data->parent ) ? $this->data->parent : null; - }, - 'enqueuedScriptsQueue' => static function () { - global $wp_scripts; - $wp_scripts->reset(); - do_action( 'wp_enqueue_scripts' ); - $queue = $wp_scripts->queue; - $wp_scripts->reset(); - $wp_scripts->queue = []; - - return $queue; - }, - 'enqueuedStylesheetsQueue' => static function () { - global $wp_styles; - do_action( 'wp_enqueue_scripts' ); - $queue = $wp_styles->queue; - $wp_styles->reset(); - $wp_styles->queue = []; - - return $queue; - }, - 'uri' => function () { - $link = $this->link; - - $maybe_url = wp_parse_url( $link ); - - // If this isn't a URL, we can assume it's been filtered and just return the link value. - if ( false === $maybe_url ) { - return $link; - } - - // Replace the home_url in the link in order to return a relative uri. - // For subdirectory multisites, this replaces the home_url which includes the subdirectory. - return ! empty( $link ) ? str_ireplace( home_url(), '', $link ) : null; - }, - ]; - - if ( isset( $this->taxonomy_object, $this->taxonomy_object->graphql_single_name ) ) { - $type_id = $this->taxonomy_object->graphql_single_name . 'Id'; - $this->fields[ $type_id ] = absint( $this->data->term_id ); - } - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/Theme.php b/lib/wp-graphql-1.17.0/src/Model/Theme.php deleted file mode 100644 index 3e221f66..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/Theme.php +++ /dev/null @@ -1,110 +0,0 @@ -data = $theme; - parent::__construct(); - } - - /** - * Method for determining if the data should be considered private or not - * - * @return bool - */ - protected function is_private() { - // Don't assume a capabilities hierarchy, since it's likely headless sites might disable some capabilities site-wide. - if ( current_user_can( 'edit_themes' ) || current_user_can( 'switch_themes' ) || current_user_can( 'update_themes' ) ) { - return false; - } - - if ( wp_get_theme()->get_stylesheet() !== $this->data->get_stylesheet() ) { - return true; - } - - return false; - } - - /** - * Initialize the object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - $stylesheet = $this->data->get_stylesheet(); - return ( ! empty( $stylesheet ) ) ? Relay::toGlobalId( 'theme', $stylesheet ) : null; - }, - 'slug' => function () { - $stylesheet = $this->data->get_stylesheet(); - return ! empty( $stylesheet ) ? $stylesheet : null; - }, - 'name' => function () { - $name = $this->data->get( 'Name' ); - return ! empty( $name ) ? $name : null; - }, - 'screenshot' => function () { - $screenshot = $this->data->get_screenshot(); - return ! empty( $screenshot ) ? $screenshot : null; - }, - 'themeUri' => function () { - $theme_uri = $this->data->get( 'ThemeURI' ); - return ! empty( $theme_uri ) ? $theme_uri : null; - }, - 'description' => function () { - return ! empty( $this->data->description ) ? $this->data->description : null; - }, - 'author' => function () { - return ! empty( $this->data->author ) ? $this->data->author : null; - }, - 'authorUri' => function () { - $author_uri = $this->data->get( 'AuthorURI' ); - return ! empty( $author_uri ) ? $author_uri : null; - }, - 'tags' => function () { - return ! empty( $this->data->tags ) ? $this->data->tags : null; - }, - 'version' => function () { - return ! empty( $this->data->version ) ? $this->data->version : null; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/User.php b/lib/wp-graphql-1.17.0/src/Model/User.php deleted file mode 100644 index 2c495921..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/User.php +++ /dev/null @@ -1,271 +0,0 @@ -user_pass = ''; - $this->data = $user; - - $allowed_restricted_fields = [ - 'isRestricted', - 'id', - 'userId', - 'databaseId', - 'name', - 'firstName', - 'lastName', - 'description', - 'slug', - 'uri', - 'enqueuedScriptsQueue', - 'enqueuedStylesheetsQueue', - ]; - - parent::__construct( 'list_users', $allowed_restricted_fields, $user->ID ); - } - - /** - * Setup the global data for the model to have proper context when resolving - * - * @return void - */ - public function setup() { - global $wp_query, $post, $authordata; - - // Store variables for resetting at tear down - $this->global_post = $post; - $this->global_authordata = $authordata; - - if ( $this->data instanceof WP_User ) { - - // Reset postdata - $wp_query->reset_postdata(); - - // Parse the query to setup global state - $wp_query->parse_query( - [ - 'author_name' => $this->data->user_nicename, - ] - ); - - // Setup globals - $wp_query->is_author = true; - $GLOBALS['authordata'] = $this->data; // phpcs:ignore WordPress.WP.GlobalVariablesOverride - $wp_query->queried_object = get_user_by( 'id', $this->data->ID ); - $wp_query->queried_object_id = $this->data->ID; - } - } - - /** - * Reset global state after the model fields - * have been generated - * - * @return void - */ - public function tear_down() { - $GLOBALS['authordata'] = $this->global_authordata; // phpcs:ignore WordPress.WP.GlobalVariablesOverride - $GLOBALS['post'] = $this->global_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride - wp_reset_postdata(); - } - - /** - * Method for determining if the data should be considered private or not - * - * @return bool - */ - protected function is_private() { - /** - * If the user has permissions to list users. - */ - if ( current_user_can( $this->restricted_cap ) ) { - return false; - } - - /** - * If the owner of the content is the current user - */ - if ( true === $this->owner_matches_current_user() ) { - return false; - } - - return $this->data->is_private ?? true; - } - - /** - * Initialize the User object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - return ( ! empty( $this->data->ID ) ) ? Relay::toGlobalId( 'user', (string) $this->data->ID ) : null; - }, - 'databaseId' => function () { - return $this->userId; - }, - 'capabilities' => function () { - if ( ! empty( $this->data->allcaps ) ) { - - /** - * Reformat the array of capabilities from the user object so that it is a true - * ListOf type - */ - $capabilities = array_keys( - array_filter( - $this->data->allcaps, - static function ( $cap ) { - return true === $cap; - } - ) - ); - } - - return ! empty( $capabilities ) ? $capabilities : null; - }, - 'capKey' => function () { - return ! empty( $this->data->cap_key ) ? $this->data->cap_key : null; - }, - 'roles' => function () { - return ! empty( $this->data->roles ) ? $this->data->roles : null; - }, - 'email' => function () { - return ! empty( $this->data->user_email ) ? $this->data->user_email : null; - }, - 'firstName' => function () { - return ! empty( $this->data->first_name ) ? $this->data->first_name : null; - }, - 'lastName' => function () { - return ! empty( $this->data->last_name ) ? $this->data->last_name : null; - }, - 'extraCapabilities' => function () { - return ! empty( $this->data->allcaps ) ? array_keys( $this->data->allcaps ) : null; - }, - 'description' => function () { - return ! empty( $this->data->description ) ? $this->data->description : null; - }, - 'username' => function () { - return ! empty( $this->data->user_login ) ? $this->data->user_login : null; - }, - 'name' => function () { - return ! empty( $this->data->display_name ) ? $this->data->display_name : null; - }, - 'registeredDate' => function () { - $timestamp = ! empty( $this->data->user_registered ) ? strtotime( $this->data->user_registered ) : null; - return ! empty( $timestamp ) ? gmdate( 'c', $timestamp ) : null; - }, - 'nickname' => function () { - return ! empty( $this->data->nickname ) ? $this->data->nickname : null; - }, - 'url' => function () { - return ! empty( $this->data->user_url ) ? $this->data->user_url : null; - }, - 'slug' => function () { - return ! empty( $this->data->user_nicename ) ? $this->data->user_nicename : null; - }, - 'nicename' => function () { - return ! empty( $this->data->user_nicename ) ? $this->data->user_nicename : null; - }, - 'locale' => function () { - $user_locale = get_user_locale( $this->data ); - - return ! empty( $user_locale ) ? $user_locale : null; - }, - 'shouldShowAdminToolbar' => function () { - $toolbar_preference_meta = get_user_meta( $this->data->ID, 'show_admin_bar_front', true ); - - return 'true' === $toolbar_preference_meta; - }, - 'userId' => ! empty( $this->data->ID ) ? absint( $this->data->ID ) : null, - 'uri' => function () { - $user_profile_url = get_author_posts_url( $this->data->ID ); - - return ! empty( $user_profile_url ) ? str_ireplace( home_url(), '', $user_profile_url ) : ''; - }, - 'enqueuedScriptsQueue' => static function () { - global $wp_scripts; - do_action( 'wp_enqueue_scripts' ); - $queue = $wp_scripts->queue; - $wp_scripts->reset(); - $wp_scripts->queue = []; - - return $queue; - }, - 'enqueuedStylesheetsQueue' => static function () { - global $wp_styles; - do_action( 'wp_enqueue_scripts' ); - $queue = $wp_styles->queue; - $wp_styles->reset(); - $wp_styles->queue = []; - - return $queue; - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Model/UserRole.php b/lib/wp-graphql-1.17.0/src/Model/UserRole.php deleted file mode 100644 index 17711c03..00000000 --- a/lib/wp-graphql-1.17.0/src/Model/UserRole.php +++ /dev/null @@ -1,86 +0,0 @@ -data = $user_role; - parent::__construct(); - } - - /** - * Method for determining if the data should be considered private or not - * - * @return bool - */ - protected function is_private() { - if ( current_user_can( 'list_users' ) ) { - return false; - } - - $current_user_roles = wp_get_current_user()->roles; - - if ( in_array( $this->data['slug'], $current_user_roles, true ) ) { - return false; - } - - return true; - } - - /** - * Initializes the object - * - * @return void - */ - protected function init() { - if ( empty( $this->fields ) ) { - $this->fields = [ - 'id' => function () { - $id = Relay::toGlobalId( 'user_role', $this->data['id'] ); - return $id; - }, - 'name' => function () { - return ! empty( $this->data['name'] ) ? esc_html( $this->data['name'] ) : null; - }, - 'displayName' => function () { - return ! empty( $this->data['displayName'] ) ? esc_html( $this->data['displayName'] ) : null; - }, - 'capabilities' => function () { - if ( empty( $this->data['capabilities'] ) || ! is_array( $this->data['capabilities'] ) ) { - return null; - } else { - return array_keys( $this->data['capabilities'] ); - } - }, - ]; - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/CommentCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/CommentCreate.php deleted file mode 100644 index 6e2f9451..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/CommentCreate.php +++ /dev/null @@ -1,203 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return [ - 'approved' => [ - 'type' => 'String', - 'description' => __( 'The approval status of the comment.', 'wp-graphql' ), - 'deprecationReason' => __( 'Deprecated in favor of the status field', 'wp-graphql' ), - ], - 'author' => [ - 'type' => 'String', - 'description' => __( 'The name of the comment\'s author.', 'wp-graphql' ), - ], - 'authorEmail' => [ - 'type' => 'String', - 'description' => __( 'The email of the comment\'s author.', 'wp-graphql' ), - ], - 'authorUrl' => [ - 'type' => 'String', - 'description' => __( 'The url of the comment\'s author.', 'wp-graphql' ), - ], - 'commentOn' => [ - 'type' => 'Int', - 'description' => __( 'The database ID of the post object the comment belongs to.', 'wp-graphql' ), - ], - 'content' => [ - 'type' => 'String', - 'description' => __( 'Content of the comment.', 'wp-graphql' ), - ], - 'date' => [ - 'type' => 'String', - 'description' => __( 'The date of the object. Preferable to enter as year/month/day ( e.g. 01/31/2017 ) as it will rearrange date as fit if it is not specified. Incomplete dates may have unintended results for example, "2017" as the input will use current date with timestamp 20:17 ', 'wp-graphql' ), - ], - 'parent' => [ - 'type' => 'ID', - 'description' => __( 'Parent comment ID of current comment.', 'wp-graphql' ), - ], - 'status' => [ - 'type' => 'CommentStatusEnum', - 'description' => __( 'The approval status of the comment', 'wp-graphql' ), - ], - 'type' => [ - 'type' => 'String', - 'description' => __( 'Type of comment.', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return [ - 'comment' => [ - 'type' => 'Comment', - 'description' => __( 'The comment that was created', 'wp-graphql' ), - 'resolve' => static function ( $payload, $args, AppContext $context ) { - if ( ! isset( $payload['id'] ) || ! absint( $payload['id'] ) ) { - return null; - } - - return $context->get_loader( 'comment' )->load_deferred( absint( $payload['id'] ) ); - }, - ], - /** - * Comments can be created by non-authenticated users, but if the comment is not approved - * the user will not have access to the comment in response to the mutation. - * - * This field allows for the mutation to respond with a success message that the - * comment was indeed created, even if it cannot be returned in the response to respect - * server privacy. - * - * If the success comes back as true, the client can then use that response to - * dictate if they should use the input values as an optimistic response to the mutation - * and store in the cache, localStorage, cookie or whatever else so that the - * client can see their comment while it's still pending approval. - */ - 'success' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the mutation succeeded. If the comment is not approved, the server will not return the comment to a non authenticated user, but a success message can be returned if the create succeeded, and the client can optimistically add the comment to the client cache', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input, AppContext $context, ResolveInfo $info ) { - - /** - * Throw an exception if there's no input - */ - if ( ( empty( $input ) || ! is_array( $input ) ) ) { - throw new UserError( esc_html__( 'Mutation not processed. There was no input for the mutation or the comment_object was invalid', 'wp-graphql' ) ); - } - - $commented_on = get_post( absint( $input['commentOn'] ) ); - - if ( empty( $commented_on ) ) { - throw new UserError( esc_html__( 'The ID of the node to comment on is invalid', 'wp-graphql' ) ); - } - - /** - * Stop if post not open to comments - */ - if ( empty( $input['commentOn'] ) || 'closed' === $commented_on->comment_status ) { - throw new UserError( esc_html__( 'Sorry, this post is closed to comments at the moment', 'wp-graphql' ) ); - } - - if ( '1' === get_option( 'comment_registration' ) && ! is_user_logged_in() ) { - throw new UserError( esc_html__( 'This site requires you to be logged in to leave a comment', 'wp-graphql' ) ); - } - - /** - * Map all of the args from GraphQL to WordPress friendly args array - */ - $comment_args = [ - 'comment_author_url' => '', - 'comment_type' => '', - 'comment_parent' => 0, - 'user_id' => 0, - 'comment_date' => gmdate( 'Y-m-d H:i:s' ), - ]; - - CommentMutation::prepare_comment_object( $input, $comment_args, 'createComment' ); - - /** - * Insert the comment and retrieve the ID - */ - $comment_id = wp_new_comment( $comment_args, true ); - - /** - * Throw an exception if the comment failed to be created - */ - if ( is_wp_error( $comment_id ) ) { - $error_message = $comment_id->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } else { - throw new UserError( esc_html__( 'The object failed to create but no error was provided', 'wp-graphql' ) ); - } - } - - /** - * If the $comment_id is empty, we should throw an exception - */ - if ( empty( $comment_id ) ) { - throw new UserError( esc_html__( 'The object failed to create', 'wp-graphql' ) ); - } - - /** - * This updates additional data not part of the comments table ( commentmeta, other relations, etc ) - * - * The input for the commentMutation will be passed, along with the $new_comment_id for the - * comment that was created so that relations can be set, meta can be updated, etc. - */ - CommentMutation::update_additional_comment_data( $comment_id, $input, 'createComment', $context, $info ); - - /** - * Return the comment object - */ - return [ - 'id' => $comment_id, - 'success' => true, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/CommentDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/CommentDelete.php deleted file mode 100644 index 7faf0ec9..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/CommentDelete.php +++ /dev/null @@ -1,136 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The deleted comment ID', 'wp-graphql' ), - ], - 'forceDelete' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the comment should be force deleted instead of being moved to the trash', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return [ - 'deletedId' => [ - 'type' => 'Id', - 'description' => __( 'The deleted comment ID', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - $deleted = (object) $payload['commentObject']; - - return ! empty( $deleted->comment_ID ) ? Relay::toGlobalId( 'comment', $deleted->comment_ID ) : null; - }, - ], - 'comment' => [ - 'type' => 'Comment', - 'description' => __( 'The deleted comment object', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - return $payload['commentObject'] ? $payload['commentObject'] : null; - }, - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input ) { - // Get the database ID for the comment. - $comment_id = Utils::get_database_id_from_id( $input['id'] ); - - // Get the post object before deleting it. - $comment_before_delete = ! empty( $comment_id ) ? get_comment( $comment_id ) : false; - - if ( empty( $comment_before_delete ) ) { - throw new UserError( esc_html__( 'The Comment could not be deleted', 'wp-graphql' ) ); - } - - /** - * Stop now if a user isn't allowed to delete the comment - */ - $user_id = $comment_before_delete->user_id; - - // Prevent comment deletions by default - $not_allowed = true; - - // If the current user can moderate comments proceed - if ( current_user_can( 'moderate_comments' ) ) { - $not_allowed = false; - } else { - // Get the current user id - $current_user_id = absint( get_current_user_id() ); - // If the current user ID is the same as the comment author's ID, then the - // current user is the comment author and can delete the comment - if ( 0 !== $current_user_id && absint( $user_id ) === $current_user_id ) { - $not_allowed = false; - } - } - - /** - * If the mutation has been prevented - */ - if ( true === $not_allowed ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to delete this comment.', 'wp-graphql' ) ); - } - - /** - * Check if we should force delete or not - */ - $force_delete = ! empty( $input['forceDelete'] ) && true === $input['forceDelete']; - - $comment_before_delete = new Comment( $comment_before_delete ); - - /** - * Delete the comment - */ - wp_delete_comment( (int) $comment_id, $force_delete ); - - return [ - 'commentObject' => $comment_before_delete, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/CommentRestore.php b/lib/wp-graphql-1.17.0/src/Mutation/CommentRestore.php deleted file mode 100644 index 3196d30e..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/CommentRestore.php +++ /dev/null @@ -1,106 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The ID of the comment to be restored', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return [ - 'restoredId' => [ - 'type' => 'Id', - 'description' => __( 'The ID of the restored comment', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - $restore = (object) $payload['commentObject']; - - return ! empty( $restore->comment_ID ) ? Relay::toGlobalId( 'comment', $restore->comment_ID ) : null; - }, - ], - 'comment' => [ - 'type' => 'Comment', - 'description' => __( 'The restored comment object', 'wp-graphql' ), - 'resolve' => static function ( $payload, $args, AppContext $context ) { - if ( ! isset( $payload['commentObject']->comment_ID ) || ! absint( $payload['commentObject']->comment_ID ) ) { - return null; - } - return $context->get_loader( 'comment' )->load_deferred( absint( $payload['commentObject']->comment_ID ) ); - }, - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input ) { - // Stop now if a user isn't allowed to delete the comment. - if ( ! current_user_can( 'moderate_comments' ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to restore this comment.', 'wp-graphql' ) ); - } - - // Get the database ID for the comment. - $comment_id = Utils::get_database_id_from_id( $input['id'] ); - - if ( false === $comment_id ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to restore this comment.', 'wp-graphql' ) ); - } - - // Delete the comment. - wp_untrash_comment( $comment_id ); - - $comment = get_comment( $comment_id ); - - return [ - 'commentObject' => $comment, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/CommentUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/CommentUpdate.php deleted file mode 100644 index 7601d0e5..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/CommentUpdate.php +++ /dev/null @@ -1,144 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return array_merge( - CommentCreate::get_input_fields(), - [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The ID of the comment being updated.', 'wp-graphql' ), - ], - ] - ); - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return CommentCreate::get_output_fields(); - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input, AppContext $context, ResolveInfo $info ) { - // Get the database ID for the comment. - $comment_id = ! empty( $input['id'] ) ? Utils::get_database_id_from_id( $input['id'] ) : null; - - // Get the args from the existing comment. - $comment_args = ! empty( $comment_id ) ? get_comment( $comment_id, ARRAY_A ) : null; - - if ( empty( $comment_id ) || empty( $comment_args ) ) { - throw new UserError( esc_html__( 'The Comment could not be updated', 'wp-graphql' ) ); - } - - /** - * Map all of the args from GraphQL to WordPress friendly args array - */ - $user_id = $comment_args['user_id'] ?? null; - $raw_comment_args = $comment_args; - CommentMutation::prepare_comment_object( $input, $comment_args, 'update', true ); - - // Prevent comment deletions by default - $not_allowed = true; - - // If the current user can moderate comments proceed - if ( current_user_can( 'moderate_comments' ) ) { - $not_allowed = false; - } else { - // Get the current user id - $current_user_id = absint( get_current_user_id() ); - // If the current user ID is the same as the comment author's ID, then the - // current user is the comment author and can delete the comment - if ( 0 !== $current_user_id && absint( $user_id ) === $current_user_id ) { - $not_allowed = false; - } - } - - /** - * If the mutation has been prevented - */ - if ( true === $not_allowed ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to update this comment.', 'wp-graphql' ) ); - } - - // If there are no changes between the existing comment and the incoming comment - if ( $comment_args === $raw_comment_args ) { - throw new UserError( esc_html__( 'No changes have been provided to the comment.', 'wp-graphql' ) ); - } - - /** - * Update comment - * $success int 1 on success and 0 on fail - */ - $success = wp_update_comment( $comment_args, true ); - - /** - * Throw an exception if the comment failed to be created - */ - if ( is_wp_error( $success ) ) { - throw new UserError( esc_html( $success->get_error_message() ) ); - } - - /** - * This updates additional data not part of the comments table ( commentmeta, other relations, etc ) - * - * The input for the commentMutation will be passed, along with the $new_comment_id for the - * comment that was created so that relations can be set, meta can be updated, etc. - */ - CommentMutation::update_additional_comment_data( $comment_id, $input, 'create', $context, $info ); - - /** - * Return the comment object - */ - return [ - 'id' => $comment_id, - 'success' => (bool) $success, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/MediaItemCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/MediaItemCreate.php deleted file mode 100644 index f2ee2431..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/MediaItemCreate.php +++ /dev/null @@ -1,328 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return [ - 'altText' => [ - 'type' => 'String', - 'description' => __( 'Alternative text to display when mediaItem is not displayed', 'wp-graphql' ), - ], - 'authorId' => [ - 'type' => 'ID', - 'description' => __( 'The userId to assign as the author of the mediaItem', 'wp-graphql' ), - ], - 'caption' => [ - 'type' => 'String', - 'description' => __( 'The caption for the mediaItem', 'wp-graphql' ), - ], - 'commentStatus' => [ - 'type' => 'String', - 'description' => __( 'The comment status for the mediaItem', 'wp-graphql' ), - ], - 'date' => [ - 'type' => 'String', - 'description' => __( 'The date of the mediaItem', 'wp-graphql' ), - ], - 'dateGmt' => [ - 'type' => 'String', - 'description' => __( 'The date (in GMT zone) of the mediaItem', 'wp-graphql' ), - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'Description of the mediaItem', 'wp-graphql' ), - ], - 'filePath' => [ - 'type' => 'String', - 'description' => __( 'The file name of the mediaItem', 'wp-graphql' ), - ], - 'fileType' => [ - 'type' => 'MimeTypeEnum', - 'description' => __( 'The file type of the mediaItem', 'wp-graphql' ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => __( 'The slug of the mediaItem', 'wp-graphql' ), - ], - 'status' => [ - 'type' => 'MediaItemStatusEnum', - 'description' => __( 'The status of the mediaItem', 'wp-graphql' ), - ], - 'title' => [ - 'type' => 'String', - 'description' => __( 'The title of the mediaItem', 'wp-graphql' ), - ], - 'pingStatus' => [ - 'type' => 'String', - 'description' => __( 'The ping status for the mediaItem', 'wp-graphql' ), - ], - 'parentId' => [ - 'type' => 'ID', - 'description' => __( 'The ID of the parent object', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return [ - 'mediaItem' => [ - 'type' => 'MediaItem', - 'description' => __( 'The MediaItem object mutation type.', 'wp-graphql' ), - 'resolve' => static function ( $payload, $args, AppContext $context ) { - if ( empty( $payload['postObjectId'] ) || ! absint( $payload['postObjectId'] ) ) { - return null; - } - - return $context->get_loader( 'post' )->load_deferred( $payload['postObjectId'] ); - }, - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input, AppContext $context, ResolveInfo $info ) { - /** - * Stop now if a user isn't allowed to upload a mediaItem - */ - if ( ! current_user_can( 'upload_files' ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to upload mediaItems', 'wp-graphql' ) ); - } - - $post_type_object = get_post_type_object( 'attachment' ); - if ( empty( $post_type_object ) ) { - throw new UserError( esc_html__( 'The Media Item could not be created', 'wp-graphql' ) ); - } - - /** - * If the mediaItem being created is being assigned to another user that's not the current user, make sure - * the current user has permission to edit others mediaItems - */ - if ( ! empty( $input['authorId'] ) ) { - // Ensure authorId is a valid databaseId. - $input['authorId'] = Utils::get_database_id_from_id( $input['authorId'] ); - - // Bail if can't edit other users' attachments. - if ( get_current_user_id() !== $input['authorId'] && ( ! isset( $post_type_object->cap->edit_others_posts ) || ! current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to create mediaItems as this user', 'wp-graphql' ) ); - } - } - - /** - * Set the file name, whether it's a local file or from a URL. - * Then set the url for the uploaded file - */ - $file_name = basename( $input['filePath'] ); - $uploaded_file_url = $input['filePath']; - $sanitized_file_path = sanitize_file_name( $input['filePath'] ); - - // Check that the filetype is allowed - $check_file = wp_check_filetype( $sanitized_file_path ); - - // if the file doesn't pass the check, throw an error - if ( ! $check_file['ext'] || ! $check_file['type'] || ! wp_http_validate_url( $uploaded_file_url ) ) { - // translators: %s is the file path. - throw new UserError( esc_html( sprintf( __( 'Invalid filePath "%s"', 'wp-graphql' ), $input['filePath'] ) ) ); - } - - $protocol = wp_parse_url( $input['filePath'], PHP_URL_SCHEME ); - - // prevent the filePath from being submitted with a non-allowed protocols - $allowed_protocols = [ 'https', 'http', 'file' ]; - - /** - * Filter the allowed protocols for the mutation - * - * @param array $allowed_protocols The allowed protocols for filePaths to be submitted - * @param mixed $protocol The current protocol of the filePath - * @param array $input The input of the current mutation - * @param \WPGraphQL\AppContext $context The context of the current request - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo of the current field - */ - $allowed_protocols = apply_filters( 'graphql_media_item_create_allowed_protocols', $allowed_protocols, $protocol, $input, $context, $info ); - - if ( ! in_array( $protocol, $allowed_protocols, true ) ) { - throw new UserError( - esc_html( - sprintf( - // translators: %1$s is the protocol, %2$s is the list of allowed protocols. - __( 'Invalid protocol. "%1$s". Only "%2$s" allowed.', 'wp-graphql' ), - $protocol, - implode( '", "', $allowed_protocols ) - ) - ) - ); - } - - /** - * Require the file.php file from wp-admin. This file includes the - * download_url and wp_handle_sideload methods - */ - require_once ABSPATH . 'wp-admin/includes/file.php'; - - $file_contents = file_get_contents( $input['filePath'] ); - - /** - * If the mediaItem file is from a local server, use wp_upload_bits before saving it to the uploads folder - */ - if ( 'file' === wp_parse_url( $input['filePath'], PHP_URL_SCHEME ) && ! empty( $file_contents ) ) { - $uploaded_file = wp_upload_bits( $file_name, null, $file_contents ); - $uploaded_file_url = ( empty( $uploaded_file['error'] ) ? $uploaded_file['url'] : null ); - } - - /** - * URL data for the mediaItem, timeout value is the default, see: - * https://developer.wordpress.org/reference/functions/download_url/ - */ - $timeout_seconds = 300; - $temp_file = download_url( $uploaded_file_url, $timeout_seconds ); - - /** - * Handle the error from download_url if it occurs - */ - if ( is_wp_error( $temp_file ) ) { - throw new UserError( esc_html__( 'Sorry, the URL for this file is invalid, it must be a valid URL', 'wp-graphql' ) ); - } - - /** - * Build the file data for side loading - */ - $file_data = [ - 'name' => $file_name, - 'type' => ! empty( $input['fileType'] ) ? $input['fileType'] : wp_check_filetype( $temp_file ), - 'tmp_name' => $temp_file, - 'error' => 0, - 'size' => filesize( $temp_file ), - ]; - - /** - * Tells WordPress to not look for the POST form fields that would normally be present as - * we downloaded the file from a remote server, so there will be no form fields - * The default is true - */ - $overrides = [ - 'test_form' => false, - ]; - - /** - * Insert the mediaItem and retrieve it's data - */ - $file = wp_handle_sideload( $file_data, $overrides ); - - /** - * Handle the error from wp_handle_sideload if it occurs - */ - if ( ! empty( $file['error'] ) ) { - throw new UserError( esc_html__( 'Sorry, the URL for this file is invalid, it must be a path to the mediaItem file', 'wp-graphql' ) ); - } - - /** - * Insert the mediaItem object and get the ID - */ - $media_item_args = MediaItemMutation::prepare_media_item( $input, $post_type_object, 'createMediaItem', $file ); - - /** - * Get the post parent and if it's not set, set it to 0 - */ - $attachment_parent_id = ! empty( $media_item_args['post_parent'] ) ? $media_item_args['post_parent'] : 0; - - /** - * Stop now if a user isn't allowed to edit the parent post - */ - $parent = get_post( $attachment_parent_id ); - - if ( null !== $parent ) { - $post_parent_type = get_post_type_object( $parent->post_type ); - - if ( empty( $post_parent_type ) ) { - throw new UserError( esc_html__( 'The parent of the Media Item is of an invalid type', 'wp-graphql' ) ); - } - - if ( 'attachment' !== $post_parent_type->name && ( ! isset( $post_parent_type->cap->edit_post ) || ! current_user_can( $post_parent_type->cap->edit_post, $attachment_parent_id ) ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to upload mediaItems assigned to this parent node', 'wp-graphql' ) ); - } - } - - /** - * Insert the mediaItem - * - * Required Argument defaults are set in the main MediaItemMutation.php if they aren't set - * by the user during input, they are: - * post_title (pulled from file if not entered) - * post_content (empty string if not entered) - * post_status (inherit if not entered) - * post_mime_type (pulled from the file if not entered in the mutation) - */ - $attachment_id = wp_insert_attachment( $media_item_args, $file['file'], $attachment_parent_id, true ); - - if ( is_wp_error( $attachment_id ) ) { - $error_message = $attachment_id->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } - - throw new UserError( esc_html__( 'The media item failed to create but no error was provided', 'wp-graphql' ) ); - } - - /** - * Check if the wp_generate_attachment_metadata method exists and include it if not - */ - require_once ABSPATH . 'wp-admin/includes/image.php'; - - /** - * Generate and update the mediaItem's metadata. - * If we make it this far the file and attachment - * have been validated and we will not receive any errors - */ - $attachment_data = wp_generate_attachment_metadata( $attachment_id, $file['file'] ); - wp_update_attachment_metadata( $attachment_id, $attachment_data ); - - /** - * Update alt text postmeta for mediaItem - */ - MediaItemMutation::update_additional_media_item_data( $attachment_id, $input, $post_type_object, 'createMediaItem', $context, $info ); - - return [ - 'postObjectId' => $attachment_id, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/MediaItemDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/MediaItemDelete.php deleted file mode 100644 index 64ed2651..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/MediaItemDelete.php +++ /dev/null @@ -1,146 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The ID of the mediaItem to delete', 'wp-graphql' ), - ], - 'forceDelete' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the mediaItem should be force deleted instead of being moved to the trash', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return [ - 'deletedId' => [ - 'type' => 'ID', - 'description' => __( 'The ID of the deleted mediaItem', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - $deleted = (object) $payload['mediaItemObject']; - - return ! empty( $deleted->ID ) ? Relay::toGlobalId( 'post', $deleted->ID ) : null; - }, - ], - 'mediaItem' => [ - 'type' => 'MediaItem', - 'description' => __( 'The mediaItem before it was deleted', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - /** @var \WPGraphQL\Model\Post $deleted */ - $deleted = $payload['mediaItemObject']; - - return ! empty( $deleted->ID ) ? $deleted : null; - }, - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input ) { - // Get the database ID for the comment. - $media_item_id = Utils::get_database_id_from_id( $input['id'] ); - - /** - * Get the mediaItem object before deleting it - */ - $existing_media_item = ! empty( $media_item_id ) ? get_post( $media_item_id ) : null; - - // If there's no existing mediaItem, throw an exception. - if ( null === $existing_media_item ) { - throw new UserError( esc_html__( 'No mediaItem with that ID could be found to delete', 'wp-graphql' ) ); - } - - // Stop now if the post isn't a mediaItem. - if ( 'attachment' !== $existing_media_item->post_type ) { - // Translators: the placeholder is the post_type of the object being deleted - throw new UserError( esc_html( sprintf( __( 'Sorry, the item you are trying to delete is a %1%s, not a mediaItem', 'wp-graphql' ), $existing_media_item->post_type ) ) ); - } - - /** - * Stop now if a user isn't allowed to delete a mediaItem - */ - $post_type_object = get_post_type_object( 'attachment' ); - - if ( ! isset( $post_type_object->cap->delete_post ) || ! current_user_can( $post_type_object->cap->delete_post, $media_item_id ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to delete mediaItems', 'wp-graphql' ) ); - } - - /** - * Check if we should force delete or not - */ - $force_delete = ! empty( $input['forceDelete'] ) && true === $input['forceDelete']; - - /** - * If the mediaItem is already in the trash, and the forceDelete input was not passed, - * don't remove from the trash - */ - if ( 'trash' === $existing_media_item->post_status && true !== $force_delete ) { - // translators: the first placeholder is the post_type of the object being deleted and the second placeholder is the unique ID of that object - throw new UserError( esc_html( sprintf( __( 'The mediaItem with id %1$s is already in the trash. To remove from the trash, use the forceDelete input', 'wp-graphql' ), $input['id'] ) ) ); - } - - /** - * Delete the mediaItem. This will not throw false thanks to - * all of the above validation - */ - $deleted = wp_delete_attachment( (int) $media_item_id, $force_delete ); - - /** - * If the post was moved to the trash, spoof the object's status before returning it - */ - $existing_media_item->post_status = ( false !== $deleted && true !== $force_delete ) ? 'trash' : $existing_media_item->post_status; - - $media_item_before_delete = new Post( $existing_media_item ); - - /** - * Return the deletedId and the mediaItem before it was deleted - */ - return [ - 'mediaItemObject' => $media_item_before_delete, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/MediaItemUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/MediaItemUpdate.php deleted file mode 100644 index a000f971..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/MediaItemUpdate.php +++ /dev/null @@ -1,171 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - /** @var \WP_Post_Type $post_type_object */ - $post_type_object = get_post_type_object( 'attachment' ); - return array_merge( - MediaItemCreate::get_input_fields(), - [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - // translators: the placeholder is the name of the type of post object being updated - 'description' => sprintf( __( 'The ID of the %1$s object', 'wp-graphql' ), $post_type_object->graphql_single_name ), - ], - ] - ); - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return MediaItemCreate::get_output_fields(); - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input, AppContext $context, ResolveInfo $info ) { - $post_type_object = get_post_type_object( 'attachment' ); - - if ( empty( $post_type_object ) ) { - return null; - } - - // Get the database ID for the comment. - $media_item_id = Utils::get_database_id_from_id( $input['id'] ); - - /** - * Get the mediaItem object before deleting it - */ - $existing_media_item = ! empty( $media_item_id ) ? get_post( $media_item_id ) : null; - - $mutation_name = 'updateMediaItem'; - - /** - * If there's no existing mediaItem, throw an exception - */ - if ( null === $existing_media_item ) { - throw new UserError( esc_html__( 'No mediaItem with that ID could be found to update', 'wp-graphql' ) ); - } - - /** - * Stop now if the post isn't a mediaItem - */ - if ( $post_type_object->name !== $existing_media_item->post_type ) { - // translators: The placeholder is the ID of the mediaItem being edited - throw new UserError( esc_html( sprintf( __( 'The id %1$d is not of the type mediaItem', 'wp-graphql' ), $input['id'] ) ) ); - } - - /** - * Stop now if a user isn't allowed to edit mediaItems - */ - if ( ! isset( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->edit_posts ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to update mediaItems', 'wp-graphql' ) ); - } - - $author_id = absint( $existing_media_item->post_author ); - - /** - * If the mutation is setting the author to be someone other than the user making the request - * make sure they have permission to edit others posts - */ - if ( ! empty( $input['authorId'] ) ) { - // Ensure authorId is a valid databaseId. - $input['authorId'] = Utils::get_database_id_from_id( $input['authorId'] ); - // Use the new author for checks. - $author_id = $input['authorId']; - } - - /** - * Check to see if the existing_media_item author matches the current user, - * if not they need to be able to edit others posts to proceed - */ - if ( get_current_user_id() !== $author_id && ( ! isset( $post_type_object->cap->edit_others_posts ) || ! current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to update mediaItems as this user.', 'wp-graphql' ) ); - } - - /** - * Insert the post object and get the ID - */ - $post_args = MediaItemMutation::prepare_media_item( $input, $post_type_object, $mutation_name, false ); - $post_args['ID'] = $media_item_id; - - $clean_args = wp_slash( (array) $post_args ); - - if ( ! is_array( $clean_args ) || empty( $clean_args ) ) { - throw new UserError( esc_html__( 'The media item failed to update', 'wp-graphql' ) ); - } - - /** - * Insert the post and retrieve the ID - * - * This will not fail as long as we have an ID in $post_args - * Thanks to the validation above we will always have the ID - */ - $post_id = wp_update_post( $clean_args, true ); - - if ( is_wp_error( $post_id ) ) { - $error_message = $post_id->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } - - throw new UserError( esc_html__( 'The media item failed to update but no error was provided', 'wp-graphql' ) ); - } - - /** - * This updates additional data not part of the posts table (postmeta, terms, other relations, etc) - * - * The input for the postObjectMutation will be passed, along with the $new_post_id for the - * postObject that was updated so that relations can be set, meta can be updated, etc. - */ - MediaItemMutation::update_additional_media_item_data( $post_id, $input, $post_type_object, $mutation_name, $context, $info ); - - /** - * Return the payload - */ - return [ - 'postObjectId' => $post_id, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/PostObjectCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/PostObjectCreate.php deleted file mode 100644 index bf99f77b..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/PostObjectCreate.php +++ /dev/null @@ -1,379 +0,0 @@ -graphql_single_name ); - - register_graphql_mutation( - $mutation_name, - [ - 'inputFields' => self::get_input_fields( $post_type_object ), - 'outputFields' => self::get_output_fields( $post_type_object ), - 'mutateAndGetPayload' => self::mutate_and_get_payload( $post_type_object, $mutation_name ), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @param \WP_Post_Type $post_type_object The post type of the mutation. - * - * @return array - */ - public static function get_input_fields( $post_type_object ) { - $fields = [ - 'date' => [ - 'type' => 'String', - 'description' => __( 'The date of the object. Preferable to enter as year/month/day (e.g. 01/31/2017) as it will rearrange date as fit if it is not specified. Incomplete dates may have unintended results for example, "2017" as the input will use current date with timestamp 20:17 ', 'wp-graphql' ), - ], - 'menuOrder' => [ - 'type' => 'Int', - 'description' => __( 'A field used for ordering posts. This is typically used with nav menu items or for special ordering of hierarchical content types.', 'wp-graphql' ), - ], - 'password' => [ - 'type' => 'String', - 'description' => __( 'The password used to protect the content of the object', 'wp-graphql' ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => __( 'The slug of the object', 'wp-graphql' ), - ], - 'status' => [ - 'type' => 'PostStatusEnum', - 'description' => __( 'The status of the object', 'wp-graphql' ), - ], - ]; - - if ( post_type_supports( $post_type_object->name, 'author' ) ) { - $fields['authorId'] = [ - 'type' => 'ID', - 'description' => __( 'The userId to assign as the author of the object', 'wp-graphql' ), - ]; - } - - if ( post_type_supports( $post_type_object->name, 'comments' ) ) { - $fields['commentStatus'] = [ - 'type' => 'String', - 'description' => __( 'The comment status for the object', 'wp-graphql' ), - ]; - } - - if ( post_type_supports( $post_type_object->name, 'editor' ) ) { - $fields['content'] = [ - 'type' => 'String', - 'description' => __( 'The content of the object', 'wp-graphql' ), - ]; - } - - if ( post_type_supports( $post_type_object->name, 'excerpt' ) ) { - $fields['excerpt'] = [ - 'type' => 'String', - 'description' => __( 'The excerpt of the object', 'wp-graphql' ), - ]; - } - - if ( post_type_supports( $post_type_object->name, 'title' ) ) { - $fields['title'] = [ - 'type' => 'String', - 'description' => __( 'The title of the object', 'wp-graphql' ), - ]; - } - - if ( post_type_supports( $post_type_object->name, 'trackbacks' ) ) { - $fields['pinged'] = [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'URLs that have been pinged.', 'wp-graphql' ), - ]; - - $fields['pingStatus'] = [ - 'type' => 'String', - 'description' => __( 'The ping status for the object', 'wp-graphql' ), - ]; - - $fields['toPing'] = [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'URLs queued to be pinged.', 'wp-graphql' ), - ]; - } - - if ( $post_type_object->hierarchical || in_array( - $post_type_object->name, - [ - 'attachment', - 'revision', - ], - true - ) ) { - $fields['parentId'] = [ - 'type' => 'ID', - 'description' => __( 'The ID of the parent object', 'wp-graphql' ), - ]; - } - - if ( 'attachment' === $post_type_object->name ) { - $fields['mimeType'] = [ - 'type' => 'MimeTypeEnum', - 'description' => __( 'If the post is an attachment or a media file, this field will carry the corresponding MIME type. This field is equivalent to the value of WP_Post->post_mime_type and the post_mime_type column in the "post_objects" database table.', 'wp-graphql' ), - ]; - } - - /** @var \WP_Taxonomy[] $allowed_taxonomies */ - $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); - - foreach ( $allowed_taxonomies as $tax_object ) { - // If the taxonomy is in the array of taxonomies registered to the post_type - if ( in_array( $tax_object->name, get_object_taxonomies( $post_type_object->name ), true ) ) { - $fields[ $tax_object->graphql_plural_name ] = [ - 'description' => sprintf( - // translators: %1$s is the post type GraphQL name, %2$s is the taxonomy GraphQL name. - __( 'Set connections between the %1$s and %2$s', 'wp-graphql' ), - $post_type_object->graphql_single_name, - $tax_object->graphql_plural_name - ), - 'type' => ucfirst( $post_type_object->graphql_single_name ) . ucfirst( $tax_object->graphql_plural_name ) . 'Input', - ]; - } - } - - return $fields; - } - - /** - * Defines the mutation output field configuration. - * - * @param \WP_Post_Type $post_type_object The post type of the mutation. - * - * @return array - */ - public static function get_output_fields( WP_Post_Type $post_type_object ) { - return [ - $post_type_object->graphql_single_name => [ - 'type' => $post_type_object->graphql_single_name, - 'description' => __( 'The Post object mutation type.', 'wp-graphql' ), - 'resolve' => static function ( $payload, $_args, AppContext $context ) { - if ( empty( $payload['postObjectId'] ) || ! absint( $payload['postObjectId'] ) ) { - return null; - } - - return $context->get_loader( 'post' )->load_deferred( $payload['postObjectId'] ); - }, - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @param \WP_Post_Type $post_type_object The post type of the mutation. - * @param string $mutation_name The mutation name. - * - * @return callable - */ - public static function mutate_and_get_payload( $post_type_object, $mutation_name ) { - return static function ( $input, AppContext $context, ResolveInfo $info ) use ( $post_type_object, $mutation_name ) { - - /** - * Throw an exception if there's no input - */ - if ( ( empty( $post_type_object->name ) ) || ( empty( $input ) || ! is_array( $input ) ) ) { - throw new UserError( esc_html__( 'Mutation not processed. There was no input for the mutation or the post_type_object was invalid', 'wp-graphql' ) ); - } - - /** - * Stop now if a user isn't allowed to create a post - */ - if ( ! isset( $post_type_object->cap->create_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) { - // translators: the $post_type_object->graphql_plural_name placeholder is the name of the object being mutated - throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to create %1$s', 'wp-graphql' ), $post_type_object->graphql_plural_name ) ) ); - } - - /** - * If the post being created is being assigned to another user that's not the current user, make sure - * the current user has permission to edit others posts for this post_type - */ - if ( ! empty( $input['authorId'] ) ) { - // Ensure authorId is a valid databaseId. - $input['authorId'] = Utils::get_database_id_from_id( $input['authorId'] ); - - $author = ! empty( $input['authorId'] ) ? get_user_by( 'ID', $input['authorId'] ) : false; - - if ( false === $author ) { - throw new UserError( esc_html__( 'The provided `authorId` is not a valid user', 'wp-graphql' ) ); - } - - if ( get_current_user_id() !== $input['authorId'] && ( ! isset( $post_type_object->cap->edit_others_posts ) || ! current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { - // translators: the $post_type_object->graphql_plural_name placeholder is the name of the object being mutated - throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to create %1$s as this user', 'wp-graphql' ), $post_type_object->graphql_plural_name ) ) ); - } - } - - /** - * @todo: When we support assigning terms and setting posts as "sticky" we need to check permissions - * @see :https://github.com/WordPress/WordPress/blob/e357195ce303017d517aff944644a7a1232926f7/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L504-L506 - * @see : https://github.com/WordPress/WordPress/blob/e357195ce303017d517aff944644a7a1232926f7/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L496-L498 - */ - - /** - * Insert the post object and get the ID - */ - $post_args = PostObjectMutation::prepare_post_object( $input, $post_type_object, $mutation_name ); - - /** - * Filter the default post status to use when the post is initially created. Pass through a filter to - * allow other plugins to override the default (for example, Edit Flow, which provides control over - * customizing stati or various E-commerce plugins that make heavy use of custom stati) - * - * @param string $default_status The default status to be used when the post is initially inserted - * @param \WP_Post_Type $post_type_object The Post Type that is being inserted - * @param string $mutation_name The name of the mutation currently in progress - */ - $default_post_status = apply_filters( 'graphql_post_object_create_default_post_status', 'draft', $post_type_object, $mutation_name ); - - /** - * We want to cache the "post_status" and set the status later. We will set the initial status - * of the inserted post as the default status for the site, allow side effects to process with the - * inserted post (set term object connections, set meta input, sideload images if necessary, etc) - * Then will follow up with setting the status as what it was declared to be later - */ - $intended_post_status = ! empty( $post_args['post_status'] ) ? $post_args['post_status'] : $default_post_status; - - /** - * If the current user cannot publish posts but their intent was to publish, - * default the status to pending. - */ - if ( ( ! isset( $post_type_object->cap->publish_posts ) || ! current_user_can( $post_type_object->cap->publish_posts ) ) && ! in_array( - $intended_post_status, - [ - 'draft', - 'pending', - ], - true - ) ) { - $intended_post_status = 'pending'; - } - - /** - * Set the post_status as the default for the initial insert. The intended $post_status will be set after - * side effects are complete. - */ - $post_args['post_status'] = $default_post_status; - - $clean_args = wp_slash( (array) $post_args ); - - if ( ! is_array( $clean_args ) || empty( $clean_args ) ) { - throw new UserError( esc_html__( 'The object failed to create', 'wp-graphql' ) ); - } - - /** - * Insert the post and retrieve the ID - */ - $post_id = wp_insert_post( $clean_args, true ); - - /** - * Throw an exception if the post failed to create - */ - if ( is_wp_error( $post_id ) ) { - $error_message = $post_id->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } - - throw new UserError( esc_html__( 'The object failed to create but no error was provided', 'wp-graphql' ) ); - } - - /** - * This updates additional data not part of the posts table (postmeta, terms, other relations, etc) - * - * The input for the postObjectMutation will be passed, along with the $new_post_id for the - * postObject that was created so that relations can be set, meta can be updated, etc. - */ - PostObjectMutation::update_additional_post_object_data( $post_id, $input, $post_type_object, $mutation_name, $context, $info, $default_post_status, $intended_post_status ); - - /** - * Determine whether the intended status should be set or not. - * - * By filtering to false, the $intended_post_status will not be set at the completion of the mutation. - * - * This allows for side-effect actions to set the status later. For example, if a post - * was being created via a GraphQL Mutation, the post had additional required assets, such as images - * that needed to be sideloaded or some other semi-time-consuming side effect, those actions could - * be deferred (cron or whatever), and when those actions complete they could come back and set - * the $intended_status. - * - * @param boolean $should_set_intended_status Whether to set the intended post_status or not. Default true. - * @param \WP_Post_Type $post_type_object The Post Type Object for the post being mutated - * @param string $mutation_name The name of the mutation currently in progress - * @param \WPGraphQL\AppContext $context The AppContext passed down to all resolvers - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down to all resolvers - * @param string $intended_post_status The intended post_status the post should have according to the mutation input - * @param string $default_post_status The default status posts should use if an intended status wasn't set - */ - $should_set_intended_status = apply_filters( 'graphql_post_object_create_should_set_intended_post_status', true, $post_type_object, $mutation_name, $context, $info, $intended_post_status, $default_post_status ); - - /** - * If the intended post status and the default post status are not the same, - * update the post with the intended status now that side effects are complete. - */ - if ( $intended_post_status !== $default_post_status && true === $should_set_intended_status ) { - - /** - * If the post was deleted by a side effect action before getting here, - * don't proceed. - */ - $new_post = get_post( $post_id ); - if ( empty( $new_post ) ) { - throw new UserError( esc_html__( 'The status of the post could not be set', 'wp-graphql' ) ); - } - - /** - * If the $intended_post_status is different than the current status of the post - * proceed and update the status. - */ - if ( $intended_post_status !== $new_post->post_status ) { - $update_args = [ - 'ID' => $post_id, - 'post_status' => $intended_post_status, - // Prevent the post_date from being reset if the date was included in the create post $args - // see: https://core.trac.wordpress.org/browser/tags/4.9/src/wp-includes/post.php#L3637 - 'edit_date' => ! empty( $post_args['post_date'] ) ? $post_args['post_date'] : false, - ]; - - wp_update_post( $update_args ); - } - } - - /** - * Return the post object - */ - return [ - 'postObjectId' => $post_id, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/PostObjectDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/PostObjectDelete.php deleted file mode 100644 index 33489058..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/PostObjectDelete.php +++ /dev/null @@ -1,167 +0,0 @@ -graphql_single_name ); - - register_graphql_mutation( - $mutation_name, - [ - 'inputFields' => self::get_input_fields( $post_type_object ), - 'outputFields' => self::get_output_fields( $post_type_object ), - 'mutateAndGetPayload' => self::mutate_and_get_payload( $post_type_object, $mutation_name ), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @param \WP_Post_Type $post_type_object The post type of the mutation. - * - * @return array - */ - public static function get_input_fields( $post_type_object ) { - return [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - // translators: The placeholder is the name of the post's post_type being deleted - 'description' => sprintf( __( 'The ID of the %1$s to delete', 'wp-graphql' ), $post_type_object->graphql_single_name ), - ], - 'forceDelete' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object should be force deleted instead of being moved to the trash', 'wp-graphql' ), - ], - 'ignoreEditLock' => [ - 'type' => 'Boolean', - 'description' => __( 'Override the edit lock when another user is editing the post', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @param \WP_Post_Type $post_type_object The post type of the mutation. - * - * @return array - */ - public static function get_output_fields( WP_Post_Type $post_type_object ) { - return [ - 'deletedId' => [ - 'type' => 'ID', - 'description' => __( 'The ID of the deleted object', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - /** @var \WPGraphQL\Model\Post $deleted */ - $deleted = $payload['postObject']; - - return ! empty( $deleted->ID ) ? Relay::toGlobalId( 'post', (string) $deleted->ID ) : null; - }, - ], - $post_type_object->graphql_single_name => [ - 'type' => $post_type_object->graphql_single_name, - 'description' => __( 'The object before it was deleted', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - /** @var \WPGraphQL\Model\Post $deleted */ - $deleted = $payload['postObject']; - - return ! empty( $deleted->ID ) ? $deleted : null; - }, - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @param \WP_Post_Type $post_type_object The post type of the mutation. - * @param string $mutation_name The mutation name. - * - * @return callable - */ - public static function mutate_and_get_payload( WP_Post_Type $post_type_object, string $mutation_name ) { - return static function ( $input ) use ( $post_type_object ) { - // Get the database ID for the post. - $post_id = Utils::get_database_id_from_id( $input['id'] ); - - /** - * Stop now if a user isn't allowed to delete a post - */ - if ( ! isset( $post_type_object->cap->delete_post ) || ! current_user_can( $post_type_object->cap->delete_post, $post_id ) ) { - // translators: the $post_type_object->graphql_plural_name placeholder is the name of the object being mutated - throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to delete %1$s', 'wp-graphql' ), $post_type_object->graphql_plural_name ) ) ); - } - - /** - * Check if we should force delete or not - */ - $force_delete = ! empty( $input['forceDelete'] ) && true === $input['forceDelete']; - - /** - * Get the post object before deleting it - */ - $post_before_delete = ! empty( $post_id ) ? get_post( $post_id ) : null; - - if ( empty( $post_before_delete ) ) { - throw new UserError( esc_html__( 'The post could not be deleted', 'wp-graphql' ) ); - } - - $post_before_delete = new Post( $post_before_delete ); - - /** - * If the post is already in the trash, and the forceDelete input was not passed, - * don't remove from the trash - */ - if ( 'trash' === $post_before_delete->post_status && true !== $force_delete ) { - // Translators: the first placeholder is the post_type of the object being deleted and the second placeholder is the unique ID of that object - throw new UserError( esc_html( sprintf( __( 'The %1$s with id %2$s is already in the trash. To remove from the trash, use the forceDelete input', 'wp-graphql' ), $post_type_object->graphql_single_name, $post_id ) ) ); - } - - // If post is locked and the override is not specified, do not allow the edit - $locked_user_id = PostObjectMutation::check_edit_lock( $post_id, $input ); - if ( false !== $locked_user_id ) { - $user = get_userdata( (int) $locked_user_id ); - $display_name = isset( $user->display_name ) ? $user->display_name : 'unknown'; - /* translators: %s: User's display name. */ - throw new UserError( esc_html( sprintf( __( 'You cannot delete this item. %s is currently editing.', 'wp-graphql' ), $display_name ) ) ); - } - - /** - * Delete the post - */ - $deleted = wp_delete_post( (int) $post_id, $force_delete ); - - /** - * If the post was moved to the trash, spoof the object's status before returning it - */ - $post_before_delete->post_status = ( false !== $deleted && true !== $force_delete ) ? 'trash' : $post_before_delete->post_status; - - /** - * Return the deletedId and the object before it was deleted - */ - return [ - 'postObject' => $post_before_delete, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/PostObjectUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/PostObjectUpdate.php deleted file mode 100644 index d8d4776c..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/PostObjectUpdate.php +++ /dev/null @@ -1,222 +0,0 @@ -graphql_single_name ); - - register_graphql_mutation( - $mutation_name, - [ - 'inputFields' => self::get_input_fields( $post_type_object ), - 'outputFields' => self::get_output_fields( $post_type_object ), - 'mutateAndGetPayload' => self::mutate_and_get_payload( $post_type_object, $mutation_name ), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @param \WP_Post_Type $post_type_object The post type of the mutation. - * - * @return array - */ - public static function get_input_fields( $post_type_object ) { - return array_merge( - PostObjectCreate::get_input_fields( $post_type_object ), - [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - // translators: the placeholder is the name of the type of post object being updated - 'description' => sprintf( __( 'The ID of the %1$s object', 'wp-graphql' ), $post_type_object->graphql_single_name ), - ], - 'ignoreEditLock' => [ - 'type' => 'Boolean', - 'description' => __( 'Override the edit lock when another user is editing the post', 'wp-graphql' ), - ], - ] - ); - } - - /** - * Defines the mutation output field configuration. - * - * @param \WP_Post_Type $post_type_object The post type of the mutation. - * - * @return array - */ - public static function get_output_fields( $post_type_object ) { - return PostObjectCreate::get_output_fields( $post_type_object ); - } - - /** - * Defines the mutation data modification closure. - * - * @param \WP_Post_Type $post_type_object The post type of the mutation. - * @param string $mutation_name The mutation name. - * - * @return callable - */ - public static function mutate_and_get_payload( $post_type_object, $mutation_name ) { - return static function ( $input, AppContext $context, ResolveInfo $info ) use ( $post_type_object, $mutation_name ) { - // Get the database ID for the comment. - $post_id = Utils::get_database_id_from_id( $input['id'] ); - $existing_post = ! empty( $post_id ) ? get_post( $post_id ) : null; - - /** - * If there's no existing post, throw an exception - */ - if ( null === $existing_post ) { - // translators: the placeholder is the name of the type of post being updated - throw new UserError( esc_html( sprintf( __( 'No %1$s could be found to update', 'wp-graphql' ), $post_type_object->graphql_single_name ) ) ); - } - - if ( $post_type_object->name !== $existing_post->post_type ) { - // translators: The first placeholder is an ID and the second placeholder is the name of the post type being edited - throw new UserError( esc_html( sprintf( __( 'The id %1$d is not of the type "%2$s"', 'wp-graphql' ), $post_id, $post_type_object->name ) ) ); - } - - /** - * Stop now if a user isn't allowed to edit posts - */ - if ( ! isset( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->edit_posts ) ) { - // translators: the $post_type_object->graphql_single_name placeholder is the name of the object being mutated - throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to update a %1$s', 'wp-graphql' ), $post_type_object->graphql_single_name ) ) ); - } - - /** - * If the existing post was authored by another author, ensure the requesting user has permission to edit it - */ - if ( get_current_user_id() !== (int) $existing_post->post_author && ( ! isset( $post_type_object->cap->edit_others_posts ) || true !== current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { - // translators: the $post_type_object->graphql_single_name placeholder is the name of the object being mutated - throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to update another author\'s %1$s', 'wp-graphql' ), $post_type_object->graphql_single_name ) ) ); - } - - $author_id = absint( $existing_post->post_author ); - - /** - * If the mutation is setting the author to be someone other than the user making the request - * make sure they have permission to edit others posts - */ - if ( ! empty( $input['authorId'] ) ) { - // Ensure authorId is a valid databaseId. - $input['authorId'] = Utils::get_database_id_from_id( $input['authorId'] ); - // Use the new author for checks. - $author_id = $input['authorId']; - } - - /** - * Check to see if the existing_media_item author matches the current user, - * if not they need to be able to edit others posts to proceed - */ - if ( get_current_user_id() !== $author_id && ( ! isset( $post_type_object->cap->edit_others_posts ) || ! current_user_can( $post_type_object->cap->edit_others_posts ) ) ) { - // translators: the $post_type_object->graphql_single_name placeholder is the name of the object being mutated - throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to update %1$s as this user.', 'wp-graphql' ), $post_type_object->graphql_plural_name ) ) ); - } - - // If post is locked and the override is not specified, do not allow the edit - $locked_user_id = PostObjectMutation::check_edit_lock( $post_id, $input ); - if ( false !== $locked_user_id ) { - $user = get_userdata( (int) $locked_user_id ); - $display_name = isset( $user->display_name ) ? $user->display_name : 'unknown'; - /* translators: %s: User's display name. */ - throw new UserError( esc_html( sprintf( __( 'You cannot update this item. %s is currently editing.', 'wp-graphql' ), $display_name ) ) ); - } - - /** - * @todo: when we add support for making posts sticky, we should check permissions to make sure users can make posts sticky - * @see : https://github.com/WordPress/WordPress/blob/e357195ce303017d517aff944644a7a1232926f7/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L640-L642 - */ - - /** - * @todo: when we add support for assigning terms to posts, we should check permissions to make sure they can assign terms - * @see : https://github.com/WordPress/WordPress/blob/e357195ce303017d517aff944644a7a1232926f7/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php#L644-L646 - */ - - /** - * Insert the post object and get the ID - */ - $post_args = PostObjectMutation::prepare_post_object( $input, $post_type_object, $mutation_name ); - $post_args['ID'] = $post_id; - - $clean_args = wp_slash( (array) $post_args ); - - if ( ! is_array( $clean_args ) || empty( $clean_args ) ) { - throw new UserError( esc_html__( 'The object failed to update.', 'wp-graphql' ) ); - } - - /** - * Insert the post and retrieve the ID - */ - $updated_post_id = wp_update_post( $clean_args, true ); - - /** - * Throw an exception if the post failed to update - */ - if ( is_wp_error( $updated_post_id ) ) { - $error_message = $updated_post_id->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } - - throw new UserError( esc_html__( 'The object failed to update but no error was provided', 'wp-graphql' ) ); - } - - /** - * Fires after a single term is created or updated via a GraphQL mutation - * - * The dynamic portion of the hook name, `$taxonomy->name` refers to the taxonomy of the term being mutated - * - * @param int $post_id Inserted post ID - * @param \WP_Post_Type $post_type_object The Post Type object for the post being mutated - * @param array $args The args used to insert the term - * @param string $mutation_name The name of the mutation being performed - */ - do_action( 'graphql_insert_post_object', absint( $post_id ), $post_type_object, $post_args, $mutation_name ); - - /** - * Fires after a single term is created or updated via a GraphQL mutation - * - * The dynamic portion of the hook name, `$taxonomy->name` refers to the taxonomy of the term being mutated - * - * @param int $post_id Inserted post ID - * @param array $args The args used to insert the term - * @param string $mutation_name The name of the mutation being performed - */ - do_action( "graphql_insert_{$post_type_object->name}", absint( $post_id ), $post_args, $mutation_name ); - - /** - * This updates additional data not part of the posts table (postmeta, terms, other relations, etc) - * - * The input for the postObjectMutation will be passed, along with the $new_post_id for the - * postObject that was updated so that relations can be set, meta can be updated, etc. - */ - PostObjectMutation::update_additional_post_object_data( (int) $post_id, $input, $post_type_object, $mutation_name, $context, $info ); - - /** - * Return the payload - */ - return [ - 'postObjectId' => $post_id, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/ResetUserPassword.php b/lib/wp-graphql-1.17.0/src/Mutation/ResetUserPassword.php deleted file mode 100644 index 249cf8e8..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/ResetUserPassword.php +++ /dev/null @@ -1,114 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return [ - 'key' => [ - 'type' => 'String', - 'description' => __( 'Password reset key', 'wp-graphql' ), - ], - 'login' => [ - 'type' => 'String', - 'description' => __( 'The user\'s login (username).', 'wp-graphql' ), - ], - 'password' => [ - 'type' => 'String', - 'description' => __( 'The new password.', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return UserCreate::get_output_fields(); - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input, AppContext $context ) { - if ( empty( $input['key'] ) ) { - throw new UserError( esc_html__( 'A password reset key is required.', 'wp-graphql' ) ); - } - - if ( empty( $input['login'] ) ) { - throw new UserError( esc_html__( 'A user login is required.', 'wp-graphql' ) ); - } - - if ( empty( $input['password'] ) ) { - throw new UserError( esc_html__( 'A new password is required.', 'wp-graphql' ) ); - } - - $user = check_password_reset_key( $input['key'], $input['login'] ); - - /** - * If the password reset key check returns an error - */ - if ( is_wp_error( $user ) ) { - - /** - * Determine the message to return - */ - if ( 'expired_key' === $user->get_error_code() ) { - $message = __( 'Password reset link has expired.', 'wp-graphql' ); - } else { - $message = __( 'Password reset link is invalid.', 'wp-graphql' ); - } - - /** - * Throw an error with the message - */ - throw new UserError( esc_html( $message ) ); - } - - /** - * Reset the password - */ - reset_password( $user, $input['password'] ); - - // Log in the user, since they already authenticated with the reset key. - wp_set_current_user( $user->ID ); - - /** - * Return the user ID - */ - return [ - 'id' => $user->ID, - 'user' => $context->get_loader( 'user' )->load_deferred( $user->ID ), - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/SendPasswordResetEmail.php b/lib/wp-graphql-1.17.0/src/Mutation/SendPasswordResetEmail.php deleted file mode 100644 index aca4150e..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/SendPasswordResetEmail.php +++ /dev/null @@ -1,258 +0,0 @@ - __( 'Send password reset email to user', 'wp-graphql' ), - 'inputFields' => self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields(): array { - return [ - 'username' => [ - 'type' => [ - 'non_null' => 'String', - ], - 'description' => __( 'A string that contains the user\'s username or email address.', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields(): array { - return [ - 'user' => [ - 'type' => 'User', - 'description' => __( 'The user that the password reset email was sent to', 'wp-graphql' ), - 'deprecationReason' => __( 'This field will be removed in a future version of WPGraphQL', 'wp-graphql' ), - 'resolve' => static function ( $payload, $args, AppContext $context ) { - return ! empty( $payload['id'] ) ? $context->get_loader( 'user' )->load_deferred( $payload['id'] ) : null; - }, - ], - 'success' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the mutation completed successfully. This does NOT necessarily mean that an email was sent.', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload(): callable { - return static function ( $input ) { - if ( ! self::was_username_provided( $input ) ) { - throw new UserError( esc_html__( 'Enter a username or email address.', 'wp-graphql' ) ); - } - - // We obsfucate the actual success of this mutation to prevent user enumeration. - $payload = [ - 'success' => true, - 'id' => null, - ]; - - $user_data = self::get_user_data( $input['username'] ); - - if ( ! $user_data ) { - graphql_debug( self::get_user_not_found_error_message( $input['username'] ) ); - - return $payload; - } - - // Get the password reset key. - $key = get_password_reset_key( $user_data ); - if ( is_wp_error( $key ) ) { - graphql_debug( __( 'Unable to generate a password reset key.', 'wp-graphql' ) ); - - return $payload; - } - - // Mail the reset key. - $subject = self::get_email_subject( $user_data ); - $message = self::get_email_message( $user_data, $key ); - - $email_sent = wp_mail( // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_mail_wp_mail - $user_data->user_email, - wp_specialchars_decode( $subject ), - $message - ); - - // wp_mail can return a wp_error, but the docblock for it in WP Core is incorrect. - // phpstan should ignore this check. - // @phpstan-ignore-next-line - if ( is_wp_error( $email_sent ) ) { - graphql_debug( __( 'The email could not be sent.', 'wp-graphql' ) . "
\n" . __( 'Possible reason: your host may have disabled the mail() function.', 'wp-graphql' ) ); - - return $payload; - } - - /** - * Return the ID of the user - */ - return [ - 'id' => $user_data->ID, - 'success' => true, - ]; - }; - } - - /** - * Was a username or email address provided? - * - * @param array $input The input args. - * - * @return bool - */ - private static function was_username_provided( $input ) { - return ! empty( $input['username'] ) && is_string( $input['username'] ); - } - - /** - * Get WP_User object representing this user - * - * @param string $username The user's username or email address. - * - * @return \WP_User|false WP_User object on success, false on failure. - */ - private static function get_user_data( $username ) { - if ( self::is_email_address( $username ) ) { - $username = wp_unslash( $username ); - - if ( ! is_string( $username ) ) { - return false; - } - - return get_user_by( 'email', trim( $username ) ); - } - - return get_user_by( 'login', trim( $username ) ); - } - - /** - * Get the error message indicating why the user wasn't found - * - * @param string $username The user's username or email address. - * - * @return string - */ - private static function get_user_not_found_error_message( string $username ) { - if ( self::is_email_address( $username ) ) { - return __( 'There is no user registered with that email address.', 'wp-graphql' ); - } - - return __( 'Invalid username.', 'wp-graphql' ); - } - - /** - * Is the provided username arg an email address? - * - * @param string $username The user's username or email address. - * - * @return bool - */ - private static function is_email_address( string $username ) { - return (bool) strpos( $username, '@' ); - } - - /** - * Get the subject of the password reset email - * - * @param \WP_User $user_data User data - * - * @return string - */ - private static function get_email_subject( $user_data ) { - /* translators: Password reset email subject. %s: Site name */ - $title = sprintf( __( '[%s] Password Reset', 'wp-graphql' ), self::get_site_name() ); - - /** - * Filters the subject of the password reset email. - * - * @param string $title Default email title. - * @param string $user_login The username for the user. - * @param \WP_User $user_data WP_User object. - */ - return apply_filters( 'retrieve_password_title', $title, $user_data->user_login, $user_data ); - } - - /** - * Get the site name. - * - * @return string - */ - private static function get_site_name() { - if ( is_multisite() ) { - $network = get_network(); - if ( isset( $network->site_name ) ) { - return $network->site_name; - } - } - - /* - * The blogname option is escaped with esc_html on the way into the database - * in sanitize_option we want to reverse this for the plain text arena of emails. - */ - - return wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); - } - - /** - * Get the message body of the password reset email - * - * @param \WP_User $user_data User data - * @param string $key Password reset key - * - * @return string - */ - private static function get_email_message( $user_data, $key ) { - $message = __( 'Someone has requested a password reset for the following account:', 'wp-graphql' ) . "\r\n\r\n"; - /* translators: %s: site name */ - $message .= sprintf( __( 'Site Name: %s', 'wp-graphql' ), self::get_site_name() ) . "\r\n\r\n"; - /* translators: %s: user login */ - $message .= sprintf( __( 'Username: %s', 'wp-graphql' ), $user_data->user_login ) . "\r\n\r\n"; - $message .= __( 'If this was a mistake, just ignore this email and nothing will happen.', 'wp-graphql' ) . "\r\n\r\n"; - $message .= __( 'To reset your password, visit the following address:', 'wp-graphql' ) . "\r\n\r\n"; - $message .= '<' . network_site_url( "wp-login.php?action=rp&key={$key}&login=" . rawurlencode( $user_data->user_login ), 'login' ) . ">\r\n"; - - /** - * Filters the message body of the password reset mail. - * - * If the filtered message is empty, the password reset email will not be sent. - * - * @param string $message Default mail message. - * @param string $key The activation key. - * @param string $user_login The username for the user. - * @param \WP_User $user_data WP_User object. - */ - return apply_filters( 'retrieve_password_message', $message, $key, $user_data->user_login, $user_data ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/TermObjectCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/TermObjectCreate.php deleted file mode 100644 index 04cf02b1..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/TermObjectCreate.php +++ /dev/null @@ -1,197 +0,0 @@ -graphql_single_name ); - - register_graphql_mutation( - $mutation_name, - [ - 'inputFields' => array_merge( - self::get_input_fields( $taxonomy ), - [ - 'name' => [ - 'type' => [ - 'non_null' => 'String', - ], - // translators: The placeholder is the name of the taxonomy for the object being mutated - 'description' => sprintf( __( 'The name of the %1$s object to mutate', 'wp-graphql' ), $taxonomy->name ), - ], - ] - ), - 'outputFields' => self::get_output_fields( $taxonomy ), - 'mutateAndGetPayload' => self::mutate_and_get_payload( $taxonomy, $mutation_name ), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. - * - * @return array - */ - public static function get_input_fields( WP_Taxonomy $taxonomy ) { - $fields = [ - 'aliasOf' => [ - 'type' => 'String', - // translators: The placeholder is the name of the taxonomy for the object being mutated - 'description' => sprintf( __( 'The slug that the %1$s will be an alias of', 'wp-graphql' ), $taxonomy->name ), - ], - 'description' => [ - 'type' => 'String', - // translators: The placeholder is the name of the taxonomy for the object being mutated - 'description' => sprintf( __( 'The description of the %1$s object', 'wp-graphql' ), $taxonomy->name ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => __( 'If this argument exists then the slug will be checked to see if it is not an existing valid term. If that check succeeds (it is not a valid term), then it is added and the term id is given. If it fails, then a check is made to whether the taxonomy is hierarchical and the parent argument is not empty. If the second check succeeds, the term will be inserted and the term id will be given. If the slug argument is empty, then it will be calculated from the term name.', 'wp-graphql' ), - ], - ]; - - /** - * Add a parentId field to hierarchical taxonomies to allow parents to be set - */ - if ( true === $taxonomy->hierarchical ) { - $fields['parentId'] = [ - 'type' => 'ID', - // translators: The placeholder is the name of the taxonomy for the object being mutated - 'description' => sprintf( __( 'The ID of the %1$s that should be set as the parent', 'wp-graphql' ), $taxonomy->name ), - ]; - } - - return $fields; - } - - /** - * Defines the mutation output field configuration. - * - * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. - * - * @return array - */ - public static function get_output_fields( WP_Taxonomy $taxonomy ) { - return [ - $taxonomy->graphql_single_name => [ - 'type' => $taxonomy->graphql_single_name, - // translators: Placeholder is the name of the taxonomy - 'description' => sprintf( __( 'The created %s', 'wp-graphql' ), $taxonomy->name ), - 'resolve' => static function ( $payload, $_args, AppContext $context ) { - $id = isset( $payload['termId'] ) ? absint( $payload['termId'] ) : null; - - return $context->get_loader( 'term' )->load_deferred( $id ); - }, - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. - * @param string $mutation_name The name of the mutation. - * - * @return callable - */ - public static function mutate_and_get_payload( WP_Taxonomy $taxonomy, string $mutation_name ) { - return static function ( $input, AppContext $context, ResolveInfo $info ) use ( $taxonomy, $mutation_name ) { - - /** - * Ensure the user can edit_terms - */ - if ( ! isset( $taxonomy->cap->edit_terms ) || ! current_user_can( $taxonomy->cap->edit_terms ) ) { - // translators: the $taxonomy->graphql_plural_name placeholder is the name of the object being mutated - throw new UserError( esc_html( sprintf( __( 'Sorry, you are not allowed to create %1$s', 'wp-graphql' ), $taxonomy->graphql_plural_name ) ) ); - } - - /** - * Prepare the object for insertion - */ - $args = TermObjectMutation::prepare_object( $input, $taxonomy, $mutation_name ); - - /** - * Ensure a name was provided - */ - if ( empty( $args['name'] ) ) { - // translators: The placeholder is the name of the taxonomy of the term being mutated - throw new UserError( esc_html( sprintf( __( 'A name is required to create a %1$s', 'wp-graphql' ), $taxonomy->name ) ) ); - } - - $term_name = wp_slash( $args['name'] ); - - if ( ! is_string( $term_name ) ) { - // translators: The placeholder is the name of the taxonomy of the term being mutated - throw new UserError( esc_html( sprintf( __( 'A valid name is required to create a %1$s', 'wp-graphql' ), $taxonomy->name ) ) ); - } - - /** - * Insert the term - */ - $term = wp_insert_term( $term_name, $taxonomy->name, wp_slash( (array) $args ) ); - - /** - * If it was an error, return the message as an exception - */ - if ( is_wp_error( $term ) ) { - $error_message = $term->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } else { - throw new UserError( esc_html__( 'The object failed to update but no error was provided', 'wp-graphql' ) ); - } - } - - /** - * If the response to creating the term didn't respond with a term_id, throw an exception - */ - if ( empty( $term['term_id'] ) ) { - throw new UserError( esc_html__( 'The object failed to create', 'wp-graphql' ) ); - } - - /** - * Fires after a single term is created or updated via a GraphQL mutation - * - * @param int $term_id Inserted term object - * @param \WP_Taxonomy $taxonomy The taxonomy of the term being updated - * @param array $args The args used to insert the term - * @param string $mutation_name The name of the mutation being performed - * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the resolve tree - */ - do_action( 'graphql_insert_term', $term['term_id'], $taxonomy, $args, $mutation_name, $context, $info ); - - /** - * Fires after a single term is created or updated via a GraphQL mutation - * - * The dynamic portion of the hook name, `$taxonomy->name` refers to the taxonomy of the term being mutated - * - * @param int $term_id Inserted term object - * @param array $args The args used to insert the term - * @param string $mutation_name The name of the mutation being performed - * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the resolve tree - */ - do_action( "graphql_insert_{$taxonomy->name}", $term['term_id'], $args, $mutation_name, $context, $info ); - - return [ - 'termId' => $term['term_id'], - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/TermObjectDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/TermObjectDelete.php deleted file mode 100644 index 9d512444..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/TermObjectDelete.php +++ /dev/null @@ -1,153 +0,0 @@ -graphql_single_name ); - - register_graphql_mutation( - $mutation_name, - [ - 'inputFields' => self::get_input_fields( $taxonomy ), - 'outputFields' => self::get_output_fields( $taxonomy ), - 'mutateAndGetPayload' => self::mutate_and_get_payload( $taxonomy, $mutation_name ), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. - * - * @return array - */ - public static function get_input_fields( WP_Taxonomy $taxonomy ) { - return [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - // translators: The placeholder is the name of the taxonomy for the term being deleted - 'description' => sprintf( __( 'The ID of the %1$s to delete', 'wp-graphql' ), $taxonomy->graphql_single_name ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. - * - * @return array - */ - public static function get_output_fields( WP_Taxonomy $taxonomy ) { - return [ - 'deletedId' => [ - 'type' => 'ID', - 'description' => __( 'The ID of the deleted object', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - $deleted = (object) $payload['termObject']; - - return ! empty( $deleted->term_id ) ? Relay::toGlobalId( 'term', $deleted->term_id ) : null; - }, - ], - $taxonomy->graphql_single_name => [ - 'type' => $taxonomy->graphql_single_name, - 'description' => __( 'The deleted term object', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - return new Term( $payload['termObject'] ); - }, - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. - * @param string $mutation_name The name of the mutation. - * - * @return callable - */ - public static function mutate_and_get_payload( WP_Taxonomy $taxonomy, string $mutation_name ) { - return static function ( $input ) use ( $taxonomy ) { - // Get the database ID for the comment. - $term_id = Utils::get_database_id_from_id( $input['id'] ); - - if ( empty( $term_id ) ) { - // Translators: The placeholder is the name of the taxonomy for the term being deleted - throw new UserError( esc_html( sprintf( __( 'The ID for the %1$s was not valid', 'wp-graphql' ), $taxonomy->graphql_single_name ) ) ); - } - - /** - * Get the term before deleting it - */ - $term_object = get_term( $term_id, $taxonomy->name ); - - if ( ! $term_object instanceof \WP_Term ) { - throw new UserError( esc_html__( 'The ID passed is invalid', 'wp-graphql' ) ); - } - - /** - * Ensure the type for the Global ID matches the type being mutated - */ - if ( $taxonomy->name !== $term_object->taxonomy ) { - // Translators: The placeholder is the name of the taxonomy for the term being edited - throw new UserError( esc_html( sprintf( __( 'The ID passed is not for a %1$s object', 'wp-graphql' ), $taxonomy->graphql_single_name ) ) ); - } - - /** - * Ensure the user can delete terms of this taxonomy - */ - if ( ! current_user_can( 'delete_term', $term_object->term_id ) ) { - // Translators: The placeholder is the name of the taxonomy for the term being deleted - throw new UserError( esc_html( sprintf( __( 'You do not have permission to delete %1$s', 'wp-graphql' ), $taxonomy->graphql_plural_name ) ) ); - } - - /** - * Delete the term and get the response - */ - $deleted = wp_delete_term( $term_id, $taxonomy->name ); - - /** - * If there was an error deleting the term, get the error message and return it - */ - if ( is_wp_error( $deleted ) ) { - $error_message = $deleted->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } else { - // Translators: The placeholder is the name of the taxonomy for the term being deleted - throw new UserError( esc_html( sprintf( __( 'The %1$s failed to delete but no error was provided', 'wp-graphql' ), $taxonomy->name ) ) ); - } - } - - /** - * Return the term object that was retrieved prior to deletion - */ - return [ - 'termObject' => $term_object, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/TermObjectUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/TermObjectUpdate.php deleted file mode 100644 index d292690d..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/TermObjectUpdate.php +++ /dev/null @@ -1,182 +0,0 @@ -graphql_single_name ); - register_graphql_mutation( - $mutation_name, - [ - 'inputFields' => self::get_input_fields( $taxonomy ), - 'outputFields' => self::get_output_fields( $taxonomy ), - 'mutateAndGetPayload' => self::mutate_and_get_payload( $taxonomy, $mutation_name ), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. - * - * @return array - */ - public static function get_input_fields( WP_Taxonomy $taxonomy ) { - return array_merge( - TermObjectCreate::get_input_fields( $taxonomy ), - [ - 'name' => [ - 'type' => 'String', - // Translators: The placeholder is the name of the taxonomy for the object being mutated - 'description' => sprintf( __( 'The name of the %1$s object to mutate', 'wp-graphql' ), $taxonomy->name ), - ], - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - // Translators: The placeholder is the taxonomy of the term being updated - 'description' => sprintf( __( 'The ID of the %1$s object to update', 'wp-graphql' ), $taxonomy->graphql_single_name ), - ], - ] - ); - } - - /** - * Defines the mutation output field configuration. - * - * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. - * - * @return array - */ - public static function get_output_fields( WP_Taxonomy $taxonomy ) { - return TermObjectCreate::get_output_fields( $taxonomy ); - } - - /** - * Defines the mutation data modification closure. - * - * @param \WP_Taxonomy $taxonomy The taxonomy type of the mutation. - * @param string $mutation_name The name of the mutation. - * - * @return callable - */ - public static function mutate_and_get_payload( WP_Taxonomy $taxonomy, $mutation_name ) { - return static function ( $input, AppContext $context, ResolveInfo $info ) use ( $taxonomy, $mutation_name ) { - $term_id = Utils::get_database_id_from_id( $input['id'] ); - - /** - * Ensure the type for the Global ID matches the type being mutated - */ - if ( empty( $term_id ) ) { - // Translators: The placeholder is the name of the taxonomy for the term being edited - throw new UserError( esc_html( sprintf( __( 'The ID passed is not for a %1$s object', 'wp-graphql' ), $taxonomy->graphql_single_name ) ) ); - } - - /** - * Get the existing term - */ - $existing_term = get_term( $term_id, $taxonomy->name ); - - /** - * If there was an error getting the existing term, return the error message - */ - if ( ! $existing_term instanceof \WP_Term ) { - if ( is_wp_error( $existing_term ) ) { - $error_message = $existing_term->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } else { - // Translators: The placeholder is the name of the taxonomy for the term being deleted - throw new UserError( esc_html( sprintf( __( 'The %1$s node failed to update', 'wp-graphql' ), $taxonomy->name ) ) ); - } - } - - // Translators: The placeholder is the name of the taxonomy for the term being deleted - throw new UserError( esc_html( sprintf( __( 'The %1$s node failed to update', 'wp-graphql' ), $taxonomy->name ) ) ); - } - - if ( $taxonomy->name !== $existing_term->taxonomy ) { - // translators: The first placeholder is an ID and the second placeholder is the name of the post type being edited - throw new UserError( esc_html( sprintf( __( 'The id %1$d is not of the type "%2$s"', 'wp-graphql' ), $term_id, $taxonomy->name ) ) ); - } - - /** - * Ensure the user has permission to edit terms - */ - if ( ! current_user_can( 'edit_term', $existing_term->term_id ) ) { - // Translators: The placeholder is the name of the taxonomy for the term being deleted - throw new UserError( esc_html( sprintf( __( 'You do not have permission to update %1$s', 'wp-graphql' ), $taxonomy->graphql_plural_name ) ) ); - } - - /** - * Prepare the $args for mutation - */ - $args = TermObjectMutation::prepare_object( $input, $taxonomy, $mutation_name ); - - if ( ! empty( $args ) ) { - - /** - * Update the term - */ - $update = wp_update_term( $existing_term->term_id, $taxonomy->name, wp_slash( (array) $args ) ); - - /** - * Respond with any errors - */ - if ( is_wp_error( $update ) ) { - // Translators: the placeholder is the name of the taxonomy - throw new UserError( esc_html( sprintf( __( 'The %1$s failed to update', 'wp-graphql' ), $taxonomy->name ) ) ); - } - } - - /** - * Fires an action when a term is updated via a GraphQL Mutation - * - * @param int $term_id The ID of the term object that was mutated - * @param \WP_Taxonomy $taxonomy The taxonomy of the term being updated - * @param array $args The args used to update the term - * @param string $mutation_name The name of the mutation being performed (create, update, delete, etc) - * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the resolve tree - */ - do_action( 'graphql_update_term', $existing_term->term_id, $taxonomy, $args, $mutation_name, $context, $info ); - - /** - * Fires an action when a term is updated via a GraphQL Mutation - * - * @param int $term_id The ID of the term object that was mutated - * @param array $args The args used to update the term - * @param string $mutation_name The name of the mutation being performed (create, update, delete, etc) - * @param \WPGraphQL\AppContext $context The AppContext passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the resolve tree - */ - do_action( "graphql_update_{$taxonomy->name}", $existing_term->term_id, $args, $mutation_name, $context, $info ); - - /** - * Return the payload - */ - return [ - 'termId' => $existing_term->term_id, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UpdateSettings.php b/lib/wp-graphql-1.17.0/src/Mutation/UpdateSettings.php deleted file mode 100644 index e821b766..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/UpdateSettings.php +++ /dev/null @@ -1,221 +0,0 @@ - $input_fields, - 'outputFields' => $output_fields, - 'mutateAndGetPayload' => static function ( $input ) use ( $type_registry ) { - return self::mutate_and_get_payload( $input, $type_registry ); - }, - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry - * - * @return array - */ - public static function get_input_fields( TypeRegistry $type_registry ) { - $allowed_settings = DataSource::get_allowed_settings( $type_registry ); - - $input_fields = []; - - if ( ! empty( $allowed_settings ) ) { - - /** - * Loop through the $allowed_settings and build fields - * for the individual settings - */ - foreach ( $allowed_settings as $key => $setting ) { - if ( ! isset( $setting['type'] ) || ! $type_registry->get_type( $setting['type'] ) ) { - continue; - } - - /** - * Determine if the individual setting already has a - * REST API name, if not use the option name. - * Sanitize the field name to be camelcase - */ - if ( ! empty( $setting['show_in_rest']['name'] ) ) { - $individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $setting['show_in_rest']['name'], '_' ) ) ); - } else { - $individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $key, '_' ) ) ); - } - - $replaced_setting_key = graphql_format_name( $individual_setting_key, ' ', '/[^a-zA-Z0-9 -]/' ); - - if ( ! empty( $replaced_setting_key ) ) { - $individual_setting_key = $replaced_setting_key; - } - - $individual_setting_key = lcfirst( $individual_setting_key ); - $individual_setting_key = lcfirst( str_replace( '_', ' ', ucwords( $individual_setting_key, '_' ) ) ); - $individual_setting_key = lcfirst( str_replace( '-', ' ', ucwords( $individual_setting_key, '_' ) ) ); - $individual_setting_key = lcfirst( str_replace( ' ', '', ucwords( $individual_setting_key, ' ' ) ) ); - - /** - * Dynamically build the individual setting, - * then add it to the $input_fields - */ - $input_fields[ $individual_setting_key ] = [ - 'type' => $setting['type'], - 'description' => $setting['description'], - ]; - } - } - - return $input_fields; - } - - /** - * Defines the mutation output field configuration. - * - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry - * - * @return array - */ - public static function get_output_fields( TypeRegistry $type_registry ) { - - /** - * Get the allowed setting groups and their fields - */ - $allowed_setting_groups = DataSource::get_allowed_settings_by_group( $type_registry ); - - $output_fields = []; - - /** - * Get all of the settings, regardless of group - */ - $output_fields['allSettings'] = [ - 'type' => 'Settings', - 'description' => __( 'Update all settings.', 'wp-graphql' ), - 'resolve' => static function () { - return true; - }, - ]; - - if ( ! empty( $allowed_setting_groups ) && is_array( $allowed_setting_groups ) ) { - foreach ( $allowed_setting_groups as $group => $setting_type ) { - $setting_type = DataSource::format_group_name( $group ); - $setting_type_name = Utils::format_type_name( $setting_type . 'Settings' ); - - $output_fields[ Utils::format_field_name( $setting_type_name ) ] = [ - 'type' => $setting_type_name, - // translators: %s is the setting type name - 'description' => sprintf( __( 'Update the %s setting.', 'wp-graphql' ), $setting_type_name ), - 'resolve' => static function () use ( $setting_type_name ) { - return $setting_type_name; - }, - ]; - } - } - return $output_fields; - } - - /** - * Defines the mutation data modification closure. - * - * @param array $input The mutation input - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry - * - * @return array - * - * @throws \GraphQL\Error\UserError - */ - public static function mutate_and_get_payload( array $input, TypeRegistry $type_registry ): array { - /** - * Check that the user can manage setting options - */ - if ( ! current_user_can( 'manage_options' ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to edit settings as this user.', 'wp-graphql' ) ); - } - - /** - * The $updatable_settings_options will store all of the allowed - * settings in a WP ready format - */ - $updatable_settings_options = []; - - $allowed_settings = DataSource::get_allowed_settings( $type_registry ); - - /** - * Loop through the $allowed_settings and build the insert options array - */ - foreach ( $allowed_settings as $key => $setting ) { - - /** - * Determine if the individual setting already has a - * REST API name, if not use the option name. - * Sanitize the field name to be camelcase - */ - if ( isset( $setting['show_in_rest']['name'] ) && ! empty( $setting['show_in_rest']['name'] ) ) { - $individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $setting['show_in_rest']['name'], '_' ) ) ); - } else { - $individual_setting_key = lcfirst( $setting['group'] . 'Settings' . str_replace( '_', '', ucwords( $key, '_' ) ) ); - } - - /** - * Dynamically build the individual setting, - * then add it to $updatable_settings_options - */ - $updatable_settings_options[ Utils::format_field_name( $individual_setting_key ) ] = [ - 'option' => $key, - 'group' => $setting['group'], - ]; - } - - foreach ( $input as $key => $value ) { - /** - * Throw an error if the input field is the site url, - * as we do not want users changing it and breaking all - * the things - */ - if ( 'generalSettingsUrl' === $key ) { - throw new UserError( esc_html__( 'Sorry, that is not allowed, speak with your site administrator to change the site URL.', 'wp-graphql' ) ); - } - - /** - * Check to see that the input field exists in settings, if so grab the option - * name and update the option - */ - if ( array_key_exists( $key, $updatable_settings_options ) ) { - update_option( $updatable_settings_options[ $key ]['option'], $value ); - } - } - - return $updatable_settings_options; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UserCreate.php b/lib/wp-graphql-1.17.0/src/Mutation/UserCreate.php deleted file mode 100644 index 9909d972..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/UserCreate.php +++ /dev/null @@ -1,187 +0,0 @@ - array_merge( - [ - 'username' => [ - 'type' => [ - 'non_null' => 'String', - ], - // translators: the placeholder is the name of the type of post object being updated - 'description' => __( 'A string that contains the user\'s username for logging in.', 'wp-graphql' ), - ], - ], - self::get_input_fields() - ), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return [ - 'password' => [ - 'type' => 'String', - 'description' => __( 'A string that contains the plain text password for the user.', 'wp-graphql' ), - ], - 'nicename' => [ - 'type' => 'String', - 'description' => __( 'A string that contains a URL-friendly name for the user. The default is the user\'s username.', 'wp-graphql' ), - ], - 'websiteUrl' => [ - 'type' => 'String', - 'description' => __( 'A string containing the user\'s URL for the user\'s web site.', 'wp-graphql' ), - ], - 'email' => [ - 'type' => 'String', - 'description' => __( 'A string containing the user\'s email address.', 'wp-graphql' ), - ], - 'displayName' => [ - 'type' => 'String', - 'description' => __( 'A string that will be shown on the site. Defaults to user\'s username. It is likely that you will want to change this, for both appearance and security through obscurity (that is if you dont use and delete the default admin user).', 'wp-graphql' ), - ], - 'nickname' => [ - 'type' => 'String', - 'description' => __( 'The user\'s nickname, defaults to the user\'s username.', 'wp-graphql' ), - ], - 'firstName' => [ - 'type' => 'String', - 'description' => __( ' The user\'s first name.', 'wp-graphql' ), - ], - 'lastName' => [ - 'type' => 'String', - 'description' => __( 'The user\'s last name.', 'wp-graphql' ), - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'A string containing content about the user.', 'wp-graphql' ), - ], - 'richEditing' => [ - 'type' => 'String', - 'description' => __( 'A string for whether to enable the rich editor or not. False if not empty.', 'wp-graphql' ), - ], - 'registered' => [ - 'type' => 'String', - 'description' => __( 'The date the user registered. Format is Y-m-d H:i:s.', 'wp-graphql' ), - ], - 'roles' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'An array of roles to be assigned to the user.', 'wp-graphql' ), - ], - 'jabber' => [ - 'type' => 'String', - 'description' => __( 'User\'s Jabber account.', 'wp-graphql' ), - ], - 'aim' => [ - 'type' => 'String', - 'description' => __( 'User\'s AOL IM account.', 'wp-graphql' ), - ], - 'yim' => [ - 'type' => 'String', - 'description' => __( 'User\'s Yahoo IM account.', 'wp-graphql' ), - ], - 'locale' => [ - 'type' => 'String', - 'description' => __( 'User\'s locale.', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return [ - 'user' => [ - 'type' => 'User', - 'description' => __( 'The User object mutation type.', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input, AppContext $context, ResolveInfo $info ) { - if ( ! current_user_can( 'create_users' ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to create a new user.', 'wp-graphql' ) ); - } - - /** - * Map all of the args from GQL to WP friendly - */ - $user_args = UserMutation::prepare_user_object( $input, 'createUser' ); - - /** - * Create the new user - */ - $user_id = wp_insert_user( $user_args ); - - /** - * Throw an exception if the post failed to create - */ - if ( is_wp_error( $user_id ) ) { - $error_message = $user_id->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } else { - throw new UserError( esc_html__( 'The object failed to create but no error was provided', 'wp-graphql' ) ); - } - } - - /** - * If the $post_id is empty, we should throw an exception - */ - if ( empty( $user_id ) ) { - throw new UserError( esc_html__( 'The object failed to create', 'wp-graphql' ) ); - } - - /** - * Update additional user data - */ - UserMutation::update_additional_user_object_data( $user_id, $input, 'createUser', $context, $info ); - - /** - * Return the new user ID - */ - return [ - 'id' => $user_id, - 'user' => $context->get_loader( 'user' )->load_deferred( $user_id ), - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UserDelete.php b/lib/wp-graphql-1.17.0/src/Mutation/UserDelete.php deleted file mode 100644 index 22cc929d..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/UserDelete.php +++ /dev/null @@ -1,168 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The ID of the user you want to delete', 'wp-graphql' ), - ], - 'reassignId' => [ - 'type' => 'ID', - 'description' => __( 'Reassign posts and links to new User ID.', 'wp-graphql' ), - ], - ]; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return [ - 'deletedId' => [ - 'type' => 'ID', - 'description' => __( 'The ID of the user that you just deleted', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - $deleted = (object) $payload['user']; - return ( ! empty( $deleted->ID ) ) ? Relay::toGlobalId( 'user', $deleted->ID ) : null; - }, - ], - 'user' => [ - 'type' => 'User', - 'description' => __( 'The deleted user object', 'wp-graphql' ), - 'resolve' => static function ( $payload ) { - return new User( $payload['user'] ); - }, - ], - ]; - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input ) { - // Get the user ID. - $user_id = Utils::get_database_id_from_id( $input['id'] ); - - if ( empty( $user_id ) ) { - throw new UserError( esc_html__( 'The user ID passed is invalid', 'wp-graphql' ) ); - } - - if ( ! current_user_can( 'delete_users', $user_id ) ) { - throw new UserError( esc_html__( 'Sorry, you are not allowed to delete users.', 'wp-graphql' ) ); - } - - /** - * Retrieve the user object before it's deleted - */ - $user_before_delete = get_user_by( 'id', $user_id ); - - /** - * Throw an error if the user we are trying to delete doesn't exist - */ - if ( false === $user_before_delete ) { - throw new UserError( esc_html__( 'Could not find an existing user to delete', 'wp-graphql' ) ); - } - - /** - * Get the user to reassign posts to. - */ - $reassign_id = 0; - if ( ! empty( $input['reassignId'] ) ) { - $reassign_id = Utils::get_database_id_from_id( $input['reassignId'] ); - - if ( empty( $reassign_id ) ) { - throw new UserError( esc_html__( 'The user ID passed to `reassignId` is invalid', 'wp-graphql' ) ); - } - /** - * Retrieve the user object before it's deleted - */ - $reassign_user = get_user_by( 'id', $reassign_id ); - - if ( false === $reassign_user ) { - throw new UserError( esc_html__( 'Could not find the existing user to reassign.', 'wp-graphql' ) ); - } - } - - if ( ! function_exists( 'wp_delete_user' ) ) { - require_once ABSPATH . 'wp-admin/includes/user.php'; - } - - if ( is_multisite() ) { - - /** - * If wpmu_delete_user() or remove_user_from_blog() doesn't exist yet, - * load the files in which each is defined. I think we need to - * load this manually here because WordPress only uses this - * function on the user edit screen normally. - */ - - // only include these files for multisite requests - if ( ! function_exists( 'wpmu_delete_user' ) ) { - require_once ABSPATH . 'wp-admin/includes/ms.php'; - } - if ( ! function_exists( 'remove_user_from_blog' ) ) { - require_once ABSPATH . 'wp-admin/includes/ms-functions.php'; - } - - $blog_id = get_current_blog_id(); - - // remove the user from the blog and reassign their posts - remove_user_from_blog( $user_id, $blog_id, $reassign_id ); - - // delete the user - $deleted_user = wpmu_delete_user( $user_id ); - } else { - $deleted_user = wp_delete_user( $user_id, $reassign_id ); - } - - if ( true !== $deleted_user ) { - throw new UserError( esc_html__( 'Could not delete the user.', 'wp-graphql' ) ); - } - - return [ - 'user' => $user_before_delete, - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UserRegister.php b/lib/wp-graphql-1.17.0/src/Mutation/UserRegister.php deleted file mode 100644 index d316f93d..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/UserRegister.php +++ /dev/null @@ -1,171 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - $input_fields = array_merge( - UserCreate::get_input_fields(), - [ - 'username' => [ - 'type' => [ - 'non_null' => 'String', - ], - // translators: the placeholder is the name of the type of object being updated - 'description' => __( 'A string that contains the user\'s username.', 'wp-graphql' ), - ], - 'email' => [ - 'type' => 'String', - 'description' => __( 'A string containing the user\'s email address.', 'wp-graphql' ), - ], - ] - ); - - /** - * Make sure we don't allow input for role or roles - */ - unset( $input_fields['role'], $input_fields['roles'] ); - - return $input_fields; - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return UserCreate::get_output_fields(); - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input, AppContext $context, ResolveInfo $info ) { - if ( ! get_option( 'users_can_register' ) ) { - throw new UserError( esc_html__( 'User registration is currently not allowed.', 'wp-graphql' ) ); - } - - if ( empty( $input['username'] ) ) { - throw new UserError( esc_html__( 'A username was not provided.', 'wp-graphql' ) ); - } - - if ( empty( $input['email'] ) ) { - throw new UserError( esc_html__( 'An email address was not provided.', 'wp-graphql' ) ); - } - - /** - * Map all of the args from GQL to WP friendly - */ - $user_args = UserMutation::prepare_user_object( $input, 'registerUser' ); - - /** - * Register the new user - */ - $user_id = register_new_user( $user_args['user_login'], $user_args['user_email'] ); - - /** - * Throw an exception if the user failed to register - */ - if ( is_wp_error( $user_id ) ) { - $error_message = $user_id->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } else { - throw new UserError( esc_html__( 'The user failed to register but no error was provided', 'wp-graphql' ) ); - } - } - - /** - * If the $user_id is empty, we should throw an exception - */ - if ( empty( $user_id ) ) { - throw new UserError( esc_html__( 'The user failed to create', 'wp-graphql' ) ); - } - - /** - * If the client isn't already authenticated, set the state in the current session to - * the user they just registered. This is mostly so that they can get a response from - * the mutation about the user they just registered after the user object passes - * through the user model. - */ - if ( ! is_user_logged_in() ) { - wp_set_current_user( $user_id ); - } - - /** - * Set the ID of the user to be used in the update - */ - $user_args['ID'] = absint( $user_id ); - - /** - * Make sure we don't accept any role input during registration - */ - unset( $user_args['role'] ); - - /** - * Prevent "Password Changed" emails from being sent. - */ - add_filter( 'send_password_change_email', [ self::class, 'return_false' ] ); - - /** - * Update the registered user with the additional input (firstName, lastName, etc) from the mutation - */ - wp_update_user( $user_args ); - - /** - * Remove filter preventing "Password Changed" emails. - */ - remove_filter( 'send_password_change_email', [ self::class, 'return_false' ] ); - - /** - * Update additional user data - */ - UserMutation::update_additional_user_object_data( $user_id, $input, 'registerUser', $context, $info ); - - /** - * Return the new user ID - */ - return [ - 'id' => $user_id, - 'user' => $context->get_loader( 'user' )->load_deferred( $user_id ), - ]; - }; - } - - /** - * @return bool False. - */ - public static function return_false(): bool { - return false; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Mutation/UserUpdate.php b/lib/wp-graphql-1.17.0/src/Mutation/UserUpdate.php deleted file mode 100644 index a0daba98..00000000 --- a/lib/wp-graphql-1.17.0/src/Mutation/UserUpdate.php +++ /dev/null @@ -1,129 +0,0 @@ - self::get_input_fields(), - 'outputFields' => self::get_output_fields(), - 'mutateAndGetPayload' => self::mutate_and_get_payload(), - ] - ); - } - - /** - * Defines the mutation input field configuration. - * - * @return array - */ - public static function get_input_fields() { - return array_merge( - [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - // translators: the placeholder is the name of the type of post object being updated - 'description' => __( 'The ID of the user', 'wp-graphql' ), - ], - ], - UserCreate::get_input_fields() - ); - } - - /** - * Defines the mutation output field configuration. - * - * @return array - */ - public static function get_output_fields() { - return UserCreate::get_output_fields(); - } - - /** - * Defines the mutation data modification closure. - * - * @return callable - */ - public static function mutate_and_get_payload() { - return static function ( $input, AppContext $context, ResolveInfo $info ) { - // Get the user ID. - $user_id = Utils::get_database_id_from_id( $input['id'] ); - - if ( empty( $user_id ) ) { - throw new UserError( esc_html__( 'The user ID passed is invalid', 'wp-graphql' ) ); - } - $existing_user = get_user_by( 'ID', $user_id ); - - /** - * If there's no existing user, throw an exception - */ - if ( false === $existing_user ) { - throw new UserError( esc_html__( 'A user could not be updated with the provided ID', 'wp-graphql' ) ); - } - - if ( ! current_user_can( 'edit_user', $existing_user->ID ) ) { - throw new UserError( esc_html__( 'You do not have the appropriate capabilities to perform this action', 'wp-graphql' ) ); - } - - if ( isset( $input['roles'] ) && ! current_user_can( 'edit_users' ) ) { - unset( $input['roles'] ); - throw new UserError( esc_html__( 'You do not have the appropriate capabilities to perform this action', 'wp-graphql' ) ); - } - - $user_args = UserMutation::prepare_user_object( $input, 'updateUser' ); - $user_args['ID'] = $user_id; - - /** - * Update the user - */ - $updated_user_id = wp_update_user( $user_args ); - - /** - * Throw an exception if the post failed to create - */ - if ( is_wp_error( $updated_user_id ) ) { - $error_message = $updated_user_id->get_error_message(); - if ( ! empty( $error_message ) ) { - throw new UserError( esc_html( $error_message ) ); - } else { - throw new UserError( esc_html__( 'The user failed to update but no error was provided', 'wp-graphql' ) ); - } - } - - /** - * If the $updated_user_id is empty, we should throw an exception - */ - if ( empty( $updated_user_id ) ) { - throw new UserError( esc_html__( 'The user failed to update', 'wp-graphql' ) ); - } - - /** - * Update additional user data - */ - UserMutation::update_additional_user_object_data( $updated_user_id, $input, 'updateUser', $context, $info ); - - /** - * Return the new user ID - */ - return [ - 'id' => $updated_user_id, - 'user' => $context->get_loader( 'user' )->load_deferred( $updated_user_id ), - ]; - }; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Registry/SchemaRegistry.php b/lib/wp-graphql-1.17.0/src/Registry/SchemaRegistry.php deleted file mode 100644 index 197a3068..00000000 --- a/lib/wp-graphql-1.17.0/src/Registry/SchemaRegistry.php +++ /dev/null @@ -1,59 +0,0 @@ -type_registry = \WPGraphQL::get_type_registry(); - } - - /** - * Returns the Schema to use for execution of the GraphQL Request - * - * @return \WPGraphQL\WPSchema - * @throws \Exception - */ - public function get_schema() { - $this->type_registry->init(); - - $schema_config = new SchemaConfig(); - $schema_config->query = $this->type_registry->get_type( 'RootQuery' ); - $schema_config->mutation = $this->type_registry->get_type( 'RootMutation' ); - $schema_config->typeLoader = function ( $type ) { - return $this->type_registry->get_type( $type ); - }; - $schema_config->types = $this->type_registry->get_types(); - - /** - * Create a new instance of the Schema - */ - $schema = new WPSchema( $schema_config, $this->type_registry ); - - /** - * Filter the Schema - * - * @param \WPGraphQL\WPSchema $schema The generated Schema - * @param \WPGraphQL\Registry\SchemaRegistry $registry The Schema Registry Instance - */ - return apply_filters( 'graphql_schema', $schema, $this ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Registry/TypeRegistry.php b/lib/wp-graphql-1.17.0/src/Registry/TypeRegistry.php deleted file mode 100644 index e8fef9c2..00000000 --- a/lib/wp-graphql-1.17.0/src/Registry/TypeRegistry.php +++ /dev/null @@ -1,1363 +0,0 @@ -types = []; - $this->type_loaders = []; - $this->eager_type_map = []; - } - - /** - * Formats the array key to a more friendly format - * - * @param string $key Name of the array key to format - * - * @return string - */ - protected function format_key( string $key ) { - return strtolower( $key ); - } - - /** - * Returns the eager type map, an array of Type definitions for Types that - * are not directly referenced in the schema. - * - * Types can add "eagerlyLoadType => true" when being registered to be included - * in the eager_type_map. - * - * @return array - */ - protected function get_eager_type_map() { - if ( ! empty( $this->eager_type_map ) ) { - return array_map( - function ( $type_name ) { - return $this->get_type( $type_name ); - }, - $this->eager_type_map - ); - } - - return []; - } - - /** - * Initialize the TypeRegistry - * - * @throws \Exception - * - * @return void - */ - public function init() { - $this->register_type( 'Bool', Type::boolean() ); - $this->register_type( 'Boolean', Type::boolean() ); - $this->register_type( 'Float', Type::float() ); - $this->register_type( 'Number', Type::float() ); - $this->register_type( 'Id', Type::id() ); - $this->register_type( 'Int', Type::int() ); - $this->register_type( 'Integer', Type::int() ); - $this->register_type( 'String', Type::string() ); - - /** - * When the Type Registry is initialized execute these files - */ - add_action( 'init_graphql_type_registry', [ $this, 'init_type_registry' ], 5, 1 ); - - /** - * Fire an action as the Type registry is being initiated - * - * @param \WPGraphQL\Registry\TypeRegistry $registry Instance of the TypeRegistry - */ - do_action( 'init_graphql_type_registry', $this ); - } - - /** - * Initialize the Type Registry - * - * @param \WPGraphQL\Registry\TypeRegistry $type_registry - * - * @return void - * @throws \Exception - */ - public function init_type_registry( self $type_registry ) { - - /** - * Fire an action as the type registry is initialized. This executes - * before the `graphql_register_types` action to allow for earlier hooking - * - * @param \WPGraphQL\Registry\TypeRegistry $registry Instance of the TypeRegistry - */ - do_action( 'graphql_register_initial_types', $type_registry ); - - // Register Interfaces. - Node::register_type(); - Commenter::register_type( $type_registry ); - Connection::register_type( $type_registry ); - ContentNode::register_type( $type_registry ); - ContentTemplate::register_type(); - DatabaseIdentifier::register_type(); - Edge::register_type( $type_registry ); - EnqueuedAsset::register_type( $type_registry ); - HierarchicalContentNode::register_type( $type_registry ); - HierarchicalNode::register_type( $type_registry ); - HierarchicalTermNode::register_type( $type_registry ); - MenuItemLinkable::register_type( $type_registry ); - NodeWithAuthor::register_type( $type_registry ); - NodeWithComments::register_type( $type_registry ); - NodeWithContentEditor::register_type( $type_registry ); - NodeWithExcerpt::register_type( $type_registry ); - NodeWithFeaturedImage::register_type( $type_registry ); - NodeWithRevisions::register_type( $type_registry ); - NodeWithTitle::register_type( $type_registry ); - NodeWithTemplate::register_type( $type_registry ); - NodeWithTrackbacks::register_type( $type_registry ); - NodeWithPageAttributes::register_type( $type_registry ); - PageInfo::register_type( $type_registry ); - Previewable::register_type( $type_registry ); - OneToOneConnection::register_type( $type_registry ); - TermNode::register_type( $type_registry ); - UniformResourceIdentifiable::register_type( $type_registry ); - - // register types - RootQuery::register_type(); - RootQuery::register_post_object_fields(); - RootQuery::register_term_object_fields(); - RootMutation::register_type(); - Avatar::register_type(); - Comment::register_type(); - CommentAuthor::register_type(); - ContentTemplate::register_content_template_types(); - EnqueuedStylesheet::register_type(); - EnqueuedScript::register_type(); - MediaDetails::register_type(); - MediaItemMeta::register_type(); - MediaSize::register_type(); - Menu::register_type(); - MenuItem::register_type(); - Plugin::register_type(); - ContentType::register_type(); - PostTypeLabelDetails::register_type(); - Settings::register_type( $this ); - Taxonomy::register_type(); - Theme::register_type(); - User::register_type(); - UserRole::register_type(); - - AvatarRatingEnum::register_type(); - CommentNodeIdTypeEnum::register_type(); - CommentsConnectionOrderbyEnum::register_type(); - CommentStatusEnum::register_type(); - ContentNodeIdTypeEnum::register_type(); - ContentTypeEnum::register_type(); - ContentTypeIdTypeEnum::register_type(); - MediaItemSizeEnum::register_type(); - MediaItemStatusEnum::register_type(); - MenuLocationEnum::register_type(); - MenuItemNodeIdTypeEnum::register_type(); - MenuNodeIdTypeEnum::register_type(); - MimeTypeEnum::register_type(); - OrderEnum::register_type(); - PluginStatusEnum::register_type(); - PostObjectFieldFormatEnum::register_type(); - PostObjectsConnectionDateColumnEnum::register_type(); - PostObjectsConnectionOrderbyEnum::register_type(); - PostStatusEnum::register_type(); - RelationEnum::register_type(); - TaxonomyEnum::register_type(); - TaxonomyIdTypeEnum::register_type(); - TermNodeIdTypeEnum::register_type(); - TermObjectsConnectionOrderbyEnum::register_type(); - TimezoneEnum::register_type(); - UserNodeIdTypeEnum::register_type(); - UserRoleEnum::register_type(); - UsersConnectionOrderbyEnum::register_type(); - UsersConnectionSearchColumnEnum::register_type(); - - DateInput::register_type(); - DateQueryInput::register_type(); - PostObjectsConnectionOrderbyInput::register_type(); - UsersConnectionOrderbyInput::register_type(); - - MenuItemObjectUnion::register_type( $this ); - PostObjectUnion::register_type( $this ); - TermObjectUnion::register_type( $this ); - - /** - * Register core connections - */ - Comments::register_connections(); - MenuItems::register_connections(); - PostObjects::register_connections(); - Taxonomies::register_connections(); - TermObjects::register_connections(); - Users::register_connections(); - - /** - * Register core mutations - */ - CommentCreate::register_mutation(); - CommentDelete::register_mutation(); - CommentRestore::register_mutation(); - CommentUpdate::register_mutation(); - MediaItemCreate::register_mutation(); - MediaItemDelete::register_mutation(); - MediaItemUpdate::register_mutation(); - ResetUserPassword::register_mutation(); - SendPasswordResetEmail::register_mutation(); - UserCreate::register_mutation(); - UserDelete::register_mutation(); - UserUpdate::register_mutation(); - UserRegister::register_mutation(); - UpdateSettings::register_mutation( $this ); - - /** - * Register PostObject types based on post_types configured to show_in_graphql - * - * @var \WP_Post_Type[] $allowed_post_types - */ - $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects' ); - - /** @var \WP_Taxonomy[] $allowed_taxonomies */ - $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); - - foreach ( $allowed_post_types as $post_type_object ) { - PostObject::register_types( $post_type_object ); - - /** - * Mutations for attachments are handled differently - * because they require different inputs - */ - if ( 'attachment' !== $post_type_object->name ) { - - /** - * Revisions are created behind the scenes as a side effect of post updates, - * they aren't created manually. - */ - if ( 'revision' !== $post_type_object->name ) { - if ( empty( $post_type_object->graphql_exclude_mutations ) || ! in_array( 'create', $post_type_object->graphql_exclude_mutations, true ) ) { - PostObjectCreate::register_mutation( $post_type_object ); - } - - if ( empty( $post_type_object->graphql_exclude_mutations ) || ! in_array( 'update', $post_type_object->graphql_exclude_mutations, true ) ) { - PostObjectUpdate::register_mutation( $post_type_object ); - } - } - - if ( empty( $post_type_object->graphql_exclude_mutations ) || ! in_array( 'delete', $post_type_object->graphql_exclude_mutations, true ) ) { - PostObjectDelete::register_mutation( $post_type_object ); - } - } - - foreach ( $allowed_taxonomies as $tax_object ) { - // If the taxonomy is in the array of taxonomies registered to the post_type - if ( in_array( $tax_object->name, get_object_taxonomies( $post_type_object->name ), true ) ) { - register_graphql_input_type( - $post_type_object->graphql_single_name . ucfirst( $tax_object->graphql_plural_name ) . 'NodeInput', - [ - 'description' => sprintf( - // translators: %1$s is the GraphQL plural name of the taxonomy, %2$s is the GraphQL singular name of the post type. - __( 'List of %1$s to connect the %2$s to. If an ID is set, it will be used to create the connection. If not, it will look for a slug. If neither are valid existing terms, and the site is configured to allow terms to be created during post mutations, a term will be created using the Name if it exists in the input, then fallback to the slug if it exists.', 'wp-graphql' ), - $tax_object->graphql_plural_name, - $post_type_object->graphql_single_name - ), - 'fields' => [ - 'id' => [ - 'type' => 'Id', - 'description' => sprintf( - // translators: %1$s is the GraphQL name of the taxonomy, %2$s is the GraphQL name of the post type. - __( 'The ID of the %1$s. If present, this will be used to connect to the %2$s. If no existing %1$s exists with this ID, no connection will be made.', 'wp-graphql' ), - $tax_object->graphql_single_name, - $post_type_object->graphql_single_name - ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => sprintf( - // translators: %1$s is the GraphQL name of the taxonomy. - __( 'The slug of the %1$s. If no ID is present, this field will be used to make a connection. If no existing term exists with this slug, this field will be used as a fallback to the Name field when creating a new term to connect to, if term creation is enabled as a nested mutation.', 'wp-graphql' ), - $tax_object->graphql_single_name - ), - ], - 'description' => [ - 'type' => 'String', - 'description' => sprintf( - // translators: %1$s is the GraphQL name of the taxonomy. - __( 'The description of the %1$s. This field is used to set a description of the %1$s if a new one is created during the mutation.', 'wp-graphql' ), - $tax_object->graphql_single_name - ), - ], - 'name' => [ - 'type' => 'String', - 'description' => sprintf( - // translators: %1$s is the GraphQL name of the taxonomy. - __( 'The name of the %1$s. This field is used to create a new term, if term creation is enabled in nested mutations, and if one does not already exist with the provided slug or ID or if a slug or ID is not provided. If no name is included and a term is created, the creation will fallback to the slug field.', 'wp-graphql' ), - $tax_object->graphql_single_name - ), - ], - ], - ] - ); - - register_graphql_input_type( - ucfirst( $post_type_object->graphql_single_name ) . ucfirst( $tax_object->graphql_plural_name ) . 'Input', - [ - 'description' => sprintf( - // translators: %1$s is the GraphQL name of the post type, %2$s is the plural GraphQL name of the taxonomy. - __( 'Set relationships between the %1$s to %2$s', 'wp-graphql' ), - $post_type_object->graphql_single_name, - $tax_object->graphql_plural_name - ), - 'fields' => [ - 'append' => [ - 'type' => 'Boolean', - 'description' => sprintf( - // translators: %1$s is the GraphQL name of the taxonomy, %2$s is the plural GraphQL name of the taxonomy. - __( 'If true, this will append the %1$s to existing related %2$s. If false, this will replace existing relationships. Default true.', 'wp-graphql' ), - $tax_object->graphql_single_name, - $tax_object->graphql_plural_name - ), - ], - 'nodes' => [ - 'type' => [ - 'list_of' => $post_type_object->graphql_single_name . ucfirst( $tax_object->graphql_plural_name ) . 'NodeInput', - ], - 'description' => __( 'The input list of items to set.', 'wp-graphql' ), - ], - ], - ] - ); - } - } - } - - /** - * Register TermObject types based on taxonomies configured to show_in_graphql - */ - foreach ( $allowed_taxonomies as $tax_object ) { - TermObject::register_types( $tax_object ); - - if ( empty( $tax_object->graphql_exclude_mutations ) || ! in_array( 'create', $tax_object->graphql_exclude_mutations, true ) ) { - TermObjectCreate::register_mutation( $tax_object ); - } - - if ( empty( $tax_object->graphql_exclude_mutations ) || ! in_array( 'update', $tax_object->graphql_exclude_mutations, true ) ) { - TermObjectUpdate::register_mutation( $tax_object ); - } - - if ( empty( $tax_object->graphql_exclude_mutations ) || ! in_array( 'delete', $tax_object->graphql_exclude_mutations, true ) ) { - TermObjectDelete::register_mutation( $tax_object ); - } - } - - /** - * Create the root query fields for any setting type in - * the $allowed_setting_types array. - */ - $allowed_setting_types = DataSource::get_allowed_settings_by_group( $this ); - - /** - * The url is not a registered setting for multisite, so this is a polyfill - * to expose the URL to the Schema for multisite sites - */ - if ( is_multisite() ) { - $this->register_field( - 'GeneralSettings', - 'url', - [ - 'type' => 'String', - 'description' => __( 'Site URL.', 'wp-graphql' ), - 'resolve' => static function () { - return get_site_url(); - }, - ] - ); - } - - if ( ! empty( $allowed_setting_types ) && is_array( $allowed_setting_types ) ) { - foreach ( $allowed_setting_types as $group_name => $setting_type ) { - $group_name = DataSource::format_group_name( $group_name ); - $type_name = SettingGroup::register_settings_group( $group_name, $group_name, $this ); - - if ( ! $type_name ) { - continue; - } - - register_graphql_field( - 'RootQuery', - Utils::format_field_name( $type_name ), - [ - 'type' => $type_name, - 'description' => sprintf( - // translators: %s is the GraphQL name of the settings group. - __( "Fields of the '%s' settings group", 'wp-graphql' ), - ucfirst( $group_name ) . 'Settings' - ), - 'resolve' => static function () use ( $setting_type ) { - return $setting_type; - }, - ] - ); - } - } - - /** - * Fire an action as the type registry is initialized. This executes - * before the `graphql_register_types` action to allow for earlier hooking - * - * @param \WPGraphQL\Registry\TypeRegistry $registry Instance of the TypeRegistry - */ - do_action( 'graphql_register_types', $type_registry ); - - /** - * Fire an action as the type registry is initialized. This executes - * during the `graphql_register_types` action to allow for earlier hooking - * - * @param \WPGraphQL\Registry\TypeRegistry $registry Instance of the TypeRegistry - */ - do_action( 'graphql_register_types_late', $type_registry ); - } - - /** - * Given a config for a custom Scalar, this adds the Scalar for use in the Schema. - * - * @param string $type_name The name of the Type to register - * @param array $config The config for the scalar type to register - * - * @throws \Exception - * - * @return void - */ - public function register_scalar( string $type_name, array $config ) { - $config['kind'] = 'scalar'; - $this->register_type( $type_name, $config ); - } - - /** - * Registers connections that were passed through the Type registration config - * - * @param array $config Type config - * - * @return void - * - * @throws \Exception - */ - protected function register_connections_from_config( array $config ) { - $connections = $config['connections'] ?? null; - - if ( ! is_array( $connections ) ) { - return; - } - - foreach ( $connections as $field_name => $connection_config ) { - if ( ! is_array( $connection_config ) ) { - continue; - } - - $connection_config['fromType'] = $config['name']; - $connection_config['fromFieldName'] = $field_name; - register_graphql_connection( $connection_config ); - } - } - - /** - * Add a Type to the Registry - * - * @param string $type_name The name of the type to register - * @param mixed|array|\GraphQL\Type\Definition\Type $config The config for the type - * - * @throws \Exception - * - * @return void - */ - public function register_type( string $type_name, $config ): void { - /** - * If the type should be excluded from the schema, skip it. - */ - if ( in_array( strtolower( $type_name ), $this->get_excluded_types(), true ) ) { - return; - } - /** - * If the Type Name starts with a number, skip it. - */ - if ( ! is_valid_graphql_name( $type_name ) ) { - graphql_debug( - sprintf( - // translators: %s is the name of the type. - __( 'The Type name \'%1$s\' is invalid and has not been added to the GraphQL Schema.', 'wp-graphql' ), - $type_name - ), - [ - 'type' => 'INVALID_TYPE_NAME', - 'type_name' => $type_name, - ] - ); - return; - } - - /** - * If the Type Name is already registered, skip it. - */ - if ( isset( $this->types[ $this->format_key( $type_name ) ] ) || isset( $this->type_loaders[ $this->format_key( $type_name ) ] ) ) { - graphql_debug( - sprintf( - // translators: %s is the name of the type. - __( 'You cannot register duplicate Types to the Schema. The Type \'%1$s\' already exists in the Schema. Make sure to give new Types a unique name.', 'wp-graphql' ), - $type_name - ), - [ - 'type' => 'DUPLICATE_TYPE', - 'type_name' => $type_name, - ] - ); - return; - } - - /** - * Register any connections that were passed through the Type config - */ - if ( is_array( $config ) && isset( $config['connections'] ) ) { - $config['name'] = ucfirst( $type_name ); - $this->register_connections_from_config( $config ); - } - - $this->type_loaders[ $this->format_key( $type_name ) ] = function () use ( $type_name, $config ) { - return $this->prepare_type( $type_name, $config ); - }; - - if ( is_array( $config ) && isset( $config['eagerlyLoadType'] ) && true === $config['eagerlyLoadType'] && ! isset( $this->eager_type_map[ $this->format_key( $type_name ) ] ) ) { - $this->eager_type_map[ $this->format_key( $type_name ) ] = $this->format_key( $type_name ); - } - } - - /** - * Add an Object Type to the Registry - * - * @param string $type_name The name of the type to register - * @param array $config The configuration of the type - * - * @throws \Exception - * @return void - */ - public function register_object_type( string $type_name, array $config ): void { - $config['kind'] = 'object'; - $this->register_type( $type_name, $config ); - } - - /** - * Add an Interface Type to the registry - * - * @param string $type_name The name of the type to register - * @param mixed|array|\GraphQL\Type\Definition\Type $config The configuration of the type - * - * @throws \Exception - * @return void - */ - public function register_interface_type( string $type_name, $config ): void { - $config['kind'] = 'interface'; - $this->register_type( $type_name, $config ); - } - - /** - * Add an Enum Type to the registry - * - * @param string $type_name The name of the type to register - * @param array $config he configuration of the type - * - * @return void - * @throws \Exception - */ - public function register_enum_type( string $type_name, array $config ): void { - $config['kind'] = 'enum'; - $this->register_type( $type_name, $config ); - } - - /** - * Add an Input Type to the Registry - * - * @param string $type_name The name of the type to register - * @param array $config he configuration of the type - * - * @return void - * @throws \Exception - */ - public function register_input_type( string $type_name, array $config ): void { - $config['kind'] = 'input'; - $this->register_type( $type_name, $config ); - } - - /** - * Add a Union Type to the Registry - * - * @param string $type_name The name of the type to register - * @param array $config he configuration of the type - * - * @return void - * - * @throws \Exception - */ - public function register_union_type( string $type_name, array $config ): void { - $config['kind'] = 'union'; - $this->register_type( $type_name, $config ); - } - - /** - * @param string $type_name The name of the type to register - * @param mixed|array|\GraphQL\Type\Definition\Type $config he configuration of the type - * - * @return mixed|array|\GraphQL\Type\Definition\Type|null - * @throws \Exception - */ - public function prepare_type( string $type_name, $config ) { - /** - * Uncomment to help trace eagerly (not lazy) loaded types. - * - * Use: graphql_debug( "prepare_type: {$type_name}", [ 'type' => $type_name ] );. - */ - - if ( ! is_array( $config ) ) { - return $config; - } - - $prepared_type = null; - - if ( ! empty( $config ) ) { - $kind = isset( $config['kind'] ) ? $config['kind'] : null; - $config['name'] = ucfirst( $type_name ); - - switch ( $kind ) { - case 'enum': - $prepared_type = new WPEnumType( $config ); - break; - case 'input': - $prepared_type = new WPInputObjectType( $config, $this ); - break; - case 'scalar': - $prepared_type = new WPScalar( $config, $this ); - break; - case 'union': - $prepared_type = new WPUnionType( $config, $this ); - break; - case 'interface': - $prepared_type = new WPInterfaceType( $config, $this ); - break; - case 'object': - default: - $prepared_type = new WPObjectType( $config, $this ); - } - } - - return $prepared_type; - } - - /** - * Given a type name, returns the type or null if not found - * - * @param string $type_name The name of the Type to get from the registry - * - * @return mixed - * |null - */ - public function get_type( string $type_name ) { - $key = $this->format_key( $type_name ); - - if ( isset( $this->type_loaders[ $key ] ) ) { - $type = $this->type_loaders[ $key ](); - $this->types[ $key ] = apply_filters( 'graphql_get_type', $type, $type_name ); - unset( $this->type_loaders[ $key ] ); - } - - return $this->types[ $key ] ?? null; - } - - /** - * Given a type name, determines if the type is already present in the Type Loader - * - * @param string $type_name The name of the type to check the registry for - * - * @return bool - */ - public function has_type( string $type_name ): bool { - return isset( $this->type_loaders[ $this->format_key( $type_name ) ] ); - } - - /** - * Return the Types in the registry - * - * @return array - */ - public function get_types(): array { - - // The full map of types is merged with eager types to support the - // rename_graphql_type API. - // - // All of the types are closures, but eager Types are the full - // Type definitions up front - return array_merge( $this->types, $this->get_eager_type_map() ); - } - - /** - * Wrapper for prepare_field to prepare multiple fields for registration at once - * - * @param array $fields Array of fields and their settings to register on a Type - * @param string $type_name Name of the Type to register the fields to - * - * @return array - * @throws \Exception - */ - public function prepare_fields( array $fields, string $type_name ): array { - $prepared_fields = []; - if ( ! empty( $fields ) && is_array( $fields ) ) { - foreach ( $fields as $field_name => $field_config ) { - if ( is_array( $field_config ) && isset( $field_config['type'] ) ) { - $prepared_field = $this->prepare_field( $field_name, $field_config, $type_name ); - if ( ! empty( $prepared_field ) ) { - $prepared_fields[ $this->format_key( $field_name ) ] = $prepared_field; - } - } - } - } - - return $prepared_fields; - } - - /** - * Prepare the field to be registered on the type - * - * @param string $field_name Friendly name of the field - * @param array $field_config Config data about the field to prepare - * @param string $type_name Name of the type to prepare the field for - * - * @return array|null - * @throws \Exception - */ - protected function prepare_field( string $field_name, array $field_config, string $type_name ): ?array { - if ( ! isset( $field_config['name'] ) ) { - $field_config['name'] = lcfirst( $field_name ); - } - - if ( ! isset( $field_config['type'] ) ) { - graphql_debug( - sprintf( - /* translators: %s is the Field name. */ - __( 'The registered field \'%s\' does not have a Type defined. Make sure to define a type for all fields.', 'wp-graphql' ), - $field_name - ), - [ - 'type' => 'INVALID_FIELD_TYPE', - 'type_name' => $type_name, - 'field_name' => $field_name, - ] - ); - return null; - } - - /** - * If the type is a string, create a callable wrapper to get the type from - * type registry. This preserves lazy-loading and prevents a bug where a type - * has the same name as a function in the global scope (e.g., `header()`) and - * is called since it passes `is_callable`. - */ - if ( is_string( $field_config['type'] ) ) { - // Bail if the type is excluded from the Schema. - if ( in_array( strtolower( $field_config['type'] ), $this->get_excluded_types(), true ) ) { - return null; - } - - $field_config['type'] = function () use ( $field_config ) { - return $this->get_type( $field_config['type'] ); - }; - } - - /** - * If the type is an array, it contains type modifiers (e.g., "non_null"). - * Create a callable wrapper to preserve lazy-loading. - */ - if ( is_array( $field_config['type'] ) ) { - // Bail if the type is excluded from the Schema. - $unmodified_type_name = $this->get_unmodified_type_name( $field_config['type'] ); - - if ( empty( $unmodified_type_name ) || in_array( strtolower( $unmodified_type_name ), $this->get_excluded_types(), true ) ) { - return null; - } - - $field_config['type'] = function () use ( $field_config ) { - return $this->setup_type_modifiers( $field_config['type'] ); - }; - } - - /** - * If the field has arguments, each one must be prepared. - */ - if ( isset( $field_config['args'] ) && is_array( $field_config['args'] ) ) { - foreach ( $field_config['args'] as $arg_name => $arg_config ) { - $arg = $this->prepare_field( $arg_name, $arg_config, $type_name ); - - // Remove the arg if the field could not be prepared. - if ( empty( $arg ) ) { - unset( $field_config['args'][ $arg_name ] ); - continue; - } - - $field_config['args'][ $arg_name ] = $arg; - } - } - - /** - * If the field has no (remaining) valid arguments, unset the key. - */ - if ( empty( $field_config['args'] ) ) { - unset( $field_config['args'] ); - } - - return $field_config; - } - - /** - * Processes type modifiers (e.g., "non-null"). Loads types immediately, so do - * not call before types are ready to be loaded. - * - * @param mixed|string|array $type The type definition - * - * @return mixed - * @throws \Exception - */ - public function setup_type_modifiers( $type ) { - if ( ! is_array( $type ) ) { - return $type; - } - - if ( isset( $type['non_null'] ) ) { - return $this->non_null( - $this->setup_type_modifiers( $type['non_null'] ) - ); - } - - if ( isset( $type['list_of'] ) ) { - return $this->list_of( - $this->setup_type_modifiers( $type['list_of'] ) - ); - } - - return $type; - } - - /** - * Wrapper for the register_field method to register multiple fields at once - * - * @param string $type_name Name of the type in the Type Registry to add the fields to - * @param array $fields Fields to register - * - * @return void - * @throws \Exception - */ - public function register_fields( string $type_name, array $fields = [] ): void { - if ( ! empty( $fields ) ) { - foreach ( $fields as $field_name => $config ) { - if ( is_string( $field_name ) && ! empty( $config ) && is_array( $config ) ) { - $this->register_field( $type_name, $field_name, $config ); - } - } - } - } - - /** - * Add a field to a Type in the Type Registry - * - * @param string $type_name Name of the type in the Type Registry to add - * the fields to - * @param string $field_name Name of the field to add to the type - * @param array $config Info about the field to register to the type - * - * @return void - * @throws \Exception - */ - public function register_field( string $type_name, string $field_name, array $config ): void { - add_filter( - 'graphql_' . $type_name . '_fields', - function ( $fields ) use ( $type_name, $field_name, $config ) { - - // Whether the field should be allowed to have underscores in the field name - $allow_field_underscores = isset( $config['allowFieldUnderscores'] ) && true === $config['allowFieldUnderscores']; - - $field_name = Utils::format_field_name( $field_name, $allow_field_underscores ); - - if ( preg_match( '/^\d/', $field_name ) ) { - graphql_debug( - sprintf( - // translators: %1$s is the field name, %2$s is the type name. - __( 'The field \'%1$s\' on Type \'%2$s\' is invalid. Field names cannot start with a number.', 'wp-graphql' ), - $field_name, - $type_name - ), - [ - 'type' => 'INVALID_FIELD_NAME', - 'field_name' => $field_name, - 'type_name' => $type_name, - ] - ); - return $fields; - } - - if ( isset( $fields[ $field_name ] ) ) { - graphql_debug( - sprintf( - // translators: %1$s is the field name, %2$s is the type name. - __( 'You cannot register duplicate fields on the same Type. The field \'%1$s\' already exists on the type \'%2$s\'. Make sure to give the field a unique name.', 'wp-graphql' ), - $field_name, - $type_name - ), - [ - 'type' => 'DUPLICATE_FIELD', - 'field_name' => $field_name, - 'type_name' => $type_name, - ] - ); - return $fields; - } - - /** - * If the field returns a properly prepared field, add it the the field registry - */ - $field = $this->prepare_field( $field_name, $config, $type_name ); - - if ( ! empty( $field ) ) { - $fields[ $field_name ] = $field; - } - - return $fields; - }, - 10, - 1 - ); - } - - /** - * Remove a field from a type - * - * @param string $type_name Name of the Type the field is registered to - * @param string $field_name Name of the field you would like to remove from the type - * - * @return void - */ - public function deregister_field( string $type_name, string $field_name ) { - add_filter( - 'graphql_' . $type_name . '_fields', - static function ( $fields ) use ( $field_name ) { - if ( isset( $fields[ $field_name ] ) ) { - unset( $fields[ $field_name ] ); - } - - return $fields; - } - ); - } - - /** - * Method to register a new connection in the Type registry - * - * @param array $config The info about the connection being registered - * - * @return void - * @throws \InvalidArgumentException - * @throws \Exception - */ - public function register_connection( array $config ): void { - new WPConnectionType( $config, $this ); - } - - /** - * Handles registration of a mutation to the Type registry - * - * @param string $mutation_name Name of the mutation being registered - * @param array $config Info about the mutation being registered - * - * @return void - * @throws \Exception - */ - public function register_mutation( string $mutation_name, array $config ): void { - // Bail if the mutation has been excluded from the schema. - if ( in_array( strtolower( $mutation_name ), $this->get_excluded_mutations(), true ) ) { - return; - } - - $config['name'] = $mutation_name; - new WPMutationType( $config, $this ); - } - - /** - * Removes a GraphQL mutation from the schema. - * - * This works by preventing the mutation from being registered in the first place. - * - * @uses 'graphql_excluded_mutations' filter. - * - * @param string $mutation_name Name of the mutation to remove from the schema. - * - * @since 1.14.0 - */ - public function deregister_mutation( string $mutation_name ): void { - // Prevent the mutation from being registered to the scheme directly. - add_filter( - 'graphql_excluded_mutations', - static function ( $excluded_mutations ) use ( $mutation_name ): array { - // Normalize the types to prevent case sensitivity issues. - $mutation_name = strtolower( $mutation_name ); - // If the type isn't already excluded, add it to the array. - if ( ! in_array( $mutation_name, $excluded_mutations, true ) ) { - $excluded_mutations[] = $mutation_name; - } - - return $excluded_mutations; - }, - 10 - ); - } - - /** - * Removes a GraphQL connection from the schema. - * - * This works by preventing the connection from being registered in the first place. - * - * @uses 'graphql_excluded_connections' filter. - * - * @param string $connection_name The GraphQL connection name. - */ - public function deregister_connection( string $connection_name ): void { - add_filter( - 'graphql_excluded_connections', - static function ( $excluded_connections ) use ( $connection_name ) { - $connection_name = strtolower( $connection_name ); - - if ( ! in_array( $connection_name, $excluded_connections, true ) ) { - $excluded_connections[] = $connection_name; - } - - return $excluded_connections; - } - ); - } - - /** - * Given a Type, this returns an instance of a NonNull of that type - * - * @param mixed $type The Type being wrapped - * - * @return \GraphQL\Type\Definition\NonNull - */ - public function non_null( $type ) { - if ( is_string( $type ) ) { - $type_def = $this->get_type( $type ); - - return Type::nonNull( $type_def ); - } - - return Type::nonNull( $type ); - } - - /** - * Given a Type, this returns an instance of a listOf of that type - * - * @param mixed $type The Type being wrapped - * - * @return \GraphQL\Type\Definition\ListOfType - */ - public function list_of( $type ) { - if ( is_string( $type ) ) { - $type_def = $this->get_type( $type ); - - if ( is_null( $type_def ) ) { - return Type::listOf( Type::string() ); - } - - return Type::listOf( $type_def ); - } - - return Type::listOf( $type ); - } - - /** - * Get the list of GraphQL type names to exclude from the schema. - * - * Type names are normalized using `strtolower()`, to avoid case sensitivity issues. - * - * @since 1.13.0 - */ - public function get_excluded_types(): array { - if ( null === $this->excluded_types ) { - /** - * Filter the list of GraphQL types to exclude from the schema. - * - * Note: using this filter directly will NOT remove the type from being referenced as a possible interface or a union type. - * To remove a GraphQL from the schema **entirely**, please use deregister_graphql_type(); - * - * @param string[] $excluded_types The names of the GraphQL Types to exclude. - * - * @since 1.13.0 - */ - $excluded_types = apply_filters( 'graphql_excluded_types', [] ); - - // Normalize the types to be lowercase, to avoid case-sensitivity issue when comparing. - $this->excluded_types = ! empty( $excluded_types ) ? array_map( 'strtolower', $excluded_types ) : []; - } - - return $this->excluded_types; - } - - /** - * Get the list of GraphQL connections to exclude from the schema. - * - * Type names are normalized using `strtolower()`, to avoid case sensitivity issues. - * - * @since 1.14.0 - */ - public function get_excluded_connections(): array { - if ( null === $this->excluded_connections ) { - /** - * Filter the list of GraphQL connections to excluded from the registry. - * - * @param string[] $excluded_connections The names of the GraphQL connections to exclude. - * - * @since 1.14.0 - */ - $excluded_connections = apply_filters( 'graphql_excluded_connections', [] ); - - // Normalize the types to be lowercase, to avoid case-sensitivity issue when comparing. - $this->excluded_connections = ! empty( $excluded_connections ) ? array_map( 'strtolower', $excluded_connections ) : []; - } - - return $this->excluded_connections; - } - - /** - * Get the list of GraphQL mutation names to exclude from the schema. - * - * Mutation names are normalized using `strtolower()`, to avoid case sensitivity issues. - * - * @since 1.14.0 - */ - public function get_excluded_mutations(): array { - if ( null === $this->excluded_mutations ) { - /** - * Filter the list of GraphQL mutations to excluded from the registry. - * - * @param string[] $excluded_mutations The names of the GraphQL mutations to exclude. - * - * @since 1.14.0 - */ - $excluded_mutations = apply_filters( 'graphql_excluded_mutations', [] ); - - // Normalize the types to be lowercase, to avoid case-sensitivity issue when comparing. - $this->excluded_mutations = ! empty( $excluded_mutations ) ? array_map( 'strtolower', $excluded_mutations ) : []; - } - - return $this->excluded_mutations; - } - - /** - * Gets the actual type name, stripped of possible NonNull and ListOf wrappers. - * - * Returns an empty string if the type modifiers are malformed. - * - * @param string|array $type The (possibly-wrapped) type name. - */ - protected function get_unmodified_type_name( $type ): string { - if ( ! is_array( $type ) ) { - return $type; - } - - $type = array_values( $type )[0] ?? ''; - - return $this->get_unmodified_type_name( $type ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Registry/Utils/PostObject.php b/lib/wp-graphql-1.17.0/src/Registry/Utils/PostObject.php deleted file mode 100644 index bf9f516f..00000000 --- a/lib/wp-graphql-1.17.0/src/Registry/Utils/PostObject.php +++ /dev/null @@ -1,589 +0,0 @@ -graphql_single_name; - - $config = [ - /* translators: post object singular name w/ description */ - 'description' => sprintf( __( 'The %s type', 'wp-graphql' ), $single_name ), - 'connections' => static::get_connections( $post_type_object ), - 'interfaces' => static::get_interfaces( $post_type_object ), - 'fields' => static::get_fields( $post_type_object ), - 'model' => Post::class, - ]; - - // Register as GraphQL objects. - if ( 'object' === $post_type_object->graphql_kind ) { - register_graphql_object_type( $single_name, $config ); - - // Register fields to the Type used for attachments (MediaItem) - if ( 'attachment' === $post_type_object->name && true === $post_type_object->show_in_graphql && isset( $post_type_object->graphql_single_name ) ) { - self::register_attachment_fields( $post_type_object ); - } - - return; - } - - /** - * Register as GraphQL interfaces or unions. - * - * It's assumed that the types used in `resolveType` have already been registered to the schema. - */ - - // Bail early if graphql_resolve_type isnt a vallable callback. - if ( empty( $post_type_object->graphql_resolve_type ) || ! is_callable( $post_type_object->graphql_resolve_type ) ) { - graphql_debug( - sprintf( - // translators: %1$s is the post type name, %2$s is the graphql kind. - __( '%1$s is registered as a GraphQL %2$s, but has no way to resolve the type. Ensure "graphql_resolve_type" is a valid callback function', 'wp-graphql' ), - $single_name, - $post_type_object->graphql_kind - ), - [ 'registered_post_type_object' => $post_type_object ] - ); - - return; - } - - $config['resolveType'] = $post_type_object->graphql_resolve_type; - - if ( 'interface' === $post_type_object->graphql_kind ) { - register_graphql_interface_type( $single_name, $config ); - - return; - } elseif ( 'union' === $post_type_object->graphql_kind ) { - - // Bail early if graphql_union_types is not defined. - if ( empty( $post_type_object->graphql_union_types ) || ! is_array( $post_type_object->graphql_union_types ) ) { - graphql_debug( - __( 'Registering a post type with "graphql_kind" => "union" requires "graphql_union_types" to be a valid array of possible GraphQL type names.', 'wp-graphql' ), - [ 'registered_post_type_object' => $post_type_object ] - ); - - return; - } - - // Set the possible types for the union. - $config['typeNames'] = $post_type_object->graphql_union_types; - - register_graphql_union_type( $single_name, $config ); - } - } - - /** - * Gets all the connections for the given post type. - * - * @param \WP_Post_Type $post_type_object - * - * @return array - */ - protected static function get_connections( WP_Post_Type $post_type_object ) { - $connections = []; - - // Comments. - if ( post_type_supports( $post_type_object->name, 'comments' ) ) { - $connections['comments'] = [ - 'toType' => 'Comment', - 'connectionArgs' => Comments::get_connection_args(), - 'resolve' => static function ( Post $post, $args, $context, $info ) { - if ( $post->isRevision ) { - $id = $post->parentDatabaseId; - } else { - $id = $post->ID; - } - - $resolver = new CommentConnectionResolver( $post, $args, $context, $info ); - - return $resolver->set_query_arg( 'post_id', absint( $id ) )->get_connection(); - }, - ]; - } - - // Previews. - if ( ! in_array( $post_type_object->name, [ 'attachment', 'revision' ], true ) ) { - $connections['preview'] = [ - 'toType' => $post_type_object->graphql_single_name, - 'connectionTypeName' => ucfirst( $post_type_object->graphql_single_name ) . 'ToPreviewConnection', - 'oneToOne' => true, - 'deprecationReason' => ( true === $post_type_object->publicly_queryable || true === $post_type_object->public ) ? null - : sprintf( - // translators: %s is the post type's GraphQL name. - __( 'The "%s" Type is not publicly queryable and does not support previews. This field will be removed in the future.', 'wp-graphql' ), - WPGraphQL\Utils\Utils::format_type_name( $post_type_object->graphql_single_name ) - ), - 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { - if ( $post->isRevision ) { - return null; - } - - if ( empty( $post->previewRevisionDatabaseId ) ) { - return null; - } - - $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info, 'revision' ); - $resolver->set_query_arg( 'p', $post->previewRevisionDatabaseId ); - - return $resolver->one_to_one()->get_connection(); - }, - ]; - } - - // Revisions. - if ( true === post_type_supports( $post_type_object->name, 'revisions' ) ) { - $connections['revisions'] = [ - 'connectionTypeName' => ucfirst( $post_type_object->graphql_single_name ) . 'ToRevisionConnection', - 'toType' => $post_type_object->graphql_single_name, - 'queryClass' => 'WP_Query', - 'connectionArgs' => PostObjects::get_connection_args( [], $post_type_object ), - 'resolve' => static function ( Post $post, $args, $context, $info ) { - $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info, 'revision' ); - $resolver->set_query_arg( 'post_parent', $post->ID ); - - return $resolver->get_connection(); - }, - ]; - } - - // Used to ensure TermNode connection doesn't get registered multiple times. - $already_registered = false; - $allowed_taxonomies = WPGraphQL::get_allowed_taxonomies( 'objects' ); - - foreach ( $allowed_taxonomies as $tax_object ) { - if ( ! in_array( $post_type_object->name, $tax_object->object_type, true ) ) { - continue; - } - - // TermNode. - if ( ! $already_registered ) { - $connections['terms'] = [ - 'toType' => 'TermNode', - 'queryClass' => 'WP_Term_Query', - 'connectionArgs' => TermObjects::get_connection_args( - [ - 'taxonomies' => [ - 'type' => [ 'list_of' => 'TaxonomyEnum' ], - 'description' => __( 'The Taxonomy to filter terms by', 'wp-graphql' ), - ], - ] - ), - 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { - $taxonomies = \WPGraphQL::get_allowed_taxonomies(); - $terms = wp_get_post_terms( $post->ID, $taxonomies, [ 'fields' => 'ids' ] ); - - if ( empty( $terms ) || is_wp_error( $terms ) ) { - return null; - } - $resolver = new TermObjectConnectionResolver( $post, $args, $context, $info, $taxonomies ); - $resolver->set_query_arg( 'include', $terms ); - - return $resolver->get_connection(); - }, - ]; - - // We won't need to register this connection again. - $already_registered = true; - } - - // TermObjects. - $connections[ $tax_object->graphql_plural_name ] = [ - 'toType' => $tax_object->graphql_single_name, - 'queryClass' => 'WP_Term_Query', - 'connectionArgs' => TermObjects::get_connection_args(), - 'resolve' => static function ( Post $post, $args, AppContext $context, $info ) use ( $tax_object ) { - $object_id = true === $post->isPreview && ! empty( $post->parentDatabaseId ) ? $post->parentDatabaseId : $post->ID; - - if ( empty( $object_id ) || ! absint( $object_id ) ) { - return null; - } - - $resolver = new TermObjectConnectionResolver( $post, $args, $context, $info, $tax_object->name ); - $resolver->set_query_arg( 'object_ids', absint( $object_id ) ); - - return $resolver->get_connection(); - }, - ]; - } - - // Merge with connections set in register_post_type. - if ( ! empty( $post_type_object->graphql_connections ) ) { - $connections = array_merge( $connections, $post_type_object->graphql_connections ); - } - - // Remove excluded connections. - if ( ! empty( $post_type_object->graphql_exclude_connections ) ) { - foreach ( $post_type_object->graphql_exclude_connections as $connection_name ) { - unset( $connections[ lcfirst( $connection_name ) ] ); - } - } - - return $connections; - } - - /** - * Gets all the interfaces for the given post type. - * - * @param \WP_Post_Type $post_type_object Post type. - * - * @return array - */ - protected static function get_interfaces( WP_Post_Type $post_type_object ) { - $interfaces = [ 'Node', 'ContentNode', 'DatabaseIdentifier', 'NodeWithTemplate' ]; - - if ( true === $post_type_object->public ) { - $interfaces[] = 'UniformResourceIdentifiable'; - } - - // Only post types that are publicly_queryable are previewable - if ( 'attachment' !== $post_type_object->name && ( true === $post_type_object->publicly_queryable || true === $post_type_object->public ) ) { - $interfaces[] = 'Previewable'; - } - - if ( post_type_supports( $post_type_object->name, 'title' ) ) { - $interfaces[] = 'NodeWithTitle'; - } - - if ( post_type_supports( $post_type_object->name, 'editor' ) ) { - $interfaces[] = 'NodeWithContentEditor'; - } - - if ( post_type_supports( $post_type_object->name, 'author' ) ) { - $interfaces[] = 'NodeWithAuthor'; - } - - if ( post_type_supports( $post_type_object->name, 'thumbnail' ) ) { - $interfaces[] = 'NodeWithFeaturedImage'; - } - - if ( post_type_supports( $post_type_object->name, 'excerpt' ) ) { - $interfaces[] = 'NodeWithExcerpt'; - } - - if ( post_type_supports( $post_type_object->name, 'comments' ) ) { - $interfaces[] = 'NodeWithComments'; - } - - if ( post_type_supports( $post_type_object->name, 'trackbacks' ) ) { - $interfaces[] = 'NodeWithTrackbacks'; - } - - if ( post_type_supports( $post_type_object->name, 'revisions' ) ) { - $interfaces[] = 'NodeWithRevisions'; - } - - if ( post_type_supports( $post_type_object->name, 'page-attributes' ) ) { - $interfaces[] = 'NodeWithPageAttributes'; - } - - if ( $post_type_object->hierarchical || in_array( - $post_type_object->name, - [ - 'attachment', - 'revision', - ], - true - ) ) { - $interfaces[] = 'HierarchicalContentNode'; - } - - if ( true === $post_type_object->show_in_nav_menus ) { - $interfaces[] = 'MenuItemLinkable'; - } - - // Merge with interfaces set in register_post_type. - if ( ! empty( $post_type_object->graphql_interfaces ) ) { - $interfaces = array_merge( $interfaces, $post_type_object->graphql_interfaces ); - } - - // Remove excluded interfaces. - if ( ! empty( $post_type_object->graphql_exclude_interfaces ) ) { - $interfaces = array_diff( $interfaces, $post_type_object->graphql_exclude_interfaces ); - } - - return $interfaces; - } - - /** - * Registers common post type fields on schema type corresponding to provided post type object. - * - * @param \WP_Post_Type $post_type_object Post type. - * - * @return array - * @todo make protected after \Type\ObjectType\PostObject::get_fields() is removed. - */ - public static function get_fields( WP_Post_Type $post_type_object ) { - $single_name = $post_type_object->graphql_single_name; - $fields = [ - 'id' => [ - 'description' => sprintf( - /* translators: %s: custom post-type name */ - __( 'The globally unique identifier of the %s object.', 'wp-graphql' ), - $post_type_object->name - ), - ], - $single_name . 'Id' => [ - 'type' => [ - 'non_null' => 'Int', - ], - 'deprecationReason' => __( 'Deprecated in favor of the databaseId field', 'wp-graphql' ), - 'description' => __( 'The id field matches the WP_Post->ID field.', 'wp-graphql' ), - 'resolve' => static function ( Post $post ) { - return absint( $post->ID ); - }, - ], - ]; - - if ( 'page' === $post_type_object->name ) { - $fields['isFrontPage'] = [ - 'type' => [ 'non_null' => 'Bool' ], - 'description' => __( 'Whether this page is set to the static front page.', 'wp-graphql' ), - ]; - - $fields['isPostsPage'] = [ - 'type' => [ 'non_null' => 'Bool' ], - 'description' => __( 'Whether this page is set to the blog posts page.', 'wp-graphql' ), - ]; - - $fields['isPrivacyPage'] = [ - 'type' => [ 'non_null' => 'Bool' ], - 'description' => __( 'Whether this page is set to the privacy page.', 'wp-graphql' ), - ]; - } - - if ( 'post' === $post_type_object->name ) { - $fields['isSticky'] = [ - 'type' => [ 'non_null' => 'Bool' ], - 'description' => __( 'Whether this page is sticky', 'wp-graphql' ), - ]; - } - - if ( ! $post_type_object->hierarchical && - ! in_array( - $post_type_object->name, - [ - 'attachment', - 'revision', - ], - true - ) ) { - $fields['ancestors']['deprecationReason'] = __( 'This content type is not hierarchical and typically will not have ancestors', 'wp-graphql' ); - $fields['parent']['deprecationReason'] = __( 'This content type is not hierarchical and typically will not have a parent', 'wp-graphql' ); - } - - // Merge with fields set in register_post_type. - if ( ! empty( $post_type_object->graphql_fields ) ) { - $fields = array_merge( $fields, $post_type_object->graphql_fields ); - } - - // Remove excluded fields. - if ( ! empty( $post_type_object->graphql_exclude_fields ) ) { - foreach ( $post_type_object->graphql_exclude_fields as $field_name ) { - unset( $fields[ $field_name ] ); - } - } - - return $fields; - } - - - /** - * Register fields to the Type used for attachments (MediaItem). - * - * @return void - */ - private static function register_attachment_fields( WP_Post_Type $post_type_object ) { - /** - * Register fields custom to the MediaItem Type - */ - register_graphql_fields( - $post_type_object->graphql_single_name, - [ - 'caption' => [ - 'type' => 'String', - 'description' => __( 'The caption for the resource', 'wp-graphql' ), - 'args' => [ - 'format' => [ - 'type' => 'PostObjectFieldFormatEnum', - 'description' => __( 'Format of the field output', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, $args ) { - if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { - // @codingStandardsIgnoreLine. - return $source->captionRaw; - } - - // @codingStandardsIgnoreLine. - return $source->captionRendered; - }, - ], - 'altText' => [ - 'type' => 'String', - 'description' => __( 'Alternative text to display when resource is not displayed', 'wp-graphql' ), - ], - 'srcSet' => [ - 'type' => 'string', - 'args' => [ - 'size' => [ - 'type' => 'MediaItemSizeEnum', - 'description' => __( 'Size of the MediaItem to calculate srcSet with', 'wp-graphql' ), - ], - ], - 'description' => __( 'The srcset attribute specifies the URL of the image to use in different situations. It is a comma separated string of urls and their widths.', 'wp-graphql' ), - 'resolve' => static function ( $source, $args ) { - $size = 'medium'; - if ( ! empty( $args['size'] ) ) { - $size = $args['size']; - } - - $src_set = wp_get_attachment_image_srcset( $source->ID, $size ); - - return ! empty( $src_set ) ? $src_set : null; - }, - ], - 'sizes' => [ - 'type' => 'string', - 'args' => [ - 'size' => [ - 'type' => 'MediaItemSizeEnum', - 'description' => __( 'Size of the MediaItem to calculate sizes with', 'wp-graphql' ), - ], - ], - 'description' => __( 'The sizes attribute value for an image.', 'wp-graphql' ), - 'resolve' => static function ( $source, $args ) { - $size = 'medium'; - if ( ! empty( $args['size'] ) ) { - $size = $args['size']; - } - - $image = wp_get_attachment_image_src( $source->ID, $size ); - if ( $image ) { - list( $src, $width, $height ) = $image; - $sizes = wp_calculate_image_sizes( - [ - absint( $width ), - absint( $height ), - ], - $src, - null, - $source->ID - ); - - return ! empty( $sizes ) ? $sizes : null; - } - - return null; - }, - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'Description of the image (stored as post_content)', 'wp-graphql' ), - 'args' => [ - 'format' => [ - 'type' => 'PostObjectFieldFormatEnum', - 'description' => __( 'Format of the field output', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, $args ) { - if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { - // @codingStandardsIgnoreLine. - return $source->descriptionRaw; - } - - // @codingStandardsIgnoreLine. - return $source->descriptionRendered; - }, - ], - 'mediaItemUrl' => [ - 'type' => 'String', - 'description' => __( 'Url of the mediaItem', 'wp-graphql' ), - ], - 'mediaType' => [ - 'type' => 'String', - 'description' => __( 'Type of resource', 'wp-graphql' ), - ], - 'sourceUrl' => [ - 'type' => 'String', - 'description' => __( 'Url of the mediaItem', 'wp-graphql' ), - 'args' => [ - 'size' => [ - 'type' => 'MediaItemSizeEnum', - 'description' => __( 'Size of the MediaItem to return', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $image, $args ) { - // @codingStandardsIgnoreLine. - $size = null; - if ( isset( $args['size'] ) ) { - $size = ( 'full' === $args['size'] ) ? 'large' : $args['size']; - } - - return ! empty( $size ) ? $image->sourceUrlsBySize[ $size ] : $image->sourceUrl; - }, - ], - 'fileSize' => [ - 'type' => 'Int', - 'description' => __( 'The filesize in bytes of the resource', 'wp-graphql' ), - 'args' => [ - 'size' => [ - 'type' => 'MediaItemSizeEnum', - 'description' => __( 'Size of the MediaItem to return', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $image, $args ) { - - // @codingStandardsIgnoreLine. - $size = null; - if ( isset( $args['size'] ) ) { - $size = ( 'full' === $args['size'] ) ? 'large' : $args['size']; - } - - $sourceUrl = ! empty( $size ) ? $image->sourceUrlsBySize[ $size ] : $image->mediaItemUrl; - $path_parts = pathinfo( $sourceUrl ); - $original_file = get_attached_file( absint( $image->databaseId ) ); - $filesize_path = ! empty( $original_file ) ? path_join( dirname( $original_file ), $path_parts['basename'] ) : null; - - return ! empty( $filesize_path ) ? filesize( $filesize_path ) : null; - }, - ], - 'mimeType' => [ - 'type' => 'String', - 'description' => __( 'The mime type of the mediaItem', 'wp-graphql' ), - ], - 'mediaDetails' => [ - 'type' => 'MediaDetails', - 'description' => __( 'Details about the mediaItem', 'wp-graphql' ), - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Registry/Utils/TermObject.php b/lib/wp-graphql-1.17.0/src/Registry/Utils/TermObject.php deleted file mode 100644 index 0db7e300..00000000 --- a/lib/wp-graphql-1.17.0/src/Registry/Utils/TermObject.php +++ /dev/null @@ -1,339 +0,0 @@ -graphql_single_name; - - $config = [ - 'description' => sprintf( - // translators: %s is the term object singular name. - __( 'The %s type', 'wp-graphql' ), - $single_name - ), - 'connections' => static::get_connections( $tax_object ), - 'interfaces' => static::get_interfaces( $tax_object ), - 'fields' => static::get_fields( $tax_object ), - 'model' => Term::class, - ]; - - // Register as GraphQL objects. - if ( 'object' === $tax_object->graphql_kind ) { - register_graphql_object_type( $single_name, $config ); - return; - } - - /** - * Register as GraphQL interfaces or unions. - * - * It's assumed that the types used in `resolveType` have already been registered to the schema. - */ - - // Bail early if graphql_resolve_type isnt a vallable callback. - if ( empty( $tax_object->graphql_resolve_type ) || ! is_callable( $tax_object->graphql_resolve_type ) ) { - graphql_debug( - sprintf( - // translators: %1$s is the term object singular name, %2$s is the graphql kind. - __( '%1$s is registered as a GraphQL %2$s, but has no way to resolve the type. Ensure "graphql_resolve_type" is a valid callback function', 'wp-graphql' ), - $single_name, - $tax_object->graphql_kind - ), - [ 'registered_taxonomy_object' => $tax_object ] - ); - - return; - } - - $config['resolveType'] = $tax_object->graphql_resolve_type; - - if ( 'interface' === $tax_object->graphql_kind ) { - register_graphql_interface_type( $single_name, $config ); - - return; - } elseif ( 'union' === $tax_object->graphql_kind ) { - - // Bail early if graphql_union_types is not defined. - if ( empty( $tax_object->graphql_union_types ) || ! is_array( $tax_object->graphql_union_types ) ) { - graphql_debug( - __( 'Registering a taxonomy with "graphql_kind" => "union" requires "graphql_union_types" to be a valid array of possible GraphQL type names.', 'wp-graphql' ), - [ 'registered_taxonomy_object' => $tax_object ] - ); - - return; - } - - // Set the possible types for the union. - $config['typeNames'] = $tax_object->graphql_union_types; - - register_graphql_union_type( $single_name, $config ); - } - } - - /** - * Gets all the connections for the given post type. - * - * @param \WP_Taxonomy $tax_object - * - * @return array - */ - protected static function get_connections( WP_Taxonomy $tax_object ) { - $connections = []; - - // Taxonomy. - // @todo connection move to TermNode (breaking). - $connections['taxonomy'] = [ - 'toType' => 'Taxonomy', - 'oneToOne' => true, - 'resolve' => static function ( Term $source, $args, $context, $info ) { - if ( empty( $source->taxonomyName ) ) { - return null; - } - $resolver = new TaxonomyConnectionResolver( $source, $args, $context, $info ); - $resolver->set_query_arg( 'name', $source->taxonomyName ); - return $resolver->one_to_one()->get_connection(); - }, - ]; - - if ( true === $tax_object->hierarchical ) { - // Children. - $connections['children'] = [ - 'toType' => $tax_object->graphql_single_name, - 'description' => sprintf( - // translators: %1$s is the term object singular name, %2$s is the term object plural name. - __( 'Connection between the %1$s type and its children %2$s.', 'wp-graphql' ), - $tax_object->graphql_single_name, - $tax_object->graphql_plural_name - ), - 'connectionArgs' => TermObjects::get_connection_args(), - 'queryClass' => 'WP_Term_Query', - 'resolve' => static function ( Term $term, $args, AppContext $context, $info ) { - $resolver = new TermObjectConnectionResolver( $term, $args, $context, $info ); - $resolver->set_query_arg( 'parent', $term->term_id ); - - return $resolver->get_connection(); - }, - ]; - - // Parent. - $connections['parent'] = [ - 'toType' => $tax_object->graphql_single_name, - 'description' => sprintf( - // translators: %s is the term object singular name. - __( 'Connection between the %1$s type and its parent %1$s.', 'wp-graphql' ), - $tax_object->graphql_single_name - ), - 'connectionTypeName' => ucfirst( $tax_object->graphql_single_name ) . 'ToParent' . ucfirst( $tax_object->graphql_single_name ) . 'Connection', - 'oneToOne' => true, - 'resolve' => static function ( Term $term, $args, AppContext $context, $info ) use ( $tax_object ) { - if ( ! isset( $term->parentDatabaseId ) || empty( $term->parentDatabaseId ) ) { - return null; - } - - $resolver = new TermObjectConnectionResolver( $term, $args, $context, $info, $tax_object->name ); - $resolver->set_query_arg( 'include', $term->parentDatabaseId ); - - return $resolver->one_to_one()->get_connection(); - }, - ]; - - // Ancestors. - $connections['ancestors'] = [ - 'toType' => $tax_object->graphql_single_name, - 'description' => __( 'The ancestors of the node. Default ordered as lowest (closest to the child) to highest (closest to the root).', 'wp-graphql' ), - 'connectionTypeName' => ucfirst( $tax_object->graphql_single_name ) . 'ToAncestors' . ucfirst( $tax_object->graphql_single_name ) . 'Connection', - 'resolve' => static function ( Term $term, $args, AppContext $context, $info ) use ( $tax_object ) { - if ( ! $tax_object instanceof WP_Taxonomy ) { - return null; - } - - $ancestor_ids = get_ancestors( absint( $term->term_id ), $term->taxonomyName, 'taxonomy' ); - - if ( empty( $ancestor_ids ) ) { - return null; - } - - $resolver = new TermObjectConnectionResolver( $term, $args, $context, $info, $tax_object->name ); - $resolver->set_query_arg( 'include', $ancestor_ids ); - $resolver->set_query_arg( 'orderby', 'include' ); - - return $resolver->get_connection(); - }, - ]; - } - - // Used to ensure contentNodes connection doesn't get registered multiple times. - $already_registered = false; - $allowed_post_types = WPGraphQL::get_allowed_post_types( 'objects' ); - - foreach ( $allowed_post_types as $post_type_object ) { - if ( ! in_array( $tax_object->name, get_object_taxonomies( $post_type_object->name ), true ) ) { - continue; - } - - // ContentNodes. - if ( ! $already_registered ) { - $connections['contentNodes'] = PostObjects::get_connection_config( - $tax_object, - [ - 'toType' => 'ContentNode', - 'resolve' => static function ( Term $term, $args, $context, $info ) { - $resolver = new PostObjectConnectionResolver( $term, $args, $context, $info, 'any' ); - $resolver->set_query_arg( - 'tax_query', - [ - [ - 'taxonomy' => $term->taxonomyName, - 'terms' => [ $term->term_id ], - 'field' => 'term_id', - 'include_children' => false, - ], - ] - ); - - return $resolver->get_connection(); - }, - ] - ); - - // We won't need to register this connection again. - $already_registered = true; - } - - // PostObjects. - $connections[ $post_type_object->graphql_plural_name ] = PostObjects::get_connection_config( - $post_type_object, - [ - 'toType' => $post_type_object->graphql_single_name, - 'queryClass' => 'WP_Query', - 'resolve' => static function ( Term $term, $args, AppContext $context, ResolveInfo $info ) use ( $post_type_object ) { - $resolver = new PostObjectConnectionResolver( $term, $args, $context, $info, $post_type_object->name ); - $resolver->set_query_arg( - 'tax_query', - [ - [ - 'taxonomy' => $term->taxonomyName, - 'terms' => [ $term->term_id ], - 'field' => 'term_id', - 'include_children' => false, - ], - ] - ); - - return $resolver->get_connection(); - }, - ] - ); - } - - // Merge with connections set in register_taxonomy. - if ( ! empty( $tax_object->graphql_connections ) ) { - $connections = array_merge( $connections, $tax_object->graphql_connections ); - } - - // Remove excluded connections. - if ( ! empty( $tax_object->graphql_exclude_connections ) ) { - foreach ( $tax_object->graphql_exclude_connections as $connection_name ) { - unset( $connections[ lcfirst( $connection_name ) ] ); - } - } - - return $connections; - } - /** - * Gets all the interfaces for the given Taxonomy. - * - * @param \WP_Taxonomy $tax_object Taxonomy. - * - * @return array - */ - protected static function get_interfaces( WP_Taxonomy $tax_object ) { - $interfaces = [ 'Node', 'TermNode', 'DatabaseIdentifier' ]; - - if ( true === $tax_object->public ) { - $interfaces[] = 'UniformResourceIdentifiable'; - } - - if ( $tax_object->hierarchical ) { - $interfaces[] = 'HierarchicalTermNode'; - } - - if ( true === $tax_object->show_in_nav_menus ) { - $interfaces[] = 'MenuItemLinkable'; - } - - // Merge with interfaces set in register_taxonomy. - if ( ! empty( $tax_object->graphql_interfaces ) ) { - $interfaces = array_merge( $interfaces, $tax_object->graphql_interfaces ); - } - - // Remove excluded interfaces. - if ( ! empty( $tax_object->graphql_exclude_interfaces ) ) { - $interfaces = array_diff( $interfaces, $tax_object->graphql_exclude_interfaces ); - } - - return $interfaces; - } - - /** - * Registers common Taxonomy fields on schema type corresponding to provided Taxonomy object. - * - * @param \WP_Taxonomy $tax_object Taxonomy. - * - * @return array - */ - protected static function get_fields( WP_Taxonomy $tax_object ) { - $single_name = $tax_object->graphql_single_name; - $fields = [ - $single_name . 'Id' => [ - 'type' => 'Int', - 'deprecationReason' => __( 'Deprecated in favor of databaseId', 'wp-graphql' ), - 'description' => __( 'The id field matches the WP_Post->ID field.', 'wp-graphql' ), - 'resolve' => static function ( Term $term ) { - return absint( $term->term_id ); - }, - ], - ]; - - // Merge with fields set in register_taxonomy. - if ( ! empty( $tax_object->graphql_fields ) ) { - $fields = array_merge( $fields, $tax_object->graphql_fields ); - } - - // Remove excluded fields. - if ( ! empty( $tax_object->graphql_exclude_fields ) ) { - foreach ( $tax_object->graphql_exclude_fields as $field_name ) { - unset( $fields[ $field_name ] ); - } - } - - return $fields; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Request.php b/lib/wp-graphql-1.17.0/src/Request.php deleted file mode 100644 index a6ac7248..00000000 --- a/lib/wp-graphql-1.17.0/src/Request.php +++ /dev/null @@ -1,798 +0,0 @@ -debug_log = new DebugLog(); - - // Set request data for passed-in (non-HTTP) requests. - $this->data = $data; - - // Get the Type Registry - $this->type_registry = \WPGraphQL::get_type_registry(); - - // Get the Schema - $this->schema = \WPGraphQL::get_schema(); - - // Get the App Context - $this->app_context = \WPGraphQL::get_app_context(); - - $this->root_value = $this->get_root_value(); - $this->validation_rules = $this->get_validation_rules(); - $this->field_resolver = $this->get_field_resolver(); - - /** - * Configure the app_context which gets passed down to all the resolvers. - * - * @since 0.0.4 - */ - $app_context = new AppContext(); - $app_context->viewer = wp_get_current_user(); - $app_context->root_url = get_bloginfo( 'url' ); - $app_context->request = ! empty( $_REQUEST ) ? $_REQUEST : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended - $app_context->type_registry = $this->type_registry; - $this->app_context = $app_context; - - $this->query_analyzer = new QueryAnalyzer( $this ); - - // The query analyzer tracks nodes, models, list types and more - // to return in headers and debug messages to help developers understand - // what was resolved, how to cache it, etc. - $this->query_analyzer->init(); - } - - /** - * @return \WPGraphQL\Utils\QueryAnalyzer - */ - public function get_query_analyzer(): QueryAnalyzer { - return $this->query_analyzer; - } - - /** - * @return mixed - */ - protected function get_field_resolver() { - return $this->field_resolver; - } - - /** - * Return the validation rules to use in the request - * - * @return array - */ - protected function get_validation_rules(): array { - $validation_rules = GraphQL::getStandardValidationRules(); - - $validation_rules['require_authentication'] = new RequireAuthentication(); - $validation_rules['disable_introspection'] = new DisableIntrospection(); - $validation_rules['query_depth'] = new QueryDepth(); - - /** - * Return the validation rules to use in the request - * - * @param array $validation_rules The validation rules to use in the request - * @param \WPGraphQL\Request $request The Request instance - */ - return apply_filters( 'graphql_validation_rules', $validation_rules, $this ); - } - - /** - * Returns the root value to use in the request. - * - * @return mixed|null - */ - protected function get_root_value() { - /** - * Set the root value based on what was passed to the request - */ - $root_value = isset( $this->data['root_value'] ) && ! empty( $this->data['root_value'] ) ? $this->data['root_value'] : null; - - /** - * Return the filtered root value - * - * @param mixed $root_value The root value the Schema should use to resolve with. Default null. - * @param \WPGraphQL\Request $request The Request instance - */ - return apply_filters( 'graphql_root_value', $root_value, $this ); - } - - /** - * Apply filters and do actions before GraphQL execution - * - * @return void - * @throws \GraphQL\Error\Error - */ - private function before_execute(): void { - - /** - * Store the global post so that it can be reset after GraphQL execution - * - * This allows for a GraphQL query to be used in the middle of post content, such as in a Shortcode - * without disrupting the flow of the post as the global POST before and after GraphQL execution will be - * the same. - */ - if ( ! empty( $GLOBALS['post'] ) ) { - $this->global_post = $GLOBALS['post']; - } - - if ( ! empty( $GLOBALS['wp_query'] ) ) { - $this->global_wp_the_query = clone $GLOBALS['wp_the_query']; - } - - /** - * If the request is a batch request it will come back as an array - */ - if ( is_array( $this->params ) ) { - - // If the request is a batch request, but batch requests are disabled, - // bail early - if ( ! $this->is_batch_queries_enabled() ) { - throw new Error( esc_html__( 'Batch Queries are not supported', 'wp-graphql' ) ); - } - - $batch_limit = get_graphql_setting( 'batch_limit', 10 ); - $batch_limit = absint( $batch_limit ) ? absint( $batch_limit ) : 10; - - // If batch requests are enabled, but a limit is set and the request exceeds the limit - // fail now - if ( $batch_limit < count( $this->params ) ) { - // translators: First placeholder is the max number of batch operations allowed in a GraphQL request. The 2nd placeholder is the number of operations requested in the current request. - throw new Error( sprintf( esc_html__( 'Batch requests are limited to %1$d operations. This request contained %2$d', 'wp-graphql' ), absint( $batch_limit ), count( $this->params ) ) ); - } - - /** - * Execute batch queries - * - * @param \GraphQL\Server\OperationParams[] $params The operation params of the batch request - */ - do_action( 'graphql_execute_batch_queries', $this->params ); - - // Process the batched requests - array_walk( $this->params, [ $this, 'do_action' ] ); - } else { - $this->do_action( $this->params ); - } - - /** - * This action runs before execution of a GraphQL request (regardless if it's a single or batch request) - * - * @param \WPGraphQL\Request $request The instance of the Request being executed - */ - do_action( 'graphql_before_execute', $this ); - } - - /** - * Checks authentication errors. - * - * False will mean there are no detected errors and - * execution will continue. - * - * Anything else (true, WP_Error, thrown exception, etc) will prevent execution of the GraphQL - * request. - * - * @return boolean - * @throws \Exception - */ - protected function has_authentication_errors() { - /** - * Bail if this is not an HTTP request. - * - * Auth for internal requests will happen - * via WordPress internals. - */ - if ( ! is_graphql_http_request() ) { - return false; - } - - /** - * Access the global $wp_rest_auth_cookie - */ - global $wp_rest_auth_cookie; - - /** - * Default state of the authentication errors - */ - $authentication_errors = false; - - /** - * Is cookie authentication NOT being used? - * - * If we get an auth error, but the user is still logged in, another auth mechanism - * (JWT, oAuth, etc) must have been used. - */ - if ( true !== $wp_rest_auth_cookie && is_user_logged_in() ) { - - /** - * Return filtered authentication errors - */ - return $this->filtered_authentication_errors( $authentication_errors ); - - /** - * If the user is not logged in, determine if there's a nonce - */ - } else { - $nonce = null; - - if ( isset( $_REQUEST['_wpnonce'] ) ) { - $nonce = $_REQUEST['_wpnonce']; // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - } elseif ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) { - $nonce = $_SERVER['HTTP_X_WP_NONCE']; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash,WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - } - - if ( null === $nonce ) { - // No nonce at all, so act as if it's an unauthenticated request. - wp_set_current_user( 0 ); - - return $this->filtered_authentication_errors( $authentication_errors ); - } - - // Check the nonce. - $result = wp_verify_nonce( $nonce, 'wp_rest' ); - - if ( ! $result ) { - throw new Exception( esc_html__( 'Cookie nonce is invalid', 'wp-graphql' ) ); - } - } - - /** - * Return the filtered authentication errors - */ - return $this->filtered_authentication_errors( $authentication_errors ); - } - - /** - * Filter Authentication errors. Allows plugins that authenticate to hook in and prevent - * execution if Authentication errors exist. - * - * @param boolean $authentication_errors Whether there are authentication errors with the - * request - * - * @return boolean - */ - protected function filtered_authentication_errors( $authentication_errors = false ) { - - /** - * If false, there are no authentication errors. If true, execution of the - * GraphQL request will be prevented and an error will be thrown. - * - * @param boolean $authentication_errors Whether there are authentication errors with the request - * @param \WPGraphQL\Request $request Instance of the Request - */ - return apply_filters( 'graphql_authentication_errors', $authentication_errors, $this ); - } - - /** - * Performs actions and runs filters after execution completes - * - * @param mixed|array|object $response The response from execution. Array for batch requests, - * single object for individual requests - * - * @return array - * - * @throws \Exception - */ - private function after_execute( $response ) { - - /** - * If there are authentication errors, prevent execution and throw an exception. - */ - if ( false !== $this->has_authentication_errors() ) { - throw new Exception( esc_html__( 'Authentication Error', 'wp-graphql' ) ); - } - - /** - * If the params and the $response are both arrays - * treat this as a batch request and map over the array to apply the - * after_execute_actions, otherwise apply them to the current response - */ - if ( is_array( $this->params ) && is_array( $response ) ) { - $filtered_response = []; - foreach ( $response as $key => $resp ) { - $filtered_response[] = $this->after_execute_actions( $resp, (int) $key ); - } - } else { - $filtered_response = $this->after_execute_actions( $response, null ); - } - - /** - * Reset the global post after execution - * - * This allows for a GraphQL query to be used in the middle of post content, such as in a Shortcode - * without disrupting the flow of the post as the global POST before and after GraphQL execution will be - * the same. - * - * We cannot use wp_reset_postdata here because it just resets the post from the global query which can - * be anything the because the resolvers themself can set it to whatever. So we just manually reset the - * post with setup_postdata we cached before this request. - */ - - if ( ! empty( $this->global_wp_the_query ) ) { - $GLOBALS['wp_the_query'] = $this->global_wp_the_query; // phpcs:ignore WordPress.WP.GlobalVariablesOverride - wp_reset_query(); // phpcs:ignore WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query - } - - if ( ! empty( $this->global_post ) ) { - $GLOBALS['post'] = $this->global_post; // phpcs:ignore WordPress.WP.GlobalVariablesOverride - setup_postdata( $this->global_post ); - } - - /** - * Run an action after GraphQL Execution - * - * @param array $filtered_response The response of the entire operation. Could be a single operation or a batch operation - * @param \WPGraphQL\Request $request Instance of the Request being executed - */ - do_action( 'graphql_after_execute', $filtered_response, $this ); - - /** - * Return the filtered response - */ - return $filtered_response; - } - - /** - * Apply filters and do actions after GraphQL execution - * - * @param mixed|array|object $response The response for your GraphQL request - * @param mixed|int|null $key The array key of the params for batch requests - * - * @return array - */ - private function after_execute_actions( $response, $key = null ) { - - /** - * Determine which params (batch or single request) to use when passing through to the actions - */ - $query = null; - $operation = null; - $variables = null; - $query_id = null; - - if ( $this->params instanceof OperationParams ) { - $operation = $this->params->operation; - $query = $this->params->query; - $query_id = $this->params->queryId; - $variables = $this->params->variables; - } elseif ( is_array( $this->params ) ) { - $operation = $this->params[ $key ]->operation ?? ''; - $query = $this->params[ $key ]->query ?? ''; - $query_id = $this->params[ $key ]->queryId ?? null; - $variables = $this->params[ $key ]->variables ?? null; - } - - /** - * Run an action. This is a good place for debug tools to hook in to log things, etc. - * - * @param mixed|array $response The response your GraphQL request - * @param \WPGraphQL\WPSchema $schema The schema object for the root request - * @param mixed|string|null $operation The name of the operation - * @param string $query The query that GraphQL executed - * @param array|null $variables Variables to passed to your GraphQL query - * @param \WPGraphQL\Request $request Instance of the Request - * - * @since 0.0.4 - */ - do_action( 'graphql_execute', $response, $this->schema, $operation, $query, $variables, $this ); - - /** - * Add the debug log to the request - */ - if ( ! empty( $response ) ) { - if ( is_array( $response ) ) { - $response['extensions']['debug'] = $this->debug_log->get_logs(); - } else { - $response->extensions['debug'] = $this->debug_log->get_logs(); - } - } - - /** - * Filter the $response of the GraphQL execution. This allows for the response to be filtered - * before it's returned, allowing granular control over the response at the latest point. - * - * POSSIBLE USAGE EXAMPLES: - * This could be used to ensure that certain fields never make it to the response if they match - * certain criteria, etc. For example, this filter could be used to check if a current user is - * allowed to see certain things, and if they are not, the $response could be filtered to remove - * the data they should not be allowed to see. - * - * Or, perhaps some systems want the response to always include some additional piece of data in - * every response, regardless of the request that was sent to it, this could allow for that - * to be hooked in and included in the $response. - * - * @param array $response The response for your GraphQL query - * @param \WPGraphQL\WPSchema $schema The schema object for the root query - * @param string $operation The name of the operation - * @param string $query The query that GraphQL executed - * @param array|null $variables Variables to passed to your GraphQL request - * @param \WPGraphQL\Request $request Instance of the Request - * @param string|null $query_id The query id that GraphQL executed - * - * @since 0.0.5 - */ - $filtered_response = apply_filters( 'graphql_request_results', $response, $this->schema, $operation, $query, $variables, $this, $query_id ); - - /** - * Run an action after the response has been filtered, as the response is being returned. - * This is a good place for debug tools to hook in to log things, etc. - * - * @param array $filtered_response The filtered response for the GraphQL request - * @param array $response The response for your GraphQL request - * @param \WPGraphQL\WPSchema $schema The schema object for the root request - * @param string $operation The name of the operation - * @param string $query The query that GraphQL executed - * @param array|null $variables Variables to passed to your GraphQL query - * @param \WPGraphQL\Request $request Instance of the Request - * @param string|null $query_id The query id that GraphQL executed - */ - do_action( 'graphql_return_response', $filtered_response, $response, $this->schema, $operation, $query, $variables, $this, $query_id ); - - /** - * Filter "is_graphql_request" back to false. - */ - \WPGraphQL::set_is_graphql_request( false ); - - return $filtered_response; - } - - /** - * Run action for a request. - * - * @param \GraphQL\Server\OperationParams $params OperationParams for the request. - * - * @return void - */ - private function do_action( OperationParams $params ) { - - /** - * Run an action for each request. - * - * @param ?string $query The GraphQL query - * @param ?string $operation The name of the operation - * @param ?array $variables Variables to be passed to your GraphQL request - * @param \GraphQL\Server\OperationParams $params The Operation Params. This includes any extra params, - * such as extenions or any other modifications to the request body - */ - do_action( 'do_graphql_request', $params->query, $params->operation, $params->variables, $params ); - } - - /** - * Execute an internal request (graphql() function call). - * - * @return array - * @throws \Exception - */ - public function execute() { - $helper = new WPHelper(); - - if ( ! $this->data instanceof OperationParams ) { - $this->params = $helper->parseRequestParams( 'POST', $this->data, [] ); - } else { - $this->params = $this->data; - } - - if ( is_array( $this->params ) ) { - return array_map( - function ( $data ) { - $this->data = $data; - return $this->execute(); - }, - $this->params - ); - } - - // If $this->params isnt an array or an OperationParams instance, then something probably went wrong. - if ( ! $this->params instanceof OperationParams ) { - throw new \Exception( 'Invalid request params.' ); - } - - /** - * Initialize the GraphQL Request - */ - $this->before_execute(); - $response = apply_filters( 'pre_graphql_execute_request', null, $this ); - - if ( null === $response ) { - - /** - * Allow the query string to be determined by a filter. Ex, when params->queryId is present, query can be retrieved. - */ - $query = apply_filters( - 'graphql_execute_query_params', - isset( $this->params->query ) ? $this->params->query : '', - $this->params - ); - - $result = GraphQL::executeQuery( - $this->schema, - $query, - $this->root_value, - $this->app_context, - isset( $this->params->variables ) ? $this->params->variables : null, - isset( $this->params->operation ) ? $this->params->operation : null, - $this->field_resolver, - $this->validation_rules - ); - - /** - * Return the result of the request - */ - $response = $result->toArray( $this->get_debug_flag() ); - } - - /** - * Ensure the response is returned as a proper, populated array. Otherwise add an error. - */ - if ( empty( $response ) || ! is_array( $response ) ) { - $response = [ - 'errors' => __( 'The GraphQL request returned an invalid response', 'wp-graphql' ), - ]; - } - - /** - * If the request is a batch request it will come back as an array - */ - return $this->after_execute( $response ); - } - - /** - * Execute an HTTP request. - * - * @return array - * @throws \Exception - */ - public function execute_http() { - /** - * Parse HTTP request. - */ - $helper = new WPHelper(); - $this->params = $helper->parseHttpRequest(); - - /** - * Initialize the GraphQL Request - */ - $this->before_execute(); - - /** - * Get the response. - */ - $response = apply_filters( 'pre_graphql_execute_request', null, $this ); - - /** - * If no cached response, execute the query - */ - if ( null === $response ) { - $server = $this->get_server(); - $response = $server->executeRequest( $this->params ); - } - - return $this->after_execute( $response ); - } - - /** - * Get the operation params for the request. - * - * @return \GraphQL\Server\OperationParams|\GraphQL\Server\OperationParams[] - */ - public function get_params() { - return $this->params; - } - - /** - * Returns the debug flag value - * - * @return int - */ - public function get_debug_flag() { - $flag = DebugFlag::INCLUDE_DEBUG_MESSAGE; - if ( 0 !== get_current_user_id() ) { - // Flag 2 shows the trace data, which should require user to be logged in to see by default - $flag = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE; - } - - return true === \WPGraphQL::debug() ? $flag : DebugFlag::NONE; - } - - /** - * Determines if batch queries are enabled for the server. - * - * Default is to have batch queries enabled. - * - * @return bool - */ - private function is_batch_queries_enabled() { - $batch_queries_enabled = true; - - $batch_queries_setting = get_graphql_setting( 'batch_queries_enabled', 'on' ); - if ( 'off' === $batch_queries_setting ) { - $batch_queries_enabled = false; - } - - /** - * Filter whether batch queries are supported or not - * - * @param boolean $batch_queries_enabled Whether Batch Queries should be enabled - * @param \GraphQL\Server\OperationParams $params Request operation params - */ - return apply_filters( 'graphql_is_batch_queries_enabled', $batch_queries_enabled, $this->params ); - } - - /** - * Create the GraphQL server that will process the request. - * - * @return \GraphQL\Server\StandardServer - */ - private function get_server() { - $debug_flag = $this->get_debug_flag(); - - $config = new ServerConfig(); - $config - ->setDebugFlag( $debug_flag ) - ->setSchema( $this->schema ) - ->setContext( $this->app_context ) - ->setValidationRules( $this->validation_rules ) - ->setQueryBatching( $this->is_batch_queries_enabled() ); - - if ( ! empty( $this->root_value ) ) { - $config->setFieldResolver( $this->root_value ); - } - - if ( ! empty( $this->field_resolver ) ) { - $config->setFieldResolver( $this->field_resolver ); - } - - /** - * Run an action when the server config is created. The config can be acted - * upon directly to override default values or implement new features, e.g., - * $config->setValidationRules(). - * - * @param \GraphQL\Server\ServerConfig $config Server config - * @param \GraphQL\Server\OperationParams $params Request operation params - * - * @since 0.2.0 - */ - do_action( 'graphql_server_config', $config, $this->params ); - - return new StandardServer( $config ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Router.php b/lib/wp-graphql-1.17.0/src/Router.php deleted file mode 100644 index 2b3e80bf..00000000 --- a/lib/wp-graphql-1.17.0/src/Router.php +++ /dev/null @@ -1,564 +0,0 @@ -is_home = false; - - /** - * Whether it's a GraphQL HTTP Request - * - * @since 0.0.5 - */ - if ( ! defined( 'GRAPHQL_HTTP_REQUEST' ) ) { - define( 'GRAPHQL_HTTP_REQUEST', true ); - } - - /** - * Process the GraphQL query Request - */ - self::process_http_request(); - } - - /** - * Sends an HTTP header. - * - * @param string $key Header key. - * @param string $value Header value. - * - * @return void - * @since 0.0.5 - */ - public static function send_header( $key, $value ) { - - /** - * Sanitize as per RFC2616 (Section 4.2): - * - * Any LWS that occurs between field-content MAY be replaced with a - * single SP before interpreting the field value or forwarding the - * message downstream. - */ - $value = preg_replace( '/\s+/', ' ', $value ); - header( apply_filters( 'graphql_send_header', sprintf( '%s: %s', $key, $value ), $key, $value ) ); - } - - /** - * Sends an HTTP status code. - * - * @return void - */ - protected static function set_status() { - status_header( self::$http_status_code ); - } - - /** - * Returns an array of headers to send with the HTTP response - * - * @return array - */ - protected static function get_response_headers() { - - /** - * Filtered list of access control headers. - * - * @param array $access_control_headers Array of headers to allow. - */ - $access_control_allow_headers = apply_filters( - 'graphql_access_control_allow_headers', - [ - 'Authorization', - 'Content-Type', - ] - ); - - // For cache url header, use the domain without protocol. Path for when it's multisite. - // Remove the starting http://, https://, :// from the full hostname/path. - $host_and_path = preg_replace( '#^.*?://#', '', graphql_get_endpoint_url() ); - - $headers = [ - 'Access-Control-Allow-Origin' => '*', - 'Access-Control-Allow-Headers' => implode( ', ', $access_control_allow_headers ), - 'Access-Control-Max-Age' => 600, - // cache the result of preflight requests (600 is the upper limit for Chromium). - 'Content-Type' => 'application/json ; charset=' . get_option( 'blog_charset' ), - 'X-Robots-Tag' => 'noindex', - 'X-Content-Type-Options' => 'nosniff', - 'X-GraphQL-URL' => $host_and_path, - ]; - - - // If the Query Analyzer was instantiated - // Get the headers determined from its Analysis - if ( self::get_request() instanceof Request && self::get_request()->get_query_analyzer() instanceof QueryAnalyzer ) { - $headers = self::get_request()->get_query_analyzer()->get_headers( $headers ); - } - - if ( true === \WPGraphQL::debug() ) { - $headers['X-hacker'] = __( 'If you\'re reading this, you should visit github.com/wp-graphql/wp-graphql and contribute!', 'wp-graphql' ); - } - - /** - * Send nocache headers on authenticated requests. - * - * @param bool $rest_send_nocache_headers Whether to send no-cache headers. - * - * @since 0.0.5 - */ - $send_no_cache_headers = apply_filters( 'graphql_send_nocache_headers', is_user_logged_in() ); - if ( $send_no_cache_headers ) { - foreach ( wp_get_nocache_headers() as $no_cache_header_key => $no_cache_header_value ) { - $headers[ $no_cache_header_key ] = $no_cache_header_value; - } - } - - /** - * Filter the $headers to send - */ - return apply_filters( 'graphql_response_headers_to_send', $headers ); - } - - /** - * Set the response headers - * - * @return void - * @since 0.0.1 - */ - public static function set_headers() { - if ( false === headers_sent() ) { - - /** - * Set the HTTP response status - */ - self::set_status(); - - /** - * Get the response headers - */ - $headers = self::get_response_headers(); - - /** - * If there are headers, set them for the response - */ - if ( ! empty( $headers ) && is_array( $headers ) ) { - foreach ( $headers as $key => $value ) { - self::send_header( $key, $value ); - } - } - - /** - * Fire an action when the headers are set - * - * @param array $headers The headers sent in the response - */ - do_action( 'graphql_response_set_headers', $headers ); - } - } - - /** - * Retrieves the raw request entity (body). - * - * @since 0.0.5 - * - * @global string php://input Raw post data. - * - * @return string|false Raw request data. - */ - public static function get_raw_data() { - $input = file_get_contents( 'php://input' ); // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsRemoteFile - - return ! empty( $input ) ? $input : ''; - } - - /** - * This processes the graphql requests that come into the /graphql endpoint via an HTTP request - * - * @return mixed - * @throws \Exception Throws Exception. - * @throws \Throwable Throws Exception. - * @global WP_User $current_user The currently authenticated user. - * @since 0.0.1 - */ - public static function process_http_request() { - global $current_user; - - if ( $current_user instanceof WP_User && ! $current_user->exists() ) { - /* - * If there is no current user authenticated via other means, clear - * the cached lack of user, so that an authenticate check can set it - * properly. - * - * This is done because for authentications such as Application - * Passwords, we don't want it to be accepted unless the current HTTP - * request is a GraphQL API request, which can't always be identified early - * enough in evaluation. - * - * See serve_request in wp-includes/rest-api/class-wp-rest-server.php. - */ - $current_user = null; // phpcs:ignore WordPress.WP.GlobalVariablesOverride - } - - /** - * This action can be hooked to to enable various debug tools, - * such as enableValidation from the GraphQL Config. - * - * @since 0.0.4 - */ - do_action( 'graphql_process_http_request' ); - - /** - * Respond to pre-flight requests. - * - * Bail before Request() execution begins. - * - * @see: https://apollographql.slack.com/archives/C10HTKHPC/p1507649812000123 - * @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS#Preflighted_requests - */ - if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'OPTIONS' === $_SERVER['REQUEST_METHOD'] ) { - self::$http_status_code = 200; - self::set_headers(); - exit; - } - - $query = ''; - $operation_name = ''; - $variables = []; - self::$request = new Request(); - - try { - $response = self::$request->execute_http(); - - // Get the operation params from the request. - $params = self::$request->get_params(); - $query = isset( $params->query ) ? $params->query : ''; - $operation_name = isset( $params->operation ) ? $params->operation : ''; - $variables = isset( $params->variables ) ? $params->variables : null; - } catch ( \Throwable $error ) { - - /** - * If there are errors, set the status to 500 - * and format the captured errors to be output properly - * - * @since 0.0.4 - */ - self::$http_status_code = 500; - - /** - * Filter thrown GraphQL errors - * - * @param array $errors Formatted errors object. - * @param \Throwable $error Thrown error. - * @param \WPGraphQL\Request $request WPGraphQL Request object. - */ - $response['errors'] = apply_filters( - 'graphql_http_request_response_errors', - [ FormattedError::createFromException( $error, self::$request->get_debug_flag() ) ], - $error, - self::$request - ); - } - - // Previously there was a small distinction between the response and the result, but - // now that we are delegating to Request, just send the response for both. - $result = $response; - - if ( false === headers_sent() ) { - self::prepare_headers( $response, $result, $query, $operation_name, $variables ); - } - - /** - * Run an action after the HTTP Response is ready to be sent back. This might be a good place for tools - * to hook in to track metrics, such as how long the process took from `graphql_process_http_request` - * to here, etc. - * - * @param array $response The GraphQL response - * @param array $result The result of the GraphQL Query - * @param string $operation_name The name of the operation - * @param string $query The request that GraphQL executed - * @param ?array $variables Variables to passed to your GraphQL query - * @param mixed $status_code The status code for the response - * - * @since 0.0.5 - */ - do_action( 'graphql_process_http_request_response', $response, $result, $operation_name, $query, $variables, self::$http_status_code ); - - /** - * Send the response - */ - wp_send_json( $response ); - } - - /** - * Prepare headers for response - * - * @param mixed|array|\GraphQL\Executor\ExecutionResult $response The response of the GraphQL Request. - * @param mixed|array|\GraphQL\Executor\ExecutionResult $graphql_results The results of the GraphQL execution. - * @param string $query The GraphQL query. - * @param string $operation_name The operation name of the GraphQL - * Request. - * @param mixed|array|null $variables The variables applied to the GraphQL - * Request. - * @param mixed|\WP_User|null $user The current user object. - * - * @return void - */ - protected static function prepare_headers( $response, $graphql_results, string $query, string $operation_name, $variables, $user = null ) { - - /** - * Filter the $status_code before setting the headers - * - * @param int $status_code The status code to apply to the headers - * @param array $response The response of the GraphQL Request - * @param array $graphql_results The results of the GraphQL execution - * @param string $query The GraphQL query - * @param string $operation_name The operation name of the GraphQL Request - * @param array $variables The variables applied to the GraphQL Request - * @param \WP_User $user The current user object - */ - self::$http_status_code = apply_filters( 'graphql_response_status_code', self::$http_status_code, $response, $graphql_results, $query, $operation_name, $variables, $user ); - - /** - * Set the response headers - */ - self::set_headers(); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Server/ValidationRules/DisableIntrospection.php b/lib/wp-graphql-1.17.0/src/Server/ValidationRules/DisableIntrospection.php deleted file mode 100644 index 29e037bf..00000000 --- a/lib/wp-graphql-1.17.0/src/Server/ValidationRules/DisableIntrospection.php +++ /dev/null @@ -1,24 +0,0 @@ -setMaxQueryDepth( $max_query_depth ); - } - - /** - * @param \GraphQL\Validator\ValidationContext $context - * - * @return callable[]|mixed[] - */ - public function getVisitor( ValidationContext $context ) { - return $this->invokeIfNeeded( - $context, - // @phpstan-ignore-next-line - [ - NodeKind::OPERATION_DEFINITION => [ - 'leave' => function ( OperationDefinitionNode $operationDefinition ) use ( $context ): void { - $maxDepth = $this->fieldDepth( $operationDefinition ); - - if ( $maxDepth <= $this->getMaxQueryDepth() ) { - return; - } - - $context->reportError( - new Error( $this->errorMessage( $this->getMaxQueryDepth(), $maxDepth ) ) - ); - }, - ], - ] - ); - } - - /** - * Determine field depth - * - * @param mixed $node The node being analyzed - * @param int $depth The depth of the field - * @param int $maxDepth The max depth allowed - * - * @return int|mixed - */ - private function fieldDepth( $node, $depth = 0, $maxDepth = 0 ) { - if ( isset( $node->selectionSet ) && $node->selectionSet instanceof SelectionSetNode ) { - foreach ( $node->selectionSet->selections as $childNode ) { - $maxDepth = $this->nodeDepth( $childNode, $depth, $maxDepth ); - } - } - - return $maxDepth; - } - - /** - * Determine node depth - * - * @param \GraphQL\Language\AST\Node $node The node being analyzed in the operation - * @param int $depth The depth of the operation - * @param int $maxDepth The Max Depth of the operation - * - * @return int|mixed - */ - private function nodeDepth( Node $node, $depth = 0, $maxDepth = 0 ) { - switch ( true ) { - case $node instanceof FieldNode: - // node has children? - if ( isset( $node->selectionSet ) ) { - // update maxDepth if needed - if ( $depth > $maxDepth ) { - $maxDepth = $depth; - } - $maxDepth = $this->fieldDepth( $node, $depth + 1, $maxDepth ); - } - break; - - case $node instanceof InlineFragmentNode: - // node has children? - $maxDepth = $this->fieldDepth( $node, $depth, $maxDepth ); - break; - - case $node instanceof FragmentSpreadNode: - $fragment = $this->getFragment( $node ); - - if ( null !== $fragment ) { - $maxDepth = $this->fieldDepth( $fragment, $depth, $maxDepth ); - } - break; - } - - return $maxDepth; - } - - /** - * Return the maxQueryDepth allowed - * - * @return int - */ - public function getMaxQueryDepth() { - return $this->maxQueryDepth; - } - - /** - * Set max query depth. If equal to 0 no check is done. Must be greater or equal to 0. - * - * @param int $maxQueryDepth The max query depth to allow for GraphQL operations - * - * @return void - */ - public function setMaxQueryDepth( int $maxQueryDepth ) { - $this->checkIfGreaterOrEqualToZero( 'maxQueryDepth', $maxQueryDepth ); - - $this->maxQueryDepth = (int) $maxQueryDepth; - } - - /** - * Return the max query depth error message - * - * @param int $max The max number of levels to allow in GraphQL operation - * @param int $count The number of levels in the current operation - * - * @return string - */ - public function errorMessage( $max, $count ) { - return sprintf( 'The server administrator has limited the max query depth to %d, but the requested query has %d levels.', $max, $count ); - } - - /** - * Determine whether the rule should be enabled - * - * @return bool - */ - protected function isEnabled() { - $is_enabled = false; - - $enabled = get_graphql_setting( 'query_depth_enabled', 'off' ); - - if ( 'on' === $enabled && absint( $this->getMaxQueryDepth() ) && 1 <= $this->getMaxQueryDepth() ) { - $is_enabled = true; - } - - return $is_enabled; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Server/ValidationRules/RequireAuthentication.php b/lib/wp-graphql-1.17.0/src/Server/ValidationRules/RequireAuthentication.php deleted file mode 100644 index b7312c96..00000000 --- a/lib/wp-graphql-1.17.0/src/Server/ValidationRules/RequireAuthentication.php +++ /dev/null @@ -1,106 +0,0 @@ -ID ) { - return false; - } - - return true; - } - - /** - * @param \GraphQL\Validator\ValidationContext $context - * - * @return callable[]|mixed[] - */ - public function getVisitor( ValidationContext $context ) { - $allowed_root_fields = []; - - /** - * Filters the allowed - * - * @param array $allowed_root_fields The Root fields allowed to be requested without authentication - * @param \GraphQL\Validator\ValidationContext $context The Validation context of the field being executed. - */ - $allowed_root_fields = apply_filters( 'graphql_require_authentication_allowed_fields', $allowed_root_fields, $context ); - - return $this->invokeIfNeeded( - $context, - [ - NodeKind::FIELD => static function ( FieldNode $node ) use ( $context, $allowed_root_fields ) { - $parent_type = $context->getParentType(); - - if ( ! $parent_type instanceof Type || empty( $parent_type->name ) ) { - return; - } - - if ( ! in_array( $parent_type->name, [ 'RootQuery', 'RootSubscription', 'RootMutation' ], true ) ) { - return; - } - - if ( empty( $allowed_root_fields ) || ! is_array( $allowed_root_fields ) || ! in_array( $node->name->value, $allowed_root_fields, true ) ) { - $context->reportError( - new Error( - sprintf( - // translators: %s is the field name - __( 'The field "%s" cannot be accessed without authentication.', 'wp-graphql' ), - $context->getParentType() . '.' . $node->name->value - ), - //@phpstan-ignore-next-line - [ $node ] - ) - ); - } - }, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Server/WPHelper.php b/lib/wp-graphql-1.17.0/src/Server/WPHelper.php deleted file mode 100644 index 3604531d..00000000 --- a/lib/wp-graphql-1.17.0/src/Server/WPHelper.php +++ /dev/null @@ -1,99 +0,0 @@ -parse_params( $bodyParams ); - - $parsed_query_params = $this->parse_extensions( wp_unslash( $queryParams ) ); - - $request_context = [ - 'method' => $method, - 'query_params' => ! empty( $parsed_query_params ) ? $parsed_query_params : null, - 'body_params' => ! empty( $parsed_body_params ) ? $parsed_body_params : null, - ]; - - /** - * Allow the request data to be filtered. Previously this filter was only - * applied to non-HTTP requests. Since 0.2.0, we will apply it to all - * requests. - * - * This is a great place to hook if you are interested in implementing - * persisted queries (and ends up being a bit more flexible than - * graphql-php's built-in persistentQueryLoader). - * - * @param array $data An array containing the pieces of the data of the GraphQL request - * @param array $request_context An array containing the both body and query params - */ - if ( 'GET' === $method ) { - $parsed_query_params = apply_filters( 'graphql_request_data', $parsed_query_params, $request_context ); - // In GET requests there cannot be any body params so it's empty. - return parent::parseRequestParams( $method, [], $parsed_query_params ); - } - - // In POST requests the query params are ignored by default but users can - // merge them into the body params manually using the $request_context if - // needed. - $parsed_body_params = apply_filters( 'graphql_request_data', $parsed_body_params, $request_context ); - return parent::parseRequestParams( $method, $parsed_body_params, [] ); - } - - /** - * Parse parameters and proxy to parse_extensions. - * - * @param array $params Request parameters. - * @return array - */ - private function parse_params( $params ) { - if ( isset( $params[0] ) ) { - return array_map( [ $this, 'parse_extensions' ], $params ); - } - - return $this->parse_extensions( $params ); - } - - /** - * Parse query extensions. - * - * @param array $params Request parameters. - * @return array - */ - private function parse_extensions( $params ) { - if ( isset( $params['extensions'] ) && is_string( $params['extensions'] ) ) { - $tmp = json_decode( $params['extensions'], true ); - if ( ! json_last_error() ) { - $params['extensions'] = $tmp; - } - } - - // Apollo server/client compatibility: look for the query id in extensions - if ( isset( $params['extensions']['persistedQuery']['sha256Hash'] ) && ! isset( $params['queryId'] ) ) { - $params['queryId'] = $params['extensions']['persistedQuery']['sha256Hash']; - unset( $params['extensions']['persistedQuery'] ); - } - - return $params; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/Comments.php b/lib/wp-graphql-1.17.0/src/Type/Connection/Comments.php deleted file mode 100644 index 63605618..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Connection/Comments.php +++ /dev/null @@ -1,263 +0,0 @@ - 'User', - 'resolve' => static function ( User $user, $args, $context, $info ) { - $resolver = new CommentConnectionResolver( $user, $args, $context, $info ); - - return $resolver->set_query_arg( 'user_id', absint( $user->userId ) )->get_connection(); - }, - - ] - ) - ); - - register_graphql_connection( - self::get_connection_config( - [ - 'fromType' => 'Comment', - 'toType' => 'Comment', - 'fromFieldName' => 'parent', - 'connectionTypeName' => 'CommentToParentCommentConnection', - 'oneToOne' => true, - 'resolve' => static function ( Comment $comment, $args, $context, $info ) { - $resolver = new CommentConnectionResolver( $comment, $args, $context, $info ); - - return ! empty( $comment->comment_parent_id ) ? $resolver->one_to_one()->set_query_arg( 'comment__in', [ $comment->comment_parent_id ] )->get_connection() : null; - }, - ] - ) - ); - - /** - * Register connection from Comment to children comments - */ - register_graphql_connection( - self::get_connection_config( - [ - 'fromType' => 'Comment', - 'fromFieldName' => 'replies', - 'resolve' => static function ( Comment $comment, $args, $context, $info ) { - $resolver = new CommentConnectionResolver( $comment, $args, $context, $info ); - - return $resolver->set_query_arg( 'parent', absint( $comment->commentId ) )->get_connection(); - }, - ] - ) - ); - } - - /** - * Given an array of $args, this returns the connection config, merging the provided args - * with the defaults - * - * @param array $args - * - * @return array - */ - public static function get_connection_config( $args = [] ) { - $defaults = [ - 'fromType' => 'RootQuery', - 'toType' => 'Comment', - 'fromFieldName' => 'comments', - 'connectionArgs' => self::get_connection_args(), - 'resolve' => static function ( $root, $args, $context, $info ) { - return DataSource::resolve_comments_connection( $root, $args, $context, $info ); - }, - ]; - - return array_merge( $defaults, $args ); - } - - /** - * This returns the connection args for the Comment connection - * - * @return array - */ - public static function get_connection_args() { - return [ - 'authorEmail' => [ - 'type' => 'String', - 'description' => __( 'Comment author email address.', 'wp-graphql' ), - ], - 'authorUrl' => [ - 'type' => 'String', - 'description' => __( 'Comment author URL.', 'wp-graphql' ), - ], - 'authorIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of author IDs to include comments for.', 'wp-graphql' ), - ], - 'authorNotIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of author IDs to exclude comments for.', 'wp-graphql' ), - ], - 'commentIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of comment IDs to include.', 'wp-graphql' ), - ], - 'commentNotIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of IDs of users whose unapproved comments will be returned by the query regardless of status.', 'wp-graphql' ), - ], - 'commentType' => [ - 'type' => 'String', - 'description' => __( 'Include comments of a given type.', 'wp-graphql' ), - ], - 'commentTypeIn' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'Include comments from a given array of comment types.', 'wp-graphql' ), - ], - 'commentTypeNotIn' => [ - 'type' => 'String', - 'description' => __( 'Exclude comments from a given array of comment types.', 'wp-graphql' ), - ], - 'contentAuthor' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Content object author ID to limit results by.', 'wp-graphql' ), - ], - 'contentAuthorIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of author IDs to retrieve comments for.', 'wp-graphql' ), - ], - 'contentAuthorNotIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of author IDs *not* to retrieve comments for.', 'wp-graphql' ), - ], - 'contentId' => [ - 'type' => 'ID', - 'description' => __( 'Limit results to those affiliated with a given content object ID.', 'wp-graphql' ), - ], - 'contentIdIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of content object IDs to include affiliated comments for.', 'wp-graphql' ), - ], - 'contentIdNotIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of content object IDs to exclude affiliated comments for.', 'wp-graphql' ), - ], - 'contentStatus' => [ - 'type' => [ - 'list_of' => 'PostStatusEnum', - ], - 'description' => __( 'Array of content object statuses to retrieve affiliated comments for. Pass \'any\' to match any value.', 'wp-graphql' ), - ], - 'contentType' => [ - 'type' => [ - 'list_of' => 'ContentTypeEnum', - ], - 'description' => __( 'Content object type or array of types to retrieve affiliated comments for. Pass \'any\' to match any value.', 'wp-graphql' ), - ], - 'contentName' => [ - 'type' => 'String', - 'description' => __( 'Content object name (i.e. slug ) to retrieve affiliated comments for.', 'wp-graphql' ), - ], - 'contentParent' => [ - 'type' => 'Int', - 'description' => __( 'Content Object parent ID to retrieve affiliated comments for.', 'wp-graphql' ), - ], - 'includeUnapproved' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of IDs or email addresses of users whose unapproved comments will be returned by the query regardless of $status. Default empty', 'wp-graphql' ), - ], - 'karma' => [ - 'type' => 'Int', - 'description' => __( 'Karma score to retrieve matching comments for.', 'wp-graphql' ), - ], - 'orderby' => [ - 'type' => 'CommentsConnectionOrderbyEnum', - 'description' => __( 'Field to order the comments by.', 'wp-graphql' ), - ], - 'order' => [ - 'type' => 'OrderEnum', - 'description' => __( 'The cardinality of the order of the connection', 'wp-graphql' ), - ], - 'parent' => [ - 'type' => 'Int', - 'description' => __( 'Parent ID of comment to retrieve children of.', 'wp-graphql' ), - ], - 'parentIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of parent IDs of comments to retrieve children for.', 'wp-graphql' ), - ], - 'parentNotIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of parent IDs of comments *not* to retrieve children for.', 'wp-graphql' ), - ], - 'search' => [ - 'type' => 'String', - 'description' => __( 'Search term(s) to retrieve matching comments for.', 'wp-graphql' ), - ], - 'status' => [ - 'type' => 'String', - 'description' => __( 'Comment status to limit results by.', 'wp-graphql' ), - ], - 'userId' => [ - 'type' => 'ID', - 'description' => __( 'Include comments for a specific user ID.', 'wp-graphql' ), - ], - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/MenuItems.php b/lib/wp-graphql-1.17.0/src/Type/Connection/MenuItems.php deleted file mode 100644 index 54033039..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Connection/MenuItems.php +++ /dev/null @@ -1,128 +0,0 @@ - 'MenuItem', - 'fromFieldName' => 'childItems', - 'resolve' => static function ( MenuItem $menu_item, $args, AppContext $context, ResolveInfo $info ) { - if ( empty( $menu_item->menuId ) || empty( $menu_item->databaseId ) ) { - return null; - } - - $resolver = new MenuItemConnectionResolver( $menu_item, $args, $context, $info ); - $resolver->set_query_arg( 'nav_menu', $menu_item->menuId ); - $resolver->set_query_arg( 'meta_key', '_menu_item_menu_item_parent' ); - $resolver->set_query_arg( 'meta_value', (int) $menu_item->databaseId ); - return $resolver->get_connection(); - }, - ] - ) - ); - - /** - * Register the MenuToMenuItemsConnection - */ - register_graphql_connection( - self::get_connection_config( - [ - 'fromType' => 'Menu', - 'toType' => 'MenuItem', - 'resolve' => static function ( Menu $menu, $args, AppContext $context, ResolveInfo $info ) { - $resolver = new MenuItemConnectionResolver( $menu, $args, $context, $info ); - $resolver->set_query_arg( - 'tax_query', - [ - [ - 'taxonomy' => 'nav_menu', - 'field' => 'term_id', - 'terms' => (int) $menu->menuId, - 'include_children' => true, - 'operator' => 'IN', - ], - ] - ); - - return $resolver->get_connection(); - }, - ] - ) - ); - } - - /** - * Given an array of $args, returns the args for the connection with the provided args merged - * - * @param array $args - * - * @return array - */ - public static function get_connection_config( $args = [] ) { - return array_merge( - [ - 'fromType' => 'RootQuery', - 'fromFieldName' => 'menuItems', - 'toType' => 'MenuItem', - 'connectionArgs' => [ - 'id' => [ - 'type' => 'Int', - 'description' => __( 'The database ID of the object', 'wp-graphql' ), - ], - 'location' => [ - 'type' => 'MenuLocationEnum', - 'description' => __( 'The menu location for the menu being queried', 'wp-graphql' ), - ], - 'parentId' => [ - 'type' => 'ID', - 'description' => __( 'The ID of the parent menu object', 'wp-graphql' ), - ], - 'parentDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'The database ID of the parent menu object', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new MenuItemConnectionResolver( $source, $args, $context, $info ); - $connection = $resolver->get_connection(); - - return $connection; - }, - ], - $args - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/PostObjects.php b/lib/wp-graphql-1.17.0/src/Type/Connection/PostObjects.php deleted file mode 100644 index fa577221..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Connection/PostObjects.php +++ /dev/null @@ -1,599 +0,0 @@ - 'ContentType', - 'toType' => 'ContentNode', - 'fromFieldName' => 'contentNodes', - 'connectionArgs' => self::get_connection_args(), - 'queryClass' => 'WP_Query', - 'resolve' => static function ( PostType $post_type, $args, AppContext $context, ResolveInfo $info ) { - $resolver = new PostObjectConnectionResolver( $post_type, $args, $context, $info ); - $resolver->set_query_arg( 'post_type', $post_type->name ); - - return $resolver->get_connection(); - }, - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'Comment', - 'toType' => 'ContentNode', - 'queryClass' => 'WP_Query', - 'oneToOne' => true, - 'fromFieldName' => 'commentedOn', - 'resolve' => static function ( Comment $comment, $args, AppContext $context, ResolveInfo $info ) { - if ( empty( $comment->comment_post_ID ) || ! absint( $comment->comment_post_ID ) ) { - return null; - } - $id = absint( $comment->comment_post_ID ); - $resolver = new PostObjectConnectionResolver( $comment, $args, $context, $info, 'any' ); - - return $resolver->one_to_one()->set_query_arg( 'p', $id )->set_query_arg( 'post_parent', null )->get_connection(); - }, - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'NodeWithRevisions', - 'toType' => 'ContentNode', - 'fromFieldName' => 'revisionOf', - 'description' => __( 'If the current node is a revision, this field exposes the node this is a revision of. Returns null if the node is not a revision of another node.', 'wp-graphql' ), - 'oneToOne' => true, - 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { - if ( ! $post->isRevision || ! isset( $post->parentDatabaseId ) || ! absint( $post->parentDatabaseId ) ) { - return null; - } - - $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info ); - $resolver->set_query_arg( 'p', $post->parentDatabaseId ); - - return $resolver->one_to_one()->get_connection(); - }, - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'RootQuery', - 'toType' => 'ContentNode', - 'queryClass' => 'WP_Query', - 'fromFieldName' => 'contentNodes', - 'connectionArgs' => self::get_connection_args(), - 'resolve' => static function ( $source, $args, $context, $info ) { - $post_types = isset( $args['where']['contentTypes'] ) && is_array( $args['where']['contentTypes'] ) ? $args['where']['contentTypes'] : \WPGraphQL::get_allowed_post_types(); - - return DataSource::resolve_post_objects_connection( $source, $args, $context, $info, $post_types ); - }, - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'HierarchicalContentNode', - 'toType' => 'ContentNode', - 'fromFieldName' => 'parent', - 'connectionTypeName' => 'HierarchicalContentNodeToParentContentNodeConnection', - 'description' => __( 'The parent of the node. The parent object can be of various types', 'wp-graphql' ), - 'oneToOne' => true, - 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { - if ( ! isset( $post->parentDatabaseId ) || ! absint( $post->parentDatabaseId ) ) { - return null; - } - - $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info ); - $resolver->set_query_arg( 'p', $post->parentDatabaseId ); - - return $resolver->one_to_one()->get_connection(); - }, - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'HierarchicalContentNode', - 'fromFieldName' => 'children', - 'toType' => 'ContentNode', - 'connectionTypeName' => 'HierarchicalContentNodeToContentNodeChildrenConnection', - 'connectionArgs' => self::get_connection_args(), - 'queryClass' => 'WP_Query', - 'resolve' => static function ( Post $post, $args, $context, $info ) { - if ( $post->isRevision ) { - $id = $post->parentDatabaseId; - } else { - $id = $post->ID; - } - - $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info, 'any' ); - $resolver->set_query_arg( 'post_parent', $id ); - - return $resolver->get_connection(); - }, - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'HierarchicalContentNode', - 'toType' => 'ContentNode', - 'fromFieldName' => 'ancestors', - 'connectionArgs' => self::get_connection_args(), - 'connectionTypeName' => 'HierarchicalContentNodeToContentNodeAncestorsConnection', - 'queryClass' => 'WP_Query', - 'description' => __( 'Returns ancestors of the node. Default ordered as lowest (closest to the child) to highest (closest to the root).', 'wp-graphql' ), - 'resolve' => static function ( Post $post, $args, $context, $info ) { - $ancestors = get_ancestors( $post->ID, '', 'post_type' ); - if ( empty( $ancestors ) || ! is_array( $ancestors ) ) { - return null; - } - $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info ); - $resolver->set_query_arg( 'post__in', $ancestors ); - $resolver->set_query_arg( 'orderby', 'post__in' ); - - return $resolver->get_connection(); - }, - ] - ); - - /** - * Register Connections to PostObjects - * - * @var \WP_Post_Type[] $allowed_post_types - */ - $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects' ); - - foreach ( $allowed_post_types as $post_type_object ) { - - /** - * Registers the RootQuery connection for each post_type - */ - if ( true === $post_type_object->graphql_register_root_connection && 'revision' !== $post_type_object->name ) { - $root_query_from_field_name = Utils::format_field_name( $post_type_object->graphql_plural_name ); - - // Prevent field name conflicts with the singular PostObject type. - if ( $post_type_object->graphql_single_name === $post_type_object->graphql_plural_name ) { - $root_query_from_field_name = 'all' . ucfirst( $post_type_object->graphql_single_name ); - } - - register_graphql_connection( - self::get_connection_config( - $post_type_object, - [ - 'fromFieldName' => $root_query_from_field_name, - ] - ) - ); - } - - /** - * Any post type that supports author should have a connection from User->Author - */ - if ( true === post_type_supports( $post_type_object->name, 'author' ) ) { - - /** - * Registers the User connection for each post_type - */ - register_graphql_connection( - self::get_connection_config( - $post_type_object, - [ - 'fromType' => 'User', - 'resolve' => static function ( User $user, $args, AppContext $context, ResolveInfo $info ) use ( $post_type_object ) { - $resolver = new PostObjectConnectionResolver( $user, $args, $context, $info, $post_type_object->name ); - $resolver->set_query_arg( 'author', $user->userId ); - - return $resolver->get_connection(); - }, - ] - ) - ); - } - } - } - - /** - * Given the Post Type Object and an array of args, this returns an array of args for use in - * registering a connection. - * - * @param mixed|\WP_Post_Type|\WP_Taxonomy $graphql_object The post type object for the post_type having a - * connection registered to it - * @param array $args The custom args to modify the connection registration - * - * @return array - */ - public static function get_connection_config( $graphql_object, $args = [] ) { - $connection_args = self::get_connection_args( [], $graphql_object ); - - if ( 'revision' === $graphql_object->name ) { - unset( $connection_args['status'] ); - unset( $connection_args['stati'] ); - } - - return array_merge( - [ - 'fromType' => 'RootQuery', - 'toType' => $graphql_object->graphql_single_name, - 'queryClass' => 'WP_Query', - 'fromFieldName' => lcfirst( $graphql_object->graphql_plural_name ), - 'connectionArgs' => $connection_args, - 'resolve' => static function ( $root, $args, $context, $info ) use ( $graphql_object ) { - return DataSource::resolve_post_objects_connection( $root, $args, $context, $info, $graphql_object->name ); - }, - ], - $args - ); - } - - /** - * Given an optional array of args, this returns the args to be used in the connection - * - * @param array $args The args to modify the defaults - * @param mixed|\WP_Post_Type|\WP_Taxonomy $post_type_object The post type the connection is going to - * - * @return array - */ - public static function get_connection_args( $args = [], $post_type_object = null ) { - $fields = [ - /** - * Search Parameter - * - * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Search_Parameter - * @since 0.0.5 - */ - 'search' => [ - 'name' => 'search', - 'type' => 'String', - 'description' => __( 'Show Posts based on a keyword search', 'wp-graphql' ), - ], - - /** - * Post & Page Parameters - * - * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Post_.26_Page_Parameters - * @since 0.0.5 - */ - 'id' => [ - 'type' => 'Int', - 'description' => __( 'Specific database ID of the object', 'wp-graphql' ), - ], - 'in' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of IDs for the objects to retrieve', 'wp-graphql' ), - ], - 'notIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Specify IDs NOT to retrieve. If this is used in the same query as "in", it will be ignored', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'Slug / post_name of the object', 'wp-graphql' ), - ], - 'nameIn' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'Specify objects to retrieve. Use slugs', 'wp-graphql' ), - ], - 'parent' => [ - 'type' => 'ID', - 'description' => __( 'Use ID to return only children. Use 0 to return only top-level items', 'wp-graphql' ), - ], - 'parentIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Specify objects whose parent is in an array', 'wp-graphql' ), - ], - 'parentNotIn' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Specify posts whose parent is not in an array', 'wp-graphql' ), - ], - 'title' => [ - 'type' => 'String', - 'description' => __( 'Title of the object', 'wp-graphql' ), - ], - - /** - * Password parameters - * - * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Password_Parameters - * @since 0.0.2 - */ - 'hasPassword' => [ - 'type' => 'Boolean', - 'description' => __( 'True for objects with passwords; False for objects without passwords; null for all objects with or without passwords', 'wp-graphql' ), - ], - 'password' => [ - 'type' => 'String', - 'description' => __( 'Show posts with a specific password.', 'wp-graphql' ), - ], - - /** - * NOTE: post_type is intentionally not supported on connections to Single post types as - * the connection to the singular Post Type already sets this argument as the entry - * point to the Graph - * - * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters - * @since 0.0.2 - */ - - /** - * Status parameters - * - * @see : https://developer.wordpress.org/reference/classes/wp_query/#status-parameters - * @since 0.0.2 - */ - 'status' => [ - 'type' => 'PostStatusEnum', - 'description' => __( 'Show posts with a specific status.', 'wp-graphql' ), - ], - 'stati' => [ - 'type' => [ - 'list_of' => 'PostStatusEnum', - ], - 'description' => __( 'Retrieve posts where post status is in an array.', 'wp-graphql' ), - ], - - /** - * Order & Orderby parameters - * - * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters - * @since 0.0.2 - */ - 'orderby' => [ - 'type' => [ - 'list_of' => 'PostObjectsConnectionOrderbyInput', - ], - 'description' => __( 'What parameter to use to order the objects by.', 'wp-graphql' ), - ], - - /** - * Date parameters - * - * @see https://developer.wordpress.org/reference/classes/wp_query/#date-parameters - */ - 'dateQuery' => [ - 'type' => 'DateQueryInput', - 'description' => __( 'Filter the connection based on dates', 'wp-graphql' ), - ], - - /** - * Mime type parameters - * - * @see https://developer.wordpress.org/reference/classes/wp_query/#mime-type-parameters - */ - 'mimeType' => [ - 'type' => 'MimeTypeEnum', - 'description' => __( 'Get objects with a specific mimeType property', 'wp-graphql' ), - ], - ]; - - /** - * If the connection is to a single post type, add additional arguments. - * - * If the connection is to many post types, the `$post_type_object` will not be an instance - * of \WP_Post_Type, and we should not add these additional arguments because it - * confuses the connection args for connections of plural post types. - * - * For example, if you have one Post Type that supports author and another that doesn't - * we don't want to expose the `author` filter for a plural connection of multiple post types - * as it's misleading to be able to filter by author on a post type that doesn't have - * authors. - * - * If folks want to enable these arguments, they can filter them back in per-connection, but - * by default WPGraphQL is exposing the least common denominator (the fields that are shared - * by _all_ post types in a multi-post-type connection) - * - * Here's a practical example: - * - * Lets's say you register a "House" post type and it doesn't support author. - * - * The "House" Post Type will show in the `contentNodes` connection, which is a connection - * to many post types. - * - * We could (pseudo code) query like so: - * - * { - * contentNodes( where: { contentTypes: [ HOUSE ] ) { - * nodes { - * id - * title - * ...on House { - * ...someHouseFields - * } - * } - * } - * } - * - * But since houses don't have authors, it doesn't make sense to have WPGraphQL expose the - * ability to query four houses filtered by author. - * - * ``` - *{ - * contentNodes( where: { author: "some author input" contentTypes: [ HOUSE ] ) { - * nodes { - * id - * title - * ...on House { - * ...someHouseFields - * } - * } - * } - * } - * ``` - * - * We want to output filters on connections based on what's actually possible, and filtering - * houses by author isn't possible, so exposing it in the Schema is quite misleading to - * consumers. - */ - if ( isset( $post_type_object ) && $post_type_object instanceof WP_Post_Type ) { - - /** - * Add arguments to post types that support author - */ - if ( true === post_type_supports( $post_type_object->name, 'author' ) ) { - /** - * Author $args - * - * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters - * @since 0.0.5 - */ - $fields['author'] = [ - 'type' => 'Int', - 'description' => __( 'The user that\'s connected as the author of the object. Use the userId for the author object.', 'wp-graphql' ), - ]; - $fields['authorName'] = [ - 'type' => 'String', - 'description' => __( 'Find objects connected to the author by the author\'s nicename', 'wp-graphql' ), - ]; - $fields['authorIn'] = [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Find objects connected to author(s) in the array of author\'s userIds', 'wp-graphql' ), - ]; - $fields['authorNotIn'] = [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Find objects NOT connected to author(s) in the array of author\'s userIds', 'wp-graphql' ), - ]; - } - - $connected_taxonomies = get_object_taxonomies( $post_type_object->name ); - if ( ! empty( $connected_taxonomies ) && in_array( 'category', $connected_taxonomies, true ) ) { - /** - * Category $args - * - * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Category_Parameters - * @since 0.0.5 - */ - $fields['categoryId'] = [ - 'type' => 'Int', - 'description' => __( 'Category ID', 'wp-graphql' ), - ]; - $fields['categoryName'] = [ - 'type' => 'String', - 'description' => __( 'Use Category Slug', 'wp-graphql' ), - ]; - $fields['categoryIn'] = [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of category IDs, used to display objects from one category OR another', 'wp-graphql' ), - ]; - $fields['categoryNotIn'] = [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of category IDs, used to display objects from one category OR another', 'wp-graphql' ), - ]; - } - - if ( ! empty( $connected_taxonomies ) && in_array( 'post_tag', $connected_taxonomies, true ) ) { - /** - * Tag $args - * - * @see : https://codex.wordpress.org/Class_Reference/WP_Query#Tag_Parameters - * @since 0.0.5 - */ - $fields['tag'] = [ - 'type' => 'String', - 'description' => __( 'Tag Slug', 'wp-graphql' ), - ]; - $fields['tagId'] = [ - 'type' => 'String', - 'description' => __( 'Use Tag ID', 'wp-graphql' ), - ]; - $fields['tagIn'] = [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of tag IDs, used to display objects from one tag OR another', 'wp-graphql' ), - ]; - $fields['tagNotIn'] = [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of tag IDs, used to display objects from one tag OR another', 'wp-graphql' ), - ]; - $fields['tagSlugAnd'] = [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'Array of tag slugs, used to display objects from one tag AND another', 'wp-graphql' ), - ]; - $fields['tagSlugIn'] = [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'Array of tag slugs, used to include objects in ANY specified tags', 'wp-graphql' ), - ]; - } - } elseif ( $post_type_object instanceof WP_Taxonomy ) { - /** - * Taxonomy-specific Content Type $args - * - * @see : https://developer.wordpress.org/reference/classes/wp_query/#post-type-parameters - */ - $args['contentTypes'] = [ - 'type' => [ 'list_of' => 'ContentTypesOf' . \WPGraphQL\Utils\Utils::format_type_name( $post_type_object->graphql_single_name ) . 'Enum' ], - 'description' => __( 'The Types of content to filter', 'wp-graphql' ), - ]; - } else { - /** - * Handle cases when the connection is for many post types - */ - - /** - * Content Type $args - * - * @see : https://developer.wordpress.org/reference/classes/wp_query/#post-type-parameters - */ - $args['contentTypes'] = [ - 'type' => [ 'list_of' => 'ContentTypeEnum' ], - 'description' => __( 'The Types of content to filter', 'wp-graphql' ), - ]; - } - - return array_merge( $fields, $args ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/Taxonomies.php b/lib/wp-graphql-1.17.0/src/Type/Connection/Taxonomies.php deleted file mode 100644 index 61fe35fb..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Connection/Taxonomies.php +++ /dev/null @@ -1,44 +0,0 @@ - 'RootQuery', - 'toType' => 'Taxonomy', - 'fromFieldName' => 'taxonomies', - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new TaxonomyConnectionResolver( $source, $args, $context, $info ); - return $resolver->get_connection(); - }, - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'ContentType', - 'toType' => 'Taxonomy', - 'fromFieldName' => 'connectedTaxonomies', - 'resolve' => static function ( PostType $source, $args, $context, $info ) { - if ( empty( $source->taxonomies ) ) { - return null; - } - $resolver = new TaxonomyConnectionResolver( $source, $args, $context, $info ); - $resolver->setQueryArg( 'in', $source->taxonomies ); - return $resolver->get_connection(); - }, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/TermObjects.php b/lib/wp-graphql-1.17.0/src/Type/Connection/TermObjects.php deleted file mode 100644 index a8f054c4..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Connection/TermObjects.php +++ /dev/null @@ -1,220 +0,0 @@ - 'RootQuery', - 'toType' => 'TermNode', - 'queryClass' => 'WP_Term_Query', - 'fromFieldName' => 'terms', - 'connectionArgs' => self::get_connection_args( - [ - 'taxonomies' => [ - 'type' => [ 'list_of' => 'TaxonomyEnum' ], - 'description' => __( 'The Taxonomy to filter terms by', 'wp-graphql' ), - ], - ] - ), - 'resolve' => static function ( $source, $args, $context, $info ) { - $taxonomies = isset( $args['where']['taxonomies'] ) && is_array( $args['where']['taxonomies'] ) ? $args['where']['taxonomies'] : \WPGraphQL::get_allowed_taxonomies(); - $resolver = new TermObjectConnectionResolver( $source, $args, $context, $info, array_values( $taxonomies ) ); - $connection = $resolver->get_connection(); - - return $connection; - }, - ] - ); - - /** @var \WP_Taxonomy[] $allowed_taxonomies */ - $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); - - /** - * Loop through the allowed_taxonomies to register appropriate connections - */ - foreach ( $allowed_taxonomies as $tax_object ) { - if ( ! $tax_object->graphql_register_root_connection ) { - continue; - } - - $root_query_from_field_name = Utils::format_field_name( $tax_object->graphql_plural_name ); - - // Prevent field name conflicts with the singular TermObject type. - if ( $tax_object->graphql_single_name === $tax_object->graphql_plural_name ) { - $root_query_from_field_name = 'all' . ucfirst( $tax_object->graphql_single_name ); - } - - /** - * Registers the RootQuery connection for each allowed taxonomy's TermObjects - */ - register_graphql_connection( - self::get_connection_config( - $tax_object, - [ - 'fromFieldName' => $root_query_from_field_name, - ] - ) - ); - } - } - - /** - * Given the Taxonomy Object and an array of args, this returns an array of args for use in - * registering a connection. - * - * @param \WP_Taxonomy $tax_object The taxonomy object for the taxonomy having a - * connection registered to it - * @param array $args The custom args to modify the connection registration - * - * @return array - */ - public static function get_connection_config( $tax_object, $args = [] ) { - $defaults = [ - 'fromType' => 'RootQuery', - 'queryClass' => 'WP_Term_Query', - 'toType' => $tax_object->graphql_single_name, - 'fromFieldName' => $tax_object->graphql_plural_name, - 'connectionArgs' => self::get_connection_args(), - 'resolve' => static function ( $root, $args, $context, $info ) use ( $tax_object ) { - return DataSource::resolve_term_objects_connection( $root, $args, $context, $info, $tax_object->name ); - }, - ]; - - return array_merge( $defaults, $args ); - } - - /** - * Given an optional array of args, this returns the args to be used in the connection - * - * @param array $args The args to modify the defaults - * - * @return array - */ - public static function get_connection_args( $args = [] ) { - return array_merge( - [ - 'childless' => [ - 'type' => 'Boolean', - 'description' => __( 'True to limit results to terms that have no children. This parameter has no effect on non-hierarchical taxonomies. Default false.', 'wp-graphql' ), - ], - 'childOf' => [ - 'type' => 'Int', - 'description' => __( 'Term ID to retrieve child terms of. If multiple taxonomies are passed, $child_of is ignored. Default 0.', 'wp-graphql' ), - ], - 'cacheDomain' => [ - 'type' => 'String', - 'description' => __( 'Unique cache key to be produced when this query is stored in an object cache. Default is \'core\'.', 'wp-graphql' ), - ], - 'descriptionLike' => [ - 'type' => 'String', - 'description' => __( 'Retrieve terms where the description is LIKE the input value. Default empty.', 'wp-graphql' ), - ], - 'exclude' => [ // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of term ids to exclude. If $include is non-empty, $exclude is ignored. Default empty array.', 'wp-graphql' ), - ], - 'excludeTree' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of term ids to exclude along with all of their descendant terms. If $include is non-empty, $exclude_tree is ignored. Default empty array.', 'wp-graphql' ), - ], - 'hideEmpty' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to hide terms not assigned to any posts. Accepts true or false. Default false', 'wp-graphql' ), - ], - 'hierarchical' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to include terms that have non-empty descendants (even if $hide_empty is set to true). Default true.', 'wp-graphql' ), - ], - 'include' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of term ids to include. Default empty array.', 'wp-graphql' ), - ], - 'name' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'Array of names to return term(s) for. Default empty.', 'wp-graphql' ), - ], - 'nameLike' => [ - 'type' => 'String', - 'description' => __( 'Retrieve terms where the name is LIKE the input value. Default empty.', 'wp-graphql' ), - ], - 'objectIds' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of object IDs. Results will be limited to terms associated with these objects.', 'wp-graphql' ), - ], - 'orderby' => [ - 'type' => 'TermObjectsConnectionOrderbyEnum', - 'description' => __( 'Field(s) to order terms by. Defaults to \'name\'.', 'wp-graphql' ), - ], - 'order' => [ - 'type' => 'OrderEnum', - 'description' => __( 'Direction the connection should be ordered in', 'wp-graphql' ), - ], - 'padCounts' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to pad the quantity of a term\'s children in the quantity of each term\'s "count" object variable. Default false.', 'wp-graphql' ), - ], - 'parent' => [ - 'type' => 'Int', - 'description' => __( 'Parent term ID to retrieve direct-child terms of. Default empty.', 'wp-graphql' ), - ], - 'search' => [ - 'type' => 'String', - 'description' => __( 'Search criteria to match terms. Will be SQL-formatted with wildcards before and after. Default empty.', 'wp-graphql' ), - ], - 'slug' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'Array of slugs to return term(s) for. Default empty.', 'wp-graphql' ), - ], - 'termTaxonomId' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of term taxonomy IDs, to match when querying terms.', 'wp-graphql' ), - 'deprecationReason' => __( 'Use `termTaxonomyId` instead', 'wp-graphql' ), - ], - 'termTaxonomyId' => [ - 'type' => [ - 'list_of' => 'ID', - ], - 'description' => __( 'Array of term taxonomy IDs, to match when querying terms.', 'wp-graphql' ), - ], - 'updateTermMetaCache' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to prime meta caches for matched terms. Default true.', 'wp-graphql' ), - ], - ], - $args - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Connection/Users.php b/lib/wp-graphql-1.17.0/src/Type/Connection/Users.php deleted file mode 100644 index 347f7ef1..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Connection/Users.php +++ /dev/null @@ -1,207 +0,0 @@ - 'RootQuery', - 'toType' => 'User', - 'fromFieldName' => 'users', - 'resolve' => static function ( $source, $args, $context, $info ) { - return DataSource::resolve_users_connection( $source, $args, $context, $info ); - }, - 'connectionArgs' => self::get_connection_args(), - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'ContentNode', - 'toType' => 'User', - 'connectionTypeName' => 'ContentNodeToEditLockConnection', - 'edgeFields' => [ - 'lockTimestamp' => [ - 'type' => 'String', - 'description' => __( 'The timestamp for when the node was last edited', 'wp-graphql' ), - 'resolve' => static function ( $edge ) { - if ( isset( $edge['source'] ) && ( $edge['source'] instanceof Post ) ) { - $edit_lock = $edge['source']->editLock; - $time = ( is_array( $edit_lock ) && ! empty( $edit_lock[0] ) ) ? $edit_lock[0] : null; - return ! empty( $time ) ? Utils::prepare_date_response( $time, gmdate( 'Y-m-d H:i:s', $time ) ) : null; - } - return null; - }, - ], - ], - 'fromFieldName' => 'editingLockedBy', - 'description' => __( 'If a user has edited the node within the past 15 seconds, this will return the user that last edited. Null if the edit lock doesn\'t exist or is greater than 15 seconds', 'wp-graphql' ), - 'oneToOne' => true, - 'resolve' => static function ( Post $source, $args, $context, $info ) { - if ( ! isset( $source->editLock[1] ) || ! absint( $source->editLock[1] ) ) { - return null; - } - - $resolver = new UserConnectionResolver( $source, $args, $context, $info ); - $resolver->one_to_one()->set_query_arg( 'include', [ absint( $source->editLock[1] ) ] ); - - return $resolver->get_connection(); - }, - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'ContentNode', - 'toType' => 'User', - 'fromFieldName' => 'lastEditedBy', - 'connectionTypeName' => 'ContentNodeToEditLastConnection', - 'description' => __( 'The user that most recently edited the node', 'wp-graphql' ), - 'oneToOne' => true, - 'resolve' => static function ( Post $source, $args, $context, $info ) { - if ( empty( $source->editLastId ) ) { - return null; - } - - $resolver = new UserConnectionResolver( $source, $args, $context, $info ); - $resolver->set_query_arg( 'include', [ absint( $source->editLastId ) ] ); - return $resolver->one_to_one()->get_connection(); - }, - ] - ); - - register_graphql_connection( - [ - 'fromType' => 'NodeWithAuthor', - 'toType' => 'User', - 'fromFieldName' => 'author', - 'oneToOne' => true, - 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { - if ( empty( $post->authorDatabaseId ) ) { - return null; - } - - $resolver = new UserConnectionResolver( $post, $args, $context, $info ); - $resolver->set_query_arg( 'include', [ absint( $post->authorDatabaseId ) ] ); - return $resolver->one_to_one()->get_connection(); - }, - ] - ); - } - - /** - * Returns the connection args for use in the connection - * - * @return array - */ - public static function get_connection_args() { - return [ - 'role' => [ - 'type' => 'UserRoleEnum', - 'description' => __( 'An array of role names that users must match to be included in results. Note that this is an inclusive list: users must match *each* role.', 'wp-graphql' ), - ], - 'roleIn' => [ - 'type' => [ - 'list_of' => 'UserRoleEnum', - ], - 'description' => __( 'An array of role names. Matched users must have at least one of these roles.', 'wp-graphql' ), - ], - 'roleNotIn' => [ - 'type' => [ - 'list_of' => 'UserRoleEnum', - ], - 'description' => __( 'An array of role names to exclude. Users matching one or more of these roles will not be included in results.', 'wp-graphql' ), - ], - 'include' => [ - 'type' => [ - 'list_of' => 'Int', - ], - 'description' => __( 'Array of userIds to include.', 'wp-graphql' ), - ], - 'exclude' => [ // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude - 'type' => [ - 'list_of' => 'Int', - ], - 'description' => __( 'Array of userIds to exclude.', 'wp-graphql' ), - ], - 'search' => [ - 'type' => 'String', - 'description' => __( 'Search keyword. Searches for possible string matches on columns. When "searchColumns" is left empty, it tries to determine which column to search in based on search string.', 'wp-graphql' ), - ], - 'searchColumns' => [ - 'type' => [ - 'list_of' => 'UsersConnectionSearchColumnEnum', - ], - 'description' => __( 'Array of column names to be searched. Accepts \'ID\', \'login\', \'nicename\', \'email\', \'url\'.', 'wp-graphql' ), - ], - 'hasPublishedPosts' => [ - 'type' => [ - 'list_of' => 'ContentTypeEnum', - ], - 'description' => __( 'Pass an array of post types to filter results to users who have published posts in those post types.', 'wp-graphql' ), - ], - 'nicename' => [ - 'type' => 'String', - 'description' => __( 'The user nicename.', 'wp-graphql' ), - ], - 'nicenameIn' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'An array of nicenames to include. Users matching one of these nicenames will be included in results.', 'wp-graphql' ), - ], - 'nicenameNotIn' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'An array of nicenames to exclude. Users matching one of these nicenames will not be included in results.', 'wp-graphql' ), - ], - 'login' => [ - 'type' => 'String', - 'description' => __( 'The user login.', 'wp-graphql' ), - ], - 'loginIn' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'An array of logins to include. Users matching one of these logins will be included in results.', 'wp-graphql' ), - ], - 'loginNotIn' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'An array of logins to exclude. Users matching one of these logins will not be included in results.', 'wp-graphql' ), - ], - 'orderby' => [ - 'type' => [ - 'list_of' => 'UsersConnectionOrderbyInput', - ], - 'description' => __( 'What parameter to use to order the objects by.', 'wp-graphql' ), - ], - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/AvatarRatingEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/AvatarRatingEnum.php deleted file mode 100644 index 8d071dbd..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/AvatarRatingEnum.php +++ /dev/null @@ -1,37 +0,0 @@ - __( "What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are judged in that order. Default is the value of the 'avatar_rating' option", 'wp-graphql' ), - 'values' => [ - 'G' => [ - 'description' => 'Indicates a G level avatar rating level.', - 'value' => 'G', - ], - 'PG' => [ - 'description' => 'Indicates a PG level avatar rating level.', - 'value' => 'PG', - ], - 'R' => [ - 'description' => 'Indicates an R level avatar rating level.', - 'value' => 'R', - ], - 'X' => [ - 'description' => 'Indicates an X level avatar rating level.', - 'value' => 'X', - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/CommentNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/CommentNodeIdTypeEnum.php deleted file mode 100644 index e5250288..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/CommentNodeIdTypeEnum.php +++ /dev/null @@ -1,36 +0,0 @@ - __( 'The Type of Identifier used to fetch a single comment node. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), - 'values' => [ - 'ID' => [ - 'name' => 'ID', - 'value' => 'global_id', - 'description' => __( 'Identify a resource by the (hashed) Global ID.', 'wp-graphql' ), - ], - 'DATABASE_ID' => [ - 'name' => 'DATABASE_ID', - 'value' => 'database_id', - 'description' => __( 'Identify a resource by the Database ID.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/CommentStatusEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/CommentStatusEnum.php deleted file mode 100644 index 560d8238..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/CommentStatusEnum.php +++ /dev/null @@ -1,38 +0,0 @@ - $name ) { - $values[ WPEnumType::get_safe_name( $status ) ] = [ - // translators: %s is the name of the comment status - 'description' => sprintf( __( 'Comments with the %1$s status', 'wp-graphql' ), $name ), - 'value' => $status, - ]; - } - - register_graphql_enum_type( - 'CommentStatusEnum', - [ - 'description' => __( 'The status of the comment object.', 'wp-graphql' ), - 'values' => $values, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/CommentsConnectionOrderbyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/CommentsConnectionOrderbyEnum.php deleted file mode 100644 index 45b8ec9e..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/CommentsConnectionOrderbyEnum.php +++ /dev/null @@ -1,85 +0,0 @@ - __( 'Options for ordering the connection', 'wp-graphql' ), - 'values' => [ - 'COMMENT_AGENT' => [ - 'description' => __( 'Order by browser user agent of the commenter.', 'wp-graphql' ), - 'value' => 'comment_agent', - ], - 'COMMENT_APPROVED' => [ - 'description' => __( 'Order by approval status of the comment.', 'wp-graphql' ), - 'value' => 'comment_approved', - ], - 'COMMENT_AUTHOR' => [ - 'description' => __( 'Order by name of the comment author.', 'wp-graphql' ), - 'value' => 'comment_author', - ], - 'COMMENT_AUTHOR_EMAIL' => [ - 'description' => __( 'Order by e-mail of the comment author.', 'wp-graphql' ), - 'value' => 'comment_author_email', - ], - 'COMMENT_AUTHOR_IP' => [ - 'description' => __( 'Order by IP address of the comment author.', 'wp-graphql' ), - 'value' => 'comment_author_IP', - ], - 'COMMENT_AUTHOR_URL' => [ - 'description' => __( 'Order by URL address of the comment author.', 'wp-graphql' ), - 'value' => 'comment_author_url', - ], - 'COMMENT_CONTENT' => [ - 'description' => __( 'Order by the comment contents.', 'wp-graphql' ), - 'value' => 'comment_content', - ], - 'COMMENT_DATE' => [ - 'description' => __( 'Order by date/time timestamp of the comment.', 'wp-graphql' ), - 'value' => 'comment_date', - ], - 'COMMENT_DATE_GMT' => [ - 'description' => __( 'Order by GMT timezone date/time timestamp of the comment.', 'wp-graphql' ), - 'value' => 'comment_date_gmt', - ], - 'COMMENT_ID' => [ - 'description' => __( 'Order by the globally unique identifier for the comment object', 'wp-graphql' ), - 'value' => 'comment_ID', - ], - 'COMMENT_IN' => [ - 'description' => __( 'Order by the array list of comment IDs listed in the where clause.', 'wp-graphql' ), - 'value' => 'comment__in', - ], - 'COMMENT_KARMA' => [ - 'description' => __( 'Order by the comment karma score.', 'wp-graphql' ), - 'value' => 'comment_karma', - ], - 'COMMENT_PARENT' => [ - 'description' => __( 'Order by the comment parent ID.', 'wp-graphql' ), - 'value' => 'comment_parent', - ], - 'COMMENT_POST_ID' => [ - 'description' => __( 'Order by the post object ID.', 'wp-graphql' ), - 'value' => 'comment_post_ID', - ], - 'COMMENT_TYPE' => [ - 'description' => __( 'Order by the the type of comment, such as \'comment\', \'pingback\', or \'trackback\'.', 'wp-graphql' ), - 'value' => 'comment_type', - ], - 'USER_ID' => [ - 'description' => __( 'Order by the user ID.', 'wp-graphql' ), - 'value' => 'user_id', - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/ContentNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/ContentNodeIdTypeEnum.php deleted file mode 100644 index 6f14af23..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/ContentNodeIdTypeEnum.php +++ /dev/null @@ -1,81 +0,0 @@ - __( 'The Type of Identifier used to fetch a single resource. Default is ID.', 'wp-graphql' ), - 'values' => self::get_values(), - ] - ); - - /** @var \WP_Post_Type[] */ - $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects' ); - - foreach ( $allowed_post_types as $post_type_object ) { - $values = self::get_values(); - - if ( ! $post_type_object->hierarchical ) { - $values['SLUG'] = [ - 'name' => 'SLUG', - 'value' => 'slug', - 'description' => __( 'Identify a resource by the slug. Available to non-hierarchcial Types where the slug is a unique identifier.', 'wp-graphql' ), - ]; - } - - if ( 'attachment' === $post_type_object->name ) { - $values['SOURCE_URL'] = [ - 'name' => 'SOURCE_URL', - 'value' => 'source_url', - 'description' => __( 'Identify a media item by its source url', 'wp-graphql' ), - ]; - } - - /** - * Register a unique Enum per Post Type. This allows for granular control - * over filtering and customizing the values available per Post Type. - */ - register_graphql_enum_type( - $post_type_object->graphql_single_name . 'IdType', - [ - 'description' => __( 'The Type of Identifier used to fetch a single resource. Default is ID.', 'wp-graphql' ), - 'values' => $values, - ] - ); - } - } - - /** - * Get the values for the Enum definitions - * - * @return array - */ - public static function get_values() { - return [ - 'ID' => [ - 'name' => 'ID', - 'value' => 'global_id', - 'description' => __( 'Identify a resource by the (hashed) Global ID.', 'wp-graphql' ), - ], - 'DATABASE_ID' => [ - 'name' => 'DATABASE_ID', - 'value' => 'database_id', - 'description' => __( 'Identify a resource by the Database ID.', 'wp-graphql' ), - ], - 'URI' => [ - 'name' => 'URI', - 'value' => 'uri', - 'description' => __( 'Identify a resource by the URI.', 'wp-graphql' ), - ], - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeEnum.php deleted file mode 100644 index 308acad7..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeEnum.php +++ /dev/null @@ -1,84 +0,0 @@ - $allowed_post_type, - 'description' => __( 'The Type of Content object', 'wp-graphql' ), - ]; - } - - register_graphql_enum_type( - 'ContentTypeEnum', - [ - 'description' => __( 'Allowed Content Types', 'wp-graphql' ), - 'values' => $values, - ] - ); - - /** - * Register a ContentTypesOf${taxonomyName}Enum for each taxonomy - * - * @var \WP_Taxonomy[] $allowed_taxonomies - */ - $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); - foreach ( $allowed_taxonomies as $tax_object ) { - /** - * Loop through the taxonomy's object type and create an array - * of values for use in the enum type. - */ - $taxonomy_values = []; - foreach ( $tax_object->object_type as $tax_object_type ) { - // Skip object types that are not allowed by WPGraphQL - if ( ! array_key_exists( $tax_object_type, $allowed_post_types ) ) { - continue; - } - - $taxonomy_values[ WPEnumType::get_safe_name( $tax_object_type ) ] = [ - 'name' => WPEnumType::get_safe_name( $tax_object_type ), - 'value' => $tax_object_type, - 'description' => __( 'The Type of Content object', 'wp-graphql' ), - ]; - } - - if ( ! empty( $taxonomy_values ) ) { - register_graphql_enum_type( - 'ContentTypesOf' . Utils::format_type_name( $tax_object->graphql_single_name ) . 'Enum', - [ - 'description' => sprintf( - // translators: %s is the taxonomy's GraphQL name. - __( 'Allowed Content Types of the %s taxonomy.', 'wp-graphql' ), - Utils::format_type_name( $tax_object->graphql_single_name ) - ), - 'values' => $taxonomy_values, - ] - ); - } - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeIdTypeEnum.php deleted file mode 100644 index f36166c3..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/ContentTypeIdTypeEnum.php +++ /dev/null @@ -1,32 +0,0 @@ - __( 'The Type of Identifier used to fetch a single Content Type node. To be used along with the "id" field. Default is "ID".', 'wp-graphql' ), - 'values' => [ - 'ID' => [ - 'name' => 'ID', - 'value' => 'id', - 'description' => __( 'The globally unique ID', 'wp-graphql' ), - ], - 'NAME' => [ - 'name' => 'NAME', - 'value' => 'name', - 'description' => __( 'The name of the content type.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemSizeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemSizeEnum.php deleted file mode 100644 index 852bc925..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemSizeEnum.php +++ /dev/null @@ -1,51 +0,0 @@ - sprintf( - // translators: %1$s is the image size. - __( 'MediaItem with the %1$s size', 'wp-graphql' ), - $image_size - ), - 'value' => $image_size, - ]; - } - - register_graphql_enum_type( - 'MediaItemSizeEnum', - [ - 'description' => __( 'The size of the media item object.', 'wp-graphql' ), - 'values' => $values, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemStatusEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemStatusEnum.php deleted file mode 100644 index 267e6e6b..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/MediaItemStatusEnum.php +++ /dev/null @@ -1,46 +0,0 @@ - sprintf( - // translators: %1$s is the post status. - __( 'Objects with the %1$s status', 'wp-graphql' ), - $status - ), - 'value' => $status, - ]; - } - - register_graphql_enum_type( - 'MediaItemStatusEnum', - [ - 'description' => __( 'The status of the media item object.', 'wp-graphql' ), - 'values' => $values, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MenuItemNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MenuItemNodeIdTypeEnum.php deleted file mode 100644 index c28be2f5..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/MenuItemNodeIdTypeEnum.php +++ /dev/null @@ -1,36 +0,0 @@ - __( 'The Type of Identifier used to fetch a single node. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), - 'values' => [ - 'ID' => [ - 'name' => 'ID', - 'value' => 'global_id', - 'description' => __( 'Identify a resource by the (hashed) Global ID.', 'wp-graphql' ), - ], - 'DATABASE_ID' => [ - 'name' => 'DATABASE_ID', - 'value' => 'database_id', - 'description' => __( 'Identify a resource by the Database ID.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MenuLocationEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MenuLocationEnum.php deleted file mode 100644 index d45a38ce..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/MenuLocationEnum.php +++ /dev/null @@ -1,47 +0,0 @@ - $location, - 'description' => sprintf( - // translators: %s is the menu location name. - __( 'Put the menu in the %s location', 'wp-graphql' ), - $location - ), - ]; - } - } - - if ( empty( $values ) ) { - $values['EMPTY'] = [ - 'value' => 'Empty menu location', - 'description' => __( 'Empty menu location', 'wp-graphql' ), - ]; - } - - register_graphql_enum_type( - 'MenuLocationEnum', - [ - 'description' => __( 'Registered menu locations', 'wp-graphql' ), - 'values' => $values, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MenuNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MenuNodeIdTypeEnum.php deleted file mode 100644 index 51e4c0f5..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/MenuNodeIdTypeEnum.php +++ /dev/null @@ -1,51 +0,0 @@ - __( 'The Type of Identifier used to fetch a single node. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), - 'values' => [ - 'ID' => [ - 'name' => 'ID', - 'value' => 'global_id', - 'description' => __( 'Identify a menu node by the (hashed) Global ID.', 'wp-graphql' ), - ], - 'DATABASE_ID' => [ - 'name' => 'DATABASE_ID', - 'value' => 'database_id', - 'description' => __( 'Identify a menu node by the Database ID.', 'wp-graphql' ), - ], - 'LOCATION' => [ - 'name' => 'LOCATION', - 'value' => 'location', - 'description' => __( 'Identify a menu node by the slug of menu location to which it is assigned', 'wp-graphql' ), - ], - 'NAME' => [ - 'name' => 'NAME', - 'value' => 'name', - 'description' => __( 'Identify a menu node by its name', 'wp-graphql' ), - ], - 'SLUG' => [ - 'name' => 'SLUG', - 'value' => 'slug', - 'description' => __( 'Identify a menu node by its slug', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/MimeTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/MimeTypeEnum.php deleted file mode 100644 index daa4dbc2..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/MimeTypeEnum.php +++ /dev/null @@ -1,46 +0,0 @@ - [ - 'value' => 'image/jpeg', - 'description' => __( 'An image in the JPEG format', 'wp-graphql' ), - ], - ]; - - $allowed_mime_types = get_allowed_mime_types(); - - if ( ! empty( $allowed_mime_types ) ) { - $values = []; - foreach ( $allowed_mime_types as $mime_type ) { - $values[ WPEnumType::get_safe_name( $mime_type ) ] = [ - 'value' => $mime_type, - 'description' => sprintf( - // translators: %s is the mime type. - __( '%s mime type.', 'wp-graphql' ), - $mime_type - ), - ]; - } - } - - register_graphql_enum_type( - 'MimeTypeEnum', - [ - 'description' => __( 'The MimeType of the object', 'wp-graphql' ), - 'values' => $values, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/OrderEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/OrderEnum.php deleted file mode 100644 index fa713e80..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/OrderEnum.php +++ /dev/null @@ -1,31 +0,0 @@ - __( 'The cardinality of the connection order', 'wp-graphql' ), - 'values' => [ - 'ASC' => [ - 'value' => 'ASC', - 'description' => __( 'Sort the query result set in an ascending order', 'wp-graphql' ), - ], - 'DESC' => [ - 'value' => 'DESC', - 'description' => __( 'Sort the query result set in a descending order', 'wp-graphql' ), - ], - ], - 'defaultValue' => 'DESC', - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PluginStatusEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PluginStatusEnum.php deleted file mode 100644 index 8d27c4e2..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/PluginStatusEnum.php +++ /dev/null @@ -1,75 +0,0 @@ - __( 'The status of the WordPress plugin.', 'wp-graphql' ), - 'values' => self::get_enum_values(), - 'defaultValue' => 'ACTIVE', - ] - ); - } - - /** - * Returns the array configuration for the GraphQL enum values. - * - * @return array - */ - protected static function get_enum_values() { - $values = [ - 'ACTIVE' => [ - 'value' => 'active', - 'description' => __( 'The plugin is currently active.', 'wp-graphql' ), - ], - 'DROP_IN' => [ - 'value' => 'dropins', - 'description' => __( 'The plugin is a drop-in plugin.', 'wp-graphql' ), - - ], - 'INACTIVE' => [ - 'value' => 'inactive', - 'description' => __( 'The plugin is currently inactive.', 'wp-graphql' ), - ], - 'MUST_USE' => [ - 'value' => 'mustuse', - 'description' => __( 'The plugin is a must-use plugin.', 'wp-graphql' ), - ], - 'PAUSED' => [ - 'value' => 'paused', - 'description' => __( 'The plugin is technically active but was paused while loading.', 'wp-graphql' ), - ], - 'RECENTLY_ACTIVE' => [ - 'value' => 'recently_activated', - 'description' => __( 'The plugin was active recently.', 'wp-graphql' ), - ], - 'UPGRADE' => [ - 'value' => 'upgrade', - 'description' => __( 'The plugin has an upgrade available.', 'wp-graphql' ), - ], - ]; - - // Multisite enums - if ( is_multisite() ) { - $values['NETWORK_ACTIVATED'] = [ - 'value' => 'network_activated', - 'description' => __( 'The plugin is activated on the multisite network.', 'wp-graphql' ), - ]; - $values['NETWORK_INACTIVE'] = [ - 'value' => 'network_inactive', - 'description' => __( 'The plugin is installed on the multisite network, but is currently inactive.', 'wp-graphql' ), - ]; - } - - return $values; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectFieldFormatEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectFieldFormatEnum.php deleted file mode 100644 index 80f09bf0..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectFieldFormatEnum.php +++ /dev/null @@ -1,32 +0,0 @@ - __( 'The format of post field data.', 'wp-graphql' ), - 'values' => [ - 'RAW' => [ - 'name' => 'RAW', - 'description' => __( 'Provide the field value directly from database. Null on unauthenticated requests.', 'wp-graphql' ), - 'value' => 'raw', - ], - 'RENDERED' => [ - 'name' => 'RENDERED', - 'description' => __( 'Provide the field value as rendered by WordPress. Default.', 'wp-graphql' ), - 'value' => 'rendered', - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php deleted file mode 100644 index 0aa9f7d7..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php +++ /dev/null @@ -1,30 +0,0 @@ - __( 'The column to use when filtering by date', 'wp-graphql' ), - 'values' => [ - 'DATE' => [ - 'value' => 'post_date', - 'description' => __( 'The date the comment was created in local time.', 'wp-graphql' ), - ], - 'MODIFIED' => [ - 'value' => 'post_modified', - 'description' => __( 'The most recent modification date of the comment.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php deleted file mode 100644 index deaf59f1..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php +++ /dev/null @@ -1,62 +0,0 @@ - __( 'Field to order the connection by', 'wp-graphql' ), - 'values' => [ - 'AUTHOR' => [ - 'value' => 'post_author', - 'description' => __( 'Order by author', 'wp-graphql' ), - ], - 'TITLE' => [ - 'value' => 'post_title', - 'description' => __( 'Order by title', 'wp-graphql' ), - ], - 'SLUG' => [ - 'value' => 'post_name', - 'description' => __( 'Order by slug', 'wp-graphql' ), - ], - 'MODIFIED' => [ - 'value' => 'post_modified', - 'description' => __( 'Order by last modified date', 'wp-graphql' ), - ], - 'DATE' => [ - 'value' => 'post_date', - 'description' => __( 'Order by publish date', 'wp-graphql' ), - ], - 'PARENT' => [ - 'value' => 'post_parent', - 'description' => __( 'Order by parent ID', 'wp-graphql' ), - ], - 'IN' => [ - 'value' => 'post__in', - 'description' => __( 'Preserve the ID order given in the IN array', 'wp-graphql' ), - ], - 'NAME_IN' => [ - 'value' => 'post_name__in', - 'description' => __( 'Preserve slug order given in the NAME_IN array', 'wp-graphql' ), - ], - 'MENU_ORDER' => [ - 'value' => 'menu_order', - 'description' => __( 'Order by the menu order value', 'wp-graphql' ), - ], - 'COMMENT_COUNT' => [ - 'value' => 'comment_count', - 'description' => __( 'Order by the number of comments it has acquired', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/PostStatusEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/PostStatusEnum.php deleted file mode 100644 index 51b24416..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/PostStatusEnum.php +++ /dev/null @@ -1,54 +0,0 @@ - 'PUBLISH', - 'value' => 'publish', - ]; - - $post_stati = get_post_stati(); - - if ( ! empty( $post_stati ) && is_array( $post_stati ) ) { - /** - * Reset the array - */ - $post_status_enum_values = []; - /** - * Loop through the post_stati - */ - foreach ( $post_stati as $status ) { - if ( ! is_string( $status ) ) { - continue; - } - - $post_status_enum_values[ WPEnumType::get_safe_name( $status ) ] = [ - 'description' => sprintf( - // translators: %1$s is the post status. - __( 'Objects with the %1$s status', 'wp-graphql' ), - $status - ), - 'value' => $status, - ]; - } - } - - register_graphql_enum_type( - 'PostStatusEnum', - [ - 'description' => __( 'The status of the object.', 'wp-graphql' ), - 'values' => $post_status_enum_values, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/RelationEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/RelationEnum.php deleted file mode 100644 index 63c944eb..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/RelationEnum.php +++ /dev/null @@ -1,32 +0,0 @@ - __( 'The logical relation between each item in the array when there are more than one.', 'wp-graphql' ), - 'values' => [ - 'AND' => [ - 'name' => 'AND', - 'value' => 'AND', - 'description' => __( 'The logical AND condition returns true if both operands are true, otherwise, it returns false.', 'wp-graphql' ), - ], - 'OR' => [ - 'name' => 'OR', - 'value' => 'OR', - 'description' => __( 'The logical OR condition returns false if both operands are false, otherwise, it returns true.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyEnum.php deleted file mode 100644 index 2574d478..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyEnum.php +++ /dev/null @@ -1,46 +0,0 @@ -graphql_single_name ) ] ) ) { - $values[ WPEnumType::get_safe_name( $tax_object->graphql_single_name ) ] = [ - 'value' => $tax_object->name, - 'description' => sprintf( - // translators: %s is the taxonomy name. - __( 'Taxonomy enum %s', 'wp-graphql' ), - $tax_object->name - ), - ]; - } - } - - register_graphql_enum_type( - 'TaxonomyEnum', - [ - 'description' => __( 'Allowed taxonomies', 'wp-graphql' ), - 'values' => $values, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyIdTypeEnum.php deleted file mode 100644 index de6743c6..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/TaxonomyIdTypeEnum.php +++ /dev/null @@ -1,32 +0,0 @@ - __( 'The Type of Identifier used to fetch a single Taxonomy node. To be used along with the "id" field. Default is "ID".', 'wp-graphql' ), - 'values' => [ - 'ID' => [ - 'name' => 'ID', - 'value' => 'id', - 'description' => __( 'The globally unique ID', 'wp-graphql' ), - ], - 'NAME' => [ - 'name' => 'NAME', - 'value' => 'name', - 'description' => __( 'The name of the taxonomy', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TermNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TermNodeIdTypeEnum.php deleted file mode 100644 index 52ff6b8b..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/TermNodeIdTypeEnum.php +++ /dev/null @@ -1,74 +0,0 @@ - __( 'The Type of Identifier used to fetch a single resource. Default is "ID". To be used along with the "id" field.', 'wp-graphql' ), - 'values' => self::get_values(), - ] - ); - - /** - * Register a unique Enum per Taxonomy. This allows for granular control - * over filtering and customizing the values available per Taxonomy. - * - * @var \WP_Taxonomy[] $allowed_taxonomies - */ - $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects' ); - - foreach ( $allowed_taxonomies as $tax_object ) { - register_graphql_enum_type( - $tax_object->graphql_single_name . 'IdType', - [ - 'description' => __( 'The Type of Identifier used to fetch a single resource. Default is ID.', 'wp-graphql' ), - 'values' => self::get_values(), - ] - ); - } - } - - /** - * Get the values for the Enum definitions - * - * @return array - */ - public static function get_values() { - return [ - 'SLUG' => [ - 'name' => 'SLUG', - 'value' => 'slug', - 'description' => __( 'Url friendly name of the node', 'wp-graphql' ), - ], - 'NAME' => [ - 'name' => 'NAME', - 'value' => 'name', - 'description' => __( 'The name of the node', 'wp-graphql' ), - ], - 'ID' => [ - 'name' => 'ID', - 'value' => 'global_id', - 'description' => __( 'The hashed Global ID', 'wp-graphql' ), - ], - 'DATABASE_ID' => [ - 'name' => 'DATABASE_ID', - 'value' => 'database_id', - 'description' => __( 'The Database ID for the node', 'wp-graphql' ), - ], - 'URI' => [ - 'name' => 'URI', - 'value' => 'uri', - 'description' => __( 'The URI for the node', 'wp-graphql' ), - ], - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php deleted file mode 100644 index d7f0414c..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php +++ /dev/null @@ -1,49 +0,0 @@ - __( 'Options for ordering the connection by', 'wp-graphql' ), - 'values' => [ - 'NAME' => [ - 'value' => 'name', - 'description' => __( 'Order the connection by name.', 'wp-graphql' ), - ], - 'SLUG' => [ - 'value' => 'slug', - 'description' => __( 'Order the connection by slug.', 'wp-graphql' ), - ], - 'TERM_GROUP' => [ - 'value' => 'term_group', - 'description' => __( 'Order the connection by term group.', 'wp-graphql' ), - ], - 'TERM_ID' => [ - 'value' => 'term_id', - 'description' => __( 'Order the connection by term id.', 'wp-graphql' ), - ], - 'TERM_ORDER' => [ - 'value' => 'term_order', - 'description' => __( 'Order the connection by term order.', 'wp-graphql' ), - ], - 'DESCRIPTION' => [ - 'value' => 'description', - 'description' => __( 'Order the connection by description.', 'wp-graphql' ), - ], - 'COUNT' => [ - 'value' => 'count', - 'description' => __( 'Order the connection by item count.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/TimezoneEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/TimezoneEnum.php deleted file mode 100644 index fc1b583e..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/TimezoneEnum.php +++ /dev/null @@ -1,194 +0,0 @@ - $zone[0], - 'city' => $exists[1] ? $zone[1] : '', - 'subcity' => $exists[2] ? $zone[2] : '', - 't_continent' => translate( str_replace( '_', ' ', $zone[0] ), 'wp-graphql' ), - 't_city' => $exists[1] ? translate( str_replace( '_', ' ', $zone[1] ), 'wp-graphql' ) : '', - 't_subcity' => $exists[2] ? translate( str_replace( '_', ' ', $zone[2] ), 'wp-graphql' ) : '', - ]; - // phpcs:enable - } - usort( $zonen, '_wp_timezone_choice_usort_callback' ); - - foreach ( $zonen as $zone ) { - // Build value in an array to join later - $value = [ $zone['continent'] ]; - if ( empty( $zone['city'] ) ) { - // It's at the continent level (generally won't happen) - $display = $zone['t_continent']; - } else { - // Add the city to the value - $value[] = $zone['city']; - $display = $zone['t_city']; - if ( ! empty( $zone['subcity'] ) ) { - // Add the subcity to the value - $value[] = $zone['subcity']; - $display .= ' - ' . $zone['t_subcity']; - } - } - // Build the value - $value = join( '/', $value ); - - $enum_values[ WPEnumType::get_safe_name( $value ) ] = [ - 'value' => $value, - 'description' => $display, - ]; - } - $offset_range = [ - - 12, - - 11.5, - - 11, - - 10.5, - - 10, - - 9.5, - - 9, - - 8.5, - - 8, - - 7.5, - - 7, - - 6.5, - - 6, - - 5.5, - - 5, - - 4.5, - - 4, - - 3.5, - - 3, - - 2.5, - - 2, - - 1.5, - - 1, - - 0.5, - 0, - 0.5, - 1, - 1.5, - 2, - 2.5, - 3, - 3.5, - 4, - 4.5, - 5, - 5.5, - 5.75, - 6, - 6.5, - 7, - 7.5, - 8, - 8.5, - 8.75, - 9, - 9.5, - 10, - 10.5, - 11, - 11.5, - 12, - 12.75, - 13, - 13.75, - 14, - ]; - foreach ( $offset_range as $offset ) { - if ( 0 <= $offset ) { - $offset_name = '+' . $offset; - } else { - $offset_name = (string) $offset; - } - $offset_value = $offset_name; - $offset_name = str_replace( - [ '.25', '.5', '.75' ], - [ - ':15', - ':30', - ':45', - ], - $offset_name - ); - $offset_name = 'UTC' . $offset_name; - $offset_value = 'UTC' . $offset_value; - - // Intentionally avoid WPEnumType::get_safe_name here for specific timezone formatting - $enum_values[ WPEnumType::get_safe_name( $offset_name ) ] = [ - 'value' => $offset_value, - 'description' => sprintf( - // translators: %s is the UTC offset. - __( 'UTC offset: %s', 'wp-graphql' ), - $offset_name - ), - ]; - } - - register_graphql_enum_type( - 'TimezoneEnum', - [ - 'description' => __( 'Available timezones', 'wp-graphql' ), - 'values' => $enum_values, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/UserNodeIdTypeEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/UserNodeIdTypeEnum.php deleted file mode 100644 index c4f61df0..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/UserNodeIdTypeEnum.php +++ /dev/null @@ -1,60 +0,0 @@ - __( 'The Type of Identifier used to fetch a single User node. To be used along with the "id" field. Default is "ID".', 'wp-graphql' ), - 'values' => self::get_values(), - ] - ); - } - - /** - * Returns the values for the Enum. - * - * @return array - */ - public static function get_values() { - return [ - 'ID' => [ - 'name' => 'ID', - 'value' => 'global_id', - 'description' => __( 'The hashed Global ID', 'wp-graphql' ), - ], - 'DATABASE_ID' => [ - 'name' => 'DATABASE_ID', - 'value' => 'database_id', - 'description' => __( 'The Database ID for the node', 'wp-graphql' ), - ], - 'URI' => [ - 'name' => 'URI', - 'value' => 'uri', - 'description' => __( 'The URI for the node', 'wp-graphql' ), - ], - 'SLUG' => [ - 'name' => 'SLUG', - 'value' => 'slug', - 'description' => __( 'The slug of the User', 'wp-graphql' ), - ], - 'EMAIL' => [ - 'name' => 'EMAIL', - 'value' => 'email', - 'description' => __( 'The Email of the User', 'wp-graphql' ), - ], - 'USERNAME' => [ - 'name' => 'USERNAME', - 'value' => 'login', - 'description' => __( 'The username the User uses to login with', 'wp-graphql' ), - ], - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/UserRoleEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/UserRoleEnum.php deleted file mode 100644 index 76f4f5ab..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/UserRoleEnum.php +++ /dev/null @@ -1,40 +0,0 @@ -roles; - $roles = []; - - foreach ( $all_roles as $key => $role ) { - $formatted_role = WPEnumType::get_safe_name( isset( $role['name'] ) ? $role['name'] : $key ); - - $roles[ $formatted_role ] = [ - 'description' => __( 'User role with specific capabilities', 'wp-graphql' ), - 'value' => $key, - ]; - } - - // Bail if there are no roles to register. - if ( empty( $roles ) ) { - return; - } - - register_graphql_enum_type( - 'UserRoleEnum', - [ - 'description' => __( 'Names of available user roles', 'wp-graphql' ), - 'values' => $roles, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionOrderbyEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionOrderbyEnum.php deleted file mode 100644 index ba6e8ddc..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionOrderbyEnum.php +++ /dev/null @@ -1,54 +0,0 @@ - __( 'Field to order the connection by', 'wp-graphql' ), - 'values' => [ - 'DISPLAY_NAME' => [ - 'value' => 'display_name', - 'description' => __( 'Order by display name', 'wp-graphql' ), - ], - 'EMAIL' => [ - 'value' => 'user_email', - 'description' => __( 'Order by email address', 'wp-graphql' ), - ], - 'LOGIN' => [ - 'value' => 'user_login', - 'description' => __( 'Order by login', 'wp-graphql' ), - ], - 'LOGIN_IN' => [ - 'value' => 'login__in', - 'description' => __( 'Preserve the login order given in the LOGIN_IN array', 'wp-graphql' ), - ], - 'NICE_NAME' => [ - 'value' => 'user_nicename', - 'description' => __( 'Order by nice name', 'wp-graphql' ), - ], - 'NICE_NAME_IN' => [ - 'value' => 'nicename__in', - 'description' => __( 'Preserve the nice name order given in the NICE_NAME_IN array', 'wp-graphql' ), - ], - 'REGISTERED' => [ - 'value' => 'user_registered', - 'description' => __( 'Order by registration date', 'wp-graphql' ), - ], - 'URL' => [ - 'value' => 'user_url', - 'description' => __( 'Order by URL', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionSearchColumnEnum.php b/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionSearchColumnEnum.php deleted file mode 100644 index 66e51310..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Enum/UsersConnectionSearchColumnEnum.php +++ /dev/null @@ -1,42 +0,0 @@ - __( 'Column used for searching for users.', 'wp-graphql' ), - 'values' => [ - 'ID' => [ - 'value' => 'ID', - 'description' => __( 'The globally unique ID.', 'wp-graphql' ), - ], - 'LOGIN' => [ - 'value' => 'login', - 'description' => __( 'The username the User uses to login with.', 'wp-graphql' ), - ], - 'NICENAME' => [ - 'value' => 'nicename', - 'description' => __( 'A URL-friendly name for the user. The default is the user\'s username.', 'wp-graphql' ), - ], - 'EMAIL' => [ - 'value' => 'email', - 'description' => __( 'The user\'s email address.', 'wp-graphql' ), - ], - 'URL' => [ - 'value' => 'url', - 'description' => __( 'The URL of the user\'s website.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Input/DateInput.php b/lib/wp-graphql-1.17.0/src/Type/Input/DateInput.php deleted file mode 100644 index 1dbe465e..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Input/DateInput.php +++ /dev/null @@ -1,33 +0,0 @@ - __( 'Date values', 'wp-graphql' ), - 'fields' => [ - 'year' => [ - 'type' => 'Int', - 'description' => __( '4 digit year (e.g. 2017)', 'wp-graphql' ), - ], - 'month' => [ - 'type' => 'Int', - 'description' => __( 'Month number (from 1 to 12)', 'wp-graphql' ), - ], - 'day' => [ - 'type' => 'Int', - 'description' => __( 'Day of the month (from 1 to 31)', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Input/DateQueryInput.php b/lib/wp-graphql-1.17.0/src/Type/Input/DateQueryInput.php deleted file mode 100644 index d1ea6765..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Input/DateQueryInput.php +++ /dev/null @@ -1,74 +0,0 @@ - __( 'Filter the connection based on input', 'wp-graphql' ), - 'fields' => [ - 'year' => [ - 'type' => 'Int', - 'description' => __( '4 digit year (e.g. 2017)', 'wp-graphql' ), - ], - 'month' => [ - 'type' => 'Int', - 'description' => __( 'Month number (from 1 to 12)', 'wp-graphql' ), - ], - 'week' => [ - 'type' => 'Int', - 'description' => __( 'Week of the year (from 0 to 53)', 'wp-graphql' ), - ], - 'day' => [ - 'type' => 'Int', - 'description' => __( 'Day of the month (from 1 to 31)', 'wp-graphql' ), - ], - 'hour' => [ - 'type' => 'Int', - 'description' => __( 'Hour (from 0 to 23)', 'wp-graphql' ), - ], - 'minute' => [ - 'type' => 'Int', - 'description' => __( 'Minute (from 0 to 59)', 'wp-graphql' ), - ], - 'second' => [ - 'type' => 'Int', - 'description' => __( 'Second (0 to 59)', 'wp-graphql' ), - ], - 'after' => [ - 'type' => 'DateInput', - 'description' => __( 'Nodes should be returned after this date', 'wp-graphql' ), - ], - 'before' => [ - 'type' => 'DateInput', - 'description' => __( 'Nodes should be returned before this date', 'wp-graphql' ), - ], - 'inclusive' => [ - 'type' => 'Boolean', - 'description' => __( 'For after/before, whether exact value should be matched or not', 'wp-graphql' ), - ], - 'compare' => [ - 'type' => 'String', - 'description' => __( 'For after/before, whether exact value should be matched or not', 'wp-graphql' ), - ], - 'column' => [ - 'type' => 'PostObjectsConnectionDateColumnEnum', - 'description' => __( 'Column to query against', 'wp-graphql' ), - ], - 'relation' => [ - 'type' => 'RelationEnum', - 'description' => __( 'OR or AND, how the sub-arrays should be compared', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Input/PostObjectsConnectionOrderbyInput.php b/lib/wp-graphql-1.17.0/src/Type/Input/PostObjectsConnectionOrderbyInput.php deleted file mode 100644 index 737343a9..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Input/PostObjectsConnectionOrderbyInput.php +++ /dev/null @@ -1,34 +0,0 @@ - __( 'Options for ordering the connection', 'wp-graphql' ), - 'fields' => [ - 'field' => [ - 'type' => [ - 'non_null' => 'PostObjectsConnectionOrderbyEnum', - ], - 'description' => __( 'The field to order the connection by', 'wp-graphql' ), - ], - 'order' => [ - 'type' => [ - 'non_null' => 'OrderEnum', - ], - 'description' => __( 'Possible directions in which to order a list of items', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Input/UsersConnectionOrderbyInput.php b/lib/wp-graphql-1.17.0/src/Type/Input/UsersConnectionOrderbyInput.php deleted file mode 100644 index 2df8ce60..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Input/UsersConnectionOrderbyInput.php +++ /dev/null @@ -1,32 +0,0 @@ - __( 'Options for ordering the connection', 'wp-graphql' ), - 'fields' => [ - 'field' => [ - 'description' => __( 'The field name used to sort the results.', 'wp-graphql' ), - 'type' => [ - 'non_null' => 'UsersConnectionOrderbyEnum', - ], - ], - 'order' => [ - 'description' => __( 'The cardinality of the order of the connection', 'wp-graphql' ), - 'type' => 'OrderEnum', - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Commenter.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Commenter.php deleted file mode 100644 index df9da9b8..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Commenter.php +++ /dev/null @@ -1,74 +0,0 @@ - __( 'The author of a comment', 'wp-graphql' ), - 'interfaces' => [ 'Node', 'DatabaseIdentifier' ], - 'resolveType' => static function ( $comment_author ) use ( $type_registry ) { - if ( $comment_author instanceof User ) { - $type = $type_registry->get_type( 'User' ); - } else { - $type = $type_registry->get_type( 'CommentAuthor' ); - } - - return $type; - }, - 'fields' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The globally unique identifier for the comment author.', 'wp-graphql' ), - ], - 'avatar' => [ - 'type' => 'Avatar', - 'description' => __( 'Avatar object for user. The avatar object can be retrieved in different sizes by specifying the size argument.', 'wp-graphql' ), - ], - 'databaseId' => [ - 'type' => [ - 'non_null' => 'Int', - ], - 'description' => __( 'Identifies the primary key from the database.', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'The name of the author of a comment.', 'wp-graphql' ), - ], - 'email' => [ - 'type' => 'String', - 'description' => __( 'The email address of the author of a comment.', 'wp-graphql' ), - ], - 'url' => [ - 'type' => 'String', - 'description' => __( 'The url of the author of a comment.', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the author information is considered restricted. (not fully public)', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Connection.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Connection.php deleted file mode 100644 index 396a9e1f..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Connection.php +++ /dev/null @@ -1,38 +0,0 @@ - __( 'A plural connection from one Node Type in the Graph to another Node Type, with support for relational data via "edges".', 'wp-graphql' ), - 'fields' => [ - 'pageInfo' => [ - 'type' => [ 'non_null' => 'PageInfo' ], - 'description' => __( 'Information about pagination in a connection.', 'wp-graphql' ), - ], - 'edges' => [ - 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => 'Edge' ] ] ], - 'description' => __( 'A list of edges (relational context) between connected nodes', 'wp-graphql' ), - ], - 'nodes' => [ - 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => 'Node' ] ] ], - 'description' => __( 'A list of connected nodes', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentNode.php deleted file mode 100644 index b808e780..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentNode.php +++ /dev/null @@ -1,174 +0,0 @@ - [ 'Node', 'UniformResourceIdentifiable' ], - 'description' => __( 'Nodes used to manage content', 'wp-graphql' ), - 'connections' => [ - 'contentType' => [ - 'toType' => 'ContentType', - 'resolve' => static function ( Post $source, $args, $context, $info ) { - if ( $source->isRevision ) { - $parent = get_post( $source->parentDatabaseId ); - $post_type = $parent->post_type ?? null; - } else { - $post_type = $source->post_type ?? null; - } - - if ( empty( $post_type ) ) { - return null; - } - - $resolver = new ContentTypeConnectionResolver( $source, $args, $context, $info ); - - return $resolver->one_to_one()->set_query_arg( 'name', $post_type )->get_connection(); - }, - 'oneToOne' => true, - ], - 'enqueuedScripts' => [ - 'toType' => 'EnqueuedScript', - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new EnqueuedScriptsConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - }, - ], - 'enqueuedStylesheets' => [ - 'toType' => 'EnqueuedStylesheet', - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new EnqueuedStylesheetConnectionResolver( $source, $args, $context, $info ); - return $resolver->get_connection(); - }, - ], - ], - 'resolveType' => static function ( Post $post ) use ( $type_registry ) { - - /** - * The resolveType callback is used at runtime to determine what Type an object - * implementing the ContentNode Interface should be resolved as. - * - * You can filter this centrally using the "graphql_wp_interface_type_config" filter - * to override if you need something other than a Post object to be resolved via the - * $post->post_type attribute. - */ - $type = null; - $post_type = isset( $post->post_type ) ? $post->post_type : null; - - if ( isset( $post->post_type ) && 'revision' === $post->post_type ) { - $parent = get_post( $post->parentDatabaseId ); - if ( $parent instanceof \WP_Post ) { - $post_type = $parent->post_type; - } - } - - $post_type_object = ! empty( $post_type ) ? get_post_type_object( $post_type ) : null; - - if ( isset( $post_type_object->graphql_single_name ) ) { - $type = $type_registry->get_type( $post_type_object->graphql_single_name ); - } - - return ! empty( $type ) ? $type : null; - }, - 'fields' => [ - 'contentTypeName' => [ - 'type' => [ 'non_null' => 'String' ], - 'description' => __( 'The name of the Content Type the node belongs to', 'wp-graphql' ), - 'resolve' => static function ( $node ) { - return $node->post_type; - }, - ], - 'template' => [ - 'type' => 'ContentTemplate', - 'description' => __( 'The template assigned to a node of content', 'wp-graphql' ), - ], - 'databaseId' => [ - 'type' => [ - 'non_null' => 'Int', - ], - 'description' => __( 'The ID of the node in the database.', 'wp-graphql' ), - ], - 'date' => [ - 'type' => 'String', - 'description' => __( 'Post publishing date.', 'wp-graphql' ), - ], - 'dateGmt' => [ - 'type' => 'String', - 'description' => __( 'The publishing date set in GMT.', 'wp-graphql' ), - ], - 'enclosure' => [ - 'type' => 'String', - 'description' => __( 'The RSS enclosure for the object', 'wp-graphql' ), - ], - 'status' => [ - 'type' => 'String', - 'description' => __( 'The current status of the object', 'wp-graphql' ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => __( 'The uri slug for the post. This is equivalent to the WP_Post->post_name field and the post_name column in the database for the "post_objects" table.', 'wp-graphql' ), - ], - 'modified' => [ - 'type' => 'String', - 'description' => __( 'The local modified time for a post. If a post was recently updated the modified field will change to match the corresponding time.', 'wp-graphql' ), - ], - 'modifiedGmt' => [ - 'type' => 'String', - 'description' => __( 'The GMT modified time for a post. If a post was recently updated the modified field will change to match the corresponding time in GMT.', 'wp-graphql' ), - ], - 'guid' => [ - 'type' => 'String', - 'description' => __( 'The global unique identifier for this post. This currently matches the value stored in WP_Post->guid and the guid column in the "post_objects" database table.', 'wp-graphql' ), - ], - 'desiredSlug' => [ - 'type' => 'String', - 'description' => __( 'The desired slug of the post', 'wp-graphql' ), - ], - 'link' => [ - 'type' => 'String', - 'description' => __( 'The permalink of the post', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'isPreview' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is a node in the preview state', 'wp-graphql' ), - ], - 'previewRevisionDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'The database id of the preview node', 'wp-graphql' ), - ], - 'previewRevisionId' => [ - 'type' => 'ID', - 'description' => __( 'Whether the object is a node in the preview state', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentTemplate.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentTemplate.php deleted file mode 100644 index f559ba85..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/ContentTemplate.php +++ /dev/null @@ -1,86 +0,0 @@ - __( 'The template assigned to a node of content', 'wp-graphql' ), - 'fields' => [ - 'templateName' => [ - 'type' => 'String', - 'description' => __( 'The name of the template', 'wp-graphql' ), - ], - ], - 'resolveType' => static function ( $value ) { - return isset( $value['__typename'] ) ? $value['__typename'] : 'DefaultTemplate'; - }, - ] - ); - } - - /** - * Register individual GraphQL objects for supported theme templates. - * - * @return void - */ - public static function register_content_template_types() { - $page_templates = []; - $page_templates['default'] = 'DefaultTemplate'; - - // Cycle through the registered post types and get the template information - $allowed_post_types = \WPGraphQL::get_allowed_post_types(); - foreach ( $allowed_post_types as $post_type ) { - $post_type_templates = wp_get_theme()->get_page_templates( null, $post_type ); - - foreach ( $post_type_templates as $file => $name ) { - $page_templates[ $file ] = $name; - } - } - - // Register each template to the schema - foreach ( $page_templates as $file => $name ) { - $template_type_name = Utils::format_type_name_for_wp_template( $name, $file ); - - // If the type name is empty, log an error and continue. - if ( empty( $template_type_name ) ) { - graphql_debug( - sprintf( - // Translators: %s is the file name. - __( 'Unable to register the %1s template file as a GraphQL Type. Either the template name or the file name must only use ASCII characters. "DefaultTemplate" will be used instead.', 'wp-graphql' ), - (string) $file - ) - ); - - continue; - } - - register_graphql_object_type( - $template_type_name, - [ - 'interfaces' => [ 'ContentTemplate' ], - // Translators: Placeholder is the name of the GraphQL Type in the Schema - 'description' => __( 'The template assigned to the node', 'wp-graphql' ), - 'fields' => [ - 'templateName' => [ - 'resolve' => static function ( $template ) { - return isset( $template['templateName'] ) ? $template['templateName'] : null; - }, - ], - ], - 'eagerlyLoadType' => true, - ] - ); - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/DatabaseIdentifier.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/DatabaseIdentifier.php deleted file mode 100644 index e02489c4..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/DatabaseIdentifier.php +++ /dev/null @@ -1,31 +0,0 @@ - __( 'Object that can be identified with a Database ID', 'wp-graphql' ), - 'fields' => [ - 'databaseId' => [ - 'type' => [ 'non_null' => 'Int' ], - 'description' => __( 'The unique identifier stored in the database', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Edge.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Edge.php deleted file mode 100644 index 7cc4f530..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Edge.php +++ /dev/null @@ -1,34 +0,0 @@ - __( 'Relational context between connected nodes', 'wp-graphql' ), - 'fields' => [ - 'cursor' => [ - 'type' => 'String', - 'description' => __( 'Opaque reference to the nodes position in the connection. Value can be used with pagination args.', 'wp-graphql' ), - ], - 'node' => [ - 'type' => [ 'non_null' => 'Node' ], - 'description' => __( 'The connected node', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/EnqueuedAsset.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/EnqueuedAsset.php deleted file mode 100644 index 8332c924..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/EnqueuedAsset.php +++ /dev/null @@ -1,83 +0,0 @@ - __( 'Asset enqueued by the CMS', 'wp-graphql' ), - 'resolveType' => static function ( $asset ) use ( $type_registry ) { - - /** - * The resolveType callback is used at runtime to determine what Type an object - * implementing the EnqueuedAsset Interface should be resolved as. - * - * You can filter this centrally using the "graphql_wp_interface_type_config" filter - * to override if you need something other than a Post object to be resolved via the - * $post->post_type attribute. - */ - $type = null; - - if ( isset( $asset['type'] ) ) { - $type = $type_registry->get_type( $asset['type'] ); - } - - return ! empty( $type ) ? $type : null; - }, - 'fields' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The ID of the enqueued asset', 'wp-graphql' ), - ], - 'handle' => [ - 'type' => 'String', - 'description' => __( 'The handle of the enqueued asset', 'wp-graphql' ), - ], - 'version' => [ - 'type' => 'String', - 'description' => __( 'The version of the enqueued asset', 'wp-graphql' ), - ], - 'src' => [ - 'type' => 'String', - 'description' => __( 'The source of the asset', 'wp-graphql' ), - ], - 'dependencies' => [ - 'type' => [ - 'list_of' => 'EnqueuedScript', - ], - 'description' => __( 'Dependencies needed to use this asset', 'wp-graphql' ), - ], - 'args' => [ - 'type' => 'Boolean', - 'description' => __( '@todo', 'wp-graphql' ), - ], - 'extra' => [ - 'type' => 'String', - 'description' => __( 'Extra information needed for the script', 'wp-graphql' ), - 'resolve' => static function ( $asset ) { - return isset( $asset->extra['data'] ) ? $asset->extra['data'] : null; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalContentNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalContentNode.php deleted file mode 100644 index 322c8479..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalContentNode.php +++ /dev/null @@ -1,45 +0,0 @@ - __( 'Content node with hierarchical (parent/child) relationships', 'wp-graphql' ), - 'interfaces' => [ - 'Node', - 'ContentNode', - 'DatabaseIdentifier', - 'HierarchicalNode', - ], - 'fields' => [ - 'parentId' => [ - 'type' => 'ID', - 'description' => __( 'The globally unique identifier of the parent node.', 'wp-graphql' ), - ], - 'parentDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'Database id of the parent node', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalNode.php deleted file mode 100644 index 570fb781..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalNode.php +++ /dev/null @@ -1,44 +0,0 @@ - __( 'Node with hierarchical (parent/child) relationships', 'wp-graphql' ), - 'interfaces' => [ - 'Node', - 'DatabaseIdentifier', - ], - 'fields' => [ - 'parentId' => [ - 'type' => 'ID', - 'description' => __( 'The globally unique identifier of the parent node.', 'wp-graphql' ), - ], - 'parentDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'Database id of the parent node', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalTermNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalTermNode.php deleted file mode 100644 index 131a9752..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/HierarchicalTermNode.php +++ /dev/null @@ -1,45 +0,0 @@ - __( 'Term node with hierarchical (parent/child) relationships', 'wp-graphql' ), - 'interfaces' => [ - 'Node', - 'TermNode', - 'DatabaseIdentifier', - 'HierarchicalNode', - ], - 'fields' => [ - 'parentId' => [ - 'type' => 'ID', - 'description' => __( 'The globally unique identifier of the parent node.', 'wp-graphql' ), - ], - 'parentDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'Database id of the parent node', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/MenuItemLinkable.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/MenuItemLinkable.php deleted file mode 100644 index 2bbc2719..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/MenuItemLinkable.php +++ /dev/null @@ -1,47 +0,0 @@ - __( 'Nodes that can be linked to as Menu Items', 'wp-graphql' ), - 'interfaces' => [ 'Node', 'UniformResourceIdentifiable', 'DatabaseIdentifier' ], - 'fields' => [], - 'resolveType' => static function ( $node ) use ( $type_registry ) { - switch ( true ) { - case $node instanceof Post: - /** @var \WP_Post_Type $post_type_object */ - $post_type_object = get_post_type_object( $node->post_type ); - $type = $type_registry->get_type( $post_type_object->graphql_single_name ); - break; - case $node instanceof Term: - /** @var \WP_Taxonomy $tax_object */ - $tax_object = get_taxonomy( $node->taxonomyName ); - $type = $type_registry->get_type( $tax_object->graphql_single_name ); - break; - default: - $type = null; - } - - return $type; - }, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Node.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Node.php deleted file mode 100644 index 18ae2bd1..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Node.php +++ /dev/null @@ -1,30 +0,0 @@ - __( 'An object with an ID', 'wp-graphql' ), - 'fields' => [ - 'id' => [ - 'type' => [ 'non_null' => 'ID' ], - 'description' => __( 'The globally unique ID for the object', 'wp-graphql' ), - ], - ], - 'resolveType' => static function ( $node ) { - return DataSource::resolve_node_type( $node ); - }, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithAuthor.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithAuthor.php deleted file mode 100644 index 05846131..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithAuthor.php +++ /dev/null @@ -1,33 +0,0 @@ - [ 'Node' ], - 'description' => __( 'A node that can have an author assigned to it', 'wp-graphql' ), - 'fields' => [ - 'authorId' => [ - 'type' => 'ID', - 'description' => __( 'The globally unique identifier of the author of the node', 'wp-graphql' ), - ], - 'authorDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'The database identifier of the author of the node', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithComments.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithComments.php deleted file mode 100644 index 73ab815b..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithComments.php +++ /dev/null @@ -1,33 +0,0 @@ - [ 'Node' ], - 'description' => __( 'A node that can have comments associated with it', 'wp-graphql' ), - 'fields' => [ - 'commentCount' => [ - 'type' => 'Int', - 'description' => __( 'The number of comments. Even though WPGraphQL denotes this field as an integer, in WordPress this field should be saved as a numeric string for compatibility.', 'wp-graphql' ), - ], - 'commentStatus' => [ - 'type' => 'String', - 'description' => __( 'Whether the comments are open or closed for this particular post.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithContentEditor.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithContentEditor.php deleted file mode 100644 index 7d114036..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithContentEditor.php +++ /dev/null @@ -1,44 +0,0 @@ - [ 'Node' ], - 'description' => __( 'A node that supports the content editor', 'wp-graphql' ), - 'fields' => [ - 'content' => [ - 'type' => 'String', - 'description' => __( 'The content of the post.', 'wp-graphql' ), - 'args' => [ - 'format' => [ - 'type' => 'PostObjectFieldFormatEnum', - 'description' => __( 'Format of the field output', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, $args ) { - if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { - // @codingStandardsIgnoreLine. - return $source->contentRaw; - } - - // @codingStandardsIgnoreLine. - return $source->contentRendered; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithExcerpt.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithExcerpt.php deleted file mode 100644 index b5b5bcae..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithExcerpt.php +++ /dev/null @@ -1,45 +0,0 @@ - [ 'Node' ], - 'description' => __( 'A node that can have an excerpt', 'wp-graphql' ), - 'fields' => [ - 'excerpt' => [ - 'type' => 'String', - 'description' => __( 'The excerpt of the post.', 'wp-graphql' ), - 'args' => [ - 'format' => [ - 'type' => 'PostObjectFieldFormatEnum', - 'description' => __( 'Format of the field output', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, $args ) { - if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { - // @codingStandardsIgnoreLine. - return $source->excerptRaw; - } - - // @codingStandardsIgnoreLine. - return $source->excerptRendered; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithFeaturedImage.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithFeaturedImage.php deleted file mode 100644 index d426b407..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithFeaturedImage.php +++ /dev/null @@ -1,55 +0,0 @@ - __( 'A node that can have a featured image set', 'wp-graphql' ), - 'interfaces' => [ 'Node' ], - 'connections' => [ - 'featuredImage' => [ - 'toType' => 'MediaItem', - 'oneToOne' => true, - 'resolve' => static function ( Post $post, $args, AppContext $context, ResolveInfo $info ) { - if ( empty( $post->featuredImageDatabaseId ) ) { - return null; - } - - $resolver = new PostObjectConnectionResolver( $post, $args, $context, $info, 'attachment' ); - $resolver->set_query_arg( 'p', absint( $post->featuredImageDatabaseId ) ); - - return $resolver->one_to_one()->get_connection(); - }, - ], - ], - 'fields' => [ - 'featuredImageId' => [ - 'type' => 'ID', - 'description' => __( 'Globally unique ID of the featured image assigned to the node', 'wp-graphql' ), - ], - 'featuredImageDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'The database identifier for the featured image node assigned to the content node', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithPageAttributes.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithPageAttributes.php deleted file mode 100644 index 3e641dc3..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithPageAttributes.php +++ /dev/null @@ -1,30 +0,0 @@ - [ 'Node' ], - 'description' => __( 'A node that can have page attributes', 'wp-graphql' ), - 'fields' => [ - 'menuOrder' => [ - 'type' => 'Int', - 'description' => __( 'A field used for ordering posts. This is typically used with nav menu items or for special ordering of hierarchical content types.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithRevisions.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithRevisions.php deleted file mode 100644 index 17ef51bf..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithRevisions.php +++ /dev/null @@ -1,30 +0,0 @@ - [ 'Node' ], - 'description' => __( 'A node that can have revisions', 'wp-graphql' ), - 'fields' => [ - 'isRevision' => [ - 'type' => 'Boolean', - 'description' => __( 'True if the node is a revision of another node', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTemplate.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTemplate.php deleted file mode 100644 index 00f9c2ed..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTemplate.php +++ /dev/null @@ -1,30 +0,0 @@ - __( 'A node that can have a template associated with it', 'wp-graphql' ), - 'interfaces' => [ 'Node' ], - 'fields' => [ - 'template' => [ - 'description' => __( 'The template assigned to the node', 'wp-graphql' ), - 'type' => 'ContentTemplate', - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTitle.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTitle.php deleted file mode 100644 index 9c3bfb0a..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTitle.php +++ /dev/null @@ -1,45 +0,0 @@ - [ 'Node' ], - 'description' => __( 'A node that NodeWith a title', 'wp-graphql' ), - 'fields' => [ - 'title' => [ - 'type' => 'String', - 'description' => __( 'The title of the post. This is currently just the raw title. An amendment to support rendered title needs to be made.', 'wp-graphql' ), - 'args' => [ - 'format' => [ - 'type' => 'PostObjectFieldFormatEnum', - 'description' => __( 'Format of the field output', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, $args ) { - if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { - // @codingStandardsIgnoreLine. - return $source->titleRaw; - } - - // @codingStandardsIgnoreLine. - return $source->titleRendered; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTrackbacks.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTrackbacks.php deleted file mode 100644 index e6fcb7f1..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/NodeWithTrackbacks.php +++ /dev/null @@ -1,38 +0,0 @@ - [ 'Node' ], - 'description' => __( 'A node that can have trackbacks and pingbacks', 'wp-graphql' ), - 'fields' => [ - 'toPing' => [ - 'type' => [ 'list_of' => 'String' ], - 'description' => __( 'URLs queued to be pinged.', 'wp-graphql' ), - ], - 'pinged' => [ - 'type' => [ 'list_of' => 'String' ], - 'description' => __( 'URLs that have been pinged.', 'wp-graphql' ), - ], - 'pingStatus' => [ - 'type' => 'String', - 'description' => __( 'Whether the pings are open or closed for this particular post.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/OneToOneConnection.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/OneToOneConnection.php deleted file mode 100644 index 67452caa..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/OneToOneConnection.php +++ /dev/null @@ -1,31 +0,0 @@ - __( 'A singular connection from one Node to another, with support for relational data on the "edge" of the connection.', 'wp-graphql' ), - 'interfaces' => [ 'Edge' ], - 'fields' => [ - 'node' => [ - 'type' => [ 'non_null' => 'Node' ], - 'description' => __( 'The connected node', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/PageInfo.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/PageInfo.php deleted file mode 100644 index 03d9d448..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/PageInfo.php +++ /dev/null @@ -1,64 +0,0 @@ - __( 'Information about pagination in a connection.', 'wp-graphql' ), - 'interfaces' => [ 'PageInfo' ], - 'fields' => self::get_fields(), - ] - ); - - register_graphql_interface_type( - 'PageInfo', - [ - 'description' => __( 'Information about pagination in a connection.', 'wp-graphql' ), - 'fields' => self::get_fields(), - ] - ); - } - - /** - * Get the fields for the PageInfo Type - * - * @return array[] - */ - public static function get_fields(): array { - return [ - 'hasNextPage' => [ - 'type' => [ - 'non_null' => 'Boolean', - ], - 'description' => __( 'When paginating forwards, are there more items?', 'wp-graphql' ), - ], - 'hasPreviousPage' => [ - 'type' => [ - 'non_null' => 'Boolean', - ], - 'description' => __( 'When paginating backwards, are there more items?', 'wp-graphql' ), - ], - 'startCursor' => [ - 'type' => 'String', - 'description' => __( 'When paginating backwards, the cursor to continue.', 'wp-graphql' ), - ], - 'endCursor' => [ - 'type' => 'String', - 'description' => __( 'When paginating forwards, the cursor to continue.', 'wp-graphql' ), - ], - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Previewable.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Previewable.php deleted file mode 100644 index 7b968662..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/Previewable.php +++ /dev/null @@ -1,51 +0,0 @@ - __( 'Nodes that can be seen in a preview (unpublished) state.', 'wp-graphql' ), - 'fields' => [ - 'isPreview' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is a node in the preview state', 'wp-graphql' ), - ], - 'previewRevisionDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'The database id of the preview node', 'wp-graphql' ), - ], - 'previewRevisionId' => [ - 'type' => 'ID', - 'description' => __( 'Whether the object is a node in the preview state', 'wp-graphql' ), - ], - ], - 'resolveType' => static function ( Post $post ) use ( $type_registry ) { - $type = 'Post'; - - $post_type_object = isset( $post->post_type ) ? get_post_type_object( $post->post_type ) : null; - - if ( isset( $post_type_object->graphql_single_name ) ) { - $type = $type_registry->get_type( $post_type_object->graphql_single_name ); - } - - return $type; - }, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/TermNode.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/TermNode.php deleted file mode 100644 index 0da6f7b8..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/TermNode.php +++ /dev/null @@ -1,112 +0,0 @@ - [ 'Node', 'UniformResourceIdentifiable' ], - 'connections' => [ - 'enqueuedScripts' => [ - 'toType' => 'EnqueuedScript', - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new EnqueuedScriptsConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - }, - ], - 'enqueuedStylesheets' => [ - 'toType' => 'EnqueuedStylesheet', - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new EnqueuedStylesheetConnectionResolver( $source, $args, $context, $info ); - return $resolver->get_connection(); - }, - ], - ], - 'description' => __( 'Terms are nodes within a Taxonomy, used to group and relate other nodes.', 'wp-graphql' ), - 'resolveType' => static function ( $term ) use ( $type_registry ) { - - /** - * The resolveType callback is used at runtime to determine what Type an object - * implementing the TermNode Interface should be resolved as. - * - * You can filter this centrally using the "graphql_wp_interface_type_config" filter - * to override if you need something other than a Post object to be resolved via the - * $post->post_type attribute. - */ - $type = null; - - if ( isset( $term->taxonomyName ) ) { - $tax_object = get_taxonomy( $term->taxonomyName ); - if ( isset( $tax_object->graphql_single_name ) ) { - $type = $type_registry->get_type( $tax_object->graphql_single_name ); - } - } - - return ! empty( $type ) ? $type : null; - }, - 'fields' => [ - 'databaseId' => [ - 'type' => [ 'non_null' => 'Int' ], - 'description' => __( 'Identifies the primary key from the database.', 'wp-graphql' ), - 'resolve' => static function ( Term $term ) { - return absint( $term->term_id ); - }, - ], - 'count' => [ - 'type' => 'Int', - 'description' => __( 'The number of objects connected to the object', 'wp-graphql' ), - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'The description of the object', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'The human friendly name of the object.', 'wp-graphql' ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => __( 'An alphanumeric identifier for the object unique to its type.', 'wp-graphql' ), - ], - 'termGroupId' => [ - 'type' => 'Int', - 'description' => __( 'The ID of the term group that this term object belongs to', 'wp-graphql' ), - ], - 'termTaxonomyId' => [ - 'type' => 'Int', - 'description' => __( 'The taxonomy ID that the object is associated with', 'wp-graphql' ), - ], - 'taxonomyName' => [ - 'type' => 'String', - 'description' => __( 'The name of the taxonomy that the object is associated with', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'link' => [ - 'type' => 'String', - 'description' => __( 'The link to the term', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/UniformResourceIdentifiable.php b/lib/wp-graphql-1.17.0/src/Type/InterfaceType/UniformResourceIdentifiable.php deleted file mode 100644 index ffb30038..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/InterfaceType/UniformResourceIdentifiable.php +++ /dev/null @@ -1,76 +0,0 @@ - [ 'Node' ], - 'description' => __( 'Any node that has a URI', 'wp-graphql' ), - 'fields' => [ - 'uri' => [ - 'type' => 'String', - 'description' => __( 'The unique resource identifier path', 'wp-graphql' ), - ], - 'id' => [ - 'type' => [ 'non_null' => 'ID' ], - 'description' => __( 'The unique resource identifier path', 'wp-graphql' ), - ], - 'isContentNode' => [ - 'type' => [ 'non_null' => 'Boolean' ], - 'description' => __( 'Whether the node is a Content Node', 'wp-graphql' ), - 'resolve' => static function ( $node ) { - return $node instanceof Post; - }, - ], - 'isTermNode' => [ - 'type' => [ 'non_null' => 'Boolean' ], - 'description' => __( 'Whether the node is a Term', 'wp-graphql' ), - 'resolve' => static function ( $node ) { - return $node instanceof Term; - }, - ], - ], - 'resolveType' => static function ( $node ) use ( $type_registry ) { - switch ( true ) { - case $node instanceof Post: - /** @var \WP_Post_Type $post_type_object */ - $post_type_object = get_post_type_object( $node->post_type ); - $type = $type_registry->get_type( $post_type_object->graphql_single_name ); - break; - case $node instanceof Term: - /** @var \WP_Taxonomy $tax_object */ - $tax_object = get_taxonomy( $node->taxonomyName ); - $type = $type_registry->get_type( $tax_object->graphql_single_name ); - break; - case $node instanceof User: - $type = $type_registry->get_type( 'User' ); - break; - case $node instanceof PostType: - $type = $type_registry->get_type( 'ContentType' ); - break; - default: - $type = null; - } - - return $type; - }, - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Avatar.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Avatar.php deleted file mode 100644 index dd9461e7..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Avatar.php +++ /dev/null @@ -1,69 +0,0 @@ - __( 'Avatars are profile images for users. WordPress by default uses the Gravatar service to host and fetch avatars from.', 'wp-graphql' ), - 'model' => AvatarModel::class, - 'fields' => [ - 'size' => [ - 'type' => 'Int', - 'description' => __( 'The size of the avatar in pixels. A value of 96 will match a 96px x 96px gravatar image.', 'wp-graphql' ), - ], - 'height' => [ - 'type' => 'Int', - 'description' => __( 'Height of the avatar image.', 'wp-graphql' ), - ], - 'width' => [ - 'type' => 'Int', - 'description' => __( 'Width of the avatar image.', 'wp-graphql' ), - ], - 'default' => [ - 'type' => 'String', - 'description' => __( "URL for the default image or a default type. Accepts '404' (return a 404 instead of a default image), 'retro' (8bit), 'monsterid' (monster), 'wavatar' (cartoon face), 'indenticon' (the 'quilt'), 'mystery', 'mm', or 'mysteryman' (The Oyster Man), 'blank' (transparent GIF), or 'gravatar_default' (the Gravatar logo).", 'wp-graphql' ), - ], - 'forceDefault' => [ - 'type' => 'Bool', - 'description' => __( 'Whether to always show the default image, never the Gravatar.', 'wp-graphql' ), - ], - 'rating' => [ - 'type' => 'String', - 'description' => __( "What rating to display avatars up to. Accepts 'G', 'PG', 'R', 'X', and are judged in that order.", 'wp-graphql' ), - ], - 'scheme' => [ - 'type' => 'String', - 'description' => __( 'Type of url scheme to use. Typically HTTP vs. HTTPS.', 'wp-graphql' ), - ], - 'extraAttr' => [ - 'type' => 'String', - 'description' => __( 'HTML attributes to insert in the IMG element. Is not sanitized.', 'wp-graphql' ), - ], - 'foundAvatar' => [ - 'type' => 'Bool', - 'description' => __( 'Whether the avatar was successfully found.', 'wp-graphql' ), - ], - 'url' => [ - 'type' => 'String', - 'description' => __( 'URL for the gravatar image source.', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Comment.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Comment.php deleted file mode 100644 index 03f9197b..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Comment.php +++ /dev/null @@ -1,131 +0,0 @@ - __( 'A Comment object', 'wp-graphql' ), - 'model' => CommentModel::class, - 'interfaces' => [ 'Node', 'DatabaseIdentifier' ], - 'connections' => [ - 'author' => [ - 'toType' => 'Commenter', - 'description' => __( 'The author of the comment', 'wp-graphql' ), - 'oneToOne' => true, - 'resolve' => static function ( $comment, $_args, AppContext $context ) { - $node = null; - - // try and load the user node - if ( ! empty( $comment->userId ) ) { - $node = $context->get_loader( 'user' )->load( absint( $comment->userId ) ); - } - - // If no node is loaded, fallback to the - // public comment author data - if ( ! $node || ( true === $node->isPrivate ) ) { - $node = ! empty( $comment->commentId ) ? $context->get_loader( 'comment_author' )->load( $comment->commentId ) : null; - } - - return [ - 'node' => $node, - 'source' => $comment, - ]; - }, - ], - ], - 'fields' => [ - 'agent' => [ - 'type' => 'String', - 'description' => __( 'User agent used to post the comment. This field is equivalent to WP_Comment->comment_agent and the value matching the "comment_agent" column in SQL.', 'wp-graphql' ), - ], - 'approved' => [ - 'type' => 'Boolean', - 'description' => __( 'The approval status of the comment. This field is equivalent to WP_Comment->comment_approved and the value matching the "comment_approved" column in SQL.', 'wp-graphql' ), - 'deprecationReason' => __( 'Deprecated in favor of the `status` field', 'wp-graphql' ), - 'resolve' => static function ( $comment ) { - return 'approve' === $comment->status; - }, - ], - 'authorIp' => [ - 'type' => 'String', - 'description' => __( 'IP address for the author. This field is equivalent to WP_Comment->comment_author_IP and the value matching the "comment_author_IP" column in SQL.', 'wp-graphql' ), - ], - 'commentId' => [ - 'type' => 'Int', - 'description' => __( 'ID for the comment, unique among comments.', 'wp-graphql' ), - 'deprecationReason' => __( 'Deprecated in favor of databaseId', 'wp-graphql' ), - ], - 'content' => [ - 'type' => 'String', - 'description' => __( 'Content of the comment. This field is equivalent to WP_Comment->comment_content and the value matching the "comment_content" column in SQL.', 'wp-graphql' ), - 'args' => [ - 'format' => [ - 'type' => 'PostObjectFieldFormatEnum', - 'description' => __( 'Format of the field output', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( \WPGraphQL\Model\Comment $comment, $args ) { - if ( isset( $args['format'] ) && 'raw' === $args['format'] ) { - return isset( $comment->contentRaw ) ? $comment->contentRaw : null; - } else { - return isset( $comment->contentRendered ) ? $comment->contentRendered : null; - } - }, - ], - 'date' => [ - 'type' => 'String', - 'description' => __( 'Date the comment was posted in local time. This field is equivalent to WP_Comment->date and the value matching the "date" column in SQL.', 'wp-graphql' ), - ], - 'dateGmt' => [ - 'type' => 'String', - 'description' => __( 'Date the comment was posted in GMT. This field is equivalent to WP_Comment->date_gmt and the value matching the "date_gmt" column in SQL.', 'wp-graphql' ), - ], - 'id' => [ - 'description' => __( 'The globally unique identifier for the comment object', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'karma' => [ - 'type' => 'Int', - 'description' => __( 'Karma value for the comment. This field is equivalent to WP_Comment->comment_karma and the value matching the "comment_karma" column in SQL.', 'wp-graphql' ), - ], - 'parentId' => [ - 'type' => 'ID', - 'description' => __( 'The globally unique identifier of the parent comment node.', 'wp-graphql' ), - ], - 'parentDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'The database id of the parent comment node or null if it is the root comment', 'wp-graphql' ), - ], - 'status' => [ - 'type' => 'CommentStatusEnum', - 'description' => __( 'The approval status of the comment. This field is equivalent to WP_Comment->comment_approved and the value matching the "comment_approved" column in SQL.', 'wp-graphql' ), - ], - 'type' => [ - 'type' => 'String', - 'description' => __( 'Type of comment. This field is equivalent to WP_Comment->comment_type and the value matching the "comment_type" column in SQL.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/CommentAuthor.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/CommentAuthor.php deleted file mode 100644 index a5c7cb06..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/CommentAuthor.php +++ /dev/null @@ -1,104 +0,0 @@ - __( 'A Comment Author object', 'wp-graphql' ), - 'interfaces' => [ 'Node', 'Commenter' ], - 'model' => CommentAuthorModel::class, - 'eagerlyLoadType' => true, - 'fields' => [ - 'id' => [ - 'description' => __( 'The globally unique identifier for the comment author object', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'The name for the comment author.', 'wp-graphql' ), - ], - 'email' => [ - 'type' => 'String', - 'description' => __( 'The email for the comment author', 'wp-graphql' ), - ], - 'url' => [ - 'type' => 'String', - 'description' => __( 'The url the comment author.', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'avatar' => [ - 'args' => [ - 'size' => [ - 'type' => 'Int', - 'description' => __( 'The size attribute of the avatar field can be used to fetch avatars of different sizes. The value corresponds to the dimension in pixels to fetch. The default is 96 pixels.', 'wp-graphql' ), - 'defaultValue' => 96, - ], - 'forceDefault' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to always show the default image, never the Gravatar. Default false', 'wp-graphql' ), - ], - 'rating' => [ - 'type' => 'AvatarRatingEnum', - 'description' => __( 'The rating level of the avatar.', 'wp-graphql' ), - ], - - ], - 'resolve' => static function ( $comment_author, $args ) { - /** - * If the $comment_author is a user, the User model only returns the email address if the requesting user is authenticated. - * But, to resolve the Avatar we need a valid email, even for unauthenticated requests. - * - * If the email isn't visible, we use the comment ID to retrieve it, then use it to resolve the avatar. - * - * The email address is not publicly exposed, adhering to the rules of the User model. - */ - $comment_author_email = ! empty( $comment_author->email ) ? $comment_author->email : get_comment_author_email( $comment_author->databaseId ); - - if ( empty( $comment_author_email ) ) { - return null; - } - - $avatar_args = []; - if ( is_numeric( $args['size'] ) ) { - $avatar_args['size'] = absint( $args['size'] ); - if ( ! $avatar_args['size'] ) { - $avatar_args['size'] = 96; - } - } - - if ( ! empty( $args['forceDefault'] ) && true === $args['forceDefault'] ) { - $avatar_args['force_default'] = true; - } - - if ( ! empty( $args['rating'] ) ) { - $avatar_args['rating'] = esc_sql( (string) $args['rating'] ); - } - - $avatar = get_avatar_data( $comment_author_email, $avatar_args ); - - // if there's no url returned, return null - if ( empty( $avatar['url'] ) ) { - return null; - } - - return new \WPGraphQL\Model\Avatar( $avatar ); - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/ContentType.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/ContentType.php deleted file mode 100644 index 234241c3..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/ContentType.php +++ /dev/null @@ -1,136 +0,0 @@ - __( 'An Post Type object', 'wp-graphql' ), - 'interfaces' => $interfaces, - 'model' => PostType::class, - 'fields' => [ - 'id' => [ - 'description' => __( 'The globally unique identifier of the post-type object.', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'The internal name of the post type. This should not be used for display purposes.', 'wp-graphql' ), - ], - 'label' => [ - 'type' => 'String', - 'description' => __( 'Display name of the content type.', 'wp-graphql' ), - ], - 'labels' => [ - 'type' => 'PostTypeLabelDetails', - 'description' => __( 'Details about the content type labels.', 'wp-graphql' ), - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'Description of the content type.', 'wp-graphql' ), - ], - 'public' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether a content type is intended for use publicly either via the admin interface or by front-end users. While the default settings of exclude_from_search, publicly_queryable, show_ui, and show_in_nav_menus are inherited from public, each does not rely on this relationship and controls a very specific intention.', 'wp-graphql' ), - ], - 'hierarchical' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the content type is hierarchical, for example pages.', 'wp-graphql' ), - ], - 'excludeFromSearch' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to exclude nodes of this content type from front end search results.', 'wp-graphql' ), - ], - 'publiclyQueryable' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether queries can be performed on the front end for the content type as part of parse_request().', 'wp-graphql' ), - ], - 'showUi' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to generate and allow a UI for managing this content type in the admin.', 'wp-graphql' ), - ], - 'showInMenu' => [ - 'type' => 'Boolean', - 'description' => __( 'Where to show the content type in the admin menu. To work, $show_ui must be true. If true, the post type is shown in its own top level menu. If false, no menu is shown. If a string of an existing top level menu (eg. "tools.php" or "edit.php?post_type=page"), the post type will be placed as a sub-menu of that.', 'wp-graphql' ), - ], - 'showInNavMenus' => [ - 'type' => 'Boolean', - 'description' => __( 'Makes this content type available for selection in navigation menus.', 'wp-graphql' ), - ], - 'showInAdminBar' => [ - 'type' => 'Boolean', - 'description' => __( 'Makes this content type available via the admin bar.', 'wp-graphql' ), - ], - 'menuPosition' => [ - 'type' => 'Int', - 'description' => __( 'The position of this post type in the menu. Only applies if show_in_menu is true.', 'wp-graphql' ), - ], - 'menuIcon' => [ - 'type' => 'String', - 'description' => __( 'The name of the icon file to display as a menu icon.', 'wp-graphql' ), - ], - 'hasArchive' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether this content type should have archives. Content archives are generated by type and by date.', 'wp-graphql' ), - ], - 'canExport' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether this content type should can be exported.', 'wp-graphql' ), - ], - 'deleteWithUser' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether content of this type should be deleted when the author of it is deleted from the system.', 'wp-graphql' ), - ], - 'showInRest' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the content type is associated with a route under the the REST API "wp/v2" namespace.', 'wp-graphql' ), - ], - 'restBase' => [ - 'type' => 'String', - 'description' => __( 'Name of content type to display in REST API "wp/v2" namespace.', 'wp-graphql' ), - ], - 'restControllerClass' => [ - 'type' => 'String', - 'description' => __( 'The REST Controller class assigned to handling this content type.', 'wp-graphql' ), - ], - 'showInGraphql' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to add the content type to the GraphQL Schema.', 'wp-graphql' ), - ], - 'graphqlSingleName' => [ - 'type' => 'String', - 'description' => __( 'The singular name of the content type within the GraphQL Schema.', 'wp-graphql' ), - ], - 'graphqlPluralName' => [ - 'type' => 'String', - 'description' => __( 'The plural name of the content type within the GraphQL Schema.', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'isFrontPage' => [ - 'type' => [ 'non_null' => 'Bool' ], - 'description' => __( 'Whether this page is set to the static front page.', 'wp-graphql' ), - ], - 'isPostsPage' => [ - 'type' => [ 'non_null' => 'Bool' ], - 'description' => __( 'Whether this page is set to the blog posts page.', 'wp-graphql' ), - ], - ], - - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedScript.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedScript.php deleted file mode 100644 index 1db90261..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedScript.php +++ /dev/null @@ -1,50 +0,0 @@ - __( 'Script enqueued by the CMS', 'wp-graphql' ), - 'interfaces' => [ 'Node', 'EnqueuedAsset' ], - 'fields' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'resolve' => static function ( $asset ) { - return isset( $asset->handle ) ? Relay::toGlobalId( 'enqueued_script', $asset->handle ) : null; - }, - ], - 'src' => [ - 'resolve' => static function ( \_WP_Dependency $script ) { - return ! empty( $script->src ) && is_string( $script->src ) ? $script->src : null; - }, - ], - 'version' => [ - 'resolve' => static function ( \_WP_Dependency $script ) { - global $wp_scripts; - - return ! empty( $script->ver ) && is_string( $script->ver ) ? (string) $script->ver : $wp_scripts->default_version; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedStylesheet.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedStylesheet.php deleted file mode 100644 index 5d8e861d..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/EnqueuedStylesheet.php +++ /dev/null @@ -1,50 +0,0 @@ - __( 'Stylesheet enqueued by the CMS', 'wp-graphql' ), - 'interfaces' => [ 'Node', 'EnqueuedAsset' ], - 'fields' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'resolve' => static function ( $asset ) { - return isset( $asset->handle ) ? Relay::toGlobalId( 'enqueued_stylesheet', $asset->handle ) : null; - }, - ], - 'src' => [ - 'resolve' => static function ( \_WP_Dependency $stylesheet ) { - return ! empty( $stylesheet->src ) && is_string( $stylesheet->src ) ? $stylesheet->src : null; - }, - ], - 'version' => [ - 'resolve' => static function ( \_WP_Dependency $stylesheet ) { - global $wp_styles; - - return ! empty( $stylesheet->ver ) && is_string( $stylesheet->ver ) ? $stylesheet->ver : $wp_styles->default_version; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaDetails.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaDetails.php deleted file mode 100644 index dff2b131..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaDetails.php +++ /dev/null @@ -1,83 +0,0 @@ - __( 'File details for a Media Item', 'wp-graphql' ), - 'fields' => [ - 'width' => [ - 'type' => 'Int', - 'description' => __( 'The width of the mediaItem', 'wp-graphql' ), - ], - 'height' => [ - 'type' => 'Int', - 'description' => __( 'The height of the mediaItem', 'wp-graphql' ), - ], - 'file' => [ - 'type' => 'String', - 'description' => __( 'The filename of the mediaItem', 'wp-graphql' ), - ], - 'sizes' => [ - 'type' => [ - 'list_of' => 'MediaSize', - ], - 'args' => [ - 'exclude' => [ // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude - 'type' => [ 'list_of' => 'MediaItemSizeEnum' ], - 'description' => __( 'The sizes to exclude. Will take precedence over `include`.', 'wp-graphql' ), - ], - 'include' => [ - 'type' => [ 'list_of' => 'MediaItemSizeEnum' ], - 'description' => __( 'The sizes to include. Can be overridden by `exclude`.', 'wp-graphql' ), - ], - ], - 'description' => __( 'The available sizes of the mediaItem', 'wp-graphql' ), - 'resolve' => static function ( $media_details, array $args ) { - // Bail early. - if ( empty( $media_details['sizes'] ) ) { - return null; - } - - // If the include arg is set, only include the sizes specified. - if ( ! empty( $args['include'] ) ) { - $media_details['sizes'] = array_intersect_key( $media_details['sizes'], array_flip( $args['include'] ) ); - } - - // If the exclude arg is set, exclude the sizes specified. - if ( ! empty( $args['exclude'] ) ) { - $media_details['sizes'] = array_diff_key( $media_details['sizes'], array_flip( $args['exclude'] ) ); - } - - $sizes = []; - - foreach ( $media_details['sizes'] as $size_name => $size ) { - $size['ID'] = $media_details['ID']; - $size['name'] = $size_name; - $sizes[] = $size; - } - - return ! empty( $sizes ) ? $sizes : null; - }, - ], - 'meta' => [ - 'type' => 'MediaItemMeta', - 'description' => __( 'Meta information associated with the mediaItem', 'wp-graphql' ), - 'resolve' => static function ( $media_details ) { - return ! empty( $media_details['image_meta'] ) ? $media_details['image_meta'] : null; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaItemMeta.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaItemMeta.php deleted file mode 100644 index d8fec8dd..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaItemMeta.php +++ /dev/null @@ -1,86 +0,0 @@ - __( 'Meta connected to a MediaItem', 'wp-graphql' ), - 'fields' => [ - 'aperture' => [ - 'type' => 'Float', - 'description' => __( 'Aperture measurement of the media item.', 'wp-graphql' ), - ], - 'credit' => [ - 'type' => 'String', - 'description' => __( 'The original creator of the media item.', 'wp-graphql' ), - ], - 'camera' => [ - 'type' => 'String', - 'description' => __( 'Information about the camera used to create the media item.', 'wp-graphql' ), - ], - 'caption' => [ - 'type' => 'String', - 'description' => __( 'The text string description associated with the media item.', 'wp-graphql' ), - ], - 'createdTimestamp' => [ - 'type' => 'Int', - 'description' => __( 'The date/time when the media was created.', 'wp-graphql' ), - 'resolve' => static function ( $meta ) { - return ! empty( $meta['created_timestamp'] ) ? $meta['created_timestamp'] : null; - }, - ], - 'copyright' => [ - 'type' => 'String', - 'description' => __( 'Copyright information associated with the media item.', 'wp-graphql' ), - ], - 'focalLength' => [ - 'type' => 'Float', - 'description' => __( 'The focal length value of the media item.', 'wp-graphql' ), - 'resolve' => static function ( $meta ) { - return ! empty( $meta['focal_length'] ) ? $meta['focal_length'] : null; - }, - ], - 'iso' => [ - 'type' => 'Int', - 'description' => __( 'The ISO (International Organization for Standardization) value of the media item.', 'wp-graphql' ), - ], - 'shutterSpeed' => [ - 'type' => 'Float', - 'description' => __( 'The shutter speed information of the media item.', 'wp-graphql' ), - 'resolve' => static function ( $meta ) { - return ! empty( $meta['shutter_speed'] ) ? $meta['shutter_speed'] : null; - }, - ], - 'title' => [ - 'type' => 'String', - 'description' => __( 'A useful title for the media item.', 'wp-graphql' ), - ], - 'orientation' => [ - 'type' => 'String', - 'description' => __( 'The vertical or horizontal aspect of the media item.', 'wp-graphql' ), - ], - 'keywords' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'List of keywords used to describe or identfy the media item.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaSize.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaSize.php deleted file mode 100644 index ddd44bd8..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MediaSize.php +++ /dev/null @@ -1,77 +0,0 @@ - __( 'Details of an available size for a media item', 'wp-graphql' ), - 'fields' => [ - 'name' => [ - 'type' => 'String', - 'description' => __( 'The referenced size name', 'wp-graphql' ), - ], - 'file' => [ - 'type' => 'String', - 'description' => __( 'The filename of the referenced size', 'wp-graphql' ), - ], - 'width' => [ - 'type' => 'String', - 'description' => __( 'The width of the referenced size', 'wp-graphql' ), - ], - 'height' => [ - 'type' => 'String', - 'description' => __( 'The height of the referenced size', 'wp-graphql' ), - ], - 'mimeType' => [ - 'type' => 'String', - 'description' => __( 'The mime type of the referenced size', 'wp-graphql' ), - 'resolve' => static function ( $image ) { - return ! empty( $image['mime-type'] ) ? $image['mime-type'] : null; - }, - ], - 'fileSize' => [ - 'type' => 'Int', - 'description' => __( 'The filesize of the resource', 'wp-graphql' ), - 'resolve' => static function ( $image ) { - if ( ! empty( $image['ID'] ) && ! empty( $image['file'] ) ) { - $original_file = get_attached_file( absint( $image['ID'] ) ); - $filesize_path = ! empty( $original_file ) ? path_join( dirname( $original_file ), $image['file'] ) : null; - - return ! empty( $filesize_path ) ? filesize( $filesize_path ) : null; - } - - return null; - }, - ], - 'sourceUrl' => [ - 'type' => 'String', - 'description' => __( 'The url of the referenced size', 'wp-graphql' ), - 'resolve' => static function ( $image ) { - $src_url = null; - - if ( ! empty( $image['ID'] ) ) { - $src = wp_get_attachment_image_src( absint( $image['ID'] ), $image['name'] ); - if ( ! empty( $src ) ) { - $src_url = $src[0]; - } - } elseif ( ! empty( $image['file'] ) ) { - $src_url = $image['file']; - } - - return $src_url; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Menu.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Menu.php deleted file mode 100644 index ae293bdf..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Menu.php +++ /dev/null @@ -1,56 +0,0 @@ - __( 'Menus are the containers for navigation items. Menus can be assigned to menu locations, which are typically registered by the active theme.', 'wp-graphql' ), - 'interfaces' => [ 'Node', 'DatabaseIdentifier' ], - 'model' => MenuModel::class, - 'fields' => [ - 'id' => [ - 'description' => __( 'The globally unique identifier of the nav menu object.', 'wp-graphql' ), - ], - 'count' => [ - 'type' => 'Int', - 'description' => __( 'The number of items in the menu', 'wp-graphql' ), - ], - 'menuId' => [ - 'type' => 'Int', - 'description' => __( 'WP ID of the nav menu.', 'wp-graphql' ), - 'deprecationReason' => __( 'Deprecated in favor of the databaseId field', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => esc_html__( 'Display name of the menu. Equivalent to WP_Term->name.', 'wp-graphql' ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => esc_html__( 'The url friendly name of the menu. Equivalent to WP_Term->slug', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'locations' => [ - 'type' => [ - 'list_of' => 'MenuLocationEnum', - ], - 'description' => __( 'The locations a menu is assigned to', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MenuItem.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/MenuItem.php deleted file mode 100644 index 9b126e0f..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/MenuItem.php +++ /dev/null @@ -1,198 +0,0 @@ - __( 'Navigation menu items are the individual items assigned to a menu. These are rendered as the links in a navigation menu.', 'wp-graphql' ), - 'interfaces' => [ 'Node', 'DatabaseIdentifier' ], - 'model' => MenuItemModel::class, - 'connections' => [ - 'connectedNode' => [ - 'toType' => 'MenuItemLinkable', - 'description' => __( 'Connection from MenuItem to it\'s connected node', 'wp-graphql' ), - 'oneToOne' => true, - 'resolve' => static function ( MenuItemModel $menu_item, $args, AppContext $context, ResolveInfo $info ) { - if ( ! isset( $menu_item->databaseId ) ) { - return null; - } - - $object_id = (int) get_post_meta( $menu_item->databaseId, '_menu_item_object_id', true ); - $object_type = get_post_meta( $menu_item->databaseId, '_menu_item_type', true ); - - $resolver = null; - switch ( $object_type ) { - // Post object - case 'post_type': - $resolver = new PostObjectConnectionResolver( $menu_item, $args, $context, $info, 'any' ); - $resolver->set_query_arg( 'p', $object_id ); - - // connected objects to menu items can be any post status - $resolver->set_query_arg( 'post_status', 'any' ); - break; - - // Taxonomy term - case 'taxonomy': - $resolver = new TermObjectConnectionResolver( $menu_item, $args, $context, $info ); - $resolver->set_query_arg( 'include', $object_id ); - break; - default: - break; - } - - return null !== $resolver ? $resolver->one_to_one()->get_connection() : null; - }, - ], - 'menu' => [ - 'toType' => 'Menu', - 'description' => __( 'The Menu a MenuItem is part of', 'wp-graphql' ), - 'oneToOne' => true, - 'resolve' => static function ( MenuItemModel $menu_item, $args, $context, $info ) { - $resolver = new MenuConnectionResolver( $menu_item, $args, $context, $info ); - $resolver->set_query_arg( 'include', $menu_item->menuDatabaseId ); - - return $resolver->one_to_one()->get_connection(); - }, - ], - ], - 'fields' => [ - 'id' => [ - 'description' => __( 'The globally unique identifier of the nav menu item object.', 'wp-graphql' ), - ], - 'parentId' => [ - 'type' => 'ID', - 'description' => __( 'The globally unique identifier of the parent nav menu item object.', 'wp-graphql' ), - ], - 'parentDatabaseId' => [ - 'type' => 'Int', - 'description' => __( 'The database id of the parent menu item or null if it is the root', 'wp-graphql' ), - ], - 'cssClasses' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'Class attribute for the menu item link', 'wp-graphql' ), - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'Description of the menu item.', 'wp-graphql' ), - ], - 'label' => [ - 'type' => 'String', - 'description' => __( 'Label or title of the menu item.', 'wp-graphql' ), - ], - 'linkRelationship' => [ - 'type' => 'String', - 'description' => __( 'Link relationship (XFN) of the menu item.', 'wp-graphql' ), - ], - 'menuItemId' => [ - 'type' => 'Int', - 'description' => __( 'WP ID of the menu item.', 'wp-graphql' ), - 'deprecationReason' => __( 'Deprecated in favor of the databaseId field', 'wp-graphql' ), - ], - 'target' => [ - 'type' => 'String', - 'description' => __( 'Target attribute for the menu item link.', 'wp-graphql' ), - ], - 'title' => [ - 'type' => 'String', - 'description' => __( 'Title attribute for the menu item link', 'wp-graphql' ), - ], - 'url' => [ - 'type' => 'String', - 'description' => __( 'URL or destination of the menu item.', 'wp-graphql' ), - ], - // Note: this field is added to the MenuItem type instead of applied by the "UniformResourceIdentifiable" interface - // because a MenuItem is not identifiable by a uri, the connected resource is identifiable by the uri. - 'uri' => [ - 'type' => 'String', - 'description' => __( 'The uri of the resource the menu item links to', 'wp-graphql' ), - ], - 'path' => [ - 'type' => 'String', - 'description' => __( 'Path for the resource. Relative path for internal resources. Absolute path for external resources.', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'order' => [ - 'type' => 'Int', - 'description' => __( 'Menu item order', 'wp-graphql' ), - ], - 'locations' => [ - 'type' => [ - 'list_of' => 'MenuLocationEnum', - ], - 'description' => __( 'The locations the menu item\'s Menu is assigned to', 'wp-graphql' ), - ], - 'connectedObject' => [ - 'type' => 'MenuItemObjectUnion', - 'deprecationReason' => __( 'Deprecated in favor of the connectedNode field', 'wp-graphql' ), - 'description' => __( 'The object connected to this menu item.', 'wp-graphql' ), - 'resolve' => static function ( $menu_item, array $args, AppContext $context, $info ) { - $object_id = intval( get_post_meta( $menu_item->menuItemId, '_menu_item_object_id', true ) ); - $object_type = get_post_meta( $menu_item->menuItemId, '_menu_item_type', true ); - - switch ( $object_type ) { - // Post object - case 'post_type': - $resolved_object = $context->get_loader( 'post' )->load_deferred( $object_id ); - break; - - // Taxonomy term - case 'taxonomy': - $resolved_object = $context->get_loader( 'term' )->load_deferred( $object_id ); - break; - default: - $resolved_object = null; - break; - } - - /** - * Allow users to override how nav menu items are resolved. - * This is useful since we often add taxonomy terms to menus - * but would prefer to represent the menu item in other ways, - * e.g., a linked post object (or vice-versa). - * - * @param \WP_Post|\WP_Term $resolved_object Post or term connected to MenuItem - * @param array $args Array of arguments input in the field as part of the GraphQL query - * @param \WPGraphQL\AppContext $context Object containing app context that gets passed down the resolve tree - * @param \GraphQL\Type\Definition\ResolveInfo $info Info about fields passed down the resolve tree - * @param int $object_id Post or term ID of connected object - * @param string $object_type Type of connected object ("post_type" or "taxonomy") - * - * @since 0.0.30 - */ - return apply_filters( - 'graphql_resolve_menu_item', - $resolved_object, - $args, - $context, - $info, - $object_id, - $object_type - ); - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Plugin.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Plugin.php deleted file mode 100644 index 639666ae..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Plugin.php +++ /dev/null @@ -1,66 +0,0 @@ - [ 'Node' ], - 'model' => PluginModel::class, - 'description' => __( 'An plugin object', 'wp-graphql' ), - 'fields' => [ - 'id' => [ - 'description' => __( 'The globally unique identifier of the plugin object.', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'Display name of the plugin.', 'wp-graphql' ), - ], - 'pluginUri' => [ - 'type' => 'String', - 'description' => __( 'URI for the plugin website. This is useful for directing users for support requests etc.', 'wp-graphql' ), - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'Description of the plugin.', 'wp-graphql' ), - ], - 'author' => [ - 'type' => 'String', - 'description' => __( 'Name of the plugin author(s), may also be a company name.', 'wp-graphql' ), - ], - 'authorUri' => [ - 'type' => 'String', - 'description' => __( 'URI for the related author(s)/company website.', 'wp-graphql' ), - ], - 'version' => [ - 'type' => 'String', - 'description' => __( 'Current version of the plugin.', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'path' => [ - 'type' => 'String', - 'description' => __( 'Plugin path.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/PostObject.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/PostObject.php deleted file mode 100644 index ca8154f0..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/PostObject.php +++ /dev/null @@ -1,48 +0,0 @@ - __( 'Details for labels of the PostType', 'wp-graphql' ), - 'fields' => [ - 'name' => [ - 'type' => 'String', - 'description' => __( 'General name for the post type, usually plural.', 'wp-graphql' ), - ], - 'singularName' => [ - 'type' => 'String', - 'description' => __( 'Name for one object of this post type.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->singular_name ) ? $labels->singular_name : null; - }, - ], - 'addNew' => [ - 'type' => 'String', - 'description' => __( 'Default is ‘Add New’ for both hierarchical and non-hierarchical types.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->add_new ) ? $labels->add_new : null; - }, - ], - 'addNewItem' => [ - 'type' => 'String', - 'description' => __( 'Label for adding a new singular item.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->add_new_item ) ? $labels->add_new_item : null; - }, - ], - 'editItem' => [ - 'type' => 'String', - 'description' => __( 'Label for editing a singular item.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->edit_item ) ? $labels->edit_item : null; - }, - ], - 'newItem' => [ - 'type' => 'String', - 'description' => __( 'Label for the new item page title.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->new_item ) ? $labels->new_item : null; - }, - ], - 'viewItem' => [ - 'type' => 'String', - 'description' => __( 'Label for viewing a singular item.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->view_item ) ? $labels->view_item : null; - }, - ], - 'viewItems' => [ - 'type' => 'String', - 'description' => __( 'Label for viewing post type archives.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->view_items ) ? $labels->view_items : null; - }, - ], - 'searchItems' => [ - 'type' => 'String', - 'description' => __( 'Label for searching plural items.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->search_items ) ? $labels->search_items : null; - }, - ], - 'notFound' => [ - 'type' => 'String', - 'description' => __( 'Label used when no items are found.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->not_found ) ? $labels->not_found : null; - }, - ], - 'notFoundInTrash' => [ - 'type' => 'String', - 'description' => __( 'Label used when no items are in the trash.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->not_found_in_trash ) ? $labels->not_found_in_trash : null; - }, - ], - 'parentItemColon' => [ - 'type' => 'String', - 'description' => __( 'Label used to prefix parents of hierarchical items.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->parent_item_colon ) ? $labels->parent_item_colon : null; - }, - ], - 'allItems' => [ - 'type' => 'String', - 'description' => __( 'Label to signify all items in a submenu link.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->all_items ) ? $labels->all_items : null; - }, - ], - 'archives' => [ - 'type' => 'String', - 'description' => __( 'Label for archives in nav menus', 'wp-graphql' ), - ], - 'attributes' => [ - 'type' => 'String', - 'description' => __( 'Label for the attributes meta box.', 'wp-graphql' ), - ], - 'insertIntoItem' => [ - 'type' => 'String', - 'description' => __( 'Label for the media frame button.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->insert_into_item ) ? $labels->insert_into_item : null; - }, - ], - 'uploadedToThisItem' => [ - 'type' => 'String', - 'description' => __( 'Label for the media frame filter.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->uploaded_to_this_item ) ? $labels->uploaded_to_this_item : null; - }, - ], - 'featuredImage' => [ - 'type' => 'String', - 'description' => __( 'Label for the Featured Image meta box title.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->featured_image ) ? $labels->featured_image : null; - }, - ], - 'setFeaturedImage' => [ - 'type' => 'String', - 'description' => __( 'Label for setting the featured image.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->set_featured_image ) ? $labels->set_featured_image : null; - }, - ], - 'removeFeaturedImage' => [ - 'type' => 'String', - 'description' => __( 'Label for removing the featured image.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->remove_featured_image ) ? $labels->remove_featured_image : null; - }, - ], - 'useFeaturedImage' => [ - 'type' => 'String', - 'description' => __( 'Label in the media frame for using a featured image.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->use_featured_item ) ? $labels->use_featured_item : null; - }, - ], - 'menuName' => [ - 'type' => 'String', - 'description' => __( 'Label for the menu name.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->menu_name ) ? $labels->menu_name : null; - }, - ], - 'filterItemsList' => [ - 'type' => 'String', - 'description' => __( 'Label for the table views hidden heading.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->filter_items_list ) ? $labels->filter_items_list : null; - }, - ], - 'itemsListNavigation' => [ - 'type' => 'String', - 'description' => __( 'Label for the table pagination hidden heading.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->items_list_navigation ) ? $labels->items_list_navigation : null; - }, - ], - 'itemsList' => [ - 'type' => 'String', - 'description' => __( 'Label for the table hidden heading.', 'wp-graphql' ), - 'resolve' => static function ( $labels ) { - return ! empty( $labels->items_list ) ? $labels->items_list : null; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootMutation.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootMutation.php deleted file mode 100644 index a819cf21..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootMutation.php +++ /dev/null @@ -1,35 +0,0 @@ - __( 'The root mutation', 'wp-graphql' ), - 'fields' => [ - 'increaseCount' => [ - 'type' => 'Int', - 'description' => __( 'Increase the count.', 'wp-graphql' ), - 'args' => [ - 'count' => [ - 'type' => 'Int', - 'description' => __( 'The count to increase', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $root, $args ) { - return isset( $args['count'] ) ? absint( $args['count'] ) + 1 : null; - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootQuery.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootQuery.php deleted file mode 100644 index 3dcea5c4..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/RootQuery.php +++ /dev/null @@ -1,963 +0,0 @@ - __( 'The root entry point into the Graph', 'wp-graphql' ), - 'connections' => [ - 'contentTypes' => [ - 'toType' => 'ContentType', - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new ContentTypeConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - }, - ], - 'menus' => [ - 'toType' => 'Menu', - 'connectionArgs' => [ - 'id' => [ - 'type' => 'Int', - 'description' => __( 'The database ID of the object', 'wp-graphql' ), - ], - 'location' => [ - 'type' => 'MenuLocationEnum', - 'description' => __( 'The menu location for the menu being queried', 'wp-graphql' ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => __( 'The slug of the menu to query items for', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new MenuConnectionResolver( $source, $args, $context, $info, 'nav_menu' ); - - return $resolver->get_connection(); - }, - ], - 'plugins' => [ - 'toType' => 'Plugin', - 'connectionArgs' => [ - 'search' => [ - 'name' => 'search', - 'type' => 'String', - 'description' => __( 'Show plugin based on a keyword search.', 'wp-graphql' ), - ], - 'status' => [ - 'type' => 'PluginStatusEnum', - 'description' => __( 'Show plugins with a specific status.', 'wp-graphql' ), - ], - 'stati' => [ - 'type' => [ 'list_of' => 'PluginStatusEnum' ], - 'description' => __( 'Retrieve plugins where plugin status is in an array.', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $root, $args, $context, $info ) { - return DataSource::resolve_plugins_connection( $root, $args, $context, $info ); - }, - ], - 'registeredScripts' => [ - 'toType' => 'EnqueuedScript', - 'resolve' => static function ( $source, $args, $context, $info ) { - - // The connection resolver expects the source to include - // enqueuedScriptsQueue - $source = new \stdClass(); - $source->enqueuedScriptsQueue = []; - global $wp_scripts; - do_action( 'wp_enqueue_scripts' ); - $source->enqueuedScriptsQueue = array_keys( $wp_scripts->registered ); - $resolver = new EnqueuedScriptsConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - }, - ], - 'registeredStylesheets' => [ - 'toType' => 'EnqueuedStylesheet', - 'resolve' => static function ( $source, $args, $context, $info ) { - - // The connection resolver expects the source to include - // enqueuedStylesheetsQueue - $source = new \stdClass(); - $source->enqueuedStylesheetsQueue = []; - global $wp_styles; - do_action( 'wp_enqueue_scripts' ); - $source->enqueuedStylesheetsQueue = array_keys( $wp_styles->registered ); - $resolver = new EnqueuedStylesheetConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - }, - ], - 'themes' => [ - 'toType' => 'Theme', - 'resolve' => static function ( $root, $args, $context, $info ) { - $resolver = new ThemeConnectionResolver( $root, $args, $context, $info ); - - return $resolver->get_connection(); - }, - ], - 'revisions' => [ - 'toType' => 'ContentNode', - 'queryClass' => 'WP_Query', - 'connectionArgs' => PostObjects::get_connection_args(), - 'resolve' => static function ( $root, $args, $context, $info ) { - $resolver = new PostObjectConnectionResolver( $root, $args, $context, $info, 'revision' ); - - return $resolver->get_connection(); - }, - ], - 'userRoles' => [ - 'toType' => 'UserRole', - 'fromFieldName' => 'userRoles', - 'resolve' => static function ( $user, $args, $context, $info ) { - $resolver = new UserRoleConnectionResolver( $user, $args, $context, $info ); - - return $resolver->get_connection(); - }, - ], - ], - 'fields' => [ - 'allSettings' => [ - 'type' => 'Settings', - 'description' => __( 'Entry point to get all settings for the site', 'wp-graphql' ), - 'resolve' => static function () { - return true; - }, - ], - 'comment' => [ - 'type' => 'Comment', - 'description' => __( 'Returns a Comment', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'Unique identifier for the comment node.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => 'CommentNodeIdTypeEnum', - 'description' => __( 'Type of unique identifier to fetch a comment by. Default is Global ID', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $_source, array $args, AppContext $context ) { - $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; - - switch ( $id_type ) { - case 'database_id': - $id = absint( $args['id'] ); - break; - default: - $id_components = Relay::fromGlobalId( $args['id'] ); - if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { - throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); - } - $id = absint( $id_components['id'] ); - - break; - } - - return $context->get_loader( 'comment' )->load_deferred( $id ); - }, - ], - 'contentNode' => [ - 'type' => 'ContentNode', - 'description' => __( 'A node used to manage content', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'Unique identifier for the content node.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => 'ContentNodeIdTypeEnum', - 'description' => __( 'Type of unique identifier to fetch a content node by. Default is Global ID', 'wp-graphql' ), - ], - 'contentType' => [ - 'type' => 'ContentTypeEnum', - 'description' => __( 'The content type the node is used for. Required when idType is set to "name" or "slug"', 'wp-graphql' ), - ], - 'asPreview' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to return the Preview Node instead of the Published Node. When the ID of a Node is provided along with asPreview being set to true, the preview node with un-published changes will be returned instead of the published node. If no preview node exists or the requester doesn\'t have proper capabilities to preview, no node will be returned.', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $_root, $args, AppContext $context ) { - $idType = $args['idType'] ?? 'global_id'; - switch ( $idType ) { - case 'uri': - return $context->node_resolver->resolve_uri( - $args['id'], - [ - 'nodeType' => 'ContentNode', - ] - ); - case 'database_id': - $post_id = absint( $args['id'] ); - break; - case 'global_id': - default: - $id_components = Relay::fromGlobalId( $args['id'] ); - if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { - throw new UserError( esc_html__( 'The ID input is invalid. Make sure you set the proper idType for your input.', 'wp-graphql' ) ); - } - $post_id = absint( $id_components['id'] ); - break; - } - - if ( isset( $args['asPreview'] ) && true === $args['asPreview'] ) { - $revisions = wp_get_post_revisions( - $post_id, - [ - 'posts_per_page' => 1, - 'fields' => 'ids', - 'check_enabled' => false, - ] - ); - $post_id = ! empty( $revisions ) ? array_values( $revisions )[0] : $post_id; - } - - $allowed_post_types = \WPGraphQL::get_allowed_post_types(); - $allowed_post_types[] = 'revision'; - - return absint( $post_id ) ? $context->get_loader( 'post' )->load_deferred( $post_id )->then( - static function ( $post ) use ( $allowed_post_types ) { - - // if the post isn't an instance of a Post model, return - if ( ! $post instanceof Post ) { - return null; - } - - if ( ! isset( $post->post_type ) || ! in_array( $post->post_type, $allowed_post_types, true ) ) { - return null; - } - - return $post; - } - ) : null; - }, - ], - 'contentType' => [ - 'type' => 'ContentType', - 'description' => __( 'Fetch a Content Type node by unique Identifier', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ 'non_null' => 'ID' ], - 'description' => __( 'Unique Identifier for the Content Type node.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => 'ContentTypeIdTypeEnum', - 'description' => __( 'Type of unique identifier to fetch a content type by. Default is Global ID', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $_root, $args, $context ) { - $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; - - $id = null; - switch ( $id_type ) { - case 'name': - $id = $args['id']; - break; - case 'id': - default: - $id_parts = Relay::fromGlobalId( $args['id'] ); - if ( isset( $id_parts['id'] ) ) { - $id = $id_parts['id']; - } - } - - return ! empty( $id ) ? $context->get_loader( 'post_type' )->load_deferred( $id ) : null; - }, - ], - 'taxonomy' => [ - 'type' => 'Taxonomy', - 'description' => __( 'Fetch a Taxonomy node by unique Identifier', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ 'non_null' => 'ID' ], - 'description' => __( 'Unique Identifier for the Taxonomy node.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => 'TaxonomyIdTypeEnum', - 'description' => __( 'Type of unique identifier to fetch a taxonomy by. Default is Global ID', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $_root, $args, $context ) { - $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; - - $id = null; - switch ( $id_type ) { - case 'name': - $id = $args['id']; - break; - case 'id': - default: - $id_parts = Relay::fromGlobalId( $args['id'] ); - if ( isset( $id_parts['id'] ) ) { - $id = $id_parts['id']; - } - } - - return ! empty( $id ) ? $context->get_loader( 'taxonomy' )->load_deferred( $id ) : null; - }, - ], - 'node' => [ - 'type' => 'Node', - 'description' => __( 'Fetches an object given its ID', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => 'ID', - 'description' => __( 'The unique identifier of the node', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $root, $args, AppContext $context, ResolveInfo $info ) { - return ! empty( $args['id'] ) ? DataSource::resolve_node( $args['id'], $context, $info ) : null; - }, - ], - 'nodeByUri' => [ - 'type' => 'UniformResourceIdentifiable', - 'description' => __( 'Fetches an object given its Unique Resource Identifier', 'wp-graphql' ), - 'args' => [ - 'uri' => [ - 'type' => [ 'non_null' => 'String' ], - 'description' => __( 'Unique Resource Identifier in the form of a path or permalink for a node. Ex: "/hello-world"', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $root, $args, AppContext $context ) { - return ! empty( $args['uri'] ) ? $context->node_resolver->resolve_uri( $args['uri'] ) : null; - }, - ], - 'menu' => [ - 'type' => 'Menu', - 'description' => __( 'A WordPress navigation menu', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The globally unique identifier of the menu.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => 'MenuNodeIdTypeEnum', - 'description' => __( 'Type of unique identifier to fetch a menu by. Default is Global ID', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, array $args, AppContext $context ) { - $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; - - switch ( $id_type ) { - case 'database_id': - $id = absint( $args['id'] ); - break; - case 'location': - $locations = get_nav_menu_locations(); - - if ( ! isset( $locations[ $args['id'] ] ) || ! absint( $locations[ $args['id'] ] ) ) { - throw new UserError( esc_html__( 'No menu set for the provided location', 'wp-graphql' ) ); - } - - $id = absint( $locations[ $args['id'] ] ); - break; - case 'name': - $menu = new \WP_Term_Query( - [ - 'taxonomy' => 'nav_menu', - 'fields' => 'ids', - 'name' => $args['id'], - 'include_children' => false, - 'count' => false, - ] - ); - $id = ! empty( $menu->terms ) ? (int) $menu->terms[0] : null; - break; - case 'slug': - $menu = new \WP_Term_Query( - [ - 'taxonomy' => 'nav_menu', - 'fields' => 'ids', - 'slug' => $args['id'], - 'include_children' => false, - 'count' => false, - ] - ); - $id = ! empty( $menu->terms ) ? (int) $menu->terms[0] : null; - break; - default: - $id_components = Relay::fromGlobalId( $args['id'] ); - if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { - throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); - } - $id = absint( $id_components['id'] ); - - break; - } - - return ! empty( $id ) ? $context->get_loader( 'term' )->load_deferred( absint( $id ) ) : null; - }, - ], - 'menuItem' => [ - 'type' => 'MenuItem', - 'description' => __( 'A WordPress navigation menu item', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The globally unique identifier of the menu item.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => 'MenuItemNodeIdTypeEnum', - 'description' => __( 'Type of unique identifier to fetch a menu item by. Default is Global ID', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, array $args, AppContext $context ) { - $id_type = isset( $args['idType'] ) ? $args['idType'] : 'id'; - - switch ( $id_type ) { - case 'database_id': - $id = absint( $args['id'] ); - break; - default: - $id_components = Relay::fromGlobalId( $args['id'] ); - if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { - throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); - } - $id = absint( $id_components['id'] ); - - break; - } - - return $context->get_loader( 'post' )->load_deferred( absint( $id ) ); - }, - ], - 'plugin' => [ - 'type' => 'Plugin', - 'description' => __( 'A WordPress plugin', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The globally unique identifier of the plugin.', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, array $args, AppContext $context ) { - $id_components = Relay::fromGlobalId( $args['id'] ); - - return ! empty( $id_components['id'] ) ? $context->get_loader( 'plugin' )->load_deferred( $id_components['id'] ) : null; - }, - ], - 'termNode' => [ - 'type' => 'TermNode', - 'description' => __( 'A node in a taxonomy used to group and relate content nodes', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'Unique identifier for the term node.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => 'TermNodeIdTypeEnum', - 'description' => __( 'Type of unique identifier to fetch a term node by. Default is Global ID', 'wp-graphql' ), - ], - 'taxonomy' => [ - 'type' => 'TaxonomyEnum', - 'description' => __( 'The taxonomy of the tern node. Required when idType is set to "name" or "slug"', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $root, $args, AppContext $context ) { - $idType = isset( $args['idType'] ) ? $args['idType'] : 'global_id'; - $term_id = null; - - switch ( $idType ) { - case 'slug': - case 'name': - case 'database_id': - $taxonomy = isset( $args['taxonomy'] ) ? $args['taxonomy'] : null; - if ( empty( $taxonomy ) && in_array( - $idType, - [ - 'name', - 'slug', - ], - true - ) ) { - throw new UserError( esc_html__( 'When fetching a Term Node by "slug" or "name", the "taxonomy" also needs to be set as an input.', 'wp-graphql' ) ); - } - if ( 'database_id' === $idType ) { - $term = get_term( absint( $args['id'] ) ); - } else { - $term = get_term_by( $idType, $args['id'], $taxonomy ); - } - $term_id = isset( $term->term_id ) ? absint( $term->term_id ) : null; - - break; - case 'uri': - return $context->node_resolver->resolve_uri( - $args['id'], - [ - 'nodeType' => 'TermNode', - ] - ); - case 'global_id': - default: - $id_components = Relay::fromGlobalId( $args['id'] ); - if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { - throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); - } - $term_id = absint( $id_components['id'] ); - break; - } - - return ! empty( $term_id ) ? $context->get_loader( 'term' )->load_deferred( $term_id ) : null; - }, - ], - 'theme' => [ - 'type' => 'Theme', - 'description' => __( 'A Theme object', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The globally unique identifier of the theme.', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, array $args ) { - $id_components = Relay::fromGlobalId( $args['id'] ); - - return DataSource::resolve_theme( $id_components['id'] ); - }, - ], - 'user' => [ - 'type' => 'User', - 'description' => __( 'Returns a user', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The globally unique identifier of the user.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => 'UserNodeIdTypeEnum', - 'description' => __( 'Type of unique identifier to fetch a user by. Default is Global ID', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, array $args, $context ) { - $idType = isset( $args['idType'] ) ? $args['idType'] : 'id'; - - switch ( $idType ) { - case 'database_id': - $id = absint( $args['id'] ); - break; - case 'uri': - return $context->node_resolver->resolve_uri( - $args['id'], - [ - 'nodeType' => 'User', - ] - ); - case 'login': - $current_user = wp_get_current_user(); - if ( $current_user->user_login !== $args['id'] ) { - if ( ! current_user_can( 'list_users' ) ) { - throw new UserError( esc_html__( 'You do not have permission to request a User by Username', 'wp-graphql' ) ); - } - } - - $user = get_user_by( 'login', $args['id'] ); - $id = isset( $user->ID ) ? $user->ID : null; - break; - case 'email': - $current_user = wp_get_current_user(); - if ( $current_user->user_email !== $args['id'] ) { - if ( ! current_user_can( 'list_users' ) ) { - throw new UserError( esc_html__( 'You do not have permission to request a User by Email', 'wp-graphql' ) ); - } - } - - $user = get_user_by( 'email', $args['id'] ); - $id = isset( $user->ID ) ? $user->ID : null; - break; - case 'slug': - $user = get_user_by( 'slug', $args['id'] ); - $id = isset( $user->ID ) ? $user->ID : null; - break; - case 'id': - default: - $id_components = Relay::fromGlobalId( $args['id'] ); - $id = absint( $id_components['id'] ); - break; - } - - return ! empty( $id ) ? $context->get_loader( 'user' )->load_deferred( $id ) : null; - }, - ], - 'userRole' => [ - 'type' => 'UserRole', - 'description' => __( 'Returns a user role', 'wp-graphql' ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The globally unique identifier of the user object.', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, array $args ) { - $id_components = Relay::fromGlobalId( $args['id'] ); - - return DataSource::resolve_user_role( $id_components['id'] ); - }, - ], - 'viewer' => [ - 'type' => 'User', - 'description' => __( 'Returns the current user', 'wp-graphql' ), - 'resolve' => static function ( $source, array $args, AppContext $context ) { - return ! empty( $context->viewer->ID ) ? $context->get_loader( 'user' )->load_deferred( $context->viewer->ID ) : null; - }, - ], - ], - ] - ); - } - - /** - * Register RootQuery fields for Post Objects of supported post types - * - * @return void - */ - public static function register_post_object_fields() { - /** @var \WP_Post_Type[] */ - $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects', [ 'graphql_register_root_field' => true ] ); - - foreach ( $allowed_post_types as $post_type_object ) { - register_graphql_field( - 'RootQuery', - $post_type_object->graphql_single_name, - [ - 'type' => $post_type_object->graphql_single_name, - 'description' => sprintf( - // translators: %1$s is the post type GraphQL name, %2$s is the post type description - __( 'An object of the %1$s Type. %2$s', 'wp-graphql' ), - $post_type_object->graphql_single_name, - $post_type_object->description - ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The globally unique identifier of the object.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => $post_type_object->graphql_single_name . 'IdType', - 'description' => __( 'Type of unique identifier to fetch by. Default is Global ID', 'wp-graphql' ), - ], - 'asPreview' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to return the Preview Node instead of the Published Node. When the ID of a Node is provided along with asPreview being set to true, the preview node with un-published changes will be returned instead of the published node. If no preview node exists or the requester doesn\'t have proper capabilities to preview, no node will be returned.', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $source, array $args, AppContext $context ) use ( $post_type_object ) { - $idType = isset( $args['idType'] ) ? $args['idType'] : 'global_id'; - $post_id = null; - switch ( $idType ) { - case 'slug': - return $context->node_resolver->resolve_uri( - $args['id'], - [ - 'name' => $args['id'], - 'post_type' => $post_type_object->name, - 'nodeType' => 'ContentNode', - ] - ); - case 'uri': - return $context->node_resolver->resolve_uri( - $args['id'], - [ - 'post_type' => $post_type_object->name, - 'archive' => false, - 'nodeType' => 'ContentNode', - ] - ); - case 'database_id': - $post_id = absint( $args['id'] ); - break; - case 'source_url': - $url = $args['id']; - $post_id = attachment_url_to_postid( $url ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.attachment_url_to_postid_attachment_url_to_postid - if ( empty( $post_id ) ) { - return null; - } - $post_id = absint( attachment_url_to_postid( $url ) ); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.attachment_url_to_postid_attachment_url_to_postid - break; - case 'global_id': - default: - $id_components = Relay::fromGlobalId( $args['id'] ); - if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { - throw new UserError( esc_html__( 'The ID input is invalid. Make sure you set the proper idType for your input.', 'wp-graphql' ) ); - } - $post_id = absint( $id_components['id'] ); - break; - } - - if ( isset( $args['asPreview'] ) && true === $args['asPreview'] ) { - $revisions = wp_get_post_revisions( - $post_id, - [ - 'posts_per_page' => 1, - 'fields' => 'ids', - 'check_enabled' => false, - ] - ); - $post_id = ! empty( $revisions ) ? array_values( $revisions )[0] : $post_id; - } - - return absint( $post_id ) ? $context->get_loader( 'post' )->load_deferred( $post_id )->then( - static function ( $post ) use ( $post_type_object ) { - - // if the post isn't an instance of a Post model, return - if ( ! $post instanceof Post ) { - return null; - } - - if ( ! isset( $post->post_type ) || ! in_array( - $post->post_type, - [ - 'revision', - $post_type_object->name, - ], - true - ) ) { - return null; - } - - return $post; - } - ) : null; - }, - ] - ); - $post_by_args = [ - 'id' => [ - 'type' => 'ID', - 'description' => sprintf( - // translators: %s is the post type's GraphQL name. - __( 'Get the %s object by its global ID', 'wp-graphql' ), - $post_type_object->graphql_single_name - ), - ], - $post_type_object->graphql_single_name . 'Id' => [ - 'type' => 'Int', - 'description' => sprintf( - // translators: %s is the post type's GraphQL name. - __( 'Get the %s by its database ID', 'wp-graphql' ), - $post_type_object->graphql_single_name - ), - ], - 'uri' => [ - 'type' => 'String', - 'description' => sprintf( - // translators: %s is the post type's GraphQL name. - __( 'Get the %s by its uri', 'wp-graphql' ), - $post_type_object->graphql_single_name - ), - ], - ]; - if ( false === $post_type_object->hierarchical ) { - $post_by_args['slug'] = [ - 'type' => 'String', - 'description' => sprintf( - // translators: %s is the post type's GraphQL name. - __( 'Get the %s by its slug (only available for non-hierarchical types)', 'wp-graphql' ), - $post_type_object->graphql_single_name - ), - ]; - } - - /** - * @deprecated Deprecated in favor of single node entry points - */ - register_graphql_field( - 'RootQuery', - $post_type_object->graphql_single_name . 'By', - [ - 'type' => $post_type_object->graphql_single_name, - 'deprecationReason' => __( 'Deprecated in favor of using the single entry point for this type with ID and IDType fields. For example, instead of postBy( id: "" ), use post(id: "" idType: "")', 'wp-graphql' ), - 'description' => sprintf( - // translators: %s is the post type's GraphQL name. - __( 'A %s object', 'wp-graphql' ), - $post_type_object->graphql_single_name - ), - 'args' => $post_by_args, - 'resolve' => static function ( $source, array $args, $context ) use ( $post_type_object ) { - $post_id = 0; - - if ( ! empty( $args['id'] ) ) { - $id_components = Relay::fromGlobalId( $args['id'] ); - if ( empty( $id_components['id'] ) || empty( $id_components['type'] ) ) { - throw new UserError( esc_html__( 'The "id" is invalid', 'wp-graphql' ) ); - } - $post_id = absint( $id_components['id'] ); - } elseif ( ! empty( $args[ lcfirst( $post_type_object->graphql_single_name . 'Id' ) ] ) ) { - $id = $args[ lcfirst( $post_type_object->graphql_single_name . 'Id' ) ]; - $post_id = absint( $id ); - } elseif ( ! empty( $args['uri'] ) ) { - return $context->node_resolver->resolve_uri( - $args['uri'], - [ - 'post_type' => $post_type_object->name, - 'archive' => false, - 'nodeType' => 'ContentNode', - ] - ); - } elseif ( ! empty( $args['slug'] ) ) { - $slug = esc_html( $args['slug'] ); - - return $context->node_resolver->resolve_uri( - $slug, - [ - 'name' => $slug, - 'post_type' => $post_type_object->name, - 'nodeType' => 'ContentNode', - ] - ); - } - - return $context->get_loader( 'post' )->load_deferred( $post_id )->then( - static function ( $post ) use ( $post_type_object ) { - - // if the post type object isn't an instance of WP_Post_Type, return - if ( ! $post_type_object instanceof \WP_Post_Type ) { - return null; - } - - // if the post isn't an instance of a Post model, return - if ( ! $post instanceof Post ) { - return null; - } - - if ( ! isset( $post->post_type ) || ! in_array( - $post->post_type, - [ - 'revision', - $post_type_object->name, - ], - true - ) ) { - return null; - } - - return $post; - } - ); - }, - ] - ); - } - } - - /** - * Register RootQuery fields for Term Objects of supported taxonomies - * - * @return void - */ - public static function register_term_object_fields() { - /** @var \WP_Taxonomy[] $allowed_taxonomies */ - $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects', [ 'graphql_register_root_field' => true ] ); - - foreach ( $allowed_taxonomies as $tax_object ) { - register_graphql_field( - 'RootQuery', - $tax_object->graphql_single_name, - [ - 'type' => $tax_object->graphql_single_name, - 'description' => sprintf( - // translators: %s is the taxonomys' GraphQL name. - __( 'A % object', 'wp-graphql' ), - $tax_object->graphql_single_name - ), - 'args' => [ - 'id' => [ - 'type' => [ - 'non_null' => 'ID', - ], - 'description' => __( 'The globally unique identifier of the object.', 'wp-graphql' ), - ], - 'idType' => [ - 'type' => $tax_object->graphql_single_name . 'IdType', - 'description' => __( 'Type of unique identifier to fetch by. Default is Global ID', 'wp-graphql' ), - ], - ], - 'resolve' => static function ( $_source, array $args, $context ) use ( $tax_object ) { - $idType = isset( $args['idType'] ) ? $args['idType'] : 'global_id'; - $term_id = null; - - switch ( $idType ) { - case 'slug': - case 'name': - case 'database_id': - if ( 'database_id' === $idType ) { - $idType = 'id'; - } - $term = get_term_by( $idType, $args['id'], $tax_object->name ); - $term_id = isset( $term->term_id ) ? absint( $term->term_id ) : null; - break; - case 'uri': - return $context->node_resolver->resolve_uri( - $args['id'], - [ - 'nodeType' => 'TermNode', - 'taxonomy' => $tax_object->name, - ] - ); - case 'global_id': - default: - $id_components = Relay::fromGlobalId( $args['id'] ); - if ( ! isset( $id_components['id'] ) || ! absint( $id_components['id'] ) ) { - throw new UserError( esc_html__( 'The ID input is invalid', 'wp-graphql' ) ); - } - $term_id = absint( $id_components['id'] ); - break; - } - - return ! empty( $term_id ) ? $context->get_loader( 'term' )->load_deferred( (int) $term_id ) : null; - }, - ] - ); - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/SettingGroup.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/SettingGroup.php deleted file mode 100644 index cdbd60cc..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/SettingGroup.php +++ /dev/null @@ -1,125 +0,0 @@ - sprintf( __( 'The %s setting type', 'wp-graphql' ), $group_name ), - 'fields' => $fields, - ] - ); - - return ucfirst( $group_name ) . 'Settings'; - } - - /** - * Given the name of a registered settings group, retrieve GraphQL fields for the group - * - * @param string $group_name Name of the settings group to retrieve fields for - * @param string $group The settings group config - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry - * - * @return array - */ - public static function get_settings_group_fields( string $group_name, string $group, TypeRegistry $type_registry ) { - $setting_fields = DataSource::get_setting_group_fields( $group, $type_registry ); - $fields = []; - - if ( ! empty( $setting_fields ) && is_array( $setting_fields ) ) { - foreach ( $setting_fields as $key => $setting_field ) { - if ( ! isset( $setting_field['type'] ) || ! $type_registry->get_type( $setting_field['type'] ) ) { - continue; - } - - /** - * Determine if the individual setting already has a - * REST API name, if not use the option name. - * Then, sanitize the field name to be camelcase - */ - if ( ! empty( $setting_field['show_in_rest']['name'] ) ) { - $field_key = $setting_field['show_in_rest']['name']; - } else { - $field_key = $key; - } - - $field_key = graphql_format_name( $field_key, ' ', '/[^a-zA-Z0-9 -]/' ); - $field_key = lcfirst( str_replace( '_', ' ', ucwords( $field_key, '_' ) ) ); - $field_key = lcfirst( str_replace( '-', ' ', ucwords( $field_key, '_' ) ) ); - $field_key = lcfirst( str_replace( ' ', '', ucwords( $field_key, ' ' ) ) ); - - if ( ! empty( $key ) && ! empty( $field_key ) ) { - - /** - * Dynamically build the individual setting and it's fields - * then add it to the fields array - */ - $fields[ $field_key ] = [ - 'type' => $type_registry->get_type( $setting_field['type'] ), - // translators: %s is the name of the setting group. - 'description' => isset( $setting_field['description'] ) && ! empty( $setting_field['description'] ) ? $setting_field['description'] : sprintf( __( 'The %s Settings Group', 'wp-graphql' ), $setting_field['type'] ), - 'resolve' => static function () use ( $setting_field ) { - - /** - * Check to see if the user querying the email field has the 'manage_options' capability - * All other options should be public by default - */ - if ( 'admin_email' === $setting_field['key'] ) { - if ( ! current_user_can( 'manage_options' ) ) { - throw new UserError( esc_html__( 'Sorry, you do not have permission to view this setting.', 'wp-graphql' ) ); - } - } - - $option = ! empty( $setting_field['key'] ) ? get_option( $setting_field['key'] ) : null; - - switch ( $setting_field['type'] ) { - case 'integer': - case 'int': - return absint( $option ); - case 'string': - return (string) $option; - case 'boolean': - case 'bool': - return (bool) $option; - case 'number': - case 'float': - return (float) $option; - } - - return ! empty( $option ) ? $option : null; - }, - ]; - } - } - } - - return $fields; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Settings.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Settings.php deleted file mode 100644 index d513c73e..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Settings.php +++ /dev/null @@ -1,128 +0,0 @@ - __( 'All of the registered settings', 'wp-graphql' ), - 'fields' => $fields, - ] - ); - } - - /** - * Returns an array of fields for all settings based on the `register_setting` WordPress API - * - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL TypeRegistry - * - * @return array - */ - public static function get_fields( TypeRegistry $type_registry ) { - $registered_settings = DataSource::get_allowed_settings( $type_registry ); - $fields = []; - - if ( ! empty( $registered_settings ) && is_array( $registered_settings ) ) { - - /** - * Loop through the $settings_array and build thevar - * setting with - * proper fields - */ - foreach ( $registered_settings as $key => $setting_field ) { - if ( ! isset( $setting_field['type'] ) || ! $type_registry->get_type( $setting_field['type'] ) ) { - continue; - } - - /** - * Determine if the individual setting already has a - * REST API name, if not use the option name. - * Then, sanitize the field name to be camelcase - */ - if ( ! empty( $setting_field['show_in_rest']['name'] ) ) { - $field_key = $setting_field['show_in_rest']['name']; - } else { - $field_key = $key; - } - - $group = DataSource::format_group_name( $setting_field['group'] ); - - $field_key = lcfirst( graphql_format_name( $field_key, ' ', '/[^a-zA-Z0-9 -]/' ) ); - $field_key = lcfirst( str_replace( '_', ' ', ucwords( $field_key, '_' ) ) ); - $field_key = lcfirst( str_replace( '-', ' ', ucwords( $field_key, '_' ) ) ); - $field_key = lcfirst( str_replace( ' ', '', ucwords( $field_key, ' ' ) ) ); - - $field_key = $group . 'Settings' . ucfirst( $field_key ); - - if ( ! empty( $key ) ) { - - /** - * Dynamically build the individual setting and it's fields - * then add it to $fields - */ - $fields[ $field_key ] = [ - 'type' => $setting_field['type'], - // translators: %s is the name of the setting group. - 'description' => sprintf( __( 'Settings of the the %s Settings Group', 'wp-graphql' ), $setting_field['type'] ), - 'resolve' => static function () use ( $setting_field, $key ) { - /** - * Check to see if the user querying the email field has the 'manage_options' capability - * All other options should be public by default - */ - if ( 'admin_email' === $key && ! current_user_can( 'manage_options' ) ) { - throw new UserError( esc_html__( 'Sorry, you do not have permission to view this setting.', 'wp-graphql' ) ); - } - - $option = get_option( (string) $key ); - - switch ( $setting_field['type'] ) { - case 'integer': - $option = absint( $option ); - break; - case 'string': - $option = ! empty( $option ) ? (string) $option : ''; - break; - case 'boolean': - $option = (bool) $option; - break; - case 'number': - $option = (float) $option; - break; - } - - return isset( $option ) ? $option : null; - }, - ]; - } - } - } - - return $fields; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Taxonomy.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/Taxonomy.php deleted file mode 100644 index 9922039f..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/Taxonomy.php +++ /dev/null @@ -1,130 +0,0 @@ - __( 'A taxonomy object', 'wp-graphql' ), - 'interfaces' => [ 'Node' ], - 'model' => TaxonomyModel::class, - 'connections' => [ - 'connectedContentTypes' => [ - 'toType' => 'ContentType', - 'description' => __( 'List of Content Types associated with the Taxonomy', 'wp-graphql' ), - 'resolve' => static function ( TaxonomyModel $taxonomy, $args, AppContext $context, ResolveInfo $info ) { - $connected_post_types = ! empty( $taxonomy->object_type ) ? $taxonomy->object_type : []; - $resolver = new ContentTypeConnectionResolver( $taxonomy, $args, $context, $info ); - $resolver->set_query_arg( 'contentTypeNames', $connected_post_types ); - return $resolver->get_connection(); - }, - ], - 'connectedTerms' => [ - 'toType' => 'TermNode', - 'connectionInterfaces' => [ 'TermNodeConnection' ], - 'description' => __( 'List of Term Nodes associated with the Taxonomy', 'wp-graphql' ), - 'resolve' => static function ( TaxonomyModel $source, $args, AppContext $context, ResolveInfo $info ) { - $taxonomies = [ $source->name ]; - - $resolver = new TermObjectConnectionResolver( $source, $args, $context, $info, $taxonomies ); - - return $resolver->get_connection(); - }, - ], - ], - 'fields' => [ - 'id' => [ - 'description' => __( 'The globally unique identifier of the taxonomy object.', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'The display name of the taxonomy. This field is equivalent to WP_Taxonomy->label', 'wp-graphql' ), - ], - 'label' => [ - 'type' => 'String', - 'description' => __( 'Name of the taxonomy shown in the menu. Usually plural.', 'wp-graphql' ), - ], - // @todo: add "labels" field - 'description' => [ - 'type' => 'String', - 'description' => __( 'Description of the taxonomy. This field is equivalent to WP_Taxonomy->description', 'wp-graphql' ), - ], - 'public' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the taxonomy is publicly queryable', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'hierarchical' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the taxonomy is hierarchical', 'wp-graphql' ), - ], - 'showUi' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to generate and allow a UI for managing terms in this taxonomy in the admin', 'wp-graphql' ), - ], - 'showInMenu' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to show the taxonomy in the admin menu', 'wp-graphql' ), - ], - 'showInNavMenus' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the taxonomy is available for selection in navigation menus.', 'wp-graphql' ), - ], - 'showCloud' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to show the taxonomy as part of a tag cloud widget. This field is equivalent to WP_Taxonomy->show_tagcloud', 'wp-graphql' ), - ], - 'showInQuickEdit' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to show the taxonomy in the quick/bulk edit panel.', 'wp-graphql' ), - ], - 'showInAdminColumn' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to display a column for the taxonomy on its post type listing screens.', 'wp-graphql' ), - ], - 'showInRest' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to add the post type route in the REST API "wp/v2" namespace.', 'wp-graphql' ), - ], - 'restBase' => [ - 'type' => 'String', - 'description' => __( 'Name of content type to display in REST API "wp/v2" namespace.', 'wp-graphql' ), - ], - 'restControllerClass' => [ - 'type' => 'String', - 'description' => __( 'The REST Controller class assigned to handling this content type.', 'wp-graphql' ), - ], - 'showInGraphql' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to add the post type to the GraphQL Schema.', 'wp-graphql' ), - ], - 'graphqlSingleName' => [ - 'type' => 'String', - 'description' => __( 'The singular name of the post type within the GraphQL Schema.', 'wp-graphql' ), - ], - 'graphqlPluralName' => [ - 'type' => 'String', - 'description' => __( 'The plural name of the post type within the GraphQL Schema.', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/TermObject.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/TermObject.php deleted file mode 100644 index 8009999b..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/TermObject.php +++ /dev/null @@ -1,29 +0,0 @@ - __( 'A theme object', 'wp-graphql' ), - 'interfaces' => [ 'Node' ], - 'model' => ThemeModel::class, - 'fields' => [ - 'id' => [ - 'description' => __( 'The globally unique identifier of the theme object.', 'wp-graphql' ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => __( 'The theme slug is used to internally match themes. Theme slugs can have subdirectories like: my-theme/sub-theme. This field is equivalent to WP_Theme->get_stylesheet().', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'Display name of the theme. This field is equivalent to WP_Theme->get( "Name" ).', 'wp-graphql' ), - ], - 'screenshot' => [ - 'type' => 'String', - 'description' => __( 'The URL of the screenshot for the theme. The screenshot is intended to give an overview of what the theme looks like. This field is equivalent to WP_Theme->get_screenshot().', 'wp-graphql' ), - ], - 'themeUri' => [ - 'type' => 'String', - 'description' => __( 'A URI if the theme has a website associated with it. The Theme URI is handy for directing users to a theme site for support etc. This field is equivalent to WP_Theme->get( "ThemeURI" ).', 'wp-graphql' ), - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'The description of the theme. This field is equivalent to WP_Theme->get( "Description" ).', 'wp-graphql' ), - ], - 'author' => [ - 'type' => 'String', - 'description' => __( 'Name of the theme author(s), could also be a company name. This field is equivalent to WP_Theme->get( "Author" ).', 'wp-graphql' ), - ], - 'authorUri' => [ - 'type' => 'String', - 'description' => __( 'URI for the author/company website. This field is equivalent to WP_Theme->get( "AuthorURI" ).', 'wp-graphql' ), - ], - 'tags' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'URI for the author/company website. This field is equivalent to WP_Theme->get( "Tags" ).', 'wp-graphql' ), - ], - 'version' => [ - 'type' => 'String', - 'description' => __( 'The current version of the theme. This field is equivalent to WP_Theme->get( "Version" ).', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - ], - - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/User.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/User.php deleted file mode 100644 index 28c9e546..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/User.php +++ /dev/null @@ -1,207 +0,0 @@ - __( 'A User object', 'wp-graphql' ), - 'model' => UserModel::class, - 'interfaces' => [ 'Node', 'UniformResourceIdentifiable', 'Commenter', 'DatabaseIdentifier' ], - 'connections' => [ - 'enqueuedScripts' => [ - 'toType' => 'EnqueuedScript', - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new EnqueuedScriptsConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - }, - ], - 'enqueuedStylesheets' => [ - 'toType' => 'EnqueuedStylesheet', - 'resolve' => static function ( $source, $args, $context, $info ) { - $resolver = new EnqueuedStylesheetConnectionResolver( $source, $args, $context, $info ); - - return $resolver->get_connection(); - }, - ], - 'revisions' => [ - 'toType' => 'ContentNode', - 'connectionTypeName' => 'UserToRevisionsConnection', - 'queryClass' => 'WP_Query', - 'description' => __( 'Connection between the User and Revisions authored by the user', 'wp-graphql' ), - 'connectionArgs' => PostObjects::get_connection_args(), - 'resolve' => static function ( $root, $args, $context, $info ) { - $resolver = new PostObjectConnectionResolver( $root, $args, $context, $info, 'revision' ); - - return $resolver->get_connection(); - }, - ], - 'roles' => [ - 'toType' => 'UserRole', - 'fromFieldName' => 'roles', - 'resolve' => static function ( UserModel $user, $args, $context, $info ) { - $resolver = new UserRoleConnectionResolver( $user, $args, $context, $info ); - - // abort if no roles are set - if ( empty( $user->roles ) ) { - return null; - } - - // Only get roles matching the slugs of the roles belonging to the user - $resolver->set_query_arg( 'slugIn', $user->roles ); - return $resolver->get_connection(); - }, - ], - ], - 'fields' => [ - 'id' => [ - 'description' => __( 'The globally unique identifier for the user object.', 'wp-graphql' ), - ], - 'databaseId' => [ - 'type' => [ 'non_null' => 'Int' ], - 'description' => __( 'Identifies the primary key from the database.', 'wp-graphql' ), - 'resolve' => static function ( \WPGraphQL\Model\User $user ) { - return absint( $user->userId ); - }, - ], - 'capabilities' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'A list of capabilities (permissions) granted to the user', 'wp-graphql' ), - ], - 'capKey' => [ - 'type' => 'String', - 'description' => __( 'User metadata option name. Usually it will be "wp_capabilities".', 'wp-graphql' ), - ], - 'email' => [ - 'type' => 'String', - 'description' => __( 'Email address of the user. This is equivalent to the WP_User->user_email property.', 'wp-graphql' ), - ], - 'firstName' => [ - 'type' => 'String', - 'description' => __( 'First name of the user. This is equivalent to the WP_User->user_first_name property.', 'wp-graphql' ), - ], - 'lastName' => [ - 'type' => 'String', - 'description' => __( 'Last name of the user. This is equivalent to the WP_User->user_last_name property.', 'wp-graphql' ), - ], - 'extraCapabilities' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'A complete list of capabilities including capabilities inherited from a role. This is equivalent to the array keys of WP_User->allcaps.', 'wp-graphql' ), - ], - 'description' => [ - 'type' => 'String', - 'description' => __( 'Description of the user.', 'wp-graphql' ), - ], - 'username' => [ - 'type' => 'String', - 'description' => __( 'Username for the user. This field is equivalent to WP_User->user_login.', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'Display name of the user. This is equivalent to the WP_User->display_name property.', 'wp-graphql' ), - ], - 'registeredDate' => [ - 'type' => 'String', - 'description' => __( 'The date the user registered or was created. The field follows a full ISO8601 date string format.', 'wp-graphql' ), - ], - 'nickname' => [ - 'type' => 'String', - 'description' => __( 'Nickname of the user.', 'wp-graphql' ), - ], - 'url' => [ - 'type' => 'String', - 'description' => __( 'A website url that is associated with the user.', 'wp-graphql' ), - ], - 'slug' => [ - 'type' => 'String', - 'description' => __( 'The slug for the user. This field is equivalent to WP_User->user_nicename', 'wp-graphql' ), - ], - 'nicename' => [ - 'type' => 'String', - 'description' => __( 'The nicename for the user. This field is equivalent to WP_User->user_nicename', 'wp-graphql' ), - ], - 'locale' => [ - 'type' => 'String', - 'description' => __( 'The preferred language locale set for the user. Value derived from get_user_locale().', 'wp-graphql' ), - ], - 'userId' => [ - 'type' => 'Int', - 'description' => __( 'The Id of the user. Equivalent to WP_User->ID', 'wp-graphql' ), - 'deprecationReason' => __( 'Deprecated in favor of the databaseId field', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - 'shouldShowAdminToolbar' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the Toolbar should be displayed when the user is viewing the site.', 'wp-graphql' ), - ], - 'avatar' => [ - 'args' => [ - 'size' => [ - 'type' => 'Int', - 'description' => __( 'The size attribute of the avatar field can be used to fetch avatars of different sizes. The value corresponds to the dimension in pixels to fetch. The default is 96 pixels.', 'wp-graphql' ), - 'defaultValue' => 96, - ], - 'forceDefault' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether to always show the default image, never the Gravatar. Default false', 'wp-graphql' ), - ], - 'rating' => [ - 'type' => 'AvatarRatingEnum', - 'description' => __( 'The rating level of the avatar.', 'wp-graphql' ), - ], - - ], - 'resolve' => static function ( $user, $args ) { - $avatar_args = []; - if ( is_numeric( $args['size'] ) ) { - $avatar_args['size'] = absint( $args['size'] ); - if ( ! $avatar_args['size'] ) { - $avatar_args['size'] = 96; - } - } - - if ( ! empty( $args['forceDefault'] ) && true === $args['forceDefault'] ) { - $avatar_args['force_default'] = true; - } - - if ( ! empty( $args['rating'] ) ) { - $avatar_args['rating'] = esc_sql( $args['rating'] ); - } - - return DataSource::resolve_avatar( $user->userId, $avatar_args ); - }, - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/ObjectType/UserRole.php b/lib/wp-graphql-1.17.0/src/Type/ObjectType/UserRole.php deleted file mode 100644 index b3c94a5c..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/ObjectType/UserRole.php +++ /dev/null @@ -1,47 +0,0 @@ - __( 'A user role object', 'wp-graphql' ), - 'model' => UserRoleModel::class, - 'interfaces' => [ 'Node' ], - 'fields' => [ - 'id' => [ - 'description' => __( 'The globally unique identifier for the user role object.', 'wp-graphql' ), - ], - 'name' => [ - 'type' => 'String', - 'description' => __( 'The registered name of the role', 'wp-graphql' ), - ], - 'capabilities' => [ - 'type' => [ - 'list_of' => 'String', - ], - 'description' => __( 'The capabilities that belong to this role', 'wp-graphql' ), - ], - 'displayName' => [ - 'type' => 'String', - 'description' => __( 'The display name of the role', 'wp-graphql' ), - ], - 'isRestricted' => [ - 'type' => 'Boolean', - 'description' => __( 'Whether the object is restricted from the current viewer', 'wp-graphql' ), - ], - ], - ] - ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Union/MenuItemObjectUnion.php b/lib/wp-graphql-1.17.0/src/Type/Union/MenuItemObjectUnion.php deleted file mode 100644 index 96ebced0..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Union/MenuItemObjectUnion.php +++ /dev/null @@ -1,93 +0,0 @@ - self::get_possible_types(), - 'description' => __( 'Deprecated in favor of MenuItemLinkeable Interface', 'wp-graphql' ), - 'resolveType' => static function ( $obj ) use ( $type_registry ) { - _doing_it_wrong( 'MenuItemObjectUnion', esc_attr__( 'The MenuItemObjectUnion GraphQL type is deprecated in favor of MenuItemLinkeable Interface', 'wp-graphql' ), '0.10.3' ); - // Post object - if ( $obj instanceof Post && isset( $obj->post_type ) && ! empty( $obj->post_type ) ) { - /** @var \WP_Post_Type $post_type_object */ - $post_type_object = get_post_type_object( $obj->post_type ); - - return $type_registry->get_type( $post_type_object->graphql_single_name ); - } - - // Taxonomy term - if ( $obj instanceof Term && ! empty( $obj->taxonomyName ) ) { - /** @var \WP_Taxonomy $tax_object */ - $tax_object = get_taxonomy( $obj->taxonomyName ); - - return $type_registry->get_type( $tax_object->graphql_single_name ); - } - - return $obj; - }, - ] - ); - } - - /** - * Returns a list of possible types for the union - * - * @return array - */ - public static function get_possible_types() { - - /** - * The possible types for MenuItems should be just the TermObjects and PostTypeObjects that are - * registered to "show_in_graphql" and "show_in_nav_menus" - */ - $args = [ - 'show_in_nav_menus' => true, - 'graphql_kind' => 'object', - ]; - - $possible_types = []; - - /** - * Add post types that are allowed in WPGraphQL. - * - * @var \WP_Post_Type $post_type_object - */ - foreach ( \WPGraphQL::get_allowed_post_types( 'objects', $args ) as $post_type_object ) { - if ( isset( $post_type_object->graphql_single_name ) ) { - $possible_types[] = $post_type_object->graphql_single_name; - } - } - - // Add taxonomies that are allowed in WPGraphQL. - foreach ( \WPGraphQL::get_allowed_taxonomies( 'objects', $args ) as $tax_object ) { - if ( isset( $tax_object->graphql_single_name ) ) { - $possible_types[] = $tax_object->graphql_single_name; - } - } - - return $possible_types; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Union/PostObjectUnion.php b/lib/wp-graphql-1.17.0/src/Type/Union/PostObjectUnion.php deleted file mode 100644 index 71a13667..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Union/PostObjectUnion.php +++ /dev/null @@ -1,65 +0,0 @@ - 'PostObjectUnion', - 'typeNames' => self::get_possible_types(), - 'description' => __( 'Union between the post, page and media item types', 'wp-graphql' ), - 'resolveType' => static function ( $value ) use ( $type_registry ) { - _doing_it_wrong( 'PostObjectUnion', esc_attr__( 'The PostObjectUnion GraphQL type is deprecated. Use the ContentNode interface instead.', 'wp-graphql' ), '1.14.1' ); - - $type = null; - if ( isset( $value->post_type ) ) { - $post_type_object = get_post_type_object( $value->post_type ); - if ( isset( $post_type_object->graphql_single_name ) ) { - $type = $type_registry->get_type( $post_type_object->graphql_single_name ); - } - } - - return ! empty( $type ) ? $type : null; - }, - ] - ); - } - - /** - * Returns a list of possible types for the union - * - * @return array - */ - public static function get_possible_types() { - $possible_types = []; - /** @var \WP_Post_Type[] */ - $allowed_post_types = \WPGraphQL::get_allowed_post_types( 'objects', [ 'graphql_kind' => 'object' ] ); - - foreach ( $allowed_post_types as $post_type_object ) { - if ( empty( $possible_types[ $post_type_object->name ] ) && isset( $post_type_object->graphql_single_name ) ) { - $possible_types[ $post_type_object->name ] = $post_type_object->graphql_single_name; - } - } - - return $possible_types; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/Union/TermObjectUnion.php b/lib/wp-graphql-1.17.0/src/Type/Union/TermObjectUnion.php deleted file mode 100644 index 599f912b..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/Union/TermObjectUnion.php +++ /dev/null @@ -1,66 +0,0 @@ - 'union', - 'typeNames' => self::get_possible_types(), - 'description' => __( 'Union between the Category, Tag and PostFormatPost types', 'wp-graphql' ), - 'resolveType' => static function ( $value ) use ( $type_registry ) { - _doing_it_wrong( 'TermObjectUnion', esc_attr__( 'The TermObjectUnion GraphQL type is deprecated. Use the TermNode interface instead.', 'wp-graphql' ), '1.14.1' ); - - $type = null; - if ( isset( $value->taxonomyName ) ) { - $tax_object = get_taxonomy( $value->taxonomyName ); - if ( isset( $tax_object->graphql_single_name ) ) { - $type = $type_registry->get_type( $tax_object->graphql_single_name ); - } - } - - return ! empty( $type ) ? $type : null; - }, - ] - ); - } - - /** - * Returns a list of possible types for the union - * - * @return array - */ - public static function get_possible_types() { - $possible_types = []; - /** @var \WP_Taxonomy[] $allowed_taxonomies */ - $allowed_taxonomies = \WPGraphQL::get_allowed_taxonomies( 'objects', [ 'graphql_kind' => 'object' ] ); - - foreach ( $allowed_taxonomies as $tax_object ) { - if ( empty( $possible_types[ $tax_object->name ] ) ) { - if ( isset( $tax_object->graphql_single_name ) ) { - $possible_types[ $tax_object->name ] = $tax_object->graphql_single_name; - } - } - } - - return $possible_types; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPConnectionType.php b/lib/wp-graphql-1.17.0/src/Type/WPConnectionType.php deleted file mode 100644 index 9883ccc3..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/WPConnectionType.php +++ /dev/null @@ -1,674 +0,0 @@ -type_registry = $type_registry; - - /** - * Filter the config of WPConnectionType - * - * @param array $config Array of configuration options passed to the WPConnectionType when instantiating a new type - * @param \WPGraphQL\Type\WPConnectionType $wp_connection_type The instance of the WPConnectionType class - */ - $config = apply_filters( 'graphql_wp_connection_type_config', $config, $this ); - - $this->validate_config( $config ); - - $this->config = $config; - $this->from_type = $config['fromType']; - $this->to_type = $config['toType']; - - /** - * Filter the connection field name. - * - * @internal This filter is internal and used by rename_graphql_field(). It is not intended for use by external code. - * - * @param string $from_field_name The name of the field the connection will be exposed as. - */ - $this->from_field_name = apply_filters( "graphql_wp_connection_{$this->from_type}_from_field_name", $config['fromFieldName'] ); - - $this->connection_name = ! empty( $config['connectionTypeName'] ) ? $config['connectionTypeName'] : $this->get_connection_name( $this->from_type, $this->to_type, $this->from_field_name ); - - /** - * Bail if the connection has been de-registered or excluded. - */ - if ( ! $this->should_register() ) { - return; - } - - $this->auth = array_key_exists( 'auth', $config ) && is_array( $config['auth'] ) ? $config['auth'] : []; - $this->connection_fields = array_key_exists( 'connectionFields', $config ) && is_array( $config['connectionFields'] ) ? $config['connectionFields'] : []; - $this->connection_args = array_key_exists( 'connectionArgs', $config ) && is_array( $config['connectionArgs'] ) ? $config['connectionArgs'] : []; - $this->edge_fields = array_key_exists( 'edgeFields', $config ) && is_array( $config['edgeFields'] ) ? $config['edgeFields'] : []; - $this->resolve_cursor = array_key_exists( 'resolveCursor', $config ) && is_callable( $config['resolve'] ) ? $config['resolveCursor'] : null; - $this->resolve_connection = array_key_exists( 'resolve', $config ) && is_callable( $config['resolve'] ) ? $config['resolve'] : static function () { - return null; - }; - $this->where_args = []; - $this->one_to_one = isset( $config['oneToOne'] ) && true === $config['oneToOne']; - $this->connection_interfaces = isset( $config['connectionInterfaces'] ) && is_array( $config['connectionInterfaces'] ) ? $config['connectionInterfaces'] : []; - $this->include_default_interfaces = isset( $config['includeDefaultInterfaces'] ) ? (bool) $config['includeDefaultInterfaces'] : true; - $this->query_class = array_key_exists( 'queryClass', $config ) && ! empty( $config['queryClass'] ) ? $config['queryClass'] : null; - - /** - * Run an action when the WPConnectionType is instantiating. - * - * @param array $config Array of configuration options passed to the WPObjectType when instantiating a new type - * @param \WPGraphQL\Type\WPConnectionType $wp_connection_type The instance of the WPConnectionType class - * - * @since 1.13.0 - */ - do_action( 'graphql_wp_connection_type', $config, $this ); - - $this->register_connection(); - } - - /** - * Validates that essential key/value pairs are passed to the connection config. - * - * @param array $config - * - * @return void - */ - protected function validate_config( array $config ): void { - if ( ! array_key_exists( 'fromType', $config ) ) { - throw new InvalidArgument( esc_html__( 'Connection config needs to have at least a fromType defined', 'wp-graphql' ) ); - } - - if ( ! array_key_exists( 'toType', $config ) ) { - throw new InvalidArgument( esc_html__( 'Connection config needs to have a "toType" defined', 'wp-graphql' ) ); - } - - if ( ! array_key_exists( 'fromFieldName', $config ) || ! is_string( $config['fromFieldName'] ) ) { - throw new InvalidArgument( esc_html__( 'Connection config needs to have "fromFieldName" defined as a string value', 'wp-graphql' ) ); - } - } - - /** - * Get edge interfaces - * - * @param array $interfaces - * - * @return array - */ - protected function get_edge_interfaces( array $interfaces = [] ): array { - - // Only include the default interfaces if the user hasnt explicitly opted out. - if ( false !== $this->include_default_interfaces ) { - $interfaces[] = Utils::format_type_name( $this->to_type . 'ConnectionEdge' ); - } - - if ( ! empty( $this->connection_interfaces ) ) { - foreach ( $this->connection_interfaces as $connection_interface ) { - $interfaces[] = str_ends_with( $connection_interface, 'Edge' ) ? $connection_interface : $connection_interface . 'Edge'; - } - } - return $interfaces; - } - - /** - * Utility method that formats the connection name given the name of the from Type and the to - * Type - * - * @param string $from_type Name of the Type the connection is coming from - * @param string $to_type Name of the Type the connection is going to - * @param string $from_field_name Acts as an alternative "toType" if connection type already defined using $to_type. - * - * @return string - */ - public function get_connection_name( string $from_type, string $to_type, string $from_field_name ): string { - - // Create connection name using $from_type + To + $to_type + Connection. - $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $to_type ) . 'Connection'; - - // If connection type already exists with that connection name. Set connection name using - // $from_field_name + To + $to_type + Connection. - if ( $this->type_registry->has_type( $connection_name ) ) { - $connection_name = ucfirst( $from_type ) . 'To' . ucfirst( $from_field_name ) . 'Connection'; - } - - return $connection_name; - } - - /** - * If the connection includes connection args in the config, this registers the input args - * for the connection - * - * @return void - * - * @throws \Exception - */ - protected function register_connection_input() { - if ( empty( $this->connection_args ) ) { - return; - } - - $input_name = $this->connection_name . 'WhereArgs'; - - if ( $this->type_registry->has_type( $input_name ) ) { - return; - } - - $this->type_registry->register_input_type( - $input_name, - [ - 'description' => sprintf( - // translators: %s is the name of the connection - __( 'Arguments for filtering the %s connection', 'wp-graphql' ), - $this->connection_name - ), - 'fields' => $this->connection_args, - 'queryClass' => $this->query_class, - ] - ); - - $this->where_args = [ - 'where' => [ - 'description' => __( 'Arguments for filtering the connection', 'wp-graphql' ), - 'type' => $this->connection_name . 'WhereArgs', - ], - ]; - } - - /** - * Registers the One to One Connection Edge type to the Schema - * - * @return void - * - * @throws \Exception - */ - protected function register_one_to_one_connection_edge_type(): void { - if ( $this->type_registry->has_type( $this->connection_name . 'Edge' ) ) { - return; - } - - // Only include the default interfaces if the user hasnt explicitly opted out. - $default_interfaces = false !== $this->include_default_interfaces ? [ - 'OneToOneConnection', - 'Edge', - ] : []; - $interfaces = $this->get_edge_interfaces( $default_interfaces ); - - $this->type_registry->register_object_type( - $this->connection_name . 'Edge', - [ - 'interfaces' => $interfaces, - 'description' => sprintf( - // translators: Placeholders are for the name of the Type the connection is coming from and the name of the Type the connection is going to - __( 'Connection between the %1$s type and the %2$s type', 'wp-graphql' ), - $this->from_type, - $this->to_type - ), - 'fields' => array_merge( - [ - 'node' => [ - 'type' => [ 'non_null' => $this->to_type ], - 'description' => __( 'The node of the connection, without the edges', 'wp-graphql' ), - 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, - ], - ], - $this->edge_fields - ), - ] - ); - } - - /** - * Registers the PageInfo type for the connection - * - * @return void - * - * @throws \Exception - */ - public function register_connection_page_info_type(): void { - if ( $this->type_registry->has_type( $this->connection_name . 'PageInfo' ) ) { - return; - } - - $this->type_registry->register_object_type( - $this->connection_name . 'PageInfo', - [ - 'interfaces' => [ $this->to_type . 'ConnectionPageInfo' ], - 'description' => sprintf( - // translators: %s is the name of the connection. - __( 'Page Info on the "%s"', 'wp-graphql' ), - $this->connection_name - ), - 'fields' => PageInfo::get_fields(), - ] - ); - } - - /** - * Registers the Connection Edge type to the Schema - * - * @return void - * - * @throws \Exception - */ - protected function register_connection_edge_type(): void { - if ( $this->type_registry->has_type( $this->connection_name . 'Edge' ) ) { - return; - } - // Only include the default interfaces if the user hasnt explicitly opted out. - $default_interfaces = false === $this->include_default_interfaces ? [ - 'Edge', - ] : []; - $interfaces = $this->get_edge_interfaces( $default_interfaces ); - - $this->type_registry->register_object_type( - $this->connection_name . 'Edge', - [ - 'description' => __( 'An edge in a connection', 'wp-graphql' ), - 'interfaces' => $interfaces, - 'fields' => array_merge( - [ - 'cursor' => [ - 'type' => 'String', - 'description' => __( 'A cursor for use in pagination', 'wp-graphql' ), - 'resolve' => $this->resolve_cursor, - 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, - ], - 'node' => [ - 'type' => [ 'non_null' => $this->to_type ], - 'description' => __( 'The item at the end of the edge', 'wp-graphql' ), - 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, - ], - ], - $this->edge_fields - ), - ] - ); - } - - /** - * Registers the Connection Type to the Schema - * - * @return void - * - * @throws \Exception - */ - protected function register_connection_type(): void { - if ( $this->type_registry->has_type( $this->connection_name ) ) { - return; - } - - $interfaces = ! empty( $this->connection_interfaces ) ? $this->connection_interfaces : []; - $interfaces[] = Utils::format_type_name( $this->to_type . 'Connection' ); - - // Only include the default interfaces if the user hasnt explicitly opted out. - if ( false !== $this->include_default_interfaces ) { - $interfaces[] = 'Connection'; - } - - $this->type_registry->register_object_type( - $this->connection_name, - [ - 'description' => sprintf( - // translators: the placeholders are the name of the Types the connection is between. - __( 'Connection between the %1$s type and the %2$s type', 'wp-graphql' ), - $this->from_type, - $this->to_type - ), - 'interfaces' => $interfaces, - 'connection_config' => $this->config, - 'fields' => $this->get_connection_fields(), - ] - ); - } - - /** - * Returns fields to be used on the connection - * - * @return array - */ - protected function get_connection_fields(): array { - return array_merge( - [ - 'pageInfo' => [ - 'type' => [ 'non_null' => $this->connection_name . 'PageInfo' ], - 'description' => __( 'Information about pagination in a connection.', 'wp-graphql' ), - ], - 'edges' => [ - 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => $this->connection_name . 'Edge' ] ] ], - // translators: %s is the name of the connection. - 'description' => sprintf( __( 'Edges for the %s connection', 'wp-graphql' ), $this->connection_name ), - ], - 'nodes' => [ - 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => $this->to_type ] ] ], - 'description' => __( 'The nodes of the connection, without the edges', 'wp-graphql' ), - ], - ], - $this->connection_fields - ); - } - - /** - * Get the args used for pagination on connections - * - * @return array|array[] - */ - protected function get_pagination_args(): array { - if ( true === $this->one_to_one ) { - $pagination_args = []; - } else { - $pagination_args = [ - 'first' => [ - 'type' => 'Int', - 'description' => __( 'The number of items to return after the referenced "after" cursor', 'wp-graphql' ), - ], - 'last' => [ - 'type' => 'Int', - 'description' => __( 'The number of items to return before the referenced "before" cursor', 'wp-graphql' ), - ], - 'after' => [ - 'type' => 'String', - 'description' => __( 'Cursor used along with the "first" argument to reference where in the dataset to get data', 'wp-graphql' ), - ], - 'before' => [ - 'type' => 'String', - 'description' => __( 'Cursor used along with the "last" argument to reference where in the dataset to get data', 'wp-graphql' ), - ], - ]; - } - - return $pagination_args; - } - - /** - * Registers the connection in the Graph - * - * @return void - * @throws \Exception - */ - public function register_connection_field(): void { - - // merge the config so the raw data passed to the connection - // is passed to the field and can be accessed via $info in resolvers - $field_config = array_merge( - $this->config, - [ - 'type' => true === $this->one_to_one ? $this->connection_name . 'Edge' : $this->connection_name, - 'args' => array_merge( $this->get_pagination_args(), $this->where_args ), - 'auth' => $this->auth, - 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, - 'description' => ! empty( $this->config['description'] ) - ? $this->config['description'] - : sprintf( - // translators: the placeholders are the name of the Types the connection is between. - __( 'Connection between the %1$s type and the %2$s type', 'wp-graphql' ), - $this->from_type, - $this->to_type - ), - 'resolve' => function ( $root, $args, $context, $info ) { - $context->connection_query_class = $this->query_class; - $resolve_connection = $this->resolve_connection; - - /** - * Return the results of the connection resolver - */ - return $resolve_connection( $root, $args, $context, $info ); - }, - 'allowFieldUnderscores' => isset( $this->config['allowFieldUnderscores'] ) && true === $this->config['allowFieldUnderscores'], - ] - ); - - $this->type_registry->register_field( - $this->from_type, - $this->from_field_name, - $field_config - ); - } - - /** - * @return void - * @throws \Exception - */ - public function register_connection_interfaces(): void { - $connection_edge_type = Utils::format_type_name( $this->to_type . 'ConnectionEdge' ); - - if ( ! $this->type_registry->has_type( $this->to_type . 'ConnectionPageInfo' ) ) { - $this->type_registry->register_interface_type( - $this->to_type . 'ConnectionPageInfo', - [ - 'interfaces' => [ 'WPPageInfo' ], - // translators: %s is the name of the connection edge. - 'description' => sprintf( __( 'Page Info on the connected %s', 'wp-graphql' ), $connection_edge_type ), - 'fields' => PageInfo::get_fields(), - ] - ); - } - - - if ( ! $this->type_registry->has_type( $connection_edge_type ) ) { - $this->type_registry->register_interface_type( - $connection_edge_type, - [ - 'interfaces' => [ 'Edge' ], - // translators: %s is the name of the type the connection edge is to. - 'description' => sprintf( __( 'Edge between a Node and a connected %s', 'wp-graphql' ), $this->to_type ), - 'fields' => [ - 'node' => [ - 'type' => [ 'non_null' => $this->to_type ], - // translators: %s is the name of the type the connection edge is to. - 'description' => sprintf( __( 'The connected %s Node', 'wp-graphql' ), $this->to_type ), - ], - ], - ] - ); - } - - if ( ! $this->one_to_one && ! $this->type_registry->has_type( $this->to_type . 'Connection' ) ) { - $this->type_registry->register_interface_type( - $this->to_type . 'Connection', - [ - 'interfaces' => [ 'Connection' ], - // translators: %s is the name of the type the connection is to. - 'description' => sprintf( __( 'Connection to %s Nodes', 'wp-graphql' ), $this->to_type ), - 'fields' => [ - 'edges' => [ - 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => $connection_edge_type ] ] ], - 'description' => sprintf( - // translators: %1$s is the name of the type the connection is from, %2$s is the name of the type the connection is to. - __( 'A list of edges (relational context) between %1$s and connected %2$s Nodes', 'wp-graphql' ), - $this->from_type, - $this->to_type - ), - ], - 'pageInfo' => [ - 'type' => [ 'non_null' => $this->to_type . 'ConnectionPageInfo' ], - ], - 'nodes' => [ - 'type' => [ 'non_null' => [ 'list_of' => [ 'non_null' => $this->to_type ] ] ], - // translators: %s is the name of the type the connection is to. - 'description' => sprintf( __( 'A list of connected %s Nodes', 'wp-graphql' ), $this->to_type ), - ], - ], - ] - ); - } - } - - /** - * Registers the connection Types and field to the Schema. - * - * @todo change to 'Protected'. This is public for now to allow for backwards compatibility. - * - * @return void - * - * @throws \Exception - */ - public function register_connection(): void { - $this->register_connection_input(); - - if ( false !== $this->include_default_interfaces ) { - $this->register_connection_interfaces(); - } - - if ( true === $this->one_to_one ) { - $this->register_one_to_one_connection_edge_type(); - } else { - $this->register_connection_page_info_type(); - $this->register_connection_edge_type(); - $this->register_connection_type(); - } - - $this->register_connection_field(); - } - - /** - * Checks whether the connection should be registered to the Schema. - */ - protected function should_register(): bool { - - // Don't register if the connection has been excluded from the schema. - $excluded_connections = $this->type_registry->get_excluded_connections(); - if ( in_array( strtolower( $this->connection_name ), $excluded_connections, true ) ) { - return false; - } - - // Don't register if one of the connection types has been excluded from the schema. - $excluded_types = $this->type_registry->get_excluded_types(); - if ( ( in_array( strtolower( $this->from_type ), $excluded_types, true ) || in_array( strtolower( $this->to_type ), $excluded_types, true ) ) ) { - return false; - } - - return true; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPEnumType.php b/lib/wp-graphql-1.17.0/src/Type/WPEnumType.php deleted file mode 100644 index 27d39b0f..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/WPEnumType.php +++ /dev/null @@ -1,100 +0,0 @@ -prepare_fields( $config['fields'], $config['name'], $config, $type_registry ); - $fields = $type_registry->prepare_fields( $fields, $config['name'] ); - - return $fields; - }; - } - - parent::__construct( $config ); - } - - /** - * Prepare_fields - * - * This function sorts the fields and applies a filter to allow for easily - * extending/modifying the shape of the Schema for the type. - * - * @param array $fields - * @param string $type_name - * @param array $config - * @param \WPGraphQL\Registry\TypeRegistry $type_registry - * @return mixed - * @since 0.0.5 - */ - public function prepare_fields( array $fields, string $type_name, array $config, TypeRegistry $type_registry ) { - - /** - * Filter all object fields, passing the $typename as a param - * - * This is useful when several different types need to be easily filtered at once. . .for example, - * if ALL types with a field of a certain name needed to be adjusted, or something to that tune - * - * @param array $fields The array of fields for the object config - * @param string $type_name The name of the object type - * @param array $config The type config - * - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The TypeRegistry instance - */ - $fields = apply_filters( 'graphql_input_fields', $fields, $type_name, $config, $type_registry ); - - /** - * Filter once with lowercase, once with uppercase for Back Compat. - */ - $lc_type_name = lcfirst( $type_name ); - $uc_type_name = ucfirst( $type_name ); - - /** - * Filter the fields with the typename explicitly in the filter name - * - * This is useful for more targeted filtering, and is applied after the general filter, to allow for - * more specific overrides - * - * @param array $fields The array of fields for the object config - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The TypeRegistry instance - */ - $fields = apply_filters( "graphql_{$lc_type_name}_fields", $fields, $type_registry ); - - /** - * Filter the fields with the typename explicitly in the filter name - * - * This is useful for more targeted filtering, and is applied after the general filter, to allow for - * more specific overrides - * - * @param array $fields The array of fields for the object config - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The TypeRegistry instance - */ - $fields = apply_filters( "graphql_{$uc_type_name}_fields", $fields, $type_registry ); - - /** - * Sort the fields alphabetically by key. This makes reading through docs much easier - * - * @since 0.0.2 - */ - ksort( $fields ); - - /** - * Return the filtered, sorted $fields - * - * @since 0.0.5 - */ - return $fields; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPInterfaceTrait.php b/lib/wp-graphql-1.17.0/src/Type/WPInterfaceTrait.php deleted file mode 100644 index a904b424..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/WPInterfaceTrait.php +++ /dev/null @@ -1,106 +0,0 @@ -config['interfaces'] ) || ! is_array( $this->config['interfaces'] ) || empty( $this->config['interfaces'] ) ) { - $interfaces = parent::getInterfaces(); - } else { - $interfaces = $this->config['interfaces']; - } - - /** - * Filters the interfaces applied to an object type - * - * @param array $interfaces List of interfaces applied to the Object Type - * @param array $config The config for the Object Type - * @param mixed|\WPGraphQL\Type\WPInterfaceType|\WPGraphQL\Type\WPObjectType $type The Type instance - */ - $interfaces = apply_filters( 'graphql_type_interfaces', $interfaces, $this->config, $this ); - - if ( empty( $interfaces ) || ! is_array( $interfaces ) ) { - return $interfaces; - } - - $new_interfaces = []; - - foreach ( $interfaces as $interface ) { - if ( $interface instanceof InterfaceType && $interface->name !== $this->name ) { - $new_interfaces[ $interface->name ] = $interface; - continue; - } - - // surface when interfaces are trying to be registered with invalid configuration - if ( ! is_string( $interface ) ) { - graphql_debug( - sprintf( - // translators: %s is the name of the GraphQL type. - __( 'Invalid Interface registered to the "%s" Type. Interfaces can only be registered with an interface name or a valid instance of an InterfaceType', 'wp-graphql' ), - $this->name - ), - [ 'invalid_interface' => $interface ] - ); - continue; - } - - // Prevent an interface from implementing itself - if ( strtolower( $this->config['name'] ) === strtolower( $interface ) ) { - graphql_debug( - sprintf( - // translators: %s is the name of the interface. - __( 'The "%s" Interface attempted to implement itself, which is not allowed', 'wp-graphql' ), - $interface - ) - ); - continue; - } - - $interface_type = $this->type_registry->get_type( $interface ); - if ( ! $interface_type instanceof InterfaceType ) { - graphql_debug( - sprintf( - // translators: %1$s is the name of the interface, %2$s is the name of the type. - __( '"%1$s" is not a valid Interface Type and cannot be implemented as an Interface on the "%2$s" Type', 'wp-graphql' ), - $interface, - $this->name - ) - ); - continue; - } - - $new_interfaces[ $interface ] = $interface_type; - $interface_interfaces = $interface_type->getInterfaces(); - - if ( empty( $interface_interfaces ) ) { - continue; - } - - foreach ( $interface_interfaces as $interface_interface_name => $interface_interface ) { - if ( ! $interface_interface instanceof InterfaceType ) { - continue; - } - - $new_interfaces[ $interface_interface_name ] = $interface_interface; - } - } - - return array_unique( $new_interfaces ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPInterfaceType.php b/lib/wp-graphql-1.17.0/src/Type/WPInterfaceType.php deleted file mode 100644 index b97c6b1e..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/WPInterfaceType.php +++ /dev/null @@ -1,174 +0,0 @@ -type_registry = $type_registry; - - $this->config = $config; - - $name = ucfirst( $config['name'] ); - $config['name'] = apply_filters( 'graphql_type_name', $name, $config, $this ); - $config['fields'] = function () use ( $config ) { - $fields = $config['fields']; - - /** - * Get the fields of interfaces and ensure they exist as fields of this type. - * - * Types are still responsible for ensuring the fields resolve properly. - */ - if ( ! empty( $this->getInterfaces() ) && is_array( $this->getInterfaces() ) ) { - $interface_fields = []; - - foreach ( $this->getInterfaces() as $interface_type ) { - if ( ! $interface_type instanceof InterfaceType ) { - $interface_type = $this->type_registry->get_type( $interface_type ); - } - - if ( ! $interface_type instanceof InterfaceType ) { - continue; - } - - $interface_config_fields = $interface_type->getFields(); - - if ( empty( $interface_config_fields ) || ! is_array( $interface_config_fields ) ) { - continue; - } - - foreach ( $interface_config_fields as $interface_field_name => $interface_field ) { - $interface_fields[ $interface_field_name ] = $interface_field->config; - } - } - } - - if ( ! empty( $interface_fields ) ) { - $fields = array_replace_recursive( $interface_fields, $fields ); - } - - $fields = $this->prepare_fields( $fields, $config['name'] ); - $fields = $this->type_registry->prepare_fields( $fields, $config['name'] ); - - return $fields; - }; - - $config['resolveType'] = function ( $obj ) use ( $config ) { - $type = null; - if ( is_callable( $config['resolveType'] ) ) { - $type = call_user_func( $config['resolveType'], $obj ); - } - - /** - * Filter the resolve type method for all interfaces - * - * @param mixed $type The Type to resolve to, based on the object being resolved. - * @param mixed $obj The Object being resolved. - * @param \WPGraphQL\Type\WPInterfaceType $wp_interface_type The WPInterfaceType instance. - */ - return apply_filters( 'graphql_interface_resolve_type', $type, $obj, $this ); - }; - - /** - * Filter the config of WPInterfaceType - * - * @param array $config Array of configuration options passed to the WPInterfaceType when instantiating a new type - * @param \WPGraphQL\Type\WPInterfaceType $wp_interface_type The instance of the WPInterfaceType class - */ - $config = apply_filters( 'graphql_wp_interface_type_config', $config, $this ); - - parent::__construct( $config ); - } - - /** - * Get interfaces implemented by this Interface - * - * @return array - */ - public function getInterfaces(): array { - return $this->get_implemented_interfaces(); - } - - /** - * This function sorts the fields and applies a filter to allow for easily - * extending/modifying the shape of the Schema for the type. - * - * @param array $fields - * @param string $type_name - * - * @return mixed - * @since 0.0.5 - */ - public function prepare_fields( array $fields, string $type_name ) { - - /** - * Filter all object fields, passing the $typename as a param - * - * This is useful when several different types need to be easily filtered at once. . .for example, - * if ALL types with a field of a certain name needed to be adjusted, or something to that tune - * - * @param array $fields The array of fields for the object config - * @param string $type_name The name of the object type - */ - $fields = apply_filters( 'graphql_interface_fields', $fields, $type_name ); - - /** - * Filter once with lowercase, once with uppercase for Back Compat. - */ - $lc_type_name = lcfirst( $type_name ); - $uc_type_name = ucfirst( $type_name ); - - /** - * Filter the fields with the typename explicitly in the filter name - * - * This is useful for more targeted filtering, and is applied after the general filter, to allow for - * more specific overrides - * - * @param array $fields The array of fields for the object config - */ - $fields = apply_filters( "graphql_{$lc_type_name}_fields", $fields ); - - /** - * Filter the fields with the typename explicitly in the filter name - * - * This is useful for more targeted filtering, and is applied after the general filter, to allow for - * more specific overrides - * - * @param array $fields The array of fields for the object config - */ - $fields = apply_filters( "graphql_{$uc_type_name}_fields", $fields ); - - /** - * This sorts the fields alphabetically by the key, which is super handy for making the schema readable, - * as it ensures it's not output in just random order - */ - ksort( $fields ); - - return $fields; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPMutationType.php b/lib/wp-graphql-1.17.0/src/Type/WPMutationType.php deleted file mode 100644 index 4a305132..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/WPMutationType.php +++ /dev/null @@ -1,355 +0,0 @@ -is_config_valid( $config ) ) { - return; - } - - $this->config = $config; - $this->type_registry = $type_registry; - $this->mutation_name = $config['name']; - - // Bail if the mutation should be excluded from the schema. - if ( ! $this->should_register() ) { - return; - } - - $this->auth = array_key_exists( 'auth', $config ) && is_array( $config['auth'] ) ? $config['auth'] : []; - $this->is_private = array_key_exists( 'isPrivate', $config ) ? $config['isPrivate'] : false; - $this->input_fields = $this->get_input_fields(); - $this->output_fields = $this->get_output_fields(); - $this->resolve_mutation = $this->get_resolver(); - - /** - * Run an action when the WPMutationType is instantiating. - * - * @param array $config Array of configuration options passed to the WPObjectType when instantiating a new type - * @param \WPGraphQL\Type\WPMutationType $wp_mutation_type The instance of the WPMutationType class - * - * @since 1.13.0 - */ - do_action( 'graphql_wp_mutation_type', $config, $this ); - - $this->register_mutation(); - } - - /** - * Validates that essential key/value pairs are passed to the connection config. - * - * @param array $config - * - * @return bool - */ - protected function is_config_valid( array $config ): bool { - $is_valid = true; - - if ( ! array_key_exists( 'name', $config ) || ! is_string( $config['name'] ) ) { - graphql_debug( - __( 'Mutation config needs to have a valid name.', 'wp-graphql' ), - [ - 'config' => $config, - ] - ); - $is_valid = false; - } - - if ( ! array_key_exists( 'mutateAndGetPayload', $config ) || ! is_callable( $config['mutateAndGetPayload'] ) ) { - graphql_debug( - __( 'Mutation config needs to have "mutateAndGetPayload" defined as a callable.', 'wp-graphql' ), - [ - 'config' => $config, - ] - ); - $is_valid = false; - } - - return (bool) $is_valid; - } - - /** - * Gets the mutation input fields. - */ - protected function get_input_fields(): array { - $input_fields = [ - 'clientMutationId' => [ - 'type' => 'String', - 'description' => __( 'This is an ID that can be passed to a mutation by the client to track the progress of mutations and catch possible duplicate mutation submissions.', 'wp-graphql' ), - ], - ]; - - if ( ! empty( $this->config['inputFields'] ) && is_array( $this->config['inputFields'] ) ) { - $input_fields = array_merge( $input_fields, $this->config['inputFields'] ); - } - - return $input_fields; - } - - /** - * Gets the mutation output fields. - */ - protected function get_output_fields(): array { - $output_fields = [ - 'clientMutationId' => [ - 'type' => 'String', - 'description' => __( 'If a \'clientMutationId\' input is provided to the mutation, it will be returned as output on the mutation. This ID can be used by the client to track the progress of mutations and catch possible duplicate mutation submissions.', 'wp-graphql' ), - ], - ]; - - if ( ! empty( $this->config['outputFields'] ) && is_array( $this->config['outputFields'] ) ) { - $output_fields = array_merge( $output_fields, $this->config['outputFields'] ); - } - - return $output_fields; - } - - protected function get_resolver(): callable { - return function ( $root, array $args, AppContext $context, ResolveInfo $info ) { - $unfiltered_input = $args['input']; - - $unfiltered_input = $args['input']; - - /** - * Filters the mutation input before it's passed to the `mutateAndGetPayload` callback. - * - * @param array $input The mutation input args. - * @param \WPGraphQL\AppContext $context The AppContext object. - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object. - * @param string $mutation_name The name of the mutation field. - */ - $input = apply_filters( 'graphql_mutation_input', $unfiltered_input, $context, $info, $this->mutation_name ); - - /** - * Filter to short circuit the mutateAndGetPayload callback. - * Returning anything other than null will stop the callback for the mutation from executing, - * and will return your data or execute your callback instead. - * - * @param array|callable|null $payload. The payload returned from the callback. Null by default. - * @param string $mutation_name The name of the mutation field. - * @param callable|\Closure $mutateAndGetPayload The callback for the mutation. - * @param array $input The mutation input args. - * @param \WPGraphQL\AppContext $context The AppContext object. - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object. - */ - $pre = apply_filters( 'graphql_pre_mutate_and_get_payload', null, $this->mutation_name, $this->config['mutateAndGetPayload'], $input, $context, $info ); - - if ( ! is_null( $pre ) ) { - $payload = is_callable( $pre ) ? $pre( $input, $context, $info ) : $pre; - } else { - $payload = $this->config['mutateAndGetPayload']( $input, $context, $info ); - - /** - * Filters the payload returned from the default mutateAndGetPayload callback. - * - * @param array $payload The payload returned from the callback. - * @param string $mutation_name The name of the mutation field. - * @param array $input The mutation input args. - * @param \WPGraphQL\AppContext $context The AppContext object. - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object. - */ - $payload = apply_filters( 'graphql_mutation_payload', $payload, $this->mutation_name, $input, $context, $info ); - } - - /** - * Fires after the mutation payload has been returned from the `mutateAndGetPayload` callback. - * - * @param array $payload The Payload returned from the mutation. - * @param array $input The mutation input args, after being filtered by 'graphql_mutation_input'. - * @param array $unfiltered_input The unfiltered input args of the mutation - * @param \WPGraphQL\AppContext $context The AppContext object. - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo object. - * @param string $mutation_name The name of the mutation field. - */ - do_action( 'graphql_mutation_response', $payload, $input, $unfiltered_input, $context, $info, $this->mutation_name ); - - // Add the client mutation ID to the payload - if ( ! empty( $input['clientMutationId'] ) ) { - $payload['clientMutationId'] = $input['clientMutationId']; - } - - return $payload; - }; - } - - /** - * Registers the input args for the mutation. - */ - protected function register_mutation_input(): void { - $input_name = $this->mutation_name . 'Input'; - - if ( $this->type_registry->has_type( $input_name ) ) { - return; - } - - $this->type_registry->register_input_type( - $input_name, - [ - // translators: %s is the name of the mutation. - 'description' => sprintf( __( 'Input for the %1$s mutation.', 'wp-graphql' ), $this->mutation_name ), - 'fields' => $this->input_fields, - 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, - ] - ); - } - - protected function register_mutation_payload(): void { - $object_name = $this->mutation_name . 'Payload'; - - if ( $this->type_registry->has_type( $object_name ) ) { - return; - } - - $this->type_registry->register_object_type( - $object_name, - [ - // translators: %s is the name of the mutation. - 'description' => sprintf( __( 'The payload for the %s mutation.', 'wp-graphql' ), $this->mutation_name ), - 'fields' => $this->output_fields, - 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, - ] - ); - } - - /** - * Registers the mutation in the Graph. - * - * @throws \Exception - */ - protected function register_mutation_field(): void { - $field_config = array_merge( - $this->config, - [ - 'args' => [ - 'input' => [ - 'type' => [ 'non_null' => $this->mutation_name . 'Input' ], - // translators: %s is the name of the mutation. - 'description' => sprintf( __( 'Input for the %s mutation', 'wp-graphql' ), $this->mutation_name ), - 'deprecationReason' => ! empty( $this->config['deprecationReason'] ) ? $this->config['deprecationReason'] : null, - ], - ], - 'auth' => $this->auth, - // translators: %s is the name of the mutation. - 'description' => ! empty( $this->config['description'] ) ? $this->config['description'] : sprintf( __( 'The %s mutation', 'wp-graphql' ), $this->mutation_name ), - 'isPrivate' => $this->is_private, - 'type' => $this->mutation_name . 'Payload', - 'resolve' => $this->resolve_mutation, - 'name' => lcfirst( $this->mutation_name ), - ] - ); - - $this->type_registry->register_field( - 'RootMutation', - lcfirst( $this->mutation_name ), - $field_config - ); - } - - /** - * Registers the Mutation Types and field to the Schema. - * - * @throws \Exception - */ - protected function register_mutation(): void { - $this->register_mutation_payload(); - $this->register_mutation_input(); - $this->register_mutation_field(); - } - - /** - * Checks whether the mutation should be registered to the schema. - */ - protected function should_register(): bool { - // Dont register mutations if they have been excluded from the schema. - $excluded_mutations = $this->type_registry->get_excluded_mutations(); - if ( in_array( strtolower( $this->mutation_name ), $excluded_mutations, true ) ) { - return false; - } - - return true; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPObjectType.php b/lib/wp-graphql-1.17.0/src/Type/WPObjectType.php deleted file mode 100644 index 1c6ac852..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/WPObjectType.php +++ /dev/null @@ -1,226 +0,0 @@ -type_registry = $type_registry; - - /** - * Filter the config of WPObjectType - * - * @param array $config Array of configuration options passed to the WPObjectType when instantiating a new type - * @param \WPGraphQL\Type\WPObjectType $wp_object_type The instance of the WPObjectType class - */ - $config = apply_filters( 'graphql_wp_object_type_config', $config, $this ); - - $this->config = $config; - - /** - * Set the Types to start with capitals - */ - $name = ucfirst( $config['name'] ); - $config['name'] = apply_filters( 'graphql_type_name', $name, $config, $this ); - - /** - * Setup the fields - * - * @return array|mixed - */ - $config['fields'] = function () use ( $config ) { - $fields = $config['fields']; - - /** - * Get the fields of interfaces and ensure they exist as fields of this type. - * - * Types are still responsible for ensuring the fields resolve properly. - */ - if ( ! empty( $this->getInterfaces() ) && is_array( $this->getInterfaces() ) ) { - $interface_fields = []; - - foreach ( $this->getInterfaces() as $interface_type ) { - if ( ! $interface_type instanceof InterfaceType ) { - $interface_type = $this->type_registry->get_type( $interface_type ); - } - - if ( ! $interface_type instanceof InterfaceType ) { - continue; - } - - $interface_config_fields = $interface_type->getFields(); - - if ( empty( $interface_config_fields ) || ! is_array( $interface_config_fields ) ) { - continue; - } - - foreach ( $interface_config_fields as $interface_field_name => $interface_field ) { - $interface_fields[ $interface_field_name ] = $interface_field->config; - } - } - } - - if ( ! empty( $interface_fields ) ) { - $fields = array_replace_recursive( $interface_fields, $fields ); - } - - $fields = $this->prepare_fields( $fields, $config['name'], $config ); - $fields = $this->type_registry->prepare_fields( $fields, $config['name'] ); - - return $fields; - }; - - /** - * Run an action when the WPObjectType is instantiating - * - * @param array $config Array of configuration options passed to the WPObjectType when instantiating a new type - * @param \WPGraphQL\Type\WPObjectType $wp_object_type The instance of the WPObjectType class - */ - do_action( 'graphql_wp_object_type', $config, $this ); - - parent::__construct( $config ); - } - - /** - * Get the interfaces implemented by the ObjectType - * - * @return array - */ - public function getInterfaces(): array { - return $this->get_implemented_interfaces(); - } - - /** - * Node_interface - * - * This returns the node_interface definition allowing - * WPObjectTypes to easily implement the node_interface - * - * @return array|\WPGraphQL\Type\InterfaceType\Node - * @since 0.0.5 - */ - public static function node_interface() { - if ( null === self::$node_interface ) { - $node_interface = DataSource::get_node_definition(); - self::$node_interface = $node_interface['nodeInterface']; - } - - return self::$node_interface; - } - - /** - * This function sorts the fields and applies a filter to allow for easily - * extending/modifying the shape of the Schema for the type. - * - * @param array $fields - * @param string $type_name - * @param array $config - * - * @return mixed - * @since 0.0.5 - */ - public function prepare_fields( $fields, $type_name, $config ) { - - /** - * Filter all object fields, passing the $typename as a param - * - * This is useful when several different types need to be easily filtered at once. . .for example, - * if ALL types with a field of a certain name needed to be adjusted, or something to that tune - * - * @param array $fields The array of fields for the object config - * @param string $type_name The name of the object type - * @param \WPGraphQL\Type\WPObjectType $wp_object_type The WPObjectType Class - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The Type Registry - */ - $fields = apply_filters( 'graphql_object_fields', $fields, $type_name, $this, $this->type_registry ); - - /** - * Filter once with lowercase, once with uppercase for Back Compat. - */ - $lc_type_name = lcfirst( $type_name ); - $uc_type_name = ucfirst( $type_name ); - - /** - * Filter the fields with the typename explicitly in the filter name - * - * This is useful for more targeted filtering, and is applied after the general filter, to allow for - * more specific overrides - * - * @param array $fields The array of fields for the object config - * @param \WPGraphQL\Type\WPObjectType $wp_object_type The WPObjectType Class - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The Type Registry - */ - $fields = apply_filters( "graphql_{$lc_type_name}_fields", $fields, $this, $this->type_registry ); - - /** - * Filter the fields with the typename explicitly in the filter name - * - * This is useful for more targeted filtering, and is applied after the general filter, to allow for - * more specific overrides - * - * @param array $fields The array of fields for the object config - * @param \WPGraphQL\Type\WPObjectType $wp_object_type The WPObjectType Class - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The Type Registry - */ - $fields = apply_filters( "graphql_{$uc_type_name}_fields", $fields, $this, $this->type_registry ); - - /** - * This sorts the fields alphabetically by the key, which is super handy for making the schema readable, - * as it ensures it's not output in just random order - */ - ksort( $fields ); - - return $fields; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Type/WPScalar.php b/lib/wp-graphql-1.17.0/src/Type/WPScalar.php deleted file mode 100644 index bd285513..00000000 --- a/lib/wp-graphql-1.17.0/src/Type/WPScalar.php +++ /dev/null @@ -1,27 +0,0 @@ -type_registry = $type_registry; - - /** - * Set the Types to start with capitals - */ - $name = ucfirst( $config['name'] ); - $config['name'] = apply_filters( 'graphql_type_name', $name, $config, $this ); - - $config['types'] = function () use ( $config ) { - $prepared_types = []; - if ( ! empty( $config['typeNames'] ) && is_array( $config['typeNames'] ) ) { - $prepared_types = []; - foreach ( $config['typeNames'] as $type_name ) { - /** - * Skip if the type is excluded from the schema. - */ - if ( in_array( strtolower( $type_name ), $this->type_registry->get_excluded_types(), true ) ) { - continue; - } - - $prepared_types[] = $this->type_registry->get_type( $type_name ); - } - } - - return $prepared_types; - }; - - $config['resolveType'] = function ( $obj ) use ( $config ) { - $type = null; - if ( is_callable( $config['resolveType'] ) ) { - $type = call_user_func( $config['resolveType'], $obj ); - } - - /** - * Filter the resolve type method for all unions - * - * @param mixed $type The Type to resolve to, based on the object being resolved - * @param mixed $obj The Object being resolved - * @param \WPGraphQL\Type\WPUnionType $wp_union_type The WPUnionType instance - */ - return apply_filters( 'graphql_union_resolve_type', $type, $obj, $this ); - }; - - /** - * Filter the possible_types to allow systems to add to the possible resolveTypes. - * - * @param mixed $types The possible types for the Union - * @param array $config The config for the Union Type - * @param \WPGraphQL\Type\WPUnionType $wp_union_type The WPUnionType instance - * - * @return mixed|array - */ - $config['types'] = apply_filters( 'graphql_union_possible_types', $config['types'], $config, $this ); - - /** - * Filter the config of WPUnionType - * - * @param array $config Array of configuration options passed to the WPUnionType when instantiating a new type - * @param \WPGraphQL\Type\WPUnionType $wp_union_type The instance of the WPUnionType class - * - * @since 0.0.30 - */ - $config = apply_filters( 'graphql_wp_union_type_config', $config, $this ); - - /** - * Run an action when the WPUnionType is instantiating - * - * @param array $config Array of configuration options passed to the WPUnionType when instantiating a new type - * @param \WPGraphQL\Type\WPUnionType $wp_union_type The instance of the WPUnionType class - */ - do_action( 'graphql_wp_union_type', $config, $this ); - - parent::__construct( $config ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Types.php b/lib/wp-graphql-1.17.0/src/Types.php deleted file mode 100644 index db4cd0f5..00000000 --- a/lib/wp-graphql-1.17.0/src/Types.php +++ /dev/null @@ -1,40 +0,0 @@ -logs = []; - - // Whether WPGraphQL Debug is enabled - $enabled = \WPGraphQL::debug(); - - /** - * Filters whether GraphQL Debug is enabled enabled. Serves as the default state for enabling debug logs. - * - * @param bool $enabled Whether logs are enabled or not - * @param \WPGraphQL\Utils\DebugLog $debug_log The DebugLog class instance - */ - $this->logs_enabled = apply_filters( 'graphql_debug_logs_enabled', $enabled, $this ); - } - - /** - * Given a message and a config, a log entry is added to the log - * - * @param mixed|string|array $message The debug log message - * @param array $config Config for the debug log. Set type and any additional information to log - * - * @return array - */ - public function add_log_entry( $message, $config = [] ) { - if ( empty( $message ) ) { - return []; - } - - $type = 'GRAPHQL_DEBUG'; - - if ( ! is_array( $config ) ) { - $config = []; - } - - if ( isset( $config['type'] ) ) { - unset( $config['message'] ); - } - - if ( isset( $config['backtrace'] ) ) { - $config['stack'] = $config['backtrace']; - unset( $config['backtrace'] ); - } - - if ( isset( $config['type'] ) ) { - $type = $config['type']; - unset( $config['type'] ); - } - - if ( ! isset( $this->logs[ wp_json_encode( $message ) ] ) ) { - $log_entry = array_merge( - [ - 'type' => $type, - 'message' => $message, - ], - $config - ); - - $this->logs[ wp_json_encode( $message ) ] = $log_entry; - - /** - * Filter the log entry for the debug log - * - * @param array $log The log entry - * @param array $config The config passed in with the log entry - */ - return apply_filters( 'graphql_debug_log_entry', $log_entry, $config ); - } - - return []; - } - - /** - * Returns the debug log - * - * @return array - */ - public function get_logs() { - - /** - * Init the debug logger - * - * @param \WPGraphQL\Utils\DebugLog $instance The DebugLog instance - */ - do_action( 'graphql_get_debug_log', $this ); - - // If GRAPHQL_DEBUG is not enabled on the server, set a default message - if ( ! $this->logs_enabled ) { - $this->logs = [ - [ - 'type' => 'DEBUG_LOGS_INACTIVE', - 'message' => __( 'GraphQL Debug logging is not active. To see debug logs, GRAPHQL_DEBUG must be enabled.', 'wp-graphql' ), - ], - ]; - } - - /** - * Return the filtered debug log - * - * @param array $logs The logs to be output with the request - * @param \WPGraphQL\Utils\DebugLog $instance The Debug Log class - */ - return apply_filters( 'graphql_debug_log', array_values( $this->logs ), $this ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Utils/InstrumentSchema.php b/lib/wp-graphql-1.17.0/src/Utils/InstrumentSchema.php deleted file mode 100644 index efe03fd2..00000000 --- a/lib/wp-graphql-1.17.0/src/Utils/InstrumentSchema.php +++ /dev/null @@ -1,273 +0,0 @@ -getFields(); - - $fields = ! empty( $fields ) ? self::wrap_fields( $fields, $type->name ) : []; - $type->name = ucfirst( esc_html( $type->name ) ); - $type->description = ! empty( $type->description ) ? esc_html( $type->description ) : ''; - $type->config['fields'] = $fields; - - return $type; - } - - /** - * Wrap Fields - * - * This wraps fields to provide sanitization on fields output by introspection queries - * (description/deprecation reason) and provides hooks to resolvers. - * - * @param array $fields The fields configured for a Type - * @param string $type_name The Type name - * - * @return mixed - */ - protected static function wrap_fields( array $fields, string $type_name ) { - if ( empty( $fields ) || ! is_array( $fields ) ) { - return $fields; - } - - foreach ( $fields as $field_key => $field ) { - - /** - * Filter the field definition - * - * @param \GraphQL\Type\Definition\FieldDefinition $field The field definition - * @param string $type_name The name of the Type the field belongs to - */ - $field = apply_filters( 'graphql_field_definition', $field, $type_name ); - - if ( ! $field instanceof FieldDefinition ) { - return $field; - } - - /** - * Get the fields resolve function - * - * @since 0.0.1 - */ - $field_resolver = is_callable( $field->resolveFn ) ? $field->resolveFn : null; - - /** - * Sanitize the description and deprecation reason - */ - $field->description = ! empty( $field->description ) && is_string( $field->description ) ? esc_html( $field->description ) : ''; - $field->deprecationReason = ! empty( $field->deprecationReason ) && is_string( $field->description ) ? esc_html( $field->deprecationReason ) : null; - - /** - * Replace the existing field resolve method with a new function that captures data about - * the resolver to be stored in the resolver_report - * - * @param mixed $source The source passed down the Resolve Tree - * @param array $args The args for the field - * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree - * - * @return mixed - * @throws \Exception - * @since 0.0.1 - */ - $field->resolveFn = static function ( $source, array $args, AppContext $context, ResolveInfo $info ) use ( $field_resolver, $type_name, $field_key, $field ) { - - /** - * Fire an action BEFORE the field resolves - * - * @param mixed $source The source passed down the Resolve Tree - * @param array $args The args for the field - * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree - * @param ?callable $field_resolver The Resolve function for the field - * @param string $type_name The name of the type the fields belong to - * @param string $field_key The name of the field - * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field - */ - do_action( 'graphql_before_resolve_field', $source, $args, $context, $info, $field_resolver, $type_name, $field_key, $field ); - - /** - * Create unique custom "nil" value which is different from the build-in PHP null, false etc. - * When this custom "nil" is returned we can know that the filter did not try to preresolve - * the field because it does not equal with anything but itself. - */ - $nil = new \stdClass(); - - /** - * When this filter return anything other than the $nil it will be used as the resolved value - * and the execution of the actual resolved is skipped. This filter can be used to implement - * field level caches or for efficiently hiding data by returning null. - * - * @param mixed $nil Unique nil value - * @param mixed $source The source passed down the Resolve Tree - * @param array $args The args for the field - * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree - * @param string $type_name The name of the type the fields belong to - * @param string $field_key The name of the field - * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field - * @param mixed $field_resolver The default field resolver - */ - $result = apply_filters( 'graphql_pre_resolve_field', $nil, $source, $args, $context, $info, $type_name, $field_key, $field, $field_resolver ); - - /** - * Check if the field pre-resolved - */ - if ( $nil === $result ) { - /** - * If the current field doesn't have a resolve function, use the defaultFieldResolver, - * otherwise use the $field_resolver - */ - if ( null === $field_resolver || ! is_callable( $field_resolver ) ) { - $result = Executor::defaultFieldResolver( $source, $args, $context, $info ); - } else { - $result = $field_resolver( $source, $args, $context, $info ); - } - } - - /** - * Fire an action before the field resolves - * - * @param mixed $result The result of the field resolution - * @param mixed $source The source passed down the Resolve Tree - * @param array $args The args for the field - * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree - * @param string $type_name The name of the type the fields belong to - * @param string $field_key The name of the field - * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field - * @param mixed $field_resolver The default field resolver - */ - $result = apply_filters( 'graphql_resolve_field', $result, $source, $args, $context, $info, $type_name, $field_key, $field, $field_resolver ); - - /** - * Fire an action AFTER the field resolves - * - * @param mixed $source The source passed down the Resolve Tree - * @param array $args The args for the field - * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree - * @param ?callable $field_resolver The Resolve function for the field - * @param string $type_name The name of the type the fields belong to - * @param string $field_key The name of the field - * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field - * @param mixed $result The result of the field resolver - */ - do_action( 'graphql_after_resolve_field', $source, $args, $context, $info, $field_resolver, $type_name, $field_key, $field, $result ); - - return $result; - }; - } - - /** - * Return the fields - */ - return $fields; - } - - /** - * Check field permissions when resolving. If the check fails, an error will be thrown. - * - * This takes into account auth params defined in the Schema - * - * @param mixed $source The source passed down the Resolve Tree - * @param array $args The args for the field - * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree - * @param mixed|callable|string $field_resolver The Resolve function for the field - * @param string $type_name The name of the type the fields belong to - * @param string $field_key The name of the field - * @param \GraphQL\Type\Definition\FieldDefinition $field The Field Definition for the resolving field - * - * @return void - * - * @throws \GraphQL\Error\UserError - */ - public static function check_field_permissions( $source, array $args, AppContext $context, ResolveInfo $info, $field_resolver, string $type_name, string $field_key, FieldDefinition $field ) { - if ( ( ! isset( $field->config['auth'] ) || ! is_array( $field->config['auth'] ) ) && ! isset( $field->config['isPrivate'] ) ) { - return; - } - - /** - * Set the default auth error message - */ - $default_auth_error_message = __( 'You do not have permission to view this', 'wp-graphql' ); - $default_auth_error_message = apply_filters( 'graphql_field_resolver_auth_error_message', $default_auth_error_message, $field ); - - /** - * Retrieve permissions error message. - */ - $auth_error = isset( $field->config['auth']['errorMessage'] ) && ! empty( $field->config['auth']['errorMessage'] ) - ? $field->config['auth']['errorMessage'] - : $default_auth_error_message; - - /** - * If the user is authenticated, and the field has a custom auth callback configured - * execute the callback before continuing resolution - */ - if ( isset( $field->config['auth']['callback'] ) && is_callable( $field->config['auth']['callback'] ) ) { - $authorized = call_user_func( $field->config['auth']['callback'], $field, $field_key, $source, $args, $context, $info, $field_resolver ); - - // If callback returns explicit false throw. - if ( false === $authorized ) { - throw new UserError( esc_html( $auth_error ) ); - } - - return; - } - - /** - * If the schema for the field is configured to "isPrivate" or has "auth" configured, - * make sure the user is authenticated before resolving the field - */ - if ( isset( $field->config['isPrivate'] ) && true === $field->config['isPrivate'] && empty( get_current_user_id() ) ) { - throw new UserError( esc_html( $auth_error ) ); - } - - /** - * If the user is authenticated and the field has "allowedCaps" configured, - * ensure the user has at least one of the allowedCaps before resolving - */ - if ( isset( $field->config['auth']['allowedCaps'] ) && is_array( $field->config['auth']['allowedCaps'] ) ) { - $caps = ! empty( wp_get_current_user()->allcaps ) ? wp_get_current_user()->allcaps : []; - if ( empty( array_intersect( array_keys( $caps ), array_values( $field->config['auth']['allowedCaps'] ) ) ) ) { - throw new UserError( esc_html( $auth_error ) ); - } - } - - /** - * If the user is authenticated and the field has "allowedRoles" configured, - * ensure the user has at least one of the allowedRoles before resolving - */ - if ( isset( $field->config['auth']['allowedRoles'] ) && is_array( $field->config['auth']['allowedRoles'] ) ) { - $roles = ! empty( wp_get_current_user()->roles ) ? wp_get_current_user()->roles : []; - $allowed_roles = array_values( $field->config['auth']['allowedRoles'] ); - if ( empty( array_intersect( array_values( $roles ), array_values( $allowed_roles ) ) ) ) { - throw new UserError( esc_html( $auth_error ) ); - } - } - } -} diff --git a/lib/wp-graphql-1.17.0/src/Utils/Preview.php b/lib/wp-graphql-1.17.0/src/Utils/Preview.php deleted file mode 100644 index e6e1d332..00000000 --- a/lib/wp-graphql-1.17.0/src/Utils/Preview.php +++ /dev/null @@ -1,58 +0,0 @@ -post_type ) { - $parent = get_post( $post->post_parent ); - $meta_key = ! empty( $meta_key ) ? $meta_key : ''; - - return isset( $parent->ID ) && absint( $parent->ID ) ? get_post_meta( $parent->ID, $meta_key, (bool) $single ) : $default_value; - } - - return $default_value; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Utils/QueryAnalyzer.php b/lib/wp-graphql-1.17.0/src/Utils/QueryAnalyzer.php deleted file mode 100644 index 46c1624b..00000000 --- a/lib/wp-graphql-1.17.0/src/Utils/QueryAnalyzer.php +++ /dev/null @@ -1,800 +0,0 @@ -request = $request; - $this->schema = $request->schema; - $this->runtime_nodes = []; - $this->models = []; - $this->list_types = []; - $this->queried_types = []; - } - - /** - * @return \WPGraphQL\Request - */ - public function get_request(): Request { - return $this->request; - } - - /** - * @return void - */ - public function init(): void { - - /** - * Filters whether to analyze queries or not - * - * @param bool $should_analyze_queries Whether to analyze queries or not. Default true - * @param \WPGraphQL\Utils\QueryAnalyzer $query_analyzer The QueryAnalyzer instance - */ - $should_analyze_queries = apply_filters( 'graphql_should_analyze_queries', true, $this ); - - // If query analyzer is disabled, bail - if ( true !== $should_analyze_queries ) { - return; - } - - $this->graphql_keys = []; - $this->skipped_keys = ''; - - /** - * Many clients have an 8k (8192 characters) header length cap. - * - * This is the total for ALL headers, not just individual headers. - * - * SEE: https://nodejs.org/en/blog/vulnerability/november-2018-security-releases/#denial-of-service-with-large-http-headers-cve-2018-12121 - * - * In order to respect this, we have a default limit of 4000 characters for the X-GraphQL-Keys header - * to allow for other headers to total up to 8k. - * - * This value can be filtered to be increased or decreased. - * - * If you see "Parse Error: Header overflow" errors in your client, you might want to decrease this value. - * - * On the other hand, if you've increased your allowed header length in your client - * (i.e. https://github.com/wp-graphql/wp-graphql/issues/2535#issuecomment-1262499064) then you might want to increase this so that keys are not truncated. - * - * @param int $header_length_limit The max limit in (binary) bytes headers should be. Anything longer will be truncated. - */ - $this->header_length_limit = apply_filters( 'graphql_query_analyzer_header_length_limit', 4000 ); - - // track keys related to the query - add_action( 'do_graphql_request', [ $this, 'determine_graphql_keys' ], 10, 4 ); - - // Track models loaded during execution - add_filter( 'graphql_dataloader_get_model', [ $this, 'track_nodes' ], 10, 1 ); - - // Expose query analyzer data in extensions - add_filter( - 'graphql_request_results', - [ - $this, - 'show_query_analyzer_in_extensions', - ], - 10, - 5 - ); - } - - /** - * Determine the keys associated with the GraphQL document being executed - * - * @param ?string $query The GraphQL query - * @param ?string $operation The name of the operation - * @param ?array $variables Variables to be passed to your GraphQL request - * @param \GraphQL\Server\OperationParams $params The Operation Params. This includes any extra params, - * such as extensions or any other modifications to the request body - * - * @return void - * @throws \Exception - */ - public function determine_graphql_keys( ?string $query, ?string $operation, ?array $variables, OperationParams $params ): void { - - // @todo: support for QueryID? - - // if the query is empty, get it from the request params - if ( empty( $query ) ) { - $query = $this->request->params->query ?: null; - } - - if ( empty( $query ) ) { - return; - } - - $query_id = Utils::get_query_id( $query ); - $this->query_id = $query_id ?: uniqid( 'gql:', true ); - - // if there's a query (either saved or part of the request params) - // get the GraphQL Types being asked for by the query - $this->list_types = $this->set_list_types( $this->schema, $query ); - $this->queried_types = $this->set_query_types( $this->schema, $query ); - $this->models = $this->set_query_models( $this->schema, $query ); - - /** - * @param \WPGraphQL\Utils\QueryAnalyzer $query_analyzer The instance of the query analyzer - * @param string $query The query string being executed - */ - do_action( 'graphql_determine_graphql_keys', $this, $query ); - } - - /** - * @return array - */ - public function get_list_types(): array { - return array_unique( $this->list_types ); - } - - /** - * @return array - */ - public function get_query_types(): array { - return array_unique( $this->queried_types ); - } - - /** - * @return array - */ - public function get_query_models(): array { - return array_unique( $this->models ); - } - - /** - * @return array - */ - public function get_runtime_nodes(): array { - /** - * @param array $runtime_nodes Nodes that were resolved during execution - */ - $runtime_nodes = apply_filters( 'graphql_query_analyzer_get_runtime_nodes', $this->runtime_nodes ); - - return array_unique( $runtime_nodes ); - } - - /** - * @return string - */ - public function get_root_operation(): string { - return $this->root_operation; - } - - /** - * Returns the operation name of the query, if there is one - * - * @return string|null - */ - public function get_operation_name(): ?string { - $operation_name = ! empty( $this->request->params->operation ) ? $this->request->params->operation : null; - - if ( empty( $operation_name ) ) { - - // If the query is not set on the params, return null - if ( ! isset( $this->request->params->query ) ) { - return null; - } - - try { - $ast = Parser::parse( $this->request->params->query ); - $operation_name = ! empty( $ast->definitions[0]->name->value ) ? $ast->definitions[0]->name->value : null; - } catch ( SyntaxError $error ) { - return null; - } - } - - return ! empty( $operation_name ) ? 'operation:' . $operation_name : null; - } - - /** - * @return string|null - */ - public function get_query_id(): ?string { - return $this->query_id; - } - - - /** - * @param \GraphQL\Type\Definition\Type $type The Type of field - * @param \GraphQL\Type\Definition\FieldDefinition $field_def The field definition the type is for - * @param mixed $parent_type The Parent Type - * @param bool $is_list_type Whether the field is a list type field - * - * @return \GraphQL\Type\Definition\Type|String|null - */ - public static function get_wrapped_field_type( Type $type, FieldDefinition $field_def, $parent_type, bool $is_list_type = false ) { - if ( ! isset( $parent_type->name ) || 'RootQuery' !== $parent_type->name ) { - return null; - } - - if ( $type instanceof NonNull || $type instanceof ListOfType ) { - if ( $type instanceof ListOfType && isset( $parent_type->name ) && 'RootQuery' === $parent_type->name ) { - $is_list_type = true; - } - - return self::get_wrapped_field_type( $type->getWrappedType(), $field_def, $parent_type, $is_list_type ); - } - - // Determine if we're dealing with a connection - if ( $type instanceof ObjectType || $type instanceof InterfaceType ) { - $interfaces = method_exists( $type, 'getInterfaces' ) ? $type->getInterfaces() : []; - $interface_names = ! empty( $interfaces ) ? array_map( - static function ( InterfaceType $interface_obj ) { - return $interface_obj->name; - }, - $interfaces - ) : []; - - if ( array_key_exists( 'Connection', $interface_names ) ) { - if ( isset( $field_def->config['fromType'] ) && ( 'rootquery' !== strtolower( $field_def->config['fromType'] ) ) ) { - return null; - } - - $to_type = $field_def->config['toType'] ?? null; - if ( empty( $to_type ) ) { - return null; - } - - return $to_type; - } - - if ( ! $is_list_type ) { - return null; - } - - return $type; - } - - return null; - } - - /** - * Given the Schema and a query string, return a list of GraphQL Types that are being asked for - * by the query. - * - * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema - * @param ?string $query The query string - * - * @return array - * @throws \GraphQL\Error\SyntaxError|\Exception - */ - public function set_list_types( ?Schema $schema, ?string $query ): array { - - /** - * @param array|null $null Default value for the filter - * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema for the current request - * @param ?string $query The query string being requested - */ - $null = null; - $pre_get_list_types = apply_filters( 'graphql_pre_query_analyzer_get_list_types', $null, $schema, $query ); - - if ( null !== $pre_get_list_types ) { - return $pre_get_list_types; - } - - if ( empty( $query ) || null === $schema ) { - return []; - } - - try { - $ast = Parser::parse( $query ); - } catch ( SyntaxError $error ) { - return []; - } - - $type_map = []; - $type_info = new TypeInfo( $schema ); - - $visitor = [ - 'enter' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info, &$type_map, $schema ) { - $parent_type = $type_info->getParentType(); - - if ( 'Field' !== $node->kind ) { - Visitor::skipNode(); - } - - $type_info->enter( $node ); - $field_def = $type_info->getFieldDef(); - - if ( ! $field_def instanceof FieldDefinition ) { - return; - } - - // Determine the wrapped type, which also determines if it's a listOf - $field_type = $field_def->getType(); - $field_type = self::get_wrapped_field_type( $field_type, $field_def, $parent_type ); - - if ( null === $field_type ) { - return; - } - - if ( ! empty( $field_type ) && is_string( $field_type ) ) { - $field_type = $schema->getType( ucfirst( $field_type ) ); - } - - if ( ! $field_type ) { - return; - } - - $field_type = $schema->getType( $field_type ); - - if ( ! $field_type instanceof ObjectType && ! $field_type instanceof InterfaceType ) { - return; - } - - // If the type being queried is an interface (i.e. ContentNode) the publishing a new - // item of any of the possible types (post, page, etc) should invalidate - // this query, so we need to tag this query with `list:$possible_type` for each possible type - if ( $field_type instanceof InterfaceType ) { - $possible_types = $schema->getPossibleTypes( $field_type ); - if ( ! empty( $possible_types ) ) { - foreach ( $possible_types as $possible_type ) { - $type_map[] = 'list:' . strtolower( $possible_type ); - } - } - } else { - $type_map[] = 'list:' . strtolower( $field_type ); - } - }, - 'leave' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info ) { - $type_info->leave( $node ); - }, - ]; - - Visitor::visit( $ast, Visitor::visitWithTypeInfo( $type_info, $visitor ) ); - $map = array_values( array_unique( array_filter( $type_map ) ) ); - - return apply_filters( 'graphql_cache_collection_get_list_types', $map, $schema, $query, $type_info ); - } - - /** - * Given the Schema and a query string, return a list of GraphQL Types that are being asked for - * by the query. - * - * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema - * @param ?string $query The query string - * - * @return array - * @throws \Exception - */ - public function set_query_types( ?Schema $schema, ?string $query ): array { - - /** - * @param array|null $null Default value for the filter - * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema for the current request - * @param ?string $query The query string being requested - */ - $null = null; - $pre_get_query_types = apply_filters( 'graphql_pre_query_analyzer_get_query_types', $null, $schema, $query ); - - if ( null !== $pre_get_query_types ) { - return $pre_get_query_types; - } - - if ( empty( $query ) || null === $schema ) { - return []; - } - try { - $ast = Parser::parse( $query ); - } catch ( SyntaxError $error ) { - return []; - } - $type_map = []; - $type_info = new TypeInfo( $schema ); - $visitor = [ - 'enter' => function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info, &$type_map, $schema ) { - $type_info->enter( $node ); - $type = $type_info->getType(); - if ( ! $type ) { - return; - } - - if ( empty( $this->root_operation ) ) { - if ( $type === $schema->getQueryType() ) { - $this->root_operation = 'Query'; - } - - if ( $type === $schema->getMutationType() ) { - $this->root_operation = 'Mutation'; - } - - if ( $type === $schema->getSubscriptionType() ) { - $this->root_operation = 'Subscription'; - } - } - - $named_type = Type::getNamedType( $type ); - - if ( $named_type instanceof InterfaceType ) { - $possible_types = $schema->getPossibleTypes( $named_type ); - foreach ( $possible_types as $possible_type ) { - $type_map[] = strtolower( $possible_type ); - } - } elseif ( $named_type instanceof ObjectType ) { - $type_map[] = strtolower( $named_type ); - } - }, - 'leave' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info ) { - $type_info->leave( $node ); - }, - ]; - - Visitor::visit( $ast, Visitor::visitWithTypeInfo( $type_info, $visitor ) ); - $map = array_values( array_unique( array_filter( $type_map ) ) ); - - return apply_filters( 'graphql_cache_collection_get_query_types', $map, $schema, $query, $type_info ); - } - - /** - * Given the Schema and a query string, return a list of GraphQL model names that are being - * asked for by the query. - * - * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema - * @param ?string $query The query string - * - * @return array - * @throws \GraphQL\Error\SyntaxError|\Exception - */ - public function set_query_models( ?Schema $schema, ?string $query ): array { - - /** - * @param array|null $null Default value for the filter - * @param ?\GraphQL\Type\Schema $schema The WPGraphQL Schema for the current request - * @param ?string $query The query string being requested - */ - $null = null; - $pre_get_models = apply_filters( 'graphql_pre_query_analyzer_get_models', $null, $schema, $query ); - - if ( null !== $pre_get_models ) { - return $pre_get_models; - } - - if ( empty( $query ) || null === $schema ) { - return []; - } - try { - $ast = Parser::parse( $query ); - } catch ( SyntaxError $error ) { - return []; - } - $type_map = []; - $type_info = new TypeInfo( $schema ); - $visitor = [ - 'enter' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info, &$type_map, $schema ) { - $type_info->enter( $node ); - $type = $type_info->getType(); - if ( ! $type ) { - return; - } - - $named_type = Type::getNamedType( $type ); - - if ( $named_type instanceof InterfaceType ) { - $possible_types = $schema->getPossibleTypes( $named_type ); - foreach ( $possible_types as $possible_type ) { - if ( ! isset( $possible_type->config['model'] ) ) { - continue; - } - $type_map[] = $possible_type->config['model']; - } - } elseif ( $named_type instanceof ObjectType ) { - if ( ! isset( $named_type->config['model'] ) ) { - return; - } - $type_map[] = $named_type->config['model']; - } - }, - 'leave' => static function ( $node, $key, $_parent, $path, $ancestors ) use ( $type_info ) { - $type_info->leave( $node ); - }, - ]; - - Visitor::visit( $ast, Visitor::visitWithTypeInfo( $type_info, $visitor ) ); - $map = array_values( array_unique( array_filter( $type_map ) ) ); - - return apply_filters( 'graphql_cache_collection_get_query_models', $map, $schema, $query, $type_info ); - } - - /** - * Track the nodes that were resolved by ensuring the Node's model - * matches one of the models asked for in the query - * - * @param mixed $model The Model to be returned by the loader - * - * @return mixed - */ - public function track_nodes( $model ) { - if ( isset( $model->id ) && in_array( get_class( $model ), $this->get_query_models(), true ) ) { - // Is this model type part of the requested/returned data in the asked for query? - - /** - * Filter the node ID before returning to the list of resolved nodes - * - * @param int $model_id The ID of the model (node) being returned - * @param object $model The Model object being returned - * @param array $runtime_nodes The runtimes nodes already collected - */ - $node_id = apply_filters( 'graphql_query_analyzer_runtime_node', $model->id, $model, $this->runtime_nodes ); - - $node_type = Utils::get_node_type_from_id( $node_id ); - - if ( empty( $this->runtime_nodes_by_type[ $node_type ] ) || ! in_array( $node_id, $this->runtime_nodes_by_type[ $node_type ], true ) ) { - $this->runtime_nodes_by_type[ $node_type ][] = $node_id; - } - - $this->runtime_nodes[] = $node_id; - } - - return $model; - } - - /** - * Returns graphql keys for use in debugging and headers. - * - * @return array - */ - public function get_graphql_keys() { - if ( ! empty( $this->graphql_keys ) ) { - return $this->graphql_keys; - } - - $keys = []; - $return_keys = ''; - - if ( $this->get_query_id() ) { - $keys[] = $this->get_query_id(); - } - - if ( ! empty( $this->get_root_operation() ) ) { - $keys[] = 'graphql:' . $this->get_root_operation(); - } - - if ( ! empty( $this->get_operation_name() ) ) { - $keys[] = $this->get_operation_name(); - } - - if ( ! empty( $this->get_list_types() ) ) { - $keys = array_merge( $keys, $this->get_list_types() ); - } - - if ( ! empty( $this->get_runtime_nodes() ) ) { - $keys = array_merge( $keys, $this->get_runtime_nodes() ); - } - - if ( ! empty( $keys ) ) { - $all_keys = implode( ' ', array_unique( array_values( $keys ) ) ); - - // Use the header_length_limit to wrap the words with a separator - $wrapped = wordwrap( $all_keys, $this->header_length_limit, '\n' ); - - // explode the string at the separator. This creates an array of chunks that - // can be used to expose the keys in multiple headers, each under the header_length_limit - $chunks = explode( '\n', $wrapped ); - - // Iterate over the chunks - foreach ( $chunks as $index => $chunk ) { - if ( 0 === $index ) { - $return_keys = $chunk; - } else { - $this->skipped_keys = trim( $this->skipped_keys . ' ' . $chunk ); - } - } - } - - $skipped_keys_array = ! empty( $this->skipped_keys ) ? explode( ' ', $this->skipped_keys ) : []; - $return_keys_array = ! empty( $return_keys ) ? explode( ' ', $return_keys ) : []; - $skipped_types = []; - - $runtime_node_types = array_keys( $this->runtime_nodes_by_type ); - - if ( ! empty( $skipped_keys_array ) ) { - foreach ( $skipped_keys_array as $skipped_key ) { - foreach ( $runtime_node_types as $node_type ) { - if ( in_array( 'skipped:' . $node_type, $skipped_types, true ) ) { - continue; - } - if ( in_array( $skipped_key, $this->runtime_nodes_by_type[ $node_type ], true ) ) { - $skipped_types[] = 'skipped:' . $node_type; - break; - } - } - } - } - - // If there are any skipped types, append them to the GraphQL Keys - if ( ! empty( $skipped_types ) ) { - $skipped_types_string = implode( ' ', $skipped_types ); - $return_keys .= ' ' . $skipped_types_string; - } - - /** - * @param array $graphql_keys Information about the keys and skipped keys returned by the Query Analyzer - * @param string $return_keys The keys returned to the X-GraphQL-Keys header - * @param string $skipped_keys The Keys that were skipped (truncated due to size limit) from the X-GraphQL-Keys header - * @param array $return_keys_array The keys returned to the X-GraphQL-Keys header, in array instead of string - * @param array $skipped_keys_array The keys skipped, in array instead of string - */ - $this->graphql_keys = apply_filters( - 'graphql_query_analyzer_graphql_keys', - [ - 'keys' => $return_keys, - 'keysLength' => strlen( $return_keys ), - 'keysCount' => ! empty( $return_keys_array ) ? count( $return_keys_array ) : 0, - 'skippedKeys' => $this->skipped_keys, - 'skippedKeysSize' => strlen( $this->skipped_keys ), - 'skippedKeysCount' => ! empty( $skipped_keys_array ) ? count( $skipped_keys_array ) : 0, - 'skippedTypes' => $skipped_types, - ], - $return_keys, - $this->skipped_keys, - $return_keys_array, - $skipped_keys_array - ); - - return $this->graphql_keys; - } - - - /** - * Return headers - * - * @param array $headers The array of headers being returned - * - * @return array - */ - public function get_headers( array $headers = [] ): array { - $keys = $this->get_graphql_keys(); - - if ( ! empty( $keys ) ) { - $headers['X-GraphQL-Query-ID'] = $this->query_id ?: null; - $headers['X-GraphQL-Keys'] = $keys['keys'] ?: null; - } - - return $headers; - } - - /** - * Outputs Query Analyzer data in the extensions response - * - * @param mixed $response - * @param \WPGraphQL\WPSchema $schema The WPGraphQL Schema - * @param string|null $operation_name The operation name being executed - * @param string|null $request The GraphQL Request being made - * @param array|null $variables The variables sent with the request - * - * @return array|object|null - */ - public function show_query_analyzer_in_extensions( $response, WPSchema $schema, ?string $operation_name, ?string $request, ?array $variables ) { - $should = \WPGraphQL::debug(); - - /** - * @param bool $should Whether the query analyzer output should be displayed in the Extensions output. Default to the value of WPGraphQL Debug. - * @param mixed $response The response of the WPGraphQL Request being executed - * @param \WPGraphQL\WPSchema $schema The WPGraphQL Schema - * @param string|null $operation_name The operation name being executed - * @param string|null $request The GraphQL Request being made - * @param array|null $variables The variables sent with the request - */ - $should_show_query_analyzer_in_extensions = apply_filters( 'graphql_should_show_query_analyzer_in_extensions', $should, $response, $schema, $operation_name, $request, $variables ); - - // If the query analyzer output is disabled, - // don't show the output in the response - if ( false === $should_show_query_analyzer_in_extensions ) { - return $response; - } - - $keys = $this->get_graphql_keys(); - - if ( ! empty( $response ) ) { - if ( is_array( $response ) ) { - $response['extensions']['queryAnalyzer'] = $keys ?: null; - } elseif ( is_object( $response ) ) { - // @phpstan-ignore-next-line - $response->extensions['queryAnalyzer'] = $keys ?: null; - } - } - - return $response; - } -} diff --git a/lib/wp-graphql-1.17.0/src/Utils/QueryLog.php b/lib/wp-graphql-1.17.0/src/Utils/QueryLog.php deleted file mode 100644 index df5628e0..00000000 --- a/lib/wp-graphql-1.17.0/src/Utils/QueryLog.php +++ /dev/null @@ -1,171 +0,0 @@ -query_logs_enabled = 'on' === $enabled; - - $this->query_log_user_role = get_graphql_setting( 'query_log_user_role', 'manage_options' ); - - if ( ! $this->query_logs_enabled ) { - return; - } - - add_action( 'init', [ $this, 'init_save_queries' ] ); - add_filter( 'graphql_request_results', [ $this, 'show_results' ], 10, 5 ); - } - - /** - * Tell WordPress to start saving queries. - * - * NOTE: This will affect all requests, not just GraphQL requests. - * - * @return void - */ - public function init_save_queries() { - if ( is_graphql_http_request() && ! defined( 'SAVEQUERIES' ) ) { - define( 'SAVEQUERIES', true ); - } - } - - /** - * Determine if the requesting user can see logs - * - * @return boolean - */ - public function user_can_see_logs() { - $can_see = false; - - // If logs are disabled, user cannot see logs - if ( ! $this->query_logs_enabled ) { - $can_see = false; - } elseif ( 'any' === $this->query_log_user_role ) { - // If "any" is the selected role, anyone can see the logs - $can_see = true; - } else { - // Get the current users roles - $user = wp_get_current_user(); - - // If the user doesn't have roles or the selected role isn't one the user has, the - // user cannot see roles; - if ( in_array( $this->query_log_user_role, $user->roles, true ) ) { - $can_see = true; - } - } - - /** - * Filter whether the logs can be seen in the request results or not - * - * @param boolean $can_see Whether the requester can see the logs or not - */ - return apply_filters( 'graphql_user_can_see_query_logs', $can_see ); - } - - /** - * Filter the results of the GraphQL Response to include the Query Log - * - * @param mixed $response - * @param \WPGraphQL\WPSchema $schema The WPGraphQL Schema - * @param string $operation_name The operation name being executed - * @param string $request The GraphQL Request being made - * @param array $variables The variables sent with the request - * - * @return array - */ - public function show_results( $response, $schema, $operation_name, $request, $variables ) { - $query_log = $this->get_query_log(); - - // If the user cannot see the logs, return the response as-is without the logs - if ( ! $this->user_can_see_logs() ) { - return $response; - } - - if ( ! empty( $response ) ) { - if ( is_array( $response ) ) { - $response['extensions']['queryLog'] = $query_log; - } elseif ( is_object( $response ) ) { - // @phpstan-ignore-next-line - $response->extensions['queryLog'] = $query_log; - } - } - - return $response; - } - - /** - * Return the query log produced from the logs stored by WPDB. - * - * @return array - */ - public function get_query_log() { - global $wpdb; - - $save_queries_value = defined( 'SAVEQUERIES' ) && true === SAVEQUERIES ? 'true' : 'false'; - $default_message = sprintf( - // translators: %s is the value of the SAVEQUERIES constant - __( 'Query Logging has been disabled. The \'SAVEQUERIES\' Constant is set to \'%s\' on your server.', 'wp-graphql' ), - $save_queries_value - ); - - // Default message - $trace = [ $default_message ]; - - if ( ! empty( $wpdb->queries ) && is_array( $wpdb->queries ) ) { - $queries = array_map( - static function ( $query ) { - return [ - 'sql' => $query[0], - 'time' => $query[1], - 'stack' => $query[2], - ]; - }, - $wpdb->queries - ); - - $times = wp_list_pluck( $queries, 'time' ); - $total_time = array_sum( $times ); - $trace = [ - 'queryCount' => count( $queries ), - 'totalTime' => $total_time, - 'queries' => $queries, - ]; - } - - /** - * Filter the trace - * - * @param array $trace The trace to return - * @param \WPGraphQL\Utils\QueryLog $instance The QueryLog class instance - */ - return apply_filters( 'graphql_tracing_response', $trace, $this ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Utils/Tracing.php b/lib/wp-graphql-1.17.0/src/Utils/Tracing.php deleted file mode 100644 index eba7f97a..00000000 --- a/lib/wp-graphql-1.17.0/src/Utils/Tracing.php +++ /dev/null @@ -1,360 +0,0 @@ -tracing_enabled = 'on' === $enabled; - - $this->tracing_user_role = get_graphql_setting( 'tracing_user_role', 'manage_options' ); - - if ( ! $this->tracing_enabled ) { - return; - } - - add_filter( 'do_graphql_request', [ $this, 'init_trace' ] ); - add_action( 'graphql_execute', [ $this, 'end_trace' ], 99, 0 ); - add_filter( 'graphql_access_control_allow_headers', [ $this, 'return_tracing_headers' ] ); - add_filter( - 'graphql_request_results', - [ - $this, - 'add_tracing_to_response_extensions', - ], - 10, - 1 - ); - add_action( 'graphql_before_resolve_field', [ $this, 'init_field_resolver_trace' ], 10, 4 ); - add_action( 'graphql_after_resolve_field', [ $this, 'end_field_resolver_trace' ], 10 ); - } - - /** - * Sets the timestamp and microtime for the start of the request - * - * @return float - */ - public function init_trace() { - $this->request_start_microtime = microtime( true ); - $this->request_start_timestamp = $this->format_timestamp( $this->request_start_microtime ); - - return $this->request_start_timestamp; - } - - /** - * Sets the timestamp and microtime for the end of the request - * - * @return void - */ - public function end_trace() { - $this->request_end_microtime = microtime( true ); - $this->request_end_timestamp = $this->format_timestamp( $this->request_end_microtime ); - } - - /** - * Initialize tracing for an individual field - * - * @param mixed $source The source passed down the Resolve Tree - * @param array $args The args for the field - * @param \WPGraphQL\AppContext $context The AppContext passed down the ResolveTree - * @param \GraphQL\Type\Definition\ResolveInfo $info The ResolveInfo passed down the ResolveTree - * - * @return void - */ - public function init_field_resolver_trace( $source, array $args, AppContext $context, ResolveInfo $info ) { - $this->field_trace = [ - 'path' => $info->path, - 'parentType' => $info->parentType->name, - 'fieldName' => $info->fieldName, - 'returnType' => $info->returnType->name ? $info->returnType->name : $info->returnType, - 'startOffset' => $this->get_start_offset(), - 'startMicrotime' => microtime( true ), - ]; - } - - /** - * End the tracing for a resolver - * - * @return void - */ - public function end_field_resolver_trace() { - if ( ! empty( $this->field_trace ) ) { - $this->field_trace['duration'] = $this->get_field_resolver_duration(); - $sanitized_trace = $this->sanitize_resolver_trace( $this->field_trace ); - $this->trace_logs[] = $sanitized_trace; - } - - // reset the field trace - $this->field_trace = []; - } - - /** - * Given a resolver start time, returns the duration of a resolver - * - * @return float|int - */ - public function get_field_resolver_duration() { - return ( microtime( true ) - $this->field_trace['startMicrotime'] ) * 1000000; - } - - /** - * Get the offset between the start of the request and now - * - * @return float|int - */ - public function get_start_offset() { - return ( microtime( true ) - $this->request_start_microtime ) * 1000000; - } - - /** - * Given a trace, sanitizes the values and returns the sanitized_trace - * - * @param array $trace - * - * @return mixed - */ - public function sanitize_resolver_trace( array $trace ) { - $sanitized_trace = []; - $sanitized_trace['path'] = ! empty( $trace['path'] ) && is_array( $trace['path'] ) ? array_map( - [ - $this, - 'sanitize_trace_resolver_path', - ], - $trace['path'] - ) : []; - $sanitized_trace['parentType'] = ! empty( $trace['parentType'] ) ? esc_html( $trace['parentType'] ) : ''; - $sanitized_trace['fieldName'] = ! empty( $trace['fieldName'] ) ? esc_html( $trace['fieldName'] ) : ''; - $sanitized_trace['returnType'] = ! empty( $trace['returnType'] ) ? esc_html( $trace['returnType'] ) : ''; - $sanitized_trace['startOffset'] = ! empty( $trace['startOffset'] ) ? absint( $trace['startOffset'] ) : ''; - $sanitized_trace['duration'] = ! empty( $trace['duration'] ) ? absint( $trace['duration'] ) : ''; - - return $sanitized_trace; - } - - /** - * Given input from a Resolver Path, this sanitizes the input for output in the trace - * - * @param mixed $input The input to sanitize - * - * @return int|null|string - */ - public static function sanitize_trace_resolver_path( $input ) { - $sanitized_input = null; - if ( is_numeric( $input ) ) { - $sanitized_input = absint( $input ); - } else { - $sanitized_input = esc_html( $input ); - } - - return $sanitized_input; - } - - /** - * Formats a timestamp to be RFC 3339 compliant - * - * @see https://github.com/apollographql/apollo-tracing - * - * @param mixed|string|float|int $time The timestamp to format - * - * @return float - */ - public function format_timestamp( $time ) { - $time_as_float = sprintf( '%.4f', $time ); - $timestamp = \DateTime::createFromFormat( 'U.u', $time_as_float ); - - return ! empty( $timestamp ) ? (float) $timestamp->format( 'Y-m-d\TH:i:s.uP' ) : (float) 0; - } - - /** - * Filter the headers that WPGraphQL returns to include headers that indicate the WPGraphQL - * server supports Apollo Tracing and Credentials - * - * @param array $headers The headers to return - * - * @return array - */ - public function return_tracing_headers( array $headers ) { - $headers[] = 'X-Insights-Include-Tracing'; - $headers[] = 'X-Apollo-Tracing'; - $headers[] = 'Credentials'; - - return (array) $headers; - } - - /** - * Filter the results of the GraphQL Response to include the Query Log - * - * @param mixed|array|object $response The response of the GraphQL Request - * - * @return mixed $response - */ - public function add_tracing_to_response_extensions( $response ) { - - // Get the trace - $trace = $this->get_trace(); - - // If a specific capability is set for tracing and the requesting user - // doesn't have the capability, return the unmodified response - if ( ! $this->user_can_see_trace_data() ) { - return $response; - } - - if ( is_array( $response ) ) { - $response['extensions']['tracing'] = $trace; - } elseif ( is_object( $response ) ) { - // @phpstan-ignore-next-line - $response->extensions['tracing'] = $trace; - } - - return $response; - } - - /** - * Returns the request duration calculated from the start and end times - * - * @return float|int - */ - public function get_request_duration() { - return ( $this->request_end_microtime - $this->request_start_microtime ) * 1000000; - } - - /** - * Determine if the requesting user can see trace data - * - * @return boolean - */ - public function user_can_see_trace_data(): bool { - $can_see = false; - - // If logs are disabled, user cannot see logs - if ( ! $this->tracing_enabled ) { - $can_see = false; - } elseif ( 'any' === $this->tracing_user_role ) { - // If "any" is the selected role, anyone can see the logs - $can_see = true; - } else { - // Get the current users roles - $user = wp_get_current_user(); - - // If the user doesn't have roles or the selected role isn't one the user has, the user cannot see roles. - if ( in_array( $this->tracing_user_role, $user->roles, true ) ) { - $can_see = true; - } - } - - /** - * Filter whether the logs can be seen in the request results or not - * - * @param boolean $can_see Whether the requester can see the logs or not - */ - return apply_filters( 'graphql_user_can_see_trace_data', $can_see ); - } - - /** - * Get the trace to add to the response - * - * @return array - */ - public function get_trace(): array { - - // Compile the trace to return with the GraphQL Response - $trace = [ - 'version' => absint( $this->trace_spec_version ), - 'startTime' => (float) $this->request_start_microtime, - 'endTime' => (float) $this->request_end_microtime, - 'duration' => absint( $this->get_request_duration() ), - 'execution' => [ - 'resolvers' => $this->trace_logs, - ], - ]; - - /** - * Filter the trace - * - * @param array $trace The trace to return - * @param \WPGraphQL\Utils\Tracing $instance The Tracing class instance - */ - return apply_filters( 'graphql_tracing_response', (array) $trace, $this ); - } -} diff --git a/lib/wp-graphql-1.17.0/src/Utils/Utils.php b/lib/wp-graphql-1.17.0/src/Utils/Utils.php deleted file mode 100644 index 0d195075..00000000 --- a/lib/wp-graphql-1.17.0/src/Utils/Utils.php +++ /dev/null @@ -1,367 +0,0 @@ - $value ) { - if ( [] !== $skip && in_array( $arg, $skip, true ) ) { - continue; - } - - if ( is_array( $value ) && ! empty( $value ) ) { - $value = array_map( - static function ( $value ) { - if ( is_string( $value ) ) { - $value = sanitize_text_field( $value ); - } - - return $value; - }, - $value - ); - } elseif ( is_string( $value ) ) { - $value = sanitize_text_field( $value ); - } - - if ( array_key_exists( $arg, $map ) ) { - $query_args[ $map[ $arg ] ] = $value; - } else { - $query_args[ $arg ] = $value; - } - } - - return $query_args; - } - - /** - * Checks the post_date_gmt or modified_gmt and prepare any post or - * modified date for single post output. - * - * @param string $date_gmt GMT publication time. - * @param mixed|string|null $date Optional. Local publication time. Default null. - * - * @return string|null ISO8601/RFC3339 formatted datetime. - * @since 4.7.0 - */ - public static function prepare_date_response( string $date_gmt, $date = null ) { - // Use the date if passed. - if ( isset( $date ) ) { - return mysql_to_rfc3339( $date ); - } - // Return null if $date_gmt is empty/zeros. - if ( '0000-00-00 00:00:00' === $date_gmt ) { - return null; - } - - // Return the formatted datetime. - return mysql_to_rfc3339( $date_gmt ); - } - - /** - * Format a GraphQL name according to the GraphQL spec. - * - * Per the GraphQL spec, characters in names are limited to Latin ASCII letter, digits, or underscores. - * - * @see http://spec.graphql.org/draft/#sec-Names - * - * @param string $name The name to format. - * @param string $replacement The replacement character for invalid characters. Defaults to '_'. - * @param string $regex The regex to use to match invalid characters. Defaults to '/[^A-Za-z0-9_]/i'. - * - * @since v1.17.0 - */ - public static function format_graphql_name( string $name, string $replacement = '_', string $regex = '/[^A-Za-z0-9_]/i' ): string { - if ( empty( $name ) ) { - return ''; - } - - /** - * Filter to manually format a GraphQL name according to custom rules. - * - * If anything other than null is returned, the result will be used for the name instead of the standard regex. - * - * Useful for providing custom transliteration rules that will convert non ASCII characters to ASCII. - * - * @param null|string $formatted_name The name to format. If not null, the result will be returned as the formatted name. - * @param string $original_name The name to format. - * @param string $replacement The replacement character for invalid characters. Defaults to '_'. - * @param string $regex The regex to use to match invalid characters. Defaults to '/[^A-Za-z0-9_]/i'. - * - * @return string|null - */ - $pre_format_name = apply_filters( 'graphql_pre_format_name', null, $name, $replacement, $regex ); - - // Check whether the filter is being used (correctly). - if ( ! empty( $pre_format_name ) && is_string( $pre_format_name ) ) { - // Don't trust the filter to return a formatted string. - $name = trim( sanitize_text_field( $pre_format_name ) ); - } else { - // Throw a warning if someone is using the filter incorrectly. - if ( null !== $pre_format_name ) { - graphql_debug( - esc_html__( 'The `graphql_pre_format_name` filter must return a string or null.', 'wp-graphql' ), - [ - 'type' => 'INVALID_GRAPHQL_NAME', - 'original_name' => esc_html( $name ), - ] - ); - } - - // Remove all non-alphanumeric characters. - $name = preg_replace( $regex, $replacement, $name ); - } - - if ( empty( $name ) ) { - return ''; - } - - // Replace multiple consecutive leading underscores with a single underscore, since those are reserved. - $name = preg_replace( '/^_+/', '_', trim( $name ) ); - - return ! empty( $name ) ? $name : ''; - } - - /** - * Given a field name, formats it for GraphQL - * - * @param string $field_name The field name to format - * @param bool $allow_underscores Whether the field should be formatted with underscores allowed. Default false. - * - * @return string - */ - public static function format_field_name( string $field_name, bool $allow_underscores = false ): string { - // Bail if empty. - if ( empty( $field_name ) ) { - return ''; - } - - $formatted_field_name = graphql_format_name( $field_name, '_', '/[^a-zA-Z0-9 -]/' ); - - // If the formatted name is empty, we want to return the original value so it displays in the error. - if ( empty( $formatted_field_name ) ) { - return $field_name; - } - - // underscores are allowed by GraphQL, but WPGraphQL has historically - // stripped them when formatting field names. - // The $allow_underscores argument allows functions to opt-in to allowing underscores - if ( true !== $allow_underscores ) { - // uppercase words separated by an underscore, then replace the underscores with a space - $formatted_field_name = lcfirst( str_replace( '_', ' ', ucwords( $formatted_field_name, '_' ) ) ); - } - - // uppercase words separated by a dash, then replace the dashes with a space - $formatted_field_name = lcfirst( str_replace( '-', ' ', ucwords( $formatted_field_name, '-' ) ) ); - - // uppercace words separated by a space, and replace spaces with no space - $formatted_field_name = lcfirst( str_replace( ' ', '', ucwords( $formatted_field_name, ' ' ) ) ); - - // Field names should be lcfirst. - return lcfirst( $formatted_field_name ); - } - - /** - * Given a type name, formats it for GraphQL - * - * @param string $type_name The type name to format - * - * @return string - */ - public static function format_type_name( $type_name ) { - return ucfirst( self::format_field_name( $type_name ) ); - } - - /** - * Returns a GraphQL type name for a given WordPress template name. - * - * If the template name has no ASCII characters, the file name will be used instead. - * - * @param string $name The template name. - * @param string $file The file name. - * @return string The formatted type name. If the name is empty, an empty string will be returned. - */ - public static function format_type_name_for_wp_template( string $name, string $file ): string { - $name = ucwords( $name ); - // Strip out not ASCII characters. - $name = graphql_format_name( $name, '', '/[^\w]/' ); - - // If replaced_name is empty, use the file name. - if ( empty( $name ) ) { - $file_parts = explode( '.', $file ); - $file_name = ! empty( $file_parts[0] ) ? self::format_type_name( $file_parts[0] ) : ''; - $replaced_name = ! empty( $file_name ) ? graphql_format_name( $file_name, '', '/[^\w]/' ) : ''; - - $name = ! empty( $replaced_name ) ? $replaced_name : $name; - } - - // If the name is still empty, we don't have a valid type. - if ( empty( $name ) ) { - return ''; - } - - // Maybe prefix the name with "Template_". - if ( preg_match( '/^\d/', $name ) || false === strpos( strtolower( $name ), 'template' ) ) { - $name = 'Template_' . $name; - } - - return $name; - } - - /** - * Helper function that defines the allowed HTML to use on the Settings pages - * - * @return array - */ - public static function get_allowed_wp_kses_html() { - $allowed_atts = [ - 'align' => [], - 'class' => [], - 'type' => [], - 'id' => [], - 'dir' => [], - 'lang' => [], - 'style' => [], - 'xml:lang' => [], - 'src' => [], - 'alt' => [], - 'href' => [], - 'rel' => [], - 'rev' => [], - 'target' => [], - 'novalidate' => [], - 'value' => [], - 'name' => [], - 'tabindex' => [], - 'action' => [], - 'method' => [], - 'for' => [], - 'width' => [], - 'height' => [], - 'data' => [], - 'title' => [], - 'checked' => [], - 'disabled' => [], - 'selected' => [], - ]; - - return [ - 'form' => $allowed_atts, - 'label' => $allowed_atts, - 'input' => $allowed_atts, - 'textarea' => $allowed_atts, - 'iframe' => $allowed_atts, - 'script' => $allowed_atts, - 'select' => $allowed_atts, - 'option' => $allowed_atts, - 'style' => $allowed_atts, - 'strong' => $allowed_atts, - 'small' => $allowed_atts, - 'table' => $allowed_atts, - 'span' => $allowed_atts, - 'abbr' => $allowed_atts, - 'code' => $allowed_atts, - 'pre' => $allowed_atts, - 'div' => $allowed_atts, - 'img' => $allowed_atts, - 'h1' => $allowed_atts, - 'h2' => $allowed_atts, - 'h3' => $allowed_atts, - 'h4' => $allowed_atts, - 'h5' => $allowed_atts, - 'h6' => $allowed_atts, - 'ol' => $allowed_atts, - 'ul' => $allowed_atts, - 'li' => $allowed_atts, - 'em' => $allowed_atts, - 'hr' => $allowed_atts, - 'br' => $allowed_atts, - 'tr' => $allowed_atts, - 'td' => $allowed_atts, - 'p' => $allowed_atts, - 'a' => $allowed_atts, - 'b' => $allowed_atts, - 'i' => $allowed_atts, - ]; - } - - /** - * Helper function to get the WordPress database ID from a GraphQL ID type input. - * - * Returns false if not a valid ID. - * - * @param int|string $id The ID from the input args. Can be either the database ID (as either a string or int) or the global Relay ID. - * - * @return int|false - */ - public static function get_database_id_from_id( $id ) { - // If we already have the database ID, send it back as an integer. - if ( is_numeric( $id ) ) { - return absint( $id ); - } - - $id_parts = Relay::fromGlobalId( $id ); - - return ! empty( $id_parts['id'] ) && is_numeric( $id_parts['id'] ) ? absint( $id_parts['id'] ) : false; - } - - /** - * Get the node type from the ID - * - * @param int|string $id The encoded Node ID. - * - * @return bool|null - */ - public static function get_node_type_from_id( $id ) { - if ( is_numeric( $id ) ) { - return null; - } - - $id_parts = Relay::fromGlobalId( $id ); - return $id_parts['type'] ?: null; - } -} diff --git a/lib/wp-graphql-1.17.0/src/WPGraphQL.php b/lib/wp-graphql-1.17.0/src/WPGraphQL.php deleted file mode 100644 index e72794db..00000000 --- a/lib/wp-graphql-1.17.0/src/WPGraphQL.php +++ /dev/null @@ -1,823 +0,0 @@ -setup_constants(); - self::$instance->includes(); - self::$instance->actions(); - self::$instance->filters(); - } - - /** - * Return the WPGraphQL Instance - */ - return self::$instance; - } - - /** - * Throw error on object clone. - * The whole idea of the singleton design pattern is that there is a single object - * therefore, we don't want the object to be cloned. - * - * @return void - * @since 0.0.1 - */ - public function __clone() { - // Cloning instances of the class is forbidden. - _doing_it_wrong( __FUNCTION__, esc_html__( 'The WPGraphQL class should not be cloned.', 'wp-graphql' ), '0.0.1' ); - } - - /** - * Disable unserializing of the class. - * - * @return void - * @since 0.0.1 - */ - public function __wakeup() { - // De-serializing instances of the class is forbidden. - _doing_it_wrong( __FUNCTION__, esc_html__( 'De-serializing instances of the WPGraphQL class is not allowed', 'wp-graphql' ), '0.0.1' ); - } - - /** - * Setup plugin constants. - * - * @return void - * @since 0.0.1 - */ - private function setup_constants() { - graphql_setup_constants(); - } - - /** - * Include required files. - * Uses composer's autoload - * - * @return void - * @since 0.0.1 - */ - private function includes(): void { - } - - /** - * Set whether the request is a GraphQL request or not - * - * @param bool $is_graphql_request - * - * @return void - */ - public static function set_is_graphql_request( $is_graphql_request = false ) { - self::$is_graphql_request = $is_graphql_request; - } - - /** - * @return bool - */ - public static function is_graphql_request() { - return self::$is_graphql_request; - } - - /** - * Sets up actions to run at certain spots throughout WordPress and the WPGraphQL execution - * cycle - * - * @return void - */ - private function actions(): void { - /** - * Init WPGraphQL after themes have been setup, - * allowing for both plugins and themes to register - * things before graphql_init - */ - add_action( - 'after_setup_theme', - static function () { - new \WPGraphQL\Data\Config(); - $router = new Router(); - $router->init(); - $instance = self::instance(); - - /** - * Fire off init action - * - * @param \WPGraphQL $instance The instance of the WPGraphQL class - */ - do_action( 'graphql_init', $instance ); - } - ); - - // Initialize the plugin url constant - // see: https://developer.wordpress.org/reference/functions/plugins_url/#more-information - add_action( 'init', [ $this, 'setup_plugin_url' ] ); - - // Prevent WPGraphQL Insights from running - remove_action( 'init', '\WPGraphQL\Extensions\graphql_insights_init' ); - - /** - * Flush permalinks if the registered GraphQL endpoint has not yet been registered. - */ - add_action( 'wp_loaded', [ $this, 'maybe_flush_permalinks' ] ); - - /** - * Hook in before fields resolve to check field permissions - */ - add_action( - 'graphql_before_resolve_field', - [ - '\WPGraphQL\Utils\InstrumentSchema', - 'check_field_permissions', - ], - 10, - 8 - ); - - // Determine what to show in graphql - add_action( 'init_graphql_request', 'register_initial_settings', 10 ); - - // Throw an exception - add_action( 'do_graphql_request', [ $this, 'min_php_version_check' ] ); - - // Initialize Admin functionality - add_action( 'after_setup_theme', [ $this, 'init_admin' ] ); - - add_action( - 'init_graphql_request', - static function () { - $tracing = new \WPGraphQL\Utils\Tracing(); - $tracing->init(); - - $query_log = new \WPGraphQL\Utils\QueryLog(); - $query_log->init(); - } - ); - } - - /** - * Check if the minimum PHP version requirement is met before execution begins. - * - * If the server is running a lower version than required, throw an exception and prevent - * further execution. - * - * @return void - * @throws \Exception - */ - public function min_php_version_check() { - if ( defined( 'GRAPHQL_MIN_PHP_VERSION' ) && version_compare( PHP_VERSION, GRAPHQL_MIN_PHP_VERSION, '<' ) ) { - throw new \Exception( - esc_html( - sprintf( - // translators: %1$s is the current PHP version, %2$s is the minimum required PHP version. - __( 'The server\'s current PHP version %1$s is lower than the WPGraphQL minimum required version: %2$s', 'wp-graphql' ), - PHP_VERSION, - GRAPHQL_MIN_PHP_VERSION - ) - ) - ); - } - } - - /** - * Sets up the plugin url - * - * @return void - */ - public function setup_plugin_url() { - // Plugin Folder URL. - if ( ! defined( 'WPGRAPHQL_PLUGIN_URL' ) ) { - define( 'WPGRAPHQL_PLUGIN_URL', plugin_dir_url( dirname( __DIR__ ) . '/wp-graphql.php' ) ); - } - } - - /** - * Determine the post_types and taxonomies, etc that should show in GraphQL - * - * @return void - */ - public function setup_types() { - /** - * Setup the settings, post_types and taxonomies to show_in_graphql - */ - self::show_in_graphql(); - } - - /** - * Flush permalinks if the GraphQL Endpoint route isn't yet registered - * - * @return void - */ - public function maybe_flush_permalinks() { - $rules = get_option( 'rewrite_rules' ); - if ( ! isset( $rules[ graphql_get_endpoint() . '/?$' ] ) ) { - flush_rewrite_rules(); // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.flush_rewrite_rules_flush_rewrite_rules - } - } - - /** - * Setup filters - * - * @return void - */ - private function filters(): void { - // Filter the post_types and taxonomies to show in the GraphQL Schema - $this->setup_types(); - - /** - * Instrument the Schema to provide Resolve Hooks and sanitize Schema output - */ - add_filter( - 'graphql_get_type', - [ - InstrumentSchema::class, - 'instrument_resolvers', - ], - 10, - 2 - ); - - // Filter how metadata is retrieved during GraphQL requests - add_filter( - 'get_post_metadata', - [ - Preview::class, - 'filter_post_meta_for_previews', - ], - 10, - 4 - ); - - /** - * Adds back compat support for the `graphql_object_type_interfaces` filter which was renamed - * to support both ObjectTypes and InterfaceTypes - * - * @deprecated - */ - add_filter( - 'graphql_type_interfaces', - static function ( $interfaces, $config, $type ) { - if ( $type instanceof WPObjectType ) { - /** - * Filters the interfaces applied to an object type - * - * @param array $interfaces List of interfaces applied to the Object Type - * @param array $config The config for the Object Type - * @param mixed|\WPGraphQL\Type\WPInterfaceType|\WPGraphQL\Type\WPObjectType $type The Type instance - */ - return apply_filters_deprecated( 'graphql_object_type_interfaces', [ $interfaces, $config, $type ], '1.4.1', 'graphql_type_interfaces' ); - } - - return $interfaces; - }, - 10, - 3 - ); - } - - /** - * Initialize admin functionality - * - * @return void - */ - public function init_admin() { - $admin = new Admin(); - $admin->init(); - } - - /** - * This sets up built-in post_types and taxonomies to show in the GraphQL Schema - * - * @return void - * @since 0.0.2 - */ - public static function show_in_graphql() { - add_filter( 'register_post_type_args', [ self::class, 'setup_default_post_types' ], 10, 2 ); - add_filter( 'register_taxonomy_args', [ self::class, 'setup_default_taxonomies' ], 10, 2 ); - - // Run late so the user can filter the args themselves. - add_filter( 'register_post_type_args', [ self::class, 'register_graphql_post_type_args' ], 99, 2 ); - add_filter( 'register_taxonomy_args', [ self::class, 'register_graphql_taxonomy_args' ], 99, 2 ); - } - - /** - * Sets up the default post types to show_in_graphql. - * - * @param array $args Array of arguments for registering a post type. - * @param string $post_type Post type key. - * - * @return array - */ - public static function setup_default_post_types( $args, $post_type ) { - // Adds GraphQL support for attachments. - if ( 'attachment' === $post_type ) { - $args['show_in_graphql'] = true; - $args['graphql_single_name'] = 'mediaItem'; - $args['graphql_plural_name'] = 'mediaItems'; - } elseif ( 'page' === $post_type ) { // Adds GraphQL support for pages. - $args['show_in_graphql'] = true; - $args['graphql_single_name'] = 'page'; - $args['graphql_plural_name'] = 'pages'; - } elseif ( 'post' === $post_type ) { // Adds GraphQL support for posts. - $args['show_in_graphql'] = true; - $args['graphql_single_name'] = 'post'; - $args['graphql_plural_name'] = 'posts'; - } - - return $args; - } - - /** - * Sets up the default taxonomies to show_in_graphql. - * - * @param array $args Array of arguments for registering a taxonomy. - * @param string $taxonomy Taxonomy key. - * - * @return array - * @since 1.12.0 - */ - public static function setup_default_taxonomies( $args, $taxonomy ) { - // Adds GraphQL support for categories. - if ( 'category' === $taxonomy ) { - $args['show_in_graphql'] = true; - $args['graphql_single_name'] = 'category'; - $args['graphql_plural_name'] = 'categories'; - } elseif ( 'post_tag' === $taxonomy ) { // Adds GraphQL support for tags. - $args['show_in_graphql'] = true; - $args['graphql_single_name'] = 'tag'; - $args['graphql_plural_name'] = 'tags'; - } elseif ( 'post_format' === $taxonomy ) { // Adds GraphQL support for post formats. - $args['show_in_graphql'] = true; - $args['graphql_single_name'] = 'postFormat'; - $args['graphql_plural_name'] = 'postFormats'; - } - - return $args; - } - - /** - * Set the GraphQL Post Type Args and pass them through a filter. - * - * @param array $args The graphql specific args for the post type - * @param string $post_type_name The name of the post type being registered - * - * @return array - * @throws \Exception - * @since 1.12.0 - */ - public static function register_graphql_post_type_args( array $args, string $post_type_name ) { - // Bail early if the post type is hidden from the WPGraphQL schema. - if ( empty( $args['show_in_graphql'] ) ) { - return $args; - } - - $graphql_args = self::get_default_graphql_type_args(); - - /** - * Filters the graphql args set on a post type - * - * @param array $args The graphql specific args for the post type - * @param string $post_type_name The name of the post type being registered - */ - $graphql_args = apply_filters( 'register_graphql_post_type_args', $graphql_args, $post_type_name ); - - return wp_parse_args( $args, $graphql_args ); - } - - /** - * Set the GraphQL Taxonomy Args and pass them through a filter. - * - * @param array $args The graphql specific args for the taxonomy - * @param string $taxonomy_name The name of the taxonomy being registered - * - * @return array - * @throws \Exception - * @since 1.12.0 - */ - public static function register_graphql_taxonomy_args( array $args, string $taxonomy_name ) { - // Bail early if the taxonomy is hidden from the WPGraphQL schema. - if ( empty( $args['show_in_graphql'] ) ) { - return $args; - } - - $graphql_args = self::get_default_graphql_type_args(); - - /** - * Filters the graphql args set on a taxonomy - * - * @param array $args The graphql specific args for the taxonomy - * @param string $taxonomy_name The name of the taxonomy being registered - */ - $graphql_args = apply_filters( 'register_graphql_taxonomy_args', $graphql_args, $taxonomy_name ); - - return wp_parse_args( $args, $graphql_args ); - } - - /** - * This sets the post type /taxonomy GraphQL properties. - * - * @since 1.12.0 - */ - public static function get_default_graphql_type_args(): array { - return [ - // The "kind" of GraphQL type to register. Can be `interface`, `object`, or `union`. - 'graphql_kind' => 'object', - // The callback used to resolve the type. Only used if `graphql_kind` is an `interface` or `union`. - 'graphql_resolve_type' => null, - // An array of custom interfaces the type should implement. - 'graphql_interfaces' => [], - // An array of default interfaces the type should exclude. - 'graphql_exclude_interfaces' => [], - // An array of custom connections the type should implement. - 'graphql_connections' => [], - // An array of default connection field names the type should exclude. - 'graphql_exclude_connections' => [], - // An array of possible type the union can resolve to. Only used if `graphql_kind` is a `union`. - 'graphql_union_types' => [], - // Whether to register default connections to the schema. - 'graphql_register_root_field' => true, - 'graphql_register_root_connection' => true, - ]; - } - - /** - * Get the post types that are allowed to be used in GraphQL. - * This gets all post_types that are set to show_in_graphql, but allows for external code - * (plugins/theme) to filter the list of allowed_post_types to add/remove additional post_types - * - * @param string|array $output Optional. The type of output to return. Accepts post type - * 'names' or 'objects'. Default 'names'. - * @param array $args Optional. Arguments to filter allowed post types - * - * @return array - * @since 0.0.4 - * @since 1.8.1 adds $output as first param, and stores post type objects in class property. - */ - public static function get_allowed_post_types( $output = 'names', $args = [] ) { - // Support deprecated param order. - if ( is_array( $output ) ) { - _deprecated_argument( __METHOD__, '1.8.1', '$args should be passed as the second parameter.' ); - $args = $output; - $output = 'names'; - } - - // Initialize array of allowed post type objects. - if ( empty( self::$allowed_post_types ) ) { - /** - * Get all post types objects. - * - * @var \WP_Post_Type[] $post_type_objects - */ - $post_type_objects = get_post_types( - [ 'show_in_graphql' => true ], - 'objects' - ); - - $post_type_names = wp_list_pluck( $post_type_objects, 'name' ); - - /** - * Pass through a filter to allow the post_types to be modified. - * For example if a certain post_type should not be exposed to the GraphQL API. - * - * @param array $post_type_names Array of post type names. - * @param array $post_type_objects Array of post type objects. - * - * @return array - * @since 1.8.1 add $post_type_objects parameter. - * - * @since 0.0.2 - */ - $allowed_post_type_names = apply_filters( 'graphql_post_entities_allowed_post_types', $post_type_names, $post_type_objects ); - - // Filter the post type objects if the list of allowed types have changed. - $post_type_objects = array_filter( - $post_type_objects, - static function ( $obj ) use ( $allowed_post_type_names ) { - if ( empty( $obj->graphql_plural_name ) && ! empty( $obj->graphql_single_name ) ) { - $obj->graphql_plural_name = $obj->graphql_single_name; - } - - /** - * Validate that the post_types have a graphql_single_name and graphql_plural_name - */ - if ( empty( $obj->graphql_single_name ) || empty( $obj->graphql_plural_name ) ) { - graphql_debug( - sprintf( - /* translators: %s will replaced with the registered type */ - __( 'The "%s" post_type isn\'t configured properly to show in GraphQL. It needs a "graphql_single_name" and a "graphql_plural_name"', 'wp-graphql' ), - $obj->name - ), - [ - 'invalid_post_type' => $obj, - ] - ); - return false; - } - - return in_array( $obj->name, $allowed_post_type_names, true ); - } - ); - - self::$allowed_post_types = $post_type_objects; - } - - /** - * Filter the list of allowed post types either by the provided args or to only return an array of names. - */ - if ( ! empty( $args ) || 'names' === $output ) { - $field = 'names' === $output ? 'name' : false; - - return wp_filter_object_list( self::$allowed_post_types, $args, 'and', $field ); - } - - return self::$allowed_post_types; - } - - /** - * Get the taxonomies that are allowed to be used in GraphQL. - * This gets all taxonomies that are set to "show_in_graphql" but allows for external code - * (plugins/themes) to filter the list of allowed_taxonomies to add/remove additional - * taxonomies - * - * @param string $output Optional. The type of output to return. Accepts taxonomy 'names' or 'objects'. Default 'names'. - * @param array $args Optional. Arguments to filter allowed taxonomies. - * - * @return array - * @since 0.0.4 - */ - public static function get_allowed_taxonomies( $output = 'names', $args = [] ) { - - // Initialize array of allowed post type objects. - if ( empty( self::$allowed_taxonomies ) ) { - /** - * Get all post types objects. - * - * @var \WP_Taxonomy[] $tax_objects - */ - $tax_objects = get_taxonomies( - [ 'show_in_graphql' => true ], - 'objects' - ); - - $tax_names = wp_list_pluck( $tax_objects, 'name' ); - - /** - * Pass through a filter to allow the taxonomies to be modified. - * For example if a certain taxonomy should not be exposed to the GraphQL API. - * - * @param array $tax_names Array of taxonomy names - * @param array $tax_objects Array of taxonomy objects. - * - * @return array - * @since 1.8.1 add $tax_names and $tax_objects parameters. - * - * @since 0.0.2 - */ - $allowed_tax_names = apply_filters( 'graphql_term_entities_allowed_taxonomies', $tax_names, $tax_objects ); - - $tax_objects = array_filter( - $tax_objects, - static function ( $obj ) use ( $allowed_tax_names ) { - if ( empty( $obj->graphql_plural_name ) && ! empty( $obj->graphql_single_name ) ) { - $obj->graphql_plural_name = $obj->graphql_single_name; - } - - /** - * Validate that the post_types have a graphql_single_name and graphql_plural_name - */ - if ( empty( $obj->graphql_single_name ) || empty( $obj->graphql_plural_name ) ) { - graphql_debug( - sprintf( - /* translators: %s will replaced with the registered taxonomty */ - __( 'The "%s" taxonomy isn\'t configured properly to show in GraphQL. It needs a "graphql_single_name" and a "graphql_plural_name"', 'wp-graphql' ), - $obj->name - ), - [ - 'invalid_taxonomy' => $obj, - ] - ); - return false; - } - - return in_array( $obj->name, $allowed_tax_names, true ); - } - ); - - self::$allowed_taxonomies = $tax_objects; - } - - $taxonomies = self::$allowed_taxonomies; - /** - * Filter the list of allowed taxonomies either by the provided args or to only return an array of names. - */ - if ( ! empty( $args ) || 'names' === $output ) { - $field = 'names' === $output ? 'name' : false; - - $taxonomies = wp_filter_object_list( $taxonomies, $args, 'and', $field ); - } - - return $taxonomies; - } - - /** - * Allow Schema to be cleared - * - * @return void - */ - public static function clear_schema() { - self::$type_registry = null; - self::$schema = null; - self::$allowed_post_types = null; - self::$allowed_taxonomies = null; - } - - /** - * Returns the Schema as defined by static registrations throughout - * the WP Load. - * - * @return \WPGraphQL\WPSchema - * - * @throws \Exception - */ - public static function get_schema() { - if ( null === self::$schema ) { - $schema_registry = new SchemaRegistry(); - $schema = $schema_registry->get_schema(); - - /** - * Generate & Filter the schema. - * - * @param \WPGraphQL\WPSchema $schema The executable Schema that GraphQL executes against - * @param \WPGraphQL\AppContext $app_context Object The AppContext object containing all of the - * information about the context we know at this point - * - * @since 0.0.5 - */ - self::$schema = apply_filters( 'graphql_schema', $schema, self::get_app_context() ); - } - - /** - * Fire an action when the Schema is returned - */ - do_action( 'graphql_get_schema', self::$schema ); - - /** - * Return the Schema after applying filters - */ - return ! empty( self::$schema ) ? self::$schema : null; - } - - /** - * Whether WPGraphQL is operating in Debug mode - * - * @return bool - */ - public static function debug(): bool { - if ( defined( 'GRAPHQL_DEBUG' ) ) { - $enabled = (bool) GRAPHQL_DEBUG; - } else { - $enabled = get_graphql_setting( 'debug_mode_enabled', 'off' ); - $enabled = 'on' === $enabled; - } - - /** - * @param bool $enabled Whether GraphQL Debug is enabled or not - */ - return (bool) apply_filters( 'graphql_debug_enabled', $enabled ); - } - - /** - * Returns the Schema as defined by static registrations throughout - * the WP Load. - * - * @return \WPGraphQL\Registry\TypeRegistry - * - * @throws \Exception - */ - public static function get_type_registry() { - if ( null === self::$type_registry ) { - $type_registry = new TypeRegistry(); - - /** - * Generate & Filter the schema. - * - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The TypeRegistry for the API - * @param \WPGraphQL\AppContext $app_context Object The AppContext object containing all of the - * information about the context we know at this point - * - * @since 0.0.5 - */ - self::$type_registry = apply_filters( 'graphql_type_registry', $type_registry, self::get_app_context() ); - } - - /** - * Fire an action when the Type Registry is returned - */ - do_action( 'graphql_get_type_registry', self::$type_registry ); - - /** - * Return the Schema after applying filters - */ - return ! empty( self::$type_registry ) ? self::$type_registry : null; - } - - /** - * Return the static schema if there is one - * - * @return null|string - */ - public static function get_static_schema() { - $schema = null; - if ( file_exists( WPGRAPHQL_PLUGIN_DIR . 'schema.graphql' ) && ! empty( file_get_contents( WPGRAPHQL_PLUGIN_DIR . 'schema.graphql' ) ) ) { - $schema = file_get_contents( WPGRAPHQL_PLUGIN_DIR . 'schema.graphql' ); - } - - return $schema; - } - - /** - * Get the AppContext for use in passing down the Resolve Tree - * - * @return \WPGraphQL\AppContext - */ - public static function get_app_context() { - /** - * Configure the app_context which gets passed down to all the resolvers. - * - * @since 0.0.4 - */ - $app_context = new AppContext(); - $app_context->viewer = wp_get_current_user(); - $app_context->root_url = get_bloginfo( 'url' ); - $app_context->request = ! empty( $_REQUEST ) ? $_REQUEST : null; // phpcs:ignore WordPress.Security.NonceVerification.Recommended - - return $app_context; - } -} diff --git a/lib/wp-graphql-1.17.0/src/WPSchema.php b/lib/wp-graphql-1.17.0/src/WPSchema.php deleted file mode 100644 index 0e378fd9..00000000 --- a/lib/wp-graphql-1.17.0/src/WPSchema.php +++ /dev/null @@ -1,54 +0,0 @@ -config = $config; - - /** - * Set the $filterable_config as the $config that was passed to the WPSchema when instantiated - * - * @param \GraphQL\Type\SchemaConfig $config The config for the Schema. - * @param \WPGraphQL\Registry\TypeRegistry $type_registry The WPGraphQL type registry. - * - * @since 0.0.9 - */ - $this->filterable_config = apply_filters( 'graphql_schema_config', $config, $type_registry ); - parent::__construct( $this->filterable_config ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/appsero/client/readme.md b/lib/wp-graphql-1.17.0/vendor/appsero/client/readme.md deleted file mode 100644 index 7157c5bd..00000000 --- a/lib/wp-graphql-1.17.0/vendor/appsero/client/readme.md +++ /dev/null @@ -1,266 +0,0 @@ -# Appsero - Client - -- [Installation](#installation) -- [Insights](#insights) -- [Dynamic Usage](#dynamic-usage) - - -## Installation - -You can install AppSero Client in two ways, via composer and manually. - -### 1. Composer Installation - -Add dependency in your project (theme/plugin): - -``` -composer require appsero/client -``` - -Now add `autoload.php` in your file if you haven't done already. - -```php -require __DIR__ . '/vendor/autoload.php'; -``` - -### 2. Manual Installation - -Clone the repository in your project. - -``` -cd /path/to/your/project/folder -git clone https://github.com/AppSero/client.git appsero -``` - -Now include the dependencies in your plugin/theme. - -```php -require __DIR__ . '/appsero/src/Client.php'; -``` - -## Insights - -AppSero can be used in both themes and plugins. - -The `Appsero\Client` class has *three* parameters: - -```php -$client = new Appsero\Client( $hash, $name, $file ); -``` - -- **hash** (*string*, *required*) - The unique identifier for a plugin or theme. -- **name** (*string*, *required*) - The name of the plugin or theme. -- **file** (*string*, *required*) - The **main file** path of the plugin. For theme, path to `functions.php` - -### Usage Example - -Please refer to the **installation** step before start using the class. - -You can obtain the **hash** for your plugin for the [Appsero Dashboard](https://dashboard.appsero.com). The 3rd parameter **must** have to be the main file of the plugin. - -```php -/** - * Initialize the tracker - * - * @return void - */ -function appsero_init_tracker_appsero_test() { - - if ( ! class_exists( 'Appsero\Client' ) ) { - require_once __DIR__ . '/appsero/src/Client.php'; - } - - $client = new Appsero\Client( 'a4a8da5b-b419-4656-98e9-4a42e9044891', 'Akismet', __FILE__ ); - - // Active insights - $client->insights()->init(); - - // Active automatic updater - $client->updater(); - - // Active license page and checker - $args = array( - 'type' => 'options', - 'menu_title' => 'Akismet', - 'page_title' => 'Akismet License Settings', - 'menu_slug' => 'akismet_settings', - ); - $client->license()->add_settings_page( $args ); -} - -appsero_init_tracker_appsero_test(); -``` - -Make sure you call this function directly, never use any action hook to call this function. - -> For plugins example code that needs to be used on your main plugin file. -> For themes example code that needs to be used on your themes `functions.php` file. - -## More Usage - -```php -$client = new Appsero\Client( 'a4a8da5b-b419-4656-98e9-4a42e9044892', 'Twenty Twelve', __FILE__ ); -``` - -#### 1. Hiding the notice - -Sometimes you wouldn't want to show the notice, or want to customize the notice message. You can do that as well. - -```php -$client->insights() - ->hide_notice() - ->init(); -``` - -#### 2. Customizing the notice message - -```php -$client->insights() - ->notice( 'My Custom Notice Message' ) - ->init(); -``` - -#### 3. Adding extra data - -You can add extra metadata from your theme or plugin. In that case, the **keys** has to be whitelisted from the Appsero dashboard. -`add_extra` method also support callback as parameter, If you need database call then callback is best for you. - -```php -$metadata = array( - 'key' => 'value', - 'another' => 'another_value' -); -$client->insights() - ->add_extra( $metadata ) - ->init(); -``` - -Or if you want to run a query then pass callback, we will call the function when it is necessary. - -```php -$metadata = function () { - $total_posts = wp_count_posts(); - - return array( - 'total_posts' => $total_posts, - 'another' => 'another_value' - ); -}; -$client->insights() - ->add_extra( $metadata ) - ->init(); -``` - -#### 4. Set textdomain - -You may set your own textdomain to translate text. - -```php -$client->set_textdomain( 'your-project-textdomain' ); -``` - - - - -#### 5. Get Plugin Data -If you want to get the most used plugins with your plugin or theme, send the active plugins' data to Appsero. -```php -$client->insights() - ->add_plugin_data() - ->init(); -``` ---- - -#### 6. Set Notice Message -Change opt-in message text -```php -$client->insights() - ->notice("Your custom notice text") - ->init(); -``` ---- - -### Check License Validity - -Check your plugin/theme is using with valid license or not, First create a global variable of `License` object then use it anywhere in your code. -If you are using it outside of same function make sure you global the variable before using the condition. - -```php -$client = new Appsero\Client( 'a4a8da5b-b419-4656-98e9-4a42e9044892', 'Twenty Twelve', __FILE__ ); - -$args = array( - 'type' => 'submenu', - 'menu_title' => 'Twenty Twelve License', - 'page_title' => 'Twenty Twelve License Settings', - 'menu_slug' => 'twenty_twelve_settings', - 'parent_slug' => 'themes.php', -); - -global $twenty_twelve_license; -$twenty_twelve_license = $client->license(); -$twenty_twelve_license->add_settings_page( $args ); - -if ( $twenty_twelve_license->is_valid() ) { - // Your special code here -} - -Or check by pricing plan title - -if ( $twenty_twelve_license->is_valid_by( 'title', 'Business' ) ) { - // Your special code here -} - -// Set custom options key for storing the license info -$twenty_twelve_license->set_option_key( 'my_plugin_license' ); -``` - -### Use your own license form - -You can easily manage license by creating a form using HTTP request. Call `license_form_submit` method from License object. - -```php -global $twenty_twelve_license; // License object -$twenty_twelve_license->license_form_submit([ - '_nonce' => wp_create_nonce( 'Twenty Twelve' ), // create a nonce with name - '_action' => 'active', // active, deactive - 'license_key' => 'random-license-key', // no need to provide if you want to deactive -]); -if ( ! $twenty_twelve_license->error ) { - // license activated - $twenty_twelve_license->success; // Success message is here -} else { - $twenty_twelve_license->error; // has error message here -} -``` - -### Set Custom Deactivation Reasons - -First set your deactivation reasons in Appsero dashboard then map them in your plugin/theme using filter hook. - -- **id** is the deactivation slug -- **text** is the deactivation title -- **placeholder** will show on textarea field -- **icon** You can set SVG icon with 23x23 size - -```php -add_filter( 'appsero_custom_deactivation_reasons', function () { - return [ - [ - 'id' => 'looks-buggy', - 'text' => 'Looks buggy', - 'placeholder' => 'Can you please tell which feature looks buggy?', - 'icon' => '', - ], - [ - 'id' => 'bad-ui', - 'text' => 'Bad UI', - 'placeholder' => 'Could you tell us a bit more?', - 'icon' => '', - ], - ]; -} ); -``` - -## Credits - -Created and maintained by [Appsero](https://appsero.com). diff --git a/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Client.php b/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Client.php deleted file mode 100644 index f51b1e7e..00000000 --- a/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Client.php +++ /dev/null @@ -1,280 +0,0 @@ -hash = $hash; - $this->name = $name; - $this->file = $file; - - $this->set_basename_and_slug(); - } - - /** - * Initialize insights class - * - * @return Appsero\Insights - */ - public function insights() { - - if ( ! class_exists( __NAMESPACE__ . '\Insights') ) { - require_once __DIR__ . '/Insights.php'; - } - - // if already instantiated, return the cached one - if ( $this->insights ) { - return $this->insights; - } - - $this->insights = new Insights( $this ); - - return $this->insights; - } - - /** - * Initialize plugin/theme updater - * - * @return Appsero\Updater - */ - public function updater() { - - if ( ! class_exists( __NAMESPACE__ . '\Updater') ) { - require_once __DIR__ . '/Updater.php'; - } - - // if already instantiated, return the cached one - if ( $this->updater ) { - return $this->updater; - } - - $this->updater = new Updater( $this ); - - return $this->updater; - } - - /** - * Initialize license checker - * - * @return Appsero\License - */ - public function license() { - - if ( ! class_exists( __NAMESPACE__ . '\License') ) { - require_once __DIR__ . '/License.php'; - } - - // if already instantiated, return the cached one - if ( $this->license ) { - return $this->license; - } - - $this->license = new License( $this ); - - return $this->license; - } - - /** - * API Endpoint - * - * @return string - */ - public function endpoint() { - $endpoint = apply_filters( 'appsero_endpoint', 'https://api.appsero.com' ); - - return trailingslashit( $endpoint ); - } - - /** - * Set project basename, slug and version - * - * @return void - */ - protected function set_basename_and_slug() { - - if ( strpos( $this->file, WP_CONTENT_DIR . '/themes/' ) === false ) { - $this->basename = plugin_basename( $this->file ); - - list( $this->slug, $mainfile) = explode( '/', $this->basename ); - - require_once ABSPATH . 'wp-admin/includes/plugin.php'; - - $plugin_data = get_plugin_data( $this->file ); - - $this->project_version = $plugin_data['Version']; - $this->type = 'plugin'; - } else { - $this->basename = str_replace( WP_CONTENT_DIR . '/themes/', '', $this->file ); - - list( $this->slug, $mainfile) = explode( '/', $this->basename ); - - $theme = wp_get_theme( $this->slug ); - - $this->project_version = $theme->version; - $this->type = 'theme'; - } - - $this->textdomain = $this->slug; - } - - /** - * Send request to remote endpoint - * - * @param array $params - * @param string $route - * - * @return array|WP_Error Array of results including HTTP headers or WP_Error if the request failed. - */ - public function send_request( $params, $route, $blocking = false ) { - $url = $this->endpoint() . $route; - - $headers = array( - 'user-agent' => 'Appsero/' . md5( esc_url( home_url() ) ) . ';', - 'Accept' => 'application/json', - ); - - $response = wp_remote_post( $url, array( - 'method' => 'POST', - 'timeout' => 30, - 'redirection' => 5, - 'httpversion' => '1.0', - 'blocking' => $blocking, - 'headers' => $headers, - 'body' => array_merge( $params, array( 'client' => $this->version ) ), - 'cookies' => array() - ) ); - - return $response; - } - - /** - * Check if the current server is localhost - * - * @return boolean - */ - public function is_local_server() { - $is_local = in_array( $_SERVER['REMOTE_ADDR'], array( '127.0.0.1', '::1' ) ); - - return apply_filters( 'appsero_is_local', $is_local ); - } - - /** - * Translate function _e() - */ - public function _etrans( $text ) { - call_user_func( '_e', $text, $this->textdomain ); - } - - /** - * Translate function __() - */ - public function __trans( $text ) { - return call_user_func( '__', $text, $this->textdomain ); - } - - /** - * Set project textdomain - */ - public function set_textdomain( $textdomain ) { - $this->textdomain = $textdomain; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Insights.php b/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Insights.php deleted file mode 100644 index 13184596..00000000 --- a/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Insights.php +++ /dev/null @@ -1,1184 +0,0 @@ -client = $client; - } - } - - /** - * Don't show the notice - * - * @return \self - */ - public function hide_notice() { - $this->show_notice = false; - - return $this; - } - - /** - * Add plugin data if needed - * - * @return \self - */ - public function add_plugin_data() { - $this->plugin_data = true; - - return $this; - } - - /** - * Add extra data if needed - * - * @param array $data - * - * @return \self - */ - public function add_extra( $data = array() ) { - $this->extra_data = $data; - - return $this; - } - - /** - * Set custom notice text - * - * @param string $text - * - * @return \self - */ - public function notice($text='' ) { - $this->notice = $text; - - return $this; - } - - /** - * Initialize insights - * - * @return void - */ - public function init() { - if ( $this->client->type == 'plugin' ) { - $this->init_plugin(); - } else if ( $this->client->type == 'theme' ) { - $this->init_theme(); - } - } - - /** - * Initialize theme hooks - * - * @return void - */ - public function init_theme() { - $this->init_common(); - - add_action( 'switch_theme', array( $this, 'deactivation_cleanup' ) ); - add_action( 'switch_theme', array( $this, 'theme_deactivated' ), 12, 3 ); - } - - /** - * Initialize plugin hooks - * - * @return void - */ - public function init_plugin() { - // plugin deactivate popup - if ( ! $this->is_local_server() ) { - add_filter( 'plugin_action_links_' . $this->client->basename, array( $this, 'plugin_action_links' ) ); - add_action( 'admin_footer', array( $this, 'deactivate_scripts' ) ); - } - - $this->init_common(); - - register_activation_hook( $this->client->file, array( $this, 'activate_plugin' ) ); - register_deactivation_hook( $this->client->file, array( $this, 'deactivation_cleanup' ) ); - } - - /** - * Initialize common hooks - * - * @return void - */ - protected function init_common() { - - if ( $this->show_notice ) { - // tracking notice - add_action( 'admin_notices', array( $this, 'admin_notice' ) ); - } - - add_action( 'admin_init', array( $this, 'handle_optin_optout' ) ); - - // uninstall reason - add_action( 'wp_ajax_' . $this->client->slug . '_submit-uninstall-reason', array( $this, 'uninstall_reason_submission' ) ); - - // cron events - add_filter( 'cron_schedules', array( $this, 'add_weekly_schedule' ) ); - add_action( $this->client->slug . '_tracker_send_event', array( $this, 'send_tracking_data' ) ); - // add_action( 'admin_init', array( $this, 'send_tracking_data' ) ); // test - } - - /** - * Send tracking data to AppSero server - * - * @param boolean $override - * - * @return void - */ - public function send_tracking_data( $override = false ) { - if ( ! $this->tracking_allowed() && ! $override ) { - return; - } - - // Send a maximum of once per week - $last_send = $this->get_last_send(); - - if ( $last_send && $last_send > strtotime( '-1 week' ) ) { - return; - } - - $tracking_data = $this->get_tracking_data(); - - $response = $this->client->send_request( $tracking_data, 'track' ); - - update_option( $this->client->slug . '_tracking_last_send', time() ); - } - - /** - * Get the tracking data points - * - * @return array - */ - protected function get_tracking_data() { - $all_plugins = $this->get_all_plugins(); - - $users = get_users( array( - 'role' => 'administrator', - 'orderby' => 'ID', - 'order' => 'ASC', - 'number' => 1, - 'paged' => 1, - ) ); - - $admin_user = ( is_array( $users ) && ! empty( $users ) ) ? $users[0] : false; - $first_name = $last_name = ''; - - if ( $admin_user ) { - $first_name = $admin_user->first_name ? $admin_user->first_name : $admin_user->display_name; - $last_name = $admin_user->last_name; - } - - $data = array( - 'url' => esc_url( home_url() ), - 'site' => $this->get_site_name(), - 'admin_email' => get_option( 'admin_email' ), - 'first_name' => $first_name, - 'last_name' => $last_name, - 'hash' => $this->client->hash, - 'server' => $this->get_server_info(), - 'wp' => $this->get_wp_info(), - 'users' => $this->get_user_counts(), - 'active_plugins' => count( $all_plugins['active_plugins'] ), - 'inactive_plugins' => count( $all_plugins['inactive_plugins'] ), - 'ip_address' => $this->get_user_ip_address(), - 'project_version' => $this->client->project_version, - 'tracking_skipped' => false, - 'is_local' => $this->is_local_server(), - ); - - // Add Plugins - if ($this->plugin_data) { - - $plugins_data = array(); - - foreach ($all_plugins['active_plugins'] as $slug => $plugin) { - $slug = strstr($slug, '/', true); - if (! $slug) { - continue; - } - - $plugins_data[ $slug ] = array( - 'name' => isset($plugin['name']) ? $plugin['name'] : '', - 'version' => isset($plugin['version']) ? $plugin['version'] : '', - ); - } - - if (array_key_exists($this->client->slug, $plugins_data)) { - unset($plugins_data[$this->client->slug]); - } - - $data['plugins'] = $plugins_data; - } - - // Add metadata - if ( $extra = $this->get_extra_data() ) { - $data['extra'] = $extra; - } - - // Check this has previously skipped tracking - $skipped = get_option( $this->client->slug . '_tracking_skipped' ); - - if ( $skipped === 'yes' ) { - delete_option( $this->client->slug . '_tracking_skipped' ); - - $data['tracking_skipped'] = true; - } - - return apply_filters( $this->client->slug . '_tracker_data', $data ); - } - - /** - * If a child class wants to send extra data - * - * @return mixed - */ - protected function get_extra_data() { - if ( is_callable( $this->extra_data ) ) { - return call_user_func( $this->extra_data ); - } - - if ( is_array( $this->extra_data ) ) { - return $this->extra_data; - } - - return array(); - } - - /** - * Explain the user which data we collect - * - * @return array - */ - protected function data_we_collect() { - $data = array( - 'Server environment details (php, mysql, server, WordPress versions)', - 'Number of users in your site', - 'Site language', - 'Number of active and inactive plugins', - 'Site name and URL', - 'Your name and email address', - ); - - if ($this->plugin_data) { - array_splice($data, 4, 0, ["active plugins' name"]); - } - - return $data; - } - - /** - * Check if the user has opted into tracking - * - * @return bool - */ - public function tracking_allowed() { - $allow_tracking = get_option( $this->client->slug . '_allow_tracking', 'no' ); - - return $allow_tracking == 'yes'; - } - - /** - * Get the last time a tracking was sent - * - * @return false|string - */ - private function get_last_send() { - return get_option( $this->client->slug . '_tracking_last_send', false ); - } - - /** - * Check if the notice has been dismissed or enabled - * - * @return boolean - */ - public function notice_dismissed() { - $hide_notice = get_option( $this->client->slug . '_tracking_notice', null ); - - if ( 'hide' == $hide_notice ) { - return true; - } - - return false; - } - - /** - * Check if the current server is localhost - * - * @return boolean - */ - private function is_local_server() { - - $host = isset( $_SERVER['HTTP_HOST'] ) ? $_SERVER['HTTP_HOST'] : 'localhost'; - $ip = isset( $_SERVER['SERVER_ADDR'] ) ? $_SERVER['SERVER_ADDR'] : '127.0.0.1'; - $is_local = false; - - if( in_array( $ip,array( '127.0.0.1', '::1' ) ) - || ! strpos( $host, '.' ) - || in_array( strrchr( $host, '.' ), array( '.test', '.testing', '.local', '.localhost', '.localdomain' ) ) - ) { - $is_local = true; - } - - return apply_filters( 'appsero_is_local', $is_local ); - } - - /** - * Schedule the event weekly - * - * @return void - */ - private function schedule_event() { - $hook_name = $this->client->slug . '_tracker_send_event'; - - if ( ! wp_next_scheduled( $hook_name ) ) { - wp_schedule_event( time(), 'weekly', $hook_name ); - } - } - - /** - * Clear any scheduled hook - * - * @return void - */ - private function clear_schedule_event() { - wp_clear_scheduled_hook( $this->client->slug . '_tracker_send_event' ); - } - - /** - * Display the admin notice to users that have not opted-in or out - * - * @return void - */ - public function admin_notice() { - - if ( $this->notice_dismissed() ) { - return; - } - - if ( $this->tracking_allowed() ) { - return; - } - - if ( ! current_user_can( 'manage_options' ) ) { - return; - } - - // don't show tracking if a local server - if ( $this->is_local_server() ) { - return; - } - - $optin_url = add_query_arg( $this->client->slug . '_tracker_optin', 'true' ); - $optout_url = add_query_arg( $this->client->slug . '_tracker_optout', 'true' ); - - if ( empty( $this->notice ) ) { - $notice = sprintf( $this->client->__trans( 'Want to help make %1$s even more awesome? Allow %1$s to collect non-sensitive diagnostic data and usage information.' ), $this->client->name ); - } else { - $notice = $this->notice; - } - - $policy_url = 'https://' . 'appsero.com/privacy-policy/'; - - $notice .= ' (' . $this->client->__trans( 'what we collect' ) . ')'; - $notice .= ''; - - echo '

'; - echo $notice; - echo '

'; - echo ' ' . $this->client->__trans( 'Allow' ) . ''; - echo ' ' . $this->client->__trans( 'No thanks' ) . ''; - echo '

'; - - echo " - "; - } - - /** - * handle the optin/optout - * - * @return void - */ - public function handle_optin_optout() { - - if ( isset( $_GET[ $this->client->slug . '_tracker_optin' ] ) && $_GET[ $this->client->slug . '_tracker_optin' ] == 'true' ) { - $this->optin(); - - wp_redirect( remove_query_arg( $this->client->slug . '_tracker_optin' ) ); - exit; - } - - if ( isset( $_GET[ $this->client->slug . '_tracker_optout' ] ) && $_GET[ $this->client->slug . '_tracker_optout' ] == 'true' ) { - $this->optout(); - - wp_redirect( remove_query_arg( $this->client->slug . '_tracker_optout' ) ); - exit; - } - } - - /** - * Tracking optin - * - * @return void - */ - public function optin() { - update_option( $this->client->slug . '_allow_tracking', 'yes' ); - update_option( $this->client->slug . '_tracking_notice', 'hide' ); - - $this->clear_schedule_event(); - $this->schedule_event(); - $this->send_tracking_data(); - } - - /** - * Optout from tracking - * - * @return void - */ - public function optout() { - update_option( $this->client->slug . '_allow_tracking', 'no' ); - update_option( $this->client->slug . '_tracking_notice', 'hide' ); - - $this->send_tracking_skipped_request(); - - $this->clear_schedule_event(); - } - - /** - * Get the number of post counts - * - * @param string $post_type - * - * @return integer - */ - public function get_post_count( $post_type ) { - global $wpdb; - - return (int) $wpdb->get_var( "SELECT count(ID) FROM $wpdb->posts WHERE post_type = '$post_type' and post_status = 'publish'"); - } - - /** - * Get server related info. - * - * @return array - */ - private static function get_server_info() { - global $wpdb; - - $server_data = array(); - - if ( isset( $_SERVER['SERVER_SOFTWARE'] ) && ! empty( $_SERVER['SERVER_SOFTWARE'] ) ) { - $server_data['software'] = $_SERVER['SERVER_SOFTWARE']; - } - - if ( function_exists( 'phpversion' ) ) { - $server_data['php_version'] = phpversion(); - } - - $server_data['mysql_version'] = $wpdb->db_version(); - - $server_data['php_max_upload_size'] = size_format( wp_max_upload_size() ); - $server_data['php_default_timezone'] = date_default_timezone_get(); - $server_data['php_soap'] = class_exists( 'SoapClient' ) ? 'Yes' : 'No'; - $server_data['php_fsockopen'] = function_exists( 'fsockopen' ) ? 'Yes' : 'No'; - $server_data['php_curl'] = function_exists( 'curl_init' ) ? 'Yes' : 'No'; - - return $server_data; - } - - /** - * Get WordPress related data. - * - * @return array - */ - private function get_wp_info() { - $wp_data = array(); - - $wp_data['memory_limit'] = WP_MEMORY_LIMIT; - $wp_data['debug_mode'] = ( defined('WP_DEBUG') && WP_DEBUG ) ? 'Yes' : 'No'; - $wp_data['locale'] = get_locale(); - $wp_data['version'] = get_bloginfo( 'version' ); - $wp_data['multisite'] = is_multisite() ? 'Yes' : 'No'; - $wp_data['theme_slug'] = get_stylesheet(); - - $theme = wp_get_theme( $wp_data['theme_slug'] ); - - $wp_data['theme_name'] = $theme->get( 'Name' ); - $wp_data['theme_version'] = $theme->get( 'Version' ); - $wp_data['theme_uri'] = $theme->get( 'ThemeURI' ); - $wp_data['theme_author'] = $theme->get( 'Author' ); - - return $wp_data; - } - - /** - * Get the list of active and inactive plugins - * - * @return array - */ - private function get_all_plugins() { - // Ensure get_plugins function is loaded - if ( ! function_exists( 'get_plugins' ) ) { - include ABSPATH . '/wp-admin/includes/plugin.php'; - } - - $plugins = get_plugins(); - $active_plugins_keys = get_option( 'active_plugins', array() ); - $active_plugins = array(); - - foreach ( $plugins as $k => $v ) { - // Take care of formatting the data how we want it. - $formatted = array(); - $formatted['name'] = strip_tags( $v['Name'] ); - - if ( isset( $v['Version'] ) ) { - $formatted['version'] = strip_tags( $v['Version'] ); - } - - if ( isset( $v['Author'] ) ) { - $formatted['author'] = strip_tags( $v['Author'] ); - } - - if ( isset( $v['Network'] ) ) { - $formatted['network'] = strip_tags( $v['Network'] ); - } - - if ( isset( $v['PluginURI'] ) ) { - $formatted['plugin_uri'] = strip_tags( $v['PluginURI'] ); - } - - if ( in_array( $k, $active_plugins_keys ) ) { - // Remove active plugins from list so we can show active and inactive separately - unset( $plugins[$k] ); - $active_plugins[$k] = $formatted; - } else { - $plugins[$k] = $formatted; - } - } - - return array( 'active_plugins' => $active_plugins, 'inactive_plugins' => $plugins ); - } - - /** - * Get user totals based on user role. - * - * @return array - */ - public function get_user_counts() { - $user_count = array(); - $user_count_data = count_users(); - $user_count['total'] = $user_count_data['total_users']; - - // Get user count based on user role - foreach ( $user_count_data['avail_roles'] as $role => $count ) { - if ( ! $count ) { - continue; - } - - $user_count[ $role ] = $count; - } - - return $user_count; - } - - /** - * Add weekly cron schedule - * - * @param array $schedules - * - * @return array - */ - public function add_weekly_schedule( $schedules ) { - - $schedules['weekly'] = array( - 'interval' => DAY_IN_SECONDS * 7, - 'display' => 'Once Weekly', - ); - - return $schedules; - } - - /** - * Plugin activation hook - * - * @return void - */ - public function activate_plugin() { - $allowed = get_option( $this->client->slug . '_allow_tracking', 'no' ); - - // if it wasn't allowed before, do nothing - if ( 'yes' !== $allowed ) { - return; - } - - // re-schedule and delete the last sent time so we could force send again - $hook_name = $this->client->slug . '_tracker_send_event'; - if ( ! wp_next_scheduled( $hook_name ) ) { - wp_schedule_event( time(), 'weekly', $hook_name ); - } - - delete_option( $this->client->slug . '_tracking_last_send' ); - - $this->send_tracking_data( true ); - } - - /** - * Clear our options upon deactivation - * - * @return void - */ - public function deactivation_cleanup() { - $this->clear_schedule_event(); - - if ( 'theme' == $this->client->type ) { - delete_option( $this->client->slug . '_tracking_last_send' ); - delete_option( $this->client->slug . '_allow_tracking' ); - } - - delete_option( $this->client->slug . '_tracking_notice' ); - } - - /** - * Hook into action links and modify the deactivate link - * - * @param array $links - * - * @return array - */ - public function plugin_action_links( $links ) { - - if ( array_key_exists( 'deactivate', $links ) ) { - $links['deactivate'] = str_replace( ' 'could-not-understand', - 'text' => $this->client->__trans( "Couldn't understand" ), - 'placeholder' => $this->client->__trans( 'Would you like us to assist you?' ), - 'icon' => '' - ), - array( - 'id' => 'found-better-plugin', - 'text' => $this->client->__trans( 'Found a better plugin' ), - 'placeholder' => $this->client->__trans( 'Which plugin?' ), - 'icon' => '', - ), - array( - 'id' => 'not-have-that-feature', - 'text' => $this->client->__trans( "Missing a specific feature" ), - 'placeholder' => $this->client->__trans( 'Could you tell us more about that feature?' ), - 'icon' => '', - ), - array( - 'id' => 'is-not-working', - 'text' => $this->client->__trans( 'Not working' ), - 'placeholder' => $this->client->__trans( 'Could you tell us a bit more whats not working?' ), - 'icon' => '', - ), - array( - 'id' => 'looking-for-other', - 'text' => $this->client->__trans( "Not what I was looking" ), - 'placeholder' => $this->client->__trans( 'Could you tell us a bit more?' ), - 'icon' => '', - ), - array( - 'id' => 'did-not-work-as-expected', - 'text' => $this->client->__trans( "Didn't work as expected" ), - 'placeholder' => $this->client->__trans( 'What did you expect?' ), - 'icon' => '', - ), - array( - 'id' => 'other', - 'text' => $this->client->__trans( 'Others' ), - 'placeholder' => $this->client->__trans( 'Could you tell us a bit more?' ), - 'icon' => '', - ), - ); - - return $reasons; - } - - /** - * Plugin deactivation uninstall reason submission - * - * @return void - */ - public function uninstall_reason_submission() { - - if ( ! isset( $_POST['reason_id'] ) ) { - wp_send_json_error(); - } - - if ( ! wp_verify_nonce( $_POST['nonce'], 'appsero-security-nonce' ) ) { - wp_send_json_error( 'Nonce verification failed' ); - } - - $data = $this->get_tracking_data(); - $data['reason_id'] = sanitize_text_field( $_POST['reason_id'] ); - $data['reason_info'] = isset( $_REQUEST['reason_info'] ) ? trim( stripslashes( $_REQUEST['reason_info'] ) ) : ''; - - $this->client->send_request( $data, 'deactivate' ); - - wp_send_json_success(); - } - - /** - * Handle the plugin deactivation feedback - * - * @return void - */ - public function deactivate_scripts() { - global $pagenow; - - if ( 'plugins.php' != $pagenow ) { - return; - } - - $this->deactivation_modal_styles(); - $reasons = $this->get_uninstall_reasons(); - $custom_reasons = apply_filters( 'appsero_custom_deactivation_reasons', array() ); - ?> - -
-
-
-

client->_etrans( 'Goodbyes are always hard. If you have a moment, please let us know how we can improve.' ); ?>

-
- -
-
    - -
  • - -
  • - -
- -
    - -
  • - -
  • - -
- -
-

- client->__trans( 'We share your data with Appsero to troubleshoot problems & make product improvements. Learn more about how Appsero handles your data.'), - esc_url( 'https://appsero.com/' ), - esc_url( 'https://appsero.com/privacy-policy' ) - ); - ?> -

-
- - -
-
- - - - get_template() == $this->client->slug ) { - $this->client->send_request( $this->get_tracking_data(), 'deactivate' ); - } - } - - /** - * Get user IP Address - */ - private function get_user_ip_address() { - $response = wp_remote_get( 'https://icanhazip.com/' ); - - if ( is_wp_error( $response ) ) { - return ''; - } - - $ip = trim( wp_remote_retrieve_body( $response ) ); - - if ( ! filter_var( $ip, FILTER_VALIDATE_IP ) ) { - return ''; - } - - return $ip; - } - - /** - * Get site name - */ - private function get_site_name() { - $site_name = get_bloginfo( 'name' ); - - if ( empty( $site_name ) ) { - $site_name = get_bloginfo( 'description' ); - $site_name = wp_trim_words( $site_name, 3, '' ); - } - - if ( empty( $site_name ) ) { - $site_name = esc_url( home_url() ); - } - - return $site_name; - } - - /** - * Send request to appsero if user skip to send tracking data - */ - private function send_tracking_skipped_request() { - $skipped = get_option( $this->client->slug . '_tracking_skipped' ); - - $data = array( - 'hash' => $this->client->hash, - 'previously_skipped' => false, - ); - - if ( $skipped === 'yes' ) { - $data['previously_skipped'] = true; - } else { - update_option( $this->client->slug . '_tracking_skipped', 'yes' ); - } - - $this->client->send_request( $data, 'tracking-skipped' ); - } - - /** - * Deactivation modal styles - */ - private function deactivation_modal_styles() { - ?> - - client = $client; - - $this->option_key = 'appsero_' . md5( $this->client->slug ) . '_manage_license'; - - $this->schedule_hook = $this->client->slug . '_license_check_event'; - - // Creating WP Ajax Endpoint to refresh license remotely - add_action( "wp_ajax_appsero_refresh_license_" . $this->client->hash, array( $this, 'refresh_license_api' ) ); - - // Run hook to check license status daily - add_action( $this->schedule_hook, array( $this, 'check_license_status' ) ); - - // Active/Deactive corn schedule - $this->run_schedule(); - } - - /** - * Set the license option key. - * - * If someone wants to override the default generated key. - * - * @param string $key - * - * @since 1.3.0 - * - * @return License - */ - public function set_option_key( $key ) { - $this->option_key = $key; - - return $this; - } - - /** - * Get the license key - * - * @since 1.3.0 - * - * @return string|null - */ - public function get_license() { - return get_option( $this->option_key, null ); - } - - /** - * Check license - * - * @return bool - */ - public function check( $license_key ) { - $route = 'public/license/' . $this->client->hash . '/check'; - - return $this->send_request( $license_key, $route ); - } - - /** - * Active a license - * - * @return bool - */ - public function activate( $license_key ) { - $route = 'public/license/' . $this->client->hash . '/activate'; - - return $this->send_request( $license_key, $route ); - } - - /** - * Deactivate a license - * - * @return bool - */ - public function deactivate( $license_key ) { - $route = 'public/license/' . $this->client->hash . '/deactivate'; - - return $this->send_request( $license_key, $route ); - } - - /** - * Send common request - * - * @param $license_key - * @param $route - * - * @return array - */ - protected function send_request( $license_key, $route ) { - $params = array( - 'license_key' => $license_key, - 'url' => esc_url( home_url() ), - 'is_local' => $this->client->is_local_server(), - ); - - $response = $this->client->send_request( $params, $route, true ); - - if ( is_wp_error( $response ) ) { - return array( - 'success' => false, - 'error' => $response->get_error_message() - ); - } - - $response = json_decode( wp_remote_retrieve_body( $response ), true ); - - if ( empty( $response ) || isset( $response['exception'] )) { - return array( - 'success' => false, - 'error' => $this->client->__trans( 'Unknown error occurred, Please try again.' ), - ); - } - - if ( isset( $response['errors'] ) && isset( $response['errors']['license_key'] ) ) { - $response = array( - 'success' => false, - 'error' => $response['errors']['license_key'][0] - ); - } - - return $response; - } - - /** - * License Refresh Endpoint - */ - public function refresh_license_api() { - $this->check_license_status(); - - return wp_send_json( - array( - 'message' => 'License refreshed successfully.' - ), - 200 - ); - } - - /** - * Add settings page for license - * - * @param array $args - * - * @return void - */ - public function add_settings_page( $args = array() ) { - $defaults = array( - 'type' => 'menu', // Can be: menu, options, submenu - 'page_title' => 'Manage License', - 'menu_title' => 'Manage License', - 'capability' => 'manage_options', - 'menu_slug' => $this->client->slug . '-manage-license', - 'icon_url' => '', - 'position' => null, - 'parent_slug' => '', - ); - - $this->menu_args = wp_parse_args( $args, $defaults ); - - add_action( 'admin_menu', array( $this, 'admin_menu' ), 99 ); - } - - /** - * Admin Menu hook - * - * @return void - */ - public function admin_menu() { - switch ( $this->menu_args['type'] ) { - case 'menu': - $this->create_menu_page(); - break; - - case 'submenu': - $this->create_submenu_page(); - break; - - case 'options': - $this->create_options_page(); - break; - } - } - - /** - * License menu output - */ - public function menu_output() { - if ( isset( $_POST['submit'] ) ) { - $this->license_form_submit( $_POST ); - } - - $license = $this->get_license(); - $action = ( $license && isset( $license['status'] ) && 'activate' == $license['status'] ) ? 'deactive' : 'active'; - $this->licenses_style(); - ?> - -
-

License Settings

- - show_license_page_notices(); - do_action( 'before_appsero_license_section' ); - ?> - -
- show_license_page_card_header( $license ); ?> - -
-

- client->__trans( 'Activate %s by your license key to get professional support and automatic update from your WordPress dashboard.' ), $this->client->name ); ?> -

-
- - -
-
- - - - - /> -
- -
-
- - show_active_license_info( $license ); - } ?> -
-
- - -
- error = $this->client->__trans( 'Please add all information' ); - - return; - } - - if ( ! wp_verify_nonce( $form['_nonce'], $this->client->name ) ) { - $this->error = $this->client->__trans( "You don't have permission to manage license." ); - - return; - } - - switch ( $form['_action'] ) { - case 'active': - $this->active_client_license( $form ); - break; - - case 'deactive': - $this->deactive_client_license( $form ); - break; - - case 'refresh': - $this->refresh_client_license( $form ); - break; - } - } - - /** - * Check license status on schedule - */ - public function check_license_status() { - $license = $this->get_license(); - - if ( isset( $license['key'] ) && ! empty( $license['key'] ) ) { - $response = $this->check( $license['key'] ); - - if ( isset( $response['success'] ) && $response['success'] ) { - $license['status'] = 'activate'; - $license['remaining'] = $response['remaining']; - $license['activation_limit'] = $response['activation_limit']; - $license['expiry_days'] = $response['expiry_days']; - $license['title'] = $response['title']; - $license['source_id'] = $response['source_identifier']; - $license['recurring'] = $response['recurring']; - } else { - $license['status'] = 'deactivate'; - $license['expiry_days'] = 0; - } - - update_option( $this->option_key, $license, false ); - } - } - - /** - * Check this is a valid license - */ - public function is_valid() { - if ( null !== $this->is_valid_licnese ) { - return $this->is_valid_licnese; - } - - $license = $this->get_license(); - - if ( ! empty( $license['key'] ) && isset( $license['status'] ) && $license['status'] == 'activate' ) { - $this->is_valid_licnese = true; - } else { - $this->is_valid_licnese = false; - } - - return $this->is_valid_licnese; - } - - /** - * Check this is a valid license - */ - public function is_valid_by( $option, $value ) { - $license = $this->get_license(); - - if ( ! empty( $license['key'] ) && isset( $license['status'] ) && $license['status'] == 'activate' ) { - if ( isset( $license[ $option ] ) && $license[ $option ] == $value ) { - return true; - } - } - - return false; - } - - /** - * Styles for licenses page - */ - private function licenses_style() { - ?> - - -
-
-

client->_etrans( 'Activations Remaining' ); ?>

- -

client->_etrans( 'Unlimited' ); ?>

- -

- client->__trans( '%1$d out of %2$d' ), $license['remaining'], $license['activation_limit'] ); ?> -

- -
-
-

client->_etrans( 'Expires in' ); ?>

- 21 ? '' : 'occupied'; - echo '

' . $license['expiry_days'] . ' days

'; - } else { - echo '

' . $this->client->__trans( 'Never' ) . '

'; - } ?> -
-
- error ) ) { - ?> -
-

error; ?>

-
- success ) ) { - ?> -
-

success; ?>

-
- '; - } - - /** - * Card header - */ - private function show_license_page_card_header( $license ) { - ?> -
- - - - - - client->__trans( 'Activate License' ); ?> - - -
- - - -
- - -
- error = $this->client->__trans( 'The license key field is required.' ); - - return; - } - - $license_key = sanitize_text_field( $form['license_key'] ); - $response = $this->activate( $license_key ); - - if ( ! $response['success'] ) { - $this->error = $response['error'] ? $response['error'] : $this->client->__trans( 'Unknown error occurred.' ); - - return; - } - - $data = array( - 'key' => $license_key, - 'status' => 'activate', - 'remaining' => $response['remaining'], - 'activation_limit' => $response['activation_limit'], - 'expiry_days' => $response['expiry_days'], - 'title' => $response['title'], - 'source_id' => $response['source_identifier'], - 'recurring' => $response['recurring'], - ); - - update_option( $this->option_key, $data, false ); - - $this->success = $this->client->__trans( 'License activated successfully.' ); - } - - /** - * Deactive client license - */ - private function deactive_client_license( $form ) { - $license = $this->get_license(); - - if ( empty( $license['key'] ) ) { - $this->error = $this->client->__trans( 'License key not found.' ); - - return; - } - - $response = $this->deactivate( $license['key'] ); - - $data = array( - 'key' => '', - 'status' => 'deactivate', - ); - - update_option( $this->option_key, $data, false ); - - if ( ! $response['success'] ) { - $this->error = $response['error'] ? $response['error'] : $this->client->__trans( 'Unknown error occurred.' ); - - return; - } - - $this->success = $this->client->__trans( 'License deactivated successfully.' ); - } - - /** - * Refresh Client License - */ - private function refresh_client_license( $form = null ) { - $license = $this->get_license(); - - if( !$license || ! isset( $license['key'] ) || empty( $license['key'] ) ) { - $this->error = $this->client->__trans( "License key not found" ); - return; - } - - $this->check_license_status(); - - $this->success = $this->client->__trans( 'License refreshed successfully.' ); - } - - /** - * Add license menu page - */ - private function create_menu_page() { - call_user_func( - 'add_' . 'menu' . '_page', - $this->menu_args['page_title'], - $this->menu_args['menu_title'], - $this->menu_args['capability'], - $this->menu_args['menu_slug'], - array( $this, 'menu_output' ), - $this->menu_args['icon_url'], - $this->menu_args['position'] - ); - } - - /** - * Add submenu page - */ - private function create_submenu_page() { - call_user_func( - 'add_' . 'submenu' . '_page', - $this->menu_args['parent_slug'], - $this->menu_args['page_title'], - $this->menu_args['menu_title'], - $this->menu_args['capability'], - $this->menu_args['menu_slug'], - array( $this, 'menu_output' ), - $this->menu_args['position'] - ); - } - - /** - * Add submenu page - */ - private function create_options_page() { - call_user_func( - 'add_' . 'options' . '_page', - $this->menu_args['page_title'], - $this->menu_args['menu_title'], - $this->menu_args['capability'], - $this->menu_args['menu_slug'], - array( $this, 'menu_output' ), - $this->menu_args['position'] - ); - } - - /** - * Schedule daily sicense checker event - */ - public function schedule_cron_event() { - if ( ! wp_next_scheduled( $this->schedule_hook ) ) { - wp_schedule_event( time(), 'daily', $this->schedule_hook ); - - wp_schedule_single_event( time() + 20, $this->schedule_hook ); - } - } - - /** - * Clear any scheduled hook - */ - public function clear_scheduler() { - wp_clear_scheduled_hook( $this->schedule_hook ); - } - - /** - * Enable/Disable schedule - */ - private function run_schedule() { - switch ( $this->client->type ) { - case 'plugin': - register_activation_hook( $this->client->file, array( $this, 'schedule_cron_event' ) ); - register_deactivation_hook( $this->client->file, array( $this, 'clear_scheduler' ) ); - break; - - case 'theme': - add_action( 'after_switch_theme', array( $this, 'schedule_cron_event' ) ); - add_action( 'switch_theme', array( $this, 'clear_scheduler' ) ); - break; - } - } - - /** - * Form action URL - */ - private function form_action_url() { - $url = add_query_arg( - $_GET, - admin_url( basename( $_SERVER['SCRIPT_NAME'] ) ) - ); - - echo apply_filters( 'appsero_client_license_form_action', $url ); - } - - /** - * Get input license key - * - * @param $action - * - * @return $license - */ - private function get_input_license_value( $action, $license ) { - if ( 'active' == $action ) { - return isset( $license['key'] ) ? $license['key'] : ''; - } - - if ( 'deactive' == $action ) { - $key_length = strlen( $license['key'] ); - - return str_pad( - substr( $license['key'], 0, $key_length / 2 ), $key_length, '*' - ); - } - - return ''; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Updater.php b/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Updater.php deleted file mode 100644 index 33b1cef3..00000000 --- a/lib/wp-graphql-1.17.0/vendor/appsero/client/src/Updater.php +++ /dev/null @@ -1,258 +0,0 @@ -client = $client; - $this->cache_key = 'appsero_' . md5( $this->client->slug ) . '_version_info'; - - // Run hooks. - if ( $this->client->type == 'plugin' ) { - $this->run_plugin_hooks(); - } elseif ( $this->client->type == 'theme' ) { - $this->run_theme_hooks(); - } - } - - /** - * Set up WordPress filter to hooks to get update. - * - * @return void - */ - public function run_plugin_hooks() { - add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'check_plugin_update' ) ); - add_filter( 'plugins_api', array( $this, 'plugins_api_filter' ), 10, 3 ); - } - - /** - * Set up WordPress filter to hooks to get update. - * - * @return void - */ - public function run_theme_hooks() { - add_filter( 'pre_set_site_transient_update_themes', array( $this, 'check_theme_update' ) ); - } - - /** - * Check for Update for this specific project - */ - public function check_plugin_update( $transient_data ) { - global $pagenow; - - if ( ! is_object( $transient_data ) ) { - $transient_data = new \stdClass; - } - - if ( 'plugins.php' == $pagenow && is_multisite() ) { - return $transient_data; - } - - if ( ! empty( $transient_data->response ) && ! empty( $transient_data->response[ $this->client->basename ] ) ) { - return $transient_data; - } - - $version_info = $this->get_version_info(); - - if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) { - - unset( $version_info->sections ); - - // If new version available then set to `response` - if ( version_compare( $this->client->project_version, $version_info->new_version, '<' ) ) { - $transient_data->response[ $this->client->basename ] = $version_info; - } else { - // If new version is not available then set to `no_update` - $transient_data->no_update[ $this->client->basename ] = $version_info; - } - - $transient_data->last_checked = time(); - $transient_data->checked[ $this->client->basename ] = $this->client->project_version; - } - - return $transient_data; - } - - /** - * Get version info from database - * - * @return Object or Boolean - */ - private function get_cached_version_info() { - global $pagenow; - - // If updater page then fetch from API now - if ( 'update-core.php' == $pagenow ) { - return false; // Force to fetch data - } - - $value = get_transient( $this->cache_key ); - - if( ! $value && ! isset( $value->name ) ) { - return false; // Cache is expired - } - - // We need to turn the icons into an array - if ( isset( $value->icons ) ) { - $value->icons = (array) $value->icons; - } - - // We need to turn the banners into an array - if ( isset( $value->banners ) ) { - $value->banners = (array) $value->banners; - } - - if ( isset( $value->sections ) ) { - $value->sections = (array) $value->sections; - } - - return $value; - } - - /** - * Set version info to database - */ - private function set_cached_version_info( $value ) { - if ( ! $value ) { - return; - } - - set_transient( $this->cache_key, $value, 3 * HOUR_IN_SECONDS ); - } - - /** - * Get plugin info from Appsero - */ - private function get_project_latest_version() { - - $license = $this->client->license()->get_license(); - - $params = array( - 'version' => $this->client->project_version, - 'name' => $this->client->name, - 'slug' => $this->client->slug, - 'basename' => $this->client->basename, - 'license_key' => ! empty( $license ) && isset( $license['key'] ) ? $license['key'] : '', - ); - - $route = 'update/' . $this->client->hash . '/check'; - - $response = $this->client->send_request( $params, $route, true ); - - if ( is_wp_error( $response ) ) { - return false; - } - - $response = json_decode( wp_remote_retrieve_body( $response ) ); - - if ( ! isset( $response->slug ) ) { - return false; - } - - if ( isset( $response->icons ) ) { - $response->icons = (array) $response->icons; - } - - if ( isset( $response->banners ) ) { - $response->banners = (array) $response->banners; - } - - if ( isset( $response->sections ) ) { - $response->sections = (array) $response->sections; - } - - return $response; - } - - /** - * Updates information on the "View version x.x details" page with custom data. - * - * @param mixed $data - * @param string $action - * @param object $args - * - * @return object $data - */ - public function plugins_api_filter( $data, $action = '', $args = null ) { - - if ( $action != 'plugin_information' ) { - return $data; - } - - if ( ! isset( $args->slug ) || ( $args->slug != $this->client->slug ) ) { - return $data; - } - - return $this->get_version_info(); - } - - /** - * Check theme upate - */ - public function check_theme_update( $transient_data ) { - global $pagenow; - - if ( ! is_object( $transient_data ) ) { - $transient_data = new \stdClass; - } - - if ( 'themes.php' == $pagenow && is_multisite() ) { - return $transient_data; - } - - if ( ! empty( $transient_data->response ) && ! empty( $transient_data->response[ $this->client->slug ] ) ) { - return $transient_data; - } - - $version_info = $this->get_version_info(); - - if ( false !== $version_info && is_object( $version_info ) && isset( $version_info->new_version ) ) { - - // If new version available then set to `response` - if ( version_compare( $this->client->project_version, $version_info->new_version, '<' ) ) { - $transient_data->response[ $this->client->slug ] = (array) $version_info; - } else { - // If new version is not available then set to `no_update` - $transient_data->no_update[ $this->client->slug ] = (array) $version_info; - } - - $transient_data->last_checked = time(); - $transient_data->checked[ $this->client->slug ] = $this->client->project_version; - } - - return $transient_data; - } - - /** - * Get version information - */ - private function get_version_info() { - $version_info = $this->get_cached_version_info(); - - if ( false === $version_info ) { - $version_info = $this->get_project_latest_version(); - $this->set_cached_version_info( $version_info ); - } - - return $version_info; - } - -} diff --git a/lib/wp-graphql-1.17.0/vendor/autoload.php b/lib/wp-graphql-1.17.0/vendor/autoload.php deleted file mode 100644 index 6446f328..00000000 --- a/lib/wp-graphql-1.17.0/vendor/autoload.php +++ /dev/null @@ -1,25 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - /** @var \Closure(string):void */ - private static $includeFile; - - /** @var string|null */ - private $vendorDir; - - // PSR-4 - /** - * @var array> - */ - private $prefixLengthsPsr4 = array(); - /** - * @var array> - */ - private $prefixDirsPsr4 = array(); - /** - * @var list - */ - private $fallbackDirsPsr4 = array(); - - // PSR-0 - /** - * List of PSR-0 prefixes - * - * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) - * - * @var array>> - */ - private $prefixesPsr0 = array(); - /** - * @var list - */ - private $fallbackDirsPsr0 = array(); - - /** @var bool */ - private $useIncludePath = false; - - /** - * @var array - */ - private $classMap = array(); - - /** @var bool */ - private $classMapAuthoritative = false; - - /** - * @var array - */ - private $missingClasses = array(); - - /** @var string|null */ - private $apcuPrefix; - - /** - * @var array - */ - private static $registeredLoaders = array(); - - /** - * @param string|null $vendorDir - */ - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - self::initializeIncludeClosure(); - } - - /** - * @return array> - */ - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - /** - * @return array> - */ - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - /** - * @return list - */ - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - /** - * @return list - */ - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - /** - * @return array Array of classname => path - */ - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - * - * @return void - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - * - * @return void - */ - public function add($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - $paths = (array) $paths; - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param list|string $paths The PSR-0 base directories - * - * @return void - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param list|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - * - * @return void - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - * - * @return void - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - * - * @return void - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - * - * @return void - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - * - * @return void - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - * - * @return void - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - $includeFile = self::$includeFile; - $includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders keyed by their corresponding vendor directories. - * - * @return array - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - /** - * @param string $class - * @param string $ext - * @return string|false - */ - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } - - /** - * @return void - */ - private static function initializeIncludeClosure() - { - if (self::$includeFile !== null) { - return; - } - - /** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - */ - self::$includeFile = \Closure::bind(static function($file) { - include $file; - }, null, null); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/InstalledVersions.php b/lib/wp-graphql-1.17.0/vendor/composer/InstalledVersions.php deleted file mode 100644 index 51e734a7..00000000 --- a/lib/wp-graphql-1.17.0/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,359 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require its presence, you can require `composer-runtime-api ^2.0` - * - * @final - */ -class InstalledVersions -{ - /** - * @var mixed[]|null - * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null - */ - private static $installed; - - /** - * @var bool|null - */ - private static $canGetVendors; - - /** - * @var array[] - * @psalm-var array}> - */ - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints((string) $constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. - * @return array[] - * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require $vendorDir.'/composer/installed.php'; - $installed[] = self::$installedByVendor[$vendorDir] = $required; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ - $required = require __DIR__ . '/installed.php'; - self::$installed = $required; - } else { - self::$installed = array(); - } - } - - if (self::$installed !== array()) { - $installed[] = self::$installed; - } - - return $installed; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/LICENSE b/lib/wp-graphql-1.17.0/vendor/composer/LICENSE deleted file mode 100644 index f27399a0..00000000 --- a/lib/wp-graphql-1.17.0/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/lib/wp-graphql-1.17.0/vendor/composer/autoload_classmap.php b/lib/wp-graphql-1.17.0/vendor/composer/autoload_classmap.php deleted file mode 100644 index 68444926..00000000 --- a/lib/wp-graphql-1.17.0/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,420 +0,0 @@ - $vendorDir . '/appsero/client/src/Client.php', - 'Appsero\\Insights' => $vendorDir . '/appsero/client/src/Insights.php', - 'Appsero\\License' => $vendorDir . '/appsero/client/src/License.php', - 'Appsero\\Updater' => $vendorDir . '/appsero/client/src/Updater.php', - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'GraphQLRelay\\Connection\\ArrayConnection' => $vendorDir . '/ivome/graphql-relay-php/src/Connection/ArrayConnection.php', - 'GraphQLRelay\\Connection\\Connection' => $vendorDir . '/ivome/graphql-relay-php/src/Connection/Connection.php', - 'GraphQLRelay\\Mutation\\Mutation' => $vendorDir . '/ivome/graphql-relay-php/src/Mutation/Mutation.php', - 'GraphQLRelay\\Node\\Node' => $vendorDir . '/ivome/graphql-relay-php/src/Node/Node.php', - 'GraphQLRelay\\Node\\Plural' => $vendorDir . '/ivome/graphql-relay-php/src/Node/Plural.php', - 'GraphQLRelay\\Relay' => $vendorDir . '/ivome/graphql-relay-php/src/Relay.php', - 'GraphQL\\Deferred' => $vendorDir . '/webonyx/graphql-php/src/Deferred.php', - 'GraphQL\\Error\\ClientAware' => $vendorDir . '/webonyx/graphql-php/src/Error/ClientAware.php', - 'GraphQL\\Error\\DebugFlag' => $vendorDir . '/webonyx/graphql-php/src/Error/DebugFlag.php', - 'GraphQL\\Error\\Error' => $vendorDir . '/webonyx/graphql-php/src/Error/Error.php', - 'GraphQL\\Error\\FormattedError' => $vendorDir . '/webonyx/graphql-php/src/Error/FormattedError.php', - 'GraphQL\\Error\\InvariantViolation' => $vendorDir . '/webonyx/graphql-php/src/Error/InvariantViolation.php', - 'GraphQL\\Error\\SyntaxError' => $vendorDir . '/webonyx/graphql-php/src/Error/SyntaxError.php', - 'GraphQL\\Error\\UserError' => $vendorDir . '/webonyx/graphql-php/src/Error/UserError.php', - 'GraphQL\\Error\\Warning' => $vendorDir . '/webonyx/graphql-php/src/Error/Warning.php', - 'GraphQL\\Exception\\InvalidArgument' => $vendorDir . '/webonyx/graphql-php/src/Exception/InvalidArgument.php', - 'GraphQL\\Executor\\ExecutionContext' => $vendorDir . '/webonyx/graphql-php/src/Executor/ExecutionContext.php', - 'GraphQL\\Executor\\ExecutionResult' => $vendorDir . '/webonyx/graphql-php/src/Executor/ExecutionResult.php', - 'GraphQL\\Executor\\Executor' => $vendorDir . '/webonyx/graphql-php/src/Executor/Executor.php', - 'GraphQL\\Executor\\ExecutorImplementation' => $vendorDir . '/webonyx/graphql-php/src/Executor/ExecutorImplementation.php', - 'GraphQL\\Executor\\Promise\\Adapter\\AmpPromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/AmpPromiseAdapter.php', - 'GraphQL\\Executor\\Promise\\Adapter\\ReactPromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php', - 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromise' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php', - 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php', - 'GraphQL\\Executor\\Promise\\Promise' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/Promise.php', - 'GraphQL\\Executor\\Promise\\PromiseAdapter' => $vendorDir . '/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php', - 'GraphQL\\Executor\\ReferenceExecutor' => $vendorDir . '/webonyx/graphql-php/src/Executor/ReferenceExecutor.php', - 'GraphQL\\Executor\\Values' => $vendorDir . '/webonyx/graphql-php/src/Executor/Values.php', - 'GraphQL\\Experimental\\Executor\\Collector' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/Collector.php', - 'GraphQL\\Experimental\\Executor\\CoroutineContext' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php', - 'GraphQL\\Experimental\\Executor\\CoroutineContextShared' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php', - 'GraphQL\\Experimental\\Executor\\CoroutineExecutor' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php', - 'GraphQL\\Experimental\\Executor\\Runtime' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/Runtime.php', - 'GraphQL\\Experimental\\Executor\\Strand' => $vendorDir . '/webonyx/graphql-php/src/Experimental/Executor/Strand.php', - 'GraphQL\\GraphQL' => $vendorDir . '/webonyx/graphql-php/src/GraphQL.php', - 'GraphQL\\Language\\AST\\ArgumentNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ArgumentNode.php', - 'GraphQL\\Language\\AST\\BooleanValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/BooleanValueNode.php', - 'GraphQL\\Language\\AST\\DefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DefinitionNode.php', - 'GraphQL\\Language\\AST\\DirectiveDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DirectiveDefinitionNode.php', - 'GraphQL\\Language\\AST\\DirectiveNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DirectiveNode.php', - 'GraphQL\\Language\\AST\\DocumentNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/DocumentNode.php', - 'GraphQL\\Language\\AST\\EnumTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\EnumTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\EnumValueDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php', - 'GraphQL\\Language\\AST\\EnumValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/EnumValueNode.php', - 'GraphQL\\Language\\AST\\ExecutableDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ExecutableDefinitionNode.php', - 'GraphQL\\Language\\AST\\FieldDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FieldDefinitionNode.php', - 'GraphQL\\Language\\AST\\FieldNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FieldNode.php', - 'GraphQL\\Language\\AST\\FloatValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FloatValueNode.php', - 'GraphQL\\Language\\AST\\FragmentDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FragmentDefinitionNode.php', - 'GraphQL\\Language\\AST\\FragmentSpreadNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php', - 'GraphQL\\Language\\AST\\HasSelectionSet' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php', - 'GraphQL\\Language\\AST\\InlineFragmentNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InlineFragmentNode.php', - 'GraphQL\\Language\\AST\\InputObjectTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\InputObjectTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\InputValueDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php', - 'GraphQL\\Language\\AST\\IntValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/IntValueNode.php', - 'GraphQL\\Language\\AST\\InterfaceTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\InterfaceTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\ListTypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ListTypeNode.php', - 'GraphQL\\Language\\AST\\ListValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ListValueNode.php', - 'GraphQL\\Language\\AST\\Location' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/Location.php', - 'GraphQL\\Language\\AST\\NameNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NameNode.php', - 'GraphQL\\Language\\AST\\NamedTypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NamedTypeNode.php', - 'GraphQL\\Language\\AST\\Node' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/Node.php', - 'GraphQL\\Language\\AST\\NodeKind' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NodeKind.php', - 'GraphQL\\Language\\AST\\NodeList' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NodeList.php', - 'GraphQL\\Language\\AST\\NonNullTypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php', - 'GraphQL\\Language\\AST\\NullValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/NullValueNode.php', - 'GraphQL\\Language\\AST\\ObjectFieldNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectFieldNode.php', - 'GraphQL\\Language\\AST\\ObjectTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\ObjectTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\ObjectValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php', - 'GraphQL\\Language\\AST\\OperationDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php', - 'GraphQL\\Language\\AST\\OperationTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\ScalarTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ScalarTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\ScalarTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\SchemaDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php', - 'GraphQL\\Language\\AST\\SchemaTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\SelectionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SelectionNode.php', - 'GraphQL\\Language\\AST\\SelectionSetNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/SelectionSetNode.php', - 'GraphQL\\Language\\AST\\StringValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/StringValueNode.php', - 'GraphQL\\Language\\AST\\TypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\TypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeExtensionNode.php', - 'GraphQL\\Language\\AST\\TypeNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeNode.php', - 'GraphQL\\Language\\AST\\TypeSystemDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/TypeSystemDefinitionNode.php', - 'GraphQL\\Language\\AST\\UnionTypeDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/UnionTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\UnionTypeExtensionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\ValueNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/ValueNode.php', - 'GraphQL\\Language\\AST\\VariableDefinitionNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/VariableDefinitionNode.php', - 'GraphQL\\Language\\AST\\VariableNode' => $vendorDir . '/webonyx/graphql-php/src/Language/AST/VariableNode.php', - 'GraphQL\\Language\\DirectiveLocation' => $vendorDir . '/webonyx/graphql-php/src/Language/DirectiveLocation.php', - 'GraphQL\\Language\\Lexer' => $vendorDir . '/webonyx/graphql-php/src/Language/Lexer.php', - 'GraphQL\\Language\\Parser' => $vendorDir . '/webonyx/graphql-php/src/Language/Parser.php', - 'GraphQL\\Language\\Printer' => $vendorDir . '/webonyx/graphql-php/src/Language/Printer.php', - 'GraphQL\\Language\\Source' => $vendorDir . '/webonyx/graphql-php/src/Language/Source.php', - 'GraphQL\\Language\\SourceLocation' => $vendorDir . '/webonyx/graphql-php/src/Language/SourceLocation.php', - 'GraphQL\\Language\\Token' => $vendorDir . '/webonyx/graphql-php/src/Language/Token.php', - 'GraphQL\\Language\\Visitor' => $vendorDir . '/webonyx/graphql-php/src/Language/Visitor.php', - 'GraphQL\\Language\\VisitorOperation' => $vendorDir . '/webonyx/graphql-php/src/Language/VisitorOperation.php', - 'GraphQL\\Server\\Helper' => $vendorDir . '/webonyx/graphql-php/src/Server/Helper.php', - 'GraphQL\\Server\\OperationParams' => $vendorDir . '/webonyx/graphql-php/src/Server/OperationParams.php', - 'GraphQL\\Server\\RequestError' => $vendorDir . '/webonyx/graphql-php/src/Server/RequestError.php', - 'GraphQL\\Server\\ServerConfig' => $vendorDir . '/webonyx/graphql-php/src/Server/ServerConfig.php', - 'GraphQL\\Server\\StandardServer' => $vendorDir . '/webonyx/graphql-php/src/Server/StandardServer.php', - 'GraphQL\\Type\\Definition\\AbstractType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/AbstractType.php', - 'GraphQL\\Type\\Definition\\BooleanType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/BooleanType.php', - 'GraphQL\\Type\\Definition\\CompositeType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/CompositeType.php', - 'GraphQL\\Type\\Definition\\CustomScalarType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/CustomScalarType.php', - 'GraphQL\\Type\\Definition\\Directive' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/Directive.php', - 'GraphQL\\Type\\Definition\\EnumType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/EnumType.php', - 'GraphQL\\Type\\Definition\\EnumValueDefinition' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php', - 'GraphQL\\Type\\Definition\\FieldArgument' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/FieldArgument.php', - 'GraphQL\\Type\\Definition\\FieldDefinition' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php', - 'GraphQL\\Type\\Definition\\FloatType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/FloatType.php', - 'GraphQL\\Type\\Definition\\HasFieldsType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php', - 'GraphQL\\Type\\Definition\\IDType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/IDType.php', - 'GraphQL\\Type\\Definition\\ImplementingType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ImplementingType.php', - 'GraphQL\\Type\\Definition\\InputObjectField' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InputObjectField.php', - 'GraphQL\\Type\\Definition\\InputObjectType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InputObjectType.php', - 'GraphQL\\Type\\Definition\\InputType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InputType.php', - 'GraphQL\\Type\\Definition\\IntType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/IntType.php', - 'GraphQL\\Type\\Definition\\InterfaceType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/InterfaceType.php', - 'GraphQL\\Type\\Definition\\LeafType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/LeafType.php', - 'GraphQL\\Type\\Definition\\ListOfType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ListOfType.php', - 'GraphQL\\Type\\Definition\\NamedType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/NamedType.php', - 'GraphQL\\Type\\Definition\\NonNull' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/NonNull.php', - 'GraphQL\\Type\\Definition\\NullableType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/NullableType.php', - 'GraphQL\\Type\\Definition\\ObjectType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ObjectType.php', - 'GraphQL\\Type\\Definition\\OutputType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/OutputType.php', - 'GraphQL\\Type\\Definition\\QueryPlan' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/QueryPlan.php', - 'GraphQL\\Type\\Definition\\ResolveInfo' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php', - 'GraphQL\\Type\\Definition\\ScalarType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/ScalarType.php', - 'GraphQL\\Type\\Definition\\StringType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/StringType.php', - 'GraphQL\\Type\\Definition\\Type' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/Type.php', - 'GraphQL\\Type\\Definition\\TypeWithFields' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php', - 'GraphQL\\Type\\Definition\\UnionType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/UnionType.php', - 'GraphQL\\Type\\Definition\\UnmodifiedType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php', - 'GraphQL\\Type\\Definition\\UnresolvedFieldDefinition' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/UnresolvedFieldDefinition.php', - 'GraphQL\\Type\\Definition\\WrappingType' => $vendorDir . '/webonyx/graphql-php/src/Type/Definition/WrappingType.php', - 'GraphQL\\Type\\Introspection' => $vendorDir . '/webonyx/graphql-php/src/Type/Introspection.php', - 'GraphQL\\Type\\Schema' => $vendorDir . '/webonyx/graphql-php/src/Type/Schema.php', - 'GraphQL\\Type\\SchemaConfig' => $vendorDir . '/webonyx/graphql-php/src/Type/SchemaConfig.php', - 'GraphQL\\Type\\SchemaValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Type/SchemaValidationContext.php', - 'GraphQL\\Type\\TypeKind' => $vendorDir . '/webonyx/graphql-php/src/Type/TypeKind.php', - 'GraphQL\\Type\\Validation\\InputObjectCircularRefs' => $vendorDir . '/webonyx/graphql-php/src/Type/Validation/InputObjectCircularRefs.php', - 'GraphQL\\Utils\\AST' => $vendorDir . '/webonyx/graphql-php/src/Utils/AST.php', - 'GraphQL\\Utils\\ASTDefinitionBuilder' => $vendorDir . '/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php', - 'GraphQL\\Utils\\BlockString' => $vendorDir . '/webonyx/graphql-php/src/Utils/BlockString.php', - 'GraphQL\\Utils\\BreakingChangesFinder' => $vendorDir . '/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php', - 'GraphQL\\Utils\\BuildClientSchema' => $vendorDir . '/webonyx/graphql-php/src/Utils/BuildClientSchema.php', - 'GraphQL\\Utils\\BuildSchema' => $vendorDir . '/webonyx/graphql-php/src/Utils/BuildSchema.php', - 'GraphQL\\Utils\\InterfaceImplementations' => $vendorDir . '/webonyx/graphql-php/src/Utils/InterfaceImplementations.php', - 'GraphQL\\Utils\\MixedStore' => $vendorDir . '/webonyx/graphql-php/src/Utils/MixedStore.php', - 'GraphQL\\Utils\\PairSet' => $vendorDir . '/webonyx/graphql-php/src/Utils/PairSet.php', - 'GraphQL\\Utils\\SchemaExtender' => $vendorDir . '/webonyx/graphql-php/src/Utils/SchemaExtender.php', - 'GraphQL\\Utils\\SchemaPrinter' => $vendorDir . '/webonyx/graphql-php/src/Utils/SchemaPrinter.php', - 'GraphQL\\Utils\\TypeComparators' => $vendorDir . '/webonyx/graphql-php/src/Utils/TypeComparators.php', - 'GraphQL\\Utils\\TypeInfo' => $vendorDir . '/webonyx/graphql-php/src/Utils/TypeInfo.php', - 'GraphQL\\Utils\\Utils' => $vendorDir . '/webonyx/graphql-php/src/Utils/Utils.php', - 'GraphQL\\Utils\\Value' => $vendorDir . '/webonyx/graphql-php/src/Utils/Value.php', - 'GraphQL\\Validator\\ASTValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Validator/ASTValidationContext.php', - 'GraphQL\\Validator\\DocumentValidator' => $vendorDir . '/webonyx/graphql-php/src/Validator/DocumentValidator.php', - 'GraphQL\\Validator\\Rules\\CustomValidationRule' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php', - 'GraphQL\\Validator\\Rules\\DisableIntrospection' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php', - 'GraphQL\\Validator\\Rules\\ExecutableDefinitions' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php', - 'GraphQL\\Validator\\Rules\\FieldsOnCorrectType' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php', - 'GraphQL\\Validator\\Rules\\FragmentsOnCompositeTypes' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php', - 'GraphQL\\Validator\\Rules\\KnownArgumentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php', - 'GraphQL\\Validator\\Rules\\KnownArgumentNamesOnDirectives' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php', - 'GraphQL\\Validator\\Rules\\KnownDirectives' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php', - 'GraphQL\\Validator\\Rules\\KnownFragmentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php', - 'GraphQL\\Validator\\Rules\\KnownTypeNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php', - 'GraphQL\\Validator\\Rules\\LoneAnonymousOperation' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php', - 'GraphQL\\Validator\\Rules\\LoneSchemaDefinition' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php', - 'GraphQL\\Validator\\Rules\\NoFragmentCycles' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php', - 'GraphQL\\Validator\\Rules\\NoUndefinedVariables' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php', - 'GraphQL\\Validator\\Rules\\NoUnusedFragments' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php', - 'GraphQL\\Validator\\Rules\\NoUnusedVariables' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php', - 'GraphQL\\Validator\\Rules\\OverlappingFieldsCanBeMerged' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php', - 'GraphQL\\Validator\\Rules\\PossibleFragmentSpreads' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php', - 'GraphQL\\Validator\\Rules\\ProvidedRequiredArguments' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php', - 'GraphQL\\Validator\\Rules\\ProvidedRequiredArgumentsOnDirectives' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php', - 'GraphQL\\Validator\\Rules\\QueryComplexity' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php', - 'GraphQL\\Validator\\Rules\\QueryDepth' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php', - 'GraphQL\\Validator\\Rules\\QuerySecurityRule' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php', - 'GraphQL\\Validator\\Rules\\ScalarLeafs' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php', - 'GraphQL\\Validator\\Rules\\SingleFieldSubscription' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php', - 'GraphQL\\Validator\\Rules\\UniqueArgumentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php', - 'GraphQL\\Validator\\Rules\\UniqueDirectivesPerLocation' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php', - 'GraphQL\\Validator\\Rules\\UniqueFragmentNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php', - 'GraphQL\\Validator\\Rules\\UniqueInputFieldNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php', - 'GraphQL\\Validator\\Rules\\UniqueOperationNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php', - 'GraphQL\\Validator\\Rules\\UniqueVariableNames' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php', - 'GraphQL\\Validator\\Rules\\ValidationRule' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php', - 'GraphQL\\Validator\\Rules\\ValuesOfCorrectType' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php', - 'GraphQL\\Validator\\Rules\\VariablesAreInputTypes' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php', - 'GraphQL\\Validator\\Rules\\VariablesInAllowedPosition' => $vendorDir . '/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php', - 'GraphQL\\Validator\\SDLValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Validator/SDLValidationContext.php', - 'GraphQL\\Validator\\ValidationContext' => $vendorDir . '/webonyx/graphql-php/src/Validator/ValidationContext.php', - 'WPGraphQL\\Admin\\Admin' => $baseDir . '/src/Admin/Admin.php', - 'WPGraphQL\\Admin\\GraphiQL\\GraphiQL' => $baseDir . '/src/Admin/GraphiQL/GraphiQL.php', - 'WPGraphQL\\Admin\\Settings\\Settings' => $baseDir . '/src/Admin/Settings/Settings.php', - 'WPGraphQL\\Admin\\Settings\\SettingsRegistry' => $baseDir . '/src/Admin/Settings/SettingsRegistry.php', - 'WPGraphQL\\AppContext' => $baseDir . '/src/AppContext.php', - 'WPGraphQL\\Connection\\Comments' => $baseDir . '/src/Connection/Comments.php', - 'WPGraphQL\\Connection\\MenuItems' => $baseDir . '/src/Connection/MenuItems.php', - 'WPGraphQL\\Connection\\PostObjects' => $baseDir . '/src/Connection/PostObjects.php', - 'WPGraphQL\\Connection\\Taxonomies' => $baseDir . '/src/Connection/Taxonomies.php', - 'WPGraphQL\\Connection\\TermObjects' => $baseDir . '/src/Connection/TermObjects.php', - 'WPGraphQL\\Connection\\Users' => $baseDir . '/src/Connection/Users.php', - 'WPGraphQL\\Data\\CommentMutation' => $baseDir . '/src/Data/CommentMutation.php', - 'WPGraphQL\\Data\\Config' => $baseDir . '/src/Data/Config.php', - 'WPGraphQL\\Data\\Connection\\AbstractConnectionResolver' => $baseDir . '/src/Data/Connection/AbstractConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\CommentConnectionResolver' => $baseDir . '/src/Data/Connection/CommentConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\ContentTypeConnectionResolver' => $baseDir . '/src/Data/Connection/ContentTypeConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\EnqueuedScriptsConnectionResolver' => $baseDir . '/src/Data/Connection/EnqueuedScriptsConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\EnqueuedStylesheetConnectionResolver' => $baseDir . '/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\MenuConnectionResolver' => $baseDir . '/src/Data/Connection/MenuConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\MenuItemConnectionResolver' => $baseDir . '/src/Data/Connection/MenuItemConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\PluginConnectionResolver' => $baseDir . '/src/Data/Connection/PluginConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\PostObjectConnectionResolver' => $baseDir . '/src/Data/Connection/PostObjectConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\TaxonomyConnectionResolver' => $baseDir . '/src/Data/Connection/TaxonomyConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\TermObjectConnectionResolver' => $baseDir . '/src/Data/Connection/TermObjectConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\ThemeConnectionResolver' => $baseDir . '/src/Data/Connection/ThemeConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\UserConnectionResolver' => $baseDir . '/src/Data/Connection/UserConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\UserRoleConnectionResolver' => $baseDir . '/src/Data/Connection/UserRoleConnectionResolver.php', - 'WPGraphQL\\Data\\Cursor\\AbstractCursor' => $baseDir . '/src/Data/Cursor/AbstractCursor.php', - 'WPGraphQL\\Data\\Cursor\\CommentObjectCursor' => $baseDir . '/src/Data/Cursor/CommentObjectCursor.php', - 'WPGraphQL\\Data\\Cursor\\CursorBuilder' => $baseDir . '/src/Data/Cursor/CursorBuilder.php', - 'WPGraphQL\\Data\\Cursor\\PostObjectCursor' => $baseDir . '/src/Data/Cursor/PostObjectCursor.php', - 'WPGraphQL\\Data\\Cursor\\TermObjectCursor' => $baseDir . '/src/Data/Cursor/TermObjectCursor.php', - 'WPGraphQL\\Data\\Cursor\\UserCursor' => $baseDir . '/src/Data/Cursor/UserCursor.php', - 'WPGraphQL\\Data\\DataSource' => $baseDir . '/src/Data/DataSource.php', - 'WPGraphQL\\Data\\Loader\\AbstractDataLoader' => $baseDir . '/src/Data/Loader/AbstractDataLoader.php', - 'WPGraphQL\\Data\\Loader\\CommentAuthorLoader' => $baseDir . '/src/Data/Loader/CommentAuthorLoader.php', - 'WPGraphQL\\Data\\Loader\\CommentLoader' => $baseDir . '/src/Data/Loader/CommentLoader.php', - 'WPGraphQL\\Data\\Loader\\EnqueuedScriptLoader' => $baseDir . '/src/Data/Loader/EnqueuedScriptLoader.php', - 'WPGraphQL\\Data\\Loader\\EnqueuedStylesheetLoader' => $baseDir . '/src/Data/Loader/EnqueuedStylesheetLoader.php', - 'WPGraphQL\\Data\\Loader\\PluginLoader' => $baseDir . '/src/Data/Loader/PluginLoader.php', - 'WPGraphQL\\Data\\Loader\\PostObjectLoader' => $baseDir . '/src/Data/Loader/PostObjectLoader.php', - 'WPGraphQL\\Data\\Loader\\PostTypeLoader' => $baseDir . '/src/Data/Loader/PostTypeLoader.php', - 'WPGraphQL\\Data\\Loader\\TaxonomyLoader' => $baseDir . '/src/Data/Loader/TaxonomyLoader.php', - 'WPGraphQL\\Data\\Loader\\TermObjectLoader' => $baseDir . '/src/Data/Loader/TermObjectLoader.php', - 'WPGraphQL\\Data\\Loader\\ThemeLoader' => $baseDir . '/src/Data/Loader/ThemeLoader.php', - 'WPGraphQL\\Data\\Loader\\UserLoader' => $baseDir . '/src/Data/Loader/UserLoader.php', - 'WPGraphQL\\Data\\Loader\\UserRoleLoader' => $baseDir . '/src/Data/Loader/UserRoleLoader.php', - 'WPGraphQL\\Data\\MediaItemMutation' => $baseDir . '/src/Data/MediaItemMutation.php', - 'WPGraphQL\\Data\\NodeResolver' => $baseDir . '/src/Data/NodeResolver.php', - 'WPGraphQL\\Data\\PostObjectMutation' => $baseDir . '/src/Data/PostObjectMutation.php', - 'WPGraphQL\\Data\\TermObjectMutation' => $baseDir . '/src/Data/TermObjectMutation.php', - 'WPGraphQL\\Data\\UserMutation' => $baseDir . '/src/Data/UserMutation.php', - 'WPGraphQL\\Model\\Avatar' => $baseDir . '/src/Model/Avatar.php', - 'WPGraphQL\\Model\\Comment' => $baseDir . '/src/Model/Comment.php', - 'WPGraphQL\\Model\\CommentAuthor' => $baseDir . '/src/Model/CommentAuthor.php', - 'WPGraphQL\\Model\\Menu' => $baseDir . '/src/Model/Menu.php', - 'WPGraphQL\\Model\\MenuItem' => $baseDir . '/src/Model/MenuItem.php', - 'WPGraphQL\\Model\\Model' => $baseDir . '/src/Model/Model.php', - 'WPGraphQL\\Model\\Plugin' => $baseDir . '/src/Model/Plugin.php', - 'WPGraphQL\\Model\\Post' => $baseDir . '/src/Model/Post.php', - 'WPGraphQL\\Model\\PostType' => $baseDir . '/src/Model/PostType.php', - 'WPGraphQL\\Model\\Taxonomy' => $baseDir . '/src/Model/Taxonomy.php', - 'WPGraphQL\\Model\\Term' => $baseDir . '/src/Model/Term.php', - 'WPGraphQL\\Model\\Theme' => $baseDir . '/src/Model/Theme.php', - 'WPGraphQL\\Model\\User' => $baseDir . '/src/Model/User.php', - 'WPGraphQL\\Model\\UserRole' => $baseDir . '/src/Model/UserRole.php', - 'WPGraphQL\\Mutation\\CommentCreate' => $baseDir . '/src/Mutation/CommentCreate.php', - 'WPGraphQL\\Mutation\\CommentDelete' => $baseDir . '/src/Mutation/CommentDelete.php', - 'WPGraphQL\\Mutation\\CommentRestore' => $baseDir . '/src/Mutation/CommentRestore.php', - 'WPGraphQL\\Mutation\\CommentUpdate' => $baseDir . '/src/Mutation/CommentUpdate.php', - 'WPGraphQL\\Mutation\\MediaItemCreate' => $baseDir . '/src/Mutation/MediaItemCreate.php', - 'WPGraphQL\\Mutation\\MediaItemDelete' => $baseDir . '/src/Mutation/MediaItemDelete.php', - 'WPGraphQL\\Mutation\\MediaItemUpdate' => $baseDir . '/src/Mutation/MediaItemUpdate.php', - 'WPGraphQL\\Mutation\\PostObjectCreate' => $baseDir . '/src/Mutation/PostObjectCreate.php', - 'WPGraphQL\\Mutation\\PostObjectDelete' => $baseDir . '/src/Mutation/PostObjectDelete.php', - 'WPGraphQL\\Mutation\\PostObjectUpdate' => $baseDir . '/src/Mutation/PostObjectUpdate.php', - 'WPGraphQL\\Mutation\\ResetUserPassword' => $baseDir . '/src/Mutation/ResetUserPassword.php', - 'WPGraphQL\\Mutation\\SendPasswordResetEmail' => $baseDir . '/src/Mutation/SendPasswordResetEmail.php', - 'WPGraphQL\\Mutation\\TermObjectCreate' => $baseDir . '/src/Mutation/TermObjectCreate.php', - 'WPGraphQL\\Mutation\\TermObjectDelete' => $baseDir . '/src/Mutation/TermObjectDelete.php', - 'WPGraphQL\\Mutation\\TermObjectUpdate' => $baseDir . '/src/Mutation/TermObjectUpdate.php', - 'WPGraphQL\\Mutation\\UpdateSettings' => $baseDir . '/src/Mutation/UpdateSettings.php', - 'WPGraphQL\\Mutation\\UserCreate' => $baseDir . '/src/Mutation/UserCreate.php', - 'WPGraphQL\\Mutation\\UserDelete' => $baseDir . '/src/Mutation/UserDelete.php', - 'WPGraphQL\\Mutation\\UserRegister' => $baseDir . '/src/Mutation/UserRegister.php', - 'WPGraphQL\\Mutation\\UserUpdate' => $baseDir . '/src/Mutation/UserUpdate.php', - 'WPGraphQL\\Registry\\SchemaRegistry' => $baseDir . '/src/Registry/SchemaRegistry.php', - 'WPGraphQL\\Registry\\TypeRegistry' => $baseDir . '/src/Registry/TypeRegistry.php', - 'WPGraphQL\\Registry\\Utils\\PostObject' => $baseDir . '/src/Registry/Utils/PostObject.php', - 'WPGraphQL\\Registry\\Utils\\TermObject' => $baseDir . '/src/Registry/Utils/TermObject.php', - 'WPGraphQL\\Request' => $baseDir . '/src/Request.php', - 'WPGraphQL\\Router' => $baseDir . '/src/Router.php', - 'WPGraphQL\\Server\\ValidationRules\\DisableIntrospection' => $baseDir . '/src/Server/ValidationRules/DisableIntrospection.php', - 'WPGraphQL\\Server\\ValidationRules\\QueryDepth' => $baseDir . '/src/Server/ValidationRules/QueryDepth.php', - 'WPGraphQL\\Server\\ValidationRules\\RequireAuthentication' => $baseDir . '/src/Server/ValidationRules/RequireAuthentication.php', - 'WPGraphQL\\Server\\WPHelper' => $baseDir . '/src/Server/WPHelper.php', - 'WPGraphQL\\Type\\Connection\\Comments' => $baseDir . '/src/Type/Connection/Comments.php', - 'WPGraphQL\\Type\\Connection\\MenuItems' => $baseDir . '/src/Type/Connection/MenuItems.php', - 'WPGraphQL\\Type\\Connection\\PostObjects' => $baseDir . '/src/Type/Connection/PostObjects.php', - 'WPGraphQL\\Type\\Connection\\Taxonomies' => $baseDir . '/src/Type/Connection/Taxonomies.php', - 'WPGraphQL\\Type\\Connection\\TermObjects' => $baseDir . '/src/Type/Connection/TermObjects.php', - 'WPGraphQL\\Type\\Connection\\Users' => $baseDir . '/src/Type/Connection/Users.php', - 'WPGraphQL\\Type\\Enum\\AvatarRatingEnum' => $baseDir . '/src/Type/Enum/AvatarRatingEnum.php', - 'WPGraphQL\\Type\\Enum\\CommentNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/CommentNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\CommentStatusEnum' => $baseDir . '/src/Type/Enum/CommentStatusEnum.php', - 'WPGraphQL\\Type\\Enum\\CommentsConnectionOrderbyEnum' => $baseDir . '/src/Type/Enum/CommentsConnectionOrderbyEnum.php', - 'WPGraphQL\\Type\\Enum\\ContentNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/ContentNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\ContentTypeEnum' => $baseDir . '/src/Type/Enum/ContentTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\ContentTypeIdTypeEnum' => $baseDir . '/src/Type/Enum/ContentTypeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\MediaItemSizeEnum' => $baseDir . '/src/Type/Enum/MediaItemSizeEnum.php', - 'WPGraphQL\\Type\\Enum\\MediaItemStatusEnum' => $baseDir . '/src/Type/Enum/MediaItemStatusEnum.php', - 'WPGraphQL\\Type\\Enum\\MenuItemNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/MenuItemNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\MenuLocationEnum' => $baseDir . '/src/Type/Enum/MenuLocationEnum.php', - 'WPGraphQL\\Type\\Enum\\MenuNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/MenuNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\MimeTypeEnum' => $baseDir . '/src/Type/Enum/MimeTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\OrderEnum' => $baseDir . '/src/Type/Enum/OrderEnum.php', - 'WPGraphQL\\Type\\Enum\\PluginStatusEnum' => $baseDir . '/src/Type/Enum/PluginStatusEnum.php', - 'WPGraphQL\\Type\\Enum\\PostObjectFieldFormatEnum' => $baseDir . '/src/Type/Enum/PostObjectFieldFormatEnum.php', - 'WPGraphQL\\Type\\Enum\\PostObjectsConnectionDateColumnEnum' => $baseDir . '/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php', - 'WPGraphQL\\Type\\Enum\\PostObjectsConnectionOrderbyEnum' => $baseDir . '/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php', - 'WPGraphQL\\Type\\Enum\\PostStatusEnum' => $baseDir . '/src/Type/Enum/PostStatusEnum.php', - 'WPGraphQL\\Type\\Enum\\RelationEnum' => $baseDir . '/src/Type/Enum/RelationEnum.php', - 'WPGraphQL\\Type\\Enum\\TaxonomyEnum' => $baseDir . '/src/Type/Enum/TaxonomyEnum.php', - 'WPGraphQL\\Type\\Enum\\TaxonomyIdTypeEnum' => $baseDir . '/src/Type/Enum/TaxonomyIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\TermNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/TermNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\TermObjectsConnectionOrderbyEnum' => $baseDir . '/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php', - 'WPGraphQL\\Type\\Enum\\TimezoneEnum' => $baseDir . '/src/Type/Enum/TimezoneEnum.php', - 'WPGraphQL\\Type\\Enum\\UserNodeIdTypeEnum' => $baseDir . '/src/Type/Enum/UserNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\UserRoleEnum' => $baseDir . '/src/Type/Enum/UserRoleEnum.php', - 'WPGraphQL\\Type\\Enum\\UsersConnectionOrderbyEnum' => $baseDir . '/src/Type/Enum/UsersConnectionOrderbyEnum.php', - 'WPGraphQL\\Type\\Enum\\UsersConnectionSearchColumnEnum' => $baseDir . '/src/Type/Enum/UsersConnectionSearchColumnEnum.php', - 'WPGraphQL\\Type\\Input\\DateInput' => $baseDir . '/src/Type/Input/DateInput.php', - 'WPGraphQL\\Type\\Input\\DateQueryInput' => $baseDir . '/src/Type/Input/DateQueryInput.php', - 'WPGraphQL\\Type\\Input\\PostObjectsConnectionOrderbyInput' => $baseDir . '/src/Type/Input/PostObjectsConnectionOrderbyInput.php', - 'WPGraphQL\\Type\\Input\\UsersConnectionOrderbyInput' => $baseDir . '/src/Type/Input/UsersConnectionOrderbyInput.php', - 'WPGraphQL\\Type\\InterfaceType\\Commenter' => $baseDir . '/src/Type/InterfaceType/Commenter.php', - 'WPGraphQL\\Type\\InterfaceType\\Connection' => $baseDir . '/src/Type/InterfaceType/Connection.php', - 'WPGraphQL\\Type\\InterfaceType\\ContentNode' => $baseDir . '/src/Type/InterfaceType/ContentNode.php', - 'WPGraphQL\\Type\\InterfaceType\\ContentTemplate' => $baseDir . '/src/Type/InterfaceType/ContentTemplate.php', - 'WPGraphQL\\Type\\InterfaceType\\DatabaseIdentifier' => $baseDir . '/src/Type/InterfaceType/DatabaseIdentifier.php', - 'WPGraphQL\\Type\\InterfaceType\\Edge' => $baseDir . '/src/Type/InterfaceType/Edge.php', - 'WPGraphQL\\Type\\InterfaceType\\EnqueuedAsset' => $baseDir . '/src/Type/InterfaceType/EnqueuedAsset.php', - 'WPGraphQL\\Type\\InterfaceType\\HierarchicalContentNode' => $baseDir . '/src/Type/InterfaceType/HierarchicalContentNode.php', - 'WPGraphQL\\Type\\InterfaceType\\HierarchicalNode' => $baseDir . '/src/Type/InterfaceType/HierarchicalNode.php', - 'WPGraphQL\\Type\\InterfaceType\\HierarchicalTermNode' => $baseDir . '/src/Type/InterfaceType/HierarchicalTermNode.php', - 'WPGraphQL\\Type\\InterfaceType\\MenuItemLinkable' => $baseDir . '/src/Type/InterfaceType/MenuItemLinkable.php', - 'WPGraphQL\\Type\\InterfaceType\\Node' => $baseDir . '/src/Type/InterfaceType/Node.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithAuthor' => $baseDir . '/src/Type/InterfaceType/NodeWithAuthor.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithComments' => $baseDir . '/src/Type/InterfaceType/NodeWithComments.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithContentEditor' => $baseDir . '/src/Type/InterfaceType/NodeWithContentEditor.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithExcerpt' => $baseDir . '/src/Type/InterfaceType/NodeWithExcerpt.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithFeaturedImage' => $baseDir . '/src/Type/InterfaceType/NodeWithFeaturedImage.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithPageAttributes' => $baseDir . '/src/Type/InterfaceType/NodeWithPageAttributes.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithRevisions' => $baseDir . '/src/Type/InterfaceType/NodeWithRevisions.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithTemplate' => $baseDir . '/src/Type/InterfaceType/NodeWithTemplate.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithTitle' => $baseDir . '/src/Type/InterfaceType/NodeWithTitle.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithTrackbacks' => $baseDir . '/src/Type/InterfaceType/NodeWithTrackbacks.php', - 'WPGraphQL\\Type\\InterfaceType\\OneToOneConnection' => $baseDir . '/src/Type/InterfaceType/OneToOneConnection.php', - 'WPGraphQL\\Type\\InterfaceType\\PageInfo' => $baseDir . '/src/Type/InterfaceType/PageInfo.php', - 'WPGraphQL\\Type\\InterfaceType\\Previewable' => $baseDir . '/src/Type/InterfaceType/Previewable.php', - 'WPGraphQL\\Type\\InterfaceType\\TermNode' => $baseDir . '/src/Type/InterfaceType/TermNode.php', - 'WPGraphQL\\Type\\InterfaceType\\UniformResourceIdentifiable' => $baseDir . '/src/Type/InterfaceType/UniformResourceIdentifiable.php', - 'WPGraphQL\\Type\\ObjectType\\Avatar' => $baseDir . '/src/Type/ObjectType/Avatar.php', - 'WPGraphQL\\Type\\ObjectType\\Comment' => $baseDir . '/src/Type/ObjectType/Comment.php', - 'WPGraphQL\\Type\\ObjectType\\CommentAuthor' => $baseDir . '/src/Type/ObjectType/CommentAuthor.php', - 'WPGraphQL\\Type\\ObjectType\\ContentType' => $baseDir . '/src/Type/ObjectType/ContentType.php', - 'WPGraphQL\\Type\\ObjectType\\EnqueuedScript' => $baseDir . '/src/Type/ObjectType/EnqueuedScript.php', - 'WPGraphQL\\Type\\ObjectType\\EnqueuedStylesheet' => $baseDir . '/src/Type/ObjectType/EnqueuedStylesheet.php', - 'WPGraphQL\\Type\\ObjectType\\MediaDetails' => $baseDir . '/src/Type/ObjectType/MediaDetails.php', - 'WPGraphQL\\Type\\ObjectType\\MediaItemMeta' => $baseDir . '/src/Type/ObjectType/MediaItemMeta.php', - 'WPGraphQL\\Type\\ObjectType\\MediaSize' => $baseDir . '/src/Type/ObjectType/MediaSize.php', - 'WPGraphQL\\Type\\ObjectType\\Menu' => $baseDir . '/src/Type/ObjectType/Menu.php', - 'WPGraphQL\\Type\\ObjectType\\MenuItem' => $baseDir . '/src/Type/ObjectType/MenuItem.php', - 'WPGraphQL\\Type\\ObjectType\\Plugin' => $baseDir . '/src/Type/ObjectType/Plugin.php', - 'WPGraphQL\\Type\\ObjectType\\PostObject' => $baseDir . '/src/Type/ObjectType/PostObject.php', - 'WPGraphQL\\Type\\ObjectType\\PostTypeLabelDetails' => $baseDir . '/src/Type/ObjectType/PostTypeLabelDetails.php', - 'WPGraphQL\\Type\\ObjectType\\RootMutation' => $baseDir . '/src/Type/ObjectType/RootMutation.php', - 'WPGraphQL\\Type\\ObjectType\\RootQuery' => $baseDir . '/src/Type/ObjectType/RootQuery.php', - 'WPGraphQL\\Type\\ObjectType\\SettingGroup' => $baseDir . '/src/Type/ObjectType/SettingGroup.php', - 'WPGraphQL\\Type\\ObjectType\\Settings' => $baseDir . '/src/Type/ObjectType/Settings.php', - 'WPGraphQL\\Type\\ObjectType\\Taxonomy' => $baseDir . '/src/Type/ObjectType/Taxonomy.php', - 'WPGraphQL\\Type\\ObjectType\\TermObject' => $baseDir . '/src/Type/ObjectType/TermObject.php', - 'WPGraphQL\\Type\\ObjectType\\Theme' => $baseDir . '/src/Type/ObjectType/Theme.php', - 'WPGraphQL\\Type\\ObjectType\\User' => $baseDir . '/src/Type/ObjectType/User.php', - 'WPGraphQL\\Type\\ObjectType\\UserRole' => $baseDir . '/src/Type/ObjectType/UserRole.php', - 'WPGraphQL\\Type\\Union\\MenuItemObjectUnion' => $baseDir . '/src/Type/Union/MenuItemObjectUnion.php', - 'WPGraphQL\\Type\\Union\\PostObjectUnion' => $baseDir . '/src/Type/Union/PostObjectUnion.php', - 'WPGraphQL\\Type\\Union\\TermObjectUnion' => $baseDir . '/src/Type/Union/TermObjectUnion.php', - 'WPGraphQL\\Type\\WPConnectionType' => $baseDir . '/src/Type/WPConnectionType.php', - 'WPGraphQL\\Type\\WPEnumType' => $baseDir . '/src/Type/WPEnumType.php', - 'WPGraphQL\\Type\\WPInputObjectType' => $baseDir . '/src/Type/WPInputObjectType.php', - 'WPGraphQL\\Type\\WPInterfaceTrait' => $baseDir . '/src/Type/WPInterfaceTrait.php', - 'WPGraphQL\\Type\\WPInterfaceType' => $baseDir . '/src/Type/WPInterfaceType.php', - 'WPGraphQL\\Type\\WPMutationType' => $baseDir . '/src/Type/WPMutationType.php', - 'WPGraphQL\\Type\\WPObjectType' => $baseDir . '/src/Type/WPObjectType.php', - 'WPGraphQL\\Type\\WPScalar' => $baseDir . '/src/Type/WPScalar.php', - 'WPGraphQL\\Type\\WPUnionType' => $baseDir . '/src/Type/WPUnionType.php', - 'WPGraphQL\\Types' => $baseDir . '/src/Types.php', - 'WPGraphQL\\Utils\\DebugLog' => $baseDir . '/src/Utils/DebugLog.php', - 'WPGraphQL\\Utils\\InstrumentSchema' => $baseDir . '/src/Utils/InstrumentSchema.php', - 'WPGraphQL\\Utils\\Preview' => $baseDir . '/src/Utils/Preview.php', - 'WPGraphQL\\Utils\\QueryAnalyzer' => $baseDir . '/src/Utils/QueryAnalyzer.php', - 'WPGraphQL\\Utils\\QueryLog' => $baseDir . '/src/Utils/QueryLog.php', - 'WPGraphQL\\Utils\\Tracing' => $baseDir . '/src/Utils/Tracing.php', - 'WPGraphQL\\Utils\\Utils' => $baseDir . '/src/Utils/Utils.php', - 'WPGraphQL\\WPSchema' => $baseDir . '/src/WPSchema.php', -); diff --git a/lib/wp-graphql-1.17.0/vendor/composer/autoload_namespaces.php b/lib/wp-graphql-1.17.0/vendor/composer/autoload_namespaces.php deleted file mode 100644 index 15a2ff3a..00000000 --- a/lib/wp-graphql-1.17.0/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,9 +0,0 @@ - array($baseDir . '/src'), - 'GraphQL\\' => array($vendorDir . '/webonyx/graphql-php/src'), - 'Appsero\\' => array($vendorDir . '/appsero/client/src'), -); diff --git a/lib/wp-graphql-1.17.0/vendor/composer/autoload_real.php b/lib/wp-graphql-1.17.0/vendor/composer/autoload_real.php deleted file mode 100644 index 2d674fef..00000000 --- a/lib/wp-graphql-1.17.0/vendor/composer/autoload_real.php +++ /dev/null @@ -1,38 +0,0 @@ -register(true); - - return $loader; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/autoload_static.php b/lib/wp-graphql-1.17.0/vendor/composer/autoload_static.php deleted file mode 100644 index 3b0d3d8d..00000000 --- a/lib/wp-graphql-1.17.0/vendor/composer/autoload_static.php +++ /dev/null @@ -1,462 +0,0 @@ - - array ( - 'WPGraphQL\\' => 10, - ), - 'G' => - array ( - 'GraphQL\\' => 8, - ), - 'A' => - array ( - 'Appsero\\' => 8, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'WPGraphQL\\' => - array ( - 0 => __DIR__ . '/../..' . '/src', - ), - 'GraphQL\\' => - array ( - 0 => __DIR__ . '/..' . '/webonyx/graphql-php/src', - ), - 'Appsero\\' => - array ( - 0 => __DIR__ . '/..' . '/appsero/client/src', - ), - ); - - public static $classMap = array ( - 'Appsero\\Client' => __DIR__ . '/..' . '/appsero/client/src/Client.php', - 'Appsero\\Insights' => __DIR__ . '/..' . '/appsero/client/src/Insights.php', - 'Appsero\\License' => __DIR__ . '/..' . '/appsero/client/src/License.php', - 'Appsero\\Updater' => __DIR__ . '/..' . '/appsero/client/src/Updater.php', - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'GraphQLRelay\\Connection\\ArrayConnection' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Connection/ArrayConnection.php', - 'GraphQLRelay\\Connection\\Connection' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Connection/Connection.php', - 'GraphQLRelay\\Mutation\\Mutation' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Mutation/Mutation.php', - 'GraphQLRelay\\Node\\Node' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Node/Node.php', - 'GraphQLRelay\\Node\\Plural' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Node/Plural.php', - 'GraphQLRelay\\Relay' => __DIR__ . '/..' . '/ivome/graphql-relay-php/src/Relay.php', - 'GraphQL\\Deferred' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Deferred.php', - 'GraphQL\\Error\\ClientAware' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/ClientAware.php', - 'GraphQL\\Error\\DebugFlag' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/DebugFlag.php', - 'GraphQL\\Error\\Error' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/Error.php', - 'GraphQL\\Error\\FormattedError' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/FormattedError.php', - 'GraphQL\\Error\\InvariantViolation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/InvariantViolation.php', - 'GraphQL\\Error\\SyntaxError' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/SyntaxError.php', - 'GraphQL\\Error\\UserError' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/UserError.php', - 'GraphQL\\Error\\Warning' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Error/Warning.php', - 'GraphQL\\Exception\\InvalidArgument' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Exception/InvalidArgument.php', - 'GraphQL\\Executor\\ExecutionContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/ExecutionContext.php', - 'GraphQL\\Executor\\ExecutionResult' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/ExecutionResult.php', - 'GraphQL\\Executor\\Executor' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Executor.php', - 'GraphQL\\Executor\\ExecutorImplementation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/ExecutorImplementation.php', - 'GraphQL\\Executor\\Promise\\Adapter\\AmpPromiseAdapter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Adapter/AmpPromiseAdapter.php', - 'GraphQL\\Executor\\Promise\\Adapter\\ReactPromiseAdapter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php', - 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromise' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php', - 'GraphQL\\Executor\\Promise\\Adapter\\SyncPromiseAdapter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php', - 'GraphQL\\Executor\\Promise\\Promise' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/Promise.php', - 'GraphQL\\Executor\\Promise\\PromiseAdapter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php', - 'GraphQL\\Executor\\ReferenceExecutor' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/ReferenceExecutor.php', - 'GraphQL\\Executor\\Values' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Executor/Values.php', - 'GraphQL\\Experimental\\Executor\\Collector' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/Collector.php', - 'GraphQL\\Experimental\\Executor\\CoroutineContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php', - 'GraphQL\\Experimental\\Executor\\CoroutineContextShared' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php', - 'GraphQL\\Experimental\\Executor\\CoroutineExecutor' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php', - 'GraphQL\\Experimental\\Executor\\Runtime' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/Runtime.php', - 'GraphQL\\Experimental\\Executor\\Strand' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Experimental/Executor/Strand.php', - 'GraphQL\\GraphQL' => __DIR__ . '/..' . '/webonyx/graphql-php/src/GraphQL.php', - 'GraphQL\\Language\\AST\\ArgumentNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ArgumentNode.php', - 'GraphQL\\Language\\AST\\BooleanValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/BooleanValueNode.php', - 'GraphQL\\Language\\AST\\DefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/DefinitionNode.php', - 'GraphQL\\Language\\AST\\DirectiveDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/DirectiveDefinitionNode.php', - 'GraphQL\\Language\\AST\\DirectiveNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/DirectiveNode.php', - 'GraphQL\\Language\\AST\\DocumentNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/DocumentNode.php', - 'GraphQL\\Language\\AST\\EnumTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\EnumTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\EnumValueDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php', - 'GraphQL\\Language\\AST\\EnumValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/EnumValueNode.php', - 'GraphQL\\Language\\AST\\ExecutableDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ExecutableDefinitionNode.php', - 'GraphQL\\Language\\AST\\FieldDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FieldDefinitionNode.php', - 'GraphQL\\Language\\AST\\FieldNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FieldNode.php', - 'GraphQL\\Language\\AST\\FloatValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FloatValueNode.php', - 'GraphQL\\Language\\AST\\FragmentDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FragmentDefinitionNode.php', - 'GraphQL\\Language\\AST\\FragmentSpreadNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php', - 'GraphQL\\Language\\AST\\HasSelectionSet' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php', - 'GraphQL\\Language\\AST\\InlineFragmentNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InlineFragmentNode.php', - 'GraphQL\\Language\\AST\\InputObjectTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\InputObjectTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\InputValueDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php', - 'GraphQL\\Language\\AST\\IntValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/IntValueNode.php', - 'GraphQL\\Language\\AST\\InterfaceTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\InterfaceTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\ListTypeNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ListTypeNode.php', - 'GraphQL\\Language\\AST\\ListValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ListValueNode.php', - 'GraphQL\\Language\\AST\\Location' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/Location.php', - 'GraphQL\\Language\\AST\\NameNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NameNode.php', - 'GraphQL\\Language\\AST\\NamedTypeNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NamedTypeNode.php', - 'GraphQL\\Language\\AST\\Node' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/Node.php', - 'GraphQL\\Language\\AST\\NodeKind' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NodeKind.php', - 'GraphQL\\Language\\AST\\NodeList' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NodeList.php', - 'GraphQL\\Language\\AST\\NonNullTypeNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php', - 'GraphQL\\Language\\AST\\NullValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/NullValueNode.php', - 'GraphQL\\Language\\AST\\ObjectFieldNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ObjectFieldNode.php', - 'GraphQL\\Language\\AST\\ObjectTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ObjectTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\ObjectTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\ObjectValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php', - 'GraphQL\\Language\\AST\\OperationDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php', - 'GraphQL\\Language\\AST\\OperationTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\ScalarTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ScalarTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\ScalarTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\SchemaDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php', - 'GraphQL\\Language\\AST\\SchemaTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\SelectionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/SelectionNode.php', - 'GraphQL\\Language\\AST\\SelectionSetNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/SelectionSetNode.php', - 'GraphQL\\Language\\AST\\StringValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/StringValueNode.php', - 'GraphQL\\Language\\AST\\TypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/TypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\TypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/TypeExtensionNode.php', - 'GraphQL\\Language\\AST\\TypeNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/TypeNode.php', - 'GraphQL\\Language\\AST\\TypeSystemDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/TypeSystemDefinitionNode.php', - 'GraphQL\\Language\\AST\\UnionTypeDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/UnionTypeDefinitionNode.php', - 'GraphQL\\Language\\AST\\UnionTypeExtensionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php', - 'GraphQL\\Language\\AST\\ValueNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/ValueNode.php', - 'GraphQL\\Language\\AST\\VariableDefinitionNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/VariableDefinitionNode.php', - 'GraphQL\\Language\\AST\\VariableNode' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/AST/VariableNode.php', - 'GraphQL\\Language\\DirectiveLocation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/DirectiveLocation.php', - 'GraphQL\\Language\\Lexer' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Lexer.php', - 'GraphQL\\Language\\Parser' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Parser.php', - 'GraphQL\\Language\\Printer' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Printer.php', - 'GraphQL\\Language\\Source' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Source.php', - 'GraphQL\\Language\\SourceLocation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/SourceLocation.php', - 'GraphQL\\Language\\Token' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Token.php', - 'GraphQL\\Language\\Visitor' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/Visitor.php', - 'GraphQL\\Language\\VisitorOperation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Language/VisitorOperation.php', - 'GraphQL\\Server\\Helper' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/Helper.php', - 'GraphQL\\Server\\OperationParams' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/OperationParams.php', - 'GraphQL\\Server\\RequestError' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/RequestError.php', - 'GraphQL\\Server\\ServerConfig' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/ServerConfig.php', - 'GraphQL\\Server\\StandardServer' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Server/StandardServer.php', - 'GraphQL\\Type\\Definition\\AbstractType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/AbstractType.php', - 'GraphQL\\Type\\Definition\\BooleanType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/BooleanType.php', - 'GraphQL\\Type\\Definition\\CompositeType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/CompositeType.php', - 'GraphQL\\Type\\Definition\\CustomScalarType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/CustomScalarType.php', - 'GraphQL\\Type\\Definition\\Directive' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/Directive.php', - 'GraphQL\\Type\\Definition\\EnumType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/EnumType.php', - 'GraphQL\\Type\\Definition\\EnumValueDefinition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php', - 'GraphQL\\Type\\Definition\\FieldArgument' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/FieldArgument.php', - 'GraphQL\\Type\\Definition\\FieldDefinition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php', - 'GraphQL\\Type\\Definition\\FloatType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/FloatType.php', - 'GraphQL\\Type\\Definition\\HasFieldsType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php', - 'GraphQL\\Type\\Definition\\IDType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/IDType.php', - 'GraphQL\\Type\\Definition\\ImplementingType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ImplementingType.php', - 'GraphQL\\Type\\Definition\\InputObjectField' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/InputObjectField.php', - 'GraphQL\\Type\\Definition\\InputObjectType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/InputObjectType.php', - 'GraphQL\\Type\\Definition\\InputType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/InputType.php', - 'GraphQL\\Type\\Definition\\IntType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/IntType.php', - 'GraphQL\\Type\\Definition\\InterfaceType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/InterfaceType.php', - 'GraphQL\\Type\\Definition\\LeafType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/LeafType.php', - 'GraphQL\\Type\\Definition\\ListOfType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ListOfType.php', - 'GraphQL\\Type\\Definition\\NamedType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/NamedType.php', - 'GraphQL\\Type\\Definition\\NonNull' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/NonNull.php', - 'GraphQL\\Type\\Definition\\NullableType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/NullableType.php', - 'GraphQL\\Type\\Definition\\ObjectType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ObjectType.php', - 'GraphQL\\Type\\Definition\\OutputType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/OutputType.php', - 'GraphQL\\Type\\Definition\\QueryPlan' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/QueryPlan.php', - 'GraphQL\\Type\\Definition\\ResolveInfo' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php', - 'GraphQL\\Type\\Definition\\ScalarType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/ScalarType.php', - 'GraphQL\\Type\\Definition\\StringType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/StringType.php', - 'GraphQL\\Type\\Definition\\Type' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/Type.php', - 'GraphQL\\Type\\Definition\\TypeWithFields' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php', - 'GraphQL\\Type\\Definition\\UnionType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/UnionType.php', - 'GraphQL\\Type\\Definition\\UnmodifiedType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php', - 'GraphQL\\Type\\Definition\\UnresolvedFieldDefinition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/UnresolvedFieldDefinition.php', - 'GraphQL\\Type\\Definition\\WrappingType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Definition/WrappingType.php', - 'GraphQL\\Type\\Introspection' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Introspection.php', - 'GraphQL\\Type\\Schema' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Schema.php', - 'GraphQL\\Type\\SchemaConfig' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/SchemaConfig.php', - 'GraphQL\\Type\\SchemaValidationContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/SchemaValidationContext.php', - 'GraphQL\\Type\\TypeKind' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/TypeKind.php', - 'GraphQL\\Type\\Validation\\InputObjectCircularRefs' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Type/Validation/InputObjectCircularRefs.php', - 'GraphQL\\Utils\\AST' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/AST.php', - 'GraphQL\\Utils\\ASTDefinitionBuilder' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php', - 'GraphQL\\Utils\\BlockString' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/BlockString.php', - 'GraphQL\\Utils\\BreakingChangesFinder' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php', - 'GraphQL\\Utils\\BuildClientSchema' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/BuildClientSchema.php', - 'GraphQL\\Utils\\BuildSchema' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/BuildSchema.php', - 'GraphQL\\Utils\\InterfaceImplementations' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/InterfaceImplementations.php', - 'GraphQL\\Utils\\MixedStore' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/MixedStore.php', - 'GraphQL\\Utils\\PairSet' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/PairSet.php', - 'GraphQL\\Utils\\SchemaExtender' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/SchemaExtender.php', - 'GraphQL\\Utils\\SchemaPrinter' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/SchemaPrinter.php', - 'GraphQL\\Utils\\TypeComparators' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/TypeComparators.php', - 'GraphQL\\Utils\\TypeInfo' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/TypeInfo.php', - 'GraphQL\\Utils\\Utils' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/Utils.php', - 'GraphQL\\Utils\\Value' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Utils/Value.php', - 'GraphQL\\Validator\\ASTValidationContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/ASTValidationContext.php', - 'GraphQL\\Validator\\DocumentValidator' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/DocumentValidator.php', - 'GraphQL\\Validator\\Rules\\CustomValidationRule' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php', - 'GraphQL\\Validator\\Rules\\DisableIntrospection' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php', - 'GraphQL\\Validator\\Rules\\ExecutableDefinitions' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php', - 'GraphQL\\Validator\\Rules\\FieldsOnCorrectType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php', - 'GraphQL\\Validator\\Rules\\FragmentsOnCompositeTypes' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php', - 'GraphQL\\Validator\\Rules\\KnownArgumentNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php', - 'GraphQL\\Validator\\Rules\\KnownArgumentNamesOnDirectives' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php', - 'GraphQL\\Validator\\Rules\\KnownDirectives' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php', - 'GraphQL\\Validator\\Rules\\KnownFragmentNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php', - 'GraphQL\\Validator\\Rules\\KnownTypeNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php', - 'GraphQL\\Validator\\Rules\\LoneAnonymousOperation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php', - 'GraphQL\\Validator\\Rules\\LoneSchemaDefinition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php', - 'GraphQL\\Validator\\Rules\\NoFragmentCycles' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php', - 'GraphQL\\Validator\\Rules\\NoUndefinedVariables' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php', - 'GraphQL\\Validator\\Rules\\NoUnusedFragments' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php', - 'GraphQL\\Validator\\Rules\\NoUnusedVariables' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php', - 'GraphQL\\Validator\\Rules\\OverlappingFieldsCanBeMerged' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php', - 'GraphQL\\Validator\\Rules\\PossibleFragmentSpreads' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php', - 'GraphQL\\Validator\\Rules\\ProvidedRequiredArguments' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php', - 'GraphQL\\Validator\\Rules\\ProvidedRequiredArgumentsOnDirectives' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php', - 'GraphQL\\Validator\\Rules\\QueryComplexity' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php', - 'GraphQL\\Validator\\Rules\\QueryDepth' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php', - 'GraphQL\\Validator\\Rules\\QuerySecurityRule' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php', - 'GraphQL\\Validator\\Rules\\ScalarLeafs' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php', - 'GraphQL\\Validator\\Rules\\SingleFieldSubscription' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php', - 'GraphQL\\Validator\\Rules\\UniqueArgumentNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php', - 'GraphQL\\Validator\\Rules\\UniqueDirectivesPerLocation' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php', - 'GraphQL\\Validator\\Rules\\UniqueFragmentNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php', - 'GraphQL\\Validator\\Rules\\UniqueInputFieldNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php', - 'GraphQL\\Validator\\Rules\\UniqueOperationNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php', - 'GraphQL\\Validator\\Rules\\UniqueVariableNames' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php', - 'GraphQL\\Validator\\Rules\\ValidationRule' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php', - 'GraphQL\\Validator\\Rules\\ValuesOfCorrectType' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php', - 'GraphQL\\Validator\\Rules\\VariablesAreInputTypes' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php', - 'GraphQL\\Validator\\Rules\\VariablesInAllowedPosition' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php', - 'GraphQL\\Validator\\SDLValidationContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/SDLValidationContext.php', - 'GraphQL\\Validator\\ValidationContext' => __DIR__ . '/..' . '/webonyx/graphql-php/src/Validator/ValidationContext.php', - 'WPGraphQL\\Admin\\Admin' => __DIR__ . '/../..' . '/src/Admin/Admin.php', - 'WPGraphQL\\Admin\\GraphiQL\\GraphiQL' => __DIR__ . '/../..' . '/src/Admin/GraphiQL/GraphiQL.php', - 'WPGraphQL\\Admin\\Settings\\Settings' => __DIR__ . '/../..' . '/src/Admin/Settings/Settings.php', - 'WPGraphQL\\Admin\\Settings\\SettingsRegistry' => __DIR__ . '/../..' . '/src/Admin/Settings/SettingsRegistry.php', - 'WPGraphQL\\AppContext' => __DIR__ . '/../..' . '/src/AppContext.php', - 'WPGraphQL\\Connection\\Comments' => __DIR__ . '/../..' . '/src/Connection/Comments.php', - 'WPGraphQL\\Connection\\MenuItems' => __DIR__ . '/../..' . '/src/Connection/MenuItems.php', - 'WPGraphQL\\Connection\\PostObjects' => __DIR__ . '/../..' . '/src/Connection/PostObjects.php', - 'WPGraphQL\\Connection\\Taxonomies' => __DIR__ . '/../..' . '/src/Connection/Taxonomies.php', - 'WPGraphQL\\Connection\\TermObjects' => __DIR__ . '/../..' . '/src/Connection/TermObjects.php', - 'WPGraphQL\\Connection\\Users' => __DIR__ . '/../..' . '/src/Connection/Users.php', - 'WPGraphQL\\Data\\CommentMutation' => __DIR__ . '/../..' . '/src/Data/CommentMutation.php', - 'WPGraphQL\\Data\\Config' => __DIR__ . '/../..' . '/src/Data/Config.php', - 'WPGraphQL\\Data\\Connection\\AbstractConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/AbstractConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\CommentConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/CommentConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\ContentTypeConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/ContentTypeConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\EnqueuedScriptsConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/EnqueuedScriptsConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\EnqueuedStylesheetConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/EnqueuedStylesheetConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\MenuConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/MenuConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\MenuItemConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/MenuItemConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\PluginConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/PluginConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\PostObjectConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/PostObjectConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\TaxonomyConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/TaxonomyConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\TermObjectConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/TermObjectConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\ThemeConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/ThemeConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\UserConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/UserConnectionResolver.php', - 'WPGraphQL\\Data\\Connection\\UserRoleConnectionResolver' => __DIR__ . '/../..' . '/src/Data/Connection/UserRoleConnectionResolver.php', - 'WPGraphQL\\Data\\Cursor\\AbstractCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/AbstractCursor.php', - 'WPGraphQL\\Data\\Cursor\\CommentObjectCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/CommentObjectCursor.php', - 'WPGraphQL\\Data\\Cursor\\CursorBuilder' => __DIR__ . '/../..' . '/src/Data/Cursor/CursorBuilder.php', - 'WPGraphQL\\Data\\Cursor\\PostObjectCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/PostObjectCursor.php', - 'WPGraphQL\\Data\\Cursor\\TermObjectCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/TermObjectCursor.php', - 'WPGraphQL\\Data\\Cursor\\UserCursor' => __DIR__ . '/../..' . '/src/Data/Cursor/UserCursor.php', - 'WPGraphQL\\Data\\DataSource' => __DIR__ . '/../..' . '/src/Data/DataSource.php', - 'WPGraphQL\\Data\\Loader\\AbstractDataLoader' => __DIR__ . '/../..' . '/src/Data/Loader/AbstractDataLoader.php', - 'WPGraphQL\\Data\\Loader\\CommentAuthorLoader' => __DIR__ . '/../..' . '/src/Data/Loader/CommentAuthorLoader.php', - 'WPGraphQL\\Data\\Loader\\CommentLoader' => __DIR__ . '/../..' . '/src/Data/Loader/CommentLoader.php', - 'WPGraphQL\\Data\\Loader\\EnqueuedScriptLoader' => __DIR__ . '/../..' . '/src/Data/Loader/EnqueuedScriptLoader.php', - 'WPGraphQL\\Data\\Loader\\EnqueuedStylesheetLoader' => __DIR__ . '/../..' . '/src/Data/Loader/EnqueuedStylesheetLoader.php', - 'WPGraphQL\\Data\\Loader\\PluginLoader' => __DIR__ . '/../..' . '/src/Data/Loader/PluginLoader.php', - 'WPGraphQL\\Data\\Loader\\PostObjectLoader' => __DIR__ . '/../..' . '/src/Data/Loader/PostObjectLoader.php', - 'WPGraphQL\\Data\\Loader\\PostTypeLoader' => __DIR__ . '/../..' . '/src/Data/Loader/PostTypeLoader.php', - 'WPGraphQL\\Data\\Loader\\TaxonomyLoader' => __DIR__ . '/../..' . '/src/Data/Loader/TaxonomyLoader.php', - 'WPGraphQL\\Data\\Loader\\TermObjectLoader' => __DIR__ . '/../..' . '/src/Data/Loader/TermObjectLoader.php', - 'WPGraphQL\\Data\\Loader\\ThemeLoader' => __DIR__ . '/../..' . '/src/Data/Loader/ThemeLoader.php', - 'WPGraphQL\\Data\\Loader\\UserLoader' => __DIR__ . '/../..' . '/src/Data/Loader/UserLoader.php', - 'WPGraphQL\\Data\\Loader\\UserRoleLoader' => __DIR__ . '/../..' . '/src/Data/Loader/UserRoleLoader.php', - 'WPGraphQL\\Data\\MediaItemMutation' => __DIR__ . '/../..' . '/src/Data/MediaItemMutation.php', - 'WPGraphQL\\Data\\NodeResolver' => __DIR__ . '/../..' . '/src/Data/NodeResolver.php', - 'WPGraphQL\\Data\\PostObjectMutation' => __DIR__ . '/../..' . '/src/Data/PostObjectMutation.php', - 'WPGraphQL\\Data\\TermObjectMutation' => __DIR__ . '/../..' . '/src/Data/TermObjectMutation.php', - 'WPGraphQL\\Data\\UserMutation' => __DIR__ . '/../..' . '/src/Data/UserMutation.php', - 'WPGraphQL\\Model\\Avatar' => __DIR__ . '/../..' . '/src/Model/Avatar.php', - 'WPGraphQL\\Model\\Comment' => __DIR__ . '/../..' . '/src/Model/Comment.php', - 'WPGraphQL\\Model\\CommentAuthor' => __DIR__ . '/../..' . '/src/Model/CommentAuthor.php', - 'WPGraphQL\\Model\\Menu' => __DIR__ . '/../..' . '/src/Model/Menu.php', - 'WPGraphQL\\Model\\MenuItem' => __DIR__ . '/../..' . '/src/Model/MenuItem.php', - 'WPGraphQL\\Model\\Model' => __DIR__ . '/../..' . '/src/Model/Model.php', - 'WPGraphQL\\Model\\Plugin' => __DIR__ . '/../..' . '/src/Model/Plugin.php', - 'WPGraphQL\\Model\\Post' => __DIR__ . '/../..' . '/src/Model/Post.php', - 'WPGraphQL\\Model\\PostType' => __DIR__ . '/../..' . '/src/Model/PostType.php', - 'WPGraphQL\\Model\\Taxonomy' => __DIR__ . '/../..' . '/src/Model/Taxonomy.php', - 'WPGraphQL\\Model\\Term' => __DIR__ . '/../..' . '/src/Model/Term.php', - 'WPGraphQL\\Model\\Theme' => __DIR__ . '/../..' . '/src/Model/Theme.php', - 'WPGraphQL\\Model\\User' => __DIR__ . '/../..' . '/src/Model/User.php', - 'WPGraphQL\\Model\\UserRole' => __DIR__ . '/../..' . '/src/Model/UserRole.php', - 'WPGraphQL\\Mutation\\CommentCreate' => __DIR__ . '/../..' . '/src/Mutation/CommentCreate.php', - 'WPGraphQL\\Mutation\\CommentDelete' => __DIR__ . '/../..' . '/src/Mutation/CommentDelete.php', - 'WPGraphQL\\Mutation\\CommentRestore' => __DIR__ . '/../..' . '/src/Mutation/CommentRestore.php', - 'WPGraphQL\\Mutation\\CommentUpdate' => __DIR__ . '/../..' . '/src/Mutation/CommentUpdate.php', - 'WPGraphQL\\Mutation\\MediaItemCreate' => __DIR__ . '/../..' . '/src/Mutation/MediaItemCreate.php', - 'WPGraphQL\\Mutation\\MediaItemDelete' => __DIR__ . '/../..' . '/src/Mutation/MediaItemDelete.php', - 'WPGraphQL\\Mutation\\MediaItemUpdate' => __DIR__ . '/../..' . '/src/Mutation/MediaItemUpdate.php', - 'WPGraphQL\\Mutation\\PostObjectCreate' => __DIR__ . '/../..' . '/src/Mutation/PostObjectCreate.php', - 'WPGraphQL\\Mutation\\PostObjectDelete' => __DIR__ . '/../..' . '/src/Mutation/PostObjectDelete.php', - 'WPGraphQL\\Mutation\\PostObjectUpdate' => __DIR__ . '/../..' . '/src/Mutation/PostObjectUpdate.php', - 'WPGraphQL\\Mutation\\ResetUserPassword' => __DIR__ . '/../..' . '/src/Mutation/ResetUserPassword.php', - 'WPGraphQL\\Mutation\\SendPasswordResetEmail' => __DIR__ . '/../..' . '/src/Mutation/SendPasswordResetEmail.php', - 'WPGraphQL\\Mutation\\TermObjectCreate' => __DIR__ . '/../..' . '/src/Mutation/TermObjectCreate.php', - 'WPGraphQL\\Mutation\\TermObjectDelete' => __DIR__ . '/../..' . '/src/Mutation/TermObjectDelete.php', - 'WPGraphQL\\Mutation\\TermObjectUpdate' => __DIR__ . '/../..' . '/src/Mutation/TermObjectUpdate.php', - 'WPGraphQL\\Mutation\\UpdateSettings' => __DIR__ . '/../..' . '/src/Mutation/UpdateSettings.php', - 'WPGraphQL\\Mutation\\UserCreate' => __DIR__ . '/../..' . '/src/Mutation/UserCreate.php', - 'WPGraphQL\\Mutation\\UserDelete' => __DIR__ . '/../..' . '/src/Mutation/UserDelete.php', - 'WPGraphQL\\Mutation\\UserRegister' => __DIR__ . '/../..' . '/src/Mutation/UserRegister.php', - 'WPGraphQL\\Mutation\\UserUpdate' => __DIR__ . '/../..' . '/src/Mutation/UserUpdate.php', - 'WPGraphQL\\Registry\\SchemaRegistry' => __DIR__ . '/../..' . '/src/Registry/SchemaRegistry.php', - 'WPGraphQL\\Registry\\TypeRegistry' => __DIR__ . '/../..' . '/src/Registry/TypeRegistry.php', - 'WPGraphQL\\Registry\\Utils\\PostObject' => __DIR__ . '/../..' . '/src/Registry/Utils/PostObject.php', - 'WPGraphQL\\Registry\\Utils\\TermObject' => __DIR__ . '/../..' . '/src/Registry/Utils/TermObject.php', - 'WPGraphQL\\Request' => __DIR__ . '/../..' . '/src/Request.php', - 'WPGraphQL\\Router' => __DIR__ . '/../..' . '/src/Router.php', - 'WPGraphQL\\Server\\ValidationRules\\DisableIntrospection' => __DIR__ . '/../..' . '/src/Server/ValidationRules/DisableIntrospection.php', - 'WPGraphQL\\Server\\ValidationRules\\QueryDepth' => __DIR__ . '/../..' . '/src/Server/ValidationRules/QueryDepth.php', - 'WPGraphQL\\Server\\ValidationRules\\RequireAuthentication' => __DIR__ . '/../..' . '/src/Server/ValidationRules/RequireAuthentication.php', - 'WPGraphQL\\Server\\WPHelper' => __DIR__ . '/../..' . '/src/Server/WPHelper.php', - 'WPGraphQL\\Type\\Connection\\Comments' => __DIR__ . '/../..' . '/src/Type/Connection/Comments.php', - 'WPGraphQL\\Type\\Connection\\MenuItems' => __DIR__ . '/../..' . '/src/Type/Connection/MenuItems.php', - 'WPGraphQL\\Type\\Connection\\PostObjects' => __DIR__ . '/../..' . '/src/Type/Connection/PostObjects.php', - 'WPGraphQL\\Type\\Connection\\Taxonomies' => __DIR__ . '/../..' . '/src/Type/Connection/Taxonomies.php', - 'WPGraphQL\\Type\\Connection\\TermObjects' => __DIR__ . '/../..' . '/src/Type/Connection/TermObjects.php', - 'WPGraphQL\\Type\\Connection\\Users' => __DIR__ . '/../..' . '/src/Type/Connection/Users.php', - 'WPGraphQL\\Type\\Enum\\AvatarRatingEnum' => __DIR__ . '/../..' . '/src/Type/Enum/AvatarRatingEnum.php', - 'WPGraphQL\\Type\\Enum\\CommentNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/CommentNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\CommentStatusEnum' => __DIR__ . '/../..' . '/src/Type/Enum/CommentStatusEnum.php', - 'WPGraphQL\\Type\\Enum\\CommentsConnectionOrderbyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/CommentsConnectionOrderbyEnum.php', - 'WPGraphQL\\Type\\Enum\\ContentNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/ContentNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\ContentTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/ContentTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\ContentTypeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/ContentTypeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\MediaItemSizeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MediaItemSizeEnum.php', - 'WPGraphQL\\Type\\Enum\\MediaItemStatusEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MediaItemStatusEnum.php', - 'WPGraphQL\\Type\\Enum\\MenuItemNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MenuItemNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\MenuLocationEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MenuLocationEnum.php', - 'WPGraphQL\\Type\\Enum\\MenuNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MenuNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\MimeTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/MimeTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\OrderEnum' => __DIR__ . '/../..' . '/src/Type/Enum/OrderEnum.php', - 'WPGraphQL\\Type\\Enum\\PluginStatusEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PluginStatusEnum.php', - 'WPGraphQL\\Type\\Enum\\PostObjectFieldFormatEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PostObjectFieldFormatEnum.php', - 'WPGraphQL\\Type\\Enum\\PostObjectsConnectionDateColumnEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PostObjectsConnectionDateColumnEnum.php', - 'WPGraphQL\\Type\\Enum\\PostObjectsConnectionOrderbyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PostObjectsConnectionOrderbyEnum.php', - 'WPGraphQL\\Type\\Enum\\PostStatusEnum' => __DIR__ . '/../..' . '/src/Type/Enum/PostStatusEnum.php', - 'WPGraphQL\\Type\\Enum\\RelationEnum' => __DIR__ . '/../..' . '/src/Type/Enum/RelationEnum.php', - 'WPGraphQL\\Type\\Enum\\TaxonomyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TaxonomyEnum.php', - 'WPGraphQL\\Type\\Enum\\TaxonomyIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TaxonomyIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\TermNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TermNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\TermObjectsConnectionOrderbyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TermObjectsConnectionOrderbyEnum.php', - 'WPGraphQL\\Type\\Enum\\TimezoneEnum' => __DIR__ . '/../..' . '/src/Type/Enum/TimezoneEnum.php', - 'WPGraphQL\\Type\\Enum\\UserNodeIdTypeEnum' => __DIR__ . '/../..' . '/src/Type/Enum/UserNodeIdTypeEnum.php', - 'WPGraphQL\\Type\\Enum\\UserRoleEnum' => __DIR__ . '/../..' . '/src/Type/Enum/UserRoleEnum.php', - 'WPGraphQL\\Type\\Enum\\UsersConnectionOrderbyEnum' => __DIR__ . '/../..' . '/src/Type/Enum/UsersConnectionOrderbyEnum.php', - 'WPGraphQL\\Type\\Enum\\UsersConnectionSearchColumnEnum' => __DIR__ . '/../..' . '/src/Type/Enum/UsersConnectionSearchColumnEnum.php', - 'WPGraphQL\\Type\\Input\\DateInput' => __DIR__ . '/../..' . '/src/Type/Input/DateInput.php', - 'WPGraphQL\\Type\\Input\\DateQueryInput' => __DIR__ . '/../..' . '/src/Type/Input/DateQueryInput.php', - 'WPGraphQL\\Type\\Input\\PostObjectsConnectionOrderbyInput' => __DIR__ . '/../..' . '/src/Type/Input/PostObjectsConnectionOrderbyInput.php', - 'WPGraphQL\\Type\\Input\\UsersConnectionOrderbyInput' => __DIR__ . '/../..' . '/src/Type/Input/UsersConnectionOrderbyInput.php', - 'WPGraphQL\\Type\\InterfaceType\\Commenter' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Commenter.php', - 'WPGraphQL\\Type\\InterfaceType\\Connection' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Connection.php', - 'WPGraphQL\\Type\\InterfaceType\\ContentNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/ContentNode.php', - 'WPGraphQL\\Type\\InterfaceType\\ContentTemplate' => __DIR__ . '/../..' . '/src/Type/InterfaceType/ContentTemplate.php', - 'WPGraphQL\\Type\\InterfaceType\\DatabaseIdentifier' => __DIR__ . '/../..' . '/src/Type/InterfaceType/DatabaseIdentifier.php', - 'WPGraphQL\\Type\\InterfaceType\\Edge' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Edge.php', - 'WPGraphQL\\Type\\InterfaceType\\EnqueuedAsset' => __DIR__ . '/../..' . '/src/Type/InterfaceType/EnqueuedAsset.php', - 'WPGraphQL\\Type\\InterfaceType\\HierarchicalContentNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/HierarchicalContentNode.php', - 'WPGraphQL\\Type\\InterfaceType\\HierarchicalNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/HierarchicalNode.php', - 'WPGraphQL\\Type\\InterfaceType\\HierarchicalTermNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/HierarchicalTermNode.php', - 'WPGraphQL\\Type\\InterfaceType\\MenuItemLinkable' => __DIR__ . '/../..' . '/src/Type/InterfaceType/MenuItemLinkable.php', - 'WPGraphQL\\Type\\InterfaceType\\Node' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Node.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithAuthor' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithAuthor.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithComments' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithComments.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithContentEditor' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithContentEditor.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithExcerpt' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithExcerpt.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithFeaturedImage' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithFeaturedImage.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithPageAttributes' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithPageAttributes.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithRevisions' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithRevisions.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithTemplate' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithTemplate.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithTitle' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithTitle.php', - 'WPGraphQL\\Type\\InterfaceType\\NodeWithTrackbacks' => __DIR__ . '/../..' . '/src/Type/InterfaceType/NodeWithTrackbacks.php', - 'WPGraphQL\\Type\\InterfaceType\\OneToOneConnection' => __DIR__ . '/../..' . '/src/Type/InterfaceType/OneToOneConnection.php', - 'WPGraphQL\\Type\\InterfaceType\\PageInfo' => __DIR__ . '/../..' . '/src/Type/InterfaceType/PageInfo.php', - 'WPGraphQL\\Type\\InterfaceType\\Previewable' => __DIR__ . '/../..' . '/src/Type/InterfaceType/Previewable.php', - 'WPGraphQL\\Type\\InterfaceType\\TermNode' => __DIR__ . '/../..' . '/src/Type/InterfaceType/TermNode.php', - 'WPGraphQL\\Type\\InterfaceType\\UniformResourceIdentifiable' => __DIR__ . '/../..' . '/src/Type/InterfaceType/UniformResourceIdentifiable.php', - 'WPGraphQL\\Type\\ObjectType\\Avatar' => __DIR__ . '/../..' . '/src/Type/ObjectType/Avatar.php', - 'WPGraphQL\\Type\\ObjectType\\Comment' => __DIR__ . '/../..' . '/src/Type/ObjectType/Comment.php', - 'WPGraphQL\\Type\\ObjectType\\CommentAuthor' => __DIR__ . '/../..' . '/src/Type/ObjectType/CommentAuthor.php', - 'WPGraphQL\\Type\\ObjectType\\ContentType' => __DIR__ . '/../..' . '/src/Type/ObjectType/ContentType.php', - 'WPGraphQL\\Type\\ObjectType\\EnqueuedScript' => __DIR__ . '/../..' . '/src/Type/ObjectType/EnqueuedScript.php', - 'WPGraphQL\\Type\\ObjectType\\EnqueuedStylesheet' => __DIR__ . '/../..' . '/src/Type/ObjectType/EnqueuedStylesheet.php', - 'WPGraphQL\\Type\\ObjectType\\MediaDetails' => __DIR__ . '/../..' . '/src/Type/ObjectType/MediaDetails.php', - 'WPGraphQL\\Type\\ObjectType\\MediaItemMeta' => __DIR__ . '/../..' . '/src/Type/ObjectType/MediaItemMeta.php', - 'WPGraphQL\\Type\\ObjectType\\MediaSize' => __DIR__ . '/../..' . '/src/Type/ObjectType/MediaSize.php', - 'WPGraphQL\\Type\\ObjectType\\Menu' => __DIR__ . '/../..' . '/src/Type/ObjectType/Menu.php', - 'WPGraphQL\\Type\\ObjectType\\MenuItem' => __DIR__ . '/../..' . '/src/Type/ObjectType/MenuItem.php', - 'WPGraphQL\\Type\\ObjectType\\Plugin' => __DIR__ . '/../..' . '/src/Type/ObjectType/Plugin.php', - 'WPGraphQL\\Type\\ObjectType\\PostObject' => __DIR__ . '/../..' . '/src/Type/ObjectType/PostObject.php', - 'WPGraphQL\\Type\\ObjectType\\PostTypeLabelDetails' => __DIR__ . '/../..' . '/src/Type/ObjectType/PostTypeLabelDetails.php', - 'WPGraphQL\\Type\\ObjectType\\RootMutation' => __DIR__ . '/../..' . '/src/Type/ObjectType/RootMutation.php', - 'WPGraphQL\\Type\\ObjectType\\RootQuery' => __DIR__ . '/../..' . '/src/Type/ObjectType/RootQuery.php', - 'WPGraphQL\\Type\\ObjectType\\SettingGroup' => __DIR__ . '/../..' . '/src/Type/ObjectType/SettingGroup.php', - 'WPGraphQL\\Type\\ObjectType\\Settings' => __DIR__ . '/../..' . '/src/Type/ObjectType/Settings.php', - 'WPGraphQL\\Type\\ObjectType\\Taxonomy' => __DIR__ . '/../..' . '/src/Type/ObjectType/Taxonomy.php', - 'WPGraphQL\\Type\\ObjectType\\TermObject' => __DIR__ . '/../..' . '/src/Type/ObjectType/TermObject.php', - 'WPGraphQL\\Type\\ObjectType\\Theme' => __DIR__ . '/../..' . '/src/Type/ObjectType/Theme.php', - 'WPGraphQL\\Type\\ObjectType\\User' => __DIR__ . '/../..' . '/src/Type/ObjectType/User.php', - 'WPGraphQL\\Type\\ObjectType\\UserRole' => __DIR__ . '/../..' . '/src/Type/ObjectType/UserRole.php', - 'WPGraphQL\\Type\\Union\\MenuItemObjectUnion' => __DIR__ . '/../..' . '/src/Type/Union/MenuItemObjectUnion.php', - 'WPGraphQL\\Type\\Union\\PostObjectUnion' => __DIR__ . '/../..' . '/src/Type/Union/PostObjectUnion.php', - 'WPGraphQL\\Type\\Union\\TermObjectUnion' => __DIR__ . '/../..' . '/src/Type/Union/TermObjectUnion.php', - 'WPGraphQL\\Type\\WPConnectionType' => __DIR__ . '/../..' . '/src/Type/WPConnectionType.php', - 'WPGraphQL\\Type\\WPEnumType' => __DIR__ . '/../..' . '/src/Type/WPEnumType.php', - 'WPGraphQL\\Type\\WPInputObjectType' => __DIR__ . '/../..' . '/src/Type/WPInputObjectType.php', - 'WPGraphQL\\Type\\WPInterfaceTrait' => __DIR__ . '/../..' . '/src/Type/WPInterfaceTrait.php', - 'WPGraphQL\\Type\\WPInterfaceType' => __DIR__ . '/../..' . '/src/Type/WPInterfaceType.php', - 'WPGraphQL\\Type\\WPMutationType' => __DIR__ . '/../..' . '/src/Type/WPMutationType.php', - 'WPGraphQL\\Type\\WPObjectType' => __DIR__ . '/../..' . '/src/Type/WPObjectType.php', - 'WPGraphQL\\Type\\WPScalar' => __DIR__ . '/../..' . '/src/Type/WPScalar.php', - 'WPGraphQL\\Type\\WPUnionType' => __DIR__ . '/../..' . '/src/Type/WPUnionType.php', - 'WPGraphQL\\Types' => __DIR__ . '/../..' . '/src/Types.php', - 'WPGraphQL\\Utils\\DebugLog' => __DIR__ . '/../..' . '/src/Utils/DebugLog.php', - 'WPGraphQL\\Utils\\InstrumentSchema' => __DIR__ . '/../..' . '/src/Utils/InstrumentSchema.php', - 'WPGraphQL\\Utils\\Preview' => __DIR__ . '/../..' . '/src/Utils/Preview.php', - 'WPGraphQL\\Utils\\QueryAnalyzer' => __DIR__ . '/../..' . '/src/Utils/QueryAnalyzer.php', - 'WPGraphQL\\Utils\\QueryLog' => __DIR__ . '/../..' . '/src/Utils/QueryLog.php', - 'WPGraphQL\\Utils\\Tracing' => __DIR__ . '/../..' . '/src/Utils/Tracing.php', - 'WPGraphQL\\Utils\\Utils' => __DIR__ . '/../..' . '/src/Utils/Utils.php', - 'WPGraphQL\\WPSchema' => __DIR__ . '/../..' . '/src/WPSchema.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit9722c19e535d86fc968bdbe1abcb61b0::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit9722c19e535d86fc968bdbe1abcb61b0::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit9722c19e535d86fc968bdbe1abcb61b0::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/installed.json b/lib/wp-graphql-1.17.0/vendor/composer/installed.json deleted file mode 100644 index cf32b8f7..00000000 --- a/lib/wp-graphql-1.17.0/vendor/composer/installed.json +++ /dev/null @@ -1,171 +0,0 @@ -{ - "packages": [ - { - "name": "appsero/client", - "version": "v1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/Appsero/client.git", - "reference": "d110c537f4ca92ac7f3398eee67cc6bdf506a4fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Appsero/client/zipball/d110c537f4ca92ac7f3398eee67cc6bdf506a4fb", - "reference": "d110c537f4ca92ac7f3398eee67cc6bdf506a4fb", - "shasum": "" - }, - "require": { - "php": ">=5.3" - }, - "time": "2022-06-30T12:01:38+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Appsero\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Tareq Hasan", - "email": "tareq@appsero.com" - } - ], - "description": "Appsero Client", - "keywords": [ - "analytics", - "plugin", - "theme", - "wordpress" - ], - "support": { - "issues": "https://github.com/Appsero/client/issues", - "source": "https://github.com/Appsero/client/tree/v1.2.1" - }, - "install-path": "../appsero/client" - }, - { - "name": "ivome/graphql-relay-php", - "version": "v0.6.0", - "version_normalized": "0.6.0.0", - "source": { - "type": "git", - "url": "https://github.com/ivome/graphql-relay-php.git", - "reference": "7055fd45b7e552cee4d1290849b84294b0049373" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ivome/graphql-relay-php/zipball/7055fd45b7e552cee4d1290849b84294b0049373", - "reference": "7055fd45b7e552cee4d1290849b84294b0049373", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0", - "webonyx/graphql-php": "^14.0" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "satooshi/php-coveralls": "~1.0" - }, - "time": "2021-04-24T19:31:29+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "description": "A PHP port of GraphQL Relay reference implementation", - "homepage": "https://github.com/ivome/graphql-relay-php", - "keywords": [ - "Relay", - "api", - "graphql" - ], - "support": { - "issues": "https://github.com/ivome/graphql-relay-php/issues", - "source": "https://github.com/ivome/graphql-relay-php/tree/v0.6.0" - }, - "install-path": "../ivome/graphql-relay-php" - }, - { - "name": "webonyx/graphql-php", - "version": "v14.11.10", - "version_normalized": "14.11.10.0", - "source": { - "type": "git", - "url": "https://github.com/webonyx/graphql-php.git", - "reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webonyx/graphql-php/zipball/d9c2fdebc6aa01d831bc2969da00e8588cffef19", - "reference": "d9c2fdebc6aa01d831bc2969da00e8588cffef19", - "shasum": "" - }, - "require": { - "ext-json": "*", - "ext-mbstring": "*", - "php": "^7.1 || ^8" - }, - "require-dev": { - "amphp/amp": "^2.3", - "doctrine/coding-standard": "^6.0", - "nyholm/psr7": "^1.2", - "phpbench/phpbench": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "0.12.82", - "phpstan/phpstan-phpunit": "0.12.18", - "phpstan/phpstan-strict-rules": "0.12.9", - "phpunit/phpunit": "^7.2 || ^8.5", - "psr/http-message": "^1.0", - "react/promise": "2.*", - "simpod/php-coveralls-mirror": "^3.0" - }, - "suggest": { - "psr/http-message": "To use standard GraphQL server", - "react/promise": "To leverage async resolving on React PHP platform" - }, - "time": "2023-07-05T14:23:37+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "GraphQL\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP port of GraphQL reference implementation", - "homepage": "https://github.com/webonyx/graphql-php", - "keywords": [ - "api", - "graphql" - ], - "support": { - "issues": "https://github.com/webonyx/graphql-php/issues", - "source": "https://github.com/webonyx/graphql-php/tree/v14.11.10" - }, - "funding": [ - { - "url": "https://opencollective.com/webonyx-graphql-php", - "type": "open_collective" - } - ], - "install-path": "../webonyx/graphql-php" - } - ], - "dev": false, - "dev-package-names": [] -} diff --git a/lib/wp-graphql-1.17.0/vendor/composer/installed.php b/lib/wp-graphql-1.17.0/vendor/composer/installed.php deleted file mode 100644 index 42a9eb87..00000000 --- a/lib/wp-graphql-1.17.0/vendor/composer/installed.php +++ /dev/null @@ -1,50 +0,0 @@ - array( - 'name' => 'wp-graphql/wp-graphql', - 'pretty_version' => 'v1.17.0', - 'version' => '1.17.0.0', - 'reference' => '1ec24256362b86d7f857efc285fbe0cacea2f67e', - 'type' => 'wordpress-plugin', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev' => false, - ), - 'versions' => array( - 'appsero/client' => array( - 'pretty_version' => 'v1.2.1', - 'version' => '1.2.1.0', - 'reference' => 'd110c537f4ca92ac7f3398eee67cc6bdf506a4fb', - 'type' => 'library', - 'install_path' => __DIR__ . '/../appsero/client', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'ivome/graphql-relay-php' => array( - 'pretty_version' => 'v0.6.0', - 'version' => '0.6.0.0', - 'reference' => '7055fd45b7e552cee4d1290849b84294b0049373', - 'type' => 'library', - 'install_path' => __DIR__ . '/../ivome/graphql-relay-php', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'webonyx/graphql-php' => array( - 'pretty_version' => 'v14.11.10', - 'version' => '14.11.10.0', - 'reference' => 'd9c2fdebc6aa01d831bc2969da00e8588cffef19', - 'type' => 'library', - 'install_path' => __DIR__ . '/../webonyx/graphql-php', - 'aliases' => array(), - 'dev_requirement' => false, - ), - 'wp-graphql/wp-graphql' => array( - 'pretty_version' => 'v1.17.0', - 'version' => '1.17.0.0', - 'reference' => '1ec24256362b86d7f857efc285fbe0cacea2f67e', - 'type' => 'wordpress-plugin', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), - 'dev_requirement' => false, - ), - ), -); diff --git a/lib/wp-graphql-1.17.0/vendor/composer/platform_check.php b/lib/wp-graphql-1.17.0/vendor/composer/platform_check.php deleted file mode 100644 index 6d3407db..00000000 --- a/lib/wp-graphql-1.17.0/vendor/composer/platform_check.php +++ /dev/null @@ -1,26 +0,0 @@ -= 70100)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.'; -} - -if ($issues) { - if (!headers_sent()) { - header('HTTP/1.1 500 Internal Server Error'); - } - if (!ini_get('display_errors')) { - if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { - fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); - } elseif (!headers_sent()) { - echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; - } - } - trigger_error( - 'Composer detected issues in your platform: ' . implode(' ', $issues), - E_USER_ERROR - ); -} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/.travis.yml b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/.travis.yml deleted file mode 100644 index c2bd8fc7..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -php: - - 7.1 - - 7.2 - - 7.3 - - 7.4 - - 8.0 - - nightly - -install: - - composer install --prefer-dist - -script: - - mkdir -p build/logs - - ./bin/phpunit --coverage-clover build/logs/clover.xml tests/ - -after_script: - - ./bin/coveralls -v diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/LICENSE b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/LICENSE deleted file mode 100644 index 73ee842d..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2018, Ivo Meißner -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/contributors.txt b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/contributors.txt deleted file mode 100644 index d2150072..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/contributors.txt +++ /dev/null @@ -1 +0,0 @@ -Ivo Meißner diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/phpunit.xml b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/phpunit.xml deleted file mode 100644 index 6f884372..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/phpunit.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - tests - - - - - src - - - diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/ArrayConnection.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/ArrayConnection.php deleted file mode 100644 index b580b7c6..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/ArrayConnection.php +++ /dev/null @@ -1,178 +0,0 @@ - 0, - 'arrayLength' => count($data) - ]); - } - - /** - * Given a slice (subset) of an array, returns a connection object for use in - * GraphQL. - * - * This function is similar to `connectionFromArray`, but is intended for use - * cases where you know the cardinality of the connection, consider it too large - * to materialize the entire array, and instead wish pass in a slice of the - * total result large enough to cover the range specified in `args`. - * - * @return array - */ - public static function connectionFromArraySlice(array $arraySlice, $args, $meta) - { - $after = self::getArrayValueSafe($args, 'after'); - $before = self::getArrayValueSafe($args, 'before'); - $first = self::getArrayValueSafe($args, 'first'); - $last = self::getArrayValueSafe($args, 'last'); - $sliceStart = self::getArrayValueSafe($meta, 'sliceStart'); - $arrayLength = self::getArrayValueSafe($meta, 'arrayLength'); - $sliceEnd = $sliceStart + count($arraySlice); - $beforeOffset = self::getOffsetWithDefault($before, $arrayLength); - $afterOffset = self::getOffsetWithDefault($after, -1); - - $startOffset = max([ - $sliceStart - 1, - $afterOffset, - -1 - ]) + 1; - - $endOffset = min([ - $sliceEnd, - $beforeOffset, - $arrayLength - ]); - if ($first !== null) { - $endOffset = min([ - $endOffset, - $startOffset + $first - ]); - } - - if ($last !== null) { - $startOffset = max([ - $startOffset, - $endOffset - $last - ]); - } - - $slice = array_slice($arraySlice, - max($startOffset - $sliceStart, 0), - count($arraySlice) - ($sliceEnd - $endOffset) - max($startOffset - $sliceStart, 0) - ); - - $edges = array_map(function($item, $index) use ($startOffset) { - return [ - 'cursor' => self::offsetToCursor($startOffset + $index), - 'node' => $item - ]; - }, $slice, array_keys($slice)); - - $firstEdge = $edges ? $edges[0] : null; - $lastEdge = $edges ? $edges[count($edges) - 1] : null; - $lowerBound = $after ? ($afterOffset + 1) : 0; - $upperBound = $before ? ($beforeOffset) : $arrayLength; - - return [ - 'edges' => $edges, - 'pageInfo' => [ - 'startCursor' => $firstEdge ? $firstEdge['cursor'] : null, - 'endCursor' => $lastEdge ? $lastEdge['cursor'] : null, - 'hasPreviousPage' => $last !== null ? $startOffset > $lowerBound : false, - 'hasNextPage' => $first !== null ? $endOffset < $upperBound : false - ] - ]; - } - - /** - * Return the cursor associated with an object in an array. - * - * @param array $data - * @param $object - * @return null|string - */ - public static function cursorForObjectInConnection(array $data, $object) - { - $offset = -1; - for ($i = 0; $i < count($data); $i++) { - if ($data[$i] == $object){ - $offset = $i; - break; - } - } - - if ($offset === -1) { - return null; - } - - return self::offsetToCursor($offset); - } - - /** - * Returns the value for the given array key, NULL, if it does not exist - * - * @param array $array - * @param string $key - * @return mixed - */ - protected static function getArrayValueSafe(array $array, $key) - { - return array_key_exists($key, $array) ? $array[$key] : null; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/Connection.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/Connection.php deleted file mode 100644 index 46443594..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Connection/Connection.php +++ /dev/null @@ -1,195 +0,0 @@ - [ - 'type' => Type::string() - ], - 'first' => [ - 'type' => Type::int() - ] - ]; - } - - /** - * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field - * whose return type is a connection type with backward pagination. - * - * @return array - */ - public static function backwardConnectionArgs() - { - return [ - 'before' => [ - 'type' => Type::string() - ], - 'last' => [ - 'type' => Type::int() - ] - ]; - } - - /** - * Returns a GraphQLFieldConfigArgumentMap appropriate to include on a field - * whose return type is a connection type with bidirectional pagination. - * - * @return array - */ - public static function connectionArgs() - { - return array_merge( - self::forwardConnectionArgs(), - self::backwardConnectionArgs() - ); - } - - /** - * Returns a GraphQLObjectType for a connection with the given name, - * and whose nodes are of the specified type. - */ - public static function connectionDefinitions(array $config) - { - return [ - 'edgeType' => self::createEdgeType($config), - 'connectionType' => self::createConnectionType($config) - ]; - } - - /** - * Returns a GraphQLObjectType for a connection with the given name, - * and whose nodes are of the specified type. - * - * @return ObjectType - */ - public static function createConnectionType(array $config) - { - if (!array_key_exists('nodeType', $config)){ - throw new \InvalidArgumentException('Connection config needs to have at least a node definition'); - } - $nodeType = $config['nodeType']; - $name = array_key_exists('name', $config) ? $config['name'] : $nodeType->name; - $connectionFields = array_key_exists('connectionFields', $config) ? $config['connectionFields'] : []; - $edgeType = array_key_exists('edgeType', $config) ? $config['edgeType'] : null; - - $connectionType = new ObjectType([ - 'name' => $name . 'Connection', - 'description' => 'A connection to a list of items.', - 'fields' => function() use ($edgeType, $connectionFields, $config) { - return array_merge([ - 'pageInfo' => [ - 'type' => Type::nonNull(self::pageInfoType()), - 'description' => 'Information to aid in pagination.' - ], - 'edges' => [ - 'type' => Type::listOf($edgeType ?: self::createEdgeType($config)), - 'description' => 'Information to aid in pagination' - ] - ], self::resolveMaybeThunk($connectionFields)); - } - ]); - - return $connectionType; - } - - /** - * Returns a GraphQLObjectType for an edge with the given name, - * and whose nodes are of the specified type. - * - * @param array $config - * @return ObjectType - */ - public static function createEdgeType(array $config) - { - if (!array_key_exists('nodeType', $config)){ - throw new \InvalidArgumentException('Edge config needs to have at least a node definition'); - } - $nodeType = $config['nodeType']; - $name = array_key_exists('name', $config) ? $config['name'] : $nodeType->name; - $edgeFields = array_key_exists('edgeFields', $config) ? $config['edgeFields'] : []; - $resolveNode = array_key_exists('resolveNode', $config) ? $config['resolveNode'] : null; - $resolveCursor = array_key_exists('resolveCursor', $config) ? $config['resolveCursor'] : null; - - $edgeType = new ObjectType(array_merge([ - 'name' => $name . 'Edge', - 'description' => 'An edge in a connection', - 'fields' => function() use ($nodeType, $resolveNode, $resolveCursor, $edgeFields) { - return array_merge([ - 'node' => [ - 'type' => $nodeType, - 'resolve' => $resolveNode, - 'description' => 'The item at the end of the edge' - ], - 'cursor' => [ - 'type' => Type::nonNull(Type::string()), - 'resolve' => $resolveCursor, - 'description' => 'A cursor for use in pagination' - ] - ], self::resolveMaybeThunk($edgeFields)); - } - ])); - - return $edgeType; - } - - /** - * The common page info type used by all connections. - * - * @return ObjectType - */ - public static function pageInfoType() - { - if (self::$pageInfoType === null){ - self::$pageInfoType = new ObjectType([ - 'name' => 'PageInfo', - 'description' => 'Information about pagination in a connection.', - 'fields' => [ - 'hasNextPage' => [ - 'type' => Type::nonNull(Type::boolean()), - 'description' => 'When paginating forwards, are there more items?' - ], - 'hasPreviousPage' => [ - 'type' => Type::nonNull(Type::boolean()), - 'description' => 'When paginating backwards, are there more items?' - ], - 'startCursor' => [ - 'type' => Type::string(), - 'description' => 'When paginating backwards, the cursor to continue.' - ], - 'endCursor' => [ - 'type' => Type::string(), - 'description' => 'When paginating forwards, the cursor to continue.' - ] - ] - ]); - } - return self::$pageInfoType; - } - - protected static function resolveMaybeThunk ($thinkOrThunk) - { - return is_callable($thinkOrThunk) ? call_user_func($thinkOrThunk) : $thinkOrThunk; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Mutation/Mutation.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Mutation/Mutation.php deleted file mode 100644 index 3f640caf..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Mutation/Mutation.php +++ /dev/null @@ -1,120 +0,0 @@ - [ - 'type' => Type::string() - ] - ]); - }; - - $augmentedOutputFields = function () use ($outputFields) { - $outputFieldsResolved = self::resolveMaybeThunk($outputFields); - return array_merge($outputFieldsResolved !== null ? $outputFieldsResolved : [], [ - 'clientMutationId' => [ - 'type' => Type::string() - ] - ]); - }; - - $outputType = new ObjectType([ - 'name' => $name . 'Payload', - 'fields' => $augmentedOutputFields - ]); - - $inputType = new InputObjectType([ - 'name' => $name . 'Input', - 'fields' => $augmentedInputFields - ]); - - $definition = [ - 'type' => $outputType, - 'args' => [ - 'input' => [ - 'type' => Type::nonNull($inputType) - ] - ], - 'resolve' => function ($query, $args, $context, ResolveInfo $info) use ($mutateAndGetPayload) { - $payload = call_user_func($mutateAndGetPayload, $args['input'], $context, $info); - $payload['clientMutationId'] = isset($args['input']['clientMutationId']) ? $args['input']['clientMutationId'] : null; - return $payload; - } - ]; - if (array_key_exists('description', $config)){ - $definition['description'] = $config['description']; - } - if (array_key_exists('deprecationReason', $config)){ - $definition['deprecationReason'] = $config['deprecationReason']; - } - return $definition; - } - - /** - * Returns the value for the given array key, NULL, if it does not exist - * - * @param array $array - * @param string $key - * @return mixed - */ - protected static function getArrayValue(array $array, $key) - { - if (array_key_exists($key, $array)){ - return $array[$key]; - } else { - throw new \InvalidArgumentException('The config value for "' . $key . '" is required, but missing in MutationConfig."'); - } - } - - protected static function resolveMaybeThunk($thinkOrThunk) - { - return is_callable($thinkOrThunk) ? call_user_func($thinkOrThunk) : $thinkOrThunk; - } -} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Node.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Node.php deleted file mode 100644 index e5d672a5..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Node.php +++ /dev/null @@ -1,117 +0,0 @@ - 'Node', - 'description' => 'An object with an ID', - 'fields' => [ - 'id' => [ - 'type' => Type::nonNull(Type::id()), - 'description' => 'The id of the object', - ] - ], - 'resolveType' => $typeResolver - ]); - - $nodeField = [ - 'name' => 'node', - 'description' => 'Fetches an object given its ID', - 'type' => $nodeInterface, - 'args' => [ - 'id' => [ - 'type' => Type::nonNull(Type::id()), - 'description' => 'The ID of an object' - ] - ], - 'resolve' => function ($obj, $args, $context, $info) use ($idFetcher) { - return $idFetcher($args['id'], $context, $info); - } - ]; - - return [ - 'nodeInterface' => $nodeInterface, - 'nodeField' => $nodeField - ]; - } - - /** - * Takes a type name and an ID specific to that type name, and returns a - * "global ID" that is unique among all types. - * - * @param string $type - * @param string $id - * @return string - */ - public static function toGlobalId($type, $id) { - return base64_encode($type . GLOBAL_ID_DELIMITER . $id); - } - - /** - * Takes the "global ID" created by self::toGlobalId, and returns the type name and ID - * used to create it. - * - * @param $globalId - * @return array - */ - public static function fromGlobalId($globalId) { - $unbasedGlobalId = base64_decode($globalId); - $delimiterPos = strpos($unbasedGlobalId, GLOBAL_ID_DELIMITER); - return [ - 'type' => substr($unbasedGlobalId, 0, $delimiterPos), - 'id' => substr($unbasedGlobalId, $delimiterPos + 1) - ]; - } - - /** - * Creates the configuration for an id field on a node, using `self::toGlobalId` to - * construct the ID from the provided typename. The type-specific ID is fetched - * by calling idFetcher on the object, or if not provided, by accessing the `id` - * property on the object. - * - * @param string|null $typeName - * @param callable|null $idFetcher - * @return array - */ - public static function globalIdField($typeName = null, callable $idFetcher = null) { - return [ - 'name' => 'id', - 'description' => 'The ID of an object', - 'type' => Type::nonNull(Type::id()), - 'resolve' => function($obj, $args, $context, $info) use ($typeName, $idFetcher) { - return self::toGlobalId( - $typeName !== null ? $typeName : $info->parentType->name, - $idFetcher ? $idFetcher($obj, $info) : $obj['id'] - ); - } - ]; - } - -} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Plural.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Plural.php deleted file mode 100644 index 7c6ab027..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Node/Plural.php +++ /dev/null @@ -1,69 +0,0 @@ - ?any, - * description?: ?string, - * }; - * - * @param array $config - * @return array - */ - public static function pluralIdentifyingRootField(array $config) - { - $inputArgs = []; - $argName = self::getArrayValue($config, 'argName'); - $inputArgs[$argName] = [ - 'type' => Type::nonNull( - Type::listOf( - Type::nonNull(self::getArrayValue($config, 'inputType')) - ) - ) - ]; - - return [ - 'description' => isset($config['description']) ? $config['description'] : null, - 'type' => Type::listOf(self::getArrayValue($config, 'outputType')), - 'args' => $inputArgs, - 'resolve' => function ($obj, $args, $context, ResolveInfo $info) use ($argName, $config) { - $inputs = $args[$argName]; - return array_map(function($input) use ($config, $context, $info) { - return call_user_func(self::getArrayValue($config, 'resolveSingleInput'), $input, $context, $info); - }, $inputs); - } - ]; - } - - /** - * Returns the value for the given array key, NULL, if it does not exist - * - * @param array $array - * @param string $key - * @return mixed - */ - protected static function getArrayValue(array $array, $key) - { - if (array_key_exists($key, $array)){ - return $array[$key]; - } else { - throw new \InvalidArgumentException('The config value for "' . $key . '" is required, but missing in PluralIdentifyingRootFieldConfig."'); - } - } -} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Relay.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Relay.php deleted file mode 100644 index 45f2ab87..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/src/Relay.php +++ /dev/null @@ -1,219 +0,0 @@ -letters, []); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'A', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - ), - 1 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 2 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 3 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - 4 => - array ( - 'node' => 'E', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsASmallerFirst() - { - $connection = ArrayConnection::connectionFromArray($this->letters, ['first' => 2]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'A', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - ), - 1 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsAnOverlyLargeFirst() - { - $connection = ArrayConnection::connectionFromArray($this->letters, ['first' => 10]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'A', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - ), - 1 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 2 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 3 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - 4 => - array ( - 'node' => 'E', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsASmallerLast() - { - $connection = ArrayConnection::connectionFromArray($this->letters, ['last' => 2]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - 1 => - array ( - 'node' => 'E', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - 'hasPreviousPage' => true, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsAnOverlyLargeLast() - { - $connection = ArrayConnection::connectionFromArray($this->letters, ['last' => 10]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'A', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - ), - 1 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 2 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 3 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - 4 => - array ( - 'node' => 'E', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsFirstAndAfter() - { - $connection = ArrayConnection::connectionFromArray($this->letters, ['first' => 2, 'after' => 'YXJyYXljb25uZWN0aW9uOjE=']); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 1 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($connection, $expected); - } - - public function testRespectsFirstAndAfterWithLongFirst() - { - $connection = ArrayConnection::connectionFromArray($this->letters, ['first' => 10, 'after' => 'YXJyYXljb25uZWN0aW9uOjE=']); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 1 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - 2 => - array ( - 'node' => 'E', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsLastAndBefore() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'last' => 2, - 'before' => 'YXJyYXljb25uZWN0aW9uOjM=' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 1 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'hasPreviousPage' => true, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsLastAndBeforeWithLongLast() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'last' => 10, - 'before' => 'YXJyYXljb25uZWN0aW9uOjM=' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'A', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - ), - 1 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 2 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsFirstAndAfterAndBeforeTooFew() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'first' => 2, - 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 1 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsFirstAndAfterAndBeforeTooMany() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'first' => 3, - 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 1 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 2 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsFirstAndAfterAndBeforeExactlyRight() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'first' => 3, - 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 1 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 2 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsLastAndAfterAndBeforeTooFew() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'last' => 2, - 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 1 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'hasPreviousPage' => true, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsLastAndAfterAndBeforeTooMany() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'last' => 4, - 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 1 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 2 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testRespectsLastAndAfterAndBeforeExactlyRight() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'last' => 3, - 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'before' => 'YXJyYXljb25uZWN0aW9uOjQ=' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 1 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 2 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testReturnsNoElementsIfFirstIs0() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'first' => 0 - ]); - - $expected = array ( - 'edges' => - array ( - ), - 'pageInfo' => - array ( - 'startCursor' => NULL, - 'endCursor' => NULL, - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testReturnsAllElementsIfCursorsAreInvalid() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'before' => 'invalid', - 'after' => 'invalid' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'A', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - ), - 1 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 2 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 3 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - 4 => - array ( - 'node' => 'E', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testReturnsAllElementsIfCursorsAreOnTheOutside() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'before' => 'YXJyYXljb25uZWN0aW9uOjYK', - 'after' => 'YXJyYXljb25uZWN0aW9uOi0xCg==' - ]); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'A', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - ), - 1 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 2 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 3 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - 4 => - array ( - 'node' => 'E', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testReturnsNoElementsIfCursorsCross() - { - $connection = ArrayConnection::connectionFromArray($this->letters, [ - 'before' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'after' => 'YXJyYXljb25uZWN0aW9uOjQ=' - ]); - - $expected = array ( - 'edges' => - array ( - ), - 'pageInfo' => - array ( - 'startCursor' => NULL, - 'endCursor' => NULL, - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testReturnsAnEdgeCursorGivenAnArrayAndAMemberObject() - { - $cursor = ArrayConnection::cursorForObjectInConnection($this->letters, 'B'); - - $this->assertEquals('YXJyYXljb25uZWN0aW9uOjE=', $cursor); - } - - public function testReturnsNullGivenAnArrayAndANonMemberObject() - { - $cursor = ArrayConnection::cursorForObjectInConnection($this->letters, 'F'); - - $this->assertEquals(null, $cursor); - } - - public function testWorksWithAJustRightArraySlice() - { - $connection = ArrayConnection::connectionFromArraySlice( - array_slice($this->letters, 1, 2), - [ - 'first' => 2, - 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', - ], - [ - 'sliceStart' => 1, - 'arrayLength' => 5 - ] - ); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 1 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testWorksWithAnOversizedArraySliceLeftSide() - { - $connection = ArrayConnection::connectionFromArraySlice( - array_slice($this->letters, 0, 3), - [ - 'first' => 2, - 'after' => 'YXJyYXljb25uZWN0aW9uOjA=', - ], - [ - 'sliceStart' => 0, - 'arrayLength' => 5 - ] - ); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'B', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - ), - 1 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testWorksWithAnOversizedArraySliceRightSide() - { - $connection = ArrayConnection::connectionFromArraySlice( - array_slice($this->letters, 2, 2), - [ - 'first' => 1, - 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', - ], - [ - 'sliceStart' => 2, - 'arrayLength' => 5 - ] - ); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testWorksWithAnOversizedArraySliceBothSides() - { - $connection = ArrayConnection::connectionFromArraySlice( - array_slice($this->letters, 1, 3), - [ - 'first' => 1, - 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', - ], - [ - 'sliceStart' => 1, - 'arrayLength' => 5 - ] - ); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testWorksWithAnUndersizedArraySliceLeftSide() - { - $connection = ArrayConnection::connectionFromArraySlice( - array_slice($this->letters, 3, 2), - [ - 'first' => 3, - 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', - ], - [ - 'sliceStart' => 3, - 'arrayLength' => 5 - ] - ); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - 1 => - array ( - 'node' => 'E', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - 'hasPreviousPage' => false, - 'hasNextPage' => false, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testWorksWithAnUndersizedArraySliceRightSide() - { - $connection = ArrayConnection::connectionFromArraySlice( - array_slice($this->letters, 2, 2), - [ - 'first' => 3, - 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', - ], - [ - 'sliceStart' => 2, - 'arrayLength' => 5 - ] - ); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'C', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - ), - 1 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($expected, $connection); - } - - public function testWorksWithAnUndersizedArraySliceBothSides() - { - $connection = ArrayConnection::connectionFromArraySlice( - array_slice($this->letters, 3, 1), - [ - 'first' => 3, - 'after' => 'YXJyYXljb25uZWN0aW9uOjE=', - ], - [ - 'sliceStart' => 3, - 'arrayLength' => 5 - ] - ); - - $expected = array ( - 'edges' => - array ( - 0 => - array ( - 'node' => 'D', - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - ), - ), - 'pageInfo' => - array ( - 'startCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'endCursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'hasPreviousPage' => false, - 'hasNextPage' => true, - ), - ); - - $this->assertEquals($expected, $connection); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ConnectionTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ConnectionTest.php deleted file mode 100644 index 7a40004c..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/ConnectionTest.php +++ /dev/null @@ -1,278 +0,0 @@ -allUsers = [ - [ 'name' => 'Dan', 'friends' => [1, 2, 3, 4] ], - [ 'name' => 'Nick', 'friends' => [0, 2, 3, 4] ], - [ 'name' => 'Lee', 'friends' => [0, 1, 3, 4] ], - [ 'name' => 'Joe', 'friends' => [0, 1, 2, 4] ], - [ 'name' => 'Tim', 'friends' => [0, 1, 2, 3] ], - ]; - - $this->userType = new ObjectType([ - 'name' => 'User', - 'fields' => function(){ - return [ - 'name' => [ - 'type' => Type::string() - ], - 'friends' => [ - 'type' => $this->friendConnection, - 'args' => Connection::connectionArgs(), - 'resolve' => function ($user, $args) { - return ArrayConnection::connectionFromArray($user['friends'], $args); - } - ], - 'friendsForward' => [ - 'type' => $this->userConnection, - 'args' => Connection::forwardConnectionArgs(), - 'resolve' => function ($user, $args) { - return ArrayConnection::connectionFromArray($user['friends'], $args); - } - ], - 'friendsBackward' => [ - 'type' => $this->userConnection, - 'args' => Connection::backwardConnectionArgs(), - 'resolve' => function ($user, $args) { - return ArrayConnection::connectionFromArray($user['friends'], $args); - } - ] - ]; - } - ]); - - $this->friendConnection = Connection::connectionDefinitions([ - 'name' => 'Friend', - 'nodeType' => $this->userType, - 'resolveNode' => function ($edge) { - return $this->allUsers[$edge['node']]; - }, - 'edgeFields' => function() { - return [ - 'friendshipTime' => [ - 'type' => Type::string(), - 'resolve' => function() { return 'Yesterday'; } - ] - ]; - }, - 'connectionFields' => function() { - return [ - 'totalCount' => [ - 'type' => Type::int(), - 'resolve' => function() { - return count($this->allUsers) -1; - } - ] - ]; - } - ])['connectionType']; - - $this->userConnection = Connection::connectionDefinitions([ - 'nodeType' => $this->userType, - 'resolveNode' => function ($edge) { - return $this->allUsers[$edge['node']]; - } - ])['connectionType']; - - $this->queryType = new ObjectType([ - 'name' => 'Query', - 'fields' => function() { - return [ - 'user' => [ - 'type' => $this->userType, - 'resolve' => function() { - return $this->allUsers[0]; - } - ] - ]; - } - ]); - - $this->schema = new Schema([ - 'query' => $this->queryType - ]); - } - - public function testIncludesConnectionAndEdgeFields() - { - $query = 'query FriendsQuery { - user { - friends(first: 2) { - totalCount - edges { - friendshipTime - node { - name - } - } - } - } - }'; - - $expected = [ - 'user' => [ - 'friends' => [ - 'totalCount' => 4, - 'edges' => [ - [ - 'friendshipTime' => 'Yesterday', - 'node' => [ - 'name' => 'Nick' - ] - ], - [ - 'friendshipTime' => 'Yesterday', - 'node' => [ - 'name' => 'Lee' - ] - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testWorksWithForwardConnectionArgs() - { - $query = 'query FriendsQuery { - user { - friendsForward(first: 2) { - edges { - node { - name - } - } - } - } - }'; - $expected = [ - 'user' => [ - 'friendsForward' => [ - 'edges' => [ - [ - 'node' => [ - 'name' => 'Nick' - ] - ], - [ - 'node' => [ - 'name' => 'Lee' - ] - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testWorksWithBackwardConnectionArgs() - { - $query = 'query FriendsQuery { - user { - friendsBackward(last: 2) { - edges { - node { - name - } - } - } - } - }'; - - $expected = [ - 'user' => [ - 'friendsBackward' => [ - 'edges' => [ - [ - 'node' => [ - 'name' => 'Joe' - ] - ], - [ - 'node' => [ - 'name' => 'Tim' - ] - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testEdgeTypeThrowsWithoutNodeType() { - $this->expectException(\InvalidArgumentException::class); - Connection::createEdgeType([]); - } - - public function testConnectionTypeThrowsWithoutNodeType() { - $this->expectException(\InvalidArgumentException::class); - Connection::createConnectionType([]); - } - - public function testConnectionDefinitionThrowsWithoutNodeType() { - $this->expectException(\InvalidArgumentException::class); - Connection::connectionDefinitions([]); - } - - /** - * Helper function to test a query and the expected response. - */ - protected function assertValidQuery($query, $expected) - { - $result = GraphQL::executeQuery($this->schema, $query)->toArray(); - $this->assertEquals(['data' => $expected], $result); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/SeparateConnectionTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/SeparateConnectionTest.php deleted file mode 100644 index 696f48dc..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Connection/SeparateConnectionTest.php +++ /dev/null @@ -1,284 +0,0 @@ -allUsers = [ - [ 'name' => 'Dan', 'friends' => [1, 2, 3, 4] ], - [ 'name' => 'Nick', 'friends' => [0, 2, 3, 4] ], - [ 'name' => 'Lee', 'friends' => [0, 1, 3, 4] ], - [ 'name' => 'Joe', 'friends' => [0, 1, 2, 4] ], - [ 'name' => 'Tim', 'friends' => [0, 1, 2, 3] ], - ]; - - $this->userType = new ObjectType([ - 'name' => 'User', - 'fields' => function(){ - return [ - 'name' => [ - 'type' => Type::string() - ], - 'friends' => [ - 'type' => $this->friendConnection, - 'args' => Connection::connectionArgs(), - 'resolve' => function ($user, $args) { - return ArrayConnection::connectionFromArray($user['friends'], $args); - } - ], - 'friendsForward' => [ - 'type' => $this->userConnection, - 'args' => Connection::forwardConnectionArgs(), - 'resolve' => function ($user, $args) { - return ArrayConnection::connectionFromArray($user['friends'], $args); - } - ], - 'friendsBackward' => [ - 'type' => $this->userConnection, - 'args' => Connection::backwardConnectionArgs(), - 'resolve' => function ($user, $args) { - return ArrayConnection::connectionFromArray($user['friends'], $args); - } - ] - ]; - } - ]); - - $this->friendEdge = Connection::createEdgeType([ - 'name' => 'Friend', - 'nodeType' => $this->userType, - 'resolveNode' => function ($edge) { - return $this->allUsers[$edge['node']]; - }, - 'edgeFields' => function() { - return [ - 'friendshipTime' => [ - 'type' => Type::string(), - 'resolve' => function() { return 'Yesterday'; } - ] - ]; - } - ]); - - $this->friendConnection = Connection::createConnectionType([ - 'name' => 'Friend', - 'nodeType' => $this->userType, - 'edgeType' => $this->friendEdge, - 'connectionFields' => function() { - return [ - 'totalCount' => [ - 'type' => Type::int(), - 'resolve' => function() { - return count($this->allUsers) -1; - } - ] - ]; - } - ]); - - $this->userEdge = Connection::createEdgeType([ - 'nodeType' => $this->userType, - 'resolveNode' => function ($edge) { - return $this->allUsers[$edge['node']]; - } - ]); - - $this->userConnection = Connection::createConnectionType([ - 'nodeType' => $this->userType, - 'edgeType' => $this->userEdge - ]); - - $this->queryType = new ObjectType([ - 'name' => 'Query', - 'fields' => function() { - return [ - 'user' => [ - 'type' => $this->userType, - 'resolve' => function() { - return $this->allUsers[0]; - } - ] - ]; - } - ]); - - $this->schema = new Schema([ - 'query' => $this->queryType - ]); - } - - public function testIncludesConnectionAndEdgeFields() - { - $query = 'query FriendsQuery { - user { - friends(first: 2) { - totalCount - edges { - friendshipTime - node { - name - } - } - } - } - }'; - - $expected = [ - 'user' => [ - 'friends' => [ - 'totalCount' => 4, - 'edges' => [ - [ - 'friendshipTime' => 'Yesterday', - 'node' => [ - 'name' => 'Nick' - ] - ], - [ - 'friendshipTime' => 'Yesterday', - 'node' => [ - 'name' => 'Lee' - ] - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testWorksWithForwardConnectionArgs() - { - $query = 'query FriendsQuery { - user { - friendsForward(first: 2) { - edges { - node { - name - } - } - } - } - }'; - $expected = [ - 'user' => [ - 'friendsForward' => [ - 'edges' => [ - [ - 'node' => [ - 'name' => 'Nick' - ] - ], - [ - 'node' => [ - 'name' => 'Lee' - ] - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testWorksWithBackwardConnectionArgs() - { - $query = 'query FriendsQuery { - user { - friendsBackward(last: 2) { - edges { - node { - name - } - } - } - } - }'; - - $expected = [ - 'user' => [ - 'friendsBackward' => [ - 'edges' => [ - [ - 'node' => [ - 'name' => 'Joe' - ] - ], - [ - 'node' => [ - 'name' => 'Tim' - ] - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - /** - * Helper function to test a query and the expected response. - */ - protected function assertValidQuery($query, $expected) - { - $result = GraphQL::executeQuery($this->schema, $query)->toArray(); - $this->assertEquals(['data' => $expected], $result); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Mutation/MutationTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Mutation/MutationTest.php deleted file mode 100644 index fa9147c6..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Mutation/MutationTest.php +++ /dev/null @@ -1,565 +0,0 @@ -simpleMutation = Mutation::mutationWithClientMutationId([ - 'name' => 'SimpleMutation', - 'inputFields' => [], - 'outputFields' => [ - 'result' => [ - 'type' => Type::int() - ] - ], - 'mutateAndGetPayload' => function () { - return ['result' => 1]; - } - ]); - - $this->simpleMutationWithDescription = Mutation::mutationWithClientMutationId([ - 'name' => 'SimpleMutationWithDescription', - 'description' => 'Simple Mutation Description', - 'inputFields' => [], - 'outputFields' => [ - 'result' => [ - 'type' => Type::int() - ] - ], - 'mutateAndGetPayload' => function () { - return ['result' => 1]; - } - ]); - - $this->simpleMutationWithDeprecationReason = Mutation::mutationWithClientMutationId([ - 'name' => 'SimpleMutationWithDeprecationReason', - 'inputFields' => [], - 'outputFields' => [ - 'result' => [ - 'type' => Type::int() - ] - ], - 'mutateAndGetPayload' => function () { - return ['result' => 1]; - }, - 'deprecationReason' => 'Just because' - ]); - - $this->simpleMutationWithThunkFields = Mutation::mutationWithClientMutationId([ - 'name' => 'SimpleMutationWithThunkFields', - 'inputFields' => function() { - return [ - 'inputData' => [ - 'type' => Type::int() - ] - ]; - }, - 'outputFields' => function() { - return [ - 'result' => [ - 'type' => Type::int() - ] - ]; - }, - 'mutateAndGetPayload' => function($inputData) { - return [ - 'result' => $inputData['inputData'] - ]; - } - ]); - - $userType = new ObjectType([ - 'name' => 'User', - 'fields' => [ - 'name' => [ - 'type' => Type::string() - ] - ] - ]); - - $this->edgeMutation = Mutation::mutationWithClientMutationId([ - 'name' => 'EdgeMutation', - 'inputFields' => [], - 'outputFields' => [ - 'result' => [ - 'type' => Connection::createEdgeType(['nodeType' => $userType ]) - ] - ], - 'mutateAndGetPayload' => function () { - return ['result' => ['node' => ['name' => 'Robert'], 'cursor' => 'SWxvdmVHcmFwaFFM']]; - } - ]); - - $this->mutation = new ObjectType([ - 'name' => 'Mutation', - 'fields' => [ - 'simpleMutation' => $this->simpleMutation, - 'simpleMutationWithDescription' => $this->simpleMutationWithDescription, - 'simpleMutationWithDeprecationReason' => $this->simpleMutationWithDeprecationReason, - 'simpleMutationWithThunkFields' => $this->simpleMutationWithThunkFields, - 'edgeMutation' => $this->edgeMutation - ] - ]); - - $this->schema = new Schema([ - 'mutation' => $this->mutation, - 'query' => $this->mutation - ]); - } - - public function testRequiresAnArgument() { - $query = 'mutation M { - simpleMutation { - result - } - }'; - - $result = GraphQL::executeQuery($this->schema, $query)->toArray(); - - $this->assertEquals(count($result['errors']), 1); - $this->assertEquals($result['errors'][0]['message'], 'Field "simpleMutation" argument "input" of type "SimpleMutationInput!" is required but not provided.'); - } - - public function testReturnsTheSameClientMutationID() - { - $query = 'mutation M { - simpleMutation(input: {clientMutationId: "abc"}) { - result - clientMutationId - } - }'; - - $expected = [ - 'simpleMutation' => [ - 'result' => 1, - 'clientMutationId' => 'abc' - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testReturnsNullWithOmittedClientMutationID() - { - $query = 'mutation M { - simpleMutation(input: {}) { - result - clientMutationId - } - }'; - - $expected = [ - 'simpleMutation' => [ - 'result' => 1, - 'clientMutationId' => null - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testSupportsEdgeAsOutputField() - { - $query = 'mutation M { - edgeMutation(input: {clientMutationId: "abc"}) { - result { - node { - name - } - cursor - } - clientMutationId - } - }'; - - $expected = [ - 'edgeMutation' => [ - 'result' => [ - 'node' => ['name' => 'Robert'], - 'cursor' => 'SWxvdmVHcmFwaFFM' - ], - 'clientMutationId' => 'abc' - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testIntrospection() - { - $query = '{ - __type(name: "SimpleMutationInput") { - name - kind - inputFields { - name - type { - name - kind - ofType { - name - kind - } - } - } - } - }'; - - $expected = [ - '__type' => [ - 'name' => 'SimpleMutationInput', - 'kind' => 'INPUT_OBJECT', - 'inputFields' => [ - [ - 'name' => 'clientMutationId', - 'type' => [ - 'name' => 'String', - 'kind' => 'SCALAR', - 'ofType' => null - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testContainsCorrectPayload() { - $query = '{ - __type(name: "SimpleMutationPayload") { - name - kind - fields { - name - type { - name - kind - ofType { - name - kind - } - } - } - } - }'; - - $expected = [ - '__type' => [ - 'name' => 'SimpleMutationPayload', - 'kind' => 'OBJECT', - 'fields' => [ - [ - 'name' => 'result', - 'type' => [ - 'name' => 'Int', - 'kind' => 'SCALAR', - 'ofType' => null - ] - ], - [ - 'name' => 'clientMutationId', - 'type' => [ - 'name' => 'String', - 'kind' => 'SCALAR', - 'ofType' => null - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testContainsCorrectField() - { - $query = '{ - __schema { - mutationType { - fields { - name - args { - name - type { - name - kind - ofType { - name - kind - } - } - } - type { - name - kind - } - } - } - } - }'; - - $expected = [ - '__schema' => [ - 'mutationType' => [ - 'fields' => [ - [ - 'name' => 'simpleMutation', - 'args' => [ - [ - 'name' => 'input', - 'type' => [ - 'name' => null, - 'kind' => 'NON_NULL', - 'ofType' => [ - 'name' => 'SimpleMutationInput', - 'kind' => 'INPUT_OBJECT' - ] - ], - ] - ], - 'type' => [ - 'name' => 'SimpleMutationPayload', - 'kind' => 'OBJECT', - ] - ], - [ - 'name' => 'simpleMutationWithDescription', - 'args' => [ - [ - 'name' => 'input', - 'type' => [ - 'name' => null, - 'kind' => 'NON_NULL', - 'ofType' => [ - 'name' => 'SimpleMutationWithDescriptionInput', - 'kind' => 'INPUT_OBJECT' - ] - ], - ] - ], - 'type' => [ - 'name' => 'SimpleMutationWithDescriptionPayload', - 'kind' => 'OBJECT', - ] - ], - [ - 'name' => 'simpleMutationWithThunkFields', - 'args' => [ - [ - 'name' => 'input', - 'type' => [ - 'name' => null, - 'kind' => 'NON_NULL', - 'ofType' => [ - 'name' => 'SimpleMutationWithThunkFieldsInput', - 'kind' => 'INPUT_OBJECT' - ] - ], - ] - ], - 'type' => [ - 'name' => 'SimpleMutationWithThunkFieldsPayload', - 'kind' => 'OBJECT', - ] - ], - [ - 'name' => 'edgeMutation', - 'args' => [ - [ - 'name' => 'input', - 'type' => [ - 'name' => null, - 'kind' => 'NON_NULL', - 'ofType' => [ - 'name' => 'EdgeMutationInput', - 'kind' => 'INPUT_OBJECT' - ] - ], - ] - ], - 'type' => [ - 'name' => 'EdgeMutationPayload', - 'kind' => 'OBJECT', - ] - ], - /* - * Promises not implemented right now - [ - 'name' => 'simplePromiseMutation', - 'args' => [ - [ - 'name' => 'input', - 'type' => [ - 'name' => null, - 'kind' => 'NON_NULL', - 'ofType' => [ - 'name' => 'SimplePromiseMutationInput', - 'kind' => 'INPUT_OBJECT' - ] - ], - ] - ], - 'type' => [ - 'name' => 'SimplePromiseMutationPayload', - 'kind' => 'OBJECT', - ] - ]*/ - ] - ] - ] - ]; - - $result = GraphQL::executeQuery($this->schema, $query)->toArray(); - - $this->assertValidQuery($query, $expected); - } - - public function testContainsCorrectDescriptions() { - $query = '{ - __schema { - mutationType { - fields { - name - description - } - } - } - }'; - - $expected = [ - '__schema' => [ - 'mutationType' => [ - 'fields' => [ - [ - 'name' => 'simpleMutation', - 'description' => null - ], - [ - 'name' => 'simpleMutationWithDescription', - 'description' => 'Simple Mutation Description' - ], - [ - 'name' => 'simpleMutationWithThunkFields', - 'description' => null - ], - [ - 'name' => 'edgeMutation', - 'description' => null - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testContainsCorrectDeprecationReasons() { - $query = '{ - __schema { - mutationType { - fields(includeDeprecated: true) { - name - isDeprecated - deprecationReason - } - } - } - }'; - - $expected = [ - '__schema' => [ - 'mutationType' => [ - 'fields' => [ - [ - 'name' => 'simpleMutation', - 'isDeprecated' => false, - 'deprecationReason' => null - ], - [ - 'name' => 'simpleMutationWithDescription', - 'isDeprecated' => false, - 'deprecationReason' => null - ], - [ - 'name' => 'simpleMutationWithDeprecationReason', - 'isDeprecated' => true, - 'deprecationReason' => 'Just because', - ], - [ - 'name' => 'simpleMutationWithThunkFields', - 'isDeprecated' => false, - 'deprecationReason' => null - ], - [ - 'name' => 'edgeMutation', - 'isDeprecated' => false, - 'deprecationReason' => null - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - /** - * Helper function to test a query and the expected response. - */ - protected function assertValidQuery($query, $expected) - { - $this->assertEquals(['data' => $expected], GraphQL::executeQuery($this->schema, $query)->toArray()); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/NodeTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/NodeTest.php deleted file mode 100644 index a3050baa..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/NodeTest.php +++ /dev/null @@ -1,411 +0,0 @@ - [ - 'id' => 1 - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testGetsCorrectIDForPhotos() { - $query = '{ - node(id: "4") { - id - } - }'; - - $expected = [ - 'node' => [ - 'id' => 4 - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testGetsCorrectNameForUsers() { - $query = '{ - node(id: "1") { - id - ... on User { - name - } - } - }'; - - $expected = [ - 'node' => [ - 'id' => '1', - 'name' => 'John Doe' - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testGetsCorrectWidthForPhotos() { - $query = '{ - node(id: "4") { - id - ... on Photo { - width - } - } - }'; - - $expected = [ - 'node' => [ - 'id' => '4', - 'width' => 400 - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testGetsCorrectTypeNameForUsers() { - $query = '{ - node(id: "1") { - id - __typename - } - }'; - - $expected = [ - 'node' => [ - 'id' => '1', - '__typename' => 'User' - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testCorrectWidthForPhotos() { - $query = '{ - node(id: "4") { - id - __typename - } - }'; - - $expected = [ - 'node' => [ - 'id' => '4', - '__typename' => 'Photo' - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testIgnoresPhotoFragmentsOnUser() { - $query = '{ - node(id: "1") { - id - ... on Photo { - width - } - } - }'; - $expected = [ - 'node' => [ - 'id' => '1' - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testReturnsNullForBadIDs() { - $query = '{ - node(id: "5") { - id - } - }'; - - $expected = [ - 'node' => null - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testHasCorrectNodeInterface() { - $query = '{ - __type(name: "Node") { - name - kind - fields { - name - type { - kind - ofType { - name - kind - } - } - } - } - }'; - - $expected = [ - '__type' => [ - 'name' => 'Node', - 'kind' => 'INTERFACE', - 'fields' => [ - [ - 'name' => 'id', - 'type' => [ - 'kind' => 'NON_NULL', - 'ofType' => [ - 'name' => 'ID', - 'kind' => 'SCALAR' - ] - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - public function testHasCorrectNodeRootField() { - $query = '{ - __schema { - queryType { - fields { - name - type { - name - kind - } - args { - name - type { - kind - ofType { - name - kind - } - } - } - } - } - } - }'; - - $expected = [ - '__schema' => [ - 'queryType' => [ - 'fields' => [ - [ - 'name' => 'node', - 'type' => [ - 'name' => 'Node', - 'kind' => 'INTERFACE' - ], - 'args' => [ - [ - 'name' => 'id', - 'type' => [ - 'kind' => 'NON_NULL', - 'ofType' => [ - 'name' => 'ID', - 'kind' => 'SCALAR' - ] - ] - ] - ] - ] - ] - ] - ] - ]; - - $this->assertValidQuery($query, $expected); - } - - /** - * Returns test schema - * - * @return Schema - */ - protected function getSchema() { - return new Schema([ - 'query' => $this->getQueryType(), - - // We have to pass the types here manually because graphql-php cannot - // recognize types that are only available through interfaces - // https://github.com/webonyx/graphql-php/issues/38 - 'types' => [ - self::$userType, - self::$photoType - ] - ]); - } - - /** - * Returns test query type - * - * @return ObjectType - */ - protected function getQueryType() { - $nodeField = $this->getNodeDefinitions(); - return new ObjectType([ - 'name' => 'Query', - 'fields' => [ - 'node' => $nodeField['nodeField'] - ] - ]); - } - - /** - * Returns node definitions - * - * @return array - */ - protected function getNodeDefinitions() { - if (!self::$nodeDefinition){ - self::$nodeDefinition = Node::nodeDefinitions( - function($id, $context, ResolveInfo $info) { - $userData = $this->getUserData(); - if (array_key_exists($id, $userData)){ - return $userData[$id]; - } else { - $photoData = $this->getPhotoData(); - if (array_key_exists($id, $photoData)){ - return $photoData[$id]; - } - } - }, - function($obj) { - if (array_key_exists($obj['id'], $this->getUserData())){ - return self::$userType; - } else { - return self::$photoType; - } - } - ); - - self::$userType = new ObjectType([ - 'name' => 'User', - 'fields' => [ - 'id' => [ - 'type' => Type::nonNull(Type::id()), - ], - 'name' => [ - 'type' => Type::string() - ] - ], - 'interfaces' => [self::$nodeDefinition['nodeInterface']] - ]); - - self::$photoType = new ObjectType([ - 'name' => 'Photo', - 'fields' => [ - 'id' => [ - 'type' => Type::nonNull(Type::id()) - ], - 'width' => [ - 'type' => Type::int() - ] - ], - 'interfaces' => [self::$nodeDefinition['nodeInterface']] - ]); - } - return self::$nodeDefinition; - } - - /** - * Returns photo data - * - * @return array - */ - protected function getPhotoData() { - return [ - '3' => [ - 'id' => 3, - 'width' => 300 - ], - '4' => [ - 'id' => 4, - 'width' => 400 - ] - ]; - } - - /** - * Returns user data - * - * @return array - */ - protected function getUserData() { - return [ - '1' => [ - 'id' => 1, - 'name' => 'John Doe' - ], - '2' => [ - 'id' => 2, - 'name' => 'Jane Smith' - ] - ]; - } - - /** - * Helper function to test a query and the expected response. - */ - private function assertValidQuery($query, $expected) - { - $result = GraphQL::executeQuery($this->getSchema(), $query)->toArray(); - - $this->assertEquals(['data' => $expected], $result); - } - -} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/PluralTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/PluralTest.php deleted file mode 100644 index 6bae1a49..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/Node/PluralTest.php +++ /dev/null @@ -1,186 +0,0 @@ - 'User', - 'fields' => function() { - return [ - 'username' => [ - 'type' => Type::string() - ], - 'url' => [ - 'type' => Type::string() - ] - ]; - } - ]); - - $queryType = new ObjectType([ - 'name' => 'Query', - 'fields' => function() use ($userType) { - return [ - 'usernames' => Plural::pluralIdentifyingRootField([ - 'argName' => 'usernames', - 'description' => 'Map from a username to the user', - 'inputType' => Type::string(), - 'outputType' => $userType, - 'resolveSingleInput' => function ($userName, $context, $info) { - return [ - 'username' => $userName, - 'url' => 'www.facebook.com/' . $userName . '?lang=' . $info->rootValue['lang'] - ]; - } - ]) - ]; - } - ]); - - return new Schema([ - 'query' => $queryType - ]); - } - - public function testAllowsFetching() { - $query = '{ - usernames(usernames:["dschafer", "leebyron", "schrockn"]) { - username - url - } - }'; - - $expected = array ( - 'usernames' => - array ( - 0 => - array ( - 'username' => 'dschafer', - 'url' => 'www.facebook.com/dschafer?lang=en', - ), - 1 => - array ( - 'username' => 'leebyron', - 'url' => 'www.facebook.com/leebyron?lang=en', - ), - 2 => - array ( - 'username' => 'schrockn', - 'url' => 'www.facebook.com/schrockn?lang=en', - ), - ), - ); - - $this->assertValidQuery($query, $expected); - } - - public function testCorrectlyIntrospects() - { - $query = '{ - __schema { - queryType { - fields { - name - args { - name - type { - kind - ofType { - kind - ofType { - kind - ofType { - name - kind - } - } - } - } - } - type { - kind - ofType { - name - kind - } - } - } - } - } - }'; - $expected = array ( - '__schema' => - array ( - 'queryType' => - array ( - 'fields' => - array ( - 0 => - array ( - 'name' => 'usernames', - 'args' => - array ( - 0 => - array ( - 'name' => 'usernames', - 'type' => - array ( - 'kind' => 'NON_NULL', - 'ofType' => - array ( - 'kind' => 'LIST', - 'ofType' => - array ( - 'kind' => 'NON_NULL', - 'ofType' => - array ( - 'name' => 'String', - 'kind' => 'SCALAR', - ), - ), - ), - ), - ), - ), - 'type' => - array ( - 'kind' => 'LIST', - 'ofType' => - array ( - 'name' => 'User', - 'kind' => 'OBJECT', - ), - ), - ), - ), - ), - ), - ); - - $this->assertValidQuery($query, $expected); - } - - /** - * Helper function to test a query and the expected response. - */ - private function assertValidQuery($query, $expected) - { - $result = GraphQL::executeQuery($this->getSchema(), $query, ['lang' => 'en'])->toArray(); - $this->assertEquals(['data' => $expected], $result); - } -} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/RelayTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/RelayTest.php deleted file mode 100644 index 0c6e4175..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/RelayTest.php +++ /dev/null @@ -1,73 +0,0 @@ -assertEquals( - Connection::forwardConnectionArgs(), - Relay::forwardConnectionArgs() - ); - } - - public function testBackwardConnectionArgs() - { - $this->assertEquals( - Connection::backwardConnectionArgs(), - Relay::backwardConnectionArgs() - ); - } - - public function testConnectionArgs() - { - $this->assertEquals( - Connection::connectionArgs(), - Relay::connectionArgs() - ); - } - - public function testConnectionDefinitions() - { - $nodeType = new ObjectType(['name' => 'test']); - $config = ['nodeType' => $nodeType]; - - $this->assertEquals( - Connection::connectionDefinitions($config), - Relay::connectionDefinitions($config) - ); - } - - public function testConnectionType() - { - $nodeType = new ObjectType(['name' => 'test']); - $config = ['nodeType' => $nodeType]; - - $this->assertEquals( - Connection::createConnectionType($config), - Relay::connectionType($config) - ); - } - - public function testEdgeType() - { - $nodeType = new ObjectType(['name' => 'test']); - $config = ['nodeType' => $nodeType]; - - $this->assertEquals( - Connection::createEdgeType($config), - Relay::edgeType($config) - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsConnectionTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsConnectionTest.php deleted file mode 100644 index d060e493..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsConnectionTest.php +++ /dev/null @@ -1,291 +0,0 @@ - - array ( - 'name' => 'Alliance to Restore the Republic', - 'ships' => - array ( - 'edges' => - array ( - 0 => - array ( - 'node' => - array ( - 'name' => 'X-Wing', - ), - ), - ), - ), - ), - ); - - $this->assertValidQuery($query, $expected); - } - - public function testFetchesTheFirstTwoShipsOfTheRebelsWithACursor() - { - $query = 'query MoreRebelShipsQuery { - rebels { - name, - ships(first: 2) { - edges { - cursor, - node { - name - } - } - } - } - }'; - - $expected = array ( - 'rebels' => - array ( - 'name' => 'Alliance to Restore the Republic', - 'ships' => - array ( - 'edges' => - array ( - 0 => - array ( - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjA=', - 'node' => - array ( - 'name' => 'X-Wing', - ), - ), - 1 => - array ( - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjE=', - 'node' => - array ( - 'name' => 'Y-Wing', - ), - ), - ), - ), - ), - ); - - $this->assertValidQuery($query, $expected); - } - - public function testFetchesTheNextThreeShipsOfTHeRebelsWithACursor() - { - $query = 'query EndOfRebelShipsQuery { - rebels { - name, - ships(first: 3 after: "YXJyYXljb25uZWN0aW9uOjE=") { - edges { - cursor, - node { - name - } - } - } - } - }'; - - $expected = array ( - 'rebels' => - array ( - 'name' => 'Alliance to Restore the Republic', - 'ships' => - array ( - 'edges' => - array ( - 0 => - array ( - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjI=', - 'node' => - array ( - 'name' => 'A-Wing', - ), - ), - 1 => - array ( - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjM=', - 'node' => - array ( - 'name' => 'Millenium Falcon', - ), - ), - 2 => - array ( - 'cursor' => 'YXJyYXljb25uZWN0aW9uOjQ=', - 'node' => - array ( - 'name' => 'Home One', - ), - ), - ), - ), - ), - ); - - $this->assertValidQuery($query, $expected); - } - - public function testFetchesNoShipsOfTheRebelsAtTheEndOfConnection() - { - $query = 'query RebelsQuery { - rebels { - name, - ships(first: 3 after: "YXJyYXljb25uZWN0aW9uOjQ=") { - edges { - cursor, - node { - name - } - } - } - } - }'; - - $expected = array ( - 'rebels' => - array ( - 'name' => 'Alliance to Restore the Republic', - 'ships' => - array ( - 'edges' => - array ( - ), - ), - ), - ); - - $this->assertValidQuery($query, $expected); - } - - public function testIdentifiesTheEndOfTheList() - { - $query = 'query EndOfRebelShipsQuery { - rebels { - name, - originalShips: ships(first: 2) { - edges { - node { - name - } - } - pageInfo { - hasNextPage - } - } - moreShips: ships(first: 3 after: "YXJyYXljb25uZWN0aW9uOjE=") { - edges { - node { - name - } - } - pageInfo { - hasNextPage - } - } - } - }'; - $expected = array ( - 'rebels' => - array ( - 'name' => 'Alliance to Restore the Republic', - 'originalShips' => - array ( - 'edges' => - array ( - 0 => - array ( - 'node' => - array ( - 'name' => 'X-Wing', - ), - ), - 1 => - array ( - 'node' => - array ( - 'name' => 'Y-Wing', - ), - ), - ), - 'pageInfo' => - array ( - 'hasNextPage' => true, - ), - ), - 'moreShips' => - array ( - 'edges' => - array ( - 0 => - array ( - 'node' => - array ( - 'name' => 'A-Wing', - ), - ), - 1 => - array ( - 'node' => - array ( - 'name' => 'Millenium Falcon', - ), - ), - 2 => - array ( - 'node' => - array ( - 'name' => 'Home One', - ), - ), - ), - 'pageInfo' => - array ( - 'hasNextPage' => false, - ), - ), - ), - ); - - $this->assertValidQuery($query, $expected); - } - - /** - * Helper function to test a query and the expected response. - */ - private function assertValidQuery($query, $expected) - { - $result = GraphQL::executeQuery(StarWarsSchema::getSchema(), $query)->toArray(); - - $this->assertEquals(['data' => $expected], $result); - } -} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsData.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsData.php deleted file mode 100644 index bcbbb49b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsData.php +++ /dev/null @@ -1,139 +0,0 @@ - '1', - 'name' => 'X-Wing' - ]; - - protected static $ywing = [ - 'id' => '2', - 'name' => 'Y-Wing' - ]; - - protected static $awing = [ - 'id' => '3', - 'name' => 'A-Wing' - ]; - - protected static $falcon = [ - 'id' => '4', - 'name' => 'Millenium Falcon' - ]; - - protected static $homeOne = [ - 'id' => '5', - 'name' => 'Home One' - ]; - - protected static $tieFighter = [ - 'id' => '6', - 'name' => 'TIE Fighter' - ]; - - protected static $tieInterceptor = [ - 'id' => '7', - 'name' => 'TIE Interceptor' - ]; - - protected static $executor = [ - 'id' => '8', - 'name' => 'TIE Interceptor' - ]; - - protected static $rebels = [ - 'id' => '1', - 'name' => 'Alliance to Restore the Republic', - 'ships' => ['1', '2', '3', '4', '5'] - ]; - - protected static $empire = [ - 'id' => '2', - 'name' => 'Galactic Empire', - 'ships' => ['6', '7', '8'] - ]; - - protected static $nextShip = 9; - - protected static $data; - - /** - * Returns the data object - * - * @return array $array - */ - protected static function getData() - { - if (self::$data === null) { - self::$data = [ - 'Faction' => [ - '1' => self::$rebels, - '2' => self::$empire - ], - 'Ship' => [ - '1' => self::$xwing, - '2' => self::$ywing, - '3' => self::$awing, - '4' => self::$falcon, - '5' => self::$homeOne, - '6' => self::$tieFighter, - '7' => self::$tieInterceptor, - '8' => self::$executor - ] - ]; - } - return self::$data; - } - - /** - * @param $shipName - * @param $factionId - * @return array - */ - public static function createShip($shipName, $factionId) - { - $data = self::getData(); - - $newShip = [ - 'id' => (string) self::$nextShip++, - 'name' => $shipName - ]; - $data['Ship'][$newShip['id']] = $newShip; - $data['Faction'][$factionId]['ships'][] = $newShip['id']; - - // Save - self::$data = $data; - - return $newShip; - } - - public static function getShip($id) - { - $data = self::getData(); - return $data['Ship'][$id]; - } - - public static function getFaction($id) - { - $data = self::getData(); - return $data['Faction'][$id]; - } - - public static function getRebels() - { - return self::$rebels; - } - - public static function getEmpire() - { - return self::$empire; - } -} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsMutationTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsMutationTest.php deleted file mode 100644 index b7d6c247..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsMutationTest.php +++ /dev/null @@ -1,60 +0,0 @@ - - array ( - 'shipName' => 'B-Wing', - 'factionId' => '1', - 'clientMutationId' => 'abcde', - ), - ); - - $expected = array ( - 'introduceShip' => - array ( - 'ship' => - array ( - 'id' => 'U2hpcDo5', - 'name' => 'B-Wing', - ), - 'faction' => - array ( - 'name' => 'Alliance to Restore the Republic', - ), - 'clientMutationId' => 'abcde', - ), - ); - - $result = GraphQL::executeQuery(StarWarsSchema::getSchema(), $mutation, null, null, $params)->toArray(); - - $this->assertEquals(['data' => $expected], $result); - } -} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsObjectIdentificationTest.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsObjectIdentificationTest.php deleted file mode 100644 index 78eea925..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsObjectIdentificationTest.php +++ /dev/null @@ -1,131 +0,0 @@ - - array ( - 'id' => 'RmFjdGlvbjox', - 'name' => 'Alliance to Restore the Republic', - ), - ); - - $this->assertValidQuery($query, $expected); - } - - public function testRefetchesTheRebels() - { - $query = 'query RebelsRefetchQuery { - node(id: "RmFjdGlvbjox") { - id - ... on Faction { - name - } - } - }'; - - $expected = array ( - 'node' => - array ( - 'id' => 'RmFjdGlvbjox', - 'name' => 'Alliance to Restore the Republic', - ), - ); - - $this->assertValidQuery($query, $expected); - } - - public function testFetchesTheIDAndNameOfTheEmpire() - { - $query = 'query EmpireQuery { - empire { - id - name - } - }'; - - $expected = array ( - 'empire' => - array ( - 'id' => 'RmFjdGlvbjoy', - 'name' => 'Galactic Empire', - ), - ); - - $this->assertValidQuery($query, $expected); - } - - public function testRefetchesTheEmpire() - { - $query = 'query EmpireRefetchQuery { - node(id: "RmFjdGlvbjoy") { - id - ... on Faction { - name - } - } - }'; - - $expected = array ( - 'node' => - array ( - 'id' => 'RmFjdGlvbjoy', - 'name' => 'Galactic Empire', - ), - ); - - $this->assertValidQuery($query, $expected); - } - - public function testRefetchesTheXWing() - { - $query = 'query XWingRefetchQuery { - node(id: "U2hpcDox") { - id - ... on Ship { - name - } - } - }'; - - $expected = array ( - 'node' => - array ( - 'id' => 'U2hpcDox', - 'name' => 'X-Wing', - ), - ); - - $this->assertValidQuery($query, $expected); - } - - /** - * Helper function to test a query and the expected response. - */ - private function assertValidQuery($query, $expected) - { - $result = GraphQL::executeQuery(StarWarsSchema::getSchema(), $query)->toArray(); - - $this->assertEquals(['data' => $expected], $result); - } -} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsSchema.php b/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsSchema.php deleted file mode 100644 index b2897919..00000000 --- a/lib/wp-graphql-1.17.0/vendor/ivome/graphql-relay-php/tests/StarWarsSchema.php +++ /dev/null @@ -1,379 +0,0 @@ - 'Ship', - 'description' => 'A ship in the Star Wars saga', - 'fields' => function() { - return [ - 'id' => Relay::globalIdField(), - 'name' => [ - 'type' => Type::string(), - 'description' => 'The name of the ship.' - ] - ]; - }, - 'interfaces' => [$nodeDefinition['nodeInterface']] - ]); - self::$shipType = $shipType; - } - return self::$shipType; - } - - /** - * We define our faction type, which implements the node interface. - * - * This implements the following type system shorthand: - * type Faction : Node { - * id: String! - * name: String - * ships: ShipConnection - * } - * - * @return ObjectType - */ - protected static function getFactionType() - { - if (self::$factionType === null){ - $shipConnection = self::getShipConnection(); - $nodeDefinition = self::getNodeDefinition(); - - $factionType = new ObjectType([ - 'name' => 'Faction', - 'description' => 'A faction in the Star Wars saga', - 'fields' => function() use ($shipConnection) { - return [ - 'id' => Relay::globalIdField(), - 'name' => [ - 'type' => Type::string(), - 'description' => 'The name of the faction.' - ], - 'ships' => [ - 'type' => $shipConnection['connectionType'], - 'description' => 'The ships used by the faction.', - 'args' => Relay::connectionArgs(), - 'resolve' => function($faction, $args) { - // Map IDs from faction back to ships - $data = array_map(function($id) { - return StarWarsData::getShip($id); - }, $faction['ships']); - return Relay::connectionFromArray($data, $args); - } - ] - ]; - }, - 'interfaces' => [$nodeDefinition['nodeInterface']] - ]); - - self::$factionType = $factionType; - } - - return self::$factionType; - } - - /** - * We define a connection between a faction and its ships. - * - * connectionType implements the following type system shorthand: - * type ShipConnection { - * edges: [ShipEdge] - * pageInfo: PageInfo! - * } - * - * connectionType has an edges field - a list of edgeTypes that implement the - * following type system shorthand: - * type ShipEdge { - * cursor: String! - * node: Ship - * } - */ - protected static function getShipConnection() - { - if (self::$shipConnection === null){ - $shipType = self::getShipType(); - $shipConnection = Relay::connectionDefinitions([ - 'nodeType' => $shipType - ]); - - self::$shipConnection = $shipConnection; - } - - return self::$shipConnection; - } - - /** - * This will return a GraphQLFieldConfig for our ship - * mutation. - * - * It creates these two types implicitly: - * input IntroduceShipInput { - * clientMutationId: string! - * shipName: string! - * factionId: ID! - * } - * - * input IntroduceShipPayload { - * clientMutationId: string! - * ship: Ship - * faction: Faction - * } - */ - public static function getShipMutation() - { - if (self::$shipMutation === null){ - $shipType = self::getShipType(); - $factionType = self::getFactionType(); - - $shipMutation = Relay::mutationWithClientMutationId([ - 'name' => 'IntroduceShip', - 'inputFields' => [ - 'shipName' => [ - 'type' => Type::nonNull(Type::string()) - ], - 'factionId' => [ - 'type' => Type::nonNull(Type::id()) - ] - ], - 'outputFields' => [ - 'ship' => [ - 'type' => $shipType, - 'resolve' => function ($payload) { - return StarWarsData::getShip($payload['shipId']); - } - ], - 'faction' => [ - 'type' => $factionType, - 'resolve' => function ($payload) { - return StarWarsData::getFaction($payload['factionId']); - } - ] - ], - 'mutateAndGetPayload' => function ($input) { - $newShip = StarWarsData::createShip($input['shipName'], $input['factionId']); - return [ - 'shipId' => $newShip['id'], - 'factionId' => $input['factionId'] - ]; - } - ]); - self::$shipMutation = $shipMutation; - } - - return self::$shipMutation; - } - - /** - * Returns the complete schema for StarWars tests - * - * @return Schema - */ - public static function getSchema() - { - $factionType = self::getFactionType(); - $nodeDefinition = self::getNodeDefinition(); - $shipMutation = self::getShipMutation(); - - /** - * This is the type that will be the root of our query, and the - * entry point into our schema. - * - * This implements the following type system shorthand: - * type Query { - * rebels: Faction - * empire: Faction - * node(id: String!): Node - * } - */ - $queryType = new ObjectType([ - 'name' => 'Query', - 'fields' => function () use ($factionType, $nodeDefinition) { - return [ - 'rebels' => [ - 'type' => $factionType, - 'resolve' => function (){ - return StarWarsData::getRebels(); - } - ], - 'empire' => [ - 'type' => $factionType, - 'resolve' => function () { - return StarWarsData::getEmpire(); - } - ], - 'node' => $nodeDefinition['nodeField'] - ]; - }, - ]); - - /** - * This is the type that will be the root of our mutations, and the - * entry point into performing writes in our schema. - * - * This implements the following type system shorthand: - * type Mutation { - * introduceShip(input IntroduceShipInput!): IntroduceShipPayload - * } - */ - $mutationType = new ObjectType([ - 'name' => 'Mutation', - 'fields' => function () use ($shipMutation) { - return [ - 'introduceShip' => $shipMutation - ]; - } - ]); - - /** - * Finally, we construct our schema (whose starting query type is the query - * type we defined above) and export it. - */ - $schema = new Schema([ - 'query' => $queryType, - 'mutation' => $mutationType - ]); - - return $schema; - } -} \ No newline at end of file diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/FUNDING.yml b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/FUNDING.yml deleted file mode 100644 index 0306338f..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -# These are supported funding model platforms -open_collective: webonyx-graphql-php diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/workflows/validate.yml b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/workflows/validate.yml deleted file mode 100644 index 75cfb7ad..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/.github/workflows/validate.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Validate - -on: - push: - branches: - tags: - pull_request: - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - php: [7.1, 7.2, 7.3, 7.4, 8.0, 8.1, 8.2] - env: [ - 'EXECUTOR= DEPENDENCIES=--prefer-lowest', - 'EXECUTOR=coroutine DEPENDENCIES=--prefer-lowest', - 'EXECUTOR=', - 'EXECUTOR=coroutine', - ] - name: PHP ${{ matrix.php }} Test ${{ matrix.env }} - - steps: - - uses: actions/checkout@v2 - - - name: Install PHP - uses: shivammathur/setup-php@2.18.1 - with: - php-version: ${{ matrix.php }} - coverage: none - extensions: json, mbstring - - - name: Remove dependencies not used in this job for PHP 8 compatibility - run: | - composer remove --dev --no-update phpbench/phpbench - composer remove --dev --no-update phpstan/phpstan - composer remove --dev --no-update phpstan/phpstan-phpunit - composer remove --dev --no-update phpstan/phpstan-strict-rules - composer remove --dev --no-update doctrine/coding-standard - - - name: Install Dependencies - run: composer update - - - name: Run unit tests - run: | - export $ENV - vendor/bin/phpunit --group default,ReactPromise - env: - ENV: ${{ matrix.env}} - - phpstan: - runs-on: ubuntu-latest - name: PHPStan - - steps: - - uses: actions/checkout@v2 - - - name: Install PHP - uses: shivammathur/setup-php@2.9.0 - with: - php-version: 7.4 - coverage: none - extensions: json, mbstring - - - name: Install Dependencies - run: composer install - - - name: PHPStan - run: composer stan diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/LICENSE b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/LICENSE deleted file mode 100644 index 8671fe43..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2015-present, Webonyx, LLC. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/UPGRADE.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/UPGRADE.md deleted file mode 100644 index 23813e60..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/UPGRADE.md +++ /dev/null @@ -1,731 +0,0 @@ -## v0.13.x > v14.x.x - -### BREAKING: Strict coercion of scalar types (#278) - -**Impact: Major** - -This change may break API clients if they were sending loose variable values. - -
- See Examples - -Consider the following query: - -```graphql -query($intQueryVariable: Int) { - test(intInput: $intQueryVariable) -} -``` - -What happens if we pass non-integer values as `$intQueryVariable`: -``` -[true, false, 1, 0, 0.0, 'true', 'false', '1', '0', '0.0', [], [0,1]] -``` - -#### Integer coercion, changed behavior: - -``` -bool(true): - 0.13.x: coerced to int(1) - 14.x.x: Error: Variable "$queryVariable" got invalid value true; Expected type Int; Int cannot represent non-integer value: true - -bool(false): - 0.13.x: coerced to int(0) - 14.x.x: Error: Variable "$queryVariable" got invalid value false; Expected type Int; Int cannot represent non-integer value: false - -string(1) "1" - 0.13.x: was coerced to int(1) - 14.x.x: Error: Variable "$queryVariable" got invalid value "1"; Expected type Int; Int cannot represent non-integer value: 1 - -string(1) "0" - 0.13.x: was coerced to int(0) - 14.x.x: Error: Variable "$queryVariable" got invalid value "0"; Expected type Int; Int cannot represent non-integer value: 0 - -string(3) "0.0" - 0.13.x: was coerced to int(0) - 14.x.x: Error: Variable "$queryVariable" got invalid value "0.0"; Expected type Int; Int cannot represent non-integer value: 0.0 -``` - -Did not change: -``` -int(1): coerced to int(1) -int(0) was coerced to int(0) -float(0) was coerced to int(0) - -string(4) "true": - Error: Variable "$queryVariable" got invalid value "true"; Expected type Int; Int cannot represent non 32-bit signed integer value: true - -string(5) "false": - Error: Variable "$queryVariable" got invalid value "false"; Expected type Int; Int cannot represent non 32-bit signed integer value: false - -array(0) {} - Error: Variable "$queryVariable" got invalid value []; Expected type Int; Int cannot represent non 32-bit signed integer value: [] - -array(2) { [0]=> int(0) [1]=> int(1) } - Error: Variable "$queryVariable" got invalid value [0,1]; Expected type Int; Int cannot represent non 32-bit signed integer value: [0,1] -``` - -#### Float coercion, changed behavior: -```graphql -query($queryVariable: Float) { - test(floatInput: $queryVariable) -} -``` - -``` -bool(true) - 0.13.x: was coerced to float(1) - 14.x.x: Error: Variable "$queryVariable" got invalid value true; Expected type Float; Float cannot represent non numeric value: true - -bool(false) - 0.13.x: was coerced to float(0) - 14.x.x: Error: Variable "$queryVariable" got invalid value false; Expected type Float; Float cannot represent non numeric value: false - -string(1) "1" - 0.13.x: was coerced to float(1) - 14.x.x: Error: Variable "$queryVariable" got invalid value "1"; Expected type Float; Float cannot represent non numeric value: 1 - -string(1) "0" - 0.13.x: was coerced to float(0) - 14.x.x: Error: Variable "$queryVariable" got invalid value "0"; Expected type Float; Float cannot represent non numeric value: 0 - -string(3) "0.0" - 0.13.x: was coerced to float(0) - 14.x.x: Error: Variable "$queryVariable" got invalid value "0.0"; Expected type Float; Float cannot represent non numeric value: 0.0 -``` - -#### String coercion, changed behavior: -```graphql -query($queryVariable: String) { - test(stringInput: $queryVariable) -} -``` - -``` -bool(true) - 0.13.x: was coerced to string(1) "1" - 14.x.x: Error: Variable "$queryVariable" got invalid value true; Expected type String; String cannot represent a non string value: true - -bool(false) - 0.13.x: was coerced to string(0) "" - 14.x.x: Error: Variable "$queryVariable" got invalid value false; Expected type String; String cannot represent a non string value: false - -int(1) - 0.13.x: was coerced to string(1) "1" - 14.x.x: Error: Variable "$queryVariable" got invalid value 1; Expected type String; String cannot represent a non string value: 1 - -int(0) - 0.13.x: was coerced to string(1) "0" - 14.x.x: Error: Variable "$queryVariable" got invalid value 0; Expected type String; String cannot represent a non string value: 0 - -float(0) - 0.13.x: was coerced to string(1) "0" - 14.x.x: Error: Variable "$queryVariable" got invalid value 0; Expected type String; String cannot represent a non string value: 0 -``` - -#### Boolean coercion did not change. - -
- -### Breaking: renamed classes and changed signatures - -**Impact: Medium** - -- Dropped previously deprecated `GraphQL\Schema`. Use `GraphQL\Type\Schema`. -- Renamed `GraphQL\Error\Debug` to `GraphQL\Error\DebugFlag`. -- Debug flags in `GraphQL\Executor\ExecutionResult`, `GraphQL\Error\FormattedError` and `GraphQL\Server\ServerConfig` - do not accept `boolean` value anymore but `int` only (pass values of `GraphQL\Error\DebugFlag` constants) -- `$positions` in `GraphQL\Error\Error` are not nullable anymore. Same can be expressesed by passing empty array. - -### BREAKING: Removed deprecated directive introspection fields (onOperation, onFragment, onField) - -**Impact: Minor** - -Could affect developer tools relying on old introspection format. -Replaced with [Directive Locations](https://spec.graphql.org/June2018/#sec-Type-System.Directives). - -### BREAKING: Changes in validation rules: - -**Impact: Minor** - - - Removal of `VariablesDefaultValueAllowed` validation rule. All variables may now specify a default value. - - Renamed `ProvidedNonNullArguments` to `ProvidedRequiredArguments` (no longer require values to be provided to non-null arguments which provide a default value). - -Could affect projects using custom sets of validation rules. - -### BREAKING: `GraphQL\Deferred` now extends `GraphQL\Executor\Promise\Adapter\SyncPromise` - -**Impact: Minor** - -Can only affect a few projects that were somehow customizing deferreds or the default sync promise adapter. - - -### BREAKING: renamed several types of dangerous/breaking changes (returned by `BreakingChangesFinder`): - -**Impact: Minor** - -Can affect projects relying on `BreakingChangesFinder` utility in their CI. - -Following types of changes were renamed: - -``` -- `NON_NULL_ARG_ADDED` to `REQUIRED_ARG_ADDED` -- `NON_NULL_INPUT_FIELD_ADDED` to `REQUIRED_INPUT_FIELD_ADDED` -- `NON_NULL_DIRECTIVE_ARG_ADDED` to `REQUIRED_DIRECTIVE_ARG_ADDED` -- `NULLABLE_INPUT_FIELD_ADDED` to `OPTIONAL_INPUT_FIELD_ADDED` -- `NULLABLE_ARG_ADDED` to `OPTIONAL_ARG_ADDED` -``` - -### Breaking: Dropped `GraphQL\Error\Error::$message` - -**Impact: Minor** - -Use `GraphQL\Error\Error->getMessage()` instead. - -### Breaking: change TypeKind constants - -**Impact: Minor** - -The constants in `\GraphQL\Type\TypeKind` were partly renamed and their values -have been changed to match their name instead of a numeric index. - -### Breaking: some error messages were changed - -**Impact: Minor** - -Can affect projects relying on error messages parsing. - -One example: added quotes around `parentType.fieldName` in error message: -```diff -- Cannot return null for non-nullable field parentType.fieldName. -+ Cannot return null for non-nullable field "parentType.fieldName". -``` -But expect other simiar changes like this. - -## Upgrade v0.12.x > v0.13.x - -### Breaking (major): minimum supported version of PHP -New minimum required version of PHP is **7.1+** - -### Breaking (major): default errors formatting changed according to spec -**Category** and extensions assigned to errors are shown under `extensions` key -```php -$e = new Error( - 'msg', - null, - null, - null, - null, - null, - ['foo' => 'bar'] -); -``` -Formatting before the change: -``` -'errors' => [ - [ - 'message' => 'msg', - 'category' => 'graphql', - 'foo' => 'bar' - ] -] -``` -After the change: -``` -'errors' => [ - [ - 'message' => 'msg', - 'extensions' => [ - 'category' => 'graphql', - 'foo' => 'bar', - ], - ] -] -``` - -Note: if error extensions contain `category` key - it has a priority over default category. - -You can always switch to [custom error formatting](https://webonyx.github.io/graphql-php/error-handling/#custom-error-handling-and-formatting) to revert to the old format. - -### Try it: Experimental Executor with improved performance -It is disabled by default. To enable it, do the following -```php - true]) -``` - -### Breaking: several classes renamed - -- `AbstractValidationRule` renamed to `ValidationRule` (NS `GraphQL\Validator\Rules`) -- `AbstractQuerySecurity` renamed to `QuerySecurityRule` (NS `GraphQL\Validator\Rules`) -- `FindBreakingChanges` renamed to `BreakingChangesFinder` (NS `GraphQL\Utils`) - -### Breaking: new constructors - -`GraphQL\Type\Definition\ResolveInfo` now takes 10 arguments instead of one array. - -## Upgrade v0.11.x > v0.12.x - -### Breaking: Minimum supported version is PHP5.6 -Dropped support for PHP 5.5. This release still supports PHP 5.6 and PHP 7.0 -**But the next major release will require PHP7.1+** - -### Breaking: Custom scalar types need to throw on invalid value -As null might be a valid value custom types need to throw an -Exception inside `parseLiteral()`, `parseValue()` and `serialize()`. - -Returning null from any of these methods will now be treated as valid result. - -### Breaking: Custom scalar types parseLiteral() declaration changed -A new parameter was added to `parseLiteral()`, which also needs to be added to any custom scalar type extending from `ScalarType` - -Before: -```php -class MyType extends ScalarType { - - ... - - public function parseLiteral($valueNode) { - //custom implementation - } -} -``` - -After: -```php -class MyType extends ScalarType { - - ... - - public function parseLiteral($valueNode, array $variables = null) { - //custom implementation - } -} -``` - -### Breaking: Descriptions in comments are not used as descriptions by default anymore -Descriptions now need to be inside Strings or BlockStrings in order to be picked up as -description. If you want to keep the old behaviour you can supply the option `commentDescriptions` -to BuildSchema::buildAST(), BuildSchema::build() or Printer::doPrint(). - -Here is the official way now to define descriptions in the graphQL language: - -Old: - -```graphql -# Description -type Dog { - ... -} -``` - -New: - -```graphql -"Description" -type Dog { - ... -} - -""" -Long Description -""" -type Dog { - ... -} -``` - -### Breaking: Cached AST of version 0.11.x is not compatible with 0.12.x. -That's because description in AST is now a separate node, not just a string. -Make sure to renew caches. - -### Breaking: Most of previously deprecated classes and methods were removed -See deprecation notices for previous versions in details. - -### Breaking: Standard server expects `operationName` vs `operation` for multi-op queries -Before the change: -```json -{ - "queryId": "persisted-query-id", - "operation": "QueryFromPersistedDocument", - "variables": {} -} -``` -After the change: -```json -{ - "queryId": "persisted-query-id", - "operationName": "QueryFromPersistedDocument", - "variables": {} -} -``` -This naming is aligned with graphql-express version. - -### Possibly Breaking: AST to array serialization excludes nulls -Most users won't be affected. It *may* affect you only if you do your own manipulations -with exported AST. - -Example of json-serialized AST before the change: -```json -{ - "kind": "Field", - "loc": null, - "name": { - "kind": "Name", - "loc": null, - "value": "id" - }, - "alias": null, - "arguments": [], - "directives": [], - "selectionSet": null -} -``` -After the change: -```json -{ - "kind": "Field", - "name": { - "kind": "Name", - "value": "id" - }, - "arguments": [], - "directives": [] -} -``` - -## Upgrade v0.8.x, v0.9.x > v0.10.x - -### Breaking: changed minimum PHP version from 5.4 to 5.5 -It allows us to leverage `::class` constant, `generators` and other features of newer PHP versions. - -### Breaking: default error formatting -By default exceptions thrown in resolvers will be reported with generic message `"Internal server error"`. -Only exceptions implementing interface `GraphQL\Error\ClientAware` and claiming themselves as `safe` will -be reported with full error message. - -This breaking change is done to avoid information leak in production when unhandled -exceptions were reported to clients (e.g. database connection errors, file access errors, etc). - -Also every error reported to client now has new `category` key which is either `graphql` or `internal`. -Exceptions implementing `ClientAware` interface may define their own custom categories. - -During development or debugging use `$executionResult->toArray(true)`. It will add `debugMessage` key to -each error entry in result. If you also want to add `trace` for each error - pass flags instead: - -``` -use GraphQL\Error\FormattedError; -$debug = FormattedError::INCLUDE_DEBUG_MESSAGE | FormattedError::INCLUDE_TRACE; -$result = GraphQL::executeAndReturnResult(/*args*/)->toArray($debug); -``` - -To change default `"Internal server error"` message to something else, use: -``` -GraphQL\Error\FormattedError::setInternalErrorMessage("Unexpected error"); -``` - -**This change only affects default error reporting mechanism. If you set your own error formatter using -`$executionResult->setErrorFormatter($myFormatter)` you won't be affected by this change.** - -If you need to revert to old behavior temporary, use: - -```php -GraphQL::executeAndReturnResult(/**/) - ->setErrorFormatter('\GraphQL\Error\Error::formatError') - ->toArray(); -``` -But note that this is deprecated format and will be removed in future versions. - -In general, if new default formatting doesn't work for you - just set [your own error -formatter](http://webonyx.github.io/graphql-php/error-handling/#custom-error-handling-and-formatting). - -### Breaking: Validation rules now have abstract base class -Previously any callable was accepted by DocumentValidator as validation rule. Now only instances of -`GraphQL\Validator\Rules\AbstractValidationRule` are allowed. - -If you were using custom validation rules, just wrap them with -`GraphQL\Validator\Rules\CustomValidationRule` (created for backwards compatibility). - -Before: -```php -use GraphQL\Validator\DocumentValidator; - -$myRule = function(ValidationContext $context) {}; -DocumentValidator::validate($schema, $ast, [$myRule]); -``` - -After: -```php -use GraphQL\Validator\Rules\CustomValidationRule; -use GraphQL\Validator\DocumentValidator; - -$myRule = new CustomValidationRule('MyRule', function(ValidationContext $context) {}); -DocumentValidator::validate($schema, $ast, [$myRule]); -``` - -Also `DocumentValidator::addRule()` signature changed. - -Before the change: -```php -use GraphQL\Validator\DocumentValidator; - -$myRule = function(ValidationContext $context) {}; -DocumentValidator::addRule('MyRuleName', $myRule); -``` - -After the change: -```php -use GraphQL\Validator\DocumentValidator; - -$myRule = new CustomValidationRulefunction('MyRule', ValidationContext $context) {}); -DocumentValidator::addRule($myRule); -``` - - -### Breaking: AST now uses `NodeList` vs array for lists of nodes -It helps us unserialize AST from array lazily. This change affects you only if you use `array_` -functions with AST or mutate AST directly. - -Before the change: -```php -new GraphQL\Language\AST\DocumentNode([ - 'definitions' => array(/*...*/) -]); -``` -After the change: -``` -new GraphQL\Language\AST\DocumentNode([ - 'definitions' => new NodeList([/*...*/]) -]); -``` - - -### Breaking: scalar types now throw different exceptions when parsing and serializing -On invalid client input (`parseValue` and `parseLiteral`) they throw standard `GraphQL\Error\Error` -but when they encounter invalid output (in `serialize`) they throw `GraphQL\Error\InvariantViolation`. - -Previously they were throwing `GraphQL\Error\UserError`. This exception is no longer used so make sure -to adjust if you were checking for this error in your custom error formatters. - -### Breaking: removed previously deprecated ability to define type as callable -See https://github.com/webonyx/graphql-php/issues/35 - -### Deprecated: `GraphQL\GraphQL::executeAndReturnResult` -Method is renamed to `GraphQL\GraphQL::executeQuery`. Old method name is still available, -but will trigger deprecation warning in the next version. - -### Deprecated: `GraphQL\GraphQL::execute` -Use `GraphQL\GraphQL::executeQuery()->toArray()` instead. -Old method still exists, but will trigger deprecation warning in next version. - -### Deprecated: `GraphQL\Schema` moved to `GraphQL\Type\Schema` -Old class still exists, but will trigger deprecation warning in next version. - -### Deprecated: `GraphQL\Utils` moved to `GraphQL\Utils\Utils` -Old class still exists, but triggers deprecation warning when referenced. - -### Deprecated: `GraphQL\Type\Definition\Config` -If you were using config validation in previous versions, replace: -```php -GraphQL\Type\Definition\Config::enableValidation(); -``` -with: -```php -$schema->assertValid(); -``` -See https://github.com/webonyx/graphql-php/issues/148 - -### Deprecated: experimental `GraphQL\Server` -Use [new PSR-7 compliant implementation](docs/executing-queries.md#using-server) instead. - -### Deprecated: experimental `GraphQL\Type\Resolution` interface and implementations -Use schema [**typeLoader** option](docs/type-system/schema.md#lazy-loading-of-types) instead. - -### Non-breaking: usage on async platforms -When using the library on async platforms use separate method `GraphQL::promiseToExecute()`. -It requires promise adapter in it's first argument and always returns a `Promise`. - -Old methods `GraphQL::execute` and `GraphQL::executeAndReturnResult` still work in backwards-compatible manner, -but they are deprecated and will be removed eventually. - -Same applies to Executor: use `Executor::promiseToExecute()` vs `Executor::execute()`. - -## Upgrade v0.7.x > v0.8.x -All of those changes apply to those who extends various parts of this library. -If you only use the library and don't try to extend it - everything should work without breaks. - - -### Breaking: Custom directives handling -When passing custom directives to schema, default directives (like `@skip` and `@include`) -are not added to schema automatically anymore. If you need them - add them explicitly with -your other directives. - -Before the change: -```php -$schema = new Schema([ - // ... - 'directives' => [$myDirective] -]); -``` - -After the change: -```php -$schema = new Schema([ - // ... - 'directives' => array_merge(GraphQL::getInternalDirectives(), [$myDirective]) -]); -``` - -### Breaking: Schema protected property and methods visibility -Most of the `protected` properties and methods of `GraphQL\Schema` were changed to `private`. -Please use public interface instead. - -### Breaking: Node kind constants -Node kind constants were extracted from `GraphQL\Language\AST\Node` to -separate class `GraphQL\Language\AST\NodeKind` - -### Non-breaking: AST node classes renamed -AST node classes were renamed to disambiguate with types. e.g.: - -``` -GraphQL\Language\AST\Field -> GraphQL\Language\AST\FieldNode -GraphQL\Language\AST\OjbectValue -> GraphQL\Language\AST\OjbectValueNode -``` -etc. - -Old names are still available via `class_alias` defined in `src/deprecated.php`. -This file is included automatically when using composer autoloading. - -### Deprecations -There are several deprecations which still work, but trigger `E_USER_DEPRECATED` when used. - -For example `GraphQL\Executor\Executor::setDefaultResolveFn()` is renamed to `setDefaultResolver()` -but still works with old name. - -## Upgrade v0.6.x > v0.7.x - -There are a few new breaking changes in v0.7.0 that were added to the graphql-js reference implementation -with the spec of April2016 - -### 1. Context for resolver - -You can now pass a custom context to the `GraphQL::execute` function that is available in all resolvers as 3rd argument. -This can for example be used to pass the current user etc. - -Make sure to update all calls to `GraphQL::execute`, `GraphQL::executeAndReturnResult`, `Executor::execute` and all -`'resolve'` callbacks in your app. - -Before v0.7.0 `GraphQL::execute` signature looked this way: - ```php - GraphQL::execute( - $schema, - $query, - $rootValue, - $variables, - $operationName - ); - ``` - -Starting from v0.7.0 the signature looks this way (note the new `$context` argument): -```php -GraphQL::execute( - $schema, - $query, - $rootValue, - $context, - $variables, - $operationName -); -``` - -Before v.0.7.0 resolve callbacks had following signature: -```php -/** - * @param mixed $object The parent resolved object - * @param array $args Input arguments - * @param ResolveInfo $info ResolveInfo object - * @return mixed - */ -function resolveMyField($object, array $args, ResolveInfo $info) { - //... -} -``` - -Starting from v0.7.0 the signature has changed to (note the new `$context` argument): -```php -/** - * @param mixed $object The parent resolved object - * @param array $args Input arguments - * @param mixed $context The context object hat was passed to GraphQL::execute - * @param ResolveInfo $info ResolveInfo object - * @return mixed - */ -function resolveMyField($object, array $args, $context, ResolveInfo $info){ - //... -} -``` - -### 2. Schema constructor signature - -The signature of the Schema constructor now accepts an associative config array instead of positional arguments: - -Before v0.7.0: -```php -$schema = new Schema($queryType, $mutationType); -``` - -Starting from v0.7.0: -```php -$schema = new Schema([ - 'query' => $queryType, - 'mutation' => $mutationType, - 'types' => $arrayOfTypesWithInterfaces // See 3. -]); -``` - -### 3. Types can be directly passed to schema - -There are edge cases when GraphQL cannot infer some types from your schema. -One example is when you define a field of interface type and object types implementing -this interface are not referenced anywhere else. - -In such case object types might not be available when an interface is queried and query -validation will fail. In that case, you need to pass the types that implement the -interfaces directly to the schema, so that GraphQL knows of their existence during query validation. - -For example: -```php -$schema = new Schema([ - 'query' => $queryType, - 'mutation' => $mutationType, - 'types' => $arrayOfTypesWithInterfaces -]); -``` - -Note that you don't need to pass all types here - only those types that GraphQL "doesn't see" -automatically. Before v7.0.0 the workaround for this was to create a dumb (non-used) field per -each "invisible" object type. - -Also see [webonyx/graphql-php#38](https://github.com/webonyx/graphql-php/issues/38) diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/best-practices.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/best-practices.md deleted file mode 100644 index 4b7fc247..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/best-practices.md +++ /dev/null @@ -1,9 +0,0 @@ -# Type Registry -**graphql-php** expects that each type in Schema is presented by single instance. Therefore -if you define your types as separate PHP classes you need to ensure that each type is referenced only once. - -Technically you can create several instances of your type (for example for tests), but `GraphQL\Type\Schema` -will throw on attempt to add different instances with the same name. - -There are several ways to achieve this depending on your preferences. We provide reference -implementation below that introduces TypeRegistry class: diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/complementary-tools.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/complementary-tools.md deleted file mode 100644 index 5262649e..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/complementary-tools.md +++ /dev/null @@ -1,28 +0,0 @@ -# Integrations - -* [Standard Server](executing-queries.md/#using-server) – Out of the box integration with any PSR-7 compatible framework (like [Slim](http://slimframework.com) or [Zend Expressive](http://zendframework.github.io/zend-expressive/)). -* [Relay Library for graphql-php](https://github.com/ivome/graphql-relay-php) – Helps construct Relay related schema definitions. -* [Lighthouse](https://github.com/nuwave/lighthouse) – Laravel based, uses Schema Definition Language -* [Laravel GraphQL](https://github.com/rebing/graphql-laravel) - Laravel wrapper for Facebook's GraphQL -* [OverblogGraphQLBundle](https://github.com/overblog/GraphQLBundle) – Bundle for Symfony -* [WP-GraphQL](https://github.com/wp-graphql/wp-graphql) - GraphQL API for WordPress -* [Siler](https://github.com/leocavalcante/siler) - Straightforward way to map GraphQL SDL to resolver callables, also built-in support for Swoole - -# GraphQL PHP Tools - -* [GraphQLite](https://graphqlite.thecodingmachine.io) – Define your complete schema with annotations -* [GraphQL Doctrine](https://github.com/Ecodev/graphql-doctrine) – Define types with Doctrine ORM annotations -* [DataLoaderPHP](https://github.com/overblog/dataloader-php) – as a ready implementation for [deferred resolvers](data-fetching.md#solving-n1-problem) -* [GraphQL Uploads](https://github.com/Ecodev/graphql-upload) – A PSR-15 middleware to support file uploads in GraphQL. -* [GraphQL Batch Processor](https://github.com/vasily-kartashov/graphql-batch-processing) – Provides a builder interface for defining collection, querying, filtering, and post-processing logic of batched data fetches. -* [GraphQL Utils](https://github.com/simPod/GraphQL-Utils) – Objective schema definition builders (no need for arrays anymore) and `DateTime` scalar -* [PSR 15 compliant middleware](https://github.com/phps-cans/psr7-middleware-graphql) for the Standard Server _(experimental)_ - -# General GraphQL Tools - -* [GraphQL Playground](https://github.com/prismagraphql/graphql-playground) – GraphQL IDE for better development workflows (GraphQL Subscriptions, interactive docs & collaboration). -* [GraphiQL](https://github.com/graphql/graphiql) – An in-browser IDE for exploring GraphQL -* [ChromeiQL](https://chrome.google.com/webstore/detail/chromeiql/fkkiamalmpiidkljmicmjfbieiclmeij) - or [GraphiQL Feen](https://chrome.google.com/webstore/detail/graphiql-feen/mcbfdonlkfpbfdpimkjilhdneikhfklp) – - GraphiQL as Google Chrome extension -* [Altair GraphQL Client](https://altair.sirmuel.design/) - A beautiful feature-rich GraphQL Client for all platforms diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/concepts.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/concepts.md deleted file mode 100644 index 91fe6421..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/concepts.md +++ /dev/null @@ -1,139 +0,0 @@ -# Overview -GraphQL is data-centric. On the very top level it is built around three major concepts: -**Schema**, **Query** and **Mutation**. - -You are expected to express your application as **Schema** (aka Type System) and expose it -with single HTTP endpoint (e.g. using our [standard server](executing-queries.md#using-server)). -Application clients (e.g. web or mobile clients) send **Queries** -to this endpoint to request structured data and **Mutations** to perform changes (usually with HTTP POST method). - -## Queries -Queries are expressed in simple language that resembles JSON: - -```graphql -{ - hero { - name - friends { - name - } - } -} -``` - -It was designed to mirror the structure of expected response: -```json -{ - "hero": { - "name": "R2-D2", - "friends": [ - {"name": "Luke Skywalker"}, - {"name": "Han Solo"}, - {"name": "Leia Organa"} - ] - } -} -``` -**graphql-php** runtime parses Queries, makes sure that they are valid for given Type System -and executes using [data fetching tools](data-fetching.md) provided by you -as a part of integration. Queries are supposed to be idempotent. - -## Mutations -Mutations use advanced features of the very same query language (like arguments and variables) -and have only semantic difference from Queries: - -```graphql -mutation CreateReviewForEpisode($ep: Episode!, $review: ReviewInput!) { - createReview(episode: $ep, review: $review) { - stars - commentary - } -} -``` -Variables `$ep` and `$review` are sent alongside with mutation. Full HTTP request might look like this: -```json -// POST /graphql-endpoint -// Content-Type: application/javascript -// -{ - "query": "mutation CreateReviewForEpisode...", - "variables": { - "ep": "JEDI", - "review": { - "stars": 5, - "commentary": "This is a great movie!" - } - } -} -``` -As you see variables may include complex objects and they will be correctly validated by -**graphql-php** runtime. - -Another nice feature of GraphQL mutations is that they also hold the query for data to be -returned after mutation. In our example mutation will return: -``` -{ - "createReview": { - "stars": 5, - "commentary": "This is a great movie!" - } -} -``` - -# Type System -Conceptually GraphQL type is a collection of fields. Each field in turn -has it's own type which allows to build complex hierarchies. - -Quick example on pseudo-language: -``` -type BlogPost { - title: String! - author: User - body: String -} - -type User { - id: Id! - firstName: String - lastName: String -} -``` - -Type system is a heart of GraphQL integration. That's where **graphql-php** comes into play. - -It provides following tools and primitives to describe your App as hierarchy of types: - - * Primitives for defining **objects** and **interfaces** - * Primitives for defining **enumerations** and **unions** - * Primitives for defining custom **scalar types** - * Built-in scalar types: `ID`, `String`, `Int`, `Float`, `Boolean` - * Built-in type modifiers: `ListOf` and `NonNull` - -Same example expressed in **graphql-php**: -```php - 'User', - 'fields' => [ - 'id' => Type::nonNull(Type::id()), - 'firstName' => Type::string(), - 'lastName' => Type::string() - ] -]); - -$blogPostType = new ObjectType([ - 'name' => 'BlogPost', - 'fields' => [ - 'title' => Type::nonNull(Type::string()), - 'author' => $userType - ] -]); -``` - -# Further Reading -To get deeper understanding of GraphQL concepts - [read the docs on official GraphQL website](http://graphql.org/learn/) - -To get started with **graphql-php** - continue to next section ["Getting Started"](getting-started.md) diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/data-fetching.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/data-fetching.md deleted file mode 100644 index c5152ba5..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/data-fetching.md +++ /dev/null @@ -1,274 +0,0 @@ -# Overview -GraphQL is data-storage agnostic. You can use any underlying data storage engine, including SQL or NoSQL database, -plain files or in-memory data structures. - -In order to convert the GraphQL query to PHP array, **graphql-php** traverses query fields (using depth-first algorithm) and -runs special **resolve** function on each field. This **resolve** function is provided by you as a part of -[field definition](type-system/object-types.md#field-configuration-options) or [query execution call](executing-queries.md#overview). - -Result returned by **resolve** function is directly included in the response (for scalars and enums) -or passed down to nested fields (for objects). - -Let's walk through an example. Consider following GraphQL query: - -```graphql -{ - lastStory { - title - author { - name - } - } -} -``` - -We need a Schema that can fulfill it. On the very top level the Schema contains Query type: - -```php - 'Query', - 'fields' => [ - - 'lastStory' => [ - 'type' => $blogStoryType, - 'resolve' => function() { - return [ - 'id' => 1, - 'title' => 'Example blog post', - 'authorId' => 1 - ]; - } - ] - - ] -]); -``` - -As we see field **lastStory** has **resolve** function that is responsible for fetching data. - -In our example, we simply return array value, but in the real-world application you would query -your database/cache/search index and return the result. - -Since **lastStory** is of composite type **BlogStory** this result is passed down to fields of this type: - -```php - 'BlogStory', - 'fields' => [ - - 'author' => [ - 'type' => $userType, - 'resolve' => function($blogStory) { - $users = [ - 1 => [ - 'id' => 1, - 'name' => 'Smith' - ], - 2 => [ - 'id' => 2, - 'name' => 'Anderson' - ] - ]; - return $users[$blogStory['authorId']]; - } - ], - - 'title' => [ - 'type' => Type::string() - ] - - ] -]); -``` - -Here **$blogStory** is the array returned by **lastStory** field above. - -Again: in the real-world applications you would fetch user data from data store by **authorId** and return it. -Also, note that you don't have to return arrays. You can return any value, **graphql-php** will pass it untouched -to nested resolvers. - -But then the question appears - field **title** has no **resolve** option. How is it resolved? - -There is a default resolver for all fields. When you define your own **resolve** function -for a field you simply override this default resolver. - -# Default Field Resolver -**graphql-php** provides following default field resolver: -```php -fieldName; - $property = null; - - if (is_array($objectValue) || $objectValue instanceof \ArrayAccess) { - if (isset($objectValue[$fieldName])) { - $property = $objectValue[$fieldName]; - } - } elseif (is_object($objectValue)) { - if (isset($objectValue->{$fieldName})) { - $property = $objectValue->{$fieldName}; - } - } - - return $property instanceof Closure - ? $property($objectValue, $args, $context, $info) - : $property; - } -``` - -As you see it returns value by key (for arrays) or property (for objects). -If the value is not set - it returns **null**. - -To override the default resolver, pass it as an argument of [executeQuery](executing-queries.md) call. - -# Default Field Resolver per Type -Sometimes it might be convenient to set default field resolver per type. You can do so by providing -[resolveField option in type config](type-system/object-types.md#configuration-options). For example: - -```php - 'User', - 'fields' => [ - - 'name' => Type::string(), - 'email' => Type::string() - - ], - 'resolveField' => function(User $user, $args, $context, ResolveInfo $info) { - switch ($info->fieldName) { - case 'name': - return $user->getName(); - case 'email': - return $user->getEmail(); - default: - return null; - } - } -]); -``` - -Keep in mind that **field resolver** has precedence over **default field resolver per type** which in turn - has precedence over **default field resolver**. - -# Solving N+1 Problem -Since: 0.9.0 - -One of the most annoying problems with data fetching is a so-called -[N+1 problem](https://secure.phabricator.com/book/phabcontrib/article/n_plus_one/).
-Consider following GraphQL query: -``` -{ - topStories(limit: 10) { - title - author { - name - email - } - } -} -``` - -Naive field resolution process would require up to 10 calls to the underlying data store to fetch authors for all 10 stories. - -**graphql-php** provides tools to mitigate this problem: it allows you to defer actual field resolution to a later stage -when one batched query could be executed instead of 10 distinct queries. - -Here is an example of **BlogStory** resolver for field **author** that uses deferring: -```php - function($blogStory) { - MyUserBuffer::add($blogStory['authorId']); - - return new GraphQL\Deferred(function () use ($blogStory) { - MyUserBuffer::loadBuffered(); - return MyUserBuffer::get($blogStory['authorId']); - }); -} -``` - -In this example, we fill up the buffer with 10 author ids first. Then **graphql-php** continues -resolving other non-deferred fields until there are none of them left. - -After that, it calls closures wrapped by `GraphQL\Deferred` which in turn load all buffered -ids once (using SQL IN(?), Redis MGET or other similar tools) and returns final field value. - -Originally this approach was advocated by Facebook in their [Dataloader](https://github.com/facebook/dataloader) -project. This solution enables very interesting optimizations at no cost. Consider the following query: - -```graphql -{ - topStories(limit: 10) { - author { - email - } - } - category { - stories(limit: 10) { - author { - email - } - } - } -} -``` - -Even though **author** field is located on different levels of the query - it can be buffered in the same buffer. -In this example, only one query will be executed for all story authors comparing to 20 queries -in a naive implementation. - -# Async PHP -Since: 0.10.0 (version 0.9.0 had slightly different API which still works, but is deprecated) - -If your project runs in an environment that supports async operations -(like HHVM, ReactPHP, Icicle.io, appserver.io, PHP threads, etc) -you can leverage the power of your platform to resolve some fields asynchronously. - -The only requirement: your platform must support the concept of Promises compatible with -[Promises A+](https://promisesaplus.com/) specification. - -To start using this feature, switch facade method for query execution from -**executeQuery** to **promiseToExecute**: - -```php -then(function(ExecutionResult $result) { - return $result->toArray(); -}); -``` - -Where **$promiseAdapter** is an instance of: - -* For [ReactPHP](https://github.com/reactphp/react) (requires **react/promise** as composer dependency):
- `GraphQL\Executor\Promise\Adapter\ReactPromiseAdapter` - -* Other platforms: write your own class implementing interface:
- [`GraphQL\Executor\Promise\PromiseAdapter`](reference.md#graphqlexecutorpromisepromiseadapter). - -Then your **resolve** functions should return promises of your platform instead of `GraphQL\Deferred`s. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/error-handling.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/error-handling.md deleted file mode 100644 index c3841b21..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/error-handling.md +++ /dev/null @@ -1,199 +0,0 @@ -# Errors in GraphQL - -Query execution process never throws exceptions. Instead, all errors are caught and collected. -After execution, they are available in **$errors** prop of -[`GraphQL\Executor\ExecutionResult`](reference.md#graphqlexecutorexecutionresult). - -When the result is converted to a serializable array using its **toArray()** method, all errors are -converted to arrays as well using default error formatting (see below). - -Alternatively, you can apply [custom error filtering and formatting](#custom-error-handling-and-formatting) -for your specific requirements. - -# Default Error formatting -By default, each error entry is converted to an associative array with following structure: - -```php - 'Error message', - 'extensions' => [ - 'category' => 'graphql' - ], - 'locations' => [ - ['line' => 1, 'column' => 2] - ], - 'path' => [ - 'listField', - 0, - 'fieldWithException' - ] -]; -``` -Entry at key **locations** points to a character in query string which caused the error. -In some cases (like deep fragment fields) locations will include several entries to track down -the path to field with the error in query. - -Entry at key **path** exists only for errors caused by exceptions thrown in resolvers. -It contains a path from the very root field to actual field value producing an error -(including indexes for list types and field names for composite types). - -**Internal errors** - -As of version **0.10.0**, all exceptions thrown in resolvers are reported with generic message **"Internal server error"**. -This is done to avoid information leak in production environments (e.g. database connection errors, file access errors, etc). - -Only exceptions implementing interface [`GraphQL\Error\ClientAware`](reference.md#graphqlerrorclientaware) and claiming themselves as **safe** will -be reported with a full error message. - -For example: -```php - 'My reported error', - 'extensions' => [ - 'category' => 'businessLogic' - ], - 'locations' => [ - ['line' => 10, 'column' => 2] - ], - 'path' => [ - 'path', - 'to', - 'fieldWithException' - ] -]; -``` - -To change default **"Internal server error"** message to something else, use: -``` -GraphQL\Error\FormattedError::setInternalErrorMessage("Unexpected error"); -``` - -# Debugging tools - -During development or debugging use `$result->toArray(DebugFlag::INCLUDE_DEBUG_MESSAGE)` to add **debugMessage** key to -each formatted error entry. If you also want to add exception trace - pass flags instead: - -```php -use GraphQL\Error\DebugFlag; -$debug = DebugFlag::INCLUDE_DEBUG_MESSAGE | DebugFlag::INCLUDE_TRACE; -$result = GraphQL::executeQuery(/*args*/)->toArray($debug); -``` - -This will make each error entry to look like this: -```php - 'Actual exception message', - 'message' => 'Internal server error', - 'extensions' => [ - 'category' => 'internal' - ], - 'locations' => [ - ['line' => 10, 'column' => 2] - ], - 'path' => [ - 'listField', - 0, - 'fieldWithException' - ], - 'trace' => [ - /* Formatted original exception trace */ - ] -]; -``` - -If you prefer the first resolver exception to be re-thrown, use following flags: -```php -toArray($debug); -``` - -If you only want to re-throw Exceptions that are not marked as safe through the `ClientAware` interface, use -the flag `Debug::RETHROW_UNSAFE_EXCEPTIONS`. - -# Custom Error Handling and Formatting -It is possible to define custom **formatter** and **handler** for result errors. - -**Formatter** is responsible for converting instances of [`GraphQL\Error\Error`](reference.md#graphqlerrorerror) -to an array. **Handler** is useful for error filtering and logging. - -For example, these are default formatter and handler: - -```php -setErrorFormatter($myErrorFormatter) - ->setErrorsHandler($myErrorHandler) - ->toArray(); -``` - -Note that when you pass [debug flags](#debugging-tools) to **toArray()** your custom formatter will still be -decorated with same debugging information mentioned above. - -# Schema Errors -So far we only covered errors which occur during query execution process. But schema definition can -also throw `GraphQL\Error\InvariantViolation` if there is an error in one of type definitions. - -Usually such errors mean that there is some logical error in your schema and it is the only case -when it makes sense to return `500` error code for GraphQL endpoint: - -```php - [FormattedError::createFromException($e)] - ]; - $status = 500; -} - -header('Content-Type: application/json', true, $status); -echo json_encode($body); -``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/executing-queries.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/executing-queries.md deleted file mode 100644 index 54f82da0..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/executing-queries.md +++ /dev/null @@ -1,208 +0,0 @@ -# Using Facade Method -Query execution is a complex process involving multiple steps, including query **parsing**, -**validating** and finally **executing** against your [schema](type-system/schema.md). - -**graphql-php** provides a convenient facade for this process in class -[`GraphQL\GraphQL`](reference.md#graphqlgraphql): - -```php -toArray(); -``` - -Returned array contains **data** and **errors** keys, as described by the -[GraphQL spec](http://facebook.github.io/graphql/#sec-Response-Format). -This array is suitable for further serialization (e.g. using **json_encode**). -See also the section on [error handling and formatting](error-handling.md). - -Description of **executeQuery** method arguments: - -Argument | Type | Notes ------------- | -------- | ----- -schema | [`GraphQL\Type\Schema`](#) | **Required.** Instance of your application [Schema](type-system/schema.md) -queryString | `string` or `GraphQL\Language\AST\DocumentNode` | **Required.** Actual GraphQL query string to be parsed, validated and executed. If you parse query elsewhere before executing - pass corresponding AST document here to avoid new parsing. -rootValue | `mixed` | Any value that represents a root of your data graph. It is passed as the 1st argument to field resolvers of [Query type](type-system/schema.md#query-and-mutation-types). Can be omitted or set to null if actual root values are fetched by Query type itself. -context | `mixed` | Any value that holds information shared between all field resolvers. Most often they use it to pass currently logged in user, locale details, etc.

It will be available as the 3rd argument in all field resolvers. (see section on [Field Definitions](type-system/object-types.md#field-configuration-options) for reference) **graphql-php** never modifies this value and passes it *as is* to all underlying resolvers. -variableValues | `array` | Map of variable values passed along with query string. See section on [query variables on official GraphQL website](http://graphql.org/learn/queries/#variables). Note that while variableValues must be an associative array, the values inside it can be nested using \stdClass if desired. -operationName | `string` | Allows the caller to specify which operation in queryString will be run, in cases where queryString contains multiple top-level operations. -fieldResolver | `callable` | A resolver function to use when one is not provided by the schema. If not provided, the [default field resolver is used](data-fetching.md#default-field-resolver). -validationRules | `array` | A set of rules for query validation step. The default value is all available rules. Empty array would allow skipping query validation (may be convenient for persisted queries which are validated before persisting and assumed valid during execution) - -# Using Server -If you are building HTTP GraphQL API, you may prefer our Standard Server -(compatible with [express-graphql](https://github.com/graphql/express-graphql)). -It supports more features out of the box, including parsing HTTP requests, producing a spec-compliant response; [batched queries](#query-batching); persisted queries. - -Usage example (with plain PHP): - -```php -handleRequest(); // parses PHP globals and emits response -``` - -Server also supports [PSR-7 request/response interfaces](http://www.php-fig.org/psr/psr-7/): -```php -processPsrRequest($psrRequest, $psrResponse, $psrBodyStream); - - -// Alternatively create PSR-7 response yourself: - -/** @var ExecutionResult|ExecutionResult[] $result */ -$result = $server->executePsrRequest($psrRequest); -$psrResponse = new SomePsr7ResponseImplementation(json_encode($result)); -``` - -PSR-7 is useful when you want to integrate the server into existing framework: - -- [PSR-7 for Laravel](https://laravel.com/docs/requests#psr7-requests) -- [Symfony PSR-7 Bridge](https://symfony.com/doc/current/components/psr7.html) -- [Slim](https://www.slimframework.com/docs/v4/concepts/value-objects.html) -- [Zend Expressive](http://zendframework.github.io/zend-expressive/) - -## Server configuration options - -Argument | Type | Notes ------------- | -------- | ----- -schema | [`Schema`](reference.md#graphqltypeschema) | **Required.** Instance of your application [Schema](type-system/schema/) -rootValue | `mixed` | Any value that represents a root of your data graph. It is passed as the 1st argument to field resolvers of [Query type](type-system/schema.md#query-and-mutation-types). Can be omitted or set to null if actual root values are fetched by Query type itself. -context | `mixed` | Any value that holds information shared between all field resolvers. Most often they use it to pass currently logged in user, locale details, etc.

It will be available as the 3rd argument in all field resolvers. (see section on [Field Definitions](type-system/object-types.md#field-configuration-options) for reference) **graphql-php** never modifies this value and passes it *as is* to all underlying resolvers. -fieldResolver | `callable` | A resolver function to use when one is not provided by the schema. If not provided, the [default field resolver is used](data-fetching.md#default-field-resolver). -validationRules | `array` or `callable` | A set of rules for query validation step. The default value is all available rules. The empty array would allow skipping query validation (may be convenient for persisted queries which are validated before persisting and assumed valid during execution).

Pass `callable` to return different validation rules for different queries (e.g. empty array for persisted query and a full list of rules for regular queries). When passed, it is expected to have the following signature:

**function ([OperationParams](reference.md#graphqlserveroperationparams) $params, DocumentNode $node, $operationType): array** -queryBatching | `bool` | Flag indicating whether this server supports query batching ([apollo-style](https://dev-blog.apollodata.com/query-batching-in-apollo-63acfd859862)).

Defaults to **false** -debug | `int` | Debug flags. See [docs on error debugging](error-handling.md#debugging-tools) (flag values are the same). -persistentQueryLoader | `callable` | A function which is called to fetch actual query when server encounters **queryId** in request vs **query**.

The server does not implement persistence part (which you will have to build on your own), but it allows you to execute queries which were persisted previously.

Expected function signature:
**function ($queryId, [OperationParams](reference.md#graphqlserveroperationparams) $params)**

Function is expected to return query **string** or parsed **DocumentNode**

[Read more about persisted queries](https://dev-blog.apollodata.com/persisted-graphql-queries-with-apollo-client-119fd7e6bba5). -errorFormatter | `callable` | Custom error formatter. See [error handling docs](error-handling.md#custom-error-handling-and-formatting). -errorsHandler | `callable` | Custom errors handler. See [error handling docs](error-handling.md#custom-error-handling-and-formatting). -promiseAdapter | [`PromiseAdapter`](reference.md#graphqlexecutorpromisepromiseadapter) | Required for [Async PHP](data-fetching/#async-php) only. - -**Server config instance** - -If you prefer fluid interface for config with autocomplete in IDE and static time validation, -use [`GraphQL\Server\ServerConfig`](reference.md#graphqlserverserverconfig) instead of an array: - -```php -setSchema($schema) - ->setErrorFormatter($myFormatter) - ->setDebugFlag($debug) -; - -$server = new StandardServer($config); -``` - -## Query batching -Standard Server supports query batching ([apollo-style](https://dev-blog.apollodata.com/query-batching-in-apollo-63acfd859862)). - -One of the major benefits of Server over a sequence of **executeQuery()** calls is that -[Deferred resolvers](data-fetching.md#solving-n1-problem) won't be isolated in queries. -So for example following batch will require single DB request (if user field is deferred): - -```json -[ - { - "query": "{user(id: 1) { id }}" - }, - { - "query": "{user(id: 2) { id }}" - }, - { - "query": "{user(id: 3) { id }}" - } -] -``` - -To enable query batching, pass **queryBatching** option in server config: -```php - true -]); -``` - -# Custom Validation Rules -Before execution, a query is validated using a set of standard rules defined by the GraphQL spec. -It is possible to override standard set of rules globally or per execution. - -Add rules globally: -```php - $myValiationRules -]); -``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/getting-started.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/getting-started.md deleted file mode 100644 index 69abf8ee..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/getting-started.md +++ /dev/null @@ -1,125 +0,0 @@ -# Prerequisites -This documentation assumes your familiarity with GraphQL concepts. If it is not the case - -first learn about GraphQL on [the official website](http://graphql.org/learn/). - -# Installation - -Using [composer](https://getcomposer.org/doc/00-intro.md), run: - -```sh -composer require webonyx/graphql-php -``` - -# Upgrading -We try to keep library releases backwards compatible. But when breaking changes are inevitable -they are explained in [upgrade instructions](https://github.com/webonyx/graphql-php/blob/master/UPGRADE.md). - -# Install Tools (optional) -While it is possible to communicate with GraphQL API using regular HTTP tools it is way -more convenient for humans to use [GraphiQL](https://github.com/graphql/graphiql) - an in-browser -IDE for exploring GraphQL APIs. - -It provides syntax-highlighting, auto-completion and auto-generated documentation for -GraphQL API. - -The easiest way to use it is to install one of the existing Google Chrome extensions: - - - [ChromeiQL](https://chrome.google.com/webstore/detail/chromeiql/fkkiamalmpiidkljmicmjfbieiclmeij) - - [GraphiQL Feen](https://chrome.google.com/webstore/detail/graphiql-feen/mcbfdonlkfpbfdpimkjilhdneikhfklp) - -Alternatively, you can follow instructions on [the GraphiQL](https://github.com/graphql/graphiql) -page and install it locally. - - -# Hello World -Let's create a type system that will be capable to process following simple query: -``` -query { - echo(message: "Hello World") -} -``` - -To do so we need an object type with field `echo`: - -```php - 'Query', - 'fields' => [ - 'echo' => [ - 'type' => Type::string(), - 'args' => [ - 'message' => Type::nonNull(Type::string()), - ], - 'resolve' => function ($rootValue, $args) { - return $rootValue['prefix'] . $args['message']; - } - ], - ], -]); - -``` - -(Note: type definition can be expressed in [different styles](type-system/index.md#type-definition-styles), -but this example uses **inline** style for simplicity) - -The interesting piece here is **resolve** option of field definition. It is responsible for returning -a value of our field. Values of **scalar** fields will be directly included in response while values of -**composite** fields (objects, interfaces, unions) will be passed down to nested field resolvers -(not in this example though). - -Now when our type is ready, let's create GraphQL endpoint file for it **graphql.php**: - -```php - $queryType -]); - -$rawInput = file_get_contents('php://input'); -$input = json_decode($rawInput, true); -$query = $input['query']; -$variableValues = isset($input['variables']) ? $input['variables'] : null; - -try { - $rootValue = ['prefix' => 'You said: ']; - $result = GraphQL::executeQuery($schema, $query, $rootValue, null, $variableValues); - $output = $result->toArray(); -} catch (\Exception $e) { - $output = [ - 'errors' => [ - [ - 'message' => $e->getMessage() - ] - ] - ]; -} -header('Content-Type: application/json'); -echo json_encode($output); -``` - -Our example is finished. Try it by running: -```sh -php -S localhost:8080 graphql.php -curl http://localhost:8080 -d '{"query": "query { echo(message: \"Hello World\") }" }' -``` - -Check out the full [source code](https://github.com/webonyx/graphql-php/blob/master/examples/00-hello-world) of this example -which also includes simple mutation. - -Obviously hello world only scratches the surface of what is possible. -So check out next example, which is closer to real-world apps. -Or keep reading about [schema definition](type-system/index.md). - -# Blog example -It is often easier to start with a full-featured example and then get back to documentation -for your own work. - -Check out [Blog example of GraphQL API](https://github.com/webonyx/graphql-php/tree/master/examples/01-blog). -It is quite close to real-world GraphQL hierarchies. Follow instructions and try it yourself in ~10 minutes. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/how-it-works.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/how-it-works.md deleted file mode 100644 index fd57e2bd..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/how-it-works.md +++ /dev/null @@ -1,35 +0,0 @@ -# Overview -Following reading describes implementation details of query execution process. It may clarify some -internals of GraphQL runtime but is not required to use it. - -# Parsing - -TODOC - -# Validating -TODOC - -# Executing -TODOC - -# Errors explained -There are 3 types of errors in GraphQL: - -- **Syntax**: query has invalid syntax and could not be parsed; -- **Validation**: query is incompatible with type system (e.g. unknown field is requested); -- **Execution**: occurs when some field resolver throws (or returns unexpected value). - -Obviously, when **Syntax** or **Validation** error is detected - the process is interrupted and -the query is not executed. - -Execution process never throws exceptions. Instead, all errors are caught and collected in -execution result. - -GraphQL is forgiving to **Execution** errors which occur in resolvers of nullable fields. -If such field throws or returns unexpected value the value of the field in response will be simply -replaced with **null** and error entry will be registered. - -If an exception is thrown in the non-null field - error bubbles up to the first nullable field. -This nullable field is replaced with **null** and error entry is added to the result. -If all fields up to the root are non-null - **data** entry will be removed from the result -and only **errors** key will be presented. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/index.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/index.md deleted file mode 100644 index a031a423..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/index.md +++ /dev/null @@ -1,55 +0,0 @@ -[![GitHub stars](https://img.shields.io/github/stars/webonyx/graphql-php.svg?style=social&label=Star)](https://github.com/webonyx/graphql-php) -[![Build Status](https://travis-ci.org/webonyx/graphql-php.svg?branch=master)](https://travis-ci.org/webonyx/graphql-php) -[![Coverage Status](https://coveralls.io/repos/github/webonyx/graphql-php/badge.svg)](https://coveralls.io/github/webonyx/graphql-php) -[![Latest Stable Version](https://poser.pugx.org/webonyx/graphql-php/version)](https://packagist.org/packages/webonyx/graphql-php) -[![License](https://poser.pugx.org/webonyx/graphql-php/license)](https://packagist.org/packages/webonyx/graphql-php) - -# About GraphQL - -GraphQL is a modern way to build HTTP APIs consumed by the web and mobile clients. -It is intended to be an alternative to REST and SOAP APIs (even for **existing applications**). - -GraphQL itself is a [specification](https://github.com/facebook/graphql) designed by Facebook -engineers. Various implementations of this specification were written -[in different languages and environments](http://graphql.org/code/). - -Great overview of GraphQL features and benefits is presented on [the official website](http://graphql.org/). -All of them equally apply to this PHP implementation. - - -# About graphql-php - -**graphql-php** is a feature-complete implementation of GraphQL specification in PHP (5.5+, 7.0+). -It was originally inspired by [reference JavaScript implementation](https://github.com/graphql/graphql-js) -published by Facebook. - -This library is a thin wrapper around your existing data layer and business logic. -It doesn't dictate how these layers are implemented or which storage engines -are used. Instead, it provides tools for creating rich API for your existing app. - -Library features include: - - - Primitives to express your app as a [Type System](type-system/index.md) - - Validation and introspection of this Type System (for compatibility with tools like [GraphiQL](complementary-tools.md#tools)) - - Parsing, validating and [executing GraphQL queries](executing-queries.md) against this Type System - - Rich [error reporting](error-handling.md), including query validation and execution errors - - Optional tools for [parsing GraphQL Type language](type-system/type-language.md) - - Tools for [batching requests](data-fetching.md#solving-n1-problem) to backend storage - - [Async PHP platforms support](data-fetching.md#async-php) via promises - - [Standard HTTP server](executing-queries.md#using-server) - -Also, several [complementary tools](complementary-tools.md) are available which provide integrations with -existing PHP frameworks, add support for Relay, etc. - -## Current Status -The first version of this library (v0.1) was released on August 10th 2015. - -The current version supports all features described by GraphQL specification -as well as some experimental features like -[Schema Language parser](type-system/type-language.md) and -[Schema printer](reference.md#graphqlutilsschemaprinter). - -Ready for real-world usage. - -## GitHub -Project source code is [hosted on GitHub](https://github.com/webonyx/graphql-php). diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/reference.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/reference.md deleted file mode 100644 index 73f81148..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/reference.md +++ /dev/null @@ -1,2332 +0,0 @@ -# GraphQL\GraphQL -This is the primary facade for fulfilling GraphQL operations. -See [related documentation](executing-queries.md). - -**Class Methods:** -```php -/** - * Executes graphql query. - * - * More sophisticated GraphQL servers, such as those which persist queries, - * may wish to separate the validation and execution phases to a static time - * tooling step, and a server runtime step. - * - * Available options: - * - * schema: - * The GraphQL type system to use when validating and executing a query. - * source: - * A GraphQL language formatted string representing the requested operation. - * rootValue: - * The value provided as the first argument to resolver functions on the top - * level type (e.g. the query object type). - * contextValue: - * The context value is provided as an argument to resolver functions after - * field arguments. It is used to pass shared information useful at any point - * during executing this query, for example the currently logged in user and - * connections to databases or other services. - * variableValues: - * A mapping of variable name to runtime value to use for all variables - * defined in the requestString. - * operationName: - * The name of the operation to use if requestString contains multiple - * possible operations. Can be omitted if requestString contains only - * one operation. - * fieldResolver: - * A resolver function to use when one is not provided by the schema. - * If not provided, the default field resolver is used (which looks for a - * value on the source value with the field's name). - * validationRules: - * A set of rules for query validation step. Default value is all available rules. - * Empty array would allow to skip query validation (may be convenient for persisted - * queries which are validated before persisting and assumed valid during execution) - * - * @param string|DocumentNode $source - * @param mixed $rootValue - * @param mixed $contextValue - * @param mixed[]|null $variableValues - * @param ValidationRule[] $validationRules - * - * @api - */ -static function executeQuery( - GraphQL\Type\Schema $schema, - $source, - $rootValue = null, - $contextValue = null, - $variableValues = null, - string $operationName = null, - callable $fieldResolver = null, - array $validationRules = null -): GraphQL\Executor\ExecutionResult -``` - -```php -/** - * Same as executeQuery(), but requires PromiseAdapter and always returns a Promise. - * Useful for Async PHP platforms. - * - * @param string|DocumentNode $source - * @param mixed $rootValue - * @param mixed $context - * @param mixed[]|null $variableValues - * @param ValidationRule[]|null $validationRules - * - * @api - */ -static function promiseToExecute( - GraphQL\Executor\Promise\PromiseAdapter $promiseAdapter, - GraphQL\Type\Schema $schema, - $source, - $rootValue = null, - $context = null, - $variableValues = null, - string $operationName = null, - callable $fieldResolver = null, - array $validationRules = null -): GraphQL\Executor\Promise\Promise -``` - -```php -/** - * Returns directives defined in GraphQL spec - * - * @return Directive[] - * - * @api - */ -static function getStandardDirectives(): array -``` - -```php -/** - * Returns types defined in GraphQL spec - * - * @return Type[] - * - * @api - */ -static function getStandardTypes(): array -``` - -```php -/** - * Replaces standard types with types from this list (matching by name) - * Standard types not listed here remain untouched. - * - * @param array $types - * - * @api - */ -static function overrideStandardTypes(array $types) -``` - -```php -/** - * Returns standard validation rules implementing GraphQL spec - * - * @return ValidationRule[] - * - * @api - */ -static function getStandardValidationRules(): array -``` - -```php -/** - * Set default resolver implementation - * - * @api - */ -static function setDefaultFieldResolver(callable $fn): void -``` -# GraphQL\Type\Definition\Type -Registry of standard GraphQL types -and a base class for all other types. - -**Class Methods:** -```php -/** - * @api - */ -static function id(): GraphQL\Type\Definition\ScalarType -``` - -```php -/** - * @api - */ -static function string(): GraphQL\Type\Definition\ScalarType -``` - -```php -/** - * @api - */ -static function boolean(): GraphQL\Type\Definition\ScalarType -``` - -```php -/** - * @api - */ -static function int(): GraphQL\Type\Definition\ScalarType -``` - -```php -/** - * @api - */ -static function float(): GraphQL\Type\Definition\ScalarType -``` - -```php -/** - * @api - */ -static function listOf(GraphQL\Type\Definition\Type $wrappedType): GraphQL\Type\Definition\ListOfType -``` - -```php -/** - * @param callable|NullableType $wrappedType - * - * @api - */ -static function nonNull($wrappedType): GraphQL\Type\Definition\NonNull -``` - -```php -/** - * @param Type $type - * - * @api - */ -static function isInputType($type): bool -``` - -```php -/** - * @param Type $type - * - * @api - */ -static function getNamedType($type): GraphQL\Type\Definition\Type -``` - -```php -/** - * @param Type $type - * - * @api - */ -static function isOutputType($type): bool -``` - -```php -/** - * @param Type $type - * - * @api - */ -static function isLeafType($type): bool -``` - -```php -/** - * @param Type $type - * - * @api - */ -static function isCompositeType($type): bool -``` - -```php -/** - * @param Type $type - * - * @api - */ -static function isAbstractType($type): bool -``` - -```php -/** - * @api - */ -static function getNullableType(GraphQL\Type\Definition\Type $type): GraphQL\Type\Definition\Type -``` -# GraphQL\Type\Definition\ResolveInfo -Structure containing information useful for field resolution process. - -Passed as 4th argument to every field resolver. See [docs on field resolving (data fetching)](data-fetching.md). - -**Class Props:** -```php -/** - * The definition of the field being resolved. - * - * @api - * @var FieldDefinition - */ -public $fieldDefinition; - -/** - * The name of the field being resolved. - * - * @api - * @var string - */ -public $fieldName; - -/** - * Expected return type of the field being resolved. - * - * @api - * @var Type - */ -public $returnType; - -/** - * AST of all nodes referencing this field in the query. - * - * @api - * @var FieldNode[] - */ -public $fieldNodes; - -/** - * Parent type of the field being resolved. - * - * @api - * @var ObjectType - */ -public $parentType; - -/** - * Path to this field from the very root value. - * - * @api - * @var string[] - */ -public $path; - -/** - * Instance of a schema used for execution. - * - * @api - * @var Schema - */ -public $schema; - -/** - * AST of all fragments defined in query. - * - * @api - * @var FragmentDefinitionNode[] - */ -public $fragments; - -/** - * Root value passed to query execution. - * - * @api - * @var mixed - */ -public $rootValue; - -/** - * AST of operation definition node (query, mutation). - * - * @api - * @var OperationDefinitionNode|null - */ -public $operation; - -/** - * Array of variables passed to query execution. - * - * @api - * @var mixed[] - */ -public $variableValues; -``` - -**Class Methods:** -```php -/** - * Helper method that returns names of all fields selected in query for - * $this->fieldName up to $depth levels. - * - * Example: - * query MyQuery{ - * { - * root { - * id, - * nested { - * nested1 - * nested2 { - * nested3 - * } - * } - * } - * } - * - * Given this ResolveInfo instance is a part of "root" field resolution, and $depth === 1, - * method will return: - * [ - * 'id' => true, - * 'nested' => [ - * nested1 => true, - * nested2 => true - * ] - * ] - * - * Warning: this method it is a naive implementation which does not take into account - * conditional typed fragments. So use it with care for fields of interface and union types. - * - * @param int $depth How many levels to include in output - * - * @return array - * - * @api - */ -function getFieldSelection($depth = 0) -``` -# GraphQL\Language\DirectiveLocation -List of available directive locations - -**Class Constants:** -```php -const QUERY = "QUERY"; -const MUTATION = "MUTATION"; -const SUBSCRIPTION = "SUBSCRIPTION"; -const FIELD = "FIELD"; -const FRAGMENT_DEFINITION = "FRAGMENT_DEFINITION"; -const FRAGMENT_SPREAD = "FRAGMENT_SPREAD"; -const INLINE_FRAGMENT = "INLINE_FRAGMENT"; -const VARIABLE_DEFINITION = "VARIABLE_DEFINITION"; -const SCHEMA = "SCHEMA"; -const SCALAR = "SCALAR"; -const OBJECT = "OBJECT"; -const FIELD_DEFINITION = "FIELD_DEFINITION"; -const ARGUMENT_DEFINITION = "ARGUMENT_DEFINITION"; -const IFACE = "INTERFACE"; -const UNION = "UNION"; -const ENUM = "ENUM"; -const ENUM_VALUE = "ENUM_VALUE"; -const INPUT_OBJECT = "INPUT_OBJECT"; -const INPUT_FIELD_DEFINITION = "INPUT_FIELD_DEFINITION"; -``` - -# GraphQL\Type\SchemaConfig -Schema configuration class. -Could be passed directly to schema constructor. List of options accepted by **create** method is -[described in docs](type-system/schema.md#configuration-options). - -Usage example: - - $config = SchemaConfig::create() - ->setQuery($myQueryType) - ->setTypeLoader($myTypeLoader); - - $schema = new Schema($config); - -**Class Methods:** -```php -/** - * Converts an array of options to instance of SchemaConfig - * (or just returns empty config when array is not passed). - * - * @param mixed[] $options - * - * @return SchemaConfig - * - * @api - */ -static function create(array $options = []) -``` - -```php -/** - * @return ObjectType|null - * - * @api - */ -function getQuery() -``` - -```php -/** - * @param ObjectType|null $query - * - * @return SchemaConfig - * - * @api - */ -function setQuery($query) -``` - -```php -/** - * @return ObjectType|null - * - * @api - */ -function getMutation() -``` - -```php -/** - * @param ObjectType|null $mutation - * - * @return SchemaConfig - * - * @api - */ -function setMutation($mutation) -``` - -```php -/** - * @return ObjectType|null - * - * @api - */ -function getSubscription() -``` - -```php -/** - * @param ObjectType|null $subscription - * - * @return SchemaConfig - * - * @api - */ -function setSubscription($subscription) -``` - -```php -/** - * @return Type[]|callable - * - * @api - */ -function getTypes() -``` - -```php -/** - * @param Type[]|callable $types - * - * @return SchemaConfig - * - * @api - */ -function setTypes($types) -``` - -```php -/** - * @return Directive[]|null - * - * @api - */ -function getDirectives() -``` - -```php -/** - * @param Directive[] $directives - * - * @return SchemaConfig - * - * @api - */ -function setDirectives(array $directives) -``` - -```php -/** - * @return callable(string $name):Type|null - * - * @api - */ -function getTypeLoader() -``` - -```php -/** - * @return SchemaConfig - * - * @api - */ -function setTypeLoader(callable $typeLoader) -``` -# GraphQL\Type\Schema -Schema Definition (see [related docs](type-system/schema.md)) - -A Schema is created by supplying the root types of each type of operation: -query, mutation (optional) and subscription (optional). A schema definition is -then supplied to the validator and executor. Usage Example: - - $schema = new GraphQL\Type\Schema([ - 'query' => $MyAppQueryRootType, - 'mutation' => $MyAppMutationRootType, - ]); - -Or using Schema Config instance: - - $config = GraphQL\Type\SchemaConfig::create() - ->setQuery($MyAppQueryRootType) - ->setMutation($MyAppMutationRootType); - - $schema = new GraphQL\Type\Schema($config); - -**Class Methods:** -```php -/** - * @param mixed[]|SchemaConfig $config - * - * @api - */ -function __construct($config) -``` - -```php -/** - * Returns array of all types in this schema. Keys of this array represent type names, values are instances - * of corresponding type definitions - * - * This operation requires full schema scan. Do not use in production environment. - * - * @return Type[] - * - * @api - */ -function getTypeMap() -``` - -```php -/** - * Returns a list of directives supported by this schema - * - * @return Directive[] - * - * @api - */ -function getDirectives() -``` - -```php -/** - * Returns schema query type - * - * @return ObjectType - * - * @api - */ -function getQueryType(): GraphQL\Type\Definition\Type -``` - -```php -/** - * Returns schema mutation type - * - * @return ObjectType|null - * - * @api - */ -function getMutationType(): GraphQL\Type\Definition\Type -``` - -```php -/** - * Returns schema subscription - * - * @return ObjectType|null - * - * @api - */ -function getSubscriptionType(): GraphQL\Type\Definition\Type -``` - -```php -/** - * @return SchemaConfig - * - * @api - */ -function getConfig() -``` - -```php -/** - * Returns type by its name - * - * @api - */ -function getType(string $name): GraphQL\Type\Definition\Type -``` - -```php -/** - * Returns all possible concrete types for given abstract type - * (implementations for interfaces and members of union type for unions) - * - * This operation requires full schema scan. Do not use in production environment. - * - * @param InterfaceType|UnionType $abstractType - * - * @return array - * - * @api - */ -function getPossibleTypes(GraphQL\Type\Definition\Type $abstractType): array -``` - -```php -/** - * Returns true if object type is concrete type of given abstract type - * (implementation for interfaces and members of union type for unions) - * - * @api - */ -function isPossibleType( - GraphQL\Type\Definition\AbstractType $abstractType, - GraphQL\Type\Definition\ObjectType $possibleType -): bool -``` - -```php -/** - * Returns instance of directive by name - * - * @api - */ -function getDirective(string $name): GraphQL\Type\Definition\Directive -``` - -```php -/** - * Validates schema. - * - * This operation requires full schema scan. Do not use in production environment. - * - * @throws InvariantViolation - * - * @api - */ -function assertValid() -``` - -```php -/** - * Validates schema. - * - * This operation requires full schema scan. Do not use in production environment. - * - * @return InvariantViolation[]|Error[] - * - * @api - */ -function validate() -``` -# GraphQL\Language\Parser -Parses string containing GraphQL query or [type definition](type-system/type-language.md) to Abstract Syntax Tree. - -Those magic functions allow partial parsing: - -@method static DocumentNode document(Source|string $source, bool[] $options = []) -@method static ExecutableDefinitionNode executableDefinition(Source|string $source, bool[] $options = []) -@method static string operationType(Source|string $source, bool[] $options = []) -@method static VariableDefinitionNode variableDefinition(Source|string $source, bool[] $options = []) -@method static SelectionSetNode selectionSet(Source|string $source, bool[] $options = []) -@method static FieldNode field(Source|string $source, bool[] $options = []) -@method static NodeList constArguments(Source|string $source, bool[] $options = []) -@method static ArgumentNode constArgument(Source|string $source, bool[] $options = []) -@method static FragmentDefinitionNode fragmentDefinition(Source|string $source, bool[] $options = []) -@method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|NullValueNode|ObjectValueNode|StringValueNode|VariableNode valueLiteral(Source|string $source, bool[] $options = []) -@method static StringValueNode stringLiteral(Source|string $source, bool[] $options = []) -@method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode variableValue(Source|string $source, bool[] $options = []) -@method static ListValueNode constArray(Source|string $source, bool[] $options = []) -@method static ObjectValueNode constObject(Source|string $source, bool[] $options = []) -@method static ObjectFieldNode constObjectField(Source|string $source, bool[] $options = []) -@method static NodeList constDirectives(Source|string $source, bool[] $options = []) -@method static DirectiveNode constDirective(Source|string $source, bool[] $options = []) -@method static NamedTypeNode namedType(Source|string $source, bool[] $options = []) -@method static StringValueNode|null description(Source|string $source, bool[] $options = []) -@method static OperationTypeDefinitionNode operationTypeDefinition(Source|string $source, bool[] $options = []) -@method static ObjectTypeDefinitionNode objectTypeDefinition(Source|string $source, bool[] $options = []) -@method static NodeList fieldsDefinition(Source|string $source, bool[] $options = []) -@method static NodeList argumentsDefinition(Source|string $source, bool[] $options = []) -@method static InterfaceTypeDefinitionNode interfaceTypeDefinition(Source|string $source, bool[] $options = []) -@method static NamedTypeNode[] unionMemberTypes(Source|string $source, bool[] $options = []) -@method static NodeList enumValuesDefinition(Source|string $source, bool[] $options = []) -@method static InputObjectTypeDefinitionNode inputObjectTypeDefinition(Source|string $source, bool[] $options = []) -@method static TypeExtensionNode typeExtension(Source|string $source, bool[] $options = []) -@method static ScalarTypeExtensionNode scalarTypeExtension(Source|string $source, bool[] $options = []) -@method static InterfaceTypeExtensionNode interfaceTypeExtension(Source|string $source, bool[] $options = []) -@method static EnumTypeExtensionNode enumTypeExtension(Source|string $source, bool[] $options = []) -@method static DirectiveDefinitionNode directiveDefinition(Source|string $source, bool[] $options = []) -@method static DirectiveLocation directiveLocation(Source|string $source, bool[] $options = []) - -**Class Methods:** -```php -/** - * Given a GraphQL source, parses it into a `GraphQL\Language\AST\DocumentNode`. - * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. - * - * Available options: - * - * noLocation: boolean, - * (By default, the parser creates AST nodes that know the location - * in the source that they correspond to. This configuration flag - * disables that behavior for performance or testing.) - * - * allowLegacySDLEmptyFields: boolean - * If enabled, the parser will parse empty fields sets in the Schema - * Definition Language. Otherwise, the parser will follow the current - * specification. - * - * This option is provided to ease adoption of the final SDL specification - * and will be removed in a future major release. - * - * allowLegacySDLImplementsInterfaces: boolean - * If enabled, the parser will parse implemented interfaces with no `&` - * character between each interface. Otherwise, the parser will follow the - * current specification. - * - * This option is provided to ease adoption of the final SDL specification - * and will be removed in a future major release. - * - * experimentalFragmentVariables: boolean, - * (If enabled, the parser will understand and parse variable definitions - * contained in a fragment definition. They'll be represented in the - * `variableDefinitions` field of the FragmentDefinitionNode. - * - * The syntax is identical to normal, query-defined variables. For example: - * - * fragment A($var: Boolean = false) on T { - * ... - * } - * - * Note: this feature is experimental and may change or be removed in the - * future.) - * - * @param Source|string $source - * @param bool[] $options - * - * @return DocumentNode - * - * @throws SyntaxError - * - * @api - */ -static function parse($source, array $options = []) -``` - -```php -/** - * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for - * that value. - * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. - * - * This is useful within tools that operate upon GraphQL Values directly and - * in isolation of complete GraphQL documents. - * - * Consider providing the results to the utility function: `GraphQL\Utils\AST::valueFromAST()`. - * - * @param Source|string $source - * @param bool[] $options - * - * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode - * - * @api - */ -static function parseValue($source, array $options = []) -``` - -```php -/** - * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for - * that type. - * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. - * - * This is useful within tools that operate upon GraphQL Types directly and - * in isolation of complete GraphQL documents. - * - * Consider providing the results to the utility function: `GraphQL\Utils\AST::typeFromAST()`. - * - * @param Source|string $source - * @param bool[] $options - * - * @return ListTypeNode|NamedTypeNode|NonNullTypeNode - * - * @api - */ -static function parseType($source, array $options = []) -``` -# GraphQL\Language\Printer -Prints AST to string. Capable of printing GraphQL queries and Type definition language. -Useful for pretty-printing queries or printing back AST for logging, documentation, etc. - -Usage example: - -```php -$query = 'query myQuery {someField}'; -$ast = GraphQL\Language\Parser::parse($query); -$printed = GraphQL\Language\Printer::doPrint($ast); -``` - -**Class Methods:** -```php -/** - * Prints AST to string. Capable of printing GraphQL queries and Type definition language. - * - * @param Node $ast - * - * @return string - * - * @api - */ -static function doPrint($ast) -``` -# GraphQL\Language\Visitor -Utility for efficient AST traversal and modification. - -`visit()` will walk through an AST using a depth first traversal, calling -the visitor's enter function at each node in the traversal, and calling the -leave function after visiting that node and all of it's child nodes. - -By returning different values from the enter and leave functions, the -behavior of the visitor can be altered, including skipping over a sub-tree of -the AST (by returning false), editing the AST by returning a value or null -to remove the value, or to stop the whole traversal by returning BREAK. - -When using `visit()` to edit an AST, the original AST will not be modified, and -a new version of the AST with the changes applied will be returned from the -visit function. - - $editedAST = Visitor::visit($ast, [ - 'enter' => function ($node, $key, $parent, $path, $ancestors) { - // return - // null: no action - // Visitor::skipNode(): skip visiting this node - // Visitor::stop(): stop visiting altogether - // Visitor::removeNode(): delete this node - // any value: replace this node with the returned value - }, - 'leave' => function ($node, $key, $parent, $path, $ancestors) { - // return - // null: no action - // Visitor::stop(): stop visiting altogether - // Visitor::removeNode(): delete this node - // any value: replace this node with the returned value - } - ]); - -Alternatively to providing enter() and leave() functions, a visitor can -instead provide functions named the same as the [kinds of AST nodes](reference.md#graphqllanguageastnodekind), -or enter/leave visitors at a named key, leading to four permutations of -visitor API: - -1) Named visitors triggered when entering a node a specific kind. - - Visitor::visit($ast, [ - 'Kind' => function ($node) { - // enter the "Kind" node - } - ]); - -2) Named visitors that trigger upon entering and leaving a node of - a specific kind. - - Visitor::visit($ast, [ - 'Kind' => [ - 'enter' => function ($node) { - // enter the "Kind" node - } - 'leave' => function ($node) { - // leave the "Kind" node - } - ] - ]); - -3) Generic visitors that trigger upon entering and leaving any node. - - Visitor::visit($ast, [ - 'enter' => function ($node) { - // enter any node - }, - 'leave' => function ($node) { - // leave any node - } - ]); - -4) Parallel visitors for entering and leaving nodes of a specific kind. - - Visitor::visit($ast, [ - 'enter' => [ - 'Kind' => function($node) { - // enter the "Kind" node - } - }, - 'leave' => [ - 'Kind' => function ($node) { - // leave the "Kind" node - } - ] - ]); - -**Class Methods:** -```php -/** - * Visit the AST (see class description for details) - * - * @param Node|ArrayObject|stdClass $root - * @param callable[] $visitor - * @param mixed[]|null $keyMap - * - * @return Node|mixed - * - * @throws Exception - * - * @api - */ -static function visit($root, $visitor, $keyMap = null) -``` - -```php -/** - * Returns marker for visitor break - * - * @return VisitorOperation - * - * @api - */ -static function stop() -``` - -```php -/** - * Returns marker for skipping current node - * - * @return VisitorOperation - * - * @api - */ -static function skipNode() -``` - -```php -/** - * Returns marker for removing a node - * - * @return VisitorOperation - * - * @api - */ -static function removeNode() -``` -# GraphQL\Language\AST\NodeKind - - -**Class Constants:** -```php -const NAME = "Name"; -const DOCUMENT = "Document"; -const OPERATION_DEFINITION = "OperationDefinition"; -const VARIABLE_DEFINITION = "VariableDefinition"; -const VARIABLE = "Variable"; -const SELECTION_SET = "SelectionSet"; -const FIELD = "Field"; -const ARGUMENT = "Argument"; -const FRAGMENT_SPREAD = "FragmentSpread"; -const INLINE_FRAGMENT = "InlineFragment"; -const FRAGMENT_DEFINITION = "FragmentDefinition"; -const INT = "IntValue"; -const FLOAT = "FloatValue"; -const STRING = "StringValue"; -const BOOLEAN = "BooleanValue"; -const ENUM = "EnumValue"; -const NULL = "NullValue"; -const LST = "ListValue"; -const OBJECT = "ObjectValue"; -const OBJECT_FIELD = "ObjectField"; -const DIRECTIVE = "Directive"; -const NAMED_TYPE = "NamedType"; -const LIST_TYPE = "ListType"; -const NON_NULL_TYPE = "NonNullType"; -const SCHEMA_DEFINITION = "SchemaDefinition"; -const OPERATION_TYPE_DEFINITION = "OperationTypeDefinition"; -const SCALAR_TYPE_DEFINITION = "ScalarTypeDefinition"; -const OBJECT_TYPE_DEFINITION = "ObjectTypeDefinition"; -const FIELD_DEFINITION = "FieldDefinition"; -const INPUT_VALUE_DEFINITION = "InputValueDefinition"; -const INTERFACE_TYPE_DEFINITION = "InterfaceTypeDefinition"; -const UNION_TYPE_DEFINITION = "UnionTypeDefinition"; -const ENUM_TYPE_DEFINITION = "EnumTypeDefinition"; -const ENUM_VALUE_DEFINITION = "EnumValueDefinition"; -const INPUT_OBJECT_TYPE_DEFINITION = "InputObjectTypeDefinition"; -const SCALAR_TYPE_EXTENSION = "ScalarTypeExtension"; -const OBJECT_TYPE_EXTENSION = "ObjectTypeExtension"; -const INTERFACE_TYPE_EXTENSION = "InterfaceTypeExtension"; -const UNION_TYPE_EXTENSION = "UnionTypeExtension"; -const ENUM_TYPE_EXTENSION = "EnumTypeExtension"; -const INPUT_OBJECT_TYPE_EXTENSION = "InputObjectTypeExtension"; -const DIRECTIVE_DEFINITION = "DirectiveDefinition"; -const SCHEMA_EXTENSION = "SchemaExtension"; -``` - -# GraphQL\Executor\Executor -Implements the "Evaluating requests" section of the GraphQL specification. - -**Class Methods:** -```php -/** - * Executes DocumentNode against given $schema. - * - * Always returns ExecutionResult and never throws. All errors which occur during operation - * execution are collected in `$result->errors`. - * - * @param mixed|null $rootValue - * @param mixed|null $contextValue - * @param mixed[]|ArrayAccess|null $variableValues - * @param string|null $operationName - * - * @return ExecutionResult|Promise - * - * @api - */ -static function execute( - GraphQL\Type\Schema $schema, - GraphQL\Language\AST\DocumentNode $documentNode, - $rootValue = null, - $contextValue = null, - $variableValues = null, - $operationName = null, - callable $fieldResolver = null -) -``` - -```php -/** - * Same as execute(), but requires promise adapter and returns a promise which is always - * fulfilled with an instance of ExecutionResult and never rejected. - * - * Useful for async PHP platforms. - * - * @param mixed|null $rootValue - * @param mixed|null $contextValue - * @param mixed[]|null $variableValues - * @param string|null $operationName - * - * @return Promise - * - * @api - */ -static function promiseToExecute( - GraphQL\Executor\Promise\PromiseAdapter $promiseAdapter, - GraphQL\Type\Schema $schema, - GraphQL\Language\AST\DocumentNode $documentNode, - $rootValue = null, - $contextValue = null, - $variableValues = null, - $operationName = null, - callable $fieldResolver = null -) -``` -# GraphQL\Executor\ExecutionResult -Returned after [query execution](executing-queries.md). -Represents both - result of successful execution and of a failed one -(with errors collected in `errors` prop) - -Could be converted to [spec-compliant](https://facebook.github.io/graphql/#sec-Response-Format) -serializable array using `toArray()` - -**Class Props:** -```php -/** - * Data collected from resolvers during query execution - * - * @api - * @var mixed[] - */ -public $data; - -/** - * Errors registered during query execution. - * - * If an error was caused by exception thrown in resolver, $error->getPrevious() would - * contain original exception. - * - * @api - * @var Error[] - */ -public $errors; - -/** - * User-defined serializable array of extensions included in serialized result. - * Conforms to - * - * @api - * @var mixed[] - */ -public $extensions; -``` - -**Class Methods:** -```php -/** - * Define custom error formatting (must conform to http://facebook.github.io/graphql/#sec-Errors) - * - * Expected signature is: function (GraphQL\Error\Error $error): array - * - * Default formatter is "GraphQL\Error\FormattedError::createFromException" - * - * Expected returned value must be an array: - * array( - * 'message' => 'errorMessage', - * // ... other keys - * ); - * - * @return self - * - * @api - */ -function setErrorFormatter(callable $errorFormatter) -``` - -```php -/** - * Define custom logic for error handling (filtering, logging, etc). - * - * Expected handler signature is: function (array $errors, callable $formatter): array - * - * Default handler is: - * function (array $errors, callable $formatter) { - * return array_map($formatter, $errors); - * } - * - * @return self - * - * @api - */ -function setErrorsHandler(callable $handler) -``` - -```php -/** - * Converts GraphQL query result to spec-compliant serializable array using provided - * errors handler and formatter. - * - * If debug argument is passed, output of error formatter is enriched which debugging information - * ("debugMessage", "trace" keys depending on flags). - * - * $debug argument must sum of flags from @see \GraphQL\Error\DebugFlag - * - * @return mixed[] - * - * @api - */ -function toArray(int $debug = "GraphQL\Error\DebugFlag::NONE"): array -``` -# GraphQL\Executor\Promise\PromiseAdapter -Provides a means for integration of async PHP platforms ([related docs](data-fetching.md#async-php)) - -**Interface Methods:** -```php -/** - * Return true if the value is a promise or a deferred of the underlying platform - * - * @param mixed $value - * - * @return bool - * - * @api - */ -function isThenable($value) -``` - -```php -/** - * Converts thenable of the underlying platform into GraphQL\Executor\Promise\Promise instance - * - * @param object $thenable - * - * @return Promise - * - * @api - */ -function convertThenable($thenable) -``` - -```php -/** - * Accepts our Promise wrapper, extracts adopted promise out of it and executes actual `then` logic described - * in Promises/A+ specs. Then returns new wrapped instance of GraphQL\Executor\Promise\Promise. - * - * @return Promise - * - * @api - */ -function then( - GraphQL\Executor\Promise\Promise $promise, - callable $onFulfilled = null, - callable $onRejected = null -) -``` - -```php -/** - * Creates a Promise - * - * Expected resolver signature: - * function(callable $resolve, callable $reject) - * - * @return Promise - * - * @api - */ -function create(callable $resolver) -``` - -```php -/** - * Creates a fulfilled Promise for a value if the value is not a promise. - * - * @param mixed $value - * - * @return Promise - * - * @api - */ -function createFulfilled($value = null) -``` - -```php -/** - * Creates a rejected promise for a reason if the reason is not a promise. If - * the provided reason is a promise, then it is returned as-is. - * - * @param Throwable $reason - * - * @return Promise - * - * @api - */ -function createRejected($reason) -``` - -```php -/** - * Given an array of promises (or values), returns a promise that is fulfilled when all the - * items in the array are fulfilled. - * - * @param Promise[]|mixed[] $promisesOrValues Promises or values. - * - * @return Promise - * - * @api - */ -function all(array $promisesOrValues) -``` -# GraphQL\Validator\DocumentValidator -Implements the "Validation" section of the spec. - -Validation runs synchronously, returning an array of encountered errors, or -an empty array if no errors were encountered and the document is valid. - -A list of specific validation rules may be provided. If not provided, the -default list of rules defined by the GraphQL specification will be used. - -Each validation rule is an instance of GraphQL\Validator\Rules\ValidationRule -which returns a visitor (see the [GraphQL\Language\Visitor API](reference.md#graphqllanguagevisitor)). - -Visitor methods are expected to return an instance of [GraphQL\Error\Error](reference.md#graphqlerrorerror), -or array of such instances when invalid. - -Optionally a custom TypeInfo instance may be provided. If not provided, one -will be created from the provided schema. - -**Class Methods:** -```php -/** - * Primary method for query validation. See class description for details. - * - * @param ValidationRule[]|null $rules - * - * @return Error[] - * - * @api - */ -static function validate( - GraphQL\Type\Schema $schema, - GraphQL\Language\AST\DocumentNode $ast, - array $rules = null, - GraphQL\Utils\TypeInfo $typeInfo = null -) -``` - -```php -/** - * Returns all global validation rules. - * - * @return ValidationRule[] - * - * @api - */ -static function allRules() -``` - -```php -/** - * Returns global validation rule by name. Standard rules are named by class name, so - * example usage for such rules: - * - * $rule = DocumentValidator::getRule(GraphQL\Validator\Rules\QueryComplexity::class); - * - * @param string $name - * - * @return ValidationRule - * - * @api - */ -static function getRule($name) -``` - -```php -/** - * Add rule to list of global validation rules - * - * @api - */ -static function addRule(GraphQL\Validator\Rules\ValidationRule $rule) -``` -# GraphQL\Error\Error -Describes an Error found during the parse, validate, or -execute phases of performing a GraphQL operation. In addition to a message -and stack trace, it also includes information about the locations in a -GraphQL document and/or execution result that correspond to the Error. - -When the error was caused by an exception thrown in resolver, original exception -is available via `getPrevious()`. - -Also read related docs on [error handling](error-handling.md) - -Class extends standard PHP `\Exception`, so all standard methods of base `\Exception` class -are available in addition to those listed below. - -**Class Constants:** -```php -const CATEGORY_GRAPHQL = "graphql"; -const CATEGORY_INTERNAL = "internal"; -``` - -**Class Methods:** -```php -/** - * An array of locations within the source GraphQL document which correspond to this error. - * - * Each entry has information about `line` and `column` within source GraphQL document: - * $location->line; - * $location->column; - * - * Errors during validation often contain multiple locations, for example to - * point out to field mentioned in multiple fragments. Errors during execution include a - * single location, the field which produced the error. - * - * @return SourceLocation[] - * - * @api - */ -function getLocations() -``` - -```php -/** - * Returns an array describing the path from the root value to the field which produced this error. - * Only included for execution errors. - * - * @return mixed[]|null - * - * @api - */ -function getPath() -``` -# GraphQL\Error\Warning -Encapsulates warnings produced by the library. - -Warnings can be suppressed (individually or all) if required. -Also it is possible to override warning handler (which is **trigger_error()** by default) - -**Class Constants:** -```php -const WARNING_ASSIGN = 2; -const WARNING_CONFIG = 4; -const WARNING_FULL_SCHEMA_SCAN = 8; -const WARNING_CONFIG_DEPRECATION = 16; -const WARNING_NOT_A_TYPE = 32; -const ALL = 63; -``` - -**Class Methods:** -```php -/** - * Sets warning handler which can intercept all system warnings. - * When not set, trigger_error() is used to notify about warnings. - * - * @api - */ -static function setWarningHandler(callable $warningHandler = null): void -``` - -```php -/** - * Suppress warning by id (has no effect when custom warning handler is set) - * - * Usage example: - * Warning::suppress(Warning::WARNING_NOT_A_TYPE) - * - * When passing true - suppresses all warnings. - * - * @param bool|int $suppress - * - * @api - */ -static function suppress($suppress = true): void -``` - -```php -/** - * Re-enable previously suppressed warning by id - * - * Usage example: - * Warning::suppress(Warning::WARNING_NOT_A_TYPE) - * - * When passing true - re-enables all warnings. - * - * @param bool|int $enable - * - * @api - */ -static function enable($enable = true): void -``` -# GraphQL\Error\ClientAware -This interface is used for [default error formatting](error-handling.md). - -Only errors implementing this interface (and returning true from `isClientSafe()`) -will be formatted with original error message. - -All other errors will be formatted with generic "Internal server error". - -**Interface Methods:** -```php -/** - * Returns true when exception message is safe to be displayed to a client. - * - * @return bool - * - * @api - */ -function isClientSafe() -``` - -```php -/** - * Returns string describing a category of the error. - * - * Value "graphql" is reserved for errors produced by query parsing or validation, do not use it. - * - * @return string - * - * @api - */ -function getCategory() -``` -# GraphQL\Error\DebugFlag -Collection of flags for [error debugging](error-handling.md#debugging-tools). - -**Class Constants:** -```php -const NONE = 0; -const INCLUDE_DEBUG_MESSAGE = 1; -const INCLUDE_TRACE = 2; -const RETHROW_INTERNAL_EXCEPTIONS = 4; -const RETHROW_UNSAFE_EXCEPTIONS = 8; -``` - -# GraphQL\Error\FormattedError -This class is used for [default error formatting](error-handling.md). -It converts PHP exceptions to [spec-compliant errors](https://facebook.github.io/graphql/#sec-Errors) -and provides tools for error debugging. - -**Class Methods:** -```php -/** - * Set default error message for internal errors formatted using createFormattedError(). - * This value can be overridden by passing 3rd argument to `createFormattedError()`. - * - * @param string $msg - * - * @api - */ -static function setInternalErrorMessage($msg) -``` - -```php -/** - * Standard GraphQL error formatter. Converts any exception to array - * conforming to GraphQL spec. - * - * This method only exposes exception message when exception implements ClientAware interface - * (or when debug flags are passed). - * - * For a list of available debug flags @see \GraphQL\Error\DebugFlag constants. - * - * @param string $internalErrorMessage - * - * @return mixed[] - * - * @throws Throwable - * - * @api - */ -static function createFromException( - Throwable $exception, - int $debug = "GraphQL\Error\DebugFlag::NONE", - $internalErrorMessage = null -): array -``` - -```php -/** - * Returns error trace as serializable array - * - * @param Throwable $error - * - * @return mixed[] - * - * @api - */ -static function toSafeTrace($error) -``` -# GraphQL\Server\StandardServer -GraphQL server compatible with both: [express-graphql](https://github.com/graphql/express-graphql) -and [Apollo Server](https://github.com/apollographql/graphql-server). -Usage Example: - - $server = new StandardServer([ - 'schema' => $mySchema - ]); - $server->handleRequest(); - -Or using [ServerConfig](reference.md#graphqlserverserverconfig) instance: - - $config = GraphQL\Server\ServerConfig::create() - ->setSchema($mySchema) - ->setContext($myContext); - - $server = new GraphQL\Server\StandardServer($config); - $server->handleRequest(); - -See [dedicated section in docs](executing-queries.md#using-server) for details. - -**Class Methods:** -```php -/** - * Converts and exception to error and sends spec-compliant HTTP 500 error. - * Useful when an exception is thrown somewhere outside of server execution context - * (e.g. during schema instantiation). - * - * @param Throwable $error - * @param bool $debug - * @param bool $exitWhenDone - * - * @api - */ -static function send500Error($error, $debug = false, $exitWhenDone = false) -``` - -```php -/** - * Creates new instance of a standard GraphQL HTTP server - * - * @param ServerConfig|mixed[] $config - * - * @api - */ -function __construct($config) -``` - -```php -/** - * Parses HTTP request, executes and emits response (using standard PHP `header` function and `echo`) - * - * By default (when $parsedBody is not set) it uses PHP globals to parse a request. - * It is possible to implement request parsing elsewhere (e.g. using framework Request instance) - * and then pass it to the server. - * - * See `executeRequest()` if you prefer to emit response yourself - * (e.g. using Response object of some framework) - * - * @param OperationParams|OperationParams[] $parsedBody - * @param bool $exitWhenDone - * - * @api - */ -function handleRequest($parsedBody = null, $exitWhenDone = false) -``` - -```php -/** - * Executes GraphQL operation and returns execution result - * (or promise when promise adapter is different from SyncPromiseAdapter). - * - * By default (when $parsedBody is not set) it uses PHP globals to parse a request. - * It is possible to implement request parsing elsewhere (e.g. using framework Request instance) - * and then pass it to the server. - * - * PSR-7 compatible method executePsrRequest() does exactly this. - * - * @param OperationParams|OperationParams[] $parsedBody - * - * @return ExecutionResult|ExecutionResult[]|Promise - * - * @throws InvariantViolation - * - * @api - */ -function executeRequest($parsedBody = null) -``` - -```php -/** - * Executes PSR-7 request and fulfills PSR-7 response. - * - * See `executePsrRequest()` if you prefer to create response yourself - * (e.g. using specific JsonResponse instance of some framework). - * - * @return ResponseInterface|Promise - * - * @api - */ -function processPsrRequest( - Psr\Http\Message\RequestInterface $request, - Psr\Http\Message\ResponseInterface $response, - Psr\Http\Message\StreamInterface $writableBodyStream -) -``` - -```php -/** - * Executes GraphQL operation and returns execution result - * (or promise when promise adapter is different from SyncPromiseAdapter) - * - * @return ExecutionResult|ExecutionResult[]|Promise - * - * @api - */ -function executePsrRequest(Psr\Http\Message\RequestInterface $request) -``` - -```php -/** - * Returns an instance of Server helper, which contains most of the actual logic for - * parsing / validating / executing request (which could be re-used by other server implementations) - * - * @return Helper - * - * @api - */ -function getHelper() -``` -# GraphQL\Server\ServerConfig -Server configuration class. -Could be passed directly to server constructor. List of options accepted by **create** method is -[described in docs](executing-queries.md#server-configuration-options). - -Usage example: - - $config = GraphQL\Server\ServerConfig::create() - ->setSchema($mySchema) - ->setContext($myContext); - - $server = new GraphQL\Server\StandardServer($config); - -**Class Methods:** -```php -/** - * Converts an array of options to instance of ServerConfig - * (or just returns empty config when array is not passed). - * - * @param mixed[] $config - * - * @return ServerConfig - * - * @api - */ -static function create(array $config = []) -``` - -```php -/** - * @return self - * - * @api - */ -function setSchema(GraphQL\Type\Schema $schema) -``` - -```php -/** - * @param mixed|callable $context - * - * @return self - * - * @api - */ -function setContext($context) -``` - -```php -/** - * @param mixed|callable $rootValue - * - * @return self - * - * @api - */ -function setRootValue($rootValue) -``` - -```php -/** - * Expects function(Throwable $e) : array - * - * @return self - * - * @api - */ -function setErrorFormatter(callable $errorFormatter) -``` - -```php -/** - * Expects function(array $errors, callable $formatter) : array - * - * @return self - * - * @api - */ -function setErrorsHandler(callable $handler) -``` - -```php -/** - * Set validation rules for this server. - * - * @param ValidationRule[]|callable|null $validationRules - * - * @return self - * - * @api - */ -function setValidationRules($validationRules) -``` - -```php -/** - * @return self - * - * @api - */ -function setFieldResolver(callable $fieldResolver) -``` - -```php -/** - * Expects function($queryId, OperationParams $params) : string|DocumentNode - * - * This function must return query string or valid DocumentNode. - * - * @return self - * - * @api - */ -function setPersistentQueryLoader(callable $persistentQueryLoader) -``` - -```php -/** - * Set response debug flags. @see \GraphQL\Error\DebugFlag class for a list of all available flags - * - * @api - */ -function setDebugFlag(int $debugFlag = "GraphQL\Error\DebugFlag::INCLUDE_DEBUG_MESSAGE"): self -``` - -```php -/** - * Allow batching queries (disabled by default) - * - * @api - */ -function setQueryBatching(bool $enableBatching): self -``` - -```php -/** - * @return self - * - * @api - */ -function setPromiseAdapter(GraphQL\Executor\Promise\PromiseAdapter $promiseAdapter) -``` -# GraphQL\Server\Helper -Contains functionality that could be re-used by various server implementations - -**Class Methods:** -```php -/** - * Parses HTTP request using PHP globals and returns GraphQL OperationParams - * contained in this request. For batched requests it returns an array of OperationParams. - * - * This function does not check validity of these params - * (validation is performed separately in validateOperationParams() method). - * - * If $readRawBodyFn argument is not provided - will attempt to read raw request body - * from `php://input` stream. - * - * Internally it normalizes input to $method, $bodyParams and $queryParams and - * calls `parseRequestParams()` to produce actual return value. - * - * For PSR-7 request parsing use `parsePsrRequest()` instead. - * - * @return OperationParams|OperationParams[] - * - * @throws RequestError - * - * @api - */ -function parseHttpRequest(callable $readRawBodyFn = null) -``` - -```php -/** - * Parses normalized request params and returns instance of OperationParams - * or array of OperationParams in case of batch operation. - * - * Returned value is a suitable input for `executeOperation` or `executeBatch` (if array) - * - * @param string $method - * @param mixed[] $bodyParams - * @param mixed[] $queryParams - * - * @return OperationParams|OperationParams[] - * - * @throws RequestError - * - * @api - */ -function parseRequestParams($method, array $bodyParams, array $queryParams) -``` - -```php -/** - * Checks validity of OperationParams extracted from HTTP request and returns an array of errors - * if params are invalid (or empty array when params are valid) - * - * @return array - * - * @api - */ -function validateOperationParams(GraphQL\Server\OperationParams $params) -``` - -```php -/** - * Executes GraphQL operation with given server configuration and returns execution result - * (or promise when promise adapter is different from SyncPromiseAdapter) - * - * @return ExecutionResult|Promise - * - * @api - */ -function executeOperation(GraphQL\Server\ServerConfig $config, GraphQL\Server\OperationParams $op) -``` - -```php -/** - * Executes batched GraphQL operations with shared promise queue - * (thus, effectively batching deferreds|promises of all queries at once) - * - * @param OperationParams[] $operations - * - * @return ExecutionResult|ExecutionResult[]|Promise - * - * @api - */ -function executeBatch(GraphQL\Server\ServerConfig $config, array $operations) -``` - -```php -/** - * Send response using standard PHP `header()` and `echo`. - * - * @param Promise|ExecutionResult|ExecutionResult[] $result - * @param bool $exitWhenDone - * - * @api - */ -function sendResponse($result, $exitWhenDone = false) -``` - -```php -/** - * Converts PSR-7 request to OperationParams[] - * - * @return OperationParams[]|OperationParams - * - * @throws RequestError - * - * @api - */ -function parsePsrRequest(Psr\Http\Message\RequestInterface $request) -``` - -```php -/** - * Converts query execution result to PSR-7 response - * - * @param Promise|ExecutionResult|ExecutionResult[] $result - * - * @return Promise|ResponseInterface - * - * @api - */ -function toPsrResponse( - $result, - Psr\Http\Message\ResponseInterface $response, - Psr\Http\Message\StreamInterface $writableBodyStream -) -``` -# GraphQL\Server\OperationParams -Structure representing parsed HTTP parameters for GraphQL operation - -**Class Props:** -```php -/** - * Id of the query (when using persistent queries). - * - * Valid aliases (case-insensitive): - * - id - * - queryId - * - documentId - * - * @api - * @var string - */ -public $queryId; - -/** - * @api - * @var string - */ -public $query; - -/** - * @api - * @var string - */ -public $operation; - -/** - * @api - * @var mixed[]|null - */ -public $variables; - -/** - * @api - * @var mixed[]|null - */ -public $extensions; -``` - -**Class Methods:** -```php -/** - * Creates an instance from given array - * - * @param mixed[] $params - * - * @api - */ -static function create(array $params, bool $readonly = false): GraphQL\Server\OperationParams -``` - -```php -/** - * @param string $key - * - * @return mixed - * - * @api - */ -function getOriginalInput($key) -``` - -```php -/** - * Indicates that operation is executed in read-only context - * (e.g. via HTTP GET request) - * - * @return bool - * - * @api - */ -function isReadOnly() -``` -# GraphQL\Utils\BuildSchema -Build instance of `GraphQL\Type\Schema` out of type language definition (string or parsed AST) -See [section in docs](type-system/type-language.md) for details. - -**Class Methods:** -```php -/** - * A helper function to build a GraphQLSchema directly from a source - * document. - * - * @param DocumentNode|Source|string $source - * @param bool[] $options - * - * @return Schema - * - * @api - */ -static function build($source, callable $typeConfigDecorator = null, array $options = []) -``` - -```php -/** - * This takes the ast of a schema document produced by the parse function in - * GraphQL\Language\Parser. - * - * If no schema definition is provided, then it will look for types named Query - * and Mutation. - * - * Given that AST it constructs a GraphQL\Type\Schema. The resulting schema - * has no resolve methods, so execution will use default resolvers. - * - * Accepts options as a third argument: - * - * - commentDescriptions: - * Provide true to use preceding comments as the description. - * This option is provided to ease adoption and will be removed in v16. - * - * @param bool[] $options - * - * @return Schema - * - * @throws Error - * - * @api - */ -static function buildAST( - GraphQL\Language\AST\DocumentNode $ast, - callable $typeConfigDecorator = null, - array $options = [] -) -``` -# GraphQL\Utils\AST -Various utilities dealing with AST - -**Class Methods:** -```php -/** - * Convert representation of AST as an associative array to instance of GraphQL\Language\AST\Node. - * - * For example: - * - * ```php - * AST::fromArray([ - * 'kind' => 'ListValue', - * 'values' => [ - * ['kind' => 'StringValue', 'value' => 'my str'], - * ['kind' => 'StringValue', 'value' => 'my other str'] - * ], - * 'loc' => ['start' => 21, 'end' => 25] - * ]); - * ``` - * - * Will produce instance of `ListValueNode` where `values` prop is a lazily-evaluated `NodeList` - * returning instances of `StringValueNode` on access. - * - * This is a reverse operation for AST::toArray($node) - * - * @param mixed[] $node - * - * @api - */ -static function fromArray(array $node): GraphQL\Language\AST\Node -``` - -```php -/** - * Convert AST node to serializable array - * - * @return mixed[] - * - * @api - */ -static function toArray(GraphQL\Language\AST\Node $node): array -``` - -```php -/** - * Produces a GraphQL Value AST given a PHP value. - * - * Optionally, a GraphQL type may be provided, which will be used to - * disambiguate between value primitives. - * - * | PHP Value | GraphQL Value | - * | ------------- | -------------------- | - * | Object | Input Object | - * | Assoc Array | Input Object | - * | Array | List | - * | Boolean | Boolean | - * | String | String / Enum Value | - * | Int | Int | - * | Float | Int / Float | - * | Mixed | Enum Value | - * | null | NullValue | - * - * @param Type|mixed|null $value - * - * @return ObjectValueNode|ListValueNode|BooleanValueNode|IntValueNode|FloatValueNode|EnumValueNode|StringValueNode|NullValueNode|null - * - * @api - */ -static function astFromValue($value, GraphQL\Type\Definition\InputType $type) -``` - -```php -/** - * Produces a PHP value given a GraphQL Value AST. - * - * A GraphQL type must be provided, which will be used to interpret different - * GraphQL Value literals. - * - * Returns `null` when the value could not be validly coerced according to - * the provided type. - * - * | GraphQL Value | PHP Value | - * | -------------------- | ------------- | - * | Input Object | Assoc Array | - * | List | Array | - * | Boolean | Boolean | - * | String | String | - * | Int / Float | Int / Float | - * | Enum Value | Mixed | - * | Null Value | null | - * - * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode|null $valueNode - * @param mixed[]|null $variables - * - * @return mixed[]|stdClass|null - * - * @throws Exception - * - * @api - */ -static function valueFromAST( - GraphQL\Language\AST\ValueNode $valueNode, - GraphQL\Type\Definition\Type $type, - array $variables = null -) -``` - -```php -/** - * Produces a PHP value given a GraphQL Value AST. - * - * Unlike `valueFromAST()`, no type is provided. The resulting PHP value - * will reflect the provided GraphQL value AST. - * - * | GraphQL Value | PHP Value | - * | -------------------- | ------------- | - * | Input Object | Assoc Array | - * | List | Array | - * | Boolean | Boolean | - * | String | String | - * | Int / Float | Int / Float | - * | Enum | Mixed | - * | Null | null | - * - * @param Node $valueNode - * @param mixed[]|null $variables - * - * @return mixed - * - * @throws Exception - * - * @api - */ -static function valueFromASTUntyped($valueNode, array $variables = null) -``` - -```php -/** - * Returns type definition for given AST Type node - * - * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode - * - * @return Type|null - * - * @throws Exception - * - * @api - */ -static function typeFromAST(GraphQL\Type\Schema $schema, $inputTypeNode) -``` - -```php -/** - * Returns operation type ("query", "mutation" or "subscription") given a document and operation name - * - * @param string $operationName - * - * @return bool|string - * - * @api - */ -static function getOperation(GraphQL\Language\AST\DocumentNode $document, $operationName = null) -``` -# GraphQL\Utils\SchemaPrinter -Given an instance of Schema, prints it in GraphQL type language. - -**Class Methods:** -```php -/** - * @param array $options - * Available options: - * - commentDescriptions: - * Provide true to use preceding comments as the description. - * This option is provided to ease adoption and will be removed in v16. - * - * @api - */ -static function doPrint(GraphQL\Type\Schema $schema, array $options = []): string -``` - -```php -/** - * @param array $options - * - * @api - */ -static function printIntrospectionSchema(GraphQL\Type\Schema $schema, array $options = []): string -``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/security.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/security.md deleted file mode 100644 index 5f1cc610..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/security.md +++ /dev/null @@ -1,94 +0,0 @@ -# Query Complexity Analysis - -This is a PHP port of [Query Complexity Analysis](http://sangria-graphql.org/learn/#query-complexity-analysis) in Sangria implementation. - -Complexity analysis is a separate validation rule which calculates query complexity score before execution. -Every field in the query gets a default score 1 (including ObjectType nodes). Total complexity of the -query is the sum of all field scores. For example, the complexity of introspection query is **109**. - -If this score exceeds a threshold, a query is not executed and an error is returned instead. - -Complexity analysis is disabled by default. To enabled it, add validation rule: - -```php - 'MyType', - 'fields' => [ - 'someList' => [ - 'type' => Type::listOf(Type::string()), - 'args' => [ - 'limit' => [ - 'type' => Type::int(), - 'defaultValue' => 10 - ] - ], - 'complexity' => function($childrenComplexity, $args) { - return $childrenComplexity * $args['limit']; - } - ] - ] -]); -``` - -# Limiting Query Depth - -This is a PHP port of [Limiting Query Depth](http://sangria-graphql.org/learn/#limiting-query-depth) in Sangria implementation. -For example, max depth of the introspection query is **7**. - -It is disabled by default. To enable it, add following validation rule: - -```php - 'track', - 'description' => 'Instruction to record usage of the field by client', - 'locations' => [ - DirectiveLocation::FIELD, - ], - 'args' => [ - new FieldArgument([ - 'name' => 'details', - 'type' => Type::string(), - 'description' => 'String with additional details of field usage scenario', - 'defaultValue' => '' - ]) - ] -]); -``` - -See possible directive locations in -[`GraphQL\Language\DirectiveLocation`](../reference.md#graphqllanguagedirectivelocation). diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/enum-types.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/enum-types.md deleted file mode 100644 index bfab3a54..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/enum-types.md +++ /dev/null @@ -1,182 +0,0 @@ -# Enum Type Definition -Enumeration types are a special kind of scalar that is restricted to a particular set -of allowed values. - -In **graphql-php** enum type is an instance of `GraphQL\Type\Definition\EnumType` -which accepts configuration array in constructor: - -```php - 'Episode', - 'description' => 'One of the films in the Star Wars Trilogy', - 'values' => [ - 'NEWHOPE' => [ - 'value' => 4, - 'description' => 'Released in 1977.' - ], - 'EMPIRE' => [ - 'value' => 5, - 'description' => 'Released in 1980.' - ], - 'JEDI' => [ - 'value' => 6, - 'description' => 'Released in 1983.' - ], - ] -]); -``` - -This example uses an **inline** style for Enum Type definition, but you can also use -[inheritance or type language](index.md#type-definition-styles). - -# Configuration options -Enum Type constructor accepts an array with following options: - -Option | Type | Notes ------- | ---- | ----- -name | `string` | **Required.** Name of the type. When not set - inferred from array key (read about [shorthand field definition](#shorthand-definitions) below) -description | `string` | Plain-text description of the type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) -values | `array` | List of enumerated items, see below for expected structure of each entry - -Each entry of **values** array in turn accepts following options: - -Option | Type | Notes ------- | ---- | ----- -name | `string` | **Required.** Name of the item. When not set - inferred from array key (read about [shorthand field definition](#shorthand-definitions) below) -value | `mixed` | Internal representation of enum item in your application (could be any value, including complex objects or callbacks) -description | `string` | Plain-text description of enum value for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) -deprecationReason | `string` | Text describing why this enum value is deprecated. When not empty - item will not be returned by introspection queries (unless forced) - - -# Shorthand definitions -If internal representation of enumerated item is the same as item name, then you can use -following shorthand for definition: - -```php - 'Episode', - 'description' => 'One of the films in the Star Wars Trilogy', - 'values' => ['NEWHOPE', 'EMPIRE', 'JEDI'] -]); -``` - -which is equivalent of: -```php - 'Episode', - 'description' => 'One of the films in the Star Wars Trilogy', - 'values' => [ - 'NEWHOPE' => ['value' => 'NEWHOPE'], - 'EMPIRE' => ['value' => 'EMPIRE'], - 'JEDI' => ['value' => 'JEDI'] - ] -]); -``` - -which is in turn equivalent of the full form: - -```php - 'Episode', - 'description' => 'One of the films in the Star Wars Trilogy', - 'values' => [ - ['name' => 'NEWHOPE', 'value' => 'NEWHOPE'], - ['name' => 'EMPIRE', 'value' => 'EMPIRE'], - ['name' => 'JEDI', 'value' => 'JEDI'] - ] -]); -``` - -# Field Resolution -When object field is of Enum Type, field resolver is expected to return an internal -representation of corresponding Enum item (**value** in config). **graphql-php** will -then serialize this **value** to **name** to include in response: - -```php - 'Episode', - 'description' => 'One of the films in the Star Wars Trilogy', - 'values' => [ - 'NEWHOPE' => [ - 'value' => 4, - 'description' => 'Released in 1977.' - ], - 'EMPIRE' => [ - 'value' => 5, - 'description' => 'Released in 1980.' - ], - 'JEDI' => [ - 'value' => 6, - 'description' => 'Released in 1983.' - ], - ] -]); - -$heroType = new ObjectType([ - 'name' => 'Hero', - 'fields' => [ - 'appearsIn' => [ - 'type' => $episodeEnum, - 'resolve' => function() { - return 5; // Actual entry in response will be 'appearsIn' => 'EMPIRE' - } - ] - ] -]); -``` - -The Reverse is true when the enum is used as input type (e.g. as field argument). -GraphQL will treat enum input as **name** and convert it into **value** before passing to your app. - -For example, given object type definition: -```php - 'Hero', - 'fields' => [ - 'appearsIn' => [ - 'type' => Type::boolean(), - 'args' => [ - 'episode' => Type::nonNull($enumType) - ], - 'resolve' => function($hero, $args) { - return $args['episode'] === 5 ? true : false; - } - ] - ] -]); -``` - -Then following query: -```graphql -fragment on Hero { - appearsInNewHope: appearsIn(NEWHOPE) - appearsInEmpire: appearsIn(EMPIRE) -} -``` -will return: -```php -[ - 'appearsInNewHope' => false, - 'appearsInEmpire' => true -] -``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/index.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/index.md deleted file mode 100644 index 5aea26c4..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/index.md +++ /dev/null @@ -1,127 +0,0 @@ -# Type System -To start using GraphQL you are expected to implement a type hierarchy and expose it as [Schema](schema.md). - -In graphql-php **type** is an instance of internal class from -`GraphQL\Type\Definition` namespace: [`ObjectType`](object-types.md), -[`InterfaceType`](interfaces.md), [`UnionType`](unions.md), [`InputObjectType`](input-types.md), -[`ScalarType`](scalar-types.md), [`EnumType`](enum-types.md) (or one of subclasses). - -But most of the types in your schema will be [object types](object-types.md). - -# Type Definition Styles -Several styles of type definitions are supported depending on your preferences. - -Inline definitions: -```php - 'MyType', - 'fields' => [ - 'id' => Type::id() - ] -]); -``` - -Class per type: -```php - [ - 'id' => Type::id() - ] - ]; - parent::__construct($config); - } -} -``` - -Using [GraphQL Type language](http://graphql.org/learn/schema/#type-language): - -```graphql -schema { - query: Query - mutation: Mutation -} - -type Query { - greetings(input: HelloInput!): String! -} - -input HelloInput { - firstName: String! - lastName: String -} -``` - -Read more about type language definitions in a [dedicated docs section](type-language.md). - -# Type Registry -Every type must be presented in Schema by a single instance (**graphql-php** -throws when it discovers several instances with the same **name** in the schema). - -Therefore if you define your type as separate PHP class you must ensure that only one -instance of that class is added to the schema. - -The typical way to do this is to create a registry of your types: - -```php -myAType ?: ($this->myAType = new MyAType($this)); - } - - public function myBType() - { - return $this->myBType ?: ($this->myBType = new MyBType($this)); - } -} -``` -And use this registry in type definition: - -```php - [ - 'b' => $types->myBType() - ] - ]); - } -} -``` -Obviously, you can automate this registry as you wish to reduce boilerplate or even -introduce Dependency Injection Container if your types have other dependencies. - -Alternatively, all methods of the registry could be static - then there is no need -to pass it in constructor - instead just use use **TypeRegistry::myAType()** in your -type definitions. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/input-types.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/input-types.md deleted file mode 100644 index 7138557b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/input-types.md +++ /dev/null @@ -1,172 +0,0 @@ -# Mutations -Mutation is just a field of a regular [Object Type](object-types.md) with arguments. -For GraphQL PHP runtime there is no difference between query fields with arguments and mutations. -They are executed [almost](http://facebook.github.io/graphql/#sec-Mutation) identically. -To some extent, Mutation is just a convention described in the GraphQL spec. - -Here is an example of a mutation operation: -```graphql -mutation CreateReviewForEpisode($ep: EpisodeInput!, $review: ReviewInput!) { - createReview(episode: $ep, review: $review) { - stars - commentary - } -} -``` - -To execute such a mutation, you need **Mutation** type [at the root of your schema](schema.md): - -```php - 'Mutation', - 'fields' => [ - // List of mutations: - 'createReview' => [ - 'args' => [ - 'episode' => Type::nonNull($episodeInputType), - 'review' => Type::nonNull($reviewInputType) - ], - 'type' => new ObjectType([ - 'name' => 'CreateReviewOutput', - 'fields' => [ - 'stars' => ['type' => Type::int()], - 'commentary' => ['type' => Type::string()] - ] - ]), - ], - // ... other mutations - ] -]); -``` -As you can see, the only difference from regular object type is the semantics of field names -(verbs vs nouns). - -Also as we see arguments can be of complex types. To leverage the full power of mutations -(and field arguments in general) you must learn how to create complex input types. - - -# About Input and Output Types -All types in GraphQL are of two categories: **input** and **output**. - -* **Output** types (or field types) are: [Scalar](scalar-types.md), [Enum](enum-types.md), [Object](object-types.md), -[Interface](interfaces.md), [Union](unions.md) - -* **Input** types (or argument types) are: [Scalar](scalar-types.md), [Enum](enum-types.md), InputObject - -Obviously, [NonNull and List](lists-and-nonnulls.md) types belong to both categories depending on their -inner type. - -Until now all examples of field **arguments** in this documentation were of [Scalar](scalar-types.md) or -[Enum](enum-types.md) types. But you can also pass complex objects. - -This is particularly valuable in case of mutations, where input data might be rather complex. - -# Input Object Type -GraphQL specification defines Input Object Type for complex inputs. It is similar to ObjectType -except that it's fields have no **args** or **resolve** options and their **type** must be input type. - -In graphql-php **Input Object Type** is an instance of `GraphQL\Type\Definition\InputObjectType` -(or one of it subclasses) which accepts configuration array in constructor: - -```php - 'StoryFiltersInput', - 'fields' => [ - 'author' => [ - 'type' => Type::id(), - 'description' => 'Only show stories with this author id' - ], - 'popular' => [ - 'type' => Type::boolean(), - 'description' => 'Only show popular stories (liked by several people)' - ], - 'tags' => [ - 'type' => Type::listOf(Type::string()), - 'description' => 'Only show stories which contain all of those tags' - ] - ] -]); -``` - -Every field may be of other InputObjectType (thus complex hierarchies of inputs are possible) - -# Configuration options -The constructor of InputObjectType accepts array with only 3 options: - -Option | Type | Notes ------------- | -------- | ----- -name | `string` | **Required.** Unique name of this object type within Schema -fields | `array` or `callable` | **Required**. An array describing object fields or callable returning such an array (see below). -description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) - -Every field is an array with following entries: - -Option | Type | Notes ------- | ---- | ----- -name | `string` | **Required.** Name of the input field. When not set - inferred from **fields** array key -type | `Type` | **Required.** Instance of one of [Input Types](input-types.md) (**Scalar**, **Enum**, **InputObjectType** + any combination of those with **nonNull** and **listOf** modifiers) -description | `string` | Plain-text description of this input field for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) -defaultValue | `scalar` | Default value of this input field. Use the internal value if specifying a default for an **enum** type - -# Using Input Object Type -In the example above we defined our InputObjectType. Now let's use it in one of field arguments: - -```php - 'Query', - 'fields' => [ - 'stories' => [ - 'type' => Type::listOf($storyType), - 'args' => [ - 'filters' => [ - 'type' => $filters, - 'defaultValue' => [ - 'popular' => true - ] - ] - ], - 'resolve' => function($rootValue, $args) { - return DataSource::filterStories($args['filters']); - } - ] - ] -]); -``` -(note that you can define **defaultValue** for fields with complex inputs as associative array). - -Then GraphQL query could include filters as literal value: -```graphql -{ - stories(filters: {author: "1", popular: false}) -} -``` - -Or as query variable: -```graphql -query($filters: StoryFiltersInput!) { - stories(filters: $filters) -} -``` -```php -$variables = [ - 'filters' => [ - "author" => "1", - "popular" => false - ] -]; -``` - -**graphql-php** will validate the input against your InputObjectType definition and pass it to your -resolver as `$args['filters']` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/interfaces.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/interfaces.md deleted file mode 100644 index 100d510e..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/interfaces.md +++ /dev/null @@ -1,174 +0,0 @@ -# Interface Type Definition -An Interface is an abstract type that includes a certain set of fields that a -type must include to implement the interface. - -In **graphql-php** interface type is an instance of `GraphQL\Type\Definition\InterfaceType` -(or one of its subclasses) which accepts configuration array in a constructor: - -```php - 'Character', - 'description' => 'A character in the Star Wars Trilogy', - 'fields' => [ - 'id' => [ - 'type' => Type::nonNull(Type::string()), - 'description' => 'The id of the character.', - ], - 'name' => [ - 'type' => Type::string(), - 'description' => 'The name of the character.' - ] - ], - 'resolveType' => function ($value) { - if ($value->type === 'human') { - return MyTypes::human(); - } else { - return MyTypes::droid(); - } - } -]); -``` -This example uses **inline** style for Interface definition, but you can also use -[inheritance or type language](index.md#type-definition-styles). - -# Configuration options -The constructor of InterfaceType accepts an array. Below is a full list of allowed options: - -Option | Type | Notes ------- | ---- | ----- -name | `string` | **Required.** Unique name of this interface type within Schema -fields | `array` | **Required.** List of fields required to be defined by interface implementors. Same as [Fields for Object Type](object-types.md#field-configuration-options) -description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) -resolveType | `callback` | **function($value, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Receives **$value** from resolver of the parent field and returns concrete interface implementor for this **$value**. - -# Implementing interface -To implement the Interface simply add it to **interfaces** array of Object Type definition: -```php - 'Human', - 'fields' => [ - 'id' => [ - 'type' => Type::nonNull(Type::string()), - 'description' => 'The id of the character.', - ], - 'name' => [ - 'type' => Type::string(), - 'description' => 'The name of the character.' - ] - ], - 'interfaces' => [ - $character - ] -]); -``` -Note that Object Type must include all fields of interface with exact same types -(including **nonNull** specification) and arguments. - -The only exception is when object's field type is more specific than the type of this field defined in interface -(see [Covariant return types for interface fields](#covariant-return-types-for-interface-fields) below) - -# Covariant return types for interface fields -Object types implementing interface may change the field type to more specific. -Example: - -``` -interface A { - field1: A -} - -type B implements A { - field1: B -} -``` - -# Sharing Interface fields -Since every Object Type implementing an Interface must have the same set of fields - it often makes -sense to reuse field definitions of Interface in Object Types: - -```php - 'Human', - 'interfaces' => [ - $character - ], - 'fields' => [ - 'height' => Type::float(), - $character->getField('id'), - $character->getField('name') - ] -]); -``` - -In this case, field definitions are created only once (as a part of Interface Type) and then -reused by all interface implementors. It can save several microseconds and kilobytes + ensures that -field definitions of Interface and implementors are always in sync. - -Yet it creates a problem with the resolution of such fields. There are two ways how shared fields could -be resolved: - -1. If field resolution algorithm is the same for all Interface implementors - you can simply add -**resolve** option to field definition in Interface itself. - -2. If field resolution varies for different implementations - you can specify **resolveField** -option in [Object Type config](object-types.md#configuration-options) and handle field -resolutions there -(Note: **resolve** option in field definition has precedence over **resolveField** option in object type definition) - -# Interface role in data fetching -The only responsibility of interface in Data Fetching process is to return concrete Object Type -for given **$value** in **resolveType**. Then resolution of fields is delegated to resolvers of this -concrete Object Type. - -If a **resolveType** option is omitted, graphql-php will loop through all interface implementors and -use their **isTypeOf** callback to pick the first suitable one. This is obviously less efficient -than single **resolveType** call. So it is recommended to define **resolveType** whenever possible. - -# Prevent invisible types -When object types that implement an interface are not directly referenced by a field, they cannot -be discovered during schema introspection. For example: - -```graphql -type Query { - animal: Animal -} - -interface Animal {...} - -type Cat implements Animal {...} -type Dog implements Animal {...} -``` - -In this example, `Cat` and `Dog` would be considered *invisible* types. Querying the `animal` field -would fail, since no possible implementing types for `Animal` can be found. - -There are two possible solutions: - -1. Add fields that reference the invisible types directly, e.g.: - - ```graphql - type Query { - dog: Dog - cat: Cat - } - ``` - -2. Pass the invisible types during schema construction, e.g.: - -```php -new GraphQLSchema([ - 'query' => ..., - 'types' => [$cat, $dog] -]); -``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/lists-and-nonnulls.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/lists-and-nonnulls.md deleted file mode 100644 index 8f3743db..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/lists-and-nonnulls.md +++ /dev/null @@ -1,62 +0,0 @@ -# Lists -**graphql-php** provides built-in support for lists. In order to create list type - wrap -existing type with `GraphQL\Type\Definition\Type::listOf()` modifier: -```php - 'User', - 'fields' => [ - 'emails' => [ - 'type' => Type::listOf(Type::string()), - 'resolve' => function() { - return ['jon@example.com', 'jonny@example.com']; - } - ] - ] -]); -``` - -Resolvers for such fields are expected to return **array** or instance of PHP's built-in **Traversable** -interface (**null** is allowed by default too). - -If returned value is not of one of these types - **graphql-php** will add an error to result -and set the field value to **null** (only if the field is nullable, see below for non-null fields). - -# Non-Null fields -By default in GraphQL, every field can have a **null** value. To indicate that some field always -returns **non-null** value - use `GraphQL\Type\Definition\Type::nonNull()` modifier: - -```php - 'User', - 'fields' => [ - 'id' => [ - 'type' => Type::nonNull(Type::id()), - 'resolve' => function() { - return uniqid(); - } - ], - 'emails' => [ - 'type' => Type::nonNull(Type::listOf(Type::string())), - 'resolve' => function() { - return ['jon@example.com', 'jonny@example.com']; - } - ] - ] -]); -``` - -If resolver of non-null field returns **null**, graphql-php will add an error to -result and exclude the whole object from the output (an error will bubble to first -nullable parent field which will be set to **null**). - -Read the section on [Data Fetching](../data-fetching.md) for details. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/object-types.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/object-types.md deleted file mode 100644 index 0b950c02..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/object-types.md +++ /dev/null @@ -1,210 +0,0 @@ -# Object Type Definition -Object Type is the most frequently used primitive in a typical GraphQL application. - -Conceptually Object Type is a collection of Fields. Each field, in turn, -has its own type which allows building complex hierarchies. - -In **graphql-php** object type is an instance of `GraphQL\Type\Definition\ObjectType` -(or one of it subclasses) which accepts configuration array in constructor: - -```php - 'User', - 'description' => 'Our blog visitor', - 'fields' => [ - 'firstName' => [ - 'type' => Type::string(), - 'description' => 'User first name' - ], - 'email' => Type::string() - ] -]); - -$blogStory = new ObjectType([ - 'name' => 'Story', - 'fields' => [ - 'body' => Type::string(), - 'author' => [ - 'type' => $userType, - 'description' => 'Story author', - 'resolve' => function(Story $blogStory) { - return DataSource::findUser($blogStory->authorId); - } - ], - 'likes' => [ - 'type' => Type::listOf($userType), - 'description' => 'List of users who liked the story', - 'args' => [ - 'limit' => [ - 'type' => Type::int(), - 'description' => 'Limit the number of recent likes returned', - 'defaultValue' => 10 - ] - ], - 'resolve' => function(Story $blogStory, $args) { - return DataSource::findLikes($blogStory->id, $args['limit']); - } - ] - ] -]); -``` -This example uses **inline** style for Object Type definitions, but you can also use -[inheritance or type language](index.md#type-definition-styles). - - -# Configuration options -Object type constructor expects configuration array. Below is a full list of available options: - -Option | Type | Notes ------------- | -------- | ----- -name | `string` | **Required.** Unique name of this object type within Schema -fields | `array` or `callable` | **Required**. An array describing object fields or callable returning such an array. See [Fields](#field-definitions) section below for expected structure of each array entry. See also the section on [Circular types](#recurring-and-circular-types) for an explanation of when to use callable for this option. -description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) -interfaces | `array` or `callable` | List of interfaces implemented by this type or callable returning such a list. See [Interface Types](interfaces.md) for details. See also the section on [Circular types](#recurring-and-circular-types) for an explanation of when to use callable for this option. -isTypeOf | `callable` | **function($value, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Expected to return **true** if **$value** qualifies for this type (see section about [Abstract Type Resolution](interfaces.md#interface-role-in-data-fetching) for explanation). -resolveField | `callable` | **function($value, $args, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Given the **$value** of this type, it is expected to return value for a field defined in **$info->fieldName**. A good place to define a type-specific strategy for field resolution. See section on [Data Fetching](../data-fetching.md) for details. - -# Field configuration options -Below is a full list of available field configuration options: - -Option | Type | Notes ------- | ---- | ----- -name | `string` | **Required.** Name of the field. When not set - inferred from **fields** array key (read about [shorthand field definition](#shorthand-field-definitions) below) -type | `Type` | **Required.** An instance of internal or custom type. Note: type must be represented by a single instance within one schema (see also [Type Registry](index.md#type-registry)) -args | `array` | An array of possible type arguments. Each entry is expected to be an array with keys: **name**, **type**, **description**, **defaultValue**. See [Field Arguments](#field-arguments) section below. -resolve | `callable` | **function($objectValue, $args, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Given the **$objectValue** of this type, it is expected to return actual value of the current field. See section on [Data Fetching](../data-fetching.md) for details -complexity | `callable` | **function($childrenComplexity, $args)**
Used to restrict query complexity. The feature is disabled by default, read about [Security](../security.md#query-complexity-analysis) to use it. -description | `string` | Plain-text description of this field for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) -deprecationReason | `string` | Text describing why this field is deprecated. When not empty - field will not be returned by introspection queries (unless forced) - -# Field arguments -Every field on a GraphQL object type can have zero or more arguments, defined in **args** option of field definition. -Each argument is an array with following options: - -Option | Type | Notes ------- | ---- | ----- -name | `string` | **Required.** Name of the argument. When not set - inferred from **args** array key -type | `Type` | **Required.** Instance of one of [Input Types](input-types.md) (**scalar**, **enum**, **InputObjectType** + any combination of those with **nonNull** and **listOf** modifiers) -description | `string` | Plain-text description of this argument for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) -defaultValue | `scalar` | Default value for this argument. Use the internal value if specifying a default for an **enum** type - -# Shorthand field definitions -Fields can be also defined in **shorthand** notation (with only **name** and **type** options): -```php -'fields' => [ - 'id' => Type::id(), - 'fieldName' => $fieldType -] -``` -which is equivalent of: -```php -'fields' => [ - 'id' => ['type' => Type::id()], - 'fieldName' => ['type' => $fieldName] -] -``` -which is in turn equivalent of the full form: -```php -'fields' => [ - ['name' => 'id', 'type' => Type::id()], - ['name' => 'fieldName', 'type' => $fieldName] -] -``` -Same shorthand notation applies to field arguments as well. - -# Recurring and circular types -Almost all real-world applications contain recurring or circular types. -Think user friends or nested comments for example. - -**graphql-php** allows such types, but you have to use `callable` in -option **fields** (and/or **interfaces**). - -For example: -```php - 'User', - 'fields' => function() use (&$userType) { - return [ - 'email' => [ - 'type' => Type::string() - ], - 'friends' => [ - 'type' => Type::listOf($userType) - ] - ]; - } -]); -``` - -Same example for [inheritance style of type definitions](index.md#type-definition-styles) using [TypeRegistry](index.md#type-registry): -```php - function() { - return [ - 'email' => MyTypes::string(), - 'friends' => MyTypes::listOf(MyTypes::user()) - ]; - } - ]; - parent::__construct($config); - } -} - -class MyTypes -{ - private static $user; - - public static function user() - { - return self::$user ?: (self::$user = new UserType()); - } - - public static function string() - { - return Type::string(); - } - - public static function listOf($type) - { - return Type::listOf($type); - } -} -``` - -# Field Resolution -Field resolution is the primary mechanism in **graphql-php** for returning actual data for your fields. -It is implemented using **resolveField** callable in type definition or **resolve** -callable in field definition (which has precedence). - -Read the section on [Data Fetching](../data-fetching.md) for a complete description of this process. - -# Custom Metadata -All types in **graphql-php** accept configuration array. In some cases, you may be interested in -passing your own metadata for type or field definition. - -**graphql-php** preserves original configuration array in every type or field instance in -public property **$config**. Use it to implement app-level mappings and definitions. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/scalar-types.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/scalar-types.md deleted file mode 100644 index 074e8c69..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/scalar-types.md +++ /dev/null @@ -1,130 +0,0 @@ -# Built-in Scalar Types -GraphQL specification describes several built-in scalar types. In **graphql-php** they are -exposed as static methods of [`GraphQL\Type\Definition\Type`](../reference.md#graphqltypedefinitiontype) class: - -```php -parseValue($value); - } - - /** - * Parses an externally provided value (query variable) to use as an input - * - * @param mixed $value - * @return mixed - */ - public function parseValue($value) - { - if (!filter_var($value, FILTER_VALIDATE_EMAIL)) { - throw new Error("Cannot represent following value as email: " . Utils::printSafeJson($value)); - } - return $value; - } - - /** - * Parses an externally provided literal value (hardcoded in GraphQL query) to use as an input. - * - * E.g. - * { - * user(email: "user@example.com") - * } - * - * @param \GraphQL\Language\AST\Node $valueNode - * @param array|null $variables - * @return string - * @throws Error - */ - public function parseLiteral(Node $valueNode, ?array $variables = null) - { - // Note: throwing GraphQL\Error\Error vs \UnexpectedValueException to benefit from GraphQL - // error location in query: - if (!$valueNode instanceof StringValueNode) { - throw new Error('Query error: Can only parse strings got: ' . $valueNode->kind, [$valueNode]); - } - if (!filter_var($valueNode->value, FILTER_VALIDATE_EMAIL)) { - throw new Error("Not a valid email", [$valueNode]); - } - return $valueNode->value; - } -} -``` - -Or with inline style: - -```php - 'Email', - 'serialize' => function($value) {/* See function body above */}, - 'parseValue' => function($value) {/* See function body above */}, - 'parseLiteral' => function($valueNode, array $variables = null) {/* See function body above */}, -]); -``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/schema.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/schema.md deleted file mode 100644 index e3ae6e05..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/schema.md +++ /dev/null @@ -1,194 +0,0 @@ -# Schema Definition -The schema is a container of your type hierarchy, which accepts root types in a constructor and provides -methods for receiving information about your types to internal GrahpQL tools. - -In **graphql-php** schema is an instance of [`GraphQL\Type\Schema`](../reference.md#graphqltypeschema) -which accepts configuration array in a constructor: - -```php - $queryType, - 'mutation' => $mutationType, -]); -``` -See possible constructor options [below](#configuration-options). - -# Query and Mutation types -The schema consists of two root types: - -* **Query** type is a surface of your read API -* **Mutation** type (optional) exposes write API by declaring all possible mutations in your app. - -Query and Mutation types are regular [object types](object-types.md) containing root-level fields -of your API: - -```php - 'Query', - 'fields' => [ - 'hello' => [ - 'type' => Type::string(), - 'resolve' => function() { - return 'Hello World!'; - } - ], - 'hero' => [ - 'type' => $characterInterface, - 'args' => [ - 'episode' => [ - 'type' => $episodeEnum - ] - ], - 'resolve' => function ($rootValue, $args) { - return StarWarsData::getHero(isset($args['episode']) ? $args['episode'] : null); - }, - ] - ] -]); - -$mutationType = new ObjectType([ - 'name' => 'Mutation', - 'fields' => [ - 'createReview' => [ - 'type' => $createReviewOutput, - 'args' => [ - 'episode' => $episodeEnum, - 'review' => $reviewInputObject - ], - 'resolve' => function($rootValue, $args) { - // TODOC - } - ] - ] -]); -``` - -Keep in mind that other than the special meaning of declaring a surface area of your API, -those types are the same as any other [object type](object-types.md), and their fields work -exactly the same way. - -**Mutation** type is also just a regular object type. The difference is in semantics. -Field names of Mutation type are usually verbs and they almost always have arguments - quite often -with complex input values (see [Mutations and Input Types](input-types.md) for details). - -# Configuration Options -Schema constructor expects an instance of [`GraphQL\Type\SchemaConfig`](../reference.md#graphqltypeschemaconfig) -or an array with following options: - -Option | Type | Notes ------------- | -------- | ----- -query | `ObjectType` | **Required.** Object type (usually named "Query") containing root-level fields of your read API -mutation | `ObjectType` | Object type (usually named "Mutation") containing root-level fields of your write API -subscription | `ObjectType` | Reserved for future subscriptions implementation. Currently presented for compatibility with introspection query of **graphql-js**, used by various clients (like Relay or GraphiQL) -directives | `Directive[]` | A full list of [directives](directives.md) supported by your schema. By default, contains built-in **@skip** and **@include** directives.

If you pass your own directives and still want to use built-in directives - add them explicitly. For example:

*array_merge(GraphQL::getStandardDirectives(), [$myCustomDirective]);* -types | `ObjectType[]` | List of object types which cannot be detected by **graphql-php** during static schema analysis.

Most often it happens when the object type is never referenced in fields directly but is still a part of a schema because it implements an interface which resolves to this object type in its **resolveType** callable.

Note that you are not required to pass all of your types here - it is simply a workaround for concrete use-case. -typeLoader | `callable` | **function($name)** Expected to return type instance given the name. Must always return the same instance if called multiple times. See section below on lazy type loading. - -# Using config class -If you prefer fluid interface for config with auto-completion in IDE and static time validation, -use [`GraphQL\Type\SchemaConfig`](../reference.md#graphqltypeschemaconfig) instead of an array: - -```php -setQuery($myQueryType) - ->setTypeLoader($myTypeLoader); - -$schema = new Schema($config); -``` - - -# Lazy loading of types -By default, the schema will scan all of your type, field and argument definitions to serve GraphQL queries. -It may cause performance overhead when there are many types in the schema. - -In this case, it is recommended to pass **typeLoader** option to schema constructor and define all -of your object **fields** as callbacks. - -Type loading concept is very similar to PHP class loading, but keep in mind that **typeLoader** must -always return the same instance of a type. - -Usage example: -```php -types[$name])) { - $this->types[$name] = $this->{$name}(); - } - return $this->types[$name]; - } - - private function MyTypeA() - { - return new ObjectType([ - 'name' => 'MyTypeA', - 'fields' => function() { - return [ - 'b' => ['type' => $this->get('MyTypeB')] - ]; - } - ]); - } - - private function MyTypeB() - { - // ... - } -} - -$registry = new Types(); - -$schema = new Schema([ - 'query' => $registry->get('Query'), - 'typeLoader' => function($name) use ($registry) { - return $registry->get($name); - } -]); -``` - - -# Schema Validation -By default, the schema is created with only shallow validation of type and field definitions -(because validation requires full schema scan and is very costly on bigger schemas). - -But there is a special method **assertValid()** on schema instance which throws -`GraphQL\Error\InvariantViolation` exception when it encounters any error, like: - -- Invalid types used for fields/arguments -- Missing interface implementations -- Invalid interface implementations -- Other schema errors... - -Schema validation is supposed to be used in CLI commands or during build step of your app. -Don't call it in web requests in production. - -Usage example: -```php - $myQueryType - ]); - $schema->assertValid(); -} catch (GraphQL\Error\InvariantViolation $e) { - echo $e->getMessage(); -} -``` diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/type-language.md b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/type-language.md deleted file mode 100644 index 29615512..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/docs/type-system/type-language.md +++ /dev/null @@ -1,91 +0,0 @@ -# Defining your schema -Since 0.9.0 - -[Type language](http://graphql.org/learn/schema/#type-language) is a convenient way to define your schema, -especially with IDE autocompletion and syntax validation. - -Here is a simple schema defined in GraphQL type language (e.g. in a separate **schema.graphql** file): - -```graphql -schema { - query: Query - mutation: Mutation -} - -type Query { - greetings(input: HelloInput!): String! -} - -input HelloInput { - firstName: String! - lastName: String -} -``` - -In order to create schema instance out of this file, use -[`GraphQL\Utils\BuildSchema`](../reference.md#graphqlutilsbuildschema): - -```php - 'SearchResult', - 'types' => [ - MyTypes::story(), - MyTypes::user() - ], - 'resolveType' => function($value) { - if ($value->type === 'story') { - return MyTypes::story(); - } else { - return MyTypes::user(); - } - } -]); -``` - -This example uses **inline** style for Union definition, but you can also use -[inheritance or type language](index.md#type-definition-styles). - -# Configuration options -The constructor of UnionType accepts an array. Below is a full list of allowed options: - -Option | Type | Notes ------- | ---- | ----- -name | `string` | **Required.** Unique name of this interface type within Schema -types | `array` | **Required.** List of Object Types included in this Union. Note that you can't create a Union type out of Interfaces or other Unions. -description | `string` | Plain-text description of this type for clients (e.g. used by [GraphiQL](https://github.com/graphql/graphiql) for auto-generated documentation) -resolveType | `callback` | **function($value, $context, [ResolveInfo](../reference.md#graphqltypedefinitionresolveinfo) $info)**
Receives **$value** from resolver of the parent field and returns concrete Object Type for this **$value**. diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/phpstan-baseline.neon b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/phpstan-baseline.neon deleted file mode 100644 index 0cb1ba54..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/phpstan-baseline.neon +++ /dev/null @@ -1,647 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Variable property access on object\\.$#" - count: 2 - path: src/Executor/Executor.php - - - - message: "#^Variable property access on object\\.$#" - count: 2 - path: src/Experimental/Executor/CoroutineExecutor.php - - - - message: "#^Variable property access on mixed\\.$#" - count: 1 - path: src/Experimental/Executor/CoroutineExecutor.php - - - - message: "#^Variable property access on GraphQL\\\\Language\\\\AST\\\\Node\\.$#" - count: 1 - path: src/Language/AST/Node.php - - - - message: "#^Method GraphQL\\\\Language\\\\AST\\\\NodeList\\:\\:splice\\(\\) should return GraphQL\\\\Language\\\\AST\\\\NodeList\\ but returns GraphQL\\\\Language\\\\AST\\\\NodeList\\\\.$#" - count: 1 - path: src/Language/AST/NodeList.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" - count: 1 - path: src/Language/Visitor.php - - - - message: "#^Variable property access on GraphQL\\\\Language\\\\AST\\\\Node\\|null\\.$#" - count: 1 - path: src/Language/Visitor.php - - - - message: "#^Variable property access on GraphQL\\\\Language\\\\AST\\\\Node\\.$#" - count: 1 - path: src/Language/Visitor.php - - - - message: "#^Only booleans are allowed in a negated boolean, \\(callable\\)\\|null given\\.$#" - count: 1 - path: src/Language/Visitor.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, \\(callable\\)\\|null given\\.$#" - count: 2 - path: src/Server/Helper.php - - - - message: "#^Only booleans are allowed in an if condition, int given\\.$#" - count: 1 - path: src/Server/Helper.php - - - - message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" - count: 2 - path: src/Server/Helper.php - - - - message: "#^Only booleans are allowed in &&, string given on the left side\\.$#" - count: 1 - path: src/Server/Helper.php - - - - message: "#^Only booleans are allowed in &&, string given on the right side\\.$#" - count: 1 - path: src/Server/Helper.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, string given\\.$#" - count: 1 - path: src/Server/Helper.php - - - - message: "#^Only booleans are allowed in an if condition, \\(callable\\)\\|null given\\.$#" - count: 1 - path: src/Server/Helper.php - - - - message: "#^Only booleans are allowed in \\|\\|, \\(callable\\)\\|null given on the left side\\.$#" - count: 1 - path: src/Server/Helper.php - - - - message: "#^Only booleans are allowed in a negated boolean, ArrayObject\\ given\\.$#" - count: 1 - path: src/Type/Definition/EnumType.php - - - - message: "#^Variable property access on \\$this\\(GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\)\\.$#" - count: 3 - path: src/Type/Definition/FieldDefinition.php - - - - message: "#^Variable property access on \\$this\\(GraphQL\\\\Type\\\\Definition\\\\InputObjectField\\)\\.$#" - count: 4 - path: src/Type/Definition/InputObjectField.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\SelectionSetNode\\|null given\\.$#" - count: 1 - path: src/Type/Definition/QueryPlan.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\SelectionSetNode\\|null given\\.$#" - count: 1 - path: src/Type/Definition/QueryPlan.php - - - - message: "#^Only booleans are allowed in an if condition, string given\\.$#" - count: 1 - path: src/Type/Definition/Type.php - - - - message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" - count: 2 - path: src/Type/Introspection.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\\\|\\(callable\\) given\\.$#" - count: 1 - path: src/Type/Schema.php - - - - message: "#^Only booleans are allowed in an if condition, \\(callable\\)\\|null given\\.$#" - count: 1 - path: src/Type/Schema.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" - count: 1 - path: src/Type/Schema.php - - - - message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" - count: 1 - path: src/Type/Schema.php - - - - message: "#^Only booleans are allowed in a negated boolean, \\(callable\\)\\|null given\\.$#" - count: 1 - path: src/Type/Schema.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\ObjectType\\|null given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in &&, GraphQL\\\\Type\\\\Definition\\\\ObjectType\\|null given on the left side\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in &&, array\\\\|GraphQL\\\\Language\\\\AST\\\\Node\\|GraphQL\\\\Language\\\\AST\\\\TypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\TypeNode\\|null given on the left side\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\OperationTypeDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Definition\\\\Type given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Error\\\\Error\\|null given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\InputValueDefinitionNode given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\DirectiveDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in &&, array\\ given on the left side\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\DirectiveDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\EnumTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\InputObjectTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\InterfaceTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\ObjectTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\SchemaDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\UnionTypeDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\InterfaceTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\InterfaceTypeExtensionNode\\|GraphQL\\\\Language\\\\AST\\\\ObjectTypeDefinitionNode\\|GraphQL\\\\Language\\\\AST\\\\ObjectTypeExtensionNode given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\FieldDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in &&, GraphQL\\\\Language\\\\AST\\\\FieldDefinitionNode\\|null given on the left side\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in &&, GraphQL\\\\Language\\\\AST\\\\NodeList\\ given on the right side\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\InputValueDefinitionNode\\|null given\\.$#" - count: 2 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\|null given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\FieldArgument\\|null given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in \\|\\|, GraphQL\\\\Type\\\\Definition\\\\FieldArgument\\|null given on the left side\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in &&, array\\ given on the left side\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" - count: 1 - path: src/Type/SchemaValidationContext.php - - - - message: "#^Variable property access on mixed\\.$#" - count: 2 - path: src/Utils/AST.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\BooleanValueNode\\|GraphQL\\\\Language\\\\AST\\\\EnumValueNode\\|GraphQL\\\\Language\\\\AST\\\\FloatValueNode\\|GraphQL\\\\Language\\\\AST\\\\IntValueNode\\|GraphQL\\\\Language\\\\AST\\\\ListValueNode\\|GraphQL\\\\Language\\\\AST\\\\NullValueNode\\|GraphQL\\\\Language\\\\AST\\\\ObjectValueNode\\|GraphQL\\\\Language\\\\AST\\\\StringValueNode\\|null given\\.$#" - count: 2 - path: src/Utils/AST.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\|null given\\.$#" - count: 1 - path: src/Utils/AST.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\EnumValueDefinition\\|null given\\.$#" - count: 1 - path: src/Utils/AST.php - - - - message: "#^Only booleans are allowed in &&, array\\|null given on the left side\\.$#" - count: 1 - path: src/Utils/AST.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" - count: 2 - path: src/Utils/AST.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\NodeList\\ given\\.$#" - count: 1 - path: src/Utils/AST.php - - - - message: "#^Only booleans are allowed in a negated boolean, string\\|null given\\.$#" - count: 1 - path: src/Utils/AST.php - - - - message: "#^Only booleans are allowed in an if condition, callable given\\.$#" - count: 1 - path: src/Utils/ASTDefinitionBuilder.php - - - - message: "#^Only booleans are allowed in &&, array\\\\|null given on the left side\\.$#" - count: 1 - path: src/Utils/PairSet.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" - count: 1 - path: src/Utils/SchemaExtender.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\SchemaDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Utils/SchemaExtender.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\\\|null given\\.$#" - count: 1 - path: src/Utils/TypeInfo.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" - count: 1 - path: src/Utils/TypeInfo.php - - - - message: "#^Only booleans are allowed in an if condition, \\(GraphQL\\\\Type\\\\Definition\\\\CompositeType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" - count: 1 - path: src/Utils/TypeInfo.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\|null given\\.$#" - count: 1 - path: src/Utils/TypeInfo.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\NamedTypeNode given\\.$#" - count: 1 - path: src/Utils/TypeInfo.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\Directive\\|GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\|null given\\.$#" - count: 1 - path: src/Utils/TypeInfo.php - - - - message: "#^Only booleans are allowed in &&, GraphQL\\\\Type\\\\Definition\\\\FieldArgument\\|null given on the left side\\.$#" - count: 1 - path: src/Utils/TypeInfo.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Definition\\\\InputObjectField\\|null given\\.$#" - count: 1 - path: src/Utils/TypeInfo.php - - - - message: "#^Only booleans are allowed in &&, GraphQL\\\\Type\\\\Definition\\\\InputObjectField\\|null given on the left side\\.$#" - count: 1 - path: src/Utils/TypeInfo.php - - - - message: "#^Variable property access on object\\.$#" - count: 1 - path: src/Utils/Utils.php - - - - message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" - count: 1 - path: src/Utils/Utils.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Error\\\\Error\\|null given\\.$#" - count: 1 - path: src/Utils/Utils.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\EnumValueDefinition\\|null given\\.$#" - count: 1 - path: src/Utils/Value.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" - count: 2 - path: src/Utils/Value.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" - count: 2 - path: src/Utils/Value.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, string given\\.$#" - count: 2 - path: src/Utils/Value.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, string\\|null given\\.$#" - count: 1 - path: src/Utils/Value.php - - - - message: "#^Only booleans are allowed in a negated boolean, \\(GraphQL\\\\Type\\\\Definition\\\\CompositeType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/FieldsOnCorrectType.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Type\\\\Definition\\\\FieldDefinition given\\.$#" - count: 1 - path: src/Validator/Rules/FieldsOnCorrectType.php - - - - message: "#^Only booleans are allowed in an if condition, array\\ given\\.$#" - count: 1 - path: src/Validator/Rules/FieldsOnCorrectType.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\NamedTypeNode given\\.$#" - count: 1 - path: src/Validator/Rules/FragmentsOnCompositeTypes.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" - count: 2 - path: src/Validator/Rules/FragmentsOnCompositeTypes.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Schema\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/KnownDirectives.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/KnownDirectives.php - - - - message: "#^Only booleans are allowed in a negated boolean, string given\\.$#" - count: 1 - path: src/Validator/Rules/KnownDirectives.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/KnownFragmentNames.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/NoFragmentCycles.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\NameNode\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\NamedTypeNode given\\.$#" - count: 1 - path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\|null given\\.$#" - count: 2 - path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\ArgumentNode\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\Node given\\.$#" - count: 2 - path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" - count: 3 - path: src/Validator/Rules/OverlappingFieldsCanBeMerged.php - - - - message: "#^Only booleans are allowed in a negated boolean, \\(GraphQL\\\\Type\\\\Definition\\\\CompositeType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/PossibleFragmentSpreads.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/PossibleFragmentSpreads.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\FieldDefinition given\\.$#" - count: 1 - path: src/Validator/Rules/ProvidedRequiredArguments.php - - - - message: "#^Only booleans are allowed in \\|\\|, GraphQL\\\\Language\\\\AST\\\\ArgumentNode\\|null given on the left side\\.$#" - count: 1 - path: src/Validator/Rules/ProvidedRequiredArguments.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Schema\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/QuerySecurityRule.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Language\\\\AST\\\\NameNode\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/QuerySecurityRule.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\OutputType\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/ScalarLeafs.php - - - - message: "#^Only booleans are allowed in an if condition, GraphQL\\\\Language\\\\AST\\\\SelectionSetNode\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/ScalarLeafs.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\SelectionSetNode\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/ScalarLeafs.php - - - - message: "#^Only booleans are allowed in \\|\\|, GraphQL\\\\Type\\\\Definition\\\\EnumType\\|GraphQL\\\\Type\\\\Definition\\\\InputObjectType\\|GraphQL\\\\Type\\\\Definition\\\\ListOfType\\|GraphQL\\\\Type\\\\Definition\\\\NonNull\\|GraphQL\\\\Type\\\\Definition\\\\ScalarType given on the left side\\.$#" - count: 1 - path: src/Validator/Rules/ValuesOfCorrectType.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\EnumValueDefinition\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/ValuesOfCorrectType.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\EnumType\\|GraphQL\\\\Type\\\\Definition\\\\InputObjectType\\|GraphQL\\\\Type\\\\Definition\\\\ListOfType\\|GraphQL\\\\Type\\\\Definition\\\\NonNull\\|GraphQL\\\\Type\\\\Definition\\\\ScalarType given\\.$#" - count: 1 - path: src/Validator/Rules/ValuesOfCorrectType.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, array\\ given\\.$#" - count: 1 - path: src/Validator/Rules/ValuesOfCorrectType.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/VariablesAreInputTypes.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\Type\\|null given\\.$#" - count: 1 - path: src/Validator/Rules/VariablesInAllowedPosition.php - - - - message: "#^Only booleans are allowed in &&, GraphQL\\\\Language\\\\AST\\\\ValueNode\\|null given on the left side\\.$#" - count: 1 - path: src/Validator/Rules/VariablesInAllowedPosition.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Language\\\\AST\\\\FragmentDefinitionNode\\|null given\\.$#" - count: 1 - path: src/Validator/ValidationContext.php - - - - message: "#^Only booleans are allowed in a negated boolean, array\\ given\\.$#" - count: 1 - path: src/Validator/ValidationContext.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Schema given\\.$#" - count: 1 - path: tests/Executor/DirectivesTest.php - - - - message: "#^Anonymous function should have native return typehint \"class@anonymous/tests/Executor/ExecutorTest\\.php\\:1333\"\\.$#" - count: 1 - path: tests/Executor/ExecutorTest.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\InterfaceType given\\.$#" - count: 1 - path: tests/Executor/LazyInterfaceTest.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Definition\\\\ObjectType given\\.$#" - count: 1 - path: tests/Executor/LazyInterfaceTest.php - - - - message: "#^Only booleans are allowed in a negated boolean, GraphQL\\\\Type\\\\Schema given\\.$#" - count: 1 - path: tests/Executor/ValuesTest.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, \\(GraphQL\\\\Type\\\\Definition\\\\CompositeType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" - count: 4 - path: tests/Language/VisitorTest.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, \\(GraphQL\\\\Type\\\\Definition\\\\OutputType&GraphQL\\\\Type\\\\Definition\\\\Type\\)\\|null given\\.$#" - count: 4 - path: tests/Language/VisitorTest.php - - - - message: "#^Only booleans are allowed in a ternary operator condition, GraphQL\\\\Type\\\\Definition\\\\EnumType\\|GraphQL\\\\Type\\\\Definition\\\\InputObjectType\\|GraphQL\\\\Type\\\\Definition\\\\ListOfType\\|GraphQL\\\\Type\\\\Definition\\\\NonNull\\|GraphQL\\\\Type\\\\Definition\\\\ScalarType\\|null given\\.$#" - count: 4 - path: tests/Language/VisitorTest.php - - - - message: "#^Access to an undefined property GraphQL\\\\Type\\\\Definition\\\\FieldDefinition\\:\\:\\$nonExistentProp\\.$#" - count: 2 - path: tests/Type/DefinitionTest.php - - - - message: "#^Access to an undefined property GraphQL\\\\Type\\\\Definition\\\\InputObjectField\\:\\:\\$nonExistentProp\\.$#" - count: 1 - path: tests/Type/DefinitionTest.php - - - - message: "#^Variable property access on \\$this\\(GraphQL\\\\Tests\\\\Type\\\\TypeLoaderTest\\)\\.$#" - count: 1 - path: tests/Type/TypeLoaderTest.php - - - - message: "#^Only booleans are allowed in a negated boolean, stdClass given\\.$#" - count: 1 - path: tests/Utils/AstFromValueTest.php - diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Deferred.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Deferred.php deleted file mode 100644 index ff79ea6b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Deferred.php +++ /dev/null @@ -1,26 +0,0 @@ -nodes = $nodes; - $this->source = $source; - $this->positions = $positions; - $this->path = $path; - $this->extensions = count($extensions) > 0 ? $extensions : ( - $previous instanceof self - ? $previous->extensions - : [] - ); - - if ($previous instanceof ClientAware) { - $this->isClientSafe = $previous->isClientSafe(); - $cat = $previous->getCategory(); - $this->category = $cat === '' || $cat === null ? self::CATEGORY_INTERNAL: $cat; - } elseif ($previous !== null) { - $this->isClientSafe = false; - $this->category = self::CATEGORY_INTERNAL; - } else { - $this->isClientSafe = true; - $this->category = self::CATEGORY_GRAPHQL; - } - } - - /** - * Given an arbitrary Error, presumably thrown while attempting to execute a - * GraphQL operation, produce a new GraphQLError aware of the location in the - * document responsible for the original Error. - * - * @param mixed $error - * @param Node[]|null $nodes - * @param mixed[]|null $path - * - * @return Error - */ - public static function createLocatedError($error, $nodes = null, $path = null) - { - if ($error instanceof self) { - if ($error->path !== null && $error->nodes !== null && count($error->nodes) !== 0) { - return $error; - } - - $nodes = $nodes ?? $error->nodes; - $path = $path ?? $error->path; - } - - $source = null; - $originalError = null; - $positions = []; - $extensions = []; - - if ($error instanceof self) { - $message = $error->getMessage(); - $originalError = $error; - $nodes = $error->nodes ?? $nodes; - $source = $error->source; - $positions = $error->positions; - $extensions = $error->extensions; - } elseif ($error instanceof Throwable) { - $message = $error->getMessage(); - $originalError = $error; - } else { - $message = (string) $error; - } - - return new static( - $message === '' || $message === null ? 'An unknown error occurred.' : $message, - $nodes, - $source, - $positions, - $path, - $originalError, - $extensions - ); - } - - /** - * @return mixed[] - */ - public static function formatError(Error $error) - { - return $error->toSerializableArray(); - } - - /** - * @inheritdoc - */ - public function isClientSafe() - { - return $this->isClientSafe; - } - - /** - * @inheritdoc - */ - public function getCategory() - { - return $this->category; - } - - public function getSource() : ?Source - { - if ($this->source === null) { - if (isset($this->nodes[0]) && $this->nodes[0]->loc !== null) { - $this->source = $this->nodes[0]->loc->source; - } - } - - return $this->source; - } - - /** - * @return int[] - */ - public function getPositions() : array - { - if (count($this->positions) === 0 && count($this->nodes ?? []) > 0) { - $positions = array_map( - static function ($node) : ?int { - return isset($node->loc) ? $node->loc->start : null; - }, - $this->nodes - ); - - $positions = array_filter( - $positions, - static function ($p) : bool { - return $p !== null; - } - ); - - $this->positions = array_values($positions); - } - - return $this->positions; - } - - /** - * An array of locations within the source GraphQL document which correspond to this error. - * - * Each entry has information about `line` and `column` within source GraphQL document: - * $location->line; - * $location->column; - * - * Errors during validation often contain multiple locations, for example to - * point out to field mentioned in multiple fragments. Errors during execution include a - * single location, the field which produced the error. - * - * @return SourceLocation[] - * - * @api - */ - public function getLocations() : array - { - if (! isset($this->locations)) { - $positions = $this->getPositions(); - $source = $this->getSource(); - $nodes = $this->nodes; - - if ($source !== null && count($positions) !== 0) { - $this->locations = array_map( - static function ($pos) use ($source) : SourceLocation { - return $source->getLocation($pos); - }, - $positions - ); - } elseif ($nodes !== null && count($nodes) !== 0) { - $locations = array_filter( - array_map( - static function ($node) : ?SourceLocation { - if (isset($node->loc->source)) { - return $node->loc->source->getLocation($node->loc->start); - } - - return null; - }, - $nodes - ) - ); - $this->locations = array_values($locations); - } else { - $this->locations = []; - } - } - - return $this->locations; - } - - /** - * @return Node[]|null - */ - public function getNodes() - { - return $this->nodes; - } - - /** - * Returns an array describing the path from the root value to the field which produced this error. - * Only included for execution errors. - * - * @return mixed[]|null - * - * @api - */ - public function getPath() - { - return $this->path; - } - - /** - * @return mixed[] - */ - public function getExtensions() - { - return $this->extensions; - } - - /** - * Returns array representation of error suitable for serialization - * - * @deprecated Use FormattedError::createFromException() instead - * - * @return mixed[] - * - * @codeCoverageIgnore - */ - public function toSerializableArray() - { - $arr = [ - 'message' => $this->getMessage(), - ]; - - $locations = Utils::map( - $this->getLocations(), - static function (SourceLocation $loc) : array { - return $loc->toSerializableArray(); - } - ); - - if (count($locations) > 0) { - $arr['locations'] = $locations; - } - if (count($this->path ?? []) > 0) { - $arr['path'] = $this->path; - } - if (count($this->extensions ?? []) > 0) { - $arr['extensions'] = $this->extensions; - } - - return $arr; - } - - /** - * Specify data which should be serialized to JSON - * - * @link http://php.net/manual/en/jsonserializable.jsonserialize.php - * - * @return mixed data which can be serialized by json_encode, - * which is a value of any type other than a resource. - */ - #[ReturnTypeWillChange] - public function jsonSerialize() - { - return $this->toSerializableArray(); - } - - /** - * @return string - */ - public function __toString() - { - return FormattedError::printError($this); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/FormattedError.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/FormattedError.php deleted file mode 100644 index 4748b69f..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/FormattedError.php +++ /dev/null @@ -1,418 +0,0 @@ -nodes ?? []) !== 0) { - /** @var Node $node */ - foreach ($error->nodes as $node) { - if ($node->loc === null) { - continue; - } - - if ($node->loc->source === null) { - continue; - } - - $printedLocations[] = self::highlightSourceAtLocation( - $node->loc->source, - $node->loc->source->getLocation($node->loc->start) - ); - } - } elseif ($error->getSource() !== null && count($error->getLocations()) !== 0) { - $source = $error->getSource(); - foreach (($error->getLocations() ?? []) as $location) { - $printedLocations[] = self::highlightSourceAtLocation($source, $location); - } - } - - return count($printedLocations) === 0 - ? $error->getMessage() - : implode("\n\n", array_merge([$error->getMessage()], $printedLocations)) . "\n"; - } - - /** - * Render a helpful description of the location of the error in the GraphQL - * Source document. - * - * @return string - */ - private static function highlightSourceAtLocation(Source $source, SourceLocation $location) - { - $line = $location->line; - $lineOffset = $source->locationOffset->line - 1; - $columnOffset = self::getColumnOffset($source, $location); - $contextLine = $line + $lineOffset; - $contextColumn = $location->column + $columnOffset; - $prevLineNum = (string) ($contextLine - 1); - $lineNum = (string) $contextLine; - $nextLineNum = (string) ($contextLine + 1); - $padLen = strlen($nextLineNum); - $lines = preg_split('/\r\n|[\n\r]/', $source->body); - - $lines[0] = self::whitespace($source->locationOffset->column - 1) . $lines[0]; - - $outputLines = [ - sprintf('%s (%s:%s)', $source->name, $contextLine, $contextColumn), - $line >= 2 ? (self::lpad($padLen, $prevLineNum) . ': ' . $lines[$line - 2]) : null, - self::lpad($padLen, $lineNum) . ': ' . $lines[$line - 1], - self::whitespace(2 + $padLen + $contextColumn - 1) . '^', - $line < count($lines) ? self::lpad($padLen, $nextLineNum) . ': ' . $lines[$line] : null, - ]; - - return implode("\n", array_filter($outputLines)); - } - - /** - * @return int - */ - private static function getColumnOffset(Source $source, SourceLocation $location) - { - return $location->line === 1 ? $source->locationOffset->column - 1 : 0; - } - - /** - * @param int $len - * - * @return string - */ - private static function whitespace($len) - { - return str_repeat(' ', $len); - } - - /** - * @param int $len - * - * @return string - */ - private static function lpad($len, $str) - { - return self::whitespace($len - mb_strlen($str)) . $str; - } - - /** - * Standard GraphQL error formatter. Converts any exception to array - * conforming to GraphQL spec. - * - * This method only exposes exception message when exception implements ClientAware interface - * (or when debug flags are passed). - * - * For a list of available debug flags @see \GraphQL\Error\DebugFlag constants. - * - * @param string $internalErrorMessage - * - * @return mixed[] - * - * @throws Throwable - * - * @api - */ - public static function createFromException(Throwable $exception, int $debug = DebugFlag::NONE, $internalErrorMessage = null) : array - { - $internalErrorMessage = $internalErrorMessage ?? self::$internalErrorMessage; - - if ($exception instanceof ClientAware) { - $formattedError = [ - 'message' => $exception->isClientSafe() ? $exception->getMessage() : $internalErrorMessage, - 'extensions' => [ - 'category' => $exception->getCategory(), - ], - ]; - } else { - $formattedError = [ - 'message' => $internalErrorMessage, - 'extensions' => [ - 'category' => Error::CATEGORY_INTERNAL, - ], - ]; - } - - if ($exception instanceof Error) { - $locations = Utils::map( - $exception->getLocations(), - static function (SourceLocation $loc) : array { - return $loc->toSerializableArray(); - } - ); - if (count($locations) > 0) { - $formattedError['locations'] = $locations; - } - - if (count($exception->path ?? []) > 0) { - $formattedError['path'] = $exception->path; - } - if (count($exception->getExtensions() ?? []) > 0) { - $formattedError['extensions'] = $exception->getExtensions() + $formattedError['extensions']; - } - } - - if ($debug !== DebugFlag::NONE) { - $formattedError = self::addDebugEntries($formattedError, $exception, $debug); - } - - return $formattedError; - } - - /** - * Decorates spec-compliant $formattedError with debug entries according to $debug flags - * (@see \GraphQL\Error\DebugFlag for available flags) - * - * @param mixed[] $formattedError - * - * @return mixed[] - * - * @throws Throwable - */ - public static function addDebugEntries(array $formattedError, Throwable $e, int $debugFlag) : array - { - if ($debugFlag === DebugFlag::NONE) { - return $formattedError; - } - - if (( $debugFlag & DebugFlag::RETHROW_INTERNAL_EXCEPTIONS) !== 0) { - if (! $e instanceof Error) { - throw $e; - } - - if ($e->getPrevious() !== null) { - throw $e->getPrevious(); - } - } - - $isUnsafe = ! $e instanceof ClientAware || ! $e->isClientSafe(); - - if (($debugFlag & DebugFlag::RETHROW_UNSAFE_EXCEPTIONS) !== 0 && $isUnsafe && $e->getPrevious() !== null) { - throw $e->getPrevious(); - } - - if (($debugFlag & DebugFlag::INCLUDE_DEBUG_MESSAGE) !== 0 && $isUnsafe) { - // Displaying debugMessage as a first entry: - $formattedError = ['debugMessage' => $e->getMessage()] + $formattedError; - } - - if (($debugFlag & DebugFlag::INCLUDE_TRACE) !== 0) { - if ($e instanceof ErrorException || $e instanceof \Error) { - $formattedError += [ - 'file' => $e->getFile(), - 'line' => $e->getLine(), - ]; - } - - $isTrivial = $e instanceof Error && $e->getPrevious() === null; - - if (! $isTrivial) { - $debugging = $e->getPrevious() ?? $e; - $formattedError['trace'] = static::toSafeTrace($debugging); - } - } - - return $formattedError; - } - - /** - * Prepares final error formatter taking in account $debug flags. - * If initial formatter is not set, FormattedError::createFromException is used - */ - public static function prepareFormatter(?callable $formatter, int $debug) : callable - { - $formatter = $formatter ?? static function ($e) : array { - return FormattedError::createFromException($e); - }; - if ($debug !== DebugFlag::NONE) { - $formatter = static function ($e) use ($formatter, $debug) : array { - return FormattedError::addDebugEntries($formatter($e), $e, $debug); - }; - } - - return $formatter; - } - - /** - * Returns error trace as serializable array - * - * @param Throwable $error - * - * @return mixed[] - * - * @api - */ - public static function toSafeTrace($error) - { - $trace = $error->getTrace(); - - if (isset($trace[0]['function']) && isset($trace[0]['class']) && - // Remove invariant entries as they don't provide much value: - ($trace[0]['class'] . '::' . $trace[0]['function'] === 'GraphQL\Utils\Utils::invariant')) { - array_shift($trace); - } elseif (! isset($trace[0]['file'])) { - // Remove root call as it's likely error handler trace: - array_shift($trace); - } - - return array_map( - static function ($err) : array { - $safeErr = array_intersect_key($err, ['file' => true, 'line' => true]); - - if (isset($err['function'])) { - $func = $err['function']; - $args = array_map([self::class, 'printVar'], $err['args'] ?? []); - $funcStr = $func . '(' . implode(', ', $args) . ')'; - - if (isset($err['class'])) { - $safeErr['call'] = $err['class'] . '::' . $funcStr; - } else { - $safeErr['function'] = $funcStr; - } - } - - return $safeErr; - }, - $trace - ); - } - - /** - * @param mixed $var - * - * @return string - */ - public static function printVar($var) - { - if ($var instanceof Type) { - // FIXME: Replace with schema printer call - if ($var instanceof WrappingType) { - $var = $var->getWrappedType(true); - } - - return 'GraphQLType: ' . $var->name; - } - - if (is_object($var)) { - return 'instance of ' . get_class($var) . ($var instanceof Countable ? '(' . count($var) . ')' : ''); - } - if (is_array($var)) { - return 'array(' . count($var) . ')'; - } - if ($var === '') { - return '(empty string)'; - } - if (is_string($var)) { - return "'" . addcslashes($var, "'") . "'"; - } - if (is_bool($var)) { - return $var ? 'true' : 'false'; - } - if (is_scalar($var)) { - return $var; - } - if ($var === null) { - return 'null'; - } - - return gettype($var); - } - - /** - * @deprecated as of v0.8.0 - * - * @param string $error - * @param SourceLocation[] $locations - * - * @return mixed[] - */ - public static function create($error, array $locations = []) - { - $formatted = ['message' => $error]; - - if (count($locations) > 0) { - $formatted['locations'] = array_map( - static function ($loc) : array { - return $loc->toArray(); - }, - $locations - ); - } - - return $formatted; - } - - /** - * @deprecated as of v0.10.0, use general purpose method createFromException() instead - * - * @return mixed[] - * - * @codeCoverageIgnore - */ - public static function createFromPHPError(ErrorException $e) - { - return [ - 'message' => $e->getMessage(), - 'severity' => $e->getSeverity(), - 'trace' => self::toSafeTrace($e), - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/InvariantViolation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/InvariantViolation.php deleted file mode 100644 index c3cb8abe..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Error/InvariantViolation.php +++ /dev/null @@ -1,20 +0,0 @@ - 0 && ! isset(self::$warned[$warningId])) { - self::$warned[$warningId] = true; - trigger_error($errorMessage, $messageLevel); - } - } - - public static function warn(string $errorMessage, int $warningId, ?int $messageLevel = null) : void - { - $messageLevel = $messageLevel ?? E_USER_WARNING; - - if (self::$warningHandler !== null) { - $fn = self::$warningHandler; - $fn($errorMessage, $warningId, $messageLevel); - } elseif ((self::$enableWarnings & $warningId) > 0) { - trigger_error($errorMessage, $messageLevel); - } - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Exception/InvalidArgument.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Exception/InvalidArgument.php deleted file mode 100644 index eea34d56..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Exception/InvalidArgument.php +++ /dev/null @@ -1,20 +0,0 @@ -schema = $schema; - $this->fragments = $fragments; - $this->rootValue = $rootValue; - $this->contextValue = $contextValue; - $this->operation = $operation; - $this->variableValues = $variableValues; - $this->errors = $errors ?? []; - $this->fieldResolver = $fieldResolver; - $this->promiseAdapter = $promiseAdapter; - } - - public function addError(Error $error) - { - $this->errors[] = $error; - - return $this; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php deleted file mode 100644 index 6bc7931c..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutionResult.php +++ /dev/null @@ -1,166 +0,0 @@ -getPrevious() would - * contain original exception. - * - * @api - * @var Error[] - */ - public $errors; - - /** - * User-defined serializable array of extensions included in serialized result. - * Conforms to - * - * @api - * @var mixed[] - */ - public $extensions; - - /** @var callable */ - private $errorFormatter; - - /** @var callable */ - private $errorsHandler; - - /** - * @param mixed[] $data - * @param Error[] $errors - * @param mixed[] $extensions - */ - public function __construct($data = null, array $errors = [], array $extensions = []) - { - $this->data = $data; - $this->errors = $errors; - $this->extensions = $extensions; - } - - /** - * Define custom error formatting (must conform to http://facebook.github.io/graphql/#sec-Errors) - * - * Expected signature is: function (GraphQL\Error\Error $error): array - * - * Default formatter is "GraphQL\Error\FormattedError::createFromException" - * - * Expected returned value must be an array: - * array( - * 'message' => 'errorMessage', - * // ... other keys - * ); - * - * @return self - * - * @api - */ - public function setErrorFormatter(callable $errorFormatter) - { - $this->errorFormatter = $errorFormatter; - - return $this; - } - - /** - * Define custom logic for error handling (filtering, logging, etc). - * - * Expected handler signature is: function (array $errors, callable $formatter): array - * - * Default handler is: - * function (array $errors, callable $formatter) { - * return array_map($formatter, $errors); - * } - * - * @return self - * - * @api - */ - public function setErrorsHandler(callable $handler) - { - $this->errorsHandler = $handler; - - return $this; - } - - /** - * @return mixed[] - */ - public function jsonSerialize() : array - { - return $this->toArray(); - } - - /** - * Converts GraphQL query result to spec-compliant serializable array using provided - * errors handler and formatter. - * - * If debug argument is passed, output of error formatter is enriched which debugging information - * ("debugMessage", "trace" keys depending on flags). - * - * $debug argument must sum of flags from @see \GraphQL\Error\DebugFlag - * - * @return mixed[] - * - * @api - */ - public function toArray(int $debug = DebugFlag::NONE) : array - { - $result = []; - - if (count($this->errors ?? []) > 0) { - $errorsHandler = $this->errorsHandler ?? static function (array $errors, callable $formatter) : array { - return array_map($formatter, $errors); - }; - - $handledErrors = $errorsHandler( - $this->errors, - FormattedError::prepareFormatter($this->errorFormatter, $debug) - ); - - // While we know that there were errors initially, they might have been discarded - if ($handledErrors !== []) { - $result['errors'] = $handledErrors; - } - } - - if ($this->data !== null) { - $result['data'] = $this->data; - } - - if (count($this->extensions ?? []) > 0) { - $result['extensions'] = $this->extensions; - } - - return $result; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Executor.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Executor.php deleted file mode 100644 index c6040bdf..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Executor.php +++ /dev/null @@ -1,190 +0,0 @@ -errors`. - * - * @param mixed|null $rootValue - * @param mixed|null $contextValue - * @param array|ArrayAccess|null $variableValues - * @param string|null $operationName - * - * @return ExecutionResult|Promise - * - * @api - */ - public static function execute( - Schema $schema, - DocumentNode $documentNode, - $rootValue = null, - $contextValue = null, - $variableValues = null, - $operationName = null, - ?callable $fieldResolver = null - ) { - // TODO: deprecate (just always use SyncAdapter here) and have `promiseToExecute()` for other cases - - $promiseAdapter = static::getPromiseAdapter(); - - $result = static::promiseToExecute( - $promiseAdapter, - $schema, - $documentNode, - $rootValue, - $contextValue, - $variableValues, - $operationName, - $fieldResolver - ); - - if ($promiseAdapter instanceof SyncPromiseAdapter) { - $result = $promiseAdapter->wait($result); - } - - return $result; - } - - /** - * Same as execute(), but requires promise adapter and returns a promise which is always - * fulfilled with an instance of ExecutionResult and never rejected. - * - * Useful for async PHP platforms. - * - * @param mixed|null $rootValue - * @param mixed|null $contextValue - * @param array|null $variableValues - * @param string|null $operationName - * - * @return Promise - * - * @api - */ - public static function promiseToExecute( - PromiseAdapter $promiseAdapter, - Schema $schema, - DocumentNode $documentNode, - $rootValue = null, - $contextValue = null, - $variableValues = null, - $operationName = null, - ?callable $fieldResolver = null - ) { - $factory = self::$implementationFactory; - - /** @var ExecutorImplementation $executor */ - $executor = $factory( - $promiseAdapter, - $schema, - $documentNode, - $rootValue, - $contextValue, - $variableValues, - $operationName, - $fieldResolver ?? self::$defaultFieldResolver - ); - - return $executor->doExecute(); - } - - /** - * If a resolve function is not given, then a default resolve behavior is used - * which takes the property of the root value of the same name as the field - * and returns it as the result, or if it's a function, returns the result - * of calling that function while passing along args and context. - * - * @param mixed $objectValue - * @param array $args - * @param mixed|null $contextValue - * - * @return mixed|null - */ - public static function defaultFieldResolver($objectValue, $args, $contextValue, ResolveInfo $info) - { - $fieldName = $info->fieldName; - $property = null; - - if (is_array($objectValue) || $objectValue instanceof ArrayAccess) { - if (isset($objectValue[$fieldName])) { - $property = $objectValue[$fieldName]; - } - } elseif (is_object($objectValue)) { - if (isset($objectValue->{$fieldName})) { - $property = $objectValue->{$fieldName}; - } - } - - return $property instanceof Closure - ? $property($objectValue, $args, $contextValue, $info) - : $property; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutorImplementation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutorImplementation.php deleted file mode 100644 index 46cb2b72..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/ExecutorImplementation.php +++ /dev/null @@ -1,15 +0,0 @@ -resolve($value); - } elseif ($onRejected !== null) { - self::resolveWithCallable($deferred, $onRejected, $reason); - } else { - $deferred->fail($reason); - } - }; - - /** @var AmpPromise $adoptedPromise */ - $adoptedPromise = $promise->adoptedPromise; - $adoptedPromise->onResolve($onResolve); - - return new Promise($deferred->promise(), $this); - } - - /** - * @inheritdoc - */ - public function create(callable $resolver) : Promise - { - $deferred = new Deferred(); - - $resolver( - static function ($value) use ($deferred) : void { - $deferred->resolve($value); - }, - static function (Throwable $exception) use ($deferred) : void { - $deferred->fail($exception); - } - ); - - return new Promise($deferred->promise(), $this); - } - - /** - * @inheritdoc - */ - public function createFulfilled($value = null) : Promise - { - $promise = new Success($value); - - return new Promise($promise, $this); - } - - /** - * @inheritdoc - */ - public function createRejected($reason) : Promise - { - $promise = new Failure($reason); - - return new Promise($promise, $this); - } - - /** - * @inheritdoc - */ - public function all(array $promisesOrValues) : Promise - { - /** @var AmpPromise[] $promises */ - $promises = []; - foreach ($promisesOrValues as $key => $item) { - if ($item instanceof Promise) { - $promises[$key] = $item->adoptedPromise; - } elseif ($item instanceof AmpPromise) { - $promises[$key] = $item; - } - } - - $deferred = new Deferred(); - - $onResolve = static function (?Throwable $reason, ?array $values) use ($promisesOrValues, $deferred) : void { - if ($reason === null) { - $deferred->resolve(array_replace($promisesOrValues, $values)); - - return; - } - - $deferred->fail($reason); - }; - - all($promises)->onResolve($onResolve); - - return new Promise($deferred->promise(), $this); - } - - private static function resolveWithCallable(Deferred $deferred, callable $callback, $argument) : void - { - try { - $result = $callback($argument); - } catch (Throwable $exception) { - $deferred->fail($exception); - - return; - } - - if ($result instanceof Promise) { - $result = $result->adoptedPromise; - } - - $deferred->resolve($result); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php deleted file mode 100644 index 14ff5027..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/ReactPromiseAdapter.php +++ /dev/null @@ -1,100 +0,0 @@ -adoptedPromise; - - return new Promise($adoptedPromise->then($onFulfilled, $onRejected), $this); - } - - /** - * @inheritdoc - */ - public function create(callable $resolver) - { - $promise = new ReactPromise($resolver); - - return new Promise($promise, $this); - } - - /** - * @inheritdoc - */ - public function createFulfilled($value = null) - { - $promise = resolve($value); - - return new Promise($promise, $this); - } - - /** - * @inheritdoc - */ - public function createRejected($reason) - { - $promise = reject($reason); - - return new Promise($promise, $this); - } - - /** - * @inheritdoc - */ - public function all(array $promisesOrValues) - { - // TODO: rework with generators when PHP minimum required version is changed to 5.5+ - $promisesOrValues = Utils::map( - $promisesOrValues, - static function ($item) { - return $item instanceof Promise ? $item->adoptedPromise : $item; - } - ); - - $promise = all($promisesOrValues)->then(static function ($values) use ($promisesOrValues) : array { - $orderedResults = []; - - foreach ($promisesOrValues as $key => $value) { - $orderedResults[$key] = $values[$key]; - } - - return $orderedResults; - }); - - return new Promise($promise, $this); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php deleted file mode 100644 index d0b94b18..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromise.php +++ /dev/null @@ -1,202 +0,0 @@ -isEmpty()) { - $task = $q->dequeue(); - $task(); - } - } - - /** - * @param callable() : mixed $executor - */ - public function __construct(?callable $executor = null) - { - if ($executor === null) { - return; - } - self::getQueue()->enqueue(function () use ($executor) : void { - try { - $this->resolve($executor()); - } catch (Throwable $e) { - $this->reject($e); - } - }); - } - - public function resolve($value) : self - { - switch ($this->state) { - case self::PENDING: - if ($value === $this) { - throw new Exception('Cannot resolve promise with self'); - } - if (is_object($value) && method_exists($value, 'then')) { - $value->then( - function ($resolvedValue) : void { - $this->resolve($resolvedValue); - }, - function ($reason) : void { - $this->reject($reason); - } - ); - - return $this; - } - - $this->state = self::FULFILLED; - $this->result = $value; - $this->enqueueWaitingPromises(); - break; - case self::FULFILLED: - if ($this->result !== $value) { - throw new Exception('Cannot change value of fulfilled promise'); - } - break; - case self::REJECTED: - throw new Exception('Cannot resolve rejected promise'); - } - - return $this; - } - - public function reject($reason) : self - { - if (! $reason instanceof Throwable) { - throw new Exception('SyncPromise::reject() has to be called with an instance of \Throwable'); - } - - switch ($this->state) { - case self::PENDING: - $this->state = self::REJECTED; - $this->result = $reason; - $this->enqueueWaitingPromises(); - break; - case self::REJECTED: - if ($reason !== $this->result) { - throw new Exception('Cannot change rejection reason'); - } - break; - case self::FULFILLED: - throw new Exception('Cannot reject fulfilled promise'); - } - - return $this; - } - - private function enqueueWaitingPromises() : void - { - Utils::invariant( - $this->state !== self::PENDING, - 'Cannot enqueue derived promises when parent is still pending' - ); - - foreach ($this->waiting as $descriptor) { - self::getQueue()->enqueue(function () use ($descriptor) : void { - /** @var self $promise */ - [$promise, $onFulfilled, $onRejected] = $descriptor; - - if ($this->state === self::FULFILLED) { - try { - $promise->resolve($onFulfilled === null ? $this->result : $onFulfilled($this->result)); - } catch (Throwable $e) { - $promise->reject($e); - } - } elseif ($this->state === self::REJECTED) { - try { - if ($onRejected === null) { - $promise->reject($this->result); - } else { - $promise->resolve($onRejected($this->result)); - } - } catch (Throwable $e) { - $promise->reject($e); - } - } - }); - } - $this->waiting = []; - } - - public static function getQueue() : SplQueue - { - return self::$queue ?? self::$queue = new SplQueue(); - } - - /** - * @param callable(mixed) : mixed $onFulfilled - * @param callable(Throwable) : mixed $onRejected - */ - public function then(?callable $onFulfilled = null, ?callable $onRejected = null) : self - { - if ($this->state === self::REJECTED && $onRejected === null) { - return $this; - } - if ($this->state === self::FULFILLED && $onFulfilled === null) { - return $this; - } - $tmp = new self(); - $this->waiting[] = [$tmp, $onFulfilled, $onRejected]; - - if ($this->state !== self::PENDING) { - $this->enqueueWaitingPromises(); - } - - return $tmp; - } - - /** - * @param callable(Throwable) : mixed $onRejected - */ - public function catch(callable $onRejected) : self - { - return $this->then(null, $onRejected); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php deleted file mode 100644 index f088aec2..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Adapter/SyncPromiseAdapter.php +++ /dev/null @@ -1,180 +0,0 @@ -adoptedPromise; - - return new Promise($adoptedPromise->then($onFulfilled, $onRejected), $this); - } - - /** - * @inheritdoc - */ - public function create(callable $resolver) - { - $promise = new SyncPromise(); - - try { - $resolver( - [ - $promise, - 'resolve', - ], - [ - $promise, - 'reject', - ] - ); - } catch (Throwable $e) { - $promise->reject($e); - } - - return new Promise($promise, $this); - } - - /** - * @inheritdoc - */ - public function createFulfilled($value = null) - { - $promise = new SyncPromise(); - - return new Promise($promise->resolve($value), $this); - } - - /** - * @inheritdoc - */ - public function createRejected($reason) - { - $promise = new SyncPromise(); - - return new Promise($promise->reject($reason), $this); - } - - /** - * @inheritdoc - */ - public function all(array $promisesOrValues) - { - $all = new SyncPromise(); - - $total = count($promisesOrValues); - $count = 0; - $result = []; - - foreach ($promisesOrValues as $index => $promiseOrValue) { - if ($promiseOrValue instanceof Promise) { - $result[$index] = null; - $promiseOrValue->then( - static function ($value) use ($index, &$count, $total, &$result, $all) : void { - $result[$index] = $value; - $count++; - if ($count < $total) { - return; - } - - $all->resolve($result); - }, - [$all, 'reject'] - ); - } else { - $result[$index] = $promiseOrValue; - $count++; - } - } - if ($count === $total) { - $all->resolve($result); - } - - return new Promise($all, $this); - } - - /** - * Synchronously wait when promise completes - * - * @return ExecutionResult - */ - public function wait(Promise $promise) - { - $this->beforeWait($promise); - $taskQueue = SyncPromise::getQueue(); - - while ($promise->adoptedPromise->state === SyncPromise::PENDING && - ! $taskQueue->isEmpty() - ) { - SyncPromise::runQueue(); - $this->onWait($promise); - } - - /** @var SyncPromise $syncPromise */ - $syncPromise = $promise->adoptedPromise; - - if ($syncPromise->state === SyncPromise::FULFILLED) { - return $syncPromise->result; - } - - if ($syncPromise->state === SyncPromise::REJECTED) { - throw $syncPromise->result; - } - - throw new InvariantViolation('Could not resolve promise'); - } - - /** - * Execute just before starting to run promise completion - */ - protected function beforeWait(Promise $promise) - { - } - - /** - * Execute while running promise completion - */ - protected function onWait(Promise $promise) - { - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Promise.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Promise.php deleted file mode 100644 index 5823d14b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/Promise.php +++ /dev/null @@ -1,40 +0,0 @@ -adapter = $adapter; - $this->adoptedPromise = $adoptedPromise; - } - - /** - * @return Promise - */ - public function then(?callable $onFulfilled = null, ?callable $onRejected = null) - { - return $this->adapter->then($this, $onFulfilled, $onRejected); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php deleted file mode 100644 index c3d40984..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Promise/PromiseAdapter.php +++ /dev/null @@ -1,92 +0,0 @@ -exeContext = $context; - $this->subFieldCache = new SplObjectStorage(); - } - - /** - * @param mixed $rootValue - * @param mixed $contextValue - * @param array|Traversable $variableValues - */ - public static function create( - PromiseAdapter $promiseAdapter, - Schema $schema, - DocumentNode $documentNode, - $rootValue, - $contextValue, - $variableValues, - ?string $operationName, - callable $fieldResolver - ) : ExecutorImplementation { - $exeContext = static::buildExecutionContext( - $schema, - $documentNode, - $rootValue, - $contextValue, - $variableValues, - $operationName, - $fieldResolver, - $promiseAdapter - ); - - if (is_array($exeContext)) { - return new class($promiseAdapter->createFulfilled(new ExecutionResult(null, $exeContext))) implements ExecutorImplementation - { - /** @var Promise */ - private $result; - - public function __construct(Promise $result) - { - $this->result = $result; - } - - public function doExecute() : Promise - { - return $this->result; - } - }; - } - - return new static($exeContext); - } - - /** - * Constructs an ExecutionContext object from the arguments passed to - * execute, which we will pass throughout the other execution methods. - * - * @param mixed $rootValue - * @param mixed $contextValue - * @param array|Traversable $rawVariableValues - * - * @return ExecutionContext|array - */ - protected static function buildExecutionContext( - Schema $schema, - DocumentNode $documentNode, - $rootValue, - $contextValue, - $rawVariableValues, - ?string $operationName = null, - ?callable $fieldResolver = null, - ?PromiseAdapter $promiseAdapter = null - ) { - $errors = []; - $fragments = []; - /** @var OperationDefinitionNode|null $operation */ - $operation = null; - $hasMultipleAssumedOperations = false; - foreach ($documentNode->definitions as $definition) { - switch (true) { - case $definition instanceof OperationDefinitionNode: - if ($operationName === null && $operation !== null) { - $hasMultipleAssumedOperations = true; - } - if ($operationName === null || - (isset($definition->name) && $definition->name->value === $operationName)) { - $operation = $definition; - } - break; - case $definition instanceof FragmentDefinitionNode: - $fragments[$definition->name->value] = $definition; - break; - } - } - if ($operation === null) { - if ($operationName === null) { - $errors[] = new Error('Must provide an operation.'); - } else { - $errors[] = new Error(sprintf('Unknown operation named "%s".', $operationName)); - } - } elseif ($hasMultipleAssumedOperations) { - $errors[] = new Error( - 'Must provide operation name if query contains multiple operations.' - ); - } - $variableValues = null; - if ($operation !== null) { - [$coercionErrors, $coercedVariableValues] = Values::getVariableValues( - $schema, - $operation->variableDefinitions ?? [], - $rawVariableValues ?? [] - ); - if (count($coercionErrors ?? []) === 0) { - $variableValues = $coercedVariableValues; - } else { - $errors = array_merge($errors, $coercionErrors); - } - } - if (count($errors) > 0) { - return $errors; - } - Utils::invariant($operation, 'Has operation if no errors.'); - Utils::invariant($variableValues !== null, 'Has variables if no errors.'); - - return new ExecutionContext( - $schema, - $fragments, - $rootValue, - $contextValue, - $operation, - $variableValues, - $errors, - $fieldResolver, - $promiseAdapter - ); - } - - public function doExecute() : Promise - { - // Return a Promise that will eventually resolve to the data described by - // the "Response" section of the GraphQL specification. - // - // If errors are encountered while executing a GraphQL field, only that - // field and its descendants will be omitted, and sibling fields will still - // be executed. An execution which encounters errors will still result in a - // resolved Promise. - $data = $this->executeOperation($this->exeContext->operation, $this->exeContext->rootValue); - $result = $this->buildResponse($data); - - // Note: we deviate here from the reference implementation a bit by always returning promise - // But for the "sync" case it is always fulfilled - return $this->isPromise($result) - ? $result - : $this->exeContext->promiseAdapter->createFulfilled($result); - } - - /** - * @param mixed|Promise|null $data - * - * @return ExecutionResult|Promise - */ - protected function buildResponse($data) - { - if ($this->isPromise($data)) { - return $data->then(function ($resolved) { - return $this->buildResponse($resolved); - }); - } - if ($data !== null) { - $data = (array) $data; - } - - return new ExecutionResult($data, $this->exeContext->errors); - } - - /** - * Implements the "Evaluating operations" section of the spec. - * - * @param mixed $rootValue - * - * @return array|Promise|stdClass|null - */ - protected function executeOperation(OperationDefinitionNode $operation, $rootValue) - { - $type = $this->getOperationRootType($this->exeContext->schema, $operation); - $fields = $this->collectFields($type, $operation->selectionSet, new ArrayObject(), new ArrayObject()); - $path = []; - // Errors from sub-fields of a NonNull type may propagate to the top level, - // at which point we still log the error and null the parent field, which - // in this case is the entire response. - // - // Similar to completeValueCatchingError. - try { - $result = $operation->operation === 'mutation' - ? $this->executeFieldsSerially($type, $rootValue, $path, $fields) - : $this->executeFields($type, $rootValue, $path, $fields); - if ($this->isPromise($result)) { - return $result->then( - null, - function ($error) : ?Promise { - if ($error instanceof Error) { - $this->exeContext->addError($error); - - return $this->exeContext->promiseAdapter->createFulfilled(null); - } - - return null; - } - ); - } - - return $result; - } catch (Error $error) { - $this->exeContext->addError($error); - - return null; - } - } - - /** - * Extracts the root type of the operation from the schema. - * - * @throws Error - */ - protected function getOperationRootType(Schema $schema, OperationDefinitionNode $operation) : ObjectType - { - switch ($operation->operation) { - case 'query': - $queryType = $schema->getQueryType(); - if ($queryType === null) { - throw new Error( - 'Schema does not define the required query root type.', - [$operation] - ); - } - - return $queryType; - case 'mutation': - $mutationType = $schema->getMutationType(); - if ($mutationType === null) { - throw new Error( - 'Schema is not configured for mutations.', - [$operation] - ); - } - - return $mutationType; - case 'subscription': - $subscriptionType = $schema->getSubscriptionType(); - if ($subscriptionType === null) { - throw new Error( - 'Schema is not configured for subscriptions.', - [$operation] - ); - } - - return $subscriptionType; - default: - throw new Error( - 'Can only execute queries, mutations and subscriptions.', - [$operation] - ); - } - } - - /** - * Given a selectionSet, adds all of the fields in that selection to - * the passed in map of fields, and returns it at the end. - * - * CollectFields requires the "runtime type" of an object. For a field which - * returns an Interface or Union type, the "runtime type" will be the actual - * Object type returned by that field. - */ - protected function collectFields( - ObjectType $runtimeType, - SelectionSetNode $selectionSet, - ArrayObject $fields, - ArrayObject $visitedFragmentNames - ) : ArrayObject { - $exeContext = $this->exeContext; - foreach ($selectionSet->selections as $selection) { - switch (true) { - case $selection instanceof FieldNode: - if (! $this->shouldIncludeNode($selection)) { - break; - } - $name = static::getFieldEntryKey($selection); - if (! isset($fields[$name])) { - $fields[$name] = new ArrayObject(); - } - $fields[$name][] = $selection; - break; - case $selection instanceof InlineFragmentNode: - if (! $this->shouldIncludeNode($selection) || - ! $this->doesFragmentConditionMatch($selection, $runtimeType) - ) { - break; - } - $this->collectFields( - $runtimeType, - $selection->selectionSet, - $fields, - $visitedFragmentNames - ); - break; - case $selection instanceof FragmentSpreadNode: - $fragName = $selection->name->value; - - if (($visitedFragmentNames[$fragName] ?? false) === true || ! $this->shouldIncludeNode($selection)) { - break; - } - $visitedFragmentNames[$fragName] = true; - /** @var FragmentDefinitionNode|null $fragment */ - $fragment = $exeContext->fragments[$fragName] ?? null; - if ($fragment === null || ! $this->doesFragmentConditionMatch($fragment, $runtimeType)) { - break; - } - $this->collectFields( - $runtimeType, - $fragment->selectionSet, - $fields, - $visitedFragmentNames - ); - break; - } - } - - return $fields; - } - - /** - * Determines if a field should be included based on the @include and @skip - * directives, where @skip has higher precedence than @include. - * - * @param FragmentSpreadNode|FieldNode|InlineFragmentNode $node - */ - protected function shouldIncludeNode(SelectionNode $node) : bool - { - $variableValues = $this->exeContext->variableValues; - $skipDirective = Directive::skipDirective(); - $skip = Values::getDirectiveValues( - $skipDirective, - $node, - $variableValues - ); - if (isset($skip['if']) && $skip['if'] === true) { - return false; - } - $includeDirective = Directive::includeDirective(); - $include = Values::getDirectiveValues( - $includeDirective, - $node, - $variableValues - ); - - return ! isset($include['if']) || $include['if'] !== false; - } - - /** - * Implements the logic to compute the key of a given fields entry - */ - protected static function getFieldEntryKey(FieldNode $node) : string - { - return $node->alias === null ? $node->name->value : $node->alias->value; - } - - /** - * Determines if a fragment is applicable to the given type. - * - * @param FragmentDefinitionNode|InlineFragmentNode $fragment - */ - protected function doesFragmentConditionMatch(Node $fragment, ObjectType $type) : bool - { - $typeConditionNode = $fragment->typeCondition; - if ($typeConditionNode === null) { - return true; - } - $conditionalType = TypeInfo::typeFromAST($this->exeContext->schema, $typeConditionNode); - if ($conditionalType === $type) { - return true; - } - if ($conditionalType instanceof AbstractType) { - return $this->exeContext->schema->isSubType($conditionalType, $type); - } - - return false; - } - - /** - * Implements the "Evaluating selection sets" section of the spec - * for "write" mode. - * - * @param mixed $rootValue - * @param array $path - * - * @return array|Promise|stdClass - */ - protected function executeFieldsSerially(ObjectType $parentType, $rootValue, array $path, ArrayObject $fields) - { - $result = $this->promiseReduce( - array_keys($fields->getArrayCopy()), - function ($results, $responseName) use ($path, $parentType, $rootValue, $fields) { - $fieldNodes = $fields[$responseName]; - $fieldPath = $path; - $fieldPath[] = $responseName; - $result = $this->resolveField($parentType, $rootValue, $fieldNodes, $fieldPath); - if ($result === static::$UNDEFINED) { - return $results; - } - $promise = $this->getPromise($result); - if ($promise !== null) { - return $promise->then(static function ($resolvedResult) use ($responseName, $results) { - $results[$responseName] = $resolvedResult; - - return $results; - }); - } - $results[$responseName] = $result; - - return $results; - }, - [] - ); - - if ($this->isPromise($result)) { - return $result->then(static function ($resolvedResults) { - return static::fixResultsIfEmptyArray($resolvedResults); - }); - } - - return static::fixResultsIfEmptyArray($result); - } - - /** - * Resolves the field on the given root value. - * - * In particular, this figures out the value that the field returns - * by calling its resolve function, then calls completeValue to complete promises, - * serialize scalars, or execute the sub-selection-set for objects. - * - * @param mixed $rootValue - * @param array $path - * - * @return array|Throwable|mixed|null - */ - protected function resolveField(ObjectType $parentType, $rootValue, ArrayObject $fieldNodes, array $path) - { - $exeContext = $this->exeContext; - $fieldNode = $fieldNodes[0]; - $fieldName = $fieldNode->name->value; - $fieldDef = $this->getFieldDef($exeContext->schema, $parentType, $fieldName); - if ($fieldDef === null) { - return static::$UNDEFINED; - } - $returnType = $fieldDef->getType(); - // The resolve function's optional 3rd argument is a context value that - // is provided to every resolve function within an execution. It is commonly - // used to represent an authenticated user, or request-specific caches. - // The resolve function's optional 4th argument is a collection of - // information about the current execution state. - $info = new ResolveInfo( - $fieldDef, - $fieldNodes, - $parentType, - $path, - $exeContext->schema, - $exeContext->fragments, - $exeContext->rootValue, - $exeContext->operation, - $exeContext->variableValues - ); - if ($fieldDef->resolveFn !== null) { - $resolveFn = $fieldDef->resolveFn; - } elseif ($parentType->resolveFieldFn !== null) { - $resolveFn = $parentType->resolveFieldFn; - } else { - $resolveFn = $this->exeContext->fieldResolver; - } - // Get the resolve function, regardless of if its result is normal - // or abrupt (error). - $result = $this->resolveFieldValueOrError( - $fieldDef, - $fieldNode, - $resolveFn, - $rootValue, - $info - ); - $result = $this->completeValueCatchingError( - $returnType, - $fieldNodes, - $info, - $path, - $result - ); - - return $result; - } - - /** - * This method looks up the field on the given type definition. - * - * It has special casing for the two introspection fields, __schema - * and __typename. __typename is special because it can always be - * queried as a field, even in situations where no other fields - * are allowed, like on a Union. __schema could get automatically - * added to the query type, but that would require mutating type - * definitions, which would cause issues. - */ - protected function getFieldDef(Schema $schema, ObjectType $parentType, string $fieldName) : ?FieldDefinition - { - static $schemaMetaFieldDef, $typeMetaFieldDef, $typeNameMetaFieldDef; - $schemaMetaFieldDef = $schemaMetaFieldDef ?? Introspection::schemaMetaFieldDef(); - $typeMetaFieldDef = $typeMetaFieldDef ?? Introspection::typeMetaFieldDef(); - $typeNameMetaFieldDef = $typeNameMetaFieldDef ?? Introspection::typeNameMetaFieldDef(); - if ($fieldName === $schemaMetaFieldDef->name && $schema->getQueryType() === $parentType) { - return $schemaMetaFieldDef; - } - - if ($fieldName === $typeMetaFieldDef->name && $schema->getQueryType() === $parentType) { - return $typeMetaFieldDef; - } - - if ($fieldName === $typeNameMetaFieldDef->name) { - return $typeNameMetaFieldDef; - } - - return $parentType->findField($fieldName); - } - - /** - * Isolates the "ReturnOrAbrupt" behavior to not de-opt the `resolveField` function. - * Returns the result of resolveFn or the abrupt-return Error object. - * - * @param mixed $rootValue - * - * @return Throwable|Promise|mixed - */ - protected function resolveFieldValueOrError( - FieldDefinition $fieldDef, - FieldNode $fieldNode, - callable $resolveFn, - $rootValue, - ResolveInfo $info - ) { - try { - // Build a map of arguments from the field.arguments AST, using the - // variables scope to fulfill any variable references. - $args = Values::getArgumentValues( - $fieldDef, - $fieldNode, - $this->exeContext->variableValues - ); - $contextValue = $this->exeContext->contextValue; - - return $resolveFn($rootValue, $args, $contextValue, $info); - } catch (Throwable $error) { - return $error; - } - } - - /** - * This is a small wrapper around completeValue which detects and logs errors - * in the execution context. - * - * @param array $path - * @param mixed $result - * - * @return array|Promise|stdClass|null - */ - protected function completeValueCatchingError( - Type $returnType, - ArrayObject $fieldNodes, - ResolveInfo $info, - array $path, - $result - ) { - // Otherwise, error protection is applied, logging the error and resolving - // a null value for this field if one is encountered. - try { - $promise = $this->getPromise($result); - if ($promise !== null) { - $completed = $promise->then(function (&$resolved) use ($returnType, $fieldNodes, $info, $path) { - return $this->completeValue($returnType, $fieldNodes, $info, $path, $resolved); - }); - } else { - $completed = $this->completeValue($returnType, $fieldNodes, $info, $path, $result); - } - - $promise = $this->getPromise($completed); - if ($promise !== null) { - return $promise->then(null, function ($error) use ($fieldNodes, $path, $returnType) : void { - $this->handleFieldError($error, $fieldNodes, $path, $returnType); - }); - } - - return $completed; - } catch (Throwable $err) { - $this->handleFieldError($err, $fieldNodes, $path, $returnType); - - return null; - } - } - - /** - * @param mixed $rawError - * @param array $path - * - * @throws Error - */ - protected function handleFieldError($rawError, ArrayObject $fieldNodes, array $path, Type $returnType) : void - { - $error = Error::createLocatedError( - $rawError, - $fieldNodes, - $path - ); - - // If the field type is non-nullable, then it is resolved without any - // protection from errors, however it still properly locates the error. - if ($returnType instanceof NonNull) { - throw $error; - } - // Otherwise, error protection is applied, logging the error and resolving - // a null value for this field if one is encountered. - $this->exeContext->addError($error); - } - - /** - * Implements the instructions for completeValue as defined in the - * "Field entries" section of the spec. - * - * If the field type is Non-Null, then this recursively completes the value - * for the inner type. It throws a field error if that completion returns null, - * as per the "Nullability" section of the spec. - * - * If the field type is a List, then this recursively completes the value - * for the inner type on each item in the list. - * - * If the field type is a Scalar or Enum, ensures the completed value is a legal - * value of the type by calling the `serialize` method of GraphQL type - * definition. - * - * If the field is an abstract type, determine the runtime type of the value - * and then complete based on that type - * - * Otherwise, the field type expects a sub-selection set, and will complete the - * value by evaluating all sub-selections. - * - * @param array $path - * @param mixed $result - * - * @return array|mixed|Promise|null - * - * @throws Error - * @throws Throwable - */ - protected function completeValue( - Type $returnType, - ArrayObject $fieldNodes, - ResolveInfo $info, - array $path, - &$result - ) { - // If result is an Error, throw a located error. - if ($result instanceof Throwable) { - throw $result; - } - - // If field type is NonNull, complete for inner type, and throw field error - // if result is null. - if ($returnType instanceof NonNull) { - $completed = $this->completeValue( - $returnType->getWrappedType(), - $fieldNodes, - $info, - $path, - $result - ); - if ($completed === null) { - throw new InvariantViolation( - sprintf('Cannot return null for non-nullable field "%s.%s".', $info->parentType, $info->fieldName) - ); - } - - return $completed; - } - // If result is null-like, return null. - if ($result === null) { - return null; - } - // If field type is List, complete each item in the list with the inner type - if ($returnType instanceof ListOfType) { - return $this->completeListValue($returnType, $fieldNodes, $info, $path, $result); - } - // Account for invalid schema definition when typeLoader returns different - // instance than `resolveType` or $field->getType() or $arg->getType() - if ($returnType !== $this->exeContext->schema->getType($returnType->name)) { - $hint = ''; - if ($this->exeContext->schema->getConfig()->typeLoader !== null) { - $hint = sprintf( - 'Make sure that type loader returns the same instance as defined in %s.%s', - $info->parentType, - $info->fieldName - ); - } - throw new InvariantViolation( - sprintf( - 'Schema must contain unique named types but contains multiple types named "%s". %s ' . - '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', - $returnType, - $hint - ) - ); - } - // If field type is Scalar or Enum, serialize to a valid value, returning - // null if serialization is not possible. - if ($returnType instanceof LeafType) { - return $this->completeLeafValue($returnType, $result); - } - if ($returnType instanceof AbstractType) { - return $this->completeAbstractValue($returnType, $fieldNodes, $info, $path, $result); - } - // Field type must be Object, Interface or Union and expect sub-selections. - if ($returnType instanceof ObjectType) { - return $this->completeObjectValue($returnType, $fieldNodes, $info, $path, $result); - } - throw new RuntimeException(sprintf('Cannot complete value of unexpected type "%s".', $returnType)); - } - - /** - * @param mixed $value - */ - protected function isPromise($value) : bool - { - return $value instanceof Promise || $this->exeContext->promiseAdapter->isThenable($value); - } - - /** - * Only returns the value if it acts like a Promise, i.e. has a "then" function, - * otherwise returns null. - * - * @param mixed $value - */ - protected function getPromise($value) : ?Promise - { - if ($value === null || $value instanceof Promise) { - return $value; - } - if ($this->exeContext->promiseAdapter->isThenable($value)) { - $promise = $this->exeContext->promiseAdapter->convertThenable($value); - if (! $promise instanceof Promise) { - throw new InvariantViolation(sprintf( - '%s::convertThenable is expected to return instance of GraphQL\Executor\Promise\Promise, got: %s', - get_class($this->exeContext->promiseAdapter), - Utils::printSafe($promise) - )); - } - - return $promise; - } - - return null; - } - - /** - * Similar to array_reduce(), however the reducing callback may return - * a Promise, in which case reduction will continue after each promise resolves. - * - * If the callback does not return a Promise, then this function will also not - * return a Promise. - * - * @param array $values - * @param Promise|mixed|null $initialValue - * - * @return Promise|mixed|null - */ - protected function promiseReduce(array $values, callable $callback, $initialValue) - { - return array_reduce( - $values, - function ($previous, $value) use ($callback) { - $promise = $this->getPromise($previous); - if ($promise !== null) { - return $promise->then(static function ($resolved) use ($callback, $value) { - return $callback($resolved, $value); - }); - } - - return $callback($previous, $value); - }, - $initialValue - ); - } - - /** - * Complete a list value by completing each item in the list with the inner type. - * - * @param array $path - * @param array|Traversable $results - * - * @return array|Promise|stdClass - * - * @throws Exception - */ - protected function completeListValue(ListOfType $returnType, ArrayObject $fieldNodes, ResolveInfo $info, array $path, &$results) - { - $itemType = $returnType->getWrappedType(); - Utils::invariant( - is_array($results) || $results instanceof Traversable, - 'User Error: expected iterable, but did not find one for field ' . $info->parentType . '.' . $info->fieldName . '.' - ); - $containsPromise = false; - $i = 0; - $completedItems = []; - foreach ($results as $item) { - $fieldPath = $path; - $fieldPath[] = $i++; - $info->path = $fieldPath; - $completedItem = $this->completeValueCatchingError($itemType, $fieldNodes, $info, $fieldPath, $item); - if (! $containsPromise && $this->getPromise($completedItem) !== null) { - $containsPromise = true; - } - $completedItems[] = $completedItem; - } - - return $containsPromise - ? $this->exeContext->promiseAdapter->all($completedItems) - : $completedItems; - } - - /** - * Complete a Scalar or Enum by serializing to a valid value, throwing if serialization is not possible. - * - * @param mixed $result - * - * @return mixed - * - * @throws Exception - */ - protected function completeLeafValue(LeafType $returnType, &$result) - { - try { - return $returnType->serialize($result); - } catch (Throwable $error) { - throw new InvariantViolation( - 'Expected a value of type "' . Utils::printSafe($returnType) . '" but received: ' . Utils::printSafe($result), - 0, - $error - ); - } - } - - /** - * Complete a value of an abstract type by determining the runtime object type - * of that value, then complete the value for that type. - * - * @param array $path - * @param array $result - * - * @return array|Promise|stdClass - * - * @throws Error - */ - protected function completeAbstractValue( - AbstractType $returnType, - ArrayObject $fieldNodes, - ResolveInfo $info, - array $path, - &$result - ) { - $exeContext = $this->exeContext; - $typeCandidate = $returnType->resolveType($result, $exeContext->contextValue, $info); - - if ($typeCandidate === null) { - $runtimeType = static::defaultTypeResolver($result, $exeContext->contextValue, $info, $returnType); - } elseif (is_callable($typeCandidate)) { - $runtimeType = Schema::resolveType($typeCandidate); - } else { - $runtimeType = $typeCandidate; - } - $promise = $this->getPromise($runtimeType); - if ($promise !== null) { - return $promise->then(function ($resolvedRuntimeType) use ( - $returnType, - $fieldNodes, - $info, - $path, - &$result - ) { - return $this->completeObjectValue( - $this->ensureValidRuntimeType( - $resolvedRuntimeType, - $returnType, - $info, - $result - ), - $fieldNodes, - $info, - $path, - $result - ); - }); - } - - return $this->completeObjectValue( - $this->ensureValidRuntimeType( - $runtimeType, - $returnType, - $info, - $result - ), - $fieldNodes, - $info, - $path, - $result - ); - } - - /** - * If a resolveType function is not given, then a default resolve behavior is - * used which attempts two strategies: - * - * First, See if the provided value has a `__typename` field defined, if so, use - * that value as name of the resolved type. - * - * Otherwise, test each possible type for the abstract type by calling - * isTypeOf for the object being coerced, returning the first type that matches. - * - * @param mixed|null $value - * @param mixed|null $contextValue - * @param InterfaceType|UnionType $abstractType - * - * @return Promise|Type|string|null - */ - protected function defaultTypeResolver($value, $contextValue, ResolveInfo $info, AbstractType $abstractType) - { - // First, look for `__typename`. - if ($value !== null && - (is_array($value) || $value instanceof ArrayAccess) && - isset($value['__typename']) && - is_string($value['__typename']) - ) { - return $value['__typename']; - } - - if ($abstractType instanceof InterfaceType && $info->schema->getConfig()->typeLoader !== null) { - Warning::warnOnce( - sprintf( - 'GraphQL Interface Type `%s` returned `null` from its `resolveType` function ' . - 'for value: %s. Switching to slow resolution method using `isTypeOf` ' . - 'of all possible implementations. It requires full schema scan and degrades query performance significantly. ' . - ' Make sure your `resolveType` always returns valid implementation or throws.', - $abstractType->name, - Utils::printSafe($value) - ), - Warning::WARNING_FULL_SCHEMA_SCAN - ); - } - // Otherwise, test each possible type. - $possibleTypes = $info->schema->getPossibleTypes($abstractType); - $promisedIsTypeOfResults = []; - foreach ($possibleTypes as $index => $type) { - $isTypeOfResult = $type->isTypeOf($value, $contextValue, $info); - if ($isTypeOfResult === null) { - continue; - } - $promise = $this->getPromise($isTypeOfResult); - if ($promise !== null) { - $promisedIsTypeOfResults[$index] = $promise; - } elseif ($isTypeOfResult) { - return $type; - } - } - if (count($promisedIsTypeOfResults) > 0) { - return $this->exeContext->promiseAdapter->all($promisedIsTypeOfResults) - ->then(static function ($isTypeOfResults) use ($possibleTypes) : ?ObjectType { - foreach ($isTypeOfResults as $index => $result) { - if ($result) { - return $possibleTypes[$index]; - } - } - - return null; - }); - } - - return null; - } - - /** - * Complete an Object value by executing all sub-selections. - * - * @param array $path - * @param mixed $result - * - * @return array|Promise|stdClass - * - * @throws Error - */ - protected function completeObjectValue( - ObjectType $returnType, - ArrayObject $fieldNodes, - ResolveInfo $info, - array $path, - &$result - ) { - // If there is an isTypeOf predicate function, call it with the - // current result. If isTypeOf returns false, then raise an error rather - // than continuing execution. - $isTypeOf = $returnType->isTypeOf($result, $this->exeContext->contextValue, $info); - if ($isTypeOf !== null) { - $promise = $this->getPromise($isTypeOf); - if ($promise !== null) { - return $promise->then(function ($isTypeOfResult) use ( - $returnType, - $fieldNodes, - $path, - &$result - ) { - if (! $isTypeOfResult) { - throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes); - } - - return $this->collectAndExecuteSubfields( - $returnType, - $fieldNodes, - $path, - $result - ); - }); - } - if (! $isTypeOf) { - throw $this->invalidReturnTypeError($returnType, $result, $fieldNodes); - } - } - - return $this->collectAndExecuteSubfields( - $returnType, - $fieldNodes, - $path, - $result - ); - } - - /** - * @param array $result - * - * @return Error - */ - protected function invalidReturnTypeError( - ObjectType $returnType, - $result, - ArrayObject $fieldNodes - ) { - return new Error( - 'Expected value of type "' . $returnType->name . '" but got: ' . Utils::printSafe($result) . '.', - $fieldNodes - ); - } - - /** - * @param array $path - * @param mixed $result - * - * @return array|Promise|stdClass - * - * @throws Error - */ - protected function collectAndExecuteSubfields( - ObjectType $returnType, - ArrayObject $fieldNodes, - array $path, - &$result - ) { - $subFieldNodes = $this->collectSubFields($returnType, $fieldNodes); - - return $this->executeFields($returnType, $result, $path, $subFieldNodes); - } - - /** - * A memoized collection of relevant subfields with regard to the return - * type. Memoizing ensures the subfields are not repeatedly calculated, which - * saves overhead when resolving lists of values. - */ - protected function collectSubFields(ObjectType $returnType, ArrayObject $fieldNodes) : ArrayObject - { - if (! isset($this->subFieldCache[$returnType])) { - $this->subFieldCache[$returnType] = new SplObjectStorage(); - } - if (! isset($this->subFieldCache[$returnType][$fieldNodes])) { - // Collect sub-fields to execute to complete this value. - $subFieldNodes = new ArrayObject(); - $visitedFragmentNames = new ArrayObject(); - foreach ($fieldNodes as $fieldNode) { - if (! isset($fieldNode->selectionSet)) { - continue; - } - $subFieldNodes = $this->collectFields( - $returnType, - $fieldNode->selectionSet, - $subFieldNodes, - $visitedFragmentNames - ); - } - $this->subFieldCache[$returnType][$fieldNodes] = $subFieldNodes; - } - - return $this->subFieldCache[$returnType][$fieldNodes]; - } - - /** - * Implements the "Evaluating selection sets" section of the spec - * for "read" mode. - * - * @param mixed $rootValue - * @param array $path - * - * @return Promise|stdClass|array - */ - protected function executeFields(ObjectType $parentType, $rootValue, array $path, ArrayObject $fields) - { - $containsPromise = false; - $results = []; - foreach ($fields as $responseName => $fieldNodes) { - $fieldPath = $path; - $fieldPath[] = $responseName; - $result = $this->resolveField($parentType, $rootValue, $fieldNodes, $fieldPath); - if ($result === static::$UNDEFINED) { - continue; - } - if (! $containsPromise && $this->isPromise($result)) { - $containsPromise = true; - } - $results[$responseName] = $result; - } - // If there are no promises, we can just return the object - if (! $containsPromise) { - return static::fixResultsIfEmptyArray($results); - } - - // Otherwise, results is a map from field name to the result of resolving that - // field, which is possibly a promise. Return a promise that will return this - // same map, but with any promises replaced with the values they resolved to. - return $this->promiseForAssocArray($results); - } - - /** - * Differentiate empty objects from empty lists. - * - * @see https://github.com/webonyx/graphql-php/issues/59 - * - * @param array|mixed $results - * - * @return array|stdClass|mixed - */ - protected static function fixResultsIfEmptyArray($results) - { - if ($results === []) { - return new stdClass(); - } - - return $results; - } - - /** - * Transform an associative array with Promises to a Promise which resolves to an - * associative array where all Promises were resolved. - * - * @param array $assoc - */ - protected function promiseForAssocArray(array $assoc) : Promise - { - $keys = array_keys($assoc); - $valuesAndPromises = array_values($assoc); - $promise = $this->exeContext->promiseAdapter->all($valuesAndPromises); - - return $promise->then(static function ($values) use ($keys) { - $resolvedResults = []; - foreach ($values as $i => $value) { - $resolvedResults[$keys[$i]] = $value; - } - - return static::fixResultsIfEmptyArray($resolvedResults); - }); - } - - /** - * @param string|ObjectType|null $runtimeTypeOrName - * @param InterfaceType|UnionType $returnType - * @param mixed $result - */ - protected function ensureValidRuntimeType( - $runtimeTypeOrName, - AbstractType $returnType, - ResolveInfo $info, - &$result - ) : ObjectType { - $runtimeType = is_string($runtimeTypeOrName) - ? $this->exeContext->schema->getType($runtimeTypeOrName) - : $runtimeTypeOrName; - if (! $runtimeType instanceof ObjectType) { - throw new InvariantViolation( - sprintf( - 'Abstract type %s must resolve to an Object type at ' . - 'runtime for field %s.%s with value "%s", received "%s". ' . - 'Either the %s type should provide a "resolveType" ' . - 'function or each possible type should provide an "isTypeOf" function.', - $returnType, - $info->parentType, - $info->fieldName, - Utils::printSafe($result), - Utils::printSafe($runtimeType), - $returnType - ) - ); - } - if (! $this->exeContext->schema->isSubType($returnType, $runtimeType)) { - throw new InvariantViolation( - sprintf('Runtime Object type "%s" is not a possible type for "%s".', $runtimeType, $returnType) - ); - } - if ($runtimeType !== $this->exeContext->schema->getType($runtimeType->name)) { - throw new InvariantViolation( - sprintf( - 'Schema must contain unique named types but contains multiple types named "%s". ' . - 'Make sure that `resolveType` function of abstract type "%s" returns the same ' . - 'type instance as referenced anywhere else within the schema ' . - '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', - $runtimeType, - $returnType - ) - ); - } - - return $runtimeType; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Values.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Values.php deleted file mode 100644 index 3e6168a5..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Executor/Values.php +++ /dev/null @@ -1,334 +0,0 @@ -variable->name->value; - /** @var InputType|Type $varType */ - $varType = TypeInfo::typeFromAST($schema, $varDefNode->type); - - if (! Type::isInputType($varType)) { - // Must use input types for variables. This should be caught during - // validation, however is checked again here for safety. - $errors[] = new Error( - sprintf( - 'Variable "$%s" expected value of type "%s" which cannot be used as an input type.', - $varName, - Printer::doPrint($varDefNode->type) - ), - [$varDefNode->type] - ); - } else { - $hasValue = array_key_exists($varName, $inputs); - $value = $hasValue ? $inputs[$varName] : Utils::undefined(); - - if (! $hasValue && ($varDefNode->defaultValue !== null)) { - // If no value was provided to a variable with a default value, - // use the default value. - $coercedValues[$varName] = AST::valueFromAST($varDefNode->defaultValue, $varType); - } elseif ((! $hasValue || $value === null) && ($varType instanceof NonNull)) { - // If no value or a nullish value was provided to a variable with a - // non-null type (required), produce an error. - $errors[] = new Error( - sprintf( - $hasValue - ? 'Variable "$%s" of non-null type "%s" must not be null.' - : 'Variable "$%s" of required type "%s" was not provided.', - $varName, - Utils::printSafe($varType) - ), - [$varDefNode] - ); - } elseif ($hasValue) { - if ($value === null) { - // If the explicit value `null` was provided, an entry in the coerced - // values must exist as the value `null`. - $coercedValues[$varName] = null; - } else { - // Otherwise, a non-null value was provided, coerce it to the expected - // type or report an error if coercion fails. - $coerced = Value::coerceValue($value, $varType, $varDefNode); - /** @var Error[] $coercionErrors */ - $coercionErrors = $coerced['errors']; - if (count($coercionErrors ?? []) > 0) { - $messagePrelude = sprintf( - 'Variable "$%s" got invalid value %s; ', - $varName, - Utils::printSafeJson($value) - ); - - foreach ($coercionErrors as $error) { - $errors[] = new Error( - $messagePrelude . $error->getMessage(), - $error->getNodes(), - $error->getSource(), - $error->getPositions(), - $error->getPath(), - $error->getPrevious(), - $error->getExtensions() - ); - } - } else { - $coercedValues[$varName] = $coerced['value']; - } - } - } - } - } - - if (count($errors) > 0) { - return [$errors, null]; - } - - return [null, $coercedValues]; - } - - /** - * Prepares an object map of argument values given a directive definition - * and a AST node which may contain directives. Optionally also accepts a map - * of variable values. - * - * If the directive does not exist on the node, returns undefined. - * - * @param FragmentSpreadNode|FieldNode|InlineFragmentNode|EnumValueDefinitionNode|FieldDefinitionNode $node - * @param mixed[]|null $variableValues - * - * @return mixed[]|null - */ - public static function getDirectiveValues(Directive $directiveDef, $node, $variableValues = null) - { - if (isset($node->directives) && $node->directives instanceof NodeList) { - $directiveNode = Utils::find( - $node->directives, - static function (DirectiveNode $directive) use ($directiveDef) : bool { - return $directive->name->value === $directiveDef->name; - } - ); - - if ($directiveNode !== null) { - return self::getArgumentValues($directiveDef, $directiveNode, $variableValues); - } - } - - return null; - } - - /** - * Prepares an object map of argument values given a list of argument - * definitions and list of argument AST nodes. - * - * @param FieldDefinition|Directive $def - * @param FieldNode|DirectiveNode $node - * @param mixed[] $variableValues - * - * @return mixed[] - * - * @throws Error - */ - public static function getArgumentValues($def, $node, $variableValues = null) - { - if (count($def->args) === 0) { - return []; - } - - $argumentNodes = $node->arguments ?? []; - $argumentValueMap = []; - foreach ($argumentNodes as $argumentNode) { - $argumentValueMap[$argumentNode->name->value] = $argumentNode->value; - } - - return static::getArgumentValuesForMap($def, $argumentValueMap, $variableValues, $node); - } - - /** - * @param FieldDefinition|Directive $fieldDefinition - * @param ArgumentNode[] $argumentValueMap - * @param mixed[] $variableValues - * @param Node|null $referenceNode - * - * @return mixed[] - * - * @throws Error - */ - public static function getArgumentValuesForMap($fieldDefinition, $argumentValueMap, $variableValues = null, $referenceNode = null) - { - $argumentDefinitions = $fieldDefinition->args; - $coercedValues = []; - - foreach ($argumentDefinitions as $argumentDefinition) { - $name = $argumentDefinition->name; - $argType = $argumentDefinition->getType(); - $argumentValueNode = $argumentValueMap[$name] ?? null; - - if ($argumentValueNode instanceof VariableNode) { - $variableName = $argumentValueNode->name->value; - $hasValue = array_key_exists($variableName, $variableValues ?? []); - $isNull = $hasValue ? $variableValues[$variableName] === null : false; - } else { - $hasValue = $argumentValueNode !== null; - $isNull = $argumentValueNode instanceof NullValueNode; - } - - if (! $hasValue && $argumentDefinition->defaultValueExists()) { - // If no argument was provided where the definition has a default value, - // use the default value. - $coercedValues[$name] = $argumentDefinition->defaultValue; - } elseif ((! $hasValue || $isNull) && ($argType instanceof NonNull)) { - // If no argument or a null value was provided to an argument with a - // non-null type (required), produce a field error. - if ($isNull) { - throw new Error( - 'Argument "' . $name . '" of non-null type ' . - '"' . Utils::printSafe($argType) . '" must not be null.', - $referenceNode - ); - } - - if ($argumentValueNode instanceof VariableNode) { - $variableName = $argumentValueNode->name->value; - throw new Error( - 'Argument "' . $name . '" of required type "' . Utils::printSafe($argType) . '" was ' . - 'provided the variable "$' . $variableName . '" which was not provided ' . - 'a runtime value.', - [$argumentValueNode] - ); - } - - throw new Error( - 'Argument "' . $name . '" of required type ' . - '"' . Utils::printSafe($argType) . '" was not provided.', - $referenceNode - ); - } elseif ($hasValue) { - if ($argumentValueNode instanceof NullValueNode) { - // If the explicit value `null` was provided, an entry in the coerced - // values must exist as the value `null`. - $coercedValues[$name] = null; - } elseif ($argumentValueNode instanceof VariableNode) { - $variableName = $argumentValueNode->name->value; - Utils::invariant($variableValues !== null, 'Must exist for hasValue to be true.'); - // Note: This does no further checking that this variable is correct. - // This assumes that this query has been validated and the variable - // usage here is of the correct type. - $coercedValues[$name] = $variableValues[$variableName] ?? null; - } else { - $valueNode = $argumentValueNode; - $coercedValue = AST::valueFromAST($valueNode, $argType, $variableValues); - if (Utils::isInvalid($coercedValue)) { - // Note: ValuesOfCorrectType validation should catch this before - // execution. This is a runtime check to ensure execution does not - // continue with an invalid argument value. - throw new Error( - 'Argument "' . $name . '" has invalid value ' . Printer::doPrint($valueNode) . '.', - [$argumentValueNode] - ); - } - $coercedValues[$name] = $coercedValue; - } - } - } - - return $coercedValues; - } - - /** - * @deprecated as of 8.0 (Moved to \GraphQL\Utils\AST::valueFromAST) - * - * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $valueNode - * @param ScalarType|EnumType|InputObjectType|ListOfType|NonNull $type - * @param mixed[]|null $variables - * - * @return mixed[]|stdClass|null - * - * @codeCoverageIgnore - */ - public static function valueFromAST(ValueNode $valueNode, InputType $type, ?array $variables = null) - { - return AST::valueFromAST($valueNode, $type, $variables); - } - - /** - * @deprecated as of 0.12 (Use coerceValue() directly for richer information) - * - * @param mixed[] $value - * @param ScalarType|EnumType|InputObjectType|ListOfType|NonNull $type - * - * @return string[] - * - * @codeCoverageIgnore - */ - public static function isValidPHPValue($value, InputType $type) - { - $errors = Value::coerceValue($value, $type)['errors']; - - return $errors - ? array_map( - static function (Throwable $error) : string { - return $error->getMessage(); - }, - $errors - ) - : []; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Collector.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Collector.php deleted file mode 100644 index dc1b49f7..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Collector.php +++ /dev/null @@ -1,282 +0,0 @@ - */ - private $visitedFragments; - - public function __construct(Schema $schema, Runtime $runtime) - { - $this->schema = $schema; - $this->runtime = $runtime; - } - - public function initialize(DocumentNode $documentNode, ?string $operationName = null) - { - $hasMultipleAssumedOperations = false; - - foreach ($documentNode->definitions as $definitionNode) { - /** @var DefinitionNode|Node $definitionNode */ - - if ($definitionNode instanceof OperationDefinitionNode) { - if ($operationName === null && $this->operation !== null) { - $hasMultipleAssumedOperations = true; - } - if ($operationName === null || - (isset($definitionNode->name) && $definitionNode->name->value === $operationName) - ) { - $this->operation = $definitionNode; - } - } elseif ($definitionNode instanceof FragmentDefinitionNode) { - $this->fragments[$definitionNode->name->value] = $definitionNode; - } - } - - if ($this->operation === null) { - if ($operationName !== null) { - $this->runtime->addError(new Error(sprintf('Unknown operation named "%s".', $operationName))); - } else { - $this->runtime->addError(new Error('Must provide an operation.')); - } - - return; - } - - if ($hasMultipleAssumedOperations) { - $this->runtime->addError(new Error('Must provide operation name if query contains multiple operations.')); - - return; - } - - if ($this->operation->operation === 'query') { - $this->rootType = $this->schema->getQueryType(); - } elseif ($this->operation->operation === 'mutation') { - $this->rootType = $this->schema->getMutationType(); - } elseif ($this->operation->operation === 'subscription') { - $this->rootType = $this->schema->getSubscriptionType(); - } else { - $this->runtime->addError(new Error(sprintf('Cannot initialize collector with operation type "%s".', $this->operation->operation))); - } - } - - /** - * @return Generator - */ - public function collectFields(ObjectType $runtimeType, ?SelectionSetNode $selectionSet) - { - $this->fields = []; - $this->visitedFragments = []; - - $this->doCollectFields($runtimeType, $selectionSet); - - foreach ($this->fields as $resultName => $fieldNodes) { - $fieldNode = $fieldNodes[0]; - $fieldName = $fieldNode->name->value; - - $argumentValueMap = null; - if (count($fieldNode->arguments) > 0) { - foreach ($fieldNode->arguments as $argumentNode) { - $argumentValueMap = $argumentValueMap ?? []; - $argumentValueMap[$argumentNode->name->value] = $argumentNode->value; - } - } - - if ($fieldName !== Introspection::TYPE_NAME_FIELD_NAME && - ! ($runtimeType === $this->schema->getQueryType() && ($fieldName === Introspection::SCHEMA_FIELD_NAME || $fieldName === Introspection::TYPE_FIELD_NAME)) && - ! $runtimeType->hasField($fieldName) - ) { - // do not emit error - continue; - } - - yield new CoroutineContextShared($fieldNodes, $fieldName, $resultName, $argumentValueMap); - } - } - - private function doCollectFields(ObjectType $runtimeType, ?SelectionSetNode $selectionSet) - { - if ($selectionSet === null) { - return; - } - - foreach ($selectionSet->selections as $selection) { - /** @var FieldNode|FragmentSpreadNode|InlineFragmentNode $selection */ - if (count($selection->directives) > 0) { - foreach ($selection->directives as $directiveNode) { - if ($directiveNode->name->value === Directive::SKIP_NAME) { - /** @var VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode|null $condition */ - $condition = null; - foreach ($directiveNode->arguments as $argumentNode) { - if ($argumentNode->name->value === Directive::IF_ARGUMENT_NAME) { - $condition = $argumentNode->value; - break; - } - } - - if ($condition === null) { - $this->runtime->addError(new Error( - sprintf('@%s directive is missing "%s" argument.', Directive::SKIP_NAME, Directive::IF_ARGUMENT_NAME), - $selection - )); - } else { - if ($this->runtime->evaluate($condition, Type::boolean()) === true) { - continue 2; // !!! advances outer loop - } - } - } elseif ($directiveNode->name->value === Directive::INCLUDE_NAME) { - /** @var VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode|null $condition */ - $condition = null; - foreach ($directiveNode->arguments as $argumentNode) { - if ($argumentNode->name->value === Directive::IF_ARGUMENT_NAME) { - $condition = $argumentNode->value; - break; - } - } - - if ($condition === null) { - $this->runtime->addError(new Error( - sprintf('@%s directive is missing "%s" argument.', Directive::INCLUDE_NAME, Directive::IF_ARGUMENT_NAME), - $selection - )); - } else { - if ($this->runtime->evaluate($condition, Type::boolean()) !== true) { - continue 2; // !!! advances outer loop - } - } - } - } - } - - if ($selection instanceof FieldNode) { - $resultName = $selection->alias === null ? $selection->name->value : $selection->alias->value; - - if (! isset($this->fields[$resultName])) { - $this->fields[$resultName] = []; - } - - $this->fields[$resultName][] = $selection; - } elseif ($selection instanceof FragmentSpreadNode) { - $fragmentName = $selection->name->value; - - if (isset($this->visitedFragments[$fragmentName])) { - continue; - } - - if (! isset($this->fragments[$fragmentName])) { - $this->runtime->addError(new Error( - sprintf('Fragment "%s" does not exist.', $fragmentName), - $selection - )); - continue; - } - - $this->visitedFragments[$fragmentName] = true; - - $fragmentDefinition = $this->fragments[$fragmentName]; - $conditionTypeName = $fragmentDefinition->typeCondition->name->value; - - if (! $this->schema->hasType($conditionTypeName)) { - $this->runtime->addError(new Error( - sprintf('Cannot spread fragment "%s", type "%s" does not exist.', $fragmentName, $conditionTypeName), - $selection - )); - continue; - } - - $conditionType = $this->schema->getType($conditionTypeName); - - if ($conditionType instanceof ObjectType) { - if ($runtimeType->name !== $conditionType->name) { - continue; - } - } elseif ($conditionType instanceof AbstractType) { - if (! $this->schema->isSubType($conditionType, $runtimeType)) { - continue; - } - } - - $this->doCollectFields($runtimeType, $fragmentDefinition->selectionSet); - } elseif ($selection instanceof InlineFragmentNode) { - if ($selection->typeCondition !== null) { - $conditionTypeName = $selection->typeCondition->name->value; - - if (! $this->schema->hasType($conditionTypeName)) { - $this->runtime->addError(new Error( - sprintf('Cannot spread inline fragment, type "%s" does not exist.', $conditionTypeName), - $selection - )); - continue; - } - - $conditionType = $this->schema->getType($conditionTypeName); - - if ($conditionType instanceof ObjectType) { - if ($runtimeType->name !== $conditionType->name) { - continue; - } - } elseif ($conditionType instanceof AbstractType) { - if (! $this->schema->isSubType($conditionType, $runtimeType)) { - continue; - } - } - } - - $this->doCollectFields($runtimeType, $selection->selectionSet); - } - } - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php deleted file mode 100644 index d22ec774..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContext.php +++ /dev/null @@ -1,57 +0,0 @@ -shared = $shared; - $this->type = $type; - $this->value = $value; - $this->result = $result; - $this->path = $path; - $this->nullFence = $nullFence; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php deleted file mode 100644 index bbc54886..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineContextShared.php +++ /dev/null @@ -1,62 +0,0 @@ -fieldNodes = $fieldNodes; - $this->fieldName = $fieldName; - $this->resultName = $resultName; - $this->argumentValueMap = $argumentValueMap; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php deleted file mode 100644 index 74981005..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/CoroutineExecutor.php +++ /dev/null @@ -1,970 +0,0 @@ - */ - private $errors; - - /** @var SplQueue */ - private $queue; - - /** @var SplQueue */ - private $schedule; - - /** @var stdClass|null */ - private $rootResult; - - /** @var int|null */ - private $pending; - - /** @var callable */ - private $doResolve; - - public function __construct( - PromiseAdapter $promiseAdapter, - Schema $schema, - DocumentNode $documentNode, - $rootValue, - $contextValue, - $rawVariableValues, - ?string $operationName, - callable $fieldResolver - ) { - if (self::$undefined === null) { - self::$undefined = Utils::undefined(); - } - - $this->errors = []; - $this->queue = new SplQueue(); - $this->schedule = new SplQueue(); - $this->schema = $schema; - $this->fieldResolver = $fieldResolver; - $this->promiseAdapter = $promiseAdapter; - $this->rootValue = $rootValue; - $this->contextValue = $contextValue; - $this->rawVariableValues = $rawVariableValues; - $this->documentNode = $documentNode; - $this->operationName = $operationName; - } - - public static function create( - PromiseAdapter $promiseAdapter, - Schema $schema, - DocumentNode $documentNode, - $rootValue, - $contextValue, - $variableValues, - ?string $operationName, - callable $fieldResolver - ) { - return new static( - $promiseAdapter, - $schema, - $documentNode, - $rootValue, - $contextValue, - $variableValues, - $operationName, - $fieldResolver - ); - } - - private static function resultToArray($value, $emptyObjectAsStdClass = true) - { - if ($value instanceof stdClass) { - $array = (array) $value; - foreach ($array as $propertyName => $propertyValue) { - $array[$propertyName] = self::resultToArray($propertyValue); - } - - if ($emptyObjectAsStdClass && count($array) === 0) { - return new stdClass(); - } - - return $array; - } - - if (is_array($value)) { - $array = []; - foreach ($value as $key => $item) { - $array[$key] = self::resultToArray($item); - } - - return $array; - } - - return $value; - } - - public function doExecute() : Promise - { - $this->rootResult = new stdClass(); - $this->errors = []; - $this->queue = new SplQueue(); - $this->schedule = new SplQueue(); - $this->pending = 0; - - $this->collector = new Collector($this->schema, $this); - $this->collector->initialize($this->documentNode, $this->operationName); - - if (count($this->errors) > 0) { - return $this->promiseAdapter->createFulfilled($this->finishExecute(null, $this->errors)); - } - - [$errors, $coercedVariableValues] = Values::getVariableValues( - $this->schema, - $this->collector->operation->variableDefinitions ?? [], - $this->rawVariableValues ?? [] - ); - - if (count($errors ?? []) > 0) { - return $this->promiseAdapter->createFulfilled($this->finishExecute(null, $errors)); - } - - $this->variableValues = $coercedVariableValues; - - foreach ($this->collector->collectFields($this->collector->rootType, $this->collector->operation->selectionSet) as $shared) { - /** @var CoroutineContextShared $shared */ - - // !!! assign to keep object keys sorted - $this->rootResult->{$shared->resultName} = null; - - $ctx = new CoroutineContext( - $shared, - $this->collector->rootType, - $this->rootValue, - $this->rootResult, - [$shared->resultName] - ); - - $fieldDefinition = $this->findFieldDefinition($ctx); - if (! $fieldDefinition->getType() instanceof NonNull) { - $ctx->nullFence = [$shared->resultName]; - } - - if ($this->collector->operation->operation === 'mutation' && ! $this->queue->isEmpty()) { - $this->schedule->enqueue($ctx); - } else { - $this->queue->enqueue(new Strand($this->spawn($ctx))); - } - } - - $this->run(); - - if ($this->pending > 0) { - return $this->promiseAdapter->create(function (callable $resolve) : void { - $this->doResolve = $resolve; - }); - } - - return $this->promiseAdapter->createFulfilled($this->finishExecute($this->rootResult, $this->errors)); - } - - /** - * @param object|null $value - * @param Error[] $errors - */ - private function finishExecute($value, array $errors) : ExecutionResult - { - $this->rootResult = null; - $this->errors = []; - $this->queue = new SplQueue(); - $this->schedule = new SplQueue(); - $this->pending = null; - $this->collector = null; - $this->variableValues = null; - - if ($value !== null) { - $value = self::resultToArray($value, false); - } - - return new ExecutionResult($value, $errors); - } - - /** - * @internal - * - * @param ScalarType|EnumType|InputObjectType|ListOfType|NonNull $type - */ - public function evaluate(ValueNode $valueNode, InputType $type) - { - return AST::valueFromAST($valueNode, $type, $this->variableValues); - } - - /** - * @internal - */ - public function addError($error) - { - $this->errors[] = $error; - } - - private function run() - { - RUN: - while (! $this->queue->isEmpty()) { - /** @var Strand $strand */ - $strand = $this->queue->dequeue(); - - try { - if ($strand->success !== null) { - RESUME: - - if ($strand->success) { - $strand->current->send($strand->value); - } else { - $strand->current->throw($strand->value); - } - - $strand->success = null; - $strand->value = null; - } - - START: - if ($strand->current->valid()) { - $value = $strand->current->current(); - - if ($value instanceof Generator) { - $strand->stack[$strand->depth++] = $strand->current; - $strand->current = $value; - goto START; - } elseif ($this->isPromise($value)) { - // !!! increment pending before calling ->then() as it may invoke the callback right away - ++$this->pending; - - if (! $value instanceof Promise) { - $value = $this->promiseAdapter->convertThenable($value); - } - - $this->promiseAdapter - ->then( - $value, - function ($value) use ($strand) : void { - $strand->success = true; - $strand->value = $value; - $this->queue->enqueue($strand); - $this->done(); - }, - function (Throwable $throwable) use ($strand) : void { - $strand->success = false; - $strand->value = $throwable; - $this->queue->enqueue($strand); - $this->done(); - } - ); - continue; - } else { - $strand->success = true; - $strand->value = $value; - goto RESUME; - } - } - - $strand->success = true; - $strand->value = $strand->current->getReturn(); - } catch (Throwable $reason) { - $strand->success = false; - $strand->value = $reason; - } - - if ($strand->depth <= 0) { - continue; - } - - $current = &$strand->stack[--$strand->depth]; - $strand->current = $current; - $current = null; - goto RESUME; - } - - if ($this->pending > 0 || $this->schedule->isEmpty()) { - return; - } - - /** @var CoroutineContext $ctx */ - $ctx = $this->schedule->dequeue(); - $this->queue->enqueue(new Strand($this->spawn($ctx))); - goto RUN; - } - - private function done() - { - --$this->pending; - - $this->run(); - - if ($this->pending > 0) { - return; - } - - $doResolve = $this->doResolve; - $doResolve($this->finishExecute($this->rootResult, $this->errors)); - } - - private function spawn(CoroutineContext $ctx) - { - // short-circuit evaluation for __typename - if ($ctx->shared->fieldName === Introspection::TYPE_NAME_FIELD_NAME) { - $ctx->result->{$ctx->shared->resultName} = $ctx->type->name; - - return; - } - - try { - if ($ctx->shared->typeGuard1 === $ctx->type) { - $resolve = $ctx->shared->resolveIfType1; - $ctx->resolveInfo = clone $ctx->shared->resolveInfoIfType1; - $ctx->resolveInfo->path = $ctx->path; - $arguments = $ctx->shared->argumentsIfType1; - $returnType = $ctx->resolveInfo->returnType; - } else { - $fieldDefinition = $this->findFieldDefinition($ctx); - - if ($fieldDefinition->resolveFn !== null) { - $resolve = $fieldDefinition->resolveFn; - } elseif ($ctx->type->resolveFieldFn !== null) { - $resolve = $ctx->type->resolveFieldFn; - } else { - $resolve = $this->fieldResolver; - } - - $returnType = $fieldDefinition->getType(); - - $ctx->resolveInfo = new ResolveInfo( - $fieldDefinition, - $ctx->shared->fieldNodes, - $ctx->type, - $ctx->path, - $this->schema, - $this->collector->fragments, - $this->rootValue, - $this->collector->operation, - $this->variableValues - ); - - $arguments = Values::getArgumentValuesForMap( - $fieldDefinition, - $ctx->shared->argumentValueMap, - $this->variableValues - ); - - // !!! assign only in batch when no exception can be thrown in-between - $ctx->shared->typeGuard1 = $ctx->type; - $ctx->shared->resolveIfType1 = $resolve; - $ctx->shared->argumentsIfType1 = $arguments; - $ctx->shared->resolveInfoIfType1 = $ctx->resolveInfo; - } - - $value = $resolve($ctx->value, $arguments, $this->contextValue, $ctx->resolveInfo); - - if (! $this->completeValueFast($ctx, $returnType, $value, $ctx->path, $returnValue)) { - $returnValue = yield $this->completeValue( - $ctx, - $returnType, - $value, - $ctx->path, - $ctx->nullFence - ); - } - } catch (Throwable $reason) { - $this->addError(Error::createLocatedError( - $reason, - $ctx->shared->fieldNodes, - $ctx->path - )); - - $returnValue = self::$undefined; - } - - if ($returnValue !== self::$undefined) { - $ctx->result->{$ctx->shared->resultName} = $returnValue; - } elseif ($ctx->resolveInfo !== null && $ctx->resolveInfo->returnType instanceof NonNull) { // !!! $ctx->resolveInfo might not have been initialized yet - $result =& $this->rootResult; - foreach ($ctx->nullFence ?? [] as $key) { - if (is_string($key)) { - $result =& $result->{$key}; - } else { - $result =& $result[$key]; - } - } - $result = null; - } - } - - private function findFieldDefinition(CoroutineContext $ctx) - { - if ($ctx->shared->fieldName === Introspection::SCHEMA_FIELD_NAME && $ctx->type === $this->schema->getQueryType()) { - return Introspection::schemaMetaFieldDef(); - } - - if ($ctx->shared->fieldName === Introspection::TYPE_FIELD_NAME && $ctx->type === $this->schema->getQueryType()) { - return Introspection::typeMetaFieldDef(); - } - - if ($ctx->shared->fieldName === Introspection::TYPE_NAME_FIELD_NAME) { - return Introspection::typeNameMetaFieldDef(); - } - - return $ctx->type->getField($ctx->shared->fieldName); - } - - /** - * @param mixed $value - * @param string[] $path - * @param mixed $returnValue - */ - private function completeValueFast(CoroutineContext $ctx, Type $type, $value, array $path, &$returnValue) : bool - { - // special handling of Throwable inherited from JS reference implementation, but makes no sense in this PHP - if ($this->isPromise($value) || $value instanceof Throwable) { - return false; - } - - $nonNull = false; - if ($type instanceof NonNull) { - $nonNull = true; - $type = $type->getWrappedType(); - } - - if (! $type instanceof LeafType) { - return false; - } - - if ($type !== $this->schema->getType($type->name)) { - $hint = ''; - if ($this->schema->getConfig()->typeLoader !== null) { - $hint = sprintf( - 'Make sure that type loader returns the same instance as defined in %s.%s', - $ctx->type, - $ctx->shared->fieldName - ); - } - $this->addError(Error::createLocatedError( - new InvariantViolation( - sprintf( - 'Schema must contain unique named types but contains multiple types named "%s". %s ' . - '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', - $type->name, - $hint - ) - ), - $ctx->shared->fieldNodes, - $path - )); - - $value = null; - } - - if ($value === null) { - $returnValue = null; - } else { - try { - $returnValue = $type->serialize($value); - } catch (Throwable $error) { - $this->addError(Error::createLocatedError( - new InvariantViolation( - 'Expected a value of type "' . Utils::printSafe($type) . '" but received: ' . Utils::printSafe($value), - 0, - $error - ), - $ctx->shared->fieldNodes, - $path - )); - $returnValue = null; - } - } - - if ($nonNull && $returnValue === null) { - $this->addError(Error::createLocatedError( - new InvariantViolation(sprintf( - 'Cannot return null for non-nullable field "%s.%s".', - $ctx->type->name, - $ctx->shared->fieldName - )), - $ctx->shared->fieldNodes, - $path - )); - - $returnValue = self::$undefined; - } - - return true; - } - - /** - * @param mixed $value - * @param string[] $path - * @param string[]|null $nullFence - * - * @return mixed - */ - private function completeValue(CoroutineContext $ctx, Type $type, $value, array $path, ?array $nullFence) - { - $nonNull = false; - $returnValue = null; - - if ($type instanceof NonNull) { - $nonNull = true; - $type = $type->getWrappedType(); - } else { - $nullFence = $path; - } - - // !!! $value might be promise, yield to resolve - try { - if ($this->isPromise($value)) { - $value = yield $value; - } - } catch (Throwable $reason) { - $this->addError(Error::createLocatedError( - $reason, - $ctx->shared->fieldNodes, - $path - )); - if ($nonNull) { - $returnValue = self::$undefined; - } else { - $returnValue = null; - } - goto CHECKED_RETURN; - } - - if ($value === null) { - $returnValue = $value; - goto CHECKED_RETURN; - } elseif ($value instanceof Throwable) { - // special handling of Throwable inherited from JS reference implementation, but makes no sense in this PHP - $this->addError(Error::createLocatedError( - $value, - $ctx->shared->fieldNodes, - $path - )); - if ($nonNull) { - $returnValue = self::$undefined; - } else { - $returnValue = null; - } - goto CHECKED_RETURN; - } - - if ($type instanceof ListOfType) { - $returnValue = []; - $index = -1; - $itemType = $type->getWrappedType(); - foreach ($value as $itemValue) { - ++$index; - - $itemPath = $path; - $itemPath[] = $index; // !!! use arrays COW semantics - $ctx->resolveInfo->path = $itemPath; - - try { - if (! $this->completeValueFast($ctx, $itemType, $itemValue, $itemPath, $itemReturnValue)) { - $itemReturnValue = yield $this->completeValue($ctx, $itemType, $itemValue, $itemPath, $nullFence); - } - } catch (Throwable $reason) { - $this->addError(Error::createLocatedError( - $reason, - $ctx->shared->fieldNodes, - $itemPath - )); - $itemReturnValue = null; - } - if ($itemReturnValue === self::$undefined) { - $returnValue = self::$undefined; - goto CHECKED_RETURN; - } - $returnValue[$index] = $itemReturnValue; - } - - goto CHECKED_RETURN; - } else { - if ($type !== $this->schema->getType($type->name)) { - $hint = ''; - if ($this->schema->getConfig()->typeLoader !== null) { - $hint = sprintf( - 'Make sure that type loader returns the same instance as defined in %s.%s', - $ctx->type, - $ctx->shared->fieldName - ); - } - $this->addError(Error::createLocatedError( - new InvariantViolation( - sprintf( - 'Schema must contain unique named types but contains multiple types named "%s". %s ' . - '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', - $type->name, - $hint - ) - ), - $ctx->shared->fieldNodes, - $path - )); - - $returnValue = null; - goto CHECKED_RETURN; - } - - if ($type instanceof LeafType) { - try { - $returnValue = $type->serialize($value); - } catch (Throwable $error) { - $this->addError(Error::createLocatedError( - new InvariantViolation( - 'Expected a value of type "' . Utils::printSafe($type) . '" but received: ' . Utils::printSafe($value), - 0, - $error - ), - $ctx->shared->fieldNodes, - $path - )); - $returnValue = null; - } - goto CHECKED_RETURN; - } elseif ($type instanceof CompositeType) { - /** @var ObjectType|null $objectType */ - $objectType = null; - if ($type instanceof InterfaceType || $type instanceof UnionType) { - $objectType = $type->resolveType($value, $this->contextValue, $ctx->resolveInfo); - - if ($objectType === null) { - $objectType = yield $this->resolveTypeSlow($ctx, $value, $type); - } - - // !!! $objectType->resolveType() might return promise, yield to resolve - $objectType = yield $objectType; - if (is_string($objectType)) { - $objectType = $this->schema->getType($objectType); - } - - if ($objectType === null) { - $this->addError(Error::createLocatedError( - sprintf( - 'Composite type "%s" did not resolve concrete object type for value: %s.', - $type->name, - Utils::printSafe($value) - ), - $ctx->shared->fieldNodes, - $path - )); - - $returnValue = self::$undefined; - goto CHECKED_RETURN; - } elseif (! $objectType instanceof ObjectType) { - $this->addError(Error::createLocatedError( - new InvariantViolation(sprintf( - 'Abstract type %s must resolve to an Object type at ' . - 'runtime for field %s.%s with value "%s", received "%s". ' . - 'Either the %s type should provide a "resolveType" ' . - 'function or each possible type should provide an "isTypeOf" function.', - $type, - $ctx->resolveInfo->parentType, - $ctx->resolveInfo->fieldName, - Utils::printSafe($value), - Utils::printSafe($objectType), - $type - )), - $ctx->shared->fieldNodes, - $path - )); - - $returnValue = null; - goto CHECKED_RETURN; - } elseif (! $this->schema->isSubType($type, $objectType)) { - $this->addError(Error::createLocatedError( - new InvariantViolation(sprintf( - 'Runtime Object type "%s" is not a possible type for "%s".', - $objectType, - $type - )), - $ctx->shared->fieldNodes, - $path - )); - - $returnValue = null; - goto CHECKED_RETURN; - } elseif ($objectType !== $this->schema->getType($objectType->name)) { - $this->addError(Error::createLocatedError( - new InvariantViolation( - sprintf( - 'Schema must contain unique named types but contains multiple types named "%s". ' . - 'Make sure that `resolveType` function of abstract type "%s" returns the same ' . - 'type instance as referenced anywhere else within the schema ' . - '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).', - $objectType, - $type - ) - ), - $ctx->shared->fieldNodes, - $path - )); - - $returnValue = null; - goto CHECKED_RETURN; - } - } elseif ($type instanceof ObjectType) { - $objectType = $type; - } else { - $this->addError(Error::createLocatedError( - sprintf( - 'Unexpected field type "%s".', - Utils::printSafe($type) - ), - $ctx->shared->fieldNodes, - $path - )); - - $returnValue = self::$undefined; - goto CHECKED_RETURN; - } - - $typeCheck = $objectType->isTypeOf($value, $this->contextValue, $ctx->resolveInfo); - if ($typeCheck !== null) { - // !!! $objectType->isTypeOf() might return promise, yield to resolve - $typeCheck = yield $typeCheck; - if (! $typeCheck) { - $this->addError(Error::createLocatedError( - sprintf('Expected value of type "%s" but got: %s.', $type->name, Utils::printSafe($value)), - $ctx->shared->fieldNodes, - $path - )); - - $returnValue = null; - goto CHECKED_RETURN; - } - } - - $returnValue = new stdClass(); - - if ($ctx->shared->typeGuard2 === $objectType) { - foreach ($ctx->shared->childContextsIfType2 as $childCtx) { - $childCtx = clone $childCtx; - $childCtx->type = $objectType; - $childCtx->value = $value; - $childCtx->result = $returnValue; - $childCtx->path = $path; - $childCtx->path[] = $childCtx->shared->resultName; // !!! uses array COW semantics - $childCtx->nullFence = $nullFence; - $childCtx->resolveInfo = null; - - $this->queue->enqueue(new Strand($this->spawn($childCtx))); - - // !!! assign null to keep object keys sorted - $returnValue->{$childCtx->shared->resultName} = null; - } - } else { - $childContexts = []; - - $fields = []; - if ($this->collector !== null) { - $fields = $this->collector->collectFields( - $objectType, - $ctx->shared->mergedSelectionSet ?? $this->mergeSelectionSets($ctx) - ); - } - - /** @var CoroutineContextShared $childShared */ - foreach ($fields as $childShared) { - $childPath = $path; - $childPath[] = $childShared->resultName; // !!! uses array COW semantics - $childCtx = new CoroutineContext( - $childShared, - $objectType, - $value, - $returnValue, - $childPath, - $nullFence - ); - - $childContexts[] = $childCtx; - - $this->queue->enqueue(new Strand($this->spawn($childCtx))); - - // !!! assign null to keep object keys sorted - $returnValue->{$childShared->resultName} = null; - } - - $ctx->shared->typeGuard2 = $objectType; - $ctx->shared->childContextsIfType2 = $childContexts; - } - - goto CHECKED_RETURN; - } else { - $this->addError(Error::createLocatedError( - sprintf('Unhandled type "%s".', Utils::printSafe($type)), - $ctx->shared->fieldNodes, - $path - )); - - $returnValue = null; - goto CHECKED_RETURN; - } - } - - CHECKED_RETURN: - if ($nonNull && $returnValue === null) { - $this->addError(Error::createLocatedError( - new InvariantViolation(sprintf( - 'Cannot return null for non-nullable field "%s.%s".', - $ctx->type->name, - $ctx->shared->fieldName - )), - $ctx->shared->fieldNodes, - $path - )); - - return self::$undefined; - } - - return $returnValue; - } - - private function mergeSelectionSets(CoroutineContext $ctx) - { - $selections = []; - - foreach ($ctx->shared->fieldNodes as $fieldNode) { - if ($fieldNode->selectionSet === null) { - continue; - } - - foreach ($fieldNode->selectionSet->selections as $selection) { - $selections[] = $selection; - } - } - - return $ctx->shared->mergedSelectionSet = new SelectionSetNode(['selections' => $selections]); - } - - /** - * @param InterfaceType|UnionType $abstractType - * - * @return Generator|ObjectType|Type|null - */ - private function resolveTypeSlow(CoroutineContext $ctx, $value, AbstractType $abstractType) - { - if ($value !== null && - is_array($value) && - isset($value['__typename']) && - is_string($value['__typename']) - ) { - return $this->schema->getType($value['__typename']); - } - - if ($abstractType instanceof InterfaceType && $this->schema->getConfig()->typeLoader !== null) { - Warning::warnOnce( - sprintf( - 'GraphQL Interface Type `%s` returned `null` from its `resolveType` function ' . - 'for value: %s. Switching to slow resolution method using `isTypeOf` ' . - 'of all possible implementations. It requires full schema scan and degrades query performance significantly. ' . - ' Make sure your `resolveType` always returns valid implementation or throws.', - $abstractType->name, - Utils::printSafe($value) - ), - Warning::WARNING_FULL_SCHEMA_SCAN - ); - } - - $possibleTypes = $this->schema->getPossibleTypes($abstractType); - - // to be backward-compatible with old executor, ->isTypeOf() is called for all possible types, - // it cannot short-circuit when the match is found - - $selectedType = null; - foreach ($possibleTypes as $type) { - $typeCheck = yield $type->isTypeOf($value, $this->contextValue, $ctx->resolveInfo); - if ($selectedType !== null || ! $typeCheck) { - continue; - } - - $selectedType = $type; - } - - return $selectedType; - } - - /** - * @param mixed $value - * - * @return bool - */ - private function isPromise($value) - { - return $value instanceof Promise || $this->promiseAdapter->isThenable($value); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Runtime.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Runtime.php deleted file mode 100644 index a5c8fa6d..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Experimental/Executor/Runtime.php +++ /dev/null @@ -1,26 +0,0 @@ -current = $coroutine; - $this->stack = []; - $this->depth = 0; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/GraphQL.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/GraphQL.php deleted file mode 100644 index 8f5291c6..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/GraphQL.php +++ /dev/null @@ -1,365 +0,0 @@ -wait($promise); - } - - /** - * Same as executeQuery(), but requires PromiseAdapter and always returns a Promise. - * Useful for Async PHP platforms. - * - * @param string|DocumentNode $source - * @param mixed $rootValue - * @param mixed $context - * @param mixed[]|null $variableValues - * @param ValidationRule[]|null $validationRules - * - * @api - */ - public static function promiseToExecute( - PromiseAdapter $promiseAdapter, - SchemaType $schema, - $source, - $rootValue = null, - $context = null, - $variableValues = null, - ?string $operationName = null, - ?callable $fieldResolver = null, - ?array $validationRules = null - ) : Promise { - try { - if ($source instanceof DocumentNode) { - $documentNode = $source; - } else { - $documentNode = Parser::parse(new Source($source ?? '', 'GraphQL')); - } - - // FIXME - if (count($validationRules ?? []) === 0) { - /** @var QueryComplexity $queryComplexity */ - $queryComplexity = DocumentValidator::getRule(QueryComplexity::class); - $queryComplexity->setRawVariableValues($variableValues); - } else { - foreach ($validationRules as $rule) { - if (! ($rule instanceof QueryComplexity)) { - continue; - } - - $rule->setRawVariableValues($variableValues); - } - } - - $validationErrors = DocumentValidator::validate($schema, $documentNode, $validationRules); - - if (count($validationErrors) > 0) { - return $promiseAdapter->createFulfilled( - new ExecutionResult(null, $validationErrors) - ); - } - - return Executor::promiseToExecute( - $promiseAdapter, - $schema, - $documentNode, - $rootValue, - $context, - $variableValues, - $operationName, - $fieldResolver - ); - } catch (Error $e) { - return $promiseAdapter->createFulfilled( - new ExecutionResult(null, [$e]) - ); - } - } - - /** - * @deprecated Use executeQuery()->toArray() instead - * - * @param string|DocumentNode $source - * @param mixed $rootValue - * @param mixed $contextValue - * @param mixed[]|null $variableValues - * - * @return Promise|mixed[] - * - * @codeCoverageIgnore - */ - public static function execute( - SchemaType $schema, - $source, - $rootValue = null, - $contextValue = null, - $variableValues = null, - ?string $operationName = null - ) { - trigger_error( - __METHOD__ . ' is deprecated, use GraphQL::executeQuery()->toArray() as a quick replacement', - E_USER_DEPRECATED - ); - - $promiseAdapter = Executor::getPromiseAdapter(); - $result = self::promiseToExecute( - $promiseAdapter, - $schema, - $source, - $rootValue, - $contextValue, - $variableValues, - $operationName - ); - - if ($promiseAdapter instanceof SyncPromiseAdapter) { - $result = $promiseAdapter->wait($result)->toArray(); - } else { - $result = $result->then(static function (ExecutionResult $r) : array { - return $r->toArray(); - }); - } - - return $result; - } - - /** - * @deprecated renamed to executeQuery() - * - * @param string|DocumentNode $source - * @param mixed $rootValue - * @param mixed $contextValue - * @param mixed[]|null $variableValues - * - * @return ExecutionResult|Promise - * - * @codeCoverageIgnore - */ - public static function executeAndReturnResult( - SchemaType $schema, - $source, - $rootValue = null, - $contextValue = null, - $variableValues = null, - ?string $operationName = null - ) { - trigger_error( - __METHOD__ . ' is deprecated, use GraphQL::executeQuery() as a quick replacement', - E_USER_DEPRECATED - ); - - $promiseAdapter = Executor::getPromiseAdapter(); - $result = self::promiseToExecute( - $promiseAdapter, - $schema, - $source, - $rootValue, - $contextValue, - $variableValues, - $operationName - ); - - if ($promiseAdapter instanceof SyncPromiseAdapter) { - $result = $promiseAdapter->wait($result); - } - - return $result; - } - - /** - * Returns directives defined in GraphQL spec - * - * @return Directive[] - * - * @api - */ - public static function getStandardDirectives() : array - { - return array_values(Directive::getInternalDirectives()); - } - - /** - * Returns types defined in GraphQL spec - * - * @return Type[] - * - * @api - */ - public static function getStandardTypes() : array - { - return array_values(Type::getStandardTypes()); - } - - /** - * Replaces standard types with types from this list (matching by name) - * Standard types not listed here remain untouched. - * - * @param array $types - * - * @api - */ - public static function overrideStandardTypes(array $types) - { - Type::overrideStandardTypes($types); - } - - /** - * Returns standard validation rules implementing GraphQL spec - * - * @return ValidationRule[] - * - * @api - */ - public static function getStandardValidationRules() : array - { - return array_values(DocumentValidator::defaultRules()); - } - - /** - * Set default resolver implementation - * - * @api - */ - public static function setDefaultFieldResolver(callable $fn) : void - { - Executor::setDefaultFieldResolver($fn); - } - - public static function setPromiseAdapter(?PromiseAdapter $promiseAdapter = null) : void - { - Executor::setPromiseAdapter($promiseAdapter); - } - - /** - * Experimental: Switch to the new executor - */ - public static function useExperimentalExecutor() - { - trigger_error( - 'Experimental Executor is deprecated and will be removed in the next major version', - E_USER_DEPRECATED - ); - Executor::setImplementationFactory([CoroutineExecutor::class, 'create']); - } - - /** - * Experimental: Switch back to the default executor - */ - public static function useReferenceExecutor() - { - Executor::setImplementationFactory([ReferenceExecutor::class, 'create']); - } - - /** - * Returns directives defined in GraphQL spec - * - * @deprecated Renamed to getStandardDirectives - * - * @return Directive[] - * - * @codeCoverageIgnore - */ - public static function getInternalDirectives() : array - { - return self::getStandardDirectives(); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php deleted file mode 100644 index 0abfb6fd..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ArgumentNode.php +++ /dev/null @@ -1,17 +0,0 @@ - */ - public $arguments; - - /** @var bool */ - public $repeatable; - - /** @var NodeList */ - public $locations; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveNode.php deleted file mode 100644 index c75aafb2..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DirectiveNode.php +++ /dev/null @@ -1,17 +0,0 @@ - */ - public $arguments; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DocumentNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DocumentNode.php deleted file mode 100644 index 986fb261..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/DocumentNode.php +++ /dev/null @@ -1,15 +0,0 @@ - */ - public $definitions; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php deleted file mode 100644 index 5d8c208e..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeDefinitionNode.php +++ /dev/null @@ -1,23 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $values; - - /** @var StringValueNode|null */ - public $description; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php deleted file mode 100644 index 2c90fef6..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumTypeExtensionNode.php +++ /dev/null @@ -1,20 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $values; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php deleted file mode 100644 index 0f9aa8d1..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueDefinitionNode.php +++ /dev/null @@ -1,20 +0,0 @@ - */ - public $directives; - - /** @var StringValueNode|null */ - public $description; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueNode.php deleted file mode 100644 index 1325bc4c..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/EnumValueNode.php +++ /dev/null @@ -1,14 +0,0 @@ - */ - public $arguments; - - /** @var NamedTypeNode|ListTypeNode|NonNullTypeNode */ - public $type; - - /** @var NodeList */ - public $directives; - - /** @var StringValueNode|null */ - public $description; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldNode.php deleted file mode 100644 index 174dbd97..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FieldNode.php +++ /dev/null @@ -1,26 +0,0 @@ - */ - public $arguments; - - /** @var NodeList */ - public $directives; - - /** @var SelectionSetNode|null */ - public $selectionSet; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FloatValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FloatValueNode.php deleted file mode 100644 index b02f5b45..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FloatValueNode.php +++ /dev/null @@ -1,14 +0,0 @@ - - */ - public $variableDefinitions; - - /** @var NamedTypeNode */ - public $typeCondition; - - /** @var NodeList */ - public $directives; - - /** @var SelectionSetNode */ - public $selectionSet; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php deleted file mode 100644 index 2dc693b2..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/FragmentSpreadNode.php +++ /dev/null @@ -1,17 +0,0 @@ - */ - public $directives; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php deleted file mode 100644 index a412cf7d..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/HasSelectionSet.php +++ /dev/null @@ -1,15 +0,0 @@ - */ - public $directives; - - /** @var SelectionSetNode */ - public $selectionSet; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php deleted file mode 100644 index cc324545..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeDefinitionNode.php +++ /dev/null @@ -1,23 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $fields; - - /** @var StringValueNode|null */ - public $description; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php deleted file mode 100644 index e470958e..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputObjectTypeExtensionNode.php +++ /dev/null @@ -1,20 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $fields; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php deleted file mode 100644 index 3e5a4aa5..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InputValueDefinitionNode.php +++ /dev/null @@ -1,26 +0,0 @@ - */ - public $directives; - - /** @var StringValueNode|null */ - public $description; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php deleted file mode 100644 index 3441b7bc..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/IntValueNode.php +++ /dev/null @@ -1,14 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $interfaces; - - /** @var NodeList */ - public $fields; - - /** @var StringValueNode|null */ - public $description; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php deleted file mode 100644 index 4b30f3da..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/InterfaceTypeExtensionNode.php +++ /dev/null @@ -1,23 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $interfaces; - - /** @var NodeList */ - public $fields; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListTypeNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListTypeNode.php deleted file mode 100644 index 6bb3902b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ListTypeNode.php +++ /dev/null @@ -1,14 +0,0 @@ - */ - public $values; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Location.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Location.php deleted file mode 100644 index dfd70b68..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/Location.php +++ /dev/null @@ -1,79 +0,0 @@ -start = $start; - $tmp->end = $end; - - return $tmp; - } - - public function __construct(?Token $startToken = null, ?Token $endToken = null, ?Source $source = null) - { - $this->startToken = $startToken; - $this->endToken = $endToken; - $this->source = $source; - - if ($startToken === null || $endToken === null) { - return; - } - - $this->start = $startToken->start; - $this->end = $endToken->end; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NameNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NameNode.php deleted file mode 100644 index ad911967..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NameNode.php +++ /dev/null @@ -1,14 +0,0 @@ -cloneValue($this); - } - - /** - * @param string|NodeList|Location|Node|(Node|NodeList|Location)[] $value - * - * @return string|NodeList|Location|Node - */ - private function cloneValue($value) - { - if (is_array($value)) { - $cloned = []; - foreach ($value as $key => $arrValue) { - $cloned[$key] = $this->cloneValue($arrValue); - } - } elseif ($value instanceof self) { - $cloned = clone $value; - foreach (get_object_vars($cloned) as $prop => $propValue) { - $cloned->{$prop} = $this->cloneValue($propValue); - } - } else { - $cloned = $value; - } - - return $cloned; - } - - public function __toString() : string - { - $tmp = $this->toArray(true); - - return (string) json_encode($tmp); - } - - /** - * @return mixed[] - */ - public function toArray(bool $recursive = false) : array - { - if ($recursive) { - return $this->recursiveToArray($this); - } - - $tmp = (array) $this; - - if ($this->loc !== null) { - $tmp['loc'] = [ - 'start' => $this->loc->start, - 'end' => $this->loc->end, - ]; - } - - return $tmp; - } - - /** - * @return mixed[] - */ - private function recursiveToArray(Node $node) - { - $result = [ - 'kind' => $node->kind, - ]; - - if ($node->loc !== null) { - $result['loc'] = [ - 'start' => $node->loc->start, - 'end' => $node->loc->end, - ]; - } - - foreach (get_object_vars($node) as $prop => $propValue) { - if (isset($result[$prop])) { - continue; - } - - if ($propValue === null) { - continue; - } - - if (is_array($propValue) || $propValue instanceof NodeList) { - $tmp = []; - foreach ($propValue as $tmp1) { - $tmp[] = $tmp1 instanceof Node ? $this->recursiveToArray($tmp1) : (array) $tmp1; - } - } elseif ($propValue instanceof Node) { - $tmp = $this->recursiveToArray($propValue); - } elseif (is_scalar($propValue) || $propValue === null) { - $tmp = $propValue; - } else { - $tmp = null; - } - - $result[$prop] = $tmp; - } - - return $result; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeKind.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeKind.php deleted file mode 100644 index 7c0f300f..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeKind.php +++ /dev/null @@ -1,138 +0,0 @@ - NameNode::class, - - // Document - self::DOCUMENT => DocumentNode::class, - self::OPERATION_DEFINITION => OperationDefinitionNode::class, - self::VARIABLE_DEFINITION => VariableDefinitionNode::class, - self::VARIABLE => VariableNode::class, - self::SELECTION_SET => SelectionSetNode::class, - self::FIELD => FieldNode::class, - self::ARGUMENT => ArgumentNode::class, - - // Fragments - self::FRAGMENT_SPREAD => FragmentSpreadNode::class, - self::INLINE_FRAGMENT => InlineFragmentNode::class, - self::FRAGMENT_DEFINITION => FragmentDefinitionNode::class, - - // Values - self::INT => IntValueNode::class, - self::FLOAT => FloatValueNode::class, - self::STRING => StringValueNode::class, - self::BOOLEAN => BooleanValueNode::class, - self::ENUM => EnumValueNode::class, - self::NULL => NullValueNode::class, - self::LST => ListValueNode::class, - self::OBJECT => ObjectValueNode::class, - self::OBJECT_FIELD => ObjectFieldNode::class, - - // Directives - self::DIRECTIVE => DirectiveNode::class, - - // Types - self::NAMED_TYPE => NamedTypeNode::class, - self::LIST_TYPE => ListTypeNode::class, - self::NON_NULL_TYPE => NonNullTypeNode::class, - - // Type System Definitions - self::SCHEMA_DEFINITION => SchemaDefinitionNode::class, - self::OPERATION_TYPE_DEFINITION => OperationTypeDefinitionNode::class, - - // Type Definitions - self::SCALAR_TYPE_DEFINITION => ScalarTypeDefinitionNode::class, - self::OBJECT_TYPE_DEFINITION => ObjectTypeDefinitionNode::class, - self::FIELD_DEFINITION => FieldDefinitionNode::class, - self::INPUT_VALUE_DEFINITION => InputValueDefinitionNode::class, - self::INTERFACE_TYPE_DEFINITION => InterfaceTypeDefinitionNode::class, - self::UNION_TYPE_DEFINITION => UnionTypeDefinitionNode::class, - self::ENUM_TYPE_DEFINITION => EnumTypeDefinitionNode::class, - self::ENUM_VALUE_DEFINITION => EnumValueDefinitionNode::class, - self::INPUT_OBJECT_TYPE_DEFINITION => InputObjectTypeDefinitionNode::class, - - // Type Extensions - self::SCALAR_TYPE_EXTENSION => ScalarTypeExtensionNode::class, - self::OBJECT_TYPE_EXTENSION => ObjectTypeExtensionNode::class, - self::INTERFACE_TYPE_EXTENSION => InterfaceTypeExtensionNode::class, - self::UNION_TYPE_EXTENSION => UnionTypeExtensionNode::class, - self::ENUM_TYPE_EXTENSION => EnumTypeExtensionNode::class, - self::INPUT_OBJECT_TYPE_EXTENSION => InputObjectTypeExtensionNode::class, - - // Directive Definitions - self::DIRECTIVE_DEFINITION => DirectiveDefinitionNode::class, - ]; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeList.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeList.php deleted file mode 100644 index 9423791f..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NodeList.php +++ /dev/null @@ -1,154 +0,0 @@ - - * @phpstan-implements IteratorAggregate - */ -class NodeList implements ArrayAccess, IteratorAggregate, Countable -{ - /** - * @var Node[] - * @phpstan-var array - */ - private $nodes; - - /** - * @param Node[] $nodes - * - * @phpstan-param array $nodes - * @phpstan-return self - */ - public static function create(array $nodes) : self - { - return new static($nodes); - } - - /** - * @param Node[] $nodes - * - * @phpstan-param array $nodes - */ - public function __construct(array $nodes) - { - $this->nodes = $nodes; - } - - /** - * @param int|string $offset - */ - public function offsetExists($offset) : bool - { - return isset($this->nodes[$offset]); - } - - /** - * TODO enable strict typing by changing how the Visitor deals with NodeList. - * Ideally, this function should always return a Node instance. - * However, the Visitor currently allows mutation of the NodeList - * and puts arbitrary values in the NodeList, such as strings. - * We will have to switch to using an array or a less strict - * type instead so we can enable strict typing in this class. - * - * @param int|string $offset - * - * @phpstan-return T - */ - #[ReturnTypeWillChange] - public function offsetGet($offset)// : Node - { - $item = $this->nodes[$offset]; - - if (is_array($item) && isset($item['kind'])) { - /** @phpstan-var T $node */ - $node = AST::fromArray($item); - $this->nodes[$offset] = $node; - } - - return $this->nodes[$offset]; - } - - /** - * @param int|string|null $offset - * @param Node|mixed[] $value - * - * @phpstan-param T|mixed[] $value - */ - public function offsetSet($offset, $value) : void - { - if (is_array($value)) { - /** @phpstan-var T $value */ - $value = AST::fromArray($value); - } - - // Happens when a Node is pushed via []= - if ($offset === null) { - $this->nodes[] = $value; - - return; - } - - $this->nodes[$offset] = $value; - } - - /** - * @param int|string $offset - */ - public function offsetUnset($offset) : void - { - unset($this->nodes[$offset]); - } - - /** - * @param mixed $replacement - * - * @phpstan-return NodeList - */ - public function splice(int $offset, int $length, $replacement = null) : NodeList - { - return new NodeList(array_splice($this->nodes, $offset, $length, $replacement)); - } - - /** - * @param NodeList|Node[] $list - * - * @phpstan-param NodeList|array $list - * @phpstan-return NodeList - */ - public function merge($list) : NodeList - { - if ($list instanceof self) { - $list = $list->nodes; - } - - return new NodeList(array_merge($this->nodes, $list)); - } - - public function getIterator() : Traversable - { - foreach ($this->nodes as $key => $_) { - yield $this->offsetGet($key); - } - } - - public function count() : int - { - return count($this->nodes); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php deleted file mode 100644 index 18dc70e4..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/NonNullTypeNode.php +++ /dev/null @@ -1,14 +0,0 @@ - */ - public $interfaces; - - /** @var NodeList */ - public $directives; - - /** @var NodeList */ - public $fields; - - /** @var StringValueNode|null */ - public $description; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php deleted file mode 100644 index b1375238..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectTypeExtensionNode.php +++ /dev/null @@ -1,23 +0,0 @@ - */ - public $interfaces; - - /** @var NodeList */ - public $directives; - - /** @var NodeList */ - public $fields; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php deleted file mode 100644 index f83d74af..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ObjectValueNode.php +++ /dev/null @@ -1,14 +0,0 @@ - */ - public $fields; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php deleted file mode 100644 index 189d606f..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationDefinitionNode.php +++ /dev/null @@ -1,27 +0,0 @@ - */ - public $variableDefinitions; - - /** @var NodeList */ - public $directives; - - /** @var SelectionSetNode */ - public $selectionSet; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php deleted file mode 100644 index 9ad8d25c..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/OperationTypeDefinitionNode.php +++ /dev/null @@ -1,21 +0,0 @@ - */ - public $directives; - - /** @var StringValueNode|null */ - public $description; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php deleted file mode 100644 index ea7d16a6..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ScalarTypeExtensionNode.php +++ /dev/null @@ -1,17 +0,0 @@ - */ - public $directives; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php deleted file mode 100644 index f563ec74..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaDefinitionNode.php +++ /dev/null @@ -1,17 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $operationTypes; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php deleted file mode 100644 index c96bcdf6..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SchemaTypeExtensionNode.php +++ /dev/null @@ -1,17 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $operationTypes; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionNode.php deleted file mode 100644 index 225e218b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/SelectionNode.php +++ /dev/null @@ -1,12 +0,0 @@ - */ - public $selections; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/StringValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/StringValueNode.php deleted file mode 100644 index 059a7e31..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/StringValueNode.php +++ /dev/null @@ -1,17 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $types; - - /** @var StringValueNode|null */ - public $description; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php deleted file mode 100644 index b10eebd5..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/UnionTypeExtensionNode.php +++ /dev/null @@ -1,20 +0,0 @@ - */ - public $directives; - - /** @var NodeList */ - public $types; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ValueNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ValueNode.php deleted file mode 100644 index 2b4e5766..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/ValueNode.php +++ /dev/null @@ -1,20 +0,0 @@ - */ - public $directives; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableNode.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableNode.php deleted file mode 100644 index f8983b90..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/AST/VariableNode.php +++ /dev/null @@ -1,14 +0,0 @@ - self::QUERY, - self::MUTATION => self::MUTATION, - self::SUBSCRIPTION => self::SUBSCRIPTION, - self::FIELD => self::FIELD, - self::FRAGMENT_DEFINITION => self::FRAGMENT_DEFINITION, - self::FRAGMENT_SPREAD => self::FRAGMENT_SPREAD, - self::INLINE_FRAGMENT => self::INLINE_FRAGMENT, - self::SCHEMA => self::SCHEMA, - self::SCALAR => self::SCALAR, - self::OBJECT => self::OBJECT, - self::FIELD_DEFINITION => self::FIELD_DEFINITION, - self::ARGUMENT_DEFINITION => self::ARGUMENT_DEFINITION, - self::IFACE => self::IFACE, - self::UNION => self::UNION, - self::ENUM => self::ENUM, - self::ENUM_VALUE => self::ENUM_VALUE, - self::INPUT_OBJECT => self::INPUT_OBJECT, - self::INPUT_FIELD_DEFINITION => self::INPUT_FIELD_DEFINITION, - ]; - - public static function has(string $name) : bool - { - return isset(self::$locations[$name]); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Lexer.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Lexer.php deleted file mode 100644 index 15563bb2..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Lexer.php +++ /dev/null @@ -1,826 +0,0 @@ -source = $source; - $this->options = $options; - $this->lastToken = $startOfFileToken; - $this->token = $startOfFileToken; - $this->line = 1; - $this->lineStart = 0; - $this->position = $this->byteStreamPosition = 0; - } - - /** - * @return Token - */ - public function advance() - { - $this->lastToken = $this->token; - - return $this->token = $this->lookahead(); - } - - public function lookahead() - { - $token = $this->token; - if ($token->kind !== Token::EOF) { - do { - $token = $token->next ?? ($token->next = $this->readToken($token)); - } while ($token->kind === Token::COMMENT); - } - - return $token; - } - - /** - * @return Token - * - * @throws SyntaxError - */ - private function readToken(Token $prev) - { - $bodyLength = $this->source->length; - - $this->positionAfterWhitespace(); - $position = $this->position; - - $line = $this->line; - $col = 1 + $position - $this->lineStart; - - if ($position >= $bodyLength) { - return new Token(Token::EOF, $bodyLength, $bodyLength, $line, $col, $prev); - } - - // Read next char and advance string cursor: - [, $code, $bytes] = $this->readChar(true); - - switch ($code) { - case self::TOKEN_BANG: - return new Token(Token::BANG, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_HASH: // # - $this->moveStringCursor(-1, -1 * $bytes); - - return $this->readComment($line, $col, $prev); - case self::TOKEN_DOLLAR: - return new Token(Token::DOLLAR, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_AMP: - return new Token(Token::AMP, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_PAREN_L: - return new Token(Token::PAREN_L, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_PAREN_R: - return new Token(Token::PAREN_R, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_DOT: // . - [, $charCode1] = $this->readChar(true); - [, $charCode2] = $this->readChar(true); - - if ($charCode1 === self::TOKEN_DOT && $charCode2 === self::TOKEN_DOT) { - return new Token(Token::SPREAD, $position, $position + 3, $line, $col, $prev); - } - break; - case self::TOKEN_COLON: - return new Token(Token::COLON, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_EQUALS: - return new Token(Token::EQUALS, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_AT: - return new Token(Token::AT, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_BRACKET_L: - return new Token(Token::BRACKET_L, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_BRACKET_R: - return new Token(Token::BRACKET_R, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_BRACE_L: - return new Token(Token::BRACE_L, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_PIPE: - return new Token(Token::PIPE, $position, $position + 1, $line, $col, $prev); - case self::TOKEN_BRACE_R: - return new Token(Token::BRACE_R, $position, $position + 1, $line, $col, $prev); - - // A-Z - case 65: - case 66: - case 67: - case 68: - case 69: - case 70: - case 71: - case 72: - case 73: - case 74: - case 75: - case 76: - case 77: - case 78: - case 79: - case 80: - case 81: - case 82: - case 83: - case 84: - case 85: - case 86: - case 87: - case 88: - case 89: - case 90: - // _ - case 95: - // a-z - case 97: - case 98: - case 99: - case 100: - case 101: - case 102: - case 103: - case 104: - case 105: - case 106: - case 107: - case 108: - case 109: - case 110: - case 111: - case 112: - case 113: - case 114: - case 115: - case 116: - case 117: - case 118: - case 119: - case 120: - case 121: - case 122: - return $this->moveStringCursor(-1, -1 * $bytes) - ->readName($line, $col, $prev); - - // - - case 45: - // 0-9 - case 48: - case 49: - case 50: - case 51: - case 52: - case 53: - case 54: - case 55: - case 56: - case 57: - return $this->moveStringCursor(-1, -1 * $bytes) - ->readNumber($line, $col, $prev); - - // " - case 34: - [, $nextCode] = $this->readChar(); - [, $nextNextCode] = $this->moveStringCursor(1, 1)->readChar(); - - if ($nextCode === 34 && $nextNextCode === 34) { - return $this->moveStringCursor(-2, (-1 * $bytes) - 1) - ->readBlockString($line, $col, $prev); - } - - return $this->moveStringCursor(-2, (-1 * $bytes) - 1) - ->readString($line, $col, $prev); - } - - throw new SyntaxError( - $this->source, - $position, - $this->unexpectedCharacterMessage($code) - ); - } - - private function unexpectedCharacterMessage($code) - { - // SourceCharacter - if ($code < 0x0020 && $code !== 0x0009 && $code !== 0x000A && $code !== 0x000D) { - return 'Cannot contain the invalid character ' . Utils::printCharCode($code); - } - - if ($code === 39) { - return "Unexpected single quote character ('), did you mean to use " . - 'a double quote (")?'; - } - - return 'Cannot parse the unexpected character ' . Utils::printCharCode($code) . '.'; - } - - /** - * Reads an alphanumeric + underscore name from the source. - * - * [_A-Za-z][_0-9A-Za-z]* - * - * @param int $line - * @param int $col - * - * @return Token - */ - private function readName($line, $col, Token $prev) - { - $value = ''; - $start = $this->position; - [$char, $code] = $this->readChar(); - - while ($code !== null && ( - $code === 95 || // _ - ($code >= 48 && $code <= 57) || // 0-9 - ($code >= 65 && $code <= 90) || // A-Z - ($code >= 97 && $code <= 122) // a-z - )) { - $value .= $char; - [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); - } - - return new Token( - Token::NAME, - $start, - $this->position, - $line, - $col, - $prev, - $value - ); - } - - /** - * Reads a number token from the source file, either a float - * or an int depending on whether a decimal point appears. - * - * Int: -?(0|[1-9][0-9]*) - * Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)? - * - * @param int $line - * @param int $col - * - * @return Token - * - * @throws SyntaxError - */ - private function readNumber($line, $col, Token $prev) - { - $value = ''; - $start = $this->position; - [$char, $code] = $this->readChar(); - - $isFloat = false; - - if ($code === 45) { // - - $value .= $char; - [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); - } - - // guard against leading zero's - if ($code === 48) { // 0 - $value .= $char; - [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); - - if ($code >= 48 && $code <= 57) { - throw new SyntaxError( - $this->source, - $this->position, - 'Invalid number, unexpected digit after 0: ' . Utils::printCharCode($code) - ); - } - } else { - $value .= $this->readDigits(); - [$char, $code] = $this->readChar(); - } - - if ($code === 46) { // . - $isFloat = true; - $this->moveStringCursor(1, 1); - - $value .= $char; - $value .= $this->readDigits(); - [$char, $code] = $this->readChar(); - } - - if ($code === 69 || $code === 101) { // E e - $isFloat = true; - $value .= $char; - [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); - - if ($code === 43 || $code === 45) { // + - - $value .= $char; - $this->moveStringCursor(1, 1); - } - $value .= $this->readDigits(); - } - - return new Token( - $isFloat ? Token::FLOAT : Token::INT, - $start, - $this->position, - $line, - $col, - $prev, - $value - ); - } - - /** - * Returns string with all digits + changes current string cursor position to point to the first char after digits - */ - private function readDigits() - { - [$char, $code] = $this->readChar(); - - if ($code >= 48 && $code <= 57) { // 0 - 9 - $value = ''; - - do { - $value .= $char; - [$char, $code] = $this->moveStringCursor(1, 1)->readChar(); - } while ($code >= 48 && $code <= 57); // 0 - 9 - - return $value; - } - - if ($this->position > $this->source->length - 1) { - $code = null; - } - - throw new SyntaxError( - $this->source, - $this->position, - 'Invalid number, expected digit but got: ' . Utils::printCharCode($code) - ); - } - - /** - * @param int $line - * @param int $col - * - * @return Token - * - * @throws SyntaxError - */ - private function readString($line, $col, Token $prev) - { - $start = $this->position; - - // Skip leading quote and read first string char: - [$char, $code, $bytes] = $this->moveStringCursor(1, 1)->readChar(); - - $chunk = ''; - $value = ''; - - while ($code !== null && - // not LineTerminator - $code !== 10 && $code !== 13 - ) { - // Closing Quote (") - if ($code === 34) { - $value .= $chunk; - - // Skip quote - $this->moveStringCursor(1, 1); - - return new Token( - Token::STRING, - $start, - $this->position, - $line, - $col, - $prev, - $value - ); - } - - $this->assertValidStringCharacterCode($code, $this->position); - $this->moveStringCursor(1, $bytes); - - if ($code === 92) { // \ - $value .= $chunk; - [, $code] = $this->readChar(true); - - switch ($code) { - case 34: - $value .= '"'; - break; - case 47: - $value .= '/'; - break; - case 92: - $value .= '\\'; - break; - case 98: - $value .= chr(8); - break; // \b (backspace) - case 102: - $value .= "\f"; - break; - case 110: - $value .= "\n"; - break; - case 114: - $value .= "\r"; - break; - case 116: - $value .= "\t"; - break; - case 117: - $position = $this->position; - [$hex] = $this->readChars(4, true); - if (! preg_match('/[0-9a-fA-F]{4}/', $hex)) { - throw new SyntaxError( - $this->source, - $position - 1, - 'Invalid character escape sequence: \\u' . $hex - ); - } - - $code = hexdec($hex); - - // UTF-16 surrogate pair detection and handling. - $highOrderByte = $code >> 8; - if (0xD8 <= $highOrderByte && $highOrderByte <= 0xDF) { - [$utf16Continuation] = $this->readChars(6, true); - if (! preg_match('/^\\\u[0-9a-fA-F]{4}$/', $utf16Continuation)) { - throw new SyntaxError( - $this->source, - $this->position - 5, - 'Invalid UTF-16 trailing surrogate: ' . $utf16Continuation - ); - } - $surrogatePairHex = $hex . substr($utf16Continuation, 2, 4); - $value .= mb_convert_encoding(pack('H*', $surrogatePairHex), 'UTF-8', 'UTF-16'); - break; - } - - $this->assertValidStringCharacterCode($code, $position - 2); - - $value .= Utils::chr($code); - break; - default: - throw new SyntaxError( - $this->source, - $this->position - 1, - 'Invalid character escape sequence: \\' . Utils::chr($code) - ); - } - $chunk = ''; - } else { - $chunk .= $char; - } - - [$char, $code, $bytes] = $this->readChar(); - } - - throw new SyntaxError( - $this->source, - $this->position, - 'Unterminated string.' - ); - } - - /** - * Reads a block string token from the source file. - * - * """("?"?(\\"""|\\(?!=""")|[^"\\]))*""" - */ - private function readBlockString($line, $col, Token $prev) - { - $start = $this->position; - - // Skip leading quotes and read first string char: - [$char, $code, $bytes] = $this->moveStringCursor(3, 3)->readChar(); - - $chunk = ''; - $value = ''; - - while ($code !== null) { - // Closing Triple-Quote (""") - if ($code === 34) { - // Move 2 quotes - [, $nextCode] = $this->moveStringCursor(1, 1)->readChar(); - [, $nextNextCode] = $this->moveStringCursor(1, 1)->readChar(); - - if ($nextCode === 34 && $nextNextCode === 34) { - $value .= $chunk; - - $this->moveStringCursor(1, 1); - - return new Token( - Token::BLOCK_STRING, - $start, - $this->position, - $line, - $col, - $prev, - BlockString::value($value) - ); - } - - // move cursor back to before the first quote - $this->moveStringCursor(-2, -2); - } - - $this->assertValidBlockStringCharacterCode($code, $this->position); - $this->moveStringCursor(1, $bytes); - - [, $nextCode] = $this->readChar(); - [, $nextNextCode] = $this->moveStringCursor(1, 1)->readChar(); - [, $nextNextNextCode] = $this->moveStringCursor(1, 1)->readChar(); - - // Escape Triple-Quote (\""") - if ($code === 92 && - $nextCode === 34 && - $nextNextCode === 34 && - $nextNextNextCode === 34 - ) { - $this->moveStringCursor(1, 1); - $value .= $chunk . '"""'; - $chunk = ''; - } else { - $this->moveStringCursor(-2, -2); - $chunk .= $char; - } - - [$char, $code, $bytes] = $this->readChar(); - } - - throw new SyntaxError( - $this->source, - $this->position, - 'Unterminated string.' - ); - } - - private function assertValidStringCharacterCode($code, $position) - { - // SourceCharacter - if ($code < 0x0020 && $code !== 0x0009) { - throw new SyntaxError( - $this->source, - $position, - 'Invalid character within String: ' . Utils::printCharCode($code) - ); - } - } - - private function assertValidBlockStringCharacterCode($code, $position) - { - // SourceCharacter - if ($code < 0x0020 && $code !== 0x0009 && $code !== 0x000A && $code !== 0x000D) { - throw new SyntaxError( - $this->source, - $position, - 'Invalid character within String: ' . Utils::printCharCode($code) - ); - } - } - - /** - * Reads from body starting at startPosition until it finds a non-whitespace - * or commented character, then places cursor to the position of that character. - */ - private function positionAfterWhitespace() - { - while ($this->position < $this->source->length) { - [, $code, $bytes] = $this->readChar(); - - // Skip whitespace - // tab | space | comma | BOM - if ($code === 9 || $code === 32 || $code === 44 || $code === 0xFEFF) { - $this->moveStringCursor(1, $bytes); - } elseif ($code === 10) { // new line - $this->moveStringCursor(1, $bytes); - $this->line++; - $this->lineStart = $this->position; - } elseif ($code === 13) { // carriage return - [, $nextCode, $nextBytes] = $this->moveStringCursor(1, $bytes)->readChar(); - - if ($nextCode === 10) { // lf after cr - $this->moveStringCursor(1, $nextBytes); - } - $this->line++; - $this->lineStart = $this->position; - } else { - break; - } - } - } - - /** - * Reads a comment token from the source file. - * - * #[\u0009\u0020-\uFFFF]* - * - * @param int $line - * @param int $col - * - * @return Token - */ - private function readComment($line, $col, Token $prev) - { - $start = $this->position; - $value = ''; - $bytes = 1; - - do { - [$char, $code, $bytes] = $this->moveStringCursor(1, $bytes)->readChar(); - $value .= $char; - } while ($code !== null && - // SourceCharacter but not LineTerminator - ($code > 0x001F || $code === 0x0009) - ); - - return new Token( - Token::COMMENT, - $start, - $this->position, - $line, - $col, - $prev, - $value - ); - } - - /** - * Reads next UTF8Character from the byte stream, starting from $byteStreamPosition. - * - * @param bool $advance - * @param int $byteStreamPosition - * - * @return (string|int)[] - */ - private function readChar($advance = false, $byteStreamPosition = null) - { - if ($byteStreamPosition === null) { - $byteStreamPosition = $this->byteStreamPosition; - } - - $code = null; - $utf8char = ''; - $bytes = 0; - $positionOffset = 0; - - if (isset($this->source->body[$byteStreamPosition])) { - $ord = ord($this->source->body[$byteStreamPosition]); - - if ($ord < 128) { - $bytes = 1; - } elseif ($ord < 224) { - $bytes = 2; - } elseif ($ord < 240) { - $bytes = 3; - } else { - $bytes = 4; - } - - $utf8char = ''; - for ($pos = $byteStreamPosition; $pos < $byteStreamPosition + $bytes; $pos++) { - $utf8char .= $this->source->body[$pos]; - } - $positionOffset = 1; - $code = $bytes === 1 ? $ord : Utils::ord($utf8char); - } - - if ($advance) { - $this->moveStringCursor($positionOffset, $bytes); - } - - return [$utf8char, $code, $bytes]; - } - - /** - * Reads next $numberOfChars UTF8 characters from the byte stream, starting from $byteStreamPosition. - * - * @param int $charCount - * @param bool $advance - * @param null $byteStreamPosition - * - * @return (string|int)[] - */ - private function readChars($charCount, $advance = false, $byteStreamPosition = null) - { - $result = ''; - $totalBytes = 0; - $byteOffset = $byteStreamPosition ?? $this->byteStreamPosition; - - for ($i = 0; $i < $charCount; $i++) { - [$char, $code, $bytes] = $this->readChar(false, $byteOffset); - $totalBytes += $bytes; - $byteOffset += $bytes; - $result .= $char; - } - if ($advance) { - $this->moveStringCursor($charCount, $totalBytes); - } - - return [$result, $totalBytes]; - } - - /** - * Moves internal string cursor position - * - * @param int $positionOffset - * @param int $byteStreamOffset - * - * @return self - */ - private function moveStringCursor($positionOffset, $byteStreamOffset) - { - $this->position += $positionOffset; - $this->byteStreamPosition += $byteStreamOffset; - - return $this; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Parser.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Parser.php deleted file mode 100644 index 9c0f460b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Parser.php +++ /dev/null @@ -1,1780 +0,0 @@ - variableDefinitions(Source|string $source, bool[] $options = []) - * @method static VariableDefinitionNode variableDefinition(Source|string $source, bool[] $options = []) - * @method static VariableNode variable(Source|string $source, bool[] $options = []) - * @method static SelectionSetNode selectionSet(Source|string $source, bool[] $options = []) - * @method static mixed selection(Source|string $source, bool[] $options = []) - * @method static FieldNode field(Source|string $source, bool[] $options = []) - * @method static NodeList arguments(Source|string $source, bool[] $options = []) - * @method static NodeList constArguments(Source|string $source, bool[] $options = []) - * @method static ArgumentNode argument(Source|string $source, bool[] $options = []) - * @method static ArgumentNode constArgument(Source|string $source, bool[] $options = []) - * @method static FragmentSpreadNode|InlineFragmentNode fragment(Source|string $source, bool[] $options = []) - * @method static FragmentDefinitionNode fragmentDefinition(Source|string $source, bool[] $options = []) - * @method static NameNode fragmentName(Source|string $source, bool[] $options = []) - * @method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|NullValueNode|ObjectValueNode|StringValueNode|VariableNode valueLiteral(Source|string $source, bool[] $options = []) - * @method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|NullValueNode|ObjectValueNode|StringValueNode constValueLiteral(Source|string $source, bool[] $options = []) - * @method static StringValueNode stringLiteral(Source|string $source, bool[] $options = []) - * @method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|StringValueNode constValue(Source|string $source, bool[] $options = []) - * @method static BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode variableValue(Source|string $source, bool[] $options = []) - * @method static ListValueNode array(Source|string $source, bool[] $options = []) - * @method static ListValueNode constArray(Source|string $source, bool[] $options = []) - * @method static ObjectValueNode object(Source|string $source, bool[] $options = []) - * @method static ObjectValueNode constObject(Source|string $source, bool[] $options = []) - * @method static ObjectFieldNode objectField(Source|string $source, bool[] $options = []) - * @method static ObjectFieldNode constObjectField(Source|string $source, bool[] $options = []) - * @method static NodeList directives(Source|string $source, bool[] $options = []) - * @method static NodeList constDirectives(Source|string $source, bool[] $options = []) - * @method static DirectiveNode directive(Source|string $source, bool[] $options = []) - * @method static DirectiveNode constDirective(Source|string $source, bool[] $options = []) - * @method static ListTypeNode|NamedTypeNode|NonNullTypeNode typeReference(Source|string $source, bool[] $options = []) - * @method static NamedTypeNode namedType(Source|string $source, bool[] $options = []) - * @method static TypeSystemDefinitionNode typeSystemDefinition(Source|string $source, bool[] $options = []) - * @method static StringValueNode|null description(Source|string $source, bool[] $options = []) - * @method static SchemaDefinitionNode schemaDefinition(Source|string $source, bool[] $options = []) - * @method static OperationTypeDefinitionNode operationTypeDefinition(Source|string $source, bool[] $options = []) - * @method static ScalarTypeDefinitionNode scalarTypeDefinition(Source|string $source, bool[] $options = []) - * @method static ObjectTypeDefinitionNode objectTypeDefinition(Source|string $source, bool[] $options = []) - * @method static NodeList implementsInterfaces(Source|string $source, bool[] $options = []) - * @method static NodeList fieldsDefinition(Source|string $source, bool[] $options = []) - * @method static FieldDefinitionNode fieldDefinition(Source|string $source, bool[] $options = []) - * @method static NodeList argumentsDefinition(Source|string $source, bool[] $options = []) - * @method static InputValueDefinitionNode inputValueDefinition(Source|string $source, bool[] $options = []) - * @method static InterfaceTypeDefinitionNode interfaceTypeDefinition(Source|string $source, bool[] $options = []) - * @method static UnionTypeDefinitionNode unionTypeDefinition(Source|string $source, bool[] $options = []) - * @method static NodeList unionMemberTypes(Source|string $source, bool[] $options = []) - * @method static EnumTypeDefinitionNode enumTypeDefinition(Source|string $source, bool[] $options = []) - * @method static NodeList enumValuesDefinition(Source|string $source, bool[] $options = []) - * @method static EnumValueDefinitionNode enumValueDefinition(Source|string $source, bool[] $options = []) - * @method static InputObjectTypeDefinitionNode inputObjectTypeDefinition(Source|string $source, bool[] $options = []) - * @method static NodeList inputFieldsDefinition(Source|string $source, bool[] $options = []) - * @method static TypeExtensionNode typeExtension(Source|string $source, bool[] $options = []) - * @method static SchemaTypeExtensionNode schemaTypeExtension(Source|string $source, bool[] $options = []) - * @method static ScalarTypeExtensionNode scalarTypeExtension(Source|string $source, bool[] $options = []) - * @method static ObjectTypeExtensionNode objectTypeExtension(Source|string $source, bool[] $options = []) - * @method static InterfaceTypeExtensionNode interfaceTypeExtension(Source|string $source, bool[] $options = []) - * @method static UnionTypeExtensionNode unionTypeExtension(Source|string $source, bool[] $options = []) - * @method static EnumTypeExtensionNode enumTypeExtension(Source|string $source, bool[] $options = []) - * @method static InputObjectTypeExtensionNode inputObjectTypeExtension(Source|string $source, bool[] $options = []) - * @method static DirectiveDefinitionNode directiveDefinition(Source|string $source, bool[] $options = []) - * @method static NodeList directiveLocations(Source|string $source, bool[] $options = []) - * @method static NameNode directiveLocation(Source|string $source, bool[] $options = []) - */ -class Parser -{ - /** - * Given a GraphQL source, parses it into a `GraphQL\Language\AST\DocumentNode`. - * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. - * - * Available options: - * - * noLocation: boolean, - * (By default, the parser creates AST nodes that know the location - * in the source that they correspond to. This configuration flag - * disables that behavior for performance or testing.) - * - * allowLegacySDLEmptyFields: boolean - * If enabled, the parser will parse empty fields sets in the Schema - * Definition Language. Otherwise, the parser will follow the current - * specification. - * - * This option is provided to ease adoption of the final SDL specification - * and will be removed in a future major release. - * - * allowLegacySDLImplementsInterfaces: boolean - * If enabled, the parser will parse implemented interfaces with no `&` - * character between each interface. Otherwise, the parser will follow the - * current specification. - * - * This option is provided to ease adoption of the final SDL specification - * and will be removed in a future major release. - * - * experimentalFragmentVariables: boolean, - * (If enabled, the parser will understand and parse variable definitions - * contained in a fragment definition. They'll be represented in the - * `variableDefinitions` field of the FragmentDefinitionNode. - * - * The syntax is identical to normal, query-defined variables. For example: - * - * fragment A($var: Boolean = false) on T { - * ... - * } - * - * Note: this feature is experimental and may change or be removed in the - * future.) - * - * @param Source|string $source - * @param bool[] $options - * - * @return DocumentNode - * - * @throws SyntaxError - * - * @api - */ - public static function parse($source, array $options = []) - { - $parser = new self($source, $options); - - return $parser->parseDocument(); - } - - /** - * Given a string containing a GraphQL value (ex. `[42]`), parse the AST for - * that value. - * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. - * - * This is useful within tools that operate upon GraphQL Values directly and - * in isolation of complete GraphQL documents. - * - * Consider providing the results to the utility function: `GraphQL\Utils\AST::valueFromAST()`. - * - * @param Source|string $source - * @param bool[] $options - * - * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode - * - * @api - */ - public static function parseValue($source, array $options = []) - { - $parser = new Parser($source, $options); - $parser->expect(Token::SOF); - $value = $parser->parseValueLiteral(false); - $parser->expect(Token::EOF); - - return $value; - } - - /** - * Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for - * that type. - * Throws `GraphQL\Error\SyntaxError` if a syntax error is encountered. - * - * This is useful within tools that operate upon GraphQL Types directly and - * in isolation of complete GraphQL documents. - * - * Consider providing the results to the utility function: `GraphQL\Utils\AST::typeFromAST()`. - * - * @param Source|string $source - * @param bool[] $options - * - * @return ListTypeNode|NamedTypeNode|NonNullTypeNode - * - * @api - */ - public static function parseType($source, array $options = []) - { - $parser = new Parser($source, $options); - $parser->expect(Token::SOF); - $type = $parser->parseTypeReference(); - $parser->expect(Token::EOF); - - return $type; - } - - /** - * Parse partial source by delegating calls to the internal parseX methods. - * - * @param bool[] $arguments - * - * @throws SyntaxError - */ - public static function __callStatic(string $name, array $arguments) - { - $parser = new Parser(...$arguments); - $parser->expect(Token::SOF); - - switch ($name) { - case 'arguments': - case 'valueLiteral': - case 'array': - case 'object': - case 'objectField': - case 'directives': - case 'directive': - $type = $parser->{'parse' . $name}(false); - break; - case 'constArguments': - $type = $parser->parseArguments(true); - break; - case 'constValueLiteral': - $type = $parser->parseValueLiteral(true); - break; - case 'constArray': - $type = $parser->parseArray(true); - break; - case 'constObject': - $type = $parser->parseObject(true); - break; - case 'constObjectField': - $type = $parser->parseObjectField(true); - break; - case 'constDirectives': - $type = $parser->parseDirectives(true); - break; - case 'constDirective': - $type = $parser->parseDirective(true); - break; - default: - $type = $parser->{'parse' . $name}(); - } - - $parser->expect(Token::EOF); - - return $type; - } - - /** @var Lexer */ - private $lexer; - - /** - * @param Source|string $source - * @param bool[] $options - */ - public function __construct($source, array $options = []) - { - $sourceObj = $source instanceof Source ? $source : new Source($source); - $this->lexer = new Lexer($sourceObj, $options); - } - - /** - * Returns a location object, used to identify the place in - * the source that created a given parsed object. - */ - private function loc(Token $startToken) : ?Location - { - if (! ($this->lexer->options['noLocation'] ?? false)) { - return new Location($startToken, $this->lexer->lastToken, $this->lexer->source); - } - - return null; - } - - /** - * Determines if the next token is of a given kind - */ - private function peek(string $kind) : bool - { - return $this->lexer->token->kind === $kind; - } - - /** - * If the next token is of the given kind, return true after advancing - * the parser. Otherwise, do not change the parser state and return false. - */ - private function skip(string $kind) : bool - { - $match = $this->lexer->token->kind === $kind; - - if ($match) { - $this->lexer->advance(); - } - - return $match; - } - - /** - * If the next token is of the given kind, return that token after advancing - * the parser. Otherwise, do not change the parser state and return false. - * - * @throws SyntaxError - */ - private function expect(string $kind) : Token - { - $token = $this->lexer->token; - - if ($token->kind === $kind) { - $this->lexer->advance(); - - return $token; - } - - throw new SyntaxError( - $this->lexer->source, - $token->start, - sprintf('Expected %s, found %s', $kind, $token->getDescription()) - ); - } - - /** - * If the next token is a keyword with the given value, advance the lexer. - * Otherwise, throw an error. - * - * @throws SyntaxError - */ - private function expectKeyword(string $value) : void - { - $token = $this->lexer->token; - if ($token->kind !== Token::NAME || $token->value !== $value) { - throw new SyntaxError( - $this->lexer->source, - $token->start, - 'Expected "' . $value . '", found ' . $token->getDescription() - ); - } - - $this->lexer->advance(); - } - - /** - * If the next token is a given keyword, return "true" after advancing - * the lexer. Otherwise, do not change the parser state and return "false". - */ - private function expectOptionalKeyword(string $value) : bool - { - $token = $this->lexer->token; - if ($token->kind === Token::NAME && $token->value === $value) { - $this->lexer->advance(); - - return true; - } - - return false; - } - - private function unexpected(?Token $atToken = null) : SyntaxError - { - $token = $atToken ?? $this->lexer->token; - - return new SyntaxError($this->lexer->source, $token->start, 'Unexpected ' . $token->getDescription()); - } - - /** - * Returns a possibly empty list of parse nodes, determined by - * the parseFn. This list begins with a lex token of openKind - * and ends with a lex token of closeKind. Advances the parser - * to the next lex token after the closing token. - * - * @throws SyntaxError - */ - private function any(string $openKind, callable $parseFn, string $closeKind) : NodeList - { - $this->expect($openKind); - - $nodes = []; - while (! $this->skip($closeKind)) { - $nodes[] = $parseFn($this); - } - - return new NodeList($nodes); - } - - /** - * Returns a non-empty list of parse nodes, determined by - * the parseFn. This list begins with a lex token of openKind - * and ends with a lex token of closeKind. Advances the parser - * to the next lex token after the closing token. - * - * @throws SyntaxError - */ - private function many(string $openKind, callable $parseFn, string $closeKind) : NodeList - { - $this->expect($openKind); - - $nodes = [$parseFn($this)]; - while (! $this->skip($closeKind)) { - $nodes[] = $parseFn($this); - } - - return new NodeList($nodes); - } - - /** - * Converts a name lex token into a name parse node. - * - * @throws SyntaxError - */ - private function parseName() : NameNode - { - $token = $this->expect(Token::NAME); - - return new NameNode([ - 'value' => $token->value, - 'loc' => $this->loc($token), - ]); - } - - /** - * Implements the parsing rules in the Document section. - * - * @throws SyntaxError - */ - private function parseDocument() : DocumentNode - { - $start = $this->lexer->token; - - return new DocumentNode([ - 'definitions' => $this->many( - Token::SOF, - function () { - return $this->parseDefinition(); - }, - Token::EOF - ), - 'loc' => $this->loc($start), - ]); - } - - /** - * @return ExecutableDefinitionNode|TypeSystemDefinitionNode - * - * @throws SyntaxError - */ - private function parseDefinition() : DefinitionNode - { - if ($this->peek(Token::NAME)) { - switch ($this->lexer->token->value) { - case 'query': - case 'mutation': - case 'subscription': - case 'fragment': - return $this->parseExecutableDefinition(); - - // Note: The schema definition language is an experimental addition. - case 'schema': - case 'scalar': - case 'type': - case 'interface': - case 'union': - case 'enum': - case 'input': - case 'extend': - case 'directive': - // Note: The schema definition language is an experimental addition. - return $this->parseTypeSystemDefinition(); - } - } elseif ($this->peek(Token::BRACE_L)) { - return $this->parseExecutableDefinition(); - } elseif ($this->peekDescription()) { - // Note: The schema definition language is an experimental addition. - return $this->parseTypeSystemDefinition(); - } - - throw $this->unexpected(); - } - - /** - * @throws SyntaxError - */ - private function parseExecutableDefinition() : ExecutableDefinitionNode - { - if ($this->peek(Token::NAME)) { - switch ($this->lexer->token->value) { - case 'query': - case 'mutation': - case 'subscription': - return $this->parseOperationDefinition(); - case 'fragment': - return $this->parseFragmentDefinition(); - } - } elseif ($this->peek(Token::BRACE_L)) { - return $this->parseOperationDefinition(); - } - - throw $this->unexpected(); - } - - // Implements the parsing rules in the Operations section. - - /** - * @throws SyntaxError - */ - private function parseOperationDefinition() : OperationDefinitionNode - { - $start = $this->lexer->token; - if ($this->peek(Token::BRACE_L)) { - return new OperationDefinitionNode([ - 'operation' => 'query', - 'name' => null, - 'variableDefinitions' => new NodeList([]), - 'directives' => new NodeList([]), - 'selectionSet' => $this->parseSelectionSet(), - 'loc' => $this->loc($start), - ]); - } - - $operation = $this->parseOperationType(); - - $name = null; - if ($this->peek(Token::NAME)) { - $name = $this->parseName(); - } - - return new OperationDefinitionNode([ - 'operation' => $operation, - 'name' => $name, - 'variableDefinitions' => $this->parseVariableDefinitions(), - 'directives' => $this->parseDirectives(false), - 'selectionSet' => $this->parseSelectionSet(), - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseOperationType() : string - { - $operationToken = $this->expect(Token::NAME); - switch ($operationToken->value) { - case 'query': - return 'query'; - case 'mutation': - return 'mutation'; - case 'subscription': - return 'subscription'; - } - - throw $this->unexpected($operationToken); - } - - private function parseVariableDefinitions() : NodeList - { - return $this->peek(Token::PAREN_L) - ? $this->many( - Token::PAREN_L, - function () : VariableDefinitionNode { - return $this->parseVariableDefinition(); - }, - Token::PAREN_R - ) - : new NodeList([]); - } - - /** - * @throws SyntaxError - */ - private function parseVariableDefinition() : VariableDefinitionNode - { - $start = $this->lexer->token; - $var = $this->parseVariable(); - - $this->expect(Token::COLON); - $type = $this->parseTypeReference(); - - return new VariableDefinitionNode([ - 'variable' => $var, - 'type' => $type, - 'defaultValue' => $this->skip(Token::EQUALS) - ? $this->parseValueLiteral(true) - : null, - 'directives' => $this->parseDirectives(true), - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseVariable() : VariableNode - { - $start = $this->lexer->token; - $this->expect(Token::DOLLAR); - - return new VariableNode([ - 'name' => $this->parseName(), - 'loc' => $this->loc($start), - ]); - } - - private function parseSelectionSet() : SelectionSetNode - { - $start = $this->lexer->token; - - return new SelectionSetNode( - [ - 'selections' => $this->many( - Token::BRACE_L, - function () : SelectionNode { - return $this->parseSelection(); - }, - Token::BRACE_R - ), - 'loc' => $this->loc($start), - ] - ); - } - - /** - * Selection : - * - Field - * - FragmentSpread - * - InlineFragment - */ - private function parseSelection() : SelectionNode - { - return $this->peek(Token::SPREAD) - ? $this->parseFragment() - : $this->parseField(); - } - - /** - * @throws SyntaxError - */ - private function parseField() : FieldNode - { - $start = $this->lexer->token; - $nameOrAlias = $this->parseName(); - - if ($this->skip(Token::COLON)) { - $alias = $nameOrAlias; - $name = $this->parseName(); - } else { - $alias = null; - $name = $nameOrAlias; - } - - return new FieldNode([ - 'alias' => $alias, - 'name' => $name, - 'arguments' => $this->parseArguments(false), - 'directives' => $this->parseDirectives(false), - 'selectionSet' => $this->peek(Token::BRACE_L) ? $this->parseSelectionSet() : null, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseArguments(bool $isConst) : NodeList - { - $parseFn = $isConst - ? function () : ArgumentNode { - return $this->parseConstArgument(); - } - : function () : ArgumentNode { - return $this->parseArgument(); - }; - - return $this->peek(Token::PAREN_L) - ? $this->many(Token::PAREN_L, $parseFn, Token::PAREN_R) - : new NodeList([]); - } - - /** - * @throws SyntaxError - */ - private function parseArgument() : ArgumentNode - { - $start = $this->lexer->token; - $name = $this->parseName(); - - $this->expect(Token::COLON); - $value = $this->parseValueLiteral(false); - - return new ArgumentNode([ - 'name' => $name, - 'value' => $value, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseConstArgument() : ArgumentNode - { - $start = $this->lexer->token; - $name = $this->parseName(); - - $this->expect(Token::COLON); - $value = $this->parseConstValue(); - - return new ArgumentNode([ - 'name' => $name, - 'value' => $value, - 'loc' => $this->loc($start), - ]); - } - - // Implements the parsing rules in the Fragments section. - - /** - * @return FragmentSpreadNode|InlineFragmentNode - * - * @throws SyntaxError - */ - private function parseFragment() : SelectionNode - { - $start = $this->lexer->token; - $this->expect(Token::SPREAD); - - $hasTypeCondition = $this->expectOptionalKeyword('on'); - if (! $hasTypeCondition && $this->peek(Token::NAME)) { - return new FragmentSpreadNode([ - 'name' => $this->parseFragmentName(), - 'directives' => $this->parseDirectives(false), - 'loc' => $this->loc($start), - ]); - } - - return new InlineFragmentNode([ - 'typeCondition' => $hasTypeCondition ? $this->parseNamedType() : null, - 'directives' => $this->parseDirectives(false), - 'selectionSet' => $this->parseSelectionSet(), - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseFragmentDefinition() : FragmentDefinitionNode - { - $start = $this->lexer->token; - $this->expectKeyword('fragment'); - - $name = $this->parseFragmentName(); - - // Experimental support for defining variables within fragments changes - // the grammar of FragmentDefinition: - // - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet - $variableDefinitions = null; - if (isset($this->lexer->options['experimentalFragmentVariables'])) { - $variableDefinitions = $this->parseVariableDefinitions(); - } - $this->expectKeyword('on'); - $typeCondition = $this->parseNamedType(); - - return new FragmentDefinitionNode([ - 'name' => $name, - 'variableDefinitions' => $variableDefinitions, - 'typeCondition' => $typeCondition, - 'directives' => $this->parseDirectives(false), - 'selectionSet' => $this->parseSelectionSet(), - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseFragmentName() : NameNode - { - if ($this->lexer->token->value === 'on') { - throw $this->unexpected(); - } - - return $this->parseName(); - } - - // Implements the parsing rules in the Values section. - - /** - * Value[Const] : - * - [~Const] Variable - * - IntValue - * - FloatValue - * - StringValue - * - BooleanValue - * - NullValue - * - EnumValue - * - ListValue[?Const] - * - ObjectValue[?Const] - * - * BooleanValue : one of `true` `false` - * - * NullValue : `null` - * - * EnumValue : Name but not `true`, `false` or `null` - * - * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|StringValueNode|VariableNode|ListValueNode|ObjectValueNode|NullValueNode - * - * @throws SyntaxError - */ - private function parseValueLiteral(bool $isConst) : ValueNode - { - $token = $this->lexer->token; - switch ($token->kind) { - case Token::BRACKET_L: - return $this->parseArray($isConst); - case Token::BRACE_L: - return $this->parseObject($isConst); - case Token::INT: - $this->lexer->advance(); - - return new IntValueNode([ - 'value' => $token->value, - 'loc' => $this->loc($token), - ]); - case Token::FLOAT: - $this->lexer->advance(); - - return new FloatValueNode([ - 'value' => $token->value, - 'loc' => $this->loc($token), - ]); - case Token::STRING: - case Token::BLOCK_STRING: - return $this->parseStringLiteral(); - case Token::NAME: - if ($token->value === 'true' || $token->value === 'false') { - $this->lexer->advance(); - - return new BooleanValueNode([ - 'value' => $token->value === 'true', - 'loc' => $this->loc($token), - ]); - } - - if ($token->value === 'null') { - $this->lexer->advance(); - - return new NullValueNode([ - 'loc' => $this->loc($token), - ]); - } else { - $this->lexer->advance(); - - return new EnumValueNode([ - 'value' => $token->value, - 'loc' => $this->loc($token), - ]); - } - break; - - case Token::DOLLAR: - if (! $isConst) { - return $this->parseVariable(); - } - break; - } - throw $this->unexpected(); - } - - private function parseStringLiteral() : StringValueNode - { - $token = $this->lexer->token; - $this->lexer->advance(); - - return new StringValueNode([ - 'value' => $token->value, - 'block' => $token->kind === Token::BLOCK_STRING, - 'loc' => $this->loc($token), - ]); - } - - /** - * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|StringValueNode|VariableNode - * - * @throws SyntaxError - */ - private function parseConstValue() : ValueNode - { - return $this->parseValueLiteral(true); - } - - /** - * @return BooleanValueNode|EnumValueNode|FloatValueNode|IntValueNode|ListValueNode|ObjectValueNode|StringValueNode|VariableNode - */ - private function parseVariableValue() : ValueNode - { - return $this->parseValueLiteral(false); - } - - private function parseArray(bool $isConst) : ListValueNode - { - $start = $this->lexer->token; - $parseFn = $isConst - ? function () { - return $this->parseConstValue(); - } - : function () { - return $this->parseVariableValue(); - }; - - return new ListValueNode( - [ - 'values' => $this->any(Token::BRACKET_L, $parseFn, Token::BRACKET_R), - 'loc' => $this->loc($start), - ] - ); - } - - private function parseObject(bool $isConst) : ObjectValueNode - { - $start = $this->lexer->token; - $this->expect(Token::BRACE_L); - $fields = []; - while (! $this->skip(Token::BRACE_R)) { - $fields[] = $this->parseObjectField($isConst); - } - - return new ObjectValueNode([ - 'fields' => new NodeList($fields), - 'loc' => $this->loc($start), - ]); - } - - private function parseObjectField(bool $isConst) : ObjectFieldNode - { - $start = $this->lexer->token; - $name = $this->parseName(); - - $this->expect(Token::COLON); - - return new ObjectFieldNode([ - 'name' => $name, - 'value' => $this->parseValueLiteral($isConst), - 'loc' => $this->loc($start), - ]); - } - - // Implements the parsing rules in the Directives section. - - /** - * @throws SyntaxError - */ - private function parseDirectives(bool $isConst) : NodeList - { - $directives = []; - while ($this->peek(Token::AT)) { - $directives[] = $this->parseDirective($isConst); - } - - return new NodeList($directives); - } - - /** - * @throws SyntaxError - */ - private function parseDirective(bool $isConst) : DirectiveNode - { - $start = $this->lexer->token; - $this->expect(Token::AT); - - return new DirectiveNode([ - 'name' => $this->parseName(), - 'arguments' => $this->parseArguments($isConst), - 'loc' => $this->loc($start), - ]); - } - - // Implements the parsing rules in the Types section. - - /** - * Handles the Type: TypeName, ListType, and NonNullType parsing rules. - * - * @return ListTypeNode|NamedTypeNode|NonNullTypeNode - * - * @throws SyntaxError - */ - private function parseTypeReference() : TypeNode - { - $start = $this->lexer->token; - - if ($this->skip(Token::BRACKET_L)) { - $type = $this->parseTypeReference(); - $this->expect(Token::BRACKET_R); - $type = new ListTypeNode([ - 'type' => $type, - 'loc' => $this->loc($start), - ]); - } else { - $type = $this->parseNamedType(); - } - if ($this->skip(Token::BANG)) { - return new NonNullTypeNode([ - 'type' => $type, - 'loc' => $this->loc($start), - ]); - } - - return $type; - } - - private function parseNamedType() : NamedTypeNode - { - $start = $this->lexer->token; - - return new NamedTypeNode([ - 'name' => $this->parseName(), - 'loc' => $this->loc($start), - ]); - } - - // Implements the parsing rules in the Type Definition section. - - /** - * TypeSystemDefinition : - * - SchemaDefinition - * - TypeDefinition - * - TypeExtension - * - DirectiveDefinition - * - * TypeDefinition : - * - ScalarTypeDefinition - * - ObjectTypeDefinition - * - InterfaceTypeDefinition - * - UnionTypeDefinition - * - EnumTypeDefinition - * - InputObjectTypeDefinition - * - * @throws SyntaxError - */ - private function parseTypeSystemDefinition() : TypeSystemDefinitionNode - { - // Many definitions begin with a description and require a lookahead. - $keywordToken = $this->peekDescription() - ? $this->lexer->lookahead() - : $this->lexer->token; - - if ($keywordToken->kind === Token::NAME) { - switch ($keywordToken->value) { - case 'schema': - return $this->parseSchemaDefinition(); - case 'scalar': - return $this->parseScalarTypeDefinition(); - case 'type': - return $this->parseObjectTypeDefinition(); - case 'interface': - return $this->parseInterfaceTypeDefinition(); - case 'union': - return $this->parseUnionTypeDefinition(); - case 'enum': - return $this->parseEnumTypeDefinition(); - case 'input': - return $this->parseInputObjectTypeDefinition(); - case 'extend': - return $this->parseTypeExtension(); - case 'directive': - return $this->parseDirectiveDefinition(); - } - } - - throw $this->unexpected($keywordToken); - } - - private function peekDescription() : bool - { - return $this->peek(Token::STRING) || $this->peek(Token::BLOCK_STRING); - } - - private function parseDescription() : ?StringValueNode - { - if ($this->peekDescription()) { - return $this->parseStringLiteral(); - } - - return null; - } - - /** - * @throws SyntaxError - */ - private function parseSchemaDefinition() : SchemaDefinitionNode - { - $start = $this->lexer->token; - $this->expectKeyword('schema'); - $directives = $this->parseDirectives(true); - - $operationTypes = $this->many( - Token::BRACE_L, - function () : OperationTypeDefinitionNode { - return $this->parseOperationTypeDefinition(); - }, - Token::BRACE_R - ); - - return new SchemaDefinitionNode([ - 'directives' => $directives, - 'operationTypes' => $operationTypes, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseOperationTypeDefinition() : OperationTypeDefinitionNode - { - $start = $this->lexer->token; - $operation = $this->parseOperationType(); - $this->expect(Token::COLON); - $type = $this->parseNamedType(); - - return new OperationTypeDefinitionNode([ - 'operation' => $operation, - 'type' => $type, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseScalarTypeDefinition() : ScalarTypeDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $this->expectKeyword('scalar'); - $name = $this->parseName(); - $directives = $this->parseDirectives(true); - - return new ScalarTypeDefinitionNode([ - 'name' => $name, - 'directives' => $directives, - 'loc' => $this->loc($start), - 'description' => $description, - ]); - } - - /** - * @throws SyntaxError - */ - private function parseObjectTypeDefinition() : ObjectTypeDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $this->expectKeyword('type'); - $name = $this->parseName(); - $interfaces = $this->parseImplementsInterfaces(); - $directives = $this->parseDirectives(true); - $fields = $this->parseFieldsDefinition(); - - return new ObjectTypeDefinitionNode([ - 'name' => $name, - 'interfaces' => $interfaces, - 'directives' => $directives, - 'fields' => $fields, - 'loc' => $this->loc($start), - 'description' => $description, - ]); - } - - /** - * ImplementsInterfaces : - * - implements `&`? NamedType - * - ImplementsInterfaces & NamedType - */ - private function parseImplementsInterfaces() : NodeList - { - $types = []; - if ($this->expectOptionalKeyword('implements')) { - // Optional leading ampersand - $this->skip(Token::AMP); - do { - $types[] = $this->parseNamedType(); - } while ($this->skip(Token::AMP) || - // Legacy support for the SDL? - (($this->lexer->options['allowLegacySDLImplementsInterfaces'] ?? false) && $this->peek(Token::NAME)) - ); - } - - return new NodeList($types); - } - - /** - * @throws SyntaxError - */ - private function parseFieldsDefinition() : NodeList - { - // Legacy support for the SDL? - if (($this->lexer->options['allowLegacySDLEmptyFields'] ?? false) - && $this->peek(Token::BRACE_L) - && $this->lexer->lookahead()->kind === Token::BRACE_R - ) { - $this->lexer->advance(); - $this->lexer->advance(); - - /** @phpstan-var NodeList $nodeList */ - $nodeList = new NodeList([]); - } else { - /** @phpstan-var NodeList $nodeList */ - $nodeList = $this->peek(Token::BRACE_L) - ? $this->many( - Token::BRACE_L, - function () : FieldDefinitionNode { - return $this->parseFieldDefinition(); - }, - Token::BRACE_R - ) - : new NodeList([]); - } - - return $nodeList; - } - - /** - * @throws SyntaxError - */ - private function parseFieldDefinition() : FieldDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $name = $this->parseName(); - $args = $this->parseArgumentsDefinition(); - $this->expect(Token::COLON); - $type = $this->parseTypeReference(); - $directives = $this->parseDirectives(true); - - return new FieldDefinitionNode([ - 'name' => $name, - 'arguments' => $args, - 'type' => $type, - 'directives' => $directives, - 'loc' => $this->loc($start), - 'description' => $description, - ]); - } - - /** - * @throws SyntaxError - */ - private function parseArgumentsDefinition() : NodeList - { - /** @var NodeList $nodeList */ - $nodeList = $this->peek(Token::PAREN_L) - ? $this->many( - Token::PAREN_L, - function () : InputValueDefinitionNode { - return $this->parseInputValueDefinition(); - }, - Token::PAREN_R - ) - : new NodeList([]); - - return $nodeList; - } - - /** - * @throws SyntaxError - */ - private function parseInputValueDefinition() : InputValueDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $name = $this->parseName(); - $this->expect(Token::COLON); - $type = $this->parseTypeReference(); - $defaultValue = null; - if ($this->skip(Token::EQUALS)) { - $defaultValue = $this->parseConstValue(); - } - $directives = $this->parseDirectives(true); - - return new InputValueDefinitionNode([ - 'name' => $name, - 'type' => $type, - 'defaultValue' => $defaultValue, - 'directives' => $directives, - 'loc' => $this->loc($start), - 'description' => $description, - ]); - } - - /** - * @throws SyntaxError - */ - private function parseInterfaceTypeDefinition() : InterfaceTypeDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $this->expectKeyword('interface'); - $name = $this->parseName(); - $interfaces = $this->parseImplementsInterfaces(); - $directives = $this->parseDirectives(true); - $fields = $this->parseFieldsDefinition(); - - return new InterfaceTypeDefinitionNode([ - 'name' => $name, - 'directives' => $directives, - 'interfaces' => $interfaces, - 'fields' => $fields, - 'loc' => $this->loc($start), - 'description' => $description, - ]); - } - - /** - * UnionTypeDefinition : - * - Description? union Name Directives[Const]? UnionMemberTypes? - * - * @throws SyntaxError - */ - private function parseUnionTypeDefinition() : UnionTypeDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $this->expectKeyword('union'); - $name = $this->parseName(); - $directives = $this->parseDirectives(true); - $types = $this->parseUnionMemberTypes(); - - return new UnionTypeDefinitionNode([ - 'name' => $name, - 'directives' => $directives, - 'types' => $types, - 'loc' => $this->loc($start), - 'description' => $description, - ]); - } - - /** - * UnionMemberTypes : - * - = `|`? NamedType - * - UnionMemberTypes | NamedType - */ - private function parseUnionMemberTypes() : NodeList - { - $types = []; - if ($this->skip(Token::EQUALS)) { - // Optional leading pipe - $this->skip(Token::PIPE); - do { - $types[] = $this->parseNamedType(); - } while ($this->skip(Token::PIPE)); - } - - return new NodeList($types); - } - - /** - * @throws SyntaxError - */ - private function parseEnumTypeDefinition() : EnumTypeDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $this->expectKeyword('enum'); - $name = $this->parseName(); - $directives = $this->parseDirectives(true); - $values = $this->parseEnumValuesDefinition(); - - return new EnumTypeDefinitionNode([ - 'name' => $name, - 'directives' => $directives, - 'values' => $values, - 'loc' => $this->loc($start), - 'description' => $description, - ]); - } - - /** - * @throws SyntaxError - */ - private function parseEnumValuesDefinition() : NodeList - { - /** @var NodeList $nodeList */ - $nodeList = $this->peek(Token::BRACE_L) - ? $this->many( - Token::BRACE_L, - function () : EnumValueDefinitionNode { - return $this->parseEnumValueDefinition(); - }, - Token::BRACE_R - ) - : new NodeList([]); - - return $nodeList; - } - - /** - * @throws SyntaxError - */ - private function parseEnumValueDefinition() : EnumValueDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $name = $this->parseName(); - $directives = $this->parseDirectives(true); - - return new EnumValueDefinitionNode([ - 'name' => $name, - 'directives' => $directives, - 'loc' => $this->loc($start), - 'description' => $description, - ]); - } - - /** - * @throws SyntaxError - */ - private function parseInputObjectTypeDefinition() : InputObjectTypeDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $this->expectKeyword('input'); - $name = $this->parseName(); - $directives = $this->parseDirectives(true); - $fields = $this->parseInputFieldsDefinition(); - - return new InputObjectTypeDefinitionNode([ - 'name' => $name, - 'directives' => $directives, - 'fields' => $fields, - 'loc' => $this->loc($start), - 'description' => $description, - ]); - } - - /** - * @throws SyntaxError - */ - private function parseInputFieldsDefinition() : NodeList - { - /** @var NodeList $nodeList */ - $nodeList = $this->peek(Token::BRACE_L) - ? $this->many( - Token::BRACE_L, - function () : InputValueDefinitionNode { - return $this->parseInputValueDefinition(); - }, - Token::BRACE_R - ) - : new NodeList([]); - - return $nodeList; - } - - /** - * TypeExtension : - * - ScalarTypeExtension - * - ObjectTypeExtension - * - InterfaceTypeExtension - * - UnionTypeExtension - * - EnumTypeExtension - * - InputObjectTypeDefinition - * - * @throws SyntaxError - */ - private function parseTypeExtension() : TypeExtensionNode - { - $keywordToken = $this->lexer->lookahead(); - - if ($keywordToken->kind === Token::NAME) { - switch ($keywordToken->value) { - case 'schema': - return $this->parseSchemaTypeExtension(); - case 'scalar': - return $this->parseScalarTypeExtension(); - case 'type': - return $this->parseObjectTypeExtension(); - case 'interface': - return $this->parseInterfaceTypeExtension(); - case 'union': - return $this->parseUnionTypeExtension(); - case 'enum': - return $this->parseEnumTypeExtension(); - case 'input': - return $this->parseInputObjectTypeExtension(); - } - } - - throw $this->unexpected($keywordToken); - } - - /** - * @throws SyntaxError - */ - private function parseSchemaTypeExtension() : SchemaTypeExtensionNode - { - $start = $this->lexer->token; - $this->expectKeyword('extend'); - $this->expectKeyword('schema'); - $directives = $this->parseDirectives(true); - $operationTypes = $this->peek(Token::BRACE_L) - ? $this->many( - Token::BRACE_L, - [$this, 'parseOperationTypeDefinition'], - Token::BRACE_R - ) - : new NodeList([]); - if (count($directives) === 0 && count($operationTypes) === 0) { - $this->unexpected(); - } - - return new SchemaTypeExtensionNode([ - 'directives' => $directives, - 'operationTypes' => $operationTypes, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseScalarTypeExtension() : ScalarTypeExtensionNode - { - $start = $this->lexer->token; - $this->expectKeyword('extend'); - $this->expectKeyword('scalar'); - $name = $this->parseName(); - $directives = $this->parseDirectives(true); - if (count($directives) === 0) { - throw $this->unexpected(); - } - - return new ScalarTypeExtensionNode([ - 'name' => $name, - 'directives' => $directives, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseObjectTypeExtension() : ObjectTypeExtensionNode - { - $start = $this->lexer->token; - $this->expectKeyword('extend'); - $this->expectKeyword('type'); - $name = $this->parseName(); - $interfaces = $this->parseImplementsInterfaces(); - $directives = $this->parseDirectives(true); - $fields = $this->parseFieldsDefinition(); - - if (count($interfaces) === 0 && - count($directives) === 0 && - count($fields) === 0 - ) { - throw $this->unexpected(); - } - - return new ObjectTypeExtensionNode([ - 'name' => $name, - 'interfaces' => $interfaces, - 'directives' => $directives, - 'fields' => $fields, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseInterfaceTypeExtension() : InterfaceTypeExtensionNode - { - $start = $this->lexer->token; - $this->expectKeyword('extend'); - $this->expectKeyword('interface'); - $name = $this->parseName(); - $interfaces = $this->parseImplementsInterfaces(); - $directives = $this->parseDirectives(true); - $fields = $this->parseFieldsDefinition(); - if (count($interfaces) === 0 - && count($directives) === 0 - && count($fields) === 0 - ) { - throw $this->unexpected(); - } - - return new InterfaceTypeExtensionNode([ - 'name' => $name, - 'directives' => $directives, - 'interfaces' => $interfaces, - 'fields' => $fields, - 'loc' => $this->loc($start), - ]); - } - - /** - * UnionTypeExtension : - * - extend union Name Directives[Const]? UnionMemberTypes - * - extend union Name Directives[Const] - * - * @throws SyntaxError - */ - private function parseUnionTypeExtension() : UnionTypeExtensionNode - { - $start = $this->lexer->token; - $this->expectKeyword('extend'); - $this->expectKeyword('union'); - $name = $this->parseName(); - $directives = $this->parseDirectives(true); - $types = $this->parseUnionMemberTypes(); - if (count($directives) === 0 && count($types) === 0) { - throw $this->unexpected(); - } - - return new UnionTypeExtensionNode([ - 'name' => $name, - 'directives' => $directives, - 'types' => $types, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseEnumTypeExtension() : EnumTypeExtensionNode - { - $start = $this->lexer->token; - $this->expectKeyword('extend'); - $this->expectKeyword('enum'); - $name = $this->parseName(); - $directives = $this->parseDirectives(true); - $values = $this->parseEnumValuesDefinition(); - if (count($directives) === 0 && - count($values) === 0 - ) { - throw $this->unexpected(); - } - - return new EnumTypeExtensionNode([ - 'name' => $name, - 'directives' => $directives, - 'values' => $values, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseInputObjectTypeExtension() : InputObjectTypeExtensionNode - { - $start = $this->lexer->token; - $this->expectKeyword('extend'); - $this->expectKeyword('input'); - $name = $this->parseName(); - $directives = $this->parseDirectives(true); - $fields = $this->parseInputFieldsDefinition(); - if (count($directives) === 0 && - count($fields) === 0 - ) { - throw $this->unexpected(); - } - - return new InputObjectTypeExtensionNode([ - 'name' => $name, - 'directives' => $directives, - 'fields' => $fields, - 'loc' => $this->loc($start), - ]); - } - - /** - * DirectiveDefinition : - * - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations - * - * @throws SyntaxError - */ - private function parseDirectiveDefinition() : DirectiveDefinitionNode - { - $start = $this->lexer->token; - $description = $this->parseDescription(); - $this->expectKeyword('directive'); - $this->expect(Token::AT); - $name = $this->parseName(); - $args = $this->parseArgumentsDefinition(); - $repeatable = $this->expectOptionalKeyword('repeatable'); - $this->expectKeyword('on'); - $locations = $this->parseDirectiveLocations(); - - return new DirectiveDefinitionNode([ - 'name' => $name, - 'description' => $description, - 'arguments' => $args, - 'repeatable' => $repeatable, - 'locations' => $locations, - 'loc' => $this->loc($start), - ]); - } - - /** - * @throws SyntaxError - */ - private function parseDirectiveLocations() : NodeList - { - // Optional leading pipe - $this->skip(Token::PIPE); - $locations = []; - do { - $locations[] = $this->parseDirectiveLocation(); - } while ($this->skip(Token::PIPE)); - - return new NodeList($locations); - } - - /** - * @throws SyntaxError - */ - private function parseDirectiveLocation() : NameNode - { - $start = $this->lexer->token; - $name = $this->parseName(); - if (DirectiveLocation::has($name->value)) { - return $name; - } - - throw $this->unexpected($start); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Printer.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Printer.php deleted file mode 100644 index 0a95efc4..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Printer.php +++ /dev/null @@ -1,539 +0,0 @@ -printAST($ast); - } - - protected function __construct() - { - } - - /** - * Traverse an AST bottom-up, converting all nodes to strings. - * - * That means the AST is manipulated in such a way that it no longer - * resembles the well-formed result of parsing. - */ - public function printAST($ast) - { - return Visitor::visit( - $ast, - [ - 'leave' => [ - NodeKind::NAME => static function (NameNode $node) : string { - return $node->value; - }, - - NodeKind::VARIABLE => static function (VariableNode $node) : string { - return '$' . $node->name; - }, - - NodeKind::DOCUMENT => function (DocumentNode $node) : string { - return $this->join($node->definitions, "\n\n") . "\n"; - }, - - NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) : string { - $op = $node->operation; - $name = $node->name; - $varDefs = $this->wrap('(', $this->join($node->variableDefinitions, ', '), ')'); - $directives = $this->join($node->directives, ' '); - $selectionSet = $node->selectionSet; - - // Anonymous queries with no directives or variable definitions can use - // the query short form. - return $name === null && strlen($directives ?? '') === 0 && ! $varDefs && $op === 'query' - ? $selectionSet - : $this->join([$op, $this->join([$name, $varDefs]), $directives, $selectionSet], ' '); - }, - - NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $node) : string { - return $node->variable - . ': ' - . $node->type - . $this->wrap(' = ', $node->defaultValue) - . $this->wrap(' ', $this->join($node->directives, ' ')); - }, - - NodeKind::SELECTION_SET => function (SelectionSetNode $node) { - return $this->block($node->selections); - }, - - NodeKind::FIELD => function (FieldNode $node) : string { - return $this->join( - [ - $this->wrap('', $node->alias, ': ') . $node->name . $this->wrap( - '(', - $this->join($node->arguments, ', '), - ')' - ), - $this->join($node->directives, ' '), - $node->selectionSet, - ], - ' ' - ); - }, - - NodeKind::ARGUMENT => static function (ArgumentNode $node) : string { - return $node->name . ': ' . $node->value; - }, - - NodeKind::FRAGMENT_SPREAD => function (FragmentSpreadNode $node) : string { - return '...' - . $node->name - . $this->wrap(' ', $this->join($node->directives, ' ')); - }, - - NodeKind::INLINE_FRAGMENT => function (InlineFragmentNode $node) : string { - return $this->join( - [ - '...', - $this->wrap('on ', $node->typeCondition), - $this->join($node->directives, ' '), - $node->selectionSet, - ], - ' ' - ); - }, - - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) : string { - // Note: fragment variable definitions are experimental and may be changed or removed in the future. - return sprintf('fragment %s', $node->name) - . $this->wrap('(', $this->join($node->variableDefinitions, ', '), ')') - . sprintf(' on %s ', $node->typeCondition) - . $this->wrap('', $this->join($node->directives, ' '), ' ') - . $node->selectionSet; - }, - - NodeKind::INT => static function (IntValueNode $node) : string { - return $node->value; - }, - - NodeKind::FLOAT => static function (FloatValueNode $node) : string { - return $node->value; - }, - - NodeKind::STRING => function (StringValueNode $node, $key) : string { - if ($node->block) { - return $this->printBlockString($node->value, $key === 'description'); - } - - return json_encode($node->value); - }, - - NodeKind::BOOLEAN => static function (BooleanValueNode $node) : string { - return $node->value ? 'true' : 'false'; - }, - - NodeKind::NULL => static function (NullValueNode $node) : string { - return 'null'; - }, - - NodeKind::ENUM => static function (EnumValueNode $node) : string { - return $node->value; - }, - - NodeKind::LST => function (ListValueNode $node) : string { - return '[' . $this->join($node->values, ', ') . ']'; - }, - - NodeKind::OBJECT => function (ObjectValueNode $node) : string { - return '{' . $this->join($node->fields, ', ') . '}'; - }, - - NodeKind::OBJECT_FIELD => static function (ObjectFieldNode $node) : string { - return $node->name . ': ' . $node->value; - }, - - NodeKind::DIRECTIVE => function (DirectiveNode $node) : string { - return '@' . $node->name . $this->wrap('(', $this->join($node->arguments, ', '), ')'); - }, - - NodeKind::NAMED_TYPE => static function (NamedTypeNode $node) : string { - // @phpstan-ignore-next-line the printer works bottom up, so this is already a string here - return $node->name; - }, - - NodeKind::LIST_TYPE => static function (ListTypeNode $node) : string { - return '[' . $node->type . ']'; - }, - - NodeKind::NON_NULL_TYPE => static function (NonNullTypeNode $node) : string { - return $node->type . '!'; - }, - - NodeKind::SCHEMA_DEFINITION => function (SchemaDefinitionNode $def) : string { - return $this->join( - [ - 'schema', - $this->join($def->directives, ' '), - $this->block($def->operationTypes), - ], - ' ' - ); - }, - - NodeKind::OPERATION_TYPE_DEFINITION => static function (OperationTypeDefinitionNode $def) : string { - return $def->operation . ': ' . $def->type; - }, - - NodeKind::SCALAR_TYPE_DEFINITION => $this->addDescription(function (ScalarTypeDefinitionNode $def) : string { - return $this->join(['scalar', $def->name, $this->join($def->directives, ' ')], ' '); - }), - - NodeKind::OBJECT_TYPE_DEFINITION => $this->addDescription(function (ObjectTypeDefinitionNode $def) : string { - return $this->join( - [ - 'type', - $def->name, - $this->wrap('implements ', $this->join($def->interfaces, ' & ')), - $this->join($def->directives, ' '), - $this->block($def->fields), - ], - ' ' - ); - }), - - NodeKind::FIELD_DEFINITION => $this->addDescription(function (FieldDefinitionNode $def) : string { - $noIndent = Utils::every($def->arguments, static function (string $arg) : bool { - return strpos($arg, "\n") === false; - }); - - return $def->name - . ($noIndent - ? $this->wrap('(', $this->join($def->arguments, ', '), ')') - : $this->wrap("(\n", $this->indent($this->join($def->arguments, "\n")), "\n)")) - . ': ' . $def->type - . $this->wrap(' ', $this->join($def->directives, ' ')); - }), - - NodeKind::INPUT_VALUE_DEFINITION => $this->addDescription(function (InputValueDefinitionNode $def) : string { - return $this->join( - [ - $def->name . ': ' . $def->type, - $this->wrap('= ', $def->defaultValue), - $this->join($def->directives, ' '), - ], - ' ' - ); - }), - - NodeKind::INTERFACE_TYPE_DEFINITION => $this->addDescription( - function (InterfaceTypeDefinitionNode $def) : string { - return $this->join( - [ - 'interface', - $def->name, - $this->wrap('implements ', $this->join($def->interfaces, ' & ')), - $this->join($def->directives, ' '), - $this->block($def->fields), - ], - ' ' - ); - } - ), - - NodeKind::UNION_TYPE_DEFINITION => $this->addDescription(function (UnionTypeDefinitionNode $def) : string { - return $this->join( - [ - 'union', - $def->name, - $this->join($def->directives, ' '), - count($def->types ?? []) > 0 - ? '= ' . $this->join($def->types, ' | ') - : '', - ], - ' ' - ); - }), - - NodeKind::ENUM_TYPE_DEFINITION => $this->addDescription(function (EnumTypeDefinitionNode $def) : string { - return $this->join( - [ - 'enum', - $def->name, - $this->join($def->directives, ' '), - $this->block($def->values), - ], - ' ' - ); - }), - - NodeKind::ENUM_VALUE_DEFINITION => $this->addDescription(function (EnumValueDefinitionNode $def) : string { - return $this->join([$def->name, $this->join($def->directives, ' ')], ' '); - }), - - NodeKind::INPUT_OBJECT_TYPE_DEFINITION => $this->addDescription(function ( - InputObjectTypeDefinitionNode $def - ) : string { - return $this->join( - [ - 'input', - $def->name, - $this->join($def->directives, ' '), - $this->block($def->fields), - ], - ' ' - ); - }), - - NodeKind::SCHEMA_EXTENSION => function (SchemaTypeExtensionNode $def) : string { - return $this->join( - [ - 'extend schema', - $this->join($def->directives, ' '), - $this->block($def->operationTypes), - ], - ' ' - ); - }, - - NodeKind::SCALAR_TYPE_EXTENSION => function (ScalarTypeExtensionNode $def) : string { - return $this->join( - [ - 'extend scalar', - $def->name, - $this->join($def->directives, ' '), - ], - ' ' - ); - }, - - NodeKind::OBJECT_TYPE_EXTENSION => function (ObjectTypeExtensionNode $def) : string { - return $this->join( - [ - 'extend type', - $def->name, - $this->wrap('implements ', $this->join($def->interfaces, ' & ')), - $this->join($def->directives, ' '), - $this->block($def->fields), - ], - ' ' - ); - }, - - NodeKind::INTERFACE_TYPE_EXTENSION => function (InterfaceTypeExtensionNode $def) : string { - return $this->join( - [ - 'extend interface', - $def->name, - $this->wrap('implements ', $this->join($def->interfaces, ' & ')), - $this->join($def->directives, ' '), - $this->block($def->fields), - ], - ' ' - ); - }, - - NodeKind::UNION_TYPE_EXTENSION => function (UnionTypeExtensionNode $def) : string { - return $this->join( - [ - 'extend union', - $def->name, - $this->join($def->directives, ' '), - count($def->types ?? []) > 0 - ? '= ' . $this->join($def->types, ' | ') - : '', - ], - ' ' - ); - }, - - NodeKind::ENUM_TYPE_EXTENSION => function (EnumTypeExtensionNode $def) : string { - return $this->join( - [ - 'extend enum', - $def->name, - $this->join($def->directives, ' '), - $this->block($def->values), - ], - ' ' - ); - }, - - NodeKind::INPUT_OBJECT_TYPE_EXTENSION => function (InputObjectTypeExtensionNode $def) : string { - return $this->join( - [ - 'extend input', - $def->name, - $this->join($def->directives, ' '), - $this->block($def->fields), - ], - ' ' - ); - }, - - NodeKind::DIRECTIVE_DEFINITION => $this->addDescription(function (DirectiveDefinitionNode $def) : string { - $noIndent = Utils::every($def->arguments, static function (string $arg) : bool { - return strpos($arg, "\n") === false; - }); - - return 'directive @' - . $def->name - . ($noIndent - ? $this->wrap('(', $this->join($def->arguments, ', '), ')') - : $this->wrap("(\n", $this->indent($this->join($def->arguments, "\n")), "\n")) - . ($def->repeatable ? ' repeatable' : '') - . ' on ' . $this->join($def->locations, ' | '); - }), - ], - ] - ); - } - - public function addDescription(callable $cb) - { - return function ($node) use ($cb) : string { - return $this->join([$node->description, $cb($node)], "\n"); - }; - } - - /** - * If maybeString is not null or empty, then wrap with start and end, otherwise - * print an empty string. - */ - public function wrap($start, $maybeString, $end = '') - { - return $maybeString ? ($start . $maybeString . $end) : ''; - } - - /** - * Given array, print each item on its own line, wrapped in an - * indented "{ }" block. - */ - public function block($array) - { - return $array && $this->length($array) - ? "{\n" . $this->indent($this->join($array, "\n")) . "\n}" - : ''; - } - - public function indent($maybeString) - { - return $maybeString ? ' ' . str_replace("\n", "\n ", $maybeString) : ''; - } - - public function manyList($start, $list, $separator, $end) - { - return $this->length($list) === 0 ? null : ($start . $this->join($list, $separator) . $end); - } - - public function length($maybeArray) - { - return $maybeArray ? count($maybeArray) : 0; - } - - public function join($maybeArray, $separator = '') : string - { - return $maybeArray - ? implode( - $separator, - Utils::filter( - $maybeArray, - static function ($x) : bool { - return (bool) $x; - } - ) - ) - : ''; - } - - /** - * Print a block string in the indented block form by adding a leading and - * trailing blank line. However, if a block string starts with whitespace and is - * a single-line, adding a leading blank line would strip that whitespace. - */ - private function printBlockString($value, $isDescription) - { - $escaped = str_replace('"""', '\\"""', $value); - - return ($value[0] === ' ' || $value[0] === "\t") && strpos($value, "\n") === false - ? ('"""' . preg_replace('/"$/', "\"\n", $escaped) . '"""') - : ('"""' . "\n" . ($isDescription ? $escaped : $this->indent($escaped)) . "\n" . '"""'); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Source.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Source.php deleted file mode 100644 index bd879407..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Source.php +++ /dev/null @@ -1,85 +0,0 @@ -body = $body; - $this->length = mb_strlen($body, 'UTF-8'); - $this->name = $name === '' || $name === null ? 'GraphQL request' : $name; - $this->locationOffset = $location ?? new SourceLocation(1, 1); - - Utils::invariant( - $this->locationOffset->line > 0, - 'line in locationOffset is 1-indexed and must be positive' - ); - Utils::invariant( - $this->locationOffset->column > 0, - 'column in locationOffset is 1-indexed and must be positive' - ); - } - - /** - * @param int $position - * - * @return SourceLocation - */ - public function getLocation($position) - { - $line = 1; - $column = $position + 1; - - $utfChars = json_decode('"\u2028\u2029"'); - $lineRegexp = '/\r\n|[\n\r' . $utfChars . ']/su'; - $matches = []; - preg_match_all($lineRegexp, mb_substr($this->body, 0, $position, 'UTF-8'), $matches, PREG_OFFSET_CAPTURE); - - foreach ($matches[0] as $index => $match) { - $line += 1; - - $column = $position + 1 - ($match[1] + mb_strlen($match[0], 'UTF-8')); - } - - return new SourceLocation($line, $column); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/SourceLocation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/SourceLocation.php deleted file mode 100644 index d0041831..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/SourceLocation.php +++ /dev/null @@ -1,55 +0,0 @@ -line = $line; - $this->column = $col; - } - - /** - * @return int[] - */ - public function toArray() - { - return [ - 'line' => $this->line, - 'column' => $this->column, - ]; - } - - /** - * @return int[] - */ - public function toSerializableArray() - { - return $this->toArray(); - } - - /** - * @return int[] - */ - #[ReturnTypeWillChange] - public function jsonSerialize() - { - return $this->toSerializableArray(); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Token.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Token.php deleted file mode 100644 index 1618103d..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Token.php +++ /dev/null @@ -1,119 +0,0 @@ -'; - public const EOF = ''; - public const BANG = '!'; - public const DOLLAR = '$'; - public const AMP = '&'; - public const PAREN_L = '('; - public const PAREN_R = ')'; - public const SPREAD = '...'; - public const COLON = ':'; - public const EQUALS = '='; - public const AT = '@'; - public const BRACKET_L = '['; - public const BRACKET_R = ']'; - public const BRACE_L = '{'; - public const PIPE = '|'; - public const BRACE_R = '}'; - public const NAME = 'Name'; - public const INT = 'Int'; - public const FLOAT = 'Float'; - public const STRING = 'String'; - public const BLOCK_STRING = 'BlockString'; - public const COMMENT = 'Comment'; - - /** - * The kind of Token (see one of constants above). - * - * @var string - */ - public $kind; - - /** - * The character offset at which this Node begins. - * - * @var int - */ - public $start; - - /** - * The character offset at which this Node ends. - * - * @var int - */ - public $end; - - /** - * The 1-indexed line number on which this Token appears. - * - * @var int - */ - public $line; - - /** - * The 1-indexed column number at which this Token begins. - * - * @var int - */ - public $column; - - /** @var string|null */ - public $value; - - /** - * Tokens exist as nodes in a double-linked-list amongst all tokens - * including ignored tokens. is always the first node and - * the last. - * - * @var Token - */ - public $prev; - - /** @var Token|null */ - public $next; - - /** - * @param mixed $value - */ - public function __construct(string $kind, int $start, int $end, int $line, int $column, ?Token $previous = null, $value = null) - { - $this->kind = $kind; - $this->start = $start; - $this->end = $end; - $this->line = $line; - $this->column = $column; - $this->prev = $previous; - $this->next = null; - $this->value = $value; - } - - public function getDescription() : string - { - return $this->kind . ($this->value === null ? '' : ' "' . $this->value . '"'); - } - - /** - * @return (string|int|null)[] - */ - public function toArray() : array - { - return [ - 'kind' => $this->kind, - 'value' => $this->value, - 'line' => $this->line, - 'column' => $this->column, - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Visitor.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Visitor.php deleted file mode 100644 index 95031e8a..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/Visitor.php +++ /dev/null @@ -1,538 +0,0 @@ - function ($node, $key, $parent, $path, $ancestors) { - * // return - * // null: no action - * // Visitor::skipNode(): skip visiting this node - * // Visitor::stop(): stop visiting altogether - * // Visitor::removeNode(): delete this node - * // any value: replace this node with the returned value - * }, - * 'leave' => function ($node, $key, $parent, $path, $ancestors) { - * // return - * // null: no action - * // Visitor::stop(): stop visiting altogether - * // Visitor::removeNode(): delete this node - * // any value: replace this node with the returned value - * } - * ]); - * - * Alternatively to providing enter() and leave() functions, a visitor can - * instead provide functions named the same as the [kinds of AST nodes](reference.md#graphqllanguageastnodekind), - * or enter/leave visitors at a named key, leading to four permutations of - * visitor API: - * - * 1) Named visitors triggered when entering a node a specific kind. - * - * Visitor::visit($ast, [ - * 'Kind' => function ($node) { - * // enter the "Kind" node - * } - * ]); - * - * 2) Named visitors that trigger upon entering and leaving a node of - * a specific kind. - * - * Visitor::visit($ast, [ - * 'Kind' => [ - * 'enter' => function ($node) { - * // enter the "Kind" node - * } - * 'leave' => function ($node) { - * // leave the "Kind" node - * } - * ] - * ]); - * - * 3) Generic visitors that trigger upon entering and leaving any node. - * - * Visitor::visit($ast, [ - * 'enter' => function ($node) { - * // enter any node - * }, - * 'leave' => function ($node) { - * // leave any node - * } - * ]); - * - * 4) Parallel visitors for entering and leaving nodes of a specific kind. - * - * Visitor::visit($ast, [ - * 'enter' => [ - * 'Kind' => function($node) { - * // enter the "Kind" node - * } - * }, - * 'leave' => [ - * 'Kind' => function ($node) { - * // leave the "Kind" node - * } - * ] - * ]); - */ -class Visitor -{ - /** @var string[][] */ - public static $visitorKeys = [ - NodeKind::NAME => [], - NodeKind::DOCUMENT => ['definitions'], - NodeKind::OPERATION_DEFINITION => ['name', 'variableDefinitions', 'directives', 'selectionSet'], - NodeKind::VARIABLE_DEFINITION => ['variable', 'type', 'defaultValue', 'directives'], - NodeKind::VARIABLE => ['name'], - NodeKind::SELECTION_SET => ['selections'], - NodeKind::FIELD => ['alias', 'name', 'arguments', 'directives', 'selectionSet'], - NodeKind::ARGUMENT => ['name', 'value'], - NodeKind::FRAGMENT_SPREAD => ['name', 'directives'], - NodeKind::INLINE_FRAGMENT => ['typeCondition', 'directives', 'selectionSet'], - NodeKind::FRAGMENT_DEFINITION => [ - 'name', - // Note: fragment variable definitions are experimental and may be changed - // or removed in the future. - 'variableDefinitions', - 'typeCondition', - 'directives', - 'selectionSet', - ], - - NodeKind::INT => [], - NodeKind::FLOAT => [], - NodeKind::STRING => [], - NodeKind::BOOLEAN => [], - NodeKind::NULL => [], - NodeKind::ENUM => [], - NodeKind::LST => ['values'], - NodeKind::OBJECT => ['fields'], - NodeKind::OBJECT_FIELD => ['name', 'value'], - NodeKind::DIRECTIVE => ['name', 'arguments'], - NodeKind::NAMED_TYPE => ['name'], - NodeKind::LIST_TYPE => ['type'], - NodeKind::NON_NULL_TYPE => ['type'], - - NodeKind::SCHEMA_DEFINITION => ['directives', 'operationTypes'], - NodeKind::OPERATION_TYPE_DEFINITION => ['type'], - NodeKind::SCALAR_TYPE_DEFINITION => ['description', 'name', 'directives'], - NodeKind::OBJECT_TYPE_DEFINITION => ['description', 'name', 'interfaces', 'directives', 'fields'], - NodeKind::FIELD_DEFINITION => ['description', 'name', 'arguments', 'type', 'directives'], - NodeKind::INPUT_VALUE_DEFINITION => ['description', 'name', 'type', 'defaultValue', 'directives'], - NodeKind::INTERFACE_TYPE_DEFINITION => ['description', 'name', 'interfaces', 'directives', 'fields'], - NodeKind::UNION_TYPE_DEFINITION => ['description', 'name', 'directives', 'types'], - NodeKind::ENUM_TYPE_DEFINITION => ['description', 'name', 'directives', 'values'], - NodeKind::ENUM_VALUE_DEFINITION => ['description', 'name', 'directives'], - NodeKind::INPUT_OBJECT_TYPE_DEFINITION => ['description', 'name', 'directives', 'fields'], - - NodeKind::SCALAR_TYPE_EXTENSION => ['name', 'directives'], - NodeKind::OBJECT_TYPE_EXTENSION => ['name', 'interfaces', 'directives', 'fields'], - NodeKind::INTERFACE_TYPE_EXTENSION => ['name', 'interfaces', 'directives', 'fields'], - NodeKind::UNION_TYPE_EXTENSION => ['name', 'directives', 'types'], - NodeKind::ENUM_TYPE_EXTENSION => ['name', 'directives', 'values'], - NodeKind::INPUT_OBJECT_TYPE_EXTENSION => ['name', 'directives', 'fields'], - - NodeKind::DIRECTIVE_DEFINITION => ['description', 'name', 'arguments', 'locations'], - - NodeKind::SCHEMA_EXTENSION => ['directives', 'operationTypes'], - ]; - - /** - * Visit the AST (see class description for details) - * - * @param Node|ArrayObject|stdClass $root - * @param callable[] $visitor - * @param mixed[]|null $keyMap - * - * @return Node|mixed - * - * @throws Exception - * - * @api - */ - public static function visit($root, $visitor, $keyMap = null) - { - $visitorKeys = $keyMap ?? self::$visitorKeys; - - $stack = null; - $inArray = $root instanceof NodeList || is_array($root); - $keys = [$root]; - $index = -1; - $edits = []; - $parent = null; - $path = []; - $ancestors = []; - $newRoot = $root; - - $UNDEFINED = null; - - do { - $index++; - $isLeaving = $index === count($keys); - $key = null; - $node = null; - $isEdited = $isLeaving && count($edits) > 0; - - if ($isLeaving) { - $key = ! $ancestors ? $UNDEFINED : $path[count($path) - 1]; - $node = $parent; - $parent = array_pop($ancestors); - - if ($isEdited) { - if ($inArray) { - // $node = $node; // arrays are value types in PHP - if ($node instanceof NodeList) { - $node = clone $node; - } - } else { - $node = clone $node; - } - $editOffset = 0; - for ($ii = 0; $ii < count($edits); $ii++) { - $editKey = $edits[$ii][0]; - $editValue = $edits[$ii][1]; - - if ($inArray) { - $editKey -= $editOffset; - } - if ($inArray && $editValue === null) { - $node->splice($editKey, 1); - $editOffset++; - } else { - if ($node instanceof NodeList || is_array($node)) { - $node[$editKey] = $editValue; - } else { - $node->{$editKey} = $editValue; - } - } - } - } - $index = $stack['index']; - $keys = $stack['keys']; - $edits = $stack['edits']; - $inArray = $stack['inArray']; - $stack = $stack['prev']; - } else { - $key = $parent !== null - ? ($inArray - ? $index - : $keys[$index] - ) - : $UNDEFINED; - $node = $parent !== null - ? ($parent instanceof NodeList || is_array($parent) - ? $parent[$key] - : $parent->{$key} - ) - : $newRoot; - if ($node === null || $node === $UNDEFINED) { - continue; - } - if ($parent !== null) { - $path[] = $key; - } - } - - $result = null; - if (! $node instanceof NodeList && ! is_array($node)) { - if (! ($node instanceof Node)) { - throw new Exception('Invalid AST Node: ' . json_encode($node)); - } - - $visitFn = self::getVisitFn($visitor, $node->kind, $isLeaving); - - if ($visitFn !== null) { - $result = $visitFn($node, $key, $parent, $path, $ancestors); - $editValue = null; - - if ($result !== null) { - if ($result instanceof VisitorOperation) { - if ($result->doBreak) { - break; - } - if (! $isLeaving && $result->doContinue) { - array_pop($path); - continue; - } - if ($result->removeNode) { - $editValue = null; - } - } else { - $editValue = $result; - } - - $edits[] = [$key, $editValue]; - if (! $isLeaving) { - if (! ($editValue instanceof Node)) { - array_pop($path); - continue; - } - - $node = $editValue; - } - } - } - } - - if ($result === null && $isEdited) { - $edits[] = [$key, $node]; - } - - if ($isLeaving) { - array_pop($path); - } else { - $stack = [ - 'inArray' => $inArray, - 'index' => $index, - 'keys' => $keys, - 'edits' => $edits, - 'prev' => $stack, - ]; - $inArray = $node instanceof NodeList || is_array($node); - - $keys = ($inArray ? $node : $visitorKeys[$node->kind]) ?? []; - $index = -1; - $edits = []; - if ($parent !== null) { - $ancestors[] = $parent; - } - $parent = $node; - } - } while ($stack); - - if (count($edits) > 0) { - $newRoot = $edits[0][1]; - } - - return $newRoot; - } - - /** - * Returns marker for visitor break - * - * @return VisitorOperation - * - * @api - */ - public static function stop() - { - $r = new VisitorOperation(); - $r->doBreak = true; - - return $r; - } - - /** - * Returns marker for skipping current node - * - * @return VisitorOperation - * - * @api - */ - public static function skipNode() - { - $r = new VisitorOperation(); - $r->doContinue = true; - - return $r; - } - - /** - * Returns marker for removing a node - * - * @return VisitorOperation - * - * @api - */ - public static function removeNode() - { - $r = new VisitorOperation(); - $r->removeNode = true; - - return $r; - } - - /** - * @param callable[][] $visitors - * - * @return array - */ - public static function visitInParallel($visitors) - { - $visitorsCount = count($visitors); - $skipping = new SplFixedArray($visitorsCount); - - return [ - 'enter' => static function (Node $node) use ($visitors, $skipping, $visitorsCount) { - for ($i = 0; $i < $visitorsCount; $i++) { - if ($skipping[$i] !== null) { - continue; - } - - $fn = self::getVisitFn( - $visitors[$i], - $node->kind, /* isLeaving */ - false - ); - - if (! $fn) { - continue; - } - - $result = $fn(...func_get_args()); - - if ($result instanceof VisitorOperation) { - if ($result->doContinue) { - $skipping[$i] = $node; - } elseif ($result->doBreak) { - $skipping[$i] = $result; - } elseif ($result->removeNode) { - return $result; - } - } elseif ($result !== null) { - return $result; - } - } - }, - 'leave' => static function (Node $node) use ($visitors, $skipping, $visitorsCount) { - for ($i = 0; $i < $visitorsCount; $i++) { - if ($skipping[$i] === null) { - $fn = self::getVisitFn( - $visitors[$i], - $node->kind, /* isLeaving */ - true - ); - - if (isset($fn)) { - $result = $fn(...func_get_args()); - if ($result instanceof VisitorOperation) { - if ($result->doBreak) { - $skipping[$i] = $result; - } elseif ($result->removeNode) { - return $result; - } - } elseif ($result !== null) { - return $result; - } - } - } elseif ($skipping[$i] === $node) { - $skipping[$i] = null; - } - } - }, - ]; - } - - /** - * Creates a new visitor instance which maintains a provided TypeInfo instance - * along with visiting visitor. - */ - public static function visitWithTypeInfo(TypeInfo $typeInfo, $visitor) - { - return [ - 'enter' => static function (Node $node) use ($typeInfo, $visitor) { - $typeInfo->enter($node); - $fn = self::getVisitFn($visitor, $node->kind, false); - - if (isset($fn)) { - $result = $fn(...func_get_args()); - if ($result !== null) { - $typeInfo->leave($node); - if ($result instanceof Node) { - $typeInfo->enter($result); - } - } - - return $result; - } - - return null; - }, - 'leave' => static function (Node $node) use ($typeInfo, $visitor) { - $fn = self::getVisitFn($visitor, $node->kind, true); - $result = $fn !== null - ? $fn(...func_get_args()) - : null; - - $typeInfo->leave($node); - - return $result; - }, - ]; - } - - /** - * @param callable[]|null $visitor - * @param string $kind - * @param bool $isLeaving - */ - public static function getVisitFn($visitor, $kind, $isLeaving) : ?callable - { - if ($visitor === null) { - return null; - } - - $kindVisitor = $visitor[$kind] ?? null; - - if (is_array($kindVisitor)) { - if ($isLeaving) { - $kindSpecificVisitor = $kindVisitor['leave'] ?? null; - } else { - $kindSpecificVisitor = $kindVisitor['enter'] ?? null; - } - - return $kindSpecificVisitor; - } - - if ($kindVisitor !== null && ! $isLeaving) { - return $kindVisitor; - } - - $visitor += ['leave' => null, 'enter' => null]; - - $specificVisitor = $isLeaving ? $visitor['leave'] : $visitor['enter']; - - if (isset($specificVisitor)) { - if (! is_array($specificVisitor)) { - // { enter() {}, leave() {} } - return $specificVisitor; - } - - return $specificVisitor[$kind] ?? null; - } - - return null; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/VisitorOperation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/VisitorOperation.php deleted file mode 100644 index 23162616..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Language/VisitorOperation.php +++ /dev/null @@ -1,17 +0,0 @@ -readRawBody(); - $bodyParams = ['query' => $rawBody ?? '']; - } elseif (stripos($contentType, 'application/json') !== false) { - $rawBody = $readRawBodyFn ? - $readRawBodyFn() - : $this->readRawBody(); - $bodyParams = json_decode($rawBody ?? '', true); - - if (json_last_error()) { - throw new RequestError('Could not parse JSON: ' . json_last_error_msg()); - } - - if (! is_array($bodyParams)) { - throw new RequestError( - 'GraphQL Server expects JSON object or array, but got ' . - Utils::printSafeJson($bodyParams) - ); - } - } elseif (stripos($contentType, 'application/x-www-form-urlencoded') !== false) { - $bodyParams = $_POST; - } elseif (stripos($contentType, 'multipart/form-data') !== false) { - $bodyParams = $_POST; - } else { - throw new RequestError('Unexpected content type: ' . Utils::printSafeJson($contentType)); - } - } - - return $this->parseRequestParams($method, $bodyParams, $urlParams); - } - - /** - * Parses normalized request params and returns instance of OperationParams - * or array of OperationParams in case of batch operation. - * - * Returned value is a suitable input for `executeOperation` or `executeBatch` (if array) - * - * @param string $method - * @param mixed[] $bodyParams - * @param mixed[] $queryParams - * - * @return OperationParams|OperationParams[] - * - * @throws RequestError - * - * @api - */ - public function parseRequestParams($method, array $bodyParams, array $queryParams) - { - if ($method === 'GET') { - $result = OperationParams::create($queryParams, true); - } elseif ($method === 'POST') { - if (isset($bodyParams[0])) { - $result = []; - foreach ($bodyParams as $index => $entry) { - $op = OperationParams::create($entry); - $result[] = $op; - } - } else { - $result = OperationParams::create($bodyParams); - } - } else { - throw new RequestError('HTTP Method "' . $method . '" is not supported'); - } - - return $result; - } - - /** - * Checks validity of OperationParams extracted from HTTP request and returns an array of errors - * if params are invalid (or empty array when params are valid) - * - * @return array - * - * @api - */ - public function validateOperationParams(OperationParams $params) - { - $errors = []; - if (! $params->query && ! $params->queryId) { - $errors[] = new RequestError('GraphQL Request must include at least one of those two parameters: "query" or "queryId"'); - } - - if ($params->query && $params->queryId) { - $errors[] = new RequestError('GraphQL Request parameters "query" and "queryId" are mutually exclusive'); - } - - if ($params->query !== null && ! is_string($params->query)) { - $errors[] = new RequestError( - 'GraphQL Request parameter "query" must be string, but got ' . - Utils::printSafeJson($params->query) - ); - } - - if ($params->queryId !== null && ! is_string($params->queryId)) { - $errors[] = new RequestError( - 'GraphQL Request parameter "queryId" must be string, but got ' . - Utils::printSafeJson($params->queryId) - ); - } - - if ($params->operation !== null && ! is_string($params->operation)) { - $errors[] = new RequestError( - 'GraphQL Request parameter "operation" must be string, but got ' . - Utils::printSafeJson($params->operation) - ); - } - - if ($params->variables !== null && (! is_array($params->variables) || isset($params->variables[0]))) { - $errors[] = new RequestError( - 'GraphQL Request parameter "variables" must be object or JSON string parsed to object, but got ' . - Utils::printSafeJson($params->getOriginalInput('variables')) - ); - } - - return $errors; - } - - /** - * Executes GraphQL operation with given server configuration and returns execution result - * (or promise when promise adapter is different from SyncPromiseAdapter) - * - * @return ExecutionResult|Promise - * - * @api - */ - public function executeOperation(ServerConfig $config, OperationParams $op) - { - $promiseAdapter = $config->getPromiseAdapter() ?? Executor::getPromiseAdapter(); - $result = $this->promiseToExecuteOperation($promiseAdapter, $config, $op); - - if ($promiseAdapter instanceof SyncPromiseAdapter) { - $result = $promiseAdapter->wait($result); - } - - return $result; - } - - /** - * Executes batched GraphQL operations with shared promise queue - * (thus, effectively batching deferreds|promises of all queries at once) - * - * @param OperationParams[] $operations - * - * @return ExecutionResult|ExecutionResult[]|Promise - * - * @api - */ - public function executeBatch(ServerConfig $config, array $operations) - { - $promiseAdapter = $config->getPromiseAdapter() ?? Executor::getPromiseAdapter(); - $result = []; - - foreach ($operations as $operation) { - $result[] = $this->promiseToExecuteOperation($promiseAdapter, $config, $operation, true); - } - - $result = $promiseAdapter->all($result); - - // Wait for promised results when using sync promises - if ($promiseAdapter instanceof SyncPromiseAdapter) { - $result = $promiseAdapter->wait($result); - } - - return $result; - } - - /** - * @param bool $isBatch - * - * @return Promise - */ - private function promiseToExecuteOperation( - PromiseAdapter $promiseAdapter, - ServerConfig $config, - OperationParams $op, - $isBatch = false - ) { - try { - if ($config->getSchema() === null) { - throw new InvariantViolation('Schema is required for the server'); - } - - if ($isBatch && ! $config->getQueryBatching()) { - throw new RequestError('Batched queries are not supported by this server'); - } - - $errors = $this->validateOperationParams($op); - - if (count($errors) > 0) { - $errors = Utils::map( - $errors, - static function (RequestError $err) : Error { - return Error::createLocatedError($err, null, null); - } - ); - - return $promiseAdapter->createFulfilled( - new ExecutionResult(null, $errors) - ); - } - - $doc = $op->queryId - ? $this->loadPersistedQuery($config, $op) - : $op->query; - - if (! $doc instanceof DocumentNode) { - $doc = Parser::parse($doc); - } - - $operationType = AST::getOperation($doc, $op->operation); - - if ($operationType === false) { - throw new RequestError('Failed to determine operation type'); - } - - if ($operationType !== 'query' && $op->isReadOnly()) { - throw new RequestError('GET supports only query operation'); - } - - $result = GraphQL::promiseToExecute( - $promiseAdapter, - $config->getSchema(), - $doc, - $this->resolveRootValue($config, $op, $doc, $operationType), - $this->resolveContextValue($config, $op, $doc, $operationType), - $op->variables, - $op->operation, - $config->getFieldResolver(), - $this->resolveValidationRules($config, $op, $doc, $operationType) - ); - } catch (RequestError $e) { - $result = $promiseAdapter->createFulfilled( - new ExecutionResult(null, [Error::createLocatedError($e)]) - ); - } catch (Error $e) { - $result = $promiseAdapter->createFulfilled( - new ExecutionResult(null, [$e]) - ); - } - - $applyErrorHandling = static function (ExecutionResult $result) use ($config) : ExecutionResult { - if ($config->getErrorsHandler()) { - $result->setErrorsHandler($config->getErrorsHandler()); - } - if ($config->getErrorFormatter() || $config->getDebugFlag() !== DebugFlag::NONE) { - $result->setErrorFormatter( - FormattedError::prepareFormatter( - $config->getErrorFormatter(), - $config->getDebugFlag() - ) - ); - } - - return $result; - }; - - return $result->then($applyErrorHandling); - } - - /** - * @return mixed - * - * @throws RequestError - */ - private function loadPersistedQuery(ServerConfig $config, OperationParams $operationParams) - { - // Load query if we got persisted query id: - $loader = $config->getPersistentQueryLoader(); - - if ($loader === null) { - throw new RequestError('Persisted queries are not supported by this server'); - } - - $source = $loader($operationParams->queryId, $operationParams); - - if (! is_string($source) && ! $source instanceof DocumentNode) { - throw new InvariantViolation(sprintf( - 'Persistent query loader must return query string or instance of %s but got: %s', - DocumentNode::class, - Utils::printSafe($source) - )); - } - - return $source; - } - - /** - * @param string $operationType - * - * @return mixed[]|null - */ - private function resolveValidationRules( - ServerConfig $config, - OperationParams $params, - DocumentNode $doc, - $operationType - ) { - // Allow customizing validation rules per operation: - $validationRules = $config->getValidationRules(); - - if (is_callable($validationRules)) { - $validationRules = $validationRules($params, $doc, $operationType); - - if (! is_array($validationRules)) { - throw new InvariantViolation(sprintf( - 'Expecting validation rules to be array or callable returning array, but got: %s', - Utils::printSafe($validationRules) - )); - } - } - - return $validationRules; - } - - /** - * @return mixed - */ - private function resolveRootValue(ServerConfig $config, OperationParams $params, DocumentNode $doc, string $operationType) - { - $rootValue = $config->getRootValue(); - - if (is_callable($rootValue)) { - $rootValue = $rootValue($params, $doc, $operationType); - } - - return $rootValue; - } - - /** - * @param string $operationType - * - * @return mixed - */ - private function resolveContextValue( - ServerConfig $config, - OperationParams $params, - DocumentNode $doc, - $operationType - ) { - $context = $config->getContext(); - - if (is_callable($context)) { - $context = $context($params, $doc, $operationType); - } - - return $context; - } - - /** - * Send response using standard PHP `header()` and `echo`. - * - * @param Promise|ExecutionResult|ExecutionResult[] $result - * @param bool $exitWhenDone - * - * @api - */ - public function sendResponse($result, $exitWhenDone = false) - { - if ($result instanceof Promise) { - $result->then(function ($actualResult) use ($exitWhenDone) : void { - $this->doSendResponse($actualResult, $exitWhenDone); - }); - } else { - $this->doSendResponse($result, $exitWhenDone); - } - } - - private function doSendResponse($result, $exitWhenDone) - { - $httpStatus = $this->resolveHttpStatus($result); - $this->emitResponse($result, $httpStatus, $exitWhenDone); - } - - /** - * @param mixed[]|JsonSerializable $jsonSerializable - * @param int $httpStatus - * @param bool $exitWhenDone - */ - public function emitResponse($jsonSerializable, $httpStatus, $exitWhenDone) - { - $body = json_encode($jsonSerializable); - header('Content-Type: application/json', true, $httpStatus); - echo $body; - - if ($exitWhenDone) { - exit; - } - } - - /** - * @return bool|string - */ - private function readRawBody() - { - return file_get_contents('php://input'); - } - - /** - * @param ExecutionResult|mixed[] $result - * - * @return int - */ - private function resolveHttpStatus($result) - { - if (is_array($result) && isset($result[0])) { - Utils::each( - $result, - static function ($executionResult, $index) : void { - if (! $executionResult instanceof ExecutionResult) { - throw new InvariantViolation(sprintf( - 'Expecting every entry of batched query result to be instance of %s but entry at position %d is %s', - ExecutionResult::class, - $index, - Utils::printSafe($executionResult) - )); - } - } - ); - $httpStatus = 200; - } else { - if (! $result instanceof ExecutionResult) { - throw new InvariantViolation(sprintf( - 'Expecting query result to be instance of %s but got %s', - ExecutionResult::class, - Utils::printSafe($result) - )); - } - if ($result->data === null && count($result->errors) > 0) { - $httpStatus = 400; - } else { - $httpStatus = 200; - } - } - - return $httpStatus; - } - - /** - * Converts PSR-7 request to OperationParams[] - * - * @return OperationParams[]|OperationParams - * - * @throws RequestError - * - * @api - */ - public function parsePsrRequest(RequestInterface $request) - { - if ($request->getMethod() === 'GET') { - $bodyParams = []; - } else { - $contentType = $request->getHeader('content-type'); - - if (! isset($contentType[0])) { - throw new RequestError('Missing "Content-Type" header'); - } - - if (stripos($contentType[0], 'application/graphql') !== false) { - $bodyParams = ['query' => (string) $request->getBody()]; - } elseif (stripos($contentType[0], 'application/json') !== false) { - $bodyParams = $request instanceof ServerRequestInterface - ? $request->getParsedBody() - : json_decode((string) $request->getBody(), true); - - if ($bodyParams === null) { - throw new InvariantViolation( - $request instanceof ServerRequestInterface - ? 'Expected to receive a parsed body for "application/json" PSR-7 request but got null' - : 'Expected to receive a JSON array in body for "application/json" PSR-7 request' - ); - } - - if (! is_array($bodyParams)) { - throw new RequestError( - 'GraphQL Server expects JSON object or array, but got ' . - Utils::printSafeJson($bodyParams) - ); - } - } else { - if ($request instanceof ServerRequestInterface) { - $bodyParams = $request->getParsedBody(); - } - - if (! isset($bodyParams)) { - $bodyParams = $this->decodeContent((string) $request->getBody(), $contentType[0]); - } - } - } - - parse_str(html_entity_decode($request->getUri()->getQuery()), $queryParams); - - return $this->parseRequestParams( - $request->getMethod(), - $bodyParams, - $queryParams - ); - } - - /** - * @return array - * - * @throws RequestError - */ - protected function decodeContent(string $rawBody, string $contentType) : array - { - parse_str($rawBody, $bodyParams); - - if (! is_array($bodyParams)) { - throw new RequestError('Unexpected content type: ' . Utils::printSafeJson($contentType)); - } - - return $bodyParams; - } - - /** - * Converts query execution result to PSR-7 response - * - * @param Promise|ExecutionResult|ExecutionResult[] $result - * - * @return Promise|ResponseInterface - * - * @api - */ - public function toPsrResponse($result, ResponseInterface $response, StreamInterface $writableBodyStream) - { - if ($result instanceof Promise) { - return $result->then(function ($actualResult) use ($response, $writableBodyStream) { - return $this->doConvertToPsrResponse($actualResult, $response, $writableBodyStream); - }); - } - - return $this->doConvertToPsrResponse($result, $response, $writableBodyStream); - } - - private function doConvertToPsrResponse($result, ResponseInterface $response, StreamInterface $writableBodyStream) - { - $httpStatus = $this->resolveHttpStatus($result); - - $result = json_encode($result); - $writableBodyStream->write($result); - - return $response - ->withStatus($httpStatus) - ->withHeader('Content-Type', 'application/json') - ->withBody($writableBodyStream); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/OperationParams.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/OperationParams.php deleted file mode 100644 index 5490ca41..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/OperationParams.php +++ /dev/null @@ -1,144 +0,0 @@ -originalInput = $params; - - $params += [ - 'query' => null, - 'queryid' => null, - 'documentid' => null, // alias to queryid - 'id' => null, // alias to queryid - 'operationname' => null, - 'variables' => null, - 'extensions' => null, - ]; - - if ($params['variables'] === '') { - $params['variables'] = null; - } - - // Some parameters could be provided as serialized JSON. - foreach (['extensions', 'variables'] as $param) { - if (! is_string($params[$param])) { - continue; - } - - $tmp = json_decode($params[$param], true); - if (json_last_error() !== JSON_ERROR_NONE) { - continue; - } - - $params[$param] = $tmp; - } - - $instance->query = $params['query']; - $instance->queryId = $params['queryid'] ?? $params['documentid'] ?? $params['id']; - $instance->operation = $params['operationname']; - $instance->variables = $params['variables']; - $instance->extensions = $params['extensions']; - $instance->readOnly = $readonly; - - // Apollo server/client compatibility: look for the queryid in extensions - if (isset($instance->extensions['persistedQuery']['sha256Hash']) && strlen($instance->query ?? '') === 0 && strlen($instance->queryId ?? '') === 0) { - $instance->queryId = $instance->extensions['persistedQuery']['sha256Hash']; - } - - return $instance; - } - - /** - * @param string $key - * - * @return mixed - * - * @api - */ - public function getOriginalInput($key) - { - return $this->originalInput[$key] ?? null; - } - - /** - * Indicates that operation is executed in read-only context - * (e.g. via HTTP GET request) - * - * @return bool - * - * @api - */ - public function isReadOnly() - { - return $this->readOnly; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/RequestError.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/RequestError.php deleted file mode 100644 index 320aad47..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/RequestError.php +++ /dev/null @@ -1,33 +0,0 @@ -setSchema($mySchema) - * ->setContext($myContext); - * - * $server = new GraphQL\Server\StandardServer($config); - */ -class ServerConfig -{ - /** - * Converts an array of options to instance of ServerConfig - * (or just returns empty config when array is not passed). - * - * @param mixed[] $config - * - * @return ServerConfig - * - * @api - */ - public static function create(array $config = []) - { - $instance = new static(); - foreach ($config as $key => $value) { - $method = 'set' . ucfirst($key); - if (! method_exists($instance, $method)) { - throw new InvariantViolation(sprintf('Unknown server config option "%s"', $key)); - } - $instance->$method($value); - } - - return $instance; - } - - /** @var Schema|null */ - private $schema; - - /** @var mixed|callable */ - private $context; - - /** @var mixed|callable */ - private $rootValue; - - /** @var callable|null */ - private $errorFormatter; - - /** @var callable|null */ - private $errorsHandler; - - /** @var int */ - private $debugFlag = DebugFlag::NONE; - - /** @var bool */ - private $queryBatching = false; - - /** @var ValidationRule[]|callable|null */ - private $validationRules; - - /** @var callable|null */ - private $fieldResolver; - - /** @var PromiseAdapter|null */ - private $promiseAdapter; - - /** @var callable|null */ - private $persistentQueryLoader; - - /** - * @return self - * - * @api - */ - public function setSchema(Schema $schema) - { - $this->schema = $schema; - - return $this; - } - - /** - * @param mixed|callable $context - * - * @return self - * - * @api - */ - public function setContext($context) - { - $this->context = $context; - - return $this; - } - - /** - * @param mixed|callable $rootValue - * - * @return self - * - * @api - */ - public function setRootValue($rootValue) - { - $this->rootValue = $rootValue; - - return $this; - } - - /** - * Expects function(Throwable $e) : array - * - * @return self - * - * @api - */ - public function setErrorFormatter(callable $errorFormatter) - { - $this->errorFormatter = $errorFormatter; - - return $this; - } - - /** - * Expects function(array $errors, callable $formatter) : array - * - * @return self - * - * @api - */ - public function setErrorsHandler(callable $handler) - { - $this->errorsHandler = $handler; - - return $this; - } - - /** - * Set validation rules for this server. - * - * @param ValidationRule[]|callable|null $validationRules - * - * @return self - * - * @api - */ - public function setValidationRules($validationRules) - { - if (! is_callable($validationRules) && ! is_array($validationRules) && $validationRules !== null) { - throw new InvariantViolation( - 'Server config expects array of validation rules or callable returning such array, but got ' . - Utils::printSafe($validationRules) - ); - } - - $this->validationRules = $validationRules; - - return $this; - } - - /** - * @return self - * - * @api - */ - public function setFieldResolver(callable $fieldResolver) - { - $this->fieldResolver = $fieldResolver; - - return $this; - } - - /** - * Expects function($queryId, OperationParams $params) : string|DocumentNode - * - * This function must return query string or valid DocumentNode. - * - * @return self - * - * @api - */ - public function setPersistentQueryLoader(callable $persistentQueryLoader) - { - $this->persistentQueryLoader = $persistentQueryLoader; - - return $this; - } - - /** - * Set response debug flags. @see \GraphQL\Error\DebugFlag class for a list of all available flags - * - * @api - */ - public function setDebugFlag(int $debugFlag = DebugFlag::INCLUDE_DEBUG_MESSAGE) : self - { - $this->debugFlag = $debugFlag; - - return $this; - } - - /** - * Allow batching queries (disabled by default) - * - * @api - */ - public function setQueryBatching(bool $enableBatching) : self - { - $this->queryBatching = $enableBatching; - - return $this; - } - - /** - * @return self - * - * @api - */ - public function setPromiseAdapter(PromiseAdapter $promiseAdapter) - { - $this->promiseAdapter = $promiseAdapter; - - return $this; - } - - /** - * @return mixed|callable - */ - public function getContext() - { - return $this->context; - } - - /** - * @return mixed|callable - */ - public function getRootValue() - { - return $this->rootValue; - } - - /** - * @return Schema|null - */ - public function getSchema() - { - return $this->schema; - } - - /** - * @return callable|null - */ - public function getErrorFormatter() - { - return $this->errorFormatter; - } - - /** - * @return callable|null - */ - public function getErrorsHandler() - { - return $this->errorsHandler; - } - - /** - * @return PromiseAdapter|null - */ - public function getPromiseAdapter() - { - return $this->promiseAdapter; - } - - /** - * @return ValidationRule[]|callable|null - */ - public function getValidationRules() - { - return $this->validationRules; - } - - /** - * @return callable|null - */ - public function getFieldResolver() - { - return $this->fieldResolver; - } - - /** - * @return callable|null - */ - public function getPersistentQueryLoader() - { - return $this->persistentQueryLoader; - } - - public function getDebugFlag() : int - { - return $this->debugFlag; - } - - /** - * @return bool - */ - public function getQueryBatching() - { - return $this->queryBatching; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/StandardServer.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/StandardServer.php deleted file mode 100644 index bb128ea9..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Server/StandardServer.php +++ /dev/null @@ -1,186 +0,0 @@ - $mySchema - * ]); - * $server->handleRequest(); - * - * Or using [ServerConfig](reference.md#graphqlserverserverconfig) instance: - * - * $config = GraphQL\Server\ServerConfig::create() - * ->setSchema($mySchema) - * ->setContext($myContext); - * - * $server = new GraphQL\Server\StandardServer($config); - * $server->handleRequest(); - * - * See [dedicated section in docs](executing-queries.md#using-server) for details. - */ -class StandardServer -{ - /** @var ServerConfig */ - private $config; - - /** @var Helper */ - private $helper; - - /** - * Converts and exception to error and sends spec-compliant HTTP 500 error. - * Useful when an exception is thrown somewhere outside of server execution context - * (e.g. during schema instantiation). - * - * @param Throwable $error - * @param int $debug - * @param bool $exitWhenDone - * - * @api - */ - public static function send500Error($error, $debug = DebugFlag::NONE, $exitWhenDone = false) - { - $response = [ - 'errors' => [FormattedError::createFromException($error, $debug)], - ]; - $helper = new Helper(); - $helper->emitResponse($response, 500, $exitWhenDone); - } - - /** - * Creates new instance of a standard GraphQL HTTP server - * - * @param ServerConfig|mixed[] $config - * - * @api - */ - public function __construct($config) - { - if (is_array($config)) { - $config = ServerConfig::create($config); - } - if (! $config instanceof ServerConfig) { - throw new InvariantViolation('Expecting valid server config, but got ' . Utils::printSafe($config)); - } - $this->config = $config; - $this->helper = new Helper(); - } - - /** - * Parses HTTP request, executes and emits response (using standard PHP `header` function and `echo`) - * - * By default (when $parsedBody is not set) it uses PHP globals to parse a request. - * It is possible to implement request parsing elsewhere (e.g. using framework Request instance) - * and then pass it to the server. - * - * See `executeRequest()` if you prefer to emit response yourself - * (e.g. using Response object of some framework) - * - * @param OperationParams|OperationParams[] $parsedBody - * @param bool $exitWhenDone - * - * @api - */ - public function handleRequest($parsedBody = null, $exitWhenDone = false) - { - $result = $this->executeRequest($parsedBody); - $this->helper->sendResponse($result, $exitWhenDone); - } - - /** - * Executes GraphQL operation and returns execution result - * (or promise when promise adapter is different from SyncPromiseAdapter). - * - * By default (when $parsedBody is not set) it uses PHP globals to parse a request. - * It is possible to implement request parsing elsewhere (e.g. using framework Request instance) - * and then pass it to the server. - * - * PSR-7 compatible method executePsrRequest() does exactly this. - * - * @param OperationParams|OperationParams[] $parsedBody - * - * @return ExecutionResult|ExecutionResult[]|Promise - * - * @throws InvariantViolation - * - * @api - */ - public function executeRequest($parsedBody = null) - { - if ($parsedBody === null) { - $parsedBody = $this->helper->parseHttpRequest(); - } - - if (is_array($parsedBody)) { - return $this->helper->executeBatch($this->config, $parsedBody); - } - - return $this->helper->executeOperation($this->config, $parsedBody); - } - - /** - * Executes PSR-7 request and fulfills PSR-7 response. - * - * See `executePsrRequest()` if you prefer to create response yourself - * (e.g. using specific JsonResponse instance of some framework). - * - * @return ResponseInterface|Promise - * - * @api - */ - public function processPsrRequest( - RequestInterface $request, - ResponseInterface $response, - StreamInterface $writableBodyStream - ) { - $result = $this->executePsrRequest($request); - - return $this->helper->toPsrResponse($result, $response, $writableBodyStream); - } - - /** - * Executes GraphQL operation and returns execution result - * (or promise when promise adapter is different from SyncPromiseAdapter) - * - * @return ExecutionResult|ExecutionResult[]|Promise - * - * @api - */ - public function executePsrRequest(RequestInterface $request) - { - $parsedBody = $this->helper->parsePsrRequest($request); - - return $this->executeRequest($parsedBody); - } - - /** - * Returns an instance of Server helper, which contains most of the actual logic for - * parsing / validating / executing request (which could be re-used by other server implementations) - * - * @return Helper - * - * @api - */ - public function getHelper() - { - return $this->helper; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/AbstractType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/AbstractType.php deleted file mode 100644 index e0257154..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/AbstractType.php +++ /dev/null @@ -1,23 +0,0 @@ -value; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php deleted file mode 100644 index 7223ebe1..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/CompositeType.php +++ /dev/null @@ -1,16 +0,0 @@ -config['serialize']($value); - } - - /** - * @param mixed $value - * - * @return mixed - */ - public function parseValue($value) - { - if (isset($this->config['parseValue'])) { - return $this->config['parseValue']($value); - } - - return $value; - } - - /** - * @param mixed[]|null $variables - * - * @return mixed - * - * @throws Exception - */ - public function parseLiteral(Node $valueNode, ?array $variables = null) - { - if (isset($this->config['parseLiteral'])) { - return $this->config['parseLiteral']($valueNode, $variables); - } - - return AST::valueFromASTUntyped($valueNode, $variables); - } - - public function assertValid() - { - parent::assertValid(); - - Utils::invariant( - isset($this->config['serialize']) && is_callable($this->config['serialize']), - sprintf('%s must provide "serialize" function. If this custom Scalar ', $this->name) . - 'is also used as an input type, ensure "parseValue" and "parseLiteral" ' . - 'functions are also provided.' - ); - if (! isset($this->config['parseValue']) && ! isset($this->config['parseLiteral'])) { - return; - } - - Utils::invariant( - isset($this->config['parseValue']) && isset($this->config['parseLiteral']) && - is_callable($this->config['parseValue']) && is_callable($this->config['parseLiteral']), - sprintf('%s must provide both "parseValue" and "parseLiteral" functions.', $this->name) - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Directive.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Directive.php deleted file mode 100644 index a04a0891..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Directive.php +++ /dev/null @@ -1,185 +0,0 @@ -name = $config['name']; - - $this->description = $config['description'] ?? null; - - if (isset($config['args'])) { - $args = []; - foreach ($config['args'] as $name => $arg) { - if (is_array($arg)) { - $args[] = new FieldArgument($arg + ['name' => $name]); - } else { - $args[] = $arg; - } - } - $this->args = $args; - } - - if (! isset($config['locations']) || ! is_array($config['locations'])) { - throw new InvariantViolation('Must provide locations for directive.'); - } - $this->locations = $config['locations']; - - $this->isRepeatable = $config['isRepeatable'] ?? false; - $this->astNode = $config['astNode'] ?? null; - - $this->config = $config; - } - - /** - * @return Directive - */ - public static function includeDirective() - { - $internal = self::getInternalDirectives(); - - return $internal['include']; - } - - /** - * @return Directive[] - */ - public static function getInternalDirectives() : array - { - if (self::$internalDirectives === null) { - self::$internalDirectives = [ - 'include' => new self([ - 'name' => self::INCLUDE_NAME, - 'description' => 'Directs the executor to include this field or fragment only when the `if` argument is true.', - 'locations' => [ - DirectiveLocation::FIELD, - DirectiveLocation::FRAGMENT_SPREAD, - DirectiveLocation::INLINE_FRAGMENT, - ], - 'args' => [ - new FieldArgument([ - 'name' => self::IF_ARGUMENT_NAME, - 'type' => Type::nonNull(Type::boolean()), - 'description' => 'Included when true.', - ]), - ], - ]), - 'skip' => new self([ - 'name' => self::SKIP_NAME, - 'description' => 'Directs the executor to skip this field or fragment when the `if` argument is true.', - 'locations' => [ - DirectiveLocation::FIELD, - DirectiveLocation::FRAGMENT_SPREAD, - DirectiveLocation::INLINE_FRAGMENT, - ], - 'args' => [ - new FieldArgument([ - 'name' => self::IF_ARGUMENT_NAME, - 'type' => Type::nonNull(Type::boolean()), - 'description' => 'Skipped when true.', - ]), - ], - ]), - 'deprecated' => new self([ - 'name' => self::DEPRECATED_NAME, - 'description' => 'Marks an element of a GraphQL schema as no longer supported.', - 'locations' => [ - DirectiveLocation::FIELD_DEFINITION, - DirectiveLocation::ENUM_VALUE, - ], - 'args' => [ - new FieldArgument([ - 'name' => self::REASON_ARGUMENT_NAME, - 'type' => Type::string(), - 'description' => - 'Explains why this element was deprecated, usually also including a ' . - 'suggestion for how to access supported similar data. Formatted using ' . - 'the Markdown syntax (as specified by [CommonMark](https://commonmark.org/).', - 'defaultValue' => self::DEFAULT_DEPRECATION_REASON, - ]), - ], - ]), - ]; - } - - return self::$internalDirectives; - } - - /** - * @return Directive - */ - public static function skipDirective() - { - $internal = self::getInternalDirectives(); - - return $internal['skip']; - } - - /** - * @return Directive - */ - public static function deprecatedDirective() - { - $internal = self::getInternalDirectives(); - - return $internal['deprecated']; - } - - /** - * @return bool - */ - public static function isSpecifiedDirective(Directive $directive) - { - return array_key_exists($directive->name, self::getInternalDirectives()); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumType.php deleted file mode 100644 index 9451ec74..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumType.php +++ /dev/null @@ -1,229 +0,0 @@ -, PHPStan won't let us type it that way. - * - * @var MixedStore - */ - private $valueLookup; - - /** @var ArrayObject */ - private $nameLookup; - - /** @var EnumTypeExtensionNode[] */ - public $extensionASTNodes; - - public function __construct($config) - { - if (! isset($config['name'])) { - $config['name'] = $this->tryInferName(); - } - - Utils::invariant(is_string($config['name']), 'Must provide name.'); - - $this->name = $config['name']; - $this->description = $config['description'] ?? null; - $this->astNode = $config['astNode'] ?? null; - $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; - $this->config = $config; - } - - /** - * @param string|mixed[] $name - * - * @return EnumValueDefinition|null - */ - public function getValue($name) - { - $lookup = $this->getNameLookup(); - - if (! is_string($name)) { - return null; - } - - return $lookup[$name] ?? null; - } - - private function getNameLookup() : ArrayObject - { - if (! $this->nameLookup) { - /** @var ArrayObject $lookup */ - $lookup = new ArrayObject(); - foreach ($this->getValues() as $value) { - $lookup[$value->name] = $value; - } - $this->nameLookup = $lookup; - } - - return $this->nameLookup; - } - - /** - * @return EnumValueDefinition[] - */ - public function getValues() : array - { - if (! isset($this->values)) { - $this->values = []; - $config = $this->config; - - if (isset($config['values'])) { - if (! is_array($config['values'])) { - throw new InvariantViolation(sprintf('%s values must be an array', $this->name)); - } - foreach ($config['values'] as $name => $value) { - if (is_string($name)) { - if (is_array($value)) { - $value += ['name' => $name, 'value' => $name]; - } else { - $value = ['name' => $name, 'value' => $value]; - } - } elseif (is_int($name) && is_string($value)) { - $value = ['name' => $value, 'value' => $value]; - } else { - throw new InvariantViolation( - sprintf( - '%s values must be an array with value names as keys.', - $this->name - ) - ); - } - $this->values[] = new EnumValueDefinition($value); - } - } - } - - return $this->values; - } - - /** - * @param mixed $value - * - * @return mixed - * - * @throws Error - */ - public function serialize($value) - { - $lookup = $this->getValueLookup(); - if (isset($lookup[$value])) { - return $lookup[$value]->name; - } - - throw new Error('Cannot serialize value as enum: ' . Utils::printSafe($value)); - } - - /** - * Actually returns a MixedStore, PHPStan won't let us type it that way - */ - private function getValueLookup() : MixedStore - { - if (! isset($this->valueLookup)) { - $this->valueLookup = new MixedStore(); - - foreach ($this->getValues() as $valueName => $value) { - $this->valueLookup->offsetSet($value->value, $value); - } - } - - return $this->valueLookup; - } - - /** - * @param mixed $value - * - * @return mixed - * - * @throws Error - */ - public function parseValue($value) - { - $lookup = $this->getNameLookup(); - if (isset($lookup[$value])) { - return $lookup[$value]->value; - } - - throw new Error('Cannot represent value as enum: ' . Utils::printSafe($value)); - } - - /** - * @param mixed[]|null $variables - * - * @return null - * - * @throws Exception - */ - public function parseLiteral(Node $valueNode, ?array $variables = null) - { - if ($valueNode instanceof EnumValueNode) { - $lookup = $this->getNameLookup(); - if (isset($lookup[$valueNode->value])) { - $enumValue = $lookup[$valueNode->value]; - if ($enumValue !== null) { - return $enumValue->value; - } - } - } - - // Intentionally without message, as all information already in wrapped Exception - throw new Error(); - } - - /** - * @throws InvariantViolation - */ - public function assertValid() - { - parent::assertValid(); - - Utils::invariant( - isset($this->config['values']), - sprintf('%s values must be an array.', $this->name) - ); - - $values = $this->getValues(); - foreach ($values as $value) { - Utils::invariant( - ! isset($value->config['isDeprecated']), - sprintf( - '%s.%s should provide "deprecationReason" instead of "isDeprecated".', - $this->name, - $value->name - ) - ); - } - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php deleted file mode 100644 index 9454f358..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/EnumValueDefinition.php +++ /dev/null @@ -1,50 +0,0 @@ -name = $config['name'] ?? null; - $this->value = $config['value'] ?? null; - $this->deprecationReason = $config['deprecationReason'] ?? null; - $this->description = $config['description'] ?? null; - $this->astNode = $config['astNode'] ?? null; - - $this->config = $config; - } - - /** - * @return bool - */ - public function isDeprecated() - { - return (bool) $this->deprecationReason; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldArgument.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldArgument.php deleted file mode 100644 index f6a8f385..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldArgument.php +++ /dev/null @@ -1,135 +0,0 @@ - $value) { - switch ($key) { - case 'name': - $this->name = $value; - break; - case 'defaultValue': - $this->defaultValue = $value; - break; - case 'description': - $this->description = $value; - break; - case 'astNode': - $this->astNode = $value; - break; - } - } - $this->config = $def; - } - - /** - * @param mixed[] $config - * - * @return FieldArgument[] - */ - public static function createMap(array $config) : array - { - $map = []; - foreach ($config as $name => $argConfig) { - if (! is_array($argConfig)) { - $argConfig = ['type' => $argConfig]; - } - $map[] = new self($argConfig + ['name' => $name]); - } - - return $map; - } - - public function getType() : Type - { - if (! isset($this->type)) { - /** - * TODO: replace this phpstan cast with native assert - * - * @var Type&InputType - */ - $type = Schema::resolveType($this->config['type']); - $this->type = $type; - } - - return $this->type; - } - - public function defaultValueExists() : bool - { - return array_key_exists('defaultValue', $this->config); - } - - public function isRequired() : bool - { - return $this->getType() instanceof NonNull && ! $this->defaultValueExists(); - } - - public function assertValid(FieldDefinition $parentField, Type $parentType) - { - try { - Utils::assertValidName($this->name); - } catch (InvariantViolation $e) { - throw new InvariantViolation( - sprintf('%s.%s(%s:) %s', $parentType->name, $parentField->name, $this->name, $e->getMessage()) - ); - } - $type = $this->getType(); - if ($type instanceof WrappingType) { - $type = $type->getWrappedType(true); - } - Utils::invariant( - $type instanceof InputType, - sprintf( - '%s.%s(%s): argument type must be Input Type but got: %s', - $parentType->name, - $parentField->name, - $this->name, - Utils::printSafe($this->type) - ) - ); - Utils::invariant( - $this->description === null || is_string($this->description), - sprintf( - '%s.%s(%s): argument description type must be string but got: %s', - $parentType->name, - $parentField->name, - $this->name, - Utils::printSafe($this->description) - ) - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php deleted file mode 100644 index ceb27b20..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FieldDefinition.php +++ /dev/null @@ -1,331 +0,0 @@ -name = $config['name']; - $this->resolveFn = $config['resolve'] ?? null; - $this->mapFn = $config['map'] ?? null; - $this->args = isset($config['args']) ? FieldArgument::createMap($config['args']) : []; - - $this->description = $config['description'] ?? null; - $this->deprecationReason = $config['deprecationReason'] ?? null; - $this->astNode = $config['astNode'] ?? null; - - $this->config = $config; - - $this->complexityFn = $config['complexity'] ?? self::DEFAULT_COMPLEXITY_FN; - } - - /** - * @param (callable():mixed[])|mixed[] $fields - * - * @return array - */ - public static function defineFieldMap(Type $type, $fields) : array - { - if (is_callable($fields)) { - $fields = $fields(); - } - if (! is_iterable($fields)) { - throw new InvariantViolation( - sprintf('%s fields must be an iterable or a callable which returns such an iterable.', $type->name) - ); - } - $map = []; - foreach ($fields as $name => $field) { - if (is_array($field)) { - if (! isset($field['name'])) { - if (! is_string($name)) { - throw new InvariantViolation( - sprintf( - '%s fields must be an associative array with field names as keys or a function which returns such an array.', - $type->name - ) - ); - } - - $field['name'] = $name; - } - if (isset($field['args']) && ! is_array($field['args'])) { - throw new InvariantViolation( - sprintf('%s.%s args must be an array.', $type->name, $name) - ); - } - $fieldDef = self::create($field); - } elseif ($field instanceof self) { - $fieldDef = $field; - } elseif (is_callable($field)) { - if (! is_string($name)) { - throw new InvariantViolation( - sprintf( - '%s lazy fields must be an associative array with field names as keys.', - $type->name - ) - ); - } - - $fieldDef = new UnresolvedFieldDefinition($type, $name, $field); - } else { - if (! is_string($name) || ! $field) { - throw new InvariantViolation( - sprintf( - '%s.%s field config must be an array, but got: %s', - $type->name, - $name, - Utils::printSafe($field) - ) - ); - } - - $fieldDef = self::create(['name' => $name, 'type' => $field]); - } - - $map[$fieldDef->getName()] = $fieldDef; - } - - return $map; - } - - /** - * @param mixed[] $field - * - * @return FieldDefinition - */ - public static function create($field) - { - return new self($field); - } - - /** - * @param int $childrenComplexity - * - * @return mixed - */ - public static function defaultComplexity($childrenComplexity) - { - return $childrenComplexity + 1; - } - - /** - * @param string $name - * - * @return FieldArgument|null - */ - public function getArg($name) - { - foreach ($this->args ?? [] as $arg) { - /** @var FieldArgument $arg */ - if ($arg->name === $name) { - return $arg; - } - } - - return null; - } - - public function getName() : string - { - return $this->name; - } - - public function getType() : Type - { - if (! isset($this->type)) { - /** - * TODO: replace this phpstan cast with native assert - * - * @var Type&OutputType - */ - $type = Schema::resolveType($this->config['type']); - $this->type = $type; - } - - return $this->type; - } - - public function __isset(string $name) : bool - { - switch ($name) { - case 'type': - Warning::warnOnce( - "The public getter for 'type' on FieldDefinition has been deprecated and will be removed" . - " in the next major version. Please update your code to use the 'getType' method.", - Warning::WARNING_CONFIG_DEPRECATION - ); - - return isset($this->type); - } - - return isset($this->$name); - } - - public function __get(string $name) - { - switch ($name) { - case 'type': - Warning::warnOnce( - "The public getter for 'type' on FieldDefinition has been deprecated and will be removed" . - " in the next major version. Please update your code to use the 'getType' method.", - Warning::WARNING_CONFIG_DEPRECATION - ); - - return $this->getType(); - default: - return $this->$name; - } - - return null; - } - - public function __set(string $name, $value) - { - switch ($name) { - case 'type': - Warning::warnOnce( - "The public setter for 'type' on FieldDefinition has been deprecated and will be removed" . - ' in the next major version.', - Warning::WARNING_CONFIG_DEPRECATION - ); - $this->type = $value; - break; - - default: - $this->$name = $value; - break; - } - } - - /** - * @return bool - */ - public function isDeprecated() - { - return (bool) $this->deprecationReason; - } - - /** - * @return callable|callable - */ - public function getComplexityFn() - { - return $this->complexityFn; - } - - /** - * @throws InvariantViolation - */ - public function assertValid(Type $parentType) - { - try { - Utils::assertValidName($this->name); - } catch (Error $e) { - throw new InvariantViolation(sprintf('%s.%s: %s', $parentType->name, $this->name, $e->getMessage())); - } - Utils::invariant( - ! isset($this->config['isDeprecated']), - sprintf( - '%s.%s should provide "deprecationReason" instead of "isDeprecated".', - $parentType->name, - $this->name - ) - ); - - $type = $this->getType(); - if ($type instanceof WrappingType) { - $type = $type->getWrappedType(true); - } - Utils::invariant( - $type instanceof OutputType, - sprintf( - '%s.%s field type must be Output Type but got: %s', - $parentType->name, - $this->name, - Utils::printSafe($this->type) - ) - ); - Utils::invariant( - $this->resolveFn === null || is_callable($this->resolveFn), - sprintf( - '%s.%s field resolver must be a function if provided, but got: %s', - $parentType->name, - $this->name, - Utils::printSafe($this->resolveFn) - ) - ); - - foreach ($this->args as $fieldArgument) { - $fieldArgument->assertValid($this, $type); - } - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php deleted file mode 100644 index 4ce723cf..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/FloatType.php +++ /dev/null @@ -1,89 +0,0 @@ -value; - } - - // Intentionally without message, as all information already in wrapped Exception - throw new Error(); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php deleted file mode 100644 index d77e61ff..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/HasFieldsType.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * @throws InvariantViolation - */ - public function getFields() : array; - - /** - * @return array - * - * @throws InvariantViolation - */ - public function getFieldNames() : array; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php deleted file mode 100644 index d5a214d9..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IDType.php +++ /dev/null @@ -1,80 +0,0 @@ -value; - } - - // Intentionally without message, as all information already in wrapped Exception - throw new Error(); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ImplementingType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ImplementingType.php deleted file mode 100644 index 94bf7717..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ImplementingType.php +++ /dev/null @@ -1,20 +0,0 @@ - - */ - public function getInterfaces() : array; -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectField.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectField.php deleted file mode 100644 index 02a20ea3..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectField.php +++ /dev/null @@ -1,171 +0,0 @@ - $v) { - switch ($k) { - case 'defaultValue': - $this->defaultValue = $v; - break; - case 'defaultValueExists': - break; - case 'type': - // do nothing; type is lazy loaded in getType - break; - default: - $this->{$k} = $v; - } - } - $this->config = $opts; - } - - public function __isset(string $name) : bool - { - switch ($name) { - case 'type': - Warning::warnOnce( - "The public getter for 'type' on InputObjectField has been deprecated and will be removed" . - " in the next major version. Please update your code to use the 'getType' method.", - Warning::WARNING_CONFIG_DEPRECATION - ); - - return isset($this->type); - } - - return isset($this->$name); - } - - public function __get(string $name) - { - switch ($name) { - case 'type': - Warning::warnOnce( - "The public getter for 'type' on InputObjectField has been deprecated and will be removed" . - " in the next major version. Please update your code to use the 'getType' method.", - Warning::WARNING_CONFIG_DEPRECATION - ); - - return $this->getType(); - default: - return $this->$name; - } - - return null; - } - - public function __set(string $name, $value) - { - switch ($name) { - case 'type': - Warning::warnOnce( - "The public setter for 'type' on InputObjectField has been deprecated and will be removed" . - ' in the next major version.', - Warning::WARNING_CONFIG_DEPRECATION - ); - $this->type = $value; - break; - - default: - $this->$name = $value; - break; - } - } - - /** - * @return Type&InputType - */ - public function getType() : Type - { - if (! isset($this->type)) { - /** - * TODO: replace this phpstan cast with native assert - * - * @var Type&InputType - */ - $type = Schema::resolveType($this->config['type']); - $this->type = $type; - } - - return $this->type; - } - - public function defaultValueExists() : bool - { - return array_key_exists('defaultValue', $this->config); - } - - public function isRequired() : bool - { - return $this->getType() instanceof NonNull && ! $this->defaultValueExists(); - } - - /** - * @throws InvariantViolation - */ - public function assertValid(Type $parentType) - { - try { - Utils::assertValidName($this->name); - } catch (Error $e) { - throw new InvariantViolation(sprintf('%s.%s: %s', $parentType->name, $this->name, $e->getMessage())); - } - $type = $this->getType(); - if ($type instanceof WrappingType) { - $type = $type->getWrappedType(true); - } - Utils::invariant( - $type instanceof InputType, - sprintf( - '%s.%s field type must be Input Type but got: %s', - $parentType->name, - $this->name, - Utils::printSafe($this->type) - ) - ); - Utils::invariant( - ! array_key_exists('resolve', $this->config), - sprintf( - '%s.%s field has a resolve property, but Input Types cannot define resolvers.', - $parentType->name, - $this->name - ) - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectType.php deleted file mode 100644 index 0d4b2706..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputObjectType.php +++ /dev/null @@ -1,121 +0,0 @@ -tryInferName(); - } - - Utils::invariant(is_string($config['name']), 'Must provide name.'); - - $this->config = $config; - $this->name = $config['name']; - $this->astNode = $config['astNode'] ?? null; - $this->description = $config['description'] ?? null; - $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; - } - - /** - * @throws InvariantViolation - */ - public function getField(string $name) : InputObjectField - { - if (! isset($this->fields)) { - $this->initializeFields(); - } - Utils::invariant(isset($this->fields[$name]), "Field '%s' is not defined for type '%s'", $name, $this->name); - - return $this->fields[$name]; - } - - /** - * @return InputObjectField[] - */ - public function getFields() : array - { - if (! isset($this->fields)) { - $this->initializeFields(); - } - - return $this->fields; - } - - protected function initializeFields() : void - { - $this->fields = []; - $fields = $this->config['fields'] ?? []; - if (is_callable($fields)) { - $fields = $fields(); - } - - if (! is_iterable($fields)) { - throw new InvariantViolation( - sprintf('%s fields must be an iterable or a callable which returns such an iterable.', $this->name) - ); - } - - foreach ($fields as $name => $field) { - if ($field instanceof Type || is_callable($field)) { - $field = ['type' => $field]; - } - $field = new InputObjectField($field + ['name' => $name]); - $this->fields[$field->name] = $field; - } - } - - /** - * Validates type config and throws if one of type options is invalid. - * Note: this method is shallow, it won't validate object fields and their arguments. - * - * @throws InvariantViolation - */ - public function assertValid() : void - { - parent::assertValid(); - - Utils::invariant( - count($this->getFields()) > 0, - sprintf( - '%s fields must be an associative array with field names as keys or a callable which returns such an array.', - $this->name - ) - ); - - foreach ($this->getFields() as $field) { - $field->assertValid($this); - } - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputType.php deleted file mode 100644 index d970bff3..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InputType.php +++ /dev/null @@ -1,22 +0,0 @@ - - | NonNull< - | ScalarType - | EnumType - | InputObjectType - | ListOfType, - >; - */ -interface InputType -{ -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IntType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IntType.php deleted file mode 100644 index f3ae6cdc..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/IntType.php +++ /dev/null @@ -1,118 +0,0 @@ -= self::MIN_INT) { - return $value; - } - - $float = is_numeric($value) || is_bool($value) - ? (float) $value - : null; - - if ($float === null || floor($float) !== $float) { - throw new Error( - 'Int cannot represent non-integer value: ' . - Utils::printSafe($value) - ); - } - - if ($float > self::MAX_INT || $float < self::MIN_INT) { - throw new Error( - 'Int cannot represent non 32-bit signed integer value: ' . - Utils::printSafe($value) - ); - } - - return (int) $float; - } - - /** - * @param mixed $value - * - * @throws Error - */ - public function parseValue($value) : int - { - $isInt = is_int($value) || (is_float($value) && floor($value) === $value); - - if (! $isInt) { - throw new Error( - 'Int cannot represent non-integer value: ' . - Utils::printSafe($value) - ); - } - - if ($value > self::MAX_INT || $value < self::MIN_INT) { - throw new Error( - 'Int cannot represent non 32-bit signed integer value: ' . - Utils::printSafe($value) - ); - } - - return (int) $value; - } - - /** - * @param mixed[]|null $variables - * - * @return int - * - * @throws Exception - */ - public function parseLiteral(Node $valueNode, ?array $variables = null) - { - if ($valueNode instanceof IntValueNode) { - $val = (int) $valueNode->value; - if ($valueNode->value === (string) $val && self::MIN_INT <= $val && $val <= self::MAX_INT) { - return $val; - } - } - - // Intentionally without message, as all information already in wrapped Exception - throw new Error(); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InterfaceType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InterfaceType.php deleted file mode 100644 index 578580c8..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/InterfaceType.php +++ /dev/null @@ -1,154 +0,0 @@ - */ - public $extensionASTNodes; - - /** - * Lazily initialized. - * - * @var array - */ - private $interfaces; - - /** - * Lazily initialized. - * - * @var array - */ - private $interfaceMap; - - /** - * @param mixed[] $config - */ - public function __construct(array $config) - { - if (! isset($config['name'])) { - $config['name'] = $this->tryInferName(); - } - - Utils::invariant(is_string($config['name']), 'Must provide name.'); - - $this->name = $config['name']; - $this->description = $config['description'] ?? null; - $this->astNode = $config['astNode'] ?? null; - $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; - $this->config = $config; - } - - /** - * @param mixed $type - * - * @return $this - * - * @throws InvariantViolation - */ - public static function assertInterfaceType($type) : self - { - Utils::invariant( - $type instanceof self, - 'Expected ' . Utils::printSafe($type) . ' to be a GraphQL Interface type.' - ); - - return $type; - } - - public function implementsInterface(InterfaceType $interfaceType) : bool - { - if (! isset($this->interfaceMap)) { - $this->interfaceMap = []; - foreach ($this->getInterfaces() as $interface) { - /** @var Type&InterfaceType $interface */ - $interface = Schema::resolveType($interface); - $this->interfaceMap[$interface->name] = $interface; - } - } - - return isset($this->interfaceMap[$interfaceType->name]); - } - - /** - * @return array - */ - public function getInterfaces() : array - { - if (! isset($this->interfaces)) { - $interfaces = $this->config['interfaces'] ?? []; - if (is_callable($interfaces)) { - $interfaces = $interfaces(); - } - - if ($interfaces !== null && ! is_array($interfaces)) { - throw new InvariantViolation( - sprintf('%s interfaces must be an Array or a callable which returns an Array.', $this->name) - ); - } - - /** @var array $interfaces */ - $interfaces = $interfaces === null - ? [] - : array_map([Schema::class, 'resolveType'], $interfaces); - - $this->interfaces = $interfaces; - } - - return $this->interfaces; - } - - /** - * Resolves concrete ObjectType for given object value - * - * @param object $objectValue - * @param mixed $context - * - * @return Type|null - */ - public function resolveType($objectValue, $context, ResolveInfo $info) - { - if (isset($this->config['resolveType'])) { - $fn = $this->config['resolveType']; - - return $fn($objectValue, $context, $info); - } - - return null; - } - - /** - * @throws InvariantViolation - */ - public function assertValid() : void - { - parent::assertValid(); - - $resolveType = $this->config['resolveType'] ?? null; - - Utils::invariant( - ! isset($resolveType) || is_callable($resolveType), - sprintf( - '%s must provide "resolveType" as a function, but got: %s', - $this->name, - Utils::printSafe($resolveType) - ) - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/LeafType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/LeafType.php deleted file mode 100644 index b913823f..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/LeafType.php +++ /dev/null @@ -1,61 +0,0 @@ -ofType = is_callable($type) ? $type : Type::assertType($type); - } - - public function toString() : string - { - return '[' . $this->getOfType()->toString() . ']'; - } - - public function getOfType() - { - return Schema::resolveType($this->ofType); - } - - public function getWrappedType(bool $recurse = false) : Type - { - $type = $this->getOfType(); - - return $recurse && $type instanceof WrappingType - ? $type->getWrappedType($recurse) - : $type; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NamedType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NamedType.php deleted file mode 100644 index d36dff5a..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NamedType.php +++ /dev/null @@ -1,18 +0,0 @@ -ofType = $type; - } - - public function toString() : string - { - return $this->getWrappedType()->toString() . '!'; - } - - public function getOfType() - { - return Schema::resolveType($this->ofType); - } - - /** - * @return (NullableType&Type) - */ - public function getWrappedType(bool $recurse = false) : Type - { - $type = $this->getOfType(); - - return $recurse && $type instanceof WrappingType - ? $type->getWrappedType($recurse) - : $type; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NullableType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NullableType.php deleted file mode 100644 index 7ff70b24..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/NullableType.php +++ /dev/null @@ -1,20 +0,0 @@ -; - */ - -interface NullableType -{ -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ObjectType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ObjectType.php deleted file mode 100644 index 1a1cf793..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ObjectType.php +++ /dev/null @@ -1,206 +0,0 @@ - 'Address', - * 'fields' => [ - * 'street' => [ 'type' => GraphQL\Type\Definition\Type::string() ], - * 'number' => [ 'type' => GraphQL\Type\Definition\Type::int() ], - * 'formatted' => [ - * 'type' => GraphQL\Type\Definition\Type::string(), - * 'resolve' => function($obj) { - * return $obj->number . ' ' . $obj->street; - * } - * ] - * ] - * ]); - * - * When two types need to refer to each other, or a type needs to refer to - * itself in a field, you can use a function expression (aka a closure or a - * thunk) to supply the fields lazily. - * - * Example: - * - * $PersonType = null; - * $PersonType = new ObjectType([ - * 'name' => 'Person', - * 'fields' => function() use (&$PersonType) { - * return [ - * 'name' => ['type' => GraphQL\Type\Definition\Type::string() ], - * 'bestFriend' => [ 'type' => $PersonType ], - * ]; - * } - * ]); - */ -class ObjectType extends TypeWithFields implements OutputType, CompositeType, NullableType, NamedType, ImplementingType -{ - /** @var ObjectTypeDefinitionNode|null */ - public $astNode; - - /** @var ObjectTypeExtensionNode[] */ - public $extensionASTNodes; - - /** @var ?callable */ - public $resolveFieldFn; - - /** - * Lazily initialized. - * - * @var array - */ - private $interfaces; - - /** - * Lazily initialized. - * - * @var array - */ - private $interfaceMap; - - /** - * @param mixed[] $config - */ - public function __construct(array $config) - { - if (! isset($config['name'])) { - $config['name'] = $this->tryInferName(); - } - - Utils::invariant(is_string($config['name']), 'Must provide name.'); - - $this->name = $config['name']; - $this->description = $config['description'] ?? null; - $this->resolveFieldFn = $config['resolveField'] ?? null; - $this->astNode = $config['astNode'] ?? null; - $this->extensionASTNodes = $config['extensionASTNodes'] ?? []; - $this->config = $config; - } - - /** - * @param mixed $type - * - * @return $this - * - * @throws InvariantViolation - */ - public static function assertObjectType($type) : self - { - Utils::invariant( - $type instanceof self, - 'Expected ' . Utils::printSafe($type) . ' to be a GraphQL Object type.' - ); - - return $type; - } - - public function implementsInterface(InterfaceType $interfaceType) : bool - { - if (! isset($this->interfaceMap)) { - $this->interfaceMap = []; - foreach ($this->getInterfaces() as $interface) { - /** @var Type&InterfaceType $interface */ - $interface = Schema::resolveType($interface); - $this->interfaceMap[$interface->name] = $interface; - } - } - - return isset($this->interfaceMap[$interfaceType->name]); - } - - /** - * @return array - */ - public function getInterfaces() : array - { - if (! isset($this->interfaces)) { - $interfaces = $this->config['interfaces'] ?? []; - if (is_callable($interfaces)) { - $interfaces = $interfaces(); - } - - if ($interfaces !== null && ! is_array($interfaces)) { - throw new InvariantViolation( - sprintf('%s interfaces must be an Array or a callable which returns an Array.', $this->name) - ); - } - - /** @var InterfaceType[] $interfaces */ - $interfaces = array_map([Schema::class, 'resolveType'], $interfaces ?? []); - - $this->interfaces = $interfaces; - } - - return $this->interfaces; - } - - /** - * @param mixed $value - * @param mixed $context - * - * @return bool|Deferred|null - */ - public function isTypeOf($value, $context, ResolveInfo $info) - { - return isset($this->config['isTypeOf']) - ? $this->config['isTypeOf']( - $value, - $context, - $info - ) - : null; - } - - /** - * Validates type config and throws if one of type options is invalid. - * Note: this method is shallow, it won't validate object fields and their arguments. - * - * @throws InvariantViolation - */ - public function assertValid() : void - { - parent::assertValid(); - - Utils::invariant( - $this->description === null || is_string($this->description), - sprintf( - '%s description must be string if set, but it is: %s', - $this->name, - Utils::printSafe($this->description) - ) - ); - - $isTypeOf = $this->config['isTypeOf'] ?? null; - - Utils::invariant( - $isTypeOf === null || is_callable($isTypeOf), - sprintf('%s must provide "isTypeOf" as a function, but got: %s', $this->name, Utils::printSafe($isTypeOf)) - ); - - foreach ($this->getFields() as $field) { - $field->assertValid($this); - } - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php deleted file mode 100644 index 7565a254..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/OutputType.php +++ /dev/null @@ -1,19 +0,0 @@ - */ - private $queryPlan = []; - - /** @var mixed[] */ - private $variableValues; - - /** @var FragmentDefinitionNode[] */ - private $fragments; - - /** @var bool */ - private $groupImplementorFields; - - /** - * @param FieldNode[] $fieldNodes - * @param mixed[] $variableValues - * @param FragmentDefinitionNode[] $fragments - * @param mixed[] $options - */ - public function __construct(ObjectType $parentType, Schema $schema, iterable $fieldNodes, array $variableValues, array $fragments, array $options = []) - { - $this->schema = $schema; - $this->variableValues = $variableValues; - $this->fragments = $fragments; - $this->groupImplementorFields = in_array('group-implementor-fields', $options, true); - $this->analyzeQueryPlan($parentType, $fieldNodes); - } - - /** - * @return mixed[] - */ - public function queryPlan() : array - { - return $this->queryPlan; - } - - /** - * @return string[] - */ - public function getReferencedTypes() : array - { - return array_keys($this->types); - } - - public function hasType(string $type) : bool - { - return count(array_filter($this->getReferencedTypes(), static function (string $referencedType) use ($type) : bool { - return $type === $referencedType; - })) > 0; - } - - /** - * @return string[] - */ - public function getReferencedFields() : array - { - return array_values(array_unique(array_merge(...array_values($this->types)))); - } - - public function hasField(string $field) : bool - { - return count(array_filter($this->getReferencedFields(), static function (string $referencedField) use ($field) : bool { - return $field === $referencedField; - })) > 0; - } - - /** - * @return string[] - */ - public function subFields(string $typename) : array - { - if (! array_key_exists($typename, $this->types)) { - return []; - } - - return $this->types[$typename]; - } - - /** - * @param FieldNode[] $fieldNodes - */ - private function analyzeQueryPlan(ObjectType $parentType, iterable $fieldNodes) : void - { - $queryPlan = []; - $implementors = []; - /** @var FieldNode $fieldNode */ - foreach ($fieldNodes as $fieldNode) { - if (! $fieldNode->selectionSet) { - continue; - } - - $type = $parentType->getField($fieldNode->name->value)->getType(); - if ($type instanceof WrappingType) { - $type = $type->getWrappedType(true); - } - - $subfields = $this->analyzeSelectionSet($fieldNode->selectionSet, $type, $implementors); - - $this->types[$type->name] = array_unique(array_merge( - array_key_exists($type->name, $this->types) ? $this->types[$type->name] : [], - array_keys($subfields) - )); - - $queryPlan = array_merge_recursive( - $queryPlan, - $subfields - ); - } - - if ($this->groupImplementorFields) { - $this->queryPlan = ['fields' => $queryPlan]; - - if ($implementors) { - $this->queryPlan['implementors'] = $implementors; - } - } else { - $this->queryPlan = $queryPlan; - } - } - - /** - * @param InterfaceType|ObjectType $parentType - * @param mixed[] $implementors - * - * @return mixed[] - * - * @throws Error - */ - private function analyzeSelectionSet(SelectionSetNode $selectionSet, Type $parentType, array &$implementors) : array - { - $fields = []; - $implementors = []; - foreach ($selectionSet->selections as $selectionNode) { - if ($selectionNode instanceof FieldNode) { - $fieldName = $selectionNode->name->value; - - if ($fieldName === Introspection::TYPE_NAME_FIELD_NAME) { - continue; - } - - $type = $parentType->getField($fieldName); - $selectionType = $type->getType(); - - $subfields = []; - $subImplementors = []; - if ($selectionNode->selectionSet) { - $subfields = $this->analyzeSubFields($selectionType, $selectionNode->selectionSet, $subImplementors); - } - - $fields[$fieldName] = [ - 'type' => $selectionType, - 'fields' => $subfields ?? [], - 'args' => Values::getArgumentValues($type, $selectionNode, $this->variableValues), - ]; - if ($this->groupImplementorFields && $subImplementors) { - $fields[$fieldName]['implementors'] = $subImplementors; - } - } elseif ($selectionNode instanceof FragmentSpreadNode) { - $spreadName = $selectionNode->name->value; - if (isset($this->fragments[$spreadName])) { - $fragment = $this->fragments[$spreadName]; - $type = $this->schema->getType($fragment->typeCondition->name->value); - $subfields = $this->analyzeSubFields($type, $fragment->selectionSet); - $fields = $this->mergeFields($parentType, $type, $fields, $subfields, $implementors); - } - } elseif ($selectionNode instanceof InlineFragmentNode) { - $type = $this->schema->getType($selectionNode->typeCondition->name->value); - $subfields = $this->analyzeSubFields($type, $selectionNode->selectionSet); - $fields = $this->mergeFields($parentType, $type, $fields, $subfields, $implementors); - } - } - - return $fields; - } - - /** - * @param mixed[] $implementors - * - * @return mixed[] - */ - private function analyzeSubFields(Type $type, SelectionSetNode $selectionSet, array &$implementors = []) : array - { - if ($type instanceof WrappingType) { - $type = $type->getWrappedType(true); - } - - $subfields = []; - if ($type instanceof ObjectType || $type instanceof AbstractType) { - $subfields = $this->analyzeSelectionSet($selectionSet, $type, $implementors); - $this->types[$type->name] = array_unique(array_merge( - array_key_exists($type->name, $this->types) ? $this->types[$type->name] : [], - array_keys($subfields) - )); - } - - return $subfields; - } - - /** - * @param mixed[] $fields - * @param mixed[] $subfields - * @param mixed[] $implementors - * - * @return mixed[] - */ - private function mergeFields(Type $parentType, Type $type, array $fields, array $subfields, array &$implementors) : array - { - if ($this->groupImplementorFields && $parentType instanceof AbstractType && ! $type instanceof AbstractType) { - $implementors[$type->name] = [ - 'type' => $type, - 'fields' => $this->arrayMergeDeep( - $implementors[$type->name]['fields'] ?? [], - array_diff_key($subfields, $fields) - ), - ]; - - $fields = $this->arrayMergeDeep( - $fields, - array_intersect_key($subfields, $fields) - ); - } else { - $fields = $this->arrayMergeDeep( - $subfields, - $fields - ); - } - - return $fields; - } - - /** - * similar to array_merge_recursive this merges nested arrays, but handles non array values differently - * while array_merge_recursive tries to merge non array values, in this implementation they will be overwritten - * - * @see https://stackoverflow.com/a/25712428 - * - * @param mixed[] $array1 - * @param mixed[] $array2 - * - * @return mixed[] - */ - private function arrayMergeDeep(array $array1, array $array2) : array - { - $merged = $array1; - - foreach ($array2 as $key => & $value) { - if (is_numeric($key)) { - if (! in_array($value, $merged, true)) { - $merged[] = $value; - } - } elseif (is_array($value) && isset($merged[$key]) && is_array($merged[$key])) { - $merged[$key] = $this->arrayMergeDeep($merged[$key], $value); - } else { - $merged[$key] = $value; - } - } - - return $merged; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php deleted file mode 100644 index 6c118c23..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ResolveInfo.php +++ /dev/null @@ -1,255 +0,0 @@ -fieldDefinition = $fieldDefinition; - $this->fieldName = $fieldDefinition->name; - $this->returnType = $fieldDefinition->getType(); - $this->fieldNodes = $fieldNodes; - $this->parentType = $parentType; - $this->path = $path; - $this->schema = $schema; - $this->fragments = $fragments; - $this->rootValue = $rootValue; - $this->operation = $operation; - $this->variableValues = $variableValues; - } - - /** - * Helper method that returns names of all fields selected in query for - * $this->fieldName up to $depth levels. - * - * Example: - * query MyQuery{ - * { - * root { - * id, - * nested { - * nested1 - * nested2 { - * nested3 - * } - * } - * } - * } - * - * Given this ResolveInfo instance is a part of "root" field resolution, and $depth === 1, - * method will return: - * [ - * 'id' => true, - * 'nested' => [ - * nested1 => true, - * nested2 => true - * ] - * ] - * - * Warning: this method it is a naive implementation which does not take into account - * conditional typed fragments. So use it with care for fields of interface and union types. - * - * @param int $depth How many levels to include in output - * - * @return array - * - * @api - */ - public function getFieldSelection($depth = 0) - { - $fields = []; - - /** @var FieldNode $fieldNode */ - foreach ($this->fieldNodes as $fieldNode) { - if ($fieldNode->selectionSet === null) { - continue; - } - - $fields = array_merge_recursive( - $fields, - $this->foldSelectionSet($fieldNode->selectionSet, $depth) - ); - } - - return $fields; - } - - /** - * @param mixed[] $options - */ - public function lookAhead(array $options = []) : QueryPlan - { - if (! isset($this->queryPlan)) { - $this->queryPlan = new QueryPlan( - $this->parentType, - $this->schema, - $this->fieldNodes, - $this->variableValues, - $this->fragments, - $options - ); - } - - return $this->queryPlan; - } - - /** - * @return bool[] - */ - private function foldSelectionSet(SelectionSetNode $selectionSet, int $descend) : array - { - $fields = []; - foreach ($selectionSet->selections as $selectionNode) { - if ($selectionNode instanceof FieldNode) { - $fields[$selectionNode->name->value] = $descend > 0 && $selectionNode->selectionSet !== null - ? $this->foldSelectionSet($selectionNode->selectionSet, $descend - 1) - : true; - } elseif ($selectionNode instanceof FragmentSpreadNode) { - $spreadName = $selectionNode->name->value; - if (isset($this->fragments[$spreadName])) { - /** @var FragmentDefinitionNode $fragment */ - $fragment = $this->fragments[$spreadName]; - $fields = array_merge_recursive( - $this->foldSelectionSet($fragment->selectionSet, $descend), - $fields - ); - } - } elseif ($selectionNode instanceof InlineFragmentNode) { - $fields = array_merge_recursive( - $this->foldSelectionSet($selectionNode->selectionSet, $descend), - $fields - ); - } - } - - return $fields; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ScalarType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ScalarType.php deleted file mode 100644 index 17bf6e7f..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/ScalarType.php +++ /dev/null @@ -1,51 +0,0 @@ -name = $config['name'] ?? $this->tryInferName(); - $this->description = $config['description'] ?? $this->description; - $this->astNode = $config['astNode'] ?? null; - $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; - $this->config = $config; - - Utils::invariant(is_string($this->name), 'Must provide name.'); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php deleted file mode 100644 index 4a26b785..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/StringType.php +++ /dev/null @@ -1,84 +0,0 @@ -value; - } - - // Intentionally without message, as all information already in wrapped Exception - throw new Error(); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Type.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Type.php deleted file mode 100644 index 14d1f6a3..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/Type.php +++ /dev/null @@ -1,355 +0,0 @@ - */ - protected static $standardTypes; - - /** @var Type[] */ - private static $builtInTypes; - - /** @var string */ - public $name; - - /** @var string|null */ - public $description; - - /** @var TypeDefinitionNode|null */ - public $astNode; - - /** @var mixed[] */ - public $config; - - /** @var TypeExtensionNode[] */ - public $extensionASTNodes; - - /** - * @api - */ - public static function id() : ScalarType - { - if (! isset(static::$standardTypes[self::ID])) { - static::$standardTypes[self::ID] = new IDType(); - } - - return static::$standardTypes[self::ID]; - } - - /** - * @api - */ - public static function string() : ScalarType - { - if (! isset(static::$standardTypes[self::STRING])) { - static::$standardTypes[self::STRING] = new StringType(); - } - - return static::$standardTypes[self::STRING]; - } - - /** - * @api - */ - public static function boolean() : ScalarType - { - if (! isset(static::$standardTypes[self::BOOLEAN])) { - static::$standardTypes[self::BOOLEAN] = new BooleanType(); - } - - return static::$standardTypes[self::BOOLEAN]; - } - - /** - * @api - */ - public static function int() : ScalarType - { - if (! isset(static::$standardTypes[self::INT])) { - static::$standardTypes[self::INT] = new IntType(); - } - - return static::$standardTypes[self::INT]; - } - - /** - * @api - */ - public static function float() : ScalarType - { - if (! isset(static::$standardTypes[self::FLOAT])) { - static::$standardTypes[self::FLOAT] = new FloatType(); - } - - return static::$standardTypes[self::FLOAT]; - } - - /** - * @api - */ - public static function listOf(Type $wrappedType) : ListOfType - { - return new ListOfType($wrappedType); - } - - /** - * @param callable|NullableType $wrappedType - * - * @api - */ - public static function nonNull($wrappedType) : NonNull - { - return new NonNull($wrappedType); - } - - /** - * Checks if the type is a builtin type - */ - public static function isBuiltInType(Type $type) : bool - { - return in_array($type->name, array_keys(self::getAllBuiltInTypes()), true); - } - - /** - * Returns all builtin in types including base scalar and - * introspection types - * - * @return Type[] - */ - public static function getAllBuiltInTypes() - { - if (self::$builtInTypes === null) { - self::$builtInTypes = array_merge( - Introspection::getTypes(), - self::getStandardTypes() - ); - } - - return self::$builtInTypes; - } - - /** - * Returns all builtin scalar types - * - * @return ScalarType[] - */ - public static function getStandardTypes() - { - return [ - self::ID => static::id(), - self::STRING => static::string(), - self::FLOAT => static::float(), - self::INT => static::int(), - self::BOOLEAN => static::boolean(), - ]; - } - - /** - * @deprecated Use method getStandardTypes() instead - * - * @return Type[] - * - * @codeCoverageIgnore - */ - public static function getInternalTypes() - { - trigger_error(__METHOD__ . ' is deprecated. Use Type::getStandardTypes() instead', E_USER_DEPRECATED); - - return self::getStandardTypes(); - } - - /** - * @param array $types - */ - public static function overrideStandardTypes(array $types) - { - $standardTypes = self::getStandardTypes(); - foreach ($types as $type) { - Utils::invariant( - $type instanceof Type, - 'Expecting instance of %s, got %s', - self::class, - Utils::printSafe($type) - ); - Utils::invariant( - isset($type->name, $standardTypes[$type->name]), - 'Expecting one of the following names for a standard type: %s, got %s', - implode(', ', array_keys($standardTypes)), - Utils::printSafe($type->name ?? null) - ); - static::$standardTypes[$type->name] = $type; - } - } - - /** - * @param Type $type - * - * @api - */ - public static function isInputType($type) : bool - { - return self::getNamedType($type) instanceof InputType; - } - - /** - * @param Type $type - * - * @api - */ - public static function getNamedType($type) : ?Type - { - if ($type === null) { - return null; - } - while ($type instanceof WrappingType) { - $type = $type->getWrappedType(); - } - - return $type; - } - - /** - * @param Type $type - * - * @api - */ - public static function isOutputType($type) : bool - { - return self::getNamedType($type) instanceof OutputType; - } - - /** - * @param Type $type - * - * @api - */ - public static function isLeafType($type) : bool - { - return $type instanceof LeafType; - } - - /** - * @param Type $type - * - * @api - */ - public static function isCompositeType($type) : bool - { - return $type instanceof CompositeType; - } - - /** - * @param Type $type - * - * @api - */ - public static function isAbstractType($type) : bool - { - return $type instanceof AbstractType; - } - - /** - * @param mixed $type - */ - public static function assertType($type) : Type - { - assert($type instanceof Type, new InvariantViolation('Expected ' . Utils::printSafe($type) . ' to be a GraphQL type.')); - - return $type; - } - - /** - * @api - */ - public static function getNullableType(Type $type) : Type - { - return $type instanceof NonNull - ? $type->getWrappedType() - : $type; - } - - /** - * @throws InvariantViolation - */ - public function assertValid() - { - Utils::assertValidName($this->name); - } - - /** - * @return string - */ - #[ReturnTypeWillChange] - public function jsonSerialize() - { - return $this->toString(); - } - - /** - * @return string - */ - public function toString() - { - return $this->name; - } - - /** - * @return string - */ - public function __toString() - { - return $this->toString(); - } - - /** - * @return string|null - */ - protected function tryInferName() - { - if ($this->name) { - return $this->name; - } - - // If class is extended - infer name from className - // QueryType -> Type - // SomeOtherType -> SomeOther - $tmp = new ReflectionClass($this); - $name = $tmp->getShortName(); - - if ($tmp->getNamespaceName() !== __NAMESPACE__) { - return preg_replace('~Type$~', '', $name); - } - - return null; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php deleted file mode 100644 index 1d0cd927..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/TypeWithFields.php +++ /dev/null @@ -1,81 +0,0 @@ - - */ - private $fields; - - private function initializeFields() : void - { - if (isset($this->fields)) { - return; - } - - $fields = $this->config['fields'] ?? []; - $this->fields = FieldDefinition::defineFieldMap($this, $fields); - } - - public function getField(string $name) : FieldDefinition - { - Utils::invariant($this->hasField($name), 'Field "%s" is not defined for type "%s"', $name, $this->name); - - return $this->findField($name); - } - - public function findField(string $name) : ?FieldDefinition - { - $this->initializeFields(); - - if (! isset($this->fields[$name])) { - return null; - } - - if ($this->fields[$name] instanceof UnresolvedFieldDefinition) { - $this->fields[$name] = $this->fields[$name]->resolve(); - } - - return $this->fields[$name]; - } - - public function hasField(string $name) : bool - { - $this->initializeFields(); - - return isset($this->fields[$name]); - } - - /** @inheritDoc */ - public function getFields() : array - { - $this->initializeFields(); - - foreach ($this->fields as $name => $field) { - if (! ($field instanceof UnresolvedFieldDefinition)) { - continue; - } - - $this->fields[$name] = $field->resolve(); - } - - return $this->fields; - } - - /** @inheritDoc */ - public function getFieldNames() : array - { - $this->initializeFields(); - - return array_keys($this->fields); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnionType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnionType.php deleted file mode 100644 index 6301e60a..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnionType.php +++ /dev/null @@ -1,150 +0,0 @@ - - */ - private $possibleTypeNames; - - /** @var UnionTypeExtensionNode[] */ - public $extensionASTNodes; - - /** - * @param mixed[] $config - */ - public function __construct(array $config) - { - if (! isset($config['name'])) { - $config['name'] = $this->tryInferName(); - } - - Utils::invariant(is_string($config['name']), 'Must provide name.'); - - /** - * Optionally provide a custom type resolver function. If one is not provided, - * the default implementation will call `isTypeOf` on each implementing - * Object type. - */ - $this->name = $config['name']; - $this->description = $config['description'] ?? null; - $this->astNode = $config['astNode'] ?? null; - $this->extensionASTNodes = $config['extensionASTNodes'] ?? null; - $this->config = $config; - } - - public function isPossibleType(Type $type) : bool - { - if (! $type instanceof ObjectType) { - return false; - } - - if (! isset($this->possibleTypeNames)) { - $this->possibleTypeNames = []; - foreach ($this->getTypes() as $possibleType) { - $this->possibleTypeNames[$possibleType->name] = true; - } - } - - return isset($this->possibleTypeNames[$type->name]); - } - - /** - * @return ObjectType[] - * - * @throws InvariantViolation - */ - public function getTypes() : array - { - if (! isset($this->types)) { - $types = $this->config['types'] ?? null; - if (is_callable($types)) { - $types = $types(); - } - - if (! is_array($types)) { - throw new InvariantViolation( - sprintf( - 'Must provide Array of types or a callable which returns such an array for Union %s', - $this->name - ) - ); - } - - $rawTypes = $types; - foreach ($rawTypes as $i => $rawType) { - $rawTypes[$i] = Schema::resolveType($rawType); - } - - $this->types = $rawTypes; - } - - return $this->types; - } - - /** - * Resolves concrete ObjectType for given object value - * - * @param object $objectValue - * @param mixed $context - * - * @return callable|null - */ - public function resolveType($objectValue, $context, ResolveInfo $info) - { - if (isset($this->config['resolveType'])) { - $fn = $this->config['resolveType']; - - return $fn($objectValue, $context, $info); - } - - return null; - } - - /** - * @throws InvariantViolation - */ - public function assertValid() : void - { - parent::assertValid(); - - if (! isset($this->config['resolveType'])) { - return; - } - - Utils::invariant( - is_callable($this->config['resolveType']), - sprintf( - '%s must provide "resolveType" as a function, but got: %s', - $this->name, - Utils::printSafe($this->config['resolveType']) - ) - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php deleted file mode 100644 index 7a31c475..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/UnmodifiedType.php +++ /dev/null @@ -1,19 +0,0 @@ -|Type) $resolver */ - private $resolver; - - /** - * @param callable(): (FieldDefinition|array|Type) $resolver - */ - public function __construct(Type $type, string $name, callable $resolver) - { - $this->type = $type; - $this->name = $name; - $this->resolver = $resolver; - } - - public function getName() : string - { - return $this->name; - } - - public function resolve() : FieldDefinition - { - $field = ($this->resolver)(); - - if ($field instanceof FieldDefinition) { - if ($field->name !== $this->name) { - throw new InvariantViolation( - sprintf('%s.%s should not dynamically change its name when resolved lazily.', $this->type->name, $this->name) - ); - } - - return $field; - } - - if (! is_array($field)) { - return FieldDefinition::create(['name' => $this->name, 'type' => $field]); - } - - if (! isset($field['name'])) { - $field['name'] = $this->name; - } elseif ($field['name'] !== $this->name) { - throw new InvariantViolation( - sprintf('%s.%s should not dynamically change its name when resolved lazily.', $this->type->name, $this->name) - ); - } - - if (isset($field['args']) && ! is_array($field['args'])) { - throw new InvariantViolation( - sprintf('%s.%s args must be an array.', $this->type->name, $this->name) - ); - } - - return FieldDefinition::create($field); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/WrappingType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/WrappingType.php deleted file mode 100644 index 26fbe85d..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Definition/WrappingType.php +++ /dev/null @@ -1,10 +0,0 @@ - */ - private static $map = []; - - /** - * @param array $options - * Available options: - * - descriptions - * Whether to include descriptions in the introspection result. - * Default: true - * - directiveIsRepeatable - * Whether to include `isRepeatable` flag on directives. - * Default: false - * - * @return string - * - * @api - */ - public static function getIntrospectionQuery(array $options = []) - { - $optionsWithDefaults = array_merge([ - 'descriptions' => true, - 'directiveIsRepeatable' => false, - ], $options); - - $descriptions = $optionsWithDefaults['descriptions'] ? 'description' : ''; - $directiveIsRepeatable = $optionsWithDefaults['directiveIsRepeatable'] ? 'isRepeatable' : ''; - - return <<name, self::getTypes()); - } - - public static function getTypes() - { - return [ - '__Schema' => self::_schema(), - '__Type' => self::_type(), - '__Directive' => self::_directive(), - '__Field' => self::_field(), - '__InputValue' => self::_inputValue(), - '__EnumValue' => self::_enumValue(), - '__TypeKind' => self::_typeKind(), - '__DirectiveLocation' => self::_directiveLocation(), - ]; - } - - /** - * Build an introspection query from a Schema - * - * Introspection is useful for utilities that care about type and field - * relationships, but do not need to traverse through those relationships. - * - * This is the inverse of BuildClientSchema::build(). The primary use case is outside - * of the server context, for instance when doing schema comparisons. - * - * @param array $options - * Available options: - * - descriptions - * Whether to include `isRepeatable` flag on directives. - * Default: true - * - directiveIsRepeatable - * Whether to include descriptions in the introspection result. - * Default: true - * - * @return array>|null - * - * @api - */ - public static function fromSchema(Schema $schema, array $options = []) : ?array - { - $optionsWithDefaults = array_merge(['directiveIsRepeatable' => true], $options); - - $result = GraphQL::executeQuery( - $schema, - self::getIntrospectionQuery($optionsWithDefaults) - ); - - return $result->data; - } - - public static function _schema() - { - if (! isset(self::$map['__Schema'])) { - self::$map['__Schema'] = new ObjectType([ - 'name' => '__Schema', - 'isIntrospection' => true, - 'description' => - 'A GraphQL Schema defines the capabilities of a GraphQL ' . - 'server. It exposes all available types and directives on ' . - 'the server, as well as the entry points for query, mutation, and ' . - 'subscription operations.', - 'fields' => [ - 'types' => [ - 'description' => 'A list of all types supported by this server.', - 'type' => new NonNull(new ListOfType(new NonNull(self::_type()))), - 'resolve' => static function (Schema $schema) : array { - return array_values($schema->getTypeMap()); - }, - ], - 'queryType' => [ - 'description' => 'The type that query operations will be rooted at.', - 'type' => new NonNull(self::_type()), - 'resolve' => static function (Schema $schema) : ?ObjectType { - return $schema->getQueryType(); - }, - ], - 'mutationType' => [ - 'description' => - 'If this server supports mutation, the type that ' . - 'mutation operations will be rooted at.', - 'type' => self::_type(), - 'resolve' => static function (Schema $schema) : ?ObjectType { - return $schema->getMutationType(); - }, - ], - 'subscriptionType' => [ - 'description' => 'If this server support subscription, the type that subscription operations will be rooted at.', - 'type' => self::_type(), - 'resolve' => static function (Schema $schema) : ?ObjectType { - return $schema->getSubscriptionType(); - }, - ], - 'directives' => [ - 'description' => 'A list of all directives supported by this server.', - 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_directive()))), - 'resolve' => static function (Schema $schema) : array { - return $schema->getDirectives(); - }, - ], - ], - ]); - } - - return self::$map['__Schema']; - } - - public static function _type() - { - if (! isset(self::$map['__Type'])) { - self::$map['__Type'] = new ObjectType([ - 'name' => '__Type', - 'isIntrospection' => true, - 'description' => - 'The fundamental unit of any GraphQL Schema is the type. There are ' . - 'many kinds of types in GraphQL as represented by the `__TypeKind` enum.' . - "\n\n" . - 'Depending on the kind of a type, certain fields describe ' . - 'information about that type. Scalar types provide no information ' . - 'beyond a name and description, while Enum types provide their values. ' . - 'Object and Interface types provide the fields they describe. Abstract ' . - 'types, Union and Interface, provide the Object types possible ' . - 'at runtime. List and NonNull types compose other types.', - 'fields' => static function () : array { - return [ - 'kind' => [ - 'type' => Type::nonNull(self::_typeKind()), - 'resolve' => static function (Type $type) { - switch (true) { - case $type instanceof ListOfType: - return TypeKind::LIST; - case $type instanceof NonNull: - return TypeKind::NON_NULL; - case $type instanceof ScalarType: - return TypeKind::SCALAR; - case $type instanceof ObjectType: - return TypeKind::OBJECT; - case $type instanceof EnumType: - return TypeKind::ENUM; - case $type instanceof InputObjectType: - return TypeKind::INPUT_OBJECT; - case $type instanceof InterfaceType: - return TypeKind::INTERFACE; - case $type instanceof UnionType: - return TypeKind::UNION; - default: - throw new Exception('Unknown kind of type: ' . Utils::printSafe($type)); - } - }, - ], - 'name' => [ - 'type' => Type::string(), - 'resolve' => static function ($obj) { - return $obj->name; - }, - ], - 'description' => [ - 'type' => Type::string(), - 'resolve' => static function ($obj) { - return $obj->description; - }, - ], - 'fields' => [ - 'type' => Type::listOf(Type::nonNull(self::_field())), - 'args' => [ - 'includeDeprecated' => ['type' => Type::boolean(), 'defaultValue' => false], - ], - 'resolve' => static function (Type $type, $args) : ?array { - if ($type instanceof ObjectType || $type instanceof InterfaceType) { - $fields = $type->getFields(); - - if (! ($args['includeDeprecated'] ?? false)) { - $fields = array_filter( - $fields, - static function (FieldDefinition $field) : bool { - return ! $field->deprecationReason; - } - ); - } - - return array_values($fields); - } - - return null; - }, - ], - 'interfaces' => [ - 'type' => Type::listOf(Type::nonNull(self::_type())), - 'resolve' => static function ($type) : ?array { - if ($type instanceof ObjectType || $type instanceof InterfaceType) { - return $type->getInterfaces(); - } - - return null; - }, - ], - 'possibleTypes' => [ - 'type' => Type::listOf(Type::nonNull(self::_type())), - 'resolve' => static function ($type, $args, $context, ResolveInfo $info) : ?array { - if ($type instanceof InterfaceType || $type instanceof UnionType) { - return $info->schema->getPossibleTypes($type); - } - - return null; - }, - ], - 'enumValues' => [ - 'type' => Type::listOf(Type::nonNull(self::_enumValue())), - 'args' => [ - 'includeDeprecated' => ['type' => Type::boolean(), 'defaultValue' => false], - ], - 'resolve' => static function ($type, $args) : ?array { - if ($type instanceof EnumType) { - $values = array_values($type->getValues()); - - if (! ($args['includeDeprecated'] ?? false)) { - $values = array_filter( - $values, - static function ($value) : bool { - return ! $value->deprecationReason; - } - ); - } - - return $values; - } - - return null; - }, - ], - 'inputFields' => [ - 'type' => Type::listOf(Type::nonNull(self::_inputValue())), - 'resolve' => static function ($type) : ?array { - if ($type instanceof InputObjectType) { - return array_values($type->getFields()); - } - - return null; - }, - ], - 'ofType' => [ - 'type' => self::_type(), - 'resolve' => static function ($type) : ?Type { - if ($type instanceof WrappingType) { - return $type->getWrappedType(); - } - - return null; - }, - ], - ]; - }, - ]); - } - - return self::$map['__Type']; - } - - public static function _typeKind() - { - if (! isset(self::$map['__TypeKind'])) { - self::$map['__TypeKind'] = new EnumType([ - 'name' => '__TypeKind', - 'isIntrospection' => true, - 'description' => 'An enum describing what kind of type a given `__Type` is.', - 'values' => [ - 'SCALAR' => [ - 'value' => TypeKind::SCALAR, - 'description' => 'Indicates this type is a scalar.', - ], - 'OBJECT' => [ - 'value' => TypeKind::OBJECT, - 'description' => 'Indicates this type is an object. `fields` and `interfaces` are valid fields.', - ], - 'INTERFACE' => [ - 'value' => TypeKind::INTERFACE, - 'description' => 'Indicates this type is an interface. `fields`, `interfaces`, and `possibleTypes` are valid fields.', - ], - 'UNION' => [ - 'value' => TypeKind::UNION, - 'description' => 'Indicates this type is a union. `possibleTypes` is a valid field.', - ], - 'ENUM' => [ - 'value' => TypeKind::ENUM, - 'description' => 'Indicates this type is an enum. `enumValues` is a valid field.', - ], - 'INPUT_OBJECT' => [ - 'value' => TypeKind::INPUT_OBJECT, - 'description' => 'Indicates this type is an input object. `inputFields` is a valid field.', - ], - 'LIST' => [ - 'value' => TypeKind::LIST, - 'description' => 'Indicates this type is a list. `ofType` is a valid field.', - ], - 'NON_NULL' => [ - 'value' => TypeKind::NON_NULL, - 'description' => 'Indicates this type is a non-null. `ofType` is a valid field.', - ], - ], - ]); - } - - return self::$map['__TypeKind']; - } - - public static function _field() - { - if (! isset(self::$map['__Field'])) { - self::$map['__Field'] = new ObjectType([ - 'name' => '__Field', - 'isIntrospection' => true, - 'description' => - 'Object and Interface types are described by a list of Fields, each of ' . - 'which has a name, potentially a list of arguments, and a return type.', - 'fields' => static function () : array { - return [ - 'name' => [ - 'type' => Type::nonNull(Type::string()), - 'resolve' => static function (FieldDefinition $field) : string { - return $field->name; - }, - ], - 'description' => [ - 'type' => Type::string(), - 'resolve' => static function (FieldDefinition $field) : ?string { - return $field->description; - }, - ], - 'args' => [ - 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_inputValue()))), - 'resolve' => static function (FieldDefinition $field) : array { - return $field->args ?? []; - }, - ], - 'type' => [ - 'type' => Type::nonNull(self::_type()), - 'resolve' => static function (FieldDefinition $field) : Type { - return $field->getType(); - }, - ], - 'isDeprecated' => [ - 'type' => Type::nonNull(Type::boolean()), - 'resolve' => static function (FieldDefinition $field) : bool { - return (bool) $field->deprecationReason; - }, - ], - 'deprecationReason' => [ - 'type' => Type::string(), - 'resolve' => static function (FieldDefinition $field) : ?string { - return $field->deprecationReason; - }, - ], - ]; - }, - ]); - } - - return self::$map['__Field']; - } - - public static function _inputValue() - { - if (! isset(self::$map['__InputValue'])) { - self::$map['__InputValue'] = new ObjectType([ - 'name' => '__InputValue', - 'isIntrospection' => true, - 'description' => - 'Arguments provided to Fields or Directives and the input fields of an ' . - 'InputObject are represented as Input Values which describe their type ' . - 'and optionally a default value.', - 'fields' => static function () : array { - return [ - 'name' => [ - 'type' => Type::nonNull(Type::string()), - 'resolve' => static function ($inputValue) : string { - /** @var FieldArgument|InputObjectField $inputValue */ - $inputValue = $inputValue; - - return $inputValue->name; - }, - ], - 'description' => [ - 'type' => Type::string(), - 'resolve' => static function ($inputValue) : ?string { - /** @var FieldArgument|InputObjectField $inputValue */ - $inputValue = $inputValue; - - return $inputValue->description; - }, - ], - 'type' => [ - 'type' => Type::nonNull(self::_type()), - 'resolve' => static function ($value) { - return method_exists($value, 'getType') - ? $value->getType() - : $value->type; - }, - ], - 'defaultValue' => [ - 'type' => Type::string(), - 'description' => - 'A GraphQL-formatted string representing the default value for this input value.', - 'resolve' => static function ($inputValue) : ?string { - /** @var FieldArgument|InputObjectField $inputValue */ - $inputValue = $inputValue; - - return ! $inputValue->defaultValueExists() - ? null - : Printer::doPrint(AST::astFromValue( - $inputValue->defaultValue, - $inputValue->getType() - )); - }, - ], - ]; - }, - ]); - } - - return self::$map['__InputValue']; - } - - public static function _enumValue() - { - if (! isset(self::$map['__EnumValue'])) { - self::$map['__EnumValue'] = new ObjectType([ - 'name' => '__EnumValue', - 'isIntrospection' => true, - 'description' => - 'One possible value for a given Enum. Enum values are unique values, not ' . - 'a placeholder for a string or numeric value. However an Enum value is ' . - 'returned in a JSON response as a string.', - 'fields' => [ - 'name' => [ - 'type' => Type::nonNull(Type::string()), - 'resolve' => static function ($enumValue) { - return $enumValue->name; - }, - ], - 'description' => [ - 'type' => Type::string(), - 'resolve' => static function ($enumValue) { - return $enumValue->description; - }, - ], - 'isDeprecated' => [ - 'type' => Type::nonNull(Type::boolean()), - 'resolve' => static function ($enumValue) : bool { - return (bool) $enumValue->deprecationReason; - }, - ], - 'deprecationReason' => [ - 'type' => Type::string(), - 'resolve' => static function ($enumValue) { - return $enumValue->deprecationReason; - }, - ], - ], - ]); - } - - return self::$map['__EnumValue']; - } - - public static function _directive() - { - if (! isset(self::$map['__Directive'])) { - self::$map['__Directive'] = new ObjectType([ - 'name' => '__Directive', - 'isIntrospection' => true, - 'description' => 'A Directive provides a way to describe alternate runtime execution and ' . - 'type validation behavior in a GraphQL document.' . - "\n\nIn some cases, you need to provide options to alter GraphQL's " . - 'execution behavior in ways field arguments will not suffice, such as ' . - 'conditionally including or skipping a field. Directives provide this by ' . - 'describing additional information to the executor.', - 'fields' => [ - 'name' => [ - 'type' => Type::nonNull(Type::string()), - 'resolve' => static function ($obj) { - return $obj->name; - }, - ], - 'description' => [ - 'type' => Type::string(), - 'resolve' => static function ($obj) { - return $obj->description; - }, - ], - 'args' => [ - 'type' => Type::nonNull(Type::listOf(Type::nonNull(self::_inputValue()))), - 'resolve' => static function (Directive $directive) : array { - return $directive->args ?? []; - }, - ], - 'isRepeatable' => [ - 'type' => Type::nonNull(Type::boolean()), - 'resolve' => static function (Directive $directive) : bool { - return $directive->isRepeatable; - }, - ], - 'locations' => [ - 'type' => Type::nonNull(Type::listOf(Type::nonNull( - self::_directiveLocation() - ))), - 'resolve' => static function ($obj) { - return $obj->locations; - }, - ], - ], - ]); - } - - return self::$map['__Directive']; - } - - public static function _directiveLocation() - { - if (! isset(self::$map['__DirectiveLocation'])) { - self::$map['__DirectiveLocation'] = new EnumType([ - 'name' => '__DirectiveLocation', - 'isIntrospection' => true, - 'description' => - 'A Directive can be adjacent to many parts of the GraphQL language, a ' . - '__DirectiveLocation describes one such possible adjacencies.', - 'values' => [ - 'QUERY' => [ - 'value' => DirectiveLocation::QUERY, - 'description' => 'Location adjacent to a query operation.', - ], - 'MUTATION' => [ - 'value' => DirectiveLocation::MUTATION, - 'description' => 'Location adjacent to a mutation operation.', - ], - 'SUBSCRIPTION' => [ - 'value' => DirectiveLocation::SUBSCRIPTION, - 'description' => 'Location adjacent to a subscription operation.', - ], - 'FIELD' => [ - 'value' => DirectiveLocation::FIELD, - 'description' => 'Location adjacent to a field.', - ], - 'FRAGMENT_DEFINITION' => [ - 'value' => DirectiveLocation::FRAGMENT_DEFINITION, - 'description' => 'Location adjacent to a fragment definition.', - ], - 'FRAGMENT_SPREAD' => [ - 'value' => DirectiveLocation::FRAGMENT_SPREAD, - 'description' => 'Location adjacent to a fragment spread.', - ], - 'INLINE_FRAGMENT' => [ - 'value' => DirectiveLocation::INLINE_FRAGMENT, - 'description' => 'Location adjacent to an inline fragment.', - ], - 'VARIABLE_DEFINITION' => [ - 'value' => DirectiveLocation::VARIABLE_DEFINITION, - 'description' => 'Location adjacent to a variable definition.', - ], - 'SCHEMA' => [ - 'value' => DirectiveLocation::SCHEMA, - 'description' => 'Location adjacent to a schema definition.', - ], - 'SCALAR' => [ - 'value' => DirectiveLocation::SCALAR, - 'description' => 'Location adjacent to a scalar definition.', - ], - 'OBJECT' => [ - 'value' => DirectiveLocation::OBJECT, - 'description' => 'Location adjacent to an object type definition.', - ], - 'FIELD_DEFINITION' => [ - 'value' => DirectiveLocation::FIELD_DEFINITION, - 'description' => 'Location adjacent to a field definition.', - ], - 'ARGUMENT_DEFINITION' => [ - 'value' => DirectiveLocation::ARGUMENT_DEFINITION, - 'description' => 'Location adjacent to an argument definition.', - ], - 'INTERFACE' => [ - 'value' => DirectiveLocation::IFACE, - 'description' => 'Location adjacent to an interface definition.', - ], - 'UNION' => [ - 'value' => DirectiveLocation::UNION, - 'description' => 'Location adjacent to a union definition.', - ], - 'ENUM' => [ - 'value' => DirectiveLocation::ENUM, - 'description' => 'Location adjacent to an enum definition.', - ], - 'ENUM_VALUE' => [ - 'value' => DirectiveLocation::ENUM_VALUE, - 'description' => 'Location adjacent to an enum value definition.', - ], - 'INPUT_OBJECT' => [ - 'value' => DirectiveLocation::INPUT_OBJECT, - 'description' => 'Location adjacent to an input object type definition.', - ], - 'INPUT_FIELD_DEFINITION' => [ - 'value' => DirectiveLocation::INPUT_FIELD_DEFINITION, - 'description' => 'Location adjacent to an input object field definition.', - ], - - ], - ]); - } - - return self::$map['__DirectiveLocation']; - } - - public static function schemaMetaFieldDef() : FieldDefinition - { - if (! isset(self::$map[self::SCHEMA_FIELD_NAME])) { - self::$map[self::SCHEMA_FIELD_NAME] = FieldDefinition::create([ - 'name' => self::SCHEMA_FIELD_NAME, - 'type' => Type::nonNull(self::_schema()), - 'description' => 'Access the current type schema of this server.', - 'args' => [], - 'resolve' => static function ( - $source, - $args, - $context, - ResolveInfo $info - ) : Schema { - return $info->schema; - }, - ]); - } - - return self::$map[self::SCHEMA_FIELD_NAME]; - } - - public static function typeMetaFieldDef() : FieldDefinition - { - if (! isset(self::$map[self::TYPE_FIELD_NAME])) { - self::$map[self::TYPE_FIELD_NAME] = FieldDefinition::create([ - 'name' => self::TYPE_FIELD_NAME, - 'type' => self::_type(), - 'description' => 'Request the type information of a single type.', - 'args' => [ - ['name' => 'name', 'type' => Type::nonNull(Type::string())], - ], - 'resolve' => static function ($source, $args, $context, ResolveInfo $info) : Type { - return $info->schema->getType($args['name']); - }, - ]); - } - - return self::$map[self::TYPE_FIELD_NAME]; - } - - public static function typeNameMetaFieldDef() : FieldDefinition - { - if (! isset(self::$map[self::TYPE_NAME_FIELD_NAME])) { - self::$map[self::TYPE_NAME_FIELD_NAME] = FieldDefinition::create([ - 'name' => self::TYPE_NAME_FIELD_NAME, - 'type' => Type::nonNull(Type::string()), - 'description' => 'The name of the current Object type at runtime.', - 'args' => [], - 'resolve' => static function ( - $source, - $args, - $context, - ResolveInfo $info - ) : string { - return $info->parentType->name; - }, - ]); - } - - return self::$map[self::TYPE_NAME_FIELD_NAME]; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Schema.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Schema.php deleted file mode 100644 index c2cf0d58..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/Schema.php +++ /dev/null @@ -1,603 +0,0 @@ - $MyAppQueryRootType, - * 'mutation' => $MyAppMutationRootType, - * ]); - * - * Or using Schema Config instance: - * - * $config = GraphQL\Type\SchemaConfig::create() - * ->setQuery($MyAppQueryRootType) - * ->setMutation($MyAppMutationRootType); - * - * $schema = new GraphQL\Type\Schema($config); - */ -class Schema -{ - /** @var SchemaConfig */ - private $config; - - /** - * Contains currently resolved schema types - * - * @var Type[] - */ - private $resolvedTypes = []; - - /** - * Lazily initialised. - * - * @var array - */ - private $implementationsMap; - - /** - * True when $resolvedTypes contain all possible schema types - * - * @var bool - */ - private $fullyLoaded = false; - - /** @var Error[] */ - private $validationErrors; - - /** @var SchemaTypeExtensionNode[] */ - public $extensionASTNodes = []; - - /** - * @param mixed[]|SchemaConfig $config - * - * @api - */ - public function __construct($config) - { - if (is_array($config)) { - $config = SchemaConfig::create($config); - } - - // If this schema was built from a source known to be valid, then it may be - // marked with assumeValid to avoid an additional type system validation. - if ($config->getAssumeValid()) { - $this->validationErrors = []; - } else { - // Otherwise check for common mistakes during construction to produce - // clear and early error messages. - Utils::invariant( - $config instanceof SchemaConfig, - 'Schema constructor expects instance of GraphQL\Type\SchemaConfig or an array with keys: %s; but got: %s', - implode( - ', ', - [ - 'query', - 'mutation', - 'subscription', - 'types', - 'directives', - 'typeLoader', - ] - ), - Utils::getVariableType($config) - ); - Utils::invariant( - ! $config->types || is_array($config->types) || is_callable($config->types), - '"types" must be array or callable if provided but got: ' . Utils::getVariableType($config->types) - ); - Utils::invariant( - $config->directives === null || is_array($config->directives), - '"directives" must be Array if provided but got: ' . Utils::getVariableType($config->directives) - ); - } - - $this->config = $config; - $this->extensionASTNodes = $config->extensionASTNodes; - - if ($config->query !== null) { - $this->resolvedTypes[$config->query->name] = $config->query; - } - if ($config->mutation !== null) { - $this->resolvedTypes[$config->mutation->name] = $config->mutation; - } - if ($config->subscription !== null) { - $this->resolvedTypes[$config->subscription->name] = $config->subscription; - } - if (is_array($this->config->types)) { - foreach ($this->resolveAdditionalTypes() as $type) { - if (isset($this->resolvedTypes[$type->name])) { - Utils::invariant( - $type === $this->resolvedTypes[$type->name], - sprintf( - 'Schema must contain unique named types but contains multiple types named "%s" (see http://webonyx.github.io/graphql-php/type-system/#type-registry).', - $type - ) - ); - } - $this->resolvedTypes[$type->name] = $type; - } - } - $this->resolvedTypes += Type::getStandardTypes() + Introspection::getTypes(); - - if ($this->config->typeLoader) { - return; - } - - // Perform full scan of the schema - $this->getTypeMap(); - } - - /** - * @return Generator - */ - private function resolveAdditionalTypes() - { - $types = $this->config->types ?? []; - - if (is_callable($types)) { - $types = $types(); - } - - if (! is_array($types) && ! $types instanceof Traversable) { - throw new InvariantViolation(sprintf( - 'Schema types callable must return array or instance of Traversable but got: %s', - Utils::getVariableType($types) - )); - } - - foreach ($types as $index => $type) { - $type = self::resolveType($type); - if (! $type instanceof Type) { - throw new InvariantViolation(sprintf( - 'Each entry of schema types must be instance of GraphQL\Type\Definition\Type but entry at %s is %s', - $index, - Utils::printSafe($type) - )); - } - yield $type; - } - } - - /** - * Returns array of all types in this schema. Keys of this array represent type names, values are instances - * of corresponding type definitions - * - * This operation requires full schema scan. Do not use in production environment. - * - * @return array - * - * @api - */ - public function getTypeMap() : array - { - if (! $this->fullyLoaded) { - $this->resolvedTypes = $this->collectAllTypes(); - $this->fullyLoaded = true; - } - - return $this->resolvedTypes; - } - - /** - * @return Type[] - */ - private function collectAllTypes() - { - $typeMap = []; - foreach ($this->resolvedTypes as $type) { - $typeMap = TypeInfo::extractTypes($type, $typeMap); - } - foreach ($this->getDirectives() as $directive) { - if (! ($directive instanceof Directive)) { - continue; - } - - $typeMap = TypeInfo::extractTypesFromDirectives($directive, $typeMap); - } - // When types are set as array they are resolved in constructor - if (is_callable($this->config->types)) { - foreach ($this->resolveAdditionalTypes() as $type) { - $typeMap = TypeInfo::extractTypes($type, $typeMap); - } - } - - return $typeMap; - } - - /** - * Returns a list of directives supported by this schema - * - * @return Directive[] - * - * @api - */ - public function getDirectives() - { - return $this->config->directives ?? GraphQL::getStandardDirectives(); - } - - /** - * @param string $operation - * - * @return ObjectType|null - */ - public function getOperationType($operation) - { - switch ($operation) { - case 'query': - return $this->getQueryType(); - case 'mutation': - return $this->getMutationType(); - case 'subscription': - return $this->getSubscriptionType(); - default: - return null; - } - } - - /** - * Returns schema query type - * - * @return ObjectType - * - * @api - */ - public function getQueryType() : ?Type - { - return $this->config->query; - } - - /** - * Returns schema mutation type - * - * @return ObjectType|null - * - * @api - */ - public function getMutationType() : ?Type - { - return $this->config->mutation; - } - - /** - * Returns schema subscription - * - * @return ObjectType|null - * - * @api - */ - public function getSubscriptionType() : ?Type - { - return $this->config->subscription; - } - - /** - * @return SchemaConfig - * - * @api - */ - public function getConfig() - { - return $this->config; - } - - /** - * Returns type by its name - * - * @api - */ - public function getType(string $name) : ?Type - { - if (! isset($this->resolvedTypes[$name])) { - $type = $this->loadType($name); - - if (! $type) { - return null; - } - $this->resolvedTypes[$name] = self::resolveType($type); - } - - return $this->resolvedTypes[$name]; - } - - public function hasType(string $name) : bool - { - return $this->getType($name) !== null; - } - - private function loadType(string $typeName) : ?Type - { - $typeLoader = $this->config->typeLoader; - - if (! isset($typeLoader)) { - return $this->defaultTypeLoader($typeName); - } - - $type = $typeLoader($typeName); - - if (! $type instanceof Type) { - // Unless you know what you're doing, kindly resist the temptation to refactor or simplify this block. The - // twisty logic here is tuned for performance, and meant to prioritize the "happy path" (the result returned - // from the type loader is already a Type), and only checks for callable if that fails. If the result is - // neither a Type nor a callable, then we throw an exception. - - if (is_callable($type)) { - $type = $type(); - - if (! $type instanceof Type) { - $this->throwNotAType($type, $typeName); - } - } else { - $this->throwNotAType($type, $typeName); - } - } - - if ($type->name !== $typeName) { - throw new InvariantViolation( - sprintf('Type loader is expected to return type "%s", but it returned "%s"', $typeName, $type->name) - ); - } - - return $type; - } - - protected function throwNotAType($type, string $typeName) - { - throw new InvariantViolation( - sprintf( - 'Type loader is expected to return a callable or valid type "%s", but it returned %s', - $typeName, - Utils::printSafe($type) - ) - ); - } - - private function defaultTypeLoader(string $typeName) : ?Type - { - // Default type loader simply falls back to collecting all types - $typeMap = $this->getTypeMap(); - - return $typeMap[$typeName] ?? null; - } - - /** - * @param Type|callable():Type $type - */ - public static function resolveType($type) : Type - { - if ($type instanceof Type) { - return $type; - } - - return $type(); - } - - /** - * Returns all possible concrete types for given abstract type - * (implementations for interfaces and members of union type for unions) - * - * This operation requires full schema scan. Do not use in production environment. - * - * @param InterfaceType|UnionType $abstractType - * - * @return array - * - * @api - */ - public function getPossibleTypes(Type $abstractType) : array - { - return $abstractType instanceof UnionType - ? $abstractType->getTypes() - : $this->getImplementations($abstractType)->objects(); - } - - /** - * Returns all types that implement a given interface type. - * - * This operations requires full schema scan. Do not use in production environment. - * - * @api - */ - public function getImplementations(InterfaceType $abstractType) : InterfaceImplementations - { - return $this->collectImplementations()[$abstractType->name]; - } - - /** - * @return array - */ - private function collectImplementations() : array - { - if (! isset($this->implementationsMap)) { - /** @var array> $foundImplementations */ - $foundImplementations = []; - foreach ($this->getTypeMap() as $type) { - if ($type instanceof InterfaceType) { - if (! isset($foundImplementations[$type->name])) { - $foundImplementations[$type->name] = ['objects' => [], 'interfaces' => []]; - } - - foreach ($type->getInterfaces() as $iface) { - if (! isset($foundImplementations[$iface->name])) { - $foundImplementations[$iface->name] = ['objects' => [], 'interfaces' => []]; - } - $foundImplementations[$iface->name]['interfaces'][] = $type; - } - } elseif ($type instanceof ObjectType) { - foreach ($type->getInterfaces() as $iface) { - if (! isset($foundImplementations[$iface->name])) { - $foundImplementations[$iface->name] = ['objects' => [], 'interfaces' => []]; - } - $foundImplementations[$iface->name]['objects'][] = $type; - } - } - } - $this->implementationsMap = array_map( - static function (array $implementations) : InterfaceImplementations { - return new InterfaceImplementations($implementations['objects'], $implementations['interfaces']); - }, - $foundImplementations - ); - } - - return $this->implementationsMap; - } - - /** - * @deprecated as of 14.4.0 use isSubType instead, will be removed in 15.0.0. - * - * Returns true if object type is concrete type of given abstract type - * (implementation for interfaces and members of union type for unions) - * - * @api - * @codeCoverageIgnore - */ - public function isPossibleType(AbstractType $abstractType, ObjectType $possibleType) : bool - { - return $this->isSubType($abstractType, $possibleType); - } - - /** - * Returns true if the given type is a sub type of the given abstract type. - * - * @param UnionType|InterfaceType $abstractType - * @param ObjectType|InterfaceType $maybeSubType - * - * @api - */ - public function isSubType(AbstractType $abstractType, ImplementingType $maybeSubType) : bool - { - if ($abstractType instanceof InterfaceType) { - return $maybeSubType->implementsInterface($abstractType); - } - - if ($abstractType instanceof UnionType) { - return $abstractType->isPossibleType($maybeSubType); - } - - throw new InvalidArgumentException(sprintf('$abstractType must be of type UnionType|InterfaceType got: %s.', get_class($abstractType))); - } - - /** - * Returns instance of directive by name - * - * @api - */ - public function getDirective(string $name) : ?Directive - { - foreach ($this->getDirectives() as $directive) { - if ($directive->name === $name) { - return $directive; - } - } - - return null; - } - - public function getAstNode() : ?SchemaDefinitionNode - { - return $this->config->getAstNode(); - } - - /** - * Validates schema. - * - * This operation requires full schema scan. Do not use in production environment. - * - * @throws InvariantViolation - * - * @api - */ - public function assertValid() - { - $errors = $this->validate(); - - if ($errors) { - throw new InvariantViolation(implode("\n\n", $this->validationErrors)); - } - - $internalTypes = Type::getStandardTypes() + Introspection::getTypes(); - foreach ($this->getTypeMap() as $name => $type) { - if (isset($internalTypes[$name])) { - continue; - } - - $type->assertValid(); - - // Make sure type loader returns the same instance as registered in other places of schema - if (! $this->config->typeLoader) { - continue; - } - - Utils::invariant( - $this->loadType($name) === $type, - sprintf( - 'Type loader returns different instance for %s than field/argument definitions. Make sure you always return the same instance for the same type name.', - $name - ) - ); - } - } - - /** - * Validates schema. - * - * This operation requires full schema scan. Do not use in production environment. - * - * @return InvariantViolation[]|Error[] - * - * @api - */ - public function validate() - { - // If this Schema has already been validated, return the previous results. - if ($this->validationErrors !== null) { - return $this->validationErrors; - } - // Validate the schema, producing a list of errors. - $context = new SchemaValidationContext($this); - $context->validateRootTypes(); - $context->validateDirectives(); - $context->validateTypes(); - - // Persist the results of validation before returning to ensure validation - // does not run multiple times for this schema. - $this->validationErrors = $context->getErrors(); - - return $this->validationErrors; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaConfig.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaConfig.php deleted file mode 100644 index f3511d78..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaConfig.php +++ /dev/null @@ -1,313 +0,0 @@ -setQuery($myQueryType) - * ->setTypeLoader($myTypeLoader); - * - * $schema = new Schema($config); - */ -class SchemaConfig -{ - /** @var ObjectType|null */ - public $query; - - /** @var ObjectType|null */ - public $mutation; - - /** @var ObjectType|null */ - public $subscription; - - /** @var Type[]|callable */ - public $types = []; - - /** @var Directive[]|null */ - public $directives; - - /** @var callable|null */ - public $typeLoader; - - /** @var SchemaDefinitionNode|null */ - public $astNode; - - /** @var bool */ - public $assumeValid = false; - - /** @var SchemaTypeExtensionNode[] */ - public $extensionASTNodes = []; - - /** - * Converts an array of options to instance of SchemaConfig - * (or just returns empty config when array is not passed). - * - * @param mixed[] $options - * - * @return SchemaConfig - * - * @api - */ - public static function create(array $options = []) - { - $config = new static(); - - if (count($options) > 0) { - if (isset($options['query'])) { - $config->setQuery($options['query']); - } - - if (isset($options['mutation'])) { - $config->setMutation($options['mutation']); - } - - if (isset($options['subscription'])) { - $config->setSubscription($options['subscription']); - } - - if (isset($options['types'])) { - $config->setTypes($options['types']); - } - - if (isset($options['directives'])) { - $config->setDirectives($options['directives']); - } - - if (isset($options['typeLoader'])) { - Utils::invariant( - is_callable($options['typeLoader']), - 'Schema type loader must be callable if provided but got: %s', - Utils::printSafe($options['typeLoader']) - ); - $config->setTypeLoader($options['typeLoader']); - } - - if (isset($options['astNode'])) { - $config->setAstNode($options['astNode']); - } - - if (isset($options['assumeValid'])) { - $config->setAssumeValid((bool) $options['assumeValid']); - } - - if (isset($options['extensionASTNodes'])) { - $config->setExtensionASTNodes($options['extensionASTNodes']); - } - } - - return $config; - } - - /** - * @return SchemaDefinitionNode|null - */ - public function getAstNode() - { - return $this->astNode; - } - - /** - * @return SchemaConfig - */ - public function setAstNode(SchemaDefinitionNode $astNode) - { - $this->astNode = $astNode; - - return $this; - } - - /** - * @return ObjectType|null - * - * @api - */ - public function getQuery() - { - return $this->query; - } - - /** - * @param ObjectType|null $query - * - * @return SchemaConfig - * - * @api - */ - public function setQuery($query) - { - $this->query = $query; - - return $this; - } - - /** - * @return ObjectType|null - * - * @api - */ - public function getMutation() - { - return $this->mutation; - } - - /** - * @param ObjectType|null $mutation - * - * @return SchemaConfig - * - * @api - */ - public function setMutation($mutation) - { - $this->mutation = $mutation; - - return $this; - } - - /** - * @return ObjectType|null - * - * @api - */ - public function getSubscription() - { - return $this->subscription; - } - - /** - * @param ObjectType|null $subscription - * - * @return SchemaConfig - * - * @api - */ - public function setSubscription($subscription) - { - $this->subscription = $subscription; - - return $this; - } - - /** - * @return Type[]|callable - * - * @api - */ - public function getTypes() - { - return $this->types; - } - - /** - * @param Type[]|callable $types - * - * @return SchemaConfig - * - * @api - */ - public function setTypes($types) - { - $this->types = $types; - - return $this; - } - - /** - * @return Directive[]|null - * - * @api - */ - public function getDirectives() - { - return $this->directives; - } - - /** - * @param Directive[] $directives - * - * @return SchemaConfig - * - * @api - */ - public function setDirectives(array $directives) - { - $this->directives = $directives; - - return $this; - } - - /** - * @return callable|null - * - * @api - */ - public function getTypeLoader() - { - return $this->typeLoader; - } - - /** - * @return SchemaConfig - * - * @api - */ - public function setTypeLoader(callable $typeLoader) - { - $this->typeLoader = $typeLoader; - - return $this; - } - - /** - * @return bool - */ - public function getAssumeValid() - { - return $this->assumeValid; - } - - /** - * @param bool $assumeValid - * - * @return SchemaConfig - */ - public function setAssumeValid($assumeValid) - { - $this->assumeValid = $assumeValid; - - return $this; - } - - /** - * @return SchemaTypeExtensionNode[] - */ - public function getExtensionASTNodes() - { - return $this->extensionASTNodes; - } - - /** - * @param SchemaTypeExtensionNode[] $extensionASTNodes - */ - public function setExtensionASTNodes(array $extensionASTNodes) - { - $this->extensionASTNodes = $extensionASTNodes; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaValidationContext.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaValidationContext.php deleted file mode 100644 index fb64bd5d..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/SchemaValidationContext.php +++ /dev/null @@ -1,1084 +0,0 @@ -schema = $schema; - $this->inputObjectCircularRefs = new InputObjectCircularRefs($this); - } - - /** - * @return Error[] - */ - public function getErrors() - { - return $this->errors; - } - - public function validateRootTypes() : void - { - $queryType = $this->schema->getQueryType(); - if (! $queryType) { - $this->reportError( - 'Query root type must be provided.', - $this->schema->getAstNode() - ); - } elseif (! $queryType instanceof ObjectType) { - $this->reportError( - 'Query root type must be Object type, it cannot be ' . Utils::printSafe($queryType) . '.', - $this->getOperationTypeNode($queryType, 'query') - ); - } - - $mutationType = $this->schema->getMutationType(); - if ($mutationType && ! $mutationType instanceof ObjectType) { - $this->reportError( - 'Mutation root type must be Object type if provided, it cannot be ' . Utils::printSafe($mutationType) . '.', - $this->getOperationTypeNode($mutationType, 'mutation') - ); - } - - $subscriptionType = $this->schema->getSubscriptionType(); - if ($subscriptionType === null || $subscriptionType instanceof ObjectType) { - return; - } - - $this->reportError( - 'Subscription root type must be Object type if provided, it cannot be ' . Utils::printSafe($subscriptionType) . '.', - $this->getOperationTypeNode($subscriptionType, 'subscription') - ); - } - - /** - * @param string $message - * @param Node[]|Node|TypeNode|TypeDefinitionNode|null $nodes - */ - public function reportError($message, $nodes = null) - { - $nodes = array_filter($nodes && is_array($nodes) ? $nodes : [$nodes]); - $this->addError(new Error($message, $nodes)); - } - - /** - * @param Error $error - */ - private function addError($error) - { - $this->errors[] = $error; - } - - /** - * @param Type $type - * @param string $operation - * - * @return NamedTypeNode|ListTypeNode|NonNullTypeNode|TypeDefinitionNode - */ - private function getOperationTypeNode($type, $operation) - { - $astNode = $this->schema->getAstNode(); - - $operationTypeNode = null; - if ($astNode instanceof SchemaDefinitionNode) { - $operationTypeNode = null; - - foreach ($astNode->operationTypes as $operationType) { - if ($operationType->operation === $operation) { - $operationTypeNode = $operationType; - break; - } - } - } - - return $operationTypeNode ? $operationTypeNode->type : ($type ? $type->astNode : null); - } - - public function validateDirectives() - { - $this->validateDirectiveDefinitions(); - - // Validate directives that are used on the schema - $this->validateDirectivesAtLocation( - $this->getDirectives($this->schema), - DirectiveLocation::SCHEMA - ); - } - - public function validateDirectiveDefinitions() - { - $directiveDefinitions = []; - - $directives = $this->schema->getDirectives(); - foreach ($directives as $directive) { - // Ensure all directives are in fact GraphQL directives. - if (! $directive instanceof Directive) { - $nodes = is_object($directive) - ? $directive->astNode - : null; - - $this->reportError( - 'Expected directive but got: ' . Utils::printSafe($directive) . '.', - $nodes - ); - continue; - } - $existingDefinitions = $directiveDefinitions[$directive->name] ?? []; - $existingDefinitions[] = $directive; - $directiveDefinitions[$directive->name] = $existingDefinitions; - - // Ensure they are named correctly. - $this->validateName($directive); - - // TODO: Ensure proper locations. - - $argNames = []; - foreach ($directive->args as $arg) { - $argName = $arg->name; - - // Ensure they are named correctly. - $this->validateName($directive); - - if (isset($argNames[$argName])) { - $this->reportError( - sprintf('Argument @%s(%s:) can only be defined once.', $directive->name, $argName), - $this->getAllDirectiveArgNodes($directive, $argName) - ); - continue; - } - - $argNames[$argName] = true; - - // Ensure the type is an input type. - if (Type::isInputType($arg->getType())) { - continue; - } - - $this->reportError( - sprintf( - 'The type of @%s(%s:) must be Input Type but got: %s.', - $directive->name, - $argName, - Utils::printSafe($arg->getType()) - ), - $this->getDirectiveArgTypeNode($directive, $argName) - ); - } - } - foreach ($directiveDefinitions as $directiveName => $directiveList) { - if (count($directiveList) <= 1) { - continue; - } - - $nodes = Utils::map( - $directiveList, - static function (Directive $directive) : ?DirectiveDefinitionNode { - return $directive->astNode; - } - ); - $this->reportError( - sprintf('Directive @%s defined multiple times.', $directiveName), - array_filter($nodes) - ); - } - } - - /** - * @param Type|Directive|FieldDefinition|EnumValueDefinition|InputObjectField $node - */ - private function validateName($node) - { - // Ensure names are valid, however introspection types opt out. - $error = Utils::isValidNameError($node->name, $node->astNode); - if (! $error || Introspection::isIntrospectionType($node)) { - return; - } - - $this->addError($error); - } - - /** - * @param string $argName - * - * @return InputValueDefinitionNode[] - */ - private function getAllDirectiveArgNodes(Directive $directive, $argName) - { - $subNodes = $this->getAllSubNodes( - $directive, - static function ($directiveNode) { - return $directiveNode->arguments; - } - ); - - return Utils::filter( - $subNodes, - static function ($argNode) use ($argName) : bool { - return $argNode->name->value === $argName; - } - ); - } - - /** - * @param string $argName - * - * @return NamedTypeNode|ListTypeNode|NonNullTypeNode|null - */ - private function getDirectiveArgTypeNode(Directive $directive, $argName) : ?TypeNode - { - $argNode = $this->getAllDirectiveArgNodes($directive, $argName)[0]; - - return $argNode ? $argNode->type : null; - } - - public function validateTypes() : void - { - $typeMap = $this->schema->getTypeMap(); - foreach ($typeMap as $typeName => $type) { - // Ensure all provided types are in fact GraphQL type. - if (! $type instanceof NamedType) { - $this->reportError( - 'Expected GraphQL named type but got: ' . Utils::printSafe($type) . '.', - $type instanceof Type ? $type->astNode : null - ); - continue; - } - - $this->validateName($type); - - if ($type instanceof ObjectType) { - // Ensure fields are valid - $this->validateFields($type); - - // Ensure objects implement the interfaces they claim to. - $this->validateInterfaces($type); - - // Ensure directives are valid - $this->validateDirectivesAtLocation( - $this->getDirectives($type), - DirectiveLocation::OBJECT - ); - } elseif ($type instanceof InterfaceType) { - // Ensure fields are valid. - $this->validateFields($type); - - // Ensure interfaces implement the interfaces they claim to. - $this->validateInterfaces($type); - - // Ensure directives are valid - $this->validateDirectivesAtLocation( - $this->getDirectives($type), - DirectiveLocation::IFACE - ); - } elseif ($type instanceof UnionType) { - // Ensure Unions include valid member types. - $this->validateUnionMembers($type); - - // Ensure directives are valid - $this->validateDirectivesAtLocation( - $this->getDirectives($type), - DirectiveLocation::UNION - ); - } elseif ($type instanceof EnumType) { - // Ensure Enums have valid values. - $this->validateEnumValues($type); - - // Ensure directives are valid - $this->validateDirectivesAtLocation( - $this->getDirectives($type), - DirectiveLocation::ENUM - ); - } elseif ($type instanceof InputObjectType) { - // Ensure Input Object fields are valid. - $this->validateInputFields($type); - - // Ensure directives are valid - $this->validateDirectivesAtLocation( - $this->getDirectives($type), - DirectiveLocation::INPUT_OBJECT - ); - - // Ensure Input Objects do not contain non-nullable circular references - $this->inputObjectCircularRefs->validate($type); - } elseif ($type instanceof ScalarType) { - // Ensure directives are valid - $this->validateDirectivesAtLocation( - $this->getDirectives($type), - DirectiveLocation::SCALAR - ); - } - } - } - - /** - * @param NodeList $directives - */ - private function validateDirectivesAtLocation($directives, string $location) - { - /** @var array> $potentiallyDuplicateDirectives */ - $potentiallyDuplicateDirectives = []; - $schema = $this->schema; - foreach ($directives as $directive) { - $directiveName = $directive->name->value; - - // Ensure directive used is also defined - $schemaDirective = $schema->getDirective($directiveName); - if ($schemaDirective === null) { - $this->reportError( - sprintf('No directive @%s defined.', $directiveName), - $directive - ); - continue; - } - - $includes = Utils::some( - $schemaDirective->locations, - static function ($schemaLocation) use ($location) : bool { - return $schemaLocation === $location; - } - ); - if (! $includes) { - $errorNodes = $schemaDirective->astNode - ? [$directive, $schemaDirective->astNode] - : [$directive]; - $this->reportError( - sprintf('Directive @%s not allowed at %s location.', $directiveName, $location), - $errorNodes - ); - } - - if ($schemaDirective->isRepeatable) { - continue; - } - - $existingNodes = $potentiallyDuplicateDirectives[$directiveName] ?? []; - $existingNodes[] = $directive; - $potentiallyDuplicateDirectives[$directiveName] = $existingNodes; - } - - foreach ($potentiallyDuplicateDirectives as $directiveName => $directiveList) { - if (count($directiveList) <= 1) { - continue; - } - - $this->reportError( - sprintf('Non-repeatable directive @%s used more than once at the same location.', $directiveName), - $directiveList - ); - } - } - - /** - * @param ObjectType|InterfaceType $type - */ - private function validateFields($type) - { - $fieldMap = $type->getFields(); - - // Objects and Interfaces both must define one or more fields. - if ($fieldMap === []) { - $this->reportError( - sprintf('Type %s must define one or more fields.', $type->name), - $this->getAllNodes($type) - ); - } - - foreach ($fieldMap as $fieldName => $field) { - // Ensure they are named correctly. - $this->validateName($field); - - // Ensure they were defined at most once. - $fieldNodes = $this->getAllFieldNodes($type, $fieldName); - if ($fieldNodes && count($fieldNodes) > 1) { - $this->reportError( - sprintf('Field %s.%s can only be defined once.', $type->name, $fieldName), - $fieldNodes - ); - continue; - } - - // Ensure the type is an output type - if (! Type::isOutputType($field->getType())) { - $this->reportError( - sprintf( - 'The type of %s.%s must be Output Type but got: %s.', - $type->name, - $fieldName, - Utils::printSafe($field->getType()) - ), - $this->getFieldTypeNode($type, $fieldName) - ); - } - - // Ensure the arguments are valid - $argNames = []; - foreach ($field->args as $arg) { - $argName = $arg->name; - - // Ensure they are named correctly. - $this->validateName($arg); - - if (isset($argNames[$argName])) { - $this->reportError( - sprintf( - 'Field argument %s.%s(%s:) can only be defined once.', - $type->name, - $fieldName, - $argName - ), - $this->getAllFieldArgNodes($type, $fieldName, $argName) - ); - } - $argNames[$argName] = true; - - // Ensure the type is an input type - if (! Type::isInputType($arg->getType())) { - $this->reportError( - sprintf( - 'The type of %s.%s(%s:) must be Input Type but got: %s.', - $type->name, - $fieldName, - $argName, - Utils::printSafe($arg->getType()) - ), - $this->getFieldArgTypeNode($type, $fieldName, $argName) - ); - } - - // Ensure argument definition directives are valid - if (! isset($arg->astNode, $arg->astNode->directives)) { - continue; - } - - $this->validateDirectivesAtLocation( - $arg->astNode->directives, - DirectiveLocation::ARGUMENT_DEFINITION - ); - } - - // Ensure any directives are valid - if (! isset($field->astNode, $field->astNode->directives)) { - continue; - } - - $this->validateDirectivesAtLocation( - $field->astNode->directives, - DirectiveLocation::FIELD_DEFINITION - ); - } - } - - /** - * @param Schema|ObjectType|InterfaceType|UnionType|EnumType|InputObjectType|Directive $obj - * - * @return ObjectTypeDefinitionNode[]|ObjectTypeExtensionNode[]|InterfaceTypeDefinitionNode[]|InterfaceTypeExtensionNode[] - */ - private function getAllNodes($obj) - { - if ($obj instanceof Schema) { - $astNode = $obj->getAstNode(); - $extensionNodes = $obj->extensionASTNodes; - } else { - $astNode = $obj->astNode; - $extensionNodes = $obj->extensionASTNodes; - } - - return $astNode - ? ($extensionNodes - ? array_merge([$astNode], $extensionNodes) - : [$astNode]) - : ($extensionNodes ?? []); - } - - /** - * @param Schema|ObjectType|InterfaceType|UnionType|EnumType|Directive $obj - */ - private function getAllSubNodes($obj, callable $getter) : NodeList - { - $result = new NodeList([]); - foreach ($this->getAllNodes($obj) as $astNode) { - if (! $astNode) { - continue; - } - - $subNodes = $getter($astNode); - if (! $subNodes) { - continue; - } - - $result = $result->merge($subNodes); - } - - return $result; - } - - /** - * @param ObjectType|InterfaceType $type - * @param string $fieldName - * - * @return FieldDefinitionNode[] - */ - private function getAllFieldNodes($type, $fieldName) - { - $subNodes = $this->getAllSubNodes($type, static function ($typeNode) { - return $typeNode->fields; - }); - - return Utils::filter($subNodes, static function ($fieldNode) use ($fieldName) : bool { - return $fieldNode->name->value === $fieldName; - }); - } - - /** - * @param ObjectType|InterfaceType $type - * @param string $fieldName - * - * @return NamedTypeNode|ListTypeNode|NonNullTypeNode|null - */ - private function getFieldTypeNode($type, $fieldName) : ?TypeNode - { - $fieldNode = $this->getFieldNode($type, $fieldName); - - return $fieldNode ? $fieldNode->type : null; - } - - /** - * @param ObjectType|InterfaceType $type - * @param string $fieldName - * - * @return FieldDefinitionNode|null - */ - private function getFieldNode($type, $fieldName) - { - $nodes = $this->getAllFieldNodes($type, $fieldName); - - return $nodes[0] ?? null; - } - - /** - * @param ObjectType|InterfaceType $type - * @param string $fieldName - * @param string $argName - * - * @return InputValueDefinitionNode[] - */ - private function getAllFieldArgNodes($type, $fieldName, $argName) - { - $argNodes = []; - $fieldNode = $this->getFieldNode($type, $fieldName); - if ($fieldNode && $fieldNode->arguments) { - foreach ($fieldNode->arguments as $node) { - if ($node->name->value !== $argName) { - continue; - } - - $argNodes[] = $node; - } - } - - return $argNodes; - } - - /** - * @param ObjectType|InterfaceType $type - * @param string $fieldName - * @param string $argName - * - * @return NamedTypeNode|ListTypeNode|NonNullTypeNode|null - */ - private function getFieldArgTypeNode($type, $fieldName, $argName) : ?TypeNode - { - $fieldArgNode = $this->getFieldArgNode($type, $fieldName, $argName); - - return $fieldArgNode ? $fieldArgNode->type : null; - } - - /** - * @param ObjectType|InterfaceType $type - * @param string $fieldName - * @param string $argName - * - * @return InputValueDefinitionNode|null - */ - private function getFieldArgNode($type, $fieldName, $argName) - { - $nodes = $this->getAllFieldArgNodes($type, $fieldName, $argName); - - return $nodes[0] ?? null; - } - - /** - * @param ObjectType|InterfaceType $type - */ - private function validateInterfaces(ImplementingType $type) : void - { - $ifaceTypeNames = []; - foreach ($type->getInterfaces() as $iface) { - if (! $iface instanceof InterfaceType) { - $this->reportError( - sprintf( - 'Type %s must only implement Interface types, it cannot implement %s.', - $type->name, - Utils::printSafe($iface) - ), - $this->getImplementsInterfaceNode($type, $iface) - ); - continue; - } - - if ($type === $iface) { - $this->reportError( - sprintf( - 'Type %s cannot implement itself because it would create a circular reference.', - $type->name - ), - $this->getImplementsInterfaceNode($type, $iface) - ); - continue; - } - - if (isset($ifaceTypeNames[$iface->name])) { - $this->reportError( - sprintf('Type %s can only implement %s once.', $type->name, $iface->name), - $this->getAllImplementsInterfaceNodes($type, $iface) - ); - continue; - } - $ifaceTypeNames[$iface->name] = true; - - $this->validateTypeImplementsAncestors($type, $iface); - $this->validateTypeImplementsInterface($type, $iface); - } - } - - /** - * @param Schema|Type $object - * - * @return NodeList - */ - private function getDirectives($object) - { - return $this->getAllSubNodes($object, static function ($node) { - return $node->directives; - }); - } - - /** - * @param ObjectType|InterfaceType $type - */ - private function getImplementsInterfaceNode(ImplementingType $type, Type $shouldBeInterface) : ?NamedTypeNode - { - $nodes = $this->getAllImplementsInterfaceNodes($type, $shouldBeInterface); - - return $nodes[0] ?? null; - } - - /** - * @param ObjectType|InterfaceType $type - * - * @return array - */ - private function getAllImplementsInterfaceNodes(ImplementingType $type, Type $shouldBeInterface) : array - { - $subNodes = $this->getAllSubNodes($type, static function (Node $typeNode) : NodeList { - /** @var ObjectTypeDefinitionNode|ObjectTypeExtensionNode|InterfaceTypeDefinitionNode|InterfaceTypeExtensionNode $typeNode */ - return $typeNode->interfaces; - }); - - return Utils::filter($subNodes, static function (NamedTypeNode $ifaceNode) use ($shouldBeInterface) : bool { - return $ifaceNode->name->value === $shouldBeInterface->name; - }); - } - - /** - * @param ObjectType|InterfaceType $type - */ - private function validateTypeImplementsInterface(ImplementingType $type, InterfaceType $iface) - { - $typeFieldMap = $type->getFields(); - $ifaceFieldMap = $iface->getFields(); - - // Assert each interface field is implemented. - foreach ($ifaceFieldMap as $fieldName => $ifaceField) { - $typeField = array_key_exists($fieldName, $typeFieldMap) - ? $typeFieldMap[$fieldName] - : null; - - // Assert interface field exists on type. - if (! $typeField) { - $this->reportError( - sprintf( - 'Interface field %s.%s expected but %s does not provide it.', - $iface->name, - $fieldName, - $type->name - ), - array_merge( - [$this->getFieldNode($iface, $fieldName)], - $this->getAllNodes($type) - ) - ); - continue; - } - - // Assert interface field type is satisfied by type field type, by being - // a valid subtype. (covariant) - if (! TypeComparators::isTypeSubTypeOf( - $this->schema, - $typeField->getType(), - $ifaceField->getType() - ) - ) { - $this->reportError( - sprintf( - 'Interface field %s.%s expects type %s but %s.%s is type %s.', - $iface->name, - $fieldName, - $ifaceField->getType(), - $type->name, - $fieldName, - Utils::printSafe($typeField->getType()) - ), - [ - $this->getFieldTypeNode($iface, $fieldName), - $this->getFieldTypeNode($type, $fieldName), - ] - ); - } - - // Assert each interface field arg is implemented. - foreach ($ifaceField->args as $ifaceArg) { - $argName = $ifaceArg->name; - $typeArg = null; - - foreach ($typeField->args as $arg) { - if ($arg->name === $argName) { - $typeArg = $arg; - break; - } - } - - // Assert interface field arg exists on type field. - if (! $typeArg) { - $this->reportError( - sprintf( - 'Interface field argument %s.%s(%s:) expected but %s.%s does not provide it.', - $iface->name, - $fieldName, - $argName, - $type->name, - $fieldName - ), - [ - $this->getFieldArgNode($iface, $fieldName, $argName), - $this->getFieldNode($type, $fieldName), - ] - ); - continue; - } - - // Assert interface field arg type matches type field arg type. - // (invariant) - // TODO: change to contravariant? - if (! TypeComparators::isEqualType($ifaceArg->getType(), $typeArg->getType())) { - $this->reportError( - sprintf( - 'Interface field argument %s.%s(%s:) expects type %s but %s.%s(%s:) is type %s.', - $iface->name, - $fieldName, - $argName, - Utils::printSafe($ifaceArg->getType()), - $type->name, - $fieldName, - $argName, - Utils::printSafe($typeArg->getType()) - ), - [ - $this->getFieldArgTypeNode($iface, $fieldName, $argName), - $this->getFieldArgTypeNode($type, $fieldName, $argName), - ] - ); - } - // TODO: validate default values? - } - - // Assert additional arguments must not be required. - foreach ($typeField->args as $typeArg) { - $argName = $typeArg->name; - $ifaceArg = null; - - foreach ($ifaceField->args as $arg) { - if ($arg->name === $argName) { - $ifaceArg = $arg; - break; - } - } - - if ($ifaceArg || ! $typeArg->isRequired()) { - continue; - } - - $this->reportError( - sprintf( - 'Object field %s.%s includes required argument %s that is missing from the Interface field %s.%s.', - $type->name, - $fieldName, - $argName, - $iface->name, - $fieldName - ), - [ - $this->getFieldArgNode($type, $fieldName, $argName), - $this->getFieldNode($iface, $fieldName), - ] - ); - } - } - } - - /** - * @param ObjectType|InterfaceType $type - */ - private function validateTypeImplementsAncestors(ImplementingType $type, InterfaceType $iface) : void - { - $typeInterfaces = $type->getInterfaces(); - foreach ($iface->getInterfaces() as $transitive) { - if (in_array($transitive, $typeInterfaces, true)) { - continue; - } - - $error = $transitive === $type ? - sprintf( - 'Type %s cannot implement %s because it would create a circular reference.', - $type->name, - $iface->name - ) : - sprintf( - 'Type %s must implement %s because it is implemented by %s.', - $type->name, - $transitive->name, - $iface->name - ); - $this->reportError( - $error, - array_merge( - $this->getAllImplementsInterfaceNodes($iface, $transitive), - $this->getAllImplementsInterfaceNodes($type, $iface) - ) - ); - } - } - - private function validateUnionMembers(UnionType $union) - { - $memberTypes = $union->getTypes(); - - if (! $memberTypes) { - $this->reportError( - sprintf('Union type %s must define one or more member types.', $union->name), - $this->getAllNodes($union) - ); - } - - $includedTypeNames = []; - - foreach ($memberTypes as $memberType) { - if (isset($includedTypeNames[$memberType->name])) { - $this->reportError( - sprintf('Union type %s can only include type %s once.', $union->name, $memberType->name), - $this->getUnionMemberTypeNodes($union, $memberType->name) - ); - continue; - } - $includedTypeNames[$memberType->name] = true; - if ($memberType instanceof ObjectType) { - continue; - } - - $this->reportError( - sprintf( - 'Union type %s can only include Object types, it cannot include %s.', - $union->name, - Utils::printSafe($memberType) - ), - $this->getUnionMemberTypeNodes($union, Utils::printSafe($memberType)) - ); - } - } - - /** - * @param string $typeName - * - * @return NamedTypeNode[] - */ - private function getUnionMemberTypeNodes(UnionType $union, $typeName) - { - $subNodes = $this->getAllSubNodes($union, static function ($unionNode) { - return $unionNode->types; - }); - - return Utils::filter($subNodes, static function ($typeNode) use ($typeName) : bool { - return $typeNode->name->value === $typeName; - }); - } - - private function validateEnumValues(EnumType $enumType) - { - $enumValues = $enumType->getValues(); - - if (! $enumValues) { - $this->reportError( - sprintf('Enum type %s must define one or more values.', $enumType->name), - $this->getAllNodes($enumType) - ); - } - - foreach ($enumValues as $enumValue) { - $valueName = $enumValue->name; - - // Ensure no duplicates - $allNodes = $this->getEnumValueNodes($enumType, $valueName); - if ($allNodes && count($allNodes) > 1) { - $this->reportError( - sprintf('Enum type %s can include value %s only once.', $enumType->name, $valueName), - $allNodes - ); - } - - // Ensure valid name. - $this->validateName($enumValue); - if ($valueName === 'true' || $valueName === 'false' || $valueName === 'null') { - $this->reportError( - sprintf('Enum type %s cannot include value: %s.', $enumType->name, $valueName), - $enumValue->astNode - ); - } - - // Ensure valid directives - if (! isset($enumValue->astNode, $enumValue->astNode->directives)) { - continue; - } - - $this->validateDirectivesAtLocation( - $enumValue->astNode->directives, - DirectiveLocation::ENUM_VALUE - ); - } - } - - /** - * @param string $valueName - * - * @return EnumValueDefinitionNode[] - */ - private function getEnumValueNodes(EnumType $enum, $valueName) - { - $subNodes = $this->getAllSubNodes($enum, static function ($enumNode) { - return $enumNode->values; - }); - - return Utils::filter($subNodes, static function ($valueNode) use ($valueName) : bool { - return $valueNode->name->value === $valueName; - }); - } - - private function validateInputFields(InputObjectType $inputObj) - { - $fieldMap = $inputObj->getFields(); - - if (! $fieldMap) { - $this->reportError( - sprintf('Input Object type %s must define one or more fields.', $inputObj->name), - $this->getAllNodes($inputObj) - ); - } - - // Ensure the arguments are valid - foreach ($fieldMap as $fieldName => $field) { - // Ensure they are named correctly. - $this->validateName($field); - - // TODO: Ensure they are unique per field. - - // Ensure the type is an input type - if (! Type::isInputType($field->getType())) { - $this->reportError( - sprintf( - 'The type of %s.%s must be Input Type but got: %s.', - $inputObj->name, - $fieldName, - Utils::printSafe($field->getType()) - ), - $field->astNode ? $field->astNode->type : null - ); - } - - // Ensure valid directives - if (! isset($field->astNode, $field->astNode->directives)) { - continue; - } - - $this->validateDirectivesAtLocation( - $field->astNode->directives, - DirectiveLocation::INPUT_FIELD_DEFINITION - ); - } - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/TypeKind.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/TypeKind.php deleted file mode 100644 index 69cdf2e2..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Type/TypeKind.php +++ /dev/null @@ -1,17 +0,0 @@ - - */ - private $visitedTypes = []; - - /** @var InputObjectField[] */ - private $fieldPath = []; - - /** - * Position in the type path. - * - * [string $typeName => int $index] - * - * @var int[] - */ - private $fieldPathIndexByTypeName = []; - - public function __construct(SchemaValidationContext $schemaValidationContext) - { - $this->schemaValidationContext = $schemaValidationContext; - } - - /** - * This does a straight-forward DFS to find cycles. - * It does not terminate when a cycle was found but continues to explore - * the graph to find all possible cycles. - */ - public function validate(InputObjectType $inputObj) : void - { - if (isset($this->visitedTypes[$inputObj->name])) { - return; - } - - $this->visitedTypes[$inputObj->name] = true; - $this->fieldPathIndexByTypeName[$inputObj->name] = count($this->fieldPath); - - $fieldMap = $inputObj->getFields(); - foreach ($fieldMap as $fieldName => $field) { - $type = $field->getType(); - - if ($type instanceof NonNull) { - $fieldType = $type->getWrappedType(); - - // If the type of the field is anything else then a non-nullable input object, - // there is no chance of an unbreakable cycle - if ($fieldType instanceof InputObjectType) { - $this->fieldPath[] = $field; - - if (! isset($this->fieldPathIndexByTypeName[$fieldType->name])) { - $this->validate($fieldType); - } else { - $cycleIndex = $this->fieldPathIndexByTypeName[$fieldType->name]; - $cyclePath = array_slice($this->fieldPath, $cycleIndex); - $fieldNames = array_map( - static function (InputObjectField $field) : string { - return $field->name; - }, - $cyclePath - ); - - $this->schemaValidationContext->reportError( - 'Cannot reference Input Object "' . $fieldType->name . '" within itself ' - . 'through a series of non-null fields: "' . implode('.', $fieldNames) . '".', - array_map( - static function (InputObjectField $field) : ?InputValueDefinitionNode { - return $field->astNode; - }, - $cyclePath - ) - ); - } - } - } - - array_pop($this->fieldPath); - } - - unset($this->fieldPathIndexByTypeName[$inputObj->name]); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/AST.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/AST.php deleted file mode 100644 index 234d1063..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/AST.php +++ /dev/null @@ -1,641 +0,0 @@ - 'ListValue', - * 'values' => [ - * ['kind' => 'StringValue', 'value' => 'my str'], - * ['kind' => 'StringValue', 'value' => 'my other str'] - * ], - * 'loc' => ['start' => 21, 'end' => 25] - * ]); - * ``` - * - * Will produce instance of `ListValueNode` where `values` prop is a lazily-evaluated `NodeList` - * returning instances of `StringValueNode` on access. - * - * This is a reverse operation for AST::toArray($node) - * - * @param mixed[] $node - * - * @api - */ - public static function fromArray(array $node) : Node - { - if (! isset($node['kind']) || ! isset(NodeKind::$classMap[$node['kind']])) { - throw new InvariantViolation('Unexpected node structure: ' . Utils::printSafeJson($node)); - } - - $kind = $node['kind'] ?? null; - $class = NodeKind::$classMap[$kind]; - $instance = new $class([]); - - if (isset($node['loc'], $node['loc']['start'], $node['loc']['end'])) { - $instance->loc = Location::create($node['loc']['start'], $node['loc']['end']); - } - - foreach ($node as $key => $value) { - if ($key === 'loc' || $key === 'kind') { - continue; - } - if (is_array($value)) { - if (isset($value[0]) || count($value) === 0) { - $value = new NodeList($value); - } else { - $value = self::fromArray($value); - } - } - $instance->{$key} = $value; - } - - return $instance; - } - - /** - * Convert AST node to serializable array - * - * @return mixed[] - * - * @api - */ - public static function toArray(Node $node) : array - { - return $node->toArray(true); - } - - /** - * Produces a GraphQL Value AST given a PHP value. - * - * Optionally, a GraphQL type may be provided, which will be used to - * disambiguate between value primitives. - * - * | PHP Value | GraphQL Value | - * | ------------- | -------------------- | - * | Object | Input Object | - * | Assoc Array | Input Object | - * | Array | List | - * | Boolean | Boolean | - * | String | String / Enum Value | - * | Int | Int | - * | Float | Int / Float | - * | Mixed | Enum Value | - * | null | NullValue | - * - * @param Type|mixed|null $value - * - * @return ObjectValueNode|ListValueNode|BooleanValueNode|IntValueNode|FloatValueNode|EnumValueNode|StringValueNode|NullValueNode|null - * - * @api - */ - public static function astFromValue($value, InputType $type) - { - if ($type instanceof NonNull) { - $astValue = self::astFromValue($value, $type->getWrappedType()); - if ($astValue instanceof NullValueNode) { - return null; - } - - return $astValue; - } - - if ($value === null) { - return new NullValueNode([]); - } - - // Convert PHP array to GraphQL list. If the GraphQLType is a list, but - // the value is not an array, convert the value using the list's item type. - if ($type instanceof ListOfType) { - $itemType = $type->getWrappedType(); - if (is_array($value) || ($value instanceof Traversable)) { - $valuesNodes = []; - foreach ($value as $item) { - $itemNode = self::astFromValue($item, $itemType); - if (! $itemNode) { - continue; - } - - $valuesNodes[] = $itemNode; - } - - return new ListValueNode(['values' => new NodeList($valuesNodes)]); - } - - return self::astFromValue($value, $itemType); - } - - // Populate the fields of the input object by creating ASTs from each value - // in the PHP object according to the fields in the input type. - if ($type instanceof InputObjectType) { - $isArray = is_array($value); - $isArrayLike = $isArray || $value instanceof ArrayAccess; - if ($value === null || (! $isArrayLike && ! is_object($value))) { - return null; - } - $fields = $type->getFields(); - $fieldNodes = []; - foreach ($fields as $fieldName => $field) { - if ($isArrayLike) { - $fieldValue = $value[$fieldName] ?? null; - } else { - $fieldValue = $value->{$fieldName} ?? null; - } - - // Have to check additionally if key exists, since we differentiate between - // "no key" and "value is null": - if ($fieldValue !== null) { - $fieldExists = true; - } elseif ($isArray) { - $fieldExists = array_key_exists($fieldName, $value); - } elseif ($isArrayLike) { - $fieldExists = $value->offsetExists($fieldName); - } else { - $fieldExists = property_exists($value, $fieldName); - } - - if (! $fieldExists) { - continue; - } - - $fieldNode = self::astFromValue($fieldValue, $field->getType()); - - if (! $fieldNode) { - continue; - } - - $fieldNodes[] = new ObjectFieldNode([ - 'name' => new NameNode(['value' => $fieldName]), - 'value' => $fieldNode, - ]); - } - - return new ObjectValueNode(['fields' => new NodeList($fieldNodes)]); - } - - if ($type instanceof ScalarType || $type instanceof EnumType) { - // Since value is an internally represented value, it must be serialized - // to an externally represented value before converting into an AST. - try { - $serialized = $type->serialize($value); - } catch (Throwable $error) { - if ($error instanceof Error && $type instanceof EnumType) { - return null; - } - throw $error; - } - - // Others serialize based on their corresponding PHP scalar types. - if (is_bool($serialized)) { - return new BooleanValueNode(['value' => $serialized]); - } - if (is_int($serialized)) { - return new IntValueNode(['value' => (string) $serialized]); - } - if (is_float($serialized)) { - // int cast with == used for performance reasons - if ((int) $serialized == $serialized) { - return new IntValueNode(['value' => (string) $serialized]); - } - - return new FloatValueNode(['value' => (string) $serialized]); - } - if (is_string($serialized)) { - // Enum types use Enum literals. - if ($type instanceof EnumType) { - return new EnumValueNode(['value' => $serialized]); - } - - // ID types can use Int literals. - $asInt = (int) $serialized; - if ($type instanceof IDType && (string) $asInt === $serialized) { - return new IntValueNode(['value' => $serialized]); - } - - // Use json_encode, which uses the same string encoding as GraphQL, - // then remove the quotes. - return new StringValueNode(['value' => $serialized]); - } - - throw new InvariantViolation('Cannot convert value to AST: ' . Utils::printSafe($serialized)); - } - - throw new Error('Unknown type: ' . Utils::printSafe($type) . '.'); - } - - /** - * Produces a PHP value given a GraphQL Value AST. - * - * A GraphQL type must be provided, which will be used to interpret different - * GraphQL Value literals. - * - * Returns `null` when the value could not be validly coerced according to - * the provided type. - * - * | GraphQL Value | PHP Value | - * | -------------------- | ------------- | - * | Input Object | Assoc Array | - * | List | Array | - * | Boolean | Boolean | - * | String | String | - * | Int / Float | Int / Float | - * | Enum Value | Mixed | - * | Null Value | null | - * - * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode|null $valueNode - * @param mixed[]|null $variables - * - * @return mixed[]|stdClass|null - * - * @throws Exception - * - * @api - */ - public static function valueFromAST(?ValueNode $valueNode, Type $type, ?array $variables = null) - { - $undefined = Utils::undefined(); - - if ($valueNode === null) { - // When there is no AST, then there is also no value. - // Importantly, this is different from returning the GraphQL null value. - return $undefined; - } - - if ($type instanceof NonNull) { - if ($valueNode instanceof NullValueNode) { - // Invalid: intentionally return no value. - return $undefined; - } - - return self::valueFromAST($valueNode, $type->getWrappedType(), $variables); - } - - if ($valueNode instanceof NullValueNode) { - // This is explicitly returning the value null. - return null; - } - - if ($valueNode instanceof VariableNode) { - $variableName = $valueNode->name->value; - - if (! $variables || ! array_key_exists($variableName, $variables)) { - // No valid return value. - return $undefined; - } - - $variableValue = $variables[$variableName] ?? null; - if ($variableValue === null && $type instanceof NonNull) { - return $undefined; // Invalid: intentionally return no value. - } - - // Note: This does no further checking that this variable is correct. - // This assumes that this query has been validated and the variable - // usage here is of the correct type. - return $variables[$variableName]; - } - - if ($type instanceof ListOfType) { - $itemType = $type->getWrappedType(); - - if ($valueNode instanceof ListValueNode) { - $coercedValues = []; - $itemNodes = $valueNode->values; - foreach ($itemNodes as $itemNode) { - if (self::isMissingVariable($itemNode, $variables)) { - // If an array contains a missing variable, it is either coerced to - // null or if the item type is non-null, it considered invalid. - if ($itemType instanceof NonNull) { - // Invalid: intentionally return no value. - return $undefined; - } - $coercedValues[] = null; - } else { - $itemValue = self::valueFromAST($itemNode, $itemType, $variables); - if ($undefined === $itemValue) { - // Invalid: intentionally return no value. - return $undefined; - } - $coercedValues[] = $itemValue; - } - } - - return $coercedValues; - } - $coercedValue = self::valueFromAST($valueNode, $itemType, $variables); - if ($undefined === $coercedValue) { - // Invalid: intentionally return no value. - return $undefined; - } - - return [$coercedValue]; - } - - if ($type instanceof InputObjectType) { - if (! $valueNode instanceof ObjectValueNode) { - // Invalid: intentionally return no value. - return $undefined; - } - - $coercedObj = []; - $fields = $type->getFields(); - $fieldNodes = Utils::keyMap( - $valueNode->fields, - static function ($field) { - return $field->name->value; - } - ); - foreach ($fields as $field) { - $fieldName = $field->name; - /** @var VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $fieldNode */ - $fieldNode = $fieldNodes[$fieldName] ?? null; - - if ($fieldNode === null || self::isMissingVariable($fieldNode->value, $variables)) { - if ($field->defaultValueExists()) { - $coercedObj[$fieldName] = $field->defaultValue; - } elseif ($field->getType() instanceof NonNull) { - // Invalid: intentionally return no value. - return $undefined; - } - continue; - } - - $fieldValue = self::valueFromAST( - $fieldNode !== null ? $fieldNode->value : null, - $field->getType(), - $variables - ); - - if ($undefined === $fieldValue) { - // Invalid: intentionally return no value. - return $undefined; - } - $coercedObj[$fieldName] = $fieldValue; - } - - return $coercedObj; - } - - if ($type instanceof EnumType) { - if (! $valueNode instanceof EnumValueNode) { - return $undefined; - } - $enumValue = $type->getValue($valueNode->value); - if (! $enumValue) { - return $undefined; - } - - return $enumValue->value; - } - - if ($type instanceof ScalarType) { - // Scalars fulfill parsing a literal value via parseLiteral(). - // Invalid values represent a failure to parse correctly, in which case - // no value is returned. - try { - return $type->parseLiteral($valueNode, $variables); - } catch (Throwable $error) { - return $undefined; - } - } - - throw new Error('Unknown type: ' . Utils::printSafe($type) . '.'); - } - - /** - * Returns true if the provided valueNode is a variable which is not defined - * in the set of variables. - * - * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $valueNode - * @param mixed[] $variables - * - * @return bool - */ - private static function isMissingVariable(ValueNode $valueNode, $variables) - { - return $valueNode instanceof VariableNode && - (count($variables) === 0 || ! array_key_exists($valueNode->name->value, $variables)); - } - - /** - * Produces a PHP value given a GraphQL Value AST. - * - * Unlike `valueFromAST()`, no type is provided. The resulting PHP value - * will reflect the provided GraphQL value AST. - * - * | GraphQL Value | PHP Value | - * | -------------------- | ------------- | - * | Input Object | Assoc Array | - * | List | Array | - * | Boolean | Boolean | - * | String | String | - * | Int / Float | Int / Float | - * | Enum | Mixed | - * | Null | null | - * - * @param Node $valueNode - * @param mixed[]|null $variables - * - * @return mixed - * - * @throws Exception - * - * @api - */ - public static function valueFromASTUntyped($valueNode, ?array $variables = null) - { - switch (true) { - case $valueNode instanceof NullValueNode: - return null; - case $valueNode instanceof IntValueNode: - return (int) $valueNode->value; - case $valueNode instanceof FloatValueNode: - return (float) $valueNode->value; - case $valueNode instanceof StringValueNode: - case $valueNode instanceof EnumValueNode: - case $valueNode instanceof BooleanValueNode: - return $valueNode->value; - case $valueNode instanceof ListValueNode: - return array_map( - static function ($node) use ($variables) { - return self::valueFromASTUntyped($node, $variables); - }, - iterator_to_array($valueNode->values) - ); - case $valueNode instanceof ObjectValueNode: - return array_combine( - array_map( - static function ($field) : string { - return $field->name->value; - }, - iterator_to_array($valueNode->fields) - ), - array_map( - static function ($field) use ($variables) { - return self::valueFromASTUntyped($field->value, $variables); - }, - iterator_to_array($valueNode->fields) - ) - ); - case $valueNode instanceof VariableNode: - $variableName = $valueNode->name->value; - - return $variables && isset($variables[$variableName]) - ? $variables[$variableName] - : null; - } - - throw new Error('Unexpected value kind: ' . $valueNode->kind . '.'); - } - - /** - * Returns type definition for given AST Type node - * - * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode - * - * @return Type|null - * - * @throws Exception - * - * @api - */ - public static function typeFromAST(Schema $schema, $inputTypeNode) - { - if ($inputTypeNode instanceof ListTypeNode) { - $innerType = self::typeFromAST($schema, $inputTypeNode->type); - - return $innerType ? new ListOfType($innerType) : null; - } - if ($inputTypeNode instanceof NonNullTypeNode) { - $innerType = self::typeFromAST($schema, $inputTypeNode->type); - - return $innerType ? new NonNull($innerType) : null; - } - if ($inputTypeNode instanceof NamedTypeNode) { - return $schema->getType($inputTypeNode->name->value); - } - - throw new Error('Unexpected type kind: ' . $inputTypeNode->kind . '.'); - } - - /** - * @deprecated use getOperationAST instead. - * - * Returns operation type ("query", "mutation" or "subscription") given a document and operation name - * - * @param string $operationName - * - * @return bool|string - * - * @api - */ - public static function getOperation(DocumentNode $document, $operationName = null) - { - if ($document->definitions) { - foreach ($document->definitions as $def) { - if (! ($def instanceof OperationDefinitionNode)) { - continue; - } - - if (! $operationName || (isset($def->name->value) && $def->name->value === $operationName)) { - return $def->operation; - } - } - } - - return false; - } - - /** - * Returns the operation within a document by name. - * - * If a name is not provided, an operation is only returned if the document has exactly one. - * - * @api - */ - public static function getOperationAST(DocumentNode $document, ?string $operationName = null) : ?OperationDefinitionNode - { - $operation = null; - foreach ($document->definitions->getIterator() as $node) { - if (! $node instanceof OperationDefinitionNode) { - continue; - } - - if ($operationName === null) { - // We found a second operation, so we bail instead of returning an ambiguous result. - if ($operation !== null) { - return null; - } - $operation = $node; - } elseif ($node->name instanceof NameNode && $node->name->value === $operationName) { - return $node; - } - } - - return $operation; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php deleted file mode 100644 index c9d4a56f..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/ASTDefinitionBuilder.php +++ /dev/null @@ -1,493 +0,0 @@ - */ - private $typeDefinitionsMap; - - /** @var callable */ - private $typeConfigDecorator; - - /** @var array */ - private $options; - - /** @var callable */ - private $resolveType; - - /** @var array */ - private $cache; - - /** - * code sniffer doesn't understand this syntax. Pr with a fix here: waiting on https://github.com/squizlabs/PHP_CodeSniffer/pull/2919 - * @param array $typeDefinitionsMap - * @param array $options - */ - public function __construct( - array $typeDefinitionsMap, - array $options, - callable $resolveType, - ?callable $typeConfigDecorator = null - ) { - $this->typeDefinitionsMap = $typeDefinitionsMap; - $this->typeConfigDecorator = $typeConfigDecorator; - $this->options = $options; - $this->resolveType = $resolveType; - - $this->cache = Type::getAllBuiltInTypes(); - } - - public function buildDirective(DirectiveDefinitionNode $directiveNode) : Directive - { - return new Directive([ - 'name' => $directiveNode->name->value, - 'description' => $this->getDescription($directiveNode), - 'args' => FieldArgument::createMap($this->makeInputValues($directiveNode->arguments)), - 'isRepeatable' => $directiveNode->repeatable, - 'locations' => Utils::map( - $directiveNode->locations, - static function (NameNode $node) : string { - return $node->value; - } - ), - 'astNode' => $directiveNode, - ]); - } - - /** - * Given an ast node, returns its string description. - */ - private function getDescription(Node $node) : ?string - { - if (isset($node->description)) { - return $node->description->value; - } - - if (isset($this->options['commentDescriptions'])) { - $rawValue = $this->getLeadingCommentBlock($node); - if ($rawValue !== null) { - return BlockString::value("\n" . $rawValue); - } - } - - return null; - } - - private function getLeadingCommentBlock(Node $node) : ?string - { - $loc = $node->loc; - if ($loc === null || $loc->startToken === null) { - return null; - } - - $comments = []; - $token = $loc->startToken->prev; - while ($token !== null - && $token->kind === Token::COMMENT - && $token->next !== null - && $token->prev !== null - && $token->line + 1 === $token->next->line - && $token->line !== $token->prev->line - ) { - $value = $token->value; - $comments[] = $value; - $token = $token->prev; - } - - return implode("\n", array_reverse($comments)); - } - - /** - * @return array> - */ - private function makeInputValues(NodeList $values) : array - { - return Utils::keyValMap( - $values, - static function (InputValueDefinitionNode $value) : string { - return $value->name->value; - }, - function (InputValueDefinitionNode $value) : array { - // Note: While this could make assertions to get the correctly typed - // value, that would throw immediately while type system validation - // with validateSchema() will produce more actionable results. - $type = $this->buildWrappedType($value->type); - - $config = [ - 'name' => $value->name->value, - 'type' => $type, - 'description' => $this->getDescription($value), - 'astNode' => $value, - ]; - if (isset($value->defaultValue)) { - $config['defaultValue'] = AST::valueFromAST($value->defaultValue, $type); - } - - return $config; - } - ); - } - - private function buildWrappedType(TypeNode $typeNode) : Type - { - if ($typeNode instanceof ListTypeNode) { - return Type::listOf($this->buildWrappedType($typeNode->type)); - } - - if ($typeNode instanceof NonNullTypeNode) { - return Type::nonNull($this->buildWrappedType($typeNode->type)); - } - - return $this->buildType($typeNode); - } - - /** - * @param string|(Node &NamedTypeNode)|(Node&TypeDefinitionNode) $ref - */ - public function buildType($ref) : Type - { - if (is_string($ref)) { - return $this->internalBuildType($ref); - } - - return $this->internalBuildType($ref->name->value, $ref); - } - - /** - * @param (Node &NamedTypeNode)|(Node&TypeDefinitionNode)|null $typeNode - * - * @throws Error - */ - private function internalBuildType(string $typeName, ?Node $typeNode = null) : Type - { - if (! isset($this->cache[$typeName])) { - if (isset($this->typeDefinitionsMap[$typeName])) { - $type = $this->makeSchemaDef($this->typeDefinitionsMap[$typeName]); - if ($this->typeConfigDecorator) { - $fn = $this->typeConfigDecorator; - try { - $config = $fn($type->config, $this->typeDefinitionsMap[$typeName], $this->typeDefinitionsMap); - } catch (Throwable $e) { - throw new Error( - sprintf('Type config decorator passed to %s threw an error ', static::class) . - sprintf('when building %s type: %s', $typeName, $e->getMessage()), - null, - null, - [], - null, - $e - ); - } - if (! is_array($config) || isset($config[0])) { - throw new Error( - sprintf( - 'Type config decorator passed to %s is expected to return an array, but got %s', - static::class, - Utils::getVariableType($config) - ) - ); - } - $type = $this->makeSchemaDefFromConfig($this->typeDefinitionsMap[$typeName], $config); - } - $this->cache[$typeName] = $type; - } else { - $fn = $this->resolveType; - $this->cache[$typeName] = $fn($typeName, $typeNode); - } - } - - return $this->cache[$typeName]; - } - - /** - * @param ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|EnumTypeDefinitionNode|ScalarTypeDefinitionNode|InputObjectTypeDefinitionNode|UnionTypeDefinitionNode $def - * - * @return CustomScalarType|EnumType|InputObjectType|InterfaceType|ObjectType|UnionType - * - * @throws Error - */ - private function makeSchemaDef(Node $def) : Type - { - switch (true) { - case $def instanceof ObjectTypeDefinitionNode: - return $this->makeTypeDef($def); - case $def instanceof InterfaceTypeDefinitionNode: - return $this->makeInterfaceDef($def); - case $def instanceof EnumTypeDefinitionNode: - return $this->makeEnumDef($def); - case $def instanceof UnionTypeDefinitionNode: - return $this->makeUnionDef($def); - case $def instanceof ScalarTypeDefinitionNode: - return $this->makeScalarDef($def); - case $def instanceof InputObjectTypeDefinitionNode: - return $this->makeInputObjectDef($def); - default: - throw new Error(sprintf('Type kind of %s not supported.', $def->kind)); - } - } - - private function makeTypeDef(ObjectTypeDefinitionNode $def) : ObjectType - { - return new ObjectType([ - 'name' => $def->name->value, - 'description' => $this->getDescription($def), - 'fields' => function () use ($def) : array { - return $this->makeFieldDefMap($def); - }, - 'interfaces' => function () use ($def) : array { - return $this->makeImplementedInterfaces($def); - }, - 'astNode' => $def, - ]); - } - - /** - * @param ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode $def - * - * @return array> - */ - private function makeFieldDefMap(Node $def) : array - { - return Utils::keyValMap( - $def->fields, - static function (FieldDefinitionNode $field) : string { - return $field->name->value; - }, - function (FieldDefinitionNode $field) : array { - return $this->buildField($field); - } - ); - } - - /** - * @return array - */ - public function buildField(FieldDefinitionNode $field) : array - { - return [ - // Note: While this could make assertions to get the correctly typed - // value, that would throw immediately while type system validation - // with validateSchema() will produce more actionable results. - 'type' => $this->buildWrappedType($field->type), - 'description' => $this->getDescription($field), - 'args' => $this->makeInputValues($field->arguments), - 'deprecationReason' => $this->getDeprecationReason($field), - 'astNode' => $field, - ]; - } - - /** - * Given a collection of directives, returns the string value for the - * deprecation reason. - * - * @param EnumValueDefinitionNode|FieldDefinitionNode $node - */ - private function getDeprecationReason(Node $node) : ?string - { - $deprecated = Values::getDirectiveValues( - Directive::deprecatedDirective(), - $node - ); - - return $deprecated['reason'] ?? null; - } - - /** - * @param ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode $def - * - * @return array - */ - private function makeImplementedInterfaces($def) : array - { - // Note: While this could make early assertions to get the correctly - // typed values, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - return Utils::map( - $def->interfaces, - function (NamedTypeNode $iface) : Type { - return $this->buildType($iface); - } - ); - } - - private function makeInterfaceDef(InterfaceTypeDefinitionNode $def) : InterfaceType - { - return new InterfaceType([ - 'name' => $def->name->value, - 'description' => $this->getDescription($def), - 'fields' => function () use ($def) : array { - return $this->makeFieldDefMap($def); - }, - 'interfaces' => function () use ($def) : array { - return $this->makeImplementedInterfaces($def); - }, - 'astNode' => $def, - ]); - } - - private function makeEnumDef(EnumTypeDefinitionNode $def) : EnumType - { - return new EnumType([ - 'name' => $def->name->value, - 'description' => $this->getDescription($def), - 'values' => Utils::keyValMap( - $def->values, - static function ($enumValue) { - return $enumValue->name->value; - }, - function ($enumValue) : array { - return [ - 'description' => $this->getDescription($enumValue), - 'deprecationReason' => $this->getDeprecationReason($enumValue), - 'astNode' => $enumValue, - ]; - } - ), - 'astNode' => $def, - ]); - } - - private function makeUnionDef(UnionTypeDefinitionNode $def) : UnionType - { - return new UnionType([ - 'name' => $def->name->value, - 'description' => $this->getDescription($def), - // Note: While this could make assertions to get the correctly typed - // values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - 'types' => function () use ($def) : array { - return Utils::map( - $def->types, - function ($typeNode) : Type { - return $this->buildType($typeNode); - } - ); - }, - 'astNode' => $def, - ]); - } - - private function makeScalarDef(ScalarTypeDefinitionNode $def) : CustomScalarType - { - return new CustomScalarType([ - 'name' => $def->name->value, - 'description' => $this->getDescription($def), - 'astNode' => $def, - 'serialize' => static function ($value) { - return $value; - }, - ]); - } - - private function makeInputObjectDef(InputObjectTypeDefinitionNode $def) : InputObjectType - { - return new InputObjectType([ - 'name' => $def->name->value, - 'description' => $this->getDescription($def), - 'fields' => function () use ($def) : array { - return $this->makeInputValues($def->fields); - }, - 'astNode' => $def, - ]); - } - - /** - * @param array $config - * - * @return CustomScalarType|EnumType|InputObjectType|InterfaceType|ObjectType|UnionType - * - * @throws Error - */ - private function makeSchemaDefFromConfig(Node $def, array $config) : Type - { - switch (true) { - case $def instanceof ObjectTypeDefinitionNode: - return new ObjectType($config); - case $def instanceof InterfaceTypeDefinitionNode: - return new InterfaceType($config); - case $def instanceof EnumTypeDefinitionNode: - return new EnumType($config); - case $def instanceof UnionTypeDefinitionNode: - return new UnionType($config); - case $def instanceof ScalarTypeDefinitionNode: - return new CustomScalarType($config); - case $def instanceof InputObjectTypeDefinitionNode: - return new InputObjectType($config); - default: - throw new Error(sprintf('Type kind of %s not supported.', $def->kind)); - } - } - - /** - * @return array - */ - public function buildInputField(InputValueDefinitionNode $value) : array - { - $type = $this->buildWrappedType($value->type); - - $config = [ - 'name' => $value->name->value, - 'type' => $type, - 'description' => $this->getDescription($value), - 'astNode' => $value, - ]; - - if ($value->defaultValue !== null) { - $config['defaultValue'] = $value->defaultValue; - } - - return $config; - } - - /** - * @return array - */ - public function buildEnumValue(EnumValueDefinitionNode $value) : array - { - return [ - 'description' => $this->getDescription($value), - 'deprecationReason' => $this->getDeprecationReason($value), - 'astNode' => $value, - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BlockString.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BlockString.php deleted file mode 100644 index a81760c2..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BlockString.php +++ /dev/null @@ -1,77 +0,0 @@ -= mb_strlen($line) || - ($commonIndent !== null && $indent >= $commonIndent) - ) { - continue; - } - - $commonIndent = $indent; - if ($commonIndent === 0) { - break; - } - } - - if ($commonIndent) { - for ($i = 1; $i < $linesLength; $i++) { - $line = $lines[$i]; - $lines[$i] = mb_substr($line, $commonIndent); - } - } - - // Remove leading and trailing blank lines. - while (count($lines) > 0 && trim($lines[0], " \t") === '') { - array_shift($lines); - } - while (count($lines) > 0 && trim($lines[count($lines) - 1], " \t") === '') { - array_pop($lines); - } - - // Return a string of the lines joined with U+000A. - return implode("\n", $lines); - } - - private static function leadingWhitespace($str) - { - $i = 0; - while ($i < mb_strlen($str) && ($str[$i] === ' ' || $str[$i] === '\t')) { - $i++; - } - - return $i; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php deleted file mode 100644 index 81a44956..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BreakingChangesFinder.php +++ /dev/null @@ -1,938 +0,0 @@ -getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - - $breakingChanges = []; - foreach (array_keys($oldTypeMap) as $typeName) { - if (isset($newTypeMap[$typeName])) { - continue; - } - - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_TYPE_REMOVED, - 'description' => $typeName . ' was removed.', - ]; - } - - return $breakingChanges; - } - - /** - * Given two schemas, returns an Array containing descriptions of any breaking - * changes in the newSchema related to changing the type of a type. - * - * @return string[][] - */ - public static function findTypesThatChangedKind( - Schema $schemaA, - Schema $schemaB - ) : iterable { - $schemaATypeMap = $schemaA->getTypeMap(); - $schemaBTypeMap = $schemaB->getTypeMap(); - - $breakingChanges = []; - foreach ($schemaATypeMap as $typeName => $schemaAType) { - if (! isset($schemaBTypeMap[$typeName])) { - continue; - } - $schemaBType = $schemaBTypeMap[$typeName]; - if ($schemaAType instanceof $schemaBType) { - continue; - } - - if ($schemaBType instanceof $schemaAType) { - continue; - } - - $schemaATypeKindName = self::typeKindName($schemaAType); - $schemaBTypeKindName = self::typeKindName($schemaBType); - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_TYPE_CHANGED_KIND, - 'description' => $typeName . ' changed from ' . $schemaATypeKindName . ' to ' . $schemaBTypeKindName . '.', - ]; - } - - return $breakingChanges; - } - - /** - * @return string - * - * @throws TypeError - */ - private static function typeKindName(Type $type) - { - if ($type instanceof ScalarType) { - return 'a Scalar type'; - } - - if ($type instanceof ObjectType) { - return 'an Object type'; - } - - if ($type instanceof InterfaceType) { - return 'an Interface type'; - } - - if ($type instanceof UnionType) { - return 'a Union type'; - } - - if ($type instanceof EnumType) { - return 'an Enum type'; - } - - if ($type instanceof InputObjectType) { - return 'an Input type'; - } - - throw new TypeError('unknown type ' . $type->name); - } - - /** - * @return string[][] - */ - public static function findFieldsThatChangedTypeOnObjectOrInterfaceTypes( - Schema $oldSchema, - Schema $newSchema - ) { - $oldTypeMap = $oldSchema->getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - - $breakingChanges = []; - foreach ($oldTypeMap as $typeName => $oldType) { - $newType = $newTypeMap[$typeName] ?? null; - if (! ($oldType instanceof ObjectType || $oldType instanceof InterfaceType) || - ! ($newType instanceof ObjectType || $newType instanceof InterfaceType) || - ! ($newType instanceof $oldType) - ) { - continue; - } - - $oldTypeFieldsDef = $oldType->getFields(); - $newTypeFieldsDef = $newType->getFields(); - foreach ($oldTypeFieldsDef as $fieldName => $fieldDefinition) { - // Check if the field is missing on the type in the new schema. - if (! isset($newTypeFieldsDef[$fieldName])) { - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_FIELD_REMOVED, - 'description' => $typeName . '.' . $fieldName . ' was removed.', - ]; - } else { - $oldFieldType = $oldTypeFieldsDef[$fieldName]->getType(); - $newFieldType = $newTypeFieldsDef[$fieldName]->getType(); - $isSafe = self::isChangeSafeForObjectOrInterfaceField( - $oldFieldType, - $newFieldType - ); - if (! $isSafe) { - $oldFieldTypeString = $oldFieldType instanceof NamedType && $oldFieldType instanceof Type - ? $oldFieldType->name - : $oldFieldType; - $newFieldTypeString = $newFieldType instanceof NamedType && $newFieldType instanceof Type - ? $newFieldType->name - : $newFieldType; - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_FIELD_CHANGED_KIND, - 'description' => $typeName . '.' . $fieldName . ' changed type from ' . $oldFieldTypeString . ' to ' . $newFieldTypeString . '.', - ]; - } - } - } - } - - return $breakingChanges; - } - - /** - * @return bool - */ - private static function isChangeSafeForObjectOrInterfaceField( - Type $oldType, - Type $newType - ) { - if ($oldType instanceof NamedType) { - return // if they're both named types, see if their names are equivalent - ($newType instanceof NamedType && $oldType->name === $newType->name) || - // moving from nullable to non-null of the same underlying type is safe - ($newType instanceof NonNull && - self::isChangeSafeForObjectOrInterfaceField($oldType, $newType->getWrappedType()) - ); - } - - if ($oldType instanceof ListOfType) { - return // if they're both lists, make sure the underlying types are compatible - ($newType instanceof ListOfType && - self::isChangeSafeForObjectOrInterfaceField( - $oldType->getWrappedType(), - $newType->getWrappedType() - )) || - // moving from nullable to non-null of the same underlying type is safe - ($newType instanceof NonNull && - self::isChangeSafeForObjectOrInterfaceField($oldType, $newType->getWrappedType())); - } - - if ($oldType instanceof NonNull) { - // if they're both non-null, make sure the underlying types are compatible - return $newType instanceof NonNull && - self::isChangeSafeForObjectOrInterfaceField($oldType->getWrappedType(), $newType->getWrappedType()); - } - - return false; - } - - /** - * @return array>> - */ - public static function findFieldsThatChangedTypeOnInputObjectTypes( - Schema $oldSchema, - Schema $newSchema - ) { - $oldTypeMap = $oldSchema->getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - - $breakingChanges = []; - $dangerousChanges = []; - foreach ($oldTypeMap as $typeName => $oldType) { - $newType = $newTypeMap[$typeName] ?? null; - if (! ($oldType instanceof InputObjectType) || ! ($newType instanceof InputObjectType)) { - continue; - } - - $oldTypeFieldsDef = $oldType->getFields(); - $newTypeFieldsDef = $newType->getFields(); - foreach (array_keys($oldTypeFieldsDef) as $fieldName) { - if (! isset($newTypeFieldsDef[$fieldName])) { - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_FIELD_REMOVED, - 'description' => $typeName . '.' . $fieldName . ' was removed.', - ]; - } else { - $oldFieldType = $oldTypeFieldsDef[$fieldName]->getType(); - $newFieldType = $newTypeFieldsDef[$fieldName]->getType(); - - $isSafe = self::isChangeSafeForInputObjectFieldOrFieldArg( - $oldFieldType, - $newFieldType - ); - if (! $isSafe) { - if ($oldFieldType instanceof NamedType) { - $oldFieldTypeString = $oldFieldType->name; - } else { - $oldFieldTypeString = $oldFieldType; - } - if ($newFieldType instanceof NamedType) { - $newFieldTypeString = $newFieldType->name; - } else { - $newFieldTypeString = $newFieldType; - } - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_FIELD_CHANGED_KIND, - 'description' => $typeName . '.' . $fieldName . ' changed type from ' . $oldFieldTypeString . ' to ' . $newFieldTypeString . '.', - ]; - } - } - } - // Check if a field was added to the input object type - foreach ($newTypeFieldsDef as $fieldName => $fieldDef) { - if (isset($oldTypeFieldsDef[$fieldName])) { - continue; - } - - $newTypeName = $newType->name; - if ($fieldDef->isRequired()) { - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_REQUIRED_INPUT_FIELD_ADDED, - 'description' => 'A required field ' . $fieldName . ' on input type ' . $newTypeName . ' was added.', - ]; - } else { - $dangerousChanges[] = [ - 'type' => self::DANGEROUS_CHANGE_OPTIONAL_INPUT_FIELD_ADDED, - 'description' => 'An optional field ' . $fieldName . ' on input type ' . $newTypeName . ' was added.', - ]; - } - } - } - - return [ - 'breakingChanges' => $breakingChanges, - 'dangerousChanges' => $dangerousChanges, - ]; - } - - /** - * @return bool - */ - private static function isChangeSafeForInputObjectFieldOrFieldArg( - Type $oldType, - Type $newType - ) { - if ($oldType instanceof NamedType) { - if (! $newType instanceof NamedType) { - return false; - } - - // if they're both named types, see if their names are equivalent - return $oldType->name === $newType->name; - } - - if ($oldType instanceof ListOfType) { - // if they're both lists, make sure the underlying types are compatible - return $newType instanceof ListOfType && - self::isChangeSafeForInputObjectFieldOrFieldArg( - $oldType->getWrappedType(), - $newType->getWrappedType() - ); - } - - if ($oldType instanceof NonNull) { - return // if they're both non-null, make sure the underlying types are - // compatible - ($newType instanceof NonNull && - self::isChangeSafeForInputObjectFieldOrFieldArg( - $oldType->getWrappedType(), - $newType->getWrappedType() - )) || - // moving from non-null to nullable of the same underlying type is safe - ! ($newType instanceof NonNull) && - self::isChangeSafeForInputObjectFieldOrFieldArg($oldType->getWrappedType(), $newType); - } - - return false; - } - - /** - * Given two schemas, returns an Array containing descriptions of any breaking - * changes in the newSchema related to removing types from a union type. - * - * @return string[][] - */ - public static function findTypesRemovedFromUnions( - Schema $oldSchema, - Schema $newSchema - ) { - $oldTypeMap = $oldSchema->getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - - $typesRemovedFromUnion = []; - foreach ($oldTypeMap as $typeName => $oldType) { - $newType = $newTypeMap[$typeName] ?? null; - if (! ($oldType instanceof UnionType) || ! ($newType instanceof UnionType)) { - continue; - } - $typeNamesInNewUnion = []; - foreach ($newType->getTypes() as $type) { - $typeNamesInNewUnion[$type->name] = true; - } - foreach ($oldType->getTypes() as $type) { - if (isset($typeNamesInNewUnion[$type->name])) { - continue; - } - - $typesRemovedFromUnion[] = [ - 'type' => self::BREAKING_CHANGE_TYPE_REMOVED_FROM_UNION, - 'description' => sprintf('%s was removed from union type %s.', $type->name, $typeName), - ]; - } - } - - return $typesRemovedFromUnion; - } - - /** - * Given two schemas, returns an Array containing descriptions of any breaking - * changes in the newSchema related to removing values from an enum type. - * - * @return string[][] - */ - public static function findValuesRemovedFromEnums( - Schema $oldSchema, - Schema $newSchema - ) { - $oldTypeMap = $oldSchema->getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - - $valuesRemovedFromEnums = []; - foreach ($oldTypeMap as $typeName => $oldType) { - $newType = $newTypeMap[$typeName] ?? null; - if (! ($oldType instanceof EnumType) || ! ($newType instanceof EnumType)) { - continue; - } - $valuesInNewEnum = []; - foreach ($newType->getValues() as $value) { - $valuesInNewEnum[$value->name] = true; - } - foreach ($oldType->getValues() as $value) { - if (isset($valuesInNewEnum[$value->name])) { - continue; - } - - $valuesRemovedFromEnums[] = [ - 'type' => self::BREAKING_CHANGE_VALUE_REMOVED_FROM_ENUM, - 'description' => sprintf('%s was removed from enum type %s.', $value->name, $typeName), - ]; - } - } - - return $valuesRemovedFromEnums; - } - - /** - * Given two schemas, returns an Array containing descriptions of any - * breaking or dangerous changes in the newSchema related to arguments - * (such as removal or change of type of an argument, or a change in an - * argument's default value). - * - * @return array>> - */ - public static function findArgChanges( - Schema $oldSchema, - Schema $newSchema - ) { - $oldTypeMap = $oldSchema->getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - - $breakingChanges = []; - $dangerousChanges = []; - - foreach ($oldTypeMap as $typeName => $oldType) { - $newType = $newTypeMap[$typeName] ?? null; - if (! ($oldType instanceof ObjectType || $oldType instanceof InterfaceType) || - ! ($newType instanceof ObjectType || $newType instanceof InterfaceType) || - ! ($newType instanceof $oldType) - ) { - continue; - } - - $oldTypeFields = $oldType->getFields(); - $newTypeFields = $newType->getFields(); - - foreach ($oldTypeFields as $fieldName => $oldField) { - if (! isset($newTypeFields[$fieldName])) { - continue; - } - - foreach ($oldField->args as $oldArgDef) { - $newArgs = $newTypeFields[$fieldName]->args; - $newArgDef = Utils::find( - $newArgs, - static function ($arg) use ($oldArgDef) : bool { - return $arg->name === $oldArgDef->name; - } - ); - if ($newArgDef !== null) { - $isSafe = self::isChangeSafeForInputObjectFieldOrFieldArg( - $oldArgDef->getType(), - $newArgDef->getType() - ); - /** @var ScalarType|EnumType|InputObjectType|ListOfType|NonNull $oldArgType */ - $oldArgType = $oldArgDef->getType(); - $oldArgName = $oldArgDef->name; - if (! $isSafe) { - $newArgType = $newArgDef->getType(); - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_ARG_CHANGED_KIND, - 'description' => $typeName . '.' . $fieldName . ' arg ' . $oldArgName . ' has changed type from ' . $oldArgType . ' to ' . $newArgType, - ]; - } elseif ($oldArgDef->defaultValueExists() && $oldArgDef->defaultValue !== $newArgDef->defaultValue) { - $dangerousChanges[] = [ - 'type' => self::DANGEROUS_CHANGE_ARG_DEFAULT_VALUE_CHANGED, - 'description' => $typeName . '.' . $fieldName . ' arg ' . $oldArgName . ' has changed defaultValue', - ]; - } - } else { - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_ARG_REMOVED, - 'description' => sprintf( - '%s.%s arg %s was removed', - $typeName, - $fieldName, - $oldArgDef->name - ), - ]; - } - // Check if arg was added to the field - foreach ($newTypeFields[$fieldName]->args as $newTypeFieldArgDef) { - $oldArgs = $oldTypeFields[$fieldName]->args; - $oldArgDef = Utils::find( - $oldArgs, - static function ($arg) use ($newTypeFieldArgDef) : bool { - return $arg->name === $newTypeFieldArgDef->name; - } - ); - - if ($oldArgDef !== null) { - continue; - } - - $newTypeName = $newType->name; - $newArgName = $newTypeFieldArgDef->name; - if ($newTypeFieldArgDef->isRequired()) { - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_REQUIRED_ARG_ADDED, - 'description' => 'A required arg ' . $newArgName . ' on ' . $newTypeName . '.' . $fieldName . ' was added', - ]; - } else { - $dangerousChanges[] = [ - 'type' => self::DANGEROUS_CHANGE_OPTIONAL_ARG_ADDED, - 'description' => 'An optional arg ' . $newArgName . ' on ' . $newTypeName . '.' . $fieldName . ' was added', - ]; - } - } - } - } - } - - return [ - 'breakingChanges' => $breakingChanges, - 'dangerousChanges' => $dangerousChanges, - ]; - } - - /** - * @return string[][] - */ - public static function findInterfacesRemovedFromObjectTypes( - Schema $oldSchema, - Schema $newSchema - ) { - $oldTypeMap = $oldSchema->getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - $breakingChanges = []; - - foreach ($oldTypeMap as $typeName => $oldType) { - $newType = $newTypeMap[$typeName] ?? null; - if (! ($oldType instanceof ImplementingType) || ! ($newType instanceof ImplementingType)) { - continue; - } - - $oldInterfaces = $oldType->getInterfaces(); - $newInterfaces = $newType->getInterfaces(); - foreach ($oldInterfaces as $oldInterface) { - $interface = Utils::find( - $newInterfaces, - static function (InterfaceType $interface) use ($oldInterface) : bool { - return $interface->name === $oldInterface->name; - } - ); - if ($interface !== null) { - continue; - } - - $breakingChanges[] = [ - 'type' => self::BREAKING_CHANGE_IMPLEMENTED_INTERFACE_REMOVED, - 'description' => sprintf('%s no longer implements interface %s.', $typeName, $oldInterface->name), - ]; - } - } - - return $breakingChanges; - } - - /** - * @return string[][] - */ - public static function findRemovedDirectives(Schema $oldSchema, Schema $newSchema) - { - $removedDirectives = []; - - $newSchemaDirectiveMap = self::getDirectiveMapForSchema($newSchema); - foreach ($oldSchema->getDirectives() as $directive) { - if (isset($newSchemaDirectiveMap[$directive->name])) { - continue; - } - - $removedDirectives[] = [ - 'type' => self::BREAKING_CHANGE_DIRECTIVE_REMOVED, - 'description' => sprintf('%s was removed', $directive->name), - ]; - } - - return $removedDirectives; - } - - private static function getDirectiveMapForSchema(Schema $schema) - { - return Utils::keyMap( - $schema->getDirectives(), - static function ($dir) { - return $dir->name; - } - ); - } - - public static function findRemovedDirectiveArgs(Schema $oldSchema, Schema $newSchema) - { - $removedDirectiveArgs = []; - $oldSchemaDirectiveMap = self::getDirectiveMapForSchema($oldSchema); - - foreach ($newSchema->getDirectives() as $newDirective) { - if (! isset($oldSchemaDirectiveMap[$newDirective->name])) { - continue; - } - - foreach (self::findRemovedArgsForDirectives( - $oldSchemaDirectiveMap[$newDirective->name], - $newDirective - ) as $arg) { - $removedDirectiveArgs[] = [ - 'type' => self::BREAKING_CHANGE_DIRECTIVE_ARG_REMOVED, - 'description' => sprintf('%s was removed from %s', $arg->name, $newDirective->name), - ]; - } - } - - return $removedDirectiveArgs; - } - - public static function findRemovedArgsForDirectives(Directive $oldDirective, Directive $newDirective) - { - $removedArgs = []; - $newArgMap = self::getArgumentMapForDirective($newDirective); - foreach ($oldDirective->args as $arg) { - if (isset($newArgMap[$arg->name])) { - continue; - } - - $removedArgs[] = $arg; - } - - return $removedArgs; - } - - private static function getArgumentMapForDirective(Directive $directive) - { - return Utils::keyMap( - $directive->args ?? [], - static function ($arg) { - return $arg->name; - } - ); - } - - public static function findAddedNonNullDirectiveArgs(Schema $oldSchema, Schema $newSchema) - { - $addedNonNullableArgs = []; - $oldSchemaDirectiveMap = self::getDirectiveMapForSchema($oldSchema); - - foreach ($newSchema->getDirectives() as $newDirective) { - if (! isset($oldSchemaDirectiveMap[$newDirective->name])) { - continue; - } - - foreach (self::findAddedArgsForDirective( - $oldSchemaDirectiveMap[$newDirective->name], - $newDirective - ) as $arg) { - if (! $arg->isRequired()) { - continue; - } - $addedNonNullableArgs[] = [ - 'type' => self::BREAKING_CHANGE_REQUIRED_DIRECTIVE_ARG_ADDED, - 'description' => sprintf( - 'A required arg %s on directive %s was added', - $arg->name, - $newDirective->name - ), - ]; - } - } - - return $addedNonNullableArgs; - } - - /** - * @return FieldArgument[] - */ - public static function findAddedArgsForDirective(Directive $oldDirective, Directive $newDirective) - { - $addedArgs = []; - $oldArgMap = self::getArgumentMapForDirective($oldDirective); - foreach ($newDirective->args as $arg) { - if (isset($oldArgMap[$arg->name])) { - continue; - } - - $addedArgs[] = $arg; - } - - return $addedArgs; - } - - /** - * @return string[][] - */ - public static function findRemovedDirectiveLocations(Schema $oldSchema, Schema $newSchema) - { - $removedLocations = []; - $oldSchemaDirectiveMap = self::getDirectiveMapForSchema($oldSchema); - - foreach ($newSchema->getDirectives() as $newDirective) { - if (! isset($oldSchemaDirectiveMap[$newDirective->name])) { - continue; - } - - foreach (self::findRemovedLocationsForDirective( - $oldSchemaDirectiveMap[$newDirective->name], - $newDirective - ) as $location) { - $removedLocations[] = [ - 'type' => self::BREAKING_CHANGE_DIRECTIVE_LOCATION_REMOVED, - 'description' => sprintf('%s was removed from %s', $location, $newDirective->name), - ]; - } - } - - return $removedLocations; - } - - public static function findRemovedLocationsForDirective(Directive $oldDirective, Directive $newDirective) - { - $removedLocations = []; - $newLocationSet = array_flip($newDirective->locations); - foreach ($oldDirective->locations as $oldLocation) { - if (array_key_exists($oldLocation, $newLocationSet)) { - continue; - } - - $removedLocations[] = $oldLocation; - } - - return $removedLocations; - } - - /** - * Given two schemas, returns an Array containing descriptions of all the types - * of potentially dangerous changes covered by the other functions down below. - * - * @return string[][] - */ - public static function findDangerousChanges(Schema $oldSchema, Schema $newSchema) - { - return array_merge( - self::findArgChanges($oldSchema, $newSchema)['dangerousChanges'], - self::findValuesAddedToEnums($oldSchema, $newSchema), - self::findInterfacesAddedToObjectTypes($oldSchema, $newSchema), - self::findTypesAddedToUnions($oldSchema, $newSchema), - self::findFieldsThatChangedTypeOnInputObjectTypes($oldSchema, $newSchema)['dangerousChanges'] - ); - } - - /** - * Given two schemas, returns an Array containing descriptions of any dangerous - * changes in the newSchema related to adding values to an enum type. - * - * @return string[][] - */ - public static function findValuesAddedToEnums( - Schema $oldSchema, - Schema $newSchema - ) { - $oldTypeMap = $oldSchema->getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - - $valuesAddedToEnums = []; - foreach ($oldTypeMap as $typeName => $oldType) { - $newType = $newTypeMap[$typeName] ?? null; - if (! ($oldType instanceof EnumType) || ! ($newType instanceof EnumType)) { - continue; - } - $valuesInOldEnum = []; - foreach ($oldType->getValues() as $value) { - $valuesInOldEnum[$value->name] = true; - } - foreach ($newType->getValues() as $value) { - if (isset($valuesInOldEnum[$value->name])) { - continue; - } - - $valuesAddedToEnums[] = [ - 'type' => self::DANGEROUS_CHANGE_VALUE_ADDED_TO_ENUM, - 'description' => sprintf('%s was added to enum type %s.', $value->name, $typeName), - ]; - } - } - - return $valuesAddedToEnums; - } - - /** - * @return string[][] - */ - public static function findInterfacesAddedToObjectTypes( - Schema $oldSchema, - Schema $newSchema - ) { - $oldTypeMap = $oldSchema->getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - $interfacesAddedToObjectTypes = []; - - foreach ($newTypeMap as $typeName => $newType) { - $oldType = $oldTypeMap[$typeName] ?? null; - if (! ($oldType instanceof ObjectType || $oldType instanceof InterfaceType) - || ! ($newType instanceof ObjectType || $newType instanceof InterfaceType)) { - continue; - } - - $oldInterfaces = $oldType->getInterfaces(); - $newInterfaces = $newType->getInterfaces(); - foreach ($newInterfaces as $newInterface) { - $interface = Utils::find( - $oldInterfaces, - static function (InterfaceType $interface) use ($newInterface) : bool { - return $interface->name === $newInterface->name; - } - ); - - if ($interface !== null) { - continue; - } - - $interfacesAddedToObjectTypes[] = [ - 'type' => self::DANGEROUS_CHANGE_IMPLEMENTED_INTERFACE_ADDED, - 'description' => sprintf( - '%s added to interfaces implemented by %s.', - $newInterface->name, - $typeName - ), - ]; - } - } - - return $interfacesAddedToObjectTypes; - } - - /** - * Given two schemas, returns an Array containing descriptions of any dangerous - * changes in the newSchema related to adding types to a union type. - * - * @return string[][] - */ - public static function findTypesAddedToUnions( - Schema $oldSchema, - Schema $newSchema - ) { - $oldTypeMap = $oldSchema->getTypeMap(); - $newTypeMap = $newSchema->getTypeMap(); - - $typesAddedToUnion = []; - foreach ($newTypeMap as $typeName => $newType) { - $oldType = $oldTypeMap[$typeName] ?? null; - if (! ($oldType instanceof UnionType) || ! ($newType instanceof UnionType)) { - continue; - } - - $typeNamesInOldUnion = []; - foreach ($oldType->getTypes() as $type) { - $typeNamesInOldUnion[$type->name] = true; - } - foreach ($newType->getTypes() as $type) { - if (isset($typeNamesInOldUnion[$type->name])) { - continue; - } - - $typesAddedToUnion[] = [ - 'type' => self::DANGEROUS_CHANGE_TYPE_ADDED_TO_UNION, - 'description' => sprintf('%s was added to union type %s.', $type->name, $typeName), - ]; - } - } - - return $typesAddedToUnion; - } -} - -class_alias(BreakingChangesFinder::class, 'GraphQL\Utils\FindBreakingChanges'); diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildClientSchema.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildClientSchema.php deleted file mode 100644 index d8f739ff..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildClientSchema.php +++ /dev/null @@ -1,496 +0,0 @@ - */ - private $introspection; - - /** @var array */ - private $options; - - /** @var array */ - private $typeMap; - - /** - * @param array $introspectionQuery - * @param array $options - */ - public function __construct(array $introspectionQuery, array $options = []) - { - $this->introspection = $introspectionQuery; - $this->options = $options; - } - - /** - * Build a schema for use by client tools. - * - * Given the result of a client running the introspection query, creates and - * returns a \GraphQL\Type\Schema instance which can be then used with all graphql-php - * tools, but cannot be used to execute a query, as introspection does not - * represent the "resolver", "parse" or "serialize" functions or any other - * server-internal mechanisms. - * - * This function expects a complete introspection result. Don't forget to check - * the "errors" field of a server response before calling this function. - * - * Accepts options as a third argument: - * - * - assumeValid: - * When building a schema from a GraphQL service's introspection result, it - * might be safe to assume the schema is valid. Set to true to assume the - * produced schema is valid. - * - * Default: false - * - * @param array $introspectionQuery - * @param array $options - * - * @api - */ - public static function build(array $introspectionQuery, array $options = []) : Schema - { - $builder = new self($introspectionQuery, $options); - - return $builder->buildSchema(); - } - - public function buildSchema() : Schema - { - if (! array_key_exists('__schema', $this->introspection)) { - throw new InvariantViolation('Invalid or incomplete introspection result. Ensure that you are passing "data" property of introspection response and no "errors" was returned alongside: ' . json_encode($this->introspection) . '.'); - } - - $schemaIntrospection = $this->introspection['__schema']; - - $this->typeMap = Utils::keyValMap( - $schemaIntrospection['types'], - static function (array $typeIntrospection) { - return $typeIntrospection['name']; - }, - function (array $typeIntrospection) : NamedType { - return $this->buildType($typeIntrospection); - } - ); - - $builtInTypes = array_merge( - Type::getStandardTypes(), - Introspection::getTypes() - ); - foreach ($builtInTypes as $name => $type) { - if (! isset($this->typeMap[$name])) { - continue; - } - - $this->typeMap[$name] = $type; - } - - $queryType = isset($schemaIntrospection['queryType']) - ? $this->getObjectType($schemaIntrospection['queryType']) - : null; - - $mutationType = isset($schemaIntrospection['mutationType']) - ? $this->getObjectType($schemaIntrospection['mutationType']) - : null; - - $subscriptionType = isset($schemaIntrospection['subscriptionType']) - ? $this->getObjectType($schemaIntrospection['subscriptionType']) - : null; - - $directives = isset($schemaIntrospection['directives']) - ? array_map( - [$this, 'buildDirective'], - $schemaIntrospection['directives'] - ) - : []; - - $schemaConfig = new SchemaConfig(); - $schemaConfig->setQuery($queryType) - ->setMutation($mutationType) - ->setSubscription($subscriptionType) - ->setTypes($this->typeMap) - ->setDirectives($directives) - ->setAssumeValid( - isset($this->options) - && isset($this->options['assumeValid']) - && $this->options['assumeValid'] - ); - - return new Schema($schemaConfig); - } - - /** - * @param array $typeRef - */ - private function getType(array $typeRef) : Type - { - if (isset($typeRef['kind'])) { - if ($typeRef['kind'] === TypeKind::LIST) { - if (! isset($typeRef['ofType'])) { - throw new InvariantViolation('Decorated type deeper than introspection query.'); - } - - return new ListOfType($this->getType($typeRef['ofType'])); - } - - if ($typeRef['kind'] === TypeKind::NON_NULL) { - if (! isset($typeRef['ofType'])) { - throw new InvariantViolation('Decorated type deeper than introspection query.'); - } - /** @var NullableType $nullableType */ - $nullableType = $this->getType($typeRef['ofType']); - - return new NonNull($nullableType); - } - } - - if (! isset($typeRef['name'])) { - throw new InvariantViolation('Unknown type reference: ' . json_encode($typeRef) . '.'); - } - - return $this->getNamedType($typeRef['name']); - } - - /** - * @return NamedType&Type - */ - private function getNamedType(string $typeName) : NamedType - { - if (! isset($this->typeMap[$typeName])) { - throw new InvariantViolation( - 'Invalid or incomplete schema, unknown type: ' . $typeName . '. Ensure that a full introspection query is used in order to build a client schema.' - ); - } - - return $this->typeMap[$typeName]; - } - - /** - * @param array $typeRef - */ - private function getInputType(array $typeRef) : InputType - { - $type = $this->getType($typeRef); - - if ($type instanceof InputType) { - return $type; - } - - throw new InvariantViolation('Introspection must provide input type for arguments, but received: ' . json_encode($type) . '.'); - } - - /** - * @param array $typeRef - */ - private function getOutputType(array $typeRef) : OutputType - { - $type = $this->getType($typeRef); - - if ($type instanceof OutputType) { - return $type; - } - - throw new InvariantViolation('Introspection must provide output type for fields, but received: ' . json_encode($type) . '.'); - } - - /** - * @param array $typeRef - */ - private function getObjectType(array $typeRef) : ObjectType - { - $type = $this->getType($typeRef); - - return ObjectType::assertObjectType($type); - } - - /** - * @param array $typeRef - */ - public function getInterfaceType(array $typeRef) : InterfaceType - { - $type = $this->getType($typeRef); - - return InterfaceType::assertInterfaceType($type); - } - - /** - * @param array $type - */ - private function buildType(array $type) : NamedType - { - if (array_key_exists('name', $type) && array_key_exists('kind', $type)) { - switch ($type['kind']) { - case TypeKind::SCALAR: - return $this->buildScalarDef($type); - case TypeKind::OBJECT: - return $this->buildObjectDef($type); - case TypeKind::INTERFACE: - return $this->buildInterfaceDef($type); - case TypeKind::UNION: - return $this->buildUnionDef($type); - case TypeKind::ENUM: - return $this->buildEnumDef($type); - case TypeKind::INPUT_OBJECT: - return $this->buildInputObjectDef($type); - } - } - - throw new InvariantViolation( - 'Invalid or incomplete introspection result. Ensure that a full introspection query is used in order to build a client schema: ' . json_encode($type) . '.' - ); - } - - /** - * @param array $scalar - */ - private function buildScalarDef(array $scalar) : ScalarType - { - return new CustomScalarType([ - 'name' => $scalar['name'], - 'description' => $scalar['description'], - 'serialize' => static function ($value) : string { - return (string) $value; - }, - ]); - } - - /** - * @param array $implementingIntrospection - * - * @return array - */ - private function buildImplementationsList(array $implementingIntrospection) : array - { - // TODO: Temporary workaround until GraphQL ecosystem will fully support 'interfaces' on interface types. - if (array_key_exists('interfaces', $implementingIntrospection) && - $implementingIntrospection['interfaces'] === null && - $implementingIntrospection['kind'] === TypeKind::INTERFACE) { - return []; - } - - if (! array_key_exists('interfaces', $implementingIntrospection)) { - throw new InvariantViolation('Introspection result missing interfaces: ' . json_encode($implementingIntrospection) . '.'); - } - - return array_map([$this, 'getInterfaceType'], $implementingIntrospection['interfaces']); - } - - /** - * @param array $object - */ - private function buildObjectDef(array $object) : ObjectType - { - return new ObjectType([ - 'name' => $object['name'], - 'description' => $object['description'], - 'interfaces' => function () use ($object) : array { - return $this->buildImplementationsList($object); - }, - 'fields' => function () use ($object) { - return $this->buildFieldDefMap($object); - }, - ]); - } - - /** - * @param array $interface - */ - private function buildInterfaceDef(array $interface) : InterfaceType - { - return new InterfaceType([ - 'name' => $interface['name'], - 'description' => $interface['description'], - 'fields' => function () use ($interface) { - return $this->buildFieldDefMap($interface); - }, - 'interfaces' => function () use ($interface) : array { - return $this->buildImplementationsList($interface); - }, - ]); - } - - /** - * @param array> $union - */ - private function buildUnionDef(array $union) : UnionType - { - if (! array_key_exists('possibleTypes', $union)) { - throw new InvariantViolation('Introspection result missing possibleTypes: ' . json_encode($union) . '.'); - } - - return new UnionType([ - 'name' => $union['name'], - 'description' => $union['description'], - 'types' => function () use ($union) : array { - return array_map( - [$this, 'getObjectType'], - $union['possibleTypes'] - ); - }, - ]); - } - - /** - * @param array> $enum - */ - private function buildEnumDef(array $enum) : EnumType - { - if (! array_key_exists('enumValues', $enum)) { - throw new InvariantViolation('Introspection result missing enumValues: ' . json_encode($enum) . '.'); - } - - return new EnumType([ - 'name' => $enum['name'], - 'description' => $enum['description'], - 'values' => Utils::keyValMap( - $enum['enumValues'], - static function (array $enumValue) : string { - return $enumValue['name']; - }, - static function (array $enumValue) : array { - return [ - 'description' => $enumValue['description'], - 'deprecationReason' => $enumValue['deprecationReason'], - ]; - } - ), - ]); - } - - /** - * @param array $inputObject - */ - private function buildInputObjectDef(array $inputObject) : InputObjectType - { - if (! array_key_exists('inputFields', $inputObject)) { - throw new InvariantViolation('Introspection result missing inputFields: ' . json_encode($inputObject) . '.'); - } - - return new InputObjectType([ - 'name' => $inputObject['name'], - 'description' => $inputObject['description'], - 'fields' => function () use ($inputObject) : array { - return $this->buildInputValueDefMap($inputObject['inputFields']); - }, - ]); - } - - /** - * @param array $typeIntrospection - */ - private function buildFieldDefMap(array $typeIntrospection) - { - if (! array_key_exists('fields', $typeIntrospection)) { - throw new InvariantViolation('Introspection result missing fields: ' . json_encode($typeIntrospection) . '.'); - } - - return Utils::keyValMap( - $typeIntrospection['fields'], - static function (array $fieldIntrospection) : string { - return $fieldIntrospection['name']; - }, - function (array $fieldIntrospection) : array { - if (! array_key_exists('args', $fieldIntrospection)) { - throw new InvariantViolation('Introspection result missing field args: ' . json_encode($fieldIntrospection) . '.'); - } - - return [ - 'description' => $fieldIntrospection['description'], - 'deprecationReason' => $fieldIntrospection['deprecationReason'], - 'type' => $this->getOutputType($fieldIntrospection['type']), - 'args' => $this->buildInputValueDefMap($fieldIntrospection['args']), - ]; - } - ); - } - - /** - * @param array> $inputValueIntrospections - * - * @return array> - */ - private function buildInputValueDefMap(array $inputValueIntrospections) : array - { - return Utils::keyValMap( - $inputValueIntrospections, - static function (array $inputValue) : string { - return $inputValue['name']; - }, - [$this, 'buildInputValue'] - ); - } - - /** - * @param array $inputValueIntrospection - * - * @return array - */ - public function buildInputValue(array $inputValueIntrospection) : array - { - $type = $this->getInputType($inputValueIntrospection['type']); - - $inputValue = [ - 'description' => $inputValueIntrospection['description'], - 'type' => $type, - ]; - - if (isset($inputValueIntrospection['defaultValue'])) { - $inputValue['defaultValue'] = AST::valueFromAST( - Parser::parseValue($inputValueIntrospection['defaultValue']), - $type - ); - } - - return $inputValue; - } - - /** - * @param array $directive - */ - public function buildDirective(array $directive) : Directive - { - if (! array_key_exists('args', $directive)) { - throw new InvariantViolation('Introspection result missing directive args: ' . json_encode($directive) . '.'); - } - if (! array_key_exists('locations', $directive)) { - throw new InvariantViolation('Introspection result missing directive locations: ' . json_encode($directive) . '.'); - } - - return new Directive([ - 'name' => $directive['name'], - 'description' => $directive['description'], - 'args' => $this->buildInputValueDefMap($directive['args']), - 'isRepeatable' => $directive['isRepeatable'] ?? false, - 'locations' => $directive['locations'], - ]); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildSchema.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildSchema.php deleted file mode 100644 index 3e057754..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/BuildSchema.php +++ /dev/null @@ -1,237 +0,0 @@ - */ - private $nodeMap; - - /** @var callable|null */ - private $typeConfigDecorator; - - /** @var array */ - private $options; - - /** - * @param array $options - */ - public function __construct(DocumentNode $ast, ?callable $typeConfigDecorator = null, array $options = []) - { - $this->ast = $ast; - $this->typeConfigDecorator = $typeConfigDecorator; - $this->options = $options; - } - - /** - * A helper function to build a GraphQLSchema directly from a source - * document. - * - * @param DocumentNode|Source|string $source - * @param array $options - * - * @return Schema - * - * @api - */ - public static function build($source, ?callable $typeConfigDecorator = null, array $options = []) - { - $doc = $source instanceof DocumentNode - ? $source - : Parser::parse($source); - - return self::buildAST($doc, $typeConfigDecorator, $options); - } - - /** - * This takes the ast of a schema document produced by the parse function in - * GraphQL\Language\Parser. - * - * If no schema definition is provided, then it will look for types named Query - * and Mutation. - * - * Given that AST it constructs a GraphQL\Type\Schema. The resulting schema - * has no resolve methods, so execution will use default resolvers. - * - * Accepts options as a third argument: - * - * - commentDescriptions: - * Provide true to use preceding comments as the description. - * This option is provided to ease adoption and will be removed in v16. - * - * @param array $options - * - * @return Schema - * - * @throws Error - * - * @api - */ - public static function buildAST(DocumentNode $ast, ?callable $typeConfigDecorator = null, array $options = []) - { - $builder = new self($ast, $typeConfigDecorator, $options); - - return $builder->buildSchema(); - } - - public function buildSchema() - { - $options = $this->options; - if (! ($options['assumeValid'] ?? false) && ! ($options['assumeValidSDL'] ?? false)) { - DocumentValidator::assertValidSDL($this->ast); - } - - $schemaDef = null; - $typeDefs = []; - $this->nodeMap = []; - /** @var array $directiveDefs */ - $directiveDefs = []; - foreach ($this->ast->definitions as $definition) { - switch (true) { - case $definition instanceof SchemaDefinitionNode: - $schemaDef = $definition; - break; - case $definition instanceof TypeDefinitionNode: - $typeName = $definition->name->value; - if (isset($this->nodeMap[$typeName])) { - throw new Error(sprintf('Type "%s" was defined more than once.', $typeName)); - } - $typeDefs[] = $definition; - $this->nodeMap[$typeName] = $definition; - break; - case $definition instanceof DirectiveDefinitionNode: - $directiveDefs[] = $definition; - break; - } - } - - $operationTypes = $schemaDef !== null - ? $this->getOperationTypes($schemaDef) - : [ - 'query' => isset($this->nodeMap['Query']) ? 'Query' : null, - 'mutation' => isset($this->nodeMap['Mutation']) ? 'Mutation' : null, - 'subscription' => isset($this->nodeMap['Subscription']) ? 'Subscription' : null, - ]; - - $DefinitionBuilder = new ASTDefinitionBuilder( - $this->nodeMap, - $this->options, - static function ($typeName) : void { - throw new Error('Type "' . $typeName . '" not found in document.'); - }, - $this->typeConfigDecorator - ); - - $directives = array_map( - static function (DirectiveDefinitionNode $def) use ($DefinitionBuilder) : Directive { - return $DefinitionBuilder->buildDirective($def); - }, - $directiveDefs - ); - - // If specified directives were not explicitly declared, add them. - $directivesByName = Utils::groupBy( - $directives, - static function (Directive $directive) : string { - return $directive->name; - } - ); - if (! isset($directivesByName['skip'])) { - $directives[] = Directive::skipDirective(); - } - if (! isset($directivesByName['include'])) { - $directives[] = Directive::includeDirective(); - } - if (! isset($directivesByName['deprecated'])) { - $directives[] = Directive::deprecatedDirective(); - } - - // Note: While this could make early assertions to get the correctly - // typed values below, that would throw immediately while type system - // validation with validateSchema() will produce more actionable results. - - return new Schema([ - 'query' => isset($operationTypes['query']) - ? $DefinitionBuilder->buildType($operationTypes['query']) - : null, - 'mutation' => isset($operationTypes['mutation']) - ? $DefinitionBuilder->buildType($operationTypes['mutation']) - : null, - 'subscription' => isset($operationTypes['subscription']) - ? $DefinitionBuilder->buildType($operationTypes['subscription']) - : null, - 'typeLoader' => static function ($name) use ($DefinitionBuilder) : Type { - return $DefinitionBuilder->buildType($name); - }, - 'directives' => $directives, - 'astNode' => $schemaDef, - 'types' => function () use ($DefinitionBuilder) : array { - $types = []; - /** @var ScalarTypeDefinitionNode|ObjectTypeDefinitionNode|InterfaceTypeDefinitionNode|UnionTypeDefinitionNode|EnumTypeDefinitionNode|InputObjectTypeDefinitionNode $def */ - foreach ($this->nodeMap as $name => $def) { - $types[] = $DefinitionBuilder->buildType($def->name->value); - } - - return $types; - }, - ]); - } - - /** - * @param SchemaDefinitionNode $schemaDef - * - * @return string[] - * - * @throws Error - */ - private function getOperationTypes($schemaDef) - { - $opTypes = []; - - foreach ($schemaDef->operationTypes as $operationType) { - $typeName = $operationType->type->name->value; - $operation = $operationType->operation; - - if (isset($opTypes[$operation])) { - throw new Error(sprintf('Must provide only one %s type in schema.', $operation)); - } - - if (! isset($this->nodeMap[$typeName])) { - throw new Error(sprintf('Specified %s type "%s" not found in document.', $operation, $typeName)); - } - - $opTypes[$operation] = $typeName; - } - - return $opTypes; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/InterfaceImplementations.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/InterfaceImplementations.php deleted file mode 100644 index eca7fd26..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/InterfaceImplementations.php +++ /dev/null @@ -1,48 +0,0 @@ - */ - private $objects; - - /** @var array */ - private $interfaces; - - /** - * @param array $objects - * @param array $interfaces - */ - public function __construct(array $objects, array $interfaces) - { - $this->objects = $objects; - $this->interfaces = $interfaces; - } - - /** - * @return array - */ - public function objects() : array - { - return $this->objects; - } - - /** - * @return array - */ - public function interfaces() : array - { - return $this->interfaces; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/MixedStore.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/MixedStore.php deleted file mode 100644 index c6183674..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/MixedStore.php +++ /dev/null @@ -1,247 +0,0 @@ -standardStore = []; - $this->floatStore = []; - $this->objectStore = new SplObjectStorage(); - $this->arrayKeys = []; - $this->arrayValues = []; - $this->nullValueIsSet = false; - $this->trueValueIsSet = false; - $this->falseValueIsSet = false; - } - - /** - * Whether a offset exists - * - * @link http://php.net/manual/en/arrayaccess.offsetexists.php - * - * @param mixed $offset

- * An offset to check for. - *

- * - * @return bool true on success or false on failure. - *

- *

- * The return value will be casted to boolean if non-boolean was returned. - */ - public function offsetExists($offset) : bool - { - if ($offset === false) { - return $this->falseValueIsSet; - } - if ($offset === true) { - return $this->trueValueIsSet; - } - if (is_int($offset) || is_string($offset)) { - return array_key_exists($offset, $this->standardStore); - } - if (is_float($offset)) { - return array_key_exists((string) $offset, $this->floatStore); - } - if (is_object($offset)) { - return $this->objectStore->offsetExists($offset); - } - if (is_array($offset)) { - foreach ($this->arrayKeys as $index => $entry) { - if ($entry === $offset) { - $this->lastArrayKey = $offset; - $this->lastArrayValue = $this->arrayValues[$index]; - - return true; - } - } - } - if ($offset === null) { - return $this->nullValueIsSet; - } - - return false; - } - - /** - * Offset to retrieve - * - * @link http://php.net/manual/en/arrayaccess.offsetget.php - * - * @param mixed $offset

- * The offset to retrieve. - *

- * - * @return mixed Can return all value types. - */ - #[ReturnTypeWillChange] - public function offsetGet($offset) - { - if ($offset === true) { - return $this->trueValue; - } - if ($offset === false) { - return $this->falseValue; - } - if (is_int($offset) || is_string($offset)) { - return $this->standardStore[$offset]; - } - if (is_float($offset)) { - return $this->floatStore[(string) $offset]; - } - if (is_object($offset)) { - return $this->objectStore->offsetGet($offset); - } - if (is_array($offset)) { - // offsetGet is often called directly after offsetExists, so optimize to avoid second loop: - if ($this->lastArrayKey === $offset) { - return $this->lastArrayValue; - } - foreach ($this->arrayKeys as $index => $entry) { - if ($entry === $offset) { - return $this->arrayValues[$index]; - } - } - } - if ($offset === null) { - return $this->nullValue; - } - - return null; - } - - /** - * Offset to set - * - * @link http://php.net/manual/en/arrayaccess.offsetset.php - * - * @param mixed $offset

- * The offset to assign the value to. - *

- * @param mixed $value

- * The value to set. - *

- */ - public function offsetSet($offset, $value) : void - { - if ($offset === false) { - $this->falseValue = $value; - $this->falseValueIsSet = true; - } elseif ($offset === true) { - $this->trueValue = $value; - $this->trueValueIsSet = true; - } elseif (is_int($offset) || is_string($offset)) { - $this->standardStore[$offset] = $value; - } elseif (is_float($offset)) { - $this->floatStore[(string) $offset] = $value; - } elseif (is_object($offset)) { - $this->objectStore[$offset] = $value; - } elseif (is_array($offset)) { - $this->arrayKeys[] = $offset; - $this->arrayValues[] = $value; - } elseif ($offset === null) { - $this->nullValue = $value; - $this->nullValueIsSet = true; - } else { - throw new InvalidArgumentException('Unexpected offset type: ' . Utils::printSafe($offset)); - } - } - - /** - * Offset to unset - * - * @link http://php.net/manual/en/arrayaccess.offsetunset.php - * - * @param mixed $offset

- * The offset to unset. - *

- */ - public function offsetUnset($offset) : void - { - if ($offset === true) { - $this->trueValue = null; - $this->trueValueIsSet = false; - } elseif ($offset === false) { - $this->falseValue = null; - $this->falseValueIsSet = false; - } elseif (is_int($offset) || is_string($offset)) { - unset($this->standardStore[$offset]); - } elseif (is_float($offset)) { - unset($this->floatStore[(string) $offset]); - } elseif (is_object($offset)) { - $this->objectStore->offsetUnset($offset); - } elseif (is_array($offset)) { - $index = array_search($offset, $this->arrayKeys, true); - - if ($index !== false) { - array_splice($this->arrayKeys, $index, 1); - array_splice($this->arrayValues, $index, 1); - } - } elseif ($offset === null) { - $this->nullValue = null; - $this->nullValueIsSet = false; - } - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/PairSet.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/PairSet.php deleted file mode 100644 index fe3a514c..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/PairSet.php +++ /dev/null @@ -1,66 +0,0 @@ -data = []; - } - - /** - * @param string $a - * @param string $b - * @param bool $areMutuallyExclusive - * - * @return bool - */ - public function has($a, $b, $areMutuallyExclusive) - { - $first = $this->data[$a] ?? null; - $result = $first && isset($first[$b]) ? $first[$b] : null; - if ($result === null) { - return false; - } - // areMutuallyExclusive being false is a superset of being true, - // hence if we want to know if this PairSet "has" these two with no - // exclusivity, we have to ensure it was added as such. - if ($areMutuallyExclusive === false) { - return $result === false; - } - - return true; - } - - /** - * @param string $a - * @param string $b - * @param bool $areMutuallyExclusive - */ - public function add($a, $b, $areMutuallyExclusive) - { - $this->pairSetAdd($a, $b, $areMutuallyExclusive); - $this->pairSetAdd($b, $a, $areMutuallyExclusive); - } - - /** - * @param string $a - * @param string $b - * @param bool $areMutuallyExclusive - */ - private function pairSetAdd($a, $b, $areMutuallyExclusive) - { - $this->data[$a] = $this->data[$a] ?? []; - $this->data[$a][$b] = $areMutuallyExclusive; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaExtender.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaExtender.php deleted file mode 100644 index b71625fa..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaExtender.php +++ /dev/null @@ -1,650 +0,0 @@ -name; - if ($type->extensionASTNodes !== null) { - if (isset(static::$typeExtensionsMap[$name])) { - return array_merge($type->extensionASTNodes, static::$typeExtensionsMap[$name]); - } - - return $type->extensionASTNodes; - } - - return static::$typeExtensionsMap[$name] ?? null; - } - - /** - * @throws Error - */ - protected static function checkExtensionNode(Type $type, Node $node) : void - { - switch (true) { - case $node instanceof ObjectTypeExtensionNode: - if (! ($type instanceof ObjectType)) { - throw new Error( - 'Cannot extend non-object type "' . $type->name . '".', - [$node] - ); - } - break; - case $node instanceof InterfaceTypeExtensionNode: - if (! ($type instanceof InterfaceType)) { - throw new Error( - 'Cannot extend non-interface type "' . $type->name . '".', - [$node] - ); - } - break; - case $node instanceof EnumTypeExtensionNode: - if (! ($type instanceof EnumType)) { - throw new Error( - 'Cannot extend non-enum type "' . $type->name . '".', - [$node] - ); - } - break; - case $node instanceof UnionTypeExtensionNode: - if (! ($type instanceof UnionType)) { - throw new Error( - 'Cannot extend non-union type "' . $type->name . '".', - [$node] - ); - } - break; - case $node instanceof InputObjectTypeExtensionNode: - if (! ($type instanceof InputObjectType)) { - throw new Error( - 'Cannot extend non-input object type "' . $type->name . '".', - [$node] - ); - } - break; - } - } - - protected static function extendScalarType(ScalarType $type) : CustomScalarType - { - return new CustomScalarType([ - 'name' => $type->name, - 'description' => $type->description, - 'astNode' => $type->astNode, - 'serialize' => $type->config['serialize'] ?? null, - 'parseValue' => $type->config['parseValue'] ?? null, - 'parseLiteral' => $type->config['parseLiteral'] ?? null, - 'extensionASTNodes' => static::getExtensionASTNodes($type), - ]); - } - - protected static function extendUnionType(UnionType $type) : UnionType - { - return new UnionType([ - 'name' => $type->name, - 'description' => $type->description, - 'types' => static function () use ($type) : array { - return static::extendPossibleTypes($type); - }, - 'astNode' => $type->astNode, - 'resolveType' => $type->config['resolveType'] ?? null, - 'extensionASTNodes' => static::getExtensionASTNodes($type), - ]); - } - - protected static function extendEnumType(EnumType $type) : EnumType - { - return new EnumType([ - 'name' => $type->name, - 'description' => $type->description, - 'values' => static::extendValueMap($type), - 'astNode' => $type->astNode, - 'extensionASTNodes' => static::getExtensionASTNodes($type), - ]); - } - - protected static function extendInputObjectType(InputObjectType $type) : InputObjectType - { - return new InputObjectType([ - 'name' => $type->name, - 'description' => $type->description, - 'fields' => static function () use ($type) : array { - return static::extendInputFieldMap($type); - }, - 'astNode' => $type->astNode, - 'extensionASTNodes' => static::getExtensionASTNodes($type), - ]); - } - - /** - * @return mixed[] - */ - protected static function extendInputFieldMap(InputObjectType $type) : array - { - $newFieldMap = []; - $oldFieldMap = $type->getFields(); - foreach ($oldFieldMap as $fieldName => $field) { - $newFieldMap[$fieldName] = [ - 'description' => $field->description, - 'type' => static::extendType($field->getType()), - 'astNode' => $field->astNode, - ]; - - if (! $field->defaultValueExists()) { - continue; - } - - $newFieldMap[$fieldName]['defaultValue'] = $field->defaultValue; - } - - $extensions = static::$typeExtensionsMap[$type->name] ?? null; - if ($extensions !== null) { - foreach ($extensions as $extension) { - foreach ($extension->fields as $field) { - $fieldName = $field->name->value; - if (isset($oldFieldMap[$fieldName])) { - throw new Error('Field "' . $type->name . '.' . $fieldName . '" already exists in the schema. It cannot also be defined in this type extension.', [$field]); - } - - $newFieldMap[$fieldName] = static::$astBuilder->buildInputField($field); - } - } - } - - return $newFieldMap; - } - - /** - * @return mixed[] - */ - protected static function extendValueMap(EnumType $type) : array - { - $newValueMap = []; - /** @var EnumValueDefinition[] $oldValueMap */ - $oldValueMap = []; - foreach ($type->getValues() as $value) { - $oldValueMap[$value->name] = $value; - } - - foreach ($oldValueMap as $key => $value) { - $newValueMap[$key] = [ - 'name' => $value->name, - 'description' => $value->description, - 'value' => $value->value, - 'deprecationReason' => $value->deprecationReason, - 'astNode' => $value->astNode, - ]; - } - - $extensions = static::$typeExtensionsMap[$type->name] ?? null; - if ($extensions !== null) { - foreach ($extensions as $extension) { - foreach ($extension->values as $value) { - $valueName = $value->name->value; - if (isset($oldValueMap[$valueName])) { - throw new Error('Enum value "' . $type->name . '.' . $valueName . '" already exists in the schema. It cannot also be defined in this type extension.', [$value]); - } - $newValueMap[$valueName] = static::$astBuilder->buildEnumValue($value); - } - } - } - - return $newValueMap; - } - - /** - * @return ObjectType[] - */ - protected static function extendPossibleTypes(UnionType $type) : array - { - $possibleTypes = array_map(static function ($type) { - return static::extendNamedType($type); - }, $type->getTypes()); - - $extensions = static::$typeExtensionsMap[$type->name] ?? null; - if ($extensions !== null) { - foreach ($extensions as $extension) { - foreach ($extension->types as $namedType) { - $possibleTypes[] = static::$astBuilder->buildType($namedType); - } - } - } - - return $possibleTypes; - } - - /** - * @param ObjectType|InterfaceType $type - * - * @return array - */ - protected static function extendImplementedInterfaces(ImplementingType $type) : array - { - $interfaces = array_map(static function (InterfaceType $interfaceType) { - return static::extendNamedType($interfaceType); - }, $type->getInterfaces()); - - $extensions = static::$typeExtensionsMap[$type->name] ?? null; - if ($extensions !== null) { - /** @var ObjectTypeExtensionNode|InterfaceTypeExtensionNode $extension */ - foreach ($extensions as $extension) { - foreach ($extension->interfaces as $namedType) { - $interfaces[] = static::$astBuilder->buildType($namedType); - } - } - } - - return $interfaces; - } - - protected static function extendType($typeDef) - { - if ($typeDef instanceof ListOfType) { - return Type::listOf(static::extendType($typeDef->getOfType())); - } - - if ($typeDef instanceof NonNull) { - return Type::nonNull(static::extendType($typeDef->getWrappedType())); - } - - return static::extendNamedType($typeDef); - } - - /** - * @param FieldArgument[] $args - * - * @return mixed[] - */ - protected static function extendArgs(array $args) : array - { - return Utils::keyValMap( - $args, - static function (FieldArgument $arg) : string { - return $arg->name; - }, - static function (FieldArgument $arg) : array { - $def = [ - 'type' => static::extendType($arg->getType()), - 'description' => $arg->description, - 'astNode' => $arg->astNode, - ]; - - if ($arg->defaultValueExists()) { - $def['defaultValue'] = $arg->defaultValue; - } - - return $def; - } - ); - } - - /** - * @param InterfaceType|ObjectType $type - * - * @return mixed[] - * - * @throws Error - */ - protected static function extendFieldMap($type) : array - { - $newFieldMap = []; - $oldFieldMap = $type->getFields(); - - foreach (array_keys($oldFieldMap) as $fieldName) { - $field = $oldFieldMap[$fieldName]; - - $newFieldMap[$fieldName] = [ - 'name' => $fieldName, - 'description' => $field->description, - 'deprecationReason' => $field->deprecationReason, - 'type' => static::extendType($field->getType()), - 'args' => static::extendArgs($field->args), - 'astNode' => $field->astNode, - 'resolve' => $field->resolveFn, - ]; - } - - $extensions = static::$typeExtensionsMap[$type->name] ?? null; - if ($extensions !== null) { - foreach ($extensions as $extension) { - foreach ($extension->fields as $field) { - $fieldName = $field->name->value; - if (isset($oldFieldMap[$fieldName])) { - throw new Error('Field "' . $type->name . '.' . $fieldName . '" already exists in the schema. It cannot also be defined in this type extension.', [$field]); - } - - $newFieldMap[$fieldName] = static::$astBuilder->buildField($field); - } - } - } - - return $newFieldMap; - } - - protected static function extendObjectType(ObjectType $type) : ObjectType - { - return new ObjectType([ - 'name' => $type->name, - 'description' => $type->description, - 'interfaces' => static function () use ($type) : array { - return static::extendImplementedInterfaces($type); - }, - 'fields' => static function () use ($type) : array { - return static::extendFieldMap($type); - }, - 'astNode' => $type->astNode, - 'extensionASTNodes' => static::getExtensionASTNodes($type), - 'isTypeOf' => $type->config['isTypeOf'] ?? null, - 'resolveField' => $type->resolveFieldFn ?? null, - ]); - } - - protected static function extendInterfaceType(InterfaceType $type) : InterfaceType - { - return new InterfaceType([ - 'name' => $type->name, - 'description' => $type->description, - 'interfaces' => static function () use ($type) : array { - return static::extendImplementedInterfaces($type); - }, - 'fields' => static function () use ($type) : array { - return static::extendFieldMap($type); - }, - 'astNode' => $type->astNode, - 'extensionASTNodes' => static::getExtensionASTNodes($type), - 'resolveType' => $type->config['resolveType'] ?? null, - ]); - } - - protected static function isSpecifiedScalarType(Type $type) : bool - { - return $type instanceof NamedType && - ( - $type->name === Type::STRING || - $type->name === Type::INT || - $type->name === Type::FLOAT || - $type->name === Type::BOOLEAN || - $type->name === Type::ID - ); - } - - protected static function extendNamedType(Type $type) - { - if (Introspection::isIntrospectionType($type) || static::isSpecifiedScalarType($type)) { - return $type; - } - - $name = $type->name; - if (! isset(static::$extendTypeCache[$name])) { - if ($type instanceof ScalarType) { - static::$extendTypeCache[$name] = static::extendScalarType($type); - } elseif ($type instanceof ObjectType) { - static::$extendTypeCache[$name] = static::extendObjectType($type); - } elseif ($type instanceof InterfaceType) { - static::$extendTypeCache[$name] = static::extendInterfaceType($type); - } elseif ($type instanceof UnionType) { - static::$extendTypeCache[$name] = static::extendUnionType($type); - } elseif ($type instanceof EnumType) { - static::$extendTypeCache[$name] = static::extendEnumType($type); - } elseif ($type instanceof InputObjectType) { - static::$extendTypeCache[$name] = static::extendInputObjectType($type); - } - } - - return static::$extendTypeCache[$name]; - } - - /** - * @return mixed|null - */ - protected static function extendMaybeNamedType(?NamedType $type = null) - { - if ($type !== null) { - return static::extendNamedType($type); - } - - return null; - } - - /** - * @param DirectiveDefinitionNode[] $directiveDefinitions - * - * @return Directive[] - */ - protected static function getMergedDirectives(Schema $schema, array $directiveDefinitions) : array - { - $existingDirectives = array_map(static function (Directive $directive) : Directive { - return static::extendDirective($directive); - }, $schema->getDirectives()); - - Utils::invariant(count($existingDirectives) > 0, 'schema must have default directives'); - - return array_merge( - $existingDirectives, - array_map(static function (DirectiveDefinitionNode $directive) : Directive { - return static::$astBuilder->buildDirective($directive); - }, $directiveDefinitions) - ); - } - - protected static function extendDirective(Directive $directive) : Directive - { - return new Directive([ - 'name' => $directive->name, - 'description' => $directive->description, - 'locations' => $directive->locations, - 'args' => static::extendArgs($directive->args), - 'astNode' => $directive->astNode, - 'isRepeatable' => $directive->isRepeatable, - ]); - } - - /** - * @param array $options - */ - public static function extend( - Schema $schema, - DocumentNode $documentAST, - array $options = [], - ?callable $typeConfigDecorator = null - ) : Schema { - if (! (isset($options['assumeValid']) || isset($options['assumeValidSDL']))) { - DocumentValidator::assertValidSDLExtension($documentAST, $schema); - } - - /** @var array $typeDefinitionMap */ - $typeDefinitionMap = []; - static::$typeExtensionsMap = []; - $directiveDefinitions = []; - /** @var SchemaDefinitionNode|null $schemaDef */ - $schemaDef = null; - /** @var array $schemaExtensions */ - $schemaExtensions = []; - - $definitionsCount = count($documentAST->definitions); - for ($i = 0; $i < $definitionsCount; $i++) { - - /** @var Node $def */ - $def = $documentAST->definitions[$i]; - - if ($def instanceof SchemaDefinitionNode) { - $schemaDef = $def; - } elseif ($def instanceof SchemaTypeExtensionNode) { - $schemaExtensions[] = $def; - } elseif ($def instanceof TypeDefinitionNode) { - $typeName = isset($def->name) ? $def->name->value : null; - - try { - $type = $schema->getType($typeName); - } catch (Error $error) { - $type = null; - } - - if ($type) { - throw new Error('Type "' . $typeName . '" already exists in the schema. It cannot also be defined in this type definition.', [$def]); - } - $typeDefinitionMap[$typeName] = $def; - } elseif ($def instanceof TypeExtensionNode) { - $extendedTypeName = isset($def->name) ? $def->name->value : null; - $existingType = $schema->getType($extendedTypeName); - if ($existingType === null) { - throw new Error('Cannot extend type "' . $extendedTypeName . '" because it does not exist in the existing schema.', [$def]); - } - - static::checkExtensionNode($existingType, $def); - - $existingTypeExtensions = static::$typeExtensionsMap[$extendedTypeName] ?? null; - static::$typeExtensionsMap[$extendedTypeName] = $existingTypeExtensions !== null ? array_merge($existingTypeExtensions, [$def]) : [$def]; - } elseif ($def instanceof DirectiveDefinitionNode) { - $directiveName = $def->name->value; - $existingDirective = $schema->getDirective($directiveName); - if ($existingDirective !== null) { - throw new Error('Directive "' . $directiveName . '" already exists in the schema. It cannot be redefined.', [$def]); - } - $directiveDefinitions[] = $def; - } - } - - if (count(static::$typeExtensionsMap) === 0 - && count($typeDefinitionMap) === 0 - && count($directiveDefinitions) === 0 - && count($schemaExtensions) === 0 - && $schemaDef === null - ) { - return $schema; - } - - static::$astBuilder = new ASTDefinitionBuilder( - $typeDefinitionMap, - $options, - static function (string $typeName) use ($schema) { - /** @var ScalarType|ObjectType|InterfaceType|UnionType|EnumType|InputObjectType $existingType */ - $existingType = $schema->getType($typeName); - if ($existingType !== null) { - return static::extendNamedType($existingType); - } - - throw new Error('Unknown type: "' . $typeName . '". Ensure that this type exists either in the original schema, or is added in a type definition.', [$typeName]); - }, - $typeConfigDecorator - ); - - static::$extendTypeCache = []; - - $operationTypes = [ - 'query' => static::extendMaybeNamedType($schema->getQueryType()), - 'mutation' => static::extendMaybeNamedType($schema->getMutationType()), - 'subscription' => static::extendMaybeNamedType($schema->getSubscriptionType()), - ]; - - if ($schemaDef) { - foreach ($schemaDef->operationTypes as $operationType) { - $operation = $operationType->operation; - $type = $operationType->type; - - if (isset($operationTypes[$operation])) { - throw new Error('Must provide only one ' . $operation . ' type in schema.'); - } - - $operationTypes[$operation] = static::$astBuilder->buildType($type); - } - } - - foreach ($schemaExtensions as $schemaExtension) { - if ($schemaExtension->operationTypes === null) { - continue; - } - - foreach ($schemaExtension->operationTypes as $operationType) { - $operation = $operationType->operation; - if (isset($operationTypes[$operation])) { - throw new Error('Must provide only one ' . $operation . ' type in schema.'); - } - $operationTypes[$operation] = static::$astBuilder->buildType($operationType->type); - } - } - - $schemaExtensionASTNodes = array_merge($schema->extensionASTNodes, $schemaExtensions); - - $types = array_merge( - // Iterate through all types, getting the type definition for each, ensuring - // that any type not directly referenced by a field will get created. - array_map(static function (Type $type) : Type { - return static::extendNamedType($type); - }, $schema->getTypeMap()), - // Do the same with new types. - array_map(static function (TypeDefinitionNode $type) : Type { - return static::$astBuilder->buildType($type); - }, $typeDefinitionMap) - ); - - return new Schema([ - 'query' => $operationTypes['query'], - 'mutation' => $operationTypes['mutation'], - 'subscription' => $operationTypes['subscription'], - 'types' => $types, - 'directives' => static::getMergedDirectives($schema, $directiveDefinitions), - 'astNode' => $schema->getAstNode(), - 'extensionASTNodes' => $schemaExtensionASTNodes, - ]); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaPrinter.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaPrinter.php deleted file mode 100644 index cf78f52c..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/SchemaPrinter.php +++ /dev/null @@ -1,508 +0,0 @@ - $options - * Available options: - * - commentDescriptions: - * Provide true to use preceding comments as the description. - * This option is provided to ease adoption and will be removed in v16. - * - * @api - */ - public static function doPrint(Schema $schema, array $options = []) : string - { - return static::printFilteredSchema( - $schema, - static function ($type) : bool { - return ! Directive::isSpecifiedDirective($type); - }, - static function ($type) : bool { - return ! Type::isBuiltInType($type); - }, - $options - ); - } - - /** - * @param array $options - */ - protected static function printFilteredSchema(Schema $schema, callable $directiveFilter, callable $typeFilter, array $options) : string - { - $directives = array_filter($schema->getDirectives(), $directiveFilter); - - $types = $schema->getTypeMap(); - ksort($types); - $types = array_filter($types, $typeFilter); - - return sprintf( - "%s\n", - implode( - "\n\n", - array_filter( - array_merge( - [static::printSchemaDefinition($schema)], - array_map( - static function (Directive $directive) use ($options) : string { - return static::printDirective($directive, $options); - }, - $directives - ), - array_map( - static function ($type) use ($options) : string { - return static::printType($type, $options); - }, - $types - ) - ) - ) - ) - ); - } - - protected static function printSchemaDefinition(Schema $schema) : string - { - if (static::isSchemaOfCommonNames($schema)) { - return ''; - } - - $operationTypes = []; - - $queryType = $schema->getQueryType(); - if ($queryType !== null) { - $operationTypes[] = sprintf(' query: %s', $queryType->name); - } - - $mutationType = $schema->getMutationType(); - if ($mutationType !== null) { - $operationTypes[] = sprintf(' mutation: %s', $mutationType->name); - } - - $subscriptionType = $schema->getSubscriptionType(); - if ($subscriptionType !== null) { - $operationTypes[] = sprintf(' subscription: %s', $subscriptionType->name); - } - - return sprintf("schema {\n%s\n}", implode("\n", $operationTypes)); - } - - /** - * GraphQL schema define root types for each type of operation. These types are - * the same as any other type and can be named in any manner, however there is - * a common naming convention: - * - * schema { - * query: Query - * mutation: Mutation - * } - * - * When using this naming convention, the schema description can be omitted. - */ - protected static function isSchemaOfCommonNames(Schema $schema) : bool - { - $queryType = $schema->getQueryType(); - if ($queryType !== null && $queryType->name !== 'Query') { - return false; - } - - $mutationType = $schema->getMutationType(); - if ($mutationType !== null && $mutationType->name !== 'Mutation') { - return false; - } - - $subscriptionType = $schema->getSubscriptionType(); - - return $subscriptionType === null || $subscriptionType->name === 'Subscription'; - } - - /** - * @param array $options - */ - protected static function printDirective(Directive $directive, array $options) : string - { - return static::printDescription($options, $directive) - . 'directive @' . $directive->name - . static::printArgs($options, $directive->args) - . ($directive->isRepeatable ? ' repeatable' : '') - . ' on ' . implode(' | ', $directive->locations); - } - - /** - * @param array $options - */ - protected static function printDescription(array $options, $def, $indentation = '', $firstInBlock = true) : string - { - if (! $def->description) { - return ''; - } - $lines = static::descriptionLines($def->description, 120 - strlen($indentation)); - if (isset($options['commentDescriptions'])) { - return static::printDescriptionWithComments($lines, $indentation, $firstInBlock); - } - - $description = $indentation && ! $firstInBlock - ? "\n" . $indentation . '"""' - : $indentation . '"""'; - - // In some circumstances, a single line can be used for the description. - if (count($lines) === 1 && - mb_strlen($lines[0]) < 70 && - substr($lines[0], -1) !== '"' - ) { - return $description . static::escapeQuote($lines[0]) . "\"\"\"\n"; - } - - // Format a multi-line block quote to account for leading space. - $hasLeadingSpace = isset($lines[0]) && - ( - substr($lines[0], 0, 1) === ' ' || - substr($lines[0], 0, 1) === '\t' - ); - if (! $hasLeadingSpace) { - $description .= "\n"; - } - - $lineLength = count($lines); - for ($i = 0; $i < $lineLength; $i++) { - if ($i !== 0 || ! $hasLeadingSpace) { - $description .= $indentation; - } - $description .= static::escapeQuote($lines[$i]) . "\n"; - } - $description .= $indentation . "\"\"\"\n"; - - return $description; - } - - /** - * @return string[] - */ - protected static function descriptionLines(string $description, int $maxLen) : array - { - $lines = []; - $rawLines = explode("\n", $description); - foreach ($rawLines as $line) { - if ($line === '') { - $lines[] = $line; - } else { - // For > 120 character long lines, cut at space boundaries into sublines - // of ~80 chars. - $sublines = static::breakLine($line, $maxLen); - foreach ($sublines as $subline) { - $lines[] = $subline; - } - } - } - - return $lines; - } - - /** - * @return string[] - */ - protected static function breakLine(string $line, int $maxLen) : array - { - if (strlen($line) < $maxLen + 5) { - return [$line]; - } - preg_match_all('/((?: |^).{15,' . ($maxLen - 40) . '}(?= |$))/', $line, $parts); - $parts = $parts[0]; - - return array_map('trim', $parts); - } - - protected static function printDescriptionWithComments($lines, $indentation, $firstInBlock) : string - { - $description = $indentation && ! $firstInBlock ? "\n" : ''; - foreach ($lines as $line) { - if ($line === '') { - $description .= $indentation . "#\n"; - } else { - $description .= $indentation . '# ' . $line . "\n"; - } - } - - return $description; - } - - protected static function escapeQuote($line) : string - { - return str_replace('"""', '\\"""', $line); - } - - /** - * @param array $options - */ - protected static function printArgs(array $options, $args, $indentation = '') : string - { - if (! $args) { - return ''; - } - - // If every arg does not have a description, print them on one line. - if (Utils::every( - $args, - static function ($arg) : bool { - return strlen($arg->description ?? '') === 0; - } - )) { - return '(' . implode(', ', array_map([static::class, 'printInputValue'], $args)) . ')'; - } - - return sprintf( - "(\n%s\n%s)", - implode( - "\n", - array_map( - static function ($arg, $i) use ($indentation, $options) : string { - return static::printDescription($options, $arg, ' ' . $indentation, ! $i) . ' ' . $indentation . - static::printInputValue($arg); - }, - $args, - array_keys($args) - ) - ), - $indentation - ); - } - - protected static function printInputValue($arg) : string - { - $argDecl = $arg->name . ': ' . (string) $arg->getType(); - if ($arg->defaultValueExists()) { - $argDecl .= ' = ' . Printer::doPrint(AST::astFromValue($arg->defaultValue, $arg->getType())); - } - - return $argDecl; - } - - /** - * @param array $options - */ - public static function printType(Type $type, array $options = []) : string - { - if ($type instanceof ScalarType) { - return static::printScalar($type, $options); - } - - if ($type instanceof ObjectType) { - return static::printObject($type, $options); - } - - if ($type instanceof InterfaceType) { - return static::printInterface($type, $options); - } - - if ($type instanceof UnionType) { - return static::printUnion($type, $options); - } - - if ($type instanceof EnumType) { - return static::printEnum($type, $options); - } - - if ($type instanceof InputObjectType) { - return static::printInputObject($type, $options); - } - - throw new Error(sprintf('Unknown type: %s.', Utils::printSafe($type))); - } - - /** - * @param array $options - */ - protected static function printScalar(ScalarType $type, array $options) : string - { - return sprintf('%sscalar %s', static::printDescription($options, $type), $type->name); - } - - /** - * @param array $options - */ - protected static function printObject(ObjectType $type, array $options) : string - { - $interfaces = $type->getInterfaces(); - $implementedInterfaces = count($interfaces) > 0 - ? ' implements ' . implode( - ' & ', - array_map( - static function (InterfaceType $interface) : string { - return $interface->name; - }, - $interfaces - ) - ) - : ''; - - return static::printDescription($options, $type) . - sprintf("type %s%s {\n%s\n}", $type->name, $implementedInterfaces, static::printFields($options, $type)); - } - - /** - * @param array $options - */ - protected static function printFields(array $options, $type) : string - { - $fields = array_values($type->getFields()); - - return implode( - "\n", - array_map( - static function ($f, $i) use ($options) : string { - return static::printDescription($options, $f, ' ', ! $i) . ' ' . - $f->name . static::printArgs($options, $f->args, ' ') . ': ' . - (string) $f->getType() . static::printDeprecated($f); - }, - $fields, - array_keys($fields) - ) - ); - } - - protected static function printDeprecated($fieldOrEnumVal) : string - { - $reason = $fieldOrEnumVal->deprecationReason; - if ($reason === null) { - return ''; - } - if ($reason === '' || $reason === Directive::DEFAULT_DEPRECATION_REASON) { - return ' @deprecated'; - } - - return ' @deprecated(reason: ' . - Printer::doPrint(AST::astFromValue($reason, Type::string())) . ')'; - } - - /** - * @param array $options - */ - protected static function printInterface(InterfaceType $type, array $options) : string - { - $interfaces = $type->getInterfaces(); - $implementedInterfaces = count($interfaces) > 0 - ? ' implements ' . implode( - ' & ', - array_map( - static function (InterfaceType $interface) : string { - return $interface->name; - }, - $interfaces - ) - ) - : ''; - - return static::printDescription($options, $type) . - sprintf("interface %s%s {\n%s\n}", $type->name, $implementedInterfaces, static::printFields($options, $type)); - } - - /** - * @param array $options - */ - protected static function printUnion(UnionType $type, array $options) : string - { - return static::printDescription($options, $type) . - sprintf('union %s = %s', $type->name, implode(' | ', $type->getTypes())); - } - - /** - * @param array $options - */ - protected static function printEnum(EnumType $type, array $options) : string - { - return static::printDescription($options, $type) . - sprintf("enum %s {\n%s\n}", $type->name, static::printEnumValues($type->getValues(), $options)); - } - - /** - * @param array $options - */ - protected static function printEnumValues($values, array $options) : string - { - return implode( - "\n", - array_map( - static function ($value, $i) use ($options) : string { - return static::printDescription($options, $value, ' ', ! $i) . ' ' . - $value->name . static::printDeprecated($value); - }, - $values, - array_keys($values) - ) - ); - } - - /** - * @param array $options - */ - protected static function printInputObject(InputObjectType $type, array $options) : string - { - $fields = array_values($type->getFields()); - - return static::printDescription($options, $type) . - sprintf( - "input %s {\n%s\n}", - $type->name, - implode( - "\n", - array_map( - static function ($f, $i) use ($options) : string { - return static::printDescription($options, $f, ' ', ! $i) . ' ' . static::printInputValue($f); - }, - $fields, - array_keys($fields) - ) - ) - ); - } - - /** - * @param array $options - * - * @api - */ - public static function printIntrospectionSchema(Schema $schema, array $options = []) : string - { - return static::printFilteredSchema( - $schema, - [Directive::class, 'isSpecifiedDirective'], - [Introspection::class, 'isIntrospectionType'], - $options - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeComparators.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeComparators.php deleted file mode 100644 index 7033eee7..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeComparators.php +++ /dev/null @@ -1,138 +0,0 @@ -getWrappedType(), $typeB->getWrappedType()); - } - - // If either type is a list, the other must also be a list. - if ($typeA instanceof ListOfType && $typeB instanceof ListOfType) { - return self::isEqualType($typeA->getWrappedType(), $typeB->getWrappedType()); - } - - // Otherwise the types are not equal. - return false; - } - - /** - * Provided a type and a super type, return true if the first type is either - * equal or a subset of the second super type (covariant). - * - * @return bool - */ - public static function isTypeSubTypeOf(Schema $schema, Type $maybeSubType, Type $superType) - { - // Equivalent type is a valid subtype - if ($maybeSubType === $superType) { - return true; - } - - // If superType is non-null, maybeSubType must also be nullable. - if ($superType instanceof NonNull) { - if ($maybeSubType instanceof NonNull) { - return self::isTypeSubTypeOf($schema, $maybeSubType->getWrappedType(), $superType->getWrappedType()); - } - - return false; - } - - if ($maybeSubType instanceof NonNull) { - // If superType is nullable, maybeSubType may be non-null. - return self::isTypeSubTypeOf($schema, $maybeSubType->getWrappedType(), $superType); - } - - // If superType type is a list, maybeSubType type must also be a list. - if ($superType instanceof ListOfType) { - if ($maybeSubType instanceof ListOfType) { - return self::isTypeSubTypeOf($schema, $maybeSubType->getWrappedType(), $superType->getWrappedType()); - } - - return false; - } - - if ($maybeSubType instanceof ListOfType) { - // If superType is not a list, maybeSubType must also be not a list. - return false; - } - - // If superType type is an abstract type, maybeSubType type may be a currently - // possible object or interface type. - return Type::isAbstractType($superType) && - $maybeSubType instanceof ImplementingType && - $schema->isSubType( - $superType, - $maybeSubType - ); - } - - /** - * Provided two composite types, determine if they "overlap". Two composite - * types overlap when the Sets of possible concrete types for each intersect. - * - * This is often used to determine if a fragment of a given type could possibly - * be visited in a context of another type. - * - * This function is commutative. - * - * @return bool - */ - public static function doTypesOverlap(Schema $schema, CompositeType $typeA, CompositeType $typeB) - { - // Equivalent types overlap - if ($typeA === $typeB) { - return true; - } - - if ($typeA instanceof AbstractType) { - if ($typeB instanceof AbstractType) { - // If both types are abstract, then determine if there is any intersection - // between possible concrete types of each. - foreach ($schema->getPossibleTypes($typeA) as $type) { - if ($schema->isSubType($typeB, $type)) { - return true; - } - } - - return false; - } - - // Determine if the latter type is a possible concrete type of the former. - return $schema->isSubType($typeA, $typeB); - } - - if ($typeB instanceof AbstractType) { - // Determine if the former type is a possible concrete type of the latter. - return $schema->isSubType($typeB, $typeA); - } - - // Otherwise the types do not overlap. - return false; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php deleted file mode 100644 index 58d17fbd..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/TypeInfo.php +++ /dev/null @@ -1,504 +0,0 @@ - */ - private $typeStack; - - /** @var array<(CompositeType&Type)|null> */ - private $parentTypeStack; - - /** @var array<(InputType&Type)|null> */ - private $inputTypeStack; - - /** @var array */ - private $fieldDefStack; - - /** @var array */ - private $defaultValueStack; - - /** @var Directive|null */ - private $directive; - - /** @var FieldArgument|null */ - private $argument; - - /** @var mixed */ - private $enumValue; - - /** - * @param Type|null $initialType - */ - public function __construct(Schema $schema, $initialType = null) - { - $this->schema = $schema; - $this->typeStack = []; - $this->parentTypeStack = []; - $this->inputTypeStack = []; - $this->fieldDefStack = []; - $this->defaultValueStack = []; - - if ($initialType === null) { - return; - } - - if (Type::isInputType($initialType)) { - $this->inputTypeStack[] = $initialType; - } - if (Type::isCompositeType($initialType)) { - $this->parentTypeStack[] = $initialType; - } - if (! Type::isOutputType($initialType)) { - return; - } - - $this->typeStack[] = $initialType; - } - - /** - * @deprecated moved to GraphQL\Utils\TypeComparators - * - * @codeCoverageIgnore - */ - public static function isEqualType(Type $typeA, Type $typeB) : bool - { - return TypeComparators::isEqualType($typeA, $typeB); - } - - /** - * @deprecated moved to GraphQL\Utils\TypeComparators - * - * @codeCoverageIgnore - */ - public static function isTypeSubTypeOf(Schema $schema, Type $maybeSubType, Type $superType) - { - return TypeComparators::isTypeSubTypeOf($schema, $maybeSubType, $superType); - } - - /** - * @deprecated moved to GraphQL\Utils\TypeComparators - * - * @codeCoverageIgnore - */ - public static function doTypesOverlap(Schema $schema, CompositeType $typeA, CompositeType $typeB) - { - return TypeComparators::doTypesOverlap($schema, $typeA, $typeB); - } - - /** - * Given root type scans through all fields to find nested types. Returns array where keys are for type name - * and value contains corresponding type instance. - * - * Example output: - * [ - * 'String' => $instanceOfStringType, - * 'MyType' => $instanceOfMyType, - * ... - * ] - * - * @param Type|null $type - * @param Type[]|null $typeMap - * - * @return Type[]|null - */ - public static function extractTypes($type, ?array $typeMap = null) - { - if (! $typeMap) { - $typeMap = []; - } - if (! $type) { - return $typeMap; - } - - if ($type instanceof WrappingType) { - return self::extractTypes($type->getWrappedType(true), $typeMap); - } - - if (! $type instanceof Type) { - // Preserve these invalid types in map (at numeric index) to make them - // detectable during $schema->validate() - $i = 0; - $alreadyInMap = false; - while (isset($typeMap[$i])) { - $alreadyInMap = $alreadyInMap || $typeMap[$i] === $type; - $i++; - } - if (! $alreadyInMap) { - $typeMap[$i] = $type; - } - - return $typeMap; - } - - if (isset($typeMap[$type->name])) { - Utils::invariant( - $typeMap[$type->name] === $type, - sprintf('Schema must contain unique named types but contains multiple types named "%s" ', $type) . - '(see http://webonyx.github.io/graphql-php/type-system/#type-registry).' - ); - - return $typeMap; - } - $typeMap[$type->name] = $type; - - $nestedTypes = []; - - if ($type instanceof UnionType) { - $nestedTypes = $type->getTypes(); - } - if ($type instanceof ImplementingType) { - $nestedTypes = array_merge($nestedTypes, $type->getInterfaces()); - } - - if ($type instanceof HasFieldsType) { - foreach ($type->getFields() as $field) { - if (count($field->args) > 0) { - $fieldArgTypes = array_map( - static function (FieldArgument $arg) : Type { - return $arg->getType(); - }, - $field->args - ); - - $nestedTypes = array_merge($nestedTypes, $fieldArgTypes); - } - $nestedTypes[] = $field->getType(); - } - } - if ($type instanceof InputObjectType) { - foreach ($type->getFields() as $field) { - $nestedTypes[] = $field->getType(); - } - } - foreach ($nestedTypes as $nestedType) { - $typeMap = self::extractTypes($nestedType, $typeMap); - } - - return $typeMap; - } - - /** - * @param Type[] $typeMap - * - * @return Type[] - */ - public static function extractTypesFromDirectives(Directive $directive, array $typeMap = []) - { - if (is_array($directive->args)) { - foreach ($directive->args as $arg) { - $typeMap = self::extractTypes($arg->getType(), $typeMap); - } - } - - return $typeMap; - } - - /** - * @return (Type&InputType)|null - */ - public function getParentInputType() : ?InputType - { - return $this->inputTypeStack[count($this->inputTypeStack) - 2] ?? null; - } - - public function getArgument() : ?FieldArgument - { - return $this->argument; - } - - /** - * @return mixed - */ - public function getEnumValue() - { - return $this->enumValue; - } - - public function enter(Node $node) - { - $schema = $this->schema; - - // Note: many of the types below are explicitly typed as "mixed" to drop - // any assumptions of a valid schema to ensure runtime types are properly - // checked before continuing since TypeInfo is used as part of validation - // which occurs before guarantees of schema and document validity. - switch (true) { - case $node instanceof SelectionSetNode: - $namedType = Type::getNamedType($this->getType()); - $this->parentTypeStack[] = Type::isCompositeType($namedType) ? $namedType : null; - break; - - case $node instanceof FieldNode: - $parentType = $this->getParentType(); - $fieldDef = null; - if ($parentType) { - $fieldDef = self::getFieldDefinition($schema, $parentType, $node); - } - $fieldType = null; - if ($fieldDef) { - $fieldType = $fieldDef->getType(); - } - $this->fieldDefStack[] = $fieldDef; - $this->typeStack[] = Type::isOutputType($fieldType) ? $fieldType : null; - break; - - case $node instanceof DirectiveNode: - $this->directive = $schema->getDirective($node->name->value); - break; - - case $node instanceof OperationDefinitionNode: - $type = null; - if ($node->operation === 'query') { - $type = $schema->getQueryType(); - } elseif ($node->operation === 'mutation') { - $type = $schema->getMutationType(); - } elseif ($node->operation === 'subscription') { - $type = $schema->getSubscriptionType(); - } - $this->typeStack[] = Type::isOutputType($type) ? $type : null; - break; - - case $node instanceof InlineFragmentNode: - case $node instanceof FragmentDefinitionNode: - $typeConditionNode = $node->typeCondition; - $outputType = $typeConditionNode - ? self::typeFromAST( - $schema, - $typeConditionNode - ) - : Type::getNamedType($this->getType()); - $this->typeStack[] = Type::isOutputType($outputType) ? $outputType : null; - break; - - case $node instanceof VariableDefinitionNode: - $inputType = self::typeFromAST($schema, $node->type); - $this->inputTypeStack[] = Type::isInputType($inputType) ? $inputType : null; // push - break; - - case $node instanceof ArgumentNode: - $fieldOrDirective = $this->getDirective() ?? $this->getFieldDef(); - $argDef = $argType = null; - if ($fieldOrDirective) { - /** @var FieldArgument $argDef */ - $argDef = Utils::find( - $fieldOrDirective->args, - static function ($arg) use ($node) : bool { - return $arg->name === $node->name->value; - } - ); - if ($argDef !== null) { - $argType = $argDef->getType(); - } - } - $this->argument = $argDef; - $this->defaultValueStack[] = $argDef && $argDef->defaultValueExists() ? $argDef->defaultValue : Utils::undefined(); - $this->inputTypeStack[] = Type::isInputType($argType) ? $argType : null; - break; - - case $node instanceof ListValueNode: - $type = $this->getInputType(); - $listType = $type === null ? null : Type::getNullableType($type); - $itemType = $listType instanceof ListOfType - ? $listType->getWrappedType() - : $listType; - // List positions never have a default value. - $this->defaultValueStack[] = Utils::undefined(); - $this->inputTypeStack[] = Type::isInputType($itemType) ? $itemType : null; - break; - - case $node instanceof ObjectFieldNode: - $objectType = Type::getNamedType($this->getInputType()); - $fieldType = null; - $inputField = null; - $inputFieldType = null; - if ($objectType instanceof InputObjectType) { - $tmp = $objectType->getFields(); - $inputField = $tmp[$node->name->value] ?? null; - $inputFieldType = $inputField ? $inputField->getType() : null; - } - $this->defaultValueStack[] = $inputField && $inputField->defaultValueExists() ? $inputField->defaultValue : Utils::undefined(); - $this->inputTypeStack[] = Type::isInputType($inputFieldType) ? $inputFieldType : null; - break; - - case $node instanceof EnumValueNode: - $enumType = Type::getNamedType($this->getInputType()); - $enumValue = null; - if ($enumType instanceof EnumType) { - $this->enumValue = $enumType->getValue($node->value); - } - $this->enumValue = $enumValue; - break; - } - } - - /** - * @return (Type & OutputType) | null - */ - public function getType() : ?OutputType - { - return $this->typeStack[count($this->typeStack) - 1] ?? null; - } - - /** - * @return (CompositeType & Type) | null - */ - public function getParentType() : ?CompositeType - { - return $this->parentTypeStack[count($this->parentTypeStack) - 1] ?? null; - } - - /** - * Not exactly the same as the executor's definition of getFieldDef, in this - * statically evaluated environment we do not always have an Object type, - * and need to handle Interface and Union types. - */ - private static function getFieldDefinition(Schema $schema, Type $parentType, FieldNode $fieldNode) : ?FieldDefinition - { - $name = $fieldNode->name->value; - $schemaMeta = Introspection::schemaMetaFieldDef(); - if ($name === $schemaMeta->name && $schema->getQueryType() === $parentType) { - return $schemaMeta; - } - - $typeMeta = Introspection::typeMetaFieldDef(); - if ($name === $typeMeta->name && $schema->getQueryType() === $parentType) { - return $typeMeta; - } - $typeNameMeta = Introspection::typeNameMetaFieldDef(); - if ($name === $typeNameMeta->name && $parentType instanceof CompositeType) { - return $typeNameMeta; - } - - if ($parentType instanceof ObjectType || - $parentType instanceof InterfaceType - ) { - return $parentType->findField($name); - } - - return null; - } - - /** - * @param NamedTypeNode|ListTypeNode|NonNullTypeNode $inputTypeNode - * - * @throws InvariantViolation - */ - public static function typeFromAST(Schema $schema, $inputTypeNode) : ?Type - { - return AST::typeFromAST($schema, $inputTypeNode); - } - - public function getDirective() : ?Directive - { - return $this->directive; - } - - public function getFieldDef() : ?FieldDefinition - { - return $this->fieldDefStack[count($this->fieldDefStack) - 1] ?? null; - } - - /** - * @return mixed|null - */ - public function getDefaultValue() - { - return $this->defaultValueStack[count($this->defaultValueStack) - 1] ?? null; - } - - /** - * @return (Type & InputType) | null - */ - public function getInputType() : ?InputType - { - return $this->inputTypeStack[count($this->inputTypeStack) - 1] ?? null; - } - - public function leave(Node $node) - { - switch (true) { - case $node instanceof SelectionSetNode: - array_pop($this->parentTypeStack); - break; - - case $node instanceof FieldNode: - array_pop($this->fieldDefStack); - array_pop($this->typeStack); - break; - - case $node instanceof DirectiveNode: - $this->directive = null; - break; - - case $node instanceof OperationDefinitionNode: - case $node instanceof InlineFragmentNode: - case $node instanceof FragmentDefinitionNode: - array_pop($this->typeStack); - break; - case $node instanceof VariableDefinitionNode: - array_pop($this->inputTypeStack); - break; - case $node instanceof ArgumentNode: - $this->argument = null; - array_pop($this->defaultValueStack); - array_pop($this->inputTypeStack); - break; - case $node instanceof ListValueNode: - case $node instanceof ObjectFieldNode: - array_pop($this->defaultValueStack); - array_pop($this->inputTypeStack); - break; - case $node instanceof EnumValueNode: - $this->enumValue = null; - break; - } - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Utils.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Utils.php deleted file mode 100644 index 5811ac0a..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Utils.php +++ /dev/null @@ -1,658 +0,0 @@ - $value) { - if (! property_exists($obj, $key)) { - $cls = get_class($obj); - Warning::warn( - sprintf("Trying to set non-existing property '%s' on class '%s'", $key, $cls), - Warning::WARNING_ASSIGN - ); - } - $obj->{$key} = $value; - } - - return $obj; - } - - /** - * @param iterable $iterable - * - * @return mixed|null - */ - public static function find($iterable, callable $predicate) - { - self::invariant( - is_array($iterable) || $iterable instanceof Traversable, - __METHOD__ . ' expects array or Traversable' - ); - - foreach ($iterable as $key => $value) { - if ($predicate($value, $key)) { - return $value; - } - } - - return null; - } - - /** - * @param iterable $iterable - * - * @return array - * - * @throws Exception - */ - public static function filter($iterable, callable $predicate) : array - { - self::invariant( - is_array($iterable) || $iterable instanceof Traversable, - __METHOD__ . ' expects array or Traversable' - ); - - $result = []; - $assoc = false; - foreach ($iterable as $key => $value) { - if (! $assoc && ! is_int($key)) { - $assoc = true; - } - if (! $predicate($value, $key)) { - continue; - } - - $result[$key] = $value; - } - - return $assoc ? $result : array_values($result); - } - - /** - * @param iterable $iterable - * - * @return array - * - * @throws Exception - */ - public static function map($iterable, callable $fn) : array - { - self::invariant( - is_array($iterable) || $iterable instanceof Traversable, - __METHOD__ . ' expects array or Traversable' - ); - - $map = []; - foreach ($iterable as $key => $value) { - $map[$key] = $fn($value, $key); - } - - return $map; - } - - /** - * @param iterable $iterable - * - * @return array - * - * @throws Exception - */ - public static function mapKeyValue($iterable, callable $fn) : array - { - self::invariant( - is_array($iterable) || $iterable instanceof Traversable, - __METHOD__ . ' expects array or Traversable' - ); - - $map = []; - foreach ($iterable as $key => $value) { - [$newKey, $newValue] = $fn($value, $key); - $map[$newKey] = $newValue; - } - - return $map; - } - - /** - * @param iterable $iterable - * - * @return array - * - * @throws Exception - */ - public static function keyMap($iterable, callable $keyFn) : array - { - self::invariant( - is_array($iterable) || $iterable instanceof Traversable, - __METHOD__ . ' expects array or Traversable' - ); - - $map = []; - foreach ($iterable as $key => $value) { - $newKey = $keyFn($value, $key); - if (! is_scalar($newKey)) { - continue; - } - - $map[$newKey] = $value; - } - - return $map; - } - - /** - * @param iterable $iterable - */ - public static function each($iterable, callable $fn) : void - { - self::invariant( - is_array($iterable) || $iterable instanceof Traversable, - __METHOD__ . ' expects array or Traversable' - ); - - foreach ($iterable as $key => $item) { - $fn($item, $key); - } - } - - /** - * Splits original iterable to several arrays with keys equal to $keyFn return - * - * E.g. Utils::groupBy([1, 2, 3, 4, 5], function($value) {return $value % 3}) will output: - * [ - * 1 => [1, 4], - * 2 => [2, 5], - * 0 => [3], - * ] - * - * $keyFn is also allowed to return array of keys. Then value will be added to all arrays with given keys - * - * @param iterable $iterable - * - * @return array> - */ - public static function groupBy($iterable, callable $keyFn) : array - { - self::invariant( - is_array($iterable) || $iterable instanceof Traversable, - __METHOD__ . ' expects array or Traversable' - ); - - $grouped = []; - foreach ($iterable as $key => $value) { - $newKeys = (array) $keyFn($value, $key); - foreach ($newKeys as $newKey) { - $grouped[$newKey][] = $value; - } - } - - return $grouped; - } - - /** - * @param iterable $iterable - * - * @return array - */ - public static function keyValMap($iterable, callable $keyFn, callable $valFn) : array - { - $map = []; - foreach ($iterable as $item) { - $map[$keyFn($item)] = $valFn($item); - } - - return $map; - } - - /** - * @param iterable $iterable - */ - public static function every($iterable, callable $predicate) : bool - { - foreach ($iterable as $key => $value) { - if (! $predicate($value, $key)) { - return false; - } - } - - return true; - } - - /** - * @param iterable $iterable - */ - public static function some($iterable, callable $predicate) : bool - { - foreach ($iterable as $key => $value) { - if ($predicate($value, $key)) { - return true; - } - } - - return false; - } - - /** - * @param bool $test - * @param string $message - */ - public static function invariant($test, $message = '') - { - if (! $test) { - if (func_num_args() > 2) { - $args = func_get_args(); - array_shift($args); - $message = sprintf(...$args); - } - // TODO switch to Error here - throw new InvariantViolation($message); - } - } - - /** - * @param Type|mixed $var - * - * @return string - */ - public static function getVariableType($var) - { - if ($var instanceof Type) { - // FIXME: Replace with schema printer call - if ($var instanceof WrappingType) { - $var = $var->getWrappedType(true); - } - - return $var->name; - } - - return is_object($var) ? get_class($var) : gettype($var); - } - - /** - * @param mixed $var - * - * @return string - */ - public static function printSafeJson($var) - { - if ($var instanceof stdClass) { - $var = (array) $var; - } - if (is_array($var)) { - return json_encode($var); - } - if ($var === '') { - return '(empty string)'; - } - if ($var === null) { - return 'null'; - } - if ($var === false) { - return 'false'; - } - if ($var === true) { - return 'true'; - } - if (is_string($var)) { - return sprintf('"%s"', $var); - } - if (is_scalar($var)) { - return (string) $var; - } - - return gettype($var); - } - - /** - * @param Type|mixed $var - * - * @return string - */ - public static function printSafe($var) - { - if ($var instanceof Type) { - return $var->toString(); - } - if (is_object($var)) { - if (method_exists($var, '__toString')) { - return (string) $var; - } - - return 'instance of ' . get_class($var); - } - if (is_array($var)) { - return json_encode($var); - } - if ($var === '') { - return '(empty string)'; - } - if ($var === null) { - return 'null'; - } - if ($var === false) { - return 'false'; - } - if ($var === true) { - return 'true'; - } - if (is_string($var)) { - return $var; - } - if (is_scalar($var)) { - return (string) $var; - } - - return gettype($var); - } - - /** - * UTF-8 compatible chr() - * - * @param string $ord - * @param string $encoding - * - * @return string - */ - public static function chr($ord, $encoding = 'UTF-8') - { - if ($encoding === 'UCS-4BE') { - return pack('N', $ord); - } - - return mb_convert_encoding(self::chr($ord, 'UCS-4BE'), $encoding, 'UCS-4BE'); - } - - /** - * UTF-8 compatible ord() - * - * @param string $char - * @param string $encoding - * - * @return mixed - */ - public static function ord($char, $encoding = 'UTF-8') - { - if (! $char && $char !== '0') { - return 0; - } - if (! isset($char[1])) { - return ord($char); - } - if ($encoding !== 'UCS-4BE') { - $char = mb_convert_encoding($char, 'UCS-4BE', $encoding); - } - - return unpack('N', $char)[1]; - } - - /** - * Returns UTF-8 char code at given $positing of the $string - * - * @param string $string - * @param int $position - * - * @return mixed - */ - public static function charCodeAt($string, $position) - { - $char = mb_substr($string, $position, 1, 'UTF-8'); - - return self::ord($char); - } - - /** - * @param int|null $code - * - * @return string - */ - public static function printCharCode($code) - { - if ($code === null) { - return ''; - } - - return $code < 0x007F - // Trust JSON for ASCII. - ? json_encode(self::chr($code)) - // Otherwise print the escaped form. - : '"\\u' . dechex($code) . '"'; - } - - /** - * Upholds the spec rules about naming. - * - * @param string $name - * - * @throws Error - */ - public static function assertValidName($name) - { - $error = self::isValidNameError($name); - if ($error) { - throw $error; - } - } - - /** - * Returns an Error if a name is invalid. - * - * @param string $name - * @param Node|null $node - * - * @return Error|null - */ - public static function isValidNameError($name, $node = null) - { - self::invariant(is_string($name), 'Expected string'); - - if (isset($name[1]) && $name[0] === '_' && $name[1] === '_') { - return new Error( - sprintf('Name "%s" must not begin with "__", which is reserved by ', $name) . - 'GraphQL introspection.', - $node - ); - } - - if (! preg_match('/^[_a-zA-Z][_a-zA-Z0-9]*$/', $name)) { - return new Error( - sprintf('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "%s" does not.', $name), - $node - ); - } - - return null; - } - - /** - * Wraps original callable with PHP error handling (using set_error_handler). - * Resulting callable will collect all PHP errors that occur during the call in $errors array. - * - * @param ErrorException[] $errors - * - * @return callable - */ - public static function withErrorHandling(callable $fn, array &$errors) - { - return static function () use ($fn, &$errors) { - // Catch custom errors (to report them in query results) - set_error_handler(static function ($severity, $message, $file, $line) use (&$errors) : void { - $errors[] = new ErrorException($message, 0, $severity, $file, $line); - }); - - try { - return $fn(); - } finally { - restore_error_handler(); - } - }; - } - - /** - * @param string[] $items - * - * @return string - */ - public static function quotedOrList(array $items) - { - $items = array_map( - static function ($item) : string { - return sprintf('"%s"', $item); - }, - $items - ); - - return self::orList($items); - } - - /** - * @param string[] $items - * - * @return string - */ - public static function orList(array $items) - { - if (count($items) === 0) { - throw new LogicException('items must not need to be empty.'); - } - $selected = array_slice($items, 0, 5); - $selectedLength = count($selected); - $firstSelected = $selected[0]; - - if ($selectedLength === 1) { - return $firstSelected; - } - - return array_reduce( - range(1, $selectedLength - 1), - static function ($list, $index) use ($selected, $selectedLength) : string { - return $list . - ($selectedLength > 2 ? ', ' : ' ') . - ($index === $selectedLength - 1 ? 'or ' : '') . - $selected[$index]; - }, - $firstSelected - ); - } - - /** - * Given an invalid input string and a list of valid options, returns a filtered - * list of valid options sorted based on their similarity with the input. - * - * Includes a custom alteration from Damerau-Levenshtein to treat case changes - * as a single edit which helps identify mis-cased values with an edit distance - * of 1 - * - * @param string $input - * @param string[] $options - * - * @return string[] - */ - public static function suggestionList($input, array $options) - { - $optionsByDistance = []; - $threshold = mb_strlen($input) * 0.4 + 1; - foreach ($options as $option) { - if ($input === $option) { - $distance = 0; - } else { - $distance = (strtolower($input) === strtolower($option) - ? 1 - : levenshtein($input, $option)); - } - if ($distance > $threshold) { - continue; - } - - $optionsByDistance[$option] = $distance; - } - - asort($optionsByDistance); - - return array_keys($optionsByDistance); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Value.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Value.php deleted file mode 100644 index 636abe22..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Utils/Value.php +++ /dev/null @@ -1,311 +0,0 @@ -getWrappedType(), $blameNode, $path); - } - - if ($value === null) { - // Explicitly return the value null. - return self::ofValue(null); - } - - if ($type instanceof ScalarType) { - // Scalars determine if a value is valid via parseValue(), which can - // throw to indicate failure. If it throws, maintain a reference to - // the original error. - try { - return self::ofValue($type->parseValue($value)); - } catch (Throwable $error) { - return self::ofErrors([ - self::coercionError( - sprintf('Expected type %s', $type->name), - $blameNode, - $path, - $error->getMessage(), - $error - ), - ]); - } - } - - if ($type instanceof EnumType) { - if (is_string($value)) { - $enumValue = $type->getValue($value); - if ($enumValue) { - return self::ofValue($enumValue->value); - } - } - - $suggestions = Utils::suggestionList( - Utils::printSafe($value), - array_map( - static function ($enumValue) : string { - return $enumValue->name; - }, - $type->getValues() - ) - ); - - $didYouMean = $suggestions - ? 'did you mean ' . Utils::orList($suggestions) . '?' - : null; - - return self::ofErrors([ - self::coercionError( - sprintf('Expected type %s', $type->name), - $blameNode, - $path, - $didYouMean - ), - ]); - } - - if ($type instanceof ListOfType) { - $itemType = $type->getWrappedType(); - if (is_array($value) || $value instanceof Traversable) { - $errors = []; - $coercedValue = []; - foreach ($value as $index => $itemValue) { - $coercedItem = self::coerceValue( - $itemValue, - $itemType, - $blameNode, - self::atPath($path, $index) - ); - if ($coercedItem['errors']) { - $errors = self::add($errors, $coercedItem['errors']); - } else { - $coercedValue[] = $coercedItem['value']; - } - } - - return $errors ? self::ofErrors($errors) : self::ofValue($coercedValue); - } - // Lists accept a non-list value as a list of one. - $coercedItem = self::coerceValue($value, $itemType, $blameNode); - - return $coercedItem['errors'] ? $coercedItem : self::ofValue([$coercedItem['value']]); - } - - if ($type instanceof InputObjectType) { - if (! is_object($value) && ! is_array($value) && ! $value instanceof Traversable) { - return self::ofErrors([ - self::coercionError( - sprintf('Expected type %s to be an object', $type->name), - $blameNode, - $path - ), - ]); - } - - // Cast \stdClass to associative array before checking the fields. Note that the coerced value will be an array. - if ($value instanceof stdClass) { - $value = (array) $value; - } - - $errors = []; - $coercedValue = []; - $fields = $type->getFields(); - foreach ($fields as $fieldName => $field) { - if (array_key_exists($fieldName, $value)) { - $fieldValue = $value[$fieldName]; - $coercedField = self::coerceValue( - $fieldValue, - $field->getType(), - $blameNode, - self::atPath($path, $fieldName) - ); - if ($coercedField['errors']) { - $errors = self::add($errors, $coercedField['errors']); - } else { - $coercedValue[$fieldName] = $coercedField['value']; - } - } elseif ($field->defaultValueExists()) { - $coercedValue[$fieldName] = $field->defaultValue; - } elseif ($field->getType() instanceof NonNull) { - $fieldPath = self::printPath(self::atPath($path, $fieldName)); - $errors = self::add( - $errors, - self::coercionError( - sprintf( - 'Field %s of required type %s was not provided', - $fieldPath, - $field->getType()->toString() - ), - $blameNode - ) - ); - } - } - - // Ensure every provided field is defined. - foreach ($value as $fieldName => $field) { - if (array_key_exists($fieldName, $fields)) { - continue; - } - - $suggestions = Utils::suggestionList( - (string) $fieldName, - array_keys($fields) - ); - $didYouMean = $suggestions - ? 'did you mean ' . Utils::orList($suggestions) . '?' - : null; - $errors = self::add( - $errors, - self::coercionError( - sprintf('Field "%s" is not defined by type %s', $fieldName, $type->name), - $blameNode, - $path, - $didYouMean - ) - ); - } - - return $errors ? self::ofErrors($errors) : self::ofValue($coercedValue); - } - - throw new Error(sprintf('Unexpected type %s', $type->name)); - } - - private static function ofErrors($errors) - { - return ['errors' => $errors, 'value' => Utils::undefined()]; - } - - /** - * @param string $message - * @param Node $blameNode - * @param mixed[]|null $path - * @param string $subMessage - * @param Exception|Throwable|null $originalError - * - * @return Error - */ - private static function coercionError( - $message, - $blameNode, - ?array $path = null, - $subMessage = null, - $originalError = null - ) { - $pathStr = self::printPath($path); - - // Return a GraphQLError instance - return new Error( - $message . - ($pathStr ? ' at ' . $pathStr : '') . - ($subMessage ? '; ' . $subMessage : '.'), - $blameNode, - null, - [], - null, - $originalError - ); - } - - /** - * Build a string describing the path into the value where the error was found - * - * @param mixed[]|null $path - * - * @return string - */ - private static function printPath(?array $path = null) - { - $pathStr = ''; - $currentPath = $path; - while ($currentPath) { - $pathStr = - (is_string($currentPath['key']) - ? '.' . $currentPath['key'] - : '[' . $currentPath['key'] . ']') . $pathStr; - $currentPath = $currentPath['prev']; - } - - return $pathStr ? 'value' . $pathStr : ''; - } - - /** - * @param mixed $value - * - * @return (mixed|null)[] - */ - private static function ofValue($value) - { - return ['errors' => null, 'value' => $value]; - } - - /** - * @param mixed|null $prev - * @param mixed|null $key - * - * @return (mixed|null)[] - */ - private static function atPath($prev, $key) - { - return ['prev' => $prev, 'key' => $key]; - } - - /** - * @param Error[] $errors - * @param Error|Error[] $moreErrors - * - * @return Error[] - */ - private static function add($errors, $moreErrors) - { - return array_merge($errors, is_array($moreErrors) ? $moreErrors : [$moreErrors]); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ASTValidationContext.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ASTValidationContext.php deleted file mode 100644 index 0b1f1bc7..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/ASTValidationContext.php +++ /dev/null @@ -1,54 +0,0 @@ -ast = $ast; - $this->schema = $schema; - $this->errors = []; - } - - public function reportError(Error $error) - { - $this->errors[] = $error; - } - - /** - * @return Error[] - */ - public function getErrors() - { - return $this->errors; - } - - /** - * @return DocumentNode - */ - public function getDocument() - { - return $this->ast; - } - - public function getSchema() : ?Schema - { - return $this->schema; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php deleted file mode 100644 index 98a5871c..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/DocumentValidator.php +++ /dev/null @@ -1,361 +0,0 @@ - new ExecutableDefinitions(), - UniqueOperationNames::class => new UniqueOperationNames(), - LoneAnonymousOperation::class => new LoneAnonymousOperation(), - SingleFieldSubscription::class => new SingleFieldSubscription(), - KnownTypeNames::class => new KnownTypeNames(), - FragmentsOnCompositeTypes::class => new FragmentsOnCompositeTypes(), - VariablesAreInputTypes::class => new VariablesAreInputTypes(), - ScalarLeafs::class => new ScalarLeafs(), - FieldsOnCorrectType::class => new FieldsOnCorrectType(), - UniqueFragmentNames::class => new UniqueFragmentNames(), - KnownFragmentNames::class => new KnownFragmentNames(), - NoUnusedFragments::class => new NoUnusedFragments(), - PossibleFragmentSpreads::class => new PossibleFragmentSpreads(), - NoFragmentCycles::class => new NoFragmentCycles(), - UniqueVariableNames::class => new UniqueVariableNames(), - NoUndefinedVariables::class => new NoUndefinedVariables(), - NoUnusedVariables::class => new NoUnusedVariables(), - KnownDirectives::class => new KnownDirectives(), - UniqueDirectivesPerLocation::class => new UniqueDirectivesPerLocation(), - KnownArgumentNames::class => new KnownArgumentNames(), - UniqueArgumentNames::class => new UniqueArgumentNames(), - ValuesOfCorrectType::class => new ValuesOfCorrectType(), - ProvidedRequiredArguments::class => new ProvidedRequiredArguments(), - VariablesInAllowedPosition::class => new VariablesInAllowedPosition(), - OverlappingFieldsCanBeMerged::class => new OverlappingFieldsCanBeMerged(), - UniqueInputFieldNames::class => new UniqueInputFieldNames(), - ]; - } - - return self::$defaultRules; - } - - /** - * @return QuerySecurityRule[] - */ - public static function securityRules() - { - // This way of defining rules is deprecated - // When custom security rule is required - it should be just added via DocumentValidator::addRule(); - // TODO: deprecate this - - if (self::$securityRules === null) { - self::$securityRules = [ - DisableIntrospection::class => new DisableIntrospection(DisableIntrospection::DISABLED), // DEFAULT DISABLED - QueryDepth::class => new QueryDepth(QueryDepth::DISABLED), // default disabled - QueryComplexity::class => new QueryComplexity(QueryComplexity::DISABLED), // default disabled - ]; - } - - return self::$securityRules; - } - - public static function sdlRules() - { - if (self::$sdlRules === null) { - self::$sdlRules = [ - LoneSchemaDefinition::class => new LoneSchemaDefinition(), - KnownDirectives::class => new KnownDirectives(), - KnownArgumentNamesOnDirectives::class => new KnownArgumentNamesOnDirectives(), - UniqueDirectivesPerLocation::class => new UniqueDirectivesPerLocation(), - UniqueArgumentNames::class => new UniqueArgumentNames(), - UniqueInputFieldNames::class => new UniqueInputFieldNames(), - ProvidedRequiredArgumentsOnDirectives::class => new ProvidedRequiredArgumentsOnDirectives(), - ]; - } - - return self::$sdlRules; - } - - /** - * This uses a specialized visitor which runs multiple visitors in parallel, - * while maintaining the visitor skip and break API. - * - * @param ValidationRule[] $rules - * - * @return Error[] - */ - public static function visitUsingRules(Schema $schema, TypeInfo $typeInfo, DocumentNode $documentNode, array $rules) - { - $context = new ValidationContext($schema, $documentNode, $typeInfo); - $visitors = []; - foreach ($rules as $rule) { - $visitors[] = $rule->getVisitor($context); - } - Visitor::visit($documentNode, Visitor::visitWithTypeInfo($typeInfo, Visitor::visitInParallel($visitors))); - - return $context->getErrors(); - } - - /** - * Returns global validation rule by name. Standard rules are named by class name, so - * example usage for such rules: - * - * $rule = DocumentValidator::getRule(GraphQL\Validator\Rules\QueryComplexity::class); - * - * @param string $name - * - * @return ValidationRule - * - * @api - */ - public static function getRule($name) - { - $rules = static::allRules(); - - if (isset($rules[$name])) { - return $rules[$name]; - } - - $name = sprintf('GraphQL\\Validator\\Rules\\%s', $name); - - return $rules[$name] ?? null; - } - - /** - * Add rule to list of global validation rules - * - * @api - */ - public static function addRule(ValidationRule $rule) - { - self::$rules[$rule->getName()] = $rule; - } - - public static function isError($value) - { - return is_array($value) - ? count(array_filter( - $value, - static function ($item) : bool { - return $item instanceof Throwable; - } - )) === count($value) - : $value instanceof Throwable; - } - - public static function append(&$arr, $items) - { - if (is_array($items)) { - $arr = array_merge($arr, $items); - } else { - $arr[] = $items; - } - - return $arr; - } - - /** - * Utility which determines if a value literal node is valid for an input type. - * - * Deprecated. Rely on validation for documents co - * ntaining literal values. - * - * @deprecated - * - * @return Error[] - */ - public static function isValidLiteralValue(Type $type, $valueNode) - { - $emptySchema = new Schema([]); - $emptyDoc = new DocumentNode(['definitions' => []]); - $typeInfo = new TypeInfo($emptySchema, $type); - $context = new ValidationContext($emptySchema, $emptyDoc, $typeInfo); - $validator = new ValuesOfCorrectType(); - $visitor = $validator->getVisitor($context); - Visitor::visit($valueNode, Visitor::visitWithTypeInfo($typeInfo, $visitor)); - - return $context->getErrors(); - } - - /** - * @param ValidationRule[]|null $rules - * - * @return Error[] - * - * @throws Exception - */ - public static function validateSDL( - DocumentNode $documentAST, - ?Schema $schemaToExtend = null, - ?array $rules = null - ) { - $usedRules = $rules ?? self::sdlRules(); - $context = new SDLValidationContext($documentAST, $schemaToExtend); - $visitors = []; - foreach ($usedRules as $rule) { - $visitors[] = $rule->getSDLVisitor($context); - } - Visitor::visit($documentAST, Visitor::visitInParallel($visitors)); - - return $context->getErrors(); - } - - public static function assertValidSDL(DocumentNode $documentAST) - { - $errors = self::validateSDL($documentAST); - if (count($errors) > 0) { - throw new Error(self::combineErrorMessages($errors)); - } - } - - public static function assertValidSDLExtension(DocumentNode $documentAST, Schema $schema) - { - $errors = self::validateSDL($documentAST, $schema); - if (count($errors) > 0) { - throw new Error(self::combineErrorMessages($errors)); - } - } - - /** - * @param Error[] $errors - */ - private static function combineErrorMessages(array $errors) : string - { - $str = ''; - foreach ($errors as $error) { - $str .= ($error->getMessage() . "\n\n"); - } - - return $str; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php deleted file mode 100644 index 83101a1d..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/CustomValidationRule.php +++ /dev/null @@ -1,30 +0,0 @@ -name = $name; - $this->visitorFn = $visitorFn; - } - - /** - * @return Error[] - */ - public function getVisitor(ValidationContext $context) - { - $fn = $this->visitorFn; - - return $fn($context); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php deleted file mode 100644 index 01a93183..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/DisableIntrospection.php +++ /dev/null @@ -1,57 +0,0 @@ -setEnabled($enabled); - } - - public function setEnabled($enabled) - { - $this->isEnabled = $enabled; - } - - public function getVisitor(ValidationContext $context) - { - return $this->invokeIfNeeded( - $context, - [ - NodeKind::FIELD => static function (FieldNode $node) use ($context) : void { - if ($node->name->value !== '__type' && $node->name->value !== '__schema') { - return; - } - - $context->reportError(new Error( - static::introspectionDisabledMessage(), - [$node] - )); - }, - ] - ); - } - - public static function introspectionDisabledMessage() - { - return 'GraphQL introspection is not allowed, but the query contained __schema or __type'; - } - - protected function isEnabled() - { - return $this->isEnabled !== self::DISABLED; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php deleted file mode 100644 index 5966df7e..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ExecutableDefinitions.php +++ /dev/null @@ -1,50 +0,0 @@ - static function (DocumentNode $node) use ($context) : VisitorOperation { - /** @var ExecutableDefinitionNode|TypeSystemDefinitionNode $definition */ - foreach ($node->definitions as $definition) { - if ($definition instanceof ExecutableDefinitionNode) { - continue; - } - - $context->reportError(new Error( - self::nonExecutableDefinitionMessage($definition->name->value), - [$definition->name] - )); - } - - return Visitor::skipNode(); - }, - ]; - } - - public static function nonExecutableDefinitionMessage($defName) - { - return sprintf('The "%s" definition is not executable.', $defName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php deleted file mode 100644 index 3d7013c8..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FieldsOnCorrectType.php +++ /dev/null @@ -1,166 +0,0 @@ - function (FieldNode $node) use ($context) : void { - $type = $context->getParentType(); - if (! $type) { - return; - } - - $fieldDef = $context->getFieldDef(); - if ($fieldDef) { - return; - } - - // This isn't valid. Let's find suggestions, if any. - $schema = $context->getSchema(); - $fieldName = $node->name->value; - // First determine if there are any suggested types to condition on. - $suggestedTypeNames = $this->getSuggestedTypeNames( - $schema, - $type, - $fieldName - ); - // If there are no suggested types, then perhaps this was a typo? - $suggestedFieldNames = $suggestedTypeNames - ? [] - : $this->getSuggestedFieldNames( - $schema, - $type, - $fieldName - ); - - // Report an error, including helpful suggestions. - $context->reportError(new Error( - static::undefinedFieldMessage( - $node->name->value, - $type->name, - $suggestedTypeNames, - $suggestedFieldNames - ), - [$node] - )); - }, - ]; - } - - /** - * Go through all of the implementations of type, as well as the interfaces - * that they implement. If any of those types include the provided field, - * suggest them, sorted by how often the type is referenced, starting - * with Interfaces. - * - * @param ObjectType|InterfaceType $type - * @param string $fieldName - * - * @return string[] - */ - private function getSuggestedTypeNames(Schema $schema, $type, $fieldName) - { - if (Type::isAbstractType($type)) { - $suggestedObjectTypes = []; - $interfaceUsageCount = []; - - foreach ($schema->getPossibleTypes($type) as $possibleType) { - if (! $possibleType->hasField($fieldName)) { - continue; - } - // This object type defines this field. - $suggestedObjectTypes[] = $possibleType->name; - foreach ($possibleType->getInterfaces() as $possibleInterface) { - if (! $possibleInterface->hasField($fieldName)) { - continue; - } - // This interface type defines this field. - $interfaceUsageCount[$possibleInterface->name] = - ! isset($interfaceUsageCount[$possibleInterface->name]) - ? 0 - : $interfaceUsageCount[$possibleInterface->name] + 1; - } - } - - // Suggest interface types based on how common they are. - arsort($interfaceUsageCount); - $suggestedInterfaceTypes = array_keys($interfaceUsageCount); - - // Suggest both interface and object types. - return array_merge($suggestedInterfaceTypes, $suggestedObjectTypes); - } - - // Otherwise, must be an Object type, which does not have possible fields. - return []; - } - - /** - * For the field name provided, determine if there are any similar field names - * that may be the result of a typo. - * - * @param ObjectType|InterfaceType $type - * @param string $fieldName - * - * @return array|string[] - */ - private function getSuggestedFieldNames(Schema $schema, $type, $fieldName) - { - if ($type instanceof ObjectType || $type instanceof InterfaceType) { - $possibleFieldNames = $type->getFieldNames(); - - return Utils::suggestionList($fieldName, $possibleFieldNames); - } - - // Otherwise, must be a Union type, which does not define fields. - return []; - } - - /** - * @param string $fieldName - * @param string $type - * @param string[] $suggestedTypeNames - * @param string[] $suggestedFieldNames - * - * @return string - */ - public static function undefinedFieldMessage( - $fieldName, - $type, - array $suggestedTypeNames, - array $suggestedFieldNames - ) { - $message = sprintf('Cannot query field "%s" on type "%s".', $fieldName, $type); - - if ($suggestedTypeNames) { - $suggestions = Utils::quotedOrList($suggestedTypeNames); - - $message .= sprintf(' Did you mean to use an inline fragment on %s?', $suggestions); - } elseif (count($suggestedFieldNames) > 0) { - $suggestions = Utils::quotedOrList($suggestedFieldNames); - - $message .= sprintf(' Did you mean %s?', $suggestions); - } - - return $message; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php deleted file mode 100644 index db72a057..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/FragmentsOnCompositeTypes.php +++ /dev/null @@ -1,64 +0,0 @@ - static function (InlineFragmentNode $node) use ($context) : void { - if (! $node->typeCondition) { - return; - } - - $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); - if (! $type || Type::isCompositeType($type)) { - return; - } - - $context->reportError(new Error( - static::inlineFragmentOnNonCompositeErrorMessage($type), - [$node->typeCondition] - )); - }, - NodeKind::FRAGMENT_DEFINITION => static function (FragmentDefinitionNode $node) use ($context) : void { - $type = TypeInfo::typeFromAST($context->getSchema(), $node->typeCondition); - - if (! $type || Type::isCompositeType($type)) { - return; - } - - $context->reportError(new Error( - static::fragmentOnNonCompositeErrorMessage( - $node->name->value, - Printer::doPrint($node->typeCondition) - ), - [$node->typeCondition] - )); - }, - ]; - } - - public static function inlineFragmentOnNonCompositeErrorMessage($type) - { - return sprintf('Fragment cannot condition on non composite type "%s".', $type); - } - - public static function fragmentOnNonCompositeErrorMessage($fragName, $type) - { - return sprintf('Fragment "%s" cannot condition on non composite type "%s".', $fragName, $type); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php deleted file mode 100644 index d3013797..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNames.php +++ /dev/null @@ -1,80 +0,0 @@ -getVisitor($context) + [ - NodeKind::ARGUMENT => static function (ArgumentNode $node) use ($context) : void { - $argDef = $context->getArgument(); - if ($argDef !== null) { - return; - } - - $fieldDef = $context->getFieldDef(); - $parentType = $context->getParentType(); - if ($fieldDef === null || ! ($parentType instanceof Type)) { - return; - } - - $context->reportError(new Error( - self::unknownArgMessage( - $node->name->value, - $fieldDef->name, - $parentType->name, - Utils::suggestionList( - $node->name->value, - array_map( - static function ($arg) : string { - return $arg->name; - }, - $fieldDef->args - ) - ) - ), - [$node] - )); - - return; - }, - ]; - } - - /** - * @param string[] $suggestedArgs - */ - public static function unknownArgMessage($argName, $fieldName, $typeName, array $suggestedArgs) - { - $message = sprintf('Unknown argument "%s" on field "%s" of type "%s".', $argName, $fieldName, $typeName); - if (isset($suggestedArgs[0])) { - $message .= sprintf(' Did you mean %s?', Utils::quotedOrList($suggestedArgs)); - } - - return $message; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php deleted file mode 100644 index bdde5d36..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownArgumentNamesOnDirectives.php +++ /dev/null @@ -1,115 +0,0 @@ -getASTVisitor($context); - } - - public function getVisitor(ValidationContext $context) - { - return $this->getASTVisitor($context); - } - - public function getASTVisitor(ASTValidationContext $context) - { - $directiveArgs = []; - $schema = $context->getSchema(); - $definedDirectives = $schema !== null ? $schema->getDirectives() : Directive::getInternalDirectives(); - - foreach ($definedDirectives as $directive) { - $directiveArgs[$directive->name] = array_map( - static function (FieldArgument $arg) : string { - return $arg->name; - }, - $directive->args - ); - } - - $astDefinitions = $context->getDocument()->definitions; - foreach ($astDefinitions as $def) { - if (! ($def instanceof DirectiveDefinitionNode)) { - continue; - } - - $name = $def->name->value; - if ($def->arguments !== null) { - $directiveArgs[$name] = Utils::map( - $def->arguments ?? [], - static function (InputValueDefinitionNode $arg) : string { - return $arg->name->value; - } - ); - } else { - $directiveArgs[$name] = []; - } - } - - return [ - NodeKind::DIRECTIVE => static function (DirectiveNode $directiveNode) use ($directiveArgs, $context) : VisitorOperation { - $directiveName = $directiveNode->name->value; - $knownArgs = $directiveArgs[$directiveName] ?? null; - - if ($directiveNode->arguments === null || $knownArgs === null) { - return Visitor::skipNode(); - } - - foreach ($directiveNode->arguments as $argNode) { - $argName = $argNode->name->value; - if (in_array($argName, $knownArgs, true)) { - continue; - } - - $suggestions = Utils::suggestionList($argName, $knownArgs); - $context->reportError(new Error( - self::unknownDirectiveArgMessage($argName, $directiveName, $suggestions), - [$argNode] - )); - } - - return Visitor::skipNode(); - }, - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php deleted file mode 100644 index 758e8611..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownDirectives.php +++ /dev/null @@ -1,200 +0,0 @@ -getASTVisitor($context); - } - - public function getSDLVisitor(SDLValidationContext $context) - { - return $this->getASTVisitor($context); - } - - public function getASTVisitor(ASTValidationContext $context) - { - $locationsMap = []; - $schema = $context->getSchema(); - $definedDirectives = $schema - ? $schema->getDirectives() - : Directive::getInternalDirectives(); - - foreach ($definedDirectives as $directive) { - $locationsMap[$directive->name] = $directive->locations; - } - - $astDefinition = $context->getDocument()->definitions; - - foreach ($astDefinition as $def) { - if (! ($def instanceof DirectiveDefinitionNode)) { - continue; - } - - $locationsMap[$def->name->value] = Utils::map( - $def->locations, - static function ($name) : string { - return $name->value; - } - ); - } - - return [ - NodeKind::DIRECTIVE => function ( - DirectiveNode $node, - $key, - $parent, - $path, - $ancestors - ) use ( - $context, - $locationsMap - ) : void { - $name = $node->name->value; - $locations = $locationsMap[$name] ?? null; - - if (! $locations) { - $context->reportError(new Error( - self::unknownDirectiveMessage($name), - [$node] - )); - - return; - } - - $candidateLocation = $this->getDirectiveLocationForASTPath($ancestors); - - if (! $candidateLocation || in_array($candidateLocation, $locations, true)) { - return; - } - $context->reportError( - new Error( - self::misplacedDirectiveMessage($name, $candidateLocation), - [$node] - ) - ); - }, - ]; - } - - public static function unknownDirectiveMessage($directiveName) - { - return sprintf('Unknown directive "%s".', $directiveName); - } - - /** - * @param Node[]|NodeList[] $ancestors The type is actually (Node|NodeList)[] but this PSR-5 syntax is so far not supported by most of the tools - * - * @return string - */ - private function getDirectiveLocationForASTPath(array $ancestors) - { - $appliedTo = $ancestors[count($ancestors) - 1]; - switch (true) { - case $appliedTo instanceof OperationDefinitionNode: - switch ($appliedTo->operation) { - case 'query': - return DirectiveLocation::QUERY; - case 'mutation': - return DirectiveLocation::MUTATION; - case 'subscription': - return DirectiveLocation::SUBSCRIPTION; - } - break; - case $appliedTo instanceof FieldNode: - return DirectiveLocation::FIELD; - case $appliedTo instanceof FragmentSpreadNode: - return DirectiveLocation::FRAGMENT_SPREAD; - case $appliedTo instanceof InlineFragmentNode: - return DirectiveLocation::INLINE_FRAGMENT; - case $appliedTo instanceof FragmentDefinitionNode: - return DirectiveLocation::FRAGMENT_DEFINITION; - case $appliedTo instanceof VariableDefinitionNode: - return DirectiveLocation::VARIABLE_DEFINITION; - case $appliedTo instanceof SchemaDefinitionNode: - case $appliedTo instanceof SchemaTypeExtensionNode: - return DirectiveLocation::SCHEMA; - case $appliedTo instanceof ScalarTypeDefinitionNode: - case $appliedTo instanceof ScalarTypeExtensionNode: - return DirectiveLocation::SCALAR; - case $appliedTo instanceof ObjectTypeDefinitionNode: - case $appliedTo instanceof ObjectTypeExtensionNode: - return DirectiveLocation::OBJECT; - case $appliedTo instanceof FieldDefinitionNode: - return DirectiveLocation::FIELD_DEFINITION; - case $appliedTo instanceof InterfaceTypeDefinitionNode: - case $appliedTo instanceof InterfaceTypeExtensionNode: - return DirectiveLocation::IFACE; - case $appliedTo instanceof UnionTypeDefinitionNode: - case $appliedTo instanceof UnionTypeExtensionNode: - return DirectiveLocation::UNION; - case $appliedTo instanceof EnumTypeDefinitionNode: - case $appliedTo instanceof EnumTypeExtensionNode: - return DirectiveLocation::ENUM; - case $appliedTo instanceof EnumValueDefinitionNode: - return DirectiveLocation::ENUM_VALUE; - case $appliedTo instanceof InputObjectTypeDefinitionNode: - case $appliedTo instanceof InputObjectTypeExtensionNode: - return DirectiveLocation::INPUT_OBJECT; - case $appliedTo instanceof InputValueDefinitionNode: - $parentNode = $ancestors[count($ancestors) - 3]; - - return $parentNode instanceof InputObjectTypeDefinitionNode - ? DirectiveLocation::INPUT_FIELD_DEFINITION - : DirectiveLocation::ARGUMENT_DEFINITION; - } - - throw new Exception('Unknown directive location: ' . get_class($appliedTo)); - } - - public static function misplacedDirectiveMessage($directiveName, $location) - { - return sprintf('Directive "%s" may not be used on "%s".', $directiveName, $location); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php deleted file mode 100644 index 052686f2..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownFragmentNames.php +++ /dev/null @@ -1,40 +0,0 @@ - static function (FragmentSpreadNode $node) use ($context) : void { - $fragmentName = $node->name->value; - $fragment = $context->getFragment($fragmentName); - if ($fragment) { - return; - } - - $context->reportError(new Error( - self::unknownFragmentMessage($fragmentName), - [$node->name] - )); - }, - ]; - } - - /** - * @param string $fragName - */ - public static function unknownFragmentMessage($fragName) - { - return sprintf('Unknown fragment "%s".', $fragName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php deleted file mode 100644 index b852f523..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/KnownTypeNames.php +++ /dev/null @@ -1,74 +0,0 @@ - $skip, - NodeKind::INTERFACE_TYPE_DEFINITION => $skip, - NodeKind::UNION_TYPE_DEFINITION => $skip, - NodeKind::INPUT_OBJECT_TYPE_DEFINITION => $skip, - NodeKind::NAMED_TYPE => static function (NamedTypeNode $node) use ($context) : void { - $schema = $context->getSchema(); - $typeName = $node->name->value; - $type = $schema->getType($typeName); - if ($type !== null) { - return; - } - - $context->reportError(new Error( - self::unknownTypeMessage( - $typeName, - Utils::suggestionList($typeName, array_keys($schema->getTypeMap())) - ), - [$node] - )); - }, - ]; - } - - /** - * @param string $type - * @param string[] $suggestedTypes - */ - public static function unknownTypeMessage($type, array $suggestedTypes) - { - $message = sprintf('Unknown type "%s".', $type); - if (count($suggestedTypes) > 0) { - $suggestions = Utils::quotedOrList($suggestedTypes); - - $message .= sprintf(' Did you mean %s?', $suggestions); - } - - return $message; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php deleted file mode 100644 index facc895a..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneAnonymousOperation.php +++ /dev/null @@ -1,58 +0,0 @@ - static function (DocumentNode $node) use (&$operationCount) : void { - $tmp = Utils::filter( - $node->definitions, - static function (Node $definition) : bool { - return $definition instanceof OperationDefinitionNode; - } - ); - - $operationCount = count($tmp); - }, - NodeKind::OPERATION_DEFINITION => static function (OperationDefinitionNode $node) use ( - &$operationCount, - $context - ) : void { - if ($node->name !== null || $operationCount <= 1) { - return; - } - - $context->reportError( - new Error(self::anonOperationNotAloneMessage(), [$node]) - ); - }, - ]; - } - - public static function anonOperationNotAloneMessage() - { - return 'This anonymous operation must be the only defined operation.'; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php deleted file mode 100644 index 4ece976b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/LoneSchemaDefinition.php +++ /dev/null @@ -1,59 +0,0 @@ -getSchema(); - $alreadyDefined = $oldSchema !== null - ? ( - $oldSchema->getAstNode() !== null || - $oldSchema->getQueryType() !== null || - $oldSchema->getMutationType() !== null || - $oldSchema->getSubscriptionType() !== null - ) - : false; - - $schemaDefinitionsCount = 0; - - return [ - NodeKind::SCHEMA_DEFINITION => static function (SchemaDefinitionNode $node) use ($alreadyDefined, $context, &$schemaDefinitionsCount) : void { - if ($alreadyDefined !== false) { - $context->reportError(new Error(self::canNotDefineSchemaWithinExtensionMessage(), $node)); - - return; - } - - if ($schemaDefinitionsCount > 0) { - $context->reportError(new Error(self::schemaDefinitionNotAloneMessage(), $node)); - } - - ++$schemaDefinitionsCount; - }, - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php deleted file mode 100644 index eec546de..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoFragmentCycles.php +++ /dev/null @@ -1,112 +0,0 @@ -visitedFrags = []; - - // Array of AST nodes used to produce meaningful errors - $this->spreadPath = []; - - // Position in the spread path - $this->spreadPathIndexByName = []; - - return [ - NodeKind::OPERATION_DEFINITION => static function () : VisitorOperation { - return Visitor::skipNode(); - }, - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) : VisitorOperation { - $this->detectCycleRecursive($node, $context); - - return Visitor::skipNode(); - }, - ]; - } - - private function detectCycleRecursive(FragmentDefinitionNode $fragment, ValidationContext $context) - { - if (isset($this->visitedFrags[$fragment->name->value])) { - return; - } - - $fragmentName = $fragment->name->value; - $this->visitedFrags[$fragmentName] = true; - - $spreadNodes = $context->getFragmentSpreads($fragment); - - if (count($spreadNodes) === 0) { - return; - } - - $this->spreadPathIndexByName[$fragmentName] = count($this->spreadPath); - - for ($i = 0; $i < count($spreadNodes); $i++) { - $spreadNode = $spreadNodes[$i]; - $spreadName = $spreadNode->name->value; - $cycleIndex = $this->spreadPathIndexByName[$spreadName] ?? null; - - $this->spreadPath[] = $spreadNode; - if ($cycleIndex === null) { - $spreadFragment = $context->getFragment($spreadName); - if ($spreadFragment) { - $this->detectCycleRecursive($spreadFragment, $context); - } - } else { - $cyclePath = array_slice($this->spreadPath, $cycleIndex); - $fragmentNames = Utils::map(array_slice($cyclePath, 0, -1), static function ($s) { - return $s->name->value; - }); - - $context->reportError(new Error( - self::cycleErrorMessage($spreadName, $fragmentNames), - $cyclePath - )); - } - array_pop($this->spreadPath); - } - - $this->spreadPathIndexByName[$fragmentName] = null; - } - - /** - * @param string[] $spreadNames - */ - public static function cycleErrorMessage($fragName, array $spreadNames = []) - { - return sprintf( - 'Cannot spread fragment "%s" within itself%s.', - $fragName, - count($spreadNames) > 0 ? ' via ' . implode(', ', $spreadNames) : '' - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php deleted file mode 100644 index 078990c7..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUndefinedVariables.php +++ /dev/null @@ -1,64 +0,0 @@ - [ - 'enter' => static function () use (&$variableNameDefined) : void { - $variableNameDefined = []; - }, - 'leave' => static function (OperationDefinitionNode $operation) use (&$variableNameDefined, $context) : void { - $usages = $context->getRecursiveVariableUsages($operation); - - foreach ($usages as $usage) { - $node = $usage['node']; - $varName = $node->name->value; - - if ($variableNameDefined[$varName] ?? false) { - continue; - } - - $context->reportError(new Error( - self::undefinedVarMessage( - $varName, - $operation->name !== null - ? $operation->name->value - : null - ), - [$node, $operation] - )); - } - }, - ], - NodeKind::VARIABLE_DEFINITION => static function (VariableDefinitionNode $def) use (&$variableNameDefined) : void { - $variableNameDefined[$def->variable->name->value] = true; - }, - ]; - } - - public static function undefinedVarMessage($varName, $opName = null) - { - return $opName - ? sprintf('Variable "$%s" is not defined by operation "%s".', $varName, $opName) - : sprintf('Variable "$%s" is not defined.', $varName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php deleted file mode 100644 index 4315c547..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedFragments.php +++ /dev/null @@ -1,70 +0,0 @@ -operationDefs = []; - $this->fragmentDefs = []; - - return [ - NodeKind::OPERATION_DEFINITION => function ($node) : VisitorOperation { - $this->operationDefs[] = $node; - - return Visitor::skipNode(); - }, - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $def) : VisitorOperation { - $this->fragmentDefs[] = $def; - - return Visitor::skipNode(); - }, - NodeKind::DOCUMENT => [ - 'leave' => function () use ($context) : void { - $fragmentNameUsed = []; - - foreach ($this->operationDefs as $operation) { - foreach ($context->getRecursivelyReferencedFragments($operation) as $fragment) { - $fragmentNameUsed[$fragment->name->value] = true; - } - } - - foreach ($this->fragmentDefs as $fragmentDef) { - $fragName = $fragmentDef->name->value; - if ($fragmentNameUsed[$fragName] ?? false) { - continue; - } - - $context->reportError(new Error( - self::unusedFragMessage($fragName), - [$fragmentDef] - )); - } - }, - ], - ]; - } - - public static function unusedFragMessage($fragName) - { - return sprintf('Fragment "%s" is never used.', $fragName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php deleted file mode 100644 index 343a969b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/NoUnusedVariables.php +++ /dev/null @@ -1,66 +0,0 @@ -variableDefs = []; - - return [ - NodeKind::OPERATION_DEFINITION => [ - 'enter' => function () : void { - $this->variableDefs = []; - }, - 'leave' => function (OperationDefinitionNode $operation) use ($context) : void { - $variableNameUsed = []; - $usages = $context->getRecursiveVariableUsages($operation); - $opName = $operation->name !== null - ? $operation->name->value - : null; - - foreach ($usages as $usage) { - $node = $usage['node']; - $variableNameUsed[$node->name->value] = true; - } - - foreach ($this->variableDefs as $variableDef) { - $variableName = $variableDef->variable->name->value; - - if ($variableNameUsed[$variableName] ?? false) { - continue; - } - - $context->reportError(new Error( - self::unusedVariableMessage($variableName, $opName), - [$variableDef] - )); - } - }, - ], - NodeKind::VARIABLE_DEFINITION => function ($def) : void { - $this->variableDefs[] = $def; - }, - ]; - } - - public static function unusedVariableMessage($varName, $opName = null) - { - return $opName - ? sprintf('Variable "$%s" is never used in operation "%s".', $varName, $opName) - : sprintf('Variable "$%s" is never used.', $varName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php deleted file mode 100644 index 63073139..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/OverlappingFieldsCanBeMerged.php +++ /dev/null @@ -1,897 +0,0 @@ -comparedFragmentPairs = new PairSet(); - $this->cachedFieldsAndFragmentNames = new SplObjectStorage(); - - return [ - NodeKind::SELECTION_SET => function (SelectionSetNode $selectionSet) use ($context) : void { - $conflicts = $this->findConflictsWithinSelectionSet( - $context, - $context->getParentType(), - $selectionSet - ); - - foreach ($conflicts as $conflict) { - [[$responseName, $reason], $fields1, $fields2] = $conflict; - - $context->reportError(new Error( - self::fieldsConflictMessage($responseName, $reason), - array_merge($fields1, $fields2) - )); - } - }, - ]; - } - - /** - * Find all conflicts found "within" a selection set, including those found - * via spreading in fragments. Called when visiting each SelectionSet in the - * GraphQL Document. - * - * @param CompositeType $parentType - * - * @return mixed[] - */ - private function findConflictsWithinSelectionSet( - ValidationContext $context, - $parentType, - SelectionSetNode $selectionSet - ) { - [$fieldMap, $fragmentNames] = $this->getFieldsAndFragmentNames( - $context, - $parentType, - $selectionSet - ); - - $conflicts = []; - - // (A) Find find all conflicts "within" the fields of this selection set. - // Note: this is the *only place* `collectConflictsWithin` is called. - $this->collectConflictsWithin( - $context, - $conflicts, - $fieldMap - ); - - $fragmentNamesLength = count($fragmentNames); - if ($fragmentNamesLength !== 0) { - // (B) Then collect conflicts between these fields and those represented by - // each spread fragment name found. - $comparedFragments = []; - for ($i = 0; $i < $fragmentNamesLength; $i++) { - $this->collectConflictsBetweenFieldsAndFragment( - $context, - $conflicts, - $comparedFragments, - false, - $fieldMap, - $fragmentNames[$i] - ); - // (C) Then compare this fragment with all other fragments found in this - // selection set to collect conflicts between fragments spread together. - // This compares each item in the list of fragment names to every other item - // in that same list (except for itself). - for ($j = $i + 1; $j < $fragmentNamesLength; $j++) { - $this->collectConflictsBetweenFragments( - $context, - $conflicts, - false, - $fragmentNames[$i], - $fragmentNames[$j] - ); - } - } - } - - return $conflicts; - } - - /** - * Given a selection set, return the collection of fields (a mapping of response - * name to field ASTs and definitions) as well as a list of fragment names - * referenced via fragment spreads. - * - * @param CompositeType $parentType - * - * @return mixed[]|SplObjectStorage - */ - private function getFieldsAndFragmentNames( - ValidationContext $context, - $parentType, - SelectionSetNode $selectionSet - ) { - if (isset($this->cachedFieldsAndFragmentNames[$selectionSet])) { - $cached = $this->cachedFieldsAndFragmentNames[$selectionSet]; - } else { - $astAndDefs = []; - $fragmentNames = []; - - $this->internalCollectFieldsAndFragmentNames( - $context, - $parentType, - $selectionSet, - $astAndDefs, - $fragmentNames - ); - $cached = [$astAndDefs, array_keys($fragmentNames)]; - $this->cachedFieldsAndFragmentNames[$selectionSet] = $cached; - } - - return $cached; - } - - /** - * Algorithm: - * - * Conflicts occur when two fields exist in a query which will produce the same - * response name, but represent differing values, thus creating a conflict. - * The algorithm below finds all conflicts via making a series of comparisons - * between fields. In order to compare as few fields as possible, this makes - * a series of comparisons "within" sets of fields and "between" sets of fields. - * - * Given any selection set, a collection produces both a set of fields by - * also including all inline fragments, as well as a list of fragments - * referenced by fragment spreads. - * - * A) Each selection set represented in the document first compares "within" its - * collected set of fields, finding any conflicts between every pair of - * overlapping fields. - * Note: This is the *only time* that a the fields "within" a set are compared - * to each other. After this only fields "between" sets are compared. - * - * B) Also, if any fragment is referenced in a selection set, then a - * comparison is made "between" the original set of fields and the - * referenced fragment. - * - * C) Also, if multiple fragments are referenced, then comparisons - * are made "between" each referenced fragment. - * - * D) When comparing "between" a set of fields and a referenced fragment, first - * a comparison is made between each field in the original set of fields and - * each field in the the referenced set of fields. - * - * E) Also, if any fragment is referenced in the referenced selection set, - * then a comparison is made "between" the original set of fields and the - * referenced fragment (recursively referring to step D). - * - * F) When comparing "between" two fragments, first a comparison is made between - * each field in the first referenced set of fields and each field in the the - * second referenced set of fields. - * - * G) Also, any fragments referenced by the first must be compared to the - * second, and any fragments referenced by the second must be compared to the - * first (recursively referring to step F). - * - * H) When comparing two fields, if both have selection sets, then a comparison - * is made "between" both selection sets, first comparing the set of fields in - * the first selection set with the set of fields in the second. - * - * I) Also, if any fragment is referenced in either selection set, then a - * comparison is made "between" the other set of fields and the - * referenced fragment. - * - * J) Also, if two fragments are referenced in both selection sets, then a - * comparison is made "between" the two fragments. - */ - - /** - * Given a reference to a fragment, return the represented collection of fields - * as well as a list of nested fragment names referenced via fragment spreads. - * - * @param CompositeType $parentType - * @param mixed[][][] $astAndDefs - * @param bool[] $fragmentNames - */ - private function internalCollectFieldsAndFragmentNames( - ValidationContext $context, - $parentType, - SelectionSetNode $selectionSet, - array &$astAndDefs, - array &$fragmentNames - ) { - foreach ($selectionSet->selections as $selection) { - switch (true) { - case $selection instanceof FieldNode: - $fieldName = $selection->name->value; - $fieldDef = null; - if ($parentType instanceof ObjectType || - $parentType instanceof InterfaceType - ) { - if ($parentType->hasField($fieldName)) { - $fieldDef = $parentType->getField($fieldName); - } - } - $responseName = $selection->alias ? $selection->alias->value : $fieldName; - - if (! isset($astAndDefs[$responseName])) { - $astAndDefs[$responseName] = []; - } - $astAndDefs[$responseName][] = [$parentType, $selection, $fieldDef]; - break; - case $selection instanceof FragmentSpreadNode: - $fragmentNames[$selection->name->value] = true; - break; - case $selection instanceof InlineFragmentNode: - $typeCondition = $selection->typeCondition; - $inlineFragmentType = $typeCondition - ? TypeInfo::typeFromAST($context->getSchema(), $typeCondition) - : $parentType; - - $this->internalCollectFieldsAndFragmentNames( - $context, - $inlineFragmentType, - $selection->selectionSet, - $astAndDefs, - $fragmentNames - ); - break; - } - } - } - - /** - * Collect all Conflicts "within" one collection of fields. - * - * @param mixed[][] $conflicts - * @param mixed[][] $fieldMap - */ - private function collectConflictsWithin( - ValidationContext $context, - array &$conflicts, - array $fieldMap - ) { - // A field map is a keyed collection, where each key represents a response - // name and the value at that key is a list of all fields which provide that - // response name. For every response name, if there are multiple fields, they - // must be compared to find a potential conflict. - foreach ($fieldMap as $responseName => $fields) { - // This compares every field in the list to every other field in this list - // (except to itself). If the list only has one item, nothing needs to - // be compared. - $fieldsLength = count($fields); - if ($fieldsLength <= 1) { - continue; - } - - for ($i = 0; $i < $fieldsLength; $i++) { - for ($j = $i + 1; $j < $fieldsLength; $j++) { - $conflict = $this->findConflict( - $context, - false, // within one collection is never mutually exclusive - $responseName, - $fields[$i], - $fields[$j] - ); - if (! $conflict) { - continue; - } - - $conflicts[] = $conflict; - } - } - } - } - - /** - * Determines if there is a conflict between two particular fields, including - * comparing their sub-fields. - * - * @param bool $parentFieldsAreMutuallyExclusive - * @param string $responseName - * @param mixed[] $field1 - * @param mixed[] $field2 - * - * @return mixed[]|null - */ - private function findConflict( - ValidationContext $context, - $parentFieldsAreMutuallyExclusive, - $responseName, - array $field1, - array $field2 - ) { - [$parentType1, $ast1, $def1] = $field1; - [$parentType2, $ast2, $def2] = $field2; - - // If it is known that two fields could not possibly apply at the same - // time, due to the parent types, then it is safe to permit them to diverge - // in aliased field or arguments used as they will not present any ambiguity - // by differing. - // It is known that two parent types could never overlap if they are - // different Object types. Interface or Union types might overlap - if not - // in the current state of the schema, then perhaps in some future version, - // thus may not safely diverge. - $areMutuallyExclusive = - $parentFieldsAreMutuallyExclusive || - ( - $parentType1 !== $parentType2 && - $parentType1 instanceof ObjectType && - $parentType2 instanceof ObjectType - ); - - // The return type for each field. - $type1 = $def1 === null ? null : $def1->getType(); - $type2 = $def2 === null ? null : $def2->getType(); - - if (! $areMutuallyExclusive) { - // Two aliases must refer to the same field. - $name1 = $ast1->name->value; - $name2 = $ast2->name->value; - if ($name1 !== $name2) { - return [ - [$responseName, sprintf('%s and %s are different fields', $name1, $name2)], - [$ast1], - [$ast2], - ]; - } - - if (! $this->sameArguments($ast1->arguments ?? [], $ast2->arguments ?? [])) { - return [ - [$responseName, 'they have differing arguments'], - [$ast1], - [$ast2], - ]; - } - } - - if ($type1 && $type2 && $this->doTypesConflict($type1, $type2)) { - return [ - [$responseName, sprintf('they return conflicting types %s and %s', $type1, $type2)], - [$ast1], - [$ast2], - ]; - } - - // Collect and compare sub-fields. Use the same "visited fragment names" list - // for both collections so fields in a fragment reference are never - // compared to themselves. - $selectionSet1 = $ast1->selectionSet; - $selectionSet2 = $ast2->selectionSet; - if ($selectionSet1 && $selectionSet2) { - $conflicts = $this->findConflictsBetweenSubSelectionSets( - $context, - $areMutuallyExclusive, - Type::getNamedType($type1), - $selectionSet1, - Type::getNamedType($type2), - $selectionSet2 - ); - - return $this->subfieldConflicts( - $conflicts, - $responseName, - $ast1, - $ast2 - ); - } - - return null; - } - - /** - * @param ArgumentNode[] $arguments1 - * @param ArgumentNode[] $arguments2 - * - * @return bool - */ - private function sameArguments($arguments1, $arguments2) - { - if (count($arguments1) !== count($arguments2)) { - return false; - } - foreach ($arguments1 as $argument1) { - $argument2 = null; - foreach ($arguments2 as $argument) { - if ($argument->name->value === $argument1->name->value) { - $argument2 = $argument; - break; - } - } - if (! $argument2) { - return false; - } - - if (! $this->sameValue($argument1->value, $argument2->value)) { - return false; - } - } - - return true; - } - - /** - * @return bool - */ - private function sameValue(Node $value1, Node $value2) - { - return (! $value1 && ! $value2) || (Printer::doPrint($value1) === Printer::doPrint($value2)); - } - - /** - * Two types conflict if both types could not apply to a value simultaneously. - * Composite types are ignored as their individual field types will be compared - * later recursively. However List and Non-Null types must match. - */ - private function doTypesConflict(Type $type1, Type $type2) : bool - { - if ($type1 instanceof ListOfType) { - return $type2 instanceof ListOfType - ? $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) - : true; - } - if ($type2 instanceof ListOfType) { - return $type1 instanceof ListOfType - ? $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) - : true; - } - if ($type1 instanceof NonNull) { - return $type2 instanceof NonNull - ? $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) - : true; - } - if ($type2 instanceof NonNull) { - return $type1 instanceof NonNull - ? $this->doTypesConflict($type1->getWrappedType(), $type2->getWrappedType()) - : true; - } - if (Type::isLeafType($type1) || Type::isLeafType($type2)) { - return $type1 !== $type2; - } - - return false; - } - - /** - * Find all conflicts found between two selection sets, including those found - * via spreading in fragments. Called when determining if conflicts exist - * between the sub-fields of two overlapping fields. - * - * @param bool $areMutuallyExclusive - * @param CompositeType $parentType1 - * @param CompositeType $parentType2 - * - * @return mixed[][] - */ - private function findConflictsBetweenSubSelectionSets( - ValidationContext $context, - $areMutuallyExclusive, - $parentType1, - SelectionSetNode $selectionSet1, - $parentType2, - SelectionSetNode $selectionSet2 - ) { - $conflicts = []; - - [$fieldMap1, $fragmentNames1] = $this->getFieldsAndFragmentNames( - $context, - $parentType1, - $selectionSet1 - ); - [$fieldMap2, $fragmentNames2] = $this->getFieldsAndFragmentNames( - $context, - $parentType2, - $selectionSet2 - ); - - // (H) First, collect all conflicts between these two collections of field. - $this->collectConflictsBetween( - $context, - $conflicts, - $areMutuallyExclusive, - $fieldMap1, - $fieldMap2 - ); - - // (I) Then collect conflicts between the first collection of fields and - // those referenced by each fragment name associated with the second. - $fragmentNames2Length = count($fragmentNames2); - if ($fragmentNames2Length !== 0) { - $comparedFragments = []; - for ($j = 0; $j < $fragmentNames2Length; $j++) { - $this->collectConflictsBetweenFieldsAndFragment( - $context, - $conflicts, - $comparedFragments, - $areMutuallyExclusive, - $fieldMap1, - $fragmentNames2[$j] - ); - } - } - - // (I) Then collect conflicts between the second collection of fields and - // those referenced by each fragment name associated with the first. - $fragmentNames1Length = count($fragmentNames1); - if ($fragmentNames1Length !== 0) { - $comparedFragments = []; - for ($i = 0; $i < $fragmentNames1Length; $i++) { - $this->collectConflictsBetweenFieldsAndFragment( - $context, - $conflicts, - $comparedFragments, - $areMutuallyExclusive, - $fieldMap2, - $fragmentNames1[$i] - ); - } - } - - // (J) Also collect conflicts between any fragment names by the first and - // fragment names by the second. This compares each item in the first set of - // names to each item in the second set of names. - for ($i = 0; $i < $fragmentNames1Length; $i++) { - for ($j = 0; $j < $fragmentNames2Length; $j++) { - $this->collectConflictsBetweenFragments( - $context, - $conflicts, - $areMutuallyExclusive, - $fragmentNames1[$i], - $fragmentNames2[$j] - ); - } - } - - return $conflicts; - } - - /** - * Collect all Conflicts between two collections of fields. This is similar to, - * but different from the `collectConflictsWithin` function above. This check - * assumes that `collectConflictsWithin` has already been called on each - * provided collection of fields. This is true because this validator traverses - * each individual selection set. - * - * @param mixed[][] $conflicts - * @param bool $parentFieldsAreMutuallyExclusive - * @param mixed[] $fieldMap1 - * @param mixed[] $fieldMap2 - */ - private function collectConflictsBetween( - ValidationContext $context, - array &$conflicts, - $parentFieldsAreMutuallyExclusive, - array $fieldMap1, - array $fieldMap2 - ) { - // A field map is a keyed collection, where each key represents a response - // name and the value at that key is a list of all fields which provide that - // response name. For any response name which appears in both provided field - // maps, each field from the first field map must be compared to every field - // in the second field map to find potential conflicts. - foreach ($fieldMap1 as $responseName => $fields1) { - if (! isset($fieldMap2[$responseName])) { - continue; - } - - $fields2 = $fieldMap2[$responseName]; - $fields1Length = count($fields1); - $fields2Length = count($fields2); - for ($i = 0; $i < $fields1Length; $i++) { - for ($j = 0; $j < $fields2Length; $j++) { - $conflict = $this->findConflict( - $context, - $parentFieldsAreMutuallyExclusive, - $responseName, - $fields1[$i], - $fields2[$j] - ); - if (! $conflict) { - continue; - } - - $conflicts[] = $conflict; - } - } - } - } - - /** - * Collect all conflicts found between a set of fields and a fragment reference - * including via spreading in any nested fragments. - * - * @param mixed[][] $conflicts - * @param bool[] $comparedFragments - * @param bool $areMutuallyExclusive - * @param mixed[][] $fieldMap - * @param string $fragmentName - */ - private function collectConflictsBetweenFieldsAndFragment( - ValidationContext $context, - array &$conflicts, - array &$comparedFragments, - $areMutuallyExclusive, - array $fieldMap, - $fragmentName - ) { - if (isset($comparedFragments[$fragmentName])) { - return; - } - $comparedFragments[$fragmentName] = true; - - $fragment = $context->getFragment($fragmentName); - if (! $fragment) { - return; - } - - [$fieldMap2, $fragmentNames2] = $this->getReferencedFieldsAndFragmentNames( - $context, - $fragment - ); - - if ($fieldMap === $fieldMap2) { - return; - } - - // (D) First collect any conflicts between the provided collection of fields - // and the collection of fields represented by the given fragment. - $this->collectConflictsBetween( - $context, - $conflicts, - $areMutuallyExclusive, - $fieldMap, - $fieldMap2 - ); - - // (E) Then collect any conflicts between the provided collection of fields - // and any fragment names found in the given fragment. - $fragmentNames2Length = count($fragmentNames2); - for ($i = 0; $i < $fragmentNames2Length; $i++) { - $this->collectConflictsBetweenFieldsAndFragment( - $context, - $conflicts, - $comparedFragments, - $areMutuallyExclusive, - $fieldMap, - $fragmentNames2[$i] - ); - } - } - - /** - * Given a reference to a fragment, return the represented collection of fields - * as well as a list of nested fragment names referenced via fragment spreads. - * - * @return mixed[]|SplObjectStorage - */ - private function getReferencedFieldsAndFragmentNames( - ValidationContext $context, - FragmentDefinitionNode $fragment - ) { - // Short-circuit building a type from the AST if possible. - if (isset($this->cachedFieldsAndFragmentNames[$fragment->selectionSet])) { - return $this->cachedFieldsAndFragmentNames[$fragment->selectionSet]; - } - - $fragmentType = TypeInfo::typeFromAST($context->getSchema(), $fragment->typeCondition); - - return $this->getFieldsAndFragmentNames( - $context, - $fragmentType, - $fragment->selectionSet - ); - } - - /** - * Collect all conflicts found between two fragments, including via spreading in - * any nested fragments. - * - * @param mixed[][] $conflicts - * @param bool $areMutuallyExclusive - * @param string $fragmentName1 - * @param string $fragmentName2 - */ - private function collectConflictsBetweenFragments( - ValidationContext $context, - array &$conflicts, - $areMutuallyExclusive, - $fragmentName1, - $fragmentName2 - ) { - // No need to compare a fragment to itself. - if ($fragmentName1 === $fragmentName2) { - return; - } - - // Memoize so two fragments are not compared for conflicts more than once. - if ($this->comparedFragmentPairs->has( - $fragmentName1, - $fragmentName2, - $areMutuallyExclusive - ) - ) { - return; - } - $this->comparedFragmentPairs->add( - $fragmentName1, - $fragmentName2, - $areMutuallyExclusive - ); - - $fragment1 = $context->getFragment($fragmentName1); - $fragment2 = $context->getFragment($fragmentName2); - if (! $fragment1 || ! $fragment2) { - return; - } - - [$fieldMap1, $fragmentNames1] = $this->getReferencedFieldsAndFragmentNames( - $context, - $fragment1 - ); - [$fieldMap2, $fragmentNames2] = $this->getReferencedFieldsAndFragmentNames( - $context, - $fragment2 - ); - - // (F) First, collect all conflicts between these two collections of fields - // (not including any nested fragments). - $this->collectConflictsBetween( - $context, - $conflicts, - $areMutuallyExclusive, - $fieldMap1, - $fieldMap2 - ); - - // (G) Then collect conflicts between the first fragment and any nested - // fragments spread in the second fragment. - $fragmentNames2Length = count($fragmentNames2); - for ($j = 0; $j < $fragmentNames2Length; $j++) { - $this->collectConflictsBetweenFragments( - $context, - $conflicts, - $areMutuallyExclusive, - $fragmentName1, - $fragmentNames2[$j] - ); - } - - // (G) Then collect conflicts between the second fragment and any nested - // fragments spread in the first fragment. - $fragmentNames1Length = count($fragmentNames1); - for ($i = 0; $i < $fragmentNames1Length; $i++) { - $this->collectConflictsBetweenFragments( - $context, - $conflicts, - $areMutuallyExclusive, - $fragmentNames1[$i], - $fragmentName2 - ); - } - } - - /** - * Given a series of Conflicts which occurred between two sub-fields, generate - * a single Conflict. - * - * @param mixed[][] $conflicts - * @param string $responseName - * - * @return mixed[]|null - */ - private function subfieldConflicts( - array $conflicts, - $responseName, - FieldNode $ast1, - FieldNode $ast2 - ) { - if (count($conflicts) === 0) { - return null; - } - - return [ - [ - $responseName, - array_map( - static function ($conflict) { - return $conflict[0]; - }, - $conflicts - ), - ], - array_reduce( - $conflicts, - static function ($allFields, $conflict) : array { - return array_merge($allFields, $conflict[1]); - }, - [$ast1] - ), - array_reduce( - $conflicts, - static function ($allFields, $conflict) : array { - return array_merge($allFields, $conflict[2]); - }, - [$ast2] - ), - ]; - } - - /** - * @param string $responseName - * @param string $reason - */ - public static function fieldsConflictMessage($responseName, $reason) - { - $reasonMessage = self::reasonMessage($reason); - - return sprintf( - 'Fields "%s" conflict because %s. Use different aliases on the fields to fetch both if this was intentional.', - $responseName, - $reasonMessage - ); - } - - public static function reasonMessage($reason) - { - if (is_array($reason)) { - $tmp = array_map( - static function ($tmp) : string { - [$responseName, $subReason] = $tmp; - - $reasonMessage = self::reasonMessage($subReason); - - return sprintf('subfields "%s" conflict because %s', $responseName, $reasonMessage); - }, - $reason - ); - - return implode(' and ', $tmp); - } - - return $reason; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php deleted file mode 100644 index 4251400b..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/PossibleFragmentSpreads.php +++ /dev/null @@ -1,160 +0,0 @@ - function (InlineFragmentNode $node) use ($context) : void { - $fragType = $context->getType(); - $parentType = $context->getParentType(); - - if (! ($fragType instanceof CompositeType) || - ! ($parentType instanceof CompositeType) || - $this->doTypesOverlap($context->getSchema(), $fragType, $parentType)) { - return; - } - - $context->reportError(new Error( - self::typeIncompatibleAnonSpreadMessage($parentType, $fragType), - [$node] - )); - }, - NodeKind::FRAGMENT_SPREAD => function (FragmentSpreadNode $node) use ($context) : void { - $fragName = $node->name->value; - $fragType = $this->getFragmentType($context, $fragName); - $parentType = $context->getParentType(); - - if (! $fragType || - ! $parentType || - $this->doTypesOverlap($context->getSchema(), $fragType, $parentType) - ) { - return; - } - - $context->reportError(new Error( - self::typeIncompatibleSpreadMessage($fragName, $parentType, $fragType), - [$node] - )); - }, - ]; - } - - private function doTypesOverlap(Schema $schema, CompositeType $fragType, CompositeType $parentType) - { - // Checking in the order of the most frequently used scenarios: - // Parent type === fragment type - if ($parentType === $fragType) { - return true; - } - - // Parent type is interface or union, fragment type is object type - if ($parentType instanceof AbstractType && $fragType instanceof ObjectType) { - return $schema->isSubType($parentType, $fragType); - } - - // Parent type is object type, fragment type is interface (or rather rare - union) - if ($parentType instanceof ObjectType && $fragType instanceof AbstractType) { - return $schema->isSubType($fragType, $parentType); - } - - // Both are object types: - if ($parentType instanceof ObjectType && $fragType instanceof ObjectType) { - return $parentType === $fragType; - } - - // Both are interfaces - // This case may be assumed valid only when implementations of two interfaces intersect - // But we don't have information about all implementations at runtime - // (getting this information via $schema->getPossibleTypes() requires scanning through whole schema - // which is very costly to do at each request due to PHP "shared nothing" architecture) - // - // So in this case we just make it pass - invalid fragment spreads will be simply ignored during execution - // See also https://github.com/webonyx/graphql-php/issues/69#issuecomment-283954602 - if ($parentType instanceof InterfaceType && $fragType instanceof InterfaceType) { - return true; - - // Note that there is one case when we do have information about all implementations: - // When schema descriptor is defined ($schema->hasDescriptor()) - // BUT we must avoid situation when some query that worked in development had suddenly stopped - // working in production. So staying consistent and always validate. - } - - // Interface within union - if ($parentType instanceof UnionType && $fragType instanceof InterfaceType) { - foreach ($parentType->getTypes() as $type) { - if ($type->implementsInterface($fragType)) { - return true; - } - } - } - - if ($parentType instanceof InterfaceType && $fragType instanceof UnionType) { - foreach ($fragType->getTypes() as $type) { - if ($type->implementsInterface($parentType)) { - return true; - } - } - } - - if ($parentType instanceof UnionType && $fragType instanceof UnionType) { - foreach ($fragType->getTypes() as $type) { - if ($parentType->isPossibleType($type)) { - return true; - } - } - } - - return false; - } - - public static function typeIncompatibleAnonSpreadMessage($parentType, $fragType) - { - return sprintf( - 'Fragment cannot be spread here as objects of type "%s" can never be of type "%s".', - $parentType, - $fragType - ); - } - - private function getFragmentType(ValidationContext $context, $name) - { - $frag = $context->getFragment($name); - if ($frag) { - $type = TypeInfo::typeFromAST($context->getSchema(), $frag->typeCondition); - if ($type instanceof CompositeType) { - return $type; - } - } - - return null; - } - - public static function typeIncompatibleSpreadMessage($fragName, $parentType, $fragType) - { - return sprintf( - 'Fragment "%s" cannot be spread here as objects of type "%s" can never be of type "%s".', - $fragName, - $parentType, - $fragType - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php deleted file mode 100644 index 77a4aa5a..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArguments.php +++ /dev/null @@ -1,62 +0,0 @@ -getVisitor($context) + [ - NodeKind::FIELD => [ - 'leave' => static function (FieldNode $fieldNode) use ($context) : ?VisitorOperation { - $fieldDef = $context->getFieldDef(); - - if (! $fieldDef) { - return Visitor::skipNode(); - } - $argNodes = $fieldNode->arguments ?? []; - - $argNodeMap = []; - foreach ($argNodes as $argNode) { - $argNodeMap[$argNode->name->value] = $argNode; - } - foreach ($fieldDef->args as $argDef) { - $argNode = $argNodeMap[$argDef->name] ?? null; - if ($argNode || ! $argDef->isRequired()) { - continue; - } - - $context->reportError(new Error( - self::missingFieldArgMessage($fieldNode->name->value, $argDef->name, $argDef->getType()), - [$fieldNode] - )); - } - - return null; - }, - ], - ]; - } - - public static function missingFieldArgMessage($fieldName, $argName, $type) - { - return sprintf( - 'Field "%s" argument "%s" of type "%s" is required but not provided.', - $fieldName, - $argName, - $type - ); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php deleted file mode 100644 index f8b34c71..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ProvidedRequiredArgumentsOnDirectives.php +++ /dev/null @@ -1,128 +0,0 @@ -getASTVisitor($context); - } - - public function getVisitor(ValidationContext $context) - { - return $this->getASTVisitor($context); - } - - public function getASTVisitor(ASTValidationContext $context) - { - $requiredArgsMap = []; - $schema = $context->getSchema(); - $definedDirectives = $schema - ? $schema->getDirectives() - : Directive::getInternalDirectives(); - - foreach ($definedDirectives as $directive) { - $requiredArgsMap[$directive->name] = Utils::keyMap( - array_filter($directive->args, static function (FieldArgument $arg) : bool { - return $arg->isRequired(); - }), - static function (FieldArgument $arg) : string { - return $arg->name; - } - ); - } - - $astDefinition = $context->getDocument()->definitions; - foreach ($astDefinition as $def) { - if (! ($def instanceof DirectiveDefinitionNode)) { - continue; - } - $arguments = $def->arguments ?? []; - - $requiredArgsMap[$def->name->value] = Utils::keyMap( - Utils::filter($arguments, static function (InputValueDefinitionNode $argument) : bool { - return $argument->type instanceof NonNullTypeNode && - ( - ! isset($argument->defaultValue) || - $argument->defaultValue === null - ); - }), - static function (InputValueDefinitionNode $argument) : string { - return $argument->name->value; - } - ); - } - - return [ - NodeKind::DIRECTIVE => [ - // Validate on leave to allow for deeper errors to appear first. - 'leave' => static function (DirectiveNode $directiveNode) use ($requiredArgsMap, $context) : ?string { - $directiveName = $directiveNode->name->value; - $requiredArgs = $requiredArgsMap[$directiveName] ?? null; - if (! $requiredArgs) { - return null; - } - - $argNodes = $directiveNode->arguments ?? []; - $argNodeMap = Utils::keyMap( - $argNodes, - static function (ArgumentNode $arg) : string { - return $arg->name->value; - } - ); - - foreach ($requiredArgs as $argName => $arg) { - if (isset($argNodeMap[$argName])) { - continue; - } - - if ($arg instanceof FieldArgument) { - $argType = (string) $arg->getType(); - } elseif ($arg instanceof InputValueDefinitionNode) { - $argType = Printer::doPrint($arg->type); - } else { - $argType = ''; - } - - $context->reportError( - new Error(static::missingDirectiveArgMessage($directiveName, $argName, $argType), [$directiveNode]) - ); - } - - return null; - }, - ], - ]; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php deleted file mode 100644 index 1a1eb4bd..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryComplexity.php +++ /dev/null @@ -1,300 +0,0 @@ -setMaxQueryComplexity($maxQueryComplexity); - } - - public function getVisitor(ValidationContext $context) - { - $this->context = $context; - - $this->variableDefs = new ArrayObject(); - $this->fieldNodeAndDefs = new ArrayObject(); - $this->complexity = 0; - - return $this->invokeIfNeeded( - $context, - [ - NodeKind::SELECTION_SET => function (SelectionSetNode $selectionSet) use ($context) : void { - $this->fieldNodeAndDefs = $this->collectFieldASTsAndDefs( - $context, - $context->getParentType(), - $selectionSet, - null, - $this->fieldNodeAndDefs - ); - }, - NodeKind::VARIABLE_DEFINITION => function ($def) : VisitorOperation { - $this->variableDefs[] = $def; - - return Visitor::skipNode(); - }, - NodeKind::OPERATION_DEFINITION => [ - 'leave' => function (OperationDefinitionNode $operationDefinition) use ($context, &$complexity) : void { - $errors = $context->getErrors(); - - if (count($errors) > 0) { - return; - } - - $this->complexity = $this->fieldComplexity($operationDefinition, $complexity); - - if ($this->getQueryComplexity() <= $this->getMaxQueryComplexity()) { - return; - } - - $context->reportError( - new Error(self::maxQueryComplexityErrorMessage( - $this->getMaxQueryComplexity(), - $this->getQueryComplexity() - )) - ); - }, - ], - ] - ); - } - - private function fieldComplexity($node, $complexity = 0) - { - if (isset($node->selectionSet) && $node->selectionSet instanceof SelectionSetNode) { - foreach ($node->selectionSet->selections as $childNode) { - $complexity = $this->nodeComplexity($childNode, $complexity); - } - } - - return $complexity; - } - - private function nodeComplexity(Node $node, $complexity = 0) - { - switch (true) { - case $node instanceof FieldNode: - // default values - $args = []; - $complexityFn = FieldDefinition::DEFAULT_COMPLEXITY_FN; - - // calculate children complexity if needed - $childrenComplexity = 0; - - // node has children? - if (isset($node->selectionSet)) { - $childrenComplexity = $this->fieldComplexity($node); - } - - $astFieldInfo = $this->astFieldInfo($node); - $fieldDef = $astFieldInfo[1]; - - if ($fieldDef instanceof FieldDefinition) { - if ($this->directiveExcludesField($node)) { - break; - } - - $args = $this->buildFieldArguments($node); - //get complexity fn using fieldDef complexity - if (method_exists($fieldDef, 'getComplexityFn')) { - $complexityFn = $fieldDef->getComplexityFn(); - } - } - - $complexity += $complexityFn($childrenComplexity, $args); - break; - - case $node instanceof InlineFragmentNode: - // node has children? - if (isset($node->selectionSet)) { - $complexity = $this->fieldComplexity($node, $complexity); - } - break; - - case $node instanceof FragmentSpreadNode: - $fragment = $this->getFragment($node); - - if ($fragment !== null) { - $complexity = $this->fieldComplexity($fragment, $complexity); - } - break; - } - - return $complexity; - } - - private function astFieldInfo(FieldNode $field) - { - $fieldName = $this->getFieldName($field); - $astFieldInfo = [null, null]; - if (isset($this->fieldNodeAndDefs[$fieldName])) { - foreach ($this->fieldNodeAndDefs[$fieldName] as $astAndDef) { - if ($astAndDef[0] === $field) { - $astFieldInfo = $astAndDef; - break; - } - } - } - - return $astFieldInfo; - } - - private function directiveExcludesField(FieldNode $node) - { - foreach ($node->directives as $directiveNode) { - if ($directiveNode->name->value === 'deprecated') { - return false; - } - [$errors, $variableValues] = Values::getVariableValues( - $this->context->getSchema(), - $this->variableDefs, - $this->getRawVariableValues() - ); - if (count($errors ?? []) > 0) { - throw new Error(implode( - "\n\n", - array_map( - static function ($error) { - return $error->getMessage(); - }, - $errors - ) - )); - } - if ($directiveNode->name->value === 'include') { - $directive = Directive::includeDirective(); - /** @var bool $directiveArgsIf */ - $directiveArgsIf = Values::getArgumentValues($directive, $directiveNode, $variableValues)['if']; - - return ! $directiveArgsIf; - } - if ($directiveNode->name->value === Directive::SKIP_NAME) { - $directive = Directive::skipDirective(); - /** @var bool $directiveArgsIf */ - $directiveArgsIf = Values::getArgumentValues($directive, $directiveNode, $variableValues)['if']; - - return $directiveArgsIf; - } - } - - return false; - } - - public function getRawVariableValues() - { - return $this->rawVariableValues; - } - - /** - * @param mixed[]|null $rawVariableValues - */ - public function setRawVariableValues(?array $rawVariableValues = null) - { - $this->rawVariableValues = $rawVariableValues ?? []; - } - - private function buildFieldArguments(FieldNode $node) - { - $rawVariableValues = $this->getRawVariableValues(); - $astFieldInfo = $this->astFieldInfo($node); - $fieldDef = $astFieldInfo[1]; - - $args = []; - - if ($fieldDef instanceof FieldDefinition) { - [$errors, $variableValues] = Values::getVariableValues( - $this->context->getSchema(), - $this->variableDefs, - $rawVariableValues - ); - - if (count($errors ?? []) > 0) { - throw new Error(implode( - "\n\n", - array_map( - static function ($error) { - return $error->getMessage(); - }, - $errors - ) - )); - } - - $args = Values::getArgumentValues($fieldDef, $node, $variableValues); - } - - return $args; - } - - public function getQueryComplexity() - { - return $this->complexity; - } - - public function getMaxQueryComplexity() - { - return $this->maxQueryComplexity; - } - - /** - * Set max query complexity. If equal to 0 no check is done. Must be greater or equal to 0. - */ - public function setMaxQueryComplexity($maxQueryComplexity) - { - $this->checkIfGreaterOrEqualToZero('maxQueryComplexity', $maxQueryComplexity); - - $this->maxQueryComplexity = (int) $maxQueryComplexity; - } - - public static function maxQueryComplexityErrorMessage($max, $count) - { - return sprintf('Max query complexity should be %d but got %d.', $max, $count); - } - - protected function isEnabled() - { - return $this->getMaxQueryComplexity() !== self::DISABLED; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php deleted file mode 100644 index 9b83d061..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QueryDepth.php +++ /dev/null @@ -1,118 +0,0 @@ -setMaxQueryDepth($maxQueryDepth); - } - - public function getVisitor(ValidationContext $context) - { - return $this->invokeIfNeeded( - $context, - [ - NodeKind::OPERATION_DEFINITION => [ - 'leave' => function (OperationDefinitionNode $operationDefinition) use ($context) : void { - $maxDepth = $this->fieldDepth($operationDefinition); - - if ($maxDepth <= $this->getMaxQueryDepth()) { - return; - } - - $context->reportError( - new Error(self::maxQueryDepthErrorMessage($this->getMaxQueryDepth(), $maxDepth)) - ); - }, - ], - ] - ); - } - - private function fieldDepth($node, $depth = 0, $maxDepth = 0) - { - if (isset($node->selectionSet) && $node->selectionSet instanceof SelectionSetNode) { - foreach ($node->selectionSet->selections as $childNode) { - $maxDepth = $this->nodeDepth($childNode, $depth, $maxDepth); - } - } - - return $maxDepth; - } - - private function nodeDepth(Node $node, $depth = 0, $maxDepth = 0) - { - switch (true) { - case $node instanceof FieldNode: - // node has children? - if ($node->selectionSet !== null) { - // update maxDepth if needed - if ($depth > $maxDepth) { - $maxDepth = $depth; - } - $maxDepth = $this->fieldDepth($node, $depth + 1, $maxDepth); - } - break; - - case $node instanceof InlineFragmentNode: - // node has children? - if ($node->selectionSet !== null) { - $maxDepth = $this->fieldDepth($node, $depth, $maxDepth); - } - break; - - case $node instanceof FragmentSpreadNode: - $fragment = $this->getFragment($node); - - if ($fragment !== null) { - $maxDepth = $this->fieldDepth($fragment, $depth, $maxDepth); - } - break; - } - - return $maxDepth; - } - - public function getMaxQueryDepth() - { - return $this->maxQueryDepth; - } - - /** - * Set max query depth. If equal to 0 no check is done. Must be greater or equal to 0. - */ - public function setMaxQueryDepth($maxQueryDepth) - { - $this->checkIfGreaterOrEqualToZero('maxQueryDepth', $maxQueryDepth); - - $this->maxQueryDepth = (int) $maxQueryDepth; - } - - public static function maxQueryDepthErrorMessage($max, $count) - { - return sprintf('Max query depth should be %d but got %d.', $max, $count); - } - - protected function isEnabled() - { - return $this->getMaxQueryDepth() !== self::DISABLED; - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php deleted file mode 100644 index dcb76e99..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/QuerySecurityRule.php +++ /dev/null @@ -1,184 +0,0 @@ -name->value; - $fragments = $this->getFragments(); - - return $fragments[$spreadName] ?? null; - } - - /** - * @return FragmentDefinitionNode[] - */ - protected function getFragments() - { - return $this->fragments; - } - - /** - * @param callable[] $validators - * - * @return callable[] - */ - protected function invokeIfNeeded(ValidationContext $context, array $validators) - { - // is disabled? - if (! $this->isEnabled()) { - return []; - } - - $this->gatherFragmentDefinition($context); - - return $validators; - } - - abstract protected function isEnabled(); - - protected function gatherFragmentDefinition(ValidationContext $context) - { - // Gather all the fragment definition. - // Importantly this does not include inline fragments. - $definitions = $context->getDocument()->definitions; - foreach ($definitions as $node) { - if (! ($node instanceof FragmentDefinitionNode)) { - continue; - } - - $this->fragments[$node->name->value] = $node; - } - } - - /** - * Given a selectionSet, adds all of the fields in that selection to - * the passed in map of fields, and returns it at the end. - * - * Note: This is not the same as execution's collectFields because at static - * time we do not know what object type will be used, so we unconditionally - * spread in all fragments. - * - * @see \GraphQL\Validator\Rules\OverlappingFieldsCanBeMerged - * - * @param Type|null $parentType - * - * @return ArrayObject - */ - protected function collectFieldASTsAndDefs( - ValidationContext $context, - $parentType, - SelectionSetNode $selectionSet, - ?ArrayObject $visitedFragmentNames = null, - ?ArrayObject $astAndDefs = null - ) { - $_visitedFragmentNames = $visitedFragmentNames ?? new ArrayObject(); - $_astAndDefs = $astAndDefs ?? new ArrayObject(); - - foreach ($selectionSet->selections as $selection) { - switch (true) { - case $selection instanceof FieldNode: - $fieldName = $selection->name->value; - $fieldDef = null; - if ($parentType instanceof HasFieldsType || $parentType instanceof InputObjectType) { - $schemaMetaFieldDef = Introspection::schemaMetaFieldDef(); - $typeMetaFieldDef = Introspection::typeMetaFieldDef(); - $typeNameMetaFieldDef = Introspection::typeNameMetaFieldDef(); - - if ($fieldName === $schemaMetaFieldDef->name && $context->getSchema()->getQueryType() === $parentType) { - $fieldDef = $schemaMetaFieldDef; - } elseif ($fieldName === $typeMetaFieldDef->name && $context->getSchema()->getQueryType() === $parentType) { - $fieldDef = $typeMetaFieldDef; - } elseif ($fieldName === $typeNameMetaFieldDef->name) { - $fieldDef = $typeNameMetaFieldDef; - } elseif ($parentType->hasField($fieldName)) { - $fieldDef = $parentType->getField($fieldName); - } - } - $responseName = $this->getFieldName($selection); - if (! isset($_astAndDefs[$responseName])) { - $_astAndDefs[$responseName] = new ArrayObject(); - } - // create field context - $_astAndDefs[$responseName][] = [$selection, $fieldDef]; - break; - case $selection instanceof InlineFragmentNode: - $_astAndDefs = $this->collectFieldASTsAndDefs( - $context, - TypeInfo::typeFromAST($context->getSchema(), $selection->typeCondition), - $selection->selectionSet, - $_visitedFragmentNames, - $_astAndDefs - ); - break; - case $selection instanceof FragmentSpreadNode: - $fragName = $selection->name->value; - - if (! ($_visitedFragmentNames[$fragName] ?? false)) { - $_visitedFragmentNames[$fragName] = true; - $fragment = $context->getFragment($fragName); - - if ($fragment) { - $_astAndDefs = $this->collectFieldASTsAndDefs( - $context, - TypeInfo::typeFromAST($context->getSchema(), $fragment->typeCondition), - $fragment->selectionSet, - $_visitedFragmentNames, - $_astAndDefs - ); - } - } - break; - } - } - - return $_astAndDefs; - } - - protected function getFieldName(FieldNode $node) - { - $fieldName = $node->name->value; - - return $node->alias ? $node->alias->value : $fieldName; - } -} - -class_alias(QuerySecurityRule::class, 'GraphQL\Validator\Rules\AbstractQuerySecurity'); diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php deleted file mode 100644 index f1714239..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ScalarLeafs.php +++ /dev/null @@ -1,51 +0,0 @@ - static function (FieldNode $node) use ($context) : void { - $type = $context->getType(); - if (! $type) { - return; - } - - if (Type::isLeafType(Type::getNamedType($type))) { - if ($node->selectionSet) { - $context->reportError(new Error( - self::noSubselectionAllowedMessage($node->name->value, $type), - [$node->selectionSet] - )); - } - } elseif (! $node->selectionSet) { - $context->reportError(new Error( - self::requiredSubselectionMessage($node->name->value, $type), - [$node] - )); - } - }, - ]; - } - - public static function noSubselectionAllowedMessage($field, $type) - { - return sprintf('Field "%s" of type "%s" must not have a sub selection.', $field, $type); - } - - public static function requiredSubselectionMessage($field, $type) - { - return sprintf('Field "%s" of type "%s" must have a sub selection.', $field, $type); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php deleted file mode 100644 index b98ee95e..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/SingleFieldSubscription.php +++ /dev/null @@ -1,57 +0,0 @@ - - */ - public function getVisitor(ValidationContext $context) : array - { - return [ - NodeKind::OPERATION_DEFINITION => static function (OperationDefinitionNode $node) use ($context) : VisitorOperation { - if ($node->operation === 'subscription') { - $selections = $node->selectionSet->selections; - - if (count($selections) !== 1) { - if ($selections instanceof NodeList) { - $offendingSelections = $selections->splice(1, count($selections)); - } else { - $offendingSelections = array_splice($selections, 1); - } - - $context->reportError(new Error( - self::multipleFieldsInOperation($node->name->value ?? null), - $offendingSelections - )); - } - } - - return Visitor::skipNode(); - }, - ]; - } - - public static function multipleFieldsInOperation(?string $operationName) : string - { - if ($operationName === null) { - return sprintf('Anonymous Subscription must select only one top level field.'); - } - - return sprintf('Subscription "%s" must select only one top level field.', $operationName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php deleted file mode 100644 index 58daecf6..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueArgumentNames.php +++ /dev/null @@ -1,64 +0,0 @@ -getASTVisitor($context); - } - - public function getVisitor(ValidationContext $context) - { - return $this->getASTVisitor($context); - } - - public function getASTVisitor(ASTValidationContext $context) - { - $this->knownArgNames = []; - - return [ - NodeKind::FIELD => function () : void { - $this->knownArgNames = []; - }, - NodeKind::DIRECTIVE => function () : void { - $this->knownArgNames = []; - }, - NodeKind::ARGUMENT => function (ArgumentNode $node) use ($context) : VisitorOperation { - $argName = $node->name->value; - if ($this->knownArgNames[$argName] ?? false) { - $context->reportError(new Error( - self::duplicateArgMessage($argName), - [$this->knownArgNames[$argName], $node->name] - )); - } else { - $this->knownArgNames[$argName] = $node->name; - } - - return Visitor::skipNode(); - }, - ]; - } - - public static function duplicateArgMessage($argName) - { - return sprintf('There can be only one argument named "%s".', $argName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php deleted file mode 100644 index cbada229..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueDirectivesPerLocation.php +++ /dev/null @@ -1,96 +0,0 @@ -getASTVisitor($context); - } - - public function getSDLVisitor(SDLValidationContext $context) - { - return $this->getASTVisitor($context); - } - - public function getASTVisitor(ASTValidationContext $context) - { - /** @var array $uniqueDirectiveMap */ - $uniqueDirectiveMap = []; - - $schema = $context->getSchema(); - $definedDirectives = $schema !== null - ? $schema->getDirectives() - : Directive::getInternalDirectives(); - foreach ($definedDirectives as $directive) { - if ($directive->isRepeatable) { - continue; - } - - $uniqueDirectiveMap[$directive->name] = true; - } - - $astDefinitions = $context->getDocument()->definitions; - foreach ($astDefinitions as $definition) { - if (! ($definition instanceof DirectiveDefinitionNode) - || $definition->repeatable - ) { - continue; - } - - $uniqueDirectiveMap[$definition->name->value] = true; - } - - return [ - 'enter' => static function (Node $node) use ($uniqueDirectiveMap, $context) : void { - if (! isset($node->directives)) { - return; - } - - $knownDirectives = []; - - /** @var DirectiveNode $directive */ - foreach ($node->directives as $directive) { - $directiveName = $directive->name->value; - - if (! isset($uniqueDirectiveMap[$directiveName])) { - continue; - } - - if (isset($knownDirectives[$directiveName])) { - $context->reportError(new Error( - self::duplicateDirectiveMessage($directiveName), - [$knownDirectives[$directiveName], $directive] - )); - } else { - $knownDirectives[$directiveName] = $directive; - } - } - }, - ]; - } - - public static function duplicateDirectiveMessage($directiveName) - { - return sprintf('The directive "%s" can only be used once at this location.', $directiveName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php deleted file mode 100644 index e9dba8a9..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueFragmentNames.php +++ /dev/null @@ -1,49 +0,0 @@ -knownFragmentNames = []; - - return [ - NodeKind::OPERATION_DEFINITION => static function () : VisitorOperation { - return Visitor::skipNode(); - }, - NodeKind::FRAGMENT_DEFINITION => function (FragmentDefinitionNode $node) use ($context) : VisitorOperation { - $fragmentName = $node->name->value; - if (! isset($this->knownFragmentNames[$fragmentName])) { - $this->knownFragmentNames[$fragmentName] = $node->name; - } else { - $context->reportError(new Error( - self::duplicateFragmentNameMessage($fragmentName), - [$this->knownFragmentNames[$fragmentName], $node->name] - )); - } - - return Visitor::skipNode(); - }, - ]; - } - - public static function duplicateFragmentNameMessage($fragName) - { - return sprintf('There can be only one fragment named "%s".', $fragName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php deleted file mode 100644 index 541a3729..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueInputFieldNames.php +++ /dev/null @@ -1,73 +0,0 @@ - */ - public $knownNames; - - /** @var array> */ - public $knownNameStack; - - public function getVisitor(ValidationContext $context) - { - return $this->getASTVisitor($context); - } - - public function getSDLVisitor(SDLValidationContext $context) - { - return $this->getASTVisitor($context); - } - - public function getASTVisitor(ASTValidationContext $context) - { - $this->knownNames = []; - $this->knownNameStack = []; - - return [ - NodeKind::OBJECT => [ - 'enter' => function () : void { - $this->knownNameStack[] = $this->knownNames; - $this->knownNames = []; - }, - 'leave' => function () : void { - $this->knownNames = array_pop($this->knownNameStack); - }, - ], - NodeKind::OBJECT_FIELD => function (ObjectFieldNode $node) use ($context) : VisitorOperation { - $fieldName = $node->name->value; - - if (isset($this->knownNames[$fieldName])) { - $context->reportError(new Error( - self::duplicateInputFieldMessage($fieldName), - [$this->knownNames[$fieldName], $node->name] - )); - } else { - $this->knownNames[$fieldName] = $node->name; - } - - return Visitor::skipNode(); - }, - ]; - } - - public static function duplicateInputFieldMessage($fieldName) - { - return sprintf('There can be only one input field named "%s".', $fieldName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php deleted file mode 100644 index c4a0777f..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueOperationNames.php +++ /dev/null @@ -1,52 +0,0 @@ -knownOperationNames = []; - - return [ - NodeKind::OPERATION_DEFINITION => function (OperationDefinitionNode $node) use ($context) : VisitorOperation { - $operationName = $node->name; - - if ($operationName !== null) { - if (! isset($this->knownOperationNames[$operationName->value])) { - $this->knownOperationNames[$operationName->value] = $operationName; - } else { - $context->reportError(new Error( - self::duplicateOperationNameMessage($operationName->value), - [$this->knownOperationNames[$operationName->value], $operationName] - )); - } - } - - return Visitor::skipNode(); - }, - NodeKind::FRAGMENT_DEFINITION => static function () : VisitorOperation { - return Visitor::skipNode(); - }, - ]; - } - - public static function duplicateOperationNameMessage($operationName) - { - return sprintf('There can be only one operation named "%s".', $operationName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php deleted file mode 100644 index f6db14e6..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/UniqueVariableNames.php +++ /dev/null @@ -1,45 +0,0 @@ -knownVariableNames = []; - - return [ - NodeKind::OPERATION_DEFINITION => function () : void { - $this->knownVariableNames = []; - }, - NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $node) use ($context) : void { - $variableName = $node->variable->name->value; - if (! isset($this->knownVariableNames[$variableName])) { - $this->knownVariableNames[$variableName] = $node->variable->name; - } else { - $context->reportError(new Error( - self::duplicateVariableMessage($variableName), - [$this->knownVariableNames[$variableName], $node->variable->name] - )); - } - }, - ]; - } - - public static function duplicateVariableMessage($variableName) - { - return sprintf('There can be only one variable named "%s".', $variableName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php deleted file mode 100644 index 461aafee..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValidationRule.php +++ /dev/null @@ -1,51 +0,0 @@ -name === '' || $this->name === null ? static::class : $this->name; - } - - public function __invoke(ValidationContext $context) - { - return $this->getVisitor($context); - } - - /** - * Returns structure suitable for GraphQL\Language\Visitor - * - * @see \GraphQL\Language\Visitor - * - * @return mixed[] - */ - public function getVisitor(ValidationContext $context) - { - return []; - } - - /** - * Returns structure suitable for GraphQL\Language\Visitor - * - * @see \GraphQL\Language\Visitor - * - * @return mixed[] - */ - public function getSDLVisitor(SDLValidationContext $context) - { - return []; - } -} - -class_alias(ValidationRule::class, 'GraphQL\Validator\Rules\AbstractValidationRule'); diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php deleted file mode 100644 index 6f977d52..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/ValuesOfCorrectType.php +++ /dev/null @@ -1,290 +0,0 @@ - [ - 'enter' => static function (FieldNode $node) use (&$fieldName) : void { - $fieldName = $node->name->value; - }, - ], - NodeKind::NULL => static function (NullValueNode $node) use ($context, &$fieldName) : void { - $type = $context->getInputType(); - if (! ($type instanceof NonNull)) { - return; - } - - $context->reportError( - new Error( - self::getBadValueMessage((string) $type, Printer::doPrint($node), null, $context, $fieldName), - $node - ) - ); - }, - NodeKind::LST => function (ListValueNode $node) use ($context, &$fieldName) : ?VisitorOperation { - // Note: TypeInfo will traverse into a list's item type, so look to the - // parent input type to check if it is a list. - $type = Type::getNullableType($context->getParentInputType()); - if (! $type instanceof ListOfType) { - $this->isValidScalar($context, $node, $fieldName); - - return Visitor::skipNode(); - } - - return null; - }, - NodeKind::OBJECT => function (ObjectValueNode $node) use ($context, &$fieldName) : ?VisitorOperation { - // Note: TypeInfo will traverse into a list's item type, so look to the - // parent input type to check if it is a list. - $type = Type::getNamedType($context->getInputType()); - if (! $type instanceof InputObjectType) { - $this->isValidScalar($context, $node, $fieldName); - - return Visitor::skipNode(); - } - unset($fieldName); - // Ensure every required field exists. - $inputFields = $type->getFields(); - $nodeFields = iterator_to_array($node->fields); - $fieldNodeMap = array_combine( - array_map( - static function ($field) : string { - return $field->name->value; - }, - $nodeFields - ), - array_values($nodeFields) - ); - foreach ($inputFields as $fieldName => $fieldDef) { - $fieldType = $fieldDef->getType(); - if (isset($fieldNodeMap[$fieldName]) || ! $fieldDef->isRequired()) { - continue; - } - - $context->reportError( - new Error( - self::requiredFieldMessage($type->name, $fieldName, (string) $fieldType), - $node - ) - ); - } - - return null; - }, - NodeKind::OBJECT_FIELD => static function (ObjectFieldNode $node) use ($context) : void { - $parentType = Type::getNamedType($context->getParentInputType()); - /** @var ScalarType|EnumType|InputObjectType|ListOfType|NonNull $fieldType */ - $fieldType = $context->getInputType(); - if ($fieldType || ! ($parentType instanceof InputObjectType)) { - return; - } - - $suggestions = Utils::suggestionList( - $node->name->value, - array_keys($parentType->getFields()) - ); - $didYouMean = $suggestions - ? 'Did you mean ' . Utils::orList($suggestions) . '?' - : null; - - $context->reportError( - new Error( - self::unknownFieldMessage($parentType->name, $node->name->value, $didYouMean), - $node - ) - ); - }, - NodeKind::ENUM => function (EnumValueNode $node) use ($context, &$fieldName) : void { - $type = Type::getNamedType($context->getInputType()); - if (! $type instanceof EnumType) { - $this->isValidScalar($context, $node, $fieldName); - } elseif (! $type->getValue($node->value)) { - $context->reportError( - new Error( - self::getBadValueMessage( - $type->name, - Printer::doPrint($node), - $this->enumTypeSuggestion($type, $node), - $context, - $fieldName - ), - $node - ) - ); - } - }, - NodeKind::INT => function (IntValueNode $node) use ($context, &$fieldName) : void { - $this->isValidScalar($context, $node, $fieldName); - }, - NodeKind::FLOAT => function (FloatValueNode $node) use ($context, &$fieldName) : void { - $this->isValidScalar($context, $node, $fieldName); - }, - NodeKind::STRING => function (StringValueNode $node) use ($context, &$fieldName) : void { - $this->isValidScalar($context, $node, $fieldName); - }, - NodeKind::BOOLEAN => function (BooleanValueNode $node) use ($context, &$fieldName) : void { - $this->isValidScalar($context, $node, $fieldName); - }, - ]; - } - - public static function badValueMessage($typeName, $valueName, $message = null) - { - return sprintf('Expected type %s, found %s', $typeName, $valueName) . - ($message ? "; {$message}" : '.'); - } - - /** - * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $node - */ - private function isValidScalar(ValidationContext $context, ValueNode $node, $fieldName) - { - // Report any error at the full type expected by the location. - /** @var ScalarType|EnumType|InputObjectType|ListOfType|NonNull $locationType */ - $locationType = $context->getInputType(); - - if (! $locationType) { - return; - } - - $type = Type::getNamedType($locationType); - - if (! $type instanceof ScalarType) { - $context->reportError( - new Error( - self::getBadValueMessage( - (string) $locationType, - Printer::doPrint($node), - $this->enumTypeSuggestion($type, $node), - $context, - $fieldName - ), - $node - ) - ); - - return; - } - - // Scalars determine if a literal value is valid via parseLiteral() which - // may throw to indicate failure. - try { - $type->parseLiteral($node); - } catch (Throwable $error) { - // Ensure a reference to the original error is maintained. - $context->reportError( - new Error( - self::getBadValueMessage( - (string) $locationType, - Printer::doPrint($node), - $error->getMessage(), - $context, - $fieldName - ), - $node, - null, - [], - null, - $error - ) - ); - } - } - - /** - * @param VariableNode|NullValueNode|IntValueNode|FloatValueNode|StringValueNode|BooleanValueNode|EnumValueNode|ListValueNode|ObjectValueNode $node - */ - private function enumTypeSuggestion($type, ValueNode $node) - { - if ($type instanceof EnumType) { - $suggestions = Utils::suggestionList( - Printer::doPrint($node), - array_map( - static function (EnumValueDefinition $value) : string { - return $value->name; - }, - $type->getValues() - ) - ); - - return $suggestions ? 'Did you mean the enum value ' . Utils::orList($suggestions) . '?' : null; - } - } - - public static function badArgumentValueMessage($typeName, $valueName, $fieldName, $argName, $message = null) - { - return sprintf('Field "%s" argument "%s" requires type %s, found %s', $fieldName, $argName, $typeName, $valueName) . - ($message ? sprintf('; %s', $message) : '.'); - } - - public static function requiredFieldMessage($typeName, $fieldName, $fieldTypeName) - { - return sprintf('Field %s.%s of required type %s was not provided.', $typeName, $fieldName, $fieldTypeName); - } - - public static function unknownFieldMessage($typeName, $fieldName, $message = null) - { - return sprintf('Field "%s" is not defined by type %s', $fieldName, $typeName) . - ($message ? sprintf('; %s', $message) : '.'); - } - - private static function getBadValueMessage($typeName, $valueName, $message = null, $context = null, $fieldName = null) - { - if ($context) { - $arg = $context->getArgument(); - if ($arg) { - return self::badArgumentValueMessage($typeName, $valueName, $fieldName, $arg->name, $message); - } - } - - return self::badValueMessage($typeName, $valueName, $message); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php deleted file mode 100644 index a1daafff..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesAreInputTypes.php +++ /dev/null @@ -1,42 +0,0 @@ - static function (VariableDefinitionNode $node) use ($context) : void { - $type = TypeInfo::typeFromAST($context->getSchema(), $node->type); - - // If the variable type is not an input type, return an error. - if (! $type || Type::isInputType($type)) { - return; - } - - $variableName = $node->variable->name->value; - $context->reportError(new Error( - self::nonInputTypeOnVarMessage($variableName, Printer::doPrint($node->type)), - [$node->type] - )); - }, - ]; - } - - public static function nonInputTypeOnVarMessage($variableName, $typeName) - { - return sprintf('Variable "$%s" cannot be non-input type "%s".', $variableName, $typeName); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php deleted file mode 100644 index 717bd656..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/Rules/VariablesInAllowedPosition.php +++ /dev/null @@ -1,116 +0,0 @@ - [ - 'enter' => function () : void { - $this->varDefMap = []; - }, - 'leave' => function (OperationDefinitionNode $operation) use ($context) : void { - $usages = $context->getRecursiveVariableUsages($operation); - - foreach ($usages as $usage) { - $node = $usage['node']; - $type = $usage['type']; - $defaultValue = $usage['defaultValue']; - $varName = $node->name->value; - $varDef = $this->varDefMap[$varName] ?? null; - - if ($varDef === null || $type === null) { - continue; - } - - // A var type is allowed if it is the same or more strict (e.g. is - // a subtype of) than the expected type. It can be more strict if - // the variable type is non-null when the expected type is nullable. - // If both are list types, the variable item type can be more strict - // than the expected item type (contravariant). - $schema = $context->getSchema(); - $varType = TypeInfo::typeFromAST($schema, $varDef->type); - - if (! $varType || $this->allowedVariableUsage($schema, $varType, $varDef->defaultValue, $type, $defaultValue)) { - continue; - } - - $context->reportError(new Error( - self::badVarPosMessage($varName, $varType, $type), - [$varDef, $node] - )); - } - }, - ], - NodeKind::VARIABLE_DEFINITION => function (VariableDefinitionNode $varDefNode) : void { - $this->varDefMap[$varDefNode->variable->name->value] = $varDefNode; - }, - ]; - } - - /** - * A var type is allowed if it is the same or more strict than the expected - * type. It can be more strict if the variable type is non-null when the - * expected type is nullable. If both are list types, the variable item type can - * be more strict than the expected item type. - */ - public static function badVarPosMessage($varName, $varType, $expectedType) - { - return sprintf( - 'Variable "$%s" of type "%s" used in position expecting type "%s".', - $varName, - $varType, - $expectedType - ); - } - - /** - * Returns true if the variable is allowed in the location it was found, - * which includes considering if default values exist for either the variable - * or the location at which it is located. - * - * @param ValueNode|null $varDefaultValue - * @param mixed $locationDefaultValue - */ - private function allowedVariableUsage(Schema $schema, Type $varType, $varDefaultValue, Type $locationType, $locationDefaultValue) : bool - { - if ($locationType instanceof NonNull && ! $varType instanceof NonNull) { - $hasNonNullVariableDefaultValue = $varDefaultValue && ! $varDefaultValue instanceof NullValueNode; - $hasLocationDefaultValue = ! Utils::isInvalid($locationDefaultValue); - if (! $hasNonNullVariableDefaultValue && ! $hasLocationDefaultValue) { - return false; - } - $nullableLocationType = $locationType->getWrappedType(); - - return TypeComparators::isTypeSubTypeOf($schema, $varType, $nullableLocationType); - } - - return TypeComparators::isTypeSubTypeOf($schema, $varType, $locationType); - } -} diff --git a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/SDLValidationContext.php b/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/SDLValidationContext.php deleted file mode 100644 index 379515e2..00000000 --- a/lib/wp-graphql-1.17.0/vendor/webonyx/graphql-php/src/Validator/SDLValidationContext.php +++ /dev/null @@ -1,9 +0,0 @@ -typeInfo = $typeInfo; - $this->fragmentSpreads = new SplObjectStorage(); - $this->recursivelyReferencedFragments = new SplObjectStorage(); - $this->variableUsages = new SplObjectStorage(); - $this->recursiveVariableUsages = new SplObjectStorage(); - } - - /** - * @return mixed[][] List of ['node' => VariableNode, 'type' => ?InputObjectType] - */ - public function getRecursiveVariableUsages(OperationDefinitionNode $operation) - { - $usages = $this->recursiveVariableUsages[$operation] ?? null; - - if ($usages === null) { - $usages = $this->getVariableUsages($operation); - $fragments = $this->getRecursivelyReferencedFragments($operation); - - $allUsages = [$usages]; - foreach ($fragments as $fragment) { - $allUsages[] = $this->getVariableUsages($fragment); - } - $usages = array_merge(...$allUsages); - $this->recursiveVariableUsages[$operation] = $usages; - } - - return $usages; - } - - /** - * @return mixed[][] List of ['node' => VariableNode, 'type' => ?InputObjectType] - */ - private function getVariableUsages(HasSelectionSet $node) - { - $usages = $this->variableUsages[$node] ?? null; - - if ($usages === null) { - $newUsages = []; - $typeInfo = new TypeInfo($this->schema); - Visitor::visit( - $node, - Visitor::visitWithTypeInfo( - $typeInfo, - [ - NodeKind::VARIABLE_DEFINITION => static function () : bool { - return false; - }, - NodeKind::VARIABLE => static function (VariableNode $variable) use ( - &$newUsages, - $typeInfo - ) : void { - $newUsages[] = [ - 'node' => $variable, - 'type' => $typeInfo->getInputType(), - 'defaultValue' => $typeInfo->getDefaultValue(), - ]; - }, - ] - ) - ); - $usages = $newUsages; - $this->variableUsages[$node] = $usages; - } - - return $usages; - } - - /** - * @return FragmentDefinitionNode[] - */ - public function getRecursivelyReferencedFragments(OperationDefinitionNode $operation) - { - $fragments = $this->recursivelyReferencedFragments[$operation] ?? null; - - if ($fragments === null) { - $fragments = []; - $collectedNames = []; - $nodesToVisit = [$operation]; - while (count($nodesToVisit) > 0) { - $node = array_pop($nodesToVisit); - $spreads = $this->getFragmentSpreads($node); - foreach ($spreads as $spread) { - $fragName = $spread->name->value; - - if ($collectedNames[$fragName] ?? false) { - continue; - } - - $collectedNames[$fragName] = true; - $fragment = $this->getFragment($fragName); - if (! $fragment) { - continue; - } - - $fragments[] = $fragment; - $nodesToVisit[] = $fragment; - } - } - $this->recursivelyReferencedFragments[$operation] = $fragments; - } - - return $fragments; - } - - /** - * @param OperationDefinitionNode|FragmentDefinitionNode $node - * - * @return FragmentSpreadNode[] - */ - public function getFragmentSpreads(HasSelectionSet $node) : array - { - $spreads = $this->fragmentSpreads[$node] ?? null; - if ($spreads === null) { - $spreads = []; - /** @var SelectionSetNode[] $setsToVisit */ - $setsToVisit = [$node->selectionSet]; - while (count($setsToVisit) > 0) { - $set = array_pop($setsToVisit); - - foreach ($set->selections as $selection) { - if ($selection instanceof FragmentSpreadNode) { - $spreads[] = $selection; - } else { - assert($selection instanceof FieldNode || $selection instanceof InlineFragmentNode); - $selectionSet = $selection->selectionSet; - if ($selectionSet !== null) { - $setsToVisit[] = $selectionSet; - } - } - } - } - $this->fragmentSpreads[$node] = $spreads; - } - - return $spreads; - } - - /** - * @param string $name - * - * @return FragmentDefinitionNode|null - */ - public function getFragment($name) - { - $fragments = $this->fragments; - if (! $fragments) { - $fragments = []; - foreach ($this->getDocument()->definitions as $statement) { - if (! ($statement instanceof FragmentDefinitionNode)) { - continue; - } - - $fragments[$statement->name->value] = $statement; - } - $this->fragments = $fragments; - } - - return $fragments[$name] ?? null; - } - - public function getType() : ?OutputType - { - return $this->typeInfo->getType(); - } - - /** - * @return (CompositeType & Type) | null - */ - public function getParentType() : ?CompositeType - { - return $this->typeInfo->getParentType(); - } - - /** - * @return (Type & InputType) | null - */ - public function getInputType() : ?InputType - { - return $this->typeInfo->getInputType(); - } - - /** - * @return (Type&InputType)|null - */ - public function getParentInputType() : ?InputType - { - return $this->typeInfo->getParentInputType(); - } - - /** - * @return FieldDefinition - */ - public function getFieldDef() - { - return $this->typeInfo->getFieldDef(); - } - - public function getDirective() - { - return $this->typeInfo->getDirective(); - } - - public function getArgument() - { - return $this->typeInfo->getArgument(); - } -} diff --git a/lib/wp-graphql-1.17.0/webpack.config.js b/lib/wp-graphql-1.17.0/webpack.config.js deleted file mode 100644 index 55738900..00000000 --- a/lib/wp-graphql-1.17.0/webpack.config.js +++ /dev/null @@ -1,32 +0,0 @@ -const defaults = require("@wordpress/scripts/config/webpack.config"); -const path = require("path"); - - -module.exports = { - ...defaults, - entry: { - index: path.resolve(process.cwd(), "packages/wpgraphiql", "index.js"), - app: path.resolve(process.cwd(), "packages/wpgraphiql", "app.js"), - graphiqlQueryComposer: path.resolve( - process.cwd(), - "packages/graphiql-query-composer", - "index.js" - ), - graphiqlAuthSwitch: path.resolve( - process.cwd(), - "packages/graphiql-auth-switch", - "index.js" - ), - graphiqlFullscreenToggle: path.resolve( - process.cwd(), - "packages/graphiql-fullscreen-toggle", - "index.js" - ), - }, - externals: { - react: "React", - "react-dom": "ReactDOM", - wpGraphiQL: "wpGraphiQL", - graphql: "wpGraphiQL.GraphQL", - }, -}; diff --git a/lib/wp-graphql-1.17.0/wp-graphql.php b/lib/wp-graphql-1.17.0/wp-graphql.php deleted file mode 100644 index bfaeb173..00000000 --- a/lib/wp-graphql-1.17.0/wp-graphql.php +++ /dev/null @@ -1,190 +0,0 @@ -' . - '

%s

' . - '', - esc_html__( 'WPGraphQL appears to have been installed without it\'s dependencies. It will not work properly until dependencies are installed. This likely means you have cloned WPGraphQL from Github and need to run the command `composer install`.', 'wp-graphql' ) - ); -} - -if ( defined( 'WP_CLI' ) && WP_CLI ) { - require_once plugin_dir_path( __FILE__ ) . 'cli/wp-cli.php'; -} - -/** - * Initialize the plugin tracker - * - * @return void - */ -function graphql_init_appsero_telemetry() { - // If the class doesn't exist, or code is being scanned by PHPSTAN, move on. - if ( ! class_exists( 'Appsero\Client' ) || defined( 'PHPSTAN' ) ) { - return; - } - - $client = new Appsero\Client( 'cd0d1172-95a0-4460-a36a-2c303807c9ef', 'WPGraphQL', __FILE__ ); - $insights = $client->insights(); - - // If the Appsero client has the add_plugin_data method, use it - if ( method_exists( $insights, 'add_plugin_data' ) ) { - // @phpstan-ignore-next-line - $insights->add_plugin_data(); - } - - // @phpstan-ignore-next-line - $insights->init(); -} - -graphql_init_appsero_telemetry(); diff --git a/vip-block-data-api.php b/vip-block-data-api.php index b312774e..1378d77c 100644 --- a/vip-block-data-api.php +++ b/vip-block-data-api.php @@ -31,9 +31,6 @@ // Composer dependencies. require_once __DIR__ . '/vendor/autoload.php'; - // WPGraphQL 1.17.0. - require_once __DIR__ . '/lib/wp-graphql-1.17.0/wp-graphql.php'; - // GraphQL API. require_once __DIR__ . '/src/graphql/graphql-api.php'; From 61bee9d39f4b487e19e470730828c5d99f5dd31a Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Mon, 13 Nov 2023 11:38:17 +1100 Subject: [PATCH 08/45] Remove the lib folder from the PHPCS --- phpcs.xml.dist | 1 - vendor/composer/installed.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index b3f32bd8..01119deb 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -19,7 +19,6 @@ \.git/* /vendor/* - /lib/* diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 77eb1f91..a6248bfa 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'automattic/vip-block-data-api', 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '83bfd74e9adaebc566b45c717d9d290a6de5cfec', + 'reference' => 'cf0286dbc153f685cf84a7ec39aaa16348f870ec', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'automattic/vip-block-data-api' => array( 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '83bfd74e9adaebc566b45c717d9d290a6de5cfec', + 'reference' => 'cf0286dbc153f685cf84a7ec39aaa16348f870ec', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), From 4c00b0d2b4f3d6dcb7e70b7bc0ef8267a4c85b38 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Mon, 13 Nov 2023 14:39:00 +1100 Subject: [PATCH 09/45] Attempting to flatten the nested blocks --- phpcs.xml.dist | 2 +- src/graphql/graphql-api.php | 76 +++++++++++++++++------ src/parser/block-additions/core-image.php | 4 +- src/parser/content-parser.php | 14 ++++- tests/rest/test-rest-api.php | 4 +- 5 files changed, 74 insertions(+), 26 deletions(-) diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 01119deb..54c6441b 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -46,7 +46,7 @@ - + diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index cea3dbf8..917f1ee5 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -1,7 +1,7 @@ ID; $post = get_post( $post_id ); $filter_options = [ 'graphQL' => true ]; - + $content_parser = new ContentParser(); // ToDo: Modify the parser to give a flattened array for the innerBlocks, if the right filter_option is provided. @@ -49,7 +49,7 @@ public static function get_blocks_data( $post_model ) { // ToDo: Verify if this is better, or is returning it another way in graphQL is better. if ( is_wp_error( $parser_results ) ) { // Return API-safe error with extra data (e.g. stack trace) removed. - return new WP_Error( $parser_results->get_error_message() ); + return new \Exception( $parser_results->get_error_message() ); } // ToDo: Transform the attributes into a tuple where the name is one field and the value is another. GraphQL requires an expected format. Might be worth turning this into a filter within the parser. @@ -67,22 +67,34 @@ public static function get_blocks_data( $post_model ) { * @param int $post_id Post ID associated with the parsed block. * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. * @param array $filter_options Options to filter using, if any. - * + * * @return array */ public static function transform_block_attributes( $sourced_block, $block_name, $post_id, $block, $filter_options ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed - if ( isset( $filter_options['graphQL'] ) && $filter_options['graphQL'] && isset( $sourced_block['attributes'] ) ) { - $sourced_block['attributes'] = array_map( - function ( $name, $value ) { - return [ - 'name' => $name, - 'value' => $value, - ]; - }, - array_keys( $sourced_block['attributes'] ), - array_values( $sourced_block['attributes'] ) - ); + if ( isset( $filter_options['graphQL'] ) && $filter_options['graphQL'] ) { + + // Flatten the inner blocks, if any. + if ( isset( $sourced_block['innerBlocks'] ) && isset( $sourced_block['parentId'] ) ) { + $sourced_blocks = []; + array_push( $sourced_blocks, $sourced_block ); + array_push( $sourced_blocks, $sourced_block['innerBlocks'] ); + unset( $sourced_block[0]['innerBlocks'] ); + } + + if ( isset( $sourced_block['attributes'] ) && ! isset( $sourced_block['attributes'][0]['name'] ) ) { + $sourced_block['attributes'] = array_map( + function ( $name, $value ) { + return [ + 'name' => $name, + 'value' => $value, + ]; + }, + array_keys( $sourced_block['attributes'] ), + array_values( $sourced_block['attributes'] ) + ); + } } + return $sourced_block; } @@ -110,9 +122,9 @@ public static function register_types() { ], ); - // Register the type corresponding to the individual block, with the above attribute. + // Register the type corresponding to the individual inner block, with the above attribute. register_graphql_type( - 'BlockData', + 'InnerBlockData', [ 'description' => 'Block data', 'fields' => [ @@ -128,6 +140,30 @@ public static function register_types() { 'type' => 'String', 'description' => 'Block name', ], + 'attributes' => [ + 'type' => [ + 'list_of' => 'BlockDataAttribute', + ], + 'description' => 'Block data attributes', + ] + ], + ], + ); + + // Register the type corresponding to the individual block, with the above attribute. + register_graphql_type( + 'BlockData', + [ + 'description' => 'Block data', + 'fields' => [ + 'id' => [ + 'type' => 'String', + 'description' => 'ID of the block', + ], + 'name' => [ + 'type' => 'String', + 'description' => 'Block name', + ], 'attributes' => [ 'type' => [ 'list_of' => 'BlockDataAttribute', @@ -135,7 +171,7 @@ public static function register_types() { 'description' => 'Block data attributes', ], 'innerBlocks' => [ - 'type' => [ 'list_of' => 'BlockData' ], + 'type' => [ 'list_of' => 'InnerBlockData' ], 'description' => 'Flattened list of inner blocks of this block', ], ], diff --git a/src/parser/block-additions/core-image.php b/src/parser/block-additions/core-image.php index 585906fb..452d4ea7 100644 --- a/src/parser/block-additions/core-image.php +++ b/src/parser/block-additions/core-image.php @@ -19,7 +19,7 @@ class CoreImage { * @access private */ public static function init() { - add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'add_image_metadata' ], 5, 4 ); + add_filter( 'vip_block_data_api__sourced_block_result_transform', [ __CLASS__, 'add_image_metadata' ], 5, 5 ); } /** @@ -34,7 +34,7 @@ public static function init() { * * @return array Updated sourced block with new metadata information */ - public static function add_image_metadata( $sourced_block, $block_name, $post_id, $block ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed + public static function add_image_metadata( $sourced_block, $block_name, $post_id, $block, $filter_options ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed if ( 'core/image' !== $block_name ) { return $sourced_block; } diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index 733c587c..a834f4c5 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -260,6 +260,18 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { ]; } + /** + * Filters a block when parsing is complete. + * + * @deprecated version 1.1.0 + * + * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. + * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. + * @param int $post_id Post ID associated with the parsed block. + * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. + */ + $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block ); + /** * Filters a block when parsing is complete. * @@ -269,7 +281,7 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. * @param array $filter_options Options to filter using, if any. */ - $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block, $filter_options ); + $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result_transform', $sourced_block, $block_name, $this->post_id, $block, $filter_options); // If attributes are empty, explicitly use an object to avoid encoding an empty array in JSON. if ( empty( $sourced_block['attributes'] ) ) { diff --git a/tests/rest/test-rest-api.php b/tests/rest/test-rest-api.php index 87f04f1c..118027aa 100644 --- a/tests/rest/test-rest-api.php +++ b/tests/rest/test-rest-api.php @@ -459,10 +459,10 @@ public function test_rest_api_returns_error_for_unexpected_exception() { $this->convert_next_error_to_exception(); $this->expectExceptionMessage( 'vip-block-data-api-parser-error' ); - add_filter( 'vip_block_data_api__sourced_block_result', $exception_causing_parser_function ); + add_filter( 'vip_block_data_api__sourced_block_result_transform', $exception_causing_parser_function ); $request = new WP_REST_Request( 'GET', sprintf( '/vip-block-data-api/v1/posts/%d/blocks', $post_id ) ); $response = $this->server->dispatch( $request ); - remove_filter( 'vip_block_data_api__sourced_block_result', $exception_causing_parser_function ); + remove_filter( 'vip_block_data_api__sourced_block_result_transform', $exception_causing_parser_function ); $this->assertEquals( 500, $response->get_status() ); From d810a0fbebb7e8d6225d2e376f686338ba2c744a Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Mon, 13 Nov 2023 17:47:54 +1100 Subject: [PATCH 10/45] Flattened the innerblocks, but still have a duplicate showing up --- composer.json | 1 - src/graphql/graphql-api.php | 21 +++++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 62eeda39..d78071b8 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,6 @@ "automattic/vipwpcs": "^3.0", "yoast/phpunit-polyfills": "^2.0", "dms/phpunit-arraysubset-asserts": "^0.5.0" - }, "config": { "allow-plugins": { diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 917f1ee5..57645000 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -74,11 +74,8 @@ public static function transform_block_attributes( $sourced_block, $block_name, if ( isset( $filter_options['graphQL'] ) && $filter_options['graphQL'] ) { // Flatten the inner blocks, if any. - if ( isset( $sourced_block['innerBlocks'] ) && isset( $sourced_block['parentId'] ) ) { - $sourced_blocks = []; - array_push( $sourced_blocks, $sourced_block ); - array_push( $sourced_blocks, $sourced_block['innerBlocks'] ); - unset( $sourced_block[0]['innerBlocks'] ); + if ( isset( $sourced_block['innerBlocks'] ) && ! isset( $sourced_block['parentId'] ) ) { + $sourced_block['innerBlocks'] = self::flatten_inner_blocks( $sourced_block ); } if ( isset( $sourced_block['attributes'] ) && ! isset( $sourced_block['attributes'][0]['name'] ) ) { @@ -94,10 +91,22 @@ function ( $name, $value ) { ); } } - + return $sourced_block; } + public static function flatten_inner_blocks( $inner_blocks ) { + if ( ! isset( $inner_blocks['innerBlocks'] ) ) { + return [ $inner_blocks ]; + } else { + foreach ( $inner_blocks['innerBlocks'] as $inner_block ) { + $inner_blocks['innerBlocks'] = array_merge( $inner_blocks['innerBlocks'], self::flatten_inner_blocks( $inner_block ) ); + } + } + + return $inner_blocks['innerBlocks']; + } + /** * Register types and fields graphql integration. * From 71dd8ae6ea5d7832ea5a797faeaee9a5a4c390e1 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 14 Nov 2023 11:40:28 +1100 Subject: [PATCH 11/45] Fixed the bug with duplicates in the child list --- src/graphql/graphql-api.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 57645000..10b83fda 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -95,16 +95,20 @@ function ( $name, $value ) { return $sourced_block; } - public static function flatten_inner_blocks( $inner_blocks ) { + public static function flatten_inner_blocks( $inner_blocks, $flattened_blocks = [] ) { if ( ! isset( $inner_blocks['innerBlocks'] ) ) { - return [ $inner_blocks ]; + array_push( $flattened_blocks, $inner_blocks ); + return $flattened_blocks; } else { - foreach ( $inner_blocks['innerBlocks'] as $inner_block ) { - $inner_blocks['innerBlocks'] = array_merge( $inner_blocks['innerBlocks'], self::flatten_inner_blocks( $inner_block ) ); + $inner_blocks_copy = $inner_blocks['innerBlocks']; + unset( $inner_blocks['innerBlocks'] ); + if ( isset( $inner_blocks['parentId'] ) ) array_push( $flattened_blocks, $inner_blocks ); + foreach ( $inner_blocks_copy as $inner_block ) { + $flattened_blocks = self::flatten_inner_blocks( $inner_block, $flattened_blocks ); } } - return $inner_blocks['innerBlocks']; + return $flattened_blocks; } /** From d98425acb0b1c58f3584f1fbc160a4756e0c5c79 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 14 Nov 2023 14:16:03 +1100 Subject: [PATCH 12/45] Downgrade php version to 7.4 --- composer.lock | 16 ++++++++-------- src/graphql/graphql-api.php | 3 --- vendor/composer/installed.json | 18 +++++++++--------- vendor/composer/installed.php | 10 +++++----- vendor/composer/platform_check.php | 4 ++-- .../deprecation-contracts/composer.json | 4 ++-- .../symfony/deprecation-contracts/function.php | 2 +- 7 files changed, 27 insertions(+), 30 deletions(-) diff --git a/composer.lock b/composer.lock index de0c5601..fb0b25f2 100644 --- a/composer.lock +++ b/composer.lock @@ -141,25 +141,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.2", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -188,7 +188,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" }, "funding": [ { @@ -204,7 +204,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:55:41+00:00" + "time": "2022-01-02T09:53:40+00:00" }, { "name": "symfony/dom-crawler", diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 10b83fda..c92f345b 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -52,8 +52,6 @@ public static function get_blocks_data( $post_model ) { return new \Exception( $parser_results->get_error_message() ); } - // ToDo: Transform the attributes into a tuple where the name is one field and the value is another. GraphQL requires an expected format. Might be worth turning this into a filter within the parser. - // ToDo: Provide a filter to modify the output. Not sure if the individual block, or the entire thing should be allowed to be modified. return $parser_results; @@ -98,7 +96,6 @@ function ( $name, $value ) { public static function flatten_inner_blocks( $inner_blocks, $flattened_blocks = [] ) { if ( ! isset( $inner_blocks['innerBlocks'] ) ) { array_push( $flattened_blocks, $inner_blocks ); - return $flattened_blocks; } else { $inner_blocks_copy = $inner_blocks['innerBlocks']; unset( $inner_blocks['innerBlocks'] ); diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 9d39994d..f9fcf365 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -141,27 +141,27 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.0.2", - "version_normalized": "3.0.2.0", + "version": "v2.5.2", + "version_normalized": "2.5.2.0", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", - "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", "shasum": "" }, "require": { - "php": ">=8.0.2" + "php": ">=7.1" }, - "time": "2022-01-02T09:55:41+00:00", + "time": "2022-01-02T09:53:40+00:00", "type": "library", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", @@ -191,7 +191,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index a6248bfa..241639be 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'automattic/vip-block-data-api', 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => 'cf0286dbc153f685cf84a7ec39aaa16348f870ec', + 'reference' => '71dd8ae6ea5d7832ea5a797faeaee9a5a4c390e1', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'automattic/vip-block-data-api' => array( 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => 'cf0286dbc153f685cf84a7ec39aaa16348f870ec', + 'reference' => '71dd8ae6ea5d7832ea5a797faeaee9a5a4c390e1', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -38,9 +38,9 @@ 'dev_requirement' => false, ), 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.0.2', - 'version' => '3.0.2.0', - 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', + 'pretty_version' => 'v2.5.2', + 'version' => '2.5.2.0', + 'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66', 'type' => 'library', 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', 'aliases' => array(), diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index b168ddd5..a8b98d5c 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 80002)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 70205)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.2.5". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json index 1c1b4ba0..cc7cc123 100644 --- a/vendor/symfony/deprecation-contracts/composer.json +++ b/vendor/symfony/deprecation-contracts/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=8.0.2" + "php": ">=7.1" }, "autoload": { "files": [ @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.0-dev" + "dev-main": "2.5-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php index 2d56512b..d4371504 100644 --- a/vendor/symfony/deprecation-contracts/function.php +++ b/vendor/symfony/deprecation-contracts/function.php @@ -20,7 +20,7 @@ * * @author Nicolas Grekas */ - function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void + function trigger_deprecation(string $package, string $version, string $message, ...$args): void { @trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED); } From d5ab09e47e182664d64c1208f1af655ff4238918 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 14 Nov 2023 14:39:15 +1100 Subject: [PATCH 13/45] Add some php docs and fix linting problems --- src/graphql/graphql-api.php | 23 ++++++++++++++++------- src/parser/block-additions/core-image.php | 1 + src/parser/content-parser.php | 2 +- vendor/composer/installed.php | 4 ++-- vip-block-data-api.php | 2 +- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index c92f345b..8c91431e 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -43,7 +43,6 @@ public static function get_blocks_data( $post_model ) { $content_parser = new ContentParser(); - // ToDo: Modify the parser to give a flattened array for the innerBlocks, if the right filter_option is provided. $parser_results = $content_parser->parse( $post->post_content, $post_id, $filter_options ); // ToDo: Verify if this is better, or is returning it another way in graphQL is better. @@ -93,13 +92,23 @@ function ( $name, $value ) { return $sourced_block; } + /** + * Flatten the inner blocks, no matter how many levels of nesting is there. + * + * @param array $inner_blocks the inner blocks in the block. + * @param array $flattened_blocks the flattened blocks that's built up as we go through the inner blocks. + * + * @return array + */ public static function flatten_inner_blocks( $inner_blocks, $flattened_blocks = [] ) { if ( ! isset( $inner_blocks['innerBlocks'] ) ) { array_push( $flattened_blocks, $inner_blocks ); } else { $inner_blocks_copy = $inner_blocks['innerBlocks']; unset( $inner_blocks['innerBlocks'] ); - if ( isset( $inner_blocks['parentId'] ) ) array_push( $flattened_blocks, $inner_blocks ); + if ( isset( $inner_blocks['parentId'] ) ) { + array_push( $flattened_blocks, $inner_blocks ); + } foreach ( $inner_blocks_copy as $inner_block ) { $flattened_blocks = self::flatten_inner_blocks( $inner_block, $flattened_blocks ); } @@ -138,24 +147,24 @@ public static function register_types() { [ 'description' => 'Block data', 'fields' => [ - 'id' => [ + 'id' => [ 'type' => 'String', 'description' => 'ID of the block', ], - 'parentId' => [ + 'parentId' => [ 'type' => 'String', 'description' => 'ID of the parent for this inner block, if it is an inner block. This will match the ID of the block', ], - 'name' => [ + 'name' => [ 'type' => 'String', 'description' => 'Block name', ], - 'attributes' => [ + 'attributes' => [ 'type' => [ 'list_of' => 'BlockDataAttribute', ], 'description' => 'Block data attributes', - ] + ], ], ], ); diff --git a/src/parser/block-additions/core-image.php b/src/parser/block-additions/core-image.php index 452d4ea7..e8595fdf 100644 --- a/src/parser/block-additions/core-image.php +++ b/src/parser/block-additions/core-image.php @@ -29,6 +29,7 @@ public static function init() { * @param string $block_name Name of the block. * @param int|null $post_id Id of the post. * @param array $block Block being parsed. + * @param array $filter_options Options for the filter, if any. * * @access private * diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index a834f4c5..b378237e 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -281,7 +281,7 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. * @param array $filter_options Options to filter using, if any. */ - $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result_transform', $sourced_block, $block_name, $this->post_id, $block, $filter_options); + $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result_transform', $sourced_block, $block_name, $this->post_id, $block, $filter_options ); // If attributes are empty, explicitly use an object to avoid encoding an empty array in JSON. if ( empty( $sourced_block['attributes'] ) ) { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 241639be..87d59b63 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'automattic/vip-block-data-api', 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '71dd8ae6ea5d7832ea5a797faeaee9a5a4c390e1', + 'reference' => 'd98425acb0b1c58f3584f1fbc160a4756e0c5c79', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'automattic/vip-block-data-api' => array( 'pretty_version' => 'dev-trunk', 'version' => 'dev-trunk', - 'reference' => '71dd8ae6ea5d7832ea5a797faeaee9a5a4c390e1', + 'reference' => 'd98425acb0b1c58f3584f1fbc160a4756e0c5c79', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/vip-block-data-api.php b/vip-block-data-api.php index 1378d77c..630a25c9 100644 --- a/vip-block-data-api.php +++ b/vip-block-data-api.php @@ -8,7 +8,7 @@ * Version: 1.1.0 * Requires at least: 5.9 * Tested up to: 6.3 - * Requires PHP: 8.0 + * Requires PHP: 7.4 * License: GPL-3 * License URI: https://www.gnu.org/licenses/gpl-3.0.html * From 778509d781453d693e368a19e6ac71f52c99e186 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 14 Nov 2023 14:41:33 +1100 Subject: [PATCH 14/45] Tweak todo comments --- src/parser/content-parser.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index b378237e..49531971 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -236,7 +236,6 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { 'id' => wp_unique_id(), ]; - // ToDo: If a parent id is present in the filter_options, set that on the block. Otherwise, if inner blocks are present then pass the id of the block in as a parent id. if ( isset( $filter_options['parentId'] ) ) { $sourced_block['parentId'] = $filter_options['parentId']; } From 75e992f8b500024daa663e91b2826cd9e9aac0b3 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 16 Nov 2023 16:23:41 +1100 Subject: [PATCH 15/45] Remove the new filter and instead just add a new arg to the existing one --- README.md | 7 ++++--- src/graphql/graphql-api.php | 5 +++-- src/parser/block-additions/core-image.php | 2 +- src/parser/content-parser.php | 12 +----------- tests/rest/test-rest-api.php | 4 ++-- 5 files changed, 11 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index cb127ce4..08537a36 100644 --- a/README.md +++ b/README.md @@ -876,16 +876,17 @@ Modify or add attributes to a block's output in the Block Data API. * @param string $post_id The post ID associated with the parsed block. * @param string $block The result of parse_blocks() for this block. * Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. + * @param array $filter_options Options to filter using, if any. eg: `site_id` */ -$sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $post_id, $block ); +$sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $post_id, $block, $filter_options ); ``` This is useful when block rendering requires attributes stored in post metadata or outside of a block's markup. This filter can be used to add attributes to any core or custom block. For example: ```php -add_filter( 'vip_block_data_api__sourced_block_result', 'add_custom_block_metadata', 10, 4 ); +add_filter( 'vip_block_data_api__sourced_block_result', 'add_custom_block_metadata', 10, 5 ); -function add_custom_block_metadata( $sourced_block, $block_name, $post_id, $block ) { +function add_custom_block_metadata( $sourced_block, $block_name, $post_id, $block, $filter_options ) { if ( 'wpvip/my-custom-block' !== $block_name ) { return $sourced_block; } diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 8c91431e..72c5db2c 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -25,7 +25,7 @@ public static function init() { return; } - add_filter( 'vip_block_data_api__sourced_block_result_transform', [ __CLASS__, 'transform_block_attributes' ], 10, 5 ); + add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'transform_block_attributes' ], 10, 5 ); add_action( 'graphql_register_types', [ __CLASS__, 'register_types' ] ); } @@ -51,7 +51,7 @@ public static function get_blocks_data( $post_model ) { return new \Exception( $parser_results->get_error_message() ); } - // ToDo: Provide a filter to modify the output. Not sure if the individual block, or the entire thing should be allowed to be modified. + // ToDo: Provide a filter to modify the output. return $parser_results; } @@ -75,6 +75,7 @@ public static function transform_block_attributes( $sourced_block, $block_name, $sourced_block['innerBlocks'] = self::flatten_inner_blocks( $sourced_block ); } + // Convert the attributes to be in the name-value format that the schema expects. if ( isset( $sourced_block['attributes'] ) && ! isset( $sourced_block['attributes'][0]['name'] ) ) { $sourced_block['attributes'] = array_map( function ( $name, $value ) { diff --git a/src/parser/block-additions/core-image.php b/src/parser/block-additions/core-image.php index e8595fdf..9a7a36fc 100644 --- a/src/parser/block-additions/core-image.php +++ b/src/parser/block-additions/core-image.php @@ -19,7 +19,7 @@ class CoreImage { * @access private */ public static function init() { - add_filter( 'vip_block_data_api__sourced_block_result_transform', [ __CLASS__, 'add_image_metadata' ], 5, 5 ); + add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'add_image_metadata' ], 5, 5 ); } /** diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index 49531971..ce9f1609 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -268,19 +268,9 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. * @param int $post_id Post ID associated with the parsed block. * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. - */ - $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block ); - - /** - * Filters a block when parsing is complete. - * - * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. - * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. - * @param int $post_id Post ID associated with the parsed block. - * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. * @param array $filter_options Options to filter using, if any. */ - $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result_transform', $sourced_block, $block_name, $this->post_id, $block, $filter_options ); + $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block, $filter_options ); // If attributes are empty, explicitly use an object to avoid encoding an empty array in JSON. if ( empty( $sourced_block['attributes'] ) ) { diff --git a/tests/rest/test-rest-api.php b/tests/rest/test-rest-api.php index 118027aa..87f04f1c 100644 --- a/tests/rest/test-rest-api.php +++ b/tests/rest/test-rest-api.php @@ -459,10 +459,10 @@ public function test_rest_api_returns_error_for_unexpected_exception() { $this->convert_next_error_to_exception(); $this->expectExceptionMessage( 'vip-block-data-api-parser-error' ); - add_filter( 'vip_block_data_api__sourced_block_result_transform', $exception_causing_parser_function ); + add_filter( 'vip_block_data_api__sourced_block_result', $exception_causing_parser_function ); $request = new WP_REST_Request( 'GET', sprintf( '/vip-block-data-api/v1/posts/%d/blocks', $post_id ) ); $response = $this->server->dispatch( $request ); - remove_filter( 'vip_block_data_api__sourced_block_result_transform', $exception_causing_parser_function ); + remove_filter( 'vip_block_data_api__sourced_block_result', $exception_causing_parser_function ); $this->assertEquals( 500, $response->get_status() ); From 04237ed6acfc11d90f1e44d54dd7b332a84e03c7 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 16 Nov 2023 17:43:14 +1100 Subject: [PATCH 16/45] Move the id/parentId logic to the graphQL logic instead of the content parser --- README.md | 2 +- src/graphql/graphql-api.php | 36 +++++++++++++++++++---------------- src/parser/content-parser.php | 9 +++------ 3 files changed, 24 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 08537a36..231d4005 100644 --- a/README.md +++ b/README.md @@ -876,7 +876,7 @@ Modify or add attributes to a block's output in the Block Data API. * @param string $post_id The post ID associated with the parsed block. * @param string $block The result of parse_blocks() for this block. * Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. - * @param array $filter_options Options to filter using, if any. eg: `site_id` + * @param array $filter_options Options to filter using, if any */ $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $post_id, $block, $filter_options ); ``` diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 72c5db2c..12642e53 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -25,7 +25,7 @@ public static function init() { return; } - add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'transform_block_attributes' ], 10, 5 ); + add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'transform_block_format' ], 10, 5 ); add_action( 'graphql_register_types', [ __CLASS__, 'register_types' ] ); } @@ -57,7 +57,7 @@ public static function get_blocks_data( $post_model ) { } /** - * Transform the block attribute's format to the format expected by the graphQL API. + * Transform the block's format to the format expected by the graphQL API. * * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. @@ -67,12 +67,16 @@ public static function get_blocks_data( $post_model ) { * * @return array */ - public static function transform_block_attributes( $sourced_block, $block_name, $post_id, $block, $filter_options ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed + public static function transform_block_format( $sourced_block, $block_name, $post_id, $block, $filter_options ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed if ( isset( $filter_options['graphQL'] ) && $filter_options['graphQL'] ) { + if ( ! isset( $sourced_block['id'] ) ) { + $sourced_block['id'] = $filter_options['id']; + } + // Flatten the inner blocks, if any. - if ( isset( $sourced_block['innerBlocks'] ) && ! isset( $sourced_block['parentId'] ) ) { - $sourced_block['innerBlocks'] = self::flatten_inner_blocks( $sourced_block ); + if ( isset( $sourced_block['innerBlocks'] ) ) { + $sourced_block['innerBlocks'] = self::flatten_inner_blocks( $sourced_block['innerBlocks'], $filter_options ); } // Convert the attributes to be in the name-value format that the schema expects. @@ -101,17 +105,17 @@ function ( $name, $value ) { * * @return array */ - public static function flatten_inner_blocks( $inner_blocks, $flattened_blocks = [] ) { - if ( ! isset( $inner_blocks['innerBlocks'] ) ) { - array_push( $flattened_blocks, $inner_blocks ); - } else { - $inner_blocks_copy = $inner_blocks['innerBlocks']; - unset( $inner_blocks['innerBlocks'] ); - if ( isset( $inner_blocks['parentId'] ) ) { - array_push( $flattened_blocks, $inner_blocks ); - } - foreach ( $inner_blocks_copy as $inner_block ) { - $flattened_blocks = self::flatten_inner_blocks( $inner_block, $flattened_blocks ); + public static function flatten_inner_blocks( $inner_blocks, $filter_options, $flattened_blocks = [] ) { + foreach ( $inner_blocks as $inner_block ) { + if ( ! isset( $inner_block['innerBlocks'] ) ) { + $inner_block['parentId'] = $inner_block['parentId'] ?? $filter_options['parentId']; + array_push( $flattened_blocks, $inner_block ); + } else if ( ! isset($inner_block['parentId']) ){ + $inner_blocks_copy = $inner_block['innerBlocks']; + unset( $inner_block['innerBlocks'] ); + $inner_block['parentId'] = $filter_options['parentId']; + array_push( $flattened_blocks, $inner_block ); + $flattened_blocks = self::flatten_inner_blocks( $inner_blocks_copy, $filter_options, $flattened_blocks ); } } diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index ce9f1609..75a9c369 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -232,16 +232,13 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { $sourced_block = [ 'name' => $block_name, - 'attributes' => $block_attributes, - 'id' => wp_unique_id(), + 'attributes' => $block_attributes ]; - if ( isset( $filter_options['parentId'] ) ) { - $sourced_block['parentId'] = $filter_options['parentId']; - } + $filter_options['id'] = wp_unique_id(); if ( isset( $block['innerBlocks'] ) ) { - $filter_options['parentId'] = $sourced_block['id']; + $filter_options['parentId'] = $filter_options['id']; $inner_blocks = array_map( function ( $block ) use ( $registered_blocks, $filter_options ) { return $this->source_block( $block, $registered_blocks, $filter_options ); }, $block['innerBlocks'] ); From 145ea17be03f6fabcf2b89db1164c2a0cc139fde Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 16 Nov 2023 17:48:03 +1100 Subject: [PATCH 17/45] Fix linting errors --- src/graphql/graphql-api.php | 5 +++-- src/parser/content-parser.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 12642e53..079ced40 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -101,6 +101,7 @@ function ( $name, $value ) { * Flatten the inner blocks, no matter how many levels of nesting is there. * * @param array $inner_blocks the inner blocks in the block. + * @param array $filter_options Options to filter using, if any. * @param array $flattened_blocks the flattened blocks that's built up as we go through the inner blocks. * * @return array @@ -110,10 +111,10 @@ public static function flatten_inner_blocks( $inner_blocks, $filter_options, $fl if ( ! isset( $inner_block['innerBlocks'] ) ) { $inner_block['parentId'] = $inner_block['parentId'] ?? $filter_options['parentId']; array_push( $flattened_blocks, $inner_block ); - } else if ( ! isset($inner_block['parentId']) ){ + } elseif ( ! isset( $inner_block['parentId'] ) ) { $inner_blocks_copy = $inner_block['innerBlocks']; unset( $inner_block['innerBlocks'] ); - $inner_block['parentId'] = $filter_options['parentId']; + $inner_block['parentId'] = $inner_block['parentId'] ?? $filter_options['parentId']; array_push( $flattened_blocks, $inner_block ); $flattened_blocks = self::flatten_inner_blocks( $inner_blocks_copy, $filter_options, $flattened_blocks ); } diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index 75a9c369..ccdc0b2e 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -232,7 +232,7 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { $sourced_block = [ 'name' => $block_name, - 'attributes' => $block_attributes + 'attributes' => $block_attributes, ]; $filter_options['id'] = wp_unique_id(); From 1df6165f948882fc5d4051e08cec0795e3427e8c Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 28 Nov 2023 14:58:07 +1100 Subject: [PATCH 18/45] Fix unknown error --- src/graphql/graphql-api.php | 2 +- src/parser/content-parser.php | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 079ced40..0ecdb0ca 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -80,7 +80,7 @@ public static function transform_block_format( $sourced_block, $block_name, $pos } // Convert the attributes to be in the name-value format that the schema expects. - if ( isset( $sourced_block['attributes'] ) && ! isset( $sourced_block['attributes'][0]['name'] ) ) { + if ( isset( $sourced_block['attributes'] ) && count($sourced_block['attributes']) !== 0 && ! isset( $sourced_block['attributes'][0]['name'] ) ) { $sourced_block['attributes'] = array_map( function ( $name, $value ) { return [ diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index ccdc0b2e..8e67b244 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -269,11 +269,6 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { */ $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block, $filter_options ); - // If attributes are empty, explicitly use an object to avoid encoding an empty array in JSON. - if ( empty( $sourced_block['attributes'] ) ) { - $sourced_block['attributes'] = (object) []; - } - return $sourced_block; } From 830894bae394f04f82dca2415c1f1564dc7495fe Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 28 Nov 2023 15:01:44 +1100 Subject: [PATCH 19/45] Fix unknown error --- src/graphql/graphql-api.php | 2 +- src/parser/content-parser.php | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 0ecdb0ca..fcf27088 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -80,7 +80,7 @@ public static function transform_block_format( $sourced_block, $block_name, $pos } // Convert the attributes to be in the name-value format that the schema expects. - if ( isset( $sourced_block['attributes'] ) && count($sourced_block['attributes']) !== 0 && ! isset( $sourced_block['attributes'][0]['name'] ) ) { + if ( isset( $sourced_block['attributes'] ) && count( $sourced_block['attributes'] ) !== 0 && ! isset( $sourced_block['attributes'][0]['name'] ) ) { $sourced_block['attributes'] = array_map( function ( $name, $value ) { return [ diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index 8e67b244..b58db715 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -258,8 +258,6 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { /** * Filters a block when parsing is complete. - * - * @deprecated version 1.1.0 * * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. From e06b15a0386177a6cb7a0e5b741643d5b2437b5c Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 28 Nov 2023 15:02:33 +1100 Subject: [PATCH 20/45] Fix unknown error --- src/graphql/graphql-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index fcf27088..3ffa5131 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -80,7 +80,7 @@ public static function transform_block_format( $sourced_block, $block_name, $pos } // Convert the attributes to be in the name-value format that the schema expects. - if ( isset( $sourced_block['attributes'] ) && count( $sourced_block['attributes'] ) !== 0 && ! isset( $sourced_block['attributes'][0]['name'] ) ) { + if ( isset( $sourced_block['attributes'] ) && ! empty( $sourced_block['attributes'] ) && ! isset( $sourced_block['attributes'][0]['name'] ) ) { $sourced_block['attributes'] = array_map( function ( $name, $value ) { return [ From 7e5ae7e9b919f2740874c993b0a0c8890f3dd3a6 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 28 Nov 2023 16:27:52 +1100 Subject: [PATCH 21/45] Fix unknown error --- src/parser/content-parser.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index b58db715..e15eee59 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -9,6 +9,7 @@ defined( 'ABSPATH' ) || die(); +use ArrayObject; use Throwable; use WP_Error; use WP_Block_Type; @@ -258,6 +259,8 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { /** * Filters a block when parsing is complete. + * + * @deprecated version 1.1.0 * * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. @@ -267,6 +270,11 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { */ $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block, $filter_options ); + // If attributes are empty, explicitly use an ArrayObject to encode an empty json object in JSON. + if ( empty( $sourced_block['attributes'] ) ) { + $sourced_block['attributes'] = new ArrayObject; + } + return $sourced_block; } From 33fc4dd40101a4ddec491a7e9ddd79d5f1dc5663 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Tue, 28 Nov 2023 16:29:19 +1100 Subject: [PATCH 22/45] Fix unknown error --- src/parser/content-parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index e15eee59..e580d2cc 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -272,7 +272,7 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { // If attributes are empty, explicitly use an ArrayObject to encode an empty json object in JSON. if ( empty( $sourced_block['attributes'] ) ) { - $sourced_block['attributes'] = new ArrayObject; + $sourced_block['attributes'] = new ArrayObject(); } return $sourced_block; From 1dda9a7663450b7dde4b9d2879d08212c7b2fc98 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 30 Nov 2023 14:57:31 +1100 Subject: [PATCH 23/45] add tests and clean up the code --- src/graphql/graphql-api.php | 5 +- src/parser/content-parser.php | 2 - tests/graphql/test-graphql-api.php | 136 +++++++++++++++++++++++++++++ 3 files changed, 138 insertions(+), 5 deletions(-) create mode 100644 tests/graphql/test-graphql-api.php diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 3ffa5131..58bae806 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -51,8 +51,6 @@ public static function get_blocks_data( $post_model ) { return new \Exception( $parser_results->get_error_message() ); } - // ToDo: Provide a filter to modify the output. - return $parser_results; } @@ -70,7 +68,8 @@ public static function get_blocks_data( $post_model ) { public static function transform_block_format( $sourced_block, $block_name, $post_id, $block, $filter_options ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed if ( isset( $filter_options['graphQL'] ) && $filter_options['graphQL'] ) { - if ( ! isset( $sourced_block['id'] ) ) { + // Add the ID to the block, if it is not already there. + if ( ! isset( $sourced_block['id'] ) && isset( $filter_options['id'] ) ) { $sourced_block['id'] = $filter_options['id']; } diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index e580d2cc..076d5c4a 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -259,8 +259,6 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { /** * Filters a block when parsing is complete. - * - * @deprecated version 1.1.0 * * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. diff --git a/tests/graphql/test-graphql-api.php b/tests/graphql/test-graphql-api.php new file mode 100644 index 00000000..8ab4c35e --- /dev/null +++ b/tests/graphql/test-graphql-api.php @@ -0,0 +1,136 @@ +assertTrue( apply_filters( 'vip_block_data_api__is_graphql_enabled', true ) ); + } + + public function test_is_graphql_enabled_false() { + $is_graphql_enabled_function = function () { + return false; + }; + add_filter( 'vip_block_data_api__is_graphql_enabled', $is_graphql_enabled_function, 10, 0 ); + $this->assertFalse( apply_filters( 'vip_block_data_api__is_graphql_enabled', true ) ); + remove_filter( 'vip_block_data_api__is_graphql_enabled', $is_graphql_enabled_function, 10, 0 ); + } + + public function test_get_blocks_data() { + $html = ' + +

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

+ + + +
+

This is a heading inside a quote

+ + + +
+

This is a heading

+
+
+ + '; + + $expected_blocks = [ + 'blocks' => [ + [ + 'name' => 'core/paragraph', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!', + ), + array( + 'name' => 'dropCap', + 'value' => '', + ), + ], + 'id' => '1', + ], + [ + 'name' => 'core/quote', + 'attributes' => [ + array( + 'name' => 'value', + 'value' => '', + ), + array( + 'name' => 'citation', + 'value' => '', + ), + ], + 'innerBlocks' => [ + [ + 'parentId' => '2', + 'name' => 'core/paragraph', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'This is a heading inside a quote', + ), + array( + 'name' => 'dropCap', + 'value' => '', + ), + ], + 'id' => '3', + ], + [ + 'parentId' => '2', + 'name' => 'core/quote', + 'attributes' => [ + array( + 'name' => 'value', + 'value' => '', + ), + array( + 'name' => 'citation', + 'value' => '', + ), + ], + 'id' => '4', + ], + [ + 'parentId' => '4', + 'name' => 'core/heading', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'This is a heading', + ), + array( + 'name' => 'level', + 'value' => '2', + ), + ], + 'id' => '5', + ], + ], + 'id' => '2', + ], + ] + ]; + + $post = $this->factory()->post->create_and_get( [ + 'post_content' => $html, + ] ); + + $blocks_data = GraphQLApi::get_blocks_data( $post ); + + $this->assertEquals( $expected_blocks, $blocks_data ); + } + +} \ No newline at end of file From df105125de4e9294af9365cba00569022a306e7e Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 30 Nov 2023 15:00:24 +1100 Subject: [PATCH 24/45] Fix the linting problems --- tests/graphql/test-graphql-api.php | 199 ++++++++++++++--------------- 1 file changed, 99 insertions(+), 100 deletions(-) diff --git a/tests/graphql/test-graphql-api.php b/tests/graphql/test-graphql-api.php index 8ab4c35e..3a065199 100644 --- a/tests/graphql/test-graphql-api.php +++ b/tests/graphql/test-graphql-api.php @@ -12,21 +12,21 @@ */ class GraphQLAPITest extends RegistryTestCase { - public function test_is_graphql_enabled_true() { - $this->assertTrue( apply_filters( 'vip_block_data_api__is_graphql_enabled', true ) ); - } + public function test_is_graphql_enabled_true() { + $this->assertTrue( apply_filters( 'vip_block_data_api__is_graphql_enabled', true ) ); + } - public function test_is_graphql_enabled_false() { - $is_graphql_enabled_function = function () { - return false; - }; - add_filter( 'vip_block_data_api__is_graphql_enabled', $is_graphql_enabled_function, 10, 0 ); - $this->assertFalse( apply_filters( 'vip_block_data_api__is_graphql_enabled', true ) ); - remove_filter( 'vip_block_data_api__is_graphql_enabled', $is_graphql_enabled_function, 10, 0 ); - } + public function test_is_graphql_enabled_false() { + $is_graphql_enabled_function = function () { + return false; + }; + add_filter( 'vip_block_data_api__is_graphql_enabled', $is_graphql_enabled_function, 10, 0 ); + $this->assertFalse( apply_filters( 'vip_block_data_api__is_graphql_enabled', true ) ); + remove_filter( 'vip_block_data_api__is_graphql_enabled', $is_graphql_enabled_function, 10, 0 ); + } - public function test_get_blocks_data() { - $html = ' + public function test_get_blocks_data() { + $html = '

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

@@ -44,93 +44,92 @@ public function test_get_blocks_data() { '; - $expected_blocks = [ - 'blocks' => [ - [ - 'name' => 'core/paragraph', - 'attributes' => [ - array( - 'name' => 'content', - 'value' => 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!', - ), - array( - 'name' => 'dropCap', - 'value' => '', - ), - ], - 'id' => '1', - ], - [ - 'name' => 'core/quote', - 'attributes' => [ - array( - 'name' => 'value', - 'value' => '', - ), - array( - 'name' => 'citation', - 'value' => '', - ), - ], - 'innerBlocks' => [ - [ - 'parentId' => '2', - 'name' => 'core/paragraph', - 'attributes' => [ - array( - 'name' => 'content', - 'value' => 'This is a heading inside a quote', - ), - array( - 'name' => 'dropCap', - 'value' => '', - ), - ], - 'id' => '3', - ], - [ - 'parentId' => '2', - 'name' => 'core/quote', - 'attributes' => [ - array( - 'name' => 'value', - 'value' => '', - ), - array( - 'name' => 'citation', - 'value' => '', - ), - ], - 'id' => '4', - ], - [ - 'parentId' => '4', - 'name' => 'core/heading', - 'attributes' => [ - array( - 'name' => 'content', - 'value' => 'This is a heading', - ), - array( - 'name' => 'level', - 'value' => '2', - ), - ], - 'id' => '5', - ], - ], - 'id' => '2', - ], - ] - ]; + $expected_blocks = [ + 'blocks' => [ + [ + 'name' => 'core/paragraph', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!', + ), + array( + 'name' => 'dropCap', + 'value' => '', + ), + ], + 'id' => '1', + ], + [ + 'name' => 'core/quote', + 'attributes' => [ + array( + 'name' => 'value', + 'value' => '', + ), + array( + 'name' => 'citation', + 'value' => '', + ), + ], + 'innerBlocks' => [ + [ + 'parentId' => '2', + 'name' => 'core/paragraph', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'This is a heading inside a quote', + ), + array( + 'name' => 'dropCap', + 'value' => '', + ), + ], + 'id' => '3', + ], + [ + 'parentId' => '2', + 'name' => 'core/quote', + 'attributes' => [ + array( + 'name' => 'value', + 'value' => '', + ), + array( + 'name' => 'citation', + 'value' => '', + ), + ], + 'id' => '4', + ], + [ + 'parentId' => '4', + 'name' => 'core/heading', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'This is a heading', + ), + array( + 'name' => 'level', + 'value' => '2', + ), + ], + 'id' => '5', + ], + ], + 'id' => '2', + ], + ], + ]; - $post = $this->factory()->post->create_and_get( [ - 'post_content' => $html, - ] ); + $post = $this->factory()->post->create_and_get( [ + 'post_content' => $html, + ] ); - $blocks_data = GraphQLApi::get_blocks_data( $post ); + $blocks_data = GraphQLApi::get_blocks_data( $post ); - $this->assertEquals( $expected_blocks, $blocks_data ); - } - -} \ No newline at end of file + $this->assertEquals( $expected_blocks, $blocks_data ); + } +} From 5ad55f11d7c6203bdce029ff684b47ff2821bb2f Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 30 Nov 2023 15:12:03 +1100 Subject: [PATCH 25/45] Add more comments --- src/graphql/graphql-api.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 58bae806..8c5ea1f9 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -45,7 +45,7 @@ public static function get_blocks_data( $post_model ) { $parser_results = $content_parser->parse( $post->post_content, $post_id, $filter_options ); - // ToDo: Verify if this is better, or is returning it another way in graphQL is better. + // We need to not return a WP_Error object, and so a regular exception is returned. if ( is_wp_error( $parser_results ) ) { // Return API-safe error with extra data (e.g. stack trace) removed. return new \Exception( $parser_results->get_error_message() ); @@ -107,9 +107,11 @@ function ( $name, $value ) { */ public static function flatten_inner_blocks( $inner_blocks, $filter_options, $flattened_blocks = [] ) { foreach ( $inner_blocks as $inner_block ) { + // This block doesnt have any inner blocks, so just add it to the flattened blocks. Ensure the parentId is set. if ( ! isset( $inner_block['innerBlocks'] ) ) { $inner_block['parentId'] = $inner_block['parentId'] ?? $filter_options['parentId']; array_push( $flattened_blocks, $inner_block ); + // This block is a root block, so go through the inner blocks recursively. } elseif ( ! isset( $inner_block['parentId'] ) ) { $inner_blocks_copy = $inner_block['innerBlocks']; unset( $inner_block['innerBlocks'] ); From a07df2be9f4bd5d391dee6ecd6ecf34efef31ed7 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Fri, 1 Dec 2023 16:42:20 +1100 Subject: [PATCH 26/45] Add docs for graphql and add analytics --- README.md | 293 ++++++++++++++++++++++++++++++---- src/graphql/graphql-api.php | 7 + src/parser/content-parser.php | 2 + src/rest/rest-api.php | 2 - 4 files changed, 270 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 231d4005..ce431b57 100644 --- a/README.md +++ b/README.md @@ -6,35 +6,32 @@ VIP Block Data API attribute sourcing animation -The Block Data API is a REST API for retrieving block editor posts structured as JSON data. While primarily designed for use in decoupled WordPress, the Block Data API can be used anywhere you want to represent block markup as structured data. +The Block Data API is an API for retrieving block editor posts structured as JSON data. This API is available as a REST, as well as a GraphQL API. While primarily designed for use in decoupled WordPress, the Block Data API can be used anywhere you want to represent block markup as structured data. This plugin is currently developed for use on WordPress sites hosted on the VIP Platform. -## Quickstart - -You can get started with the Block Data API in a few steps. - -If you're a customer with WordPress VIP, see [Install on WordPress VIP](#install-on-wordpress-vip). Otherwise, follow these steps to quickstart on any WordPress site: - -1. Install the plugin by adding it to the `plugins/` directory of the site's GitHub repository. We recommend using [git subtree](#install-via-git-subtree) for adding the plugin. -2. Activate the plugin in the "Plugins" screen of the site's WordPress admin dashboard. -3. Make a request to `/wp-json/vip-block-data-api/v1/posts//blocks` (replacing `` with a valid post ID of your site). - -Other installation options, examples, and helpful filters for customizing the API are outlined below. - ## Table of contents +- [Table of contents](#table-of-contents) - [Installation](#installation) - [Install on WordPress VIP](#install-on-wordpress-vip) - [Install via ZIP file](#install-via-zip-file) - [Plugin activation](#plugin-activation) -- [Usage](#usage) - - [Versioning](#versioning) -- [Block Data API examples](#block-data-api-examples) - - [Example: Basic text blocks: `core/heading` and `core/paragraph`](#example-basic-text-blocks-coreheading-and-coreparagraph) - - [Example: Text attributes in `core/pullquote`](#example-text-attributes-in-corepullquote) - - [Example: Nested blocks in `core/media-text`](#example-nested-blocks-in-coremedia-text) -- [Preact example](#preact-example) +- [APIs](#apis) + - [REST](#rest) + - [Usage](#usage) + - [Versioning](#versioning) + - [Examples](#examples) + - [Example: Basic text blocks: `core/heading` and `core/paragraph`](#example-basic-text-blocks-coreheading-and-coreparagraph) + - [Example: Text attributes in `core/pullquote`](#example-text-attributes-in-corepullquote) + - [Example: Nested blocks in `core/media-text`](#example-nested-blocks-in-coremedia-text) + - [GraphQL](#graphql) + - [Setup](#setup) + - [Usage](#usage-1) + - [Examples](#examples-1) + - [Example: Simple nested blocks: `core/list` and `core/quote`](#example-simple-nested-blocks-corelist-and-corequote) +- [API Consumption](#api-consumption) + - [Preact](#preact) - [Limitations](#limitations) - [Client-side blocks](#client-side-blocks) - [Client-side example](#client-side-example) @@ -46,6 +43,8 @@ Other installation options, examples, and helpful filters for customizing the AP - [`include`](#include) - [`exclude`](#exclude) - [Code Filters](#code-filters) + - [GraphQL](#graphql-1) + - [REST](#rest-1) - [`vip_block_data_api__rest_validate_post_id`](#vip_block_data_api__rest_validate_post_id) - [`vip_block_data_api__rest_permission_callback`](#vip_block_data_api__rest_permission_callback) - [`vip_block_data_api__allow_block`](#vip_block_data_api__allow_block) @@ -97,9 +96,17 @@ To activate the installed plugin: ![Plugin activation][media-plugin-activate] -## Usage +## APIs + +The VIP Block Data API plugin provides two types of APIs to use - REST and GraphQL. The Block Data API [uses server-side registered blocks][wordpress-block-metadata-php-registration] to determine block attributes. Refer to the **[Client-side blocks](#client-side-blocks)** section for more information about client-side block support limitations. -The VIP Block Data API plugin provides a REST endpoint for reading post block data as JSON. The REST URL is located at: +### REST + +There is no extra setup necessary for the REST API. It is ready to use out of the box. + +#### Usage + +The REST URL is located at: ```js /wp-json/vip-block-data-api/v1/posts//blocks @@ -114,9 +121,7 @@ Review these [**Filters**](#filters) to learn more about limiting access to the - [`vip_block_data_api__rest_validate_post_id`](#vip_block_data_api__rest_validate_post_id) - [`vip_block_data_api__rest_permission_callback`](#vip_block_data_api__rest_permission_callback) -The Block Data API [uses server-side registered blocks][wordpress-block-metadata-php-registration] to determine block attributes. Refer to the **[Client-side blocks](#client-side-blocks)** section for more information about client-side block support limitations. - -### Versioning +#### Versioning The current REST endpoint uses a `v1` prefix: @@ -126,11 +131,11 @@ The current REST endpoint uses a `v1` prefix: We plan to utilize API versioning to avoid unexpected changes to the plugin. In the event that we make breaking changes to API output, we will add a new endpoint (e.g. `/wp-json/vip-block-data-api/v2/`) with access to new data. Previous versions will remain accessible for backward compatibility. -## Block Data API examples +#### Examples Examples of WordPress block markup and the associated data structure returned by the Block Data API. -### Example: Basic text blocks: `core/heading` and `core/paragraph` +##### Example: Basic text blocks: `core/heading` and `core/paragraph` ![Heading and paragraph block in editor][media-example-heading-paragraph] @@ -178,7 +183,7 @@ Examples of WordPress block markup and the associated data structure returned by --- -### Example: Text attributes in `core/pullquote` +##### Example: Text attributes in `core/pullquote` ![Pullquote block in editor][media-example-pullquote] @@ -221,7 +226,7 @@ Examples of WordPress block markup and the associated data structure returned by --- -### Example: Nested blocks in `core/media-text` +##### Example: Nested blocks in `core/media-text` ![Media-text block containing heading in editor][media-example-media-text] @@ -281,7 +286,208 @@ Examples of WordPress block markup and the associated data structure returned by -## Preact example +### GraphQL + +The GraphQL API, requires some setup before it can be it can be used. + +#### Setup + +The Block Data API integrates with **WP-GraphQL** to provide a GraphQL API as well. As a result, it is necessary to have WP-GraphQL installed, to activate the GraphQL API. To do so, follow the instructions mentioned [here](https://www.wpgraphql.com/docs/quick-start#install). + +Once WP-GraphQL has been installed and setup, a new field called `blocksData` will show up under categories that support `ContentNodes` like posts, pages, etc. + +#### Usage + +The `blocksData` field would be the field through which block data would be returned under a category that supports it. + +An example of what a query would look like for a post: + +```graphQL +query NewQuery { + post(id: "1", idType: DATABASE_ID) { + blocksData { + blocks { + id + name + attributes { + name + value + } + innerBlocks { + name + parentId + id + attributes { + name + value + } + } + } + } + } +} +``` + +Here, the `id` and `parentId` fields are dynamically generated, unique IDs that help to identify parent-child relationships in the `innerBlocks` under a block, in the overall block structure.The resulting `innerBlocks` is a flattened list, that can be untangled using the combination of `id` and `parentId` fields. This is helpful in being able to give back a complicated nesting structure, without having any knowledge as to how deep this nesting goes. + +In addition, the attributes of a block are a list of `name`, `value` pairs so as to avoid having to figure out the type of each block. This allows giving back any block's attributes. + +#### Examples + +Examples of WordPress block markup and the associated data structure returned by the Block Data API. + +##### Example: Simple nested blocks: `core/list` and `core/quote` + +![List and Quote block in editor][media-example-list-quote] + + + + + + + + + + + +
Block MarkupQueryBlock Data API
+ +```html + +
    +
  • This is item 1 in the list
  • + + + +
  • This is item 2 in the list
  • + +
+ + + +
+ +

This is a paragraph within a quote

+ +
+ +``` + +
+ +```graphQL +query NewQuery { + post(id: "1", idType: DATABASE_ID) { + blocksData { + blocks { + id + name + attributes { + name + value + } + innerBlocks { + name + parentId + id + attributes { + name + value + } + } + } + } + } +} +``` + +```json +{ + "data": { + "post": { + "blocksData": { + "blocks": [ + { + "attributes": [ + { + "name": "ordered", + "value": "" + }, + { + "name": "values", + "value": "" + } + ], + "id": "1", + "name": "core\/list", + "innerBlocks": [ + { + "id": "2", + "name": "core\/list-item", + "parentId": "1", + "attributes": [ + { + "name": "content", + "value": "This is item 1 in the list" + } + ] + }, + { + "id": "3", + "name": "core\/list-item", + "parentId": "1", + "attributes": [ + { + "name": "content", + "value": "This is item 2 in the list" + } + ] + } + ] + }, + { + "attributes": [ + { + "name": "value", + "value": "" + }, + { + "name": "citation", + "value": "" + } + ], + "id": "4", + "name": "core\/quote", + "innerBlocks": [ + { + "id": "5", + "name": "core\/paragraph", + "parentId": "4", + "attributes": [ + { + "name": "content", + "value": "This is a paragraph within a quote" + }, + { + "name": "dropCap", + "value": "" + } + ] + } + ] + } + ] + } + } + } +} +``` + +
+ +## API Consumption + +### Preact An example [Preact app][preact] app that queries for block data and maps it into customized components. @@ -569,7 +775,7 @@ The sourced caption is returned in the Block Data API: } ``` -Because the `caption` property in this example is , it seems possible to print the caption to the page safely (e.g. without using `innerHTML` or React's `dangerouslySetInnerHTML`). However, this is not the case and may result in incorrect rendering. +Because the `caption` property in this example is plaintext, it seems possible to print the caption to the page safely (e.g. without using `innerHTML` or React's `dangerouslySetInnerHTML`). However, this is not the case and may result in incorrect rendering. Attributes with the `html` source like the image block caption attribute above can contain plain-text as well as markup. @@ -754,7 +960,28 @@ Note that custom block filter rules can also be created in code via [the `vip_bl ## Code Filters -Block Data API filters can be applied to limit access to the REST API and modify the output of parsed blocks. +### GraphQL + +```php +/** + * Filter to enable/disable the graphQL API. By default, it is enabled. + * + * @param bool $is_graphql_to_be_enabled Whether the graphQL API should be enabled or not. +*/ +apply_filters( 'vip_block_data_api__is_graphql_enabled', true ); +``` + +To disable the GraphQL API, the following can be done: + +```php +add_filter( 'vip_block_data_api__is_graphql_enabled', function( ) { + return false; +}, 10, 1); +``` + +### REST + +These filters can be applied to limit access to the REST API and modify the output of parsed blocks. ### `vip_block_data_api__rest_validate_post_id` @@ -1002,6 +1229,8 @@ composer run test [media-example-pullquote]: https://github.com/Automattic/vip-block-data-api/blob/media/example-pullquote.png [media-plugin-activate]: https://github.com/Automattic/vip-block-data-api/blob/media/plugin-activate.png [media-preact-media-text]: https://github.com/Automattic/vip-block-data-api/blob/media/preact-media-text.png +[media-example-list-quote]: https://github.com/Automattic/vip-block-data-api/blob/media/example-utility-quote-list.png +[media-example-utility-quote-list]: https://github.com/Automattic/vip-block-data-api/blob/media/example-list-quote.png [preact]: https://preactjs.com [repo-analytics]: src/analytics/analytics.php [repo-core-image-block-addition]: src/parser/block-additions/core-image.php diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 8c5ea1f9..e49199a4 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -19,6 +19,11 @@ class GraphQLApi { * @access private */ public static function init() { + /** + * Filter to enable/disable the graphQL API. By default, it is enabled. + * + * @param bool $is_graphql_to_be_enabled Whether the graphQL API should be enabled or not. + */ $is_graphql_to_be_enabled = apply_filters( 'vip_block_data_api__is_graphql_enabled', true ); if ( ! $is_graphql_to_be_enabled ) { @@ -47,6 +52,8 @@ public static function get_blocks_data( $post_model ) { // We need to not return a WP_Error object, and so a regular exception is returned. if ( is_wp_error( $parser_results ) ) { + Analytics::record_error( $parser_results ); + // Return API-safe error with extra data (e.g. stack trace) removed. return new \Exception( $parser_results->get_error_message() ); } diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index 076d5c4a..a63afe5c 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -106,6 +106,8 @@ public function should_block_be_included( $block, $block_name, $filter_options ) * @return array|WP_Error */ public function parse( $post_content, $post_id = null, $filter_options = [] ) { + Analytics::record_usage(); + if ( isset( $filter_options['exclude'] ) && isset( $filter_options['include'] ) ) { return new WP_Error( 'vip-block-data-api-invalid-params', 'Cannot provide blocks to exclude and include at the same time', [ 'status' => 400 ] ); } diff --git a/src/rest/rest-api.php b/src/rest/rest-api.php index f5b97795..a60142be 100644 --- a/src/rest/rest-api.php +++ b/src/rest/rest-api.php @@ -128,8 +128,6 @@ public static function get_block_content( $params ) { $post_id = $params['id']; $post = get_post( $post_id ); - Analytics::record_usage(); - $parse_time_start = microtime( true ); $content_parser = new ContentParser(); From 984f5193e2ce6f7f7b8595daf051456a5eb7febb Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Fri, 1 Dec 2023 16:49:44 +1100 Subject: [PATCH 27/45] tweak the table --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index ce431b57..8cd80f25 100644 --- a/README.md +++ b/README.md @@ -399,6 +399,9 @@ query NewQuery { } ``` + + + ```json { "data": { From 43560a8383753536556f9089560ab127ca4f7355 Mon Sep 17 00:00:00 2001 From: Gopal Krishnan Date: Mon, 4 Dec 2023 13:06:09 +1100 Subject: [PATCH 28/45] Update README.md Co-authored-by: Chris Zarate --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8cd80f25..089386c7 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ VIP Block Data API attribute sourcing animation -The Block Data API is an API for retrieving block editor posts structured as JSON data. This API is available as a REST, as well as a GraphQL API. While primarily designed for use in decoupled WordPress, the Block Data API can be used anywhere you want to represent block markup as structured data. +The Block Data API is an API for retrieving block editor posts structured as JSON data, with integrations for both the official WordPress REST API and WPGraphQL. While primarily designed for use in decoupled WordPress, the Block Data API can be used anywhere you want to represent block markup as structured data. This plugin is currently developed for use on WordPress sites hosted on the VIP Platform. From 9f03a0c53180e8ae39751da12af5fc09dff3c140 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Mon, 4 Dec 2023 15:52:31 +1100 Subject: [PATCH 29/45] Add the utility function --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/README.md b/README.md index 089386c7..6444cfd9 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ This plugin is currently developed for use on WordPress sites hosted on the VIP - [Example: Simple nested blocks: `core/list` and `core/quote`](#example-simple-nested-blocks-corelist-and-corequote) - [API Consumption](#api-consumption) - [Preact](#preact) + - [Utility functions to reconstruct the block hierarchy](#utility-functions-to-reconstruct-the-block-hierarchy) - [Limitations](#limitations) - [Client-side blocks](#client-side-blocks) - [Client-side example](#client-side-example) @@ -590,6 +591,65 @@ The code above produces this HTML from post data: ``` +### Utility functions to reconstruct the block hierarchy + +The purpose of these functions is to take the flattened `innerBlock` list under each root block, and reconstruct the block hierarchy. + +The logic is as follows: + +1. Go over each block given back. +2. Go over each block's `innerBlocks`. + * For each `innerBlock`, check if the `parentId` matches the `id` of the root block. + * If yes, add that `innerBlock` to a new list. + * If no, go over the newly constructed list and repeat step 2's logic as the block could be nested under another `innerBlock`. + +This logic has been split over two functions, with the core logic (steps 1, 2a, 2b) being in the function below and the recursive case (2c) being handled in the second function called `convertInnerBlocksToHierarchy`. + +```js +const blocks = payload.data?.post?.blocksData?.blocks; + +// Iterate over the blocks. +for (const block of blocks) { + // skip if the innerBlocks are not set. + if (!block.innerBlocks) { + continue; + } + // Get the innerBlocks. + const innerBlocks = block.innerBlocks; + // Create a new array to store the hierarchy. + let innerBlockHierarchy = []; + // Iterate over the innerBlocks and use the parentID and ID to reconstruct the hierarchy. + for (const innerBlock of innerBlocks) { + // If the innerBlock's parentId matches the block's id, add it to the hierarchy. + if (innerBlock.parentId === block.id) { + innerBlockHierarchy.push(innerBlock); + } else { + // Otherwise, use the recursive function to find the right parent. + convertInnerBlocksToHierarchy(innerBlock, innerBlockHierarchy); + } + } + + // Add the innerBlockHierarchy to the block. + block.innerBlocks = innerBlockHierarchy; +} +``` + +```js +function convertInnerBlocksToHierarchy( innerBlock, innerBlockHierarchy) { + // loop over the innerBlockHierarchy. + for (const innerBlockParent of innerBlockHierarchy) { + // If the innerBlock's parentId matches the innerBlockParent's id, add it to the hierarchy. + if (innerBlock.parentId === innerBlockParent.id) { + innerBlockParent.innerBlocks = innerBlockParent.innerBlocks || []; + innerBlockParent.innerBlocks.push(innerBlock); + // If the innerBlockParent has innerBlocks, loop over them and add it under it the right parent. + } else if (innerBlockParent.innerBlocks) { + convertInnerBlocksToHierarchy(innerBlock, innerBlockParent.innerBlocks); + } + } +} +``` + ## Limitations ### Client-side blocks From 0e63fe4515fd88c336b4d7ba26edcdb56555d5d5 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Mon, 4 Dec 2023 16:09:09 +1100 Subject: [PATCH 30/45] Add the utility function --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6444cfd9..0b375702 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This plugin is currently developed for use on WordPress sites hosted on the VIP - [Example: Simple nested blocks: `core/list` and `core/quote`](#example-simple-nested-blocks-corelist-and-corequote) - [API Consumption](#api-consumption) - [Preact](#preact) - - [Utility functions to reconstruct the block hierarchy](#utility-functions-to-reconstruct-the-block-hierarchy) + - [Utility function to reconstruct the block hierarchy](#utility-function-to-reconstruct-the-block-hierarchy) - [Limitations](#limitations) - [Client-side blocks](#client-side-blocks) - [Client-side example](#client-side-example) @@ -591,9 +591,9 @@ The code above produces this HTML from post data: ``` -### Utility functions to reconstruct the block hierarchy +### Utility function to reconstruct the block hierarchy -The purpose of these functions is to take the flattened `innerBlock` list under each root block, and reconstruct the block hierarchy. +The purpose of this function is to take the flattened `innerBlock` list under each root block, and reconstruct the block hierarchy. The logic is as follows: From 47f2efbb1a81406f59af35de2b787153d03cb0ca Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 7 Dec 2023 19:31:55 +1100 Subject: [PATCH 31/45] Re-write the graphQL generation separate from a filter --- README.md | 7 +- src/graphql/graphql-api.php | 190 +++++++++++----------- src/parser/block-additions/core-image.php | 4 +- src/parser/content-parser.php | 11 +- 4 files changed, 100 insertions(+), 112 deletions(-) diff --git a/README.md b/README.md index 0b375702..590d5354 100644 --- a/README.md +++ b/README.md @@ -1166,17 +1166,16 @@ Modify or add attributes to a block's output in the Block Data API. * @param string $post_id The post ID associated with the parsed block. * @param string $block The result of parse_blocks() for this block. * Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. - * @param array $filter_options Options to filter using, if any */ -$sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $post_id, $block, $filter_options ); +$sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $post_id, $block); ``` This is useful when block rendering requires attributes stored in post metadata or outside of a block's markup. This filter can be used to add attributes to any core or custom block. For example: ```php -add_filter( 'vip_block_data_api__sourced_block_result', 'add_custom_block_metadata', 10, 5 ); +add_filter( 'vip_block_data_api__sourced_block_result', 'add_custom_block_metadata', 10, 4 ); -function add_custom_block_metadata( $sourced_block, $block_name, $post_id, $block, $filter_options ) { +function add_custom_block_metadata( $sourced_block, $block_name, $post_id, $block ) { if ( 'wpvip/my-custom-block' !== $block_name ) { return $sourced_block; } diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index e49199a4..6a29bae9 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -7,6 +7,8 @@ namespace WPCOMVIP\BlockDataApi; +use GraphQLRelay\Relay; + defined( 'ABSPATH' ) || die(); /** @@ -14,24 +16,11 @@ */ class GraphQLApi { /** - * Initiatilize the graphQL API, if its allowed - * - * @access private + * Initiatilize the graphQL API by hooking into the graphql_register_types action, + * which only fires if WPGraphQL is installed and enabled, and is further controlled + * by the vip_block_data_api__is_graphql_enabled filter. */ public static function init() { - /** - * Filter to enable/disable the graphQL API. By default, it is enabled. - * - * @param bool $is_graphql_to_be_enabled Whether the graphQL API should be enabled or not. - */ - $is_graphql_to_be_enabled = apply_filters( 'vip_block_data_api__is_graphql_enabled', true ); - - if ( ! $is_graphql_to_be_enabled ) { - return; - } - - add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'transform_block_format' ], 10, 5 ); - add_action( 'graphql_register_types', [ __CLASS__, 'register_types' ] ); } @@ -41,14 +30,13 @@ public static function init() { * @param WPGraphQL\Model\Post $post_model Post model for post. * @return array */ - public static function get_blocks_data( $post_model ) { - $post_id = $post_model->ID; - $post = get_post( $post_id ); - $filter_options = [ 'graphQL' => true ]; + public static function get_blocks_data( \WPGraphQL\Model\Post $post_model ) { + $post_id = $post_model->ID; + $post = get_post( $post_id ); $content_parser = new ContentParser(); - $parser_results = $content_parser->parse( $post->post_content, $post_id, $filter_options ); + $parser_results = $content_parser->parse( $post->post_content, $post_id ); // We need to not return a WP_Error object, and so a regular exception is returned. if ( is_wp_error( $parser_results ) ) { @@ -58,73 +46,92 @@ public static function get_blocks_data( $post_model ) { return new \Exception( $parser_results->get_error_message() ); } + $parser_results['blocks'] = array_map(function ( $block ) { + return self::transform_block_format( $block ); + }, $parser_results['blocks'] ); + return $parser_results; } /** * Transform the block's format to the format expected by the graphQL API. * - * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. - * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. - * @param int $post_id Post ID associated with the parsed block. - * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. - * @param array $filter_options Options to filter using, if any. + * @param array $block An associative array of parsed block data with keys 'name' and 'attribute'. * * @return array */ - public static function transform_block_format( $sourced_block, $block_name, $post_id, $block, $filter_options ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed - if ( isset( $filter_options['graphQL'] ) && $filter_options['graphQL'] ) { + public static function transform_block_format( $block ) { + // Generate a unique ID for the block. + $block['id'] = Relay::toGlobalId( 'ID', wp_unique_id() ); - // Add the ID to the block, if it is not already there. - if ( ! isset( $sourced_block['id'] ) && isset( $filter_options['id'] ) ) { - $sourced_block['id'] = $filter_options['id']; - } - - // Flatten the inner blocks, if any. - if ( isset( $sourced_block['innerBlocks'] ) ) { - $sourced_block['innerBlocks'] = self::flatten_inner_blocks( $sourced_block['innerBlocks'], $filter_options ); - } + // Convert the attributes to be in the name-value format that the schema expects. + $block = self::map_attributes( $block ); - // Convert the attributes to be in the name-value format that the schema expects. - if ( isset( $sourced_block['attributes'] ) && ! empty( $sourced_block['attributes'] ) && ! isset( $sourced_block['attributes'][0]['name'] ) ) { - $sourced_block['attributes'] = array_map( - function ( $name, $value ) { - return [ - 'name' => $name, - 'value' => $value, - ]; - }, - array_keys( $sourced_block['attributes'] ), - array_values( $sourced_block['attributes'] ) - ); - } + // Flatten the inner blocks, if any. + if ( isset( $block['innerBlocks'] ) ) { + $block['innerBlocks'] = self::flatten_inner_blocks( $block['innerBlocks'], $block['id'] ); } - return $sourced_block; + return $block; + } + + /** + * Convert the attributes to be in the name-value format that the schema expects. + * + * @param array $block An associative array of parsed block data with keys 'name' and 'attribute'. + * + * @return array + */ + public static function map_attributes( $block ) { + // check if type of attributes is stdClass and unset it as that's not supported by graphQL. + if ( isset( $block['attributes'] ) && is_object( $block['attributes'] ) ) { + unset( $block['attributes'] ); + } elseif ( isset( $block['attributes'] ) && ! empty( $block['attributes'] ) ) { + $block['attributes'] = array_map( + function ( $name, $value ) { + return [ + 'name' => $name, + 'value' => $value, + ]; + }, + array_keys( $block['attributes'] ), + array_values( $block['attributes'] ) + ); + } + + return $block; } /** * Flatten the inner blocks, no matter how many levels of nesting is there. * - * @param array $inner_blocks the inner blocks in the block. - * @param array $filter_options Options to filter using, if any. - * @param array $flattened_blocks the flattened blocks that's built up as we go through the inner blocks. + * @param array $inner_blocks the inner blocks in the block. + * @param string $parent_id ID of the parent block, that the inner blocks belong to. + * @param array $flattened_blocks the flattened blocks that's built up as we go through the inner blocks. * * @return array */ - public static function flatten_inner_blocks( $inner_blocks, $filter_options, $flattened_blocks = [] ) { + public static function flatten_inner_blocks( $inner_blocks, $parent_id, $flattened_blocks = [] ) { foreach ( $inner_blocks as $inner_block ) { + // Generate a unique ID for the block. + $inner_block['id'] = Relay::toGlobalId( 'ID', wp_unique_id() ); + + // Convert the attributes to be in the name-value format that the schema expects. + $inner_block = self::map_attributes( $inner_block ); + + // Set the parentId to be the ID of the parent block whose inner blocks are being flattened. + $inner_block['parentId'] = $parent_id; + // This block doesnt have any inner blocks, so just add it to the flattened blocks. Ensure the parentId is set. if ( ! isset( $inner_block['innerBlocks'] ) ) { - $inner_block['parentId'] = $inner_block['parentId'] ?? $filter_options['parentId']; array_push( $flattened_blocks, $inner_block ); - // This block is a root block, so go through the inner blocks recursively. - } elseif ( ! isset( $inner_block['parentId'] ) ) { + // This block is has inner blocks, so go through the inner blocks recursively. + } else { $inner_blocks_copy = $inner_block['innerBlocks']; unset( $inner_block['innerBlocks'] ); - $inner_block['parentId'] = $inner_block['parentId'] ?? $filter_options['parentId']; + // first add the current block to the flattened blocks, and then go through the inner blocks recursively. array_push( $flattened_blocks, $inner_block ); - $flattened_blocks = self::flatten_inner_blocks( $inner_blocks_copy, $filter_options, $flattened_blocks ); + $flattened_blocks = self::flatten_inner_blocks( $inner_blocks_copy, $inner_block['id'], $flattened_blocks ); } } @@ -137,52 +144,35 @@ public static function flatten_inner_blocks( $inner_blocks, $filter_options, $fl * @return void */ public static function register_types() { + /** + * Filter to enable/disable the graphQL API. By default, it is enabled. + * + * @param bool $is_graphql_to_be_enabled Whether the graphQL API should be enabled or not. + */ + $is_graphql_to_be_enabled = apply_filters( 'vip_block_data_api__is_graphql_enabled', true ); + + if ( ! $is_graphql_to_be_enabled ) { + return; + } + // Register the type corresponding to the attributes of each individual block. register_graphql_object_type( - 'BlockDataAttribute', + 'BlockAttribute', [ - 'description' => 'Block data attribute', + 'description' => 'Block attribute', 'fields' => [ 'name' => [ - 'type' => 'String', + 'type' => [ 'non_null' => 'String' ], 'description' => 'Block data attribute name', ], 'value' => [ - 'type' => 'String', + 'type' => [ 'non_null' => 'String' ], 'description' => 'Block data attribute value', ], ], ], ); - // Register the type corresponding to the individual inner block, with the above attribute. - register_graphql_type( - 'InnerBlockData', - [ - 'description' => 'Block data', - 'fields' => [ - 'id' => [ - 'type' => 'String', - 'description' => 'ID of the block', - ], - 'parentId' => [ - 'type' => 'String', - 'description' => 'ID of the parent for this inner block, if it is an inner block. This will match the ID of the block', - ], - 'name' => [ - 'type' => 'String', - 'description' => 'Block name', - ], - 'attributes' => [ - 'type' => [ - 'list_of' => 'BlockDataAttribute', - ], - 'description' => 'Block data attributes', - ], - ], - ], - ); - // Register the type corresponding to the individual block, with the above attribute. register_graphql_type( 'BlockData', @@ -190,21 +180,25 @@ public static function register_types() { 'description' => 'Block data', 'fields' => [ 'id' => [ - 'type' => 'String', + 'type' => [ 'non_null' => 'ID' ], 'description' => 'ID of the block', ], + 'parentId' => [ + 'type' => 'ID', + 'description' => 'ID of the parent for this inner block, if it is an inner block. Otherwise, it will not be set. If it set, this will match the ID of the block', + ], 'name' => [ - 'type' => 'String', + 'type' => [ 'non_null' => 'String' ], 'description' => 'Block name', ], 'attributes' => [ 'type' => [ - 'list_of' => 'BlockDataAttribute', + 'list_of' => 'BlockAttribute', ], - 'description' => 'Block data attributes', + 'description' => 'Block attributes', ], 'innerBlocks' => [ - 'type' => [ 'list_of' => 'InnerBlockData' ], + 'type' => [ 'list_of' => 'BlockData' ], 'description' => 'Flattened list of inner blocks of this block', ], ], @@ -232,7 +226,7 @@ public static function register_types() { // Register the field on every post type that supports 'editor'. register_graphql_field( 'NodeWithContentEditor', - 'BlocksData', + 'blocksData', [ 'type' => 'BlocksData', 'description' => 'A block representation of post content', diff --git a/src/parser/block-additions/core-image.php b/src/parser/block-additions/core-image.php index 9a7a36fc..9da6a652 100644 --- a/src/parser/block-additions/core-image.php +++ b/src/parser/block-additions/core-image.php @@ -19,7 +19,7 @@ class CoreImage { * @access private */ public static function init() { - add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'add_image_metadata' ], 5, 5 ); + add_filter( 'vip_block_data_api__sourced_block_result', [ __CLASS__, 'add_image_metadata' ], 5, 2 ); } /** @@ -35,7 +35,7 @@ public static function init() { * * @return array Updated sourced block with new metadata information */ - public static function add_image_metadata( $sourced_block, $block_name, $post_id, $block, $filter_options ) { // phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed + public static function add_image_metadata( $sourced_block, $block_name ) { if ( 'core/image' !== $block_name ) { return $sourced_block; } diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index a63afe5c..647a2066 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -9,7 +9,6 @@ defined( 'ABSPATH' ) || die(); -use ArrayObject; use Throwable; use WP_Error; use WP_Block_Type; @@ -238,11 +237,8 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { 'attributes' => $block_attributes, ]; - $filter_options['id'] = wp_unique_id(); - if ( isset( $block['innerBlocks'] ) ) { - $filter_options['parentId'] = $filter_options['id']; - $inner_blocks = array_map( function ( $block ) use ( $registered_blocks, $filter_options ) { + $inner_blocks = array_map( function ( $block ) use ( $registered_blocks, $filter_options ) { return $this->source_block( $block, $registered_blocks, $filter_options ); }, $block['innerBlocks'] ); @@ -266,13 +262,12 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. * @param int $post_id Post ID associated with the parsed block. * @param array $block Result of parse_blocks() for this block. Contains 'blockName', 'attrs', 'innerHTML', and 'innerBlocks' keys. - * @param array $filter_options Options to filter using, if any. */ - $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block, $filter_options ); + $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block ); // If attributes are empty, explicitly use an ArrayObject to encode an empty json object in JSON. if ( empty( $sourced_block['attributes'] ) ) { - $sourced_block['attributes'] = new ArrayObject(); + $sourced_block['attributes'] = (object) []; } return $sourced_block; From 17000dbc8196debc4d6062bfda843c9e0302656b Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 7 Dec 2023 19:41:12 +1100 Subject: [PATCH 32/45] fix failures in tests --- src/parser/block-additions/core-image.php | 7 ++----- src/parser/content-parser.php | 4 ++-- tests/graphql/test-graphql-api.php | 4 +++- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/parser/block-additions/core-image.php b/src/parser/block-additions/core-image.php index 9da6a652..f4442488 100644 --- a/src/parser/block-additions/core-image.php +++ b/src/parser/block-additions/core-image.php @@ -25,11 +25,8 @@ public static function init() { /** * Add size metadata to core/image blocks * - * @param array $sourced_block Sourced block result. - * @param string $block_name Name of the block. - * @param int|null $post_id Id of the post. - * @param array $block Block being parsed. - * @param array $filter_options Options for the filter, if any. + * @param array $sourced_block Sourced block result. + * @param string $block_name Name of the block. * * @access private * diff --git a/src/parser/content-parser.php b/src/parser/content-parser.php index 647a2066..28af8a87 100644 --- a/src/parser/content-parser.php +++ b/src/parser/content-parser.php @@ -257,7 +257,7 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { /** * Filters a block when parsing is complete. - * + * * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. * @param string $block_name Name of the parsed block, e.g. 'core/paragraph'. * @param int $post_id Post ID associated with the parsed block. @@ -265,7 +265,7 @@ protected function source_block( $block, $registered_blocks, $filter_options ) { */ $sourced_block = apply_filters( 'vip_block_data_api__sourced_block_result', $sourced_block, $block_name, $this->post_id, $block ); - // If attributes are empty, explicitly use an ArrayObject to encode an empty json object in JSON. + // If attributes are empty, explicitly use an object to avoid encoding an empty array in JSON. if ( empty( $sourced_block['attributes'] ) ) { $sourced_block['attributes'] = (object) []; } diff --git a/tests/graphql/test-graphql-api.php b/tests/graphql/test-graphql-api.php index 3a065199..b7429f68 100644 --- a/tests/graphql/test-graphql-api.php +++ b/tests/graphql/test-graphql-api.php @@ -128,7 +128,9 @@ public function test_get_blocks_data() { 'post_content' => $html, ] ); - $blocks_data = GraphQLApi::get_blocks_data( $post ); + $graphQLPost = new \WPGraphQL\Model\Post( $post ); + + $blocks_data = GraphQLApi::get_blocks_data( $graphQLPost ); $this->assertEquals( $expected_blocks, $blocks_data ); } From 3c6cdd0af0fc5ba01eece7eba19278c159b93c20 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 7 Dec 2023 19:43:26 +1100 Subject: [PATCH 33/45] fix failures in tests --- src/graphql/graphql-api.php | 2 +- tests/graphql/test-graphql-api.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 6a29bae9..998af726 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -27,7 +27,7 @@ public static function init() { /** * Extract the blocks data for a post, and return back in the format expected by the graphQL API. * - * @param WPGraphQL\Model\Post $post_model Post model for post. + * @param \WPGraphQL\Model\Post $post_model Post model for post. * @return array */ public static function get_blocks_data( \WPGraphQL\Model\Post $post_model ) { diff --git a/tests/graphql/test-graphql-api.php b/tests/graphql/test-graphql-api.php index b7429f68..0e5b6a9c 100644 --- a/tests/graphql/test-graphql-api.php +++ b/tests/graphql/test-graphql-api.php @@ -128,9 +128,9 @@ public function test_get_blocks_data() { 'post_content' => $html, ] ); - $graphQLPost = new \WPGraphQL\Model\Post( $post ); + $wp_graphql_post = new \WPGraphQL\Model\Post( $post ); - $blocks_data = GraphQLApi::get_blocks_data( $graphQLPost ); + $blocks_data = GraphQLApi::get_blocks_data( $wp_graphql_post ); $this->assertEquals( $expected_blocks, $blocks_data ); } From 5bb603085d5fcd3a019caf9104b80cdfabe7aa86 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 7 Dec 2023 19:48:02 +1100 Subject: [PATCH 34/45] fix failures in tests --- src/graphql/graphql-api.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 998af726..62432c2d 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -28,9 +28,10 @@ public static function init() { * Extract the blocks data for a post, and return back in the format expected by the graphQL API. * * @param \WPGraphQL\Model\Post $post_model Post model for post. + * * @return array */ - public static function get_blocks_data( \WPGraphQL\Model\Post $post_model ) { + public static function get_blocks_data( $post_model ) { $post_id = $post_model->ID; $post = get_post( $post_id ); From e4acbf8e70c65a233a3d9421f0048006f001a008 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Thu, 7 Dec 2023 19:48:29 +1100 Subject: [PATCH 35/45] fix failures in tests --- tests/graphql/test-graphql-api.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/graphql/test-graphql-api.php b/tests/graphql/test-graphql-api.php index 0e5b6a9c..3a065199 100644 --- a/tests/graphql/test-graphql-api.php +++ b/tests/graphql/test-graphql-api.php @@ -128,9 +128,7 @@ public function test_get_blocks_data() { 'post_content' => $html, ] ); - $wp_graphql_post = new \WPGraphQL\Model\Post( $post ); - - $blocks_data = GraphQLApi::get_blocks_data( $wp_graphql_post ); + $blocks_data = GraphQLApi::get_blocks_data( $post ); $this->assertEquals( $expected_blocks, $blocks_data ); } From bd255c2fa82dfdc663627eb88644e65c2425911c Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Fri, 8 Dec 2023 10:15:42 +1100 Subject: [PATCH 36/45] Add a mock for a graphQL specific function --- tests/bootstrap.php | 2 ++ tests/mocks/graphql-relay-mock.php | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 tests/mocks/graphql-relay-mock.php diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 352e2466..c8d5f491 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -45,3 +45,5 @@ function _manually_load_plugin() { // Add custom test classes require_once __DIR__ . '/registry-test-case.php'; + +require_once __DIR__ . '/mocks/graphql-relay-mock.php'; \ No newline at end of file diff --git a/tests/mocks/graphql-relay-mock.php b/tests/mocks/graphql-relay-mock.php new file mode 100644 index 00000000..ee9950c1 --- /dev/null +++ b/tests/mocks/graphql-relay-mock.php @@ -0,0 +1,19 @@ + Date: Fri, 8 Dec 2023 10:19:20 +1100 Subject: [PATCH 37/45] fix linting --- tests/bootstrap.php | 2 +- tests/mocks/graphql-relay-mock.php | 24 +++++++++++++----------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index c8d5f491..f671ea52 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -46,4 +46,4 @@ function _manually_load_plugin() { // Add custom test classes require_once __DIR__ . '/registry-test-case.php'; -require_once __DIR__ . '/mocks/graphql-relay-mock.php'; \ No newline at end of file +require_once __DIR__ . '/mocks/graphql-relay-mock.php'; diff --git a/tests/mocks/graphql-relay-mock.php b/tests/mocks/graphql-relay-mock.php index ee9950c1..f7e695c3 100644 --- a/tests/mocks/graphql-relay-mock.php +++ b/tests/mocks/graphql-relay-mock.php @@ -5,15 +5,17 @@ // Ported over to mock out this functionality for tests. class Relay { - /** - * Takes a type name and an ID specific to that type name, and returns a - * "global ID" that is unique among all types. - * - * @param string $type - * @param string $id - * @return string - */ - public static function toGlobalId($type, $id) { - return "{$id}"; - } + /** + * Takes a type name and an ID specific to that type name, and returns a + * "global ID" that is unique among all types. + * + * @param string $type + * @param string $id + * @return string + * + * phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid + */ + public static function toGlobalId( $type, $id ) { + return "{$id}"; + } } From 272e92b509c6c6e59eaebaf9bf9beaae7d6d347e Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Fri, 8 Dec 2023 17:12:53 +1100 Subject: [PATCH 38/45] Add a flatten option for the innerblocks --- src/graphql/graphql-api.php | 39 ++++-- tests/graphql/test-graphql-api.php | 198 ++++++++++++++++++++++++++--- 2 files changed, 206 insertions(+), 31 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 62432c2d..872a825d 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -68,9 +68,10 @@ public static function transform_block_format( $block ) { // Convert the attributes to be in the name-value format that the schema expects. $block = self::map_attributes( $block ); - // Flatten the inner blocks, if any. - if ( isset( $block['innerBlocks'] ) ) { - $block['innerBlocks'] = self::flatten_inner_blocks( $block['innerBlocks'], $block['id'] ); + if ( isset( $block['innerBlocks'] ) && ! empty( $block['innerBlocks'] ) ) { + $block['innerBlocks'] = array_map( function ( $block ) { + return self::transform_block_format( $block ); + }, $block['innerBlocks'] ); } return $block; @@ -114,16 +115,10 @@ function ( $name, $value ) { */ public static function flatten_inner_blocks( $inner_blocks, $parent_id, $flattened_blocks = [] ) { foreach ( $inner_blocks as $inner_block ) { - // Generate a unique ID for the block. - $inner_block['id'] = Relay::toGlobalId( 'ID', wp_unique_id() ); + // Set the parentId to be the ID of the parent block whose inner blocks are being flattened. + $inner_block['parentId'] = $parent_id; - // Convert the attributes to be in the name-value format that the schema expects. - $inner_block = self::map_attributes( $inner_block ); - - // Set the parentId to be the ID of the parent block whose inner blocks are being flattened. - $inner_block['parentId'] = $parent_id; - - // This block doesnt have any inner blocks, so just add it to the flattened blocks. Ensure the parentId is set. + // This block doesnt have any inner blocks, so just add it to the flattened blocks. Ensure the parentId is set. if ( ! isset( $inner_block['innerBlocks'] ) ) { array_push( $flattened_blocks, $inner_block ); // This block is has inner blocks, so go through the inner blocks recursively. @@ -215,6 +210,26 @@ public static function register_types() { 'blocks' => [ 'type' => [ 'list_of' => 'BlockData' ], 'description' => 'List of blocks data', + 'args' => [ + 'flatten' => [ + 'type' => 'Boolean', + 'description' => 'Collate the inner blocks under each root block into a single list with a parent-child relationship. This is set to true by default, and setting it to false will reverse that to preserve the original block hierarchy, at the expense of knowing the exact depth when querying the inner blocks. Default: true', + ], + ], + 'resolve' => function ( $blocks, $args ) { + if ( ! isset( $args['flatten'] ) || true === $args['unflatten'] ) { + $blocks['blocks'] = array_map(function ( $block ) { + // Flatten the inner blocks, if any. + if ( isset( $block['innerBlocks'] ) ) { + $block['innerBlocks'] = self::flatten_inner_blocks( $block['innerBlocks'], $block['id'] ); + } + + return $block; + }, $blocks['blocks'] ); + } + + return $blocks['blocks']; + }, ], 'warnings' => [ 'type' => [ 'list_of' => 'String' ], diff --git a/tests/graphql/test-graphql-api.php b/tests/graphql/test-graphql-api.php index 3a065199..06838370 100644 --- a/tests/graphql/test-graphql-api.php +++ b/tests/graphql/test-graphql-api.php @@ -74,7 +74,6 @@ public function test_get_blocks_data() { ], 'innerBlocks' => [ [ - 'parentId' => '2', 'name' => 'core/paragraph', 'attributes' => [ array( @@ -89,9 +88,8 @@ public function test_get_blocks_data() { 'id' => '3', ], [ - 'parentId' => '2', - 'name' => 'core/quote', - 'attributes' => [ + 'name' => 'core/quote', + 'attributes' => [ array( 'name' => 'value', 'value' => '', @@ -101,22 +99,23 @@ public function test_get_blocks_data() { 'value' => '', ), ], - 'id' => '4', - ], - [ - 'parentId' => '4', - 'name' => 'core/heading', - 'attributes' => [ - array( - 'name' => 'content', - 'value' => 'This is a heading', - ), - array( - 'name' => 'level', - 'value' => '2', - ), + 'innerBlocks' => [ + [ + 'name' => 'core/heading', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'This is a heading', + ), + array( + 'name' => 'level', + 'value' => '2', + ), + ], + 'id' => '5', + ], ], - 'id' => '5', + 'id' => '4', ], ], 'id' => '2', @@ -132,4 +131,165 @@ public function test_get_blocks_data() { $this->assertEquals( $expected_blocks, $blocks_data ); } + + public function test_flatten_inner_blocks() { + $inner_blocks = [ + [ + 'name' => 'core/paragraph', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!', + ), + array( + 'name' => 'dropCap', + 'value' => '', + ), + ], + 'id' => '2', + ], + [ + 'name' => 'core/quote', + 'attributes' => [ + array( + 'name' => 'value', + 'value' => '', + ), + array( + 'name' => 'citation', + 'value' => '', + ), + ], + 'innerBlocks' => [ + [ + 'name' => 'core/paragraph', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'This is a heading inside a quote', + ), + array( + 'name' => 'dropCap', + 'value' => '', + ), + ], + 'id' => '4', + ], + [ + 'name' => 'core/quote', + 'attributes' => [ + array( + 'name' => 'value', + 'value' => '', + ), + array( + 'name' => 'citation', + 'value' => '', + ), + ], + 'innerBlocks' => [ + [ + 'name' => 'core/heading', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'This is a heading', + ), + array( + 'name' => 'level', + 'value' => '2', + ), + ], + 'id' => '6', + ], + ], + 'id' => '5', + ], + ], + 'id' => '3', + ], + ]; + + $expected_blocks = [ + [ + 'name' => 'core/paragraph', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'Welcome to WordPress. This is your first post. Edit or delete it, then start writing!', + ), + array( + 'name' => 'dropCap', + 'value' => '', + ), + ], + 'parentId' => '1', + 'id' => '2', + ], + [ + 'name' => 'core/quote', + 'attributes' => [ + array( + 'name' => 'value', + 'value' => '', + ), + array( + 'name' => 'citation', + 'value' => '', + ), + ], + 'id' => '3', + 'parentId' => '1', + ], + [ + 'name' => 'core/paragraph', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'This is a heading inside a quote', + ), + array( + 'name' => 'dropCap', + 'value' => '', + ), + ], + 'id' => '4', + 'parentId' => '3', + ], + [ + 'name' => 'core/quote', + 'attributes' => [ + array( + 'name' => 'value', + 'value' => '', + ), + array( + 'name' => 'citation', + 'value' => '', + ), + ], + 'id' => '5', + 'parentId' => '3', + ], + [ + 'name' => 'core/heading', + 'attributes' => [ + array( + 'name' => 'content', + 'value' => 'This is a heading', + ), + array( + 'name' => 'level', + 'value' => '2', + ), + ], + 'id' => '6', + 'parentId' => '5', + ], + ]; + + $flattened_blocks = GraphQLApi::flatten_inner_blocks( $inner_blocks, '1' ); + + $this->assertEquals( $expected_blocks, $flattened_blocks ); + } } From fac6ebf59e071e5db10234cabe951f7db1d4894f Mon Sep 17 00:00:00 2001 From: Alec Geatches Date: Mon, 11 Dec 2023 16:05:51 -0700 Subject: [PATCH 39/45] Address README feedback, standardize code spacing, update TOC --- README.md | 276 +++++++++++++++++++++++++++--------------------------- 1 file changed, 137 insertions(+), 139 deletions(-) diff --git a/README.md b/README.md index 590d5354..c35abfdc 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ This plugin is currently developed for use on WordPress sites hosted on the VIP ## Table of contents -- [Table of contents](#table-of-contents) - [Installation](#installation) - [Install on WordPress VIP](#install-on-wordpress-vip) - [Install via ZIP file](#install-via-zip-file) @@ -28,11 +27,11 @@ This plugin is currently developed for use on WordPress sites hosted on the VIP - [GraphQL](#graphql) - [Setup](#setup) - [Usage](#usage-1) - - [Examples](#examples-1) - - [Example: Simple nested blocks: `core/list` and `core/quote`](#example-simple-nested-blocks-corelist-and-corequote) + - [Block Attributes](#block-attributes) + - [Example: Simple nested blocks: `core/list` and `core/quote`](#example-simple-nested-blocks-corelist-and-corequote) - [API Consumption](#api-consumption) - [Preact](#preact) - - [Utility function to reconstruct the block hierarchy](#utility-function-to-reconstruct-the-block-hierarchy) + - [Block hierarchy reconstruction](#block-hierarchy-reconstruction) - [Limitations](#limitations) - [Client-side blocks](#client-side-blocks) - [Client-side example](#client-side-example) @@ -289,19 +288,17 @@ Examples of WordPress block markup and the associated data structure returned by ### GraphQL -The GraphQL API, requires some setup before it can be it can be used. +The GraphQL API requires some setup before it can be it can be used. #### Setup -The Block Data API integrates with **WP-GraphQL** to provide a GraphQL API as well. As a result, it is necessary to have WP-GraphQL installed, to activate the GraphQL API. To do so, follow the instructions mentioned [here](https://www.wpgraphql.com/docs/quick-start#install). +The Block Data API integrates with **WPGraphQL** to provide a GraphQL API. It is necessary to have [WPGraphQL installed and activated][wpgraphql-install]. -Once WP-GraphQL has been installed and setup, a new field called `blocksData` will show up under categories that support `ContentNodes` like posts, pages, etc. +Once WPGraphQL has been installed and setup, a new field called `blocksData` will be available for post types that provide content, like posts, pages, etc. #### Usage -The `blocksData` field would be the field through which block data would be returned under a category that supports it. - -An example of what a query would look like for a post: +The `blocksData` field provides block data for post types that support it. Here is an example query: ```graphQL query NewQuery { @@ -329,15 +326,28 @@ query NewQuery { } ``` -Here, the `id` and `parentId` fields are dynamically generated, unique IDs that help to identify parent-child relationships in the `innerBlocks` under a block, in the overall block structure.The resulting `innerBlocks` is a flattened list, that can be untangled using the combination of `id` and `parentId` fields. This is helpful in being able to give back a complicated nesting structure, without having any knowledge as to how deep this nesting goes. +Here, the `id` and `parentId` fields are dynamically generated, unique IDs that help to identify parent-child relationships in the `innerBlocks` under a block, in the overall block structure. The resulting `innerBlocks` is a flattened list that can be untangled using the combination of `id` and `parentId` fields. This is helpful in being able to give back a complicated nesting structure, without having any knowledge as to how deep this nesting goes. For more information on recreating `innerBlocks`, see [Block Hierarchy Reconstruction](#block-hierarchy-reconstruction). -In addition, the attributes of a block are a list of `name`, `value` pairs so as to avoid having to figure out the type of each block. This allows giving back any block's attributes. +#### Block Attributes -#### Examples +The attributes of a block in GraphQL are available in a list of `name` / `value` string pairs, e.g. -Examples of WordPress block markup and the associated data structure returned by the Block Data API. +```js +"attributes": [ + { + "name": "content", + "value": "This is item 1 in the list", + }, + { + "name": "fontSize", + "value": "small" + } +] +``` -##### Example: Simple nested blocks: `core/list` and `core/quote` +This is used instead of a key-value structure. This is a trade-off that makes it easy to retrieve block attributes without specifying the the block type ahead of time, but attribute type information is lost. + +#### Example: Simple nested blocks: `core/list` and `core/quote` ![List and Quote block in editor][media-example-list-quote] @@ -406,81 +416,81 @@ query NewQuery { ```json { "data": { - "post": { - "blocksData": { - "blocks": [ + "post": { + "blocksData": { + "blocks": [ + { + "attributes": [ + { + "name": "ordered", + "value": "" + }, + { + "name": "values", + "value": "" + } + ], + "id": "1", + "name": "core/list", + "innerBlocks": [ + { + "id": "2", + "name": "core/list-item", + "parentId": "1", + "attributes": [ + { + "name": "content", + "value": "This is item 1 in the list" + } + ] + }, + { + "id": "3", + "name": "core/list-item", + "parentId": "1", + "attributes": [ + { + "name": "content", + "value": "This is item 2 in the list" + } + ] + } + ] + }, + { + "attributes": [ + { + "name": "value", + "value": "" + }, + { + "name": "citation", + "value": "" + } + ], + "id": "4", + "name": "core/quote", + "innerBlocks": [ + { + "id": "5", + "name": "core/paragraph", + "parentId": "4", + "attributes": [ { - "attributes": [ - { - "name": "ordered", - "value": "" - }, - { - "name": "values", - "value": "" - } - ], - "id": "1", - "name": "core\/list", - "innerBlocks": [ - { - "id": "2", - "name": "core\/list-item", - "parentId": "1", - "attributes": [ - { - "name": "content", - "value": "This is item 1 in the list" - } - ] - }, - { - "id": "3", - "name": "core\/list-item", - "parentId": "1", - "attributes": [ - { - "name": "content", - "value": "This is item 2 in the list" - } - ] - } - ] + "name": "content", + "value": "This is a paragraph within a quote" }, { - "attributes": [ - { - "name": "value", - "value": "" - }, - { - "name": "citation", - "value": "" - } - ], - "id": "4", - "name": "core\/quote", - "innerBlocks": [ - { - "id": "5", - "name": "core\/paragraph", - "parentId": "4", - "attributes": [ - { - "name": "content", - "value": "This is a paragraph within a quote" - }, - { - "name": "dropCap", - "value": "" - } - ] - } - ] + "name": "dropCap", + "value": "" } - ] + ] + } + ] } + ] } + } } } ``` @@ -591,14 +601,14 @@ The code above produces this HTML from post data: ``` -### Utility function to reconstruct the block hierarchy +### Block hierarchy reconstruction -The purpose of this function is to take the flattened `innerBlock` list under each root block, and reconstruct the block hierarchy. +The purpose of this function is to take the flattened `innerBlocks` list under each root block, and reconstruct the block hierarchy. The logic is as follows: -1. Go over each block given back. -2. Go over each block's `innerBlocks`. +1. Loop through each block. +2. Loop through each block's `innerBlocks`: * For each `innerBlock`, check if the `parentId` matches the `id` of the root block. * If yes, add that `innerBlock` to a new list. * If no, go over the newly constructed list and repeat step 2's logic as the block could be nested under another `innerBlock`. @@ -606,47 +616,45 @@ The logic is as follows: This logic has been split over two functions, with the core logic (steps 1, 2a, 2b) being in the function below and the recursive case (2c) being handled in the second function called `convertInnerBlocksToHierarchy`. ```js -const blocks = payload.data?.post?.blocksData?.blocks; +const blocks = payload.data?.post?.blocksData?.blocks ?? []; // Iterate over the blocks. for (const block of blocks) { - // skip if the innerBlocks are not set. - if (!block.innerBlocks) { - continue; - } - // Get the innerBlocks. - const innerBlocks = block.innerBlocks; - // Create a new array to store the hierarchy. - let innerBlockHierarchy = []; - // Iterate over the innerBlocks and use the parentID and ID to reconstruct the hierarchy. - for (const innerBlock of innerBlocks) { - // If the innerBlock's parentId matches the block's id, add it to the hierarchy. - if (innerBlock.parentId === block.id) { - innerBlockHierarchy.push(innerBlock); - } else { - // Otherwise, use the recursive function to find the right parent. - convertInnerBlocksToHierarchy(innerBlock, innerBlockHierarchy); - } + // skip if the innerBlocks are not set. + if (!block.innerBlocks) { + continue; + } + + // Get the innerBlocks. + const innerBlocks = block.innerBlocks; + // Create a new array to store the hierarchy. + let innerBlockHierarchy = []; + // Iterate over the innerBlocks and use the parentID and ID to reconstruct the hierarchy. + for (const innerBlock of innerBlocks) { + // If the innerBlock's parentId matches the block's id, add it to the hierarchy. + if (innerBlock.parentId === block.id) { + innerBlockHierarchy.push(innerBlock); + } else { + // Otherwise, use the recursive function to find the right parent. + convertInnerBlocksToHierarchy(innerBlock, innerBlockHierarchy); } + } - // Add the innerBlockHierarchy to the block. - block.innerBlocks = innerBlockHierarchy; + // Add the innerBlockHierarchy to the block. + block.innerBlocks = innerBlockHierarchy; } -``` -```js function convertInnerBlocksToHierarchy( innerBlock, innerBlockHierarchy) { - // loop over the innerBlockHierarchy. - for (const innerBlockParent of innerBlockHierarchy) { - // If the innerBlock's parentId matches the innerBlockParent's id, add it to the hierarchy. - if (innerBlock.parentId === innerBlockParent.id) { - innerBlockParent.innerBlocks = innerBlockParent.innerBlocks || []; - innerBlockParent.innerBlocks.push(innerBlock); - // If the innerBlockParent has innerBlocks, loop over them and add it under it the right parent. - } else if (innerBlockParent.innerBlocks) { - convertInnerBlocksToHierarchy(innerBlock, innerBlockParent.innerBlocks); - } + for (const innerBlockParent of innerBlockHierarchy) { + // If the innerBlock's parentId matches the innerBlockParent's id, add it to the hierarchy. + if (innerBlock.parentId === innerBlockParent.id) { + innerBlockParent.innerBlocks = innerBlockParent.innerBlocks || []; + innerBlockParent.innerBlocks.push(innerBlock); + // If the innerBlockParent has innerBlocks, loop over them and add it under it the right parent. + } else if (innerBlockParent.innerBlocks) { + convertInnerBlocksToHierarchy(innerBlock, innerBlockParent.innerBlocks); } + } } ``` @@ -1025,21 +1033,11 @@ Note that custom block filter rules can also be created in code via [the `vip_bl ### GraphQL -```php -/** - * Filter to enable/disable the graphQL API. By default, it is enabled. - * - * @param bool $is_graphql_to_be_enabled Whether the graphQL API should be enabled or not. -*/ -apply_filters( 'vip_block_data_api__is_graphql_enabled', true ); -``` - -To disable the GraphQL API, the following can be done: +By default, the VIP Block Data API enables GraphQL integration automatically if WPGraphQL is activated. To disable this behavior, use the `vip_block_data_api__is_graphql_enabled` filter: ```php -add_filter( 'vip_block_data_api__is_graphql_enabled', function( ) { - return false; -}, 10, 1); +// Disable GraphQL integration +add_filter( 'vip_block_data_api__is_graphql_enabled', '__return_false', 10, 1 ); ``` ### REST @@ -1161,7 +1159,7 @@ Modify or add attributes to a block's output in the Block Data API. /** * Filters a block when parsing is complete. * - * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attribute'. + * @param array $sourced_block An associative array of parsed block data with keys 'name' and 'attributes'. * @param string $block_name The name of the parsed block, e.g. 'core/paragraph'. * @param string $post_id The post ID associated with the parsed block. * @param string $block The result of parse_blocks() for this block. @@ -1198,7 +1196,7 @@ For another example of how this filter can be used to extend block data, we have The plugin records two data points for analytics, on VIP sites: 1. A usage metric when the `/wp-json/vip-block-data-api` REST API is used to retrive block data. This analytic data simply is a counter, and includes no information about the post's content or metadata. It will only include the customer site ID to associate the usage. - + 2. When an error occurs from within the plugin on the [WordPress VIP][wpvip] platform. This is used to identify issues with customers for private follow-up. Both of these data points are a counter that is incremented, and do not contain any other telemetry or sensitive data. You can see what's being [collected in code here][repo-analytics], and WPVIP's privacy policy [here](https://wpvip.com/privacy/). @@ -1287,12 +1285,12 @@ composer run test [media-example-caption-plain]: https://github.com/Automattic/vip-block-data-api/blob/media/example-caption-plain.png [media-example-caption-rich-text]: https://github.com/Automattic/vip-block-data-api/blob/media/example-caption-rich-text.png [media-example-heading-paragraph]: https://github.com/Automattic/vip-block-data-api/blob/media/example-header-paragraph.png +[media-example-list-quote]: https://github.com/Automattic/vip-block-data-api/blob/media/example-utility-quote-list.png [media-example-media-text]: https://github.com/Automattic/vip-block-data-api/blob/media/example-media-text.png [media-example-pullquote]: https://github.com/Automattic/vip-block-data-api/blob/media/example-pullquote.png +[media-example-utility-quote-list]: https://github.com/Automattic/vip-block-data-api/blob/media/example-list-quote.png [media-plugin-activate]: https://github.com/Automattic/vip-block-data-api/blob/media/plugin-activate.png [media-preact-media-text]: https://github.com/Automattic/vip-block-data-api/blob/media/preact-media-text.png -[media-example-list-quote]: https://github.com/Automattic/vip-block-data-api/blob/media/example-utility-quote-list.png -[media-example-utility-quote-list]: https://github.com/Automattic/vip-block-data-api/blob/media/example-list-quote.png [preact]: https://preactjs.com [repo-analytics]: src/analytics/analytics.php [repo-core-image-block-addition]: src/parser/block-additions/core-image.php @@ -1311,10 +1309,10 @@ composer run test [wordpress-release-5-0]: https://wordpress.org/documentation/wordpress-version/version-5-0/ [wordpress-rest-api-posts]: https://developer.wordpress.org/rest-api/reference/posts/ [wp-env]: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/ -[wpvip]: https://wpvip.com/ +[wpgraphql-install]: https://www.wpgraphql.com/docs/quick-start#install [wpvip-mu-plugins-block-data-api]: https://docs.wpvip.com/technical-references/vip-go-mu-plugins/block-data-api-plugin/ [wpvip-page-cache]: https://docs.wpvip.com/technical-references/caching/page-cache/ [wpvip-plugin-activate]: https://docs.wpvip.com/how-tos/activate-plugins-through-code/ [wpvip-plugin-submodules]: https://docs.wpvip.com/technical-references/plugins/installing-plugins-best-practices/#h-submodules [wpvip-plugin-subtrees]: https://docs.wpvip.com/technical-references/plugins/installing-plugins-best-practices/#h-subtrees -[wpvip]: https://wpvip.com/ \ No newline at end of file +[wpvip]: https://wpvip.com/ From d578fe470a0ae1248eb0198b682ef76d886bf3ff Mon Sep 17 00:00:00 2001 From: Alec Geatches Date: Mon, 11 Dec 2023 16:09:22 -0700 Subject: [PATCH 40/45] Add minor spacing and documentation changes --- src/graphql/graphql-api.php | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 872a825d..9de65f84 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -16,8 +16,8 @@ */ class GraphQLApi { /** - * Initiatilize the graphQL API by hooking into the graphql_register_types action, - * which only fires if WPGraphQL is installed and enabled, and is further controlled + * Initiatilize the graphQL API by hooking into the graphql_register_types action, + * which only fires if WPGraphQL is installed and enabled, and is further controlled * by the vip_block_data_api__is_graphql_enabled filter. */ public static function init() { @@ -28,7 +28,7 @@ public static function init() { * Extract the blocks data for a post, and return back in the format expected by the graphQL API. * * @param \WPGraphQL\Model\Post $post_model Post model for post. - * + * * @return array */ public static function get_blocks_data( $post_model ) { @@ -57,7 +57,7 @@ public static function get_blocks_data( $post_model ) { /** * Transform the block's format to the format expected by the graphQL API. * - * @param array $block An associative array of parsed block data with keys 'name' and 'attribute'. + * @param array $block An associative array of parsed block data with keys 'name' and 'attributes'. * * @return array */ @@ -80,7 +80,7 @@ public static function transform_block_format( $block ) { /** * Convert the attributes to be in the name-value format that the schema expects. * - * @param array $block An associative array of parsed block data with keys 'name' and 'attribute'. + * @param array $block An associative array of parsed block data with keys 'name' and 'attributes'. * * @return array */ @@ -110,22 +110,23 @@ function ( $name, $value ) { * @param array $inner_blocks the inner blocks in the block. * @param string $parent_id ID of the parent block, that the inner blocks belong to. * @param array $flattened_blocks the flattened blocks that's built up as we go through the inner blocks. - * + * * @return array */ public static function flatten_inner_blocks( $inner_blocks, $parent_id, $flattened_blocks = [] ) { foreach ( $inner_blocks as $inner_block ) { - // Set the parentId to be the ID of the parent block whose inner blocks are being flattened. - $inner_block['parentId'] = $parent_id; + // Set the parentId to be the ID of the parent block whose inner blocks are being flattened. + $inner_block['parentId'] = $parent_id; - // This block doesnt have any inner blocks, so just add it to the flattened blocks. Ensure the parentId is set. if ( ! isset( $inner_block['innerBlocks'] ) ) { + // This block doesnt have any inner blocks, so just add it to the flattened blocks. array_push( $flattened_blocks, $inner_block ); - // This block is has inner blocks, so go through the inner blocks recursively. } else { + // This block is has inner blocks, so go through the inner blocks recursively. $inner_blocks_copy = $inner_block['innerBlocks']; unset( $inner_block['innerBlocks'] ); - // first add the current block to the flattened blocks, and then go through the inner blocks recursively. + + // First add the current block to the flattened blocks, and then go through the inner blocks recursively. array_push( $flattened_blocks, $inner_block ); $flattened_blocks = self::flatten_inner_blocks( $inner_blocks_copy, $inner_block['id'], $flattened_blocks ); } @@ -142,7 +143,7 @@ public static function flatten_inner_blocks( $inner_blocks, $parent_id, $flatten public static function register_types() { /** * Filter to enable/disable the graphQL API. By default, it is enabled. - * + * * @param bool $is_graphql_to_be_enabled Whether the graphQL API should be enabled or not. */ $is_graphql_to_be_enabled = apply_filters( 'vip_block_data_api__is_graphql_enabled', true ); @@ -181,7 +182,7 @@ public static function register_types() { ], 'parentId' => [ 'type' => 'ID', - 'description' => 'ID of the parent for this inner block, if it is an inner block. Otherwise, it will not be set. If it set, this will match the ID of the block', + 'description' => 'ID of the parent for this inner block, if it is an inner block. Otherwise, it will be null.', ], 'name' => [ 'type' => [ 'non_null' => 'String' ], @@ -213,12 +214,12 @@ public static function register_types() { 'args' => [ 'flatten' => [ 'type' => 'Boolean', - 'description' => 'Collate the inner blocks under each root block into a single list with a parent-child relationship. This is set to true by default, and setting it to false will reverse that to preserve the original block hierarchy, at the expense of knowing the exact depth when querying the inner blocks. Default: true', + 'description' => 'Collate the inner blocks under each root block into a single list with a parent-child relationship. This is set to true by default, and setting it to false will preserve the original block hierarchy, but will require nested inner block queries to the desired depth. Default: true', ], ], 'resolve' => function ( $blocks, $args ) { - if ( ! isset( $args['flatten'] ) || true === $args['unflatten'] ) { - $blocks['blocks'] = array_map(function ( $block ) { + if ( ! isset( $args['flatten'] ) || true === $args['flatten'] ) { + $blocks['blocks'] = array_map( function ( $block ) { // Flatten the inner blocks, if any. if ( isset( $block['innerBlocks'] ) ) { $block['innerBlocks'] = self::flatten_inner_blocks( $block['innerBlocks'], $block['id'] ); From 8cdc1e209fb2688dc0930e53ba1e5f0733da18b5 Mon Sep 17 00:00:00 2001 From: Alec Geatches Date: Tue, 12 Dec 2023 13:51:55 -0700 Subject: [PATCH 41/45] Explicitly strval block attribute values --- src/graphql/graphql-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 9de65f84..efe927cb 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -93,7 +93,7 @@ public static function map_attributes( $block ) { function ( $name, $value ) { return [ 'name' => $name, - 'value' => $value, + 'value' => strval( $value ), ]; }, array_keys( $block['attributes'] ), From 90c77dedc6472b01e70226dfd4529b358a011fd4 Mon Sep 17 00:00:00 2001 From: Alec Geatches Date: Tue, 12 Dec 2023 16:58:12 -0700 Subject: [PATCH 42/45] Add note about mocked integer ID values in README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index c35abfdc..e425e7b8 100644 --- a/README.md +++ b/README.md @@ -499,6 +499,8 @@ query NewQuery { +Note that `id` values returned from GraphQL will be alpha-numeric strings, e.g. `"id": "SUQ6MQ=="` and not integers. + ## API Consumption ### Preact From a64af6d179e6ff194bd0e2aa264e31fc3362da34 Mon Sep 17 00:00:00 2001 From: ingeniumed Date: Wed, 13 Dec 2023 12:48:55 +1100 Subject: [PATCH 43/45] add a mention of the flatten paramter --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index e425e7b8..99994c6d 100644 --- a/README.md +++ b/README.md @@ -328,6 +328,33 @@ query NewQuery { Here, the `id` and `parentId` fields are dynamically generated, unique IDs that help to identify parent-child relationships in the `innerBlocks` under a block, in the overall block structure. The resulting `innerBlocks` is a flattened list that can be untangled using the combination of `id` and `parentId` fields. This is helpful in being able to give back a complicated nesting structure, without having any knowledge as to how deep this nesting goes. For more information on recreating `innerBlocks`, see [Block Hierarchy Reconstruction](#block-hierarchy-reconstruction). +This behaviour can be changed by passing in `flatten: false`. This would give back the same block hierarchy as shown in the block editor, without the `parentId` being set. In addition, the correct depth would need to be requested in the query so that the entire block hierarchy can be given back. By default, `flatten` is set to true and so can be skipped if flattenining the innerBlocks is the intended behaviour. The same query above, would now look like: + +```graphQL +query NewQuery { + post(id: "1", idType: DATABASE_ID) { + blocksData { + blocks(flatten: false) { + id + name + attributes { + name + value + } + innerBlocks { + attributes { + name + value + } + name + id + } + } + } + } +} +``` + #### Block Attributes The attributes of a block in GraphQL are available in a list of `name` / `value` string pairs, e.g. From 6e2c3677cb02fcacebe67604a6ff0a78662ef3b1 Mon Sep 17 00:00:00 2001 From: Alec Geatches Date: Wed, 13 Dec 2023 10:59:54 -0700 Subject: [PATCH 44/45] Incorporate post ID into GraphQL relay IDs to prevent cache collisions --- src/graphql/graphql-api.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index efe927cb..659cd333 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -47,8 +47,8 @@ public static function get_blocks_data( $post_model ) { return new \Exception( $parser_results->get_error_message() ); } - $parser_results['blocks'] = array_map(function ( $block ) { - return self::transform_block_format( $block ); + $parser_results['blocks'] = array_map( function ( $block ) use ( $post_id ) { + return self::transform_block_format( $block, $post_id ); }, $parser_results['blocks'] ); return $parser_results; @@ -57,20 +57,21 @@ public static function get_blocks_data( $post_model ) { /** * Transform the block's format to the format expected by the graphQL API. * - * @param array $block An associative array of parsed block data with keys 'name' and 'attributes'. + * @param array $block An associative array of parsed block data with keys 'name' and 'attributes'. + * @param array $post_id The associated post ID for the content being transformed. Used to produce unique block IDs. * * @return array */ - public static function transform_block_format( $block ) { + public static function transform_block_format( $block, $post_id ) { // Generate a unique ID for the block. - $block['id'] = Relay::toGlobalId( 'ID', wp_unique_id() ); + $block['id'] = Relay::toGlobalId( 'BlockData', sprintf( "%d:%d", $post_id, wp_unique_id() ) ); // Convert the attributes to be in the name-value format that the schema expects. $block = self::map_attributes( $block ); if ( isset( $block['innerBlocks'] ) && ! empty( $block['innerBlocks'] ) ) { - $block['innerBlocks'] = array_map( function ( $block ) { - return self::transform_block_format( $block ); + $block['innerBlocks'] = array_map( function ( $block ) use ( $post_id ) { + return self::transform_block_format( $block, $post_id ); }, $block['innerBlocks'] ); } From f89ed3c742e8d56dd4cda55056dc738422ffa33e Mon Sep 17 00:00:00 2001 From: Alec Geatches Date: Wed, 13 Dec 2023 11:09:38 -0700 Subject: [PATCH 45/45] Fix linting errors, make Relay mock return more deterministic numbers --- src/graphql/graphql-api.php | 2 +- tests/mocks/graphql-relay-mock.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/graphql/graphql-api.php b/src/graphql/graphql-api.php index 659cd333..33da566e 100644 --- a/src/graphql/graphql-api.php +++ b/src/graphql/graphql-api.php @@ -64,7 +64,7 @@ public static function get_blocks_data( $post_model ) { */ public static function transform_block_format( $block, $post_id ) { // Generate a unique ID for the block. - $block['id'] = Relay::toGlobalId( 'BlockData', sprintf( "%d:%d", $post_id, wp_unique_id() ) ); + $block['id'] = Relay::toGlobalId( 'BlockData', sprintf( '%d:%d', $post_id, wp_unique_id() ) ); // Convert the attributes to be in the name-value format that the schema expects. $block = self::map_attributes( $block ); diff --git a/tests/mocks/graphql-relay-mock.php b/tests/mocks/graphql-relay-mock.php index f7e695c3..d0b6eabb 100644 --- a/tests/mocks/graphql-relay-mock.php +++ b/tests/mocks/graphql-relay-mock.php @@ -4,6 +4,7 @@ // Ported over to mock out this functionality for tests. class Relay { + public static $current_id = 0; /** * Takes a type name and an ID specific to that type name, and returns a @@ -12,10 +13,12 @@ class Relay { * @param string $type * @param string $id * @return string - * + * * phpcs:disable WordPress.NamingConventions.ValidFunctionName.MethodNameInvalid + * phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundAfterLastUsed */ public static function toGlobalId( $type, $id ) { - return "{$id}"; + ++self::$current_id; + return strval( self::$current_id ); } }